<HTML>
<HEAD>
<TITLE>shear - Methods to Shear or Rotate an Image by an Arbitrary Angle</TITLE>
<LINK REV="made" HREF="mailto:cristy@mystic.es.dupont.com">
</HEAD>

<body background="../../images/background.gif">

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A>
	<UL>

		<LI><A HREF="#RotateImage">RotateImage</A>
		<LI><A HREF="#ShearImage">ShearImage</A>
	</UL>

</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
shear - Methods to Shear or Rotate an Image by an Arbitrary Angle

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
<STRONG>RotateImage</STRONG>(image,degrees,crop,sharpen)

<P>
<STRONG>ShearImage</STRONG>(image,x_shear,y_shear,crop)

<P>
<HR>
<H1><A NAME="FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A></H1>
<P>
<HR>
<H2><A NAME="RotateImage">RotateImage</A></H2>
<P>
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.

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

<P>
The format of the RotateImage routine is:

<P>
<PRE>        RotateImage(image,degrees,crop,sharpen)
</PRE>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG><A NAME="item_o">status:</A></STRONG><DD>
<P>
Method RotateImage returns a pointer to the image after rotating. A null
image is returned if there is a memory shortage.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image; returned from ReadImage.

<DT><STRONG>degrees:</STRONG><DD>
<P>
Specifies the number of degrees to rotate the image.

<DT><STRONG>crop:</STRONG><DD>
<P>
A value other than zero crops the corners of the rotated image and retains
the original image size.

<DT><STRONG>sharpen:</STRONG><DD>
<P>
A value other than zero sharpens the image after it is rotated.

</DL></DL>
<P>
<HR>
<H2><A NAME="ShearImage">ShearImage</A></H2>
<P>
Method ShearImage creates a new image that is a sheared 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 Y axis. The amount of the
shear is controlled by a shear angle. For X direction shears, x_shear is
measured relative to the Y axis, and similarly, for Y 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.

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

<P>
The format of the ShearImage routine is:

<P>
<PRE>        ShearImage(image,x_shear,y_shear,crop)
</PRE>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method ShearImage returns a pointer to the image after rotating. A null
image is returned if there is a memory shortage.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image; returned from ReadImage.

<DT><STRONG>x_shear, y_shear:</STRONG><DD>
<P>
Specifies the number of degrees to shear the image.

<DT><STRONG>crop:</STRONG><DD>
<P>
A value other than zero crops the corners of the rotated image and retains
the original image size.

</DL></DL>
</BODY>

</HTML>
