RGB spectrum

class rgb_t : public wt::spectrum::spectrum_real_t

A (real-valued) spectrum that upsamples an RGB colour triplet to spectral data. Defined between wavelengths of 380nm and 780nm. See wt::colourspace::RGB_to_spectral.

Public Functions

inline rgb_t(std::string id, const vec3_t &rgb)
rgb_t(const rgb_t&) = delete
rgb_t(rgb_t&&) = default
inline virtual const distribution1d_t *distribution() const noexcept override

Returns the underlying spectrum distribution.

inline virtual f_t power() const noexcept override

Returns the total spectral power contained in this spectrum.

inline virtual f_t power(const range_t<wavenumber_t> &wavenumbers) const noexcept override

Returns the spectral power over the provided wavenumber range.

inline virtual range_t<wavenumber_t> wavenumber_range() const noexcept override

Returns the range of wavenumbers for which this spectrum is defined. Querying the spectrum with wavenumber<range.min or wavenumber>range.max will always be 0.

inline virtual wavenumber_t mean_wavenumber() const noexcept override

Returns the mean wavenumber for this spectrum.

inline virtual f_t f(const wavenumber_t wavenumber) const noexcept override

Query the spectrum. Returns the spectral power for the given wavenumber ‘wavenumber’.

virtual scene::element::info_t description() const override

Public Static Functions

static std::unique_ptr<binned_piecewise_linear_distribution_t> rgb_to_binned_linear_distribution(const vec3_t &rgb) noexcept

Creates a binned piecewise-linear distribution from an RGB colour rgb. Uses wt::colourspace::RGB_to_spectral for uplifting to spectral.

static std::unique_ptr<spectrum_real_t> load(std::string id, scene::loader::loader_t *loader, const scene::loader::node_t &node, const wt::wt_context_t &context)

Public Static Attributes

static constexpr auto lambda_min = colourspace::RGB_to_spectral::min_lambda
static constexpr auto lambda_max = colourspace::RGB_to_spectral::max_lambda