ImageGear Professional v18.2 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > General Image Functions > IG_image_is_signed_set |
This function sets a boolean value that specifies whether the image pixel data is signed or unsigned.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_image_is_signed_set( HIGEAR hIGear, AT_BOOL bSigned ); |
Name | Type | Description |
hIGear | HIGEAR | HIGEAR handle of image. |
bSigned | AT_BOOL | Indicates whether the image should be treated as signed or unsigned. |
All pixel formats supported by ImageGear Professional, except:
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrcount; // Number of errors on stack HIGEAR hIGear; // Handle of image // Load image file "picture.bmp" from working directory nErrcount = IG_load_file("picture.bmp", &hIGear); if(nErrcount == 0) { nErrcount = IG_image_is_signed_set(hIGear, TRUE); // ... // Destroy the image IG_image_delete(hIGear); } |
The Signed flag affects the image display. If an image is unsigned, and does not have any display LUTs attached, pixel intensity value of 0 is the minimal intensity, so it is displayed as black. If the image is signed, 0 is the middle intensity, so it is displayed as 50% gray.
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.
This function does not modify the image pixel values. It only changes a flag attached to the image. Also, this function does not cause the image to be redrawn. Refer to IG_dspl_image_draw for how to display an image. |