---
title: CWCheckBitmap
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/colorsync_manager/1805121-cwcheckbitmap
---

# CWCheckBitmap

Tests the colors of the pixel data of a bitmap to determine whether the colors map to the gamut of the destination device.

## Declaration

```occ
CMError CWCheckBitmap (
   CMWorldRef cw,
   const CMBitmap *bitmap,
   CMBitmapCallBackUPP progressProc,
   void *refCon,
   CMBitmap *resultBitmap
);
```

## Parameters

- `cw`: A reference to the color world of type [doc://com.apple.documentation/documentation/applicationservices/cmworldref](applicationservices/cmworldref.md) to use for the color check.
 The functions [doc://com.apple.documentation/documentation/applicationservices/colorsync_manager/1805079-ncwnewcolorworld](applicationservices/colorsync_manager/1805079-ncwnewcolorworld.md) and [doc://com.apple.documentation/documentation/applicationservices/colorsync_manager/1805087-cwconcatcolorworld](applicationservices/colorsync_manager/1805087-cwconcatcolorworld.md) both allocate color world references of type [doc://com.apple.documentation/documentation/applicationservices/cmworldref](applicationservices/cmworldref.md).
- `bitmap`: A pointer to a bitmap of type [doc://com.apple.documentation/documentation/applicationservices/cmbitmap](applicationservices/cmbitmap.md) 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 default 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. Specify `NULL` for this parameter if your application will not monitor the bitmap color checking. For information on the callback function and its type definition, see the function [doc://com.apple.documentation/documentation/applicationservices/cmbitmapcallbackprocptr](applicationservices/cmbitmapcallbackprocptr.md).
- `refCon`: A pointer to a reference constant for application data passed as a parameter to calls to `progressProc`.
- `resultBitmap`: A pointer to a bitmap. On return, contains the results 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 the `image` field of the structure [doc://com.apple.documentation/documentation/applicationservices/cmbitmap](applicationservices/cmbitmap.md) and initialize the buffer to zeroes. Pixels are set to 1 if the corresponding pixel of the source bitmap indicated by `bitMap` is out of gamut. You must set the `space` field of the `CMBitMap` structure to `cmGamutResult1Space` color space storage format, as described in [doc://com.apple.documentation/documentation/applicationservices/1560701-abstract_color_space_constants](applicationservices/1560701-abstract_color_space_constants.md).

## Return Value

A `CMError` value. See [Result Codes](../colorsync_manager.md).

## Overview

When your application calls the `CWCheckBitMap` 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 the `CWConcatColorWorld` function, then the `keyIndex` field of the `CMConcatProfileSet` data structure identifies the preferred CMM. If the preferred CMM is not available, the default CMM is used to perform the color matching.

For the `CWCheckBitMap` function to execute successfully, the source profile’s `dataColorSpace` field value and the `space` field value of the source bitmap pointed to by the `bitMap` 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

### Working With ColorWorlds

- [NCWNewColorWorld](1805079-ncwnewcolorworld.md)
- [CWConcatColorWorld](1805087-cwconcatcolorworld.md)
- [NCWConcatColorWorld](1805091-ncwconcatcolorworld.md)
- [CMGetCWInfo](1805097-cmgetcwinfo.md)
- [CWDisposeColorWorld](1805102-cwdisposecolorworld.md)
- [CWMatchColors](1805108-cwmatchcolors.md)
- [CWCheckColors](1805111-cwcheckcolors.md)
- [CWMatchBitmap](1805116-cwmatchbitmap.md)
- [CWFillLookupTexture](1805126-cwfilllookuptexture.md)
