1#ifndef TATOOINE_COLOR_SCALES_PIYG_H
2#define TATOOINE_COLOR_SCALES_PIYG_H
11template <
floating_po
int Real>
19 std::unique_ptr<color_type[]>
m_data;
29 {0.556863, 0.0039220000000000001, 0.32156899999999999},
30 {0.692195, 0.067896999999999999, 0.42737399999999998},
31 {0.797539, 0.197847, 0.53917700000000002},
32 {0.85905399999999998, 0.42422100000000001, 0.65974600000000005},
33 {0.90857399999999999, 0.59261799999999998, 0.77031899999999998},
34 {0.95155699999999999, 0.73633199999999999, 0.866205},
35 {0.98108399999999996, 0.83967700000000001, 0.91787799999999997},
36 {0.98292999999999997, 0.913802, 0.94955800000000001},
37 {0.96731999999999996, 0.96847399999999995, 0.96562899999999996},
38 {0.92549000000000003, 0.96355199999999996, 0.86966600000000005},
39 {0.852441, 0.93925400000000003, 0.73602500000000004},
40 {0.73925399999999997, 0.890042, 0.55394100000000002},
41 {0.60323000000000004, 0.80553600000000003, 0.38223800000000002},
42 {0.46728199999999998, 0.71141900000000002, 0.23521700000000001},
43 {0.344252, 0.608074, 0.15647800000000001},
44 {0.24060000000000001, 0.49826999999999999, 0.116494},
45 {0.15294099999999999, 0.39215699999999998, 0.098039000000000001}}} {
53 return m_data[(num_samples() - 1)];
55 t *= num_samples() - 1;
56 auto const i =
static_cast<std::size_t
>(std::floor(t));
58 return m_data[i] * (1 - t) + m_data[i + 1] * t;
auto data() -> color_type *
Definition: PiYG.h:24
auto operator()(real_type const t) const
Definition: PiYG.h:60
auto data_container() -> color_type *
Definition: PiYG.h:22
std::unique_ptr< color_type[]> m_data
Definition: PiYG.h:19
static constexpr std::size_t num_samples()
Definition: PiYG.h:16
Real real_type
Definition: PiYG.h:13
auto sample(real_type t) const
Definition: PiYG.h:48
auto data() const -> color_type const *
Definition: PiYG.h:25
auto data_container() const -> color_type const *
Definition: PiYG.h:23
PiYG()
Definition: PiYG.h:27