Table of Contents

Class DdsDecoder

Namespace
SharpDX.WIC
Assembly
SharpDX.Direct2D1.dll
[Guid("409cd537-8532-40cb-9774-e2feb2df4e9c")]
public class DdsDecoder : ComObject
Inheritance
DdsDecoder

Constructors

DdsDecoder(nint)

public DdsDecoder(nint nativePtr)

Parameters

nativePtr nint

Properties

Parameters

Gets DDS-specific data.

public DdsParameters Parameters { get; }

Property Value

DdsParameters

Methods

GetFrame(int, int, int, out BitmapFrameDecode)

Retrieves the specified frame of the DDS image.

public void GetFrame(int arrayIndex, int mipLevel, int sliceIndex, out BitmapFrameDecode bitmapFrameOut)

Parameters

arrayIndex int

The requested index within the texture array.

mipLevel int

The requested mip level.

sliceIndex int

The requested slice within the 3D texture.

bitmapFrameOut BitmapFrameDecode

A reference to a BitmapFrameDecode object.

Remarks

A DDS file can contain multiple images that are organized into a three level hierarchy. First, DDS file may contain multiple textures in a texture array. Second, each texture can have multiple mip levels. Finally, the texture may be a 3D (volume) texture and have multiple slices, each of which is a 2D texture. See the DDS documentation for more information.

WIC maps this three level hierarchy into a linear array of BitmapFrameDecode, accessible via IWICBitmapDecoder::GetFrame. However, determining which frame corresponds to a triad of arrayIndex, mipLevel, and sliceIndex value is not trivial because each mip level of a 3D texture has a different depth (number of slices). This method provides additional convenience over IWICBitmapDecoder::GetFrame for DDS images by calculating the correct frame given the three indices.

Operators

explicit operator DdsDecoder(nint)

public static explicit operator DdsDecoder(nint nativePtr)

Parameters

nativePtr nint

Returns

DdsDecoder