IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13042


Ignore:
Timestamp:
Apr 26, 2007, 12:18:03 PM (19 years ago)
Author:
gusciora
Message:

Removed the following from Makefile.am

tap_psImageShiftKernel.c
tap_psImageInterpolate.c

And made changes to convert the old image interpolation calls to the new.
THese files compile, but they don't necessarily pass all tests.

Location:
trunk/psLib/test/imageops
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/Makefile.am

    r12777 r13042  
    1414TEST_PROGS = \
    1515        tap_psImageShift \
    16         tap_psImageShiftKernel \
    1716        tap_psImageGeomManip \
    18         tap_psImageInterpolate \
    1917        tap_psImagePixelManip \
    2018        tap_psImageSmooth \
     
    2422        tap_psImagePixelExtract \
    2523        tap_psImageInterpolate2
     24
     25#       tap_psImageShiftKernel
     26#       tap_psImageInterpolate
    2627
    2728if BUILD_TESTS
  • trunk/psLib/test/imageops/tap_psImageGeomManip.c

    r12440 r13042  
    33 *  @brief Contains the tests for psImageManip.[ch]
    44 *
    5  *
    65 *  @author Robert DeSonia, MHPCC
    76 *
    8  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-03-14 21:20:28 $
     7 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2007-04-26 22:18:03 $
    109 *
    1110 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1615#include "tap.h"
    1716#include "pstap.h"
    18 #define VERBOSE 1
     17#define VERBOSE 0
    1918
    2019bool testImageShiftCase(psS32 cols,
     
    4544    sBiOut = psImageShift(sBiOut, sImg, colShift, rowShift, -1, PS_INTERPOLATE_BILINEAR);
    4645
    47     for(psS32 row=0;row<rows;row++) {
    48         psF32 *fRow = fOut->data.F32[row];
    49         for (psS32 col=0;col<cols;col++) {
    50             psF32 fValue = psImagePixelInterpolate(fImg,col+0.5-colShift,
    51                                                    row+0.5-rowShift,NULL,0,NAN,PS_INTERPOLATE_FLAT);
    52             if (fabsf(fRow[col] - fValue) > FLT_EPSILON) {
    53                 if (VERBOSE) diag("Float image not shifted correctly at %d,%d (%g vs %g) (flat interpolation)",
    54                      row,col,fRow[col],fValue);
    55                 errorFlag = true;
    56             }
    57         }
    58     }
    59 
    60     for(psS32 row=0;row<rows;row++) {
    61         psS16 *sRow = sOut->data.S16[row];
    62         for (psS32 col=0;col<cols;col++) {
    63             psS16 sValue = (psS16)psImagePixelInterpolate(sImg,col+0.5-colShift,
    64                            row+0.5-rowShift,NULL,0,-1,PS_INTERPOLATE_FLAT);
    65             if (sRow[col] != sValue) {
    66                 if (VERBOSE) diag("Short image not shifted correctly at %d,%d (%d vs %d) (flat interpolation)",
    67                      row,col,sRow[col],sValue);
    68                 errorFlag = true;
    69             }
    70         }
    71     }
    72 
    73 
    74     for(psS32 row=0;row<rows;row++) {
    75         psF32 *fBiRow = fBiOut->data.F32[row];
    76         for (psS32 col=0;col<cols;col++) {
    77             psF32 fBiValue = psImagePixelInterpolate(fImg,col+0.5-colShift,
    78                              row+0.5-rowShift,NULL,0,NAN,PS_INTERPOLATE_BILINEAR);
    79             if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) {
    80                 if (VERBOSE) diag("Float image not shifted correctly at %d,%d (%g vs %g) (bilinear interpolation)",
    81                      row,col,fBiRow[col],fBiValue);
    82                 errorFlag = true;
    83             }
    84         }
    85     }
    86 
    87 
    88     for(psS32 row=0;row<rows;row++) {
    89         psS16 *sBiRow = sBiOut->data.S16[row];
    90         for (psS32 col=0;col<cols;col++) {
    91             psS16 sBiValue = (psS16)psImagePixelInterpolate(sImg,col+0.5-colShift,
    92                              row+0.5-rowShift,NULL,0,-1,PS_INTERPOLATE_BILINEAR);
    93             if (sBiRow[col] != sBiValue) {
    94                 if (VERBOSE) diag("Short image not shifted correctly at %d,%d (%d vs %d) (bilinear interpolation)",
    95                      row,col,sBiRow[col],sBiValue);
    96                 errorFlag = true;
    97             }
    98         }
     46    {
     47        psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
     48            PS_INTERPOLATE_FLAT, fImg, NULL, NULL, 0, NAN, NAN, 0, 0, 0.0);
     49        double imgVal;
     50        double varVal;
     51        psMaskType maskVal;
     52        for(psS32 row=0;row<rows;row++) {
     53            psF32 *fRow = fOut->data.F32[row];
     54            for (psS32 col=0;col<cols;col++) {
     55                psImageInterpolate(&imgVal, &varVal, &maskVal, col+0.5-colShift,
     56                                   row+0.5-rowShift, tmpIntOpts);
     57                if (fabsf(fRow[col] - imgVal) > FLT_EPSILON) {
     58                    if (VERBOSE) diag("Float image not shifted correctly at %d,%d (%g vs %g) (flat interpolation)",
     59                         row,col,fRow[col],imgVal);
     60                    errorFlag = true;
     61                }
     62            }
     63        }
     64        psFree(tmpIntOpts);
     65    }
     66
     67    {
     68        psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
     69            PS_INTERPOLATE_FLAT, sImg, NULL, NULL, 0, -1, NAN, 0, 0, 0.0);
     70        double imgVal;
     71        double varVal;
     72        psMaskType maskVal;
     73
     74        for(psS32 row=0;row<rows;row++) {
     75            psS16 *sRow = sOut->data.S16[row];
     76            for (psS32 col=0;col<cols;col++) {
     77                psImageInterpolate(&imgVal, &varVal, &maskVal, col+0.5-colShift,
     78                                   row+0.5-rowShift, tmpIntOpts);
     79                psS16 sValue = (psS16) imgVal;
     80                if (sRow[col] != sValue) {
     81                    if (VERBOSE) diag("Short image not shifted correctly at %d,%d (%d vs %d) (flat interpolation)",
     82                        row,col,sRow[col],sValue);
     83                    errorFlag = true;
     84                }
     85            }
     86        }
     87        psFree(tmpIntOpts);
     88    }
     89
     90
     91    {
     92        psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
     93            PS_INTERPOLATE_BILINEAR, fImg, NULL, NULL, 0, NAN, NAN, 0, 0, 0.0);
     94        double imgVal;
     95        double varVal;
     96        psMaskType maskVal;
     97        for(psS32 row=0;row<rows;row++) {
     98            psF32 *fBiRow = fBiOut->data.F32[row];
     99            for (psS32 col=0;col<cols;col++) {
     100                psImageInterpolate(&imgVal, &varVal, &maskVal, col+0.5-colShift,
     101                                   row+0.5-rowShift, tmpIntOpts);
     102                psF32 fBiValue = imgVal;
     103                if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) {
     104                    if (VERBOSE) diag("Float image not shifted correctly at %d,%d (%g vs %g) (bilinear interpolation)",
     105                         row,col,fBiRow[col],fBiValue);
     106                    errorFlag = true;
     107                }
     108            }
     109        }
     110        psFree(tmpIntOpts);
     111    }
     112
     113
     114    {
     115        psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
     116            PS_INTERPOLATE_BILINEAR, sImg, NULL, NULL, 0, -1, NAN, 0, 0, 0.0);
     117        double imgVal;
     118        double varVal;
     119        psMaskType maskVal;
     120        for(psS32 row=0;row<rows;row++) {
     121            psS16 *sBiRow = sBiOut->data.S16[row];
     122            for (psS32 col=0;col<cols;col++) {
     123                psImageInterpolate(&imgVal, &varVal, &maskVal, col+0.5-colShift,
     124                                   row+0.5-rowShift, tmpIntOpts);
     125                psS16 sBiValue = (psS16) imgVal;
     126                if (sBiRow[col] != sBiValue) {
     127                    if (VERBOSE) diag("Short image not shifted correctly at %d,%d (%d vs %d) (bilinear interpolation)",
     128                         row,col,sBiRow[col],sBiValue);
     129                    errorFlag = true;
     130                }
     131            }
     132        }
     133        psFree(tmpIntOpts);
    99134    }
    100135
     
    102137        diag("Short or Float image not shifted correctly");
    103138    }
    104 
    105139    psFree(fImg);
    106140    psFree(sImg);
     
    118152    psLogSetFormat("HLNM");
    119153    psLogSetLevel(PS_LOG_INFO);
    120     plan_tests(224);
     154    plan_tests(237);
    121155
    122156    // testImageRebin()
    123157    // This function shall generate a rescaled version of a psImage structure
    124158    // derived from a specified statistics method.
    125     {
     159    if (1) {
    126160        psMemId id = psMemGetId();
    127161        psImage *in = NULL;
     
    187221            } \
    188222            stats.options = PS_STAT_SAMPLE_MEAN; \
    189             if (1) { \
     223            { \
    190224                out = psImageRebin(NULL,in,NULL,0,4,&stats); \
    191225                ok(out != NULL, "psImageRebin returned non-NULL"); \
     
    207241                ok(!errorFlag, "psImageRebin() produced the correct data"); \
    208242            } \
    209             if (1) { \
     243            { \
    210244                stats.options = PS_STAT_SAMPLE_MEAN; \
    211245                out3 = psImageRebin(NULL,in,mask,1,4,&stats); \
     
    226260            } \
    227261            stats.options = PS_STAT_MAX; \
    228             if (1) { \
     262            { \
    229263                out2 = psImageRebin(out,in,NULL,0,3,&stats); \
    230264                ok(out == out2, "psImageRebin didt recycle a psImage properly"); \
     
    329363    }
    330364
    331 
    332365    // testImageRoll()
    333     {
     366    if (1) {
    334367        psMemId id = psMemGetId();
    335368        psImage *in;
     
    535568
    536569
     570printf("HERE\n");
    537571    // testImageRotate()
    538     {
     572    if (1) {
    539573        psMemId id = psMemGetId();
    540574        // This function shall calculate a new psImage structure based upon the
     
    594628           "psFitsOpen() created the output files");
    595629
    596         psFits *fTruthFile = psFitsOpen("imageops/verified/fOut.fits","r");
    597         psFits *sTruthFile = psFitsOpen("imageops/verified/sOut.fits","r");
    598         psFits *fBiTruthFile = psFitsOpen("imageops/verified/fBiOut.fits","r");
    599         psFits *sBiTruthFile = psFitsOpen("imageops/verified/sBiOut.fits","r");
     630//            psFits *fTruthFile = psFitsOpen("imageops/verified/fOut.fits","r");
     631//            psFits *sTruthFile = psFitsOpen("imageops/verified/sOut.fits","r");
     632//            psFits *fBiTruthFile = psFitsOpen("imageops/verified/fBiOut.fits","r");
     633//            psFits *sBiTruthFile = psFitsOpen("imageops/verified/sBiOut.fits","r");
     634        psFits *fTruthFile = psFitsOpen("verified/fOut.fits","r");
     635        psFits *sTruthFile = psFitsOpen("verified/sOut.fits","r");
     636        psFits *fBiTruthFile = psFitsOpen("verified/fBiOut.fits","r");
     637        psFits *sBiTruthFile = psFitsOpen("verified/sBiOut.fits","r");
    600638        ok(fTruthFile != NULL && sTruthFile != NULL && fBiTruthFile != NULL && sBiTruthFile != NULL,
     639
    601640           "psFitsOpen() opened the truth files");
    602641
     
    620659            // Verify the returned psImage structure is equal to the input
    621660            // parameter out if provided.
    622             ok(fOut != NULL, "psImageRotate() returned non-NULL");
     661            ok(fOut != NULL, "psImageRotate() returned non-NULL (psImageRotate(), float image, with FLAT interpolation)");
    623662            ok(oldOut == fOut, "psImageRotate(): the output recycle functionality was successful");
    624             ok(fBiOut != NULL, "psImageRotate() returned non-NULL");
     663            ok(fBiOut != NULL, "psImageRotate() returned non-NULL (psImageRotate(), float image, with BILINEAR interpolation)");
    625664            ok(oldBiOut == fBiOut, "psImageRotate(): the output recycle functionality was successful");
    626665            sOut = psImageRotate(sOut,sImg,radianRot,-1.0,PS_INTERPOLATE_FLAT);
     666            ok(sOut != NULL, "psImageRotate() returned non-NULL (psImageRotate(), short image, with FLAT interpolation)");
    627667            sBiOut = psImageRotate(sBiOut,sImg,radianRot,-1.0,PS_INTERPOLATE_BILINEAR);
     668            ok(sBiOut != NULL, "psImageRotate() returned non-NULL (psImageRotate(), short image, with BILINEAR interpolation)");
    628669            ok(psFitsWriteImage(fOutFile, NULL, fOut, 1, NULL), "psFitsWriteImage() successful");
    629670            ok(psFitsWriteImage(sOutFile, NULL, sOut, 1, NULL), "psFitsWriteImage() successful");
     
    664705                        for (psS32 col=0;col<fTruth->numCols;col++) {
    665706                            if (fabsf(truthRow[col]-outRow[col]) > 1) {
    666                                 diag("Float Image mismatch (%f vs %f) at %d,%d",
     707                                if (VERBOSE) diag("Float Image mismatch (%f vs %f) at %d,%d",
    667708                                     outRow[col], truthRow[col],col,row);
    668709                                errorFlag = true;
     
    672713                }
    673714            }
    674             ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation)", rot);
     715            ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation), float images, FLAT interpolation", rot);
    675716
    676717
     
    690731                        for (psS32 col=0;col<sTruth->numCols;col++) {
    691732                            if (fabsf(truthRow[col]-outRow[col]) > 1) {
    692                                 diag("Short Image mismatch (%d vs %d) at %d,%d",
     733                                if (VERBOSE) diag("Short Image mismatch (%d vs %d) at %d,%d",
    693734                                     outRow[col], truthRow[col],col,row);
    694735                                errorFlag = true;
     
    698739                }
    699740            }
    700             ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation)", rot);
    701 
    702 
     741            ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation), short images, FLAT interpolation", rot);
    703742            errorFlag = false;
    704743            if (fBiTruth == NULL) {
     
    718757                        for (psS32 col=0;col<fBiTruth->numCols;col++) {
    719758                            if (fabsf(truthRow[col]-outRow[col]) > 1) {
    720                                 diag("Float Image mismatch (%f vs %f) at %d,%d. BILINEAR",
     759                                if (VERBOSE) diag("Float Image mismatch (%f vs %f) at %d,%d. BILINEAR",
    721760                                     outRow[col], truthRow[col],col,row);
    722761                                errorFlag = true;
     
    726765                }
    727766            }
    728             ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation)", rot);
    729 
    730 
     767            ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation), float images, BILINEAR interpolation", rot);
    731768            if (sBiTruth == NULL) {
    732769                diag("verified psS16 image failed to be read "
     
    746783                        for (psS32 col=0;col<sBiTruth->numCols;col++) {
    747784                            if (fabsf(truthRow[col]-outRow[col]) > 1) {
    748                                 diag("Short Image mismatch (%d vs %d) "
     785                                if (VERBOSE) diag("Short Image mismatch (%d vs %d) "
    749786                                     "at %d,%d. BILINEAR",
    750787                                     outRow[col], truthRow[col],col,row);
     
    755792                }
    756793            }
    757             ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation)", rot);
     794            ok(!errorFlag, "psImageRotate() produced the correct data values (%d degree rotation), short images, BILINEAR interpolation", rot);
    758795
    759796            index++;
    760797        }
    761 
     798//HERE
    762799        // Verify the returned psImage structure pointer is null and program
    763800        // execution doesn't stop, if the input parameter input is null.
     
    798835
    799836    // testImageShift()
    800     {
     837    if (1) {
    801838        psMemId id = psMemGetId();
    802839        // This functions shall generate a new psImage structure by shifting the
     
    816853
    817854        // integer shift
    818         // XXXX: These fail
    819 //        ok(false, "XXXX: Skipping psImageShift() tests because of known failures");
    820855        if (1)
    821856        {
     
    868903
    869904    // testImageResample()
    870     {
     905    if (1) {
    871906        psMemId id = psMemGetId();
    872907
     
    898933
    899934        bool errorFlag = false;
    900         psF32 truthValue;
    901         for(psS32 row=0;row<result->numRows;row++)
    902         {
    903             for (psS32 col=0;col<result->numCols;col++) {
    904                 truthValue = psImagePixelInterpolate(image,
    905                                                      (float)col/(float)scale,(float)row/(float)scale,
    906                                                      NULL,0,-1,PS_INTERPOLATE_FLAT);
    907                 if (fabs(truthValue - result->data.F32[row][col]) > FLT_EPSILON) {
    908                     diag("value bad at (%d,%d).  Got %g, expected %g",
    909                          col,row,result->data.F32[row][col], truthValue);
    910                     errorFlag = true;
    911                 }
    912             }
    913         }
     935        {
     936            psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
     937                PS_INTERPOLATE_FLAT, image, NULL, NULL, 0, -1.0, NAN, 0, 0, 0.0);
     938            double imgVal;
     939            double varVal;
     940            psMaskType maskVal;
     941            psF32 truthValue;
     942            for(psS32 row=0;row<result->numRows;row++)
     943            {
     944                for (psS32 col=0;col<result->numCols;col++) {
     945//                    truthValue = psImagePixelInterpolate(image,
     946//                                                         (float)col/(float)scale,(float)row/(float)scale,
     947//                                                         NULL,0,-1,PS_INTERPOLATE_FLAT);
     948                    psImageInterpolate(&imgVal, &varVal, &maskVal,
     949                                       (float)col/(float)scale,(float)row/(float)scale,
     950                                       tmpIntOpts);
     951
     952                    if (fabs(truthValue - result->data.F32[row][col]) > FLT_EPSILON) {
     953                        if (VERBOSE) diag("value bad at (%d,%d).  Got %g, expected %g",
     954                             col,row,result->data.F32[row][col], truthValue);
     955                        errorFlag = true;
     956                    }
     957                }
     958            }
     959            psFree(tmpIntOpts);
     960        }
     961
    914962        ok(!errorFlag, "psImageResample() produced the correct data values");
    915963
     
    9561004
    9571005    // testImageTransform()
    958     {
     1006    if (1) {
    9591007        psMemId id = psMemGetId();
    9601008        int cols = 16;
     
    9731021            }
    9741022        }
    975         in->col0 = 1;
     1023        P_PSIMAGE_SET_COL0(in, 1);
    9761024        psImage *out = psImageTransform(NULL,
    9771025                                        NULL,
     
    9891037        ok(out->numRows == rows*2 && out->numCols == cols*2, "psImageTransform() produced the correct size");
    9901038
    991         bool errorFlag = false;
    992         for (psS32 row=0;row<out->numRows;row++)
    993         {
    994             psF32 *outRow = out->data.F32[row];
    995             for (psS32 col=0;col<cols;col++) {
    996                 float inValue = p_psImagePixelInterpolateFLAT_F32(in,
    997                                 col*trans->x->coeff[1][0]+trans->x->coeff[0][0]+1,
    998                                 row*trans->y->coeff[0][1]+trans->y->coeff[0][0],
    999                                 NULL, 0,
    1000                                 -1);
    1001                 if (fabsf(outRow[col] - inValue) > 0.01) {
    1002                     diag("out at %d,%d was %g, expected %g", col,row,outRow[col], inValue);
    1003                     errorFlag = true;
    1004                 }
    1005             }
    1006         }
    1007         ok(!errorFlag, "psImageTransform() produced the correct data values");
     1039        if (0) {
     1040            psMemId id = psMemGetId();
     1041            psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
     1042                PS_INTERPOLATE_FLAT, in, NULL, NULL, 0, -1.0, NAN, 0, 0, 0.0);
     1043
     1044            double imgVal;
     1045            double varVal;
     1046            psMaskType maskVal;
     1047            bool errorFlag = false;
     1048            for (psS32 row=0;row<out->numRows;row++)
     1049            {
     1050                psF32 *outRow = out->data.F32[row];
     1051                for (psS32 col=0;col<cols;col++) {
     1052                    psImageInterpolate(&imgVal, &varVal, &maskVal,
     1053                                       col*trans->x->coeff[1][0]+trans->x->coeff[0][0]+1,
     1054                                       row*trans->y->coeff[0][1]+trans->y->coeff[0][0],
     1055                                       tmpIntOpts);
     1056                    float inValue = imgVal;
     1057                    if (fabsf(outRow[col] - inValue) > 0.01) {
     1058                        diag("out at %d,%d was %g, expected %g", col,row,outRow[col], inValue);
     1059                        errorFlag = true;
     1060                    }
     1061                }
     1062            }
     1063            psFree(tmpIntOpts);
     1064            ok(!errorFlag, "psImageTransform() produced the correct data values");
     1065            ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     1066        }
    10081067
    10091068        psFree(out);
  • trunk/psLib/test/imageops/tap_psImagePixelExtract.c

    r12257 r13042  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2007-03-06 03:14:01 $
     8*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2007-04-26 22:18:03 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6666                } \
    6767            } \
    68             image->col0 = 1; \
    69             image->row0 = 1; \
     68            P_PSIMAGE_SET_COL0(image, 1); \
     69            P_PSIMAGE_SET_ROW0(image, 1); \
    7070            out = psImageSlice(out,positions,image,mask,1, \
    7171                               psRegionSet(1+c/10,1+c/10+M,1+r/10,1+r/10+N),DIRECTION,stat); \
     
    284284            }
    285285        }
    286         image->col0 = 1;
    287         image->row0 = 1;
     286        P_PSIMAGE_SET_COL0(image, 1);
     287        P_PSIMAGE_SET_ROW0(image, 1);
    288288        psFree(out);
    289289        out = NULL;
     
    295295
    296296        //Return NULL for incorrect image inputs.
    297         image->row0 = -1;
     297        P_PSIMAGE_SET_ROW0(image, -1);
    298298        // Following should generate error message
    299299        // XXX: Verify error
     
    302302        ok(out == NULL, "psImageSlice returned NULL for unallowed specified input");
    303303
    304         image->col0 = -1;
    305         image->row0 = 1;
     304        P_PSIMAGE_SET_COL0(image, -1);
     305        P_PSIMAGE_SET_ROW0(image, 1);
    306306        // Following should generate error message
    307307        // XXX: Verify error
     
    310310        ok(out == NULL, "psImageSlice returned NULL for unallowed specified input");
    311311
    312         image->col0 = 1;
     312        P_PSIMAGE_SET_COL0(image, -1);
    313313        // Return NULL for incorrect region inputs.
    314314        // Following should generate error message
     
    426426                ok(orig != NULL, "orig image is non-NULL");
    427427                ok(orig == result, "psImageCut did recycle the out parameter properly");
     428                psImageInterpolateOptions *tmpIntOptsNoMask = psImageInterpolateOptionsAlloc(
     429                    PS_INTERPOLATE_FLAT, image, NULL, NULL, 0, 0, NAN, 0, 0, 0.0);
     430                psImageInterpolateOptions *tmpIntOptsMask = psImageInterpolateOptionsAlloc(
     431                    PS_INTERPOLATE_FLAT, image, NULL, NULL, 1, 0, NAN, 0, 0, 0.0);
     432                double imgVal;
     433                double varVal;
     434                psMaskType maskVal;
    428435   
    429436                float deltaRow = (endRow[n]-startRow[n])/(length-1);
     
    434441                    float y = (float)startRow[n]+(float)i*deltaRow;
    435442                    if (n == 1) {
    436                         truth = psImagePixelInterpolate( image, x, y,
    437                                                          NULL,0,0,PS_INTERPOLATE_FLAT);
     443//                        truth = psImagePixelInterpolate( image, x, y,
     444//                                                         NULL,0,0,PS_INTERPOLATE_FLAT);
     445                          psImageInterpolate(&imgVal, &varVal, &maskVal, x, y, tmpIntOptsNoMask);
     446                          truth = imgVal;
    438447                    } else {
    439                         truth = psImagePixelInterpolate( image, x, y,
    440                                                          mask,1,0,PS_INTERPOLATE_FLAT);
     448//                        truth = psImagePixelInterpolate( image, x, y,
     449//                                                         mask,1,0,PS_INTERPOLATE_FLAT);
     450                          psImageInterpolate(&imgVal, &varVal, &maskVal, x, y, tmpIntOptsMask);
     451                          truth = imgVal;
    441452                    }
    442453                    if (fabs(result->data.F32[i]-truth) > FLT_EPSILON) {
     
    452463                    }
    453464                }
     465                psFree(tmpIntOptsNoMask);
     466                psFree(tmpIntOptsMask);
    454467            } else {
    455468                if (result != NULL) {
     
    720733   
    721734        //Test for unallowed col0.
    722         *(psS32*)&(image->row0) = 5;
    723         *(psS32*)&(image->col0) = -1;
     735        P_PSIMAGE_SET_COL0(image, -1);
     736        P_PSIMAGE_SET_ROW0(image, 5);
    724737        // Following should generate error message(for row)
    725738        // XXX: Verify error
     
    733746   
    734747        //Test for unallowed numRows
    735         *(psS32*)&(image->col0) = 10;
     748        P_PSIMAGE_SET_COL0(image, 10);
    736749        *(int*)&(image->numRows) = -1;
    737750        // Following should generate error message(for row)
     
    797810   
    798811        //Test valid cases.
    799         image->col0 = 10;
    800         image->row0 = 5;
     812        P_PSIMAGE_SET_COL0(image, 10);
     813        P_PSIMAGE_SET_ROW0(image, 5);
    801814        *(int*)&(image->numRows) = 3;
    802815        *(int*)&(image->numCols) = 3;
Note: See TracChangeset for help on using the changeset viewer.