CB-Pastel2.h
Go to the documentation of this file.
1
/**
2
* This file was automatically created with "create_c++_header.sh".
3
* Do not edit manually.
4
*/
5
#pragma once
6
#include "../../colormap.h"
7
8
namespace
colormap
9
{
10
namespace
IDL
11
{
12
13
class
CBPastel2
:
public
Colormap
14
{
15
private
:
16
class
Wrapper :
public
WrapperBase
17
{
18
public
:
19
#ifdef float
20
#error "TODO"
21
#endif
22
#define float local_real_t
23
#include "../../../../shaders/glsl/IDL_CB-Pastel2.frag"
24
#undef float
25
};
26
27
public
:
28
Color
29
getColor
(
double
x)
const override
30
{
31
Wrapper w;
32
vec4
c
= w.colormap(x);
33
Color
result;
34
result.
r
=
std::max
(0.0,
std::min
(1.0,
c
.r));
35
result.
g
=
std::max
(0.0,
std::min
(1.0,
c
.g));
36
result.
b
=
std::max
(0.0,
std::min
(1.0,
c
.b));
37
result.
a
=
std::max
(0.0,
std::min
(1.0,
c
.a));
38
return
result;
39
}
40
41
std::string
42
getTitle
()
const override
43
{
44
return
std::string(
"CB-Pastel2"
);
45
}
46
47
std::string
48
getCategory
()
const override
49
{
50
return
std::string(
"IDL"
);
51
}
52
53
std::string
54
getSource
()
const override
55
{
56
return
std::string(
57
"float colormap_red(float x) {\n"
58
" if (x < 0.1414470427532423) {\n"
59
" return 5.23716927453769E+02 * x + 1.79102418207681E+02;\n"
60
" } else if (x < 0.2832126252873305) {\n"
61
" return -3.55011583011593E+02 * x + 3.03395967395968E+02;\n"
62
" } else if (x < 0.4293789173286286) {\n"
63
" return 2.81737389211071E+02 * x + 1.23060619323778E+02;\n"
64
" } else if (x < 0.5703484841123749) {\n"
65
" return -9.85406162465110E+01 * x + 2.86343977591045E+02;\n"
66
" } else if (x < 0.7170614267751989) {\n"
67
" return 1.69092460881909E+02 * x + 1.33699857752520E+02;\n"
68
" } else if (x < 0.859829619768543) {\n"
69
" return -9.94710581026121E+01 * x + 3.26276397855329E+02;\n"
70
" } else {\n"
71
" return -2.57056149732620E+02 * x + 4.61772727272750E+02;\n"
72
" }\n"
73
"}\n"
74
"\n"
75
"float colormap_green(float x) {\n"
76
" if (x < 0.1411063922737659) {\n"
77
" return -1.49220483641537E+02 * x + 2.26007112375533E+02;\n"
78
" } else if (x < 0.2816283290590322) {\n"
79
" return 5.77629343629288E+01 * x + 1.96800429000430E+02;\n"
80
" } else if (x < 0.4291887492428612) {\n"
81
" return -7.38876244665610E+01 * x + 2.33876955903267E+02;\n"
82
" } else if (x < 0.571830104540257) {\n"
83
" return 3.01873399715509E+02 * x + 7.26045519203479E+01;\n"
84
" } else if (x < 0.7190262682310248) {\n"
85
" return -2.25206477732972E+01 * x + 2.58102834008109E+02;\n"
86
" } else if (x < 0.8491803538380496) {\n"
87
" return -1.16468292682893E+02 * x + 3.25653658536549E+02;\n"
88
" } else {\n"
89
" return -1.44447728516695E+02 * x + 3.49413245758086E+02;\n"
90
" }\n"
91
"}\n"
92
"\n"
93
"float colormap_blue(float x) {\n"
94
" if (x < 0.1425168965591466) {\n"
95
" return -2.26903238866400E+02 * x + 2.04742307692308E+02;\n"
96
" } else if (x < 0.2851292529683606) {\n"
97
" return 4.18120091673021E+02 * x + 1.12815584415585E+02;\n"
98
" } else if (x < 0.4319360871262316) {\n"
99
" return -3.09335813546247E+01 * x + 2.40853922748656E+02;\n"
100
" } else if (x < 0.7146533590447866) {\n"
101
" return -1.88956299440485E+02 * x + 3.09109637275714E+02;\n"
102
" } else if (x < 0.8619542566532371) {\n"
103
" return 2.06196082722327E+02 * x + 2.67126600285119E+01;\n"
104
" } else {\n"
105
" return -6.48097784562050E+00 * x + 2.10030557677552E+02;\n"
106
" }\n"
107
"}\n"
108
"\n"
109
"vec4 colormap(float x) {\n"
110
" float r = clamp(colormap_red(x) / 255.0, 0.0, 1.0);\n"
111
" float g = clamp(colormap_green(x) / 255.0, 0.0, 1.0);\n"
112
" float b = clamp(colormap_blue(x) / 255.0, 0.0, 1.0);\n"
113
" return vec4(r, g, b, 1.0);\n"
114
"}\n"
);
115
}
116
};
117
118
}
// namespace IDL
119
}
// namespace colormap
colormap::Colormap
Definition:
colormap.h:17
colormap::Color::g
double g
Definition:
colormap.h:14
colormap::IDL::CBPastel2::getColor
Color getColor(double x) const override
Definition:
CB-Pastel2.h:29
c
constexpr T c
Definition:
UnscentedKalmanFilterTest.cpp:46
colormap::Colormap::vec4
Definition:
colormap.h:33
colormap::IDL::CBPastel2::getCategory
std::string getCategory() const override
Definition:
CB-Pastel2.h:48
colormap::IDL::CBPastel2::getSource
std::string getSource() const override
Definition:
CB-Pastel2.h:54
Color
uint32_t Color
RGBA color.
Definition:
color.h:8
colormap::Color::a
double a
Definition:
colormap.h:14
colormap::Color::b
double b
Definition:
colormap.h:14
max
T max(T t1, T t2)
Definition:
gdiam.h:51
colormap::Color
Definition:
colormap.h:12
colormap::IDL::CBPastel2
Definition:
CB-Pastel2.h:13
colormap
This file was automatically created with "create_c++_header.sh".
Definition:
colormap.h:9
colormap::IDL::CBPastel2::getTitle
std::string getTitle() const override
Definition:
CB-Pastel2.h:42
colormap::Color::r
double r
Definition:
colormap.h:14
colormap::Colormap::WrapperBase
Definition:
colormap.h:146
min
T min(T t1, T t2)
Definition:
gdiam.h:44
VisionX
components
pointcloud_processor
DenseCRFSegmentationProcessor
include
colormap
private
IDL
CB-Pastel2.h
Generated on Sat Mar 29 2025 09:17:36 for armarx_documentation by
1.8.17