H shear - Shear or rotate a raster image by an arbitrary angle�� �  0 




NAME

<shear - Shear or rotate a raster image by an arbitrary angle








SYNOPSIS

8RotateImage(image,degrees,crop,sharpen)

7ShearImage(image,x_shear,y_shear,crop)






9

FUNCTION DESCRIPTIONS






%

RotateImage

EFunction RotateImage creates a new image that is a rotated copy of anIexisting one. Positive angles rotate counter-clockwise (right-hand rule),Iwhile negative angles rotate clockwise. Rotated images are usually largerEthan the originals and have 'empty' triangular corners. X axis. EmptyEtriangles left over from shearing the image are filled with the colorHdefined by the pixel at location (0,0). RotateImage allocates the memoryFnecessary for the new Image structure and returns a pointer to the newimage.

IFunction RotateImage is based on the paper ``A Fast Algorithm for GeneralCRaster Rotatation'' by Alan W. Paeth. RotateImage is adapted from aIsimiliar routine based on the Paeth paper written by Michael Halle of the%Spatial Imaging Group, MIT Media Lab.

)The format of the RotateImage routine is:

4

        RotateImage(image,degrees,crop,sharpen)


(A description of each parameter follows.



$
status:
JFunction RotateImage returns a pointer to the image after rotating. A null0image is returned if there is a memory shortage.



image:
BThe address of a structure of type Image; returned from ReadImage.



degrees:
4Specifies the number of degrees to rotate the image.



crop:
JA value other than zero crops the corners of the rotated image and retainsthe original image size.



sharpen:
?A value other than zero sharpens the image after it is rotated.






#

ShearImage

DFunction ShearImage creates a new image that is a sheared copy of anIexisting one. Shearing slides one edge of an image along the X or Y axis,Icreating a parallelogram. An X direction shear slides an edge along the XKaxis, while a Y direction shear slides an edge along the Y axis. The amountDof the shear is controlled by a shear angle. For X direction shears,Jx_shear is measured relative to the Y axis, and similarly, for Y directionGshears y_shear is measured relative to the X axis. Empty triangles leftKover from shearing the image are filled with the color defined by the pixelHat location (0,0). ShearImage allocates the memory necessary for the new7Image structure and returns a pointer to the new image.

HFunction ShearImage is based on the paper ``A Fast Algorithm for General%Raster Rotatation'' by Alan W. Paeth.

(The format of the ShearImage routine is:

3

        ShearImage(image,x_shear,y_shear,crop)


(A description of each parameter follows.




status:
IFunction ShearImage returns a pointer to the image after rotating. A null0image is returned if there is a memory shortage.



image:
BThe address of a structure of type Image; returned from ReadImage.



x_shear, y_shear:
3Specifies the number of degrees to shear the image.



crop:
JA value other than zero crops the corners of the rotated image and retainsthe original image size.