Important: The information in this document is obsolete and should not be used for new development.
CWCheckBitMap
Tests the colors of the pixel data of a bitmap to determine whether the colors map to the gamut of the destination device.
pascal CMError CWCheckBitMap ( CMWorldRef cw, const CMBitMap *bitMap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitMap *resultBitMap);
cw
- A reference to the color world (page 3-66) to use for the color check.
bitMap
- A pointer to a bitmap (page 3-61) whose colors are to be checked.
progressProc
- A calling program-supplied callback function that allows your application to monitor progress or abort the operation as the bitmap's colors are checked against the gamut of the destination device. The Apple CMM calls your function approximately every half-second unless color checking occurs in less time; this happens when there is a small amount of data to be checked. If the function returns a result of
true
, the operation is aborted. SpecifyNULL
for this parameter if your application will not monitor the bitmap color checking. For information on the callback function and its type definition, seeMyCMBitmapCallBackProc
(page 3-170).refCon
- A reference constant for application data passed as a parameter to calls to
progressProc
.resultBitMap
- A pointer to a bitmap. On output, contains the outcome of the color check. The bitmap must have bounds equal to the parameter of the source bitmap pointed to by
bitMap
. You must allocate the pixel buffer pointed to by theimage
field of theCMBitMap
structure (page 3-61) and initialize the buffer to zeroes. Pixels are set to 1 if the corresponding pixel of the source bitmap indicated bybitMap
is out of gamut. You must set thespace
field of theCMBitMap
structure tocmGamutResult1Space
color space storage format (see "Abstract Color Space Constants" (page 3-23)).- function result
- A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes. CWCheckBitMap returns cmCantGamutCheckError if the color world does not contain gamut information. For more information, see "Flag Mask Definitions for Version 2.x Profiles" (page 3-29).
DISCUSSION
When your application calls theCWCheckBitMap
function, the ColorSync Manager dispatches the function to the preferred CMM. The ColorSync Manager determines the preferred CMM based on the color world configuration. If the color world you pass in was created by theNCWNewColorWorld
function, the color world contains a source and destination profile, in which case the arbitration scheme described in "Introduction to the ColorSync Manager" in Advanced Color Imaging on the Mac OS is used to determine the preferred CMM. If the color world you pass in was created by theCWConcatColorWorld
function, then thekeyIndex
field of theCMConcatProfileSet
data structure identifies the preferred CMM. If the preferred CMM is not available, the default Apple CMM is used to perform the color matching.For the CWCheckBitMap function to execute successfully, the source profile's
dataColorSpace
field value and thespace
field value of the source bitmap pointed to by thebitMap
parameter must specify the same data color space. CWCheckBitMap is not supported if the color world was initialized with a named color space profile.SEE ALSO
TheNCWNewColorWorld
function (page 3-108) and theCWConcatColorWorld
function (page 3-110) both allocate color world references of typeCMWorldRef
.