Table of Contents

Enum KtxDimension

Namespace
Egami.Formats.Extended.Ktx
Assembly
Egami.Formats.Extended.dll

The kind of texture a KTX file holds.

public enum KtxDimension

Fields

Texture1D = 0

A row of texels: height 1.

Texture2D = 1

A 2D texture, an array of them or a cube map.

Texture3D = 2

A volume texture: a stack of depth slices that shrinks with each mip.

Examples

// What the file says: the Vulkan format, supercompression, layout, mips, colour, orientation and key/value data.
using Raster texture = Raster.Load("texture.ktx2", context);
if (texture.Metadata.FormatDetails is KtxDetails ktx)
{
    Console.WriteLine($"{ktx.FormatName} (VkFormat {ktx.VkFormat}), {ktx.Supercompression}, {ktx.MipLevels} mips");
    Console.WriteLine($"{ktx.Dimension}, cube: {ktx.IsCube}, sRGB {ktx.IsSrgb}, alpha {ktx.AlphaMode}, orientation {ktx.Orientation}");
    foreach ((string key, string value) in ktx.KeyValues)
    {
        Console.WriteLine($"{key} = {value}");
    }
}