Changeset 2273 for trunk/psLib/test/image/tst_psImageManip.c
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageManip.c (modified) (83 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageManip.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-11-04 01:05:00 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 119 119 } \ 120 120 if (fabsf(imgRow[col]-value) > FLT_EPSILON) { \ 121 psError( __func__,"Pixel value is not as expected (%g vs %g) at %u,%u", \121 psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%g vs %g) at %u,%u", \ 122 122 (psF64)imgRow[col],(psF64)value,col,row); \ 123 123 return 1; \ … … 126 126 } \ 127 127 if (retVal != numClipped) { \ 128 psError( __func__,"Expected %d clips, but got %d", \128 psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \ 129 129 numClipped,retVal); \ 130 130 return 2; \ … … 159 159 if (fabsf(creal(imgRow[col])-creal(value)) > FLT_EPSILON || \ 160 160 fabsf(cimag(imgRow[col])-cimag(value)) > FLT_EPSILON) { \ 161 psError( __func__,"Pixel value is not as expected (%.2f+%.2fi vs %.2f+%.2fi) at %u,%u", \161 psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%.2f+%.2fi vs %.2f+%.2fi) at %u,%u", \ 162 162 creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \ 163 163 return 1; \ … … 166 166 } \ 167 167 if (retVal != numClipped) { \ 168 psError( __func__,"Expected %d clips, but got %d", \168 psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \ 169 169 numClipped,retVal); \ 170 170 return 2; \ … … 198 198 retVal = psImageClip(NULL,min,-1.0f,max,-2.0f); 199 199 if (retVal != 0) { 200 psError( __func__,"Expected zero return for clips of a NULL image.");200 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips of a NULL image."); 201 201 return 3; 202 202 } … … 207 207 retVal = psImageClip(img,max,-1.0f,min,-2.0f); 208 208 if (retVal != 0) { 209 psError( __func__,"Expected zero return for clips when max < min.");209 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips when max < min."); 210 210 return 4; 211 211 } … … 217 217 retVal = psImageClip(img,min,-1.0f,max,-2.0f); 218 218 if (retVal != 0) { 219 psError( __func__,"Expected zero return for clip of invalid image type.");219 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clip of invalid image type."); 220 220 return 5; 221 221 } … … 276 276 } \ 277 277 if (fabsf(imgRow[col]-value) > FLT_EPSILON) { \ 278 psError( __func__,"Pixel value is not as expected (%f vs %f) at %d,%d", \278 psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%f vs %f) at %d,%d", \ 279 279 imgRow[col],value,col,row); \ 280 280 return 1; \ … … 283 283 } \ 284 284 if (retVal != numClipped) { \ 285 psError( __func__,"Expected %d clips, but got %d", \285 psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \ 286 286 numClipped,retVal); \ 287 287 return 2; \ … … 299 299 retVal = psImageClipNaN(NULL,-1.0f); 300 300 if (retVal != 0) { 301 psError( __func__,"Expected zero return for clips of a NULL image.");301 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips of a NULL image."); 302 302 return 3; 303 303 } … … 309 309 retVal = psImageClipNaN(img,2.0f); 310 310 if (retVal != 0) { 311 psError( __func__,"Expected zero return for clip of invalid image type.");311 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clip of invalid image type."); 312 312 return 4; 313 313 } … … 377 377 } \ 378 378 if (cabs(imgRow[col]-value) > FLT_EPSILON) { \ 379 psError( __func__,"Pixel value is not as expected (%g%+gi vs %g%+gi) at %d,%d", \379 psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%g%+gi vs %g%+gi) at %d,%d", \ 380 380 creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \ 381 381 return 1; \ … … 384 384 } \ 385 385 if (retVal != numClipped) { \ 386 psError( __func__,"Expected %d clips, but got %d", \386 psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \ 387 387 numClipped,retVal); \ 388 388 return 2; \ … … 408 408 retVal = psImageClipComplexRegion(NULL,0,0,0,0); 409 409 if (retVal != 0) { 410 psError( __func__,"Expected zero return for clips of a NULL image.");410 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips of a NULL image."); 411 411 return 3; 412 412 } … … 427 427 retVal = psImageClipComplexRegion(img,10.0+I*1.0,-1.0,5.0+5.0*I,-2.0); 428 428 if (retVal != 0) { 429 psError( __func__,"Expected zero return for creal(min)>creal(max).");429 psError(PS_ERR_UNKNOWN, true,"Expected zero return for creal(min)>creal(max)."); 430 430 return 3; 431 431 } … … 433 433 retVal = psImageClipComplexRegion(img,1.0+I*10.0,-1.0,5.0+5.0*I,-2.0); 434 434 if (retVal != 0) { 435 psError( __func__,"Expected zero return for cimag(min)>cimag(max).");435 psError(PS_ERR_UNKNOWN, true,"Expected zero return for cimag(min)>cimag(max)."); 436 436 return 3; 437 437 } … … 439 439 retVal = psImageClipComplexRegion(img,10.0+I*10.0,-1.0,5.0+5.0*I,-2.0); 440 440 if (retVal != 0) { 441 psError( __func__,"Expected zero return for min>max.");441 psError(PS_ERR_UNKNOWN, true,"Expected zero return for min>max."); 442 442 return 3; 443 443 } … … 457 457 0.0); 458 458 if (retVal != 0) { 459 psError( __func__,"Expected zero return for vmin not in datatype range.");459 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range."); 460 460 return 80; 461 461 } … … 468 468 0.0); 469 469 if (retVal != 0) { 470 psError( __func__,"Expected zero return for vmin not in datatype range.");470 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range."); 471 471 return 81; 472 472 } … … 479 479 0.0); 480 480 if (retVal != 0) { 481 psError( __func__,"Expected zero return for vmin not in datatype range.");481 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range."); 482 482 return 82; 483 483 } … … 490 490 0.0); 491 491 if (retVal != 0) { 492 psError( __func__,"Expected zero return for vmin not in datatype range.");492 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range."); 493 493 return 83; 494 494 } … … 501 501 -2.0*(double)FLT_MAX); 502 502 if (retVal != 0) { 503 psError( __func__,"Expected zero return for vmax not in datatype range.");503 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range."); 504 504 return 84; 505 505 } … … 512 512 2.0*(double)FLT_MAX); 513 513 if (retVal != 0) { 514 psError( __func__,"Expected zero return for vmax not in datatype range.");514 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range."); 515 515 return 85; 516 516 } … … 523 523 -2.0*(double)FLT_MAX*I); 524 524 if (retVal != 0) { 525 psError( __func__,"Expected zero return for vmax not in datatype range.");525 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range."); 526 526 return 87; 527 527 } … … 534 534 2.0*(double)FLT_MAX*I); 535 535 if (retVal != 0) { 536 psError( __func__,"Expected zero return for vmax not in datatype range.");536 psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range."); 537 537 return 88; 538 538 } … … 552 552 0.0); 553 553 if (retVal == 0) { 554 psError( __func__,"Didn't expect zero return for vmin > vmax.");554 psError(PS_ERR_UNKNOWN, true,"Didn't expect zero return for vmin > vmax."); 555 555 return 83; 556 556 } … … 573 573 retVal = psImageClipComplexRegion(img,2.0,10.0,5.0,0.0); 574 574 if (retVal != 0) { 575 psError( __func__,"Expected zero return for clip of invalid image type.");575 psError(PS_ERR_UNKNOWN, true,"Expected zero return for clip of invalid image type."); 576 576 return 84; 577 577 } … … 625 625 retVal = psImageOverlaySection(img,img2,c/4,r/4,OPSTRING); \ 626 626 if (retVal != 0) { \ 627 psError( __func__,"psImageOverlaySection returned non-zero %s op",OPSTRING); \627 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero %s op",OPSTRING); \ 628 628 return 1; \ 629 629 } \ … … 637 637 } \ 638 638 if (fabsf(imgRow[col] - val) > FLT_EPSILON) { \ 639 psError( __func__,"Value incorrect at %d,%d (%.2f vs %.2f for %s)", \639 psError(PS_ERR_UNKNOWN, true,"Value incorrect at %d,%d (%.2f vs %.2f for %s)", \ 640 640 col,row,imgRow[col],val,OPSTRING); \ 641 641 return 2; \ 642 642 } \ 643 643 if (row < r/2 && col < c/2 && fabsf(img2Row[col] - 2.0) > FLT_EPSILON) { \ 644 psError( __func__,"Overlay modified at %d,%d (%.2f for %s)", \644 psError(PS_ERR_UNKNOWN, true,"Overlay modified at %d,%d (%.2f for %s)", \ 645 645 col,row,img2Row[col],OPSTRING); \ 646 646 return 2; \ … … 706 706 retVal = psImageOverlaySection(img,img2,c/4,r/4,"+"); 707 707 if (retVal == 0) { 708 psError( __func__,"psImageOverlaySection returned zero even though "708 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though " 709 709 "overlay too big"); 710 710 return 3; … … 714 714 for (unsigned col=0;col<c;col++) { 715 715 if (imgRow[col] != 6.0f) { 716 psError( __func__,"Input image modified when overlay size too big");716 psError(PS_ERR_UNKNOWN, true,"Input image modified when overlay size too big"); 717 717 return 4; 718 718 } … … 729 729 retVal = psImageOverlaySection(img,NULL,c/4,r/4,"+"); 730 730 if (retVal == 0) { 731 psError( __func__,"psImageOverlaySection returned zero even though "731 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though " 732 732 "overlay too big"); 733 733 return 5; … … 737 737 for (unsigned col=0;col<c;col++) { 738 738 if (imgRow[col] != 6.0f) { 739 psError( __func__,"Input image modified when overlay NULL");739 psError(PS_ERR_UNKNOWN, true,"Input image modified when overlay NULL"); 740 740 return 6; 741 741 } … … 751 751 retVal = psImageOverlaySection(NULL,img2,c/4,r/4,"+"); 752 752 if (retVal == 0) { 753 psError( __func__,"psImageOverlaySection returned zero even though "753 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though " 754 754 "overlay too big"); 755 755 return 7; … … 764 764 retVal = psImageOverlaySection(img,img2,0,0,"$"); 765 765 if (retVal == 0) { 766 psError( __func__,"psImageOverlaySection returned zero even though "766 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though " 767 767 "overlay operator is invalid"); 768 768 return 8; … … 777 777 retVal = psImageOverlaySection(img,img2,0,0,NULL); 778 778 if(retVal == 0) { 779 psError( __func__,"psImageOverlaySection returned zero even though "779 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though " 780 780 "overlay operator is NULL"); 781 781 return 9; … … 790 790 retVal = psImageOverlaySection(img,img3,0,0,"+"); 791 791 if(retVal == 0) { 792 psError( __func__,"psImageOverlaySection returned zero eventhough "792 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero eventhough " 793 793 " overlay image type is different than input image."); 794 794 return 10; … … 803 803 retVal = psImageOverlaySection(img3,img4,0,0,"+"); 804 804 if(retVal == 0) { 805 psError( __func__,"psImageOverlaySection returned zero eventhough "805 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero eventhough " 806 806 "overlay and image type are invalid type."); 807 807 return 11; … … 820 820 retVal = psImageOverlaySection(img,img2,0,0,"/"); 821 821 if (retVal != 0) { 822 psError( __func__,"psImageOverlaySection returned non-zero when "822 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero when " 823 823 "checking divide-by-zero."); 824 824 return 12; … … 906 906 out = psImageRebin(NULL,in,NULL,0,4,&stats); \ 907 907 if (out == NULL) { \ 908 psError( __func__,"psImageRebin returned a NULL pointer!?"); \908 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned a NULL pointer!?"); \ 909 909 return 1; \ 910 910 } \ 911 911 if (out->numRows != 4 || out->numCols != 4) { \ 912 psError( __func__,"psImageRebin didn't produce the proper size image " \912 psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper size image " \ 913 913 "(%d x %d).", \ 914 914 out->numCols, out->numRows); \ … … 920 920 for (psS32 col = 0; col<4; col++) { \ 921 921 if (fabsf((float)outRow[col]-(float)truthRow[col]) > FLT_EPSILON) { \ 922 psError( __func__,"psImageRebin didn't produce the proper mean " \922 psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper mean " \ 923 923 "result at (%d,%d) [%f vs %f].", \ 924 924 col,row,outRow[col],truthRow[col]); \ … … 934 934 for ( psS32 col = 0; col<4; col++) { \ 935 935 if(abs((psS32)outRow[col]-(psS32)truthRow[col]) > FLT_EPSILON) { \ 936 psError( __func__,"psImageRebin with mask didn't produce the proper mean " \936 psError(PS_ERR_UNKNOWN, true,"psImageRebin with mask didn't produce the proper mean " \ 937 937 "result at (%d,%d) [%f vs %f].", \ 938 938 col,row,outRow[col],truthRow[col]); \ … … 944 944 out2 = psImageRebin(out,in,NULL,0,3,&stats); \ 945 945 if (out != out2) { \ 946 psError( __func__,"psImageRebin didn't recycle a psImage properly!?"); \946 psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't recycle a psImage properly!?"); \ 947 947 return 7; \ 948 948 } \ 949 949 if (out == NULL) { \ 950 psError( __func__,"psImageRebin returned a NULL pointer!?"); \950 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned a NULL pointer!?"); \ 951 951 return 4; \ 952 952 } \ 953 953 if (out->numRows != 6 || out->numCols != 6) { \ 954 psError( __func__,"psImageRebin didn't produce the proper size image " \954 psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper size image " \ 955 955 "(%d x %d).", \ 956 956 out->numCols, out->numRows); \ … … 962 962 for (psS32 col = 0; col<6; col++) { \ 963 963 if (fabsf((float)outRow[col]-(float)truthRow[col]) > FLT_EPSILON) { \ 964 psError( __func__,"psImageRebin didn't produce the proper " \964 psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper " \ 965 965 "max result at (%d,%d) [%f vs %f].", \ 966 966 col,row,outRow[col],truthRow[col]); \ … … 990 990 out = psImageRebin(NULL,in,NULL,0,4,&stats); 991 991 if(out != NULL) { 992 psError( __func__,"psImageRebin return an image eventhough the "992 psError(PS_ERR_UNKNOWN, true,"psImageRebin return an image eventhough the " 993 993 "type is not handled."); 994 994 return 14; … … 999 999 out = psImageRebin(NULL,in,mask,1,4,&stats); 1000 1000 if(out != NULL) { 1001 psError( __func__,"psImageRebin return an image eventhough the "1001 psError(PS_ERR_UNKNOWN, true,"psImageRebin return an image eventhough the " 1002 1002 "mask is not the correct type."); 1003 1003 return 17; … … 1012 1012 1013 1013 if (out2 != NULL) { 1014 psError( __func__,"psImageRebin returned an image though the input was "1014 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the input was " 1015 1015 "NULL!?"); 1016 1016 return 8; … … 1024 1024 1025 1025 if (out2 != NULL) { 1026 psError( __func__,"psImageRebin returned an image though the scale was "1026 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the scale was " 1027 1027 "zero!?"); 1028 1028 return 9; … … 1035 1035 1036 1036 if (out2 != NULL) { 1037 psError( __func__,"psImageRebin returned an image though the stats was "1037 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats was " 1038 1038 "NULL!?"); 1039 1039 return 10; … … 1049 1049 1050 1050 if (out2 != NULL) { 1051 psError( __func__,"psImageRebin returned an image though the stats "1051 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats " 1052 1052 "options was zero!?"); 1053 1053 return 11; … … 1059 1059 1060 1060 if (out2 != NULL) { 1061 psError( __func__,"psImageRebin returned an image though the stats "1061 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats " 1062 1062 "options was PS_STAT_USE_RANGE!?"); 1063 1063 return 12; … … 1072 1072 1073 1073 if (out2 != NULL) { 1074 psError( __func__,"psImageRebin returned an image though the stats "1074 psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats " 1075 1075 "options was PS_STAT_SAMPLE_MEAN+PS_STAT_MAX!?"); 1076 1076 return 13; … … 1121 1121 for (psS32 col=0;col<cols;col++) { 1122 1122 if (inRow[col] != outRow[col]) { 1123 psError( __func__,"psImageRoll didn't produce expected result "1123 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1124 1124 "at %d,%d (%f vs %f) for dx=0, dy=0.", 1125 1125 col,row,inRow[col],outRow[col]); … … 1135 1135 for (psS32 col=0;col<cols;col++) { 1136 1136 if (inRow[(col+cols/4) % cols] != outRow[col]) { 1137 psError( __func__,"psImageRoll didn't produce expected result "1137 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1138 1138 "at %d,%d (%f vs %f) for dx=cols/4, dy=0.", 1139 1139 col,row,inRow[(col+cols/4) % cols],outRow[col]); … … 1146 1146 // parameter out if provided. 1147 1147 if (out2 != out) { 1148 psError( __func__,"psImageRoll didn't recycle my out psImage!?");1148 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't recycle my out psImage!?"); 1149 1149 return 1; 1150 1150 } … … 1156 1156 for (psS32 col=0;col<cols;col++) { 1157 1157 if (inRow[col] != outRow[col]) { 1158 psError( __func__,"psImageRoll didn't produce expected result "1158 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1159 1159 "at %d,%d (%f vs %f) for dx=0, dy=rows/4.", 1160 1160 col,row,inRow[col],outRow[col]); … … 1170 1170 for (psS32 col=0;col<cols;col++) { 1171 1171 if (inRow[(col+cols/4) % cols] != outRow[col]) { 1172 psError( __func__,"psImageRoll didn't produce expected result "1172 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1173 1173 "at %d,%d (%f vs %f) for dx=cols/4, dy=rows/4.", 1174 1174 col,row,inRow[(col+cols/4) % cols],outRow[col]); … … 1184 1184 for (psS32 col=0;col<cols;col++) { 1185 1185 if (inRow[(col+(cols-cols/4)) % cols] != outRow[col]) { 1186 psError( __func__,"psImageRoll didn't produce expected result "1186 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1187 1187 "at %d,%d (%f vs %f) for dx=-cols/4, dy=0.", 1188 1188 col,row,inRow[(col+(cols-cols/4)) % cols],outRow[col]); … … 1198 1198 for (psS32 col=0;col<cols;col++) { 1199 1199 if (inRow[col] != outRow[col]) { 1200 psError( __func__,"psImageRoll didn't produce expected result "1200 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1201 1201 "at %d,%d (%f vs %f) for dx=0, dy=-rows/4.", 1202 1202 col,row,inRow[col],outRow[col]); … … 1212 1212 for (psS32 col=0;col<cols;col++) { 1213 1213 if (inRow[(col+cols-cols/4) % cols] != outRow[col]) { 1214 psError( __func__,"psImageRoll didn't produce expected result "1214 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " 1215 1215 "at %d,%d (%f vs %f) for dx=cols/4, dy=rows/4.", 1216 1216 col,row,inRow[(col+cols-cols/4) % cols],outRow[col]); … … 1226 1226 out2 = psImageRoll(NULL,NULL,0,0); 1227 1227 if (out2 != NULL) { 1228 psError( __func__,"psImageRoll did not return NULL though input image was NULL!?");1228 psError(PS_ERR_UNKNOWN, true,"psImageRoll did not return NULL though input image was NULL!?"); 1229 1229 return 2; 1230 1230 } … … 1249 1249 for (psS32 col=0;col<cols1;col++) { \ 1250 1250 if (inRow[(col+cols1/4)%cols1] != outRow[col]) { \ 1251 psError( __func__,"psImageRoll didn't produce expected result " \1251 psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " \ 1252 1252 "at %d,%d (%f vs %f) for dx=0, dy=0.", \ 1253 1253 col,row,(float)inRow[col],(float)outRow[col]); \ … … 1346 1346 // parameter out if provided. 1347 1347 if (oldOut != NULL && oldOut != fOut) { 1348 psError( __func__,"the output recycle functionality failed");1348 psError(PS_ERR_UNKNOWN, true,"the output recycle functionality failed"); 1349 1349 return 2; 1350 1350 } 1351 1351 if (oldBiOut != NULL && oldBiOut != fBiOut) { 1352 psError( __func__,"the output recycle functionality failed");1352 psError(PS_ERR_UNKNOWN, true,"the output recycle functionality failed"); 1353 1353 return 4; 1354 1354 } … … 1356 1356 sBiOut = psImageRotate(sBiOut,sImg,rot,-1.0,PS_INTERPOLATE_BILINEAR); 1357 1357 if (! psImageWriteSection(fOut,0,0,0,NULL,index,"temp/fOut.fits") ) { 1358 psError( __func__,"Can not write to temp/fOut.fits, so why continue!?");1358 psError(PS_ERR_UNKNOWN, true,"Can not write to temp/fOut.fits, so why continue!?"); 1359 1359 return 20; 1360 1360 } 1361 1361 if (! psImageWriteSection(sOut,0,0,0,NULL,index,"temp/sOut.fits") ) { 1362 psError( __func__,"Can not write to temp/sOut.fits, so why continue!?");1362 psError(PS_ERR_UNKNOWN, true,"Can not write to temp/sOut.fits, so why continue!?"); 1363 1363 return 21; 1364 1364 } 1365 1365 if (! psImageWriteSection(fBiOut,0,0,0,NULL,index,"temp/fBiOut.fits") ) { 1366 psError( __func__,"Can not write to temp/fBiOut.fits, so why continue!?");1366 psError(PS_ERR_UNKNOWN, true,"Can not write to temp/fBiOut.fits, so why continue!?"); 1367 1367 return 40; 1368 1368 } 1369 1369 if (! psImageWriteSection(sBiOut,0,0,0,NULL,index,"temp/sBiOut.fits") ) { 1370 psError( __func__,"Can not write to temp/sBiOut.fits, so why continue!?");1370 psError(PS_ERR_UNKNOWN, true,"Can not write to temp/sBiOut.fits, so why continue!?"); 1371 1371 return 41; 1372 1372 } … … 1378 1378 sBiTruth = psImageReadSection(sBiTruth,0,0,0,0,0,NULL,index,"verified/sBiOut.fits"); 1379 1379 if (fTruth == NULL) { 1380 psError( __func__,"verified psF32 image failed to be read (%d deg. rotation)",1380 psError(PS_ERR_UNKNOWN, true,"verified psF32 image failed to be read (%d deg. rotation)", 1381 1381 rot); 1382 1382 fail = true; 1383 1383 } else { 1384 1384 if (fTruth->numRows != fOut->numRows || fTruth->numCols != fOut->numCols) { 1385 psError( __func__,"Rotated float image size did not match truth "1385 psError(PS_ERR_UNKNOWN, true,"Rotated float image size did not match truth " 1386 1386 "image for %d deg rotation (%dx%d vs %dx%d).", 1387 1387 rot,fOut->numCols,fOut->numRows,fTruth->numCols,fTruth->numRows); … … 1393 1393 for (psS32 col=0;col<fTruth->numCols;col++) { 1394 1394 if (fabsf(truthRow[col]-outRow[col]) > 1) { 1395 psError( __func__,"Float Image mismatch (%f vs %f) at %d,%d.",1395 psError(PS_ERR_UNKNOWN, true,"Float Image mismatch (%f vs %f) at %d,%d.", 1396 1396 outRow[col], truthRow[col],col,row); 1397 1397 fail = true; … … 1403 1403 1404 1404 if (sTruth == NULL) { 1405 psError( __func__,"verified psS16 image failed to be read "1405 psError(PS_ERR_UNKNOWN, true,"verified psS16 image failed to be read " 1406 1406 "(%d deg. rotation)",rot); 1407 1407 fail = true; … … 1409 1409 if (sTruth->numRows != sOut->numRows || 1410 1410 sTruth->numCols != sOut->numCols) { 1411 psError( __func__,"Rotated psS16 image size did not match truth "1411 psError(PS_ERR_UNKNOWN, true,"Rotated psS16 image size did not match truth " 1412 1412 "image for %d deg rotation.",rot); 1413 1413 fail = true; … … 1418 1418 for (psS32 col=0;col<sTruth->numCols;col++) { 1419 1419 if (fabsf(truthRow[col]-outRow[col]) > 1) { 1420 psError( __func__,"Short Image mismatch (%d vs %d) "1420 psError(PS_ERR_UNKNOWN, true,"Short Image mismatch (%d vs %d) " 1421 1421 "at %d,%d.", 1422 1422 outRow[col], truthRow[col],col,row); … … 1430 1430 1431 1431 if (fBiTruth == NULL) { 1432 psError( __func__,"verified psF32 Bi image failed to be read (%d deg. rotation)",1432 psError(PS_ERR_UNKNOWN, true,"verified psF32 Bi image failed to be read (%d deg. rotation)", 1433 1433 rot); 1434 1434 fail = true; 1435 1435 } else { 1436 1436 if (fBiTruth->numRows != fBiOut->numRows || fBiTruth->numCols != fBiOut->numCols) { 1437 psError( __func__,"Rotated float image size did not match truth "1437 psError(PS_ERR_UNKNOWN, true,"Rotated float image size did not match truth " 1438 1438 "image for %d deg rotation (%dx%d vs %dx%d). BILINEAR", 1439 1439 rot,fBiOut->numCols,fBiOut->numRows,fBiTruth->numCols,fBiTruth->numRows); … … 1445 1445 for (psS32 col=0;col<fBiTruth->numCols;col++) { 1446 1446 if (fabsf(truthRow[col]-outRow[col]) > 1) { 1447 psError( __func__,"Float Image mismatch (%f vs %f) at %d,%d. BILINEAR",1447 psError(PS_ERR_UNKNOWN, true,"Float Image mismatch (%f vs %f) at %d,%d. BILINEAR", 1448 1448 outRow[col], truthRow[col],col,row); 1449 1449 fail = true; … … 1455 1455 1456 1456 if (sBiTruth == NULL) { 1457 psError( __func__,"verified psS16 image failed to be read "1457 psError(PS_ERR_UNKNOWN, true,"verified psS16 image failed to be read " 1458 1458 "(%d deg. rotation) BILINEAR",rot); 1459 1459 fail = true; … … 1461 1461 if (sBiTruth->numRows != sBiOut->numRows || 1462 1462 sBiTruth->numCols != sBiOut->numCols) { 1463 psError( __func__,"Rotated psS16 image size did not match truth "1463 psError(PS_ERR_UNKNOWN, true,"Rotated psS16 image size did not match truth " 1464 1464 "image for %d deg rotation. BILINEAR",rot); 1465 1465 fail = true; … … 1470 1470 for (psS32 col=0;col<sBiTruth->numCols;col++) { 1471 1471 if (fabsf(truthRow[col]-outRow[col]) > 1) { 1472 psError( __func__,"Short Image mismatch (%d vs %d) "1472 psError(PS_ERR_UNKNOWN, true,"Short Image mismatch (%d vs %d) " 1473 1473 "at %d,%d. BILINEAR", 1474 1474 outRow[col], truthRow[col],col,row); … … 1487 1487 s32Out = psImageRotate(s32Out,s32Img,rot,-1.0,PS_INTERPOLATE_FLAT); 1488 1488 if( s32Out != NULL ) { 1489 psError( __func__,"psImage returned is not NULL for invalid image type.");1489 psError(PS_ERR_UNKNOWN, true,"psImage returned is not NULL for invalid image type."); 1490 1490 return 5; 1491 1491 } … … 1496 1496 1497 1497 if (fail) { 1498 psError( __func__,"One or more images didn't match truth or truth did "1498 psError(PS_ERR_UNKNOWN, true,"One or more images didn't match truth or truth did " 1499 1499 "not exist."); 1500 1500 return 10; … … 1507 1507 fOut = psImageRotate(fOut,NULL,0,0,PS_INTERPOLATE_FLAT); 1508 1508 if (fOut != NULL) { 1509 psError( __func__,"NULL wasn't returned though the input image was NULL.");1509 psError(PS_ERR_UNKNOWN, true,"NULL wasn't returned though the input image was NULL."); 1510 1510 return 3; 1511 1511 } … … 1517 1517 fOut = psImageRotate(fOut, fImg, 33, 0, -1); 1518 1518 if (fOut != NULL) { 1519 psError( __func__,"NULL wasn't returned though the interpolation mode "1519 psError(PS_ERR_UNKNOWN, true,"NULL wasn't returned though the interpolation mode " 1520 1520 "is invalid."); 1521 1521 return 4; … … 1598 1598 1599 1599 if (fRecycle != fOut) { 1600 psError( __func__,"psImageShift didn't recycle my image?");1600 psError(PS_ERR_UNKNOWN, true,"psImageShift didn't recycle my image?"); 1601 1601 return 10; 1602 1602 } … … 1609 1609 fOut = psImageShift(fOut,NULL,8,8,NAN,PS_INTERPOLATE_FLAT); 1610 1610 if (fOut != NULL) { 1611 psError( __func__,"psImageShift didn't return NULL given a NULL input image.");1611 psError(PS_ERR_UNKNOWN, true,"psImageShift didn't return NULL given a NULL input image."); 1612 1612 return 11; 1613 1613 } … … 1618 1618 fOut = psImageShift(fOut,fImg,8,8,NAN,-1); 1619 1619 if (fOut != NULL ) { 1620 psError( __func__,"psImageShift didn't return NULL given an invalid interpolation mode.");1620 psError(PS_ERR_UNKNOWN, true,"psImageShift didn't return NULL given an invalid interpolation mode."); 1621 1621 return 12; 1622 1622 } … … 1675 1675 1676 1676 if (fabsf(fRow[col] - fValue) > FLT_EPSILON) { 1677 psError( __func__,"Float image not shifted correctly at %d,%d (%g vs %g)",1677 psError(PS_ERR_UNKNOWN, true,"Float image not shifted correctly at %d,%d (%g vs %g)", 1678 1678 col,row,fRow[col],fValue); 1679 1679 return 1; 1680 1680 } 1681 1681 if (sRow[col] != sValue) { 1682 psError( __func__,"Short image not shifted correctly at %d,%d (%d vs %d)",1682 psError(PS_ERR_UNKNOWN, true,"Short image not shifted correctly at %d,%d (%d vs %d)", 1683 1683 col,row,sRow[col],sValue); 1684 1684 return 2; 1685 1685 } 1686 1686 if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) { 1687 psError( __func__,"Float image not shifted correctly at %d,%d (%g vs %g)",1687 psError(PS_ERR_UNKNOWN, true,"Float image not shifted correctly at %d,%d (%g vs %g)", 1688 1688 col,row,fBiRow[col],fBiValue); 1689 1689 return 1; 1690 1690 } 1691 1691 if (sBiRow[col] != sBiValue) { 1692 psError( __func__,"Short image not shifted correctly at %d,%d (%d vs %d)",1692 psError(PS_ERR_UNKNOWN, true,"Short image not shifted correctly at %d,%d (%d vs %d)", 1693 1693 col,row,sBiRow[col],sBiValue); 1694 1694 return 2;
Note:
See TracChangeset
for help on using the changeset viewer.
