1#ifndef TATOOINE_COLOR_SCALES_JET_H
2#define TATOOINE_COLOR_SCALES_JET_H
11template <
floating_po
int Real>
19 std::unique_ptr<color_type[]>
m_data;
30 auto data() ->
auto& {
return m_data; }
31 auto data() const -> auto const& {
return m_data; }
38 return m_data[num_samples() - 1];
40 t *= num_samples() - 1;
41 auto const i =
static_cast<size_t>(std::floor(t));
43 return m_data[i] * (1 - t) + m_data[i + 1] * t;
std::unique_ptr< color_type[]> m_data
Definition: jet.h:19
Real real_type
Definition: jet.h:13
auto operator()(real_type const t) const
Definition: jet.h:46
auto sample(real_type t) const
Definition: jet.h:33
auto data() -> auto &
Definition: jet.h:30
auto data() const -> auto const &
Definition: jet.h:31
static constexpr auto num_samples() -> std::size_t
Definition: jet.h:17
jet()
Definition: jet.h:21