Enum DdsTextureFormat
The formats the DDS writer writes, each a DXGI format; Srgb picks the _SRGB form where there is one.
public enum DdsTextureFormat
Fields
A8 = 5A8_UNORM: alpha only. Legacy header A8.
Bc1 = 19BC1 (DXT1): RGB with 1-bit alpha, 4 bits a pixel.
Bc2 = 20BC2 (DXT3): RGB with explicit 4-bit alpha, 8 bits a pixel.
Bc3 = 21BC3 (DXT5): RGB with interpolated alpha, 8 bits a pixel.
Bc4 = 22BC4 (ATI1): one channel, the raster's gray, 4 bits a pixel.
Bc5 = 23BC5 (ATI2): red and green, for normal maps, 8 bits a pixel.
Bc6h = 25BC6H_UF16: unsigned half-float RGB for HDR, 8 bits a pixel; negatives become 0. DX10 header.
Bc6hSigned = 26BC6H_SF16: signed half-float RGB for HDR, 8 bits a pixel. DX10 header.
Bc7 = 24BC7: RGBA at 8 bits a pixel, with eight modes and partitions; the best quality of the 8-bit block formats. DX10 header.
Bgr565 = 16B5G6R5_UNORM: 16-bit colour. Legacy header R5G6B5.
Bgra4444 = 18B4G4R4A4_UNORM: 4 bits a channel. Legacy header A4R4G4B4.
Bgra5551 = 17B5G5R5A1_UNORM: 15-bit colour and 1-bit alpha. Legacy header A1R5G5B5.
Bgra8 = 1B8G8R8A8_UNORM: 8-bit BGRA. Legacy header A8R8G8B8.
Bgrx8 = 2B8G8R8X8_UNORM: 8-bit BGR with an unused byte. Legacy header X8R8G8B8.
D16 = 47D16_UNORM: 16-bit depth, the raster's gray. DX10 header.
D24S8 = 48D24_UNORM_S8_UINT: 24-bit depth from the raster's gray, stencil 0. DX10 header.
D32F = 49D32_FLOAT: float depth, the raster's gray. DX10 header.
D32FS8 = 50D32_FLOAT_S8X24_UINT: float depth from the raster's gray, stencil 0. DX10 header.
Nv12 = 51NV12: 8-bit 4:2:0 video, a Y′ plane then interleaved Cb and Cr at half size, BT.601 studio range. Width and height must be even, and only mip 0 is written, as Direct3D has no mips for planar formats. DX10 header.
P010 = 52P010: 10-bit 4:2:0 video, as Nv12 with 16-bit samples holding 10 bits in their high bits. DX10 header.
P016 = 53P016: 16-bit 4:2:0 video, as Nv12 with 16-bit samples. DX10 header.
R11G11B10F = 14R11G11B10_FLOAT: unsigned 11-, 11- and 10-bit floats, for HDR colour without alpha.
R16 = 6R16_UNORM: one 16-bit channel, the raster's gray. Legacy header L16.
R16SInt = 34R16_SINT: one 16-bit signed integer from the raster's gray, offset by 32768: 32768 stores 0. DX10 header.
R16UInt = 33R16_UINT: one 16-bit unsigned integer, the raster's gray as 0 to 65535. DX10 header.
R32F = 10R32_FLOAT: one float channel, the raster's gray.
R32SInt = 40R32_SINT: one 32-bit signed integer, the raster's float gray rounded as in R32UInt. DX10 header.
R32UInt = 39R32_UINT: one 32-bit unsigned integer, the raster's float gray rounded to the nearest integer and clamped to the type's range; values up to 2²⁴ survive a float raster exactly. DX10 header.
R8 = 3R8_UNORM: one 8-bit channel, the raster's gray. Legacy header L8.
R8SInt = 28R8_SINT: one 8-bit signed integer from the raster's gray, offset as the reader maps it back: 0 stores −128, 128 stores 0 and 255 stores 127. DX10 header.
R8UInt = 27R8_UINT: one 8-bit unsigned integer, the raster's gray as 0 to 255. DX10 header.
Rg16 = 7R16G16_UNORM: red and green, 16 bits each. Legacy header G16R16.
Rg16SInt = 36R16G16_SINT: red and green as 16-bit signed integers, offset by 32768 as in R16SInt. DX10 header.
Rg16UInt = 35R16G16_UINT: red and green as 16-bit unsigned integers. DX10 header.
Rg32SInt = 42R32G32_SINT: red and green as 32-bit signed integers, rounded as in R32UInt. DX10 header.
Rg32UInt = 41R32G32_UINT: red and green as 32-bit unsigned integers, rounded as in R32UInt. DX10 header.
Rg8 = 4R8G8_UNORM: red and green, 8 bits each, as two-channel normal maps keep them.
Rg8SInt = 30R8G8_SINT: red and green as 8-bit signed integers, offset by 128 as in R8SInt. DX10 header.
Rg8UInt = 29R8G8_UINT: red and green as 8-bit unsigned integers. DX10 header.
Rgb10A2 = 13R10G10B10A2_UNORM: 10-bit RGB and 2-bit alpha.
Rgb32SInt = 44R32G32B32_SINT: RGB as 32-bit signed integers, rounded as in R32UInt. DX10 header.
Rgb32UInt = 43R32G32B32_UINT: RGB as 32-bit unsigned integers, rounded as in R32UInt. DX10 header.
Rgb9E5 = 15R9G9B9E5_SHAREDEXP: three 9-bit mantissas sharing an exponent, for HDR colour without alpha.
RgbF32 = 11R32G32B32_FLOAT: float RGB.
Rgba16 = 8R16G16B16A16_UNORM: 16-bit RGBA. Legacy header D3DFMT 36.
Rgba16SInt = 38R16G16B16A16_SINT: RGBA as 16-bit signed integers, offset by 32768 as in R16SInt. DX10 header.
Rgba16UInt = 37R16G16B16A16_UINT: RGBA as 16-bit unsigned integers. DX10 header.
Rgba32SInt = 46R32G32B32A32_SINT: RGBA as 32-bit signed integers, rounded as in R32UInt. DX10 header.
Rgba32UInt = 45R32G32B32A32_UINT: RGBA as 32-bit unsigned integers, rounded as in R32UInt. DX10 header.
Rgba8 = 0R8G8B8A8_UNORM: 8-bit RGBA. Legacy header A8B8G8R8.
Rgba8SInt = 32R8G8B8A8_SINT: RGBA as 8-bit signed integers, offset by 128 as in R8SInt. DX10 header.
Rgba8UInt = 31R8G8B8A8_UINT: RGBA as 8-bit unsigned integers. DX10 header.
RgbaF16 = 9R16G16B16A16_FLOAT: half-float RGBA.
RgbaF32 = 12R32G32B32A32_FLOAT: float RGBA.
Examples
// A BC3 texture with its full mip chain: the format, mip count, effort (0 to 6) and header are options.
using (FileStream output = File.Create("duck.dds"))
{
image.Save(output, DdsFormat.Info, new DdsWriterOptions { Format = DdsTextureFormat.Bc3, Effort = 5 });
}
// An sRGB colour texture without mips, in the DX10 header.
using (FileStream output = File.Create("duck-srgb.dds"))
{
image.Save(output, DdsFormat.Info, new DdsWriterOptions { Format = DdsTextureFormat.Bc1, Srgb = true, MipLevels = 1 });
}
// Six faces back into a cube map; SaveAll without Cube writes a texture array.
using RasterList faces = Raster.LoadAll("sky.dds", context);
using (FileStream output = File.Create("sky-bc1.dds"))
{
Raster.SaveAll(faces, output, DdsFormat.Info, new DdsWriterOptions { Cube = true, Format = DdsTextureFormat.Bc1 });
}