Index: trunk/psLib/src/image/psImageErrors.dat
===================================================================
--- trunk/psLib/src/image/psImageErrors.dat	(revision 3446)
+++ trunk/psLib/src/image/psImageErrors.dat	(revision 3476)
@@ -79,2 +79,3 @@
 psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d.
 psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL.
+psImageManip_TRANSFORM_NULL            Specified input transform can not be NULL.
Index: trunk/psLib/src/image/psImageErrors.h
===================================================================
--- trunk/psLib/src/image/psImageErrors.h	(revision 3446)
+++ trunk/psLib/src/image/psImageErrors.h	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -96,4 +96,5 @@
 #define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d."
 #define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL."
+#define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL"
 //~End
 
Index: trunk/psLib/src/image/psImageExtraction.c
===================================================================
--- trunk/psLib/src/image/psImageExtraction.c	(revision 3446)
+++ trunk/psLib/src/image/psImageExtraction.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-24 00:19:51 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -370,6 +370,6 @@
                 ps##TYPE *imgVecData = imgVec->data.TYPE; \
                 if (maskVec != NULL) { \
-                    maskVecData = maskVec->data.V; \
-                    maskData = (psMaskType* )(mask->data.V[row0]) + c; \
+                    maskVecData = maskVec->data.U8; \
+                    maskData = (psMaskType* )(mask->data.U8[row0]) + c; \
                 } \
                 for (psS32 r=row0;r<row1;r++) { \
@@ -453,7 +453,7 @@
             // point the vector struct to the
             // data to calculate the stats
-            imgVec->data.V = (psPtr )(in->data.U8[r] + col0 * elementSize);
+            imgVec->data.U8 = (psPtr )(in->data.U8[r] + col0 * elementSize);
             if (maskVec != NULL) {
-                maskVec->data.V = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
+                maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
             }
             myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal);
Index: trunk/psLib/src/image/psImageManip.c
===================================================================
--- trunk/psLib/src/image/psImageManip.c	(revision 3446)
+++ trunk/psLib/src/image/psImageManip.c	(revision 3476)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-18 02:35:14 $
+ *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -27,4 +27,5 @@
 #include "psConstants.h"
 #include "psImageErrors.h"
+#include "psCoord.h"
 
 psS32 psImageClip(psImage* input,
@@ -1034,5 +1035,4 @@
     break;
 
-
     switch (mode) {
         PSIMAGE_SHIFT_ARBITRARY_CASE(FLAT);
@@ -1049,2 +1049,35 @@
     return out;
 }
+
+
+// XXX: implementation is awaiting working psPlaneTransform functions like
+// invert.  Also, the next SDRS should have a different signature.
+psImage* psImageTransform(psImage *output,
+                          const psImage *input,
+                          const psImage *inputMask,
+                          int inputMaskVal,
+                          const psPlaneTransform *outToIn,
+                          const psImage *combineMask,
+                          int combineMaskVal)
+{
+    if (input == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psImage_IMAGE_NULL);
+        return NULL;
+    }
+
+    if (outToIn == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psImageManip_TRANSFORM_NULL);
+        return NULL;
+    }
+
+    // find the input image domain in the output image
+
+    // loop through the output image using the domain above and transform
+    // each output pixel to input coordinates and use psImagePixelInterpolate
+    // to determine the pixel value.
+
+
+    return NULL;
+}
Index: trunk/psLib/src/image/psImageManip.h
===================================================================
--- trunk/psLib/src/image/psImageManip.h	(revision 3446)
+++ trunk/psLib/src/image/psImageManip.h	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,5 @@
 
 #include "psImage.h"
+#include "psCoord.h"
 
 /// @addtogroup Image
@@ -180,3 +181,34 @@
 );
 
+/** 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
+ *  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.
+ *
+ *  @return psImage*    The transformed image.
+ */
+psImage* psImageTransform(
+    psImage *output,                   ///< psImage to recycle, or NULL
+    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
+);
+
 #endif
Index: trunk/psLib/src/image/psImageStats.c
===================================================================
--- trunk/psLib/src/image/psImageStats.c	(revision 3446)
+++ trunk/psLib/src/image/psImageStats.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-23 21:32:40 $
+ *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -63,5 +63,5 @@
         junkData->nalloc = in->numRows * in->numCols;
         junkData->n = junkData->nalloc;
-        junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
+        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     } else {
         // image not necessarily contiguous
@@ -73,5 +73,5 @@
         junkData->n = junkData->nalloc;
 
-        psU8* data = junkData->data.V;
+        psU8* data = junkData->data.U8;
         for (int row = 0; row < numRows; row++) {
             memcpy(data, in->data.V[row], rowSize);
@@ -87,5 +87,5 @@
             junkMask->nalloc = mask->numRows * mask->numCols;
             junkMask->n = junkMask->nalloc;
-            junkMask->data.V = mask->data.V[0];
+            junkMask->data.U8 = mask->data.V[0];
         } else {
             // image not necessarily contiguous
@@ -97,5 +97,5 @@
             junkMask->n = junkMask->nalloc;
 
-            psU8* data = junkMask->data.V;
+            psU8* data = junkMask->data.U8;
             for (int row = 0; row < numRows; row++) {
                 memcpy(data, mask->data.V[row], rowSize);
@@ -136,5 +136,5 @@
         junkData->nalloc = in->numRows * in->numCols;
         junkData->n = junkData->nalloc;
-        junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
+        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     } else {
         // image not necessarily contiguous
@@ -146,5 +146,5 @@
         junkData->n = junkData->nalloc;
 
-        psU8* data = junkData->data.V;
+        psU8* data = junkData->data.U8;
         for (int row = 0; row < numRows; row++) {
             memcpy(data, in->data.V[row], rowSize);
@@ -160,5 +160,5 @@
             junkMask->nalloc = mask->numRows * mask->numCols;
             junkMask->n = junkMask->nalloc;
-            junkMask->data.V = mask->data.V[0];
+            junkMask->data.U8 = mask->data.V[0];
         } else {
             // image not necessarily contiguous
@@ -170,5 +170,5 @@
             junkMask->n = junkMask->nalloc;
 
-            psU8* data = junkMask->data.V;
+            psU8* data = junkMask->data.U8;
             for (int row = 0; row < numRows; row++) {
                 memcpy(data, mask->data.V[row], rowSize);
