DGtal
1.5.beta
|
Aim: This class template may be used to (linearly) convert scalar values in a given range into a color in a cyclic hue shade colormap, maybe aka rainbow color map. This color map is suitable, for example, to colorize distance functions. By default, only one hue cycle is used. More...
#include <DGtal/io/colormaps/HueShadeColorMap.h>
Public Types | |
typedef PValue | Value |
Public Member Functions | |
HueShadeColorMap (const PValue &min, const PValue &max, const unsigned int cycles=DefaultCycles) | |
Color | operator() (const PValue &value) const |
~HueShadeColorMap () | |
HueShadeColorMap (const HueShadeColorMap &other) | |
HueShadeColorMap & | operator= (const HueShadeColorMap &other) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
const PValue & | min () const |
const PValue & | max () const |
void | setCycles (int cycles) |
Static Public Member Functions | |
static Color | getColor (const unsigned int cycles, const PValue &min, const PValue &max, const PValue &value) |
Protected Member Functions | |
HueShadeColorMap () | |
Protected Attributes | |
PValue | myMin |
PValue | myMax |
unsigned int | myCycles |
Aim: This class template may be used to (linearly) convert scalar values in a given range into a color in a cyclic hue shade colormap, maybe aka rainbow color map. This color map is suitable, for example, to colorize distance functions. By default, only one hue cycle is used.
Description of template class 'HueShadeColorMap'
The HueShadeColorMap 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. |
DefaultCycles | The default number of cycles (used as a default parameter by the constructor). |
Definition at line 90 of file HueShadeColorMap.h.
typedef PValue DGtal::HueShadeColorMap< PValue, DefaultCycles >::Value |
Definition at line 95 of file HueShadeColorMap.h.
DGtal::HueShadeColorMap< PValue, DefaultCycles >::HueShadeColorMap | ( | const PValue & | min, |
const PValue & | max, | ||
const unsigned int | cycles = DefaultCycles |
||
) |
Constructor.
min | The lower bound of the value range. |
max | The upper bound of the value range. |
cycles | The number of cycles in the colormap. |
DGtal::HueShadeColorMap< PValue, DefaultCycles >::~HueShadeColorMap | ( | ) |
Destructor.
DGtal::HueShadeColorMap< PValue, DefaultCycles >::HueShadeColorMap | ( | const HueShadeColorMap< PValue, DefaultCycles > & | other | ) |
Copy constructor.
other | the object to clone. |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
static |
Computes the color associated with a value in a given range.
cycles | The number of (rainbow) cycles. |
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::HueShadeColorMap< PValue, DefaultCycles >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
const PValue& DGtal::HueShadeColorMap< PValue, DefaultCycles >::max | ( | ) | const |
Returns the upper bound of the value range.
const PValue& DGtal::HueShadeColorMap< PValue, DefaultCycles >::min | ( | ) | const |
Returns the lower bound of the value range.
Color DGtal::HueShadeColorMap< PValue, DefaultCycles >::operator() | ( | const PValue & | value | ) | const |
Computes the color associated with a value in a given range.
value | A value within the value range. |
HueShadeColorMap& DGtal::HueShadeColorMap< PValue, DefaultCycles >::operator= | ( | const HueShadeColorMap< PValue, DefaultCycles > & | other | ) |
Assignment.
other | the object to copy. |
void DGtal::HueShadeColorMap< PValue, DefaultCycles >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::HueShadeColorMap< PValue, DefaultCycles >::setCycles | ( | int | cycles | ) |
Sets the number of cycles of hue shade.
cycles | Number of cycles. |
|
protected |
The number of cycles in the color map.
Definition at line 204 of file HueShadeColorMap.h.
|
protected |
The lower bound of the value range.
Definition at line 203 of file HueShadeColorMap.h.
|
protected |
The lower bound of the value range.
Definition at line 202 of file HueShadeColorMap.h.