The central element in ImageGear API is the single-page image handle: HIGEAR. The majority of ImageGear API functions take HIGEAR as a parameter. HIGEAR encapsulates the following data:
Usually you create a HIGEAR handle by loading an image from a disk file, or from memory. See Loading Images for details. You can also create a new HIGEAR handle using IG_image_create, or import a Windows DIB into HIGEAR using IG_image_DIB_import.
When HIGEAR is no longer used, you must delete it using IG_image_delete.
This topic provides information about the following:
ImageGear provides two ways to access image attributes: via the HIGEAR handle, and via the special object HIGDIBINFO, which encapsulates the image attributes.
Image Attribute |
To Access via HIGEAR |
To Access via HIGDIBINFO |
---|---|---|
Width |
||
Height |
||
Color Space |
||
Channel Depths |
||
Palette (for images that have Indexed colorspace) |
||
Resolution |
||
Signed attribute |
|
The HIGDIBINFO object only contains the attributes and does not contain the pixels.
Use IG_DIB_info_create to create a DIB info object. Use IG_DIB_info_copy to create a copy of an existing object. Use IG_image_DIB_info_get to obtain DIB information from a HIGEAR handle.
When the HIGDIBINFO object is no longer in use, you must delete it using IG_DIB_info_delete.
You cannot edit the DIB information of a HIGEAR directly. Instead, use image processing functions to modify the image: resize, convert to a different color space, change its resolution, etc.
ImageGear uses two different places to store an image's orientation information: Orientation attribute of HIGEAR, and Orientation attribute of display settings.
When ImageGear loads an image, and the image’s file format supports storing the Orientation attribute (e.g., TIFF format), ImageGear stores this attribute in HIGEAR. You can get or modify this attribute with IG_image_orientation_get and IG_image_orientation_set, correspondingly.
If the application displays the image, ImageGear copies HIGEAR’s Orientation attribute to the image’s Display settings. This allows ImageGear to display the image using the orientation specified in the source file. You can get or set display orientation using IG_dspl_orientation_get and IG_dspl_orientation_set, correspondingly. Changing the display orientation does not change the HIGEAR Orientation attribute. Changing the HIGEAR Orientation attribute does not change the display orientation.
When saving an image to a format that supports orientation, ImageGear saves the HIGEAR’s Orientation attribute to the file’s header, and does not take the display orientation into account. If you’d like to save an image using the current display orientation, copy the orientation from the display settings to HIGEAR.