Pshear - Methods to Shear or Rotate an Image by an Arbitrary Angle;/


NAME



Ashear - Methods to Shear or Rotate an Image by an Arbitrary Angle




(

SYNOPSIS



8RotateImage(image,degrees,crop,sharpen)

7ShearImage(image,x_shear,y_shear,crop)




B

FUNCTION DESCRIPTIONS






.

RotateImage



CMethod 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.

GMethod RotateImage is based on the paper ``A Fast Algorithm for GeneralKRaster Rotatation'' by Alan W. Paeth. RotateImage is adapted from a similarHroutine based on the Paeth paper written by Michael Halle of the SpatialImaging Group, MIT Media Lab.

)The format of the RotateImage routine is:

4

        RotateImage(image,degrees,crop,sharpen)


(A description of each parameter follows.

5
status:


HMethod 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



KMethod ShearImage creates a new image that is a sheared copy of an existingKone. Shearing slides one edge of an image along the X or Y axis, creating aJparallelogram. An X direction shear slides an edge along the X axis, whileFa Y direction shear slides an edge along the Y axis. The amount of theHshear is controlled by a shear angle. For X direction shears, x_shear isFmeasured relative to the Y axis, and similarly, for Y direction shearsJy_shear is measured relative to the X axis. Empty triangles left over fromDshearing the image are filled with the color defined by the pixel atKlocation (0,0). ShearImage allocates the memory necessary for the new Image1structure and returns a pointer to the new image.

FMethod 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:


GMethod 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.