ImageGear for C and C++ on Windows v20.0 - Updated
IG_image_is_signed_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > General Image Functions > IG_image_is_signed_get

This function returns a boolean value indicating whether the image pixel data is signed or unsigned.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_image_is_signed_get(
       HIGEAR hIGear,
       LPAT_BOOL lpbSigned
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpbSigned AT_BOOL Indicates whether or not a grayscale image should be treated as signed.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Image Processing, Medical, Pixel Access

Example:

 
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);
}

Remarks:

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.

Is this page helpful?
Yes No
Thanks for your feedback.