Indicates the pixel format of a DXSurface object. This enumerated type is returned from the IDXARGBReadPtr::GetNativeType and IDXSurface::GetPixelFormat methods.
Syntax
typedef enum DXSAMPLEFORMATENUM { DXPF_FLAGSMASK = (0xFFFF0000), DXPF_NONPREMULT = (0x00010000), DXPF_TRANSPARENCY = (0x00020000), DXPF_TRANSLUCENCY = (0x00040000), DXPF_2BITERROR = (0x00200000), DXPF_3BITERROR = (0x00300000), DXPF_4BITERROR = (0x00400000), DXPF_5BITERROR = (0x00500000), DXPF_ERRORMASK = (0x00700000), DXPF_NONSTANDARD = (0), DXPF_PMARGB32 = (1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), DXPF_ARGB32 = (2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), DXPF_ARGB4444 = (3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR), DXPF_A8 = (4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), DXPF_RGB32 = (5), DXPF_RGB24 = (6), DXPF_RGB565 = (7 | DXPF_3BITERROR), DXPF_RGB555 = (8 | DXPF_3BITERROR), DXPF_RGB8 = (9 | DXPF_5BITERROR), DXPF_ARGB1555 = (10 | DXPF_TRANSPARENCY | DXPF_3BITERROR), DXPF_RGB32_CK = (DXPF_RGB32 | DXPF_TRANSPARENCY), DXPF_RGB24_CK = (DXPF_RGB24 | DXPF_TRANSPARENCY), DXPF_RGB555_CK = (DXPF_RGB555 | DXPF_TRANSPARENCY), DXPF_RGB565_CK = (DXPF_RGB565 | DXPF_TRANSPARENCY), DXPF_RGB8_CK = (DXPF_RGB8 | DXPF_TRANSPARENCY) } DXSAMPLEFORMATENUM;
Elements
Utility Flags
- DXPF_FLAGSMASK
- Mask specifying which bits of the longword are being used to indicate transparency and dithering options.
Alpha Channel Flags
- DXPF_NONPREMULT
- Flag indicating the pixel format is not alpha premultiplied.
- DXPF_TRANSPARENCY
- Flag indicating that the surface uses a color key for transparency.
- DXPF_TRANSLUCENCY
- Flag indicating that the pixel format uses 8-bit alpha values.
Dithering Error Term Flags
- DXPF_2BITERROR
- Flag indicating the surface uses a 2-bit error term for dithering.
- DXPF_3BITERROR
- Flag indicating the surface uses a 3-bit error term for dithering.
- DXPF_4BITERROR
- Flag indicating the surface uses a 4-bit error term for dithering.
- DXPF_5BITERROR
- Flag indicating the surface uses a 5-bit error term for dithering.
- DXPF_ERRORMASK
- Mask of all bits used for dithering.
Sample Formats
- DXPF_NONSTANDARD
- Flag indicating that the surface pixel format is not one of the formats listed here. This flag can be combined with DXPF_NONPREMULT, if operations on the surface are more efficient with a pixel format that is not alpha premultiplied.
- DXPF_PMARGB32
- A 32-bit pixel format, with eight bits each of alpha, red, green, and blue. The bits are stored in that order, with the alpha stored in the higher-order bits and the blue in the lower-order bits. For this format, the color values are alpha premultiplied.
- DXPF_ARGB32
- A 32-bit pixel format, with eight bits each of alpha, red, green, and blue. The bits are stored in that order, with the alpha stored in the higher-order bits and the blue in the lower-order bits.
- DXPF_ARGB4444
- A 16-bit pixel format, with four bits each of alpha, red, green, and blue.
- DXPF_A8
- An 8-bit pixel format that stores only alpha values.
- DXPF_RGB32
- A 32-bit pixel format, with eight bits each of red, green, and blue. This is essentially a 24-bit version of DXPF_ARGB32, with no alpha values.
- DXPF_RGB24
- A 24 bit pixel format, with eight bits each of red, green, and blue.
- DXPF_RGB565
- A 16-bit pixel format that uses 5 bits for red, 6 bits for green, and 5 bits for blue.
- DXPF_RGB555
- A 16-bit pixel format that uses 5 bits for red, 5 bits for green, and 5 bits for blue. The highest-order bit is ignored.
- DXPF_RGB8
- An 8-bit pixel format, where each value refers to a color in a palette.
- DXPF_ARGB1555
- A 16-bit pixel format that uses 5 bits for red, 5 bits for green, and 5 bits for blue. The last bit is used to flag a pixel as transparent.
- DXPF_RGB32_CK
- Same format as DXPF_RGB32 and uses a color key for transparency.
- DXPF_RGB24_CK
- Same format as DXPF_RGB24 and uses a color key for transparency.
- DXPF_RGB555_CK
- Same format as DXPF_RGB555 and uses a color key for transparency.
- DXPF_RGB565_CK
- Same format as DXPF_RGB565 and uses a color key for transparency.
- DXPF_RGB8_CK
- Same format as DXPF_RGB8 and uses a color key for transparency.
Remarks
This value is returned from the IDXARGBReadPtr::GetNativeType and IDXSurface::GetPixelFormat methods. You can use the mask to determine the pixel format of the DXSurface and any dithering or transparency options used for rendering.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.