This function returns the list of compressions available for saving the specified image to a particular file format.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_fltr_compressionlist_get_ex(
const HIGDIBINFO hDIB,
AT_MODE nFormatID,
LPAT_MODE lpComprList,
UINT nCListSize,
LPUINT lpnCListCount
);
|
Name | Type | Description |
---|---|---|
hDIB | const HIGDIBINFO | Handle of DIB info object that contains image parameters. If NULL, then this function returns all possible compressions. |
nFormatID | AT_MODE | File format identifier. See enumIGFormats for possible values. |
lpComprList | LPAT_MODE | Pointer to the array to return the list of compression constants to. See enumIGCompressions for possible values. Set to NULL if you only need to obtain the number of available compressions. |
nCListSize | UINT | Size of the lpCompList array. |
lpnCListCount | LPUINT | Pointer to a variable which will receive the actual number of compression constants. |
All pixel formats supported by ImageGear for C and C++.
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrCount; // Number of errors on stack HIGEAR hIGear; // Handle of image HIGDIBINFO hDIB; // DIB info handle of image UINT nCount, nActual; // Number of compressions LPAT_MODE lpCompList; // List of compressions // Load the image nErrCount = IG_load_file("picture.tif", &hIGear); if( nErrCount==0 ) { nErrCount = IG_image_DIB_info_get(hIGear, &hDIB); // Get compression count nErrCount = IG_fltr_compressionlist_get_ex(hDIB, IG_FORMAT_TIF, NULL, 0, &nCount); // Allocate memory for compressions lpCompList = (LPAT_MODE) malloc(nCount * sizeof(AT_MODE)); // Get list of compressions that can be used when // saving the given image into TIFF format nErrCount = IG_fltr_compressionlist_get_ex(hDIB, IG_FORMAT_TIF, lpCompList, nCount, &nActual); // ... // Delete memory free(lpCompList); // Delete DIB info IG_DIB_info_delete(hDIB); // Delete the image IG_image_delete(hIGear); } |
See also the section Saving.