Table of Contents

Class DdsFormat

Namespace
Egami.Formats.Extended.Dds
Assembly
Egami.Formats.Extended.dll

DDS (DirectDraw Surface), the texture container of Direct3D and most game engines: a header, then every mip level of every face, array slice or depth slice, uncompressed or in BC1 to BC7 blocks. Load gives mip 0 of the first surface; LoadAll and DdsReaderOptions reach the others. Save writes a texture with a full mip chain, SaveAll an array or a cube map (DdsWriterOptions). Registered with WithDds(EgamiContext).

public static class DdsFormat
Inheritance
DdsFormat
Inherited Members

Examples

// Load gives mip 0 of the first surface, in the format's natural pixel type (Rgba8 for BC1 to BC3, BC7 and RGBA8).
EgamiContext context = EgamiContext.Default.WithDds();
using Raster texture = Raster.Load("rock.dds", context);
texture.Save("rock.png");

// Probe reads the header alone: the surfaces at mip 0 are its images.
RasterInfo info = Raster.Probe("rock.dds", context);
Console.WriteLine($"{info.Width}×{info.Height}, {info.ImageCount} surface(s)");

Properties

Info

Gets the format's registration: name, MIME types, extensions, signature, reader and writer.

public static FormatInfo Info { get; }

Property Value

FormatInfo