spectra


class spectrum_t : public wt::scene::scene_element_t

Generic spectrum: a complex-valued function of wavenumber. Wavenumber \( k \) is related to wavelength \( \lambda \) via \( k = \frac{2\pi}{\lambda} \).

Subclassed by wt::spectrum::complex_analytic_t, wt::spectrum::complex_container_t, wt::spectrum::complex_uniform_t, wt::spectrum::spectrum_real_t

Public Functions

inline spectrum_t(std::string id)
spectrum_t(const spectrum_t&) = default
spectrum_t(spectrum_t&&) = default
virtual ~spectrum_t() noexcept = default
virtual range_t<wavenumber_t> wavenumber_range() const noexcept = 0

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.

virtual c_t value(const wavenumber_t wavenumber) const noexcept = 0

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

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

Public Static Functions

static inline constexpr std::string scene_element_class() noexcept
static std::unique_ptr<spectrum_t> load(std::string id, scene::loader::loader_t *loader, const scene::loader::node_t &node, const wt::wt_context_t &context)

class spectrum_real_t : public wt::spectrum::spectrum_t

Purely real-valued spectrum, for power and power-like distributions.

Subclassed by wt::spectrum::analytic_t, wt::spectrum::binned_t, wt::spectrum::blackbody_t, wt::spectrum::composite_t, wt::spectrum::discrete_t, wt::spectrum::function_t, wt::spectrum::gaussian_t, wt::spectrum::piecewise_linear_t, wt::spectrum::rgb_t, wt::spectrum::uniform_t

Public Functions

inline spectrum_real_t(std::string id)
spectrum_real_t(const spectrum_real_t&) = default
spectrum_real_t(spectrum_real_t&&) = default
virtual ~spectrum_real_t() noexcept = default
virtual const distribution1d_t *distribution() const noexcept = 0

Returns the underlying spectrum distribution.

virtual f_t power() const noexcept = 0

Returns the total spectral power contained in this spectrum.

virtual f_t power(const range_t<wavenumber_t> &wavenumbers) const noexcept = 0

Returns the spectral power over the provided wavenumber range.

virtual wavenumber_t mean_wavenumber() const noexcept = 0

Returns the mean wavenumber for this spectrum.

virtual f_t f(const wavenumber_t wavenumber) const noexcept = 0

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

inline virtual c_t value(const wavenumber_t wavenumber) const noexcept final

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