Associates colors to a range of values.
More...
#include <codac_ColorMap.h>
Associates colors to a range of values.
◆ ColorMap()
codac::ColorMap::ColorMap |
( |
InterpolMode |
interpol_mode = InterpolMode::RGB | ) |
|
Creates a color map.
- Parameters
-
interpol_mode | mode defining in which color space the color interpolation will be made (RGB by default) |
◆ operator=()
Returns a copy of a ColorMap.
- Parameters
-
- Returns
- a new ColorMap object with same values
◆ add_color_point() [1/2]
void codac::ColorMap::add_color_point |
( |
rgb |
color, |
|
|
float |
index |
|
) |
| |
Adds a RGB color point to the map.
- Parameters
-
color | RGB color to be added |
index | key associated to the color (any float value) |
◆ add_color_point() [2/2]
void codac::ColorMap::add_color_point |
( |
hsv |
color, |
|
|
float |
index |
|
) |
| |
Adds a HSV color point to the map.
- Parameters
-
color | HSV color to be added |
index | key associated to the color (any float value) |
◆ set_opacity()
void codac::ColorMap::set_opacity |
( |
float |
alpha | ) |
|
Sets a constant opacity to all colors of the map.
- Parameters
-
alpha | opacity value, between 0. (transparent) and 1. (opaque) |
◆ is_opaque()
bool codac::ColorMap::is_opaque |
( |
| ) |
const |
Returns true
of all colors are opaque.
- Returns
- opacity test of the map
◆ color() [1/2]
rgb codac::ColorMap::color |
( |
double |
r | ) |
const |
Evaluates the color map at \(r\), \(r\in[0,1]\).
If r
is not a key of the map, an interpolation is made to compute the corresponding color, according to the selected mode.
- Parameters
-
- Returns
- an RGB color
◆ color() [2/2]
rgb codac::ColorMap::color |
( |
double |
t, |
|
|
const Trajectory & |
f |
|
) |
| const |
Evaluates the color map at \(f(t)\), \(t\in[t_0,t_f]\).
If \(f(t)\) is not a key of the map, an interpolation is made to compute the corresponding color, according to the selected mode.
- Parameters
-
t | input, between 0 and 1 |
f | the trajectory function |
- Returns
- an RGB color
◆ displayColorMap()
void codac::ColorMap::displayColorMap |
( |
const std::string & |
fig_name = "Color map" | ) |
const |
Creates a VIBesFig with the colors of the map.
- Parameters
-
fig_name | a reference to the figure that will be displayed in the window's title |
The documentation for this class was generated from the following file: