Microsoft DirectX 8.1 (C++)

CImageDisplay::GetColourMask

Retrieves a set of individual color element masks.

Syntax

BOOL GetColourMask(
    DWORD *pMaskRed,
    DWORD *pMaskGreen,
    DWORD *pMaskBlue
);

Parameters

pMaskRed

Pointer to the red mask.

pMaskGreen

Pointer to the green mask.

pMaskBlue

Pointer to the blue mask.

Return Value

Returns one of the following values.

Value Description
TRUE Masks were filled out correctly.
FALSE No masks were available for the display.

Remarks

Given a video format described by a VIDEOINFO structure, this member function returns the mask that is used to obtain the range of acceptable colors for this type (for example, the mask for a 24-bit true color format is 0xFF in all cases). A 16-bit 5:6:5 display format uses 0xF8, 0xFC, and 0xF8. Therefore, given any RGB triplets, this member function can find one that is compatible with the display format by using a bitwise AND operation.

See Also