23 float h,
float s,
float v,
float&
r,
float&
g,
float&
b)
26 h = max(0.0f,
min(1.0f, h));
27 s = max(0.0f,
min(1.0f,
s));
28 v = max(0.0f,
min(1.0f,
v));
30 int Hi = ((int)floor(h * 6)) % 6;
31 float f = (h * 6) - Hi;
32 float p =
v * (1 -
s);
33 float q =
v * (1 - f *
s);
34 float t =
v * (1 - (1 - f) *
s);
75 float r,
float g,
float b,
float& h,
float&
s,
float&
v)
78 r = max(0.0f,
min(1.0f,
r));
79 g = max(0.0f,
min(1.0f,
g));
80 b = max(0.0f,
min(1.0f,
b));
94 h = (
g -
b) / (6 * (Max - Min));
96 h = 1 - (
g -
b) / (6 * (Max - Min));
99 h = 1 / 3.0f + (
b -
r) / (6 * (Max - Min));
101 h = 2 / 3.0f + (
r -
g) / (6 * (Max - Min));
116 const TColormap& color_map,
const float color_index,
float&
r,
float&
g,
126 r =
g =
b = color_index;
142 static bool jet_table_done =
false;
143 static Eigen::VectorXf jet_r, jet_g, jet_b;
148 jet_table_done =
true;
152 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
153 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
154 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
155 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
156 0.062500, 0.125000, 0.187500, 0.250000, 0.312500, 0.375000,
157 0.437500, 0.500000, 0.562500, 0.625000, 0.687500, 0.750000,
158 0.812500, 0.875000, 0.937500, 1.000000, 1.000000, 1.000000,
159 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
160 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
161 1.000000, 1.000000, 0.937500, 0.875000, 0.812500, 0.750000,
162 0.687500, 0.625000, 0.562500, 0.500000};
164 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
165 0.000000, 0.000000, 0.062500, 0.125000, 0.187500, 0.250000,
166 0.312500, 0.375000, 0.437500, 0.500000, 0.562500, 0.625000,
167 0.687500, 0.750000, 0.812500, 0.875000, 0.937500, 1.000000,
168 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
169 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
170 1.000000, 1.000000, 1.000000, 1.000000, 0.937500, 0.875000,
171 0.812500, 0.750000, 0.687500, 0.625000, 0.562500, 0.500000,
172 0.437500, 0.375000, 0.312500, 0.250000, 0.187500, 0.125000,
173 0.062500, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
174 0.000000, 0.000000, 0.000000, 0.000000};
176 0.562500, 0.625000, 0.687500, 0.750000, 0.812500, 0.875000,
177 0.937500, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
178 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
179 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
180 0.937500, 0.875000, 0.812500, 0.750000, 0.687500, 0.625000,
181 0.562500, 0.500000, 0.437500, 0.375000, 0.312500, 0.250000,
182 0.187500, 0.125000, 0.062500, 0.000000, 0.000000, 0.000000,
183 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
184 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
185 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
186 0.000000, 0.000000, 0.000000, 0.000000};
187 const size_t N =
sizeof(JET_B) /
sizeof(JET_B[0]);
192 for (
size_t i = 0; i < N; i++)
208 static bool table_done =
false;
209 static Eigen::VectorXf hot_r, hot_g, hot_b;
218 0.041667, 0.083333, 0.125000, 0.166667, 0.208333, 0.250000,
219 0.291667, 0.333333, 0.375000, 0.416667, 0.458333, 0.500000,
220 0.541667, 0.583333, 0.625000, 0.666667, 0.708333, 0.750000,
221 0.791667, 0.833333, 0.875000, 0.916667, 0.958333, 1.000000,
222 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
223 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
224 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
225 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
226 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
227 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
228 1.000000, 1.000000, 1.000000, 1.000000};
230 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
231 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
232 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
233 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
234 0.041667, 0.083333, 0.125000, 0.166667, 0.208333, 0.250000,
235 0.291667, 0.333333, 0.375000, 0.416667, 0.458333, 0.500000,
236 0.541667, 0.583333, 0.625000, 0.666667, 0.708333, 0.750000,
237 0.791667, 0.833333, 0.875000, 0.916667, 0.958333, 1.000000,
238 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
239 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000,
240 1.000000, 1.000000, 1.000000, 1.000000};
242 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
243 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
244 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
245 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
246 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
247 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
248 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
249 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
250 0.062500, 0.125000, 0.187500, 0.250000, 0.312500, 0.375000,
251 0.437500, 0.500000, 0.562500, 0.625000, 0.687500, 0.750000,
252 0.812500, 0.875000, 0.937500, 1.000000};
253 const size_t N =
sizeof(HOT_B) /
sizeof(HOT_B[0]);
258 for (
size_t i = 0; i < N; i++)
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
void rgb2hsv(float r, float g, float b, float &h, float &s, float &v)
Transform RGB color components to HSV, all of them in the range [0,1].
void hsv2rgb(float h, float s, float v, float &r, float &g, float &b)
Transform HSV color components to RGB, all of them in the range [0,1].
void jet2rgb(const float color_index, float &r, float &g, float &b)
Computes the RGB color components (range [0,1]) for the corresponding color index in the range [0,...
TColormap
Different colormaps for use in mrpt::utils::colormap()
void colormap(const TColormap &color_map, const float color_index, float &r, float &g, float &b)
Transform a float number in the range [0,1] into RGB components.
void hot2rgb(const float color_index, float &r, float &g, float &b)
Computes the RGB color components (range [0,1]) for the corresponding color index in the range [0,...
@ cmHOT
[New in MRPT 1.5.0]
T interpolate(const T &x, const VECTOR &ys, const T &x0, const T &x1)
Interpolate a data sequence "ys" ranging from "x0" to "x1" (equally spaced), to obtain the approximat...
#define THROW_EXCEPTION(msg)
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
const T max3(const T &A, const T &B, const T &C)
const T min3(const T &A, const T &B, const T &C)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.