![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
Functions | |
| constexpr int8_t | red (ImageFormat format) |
| Get the number of bits of precision of the red channel in the given format. | |
| constexpr int8_t | decompressedRed (ImageFormat format) |
| Get the number of bits of precision of the red channel in the given format regardless of compression. | |
| constexpr int8_t | green (ImageFormat format) |
| Get the number of bits of precision of the green channel in the given format. | |
| constexpr int8_t | decompressedGreen (ImageFormat format) |
| Get the number of bits of precision of the green channel in the given format regardless of compression. | |
| constexpr int8_t | blue (ImageFormat format) |
| Get the number of bits of precision of the blue channel in the given format. | |
| constexpr int8_t | decompressedBlue (ImageFormat format) |
| Get the number of bits of precision of the blue channel in the given format regardless of compression. | |
| constexpr int8_t | alpha (ImageFormat format) |
| Get the number of bits of precision of the alpha channel in the given format. | |
| constexpr int8_t | decompressedAlpha (ImageFormat format) |
| Get the number of bits of precision of the alpha channel in the given format regardless of compression. | |
| constexpr uint8_t | bpp (ImageFormat format) |
| Find the bits per pixel of the given format. | |
| constexpr ImageFormat | containerFormat (ImageFormat format) |
| Find a container format for the given format, a format that is more commonly understood within this library and can represent the input texture without losing data. | |
| constexpr bool | large (ImageFormat format) |
| Check if the given format is representable by RGBA8888 without losing data. | |
| constexpr bool | decimal (ImageFormat format) |
| Checks if the given format stores floating points in its channels. | |
| constexpr bool | compressed (ImageFormat format) |
| Check if the given format is a compressed format (DXT1, DXT3, DXT5, ATI1N, ATI2N, BC7, BC6H). | |
| constexpr bool | transparent (ImageFormat format) |
| Check if the given format can store transparency. | |
| constexpr bool | opaque (ImageFormat format) |
| Check if the given format cannot store transparency. | |
| constexpr bool | console (ImageFormat format) |
| Check if the given format is exclusively used on console platforms. | |
| constexpr uint32_t | getDataLength (ImageFormat format, uint16_t width, uint16_t height, uint16_t depth=1) |
| Calculate the amount of data required to store a texture with the given format and dimensions. | |
| constexpr uint32_t | getDataLength (ImageFormat format, uint8_t mipCount, uint16_t frameCount, uint8_t faceCount, uint16_t width, uint16_t height, uint16_t depth=1) |
| Calculate the amount of data required to store a texture with the given format, mip/frame/face count, and dimensions. | |
| constexpr uint32_t | getDataLengthXBOX (bool padded, ImageFormat format, uint8_t mipCount, uint16_t frameCount, uint8_t faceCount, uint16_t width, uint16_t height, uint16_t depth=1) |
| Calculate the amount of data required to store an XBOX platform texture with the given format, mip/frame/face count, and dimensions. | |
| constexpr bool | getDataPosition (uint32_t &offset, uint32_t &length, ImageFormat format, uint8_t mip, uint8_t mipCount, uint16_t frame, uint16_t frameCount, uint8_t face, uint8_t faceCount, uint16_t width, uint16_t height, uint16_t slice=0, uint16_t depth=1) |
| Find the position of a specific mip, frame, face, and slice within a texture. | |
| constexpr bool | getDataPositionXbox (uint32_t &offset, uint32_t &length, bool padded, ImageFormat format, uint8_t mip, uint8_t mipCount, uint16_t frame, uint16_t frameCount, uint8_t face, uint8_t faceCount, uint16_t width, uint16_t height, uint16_t slice=0, uint16_t depth=1) |
| Find the position of a specific mip, frame, face, and slice within an XBOX platform texture. | |
|
nodiscardconstexpr |
Get the number of bits of precision of the alpha channel in the given format.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 390 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the blue channel in the given format.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 290 of file ImageFormats.h.
|
nodiscardconstexpr |
Find the bits per pixel of the given format.
Note this is bits per pixel, not bytes per pixel. The DXT1 format is 0.5 bytes per pixel, which cannot be stored in a uint8_t.
| format | The format to find the bits per pixel of. |
Definition at line 492 of file ImageFormats.h.
|
nodiscardconstexpr |
Check if the given format is a compressed format (DXT1, DXT3, DXT5, ATI1N, ATI2N, BC7, BC6H).
| format | The format to check. |
Definition at line 658 of file ImageFormats.h.
|
nodiscardconstexpr |
Check if the given format is exclusively used on console platforms.
| format | The format to check. |
Definition at line 718 of file ImageFormats.h.
|
nodiscardconstexpr |
Find a container format for the given format, a format that is more commonly understood within this library and can represent the input texture without losing data.
| format | The format to find the container format of. |
Definition at line 570 of file ImageFormats.h.
|
nodiscardconstexpr |
Checks if the given format stores floating points in its channels.
| format | The format to check. |
Definition at line 649 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the alpha channel in the given format regardless of compression.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 464 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the blue channel in the given format regardless of compression.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 364 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the green channel in the given format regardless of compression.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 264 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the red channel in the given format regardless of compression.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 163 of file ImageFormats.h.
|
nodiscardconstexpr |
Calculate the amount of data required to store a texture with the given format and dimensions.
| format | The format of the texture. |
| width | The width of the texture. |
| height | The height of the texture. |
| depth | The depth of the texture. |
Definition at line 842 of file ImageFormats.h.
|
nodiscardconstexpr |
Calculate the amount of data required to store a texture with the given format, mip/frame/face count, and dimensions.
| format | The format of the texture. |
| mipCount | The mip count of the texture. |
| frameCount | The frame count of the texture. |
| faceCount | The face count of the texture. |
| width | The width of the texture. |
| height | The height of the texture. |
| depth | The depth of the texture. |
Definition at line 861 of file ImageFormats.h.
|
nodiscardconstexpr |
Calculate the amount of data required to store an XBOX platform texture with the given format, mip/frame/face count, and dimensions.
XBOX platform textures have padding between frames to attempt to align each one to 512 bytes (this explanation is simplified from the actual padding algorithm but is mostly correct).
| padded | Whether to add padding after some frames. Some parts of an XBOX platform texture expect this padding and some do not. |
| format | The format of the texture. |
| mipCount | The mip count of the texture. |
| frameCount | The frame count of the texture. |
| faceCount | The face count of the texture. |
| width | The width of the texture. |
| height | The height of the texture. |
| depth | The depth of the texture. |
Definition at line 886 of file ImageFormats.h.
|
nodiscardconstexpr |
Find the position of a specific mip, frame, face, and slice within a texture.
| offset | Set to the offset of the section of the texture being searched for. |
| length | Set to the length of the section of the texture being searched for. |
| format | The format of the texture. |
| mip | The mip level to search for within the texture. |
| mipCount | The mip count of the texture. |
| frame | The frame to search for within the texture. |
| frameCount | The frame count of the texture. |
| face | The face to search for within the texture. |
| faceCount | The face count of the texture. |
| width | The width of the texture. |
| height | The height of the texture. |
| slice | The slice to search for within the texture. |
| depth | The depth of the texture. |
Definition at line 917 of file ImageFormats.h.
|
nodiscardconstexpr |
Find the position of a specific mip, frame, face, and slice within an XBOX platform texture.
XBOX platform textures are laid out in the inverse of a regular texture in DDS mip layout and have padding between some frames.
| offset | Set to the offset of the section of the texture being searched for. |
| length | Set to the length of the section of the texture being searched for. |
| padded | Whether to add padding after some frames. Some parts of an XBOX platform texture expect this padding and some do not. |
| format | The format of the texture. |
| mip | The mip level to search for within the texture. |
| mipCount | The mip count of the texture. |
| frame | The frame to search for within the texture. |
| frameCount | The frame count of the texture. |
| face | The face to search for within the texture. |
| faceCount | The face count of the texture. |
| width | The width of the texture. |
| height | The height of the texture. |
| slice | The slice to search for within the texture. |
| depth | The depth of the texture. |
Definition at line 959 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the green channel in the given format.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 189 of file ImageFormats.h.
|
nodiscardconstexpr |
Check if the given format is representable by RGBA8888 without losing data.
| format | The format to check. |
Definition at line 640 of file ImageFormats.h.
|
nodiscardconstexpr |
Check if the given format cannot store transparency.
| format | The format to check. |
Definition at line 709 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the number of bits of precision of the red channel in the given format.
| format | The format to get the number of bits of precision in this channel from. |
Definition at line 89 of file ImageFormats.h.
|
nodiscardconstexpr |
Check if the given format can store transparency.
| format | The format to check. |
Definition at line 667 of file ImageFormats.h.