32 h = max(0.0f,
min(1.0f,h));
33 s = max(0.0f,
min(1.0f,
s));
34 v = max(0.0f,
min(1.0f,
v));
36 int Hi = ((int)floor(h *6)) % 6;
40 float t =
v*(1-(1-f)*
s);
44 case 0:
r=
v;
g=
t;
b=
p;
break;
45 case 1:
r=
q;
g=
v;
b=
p;
break;
46 case 2:
r=
p;
g=
v;
b=
t;
break;
47 case 3:
r=
p;
g=
q;
b=
v;
break;
48 case 4:
r=
t;
g=
p;
b=
v;
break;
49 case 5:
r=
v;
g=
p;
b=
q;
break;
65 r = max(0.0f,
min(1.0f,
r));
66 g = max(0.0f,
min(1.0f,
g));
67 b = max(0.0f,
min(1.0f,
b));
81 h = (
g-
b)/(6*(Max-Min));
82 else h = 1-(
g-
b)/(6*(Max-Min));
86 h = 1/3.0f + (
b-
r)/(6*(Max-Min));
87 else h = 2/3.0f + (
r-
g)/(6*(Max-Min));
103 const float color_index,
115 r =
g =
b = color_index;
131 static bool jet_table_done =
false;
132 static Eigen::VectorXf jet_r,jet_g,jet_b;
138 jet_table_done =
true;
141 double JET_R[] = { 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.062500,0.125000,0.187500,0.250000,0.312500,0.375000,0.437500,0.500000,0.562500,0.625000,0.687500,0.750000,0.812500,0.875000,0.937500,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.937500,0.875000,0.812500,0.750000,0.687500,0.625000,0.562500,0.500000 };
142 double JET_G[] = { 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.062500,0.125000,0.187500,0.250000,0.312500,0.375000,0.437500,0.500000,0.562500,0.625000,0.687500,0.750000,0.812500,0.875000,0.937500,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.937500,0.875000,0.812500,0.750000,0.687500,0.625000,0.562500,0.500000,0.437500,0.375000,0.312500,0.250000,0.187500,0.125000,0.062500,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000 };
143 double JET_B[] = { 0.562500,0.625000,0.687500,0.750000,0.812500,0.875000,0.937500,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.937500,0.875000,0.812500,0.750000,0.687500,0.625000,0.562500,0.500000,0.437500,0.375000,0.312500,0.250000,0.187500,0.125000,0.062500,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000 };
144 const size_t N =
sizeof(JET_B)/
sizeof(JET_B[0]);
149 for (
size_t i=0;i<N;i++)
165 static bool table_done =
false;
166 static Eigen::VectorXf hot_r, hot_g, hot_b;
174 double HOT_R[] = { 0.041667,0.083333,0.125000,0.166667,0.208333,0.250000,0.291667,0.333333,0.375000,0.416667,0.458333,0.500000,0.541667,0.583333,0.625000,0.666667,0.708333,0.750000,0.791667,0.833333,0.875000,0.916667,0.958333,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000 };
175 double HOT_G[] = { 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.041667,0.083333,0.125000,0.166667,0.208333,0.250000,0.291667,0.333333,0.375000,0.416667,0.458333,0.500000,0.541667,0.583333,0.625000,0.666667,0.708333,0.750000,0.791667,0.833333,0.875000,0.916667,0.958333,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000 };
176 double HOT_B[] = { 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.062500,0.125000,0.187500,0.250000,0.312500,0.375000,0.437500,0.500000,0.562500,0.625000,0.687500,0.750000,0.812500,0.875000,0.937500,1.000000 };
177 const size_t N =
sizeof(HOT_B) /
sizeof(HOT_B[0]);
182 for (
size_t i = 0; i<N; i++)
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
const T min3(const T &A, const T &B, const T &C)
TColormap
Different colormaps for use in mrpt::utils::colormap()
#define THROW_EXCEPTION(msg)
GLdouble GLdouble GLdouble GLdouble q
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...
void BASE_IMPEXP 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.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLdouble GLdouble GLdouble r
void BASE_IMPEXP 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...
void BASE_IMPEXP 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...
const T max3(const T &A, const T &B, const T &C)
void BASE_IMPEXP 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 BASE_IMPEXP 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].