ImageGear for C and C++ on Windows v19.5 - Updated
IG_IP_sharpen
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Functions > IG_IP_sharpen

This function sharpens the image by making the dark side of a contrast edge become darker and the light side lighter.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_IP_sharpen(
   HIGEAR hIGear,
   const LPAT_RECT lpRect,
   const INT nSharpFactor
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpRect const LPAT_RECT Pointer to an AT_RECT struct specifying a portion of the image to be affected. NULL means entire image.
nSharpFactor const INT Factor indicating the degree for increasing image sharpness. Valid range is 1 to 5. The higher the value, the more sharpening will be applied.

Return Value:

Returns 0 if successful. Otherwise, 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++.

Sample:

Image Processing, Medical, Timing

Example:

 
Copy Code
HIGEAR hIGear;            // HIGEAR handle of the image
AT_ERRCOUNT nErrcount;    // Count of errs on stack upon ret from func

// Load image file "picture.bmp" from working directory
nErrcount = IG_load_file("picture.bmp", &hIGear);
if(nErrcount == 0)
{
    nErrcount = IG_IP_sharpen(hIGear, NULL, 2);
    // ...
    // Destroy the image
    IG_image_delete(hIGear);
}

Remarks:

Flat areas (areas that are filled by the same pixel value) are not altered by this function.

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 NRA 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.

See Also

IG_IP_unsharp_mask

IG_IP_smooth

IG_IP_convolve_matrix