Class Ktx2Loader¶
Namespace: Apogee.Content
Assembly: Apogee.Content.dll
Loads KTX 2 files. Basis Universal data (ETC1S and UASTC) is transcoded to the best format the GPU samples: BC7, ASTC 4x4, or RGBA8.
public static class Ktx2Loader
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
Magic¶
The file magic of a KTX 2 file («KTX 20»\r\n\x1A\n).
public static ReadOnlySpan<byte> Magic { get; }
Property Value¶
Methods¶
IsKtx2(ReadOnlySpan<byte>)¶
public static bool IsKtx2(ReadOnlySpan<byte> file)
Parameters¶
file ReadOnlySpan<byte>
Returns¶
IsSrgb(string, ReadOnlySpan<byte>)¶
Whether the file says its colors are sRGB: the transfer function in its data format descriptor, which holds for RGBA8 and for Basis Universal data alike.
public static bool IsSrgb(string name, ReadOnlySpan<byte> file)
Parameters¶
name string
file ReadOnlySpan<byte>
Returns¶
Exceptions¶
It is not a readable KTX 2 file.
Load(string, ReadOnlySpan<byte>, bool, TextureCaps, SamplerData)¶
public static TextureData Load(string name, ReadOnlySpan<byte> file, bool srgb, TextureCaps caps, SamplerData sampler)
Parameters¶
name string
file ReadOnlySpan<byte>
srgb bool
Whether the colors are sRGB (base color, emissive) or linear (normals, roughness…); it picks the sampled format, whatever the file says.
caps TextureCaps
sampler SamplerData