CB-GnBu.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 CBGnBu : 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-GnBu.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-GnBu");
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 " float v = ((((-2.83671754639782E+03 * x + 6.51753994553536E+03) * x - "
59 "5.00110948171466E+03) * x + 1.30359712298773E+03) * x - 2.89958300810074E+02) "
60 "* x + 2.48458039402758E+02;\n"
61 " if (v < 8.0) {\n"
62 " return 8.0;\n"
63 " } else {\n"
64 " return v;\n"
65 " }\n"
66 "}\n"
67 "\n"
68 "float colormap_green(float x) {\n"
69 " return (((((-1.36304822155833E+03 * x + 4.37691418182849E+03) * x - "
70 "5.01802019417285E+03) * x + 2.39971481269598E+03) * x - 5.65401491984724E+02) "
71 "* x - 1.48189675724133E+01) * x + 2.50507618187374E+02;\n"
72 "}\n"
73 "\n"
74 "float colormap_blue(float x) {\n"
75 " if (x < 0.3756393599187693) {\n"
76 " return (9.62948273917718E+01 * x - 1.96136874142438E+02) * x + "
77 "2.41033490809633E+02;\n"
78 " } else if (x < 0.6215448666633865) {\n"
79 " return 1.21184043778803E+02 * x + 1.35422939068100E+02;\n"
80 " } else if (x < 0.8830064316178203) {\n"
81 " return -1.53052165744713E+02 * x + 3.05873047350666E+02;\n"
82 " } else {\n"
83 " return -3.49468965517114E+02 * x + 4.79310344827486E+02;\n"
84 " }\n"
85 "}\n"
86 "\n"
87 "vec4 colormap(float x) {\n"
88 " float r = clamp(colormap_red(x) / 255.0, 0.0, 1.0);\n"
89 " float g = clamp(colormap_green(x) / 255.0, 0.0, 1.0);\n"
90 " float b = clamp(colormap_blue(x) / 255.0, 0.0, 1.0);\n"
91 " return vec4(r, g, b, 1.0);\n"
92 "}\n");
93 }
94 };
95
96 } // namespace IDL
97} // namespace colormap
constexpr T c
std::string getCategory() const override
Definition CB-GnBu.h:48
std::string getSource() const override
Definition CB-GnBu.h:54
Color getColor(double x) const override
Definition CB-GnBu.h:29
std::string getTitle() const override
Definition CB-GnBu.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