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:
- First way: image itself does not store color profile data but use profile from global parameters (WCP).
- Second way: image stores color profile locally and does not depend on global settings.
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.