Go to the documentation of this file.
6 #include "../../colormap.h"
22 #define float local_real_t
23 #include "../../../../shaders/glsl/IDL_Eos_A.frag"
44 return std::string(
"Eos_A");
50 return std::string(
"IDL");
57 "float colormap_h(float x) {\n"
58 " if (x < 0.1151580585723306) {\n"
59 " return (2.25507158009032E+00 * x - 1.17973110308697E+00) * x + "
60 "7.72551618145170E-01; // H1\n"
61 " } else if (x < (9.89643667779019E-01 - 6.61604251019618E-01) / "
62 "(2.80520737708568E+00 - 1.40111938331467E+00)) {\n"
63 " return -2.80520737708568E+00 * x + 9.89643667779019E-01; // H2\n"
64 " } else if (x < (6.61604251019618E-01 - 4.13849520734156E-01) / "
65 "(1.40111938331467E+00 - 7.00489176507247E-01)) {\n"
66 " return -1.40111938331467E+00 * x + 6.61604251019618E-01; // H3\n"
67 " } else if (x < (4.13849520734156E-01 - 2.48319927251200E-01) / "
68 "(7.00489176507247E-01 - 3.49965224045823E-01)) {\n"
69 " return -7.00489176507247E-01 * x + 4.13849520734156E-01; // H4\n"
71 " return -3.49965224045823E-01 * x + 2.48319927251200E-01; // H5\n"
75 "float colormap_v(float x) {\n"
78 " v = clamp(2.10566088679245E+00 * x + 7.56360684411500E-01, 0.0, "
81 " v = clamp(-1.70132918347782E+00 * x + 2.20637371757606E+00, 0.0, "
84 " float period = 4.0 / 105.0;\n"
85 " float len = 3.0 / 252.0;\n"
86 " float t = mod(x + 7.0 / 252.0, period);\n"
87 " if (0.0 <= t && t < len) {\n"
89 " v = (1.87862631683169E+00 * x + 6.81498517051705E-01);\n"
90 " } else if (x < 0.73) {\n"
91 " v -= 26.0 / 252.0; \n"
93 " v = -1.53215278202992E+00 * x + 1.98649818445446E+00;\n"
100 "// => [x=-0.8359672286003642,x=0.1151580585723306]\n"
102 "vec4 colormap_hsv2rgb(float h, float s, float v) {\n"
109 " float f = h - float(i);\n"
111 " r *= 1.0 - s * f;\n"
113 " } else if (i == 2) {\n"
115 " b *= 1.0 - s * (1.0 - f);\n"
116 " } else if (i == 3) {\n"
118 " g *= 1.0 - s * f;\n"
119 " } else if (i == 4) {\n"
120 " r *= 1.0 - s * (1.0 - f);\n"
122 " } else if (i == 5) {\n"
124 " b *= 1.0 - s * f;\n"
126 " g *= 1.0 - s * (1.0 - f);\n"
130 " return vec4(r, g, b, 1.0);\n"
133 "vec4 colormap(float x) {\n"
134 " float h = colormap_h(clamp(x, 0.0, 1.0));\n"
136 " float v = colormap_v(clamp(x, 0.0, 1.0));\n"
137 " return colormap_hsv2rgb(h, s, v);\n"
std::string getSource() const override
Color getColor(double x) const override
std::string getTitle() const override
uint32_t Color
RGBA color.
std::string getCategory() const override
This file was automatically created with "create_c++_header.sh".
This file offers overloads of toIce() and fromIce() functions for STL container types.