Work with Single-Page Images (HIGEAR)
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:
- DIB information, such as dimensions, color space, and channel depths. See "Accessing Image Attributes" below for more details.
- Image pixels (if HIGEAR contains a raster image). Usually, you do not need to access the image pixels directly. You can load, display, process, save images, and do other operations using high-level API that accesses image pixels internally. If you need to access image pixels directly, see Accessing Image Pixels for details.
- Vector data (if HIGEAR contains a vector image). See Working with Vector Images for details.
- Image display attributes. See Displaying Images for details.
- Image orientation. See "Image Orientation" below for details.
- Color profile (optional). See Using Color Profile Manager for details.
- Non-rectangular Area of Interest (optional). See Region of Interest Processing for details.
- Format-specific information (for DICOM and FlashPix).
- Extra channel information (optional). See Spot and Mask Channels for details.
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.
A HIGEAR can contain raster data or vector data, but not both (except for the case when vector data contains raster entities; however, such raster data is only accessible via the vector API). Vector images are further subdivided into CAD, PDF, and XPS. Use IG_image_is_raster, IG_image_is_vector, IG_image_is_CAD, IG_image_is_PDF, and IG_image_is_XPS to find out the type of image represented by a HIGEAR.
This topic provides information about the following:
Accessing Image Attributes
ImageGear provides two ways to access image attributes: via the HIGEAR handle, and via the special object HIGDIBINFO, which encapsulates the image attributes.
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.
Image Orientation
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.