factorIm
Top  Previous  Next

factorIm ( integer Input, integer Output, float Factor [, integer Mode =1] )

Use this function to multiply each pixel in an image or selection to a constant value. The following formula is used for calculating the intensity of a target pixel:

factorim

If a pixel's result falls outside of the image's intensity scale, it will be clipped or wrapped around the highest /lowest permitted value, depending on the Mode selected.


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.  
 
Output  
 
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Factor  
 
A floating variable or constant specifying the value that will be multiplied to each pixel of the image.  
 
Mode  
 
An optional enumerated integer that describes the processing mode to use. Must be one of the following values:  
 
M_WRAP=0 - pixel values in the output image which fall outside of the image's intensity range will be wrapped around the highest permitted value or zero level.  
M_CLIP=1 - pixel values in the output image which fall outside of the image's intensity range will be clipped to the highest permitted intensity value or zero level.  
Default: M_CLIP  
 
If the input image is of the floating or complex type, this parameter is disregarded.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example

The following set of statements displays a live image with all pixels factored by a value of 1.3 with saturation:  
 
do  
  grabIm (0)  
  factorIm(0, 1, 1.3)  
loop while getError()=ERR_OK