XLATEOBJ

typedef struct _XLATEOBJ {

ULONG iUniq;

FLONG flXlate;

USHORT iSrcType;

USHORT iDstType;

ULONG cEntries;

ULONG *pulXlate;

} XLATEOBJ;

The XLATEOBJ structure is used to translate color indices from one palette to another.

Members

iUniq

A cache identifier that enables the driver to recognize an XLATEOBJ structure that it has previously cached. If this member is zero, the driver should not cache the XLATEOBJ structure.

flXlate

Flags specifying hints about the translation. This member can be any combination of the following values:

Value Meaning
XO_TRIVIAL Source indices are usable as target indices.
XO_TABLE A table is provided to translate source indices to target indices. This flag will always be set for 1-, 4-, and 8-bbp source bitmaps.
XO_TO_MONO Source indices are translated to a monochrome format with the special property that all indices map to zero, except for one. A driver can use this to accelerate a block transfer.

iSrcType

Specifies the type of the source palette.This member can be one of the following values:

Value Meaning
PAL_INDEXED Indexed palette.
PAL_BITFIELDS Palette is defined by 3 masks.
PAL_RGB 8 bits for each of R, G, B; least significant byte is R.
PAL_BGR 8 bits for each of B, G, R; least significant byte is B.

If the source palette is not one of these types, the driver should not attempt to download the palette description.

iDstType

Describes the type of the destination palette. See iSrcType for allowable values. If the destination palette is not one of these types, the driver should not attempt to download the palette description.

cEntries

Count of entries in pulXlate. Indexing into pulXlate with a value greater than cEntries results in a memory access violation.

pulXlate

Points to an array of translation entries. If this member is null and the iSrcType member is PAL_INDEXED, the driver should call the XLATEOBJ_piVector function to retrieve the translation vector.

Comments

The destination palette always belongs to the destination surface of some drawing operation. The source palette is an application-selected palette or a palette from another surface.

The XLATEOBJ structure is used to translate color indices that refer to the source palette to indices for the destination palette. The resulting index identifies a color that matches the source color as closely as possible.

See Also

XLATEOBJ_piVector