IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.