DGtal
0.6.devel
|
#include <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.
|
inline |
Constructor.
min | The lower bound of the value range. |
max | The upper bound of the value range. |
Definition at line 43 of file GrayscaleColorMap.ih.
|
inline |
|
inline |
Copy constructor.
other | the object to clone. |
Definition at line 51 of file GrayscaleColorMap.ih.
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
inlinestatic |
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. |
Definition at line 133 of file GrayscaleColorMap.ih.
Referenced by DGtal::GrayscaleColorMap< PValue >::operator()().
|
inline |
Checks the validity/consistency of the object.
Definition at line 124 of file GrayscaleColorMap.ih.
|
inline |
Returns the upper bound of the value range.
Definition at line 89 of file GrayscaleColorMap.ih.
|
inline |
Returns the lower bound of the value range.
Definition at line 81 of file GrayscaleColorMap.ih.
|
inline |
Computes the gray level associated with a value in a given range.
value | A value within the value range. |
Definition at line 97 of file GrayscaleColorMap.ih.
References DGtal::GrayscaleColorMap< PValue >::getColor().
GrayscaleColorMap< Value > & GrayscaleColorMap::operator= | ( | const GrayscaleColorMap< PValue > & | other | ) |
Assignment.
other | the object to copy. |
Definition at line 65 of file GrayscaleColorMap.ih.
References DGtal::GrayscaleColorMap< PValue >::myMax, and DGtal::GrayscaleColorMap< PValue >::myMin.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 109 of file GrayscaleColorMap.ih.
|
protected |
The lower bound of the value range.
Definition at line 195 of file GrayscaleColorMap.h.
Referenced by DGtal::GrayscaleColorMap< PValue >::operator=().
|
protected |
The lower bound of the value range.
Definition at line 194 of file GrayscaleColorMap.h.
Referenced by DGtal::GrayscaleColorMap< PValue >::operator=().