CB-Accent.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 
8 namespace colormap
9 {
10  namespace IDL
11  {
12 
13  class CBAccent : 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-Accent.frag"
24 #undef float
25  };
26 
27  public:
28  Color getColor(double x) const override
29  {
30  Wrapper w;
31  vec4 c = w.colormap(x);
32  Color result;
33  result.r = std::max(0.0, std::min(1.0, c.r));
34  result.g = std::max(0.0, std::min(1.0, c.g));
35  result.b = std::max(0.0, std::min(1.0, c.b));
36  result.a = std::max(0.0, std::min(1.0, c.a));
37  return result;
38  }
39 
40  std::string getTitle() const override
41  {
42  return std::string("CB-Accent");
43  }
44 
45  std::string getCategory() const override
46  {
47  return std::string("IDL");
48  }
49 
50  std::string getSource() const override
51  {
52  return std::string(
53  "float colormap_red(float x) {\n"
54  " if (x < 0.3953623640294495) {\n"
55  " return 4.43904418116747E+02 * x + 1.27235098111810E+02; // R1\n"
56  " } else if (x < 0.5707952559161218) {\n"
57  " return -1.40693770913775E+03 * x + 8.58988416988442E+02; // R2\n"
58  " } else if (x < 0.7167119613307117) {\n"
59  " return 1.26199099099112E+03 * x - 6.64423423423499E+02; // R3\n"
60  " } else if (x < 0.8579249381242428) {\n"
61  " return -3.45591749644313E+02 * x + 4.87750355618723E+02; // R4\n"
62  " } else {\n"
63  " return -6.12161344537705E+02 * x + 7.16447058823441E+02; // R5\n"
64  " }\n"
65  "}\n"
66  "\n"
67  "float colormap_green(float x) {\n"
68  " if (x < 0.1411385125927322) {\n"
69  " return -1.90229018492177E+02 * x + 2.01102418207681E+02; // G1\n"
70  " } else if (x < 0.2839213365162221) {\n"
71  " return 1.26397818871505E+02 * x + 1.56414177335230E+02; // G2\n"
72  " } else if (x < 0.4292115788900552) {\n"
73  " return 4.30655855855847E+02 * x + 7.00288288288335E+01; // G3\n"
74  " } else if (x < 0.5716859888719092) {\n"
75  " return -1.03353736732686E+03 * x + 6.98477513951204E+02; // G4\n"
76  " } else if (x < 0.7167535225418249) {\n"
77  " return -7.29556302521079E+02 * x + 5.24695798319375E+02; // G5\n"
78  " } else if (x < 0.8577494771113141) {\n"
79  " return 6.31469498069341E+02 * x - 4.50824238524115E+02; // G6\n"
80  " } else {\n"
81  " return 7.78344916345091E+01 * x + 2.40558987558802E+01; // G7\n"
82  " }\n"
83  "}\n"
84  "\n"
85  "float colormap_blue(float x) {\n"
86  " if (x < 0.1418174223507038) {\n"
87  " return 5.96339971550497E+02 * x + 1.27334281650071E+02; // B1\n"
88  " } else if (x < 0.2832901246500529) {\n"
89  " return -5.48535392535404E+02 * x + 2.89697554697557E+02; // B2\n"
90  " } else if (x < 0.4021748491445084) {\n"
91  " return 1.22844950213372E+02 * x + 9.95021337126610E+01; // B3\n"
92  " } else if (x < 0.5699636786725797) {\n"
93  " return 1.60703217503224E+02 * x + 8.42764907764923E+01; // B4\n"
94  " } else if (x < 0.7149788470960766) {\n"
95  " return -3.30626890756314E+02 * x + 3.64316806722696E+02; // B5\n"
96  " } else if (x < 0.8584529189762473) {\n"
97  " return -7.30288215340717E+02 * x + 6.50066199802944E+02; // B6\n"
98  " } else {\n"
99  " return 5.42814671814679E+02 * x - 4.42832689832695E+02; // B7\n"
100  " }\n"
101  "}\n"
102  "\n"
103  "vec4 colormap(float x) {\n"
104  " float r = clamp(colormap_red(x) / 255.0, 0.0, 1.0);\n"
105  " float g = clamp(colormap_green(x) / 255.0, 0.0, 1.0);\n"
106  " float b = clamp(colormap_blue(x) / 255.0, 0.0, 1.0);\n"
107  " return vec4(r, g, b, 1.0);\n"
108  "}\n"
109  );
110  }
111  };
112 
113  } // namespace IDL
114 } // namespace colormap
colormap::Colormap
Definition: colormap.h:17
colormap::Color::g
double g
Definition: colormap.h:14
colormap::IDL::CBAccent::getCategory
std::string getCategory() const override
Definition: CB-Accent.h:45
colormap::IDL::CBAccent::getSource
std::string getSource() const override
Definition: CB-Accent.h:50
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
colormap::Colormap::vec4
Definition: colormap.h:32
colormap::IDL::CBAccent::getTitle
std::string getTitle() const override
Definition: CB-Accent.h:40
colormap::IDL::CBAccent
Definition: CB-Accent.h:13
colormap::Color::a
double a
Definition: colormap.h:14
colormap::Color::b
double b
Definition: colormap.h:14
max
T max(T t1, T t2)
Definition: gdiam.h:48
colormap::IDL::CBAccent::getColor
Color getColor(double x) const override
Definition: CB-Accent.h:28
colormap::Color
Definition: colormap.h:12
colormap
This file was automatically created with "create_c++_header.sh".
Definition: colormap.h:9
colormap::Color::r
double r
Definition: colormap.h:14
colormap::Colormap::WrapperBase
Definition: colormap.h:144
min
T min(T t1, T t2)
Definition: gdiam.h:42