Index: /trunk/psLib/pslib.kdevses
===================================================================
--- /trunk/psLib/pslib.kdevses	(revision 3879)
+++ /trunk/psLib/pslib.kdevses	(revision 3880)
@@ -3,21 +3,21 @@
 <KDevPrjSession>
  <DocsAndViews NumberOfDocuments="6" >
-  <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataIO/psFits.c" >
-   <View0 line="1202" Type="Source" />
+  <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.h" >
+   <View0 line="32" Type="Source" />
   </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/image/tst_psImage.c" >
-   <View0 line="35" Type="Source" />
+  <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.c" >
+   <View0 line="1054" Type="Source" />
   </Doc1>
-  <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/configure.ac" >
-   <View0 line="26" Type="Source" />
+  <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.c" >
+   <View0 line="377" Type="Source" />
   </Doc2>
-  <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/sysUtils/psTrace.h" >
-   <View0 line="87" Type="Source" />
+  <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.h" >
+   <View0 line="0" Type="Source" />
   </Doc3>
-  <Doc4 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/sysUtils/psTrace.c" >
-   <View0 line="522" Type="Source" />
+  <Doc4 NumberOfViews="1" URL="file:///usr/include/gsl/gsl_linalg.h" >
+   <View0 line="53" Type="Source" />
   </Doc4>
-  <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psMetadata.h" >
-   <View0 line="65" Type="Source" />
+  <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psConstants.h" >
+   <View0 line="32" Type="Source" />
   </Doc5>
  </DocsAndViews>
Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 3879)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 3880)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-14 03:23:55 $
+ *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 02:29:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -31,5 +31,4 @@
 These are common mathimatical constants used by various functions in the psLib.
  *****************************************************************************/
-#define PS_ONE 1.0
 #define PS_PI   3.1415926535897932384626433832795029  /* pi */
 #define PS_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
@@ -38,5 +37,4 @@
 #define PS_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
 
-#define PS_COT(X) (1.0 / atan(X))
 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0)
 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0))
Index: /trunk/psLib/src/dataManip/psMatrix.c
===================================================================
--- /trunk/psLib/src/dataManip/psMatrix.c	(revision 3879)
+++ /trunk/psLib/src/dataManip/psMatrix.c	(revision 3880)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-22 21:52:49 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 02:29:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -376,6 +376,4 @@
 psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2)
 {
-    psS32 numRows = 0;
-    psS32 numCols = 0;
     gsl_matrix *m1 = NULL;
     gsl_matrix *m2 = NULL;
@@ -394,21 +392,21 @@
     PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP);
 
-    outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type);
-
-    PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP);
-    PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP);
-    PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP);
-
-    // Initialize data
-    numRows = inImage1->numRows;
-    numCols = inImage1->numCols;
+    if (inImage1->numRows != inImage2->numCols) {
+        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2.");
+        MULTIPLY_CLEANUP;
+    }
+    if (inImage1->type.type != inImage2->type.type) {
+        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match.");
+        MULTIPLY_CLEANUP;
+    }
+
+    outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type);
 
     // Initialize GSL data
-    m1 = gsl_matrix_alloc(numRows, numCols);
+    m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols);
     psImageToGslMatrix(m1, inImage1);
-    m2 = gsl_matrix_alloc(numRows, numCols);
+    m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols);
     psImageToGslMatrix(m2, inImage2);
-    m3 = gsl_matrix_alloc(numRows, numCols);
-    psImageToGslMatrix(m3, outImage);
+    m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols);
 
     // Perform multiplication
Index: /trunk/psLib/src/image/psImageManip.c
===================================================================
--- /trunk/psLib/src/image/psImageManip.c	(revision 3879)
+++ /trunk/psLib/src/image/psImageManip.c	(revision 3880)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-21 21:18:23 $
+ *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 02:29:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1056,10 +1056,13 @@
 // invert.  Also, the next SDRS should have a different signature.
 psImage* psImageTransform(psImage *output,
+                          psArray** blankPixels,
                           const psImage *input,
                           const psImage *inputMask,
                           int inputMaskVal,
                           const psPlaneTransform *outToIn,
-                          const psImage *combineMask,
-                          int combineMaskVal)
+                          const psRegion region,
+                          const psPixels* pixels,
+                          psImageInterpolateMode mode,
+                          int exposedValue)
 {
     if (input == NULL) {
Index: /trunk/psLib/src/image/psImageManip.h
===================================================================
--- /trunk/psLib/src/image/psImageManip.h	(revision 3879)
+++ /trunk/psLib/src/image/psImageManip.h	(revision 3880)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-21 21:18:23 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 02:29:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -21,4 +21,5 @@
 #include "psCoord.h"
 #include "psStats.h"
+#include "psPixels.h"
 
 /// @addtogroup Image
@@ -183,20 +184,25 @@
 /** Transform the input image according the supplied transformation.
  *
- *  Transform the input image according the supplied transformation. In the
- *  event that the output is NULL, the smallest possible image capable of
- *  containing the entire transformed input image is to be returned; otherwise
- *  only the image size specified in the output image is to be used. If the
- *  inputMask is not NULL, those pixels in the inputMask matching inputMaskVal
+ *  Transform the input image according the supplied transformation. The size
+ *  of the transformed image is deï¬ned by the supplied output image, if
+ *  non-NULL, or the region otherwise (size region.x1 - region.x0 by region.y1
+ *  region.y0, with out->x0 = region.x0 and out->y0 = region.y0). If the
+ *  inputMask is non-NULL, those pixels in the inputMask matching inputMaskVal
  *  are to be ignored in the transformation. The inputMask must be of type
  *  psU8, and of the same size as the input, otherwise the function shall
- *  generate an error and return NULL. The transformation outToIn specifies
- *  the coordinates in the input image of a pixel in the output image - note
- *  that this is the reverse of what might be naively expected, but it is what
- *  is required in order to use psImagePixelInterpolate. If combineMask is not
- *  NULL, then those pixels that match combineMaskVal are not transformed.
- *  combineMask must be of type psU8 and of the same size as the output,
- *  otherwise the function shall generate an error and return NULL. This
- *  function must be capable of handling the following types for the input
- *  (with corresponding types for the output): psF32, psF64.
+ *  generate an error and return NULL. The transformation outToIn speciï¬es the
+ *  coordinates in the input image of a pixel in the output image â note that
+ *  this is the reverse of what might be naively expected, but it is what is
+ *  required in order to use psImagePixelInterpolate. If the pixels array is
+ *  non-NULL, it shall consist of psPixelCoords, and only those pixels in the
+ *  output image shall be transformed; otherwise, the entire image is
+ *  generated. The interpolation is performed using the speciï¬ed interpolation
+ *  mode. Where a pixel in the output image does not correspond to a pixel in
+ *  the input image (or all appropriate pixels in the input image are
+ *  masked), the value shall be set to exposed, and the pixel added to the
+ *  appropriate list of pixels (psPixels) in the array of blankPixels for
+ *  return to the user. This function must be capable of handling the following
+ *  types for the input (with corresponding types for the output): psF32, psF64.
+ 
  *
  *  @return psImage*    The transformed image.
@@ -204,10 +210,13 @@
 psImage* psImageTransform(
     psImage *output,                   ///< psImage to recycle, or NULL
+    psArray** blankPixels,             ///<
     const psImage *input,              ///< psImage to apply transform to
     const psImage *inputMask,          ///< if not NULL, mask of input psImage
     int inputMaskVal,                  ///< masking value for inputMask
     const psPlaneTransform *outToIn,   ///< the transform to apply
-    const psImage *combineMask,        ///< if not NULL, mask of pixels not to be transformed
-    int combineMaskVal                 ///< masking value for combineMask
+    const psRegion region,             ///<
+    const psPixels* pixels,            ///<
+    psImageInterpolateMode mode,       ///<
+    int exposedValue                   ///<
 );
 
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 3879)
+++ /trunk/psLib/src/math/psConstants.h	(revision 3880)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-14 03:23:55 $
+ *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 02:29:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -31,5 +31,4 @@
 These are common mathimatical constants used by various functions in the psLib.
  *****************************************************************************/
-#define PS_ONE 1.0
 #define PS_PI   3.1415926535897932384626433832795029  /* pi */
 #define PS_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
@@ -38,5 +37,4 @@
 #define PS_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
 
-#define PS_COT(X) (1.0 / atan(X))
 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0)
 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0))
Index: /trunk/psLib/src/math/psMatrix.c
===================================================================
--- /trunk/psLib/src/math/psMatrix.c	(revision 3879)
+++ /trunk/psLib/src/math/psMatrix.c	(revision 3880)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-22 21:52:49 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 02:29:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -376,6 +376,4 @@
 psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2)
 {
-    psS32 numRows = 0;
-    psS32 numCols = 0;
     gsl_matrix *m1 = NULL;
     gsl_matrix *m2 = NULL;
@@ -394,21 +392,21 @@
     PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP);
 
-    outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type);
-
-    PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP);
-    PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP);
-    PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP);
-
-    // Initialize data
-    numRows = inImage1->numRows;
-    numCols = inImage1->numCols;
+    if (inImage1->numRows != inImage2->numCols) {
+        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2.");
+        MULTIPLY_CLEANUP;
+    }
+    if (inImage1->type.type != inImage2->type.type) {
+        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match.");
+        MULTIPLY_CLEANUP;
+    }
+
+    outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type);
 
     // Initialize GSL data
-    m1 = gsl_matrix_alloc(numRows, numCols);
+    m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols);
     psImageToGslMatrix(m1, inImage1);
-    m2 = gsl_matrix_alloc(numRows, numCols);
+    m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols);
     psImageToGslMatrix(m2, inImage2);
-    m3 = gsl_matrix_alloc(numRows, numCols);
-    psImageToGslMatrix(m3, outImage);
+    m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols);
 
     // Perform multiplication
