Class texture2d_t¶
Defined in File texture2d.hpp
Inheritance Relationships¶
Derived Type¶
public wt::bitmap::texture2d_tmpl_t< TexelT, texfilter, layout, colour_encoding_type >
(Template Class texture2d_tmpl_t)
Class Documentation¶
-
class texture2d_t¶
A texture is a 2D bitmap with filtering and colour encoding facilities.
Subclassed by wt::bitmap::texture2d_tmpl_t< TexelT, texfilter, layout, colour_encoding_type >
Public Functions
-
inline texture2d_t(texture2d_storage_t storage, texture2d_config_t config, colour_encoding_t colour_encoding) noexcept¶
-
texture2d_t(texture2d_t&&) = default¶
-
virtual ~texture2d_t() noexcept = default¶
-
virtual std::size_t component_bytes() const noexcept = 0¶
Returns the byte per pixel component.
-
virtual std::size_t bytes() const noexcept = 0¶
Returns the total size (in bytes) of the texture.
-
inline colour_encoding_t colour_encoding() const noexcept¶
Returns the colour encoding used for the texture. Ignored for floating-point textures.
-
virtual texture_filter_type_e get_tex_filter() const noexcept = 0¶
Returns the requested texture filter.
-
inline const auto pixel_layout() const noexcept¶
Returns the pixel layout.
-
inline const auto components() const noexcept¶
Returns the number of components per pixel.
-
inline const auto &get_storage() const noexcept¶
-
virtual vec4_t texel(vec2i32_t coord) const noexcept = 0¶
Access a single texel at an image coordinate.
-
inline bool is_constant() const noexcept¶
Returns TRUE for textures that are constant.
Public Static Functions
-
static std::unique_ptr<texture2d_t> load_from_path(const wt_context_t &ctx, const std::filesystem::path &path, const texture2d_config_t config = {}, std::optional<colour_encoding_t> colour_encoding = {})¶
Loads a texture from a path.
- Parameters:
colour_encoding – (optional) Desired colour encoding, if not provided uses the colour encoding of the stored bitmap
Protected Functions
-
inline void compute_texture_data() noexcept¶
Protected Attributes
-
texture2d_storage_t storage¶
-
texture2d_config_t config¶
-
colour_encoding_t config_colour_encoding¶
Colour encoding for unorm/snorm textures. Ignored for floating point textures.
-
inline texture2d_t(texture2d_storage_t storage, texture2d_config_t config, colour_encoding_t colour_encoding) noexcept¶