Struct texture2d_storage_t

Nested Relationships

Nested Types

Struct Documentation

struct texture2d_storage_t

Generic storage for a texture; uses an aligned, tiled memory layout.

Public Functions

inline std::size_t bytes() const noexcept

Size in bytes of this storage.

inline auto texel_offset(vec2u32_t coords) const noexcept

Offset into data to texel at integer coordinates coords.

template<texel T>
inline auto create_bitmap() const noexcept

Creates a bitmap from this texture storage.

Template Parameters:

T – texel type of bitmap; must fulfil sizeof(T)==comp_size.

Public Members

std::unique_ptr<aligned_block_t[]> data
tex_info_t info
std::uint8_t comp_size

Size in bytes of a single texel component.

pixel_layout_t layout

Pixel layout a texel.

Public Static Attributes

static constexpr vec2u32_t tile_size = {8, 4}
static constexpr std::uint32_t tile_texels = tile_size.x * tile_size.y
struct aligned_block_t
struct tex_info_t

Public Members

vec2u32_t dim

Bitmap dimensions.

vec2u32_t tiles

Tile dimensions.