Index: trunk/psLib/test/imageops/tap_psImagePixelManip.c
===================================================================
--- trunk/psLib/test/imageops/tap_psImagePixelManip.c	(revision 12405)
+++ trunk/psLib/test/imageops/tap_psImagePixelManip.c	(revision 12431)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-03-12 20:46:45 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-03-14 00:39:51 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -96,52 +96,4 @@
         }
 
-        #define testImageClipByComplexType(datatype) \
-        { \
-            psU32 c = 128; \
-            psU32 r = 256; \
-            psF64 min; \
-            psF64 max; \
-            psS32 numClipped = 0; \
-            psS32 retVal; \
-            psMemId id = psMemGetId(); \
-            psImage *img = psImageAlloc(c,r,PS_TYPE_##datatype); \
-            for (psU32 row=0;row<r;row++) { \
-                ps##datatype* imgRow = img->data.datatype[row]; \
-                for (psU32 col=0;col<c;col++) { \
-                    imgRow[col] = (ps##datatype)(row+I*col); \
-                } \
-            } \
-            min = (float)r/2.0f; \
-            max = (float)r; \
-            \
-            retVal = psImageClip(img,min,-1.0f,max,-2.0f); \
-            \
-            numClipped = 0; \
-            bool errorFlag = false; \
-            for (psU32 row=0;row<r;row++) { \
-                ps##datatype* imgRow = img->data.datatype[row]; \
-                for (psU32 col=0;col<c;col++) { \
-                    ps##datatype value = row+I*col; \
-                    if (cabs(value) < min) { \
-                        numClipped++; \
-                        value = -1.0f; \
-                    } else if (cabs(value) > max) { \
-                        numClipped++; \
-                        value = -2.0f; \
-                    } \
-                    if (fabsf(creal(imgRow[col])-creal(value)) > FLT_EPSILON || \
-                            fabsf(cimag(imgRow[col])-cimag(value)) > FLT_EPSILON) { \
-                        diag("Pixel value is not as expected (%.2f+%.2fi vs %.2f+%.2fi) at %u,%u", \
-                             creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \
-                        errorFlag = true; \
-                    } \
-                } \
-            } \
-            ok(!errorFlag, "psImageClip() produced the correct data values"); \
-            ok(retVal == numClipped, "Got the expected number of clips"); \
-            psFree(img); \
-            ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); \
-        }
-
         testImageClipByType(F64);
         testImageClipByType(F32);
@@ -152,7 +104,4 @@
         testImageClipByType(U16);
         testImageClipByType(U8);
-        testImageClipByComplexType(C32);
-        testImageClipByComplexType(C64);
-
 
         psF64 min=0.0;
@@ -241,6 +190,4 @@
         testImageClipNaNByType(F32);
         testImageClipNaNByType(F64);
-        testImageClipNaNByType(C32);
-        testImageClipNaNByType(C64);
 
         // Verify the retuned integer is zero, psImage structure input is unmodified
@@ -251,5 +198,5 @@
 
         // Verify program execution doesn't stop if the input image type is something
-        // other than F32, F64, C32, C64.
+        // other than F32, F64.
         img = psImageAlloc(c,r,PS_TYPE_S32);
         // Following should be an error (incorrect type)
@@ -260,232 +207,4 @@
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
-
-
-    // testImageClipComplexRegion()
-    {
-        psMemId id = psMemGetId();
-        psImage* img = NULL;
-        psU32 c = 1024;
-        psU32 r = 2048;
-        psS32 numClipped = 0;
-        psS32 retVal;
-
-        // psImageClipNaN shall modified pixel values of NaN with a specified value
-
-        // 1. Create a complex image with a wide range of complex values
-        //
-        // 2. call psImageClipComplexRegion with min and max where there is at least
-        //    2 pixels in the image above) that is:
-        //   a) real(p) < real(min) && complex(p) < complex(min),
-        //   b) real(p) < real(min) && complex(min) < complex(p) < complex(max)
-        //   c) real(min) < real(p) < real(max) && complex(p) < complex(min)
-        //   d) real(min) < real(p) < real(max) && complex(min) < complex(p) < complex(max)
-        //   e) real(p) > real(max) && complex(min) < complex(p) < complex(max)
-        //   f) real(pmin) < real(p) < real(max) && complex(p) > complex(max)
-        //   g) real(p) > real(max) && complex(p) > complex(max)
-        //   h) real(p) < real(min) && complex(p) > complex(max)
-        //   i) real(p) > real(max) && complex(p) < complex(min)
-        //
-        // 3. verify that All pixels in case (a), (b), and (c) have the value vmin
-        //
-        // 4. verify that all pixels in case (d) are unchanged from input
-        //
-        // 5. verify that all pixels in case (e), (f), (g), (h), and (i) have the
-        //    value vmax
-        #define testImageClipComplexByType(datatype,MIN,MAX) \
-        { \
-            psMemId id = psMemGetId(); \
-            img = psImageAlloc(c,r,PS_TYPE_##datatype); \
-            for (unsigned row=0;row<r;row++) { \
-                ps##datatype* imgRow = img->data.datatype[row]; \
-                for (unsigned col=0;col<c;col++) { \
-                    imgRow[col] = row+I*col; \
-                } \
-            } \
-            \
-            retVal = psImageClipComplexRegion(img,MIN,-1.0-1.0*I,MAX,-2.0-2.0*I); \
-            \
-            numClipped = 0; \
-            bool errorFlag = false; \
-            for (unsigned row=0;row<r;row++) { \
-                ps##datatype* imgRow = img->data.datatype[row]; \
-                for (unsigned col=0;col<c;col++) { \
-                    ps##datatype value = (ps##datatype)(row+I*col); \
-                    if ( (row > creal(MAX)) || (col > cimag(MAX)) ) { \
-                        numClipped++; \
-                        value = -2.0-2.0*I; \
-                    } else if ((row < creal(MIN)) || (col < cimag(MIN)) ) { \
-                        numClipped++; \
-                        value = -1.0-1.0*I; \
-                    } \
-                    if (cabs(imgRow[col]-value) > FLT_EPSILON) { \
-                        diag("Pixel value is not as expected (%g%+gi vs %g%+gi) at %d,%d", \
-                             creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \
-                        errorFlag = true; \
-                    } \
-                } \
-            } \
-            ok(!errorFlag, "psImageClip() produced the correct data values"); \
-            ok(retVal == numClipped, "Got the expected number of clips"); \
-            psFree(img); \
-            ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); \
-        }
-
-        complex double min = ((double)r)/5.0+I*((double)c)/4.0;
-        complex double max = ((double)r)/3.0+I*((double)c)/2.0;
-
-        // Testing clipping at %g%+gi to %g%+gi for psC32, creal(min),cimag(min),creal(max),cimag(max));
-
-        testImageClipComplexByType(C32,min,max);
-
-        // Testing clipping at %g%+gi to %g%+gi for psC64, creal(min),cimag(min),creal(max),cimag(max));
-        testImageClipComplexByType(C64,min,max);
-
-        //  6. Call psImageClipComplexRegion with NULL input parameter; should error
-        //     but not stop execution.
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(NULL,0,0,0,0);
-        ok(retVal == 0, "Expected zero return for clips of a NULL image");
-
-        img = psImageAlloc(c,r,PS_TYPE_C32);
-        for (unsigned row=0;row<r;row++)
-        {
-            psC32* imgRow = img->data.C32[row];
-            for (unsigned col=0;col<c;col++) {
-                imgRow[col] = row+I*col;
-            }
-        }
-
-        //  7. Call psImageClipComplexRegion with min > max; should error and return 0,
-        //     but not stop execution
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,10.0+I*1.0,-1.0,5.0+5.0*I,-2.0);
-        ok(retVal == 0, "Expected zero return for creal(min)>creal(max)");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,1.0+I*10.0,-1.0,5.0+5.0*I,-2.0);
-        ok(retVal == 0, "Expected zero return for cimag(min)>cimag(max)");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,10.0+I*10.0,-1.0,5.0+5.0*I,-2.0);
-        ok(retVal == 0, "Expected zero return for min>max");
-
-        //  8. Call psImageClipComplexRegion with the follow vmin/vmax values; each
-        //     should error and return 0, but not stop execution
-        //      a) vmin < datatype region's minimum
-        //      b) vmax < datatype region's minimum
-        //      c) vmin > datatype region's maximum
-        //      d) vmax > datatype region's maximum
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          -2.0*(double)FLT_MAX,
-                                          5.0+5.0*I,
-                                          0.0);
-        ok(retVal == 0, "Expected zero return for vmin not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          2.0*(double)FLT_MAX,
-                                          5.0+5.0*I,
-                                          0.0);
-        ok(retVal == 0, "Expected zero return for vmin not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          FLT_EPSILON-2.0*(double)FLT_MAX*I,
-                                          5.0+5.0*I,
-                                          0.0);
-        ok(retVal == 0, "Expected zero return for vmin not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          FLT_EPSILON+2.0*(double)FLT_MAX*I,
-                                          5.0+5.0*I,
-                                          0.0);
-        ok(retVal == 0, "Expected zero return for vmin not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          0.0,
-                                          5.0+5.0*I,
-                                          -2.0*(double)FLT_MAX);
-        ok(retVal == 0, "Expected zero return for vmax not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          0.0,
-                                          5.0+5.0*I,
-                                          2.0*(double)FLT_MAX);
-        ok(retVal == 0, "Expected zero return for vmax not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          0.0,
-                                          5.0+5.0*I,
-                                          FLT_EPSILON-2.0*(double)FLT_MAX*I);
-        ok(retVal == 0, "Expected zero return for vmax not in datatype range");
-
-        // Following should be an error
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          0.0,
-                                          5.0+5.0*I,
-                                          FLT_EPSILON+2.0*(double)FLT_MAX*I);
-        ok(retVal == 0, "Expected zero return for vmax not in datatype range");
-
-        // now check if vmin > vmax is OK
-        for (unsigned row=0;row<r;row++)
-        {
-            psC32* imgRow = img->data.C32[row];
-            for (unsigned col=0;col<c;col++) {
-                imgRow[col] = row+I*col;
-            }
-        }
-        retVal = psImageClipComplexRegion(img,
-                                          1.0+I*1.0,
-                                          10.0,
-                                          5.0+5.0*I,
-                                          0.0);
-        ok(retVal != 0, "Didn't expect zero return for vmin > vmax");
-        psFree(img);
-        img = NULL;
-
-        //  9. Call psImageClipComplexRegion with the max value out of datatype's
-        //     range; should clip as expected (see step 1-5). Repeat with min value
-        //     out of datatype's range.
-
-        testImageClipComplexByType(C32,-(double)FLT_MAX*2.0-I*(double)FLT_MAX*2.0,10.0+I*10.0);
-        testImageClipComplexByType(C32,10.0+I*10.0,(double)FLT_MAX*2.0+I*(double)FLT_MAX*2.0);
-
-        // Verify program execution doesn't stop if the input image type is something
-        // other than C32, C64.
-        img = psImageAlloc(c,r,PS_TYPE_S32);
-        // Following should be an error (incorrect type)
-        // XXX: Verify error
-        retVal = psImageClipComplexRegion(img,2.0,10.0,5.0,0.0);
-        ok(retVal == 0, "Expected zero return for clip of incorrect image type");
-        psFree(img);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
 
     // testImageOverlay()
@@ -568,6 +287,4 @@
 
 
-        //      testOverlayType(C64);
-        //        testOverlayType(C32);
         //        testOverlayType(F64);
         //        testOverlayType(F32);
