Index: trunk/psLib/src/image/psImageManip.c
===================================================================
--- trunk/psLib/src/image/psImageManip.c	(revision 2835)
+++ trunk/psLib/src/image/psImageManip.c	(revision 2860)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-28 01:42:28 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-03 21:58:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,5 +25,5 @@
 #include "psMemory.h"
 #include "psImageExtraction.h"
-
+#include "psConstants.h"
 #include "psImageErrors.h"
 
@@ -675,8 +675,8 @@
         return NULL;
     }
-    // put the angle in the range of 0...360.
-    angle = angle - 360.0f * floor(angle / 360.0f);
-
-    if (fabsf(angle - 90.0f) < FLT_EPSILON) {
+    // put the angle in the range of 0...2PI.
+    angle = angle - (2.0*PS_PI) * floor(angle / (2.0*PS_PI));
+
+    if (fabsf(angle - PS_PI_2) < FLT_EPSILON) {
         // perform 1/4 rotate counter-clockwise
         psS32 numRows = in->numCols;
@@ -702,10 +702,10 @@
             PSIMAGE_ROTATE_LEFT_90(U8);
             PSIMAGE_ROTATE_LEFT_90(U16);
-            //            PSIMAGE_ROTATE_LEFT_90(U32);      Not a requirement
-            //            PSIMAGE_ROTATE_LEFT_90(U64);      Not a requirement
+            PSIMAGE_ROTATE_LEFT_90(U32);    //  Not a requirement
+            PSIMAGE_ROTATE_LEFT_90(U64);    //  Not a requirement
             PSIMAGE_ROTATE_LEFT_90(S8);
             PSIMAGE_ROTATE_LEFT_90(S16);
-            //            PSIMAGE_ROTATE_LEFT_90(S32);      Not a requirement
-            //            PSIMAGE_ROTATE_LEFT_90(S64);      Not a requirement
+            PSIMAGE_ROTATE_LEFT_90(S32);    //  Not a requirement
+            PSIMAGE_ROTATE_LEFT_90(S64);    //  Not a requirement
             PSIMAGE_ROTATE_LEFT_90(F32);
             PSIMAGE_ROTATE_LEFT_90(F64);
@@ -723,5 +723,5 @@
             }
         }
-    } else if (fabsf(angle - 180.0f) < FLT_EPSILON) {
+    } else if (fabsf(angle - PS_PI) < FLT_EPSILON) {
         // perform 1/2 rotate
         psS32 numRows = in->numRows;
@@ -748,10 +748,10 @@
             PSIMAGE_ROTATE_180_CASE(U8);
             PSIMAGE_ROTATE_180_CASE(U16);
-            //            PSIMAGE_ROTATE_180_CASE(U32);    Not a requirement
-            //            PSIMAGE_ROTATE_180_CASE(U64);    Not a requirement
+            PSIMAGE_ROTATE_180_CASE(U32);    // Not a requirement
+            PSIMAGE_ROTATE_180_CASE(U64);    // Not a requirement
             PSIMAGE_ROTATE_180_CASE(S8);
             PSIMAGE_ROTATE_180_CASE(S16);
-            //            PSIMAGE_ROTATE_180_CASE(S32);    Not a requirement
-            //            PSIMAGE_ROTATE_180_CASE(S64);    Not a requirement
+            PSIMAGE_ROTATE_180_CASE(S32);    // Not a requirement
+            PSIMAGE_ROTATE_180_CASE(S64);    // Not a requirement
             PSIMAGE_ROTATE_180_CASE(F32);
             PSIMAGE_ROTATE_180_CASE(F64);
@@ -769,5 +769,5 @@
             }
         }
-    } else if (fabsf(angle - 270.0f) < FLT_EPSILON) {
+    } else if (fabsf(angle - (PS_PI+PS_PI_2)) < FLT_EPSILON) {
         // perform 1/4 rotate clockwise
         psS32 numRows = in->numCols;
@@ -793,10 +793,10 @@
             PSIMAGE_ROTATE_RIGHT_90(U8);
             PSIMAGE_ROTATE_RIGHT_90(U16);
-            //            PSIMAGE_ROTATE_RIGHT_90(U32);     Not a requirement
-            //            PSIMAGE_ROTATE_RIGHT_90(U64);     Not a requirement
+            PSIMAGE_ROTATE_RIGHT_90(U32);     // Not a requirement
+            PSIMAGE_ROTATE_RIGHT_90(U64);     // Not a requirement
             PSIMAGE_ROTATE_RIGHT_90(S8);
             PSIMAGE_ROTATE_RIGHT_90(S16);
-            //            PSIMAGE_ROTATE_RIGHT_90(S32);     Not a requirement
-            //            PSIMAGE_ROTATE_RIGHT_90(S64);     Not a requirement
+            PSIMAGE_ROTATE_RIGHT_90(S32);     // Not a requirement
+            PSIMAGE_ROTATE_RIGHT_90(S64);     // Not a requirement
             PSIMAGE_ROTATE_RIGHT_90(F32);
             PSIMAGE_ROTATE_RIGHT_90(F64);
@@ -822,7 +822,6 @@
         float centerX = (float)(numCols) / 2.0f;
         float centerY = (float)(numRows) / 2.0f;
-        float t = angle * (3.14159265358f / 180.0f);
-        double cosT = cosf(t);
-        double sinT = sinf(t);
+        double cosT = cosf(angle);
+        double sinT = sinf(angle);
 
         // calculate the corners of the rotated image so we know the proper output image size.
@@ -897,10 +896,10 @@
             PSIMAGE_ROTATE_ARBITRARY_LOOP(U16,MODE); \
             break; \
-            /*        case PS_TYPE_U32:    Not a requirement */ \
-            /*            PSIMAGE_ROTATE_ARBITRARY_LOOP(U32,MODE); */ \
-            /*            break; */ \
-            /*        case PS_TYPE_U64:    Not a requirement */ \
-            /*            PSIMAGE_ROTATE_ARBITRARY_LOOP(U64,MODE); */ \
-            /*            break; */ \
+        case PS_TYPE_U32:   /* Not a requirement */ \
+            PSIMAGE_ROTATE_ARBITRARY_LOOP(U32,MODE); \
+            break; \
+        case PS_TYPE_U64:   /* Not a requirement */ \
+            PSIMAGE_ROTATE_ARBITRARY_LOOP(U64,MODE); \
+            break;  \
         case PS_TYPE_S8: \
             PSIMAGE_ROTATE_ARBITRARY_LOOP(S8,MODE); \
@@ -909,10 +908,10 @@
             PSIMAGE_ROTATE_ARBITRARY_LOOP(S16,MODE); \
             break; \
-            /*        case PS_TYPE_S32:    Not a requirement */ \
-            /*            PSIMAGE_ROTATE_ARBITRARY_LOOP(S32,MODE); */ \
-            /*            break; */ \
-            /*        case PS_TYPE_S64:    Not a requirement */ \
-            /*            PSIMAGE_ROTATE_ARBITRARY_LOOP(S64,MODE); */ \
-            /*            break; */ \
+        case PS_TYPE_S32:   /* Not a requirement */ \
+            PSIMAGE_ROTATE_ARBITRARY_LOOP(S32,MODE); \
+            break; \
+        case PS_TYPE_S64:   /* Not a requirement */ \
+            PSIMAGE_ROTATE_ARBITRARY_LOOP(S64,MODE); \
+            break; \
         case PS_TYPE_F32: \
             PSIMAGE_ROTATE_ARBITRARY_LOOP(F32,MODE); \
Index: trunk/psLib/src/image/psImageManip.h
===================================================================
--- trunk/psLib/src/image/psImageManip.h	(revision 2835)
+++ trunk/psLib/src/image/psImageManip.h	(revision 2860)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-16 20:00:21 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-03 21:58:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -44,5 +44,5 @@
  *  All pixels outside of the rectangular region in complex space formed by
  *  the min and max input parameters are set to the value vmax (if either
- *  the real or imaginary portion exceeds the respective max values), or vmin. 
+ *  the real or imaginary portion exceeds the respective max values), or vmin.
  *  This function is defined for psC32, and psC64 imagery only.
  *
@@ -93,5 +93,5 @@
  *  1/scale.  The scale, always a positive number, is equal in each dimension and
  *  specified the number of pixels used to define a new pixel in the output image.
- *  The output image is generated from all input image pixels. This function is 
+ *  The output image is generated from all input image pixels. This function is
  *  defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
  *
@@ -110,8 +110,8 @@
 /** Resample image to new scale.
  *
- *  A new image is constructed in which the dimensions are increased by a 
- *  factor of scale. The scale, always a positive number, is equal in each 
- *  dimension. The output image is generated from all input image pixels. 
- *  Each pixel in the output image is derived by interpolating between 
+ *  A new image is constructed in which the dimensions are increased by a
+ *  factor of scale. The scale, always a positive number, is equal in each
+ *  dimension. The output image is generated from all input image pixels.
+ *  Each pixel in the output image is derived by interpolating between
  *  neighboring pixels using the specified interpolation method (mode).
  *
@@ -127,10 +127,10 @@
 /** Rotate the input image by given angle, specified in degrees.
  *
- *  The output image must contain all of the pixels from the input image in 
- *  their new frame. Pixels in the output image which do not map to input 
- *  pixels should be set to exposed. The center of rotation is always the 
- *  center pixel of the image. The rotation is specified in the sense that a 
- *  positive angle is an anti-clockwise rotation. This function must be 
- *  defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64, 
+ *  The output image must contain all of the pixels from the input image in
+ *  their new frame. Pixels in the output image which do not map to input
+ *  pixels should be set to exposed. The center of rotation is always the
+ *  center pixel of the image. The rotation is specified in the sense that a
+ *  positive angle is an anti-clockwise rotation. This function must be
+ *  defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64,
  *  psC32, psC64.
  *
@@ -140,5 +140,5 @@
     psImage* out,                      ///< an psImage to recycle.  If NULL, a new image is created
     const psImage* in,                 ///< input image
-    float angle,                       ///< the rotation angle in degrees.
+    float angle,                       ///< the rotation angle in radians.
     psC64 unexposedValue,              ///< the output image pixel values for non-imagery areas
     psImageInterpolateMode mode        ///< the interpolation mode used
@@ -147,9 +147,9 @@
 /** Shift image by an arbitrary number of pixels (dx,dy) in either direction.
  *
- *  If the shift values are fractional, the output pixel values should 
- *  interpolate between the input pixel values. The output image has the same 
- *  dimensions as the input image. Pixels which fall off the edge of the 
- *  output image are lost. Newly exposed pixels are set to the value given by 
- *  exposed. This function must be defined for the following types: psU8, 
+ *  If the shift values are fractional, the output pixel values should
+ *  interpolate between the input pixel values. The output image has the same
+ *  dimensions as the input image. Pixels which fall off the edge of the
+ *  output image are lost. Newly exposed pixels are set to the value given by
+ *  exposed. This function must be defined for the following types: psU8,
  *  psU16, psS8, psS16, psF32, psF64, psC32, psC64.
  *
@@ -166,7 +166,7 @@
 
 /** Roll image by an integer number of pixels in either direction.
- * 
+ *
  *  The output image is the same dimensions as the input image.  Edge pixels
- *  wrap to the other side (no values are lost).  This function is 
+ *  wrap to the other side (no values are lost).  This function is
  *  defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
  *
