genShading
Top  Previous  Next

genShading ( integer Input, integer Output, integer Distance [, integer Source =0,
floating Angle =0 ] )  

Use this function to apply non-uniform light distribution to an image or selection. You can select the type of the light source and the distance between the light source and image surface.

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.  
 
Distance  
 
An integer specifying the distance between the light source and image surface, in percentage of the image width.  
 
Source  
 
An optional enumerated integer that describes the nature of the light source. Must be one of the following values:  
 
SR_POINT – uses a point light source to simulate the light distribution  
SR_LINE – uses a line light source to simulate the light distribution  
Default value: SR_POINT  
 
Angle  
 
An optional floating argument specifying the angle between the axis of the line light source and the horizontal. The angle is measured in degrees clockwise. This parameter is disregarded for the point light source.  
Default value: 0  
 
Error flags

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

Example

This set of statements continuously captures an image and adds a line-source shading to it.  
 
do  
grabIm(0)  
genShading (0,1,50,SR_LINE)  
loop while getError()=ERR_OK