genImpulse
Top  Previous  Next

genImpulse ( integer Input, integer Output, floating Level [, integer Density=50 ] )

Use this function to generate a random impulse noise and superimpose it on an image or selection. You can choose the maximum intensity level of the noise and its average spatial density. If the image is a color one, the noise will be generated independently for each color component.

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.  
 
Level  
 
A positive floating variable or constant specifying the maximum level of noise impulses. The actual intensities of the impulses are randomly distributed between -Level and +Level.  
 
Density  
 
An integer between 1 and 100 specifying the average spatial density of the noise in relative units. The coordinates of noise impulses are randomly distributed over the image or selection area.  
Default value: 50  
 
Error flags

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

Example

This set of statements continuously grabs an image and superimposes an impulse noise on it:  
 
do  
grabim(0)  
level=getMaxPixel(0)*0.75  
genImpulse (0, 1, level, 30)  
loop