Export (0) Print
Expand All

2.2.22 PixelFormatDescriptor Object

The PixelFormatDescriptor object specifies the pixel format of a drawing surface.


0

1

2

3

4

5

6

7

8

9
1
0

1

2

3

4

5

6

7

8

9
2
0

1

2

3

4

5

6

7

8

9
3
0

1

nSize

nVersion

dwFlags

iPixelType

cColorBits

cRedBits

cRedShift

cGreenBits

cGreenShift

cBlueBits

cBlueShift

cAlphaBits

cAlphaShift

cAccumBits

cAccumRedBits

cAccumGreenBits

cAccumBlueBits

cAccumAlphaBits

cDepthBits

cStencilBits

cAuxBuffers

iLayerType

bReserved

dwLayerMask

dwVisibleMask

dwDamageMask

nSize (2 bytes): A 16-bit integer that specifies the size, in bytes, of this data structure.

nVersion (2 bytes): A 16-bit integer that MUST be set to 0x0001.

 

dwFlags (4 bytes): A set of bit flags that specify properties of the pixel buffer that is used for output to the drawing surface. These properties are not all mutually exclusive; combinations of flags are allowed, except where noted otherwise.


0

1

2

3

4

5

6

7

8

9
1
0

1

2

3

4

5

6

7

8

9
2
0

1

2

3

4

5

6

7

8

9
3
0

1

P

F

S
O

G

M

W

S

D

C

D
A

D
S

A

S
L

S
C

S
E

S
P

0

0

0

0

0

0

0

0

0

0

0

0

S
D

D
D

D
P

0

The following bit flag constants are defined.

Value Description

D

PFD_DOUBLEBUFFER

The pixel buffer is double-buffered. This flag and PFD_SUPPORT_GDI MUST NOT both be set.

S

PFD_STEREO

The pixel buffer MAY be stereoscopic; that is, it MAY specify a color plane that is used to create the illusion of depth in an image.<63>

W

PFD_DRAW_TO_WINDOW

The pixel buffer can draw to a window or device surface.

M

PFD_DRAW_TO_BITMAP

The pixel buffer can draw to a memory bitmap.

G

PFD_SUPPORT_GDI

This flag SHOULD be clear, but it MAY be set. <64> The PFD_SUPPORT_GDI flag and PFD_DOUBLEBUFFER MUST NOT both be set.

SO

PFD_SUPPORT_OPENGL

The pixel buffer supports OpenGL drawing. See [OPENGL] for more information.

F

PFD_GENERIC_FORMAT

The pixel format is natively supported by the operating system; this is known as the "generic" implementation.<65>

If clear, the pixel format is supported by a device driver or hardware.

P

PFD_NEED_PALETTE

The buffer uses RGBA pixels on a palette-managed device. A LogPalette object (section 2.2.17) is required to achieve the best results for this pixel type. Colors in the palette SHOULD be specified according to the values of the cRedBits, cRedShift, cGreenBits, cGreenShift, cBlueBits, and cBlueShift fields.

SP

PFD_NEED_SYSTEM_PALETTE

The output device supports one hardware palette in 256-color mode only. For such systems to use hardware acceleration, the hardware palette MUST be in a fixed order (for example, 3-3-2) when in RGBA mode, or MUST match the LogPalette object when in color table mode.

SE

PFD_SWAP_EXCHANGE

The contents of the back buffer have been exchanged with the contents of the front buffer in a double-buffered color plane.

SC

PFD_SWAP_COPY

The contents of the back buffer have been copied to the front buffer in a double-buffered color plane. The contents of the back buffer have not been affected.

SL

PFD_SWAP_LAYER_BUFFERS

A device can swap individual color planes with pixel formats that include double-buffered overlay or underlay color planes. Otherwise all color planes are swapped together as a group.

A

PFD_GENERIC_ACCELERATED

The pixel format is supported by a device driver that accelerates the generic implementation. If this flag is clear and the PFD_GENERIC_FORMAT flag is set, the pixel format is supported by the generic implementation only.

DS

PFD_SUPPORT_DIRECTDRAW

The pixel buffer supports DirectDraw drawing, which allows applications to have low-level control of the output drawing surface.

DA

PFD_DIRECT3D_ACCELERATED

The pixel buffer supports Direct3D drawing, which accellerated rendering in three dimensions.

C

PFD_SUPPORT_COMPOSITION

The pixel buffer supports compositing, which indicates that source pixels MAY overwrite or be combined with background pixels.<66>

DP

PFD_DEPTH_DONTCARE

The pixel buffer is not required to include a color plane for depth effects.

DD

PFD_DOUBLEBUFFER_DONTCARE

The pixel buffer can be either single or double buffered.

SD

PFD_STEREO_DONTCARE

The pixel buffer MAY be either monoscopic or stereoscopic.

iPixelType (1 byte): The type of pixel data.

Value Meaning

PFD_TYPE_RGBA
0x00

The pixel format is RGBA.

PFD_TYPE_COLORINDEX
0x01

Each pixel is an index in a color table.

cColorBits (1 byte): The number of bits per pixel for RGBA pixel types, excluding the alpha bitplanes. For color table pixels, it is the size of each color table index.

cRedBits (1 byte): Specifies the number of red bitplanes in each RGBA color buffer.

cRedShift (1 byte): Specifies the shift count in bits for red bitplanes in each RGBA color buffer.

cGreenBits (1 byte): Specifies the number of green bitplanes in each RGBA color buffer.

cGreenShift (1 byte): Specifies the shift count for green bitplanes in each RGBA color buffer.

cBlueBits (1 byte): Specifies the number of blue bitplanes in each RGBA color buffer.

cBlueShift (1 byte): Specifies the shift count for blue bitplanes in each RGBA color buffer.

cAlphaBits (1 byte): Specifies the number of alpha bitplanes in each RGBA color buffer.<67>

cAlphaShift (1 byte): Specifies the shift count for alpha bitplanes in each RGBA color buffer.<68>

cAccumBits (1 byte): Specifies the total number of bitplanes in the accumulation buffer.

cAccumRedBits (1 byte): Specifies the number of red bitplanes in the accumulation buffer.

cAccumGreenBits (1 byte): Specifies the number of green bitplanes in the accumulation buffer.

cAccumBlueBits (1 byte): Specifies the number of blue bitplanes in the accumulation buffer.

cAccumAlphaBits (1 byte): Specifies the number of alpha bitplanes in the accumulation buffer.<69>

cDepthBits (1 byte): Specifies the depth of the depth (z-axis) buffer.

cStencilBits (1 byte): Specifies the depth of the stencil buffer.

cAuxBuffers (1 byte): Specifies the number of auxiliary buffers. Auxiliary buffers are not supported.

iLayerType (1 byte): This field MAY be ignored.

bReserved (1 byte): Specifies the number of overlay and underlay planes. Bits 0 through 3 specify up to 15 overlay planes and bits 4 through 7 specify up to 15 underlay planes.

dwLayerMask (4 bytes): This field MAY be ignored.

dwVisibleMask (4 bytes): Specifies the transparent color or index of an underlay plane. When the pixel type is RGBA, dwVisibleMask is a transparent RGB color value. When the pixel type is color index, it is a transparent index value.

dwDamageMask (4 bytes): This field MAY be ignored.

The PixelFormatDescriptor object can be used in EMR_HEADER records (section 2.3.4.2) to specify the pixel format of the output surface for the playback device context.

 
Show:
© 2014 Microsoft