This function returns a boolean value indicating whether the image pixel data is signed or unsigned.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_image_is_signed_get( HIGEAR hIGear, LPAT_BOOL lpbSigned ); |
Name | Type | Description |
---|---|---|
hIGear | HIGEAR | HIGEAR handle of image. |
lpbSigned | AT_BOOL | Indicates whether or not a grayscale image should be treated as signed. |
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 AT_BOOL bItsSigned; // Will be set = TRUE if signed // Load image file "picture.bmp" from working directory nErrcount = IG_load_file("picture.bmp", &hIGear); if(nErrcount == 0) { nErrcount = IG_image_is_signed_get(hIGear, &bItsSigned); // ... // Destroy the image IG_image_delete(hIGear); } |
Although ImageGear allows getting and setting the Signed flag from/to images of any colorspaces, except for 1-bit per pixel images, it only takes this flag into account for images that have IG_COLOR_SPACE_ID_Gy colorspace.
Several image file formats, such as DICOM and JPEG2K, allow specifying image pixels as signed or unsigned. If the file format does not specify whether the pixels are signed or unsigned, ImageGear assumes they are unsigned.
If HIGEAR image is signed, and an attempt is made to save it to a file format that does not support Signed images, the Signed flag is ignored.