Umbra::TextureData class

Data for creating a texture.

Public functions

auto getMipmapLevelByteSize(uint32_t level) const -> uint32_t pure virtual
Size of a mip level in bytes. Level 0 is always the largest.
auto getMipmapLevelOffset(uint32_t level) const -> uint32_t pure virtual
Byte offset where a mip level's data starts in the unpacked data.
auto getData(void* dst, size_t dstSize, bool uncachedMemory = false) const -> bool pure virtual
Unpack texture data.
auto getMetaData(MetaData* dst, size_t dstSize) const -> bool pure virtual
Fetch lookup table for per-pixel metadata.

Public variables

uint32_t width
Width in pixels.
uint32_t height
Height in pixels.
TextureFormat format
Texture format.
ColorSpace colorSpace
Color space.
uint32_t mipLevels
Mipmap levels.
uint32_t dataByteSize
Sum of unpacked sizes of all mip levels.
TextureType textureType
Texture type and expected usage.
uint32_t metaDataByteSize
Size of lookup table for per-pixel metadata.

Function details

bool Umbra::TextureData::getData(void* dst, size_t dstSize, bool uncachedMemory = false) const pure virtual

Unpack texture data.

Parameters
dst Destination buffer
dstSize Destination buffer size. This function will fail if the buffer is not large enough for the output data.
uncachedMemory Should reads/writes to the destination buffer be considered 'slow'. Set this if the destination buffer is, for example, memory mapped GPU memory. Setting this prevents some internal optimizations.
Returns true if operation succeeded. This operation may fail if input parameters are invalid or the mesh data is corrupt

bool Umbra::TextureData::getMetaData(MetaData* dst, size_t dstSize) const pure virtual

Fetch lookup table for per-pixel metadata.

Parameters
dst Destination buffer
dstSize Destination buffer size. This function will fail if the buffer is not large enough for the output data.
Returns true if operation succeeded. This operation may fail if input parameters are invalid

Variable details

ColorSpace Umbra::TextureData::colorSpace

Color space.

Not all format/color space combinations are valid

uint32_t Umbra::TextureData::mipLevels

Mipmap levels.

Umbra generally generates either no mipmaps or the full mip chain