ColorHueSaturation

#include "BIIMAGE.H"

 

HDIB CALLBACK ColorHueSaturation( HDIB     HDib,
int           hue,
int           saturation,
int           intensity,
UINT     min,
UINT     max,
int           iShowProgress,
HWND  hParent)

Description

This function will modify the hue, intensity and saturation values of the image. This function works for only 24 bit per pixel images.

Examples

                        color                                       hsi
The original 900 x 1300 sized color image and the Hue/Saturation/Intensity operated image with Hue = 45, Saturation = -16, Intensity = 61, Min = 0 and Max = 360 parameter values.

Parameters

HDIB

hDIB

Handle of the source DIB.

int

hue

Value of hue [-180 - 180].

int

saturation

Value of saturation [-255 - 255].

int

intensity

Value of intensity [-255 - 255].

UINT

min

The minimum value of the range of hue [0 - 360].

UINT

max

The maximum value of the range of hue [0 - 360].

int

iShowProgress

This parameter specifies the displaying of the progressbar and the preview dialog.

Available values:

DISPLAY_NONE (0)     -     The progressbar and the preview dialog will not display before filtering.

DISPLAY_PROGRESS (1)-The progressbar will display during filtering procedure.

DISPLAY_DIALOG (2)      -                                   The preview dialog will display before filtering. This dialog shows the part of the image before and after filtering.

DISPLAY_BOTH (3)     -     The progressbar and the preview dialog will display.

IMPORTANT: The preview dialog will only display, if there is BiDlgs.dll installed.

HWND

hParent

Handler of the parent window to display preview dialog.

Return values

The handle of the new filtered DIB or NULL if an error occurred. The GetLastColorConvertError function will return the error code.

Programming notes

The function will not free the input DIB.

 

Rules:

If min < 0 or min > 360 or max < 0 or max > 360 or min = max the function returns NULL, and the error code will be CCINVALIDPARAMETER.

If min < max, the range of hue will be [min, max],

If min > max, the range of hue will be [0, max] and [min, 360].

If min = max = 0, the intervallum will be [0, 360].