ImageGear for C and C++ on Windows v20.3 - Updated
IG_cpm_image_profile_set
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Color Profile Management Functions > IG_cpm_image_profile_set

This function provides color profile management for given particular image.

Declaration:

 
Copy Code
AT_ERRCODE LACCUAPI IG_cpm_image_profile_set(
        HIGEAR hIGear, 
        LPAT_BYTE lpRawData, 
        DWORD dwRawSize, 
        AT_BOOL bConvert 
);

Arguments:

Name Type Description
hIGear HIGEAR IN: handle of image where to set profile.
lpRawData LPAT_BYTE IN: raw data of new profile. Can be either NULL or pointer to memory buffer that contains valid color profile in format specified by ICC.1:1998-09.
dwRawSize DWORD IN: length of data stored in lpRawData.
bConvert AT_BOOL IN: if TRUE then convert all images associated with old profile to new profile, but if FALSE then simple replace profile without any conversion.

Return Value:

Return value is a code of last error, or NULL if success.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

None

Remarks:

There can be two ways that an image is associated with a color profile:

If lpRawData is NULL during this function call, then previous local profile (if it existed) is deleted and image become dependent on global profile correspondent to color space used by its pixel data. If lpRawData is valid ICC profile then previous local profile (if it existed) is deleted and image becomes associated with new local profile.

The last parameter specifies how pixel data should be changed during profile change operation. If bConvert is TRUE, then pixel is converted from one format to another but in other case pixel data is unchanged.

Please note, that color profile management is disabled by default. See Working with ImageGear Color Profile Manager for information about how to activate it.

If some error happens such as invalid or unsupported profile or color space mismatch in image and color profile, then function returns appropriate error code.

Is this page helpful?
Yes No
Thanks for your feedback.