This function allows you to register your ICC callback functions.
Declaration:
Copy Code | |
---|---|
AT_ERRCODE ACCUAPI IG_fltr_ICC_callback_set( LPVOID lpPrivate, LPAFT_IG_ICC_GET_CB lpfnGetCB, LPAFT_IG_ICC_SET_CB lpfnSetCB, LPAFT_ANY lpfnReserved ); |
Arguments:
Name | Type | Description |
lpPrivate | LPVOID | Private callback data. |
lpfnGetCB | LPAFT_IG_ICC_GET_CB | GET callback function. |
lpfnSetCB | LPAFT_IG_ICC_SET_CB | SET callback function. |
lpfnReserved | LPAFT_ANY | Reserved. |
Return Value:
Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.Supported Raster Image Formats:
This function does not process image pixels.
Sample:
Load Callback
Example:
Copy Code | |
---|---|
VOID ACCUAPI ICCGet( AT_VOID *lpPrivate, // Private callback data. AT_BYTE *lpICCData, // ICC profile data, allocated by the toolkit AT_INT DataLength // Length of ICC profile data, in bytes ) { // ... } VOID ACCUAPI ICCSet( AT_VOID *lpPrivate, // Private callback data. AT_BYTE **lplpICCData, // ICC profile data, allocated by the application AT_INT *lpDataLength // Length of ICC profile data, in bytes ) { // ... } void Example_IG_fltr_ICC_callback_set() { AT_ERRCOUNT nErrcount; // Count of returned errors on stack // Set ICC callback functions nErrcount = IG_fltr_ICC_callback_set(NULL, ICCGet, ICCSet, NULL); } |
Remarks:
This function registers callbacks for reading and writing ICC profiles during loading and saving of image files.
- ICC profile reading. Use any image loading function to load an image. As soon as the format filter encounters an ICC profile, it calls the callback function. The ICC profile is provided in the standard ICC format, as a byte array. The toolkit owns the buffer, so the application shall not delete it. If the application needs to use the ICC profile after exiting the callback, it shall copy it to its own buffer.
- ICC profile writing. Use any image saving function to save an image. If the format filter supports ICC profile writing, it calls the callback function before writing the profile. If the HIGEAR being saved has an ICC profile attached to it, format filter ignores this profile and writes the profile obtained from the callback. The ICC profile shall be provided in the standard ICC format, as a byte array. The application owns the buffer, and is responsible for deleting it.