Go to the documentation of this file.
6 #include "../../colormap.h"
22 #define float local_real_t
23 #include "../../../../shaders/glsl/IDL_Hue_Sat_Value_2.frag"
44 return std::string(
"Hue_Sat_Value_2");
50 return std::string(
"IDL");
57 "float colormap_low(float x) {\n"
58 " return -9.89123311722871E-01 * x + 2.54113856910082E+02;\n"
61 "float colormap_r1(float x) {\n"
62 " float t = x - 44.52807774916808;\n"
63 " return (-2.10743035084859E-02 * t - 1.14339819510944E+00) * t + 255.0;\n"
66 "float colormap_r2(float x) {\n"
67 " float t = x - 173.2142990353825;\n"
68 " return (2.10464655909683E-02 * t + 3.09770350177039E+00) * t + "
72 "float colormap_g1(float x) {\n"
73 " float t = x - 87.18599073927922;\n"
74 " return (2.18814766236433E-02 * t + 1.07683877405025E+00) * t + "
78 "float colormap_g2(float x) {\n"
79 " float t = x - 216.2347301863598;\n"
80 " return (-1.75617661106684E-02 * t - 5.19390917463437E+00) * t + 255.0;\n"
83 "float colormap_b2(float x) {\n"
84 " float t = x - 130.3078696041572;\n"
85 " return (-1.97675474706200E-02 * t - 3.16561290370380E+00) * t + 255.0;\n"
88 "float colormap_red(float x) {\n"
89 " if (x < 44.52807774916808) {\n"
91 " } else if (x < 87.18599073927922) {\n"
92 " return colormap_r1(x);\n"
93 " } else if (x < 173.2142990353825) {\n"
94 " return colormap_low(x);\n"
95 " } else if (x < 216.2347301863598) {\n"
96 " return colormap_r2(x);\n"
102 "float colormap_green(float x) {\n"
103 " if (x < 87.18599073927922) {\n"
104 " return colormap_low(x);\n"
105 " } else if (x < 130.3078696041572) {\n"
106 " return colormap_g1(x);\n"
107 " } else if (x < 216.2347301863598) {\n"
110 " return colormap_g2(x);\n"
114 "float colormap_blue(float x) {\n"
115 " if (x < 44.52807774916808) {\n"
116 " return (2.31958376441286E-02 * x - 1.01298265446011E+00) * x + "
117 "2.54114630079813E+02; // B1\n"
118 " } else if (x < 130.3078696041572) {\n"
120 " } else if (x < 173.2142990353825) {\n"
121 " return colormap_b2(x);\n"
123 " return colormap_low(x);\n"
128 "// => [x=-0.8571972230440585,x=44.52807774916808]\n"
131 "// => [x=-5.450356335481052,x=87.18599073927922]\n"
134 "// => [x=-5.148233003947013,x=130.3078696041572]\n"
137 "// => [x=-22.70273917535556,x=173.2142990353825]\n"
140 "// => [x=-16.99015635858727,x=216.2347301863598]\n"
142 "// low(87.18599073927922) = 167.876161014\n"
143 "// low(173.2142990353825) = 82.7835558104\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 getSource() const override
uint32_t Color
RGBA color.
std::string getTitle() const override
This file was automatically created with "create_c++_header.sh".
std::string getCategory() const override
Color getColor(double x) const override
This file offers overloads of toIce() and fromIce() functions for STL container types.