IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2004, 3:22:59 PM (22 years ago)
Author:
desonia
Message:

added test for psImageResample.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageManip.c

    r1941 r2105  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-10-02 02:08:00 $
     12 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-10-14 01:22:59 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    569569        return NULL;
    570570    }
     571
     572    if (scale < 1) {
     573        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample",
     574                   PS_ERR_BAD_PARAMETER_VALUE, true,
     575                   PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE,
     576                   scale);
     577        psFree(out);
     578        return NULL;
     579    }
     580
     581    if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) {
     582        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample",
     583                   PS_ERR_BAD_PARAMETER_VALUE, true,
     584                   PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED,
     585                   mode);
     586        psFree(out);
     587        return NULL;
     588    }
     589
    571590    // create an output image of the same size
    572591    // and type
     
    582601            float inRow = (float)row * invScale; \
    583602            for (int col=0;col<outCols;col++) { \
    584                 rowData[col] = psImagePixelInterpolate(in,inRow,(float)col*invScale,NULL,0,0,mode); \
     603                rowData[col] = psImagePixelInterpolate(in,(float)col*invScale,inRow,NULL,0,0,mode); \
    585604            } \
    586605        }  \
Note: See TracChangeset for help on using the changeset viewer.