nCine::TextureFormat class

Texture format.

Public static functions

static auto calculateMipSizes(GLenum internalFormat, std::int32_t width, std::int32_t height, std::int32_t mipMapCount, std::uint32_t* mipDataOffsets, std::uint32_t* mipDataSizes) -> std::uint32_t
Calculates the pixel data size for each MIP map level.

Constructors, destructors, conversion operators

TextureFormat()
TextureFormat(GLenum internalFormat) explicit
TextureFormat(GLenum internalFormat, GLenum type)

Public functions

auto internalFormat() const -> GLenum
Returns the specified internal format.
auto format() const -> GLenum
Returns the corresponding format.
auto type() const -> GLenum
Returns the corresponding pixel data type.
auto isCompressed() const -> bool
Returns true if the format holds compressed data.
auto numChannels() const -> std::uint32_t
Returns the number of color channels.
void bgrFormat()
Converts the external format to the corresponding BGR one.