affine
Top  Previous  Next

affine ( integer Input, integer Output, integer Angle, integer ScaleX, integer ScaleY,
integer SkewX, integer Mode )

Use this function to apply an arbitrary affine transformation to an image. Affine transformation preserves collinearity, which means that all points lying on a straight line initially will still lie on a line after the transformation. The transformation includes scaling, rotation, translation, reflection and skewing of an image.

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.  
 
Angle  
 
A floating variable or constant specifying the rotation angle in degrees. A positive value corresponds to the clockwise direction, negative value to the counterclockwise direction. If this parameter is zero, no rotation will be performed.  
 
ScaleX  
 
A floating variable or constant specifying the horizontal scaling factor. If this parameter is 1., no horizontal scaling will be performed.  
 
ScaleY  
A floating variable or constant specifying the vertical scaling factor. If this parameter is 1., no vertical scaling will be performed.  
 
Skew  
 
A floating variable or constant between –90 and 90 specifying the angle of the horizontal skew in degrees. A positive value will make the upper part of the image skew to the right, a negative value to the left. If this parameter is zero, the image will not be skewed horizontally.  
 
Mode  
 
An enumerated integer that describes the flipping (reflection) mode to use. Must be one of the following values:  
 
0 – no flipping will be performed.  
1 – reverse the image horizontally.  
2 – reverse the image vertically.  
 
Error flags

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

Example

This set of statements loads the image from a file and performs its affine transform by applying horizontal and vertical scaling, rotation and horizontal skew:  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
affine (1, 2, -15, 1.5, 1.7, 0, 0)