codac 1.5.6
Loading...
Searching...
No Matches
codac_ColorMap.h
Go to the documentation of this file.
1
12#ifndef __CODAC_COLORMAP_H__
13#define __CODAC_COLORMAP_H__
14
15#include "codac_colors.h"
16#include "codac_Trajectory.h"
17
18namespace codac
19{
25 enum class InterpolMode { RGB, HSV };
26
32 {
33 public:
34
41 ColorMap(InterpolMode interpol_mode = InterpolMode::RGB);
42
47
54 const ColorMap& operator=(const ColorMap& x);
55
62 void add_color_point(rgb color, float index);
63
70 void add_color_point(hsv color, float index);
71
75 void reverse();
76
82 void set_opacity(float alpha);
83
89 bool is_opaque() const;
90
100 rgb color(double r) const;
101
112 rgb color(double t, const Trajectory& f) const;
113
119 void displayColorMap(const std::string& fig_name = "Color map") const;
120
121 static const ColorMap HAXBY;
122 static const ColorMap DEFAULT;
123 static const ColorMap BLUE_TUBE;
124 static const ColorMap RED_TUBE;
125 static const ColorMap RAINBOW;
126
127
128 protected:
129
130 InterpolMode m_interpol_mode = InterpolMode::RGB;
131 std::map<float,rgb> m_colormap;
132 };
133}
134
135#endif
Associates colors to a range of values.
Definition codac_ColorMap.h:32
ColorMap(InterpolMode interpol_mode=InterpolMode::RGB)
Creates a color map.
const ColorMap & operator=(const ColorMap &x)
Returns a copy of a ColorMap.
static const ColorMap HAXBY
predefined HAXBY color map (mainly used for DEM)
Definition codac_ColorMap.h:121
void displayColorMap(const std::string &fig_name="Color map") const
Creates a VIBesFig with the colors of the map.
static const ColorMap RED_TUBE
a predefined color map for tubes
Definition codac_ColorMap.h:124
void reverse()
Reverses the keys of the color map.
std::map< float, rgb > m_colormap
map of colors
Definition codac_ColorMap.h:131
void add_color_point(hsv color, float index)
Adds a HSV color point to the map.
rgb color(double t, const Trajectory &f) const
Evaluates the color map at , .
void add_color_point(rgb color, float index)
Adds a RGB color point to the map.
InterpolMode m_interpol_mode
interpolation mode
Definition codac_ColorMap.h:130
static const ColorMap RAINBOW
a predefined color map
Definition codac_ColorMap.h:125
bool is_opaque() const
Returns true of all colors are opaque.
~ColorMap()
ColorMap destructor.
Definition codac_ColorMap.h:46
void set_opacity(float alpha)
Sets a constant opacity to all colors of the map.
static const ColorMap DEFAULT
a predefined default color map
Definition codac_ColorMap.h:122
static const ColorMap BLUE_TUBE
a predefined color map for tubes
Definition codac_ColorMap.h:123
rgb color(double r) const
Evaluates the color map at , .
One dimensional trajectory , defined as a temporal map of values.
Definition codac_Trajectory.h:35
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition codac_capd_helpers.h:9
InterpolMode
Defines in which color space (HSV, RGB) the color interpolation will be made.
Definition codac_ColorMap.h:25
Represents an HSV value.
Definition codac_colors.h:36
Represents an RGB value.
Definition codac_colors.h:24