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

<body bgcolor="#FFFFFF" text="#000000" link="#1F00FF" alink="#FF0000"  vlink="#9900DD">

<!-- INDEX BEGIN -->

<UL>

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

		<LI><A HREF="#RotateImage">RotateImage</A></LI>
		<LI><A HREF="#ShearImage">ShearImage</A></LI>
	</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>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
Image * <STRONG>RotateImage</STRONG>( Image *image, const double degrees );

</P>
<P>
Image * <STRONG>ShearImage</STRONG>( Image *image, const double x_shear, const double y_shear );

</P>
<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. 
<FONT SIZE=-1>X</FONT> 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>
<P>
Method RotateImage is based on the paper 
<FONT SIZE=-1>``A</FONT> Fast Algorithm for General Raster Rotatation'' by Alan 
<FONT SIZE=-1>W.</FONT> Paeth. RotateImage is adapted from a similar method based on the Paeth paper written by Michael Halle of the Spatial Imaging Group, 
<FONT SIZE=-1>MIT</FONT> Media Lab.


</P>
<P>
The format of the RotateImage method is:

</P>
<blockquote><A HREF="types/Image.html">Image</A> *RotateImage ( <A HREF="types/Image.html">Image</A> *image, const double degrees ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows.

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

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

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

</P>
</DL></DL>
<P>
<HR>
<H2><A NAME="ShearImage">ShearImage</A></H2>
<P>
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 
<FONT SIZE=-1>X</FONT> or 
<FONT SIZE=-1>Y</FONT> axis, creating a parallelogram. An 
<FONT SIZE=-1>X</FONT> direction shear slides an edge along the 
<FONT SIZE=-1>X</FONT> axis, while a 
<FONT SIZE=-1>Y</FONT> direction shear slides an edge along the 
<FONT SIZE=-1>Y</FONT> axis. The amount of the shear is controlled by a shear angle. For 
<FONT SIZE=-1>X</FONT> direction shears, x_shear is measured relative to the 
<FONT SIZE=-1>Y</FONT> axis, and similarly, for 
<FONT SIZE=-1>Y</FONT> direction shears y_shear is measured relative to the 
<FONT SIZE=-1>X</FONT> 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>
<P>
Method ShearImage is based on the paper 
<FONT SIZE=-1>``A</FONT> Fast Algorithm for General Raster Rotatation'' by Alan 
<FONT SIZE=-1>W.</FONT> Paeth.


</P>
<P>
The format of the ShearImage method is:

</P>
<blockquote><A HREF="types/Image.html">Image</A> *ShearImage ( <A HREF="types/Image.html">Image</A> *image, const double x_shear, const double y_shear ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows.

</P>
<DL><DL>
<p><dt><STRONG>status:</STRONG><DD>
<P>
Method ShearImage returns a pointer to the image after rotating. 
<FONT SIZE=-1>A</FONT> null image is returned if there is a memory
shortage.

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

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

</P>
</DL></DL>

</BODY>

</HTML>
