IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 14, 2004, 2:08:44 PM (22 years ago)
Author:
desonia
Message:

fixed tests to coorespond to changes in psImageClip and/or the FullUnitTest/runTest
scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageManip.c

    r1217 r1221  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-14 23:23:42 $
     8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-07-15 00:08:43 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5252    unsigned int c = 128;
    5353    unsigned int r = 256;
    54     psF32 min;
    55     psF32 max;
     54    psF64 min;
     55    psF64 max;
    5656    int numClipped = 0;
    5757    int retVal;
     
    9191        } \
    9292    } \
    93     min = (float)r/2.0f; \
    94     max = (float)r; \
     93    min = (psF64)r/2.0; \
     94    max = (psF64)r; \
    9595    \
    96     retVal = psImageClip(img,min,-1.0f,max,-2.0f); \
     96    retVal = psImageClip(img,min,(double)PS_MIN_##datatype,max,(double)PS_MAX_##datatype); \
    9797    \
    9898    numClipped = 0; \
     
    101101        for (unsigned int col=0;col<c;col++) { \
    102102            ps##datatype value = (ps##datatype)(row+col); \
    103             if (value < (ps##datatype)min) { \
     103            if (value < min) { \
    104104                numClipped++; \
    105                 value = -1; \
    106             } else if (value > (ps##datatype)max) { \
     105                value = PS_MIN_##datatype; \
     106            } else if (value > max) { \
    107107                numClipped++; \
    108                 value = -2; \
     108                value = PS_MAX_##datatype; \
    109109            } \
    110110            if (fabsf(imgRow[col]-value) > FLT_EPSILON) { \
    111                 psError(__func__,"Pixel value is not as expected (%d vs %d) at %u,%u", \
    112                         imgRow[col],value,col,row); \
     111                psError(__func__,"Pixel value is not as expected (%g vs %g) at %u,%u", \
     112                        (psF64)imgRow[col],(psF64)value,col,row); \
    113113                return 1; \
    114114            } \
Note: See TracChangeset for help on using the changeset viewer.