CB-RdYiGn.h
Go to the documentation of this file.
1/**
2 * This file was automatically created with "create_c++_header.sh".
3 * Do not edit manually.
4 */
5#pragma once
6#include "../../colormap.h"
7
8namespace colormap
9{
10 namespace IDL
11 {
12
13 class CBRdYiGn : public Colormap
14 {
15 private:
16 class Wrapper : public WrapperBase
17 {
18 public:
19#ifdef float
20#error "TODO"
21#endif
22#define float local_real_t
23#include "../../../../shaders/glsl/IDL_CB-RdYiGn.frag"
24#undef float
25 };
26
27 public:
28 Color
29 getColor(double x) const override
30 {
31 Wrapper w;
32 vec4 c = w.colormap(x);
33 Color result;
34 result.r = std::max(0.0, std::min(1.0, c.r));
35 result.g = std::max(0.0, std::min(1.0, c.g));
36 result.b = std::max(0.0, std::min(1.0, c.b));
37 result.a = std::max(0.0, std::min(1.0, c.a));
38 return result;
39 }
40
41 std::string
42 getTitle() const override
43 {
44 return std::string("CB-RdYiGn");
45 }
46
47 std::string
48 getCategory() const override
49 {
50 return std::string("IDL");
51 }
52
53 std::string
54 getSource() const override
55 {
56 return std::string(
57 "float colormap_red(float x) {\n"
58 " if (x < 0.09825118520770205) {\n"
59 " return 5.07556923076926E+02 * x + 1.64923076923077E+02;\n"
60 " } else if (x < 0.2009111350471108) {\n"
61 " return 2.86362637362647E+02 * x + 1.86655677655676E+02;\n"
62 " } else if (x < 0.2994418666360456) {\n"
63 " return 8.90415982485030E+01 * x + 2.26299671592774E+02;\n"
64 " } else if (x < 0.5001300871372223) {\n"
65 " return 9.81627851140242E+00 * x + 2.50023049219689E+02;\n"
66 " } else if (x < 0.9039205014705658) {\n"
67 " return ((-3.30848798119696E+01 * x - 5.65722561191396E+02) * x + "
68 "2.78046782759626E+02) * x + 2.61515979057614E+02;\n"
69 " } else {\n"
70 " return -2.53583846153761E+02 * x + 2.55396153846073E+02;\n"
71 " }\n"
72 "}\n"
73 "\n"
74 "float colormap_green(float x) {\n"
75 " if (x < 0.1105575469849737) {\n"
76 " return 4.79433455433456E+02 * x + 3.65079365079361E-01;\n"
77 " } else if (x < 0.3151890079472769) {\n"
78 " return 6.25896582484846E+02 * x - 1.58275246854709E+01;\n"
79 " } else if (x < 0.4023888287265409) {\n"
80 " return 4.80700000000005E+02 * x + 2.99368421052611E+01;\n"
81 " } else if (x < 0.5007980763912201) {\n"
82 " return 3.22042124542111E+02 * x + 9.37789987790044E+01;\n"
83 " } else if (x < 0.9266376793384552) {\n"
84 " return ((-2.91150627193739E+02 * x + 2.73891595228739E+02) * x - "
85 "1.97954551648389E+02) * x + 3.22069054828072E+02;\n"
86 " } else {\n"
87 " return -4.70385384615211E+02 * x + 5.78034615384465E+02;\n"
88 " }\n"
89 "}\n"
90 "\n"
91 "float colormap_blue(float x) {\n"
92 " if (x < 0.1007720845701718) {\n"
93 " return 1.66813186813184E+01 * x + 3.72910052910053E+01;\n"
94 " } else if (x < 0.2891807195246389) {\n"
95 " return 2.86155895159223E+02 * x + 1.01354904806627E+01;\n"
96 " } else if (x < 0.4061884871072265) {\n"
97 " return 4.02182758620675E+02 * x - 2.34172413793071E+01;\n"
98 " } else if (x < 0.5018816861329155) {\n"
99 " return 5.35500000000025E+02 * x - 7.75691699604942E+01;\n"
100 " } else if (x < 0.604070194492165) {\n"
101 " return -5.10170329670400E+02 * x + 4.47233618233660E+02;\n"
102 " } else if (x < 0.7060918916718424) {\n"
103 " return -3.26878215654109E+02 * x + 3.36512315270959E+02;\n"
104 " } else if (x < 0.812819402403008) {\n"
105 " return -6.62557264957455E+01 * x + 1.52488888888906E+02;\n"
106 " } else {\n"
107 " return -2.16444081632622E+02 * x + 2.74564897959153E+02;\n"
108 " }\n"
109 "}\n"
110 "\n"
111 "vec4 colormap(float x) {\n"
112 " float r = clamp(colormap_red(x) / 255.0, 0.0, 1.0);\n"
113 " float g = clamp(colormap_green(x) / 255.0, 0.0, 1.0);\n"
114 " float b = clamp(colormap_blue(x) / 255.0, 0.0, 1.0);\n"
115 " return vec4(r, g, b, 1.0);\n"
116 "}\n");
117 }
118 };
119
120 } // namespace IDL
121} // namespace colormap
constexpr T c
std::string getCategory() const override
Definition CB-RdYiGn.h:48
std::string getSource() const override
Definition CB-RdYiGn.h:54
Color getColor(double x) const override
Definition CB-RdYiGn.h:29
std::string getTitle() const override
Definition CB-RdYiGn.h:42
uint32_t Color
RGBA color.
Definition color.h:8
This file offers overloads of toIce() and fromIce() functions for STL container types.
This file was automatically created with "create_c++_header.sh".
Definition colormap.h:10