This topic provides information about the following:
Image data (or simply, image) is available for manipulations through the DIB property and is a ImGearDIB Class type. Color space, channels, width, and height are major attributes which define image structure.
ImageGear considers an image as a collection of channels, each of which gives some single piece of information about the pixels in a whole image. Channels are defined as an array of depths for each channel. Depth specifies the quantity of different values for a particular channel. This data is constant for the page until image processing functions are applied. It may be accessed through the ImGearDIB.ChannelDepths Property.
The ImGearColorSpace Structure (returned by the ImGearDIB.ColorSpace Property) defines the semantics of the information stored in all channels (i.e., whether the second channel is the green component of RGB color, magenta of CMYK, or alpha value of a grayscale image). This information may be formed from ImGearColorSpaceIDs Enumeration flags and placed into the constructor of ImGearPage Class.
Pixels in ImGearDIB Class may be accessed as both individual pixels or groups of pixels. GetPixelCopy Method() and UpdateColumnFrom Method() are examples of such members. An important issue is that all of these routines return copies of the data stored in an image as an array of the ImGearPixel Class. None of these members allows direct access to the pixel store.
To gain direct access to an image, GetImage Method() or GetRaster Method() members of ImGearDIB Class should be used. This is an efficient way to implement image processing routines, since all changes made to the structures (returned by these functions) will be reflected in the image. Users of GetImage Method() or GetRaster Method() should completely understand the structure of the internal pixel store to avoid producing ill-formed images.
The following example creates an RGB image and swaps red and blue channel values for diagonal pixels:
Region of interest (ImGearROI Class) represents a free-shape image area (rectangular, non-rectangluar, or entire space) and specifies a meaningful part of an image. For example, a region of interest may be established to define an area where some image processing functions should be applied.