Index: trunk/psLib/test/image/tst_psImageGeomManip.c
===================================================================
--- trunk/psLib/test/image/tst_psImageGeomManip.c	(revision 4308)
+++ trunk/psLib/test/image/tst_psImageGeomManip.c	(revision 4541)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-17 23:44:22 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-12 19:27:28 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1085,10 +1085,16 @@
 
     psImage* in = psImageAlloc(cols,rows,PS_TYPE_F32);
+    psImage* mask = psImageAlloc(cols,rows,PS_TYPE_MASK);
     for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[row];
+        psMaskType* maskRow = mask->data.PS_TYPE_MASK_DATA[row];
         for (psS32 col=0;col<cols;col++) {
             inRow[col] = (psF32)row+(psF32)col/1000.0f;
-        }
-    }
+            maskRow[col] = 0;
+        }
+    }
+
+
+    // ********** check psImageTransform with minimum specified inputs.
 
     psImage* out = psImageTransform(NULL,
@@ -1138,4 +1144,58 @@
     }
 
+    // zero out buffer
+    memset(out->rawDataBuffer, 0, sizeof(psF32)*out->numRows*out->numCols);
+
+    psPixels* blanks = psPixelsAlloc(10);
+    psPixels* mask = psPixelsAlloc(10);
+
+    // perform the same transform, but this time, supply a psImage to recycle and a mask
+    out = psImageTransform(out,
+                           blanks,
+                           in,
+                           mask,
+                           1,
+                           trans,
+                           psRegionSet(0,0,0,0),
+                           NULL,
+                           PS_INTERPOLATE_FLAT,
+                           -1);
+
+    if (out == NULL) {
+        psError(PS_ERR_UNKNOWN, false,
+                "out == NULL");
+        return 1;
+    }
+    if (out->type.type != PS_TYPE_F32) {
+        psError(PS_ERR_UNKNOWN, false,
+                "out->type.type != PS_TYPE_F32, out->type.type == %d",
+                out->type.type);
+        return 2;
+    }
+    if (out->numRows != rows*2 || out->numCols != cols*2) {
+        psError(PS_ERR_UNKNOWN, false,
+                "out size is %dx%d, not %dx%d",
+                out->numCols, out->numRows, cols*2, rows);
+        return 3;
+    }
+
+    for (psS32 row=0;row<out->numRows;row++) {
+        psF32* outRow = out->data.F32[row];
+        for (psS32 col=0;col<cols;col++) {
+            float inValue = p_psImagePixelInterpolateFLAT_F32(in,
+                            col*trans->x->coeff[1][0]+trans->x->coeff[0][0],
+                            row*trans->y->coeff[0][1]+trans->y->coeff[0][0],
+                            NULL, 0,
+                            -1);
+            if (fabsf(outRow[col] - inValue) > FLT_EPSILON*10) {
+                psError(PS_ERR_UNKNOWN, false,
+                        "out at %d,%d was %g, expected %g",
+                        col,row,outRow[col], inValue);
+                return 4;
+            }
+        }
+    }
+
+
     psFree(out);
     psFree(in);
