Go to the documentation of this file.
6 #include "../../colormap.h"
22 #define float local_real_t
23 #include "../../../../shaders/glsl/IDL_Volcano.frag"
44 return std::string(
"Volcano");
50 return std::string(
"IDL");
57 "float colormap_r1(float x) {\n"
58 " const float pi = 3.141592653589793238462643383279502884197169399;\n"
59 " const float a = 216.6901575438631;\n"
60 " const float b = 1.073972444219095;\n"
61 " const float c = 0.6275803332110022;\n"
62 " const float d = 221.6241814852619;\n"
63 " float v = a * sin(2.0 * pi / b * x + 2.0 * pi * c) + d;\n"
71 "float colormap_r2(float x) {\n"
72 " const float pi = 3.141592653589793238462643383279502884197169399;\n"
73 " const float a = 202.3454274460618;\n"
74 " const float b = 1.058678309228987;\n"
75 " const float c = 0.4891299991060677;\n"
76 " const float d = -72.38173481234448;\n"
77 " return a * sin(2.0 * pi / b * x + 2.0 * pi * c) + d;\n"
80 "float colormap_red(float x) {\n"
81 " if (x < 0.4264009656413063) {\n"
82 " return colormap_r1(x);\n"
83 " } else if (x < 0.6024851624202665) {\n"
84 " const float a = (0.0 - 255.0) / (0.6024851624202665 - "
85 "0.4264009656413063);\n"
86 " const float b = -0.6024851624202665 * a;\n"
87 " return a * x + b;\n"
89 " return colormap_r2(x);\n"
93 "float colormap_green(float x) {\n"
94 " const float pi = 3.141592653589793238462643383279502884197169399;\n"
95 " const float a = 126.3856859482602;\n"
96 " const float b = 0.6744554815524477;\n"
97 " const float c = 0.01070628027163306;\n"
98 " const float d = 26.95058522613648;\n"
99 " float v = a * sin(2.0 * pi / b * x + 2.0 * pi * c) + d;\n"
107 "float colormap_blue(float x) {\n"
108 " const float pi = 3.141592653589793238462643383279502884197169399;\n"
109 " const float a = 126.9540413031656;\n"
110 " const float b = 0.2891013907955124;\n"
111 " const float c = 0.5136633102640619;\n"
112 " const float d = 126.5159759632338;\n"
113 " return a * sin(2.0 * pi / b * x + 2.0 * pi * c) + d;\n"
117 "// => 0.4264009656413063\n"
120 "// => 0.6024851624202665\n"
122 "vec4 colormap(float x) {\n"
123 " float r = clamp(colormap_red(x) / 255.0, 0.0, 1.0);\n"
124 " float g = clamp(colormap_green(x) / 255.0, 0.0, 1.0);\n"
125 " float b = clamp(colormap_blue(x) / 255.0, 0.0, 1.0);\n"
126 " return vec4(r, g, b, 1.0);\n"
Color getColor(double x) const override
std::string getCategory() const override
uint32_t Color
RGBA color.
This file was automatically created with "create_c++_header.sh".
std::string getSource() const override
std::string getTitle() const override
This file offers overloads of toIce() and fromIce() functions for STL container types.