bitmap textureΒΆ
-
class bitmap_t : public wt::texture::texture_t
Texture defined via a 2D bitmap. Texture filtering is configurable, see
wt::bitmap::texture2d_config_t
.Public Types
-
using texture2d_t = bitmap::texture2d_t
Public Functions
-
inline bitmap_t(std::string id, private_token_t)
-
bitmap_t(bitmap_t&&) = default
-
virtual ~bitmap_t() noexcept = default
-
inline const auto &get_texture() const noexcept
Returns the underlying 2D texture.
-
inline virtual vec2_t resolution() const noexcept override
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 virtual std::shared_ptr<spectrum::spectrum_real_t> mean_spectrum() const noexcept override
Average spectrum of the texture. Returns
nullptr
when an average spectrum cannot be computed.
-
inline auto get_filter_config() const noexcept
Returns the underlying texture filering configuration.
-
inline bool is_RGB() const noexcept
Returns TRUE if the underlying bitmap contains RGB or RGBA data.
-
inline virtual std::optional<f_t> mean_value(wavenumber_t k) const noexcept override
Average value of the texture. Returns std::nullopt when an average value cannot be computed.
-
inline virtual vec4_t get_RGBA(const texture_query_t &query) const noexcept override
Samples the texture. Returns filtered RGBA data, without spectral upsampling. Ignores
query.k
. Only relevant for some textures.
-
inline virtual vec2_t f(const texture_query_t &query) const noexcept override
Samples the texture. Returns spectrally upsampled (to wavenumber
query.k
) result.- Returns:
Spectral luminance value and alpha (if any) pair.
-
virtual scene::element::info_t description() const override
Public Static Functions
-
static std::shared_ptr<bitmap_t> load(std::string id, scene::loader::loader_t *loader, const scene::loader::node_t &node, const wt::wt_context_t &context)
-
using texture2d_t = bitmap::texture2d_t