format.hpp File Reference

Namespaces

 kanzi
 

Enumerations

enum  kanzi::GraphicsElementType { kanzi::GraphicsElementTypeUINT, kanzi::GraphicsElementTypeSINT, kanzi::GraphicsElementTypeFLOAT }
 GraphicsElementType is used to specify type of element of data consumed by shaders. More...
 
enum  kanzi::GraphicsDataType {
  kanzi::GraphicsDataTypeNone, kanzi::GraphicsDataTypeUNORM8, kanzi::GraphicsDataTypeSNORM8, kanzi::GraphicsDataTypeUNORM16,
  kanzi::GraphicsDataTypeSNORM16, kanzi::GraphicsDataTypeUNORM32, kanzi::GraphicsDataTypeSNORM32, kanzi::GraphicsDataTypeUNORM_PACK16_5_6_5,
  kanzi::GraphicsDataTypeCOMPRESSED, kanzi::GraphicsDataTypeUINT8, kanzi::GraphicsDataTypeSINT8, kanzi::GraphicsDataTypeUINT16,
  kanzi::GraphicsDataTypeSINT16, kanzi::GraphicsDataTypeUINT32, kanzi::GraphicsDataTypeSINT32, kanzi::GraphicsDataTypeSFLOAT16,
  kanzi::GraphicsDataTypeSFLOAT32, kanzi::GraphicsDataTypeUNORM24, kanzi::GraphicsDataTypeUNORM24_UINT8, kanzi::GraphicsDataTypeUNORM_PACK32_2_10_10_10,
  kanzi::GraphicsDataTypeSNORM_PACK32_2_10_10_10, kanzi::GraphicsDataTypeNative
}
 GraphicsDataType is used to specify type of data in textures and vertex buffers. More...
 
enum  kanzi::GraphicsFormat {
  kanzi::GraphicsFormatNone, kanzi::GraphicsFormatLUMINANCE8_UNORM, kanzi::GraphicsFormatALPHA8_UNORM, kanzi::GraphicsFormatLUMINANCE8_ALPHA8_UNORM,
  kanzi::GraphicsFormatR8_UNORM, kanzi::GraphicsFormatR8_UINT, kanzi::GraphicsFormatR8_SINT, kanzi::GraphicsFormatR8G8_UNORM,
  kanzi::GraphicsFormatR8G8_UINT, kanzi::GraphicsFormatR8G8_SINT, kanzi::GraphicsFormatR8G8B8_UNORM, kanzi::GraphicsFormatR8G8B8_SRGB,
  kanzi::GraphicsFormatR8G8B8_UINT, kanzi::GraphicsFormatR8G8B8_SINT, kanzi::GraphicsFormatR8G8B8A8_UNORM, kanzi::GraphicsFormatR8G8B8A8_SRGB,
  kanzi::GraphicsFormatR8G8B8A8_UINT, kanzi::GraphicsFormatR8G8B8A8_SINT, kanzi::GraphicsFormatR16_UINT, kanzi::GraphicsFormatR16_SINT,
  kanzi::GraphicsFormatR16_SFLOAT, kanzi::GraphicsFormatR16G16_UINT, kanzi::GraphicsFormatR16G16_SINT, kanzi::GraphicsFormatR16G16_SFLOAT,
  kanzi::GraphicsFormatR16G16B16_UINT, kanzi::GraphicsFormatR16G16B16_SINT, kanzi::GraphicsFormatR16G16B16_SFLOAT, kanzi::GraphicsFormatR16G16B16A16_UINT,
  kanzi::GraphicsFormatR16G16B16A16_SINT, kanzi::GraphicsFormatR16G16B16A16_SFLOAT, kanzi::GraphicsFormatR5G6B5_UNORM_PACK16, kanzi::GraphicsFormatETC1_R8G8B8_UNORM,
  kanzi::GraphicsFormatETC2_R8G8B8_UNORM, kanzi::GraphicsFormatETC2_R8G8B8A1_UNORM, kanzi::GraphicsFormatETC2_R8G8B8A8_UNORM, kanzi::GraphicsFormatBC2_UNORM,
  kanzi::GraphicsFormatBC3_UNORM, kanzi::GraphicsFormatPVRTC1_RGB_2BPP, kanzi::GraphicsFormatPVRTC1_RGB_4BPP, kanzi::GraphicsFormatPVRTC1_RGBA_2BPP,
  kanzi::GraphicsFormatPVRTC1_RGBA_4BPP, kanzi::GraphicsFormatPVRTC2_RGBA_2BPP, kanzi::GraphicsFormatPVRTC2_RGBA_4BPP, kanzi::GraphicsFormatATC_RGB,
  kanzi::GraphicsFormatATC_RGBA_EXPLICIT_ALPHA, kanzi::GraphicsFormatATC_RGBA_INTERPOLATED_ALPHA, kanzi::GraphicsFormatD16_UNORM, kanzi::GraphicsFormatD24_UNORM,
  kanzi::GraphicsFormatD32_SFLOAT, kanzi::GraphicsFormatD24_UNORM_S8_UINT, kanzi::GraphicsFormatS8_UINT, kanzi::GraphicsFormatASTC_4x4_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_4x4_SRGB_BLOCK, kanzi::GraphicsFormatASTC_5x4_UNORM_BLOCK, kanzi::GraphicsFormatASTC_5x4_SRGB_BLOCK, kanzi::GraphicsFormatASTC_5x5_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_5x5_SRGB_BLOCK, kanzi::GraphicsFormatASTC_6x5_UNORM_BLOCK, kanzi::GraphicsFormatASTC_6x5_SRGB_BLOCK, kanzi::GraphicsFormatASTC_6x6_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_6x6_SRGB_BLOCK, kanzi::GraphicsFormatASTC_8x5_UNORM_BLOCK, kanzi::GraphicsFormatASTC_8x5_SRGB_BLOCK, kanzi::GraphicsFormatASTC_8x6_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_8x6_SRGB_BLOCK, kanzi::GraphicsFormatASTC_8x8_UNORM_BLOCK, kanzi::GraphicsFormatASTC_8x8_SRGB_BLOCK, kanzi::GraphicsFormatASTC_10x5_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_10x5_SRGB_BLOCK, kanzi::GraphicsFormatASTC_10x6_UNORM_BLOCK, kanzi::GraphicsFormatASTC_10x6_SRGB_BLOCK, kanzi::GraphicsFormatASTC_10x8_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_10x8_SRGB_BLOCK, kanzi::GraphicsFormatASTC_10x10_UNORM_BLOCK, kanzi::GraphicsFormatASTC_10x10_SRGB_BLOCK, kanzi::GraphicsFormatASTC_12x10_UNORM_BLOCK,
  kanzi::GraphicsFormatASTC_12x10_SRGB_BLOCK, kanzi::GraphicsFormatASTC_12x12_UNORM_BLOCK, kanzi::GraphicsFormatASTC_12x12_SRGB_BLOCK, kanzi::GraphicsFormatALPHA1_LUMINANCE7_UNORM,
  kanzi::GraphicsFormatALPHA4_LUMINANCE4_UNORM, kanzi::GraphicsFormatALPHA8_LUMINANCE8_UNORM, kanzi::GraphicsFormatALPHALUMINANCE1_UNORM, kanzi::GraphicsFormatALPHALUMINANCE2_UNORM,
  kanzi::GraphicsFormatALPHALUMINANCE4_UNORM, kanzi::GraphicsFormatALPHALUMINANCE8_UNORM, kanzi::GraphicsFormatA1R5G5B5_UNORM, kanzi::GraphicsFormatR5G5B5A1_UNORM,
  kanzi::GraphicsFormatA4R4G4B4_UNORM, kanzi::GraphicsFormatR4G4B4A4_UNORM, kanzi::GraphicsFormatA8R8G8B8_UNORM, kanzi::GraphicsFormatCLUT8_UINT,
  kanzi::GraphicsFormatCLUT4_UINT, kanzi::GraphicsFormatCLUT2_UINT, kanzi::GraphicsFormatCLUT1_UINT, kanzi::GraphicsFormatR8_SNORM,
  kanzi::GraphicsFormatR32_UINT, kanzi::GraphicsFormatR32_SINT, kanzi::GraphicsFormatR32_SFLOAT, kanzi::GraphicsFormatR8G8_SNORM,
  kanzi::GraphicsFormatR32G32_UINT, kanzi::GraphicsFormatR32G32_SINT, kanzi::GraphicsFormatR32G32_SFLOAT, kanzi::GraphicsFormatR8G8B8_SNORM,
  kanzi::GraphicsFormatR32G32B32_UINT, kanzi::GraphicsFormatR32G32B32_SINT, kanzi::GraphicsFormatR32G32B32_SFLOAT, kanzi::GraphicsFormatR8G8B8A8_SNORM,
  kanzi::GraphicsFormatR32G32B32A32_UINT, kanzi::GraphicsFormatR32G32B32A32_SINT, kanzi::GraphicsFormatR32G32B32A32_SFLOAT, kanzi::GraphicsFormatR16_UNORM,
  kanzi::GraphicsFormatR16_SNORM, kanzi::GraphicsFormatR16G16_UNORM, kanzi::GraphicsFormatR16G16_SNORM, kanzi::GraphicsFormatR16G16B16_UNORM,
  kanzi::GraphicsFormatR16G16B16_SNORM, kanzi::GraphicsFormatR16G16B16A16_UNORM, kanzi::GraphicsFormatR16G16B16A16_SNORM, kanzi::GraphicsFormatGlRangeBegin,
  kanzi::GraphicsFormatGlRangeEnd, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_ALPHA8, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_LUM8, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL17,
  kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL44, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL88, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL1, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL2,
  kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL4, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_AL8, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_RGB565, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_ARGB1555,
  kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_RGBA5551, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_ARGB4444, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_RGBA4444, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_ARGB8888,
  kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_RGBA8888, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_CLUT_8, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_CLUT_4, kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_CLUT_2,
  kanzi::GraphicsFormatR_DRW2D_PIXELFORMAT_CLUT_1, kanzi::GraphicsFormatFullRangeBegin, kanzi::GraphicsFormatFullRangeEnd
}
 GraphicsFormat specifies format of graphics data used for example in textures and vertex attributes. More...
 

Functions

KANZI_API bool kanzi::isValid (GraphicsFormat format)
 Indicates whether format is valid. More...
 
KANZI_API unsigned int kanzi::getBitsPerBlock (GraphicsFormat format)
 Returns number of bits per block of the specified format. More...
 
KANZI_API unsigned int kanzi::getBytesPerBlock (GraphicsFormat format)
 Returns number of bytes per block of the specified format. More...
 
KANZI_API bool kanzi::isCompressed (GraphicsFormat format)
 Indicates whether format is compressed format or not. More...
 
KANZI_API GraphicsFormat kanzi::getFallback (GraphicsFormat format)
 Returns an alternative format which is potentially more widely supported. More...
 
KANZI_API GraphicsFormat kanzi::getCommon (GraphicsFormat format1, GraphicsFormat format2)
 Returns a common superset of two formats, or GraphicsFormatNone if formats cannot be combined. More...
 
KANZI_API GraphicsDataType kanzi::getDataType (GraphicsFormat format)
 Returns data type of the format. More...
 
KANZI_API unsigned int kanzi::getChannelCount (GraphicsFormat format)
 Returns number of unique color channels of the format. More...
 
KANZI_API unsigned int kanzi::getDataSizeBytes (int width, int height, GraphicsFormat format)
 Returns data size in bytes for image with specified dimensions and format. More...
 
KANZI_API bool kanzi::hasColor (GraphicsFormat format)
 Indicates whether given format has one more more color channels. More...
 
KANZI_API bool kanzi::hasAlpha (GraphicsFormat format)
 Indicates whether given format has alpha channel. More...
 
KANZI_API bool kanzi::hasDepth (GraphicsFormat format)
 Indicates whether given format has depth channel. More...
 
KANZI_API bool kanzi::hasStencil (GraphicsFormat format)
 Indicates whether given format has stencil channel. More...
 
KANZI_API bool kanzi::hasAliasedChannel (GraphicsFormat format)
 Indicates whether given format has an aliased color channel. More...
 
KANZI_API unsigned int kanzi::getBitCount (GraphicsDataType dataType)
 Return number of bits per one element of data type. More...
 
KANZI_API unsigned int kanzi::getBitCount (GraphicsDataType dataType, unsigned int componentCount)
 Return number of bits per one element of data type. More...
 
KANZI_API unsigned int kanzi::getByteCount (GraphicsDataType dataType)
 Return number of bytes per one element of data type. More...
 
KANZI_API bool kanzi::isPacked (GraphicsDataType dataType)
 Indicates whether given data type is packed or not. More...
 
KANZI_API unsigned int kanzi::getByteCount (GraphicsDataType dataType, unsigned int componentCount)
 Returns number of bytes for graphics data. More...
 
KANZI_API FixedString kanzi::toFixedString (GraphicsDataType dataType)
 Returns human readable string for GraphicsDataType. More...
 
KANZI_API FixedString kanzi::toFixedString (GraphicsFormat format)
 Returns human readable string for GraphicsFormat. More...
 
KANZI_API optional< GraphicsFormat > kanzi::findGraphicsFormatByName (string_view formatName)
 Returns GraphicsFormat given its name as a human readable string. More...