Ktx2Header Class
The immutable header, data format descriptor and key/value data of the KTX 2.0 file an image was decoded from. This is informational only, like ImageMetadata.SourceFormat: it describes the file, not the pixels.
public sealed class Ktx2Header : IEquatable<Ktx2Header>Remarks
The decoder applies what changes the pixels the texture means: the component mapping of KTXswizzle (the channels a format lacks are 0, and alpha 1), and the transfer function and the primaries of the data format descriptor as the color labels of the image (ImageMetadata.TransferFunction, ImageMetadata.Cicp). KTXorientation is reported as ImageMetadata.Orientation, which AutoOrient applies.
No operation updates it, and every encoder ignores it.
- Implements
Properties
| Name | Description |
|---|---|
| AstcDecodeMode | Gets the value of KTXastcDecodeMode (rgb9e5 or unorm8), or null without it. It is reported, never applied. |
| ColorModel | Gets the color model of the data format descriptor (Khronos Data Format Specification, section 5.5), such as 1 (RGBSDA), 162 (ASTC) or 166 (UASTC). |
| ColorPrimaries | Gets the color primaries of the data format descriptor (section 5.7), such as 1 (BT.709) or 10 (Display P3). |
| FaceCount | Gets the number of faces: 6 for a cube map, 1 otherwise. |
| FormatName | Gets the name of the format, such as R8G8B8A8_SRGB, ASTC_6x6_UNORM_BLOCK or UNDEFINED (UASTC). |
| KeyValueData | Gets the key/value data: each value as it is stored, a NUL-terminated string included. |
| Keys | Gets the keys of the key/value data, in the order of the file. |
| LayerCount | Gets the number of array layers, or 0 for a texture that is not an array. |
| LevelCount | Gets the number of mip levels the file stores, or 0 when it stores the base level only and asks a loader to generate the others. |
| Orientation | Gets the value of KTXorientation, such as rd or ruo, or null without it. |
| PixelDepth | Gets the depth of the base level, in pixels, or 0 for a texture that is not three-dimensional. |
| PixelHeight | Gets the height of the base level, in pixels, or 0 for a one-dimensional texture. |
| PixelWidth | Gets the width of the base level, in pixels. |
| SupercompressionScheme | Gets the supercompression scheme: 0 (none), 1 (BasisLZ), 2 (Zstandard) or 3 (ZLIB). |
| Swizzle | Gets the value of KTXswizzle, such as rrr1, or null without it. |
| TransferFunction | Gets the transfer function of the data format descriptor (section 5.8), such as 1 (linear) or 2 (sRGB). |
| VkFormat | Gets the vkFormat of the header: a value of the Vulkan VkFormat enumeration, or 0 (VK_FORMAT_UNDEFINED) for Basis Universal data. |
| Writer | Gets the value of KTXwriter, the tool that wrote the file, or null without it. |
| WriterScParams | Gets the value of KTXwriterScParams, the options of the tool that wrote the file, or null without it. |
AstcDecodeMode
Ktx2Header.csColorModel
Ktx2Header.csColorPrimaries
Ktx2Header.csFaceCount
Ktx2Header.csFormatName
Ktx2Header.csKeyValueData
Ktx2Header.csGets the key/value data: each value as it is stored, a NUL-terminated string included.
public IReadOnlyDictionary<string, ReadOnlyMemory<byte>> KeyValueData { get; }Property value
Keys
Ktx2Header.csGets the keys of the key/value data, in the order of the file.
public IReadOnlyList<string> Keys { get; }Property value
LayerCount
Ktx2Header.csLevelCount
Ktx2Header.csOrientation
Ktx2Header.csPixelDepth
Ktx2Header.csPixelHeight
Ktx2Header.csPixelWidth
Ktx2Header.csSupercompressionScheme
Ktx2Header.csSwizzle
Ktx2Header.csTransferFunction
Ktx2Header.csVkFormat
Ktx2Header.csWriter
Ktx2Header.csWriterScParams
Ktx2Header.csMethods
| Name | Description |
|---|---|
| Equals(Ktx2Header?) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Determines whether the specified object is equal to the current object. |
| GetHashCode() | Serves as the default hash function. |
| ToString() | Returns a string that represents the current object. |
Equals overloads
Equals(Ktx2Header?)
Ktx2Header.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(Ktx2Header? other)Parameters
otherKtx2Header?- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.