Class DdsReaderOptions
Options for reading DDS.
public sealed record DdsReaderOptions : ReaderOptions, IEquatable<ReaderOptions>, IEquatable<DdsReaderOptions>
- Inheritance
-
DdsReaderOptions
- Implements
- Inherited Members
Examples
// One surface and mip: cube face -Y (faces go +X, -X, +Y, -Y, +Z, -Z), third mip.
using Raster face = Raster.Load("sky.dds", context, new DdsReaderOptions { Surface = 3, MipLevel = 2 });
// Every face at mip 0, or with every mip after its face.
using RasterList faces = Raster.LoadAll("sky.dds", context);
using RasterList all = Raster.LoadAll("sky.dds", context, new DdsReaderOptions { IncludeMipLevels = true });
// A thumbnail reads the smallest mip that still covers the size, a fraction of the file.
using Raster thumbnail = Raster.Load("sky.dds", context, new ReaderOptions { MinimumSize = new Size(8, 8) });
// Two-channel normal maps (BC5, R8G8) load with blue 0, or with Z rebuilt.
using Raster normals = Raster.Load("sky.dds", context, new DdsReaderOptions { ReconstructNormalZ = true });
Properties
IncludeMipLevels
Gets whether LoadAll also returns every mip level, each after the surface it belongs to. Defaults to false: mip 0 of each surface only.
public bool IncludeMipLevels { get; init; }
Property Value
MipLevel
Gets the mip level Load returns, or null (the default) for mip 0, or the smallest that covers
MinimumSize. A volume's depth slice Surface at mip m is slice
Surface >> m of that mip.
public int? MipLevel { get; init; }
Property Value
- int?
Exceptions
- ArgumentOutOfRangeException
The value is negative.
ReconstructNormalZ
Gets whether a two-channel normal map (BC5, R8G8, R16G16) gets its blue channel rebuilt as the normal's Z, sqrt(1 − x² − y²), instead of 0. Defaults to false.
public bool ReconstructNormalZ { get; init; }
Property Value
Surface
Gets the surface Load returns, or null (the default) for the first: the index of a face or array slice (cube faces in the order +X, −X, +Y, −Y, +Z, −Z, each cube after the one before), or of a depth slice of a volume.
public int? Surface { get; init; }
Property Value
- int?
Exceptions
- ArgumentOutOfRangeException
The value is negative.