Class KtxFormat
KTX 1.1, the Khronos texture container for OpenGL: a header naming the OpenGL format, key/value data, then every mip level
of every array layer, cube face and depth slice, uncompressed or in BC1 to BC7, ETC1, ETC2, EAC or 2D ASTC blocks, in either
byte order. Load gives mip 0 of the first surface, turned upright and swizzled as the file's KTXorientation and
KTXswizzle say; LoadAll and KtxReaderOptions reach the others. Read only. Registered with WithKtx(EgamiContext).
public static class KtxFormat
- Inheritance
-
KtxFormat
- Inherited Members
Examples
// KTX 1.1 (.ktx) and KTX 2.0 (.ktx2) are two formats; WithExtendedFormats() registers both.
EgamiContext context = EgamiContext.Default.WithKtx().WithKtx2();
// Load gives mip 0 of the first surface, upright, in the format's natural pixel type (Rgba8 for RGBA8 and BC7).
using Raster texture = Raster.Load("texture.ktx2", context);
texture.Save("texture.png");
// Probe reads the headers alone: the surfaces at mip 0 are its images.
RasterInfo info = Raster.Probe("sky.ktx2", context);
Console.WriteLine($"{info.Width}×{info.Height}, {info.ImageCount} surface(s)");
Properties
Info
Gets the format's registration: name, MIME type, extension, signature and reader.
public static FormatInfo Info { get; }