Go to the documentation of this file.
6 #include "../../colormap.h"
22 #define float local_real_t
23 #include "../../../../shaders/glsl/IDL_Hue_Sat_Lightness_2.frag"
44 return std::string(
"Hue_Sat_Lightness_2");
50 return std::string(
"IDL");
57 "float colormap_up(float x) {\n"
58 " return (1.88200166286601E-03 * x - 4.65545143706978E-01) * x + "
59 "2.51008231568770E+02;\n"
62 "float colormap_low(float x) {\n"
63 " return (-1.90879354636631E-03 * x - 5.05775136749144E-01) * x + "
64 "2.51839633472648E+02;\n"
67 "float colormap_r1(float x) {\n"
68 " float t = x - 84.41170691108532;\n"
69 " return ((-1.30664056487685E-04 * t - 2.23609578814399E-02) * t - "
70 "1.63427831229829E+00) * t + colormap_low(84.41170691108532);\n"
73 "float colormap_r2(float x) {\n"
74 " float t = (x - 172.4679464259528);\n"
75 " return (3.39051205856669E-02 * t + 1.53777364753859E+00) * t + "
76 "colormap_low(172.4679464259528);\n"
79 "float colormap_g1(float x) {\n"
80 " return (2.06966753567031E-02 * x - 3.81765550976615E+00) * x + "
81 "3.70329541512642E+02;\n"
84 "float colormap_g2(float x) {\n"
85 " float t = x - 215.8140719563986;\n"
86 " return (-2.93369381849802E-02 * t - 4.45609461245051E+00) * t + "
87 "colormap_up(215.8140719563986);\n"
90 "float colormap_b1(float x) {\n"
91 " float t = (x - 129.0039558892991);\n"
92 " return (-2.69029805601284E-02 * t - 1.46365429919324E+00) * t + "
93 "colormap_up(129.0039558892991);\n"
96 "float colormap_red(float x) {\n"
97 " if (x < 84.41170691108532) {\n"
98 " return colormap_r1(x);\n"
99 " } else if (x < 172.4679464259528) {\n"
100 " return colormap_low(x);\n"
101 " } else if (x < 215.8140719563986) {\n"
102 " return colormap_r2(x);\n"
104 " return colormap_up(x);\n"
108 "float colormap_green(float x) {\n"
109 " if (x < 84.41170691108532) {\n"
110 " return colormap_low(x);\n"
111 " } else if (x < 129.0039558892991) {\n"
112 " return colormap_g1(x);\n"
113 " } else if (x < 215.8140719563986) {\n"
114 " return colormap_up(x);\n"
116 " return colormap_g2(x);\n"
120 "float colormap_blue(float x) {\n"
121 " if (x < 129.0039558892991) {\n"
122 " return colormap_up(x);\n"
123 " } else if (x < 172.4679464259528) {\n"
124 " return colormap_b1(x);\n"
126 " return colormap_low(x);\n"
131 "// => [x=62.09621943267293,x=84.41170691108532]\n"
134 "// => [x=49.16072666680554,x=129.0039558892991]\n"
137 "// => [x=66.91982278615977,x=172.4679464259528]\n"
140 "// => [x=86.8352194379599,x=215.8140719563986]\n"
142 "// low(172.4679464259528) = 107.83220272\n"
143 "// up(215.8140719563986) = 238.192608973\n"
145 "vec4 colormap(float x) {\n"
146 " float t = x * 255.0;\n"
147 " float r = clamp(colormap_red(t) / 255.0, 0.0, 1.0);\n"
148 " float g = clamp(colormap_green(t) / 255.0, 0.0, 1.0);\n"
149 " float b = clamp(colormap_blue(t) / 255.0, 0.0, 1.0);\n"
150 " return vec4(r, g, b, 1.0);\n"
std::string getCategory() const override
uint32_t Color
RGBA color.
std::string getSource() const override
This file was automatically created with "create_c++_header.sh".
std::string getTitle() const override
Color getColor(double x) const override
This file offers overloads of toIce() and fromIce() functions for STL container types.