|
DGtal 2.0.0
|
Aim: This class template may be used to (linearly) convert scalar values in a given range into a color with given lightness. More...
#include <DGtal/io/colormaps/ColorBrightnessColorMap.h>
Public Types | |
| typedef PValue | Value |
Public Member Functions | |
| ColorBrightnessColorMap (const PValue &min, const PValue &max, const Color color=Color(DGTAL_RED_COMPONENT(PDefaultColor), DGTAL_GREEN_COMPONENT(PDefaultColor), DGTAL_BLUE_COMPONENT(PDefaultColor))) | |
| Color | operator() (const PValue &value) const |
| ~ColorBrightnessColorMap () | |
| ColorBrightnessColorMap (const ColorBrightnessColorMap &other) | |
| ColorBrightnessColorMap & | operator= (const ColorBrightnessColorMap &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 Color color, const PValue &min, const PValue &max, const PValue &value) |
Protected Member Functions | |
| ColorBrightnessColorMap () | |
Protected Attributes | |
| PValue | myMin |
| PValue | myMax |
| Color | myColor |
Aim: This class template may be used to (linearly) convert scalar values in a given range into a color with given lightness.
Description of template class 'ColorBrightnessColorMap'
The ColorBrightnessColorMap can be used either as a functor object (the value range is given at the object's construction, together with the reference color) which converts a value into a LibBoard::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. |
| PDefaultColor | The default color as an integer built using the DGTAL_RGB2INT macro. |
Definition at line 89 of file ColorBrightnessColorMap.h.
| typedef PValue DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::Value |
Definition at line 93 of file ColorBrightnessColorMap.h.
| DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::ColorBrightnessColorMap | ( | const PValue & | min, |
| const PValue & | max, | ||
| const Color | color = Color(DGTAL_RED_COMPONENT(PDefaultColor), DGTAL_GREEN_COMPONENT(PDefaultColor), DGTAL_BLUE_COMPONENT(PDefaultColor)) ) |
Constructor.
| min | The lower bound of the value range. |
| max | The upper bound of the value range. |
| color | The color associated with the upper bound. |
Referenced by ColorBrightnessColorMap(), and operator=().
| DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::~ColorBrightnessColorMap | ( | ) |
Destructor.
| DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::ColorBrightnessColorMap | ( | const ColorBrightnessColorMap< PValue, PDefaultColor > & | other | ) |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
static |
Computes the color associated with a value in a given range.
| color | The color associated with the upper bound. |
| 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::ColorBrightnessColorMap< PValue, PDefaultColor >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
| const PValue & DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::max | ( | ) | const |
Returns the upper bound of the value range.
Referenced by ColorBrightnessColorMap(), and getColor().
| const PValue & DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::min | ( | ) | const |
Returns the lower bound of the value range.
Referenced by ColorBrightnessColorMap(), and getColor().
| Color DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::operator() | ( | const PValue & | value | ) | const |
| ColorBrightnessColorMap & DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::operator= | ( | const ColorBrightnessColorMap< PValue, PDefaultColor > & | other | ) |
Assignment.
| other | the object to copy. |
References ColorBrightnessColorMap().
| void DGtal::ColorBrightnessColorMap< PValue, PDefaultColor >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
| out | the output stream where the object is written. |
|
protected |
The color of the upper bound value.
Definition at line 197 of file ColorBrightnessColorMap.h.
|
protected |
The lower bound of the value range.
Definition at line 196 of file ColorBrightnessColorMap.h.
|
protected |
The lower bound of the value range.
Definition at line 195 of file ColorBrightnessColorMap.h.