CMCheckRGBs function

The CMCheckRGBs function checks whether the pixels in a bitmap lie within the output gamut of a specified transform.

Syntax

BOOL WINAPI CMCheckRGBs(
   HCMTRANSFORM  hcmTransform,
   LPVOID        lpSrcBits,
   BMFORMAT      bmInput,
   DWORD         dwWidth,
   DWORD         dwHeight,
   DWORD         dwStride,
   LPBYTE        lpaResult,
   PBMCALLBACKFN pfnCallback,
   ULONG         ulCallbackData
);

Parameters

  • hcmTransform
    Specifies the color transform to use.

  • lpSrcBits
    Points to the bitmap to check against an output gamut.

  • bmInput
    Specifies the input bitmap format.

  • dwWidth
    Specifies the number of pixels per scan line in the input bitmap.

  • dwHeight
    Specifies the number of scan lines in the input bitmap.

  • dwStride
    Specifies the number of bytes from the beginning of one scan line to the beginning of the next in the input bitmap. If dwStride is set to zero, the CMM should assume that scan lines are padded so as to be DWORD-aligned.

  • lpaResult
    Points to a buffer in which the test results are to be placed.

    The results are represented by an array of bytes. Each byte in the array corresponds to a pixel in the bitmap, and on exit is set to an unsigned value between 0 and 255. The value 0 denotes that the color is in gamut, while a nonzero value denotes that it is out of gamut. For any integer n such that 0 < n < 255, a result value of n + 1 indicates that the corresponding color is at least as far out of gamut as would be indicated by a result value of n. These values are usually generated from the gamutTag in the ICC profile.

  • pfnCallback
    Pointer to an application-supplied callback function called periodically by CMCheckRGBs to report progress and allow the calling process to cancel the translation. (See ICMProgressProcCallback.)

  • ulCallbackData
    Data passed back to the callback function, for example to identify the bitmap test that is reporting progress.

Return value

If this function succeeds, the return value is TRUE.

If this function fails, the return value is FALSE. If the function is not successful, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h.

Remarks

Every CMM is required to export this function.

If the input format is not compatible with the color transform, the CMCheckRGBs function fails.

If the callback function returns 0, processing should be canceled and CMCheckRGBs should return zero to indicate failure; the results buffer may be partially filled.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h

Library

Gdi32.lib

DLL

Icm32.dll

See also

Basic Color Management Concepts

Functions

ICMProgressProcCallback