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>
|
static Color | getColor (const unsigned int cycles, const PValue &min, const PValue &max, const PValue &value) |
|
template<typename PValue, int DefaultCycles = 1>
class DGtal::HueShadeColorMap< PValue, DefaultCycles >
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.
#include "DGtal/io/Color.h"
#include "HueShadeColorMap.h"
{
Color red = hueShade(1.0f);
Color lightBlue1 = hueShade(0.5f);
}
Structure representing an RGB triple with alpha component.
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
static Color getColor(const unsigned int cycles, const PValue &min, const PValue &max, const PValue &value)
- Template Parameters
-
PValue | The type of the range values. |
DefaultCycles | The default number of cycles (used as a default parameter by the constructor). |
- Examples
- geometry/volumes/distance/distancetransform2D.cpp, geometry/volumes/distance/exampleFMM2D.cpp, geometry/volumes/distance/toricdomainvolumetric.cpp, geometry/volumes/distance/voronoimap2D.cpp, graph/graphTraversal.cpp, graph/volDistanceTraversal.cpp, images/exampleConstImageAdapter.cpp, images/exampleTiledImage.cpp, io/viewers/viewer3D-8-2DSliceImages.cpp, io/viewers/viewer3D-9-3Dimages.cpp, and topology/volBreadthFirstTraversal.cpp.
Definition at line 90 of file HueShadeColorMap.h.
◆ Value
template<typename PValue , int DefaultCycles = 1>
◆ HueShadeColorMap() [1/3]
template<typename PValue , int DefaultCycles = 1>
DGtal::HueShadeColorMap< PValue, DefaultCycles >::HueShadeColorMap |
( |
const PValue & | min, |
|
|
const PValue & | max, |
|
|
const unsigned int | cycles = DefaultCycles ) |
Constructor.
- Parameters
-
min | The lower bound of the value range. |
max | The upper bound of the value range. |
cycles | The number of cycles in the colormap. |
◆ ~HueShadeColorMap()
template<typename PValue , int DefaultCycles = 1>
◆ HueShadeColorMap() [2/3]
template<typename PValue , int DefaultCycles = 1>
Copy constructor.
- Parameters
-
other | the object to clone. |
◆ HueShadeColorMap() [3/3]
template<typename PValue , int DefaultCycles = 1>
Constructor. Forbidden by default (protected to avoid g++ warnings).
◆ getColor()
template<typename PValue , int DefaultCycles = 1>
static Color DGtal::HueShadeColorMap< PValue, DefaultCycles >::getColor |
( |
const unsigned int | cycles, |
|
|
const PValue & | min, |
|
|
const PValue & | max, |
|
|
const PValue & | value ) |
|
static |
Computes the color associated with a value in a given range.
- Parameters
-
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. |
- Returns
- A color whose hue linearly depends on the position of [value] within the range [min]..[max].
◆ isValid()
template<typename PValue , int DefaultCycles = 1>
Checks the validity/consistency of the object.
- Returns
- 'true' if the object is valid, 'false' otherwise.
◆ max()
template<typename PValue , int DefaultCycles = 1>
Returns the upper bound of the value range.
- Returns
- The upper bound of the value range.
◆ min()
template<typename PValue , int DefaultCycles = 1>
Returns the lower bound of the value range.
- Returns
- The lower bound of the value range.
◆ operator()()
template<typename PValue , int DefaultCycles = 1>
Computes the color associated with a value in a given range.
- Parameters
-
value | A value within the value range. |
- Returns
- A color whose hue linearly depends on the position of [value] within the current range.
◆ operator=()
template<typename PValue , int DefaultCycles = 1>
Assignment.
- Parameters
-
- Returns
- a reference on 'this'.
◆ selfDisplay()
template<typename PValue , int DefaultCycles = 1>
Writes/Displays the object on an output stream.
- Parameters
-
out | the output stream where the object is written. |
◆ setCycles()
template<typename PValue , int DefaultCycles = 1>
Sets the number of cycles of hue shade.
- Parameters
-
◆ myCycles
template<typename PValue , int DefaultCycles = 1>
◆ myMax
template<typename PValue , int DefaultCycles = 1>
◆ myMin
template<typename PValue , int DefaultCycles = 1>
The documentation for this class was generated from the following file: