Changeset 13042 for trunk/psLib/test/imageops/tap_psImagePixelExtract.c
- Timestamp:
- Apr 26, 2007, 12:18:03 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tap_psImagePixelExtract.c
r12257 r13042 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 3-06 03:14:01$8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-04-26 22:18:03 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 66 66 } \ 67 67 } \ 68 image->col0 = 1; \69 image->row0 = 1; \68 P_PSIMAGE_SET_COL0(image, 1); \ 69 P_PSIMAGE_SET_ROW0(image, 1); \ 70 70 out = psImageSlice(out,positions,image,mask,1, \ 71 71 psRegionSet(1+c/10,1+c/10+M,1+r/10,1+r/10+N),DIRECTION,stat); \ … … 284 284 } 285 285 } 286 image->col0 = 1;287 image->row0 = 1;286 P_PSIMAGE_SET_COL0(image, 1); 287 P_PSIMAGE_SET_ROW0(image, 1); 288 288 psFree(out); 289 289 out = NULL; … … 295 295 296 296 //Return NULL for incorrect image inputs. 297 image->row0 = -1;297 P_PSIMAGE_SET_ROW0(image, -1); 298 298 // Following should generate error message 299 299 // XXX: Verify error … … 302 302 ok(out == NULL, "psImageSlice returned NULL for unallowed specified input"); 303 303 304 image->col0 = -1;305 image->row0 = 1;304 P_PSIMAGE_SET_COL0(image, -1); 305 P_PSIMAGE_SET_ROW0(image, 1); 306 306 // Following should generate error message 307 307 // XXX: Verify error … … 310 310 ok(out == NULL, "psImageSlice returned NULL for unallowed specified input"); 311 311 312 image->col0 = 1;312 P_PSIMAGE_SET_COL0(image, -1); 313 313 // Return NULL for incorrect region inputs. 314 314 // Following should generate error message … … 426 426 ok(orig != NULL, "orig image is non-NULL"); 427 427 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; 428 435 429 436 float deltaRow = (endRow[n]-startRow[n])/(length-1); … … 434 441 float y = (float)startRow[n]+(float)i*deltaRow; 435 442 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; 438 447 } 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; 441 452 } 442 453 if (fabs(result->data.F32[i]-truth) > FLT_EPSILON) { … … 452 463 } 453 464 } 465 psFree(tmpIntOptsNoMask); 466 psFree(tmpIntOptsMask); 454 467 } else { 455 468 if (result != NULL) { … … 720 733 721 734 //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); 724 737 // Following should generate error message(for row) 725 738 // XXX: Verify error … … 733 746 734 747 //Test for unallowed numRows 735 *(psS32*)&(image->col0) = 10;748 P_PSIMAGE_SET_COL0(image, 10); 736 749 *(int*)&(image->numRows) = -1; 737 750 // Following should generate error message(for row) … … 797 810 798 811 //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); 801 814 *(int*)&(image->numRows) = 3; 802 815 *(int*)&(image->numCols) = 3;
Note:
See TracChangeset
for help on using the changeset viewer.
