ImageGear for C and C++ on Linux v18.8 - Updated
Work with Single-Page Images (HIGEAR)
User Guide > How to Work with... > Common Operations > Manipulating Image Data > 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:

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:

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.

Image Attribute

To Access via HIGEAR

To Access via HIGDIBINFO

Width

IG_image_dimensions_get

IG_DIB_width_get

Height

IG_image_dimensions_get

IG_DIB_height_get

Color Space

IG_image_colorspace_get

IG_DIB_colorspace_get

Channel Depths

IG_image_channel_count_get

IG_image_channel_depth_get

IG_image_channel_depths_get

IG_DIB_channel_count_get

IG_DIB_channel_depth_get

IG_DIB_channel_depths_get

Palette (for images that have Indexed colorspace)

IG_palette_get

IG_palette_set

IG_DIB_palette_alloc

IG_DIB_palette_length_get

IG_DIB_palette_size_get

IG_DIB_palette_pointer_get

Resolution

IG_image_resolution_get

IG_image_resolution_set

IG_DIB_resolution_get

IG_DIB_resolution_set

Signed attribute

IG_image_is_signed_get

IG_image_is_signed_set

 

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.