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



KImage * RotateImage( Image *image, const double degrees );



`Image * ShearImage( Image *image, const double x_shear, const double y_shear );






B

FUNCTION DESCRIPTIONS






.

RotateImage



Method RotateImage creates a new image that is a rotated copy of an existing one. Positive angles rotate counter-clockwise (right-hand rule), while negative angles rotate clockwise. Rotated images are usually larger than the originals and have 'empty' triangular corners. ÿX axis. Empty triangles left over from shearing the image are filled with the color defined by the pixel at location (0,0). RotateImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.



)Method RotateImage is based on the paper P``A Fast Algorithm for General Raster Rotatation'' by Alan œW. Paeth. RotateImage is adapted from a similar method based on the Paeth paper written by Michael Halle of the Spatial Imaging Group, #MIT Media Lab.



(The format of the RotateImage method is:

Image *RotateImage ( Image *image, const double degrees );


=A description of each parameter follows.


8

status:


BMethod RotateImage returns a pointer to the image after rotating. BA null image 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.






,

ShearImage



„Method ShearImage creates a new image that is a shear_image copy of an existing one. Shearing slides one edge of an image along the X or :Y axis, creating a parallelogram. An @X direction shear slides an edge along the %X axis, while a @Y direction shear slides an edge along the YY axis. The amount of the shear is controlled by a shear angle. For MX direction shears, x_shear is measured relative to the 0Y axis, and similarly, for LY direction shears y_shear is measured relative to the þX axis. Empty triangles left over from shearing the image are filled with the color defined by the pixel at location (0,0). ShearImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.



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



'The format of the ShearImage method is:

§
Image *ShearImage ( Image *image, const double x_shear, const double y_shear );


=A description of each parameter follows.


#

status:


AMethod ShearImage returns a pointer to the image after rotating. BA null image 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.