1#ifndef TATOOINE_COLOR_SCALES_PUOR_H
2#define TATOOINE_COLOR_SCALES_PUOR_H
11template <
floating_po
int Real>
19 std::unique_ptr<color_type[]>
m_data;
29 {0.49803900000000001, 0.231373, 0.031372999999999998},
30 {0.62599000000000005, 0.30273, 0.026450999999999999},
31 {0.74694300000000002, 0.38708199999999998, 0.037524000000000002},
32 {0.85767000000000004, 0.490427, 0.071971999999999994},
33 {0.93640900000000005, 0.61776200000000003, 0.236371},
34 {0.99269499999999999, 0.74309899999999995, 0.43291000000000002},
35 {0.99515600000000004, 0.84152300000000002, 0.63714000000000004},
36 {0.98531299999999999, 0.913802, 0.81368700000000005},
37 {0.96624399999999999, 0.96639799999999998, 0.96770500000000004},
38 {0.88996500000000001, 0.89503999999999995, 0.93817799999999996},
39 {0.80615099999999995, 0.80430599999999997, 0.89465600000000001},
40 {0.71264899999999998, 0.68865799999999999, 0.83314100000000002},
41 {0.59423300000000001, 0.55432499999999996, 0.74463699999999999},
42 {0.47489399999999998, 0.404229, 0.65236400000000005},
43 {0.36662800000000001, 0.217224, 0.56378300000000003},
44 {0.26643600000000001, 0.089965000000000003, 0.43483300000000003},
45 {0.17647099999999999, 0, 0.29411799999999999}}} {}
52 return m_data[(num_samples() - 1)];
54 t *= num_samples() - 1;
55 auto const i =
static_cast<std::size_t
>(std::floor(t));
57 return m_data[i] * (1 - t) + m_data[i + 1] * t;
Real real_type
Definition: PuOr.h:13
auto data() const -> color_type const *
Definition: PuOr.h:25
auto operator()(real_type const t) const
Definition: PuOr.h:59
PuOr()
Definition: PuOr.h:27
auto data_container() -> color_type *
Definition: PuOr.h:22
std::unique_ptr< color_type[]> m_data
Definition: PuOr.h:19
static constexpr std::size_t num_samples()
Definition: PuOr.h:16
auto sample(real_type t) const
Definition: PuOr.h:47
auto data() -> color_type *
Definition: PuOr.h:24
auto data_container() const -> color_type const *
Definition: PuOr.h:23