adjHueSat
Top  Previous  Next

adjHueSat ( integer Input, integer Output, integer Mode, integer& Hue, integer& Sat )

Use this function to adjust the hue and/or saturation values of an image or selection. Hue represents color pigmentation; saturation represents color depth or richness.

Parameters
 
Input  
 
An integer between 0 and 116 specifying the input image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames. If the function is called in the interactive mode (M_DIALOG or M_MOUSE), only visible frames (1-99) can be used.  
 
Output  
 
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Mode  
 
An enumerated integer that describes the mode to use. Must be one of the following values:  
 
M_PRESET=0 – immediately applies the function to the input image using the values specified by the Hue and Sat parameters.  
M_DIALOG=1 – opens the Hue/Saturation dialog that lets the user adjust the hue and saturation manually by moving the sliders on the dialog and watching the changes in real time.  
M_MOUSE=2 – activates the mouse mode that lets the user interactively change the settings with a mouse. Moving the mouse downward or upward makes hue lower or higher respectively. Moving the mouse leftward or rightward makes the saturation lower or higher respectively. To apply the changes and exit the function, press the left mouse button. To exit the function without applying the changes to the image, press the right mouse button.  
 
Hue  
 
An integer between –100 and 100 specifying value in per cent to adjust the hue of the image. If the function is called in the interactive mode (M_DIALOG or M_MOUSE), the variable will return the selected value of hue.  
 
Sat  
 
An integer between –100 and 100 specifying value in per cent to adjust the saturation of the image. Zero value corresponds to a black-and-white image. If the function is called in the interactive mode (M_DIALOG or M_MOUSE), the variable will return the selected value of saturation.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
ERR_CANCEL=-2  
 
The flag set if the function cancelled in the interactive mode.  
 
Example

The following operator increases the saturation of an image #1 by 30%:  
 
adjHueSat (1, 1, M_PRESET, 0, 30)