This function performs a maximum filter on an image.
Declaration:
|
Copy Code
|
AT_ERRCOUNT ACCUAPI IG_IP_maximum (
HIGEAR hIGear,
const LPAT_RECT lpRect,
AT_DIMENSION nNeighborWidth,
AT_DIMENSION nNeighborHeight
);
|
Arguments:
Name |
Type |
Description |
hIGear |
HIGEAR |
HIGEAR handle of image. |
lpRect |
const LPAT_RECT |
Far pointer to an AT_RECT struct specifying the rectangular portion of the image to operate upon. If NULL, the entire image will be operated upon. Before ImageGear performs this operation, it will check to see if an internal flag has been set to TRUE to make a mask active for this HIGEAR image. If a mask is active, and a valid pointer to a mask can be found, ImageGear will override the settings passed to this structure in favor of the non-rectangular ROI defined by the mask. |
nNeighborWidth |
AT_DIMENSION |
Width of the neighborhood to include in computing each new pixel's value. Must be positive. |
nNeighborHeight |
AT_DIMENSION |
Height of the neighborhood to include in computing each new pixel's value. Must be positive. |
Return Value:
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++, except:
Indexed RGB with non-grayscale palette.
Sample:
Image Processing
Example:
|
Copy Code
|
HIGEAR hIGear; /* HIGEAR handle of image */
nErrCount = IG_IP_maximum ( hIGear, NULL, 5, 5 );
|
Remarks:
A maximum filter makes the lighter pixels larger and shrinks the darker ones. The width and height determine the size of each original pixel's neighborhood to use to compute the maximum output pixels. Most applications will find that 3x3 or 5x5 works best.
Only the lpRect of the image is processed. Set lpRect = NULL to process the entire image.
This function, like other ImageGear Image Processing and Clipboard API calls, takes an AT_RECT structure as an argument, so that you can process a rectangular sub-region of an image. However, before ImageGear performs the operation specified by this function, it will check to see if an internal flag has been set to TRUE, indicating that a mask HIGEAR should be used with the image. If the flag is set to TRUE, and a valid pointer to a mask image has been assigned, ImageGear will override the settings passed to the AT_RECT structure and use the non-rectangular ROI defined by the mask HIGEAR. To create a non-rectangular region of interest, call IG_IP_NR_ROI_to_HIGEAR_mask().