Table of Contents

Class DdsDetails

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

Details only DDS has, kept in FormatDetails.

public sealed class DdsDetails : FormatDetails
Inheritance
DdsDetails
Inherited Members

Examples

// What the header says: the DXGI format, the mip count, the dimension, cube and array layout and the alpha mode.
using Raster texture = Raster.Load("rock.dds", context);
if (texture.Metadata.FormatDetails is DdsDetails dds)
{
    Console.WriteLine($"{dds.FormatName} (DXGI {dds.DxgiFormat}), {dds.MipLevels} mips, {dds.Dimension}, cube: {dds.IsCube}");
    Console.WriteLine($"alpha {dds.AlphaMode}, sRGB {dds.IsSrgb}, DX10 header {dds.Dx10Header}");
}

// An _SRGB format is tagged sRGB; any other loads its values as stored.
bool srgb = texture.Metadata.ColorSpace == ColorSpaceHint.Srgb;

Properties

AlphaMode

Gets or sets how the alpha channel is meant to be read.

public DdsAlphaMode AlphaMode { get; set; }

Property Value

DdsAlphaMode

ArraySize

Gets or sets the number of array elements; for a cube map, the number of cubes.

public int ArraySize { get; set; }

Property Value

int

Depth

Gets or sets the depth of mip 0 of a volume texture, else 1.

public int Depth { get; set; }

Property Value

int

Dimension

Gets or sets the texture's dimension.

public DdsDimension Dimension { get; set; }

Property Value

DdsDimension

Dx10Header

Gets or sets whether the file has the DX10 header.

public bool Dx10Header { get; set; }

Property Value

bool

DxgiFormat

Gets or sets the DXGI format number, as Microsoft's DXGI_FORMAT lists it (98 is BC7_UNORM). A legacy header's format is given as the DXGI format it maps to, or 0 for bit masks and palettes that have none.

public int DxgiFormat { get; set; }

Property Value

int

FormatName

Gets or sets the format's name, such as BC7_UNORM_SRGB, DXT1-style legacy formats under their DXGI name, or a description of legacy bit masks.

public string FormatName { get; set; }

Property Value

string

FourCC

Gets or sets the legacy header's FourCC, such as DXT5, or null for none.

public string? FourCC { get; set; }

Property Value

string

IsCube

Gets or sets whether the texture is a cube map.

public bool IsCube { get; set; }

Property Value

bool

IsSrgb

Gets or sets whether the format is an _SRGB one, whose values are sRGB-encoded.

public bool IsSrgb { get; set; }

Property Value

bool

MipLevel

Gets or sets the mip level this raster is; 0 is full size.

public int MipLevel { get; set; }

Property Value

int

MipLevels

Gets or sets the number of mip levels the file stores, at least 1.

public int MipLevels { get; set; }

Property Value

int

Surface

Gets or sets the surface this raster is: the index of its face or array slice, or its depth slice in a volume.

public int Surface { get; set; }

Property Value

int

Methods

Copy()

Returns a deep copy.

public override FormatDetails Copy()

Returns

FormatDetails

The copy.

PixelsChanged()

Forgets what the details say about color, once the pixels have been converted to another encoding.

protected override void PixelsChanged()