Table of Contents

Enum DdsTextureFormat

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

The formats the DDS writer writes, each a DXGI format; Srgb picks the _SRGB form where there is one.

public enum DdsTextureFormat

Fields

A8 = 5

A8_UNORM: alpha only. Legacy header A8.

Bc1 = 19

BC1 (DXT1): RGB with 1-bit alpha, 4 bits a pixel.

Bc2 = 20

BC2 (DXT3): RGB with explicit 4-bit alpha, 8 bits a pixel.

Bc3 = 21

BC3 (DXT5): RGB with interpolated alpha, 8 bits a pixel.

Bc4 = 22

BC4 (ATI1): one channel, the raster's gray, 4 bits a pixel.

Bc5 = 23

BC5 (ATI2): red and green, for normal maps, 8 bits a pixel.

Bc6h = 25

BC6H_UF16: unsigned half-float RGB for HDR, 8 bits a pixel; negatives become 0. DX10 header.

Bc6hSigned = 26

BC6H_SF16: signed half-float RGB for HDR, 8 bits a pixel. DX10 header.

Bc7 = 24

BC7: RGBA at 8 bits a pixel, with eight modes and partitions; the best quality of the 8-bit block formats. DX10 header.

Bgr565 = 16

B5G6R5_UNORM: 16-bit colour. Legacy header R5G6B5.

Bgra4444 = 18

B4G4R4A4_UNORM: 4 bits a channel. Legacy header A4R4G4B4.

Bgra5551 = 17

B5G5R5A1_UNORM: 15-bit colour and 1-bit alpha. Legacy header A1R5G5B5.

Bgra8 = 1

B8G8R8A8_UNORM: 8-bit BGRA. Legacy header A8R8G8B8.

Bgrx8 = 2

B8G8R8X8_UNORM: 8-bit BGR with an unused byte. Legacy header X8R8G8B8.

D16 = 47

D16_UNORM: 16-bit depth, the raster's gray. DX10 header.

D24S8 = 48

D24_UNORM_S8_UINT: 24-bit depth from the raster's gray, stencil 0. DX10 header.

D32F = 49

D32_FLOAT: float depth, the raster's gray. DX10 header.

D32FS8 = 50

D32_FLOAT_S8X24_UINT: float depth from the raster's gray, stencil 0. DX10 header.

Nv12 = 51

NV12: 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 = 52

P010: 10-bit 4:2:0 video, as Nv12 with 16-bit samples holding 10 bits in their high bits. DX10 header.

P016 = 53

P016: 16-bit 4:2:0 video, as Nv12 with 16-bit samples. DX10 header.

R11G11B10F = 14

R11G11B10_FLOAT: unsigned 11-, 11- and 10-bit floats, for HDR colour without alpha.

R16 = 6

R16_UNORM: one 16-bit channel, the raster's gray. Legacy header L16.

R16SInt = 34

R16_SINT: one 16-bit signed integer from the raster's gray, offset by 32768: 32768 stores 0. DX10 header.

R16UInt = 33

R16_UINT: one 16-bit unsigned integer, the raster's gray as 0 to 65535. DX10 header.

R32F = 10

R32_FLOAT: one float channel, the raster's gray.

R32SInt = 40

R32_SINT: one 32-bit signed integer, the raster's float gray rounded as in R32UInt. DX10 header.

R32UInt = 39

R32_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 = 3

R8_UNORM: one 8-bit channel, the raster's gray. Legacy header L8.

R8SInt = 28

R8_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 = 27

R8_UINT: one 8-bit unsigned integer, the raster's gray as 0 to 255. DX10 header.

Rg16 = 7

R16G16_UNORM: red and green, 16 bits each. Legacy header G16R16.

Rg16SInt = 36

R16G16_SINT: red and green as 16-bit signed integers, offset by 32768 as in R16SInt. DX10 header.

Rg16UInt = 35

R16G16_UINT: red and green as 16-bit unsigned integers. DX10 header.

Rg32SInt = 42

R32G32_SINT: red and green as 32-bit signed integers, rounded as in R32UInt. DX10 header.

Rg32UInt = 41

R32G32_UINT: red and green as 32-bit unsigned integers, rounded as in R32UInt. DX10 header.

Rg8 = 4

R8G8_UNORM: red and green, 8 bits each, as two-channel normal maps keep them.

Rg8SInt = 30

R8G8_SINT: red and green as 8-bit signed integers, offset by 128 as in R8SInt. DX10 header.

Rg8UInt = 29

R8G8_UINT: red and green as 8-bit unsigned integers. DX10 header.

Rgb10A2 = 13

R10G10B10A2_UNORM: 10-bit RGB and 2-bit alpha.

Rgb32SInt = 44

R32G32B32_SINT: RGB as 32-bit signed integers, rounded as in R32UInt. DX10 header.

Rgb32UInt = 43

R32G32B32_UINT: RGB as 32-bit unsigned integers, rounded as in R32UInt. DX10 header.

Rgb9E5 = 15

R9G9B9E5_SHAREDEXP: three 9-bit mantissas sharing an exponent, for HDR colour without alpha.

RgbF32 = 11

R32G32B32_FLOAT: float RGB.

Rgba16 = 8

R16G16B16A16_UNORM: 16-bit RGBA. Legacy header D3DFMT 36.

Rgba16SInt = 38

R16G16B16A16_SINT: RGBA as 16-bit signed integers, offset by 32768 as in R16SInt. DX10 header.

Rgba16UInt = 37

R16G16B16A16_UINT: RGBA as 16-bit unsigned integers. DX10 header.

Rgba32SInt = 46

R32G32B32A32_SINT: RGBA as 32-bit signed integers, rounded as in R32UInt. DX10 header.

Rgba32UInt = 45

R32G32B32A32_UINT: RGBA as 32-bit unsigned integers, rounded as in R32UInt. DX10 header.

Rgba8 = 0

R8G8B8A8_UNORM: 8-bit RGBA. Legacy header A8B8G8R8.

Rgba8SInt = 32

R8G8B8A8_SINT: RGBA as 8-bit signed integers, offset by 128 as in R8SInt. DX10 header.

Rgba8UInt = 31

R8G8B8A8_UINT: RGBA as 8-bit unsigned integers. DX10 header.

RgbaF16 = 9

R16G16B16A16_FLOAT: half-float RGBA.

RgbaF32 = 12

R32G32B32A32_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 });
}