Changeset 13042
- Timestamp:
- Apr 26, 2007, 12:18:03 PM (19 years ago)
- Location:
- trunk/psLib/test/imageops
- Files:
-
- 3 edited
-
Makefile.am (modified) (2 diffs)
-
tap_psImageGeomManip.c (modified) (27 diffs)
-
tap_psImagePixelExtract.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/Makefile.am
r12777 r13042 14 14 TEST_PROGS = \ 15 15 tap_psImageShift \ 16 tap_psImageShiftKernel \17 16 tap_psImageGeomManip \ 18 tap_psImageInterpolate \19 17 tap_psImagePixelManip \ 20 18 tap_psImageSmooth \ … … 24 22 tap_psImagePixelExtract \ 25 23 tap_psImageInterpolate2 24 25 # tap_psImageShiftKernel 26 # tap_psImageInterpolate 26 27 27 28 if BUILD_TESTS -
trunk/psLib/test/imageops/tap_psImageGeomManip.c
r12440 r13042 3 3 * @brief Contains the tests for psImageManip.[ch] 4 4 * 5 *6 5 * @author Robert DeSonia, MHPCC 7 6 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 3-14 21:20:28$7 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-26 22:18:03 $ 10 9 * 11 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 16 15 #include "tap.h" 17 16 #include "pstap.h" 18 #define VERBOSE 117 #define VERBOSE 0 19 18 20 19 bool testImageShiftCase(psS32 cols, … … 45 44 sBiOut = psImageShift(sBiOut, sImg, colShift, rowShift, -1, PS_INTERPOLATE_BILINEAR); 46 45 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); 99 134 } 100 135 … … 102 137 diag("Short or Float image not shifted correctly"); 103 138 } 104 105 139 psFree(fImg); 106 140 psFree(sImg); … … 118 152 psLogSetFormat("HLNM"); 119 153 psLogSetLevel(PS_LOG_INFO); 120 plan_tests(2 24);154 plan_tests(237); 121 155 122 156 // testImageRebin() 123 157 // This function shall generate a rescaled version of a psImage structure 124 158 // derived from a specified statistics method. 125 {159 if (1) { 126 160 psMemId id = psMemGetId(); 127 161 psImage *in = NULL; … … 187 221 } \ 188 222 stats.options = PS_STAT_SAMPLE_MEAN; \ 189 if (1){ \223 { \ 190 224 out = psImageRebin(NULL,in,NULL,0,4,&stats); \ 191 225 ok(out != NULL, "psImageRebin returned non-NULL"); \ … … 207 241 ok(!errorFlag, "psImageRebin() produced the correct data"); \ 208 242 } \ 209 if (1){ \243 { \ 210 244 stats.options = PS_STAT_SAMPLE_MEAN; \ 211 245 out3 = psImageRebin(NULL,in,mask,1,4,&stats); \ … … 226 260 } \ 227 261 stats.options = PS_STAT_MAX; \ 228 if (1){ \262 { \ 229 263 out2 = psImageRebin(out,in,NULL,0,3,&stats); \ 230 264 ok(out == out2, "psImageRebin didt recycle a psImage properly"); \ … … 329 363 } 330 364 331 332 365 // testImageRoll() 333 {366 if (1) { 334 367 psMemId id = psMemGetId(); 335 368 psImage *in; … … 535 568 536 569 570 printf("HERE\n"); 537 571 // testImageRotate() 538 {572 if (1) { 539 573 psMemId id = psMemGetId(); 540 574 // This function shall calculate a new psImage structure based upon the … … 594 628 "psFitsOpen() created the output files"); 595 629 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"); 600 638 ok(fTruthFile != NULL && sTruthFile != NULL && fBiTruthFile != NULL && sBiTruthFile != NULL, 639 601 640 "psFitsOpen() opened the truth files"); 602 641 … … 620 659 // Verify the returned psImage structure is equal to the input 621 660 // 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)"); 623 662 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)"); 625 664 ok(oldBiOut == fBiOut, "psImageRotate(): the output recycle functionality was successful"); 626 665 sOut = psImageRotate(sOut,sImg,radianRot,-1.0,PS_INTERPOLATE_FLAT); 666 ok(sOut != NULL, "psImageRotate() returned non-NULL (psImageRotate(), short image, with FLAT interpolation)"); 627 667 sBiOut = psImageRotate(sBiOut,sImg,radianRot,-1.0,PS_INTERPOLATE_BILINEAR); 668 ok(sBiOut != NULL, "psImageRotate() returned non-NULL (psImageRotate(), short image, with BILINEAR interpolation)"); 628 669 ok(psFitsWriteImage(fOutFile, NULL, fOut, 1, NULL), "psFitsWriteImage() successful"); 629 670 ok(psFitsWriteImage(sOutFile, NULL, sOut, 1, NULL), "psFitsWriteImage() successful"); … … 664 705 for (psS32 col=0;col<fTruth->numCols;col++) { 665 706 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", 667 708 outRow[col], truthRow[col],col,row); 668 709 errorFlag = true; … … 672 713 } 673 714 } 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); 675 716 676 717 … … 690 731 for (psS32 col=0;col<sTruth->numCols;col++) { 691 732 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", 693 734 outRow[col], truthRow[col],col,row); 694 735 errorFlag = true; … … 698 739 } 699 740 } 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); 703 742 errorFlag = false; 704 743 if (fBiTruth == NULL) { … … 718 757 for (psS32 col=0;col<fBiTruth->numCols;col++) { 719 758 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", 721 760 outRow[col], truthRow[col],col,row); 722 761 errorFlag = true; … … 726 765 } 727 766 } 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); 731 768 if (sBiTruth == NULL) { 732 769 diag("verified psS16 image failed to be read " … … 746 783 for (psS32 col=0;col<sBiTruth->numCols;col++) { 747 784 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) " 749 786 "at %d,%d. BILINEAR", 750 787 outRow[col], truthRow[col],col,row); … … 755 792 } 756 793 } 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); 758 795 759 796 index++; 760 797 } 761 798 //HERE 762 799 // Verify the returned psImage structure pointer is null and program 763 800 // execution doesn't stop, if the input parameter input is null. … … 798 835 799 836 // testImageShift() 800 {837 if (1) { 801 838 psMemId id = psMemGetId(); 802 839 // This functions shall generate a new psImage structure by shifting the … … 816 853 817 854 // integer shift 818 // XXXX: These fail819 // ok(false, "XXXX: Skipping psImageShift() tests because of known failures");820 855 if (1) 821 856 { … … 868 903 869 904 // testImageResample() 870 {905 if (1) { 871 906 psMemId id = psMemGetId(); 872 907 … … 898 933 899 934 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 914 962 ok(!errorFlag, "psImageResample() produced the correct data values"); 915 963 … … 956 1004 957 1005 // testImageTransform() 958 {1006 if (1) { 959 1007 psMemId id = psMemGetId(); 960 1008 int cols = 16; … … 973 1021 } 974 1022 } 975 in->col0 = 1;1023 P_PSIMAGE_SET_COL0(in, 1); 976 1024 psImage *out = psImageTransform(NULL, 977 1025 NULL, … … 989 1037 ok(out->numRows == rows*2 && out->numCols == cols*2, "psImageTransform() produced the correct size"); 990 1038 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 } 1008 1067 1009 1068 psFree(out); -
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.
