DGtal
1.5.beta
|
Aim: This class template may be used to (linearly) convert scalar values in a given range into gray levels. More...
#include <DGtal/io/colormaps/GrayscaleColorMap.h>
Public Types | |
typedef PValue | Value |
Public Member Functions | |
GrayscaleColorMap (const PValue &min, const PValue &max) | |
Color | operator() (const PValue &value) const |
~GrayscaleColorMap () | |
GrayscaleColorMap (const GrayscaleColorMap &other) | |
GrayscaleColorMap & | operator= (const GrayscaleColorMap &other) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
const PValue & | min () const |
const PValue & | max () const |
Static Public Member Functions | |
static Color | getColor (const PValue &min, const PValue &max, const PValue &value) |
Protected Member Functions | |
GrayscaleColorMap () | |
Protected Attributes | |
PValue | myMin |
PValue | myMax |
Aim: This class template may be used to (linearly) convert scalar values in a given range into gray levels.
Description of template class 'GrayscaleColorMap'
The GrayscaleColorMap can be used either as a functor object (the value range is given at the object's construction) which converts a value into a Color structure, or it can be used through a static method taking both the range and the value as parameters.
The code below shows a possible use of this class.
PValue | The type of the range values. |
Definition at line 93 of file GrayscaleColorMap.h.
typedef PValue DGtal::GrayscaleColorMap< PValue >::Value |
Definition at line 98 of file GrayscaleColorMap.h.
DGtal::GrayscaleColorMap< PValue >::GrayscaleColorMap | ( | const PValue & | min, |
const PValue & | max | ||
) |
Constructor.
min | The lower bound of the value range. |
max | The upper bound of the value range. |
DGtal::GrayscaleColorMap< PValue >::~GrayscaleColorMap | ( | ) |
Destructor.
DGtal::GrayscaleColorMap< PValue >::GrayscaleColorMap | ( | const GrayscaleColorMap< PValue > & | other | ) |
Copy constructor.
other | the object to clone. |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
static |
Computes the gray level associated with a value in a given range.
min | The lower bound of the value range. |
max | The upper bound of the value range. |
value | A value within the value range. |
bool DGtal::GrayscaleColorMap< PValue >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
const PValue& DGtal::GrayscaleColorMap< PValue >::max | ( | ) | const |
Returns the upper bound of the value range.
const PValue& DGtal::GrayscaleColorMap< PValue >::min | ( | ) | const |
Returns the lower bound of the value range.
Color DGtal::GrayscaleColorMap< PValue >::operator() | ( | const PValue & | value | ) | const |
Computes the gray level associated with a value in a given range.
value | A value within the value range. |
GrayscaleColorMap& DGtal::GrayscaleColorMap< PValue >::operator= | ( | const GrayscaleColorMap< PValue > & | other | ) |
Assignment.
other | the object to copy. |
void DGtal::GrayscaleColorMap< PValue >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
protected |
The lower bound of the value range.
Definition at line 195 of file GrayscaleColorMap.h.
|
protected |
The lower bound of the value range.
Definition at line 194 of file GrayscaleColorMap.h.