![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
Functions | |
| constexpr uint16_t | getMipDim (uint8_t mip, uint16_t dim, bool addCompressedFormatPadding=false) |
| Get the dimension at a given mip level. | |
| constexpr std::pair< uint16_t, uint16_t > | getMipDims (uint8_t mip, uint16_t width, uint16_t height, bool addCompressedFormatPadding=false) |
| Get the width and height at a given mip level. | |
| constexpr std::tuple< uint16_t, uint16_t, uint16_t > | getMipDims (uint8_t mip, uint16_t width, uint16_t height, uint16_t depth, bool addCompressedFormatPadding=false) |
| Get the width, height, and depth at a given mip level. | |
| constexpr uint8_t | getMaximumMipCount (uint16_t width, uint16_t height, uint16_t depth=1) |
| Calculate the largest mip count a texture with the given width, height, and depth can contain. | |
|
nodiscardconstexpr |
Calculate the largest mip count a texture with the given width, height, and depth can contain.
On console platforms, since there is no mip count field in the header, this determines the actual mip count if the texture contains mips.
| width | The width of the largest mip in the texture. |
| height | The height of the largest mip in the texture. |
| depth | The depth of the largest mip in the texture. |
Definition at line 817 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the dimension at a given mip level.
Does not include padding added by compressed formats by default.
| mip | The mip level. This should not be enabled if the input dimension is depth, as compressed formats are compressed on 2D slices. Otherwise, it should be enabled if ImageFormatDetails::compressed(format) is true. |
| dim | The dimension of the largest mip in the texture. Can be width, height, or depth. |
| addCompressedFormatPadding | Aligns the output dimension to 4 pixels. |
Definition at line 753 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the width and height at a given mip level.
Does not include padding added by compressed formats by default.
| mip | The mip level. |
| width | The width of the largest mip in the texture. |
| height | The height of the largest mip in the texture. |
| addCompressedFormatPadding | Aligns the output width and height to 4 pixels. |
Definition at line 774 of file ImageFormats.h.
|
nodiscardconstexpr |
Get the width, height, and depth at a given mip level.
Does not include padding added by compressed formats by default.
| mip | The mip level. |
| width | The width of the largest mip in the texture. |
| height | The height of the largest mip in the texture. |
| depth | The depth of the largest mip in the texture. |
| addCompressedFormatPadding | Aligns the output width and height to 4 pixels. |
Definition at line 795 of file ImageFormats.h.