adjColors
Top  Previous  Next

adjColors ( integer Input, integer Output, integer& CR, integer& MG, integer& YB )

Use this function to adjust the color balance of an image or selection by shifting the colors between complimentary pairs of the primary RGB color values and secondary CMYmodelCMY color values.

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 CR, MG, and YB parameters.  
M_DIALOG=1 – opens the Levels dialog that lets the user adjust the colors 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 the cyan-red component lower or higher respectively. Moving the mouse leftward or rightward makes the magenta-green component lower or higher respectively. If the mouse has a wheel control, rotating the wheel downward or upward makes the yellow-blue component 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.  
 
CR  
 
An integer between –100 and 100 specifying value in per cent to adjust the balance of cyan and red in the image. If the function is called in the interactive mode (M_DIALOG or M_MOUSE), the variable will return the selected value of the cyan-red parameter.  
 
MG  
 
An integer between –100 and 100 specifying value in per cent to adjust the balance of magenta and green in the image. If the function is called in the interactive mode (M_DIALOG or M_MOUSE), the variable will return the selected value of the magenta-green parameter.  
 
YB  
 
An integer between –100 and 100 specifying value in per cent to adjust the balance of yellow and bluw in the image. If the function is called in the interactive mode (M_DIALOG or M_MOUSE), the variable will return the selected value of the yellow-blue parameter.  
 
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

This set of statements lets the user adjust the colors of a captured image using the dialog mode and outputs interactively selected parameters to the terminal window.  
 
grabIm (1)  
adjColors (1, 2, M_DIALOG, cr, mg, yb)  
print "Cyan-red=", cr  
print "Magenta-green=", mg  
print "Yellow-blue=",yb  
 
Remarks

For more information on the Colors dialog box, refer to ImageWarp User's Guide.