ImageGear for C and C++ on Windows v19.1 - Updated
IG_gui_ip_unsharp_mask_dlg
API Reference Guide > GUI Component API Reference > GUI Component Functions Reference > Image Processing Functions > IG_gui_ip_unsharp_mask_dlg

This function shows the dialog that allows you to choose parameters and apply the Unsharp Mask transform.

Declaration:

 
Copy Code
BOOL ACCUAPI IG_gui_ip_unsharp_mask_dlg (
        HWND hWnd, 
        LPAT_IGGUI_IP_UNSHARP_MASK lpIpUnsharpMaskData
);

Arguments:

Name Type Description
hWnd HWND A handle of the parent window.
lpIpUnsharpMaskData LPAT_IGGUI_IP_UNSHARP_MASK A pointer to the AT_IGGUI_IP_UNSHARP_MASK structure.

Return Value:

If the user specifies parameters and clicks the OK button, the return value is non-zero. If the user cancels or closes the dialog box or an error occurs, the return value is zero.

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
#include "IG_gui_common.h"
AT_IGGUI_IP_UNSHARP_MASK IpUnsharpMask;
IpUnsharpMask.cbSize = sizeof (IpUnsharpMask);
IpUnsharpMask.hWnd = hWnd;
IpUnsharpMask.hIGear = hIGear;
IpUnsharpMask.uFlags |= IG_IGGUI_IP_SETUP_EMPTY_RECT;
IpUnsharpMask.dblRadius = 1.0;
IpUnsharpMask.nAmount = 150;
IpUnsharpMask.nThreshold = 10;
IpUnsharpMask.nColorChannel = IG_COLOR_COMP_ALL;
if (IG_gui_ip_unsharp_mask_dlg (hWnd, &IpUnsharpMask))
{
InvalidateRect(hWnd, NULL, FALSE);
        UpdateWindow(hWnd);
}

Remarks:

The Unsharp Mask transform is used for image sharpening and edge enhancement. The algorithm works by subtracting a smoothed version of the image ("unsharp") from the original image.