Go to the documentation of this file.
6 #include "../../colormap.h"
22 #define float local_real_t
23 #include "../../../../shaders/glsl/IDL_Eos_B.frag"
44 return std::string(
"Eos_B");
50 return std::string(
"IDL");
57 "float colormap_h(float x) {\n"
58 " if (x < 0.1167535483837128) {\n"
59 " return 2.0 / 3.0; // H1\n"
60 " } else if (x < 0.1767823398113251) {\n"
61 " return ((-3.19659402385354E+02 * x + 1.14469539590179E+02) * x - "
62 "1.52210982227697E+01) * x + 1.39214703883044E+00; // H2\n"
63 " } else if (x < 0.2266354262828827) {\n"
64 " return ((-3.55166097640991E+02 * x + 2.51218596935272E+02) * x - "
65 "6.08853752315044E+01) * x + 5.38727123476564E+00; // H3\n"
66 " } else if (x < (6.95053970124612E-01 - 4.13725796136428E-01) / "
67 "(1.48914458632691E+00 - 6.97458630656247E-01)) {\n"
68 " return -1.48914458632691E+00 * x + 6.95053970124612E-01; // H4\n"
69 " } else if (x < (4.13725796136428E-01 - 2.48329223043123E-01) / "
70 "(6.97458630656247E-01 - 3.48617475202321E-01)) {\n"
71 " return -6.97458630656247E-01 * x + 4.13725796136428E-01; // H5\n"
73 " return -3.48617475202321E-01 * x + 2.48329223043123E-01; // H6\n"
77 "float colormap_v(float x) {\n"
79 " if (x < 0.115834504365921) {\n"
80 " v = 4.18575376272140E+00 * x + 5.15145240089963E-01; // V1-Hi\n"
81 " } else if (x < (1.90980360972022E+00 + 9.13724751363001E-01) / "
82 "(7.87450639585523E+00 + 7.87450803534638E+00)) {\n"
83 " v = -7.87450803534638E+00 * x + 1.90980360972022E+00; // V2-Hi\n"
84 " } else if (x < 0.5) {\n"
85 " v = 7.87450639585523E+00 * x - 9.13724751363001E-01; // V3-Hi\n"
87 " v = -1.87540494049556E+00 * x + 2.33603077812338E+00; // V4-Hi\n"
89 " v = clamp(v, 0.0, 1.0);\n"
91 " float period = 4.0 / 105.0;\n"
92 " float len = 3.0 / 252.0;\n"
93 " float t = mod(x + 7.0 / 252.0, period);\n"
94 " if (0.0 <= t && t < len) {\n"
95 " if (x < 0.115834504365921) {\n"
96 " v = 3.74113124408467E+00 * x + 4.64654322955584E-01; // "
98 " } else if (x < (1.90980360972022E+00 + 9.13724751363001E-01) / "
99 "(7.87450639585523E+00 + 7.87450803534638E+00)) {\n"
100 " v = -3.97326878048783E+00 * x + 1.25308500609757E+00; // "
102 " } else if (x < 0.25) {\n"
103 " v = 6.99297032967038E+00 * x - 8.03946549450558E-01; // "
105 " } else if (x < 0.72) {\n"
106 " v -= 26.0 / 255.0;\n"
108 " v = -1.67870020621040E+00 * x + 2.09414636280895E+00; // "
117 "// => [x=0.1167535483837128]\n"
120 "// => [x=0.1767823398113251,x=0.1822494566440582,x=3.492328017950058]\n"
123 "// => [x=0.2266354262828827]\n"
126 "// => [x=0.115834504365921]\n"
128 "// V2-Hi - V3-Hi = 0\n"
131 "vec4 colormap_hsv2rgb(float h, float s, float v) {\n"
138 " float f = h - float(i);\n"
140 " r *= 1.0 - s * f;\n"
142 " } else if (i == 2) {\n"
144 " b *= 1.0 - s * (1.0 - f);\n"
145 " } else if (i == 3) {\n"
147 " g *= 1.0 - s * f;\n"
148 " } else if (i == 4) {\n"
149 " r *= 1.0 - s * (1.0 - f);\n"
151 " } else if (i == 5) {\n"
153 " b *= 1.0 - s * f;\n"
155 " g *= 1.0 - s * (1.0 - f);\n"
159 " return vec4(r, g, b, 1.0);\n"
162 "vec4 colormap(float x) {\n"
163 " float h = colormap_h(clamp(x, 0.0, 1.0));\n"
165 " float v = colormap_v(clamp(x, 0.0, 1.0));\n"
166 " return colormap_hsv2rgb(h, s, v);\n"
std::string getTitle() const override
std::string getCategory() const override
std::string getSource() const override
uint32_t Color
RGBA color.
Color getColor(double x) 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.