[This is preliminary documentation and subject to change.]
The CMTranslateRGBs function translates a bitmap from one color space to another using a color transform.
BOOL WINAPI CMTranslateRGBs(
HCMTRANSFORM hcmTransform,
LPVOID lpSrcBits,
BMFORMAT bmInput,
DWORD dwWidth,
DWORD dwHeight,
DWORD dwStride,
LPVOID lpDestBits,
BMFORMAT bmOutput,
DWORD dwTranslateDirection
);
Value | Meaning |
---|---|
CMS_FORWARD | Use forward transform |
CMS_BACKWARD | Use reverse transform |
If this function succeeds, the return value is TRUE.
If this function fails, the return value is FALSE and the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h.
Every CMM is required to export this function.
When writing into the destination buffer, the CMM should make sure that scan lines are padded to be DWORD-aligned.
If the input and output formats are not compatible with the color transform, this function fails.
If both input and output bitmap formats are 3 channel, 4 bytes per pixel as in the case of BM_xRGBQUADS, the 4th bytes should be preserved and copied to the output buffer.
Note that this function must support in-place translation. That is, whenever the memory footprint of the output is less than or equal to the memory footprint of the input, this function must be able to translate the bitmap colors even if the source and destination buffers are the same.
Windows NT: Requires version 5.0 or later.
Windows: Requires Windows 98.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Import Library: Use gdi32.lib.
Color Management Overview, ICM 2.0 Functions