Template Class qtexture_t

Inheritance Relationships

Base Type

Class Documentation

template<Quantity Q>
class qtexture_t : public wt::scene::scene_element_t

Simple wrapper around texture_t that scales the queried texture value by a scalar scale. Useful when textures with physical units are required. Only the first channel of the underlying texture is used, rest is ignored. The underlying texture may be nullptr in which case this texture is a constant texture.

Public Functions

inline qtexture_t(std::string id, std::shared_ptr<texture_t> tex, Q scale)
qtexture_t(qtexture_t&&) = default
qtexture_t(const qtexture_t&) = default
inline bool needs_interaction_footprint() const noexcept

Returns TRUE for textures that make use of the surface interaction footprint data.

inline vec2_t resolution() const noexcept

Returns texture resolution represented via \( \frac{\text{texels}}{\vec{uv}} \). May return an approximation. Can be infinite, e.g., for analytic textures. Can be 1, for constant textures.

inline bool is_constant() const noexcept

Returns TRUE for textures that are constant, i.e. admit a resolution() of exactly 1.

inline std::shared_ptr<spectrum::qspectrum_t<Q>> mean_spectrum() const noexcept

Average spectrum of the texture. Returns nullptr when an average spectrum cannot be computed.

inline std::optional<Q> mean_value(wavenumber_t k) const noexcept

Average value of the texture. Returns std::nullopt when an average value cannot be computed.

inline Q f(const texture_query_t &query) const noexcept

Samples the texture. Returns spectrally upsampled (to wavenumber query.k) result.

Returns:

Spectral luminance value and alpha (if any) pair.

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

Public Static Functions

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