Changeset 2273 for trunk/psLib/test/image
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 6 edited
-
tst_psImage.c (modified) (19 diffs)
-
tst_psImageConvolve.c (modified) (30 diffs)
-
tst_psImageExtraction.c (modified) (54 diffs)
-
tst_psImageFFT.c (modified) (23 diffs)
-
tst_psImageIO.c (modified) (19 diffs)
-
tst_psImageManip.c (modified) (83 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.29 $ $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 … … 71 71 continue; 72 72 } 73 psError( __func__,"psImageAlloc returned NULL for type %x, size %dx%d.",73 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned NULL for type %x, size %dx%d.", 74 74 type[t], numCols[i], numRows[i]); 75 75 psFree(image); … … 78 78 79 79 if (image->type.dimen != PS_DIMEN_IMAGE || image->type.type != type[t]) { 80 psError( __func__,"psImageAlloc allocated wrong dimen/type (%d/%d), should be "80 psError(PS_ERR_UNKNOWN, true,"psImageAlloc allocated wrong dimen/type (%d/%d), should be " 81 81 "PS_IMAGE_DIMEN/%d", image->type.dimen, image->type.type, type[t]); 82 82 psFree(image); … … 85 85 86 86 if (image->numCols != numCols[i] || image->numRows != numRows[i]) { 87 psError( __func__,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)",87 psError(PS_ERR_UNKNOWN, true,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)", 88 88 image->numCols, image->numRows, numCols[i], numRows[i],type[t]); 89 89 psFree(image); … … 92 92 93 93 if (image->col0 != 0 || image->row0 != 0) { 94 psError( __func__,"psImageAlloc returned row0/col0 of %d/%d. Should be 0/0.",94 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned row0/col0 of %d/%d. Should be 0/0.", 95 95 image->row0, image->row0); 96 96 psFree(image); … … 99 99 100 100 if (image->parent != NULL) { 101 psError( __func__,"psImageAlloc returned non-NULL parent");101 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned non-NULL parent"); 102 102 psFree(image); 103 103 return 5; … … 105 105 106 106 if (image->children != NULL) { 107 psError( __func__,"psImageAlloc returned non-NULL children array");107 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned non-NULL children array"); 108 108 psFree(image); 109 109 return 7; … … 123 123 for (psS32 c=0;c<cols;c++) { 124 124 if (image->data.U16[r][c] != 2*c+r) { 125 psError( __func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r);125 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in uint16 image at (%d,%d)",c,r); 126 126 psFree(image); 127 127 return 8; … … 143 143 for (psS32 c=0;c<cols;c++) { 144 144 if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) { 145 psError( __func__,"Could not set all pixels in float image at (%d,%d)",c,r);145 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in float image at (%d,%d)",c,r); 146 146 psFree(image); 147 147 return 8; … … 163 163 for (psS32 c=0;c<cols;c++) { 164 164 if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) { 165 psError( __func__,"Could not set all pixels in double image at (%d,%d)",c,r);165 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in double image at (%d,%d)",c,r); 166 166 psFree(image); 167 167 return 8; … … 184 184 if (fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON || 185 185 fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) { 186 psError( __func__,"Could not set all pixels in complex image at (%d,%d)",c,r);186 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in complex image at (%d,%d)",c,r); 187 187 psFree(image); 188 188 return 8; … … 205 205 for (psS32 c=0;c<cols;c++) { 206 206 if (image->data.PTR[r][c] != temp) { 207 psError( __func__, "Could not set pixel in pointer image at (%d,%d): %x %x",207 psError(PS_ERR_UNKNOWN, true, "Could not set pixel in pointer image at (%d,%d): %x %x", 208 208 c,r,image->data.PTR[r][c],temp); 209 209 psFree(image); … … 229 229 for (psS32 c=0;c<cols;c++) { 230 230 if (image->data.U8[r][c] != (uint8_t)(r + c)) { 231 psError( __func__,"Could not set all pixels in image (type=%d) at (%d,%d)",231 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in image (type=%d) at (%d,%d)", 232 232 type[t],c,r); 233 233 psFree(image); … … 281 281 // Verify the returned psImage structure pointer is equal to the input parameter output. 282 282 if (img2 != img3) { 283 psError( __func__,"the image given for recycled wasn't");283 psError(PS_ERR_UNKNOWN, true,"the image given for recycled wasn't"); 284 284 return 1; 285 285 } … … 289 289 img4 = psImageCopy(NULL,img,PS_TYPE_F32); 290 290 if (img4 == NULL) { 291 psError( __func__,"output image doesn't exist");291 psError(PS_ERR_UNKNOWN, true,"output image doesn't exist"); 292 292 return 4; 293 293 } 294 294 if (img4->type.type != img->type.type) { 295 psError( __func__,"output image is not the same type as input image");295 psError(PS_ERR_UNKNOWN, true,"output image is not the same type as input image"); 296 296 return 4; 297 297 } … … 301 301 for (unsigned col=0;col<c;col++) { 302 302 if( imgInRow[col] != imgOutRow[col] ) { 303 psError( __func__,"Input image not equal to output image at %d,%d!",303 psError(PS_ERR_UNKNOWN, true,"Input image not equal to output image at %d,%d!", 304 304 col, row); 305 305 return 4; … … 321 321 img2 = psImageCopy(img2,img,PS_TYPE_##OUT); \ 322 322 if (img2 == NULL) { \ 323 psError( __func__,"psImageCopy failed to copy U8."); \323 psError(PS_ERR_UNKNOWN, true,"psImageCopy failed to copy U8."); \ 324 324 return 2; \ 325 325 } \ … … 329 329 for (psU32 col=0;col<c;col++) { \ 330 330 if (abs(imgRow[col] - (ps##IN)(row+col)) > 0.5) { \ 331 psError( __func__,"Input image was changed at %d,%d!", \331 psError(PS_ERR_UNKNOWN, true,"Input image was changed at %d,%d!", \ 332 332 col,row); \ 333 333 return 2; \ 334 334 } \ 335 335 if (abs(img2Row[col] - (ps##OUT)(imgRow[col])) > 0.5) { \ 336 psError( __func__,"returned psImage values after copy don't match at %d,%d " \336 psError(PS_ERR_UNKNOWN, true,"returned psImage values after copy don't match at %d,%d " \ 337 337 "(%d vs %d)",\ 338 338 col,row,img2Row[col], (ps##OUT)(imgRow[col])); \ … … 382 382 img3 = psImageCopy(NULL,NULL,PS_TYPE_F32); 383 383 if (img3 != NULL) { 384 psError( __func__,"psImageCopy didn't return NULL when input image was NULL.");384 psError(PS_ERR_UNKNOWN, true,"psImageCopy didn't return NULL when input image was NULL."); 385 385 return 3; 386 386 } -
trunk/psLib/test/image/tst_psImageConvolve.c
r2204 r2273 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-1 0-27 00:57:33$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-11-04 01:05:00 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 52 52 53 53 if (k == NULL) { 54 psError( __func__,"psKernelAlloc returned NULL for [%d:%d,%d:%d].",54 psError(PS_ERR_UNKNOWN, true,"psKernelAlloc returned NULL for [%d:%d,%d:%d].", 55 55 xMin[i], xMax[i], yMin[i], yMax[i]); 56 56 return i*10+1; … … 59 59 if (k->xMin != xMin[i] || k->xMax != xMax[i] || 60 60 k->yMin != yMin[i] || k->yMax != yMax[i]) { 61 psError( __func__,"Min/max members, [%d:%d,%d:%d], of psKernel wrong. Should be [%d:%d,%d:%d].",61 psError(PS_ERR_UNKNOWN, true,"Min/max members, [%d:%d,%d:%d], of psKernel wrong. Should be [%d:%d,%d:%d].", 62 62 k->xMin,k->xMax, k->yMin, k->yMax, 63 63 xMin[i], xMax[i], yMin[i], yMax[i]); … … 67 67 if (k->image->numCols != xMax[i]-xMin[i]+1 || 68 68 k->image->numRows != yMax[i]-yMin[i]+1) { 69 psError( __func__,"Size of the kernel image is wrong (%dx%d vs %dx%d).",69 psError(PS_ERR_UNKNOWN, true,"Size of the kernel image is wrong (%dx%d vs %dx%d).", 70 70 xMax[i]-xMin[i]+1, yMax[i]-yMin[i]+1, 71 71 k->image->numCols, k->image->numRows); … … 75 75 for (psS32 j=yMin[i]; j<yMax[i]; j++) { 76 76 if (k->kernel[j]+xMin[i] != k->image->data.PS_TYPE_KERNEL_DATA[j-yMin[i]]) { 77 psError( __func__,"The kernel pointer was set wrong for row %d.",77 psError(PS_ERR_UNKNOWN, true,"The kernel pointer was set wrong for row %d.", 78 78 j); 79 79 return i*10+4; … … 87 87 k = psKernelAlloc(5, -5, -2, 2); 88 88 if (k == NULL) { 89 psError( __func__,"psKernelAlloc returned NULL for xMin > xMax.");89 psError(PS_ERR_UNKNOWN, true,"psKernelAlloc returned NULL for xMin > xMax."); 90 90 return i*10+5; 91 91 } 92 92 93 93 if (k->xMin != -5 || k->xMax != 5) { 94 psError( __func__,"psKernelAlloc didn't swap xMin & xMax.");94 psError(PS_ERR_UNKNOWN, true,"psKernelAlloc didn't swap xMin & xMax."); 95 95 return i*10+6; 96 96 } … … 101 101 k = psKernelAlloc(-2, 2, 5, -5); 102 102 if (k == NULL) { 103 psError( __func__,"psKernelAlloc returned NULL for yMin > yMax.");103 psError(PS_ERR_UNKNOWN, true,"psKernelAlloc returned NULL for yMin > yMax."); 104 104 return i*10+7; 105 105 } 106 106 107 107 if (k->yMin != -5 || k->yMax != 5) { 108 psError( __func__,"psKernelAlloc didn't swap yMin & yMax.");108 psError(PS_ERR_UNKNOWN, true,"psKernelAlloc didn't swap yMin & yMax."); 109 109 return i*10+8; 110 110 } … … 136 136 137 137 if (result == NULL) { 138 psError( __func__,"psKernelGenerate returned NULL.");138 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate returned NULL."); 139 139 return 1; 140 140 } … … 142 142 if (result->xMin != -1 || result->xMax != 1 || 143 143 result->yMin != -2 || result->yMax != 2) { 144 psError( __func__,"psKernelGenerate result had a range of [%d:%d,%d:%d]. Suppose to be [0:1,1:2].",144 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result had a range of [%d:%d,%d:%d]. Suppose to be [0:1,1:2].", 145 145 result->xMin, result->xMax, result->yMin, result->yMax); 146 146 return 2; … … 154 154 } 155 155 if (fabsf(1.0 - sum) > FLT_EPSILON) { 156 psError( __func__,"psKernelGenerate result is not normalized (sum=%g).",156 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result is not normalized (sum=%g).", 157 157 sum); 158 158 … … 166 166 fabsf(result->kernel[-1][ 0] - 2.0/10.0) > FLT_EPSILON || 167 167 fabsf(result->kernel[-2][-1] - 0.0/10.0) > FLT_EPSILON) { 168 psError( __func__,"psKernelGenerate result values, %g,%g;%g,%g, are wrong. Suppose to be 2,6;1,0.",168 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result values, %g,%g;%g,%g, are wrong. Suppose to be 2,6;1,0.", 169 169 result->kernel[-1][0], result->kernel[1][1], 170 170 result->kernel[2][0], result->kernel[-2][-1]); … … 191 191 192 192 if (result == NULL) { 193 psError( __func__,"psKernelGenerate returned NULL.");193 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate returned NULL."); 194 194 return 5; 195 195 } … … 197 197 if (result->xMin != 0 || result->xMax != 1 || 198 198 result->yMin != 0 || result->yMax != 3) { 199 psError( __func__,"psKernelGenerate result had a range of [%d:%d,%d:%d]. Suppose to be [0:1,1:2].",199 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result had a range of [%d:%d,%d:%d]. Suppose to be [0:1,1:2].", 200 200 result->xMin, result->xMax, result->yMin, result->yMax); 201 201 return 6; … … 209 209 } 210 210 if (fabsf(1.0 - sum) > FLT_EPSILON) { 211 psError( __func__,"psKernelGenerate result is not normalized (sum=%g).",211 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result is not normalized (sum=%g).", 212 212 sum); 213 213 … … 220 220 fabsf(result->kernel[3][1] - 8.0/21.0) > FLT_EPSILON || 221 221 fabsf(result->kernel[2][1] - 10.0/21.0) > FLT_EPSILON) { 222 psError( __func__,"psKernelGenerate result values, %g,%g;%g,%g, are wrong. Suppose to be 2,6;1,0.",222 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result values, %g,%g;%g,%g, are wrong. Suppose to be 2,6;1,0.", 223 223 result->kernel[1][0], result->kernel[1][1], 224 224 result->kernel[2][0], result->kernel[2][1]); … … 246 246 result = psKernelGenerate(tVec, xVec, yVec, false); 247 247 if (result == NULL) { 248 psError( __func__,"psKernelGenerate returned NULL.");248 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate returned NULL."); 249 249 return 9; 250 250 } … … 254 254 fabsf(result->kernel[ 1][ 1] - 6.0/8.0) > FLT_EPSILON || 255 255 fabsf(result->kernel[ 0][ 0] - 1.0/8.0) > FLT_EPSILON) { 256 psError( __func__,"psKernelGenerate result values wrong for truncated time vector.");256 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate result values wrong for truncated time vector."); 257 257 258 258 return 10; … … 264 264 result = psKernelGenerate(NULL, xVec, yVec, true); 265 265 if (result != NULL) { 266 psError( __func__,"psKernelGenerate returned a kernel with no time vector.");266 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate returned a kernel with no time vector."); 267 267 return 11; 268 268 } … … 271 271 result = psKernelGenerate(tVec, NULL, yVec, true); 272 272 if (result != NULL) { 273 psError( __func__,"psKernelGenerate returned a kernel with no x vector.");273 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate returned a kernel with no x vector."); 274 274 return 11; 275 275 } … … 278 278 result = psKernelGenerate(tVec, xVec, NULL, true); 279 279 if (result != NULL) { 280 psError( __func__,"psKernelGenerate returned a kernel with no y vector.");280 psError(PS_ERR_UNKNOWN, true,"psKernelGenerate returned a kernel with no y vector."); 281 281 return 11; 282 282 } … … 336 336 337 337 if (out == NULL) { 338 psError( __func__, "psImageConvolve returned a NULL for direct gaussian case.");338 psError(PS_ERR_UNKNOWN, true, "psImageConvolve returned a NULL for direct gaussian case."); 339 339 return 1; 340 340 } 341 341 342 342 if (out->numCols != c || out->numRows != r) { 343 psError( __func__, "psImageConvolve result image is %dx%d, but expected %dx%d.",343 psError(PS_ERR_UNKNOWN, true, "psImageConvolve result image is %dx%d, but expected %dx%d.", 344 344 out->numCols, out->numRows, 345 345 c,r); … … 350 350 char* typeStr; 351 351 PS_TYPE_NAME(typeStr,out->type.type); 352 psError( __func__, "psImageConvolve result image is of type %s, not psF32.",352 psError(PS_ERR_UNKNOWN, true, "psImageConvolve result image is of type %s, not psF32.", 353 353 typeStr); 354 354 return 3; … … 359 359 for (psS32 j=-1;j<1;j++) { 360 360 if (fabsf(out->data.F32[r/2+i][c/2+j] - g->kernel[i][j]) > 0.0001) { 361 psError( __func__,"Convolved image wrong at %d,%d. Value is %g, expected %g.",361 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d. Value is %g, expected %g.", 362 362 c/2+j,r/2+i, 363 363 out->data.F32[r/2+i][c/2+j], g->kernel[i][j]); … … 365 365 } 366 366 if (i >= 0 && j >= 0 && fabsf(out->data.F32[i][j] - g->kernel[i][j]) > 0.0001) { 367 psError( __func__,"Convolved image wrong at %d,%d. Value is %g, expected %g.",367 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d. Value is %g, expected %g.", 368 368 j,i, 369 369 out->data.F32[i][j], g->kernel[i][j]); … … 371 371 } 372 372 if (i <= 0 && fabsf(out->data.F32[r-1+i][c/2+j] - g->kernel[i][j]) > 0.0001) { 373 psError( __func__,"Convolved image wrong at %d,%d. Value is %g, expected %g.",373 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d. Value is %g, expected %g.", 374 374 c/2+j,r-1+i, 375 375 out->data.F32[r-1+i][c/2+j], g->kernel[i][j]); … … 397 397 398 398 if (out == NULL) { 399 psError( __func__, "psImageConvolve returned a NULL for gaussian case.");399 psError(PS_ERR_UNKNOWN, true, "psImageConvolve returned a NULL for gaussian case."); 400 400 return 10; 401 401 } 402 402 403 403 if (out != out2) { 404 psError( __func__, "psImageConvolve didn't recycle the supplied out image struct.");404 psError(PS_ERR_UNKNOWN, true, "psImageConvolve didn't recycle the supplied out image struct."); 405 405 return 11; 406 406 } 407 407 408 408 if (out->numCols != c || out->numRows != r) { 409 psError( __func__, "psImageConvolve result image is %dx%d, but expected %dx%d.",409 psError(PS_ERR_UNKNOWN, true, "psImageConvolve result image is %dx%d, but expected %dx%d.", 410 410 out->numCols, out->numRows, 411 411 c,r); … … 416 416 char* typeStr; 417 417 PS_TYPE_NAME(typeStr,out->type.type); 418 psError( __func__, "psImageConvolve result image is of type %s, not psF32.",418 psError(PS_ERR_UNKNOWN, true, "psImageConvolve result image is of type %s, not psF32.", 419 419 typeStr); 420 420 return 13; … … 426 426 for (psS32 j=-1;j<1;j++) { 427 427 if (fabsf(out->data.F32[r/2+i][c/2+j] - g->kernel[i][j]) > 0.0001) { 428 psError( __func__,"Convolved image wrong at %d,%d. Value is %g, expected %g.",428 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d. Value is %g, expected %g.", 429 429 c/2+j,r/2+i, 430 430 out->data.F32[r/2+i][c/2+j], g->kernel[i][j]); … … 433 433 } 434 434 if (i >= 0 && j >= 0 && fabsf(out->data.F32[i][j] - g->kernel[i][j]) > 0.0001) { 435 psError( __func__,"Convolved image wrong at %d,%d. Value is %g, expected %g.",435 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d. Value is %g, expected %g.", 436 436 j,i, 437 437 out->data.F32[i][j], g->kernel[i][j]); … … 439 439 } 440 440 if (i <= 0 && fabsf(out->data.F32[r-1+i][c/2+j] - g->kernel[i][j]) > 0.0001) { 441 psError( __func__,"Convolved image wrong at %d,%d. Value is %g, expected %g.",441 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d. Value is %g, expected %g.", 442 442 c/2+j,r-1+i, 443 443 out->data.F32[r-1+i][c/2+j], g->kernel[i][j]); -
trunk/psLib/test/image/tst_psImageExtraction.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.19 $ $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 … … 87 87 \ 88 88 if (out->n != TRUTH_SIZE) { \ 89 psError( __func__,"Number of results is wrong (%d, not %d)", \89 psError(PS_ERR_UNKNOWN,true,"Number of results is wrong (%d, not %d)", \ 90 90 out->n,n); \ 91 91 return TESTNUM*4+1; \ … … 93 93 \ 94 94 if (positions->n != TRUTH_SIZE) { \ 95 psError( __func__,"Number of results for positions vector is wrong (%d, not %d)", \95 psError(PS_ERR_UNKNOWN,true,"Number of results for positions vector is wrong (%d, not %d)", \ 96 96 out->n,n); \ 97 97 return TESTNUM*4+2; \ … … 100 100 for (psS32 i=0;i<out->n;i++) { \ 101 101 if (fabs(out->data.F64[i]-image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF64)r) { \ 102 psError( __func__,"Improper result at position %d. Got %g, expected %g",i, \102 psError(PS_ERR_UNKNOWN,true,"Improper result at position %d. Got %g, expected %g",i, \ 103 103 out->data.F64[i],image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \ 104 104 return TESTNUM*4+3; \ … … 106 106 if (DIRECTION == PS_CUT_X_POS || DIRECTION == PS_CUT_X_NEG) { \ 107 107 if (positions->data.U32[i] != c/10+TRUTHPIX_X) { \ 108 psError( __func__,"Improper positions (%d vs %d) result @ %d.", \108 psError(PS_ERR_UNKNOWN,true,"Improper positions (%d vs %d) result @ %d.", \ 109 109 positions->data.U32[i],c/10+TRUTHPIX_X,i); \ 110 110 return TESTNUM*4+4; \ … … 112 112 } else { \ 113 113 if (positions->data.U32[i] != r/10+TRUTHPIX_Y) { \ 114 psError( __func__,"Improper positions (%d vs %d) result @ %d.", \114 psError(PS_ERR_UNKNOWN,true,"Improper positions (%d vs %d) result @ %d.", \ 115 115 positions->data.U32[i],r/10+TRUTHPIX_Y,i); \ 116 116 return TESTNUM*4+4; \ … … 165 165 stat ); 166 166 if ( out != NULL ) { 167 psError( __func__, "Giving a NULL image, psImageSlice didn't return NULL as expected" );167 psError( PS_ERR_UNKNOWN,true, "Giving a NULL image, psImageSlice didn't return NULL as expected" ); 168 168 return 101; 169 169 } … … 184 184 NULL ); 185 185 if ( out != NULL ) { 186 psError( __func__, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" );186 psError( PS_ERR_UNKNOWN,true, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" ); 187 187 return 102; 188 188 } … … 202 202 stat); 203 203 if ( out != NULL ) { 204 psError( __func__, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" );204 psError( PS_ERR_UNKNOWN,true, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" ); 205 205 return 103; 206 206 } … … 220 220 stat ); 221 221 if ( out != NULL ) { 222 psError( __func__, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" );222 psError( PS_ERR_UNKNOWN,true, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" ); 223 223 return 104; 224 224 } … … 238 238 stat ); 239 239 if ( out != NULL ) { 240 psError( __func__, "Giving an invalid x position, psImageSlice didn't return NULL as expected" );240 psError( PS_ERR_UNKNOWN,true, "Giving an invalid x position, psImageSlice didn't return NULL as expected" ); 241 241 return 105; 242 242 } … … 251 251 stat ); 252 252 if ( out != NULL ) { 253 psError( __func__, "Giving an invalid y position, psImageSlice didn't return NULL as expected" );253 psError( PS_ERR_UNKNOWN,true, "Giving an invalid y position, psImageSlice didn't return NULL as expected" ); 254 254 return 106; 255 255 } … … 264 264 stat); 265 265 if ( out != NULL ) { 266 psError( __func__, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" );266 psError( PS_ERR_UNKNOWN,true, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" ); 267 267 return 107; 268 268 } … … 277 277 stat); 278 278 if ( out != NULL ) { 279 psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );279 psError( PS_ERR_UNKNOWN,true, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" ); 280 280 return 108; 281 281 } … … 296 296 stat); 297 297 if ( out != NULL ) { 298 psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );298 psError( PS_ERR_UNKNOWN,true, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" ); 299 299 return 109; 300 300 } … … 314 314 stat); 315 315 if ( out != NULL ) { 316 psError( __func__, "Mask size different than image size didn't return NULL as expected" );316 psError( PS_ERR_UNKNOWN,true, "Mask size different than image size didn't return NULL as expected" ); 317 317 return 110; 318 318 } … … 330 330 stat); 331 331 if ( out != NULL ) { 332 psError( __func__, "Mask invalid type didn't return NULL as expected.");332 psError( PS_ERR_UNKNOWN,true, "Mask invalid type didn't return NULL as expected."); 333 333 return 111; 334 334 } … … 345 345 stat); 346 346 if ( out != NULL ) { 347 psError( __func__, "Input image with invalid type didn't return NULL as expected.");347 psError( PS_ERR_UNKNOWN,true, "Input image with invalid type didn't return NULL as expected."); 348 348 return 112; 349 349 } … … 390 390 391 391 if (subset2->numCols != c/2 || subset2->numRows != r/2) { 392 psError( __func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",392 psError(PS_ERR_UNKNOWN,true,"psImageSubset output size was not proper(%dx%d, should be %dx%d).", 393 393 subset2->numCols, subset2->numRows, c/2,r/2); 394 394 return 1; … … 396 396 397 397 if (subset3->numCols != c/2 || subset3->numRows != r/2) { 398 psError( __func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",398 psError(PS_ERR_UNKNOWN,true,"psImageSubset output size was not proper(%dx%d, should be %dx%d).", 399 399 subset3->numCols, subset3->numRows, c/2,r/2); 400 400 return 2; … … 407 407 for (psS32 col=0;col<c/2;col++) { 408 408 if (subset2->data.U32[row][col] != original->data.U32[row+r/4][col+c/4]) { 409 psError( __func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",409 psError(PS_ERR_UNKNOWN,true,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).", 410 410 row,col,subset2->data.U32[row][col], original->data.U32[row+r/4][col+c/4]); 411 411 return 3; 412 412 } 413 413 if (subset3->data.U32[row][col] != original->data.U32[row][col]) { 414 psError( __func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",414 psError(PS_ERR_UNKNOWN,true,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).", 415 415 row,col,subset2->data.U32[row][col], original->data.U32[row][col]); 416 416 return 4; … … 423 423 424 424 if (subset2->type.type != PS_TYPE_U32) { 425 psError( __func__,"psImageSubset output type was not proper(%d, should be %d).",425 psError(PS_ERR_UNKNOWN,true,"psImageSubset output type was not proper(%d, should be %d).", 426 426 subset2->type.type, PS_TYPE_U32); 427 427 return 6; 428 428 } 429 429 if (subset3->type.type != PS_TYPE_U32) { 430 psError( __func__,"psImageSubset output type was not proper(%d, should be %d).",430 psError(PS_ERR_UNKNOWN,true,"psImageSubset output type was not proper(%d, should be %d).", 431 431 subset3->type.type, PS_TYPE_U32); 432 432 return 7; … … 437 437 438 438 if (subset2->col0 != c/4 || subset2->row0 != r/4) { 439 psError( __func__,"psImageSubset didn't set col0/row0 for subset2 (%d/%d, should be %d/%d).",439 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set col0/row0 for subset2 (%d/%d, should be %d/%d).", 440 440 subset2->col0,subset2->row0,c/4,r/4); 441 441 return 8; 442 442 } 443 443 if (subset3->col0 != 0 || subset3->row0 != 0) { 444 psError( __func__,"psImageSubset didn't set col0/row0 for subset3 (%d/%d, should be %d/%d).",444 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set col0/row0 for subset3 (%d/%d, should be %d/%d).", 445 445 subset3->col0,subset3->row0,0,0); 446 446 return 9; … … 451 451 452 452 if (subset2->parent != original || subset3->parent != original) { 453 psError( __func__,"psImageSubset didn't set parent.");453 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set parent."); 454 454 return 10; 455 455 } … … 458 458 459 459 if (subset2->children != NULL || subset3->children != NULL) { 460 psError( __func__,"psImageSubset didn't set children to NULL.");460 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set children to NULL."); 461 461 return 11; 462 462 } … … 467 467 468 468 if (original->children == NULL || original->children->n != 2) { 469 psError( __func__,"psImageSubset didn't increment number of children by one per subset.");469 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't increment number of children by one per subset."); 470 470 return 12; 471 471 } 472 472 if (original->children->data[0] != subset2 || original->children->data[1] != subset3) { 473 psError( __func__,"psImageSubset didn't properly store the children pointers.");473 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't properly store the children pointers."); 474 474 return 13; 475 475 } … … 482 482 subset1 = psImageSubset(NULL,0,0,c/2,r/2); 483 483 if (subset1 != NULL) { 484 psError( __func__,"psImageSubset didn't return NULL when input image was NULL.");484 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when input image was NULL."); 485 485 return 14; 486 486 } … … 494 494 subset1 = psImageSubset(original,0,r/2,c/2,r/2); 495 495 if (subset1 != NULL) { 496 psError( __func__,"psImageSubset didn't return NULL when numRows=0.");496 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when numRows=0."); 497 497 return 15; 498 498 } … … 500 500 subset1 = psImageSubset(original,c/2,0,c/2,r/2); 501 501 if (subset1 != NULL) { 502 psError( __func__,"psImageSubset didn't return NULL when numCols=0.");502 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when numCols=0."); 503 503 return 16; 504 504 } 505 505 if (memcmp(original,&preSubsetStruct,sizeof(psImage)) != 0) { 506 psError( __func__,"psImageSubset changed the original struct though it failed to subset.");506 psError(PS_ERR_UNKNOWN,true,"psImageSubset changed the original struct though it failed to subset."); 507 507 return 17; 508 508 } … … 516 516 subset1 = psImageSubset(original,0,0,c/2,r*2); 517 517 if (subset1 != NULL) { 518 psError( __func__,"psImageSubset didn't return NULL when subset origin was outside of "518 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of " 519 519 "image (via cols)."); 520 520 return 18; … … 523 523 subset1 = psImageSubset(original,0,0,c*2,r/2); 524 524 if (subset1 != NULL) { 525 psError( __func__,"psImageSubset didn't return NULL when subset origin was outside of "525 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of " 526 526 "image (via rows)."); 527 527 return 19; … … 530 530 subset1 = psImageSubset(original,-1,0,c/2,r/2); 531 531 if (subset1 != NULL) { 532 psError( __func__,"psImageSubset didn't return NULL when subset origin was outside of "532 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of " 533 533 "image (col0=-1)."); 534 534 return 20; … … 537 537 subset1 = psImageSubset(original,0,-1,c/2,r/2); 538 538 if (subset1 != NULL) { 539 psError( __func__,"psImageSubset didn't return NULL when subset origin was outside of "539 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of " 540 540 "image (row0=-1)."); 541 541 return 21; … … 550 550 subset1 = psImageSubset(original,0,0,c/2,r+1); 551 551 if (subset1 != NULL) { 552 psError( __func__,"psImageSubset didn't return NULL when subset was outside of image (via rows).");552 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via rows)."); 553 553 return 22; 554 554 } … … 556 556 subset1 = psImageSubset(original,0,0,c+1,r/2); 557 557 if (subset1 != NULL) { 558 psError( __func__,"psImageSubset didn't return NULL when subset was outside of image (via cols).");558 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via cols)."); 559 559 return 23; 560 560 } … … 562 562 subset1 = psImageSubset(original,0,0,c+1,r+1); 563 563 if (subset1 != NULL) { 564 psError( __func__,"psImageSubset didn't return NULL when subset was outside of image (via row+cols).");564 psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via row+cols)."); 565 565 return 24; 566 566 } … … 575 575 // Verify the returned psImage structure member Nchildren is set to zero. 576 576 if (original->children != NULL && original->children->n > 0) { 577 psError( __func__,"psImageFreeChildren didn't set number of children to zero.");577 psError(PS_ERR_UNKNOWN,true,"psImageFreeChildren didn't set number of children to zero."); 578 578 return 25; 579 579 } … … 586 586 preSubsetStruct.col0 != original->col0) { 587 587 588 psError( __func__,"psImageFreeChildren modified parent's non-children elements.");588 psError(PS_ERR_UNKNOWN,true,"psImageFreeChildren modified parent's non-children elements."); 589 589 return 27; 590 590 } … … 626 626 627 627 if (subset == NULL) { 628 psError( __func__,"psImageSubsection returned a NULL with a subset of %s.",628 psError(PS_ERR_UNKNOWN,true,"psImageSubsection returned a NULL with a subset of %s.", 629 629 sectionStr); 630 630 return 10*i+1; … … 632 632 633 633 if (subset->type.type != PS_TYPE_U32) { 634 psError( __func__,"psImageSubsection output type was not proper(%d, should be %d).",634 psError(PS_ERR_UNKNOWN,true,"psImageSubsection output type was not proper(%d, should be %d).", 635 635 subset->type.type, PS_TYPE_U32); 636 636 return 10*i+2; … … 638 638 639 639 if (subset->col0 != x1[i] || subset->row0 != y1[i]) { 640 psError( __func__,"psImageSubsection didn't set properly col0/row0 (%d/%d, should be %d/%d).",640 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't set properly col0/row0 (%d/%d, should be %d/%d).", 641 641 subset->col0,subset->row0,x1[i],y1[i]); 642 642 return 10*i+3; … … 644 644 645 645 if (subset->parent != original) { 646 psError( __func__,"psImageSubsection didn't set parent.");646 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't set parent."); 647 647 return 10*i+4; 648 648 } 649 649 650 650 if (subset->children != NULL) { 651 psError( __func__,"psImageSubsection didn't set children to NULL.");651 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't set children to NULL."); 652 652 return 10*i+5; 653 653 } 654 654 655 655 if (original->children == NULL || original->children->n != i+1) { 656 psError( __func__,"psImageSubsection didn't increment number of children by one per subset.");656 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't increment number of children by one per subset."); 657 657 return 10*i+6; 658 658 } … … 660 660 661 661 if (original->children->data[i] != subset) { 662 psError( __func__,"psImageSubsection didn't properly store the children pointer.");662 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't properly store the children pointer."); 663 663 return 10*i+7; 664 664 } … … 667 667 psS32 numRows = y2[i]-y1[i]+1; 668 668 if (subset->numCols != numCols || subset->numRows != numRows) { 669 psError( __func__,"psImageSubsection output size was not proper(%dx%d, should be %dx%d).",669 psError(PS_ERR_UNKNOWN,true,"psImageSubsection output size was not proper(%dx%d, should be %dx%d).", 670 670 subset->numCols, subset->numRows, numCols, numRows); 671 671 return 10*i+8; … … 675 675 for (psS32 col=0;col<numCols;col++) { 676 676 if (subset->data.U32[row][col] != original->data.U32[row+y1[i]][col+x1[i]]) { 677 psError( __func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",677 psError(PS_ERR_UNKNOWN,true,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).", 678 678 row,col,subset->data.U32[row][col], original->data.U32[row+y1[i]][col+x1[i]]); 679 679 return 10*i+9; … … 686 686 subset = psImageSubsection(original,"[64:32,32:64]"); 687 687 if (subset != NULL) { 688 psError( __func__,"psImageSubsection didn't return NULL when x1 > x2.");688 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't return NULL when x1 > x2."); 689 689 return 10*i+10; 690 690 } … … 693 693 subset = psImageSubsection(original,"[32:64,64:32]"); 694 694 if (subset != NULL) { 695 psError( __func__,"psImageSubsection didn't return NULL when y1 > y2.");695 psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't return NULL when y1 > y2."); 696 696 return 10*i+11; 697 697 } … … 700 700 subset = psImageSubsection(original,"[64:256,32:64]"); // assumes c<256 701 701 if (subset != NULL) { 702 psError( __func__,"psImageSubsection didn't return NULL when x2 > c.");702 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when x2 > c."); 703 703 return 10*i+12; 704 704 } … … 707 707 subset = psImageSubsection(original,"[32:64,64:256]"); // assumes r==256 708 708 if (subset != NULL) { 709 psError( __func__,"psImageSubsection didn't return NULL when y2 > r.");709 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when y2 > r."); 710 710 return 10*i+13; 711 711 } … … 714 714 subset = psImageSubsection(original,"32:64,32:64"); 715 715 if (subset != NULL) { 716 psError( __func__,"psImageSubsection didn't return NULL when subsection was '32:64,32:64'.");716 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was '32:64,32:64'."); 717 717 return 10*i+14; 718 718 } … … 721 721 subset = psImageSubsection(original,"[32-64,32-64]"); 722 722 if (subset != NULL) { 723 psError( __func__,"psImageSubsection didn't return NULL when subsection was '[32-64,32-64]'.");723 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was '[32-64,32-64]'."); 724 724 return 10*i+15; 725 725 } … … 728 728 subset = psImageSubsection(original,"[32:64,32]"); 729 729 if (subset != NULL) { 730 psError( __func__,"psImageSubsection didn't return NULL when subsection was '[32:64,32]'.");730 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was '[32:64,32]'."); 731 731 return 10*i+16; 732 732 } … … 735 735 subset = psImageSubsection(NULL,"[32:64,32:64]"); 736 736 if (subset != NULL) { 737 psError( __func__,"psImageSubsection didn't return NULL when image was NULL.");737 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when image was NULL."); 738 738 return 10*i+17; 739 739 } … … 742 742 subset = psImageSubsection(original,NULL); 743 743 if (subset != NULL) { 744 psError( __func__,"psImageSubsection didn't return NULL when subsection was NULL.");744 psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was NULL."); 745 745 return 10*i+18; 746 746 } -
trunk/psLib/test/image/tst_psImageFFT.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.13 $ $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 … … 85 85 img2 = psImageFFT(img2,img,PS_FFT_FORWARD); 86 86 if (img2->type.type != PS_TYPE_C32) { 87 psError( __func__,"FFT didn't produce complex values?");87 psError(PS_ERR_UNKNOWN, true,"FFT didn't produce complex values?"); 88 88 return 1; 89 89 } 90 90 if (img2->numCols != m || img2->numRows != n) { 91 psError( __func__,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).",91 psError(PS_ERR_UNKNOWN, true,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).", 92 92 img2->numCols,img2->numRows,m,n); 93 93 return 2; … … 103 103 if (! (col == 0 && (row == 1 || row == n-1)) 104 104 && ! (row == 0 && (col==1 || col == n-1)) ) { 105 psError( __func__,"Result invalid at %d,%d (%.2f)",col,row,mag);105 psError(PS_ERR_UNKNOWN, true,"Result invalid at %d,%d (%.2f)",col,row,mag); 106 106 return 3; 107 107 } … … 109 109 if ( (col == 0 && (row == 1 || row == n-1)) 110 110 || (row == 0 && (col==1 || col == n-1)) ) { 111 psError( __func__,"Result invalid at %d,%d (%.2f)",col,row,mag);111 psError(PS_ERR_UNKNOWN, true,"Result invalid at %d,%d (%.2f)",col,row,mag); 112 112 return 4; 113 113 } … … 120 120 121 121 if (img3->type.type != PS_TYPE_C32) { 122 psError( __func__,"FFT didn't produce complex values?");122 psError(PS_ERR_UNKNOWN, true,"FFT didn't produce complex values?"); 123 123 return 5; 124 124 } 125 125 126 126 if (img3->numCols != m || img3->numRows != n) { 127 psError( __func__,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).",127 psError(PS_ERR_UNKNOWN, true,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).", 128 128 img3->numCols,img3->numRows,m,n); 129 129 return 6; … … 136 136 psF32 pixel = creal(img3Row[col])/m/n; 137 137 if (fabsf(pixel-imgRow[col]) > 0.1) { 138 psError( __func__,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)",138 psError(PS_ERR_UNKNOWN, true,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)", 139 139 col,row,pixel,imgRow[col]); 140 140 return 7; … … 149 149 char* typeStr; 150 150 PS_TYPE_NAME(typeStr,img3->type.type) 151 psError( __func__,"FFT asked to make real result, but I got a %s type image?",typeStr);151 psError(PS_ERR_UNKNOWN, true,"FFT asked to make real result, but I got a %s type image?",typeStr); 152 152 return 8; 153 153 } 154 154 155 155 if (img3->numCols != m || img3->numRows != n) { 156 psError( __func__,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).",156 psError(PS_ERR_UNKNOWN, true,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).", 157 157 img3->numCols,img3->numRows,m,n); 158 158 return 9; … … 165 165 psF32 pixel = img3Row[col]/m/n; 166 166 if (fabsf(pixel-imgRow[col]) > 0.1) { 167 psError( __func__,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)",167 psError(PS_ERR_UNKNOWN, true,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)", 168 168 col,row,pixel,imgRow[col]); 169 169 return 10; … … 175 175 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error."); 176 176 if (psImageFFT(NULL,img2,PS_FFT_REVERSE|PS_FFT_FORWARD) != NULL) { 177 psError( __func__,"PS_FFT_REVERSE|PS_FFT_FORWARD option produced something?");177 psError(PS_ERR_UNKNOWN, true,"PS_FFT_REVERSE|PS_FFT_FORWARD option produced something?"); 178 178 return 11; 179 179 } … … 181 181 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error."); 182 182 if (psImageFFT(NULL,img2,PS_FFT_FORWARD|PS_FFT_REAL_RESULT) != NULL) { 183 psError( __func__,"PS_FFT_FORWARD|PS_FFT_REAL_RESULT option produced something?");183 psError(PS_ERR_UNKNOWN, true,"PS_FFT_FORWARD|PS_FFT_REAL_RESULT option produced something?"); 184 184 return 12; 185 185 } … … 188 188 img4 = psImageFFT(NULL,NULL,PS_FFT_FORWARD); 189 189 if (img4 != NULL ) { 190 psError( __func__,"psImageFFT should return null for a null input image.");190 psError(PS_ERR_UNKNOWN, true,"psImageFFT should return null for a null input image."); 191 191 return 10; 192 192 } … … 197 197 img5 = psImageFFT(NULL,img4,PS_FFT_REAL_RESULT); 198 198 if (img5 != NULL) { 199 psError( __func__,"psImageFFT should return null for an invalid FFT direction.");199 psError(PS_ERR_UNKNOWN, true,"psImageFFT should return null for an invalid FFT direction."); 200 200 return 11; 201 201 } … … 229 229 img2 = psImageReal(img2,img); 230 230 if (img2 == NULL) { 231 psError( __func__,"psImageReal returned a NULL?");231 psError(PS_ERR_UNKNOWN, true,"psImageReal returned a NULL?"); 232 232 return 1; 233 233 } 234 234 if (img2->type.type != PS_TYPE_F32) { 235 psError( __func__,"psImageReal returned a wrong type (%d)?",235 psError(PS_ERR_UNKNOWN, true,"psImageReal returned a wrong type (%d)?", 236 236 img2->type.type); 237 237 return 2; … … 240 240 img3 = psImageImaginary(img3,img); 241 241 if (img3 == NULL) { 242 psError( __func__,"psImageImaginary returned a NULL?");242 psError(PS_ERR_UNKNOWN, true,"psImageImaginary returned a NULL?"); 243 243 return 3; 244 244 } 245 245 if (img3->type.type != PS_TYPE_F32) { 246 psError( __func__,"psImageImaginary returned a wrong type (%d)?",246 psError(PS_ERR_UNKNOWN, true,"psImageImaginary returned a wrong type (%d)?", 247 247 img3->type.type); 248 248 return 4; … … 255 255 for (psU32 col=0;col<m;col++) { 256 256 if (fabsf(img2Row[col] - row) > FLT_EPSILON) { 257 psError( __func__,"psImageReal didn't return the real portion at n=%d",257 psError(PS_ERR_UNKNOWN, true,"psImageReal didn't return the real portion at n=%d", 258 258 n); 259 259 return 5; 260 260 } 261 261 if (fabsf(img3Row[col] - col) > FLT_EPSILON) { 262 psError( __func__,"psImageImaginary didn't return the imag portion at n=%d",262 psError(PS_ERR_UNKNOWN, true,"psImageImaginary didn't return the imag portion at n=%d", 263 263 n); 264 264 return 6; … … 307 307 // 3. verify that the result is a psC32 308 308 if (img3->type.type != PS_TYPE_C32) { 309 psError( __func__,"Image Type from psImageComplex is not complex? (%d)",309 psError(PS_ERR_UNKNOWN, true,"Image Type from psImageComplex is not complex? (%d)", 310 310 img3->type.type); 311 311 return 1; … … 319 319 if (fabsf(crealf(img3Row[col]) - row) > FLT_EPSILON || 320 320 fabsf(cimagf(img3Row[col]) - col) > FLT_EPSILON) { 321 psError( __func__,"psImageComplex result is invalid (%d,%d, %.2f+%.2fi)",321 psError(PS_ERR_UNKNOWN, true,"psImageComplex result is invalid (%d,%d, %.2f+%.2fi)", 322 322 col,row,crealf(img3Row[col]),cimagf(img3Row[col])); 323 323 return 2; … … 334 334 // 8. verify that an appropriate error occurred. (this partially has to be done via inspection) 335 335 if (img3 != NULL) { 336 psError( __func__,"psImageComplex returned a image though input types mismatched.");336 psError(PS_ERR_UNKNOWN, true,"psImageComplex returned a image though input types mismatched."); 337 337 return 3; 338 338 } … … 347 347 // 11. verify thet an appropriate error occurred. 348 348 if (img3 != NULL) { 349 psError( __func__,"psImageComplex returned a image though input sizes mismatched.");349 psError(PS_ERR_UNKNOWN, true,"psImageComplex returned a image though input sizes mismatched."); 350 350 return 4; 351 351 } … … 380 380 // 3. verify result is psC32 381 381 if (img2->type.type != PS_TYPE_C32) { 382 psError( __func__,"the psImageConjugate didn't return a C32 image.");382 psError(PS_ERR_UNKNOWN, true,"the psImageConjugate didn't return a C32 image."); 383 383 return 1; 384 384 } … … 390 390 if (fabsf(crealf(img2Row[col]) - row) > FLT_EPSILON || 391 391 fabsf(cimagf(img2Row[col]) + col) > FLT_EPSILON) { 392 psError( __func__,"psImageComplex result is invalid (%d,%d, %.2f+%.2fi)",392 psError(PS_ERR_UNKNOWN, true,"psImageComplex result is invalid (%d,%d, %.2f+%.2fi)", 393 393 col,row,crealf(img2Row[col]),cimagf(img2Row[col])); 394 394 return 2; … … 425 425 // 3. verify result is psF32 426 426 if (img2->type.type != PS_TYPE_F32) { 427 psError( __func__,"the type was not PS_TYPE_F32.");427 psError(PS_ERR_UNKNOWN, true,"the type was not PS_TYPE_F32."); 428 428 return 1; 429 429 } … … 438 438 439 439 if (fabsf(img2Row[col] - power) > 2.0f*FLT_EPSILON) { 440 psError( __func__,"psImagePowerSpectrum result is invalid (%d,%d, %.2f vs %.2f)",440 psError(PS_ERR_UNKNOWN, true,"psImagePowerSpectrum result is invalid (%d,%d, %.2f vs %.2f)", 441 441 col,row,img2Row[col],power); 442 442 return 2; -
trunk/psLib/test/image/tst_psImageIO.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.11 $ $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 … … 97 97 remove(filename); \ 98 98 if (! psImageWriteSection(img3,0,0,1,NULL,0,filename)) { \ 99 psError( __func__,"Failed to write test image %s",filename); \99 psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \ 100 100 return 1; \ 101 101 } \ 102 102 if (! psImageWriteSection(img,0,0,0,NULL,0,filename)) { \ 103 psError( __func__,"Failed to write test image %s",filename); \103 psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \ 104 104 return 2; \ 105 105 } \ 106 106 if (! psImageWriteSection(img,0,0,1,NULL,1,filename)) { \ 107 psError( __func__,"Failed to write test image %s",filename); \107 psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \ 108 108 return 3; \ 109 109 } \ 110 110 if (! psImageWriteSection(img3,0,0,0,NULL,1,filename)) { \ 111 psError( __func__,"Failed to write test image %s",filename); \111 psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \ 112 112 return 4; \ 113 113 } \ … … 119 119 img = psImageReadSection(img,readM0,readN0,readM,readN,0,NULL,0,filename); \ 120 120 /* if (img_ref != img) { */ \ 121 /* psError( __func__,"psImageReadSection didn't recycle the psImage?"); */ \121 /* psError(PS_ERR_UNKNOWN, true,"psImageReadSection didn't recycle the psImage?"); */ \ 122 122 /* return 5; */ \ 123 123 /* } */ \ 124 124 img3 = psImageReadSection(img3,readM0,readN0,readM,readN,1,NULL,0,filename); \ 125 125 if (img3 == NULL) { \ 126 psError( __func__,"Failed to read test image %s",filename); \126 psError(PS_ERR_UNKNOWN, true,"Failed to read test image %s",filename); \ 127 127 return 6; \ 128 128 } \ … … 134 134 for (psU32 col = readM0; col < readM; col++) { \ 135 135 if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \ 136 psError( __func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \136 psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \ 137 137 col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \ 138 138 return 7; \ 139 139 } \ 140 140 if (fabsf(img3Row[col-readM0]-img4Row[col]) > FLT_EPSILON) { \ 141 psError( __func__,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \141 psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \ 142 142 col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \ 143 143 return 8; \ … … 152 152 img = psImageReadSection(img,readM0,readN0,readM,readN,1,NULL,1,filename); \ 153 153 if (img == NULL) { \ 154 psError( __func__,"Failed to read test image %s",filename); \154 psError(PS_ERR_UNKNOWN, true,"Failed to read test image %s",filename); \ 155 155 return 9; \ 156 156 } \ … … 162 162 for (psU32 col = readM0; col < readM; col++) { \ 163 163 if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \ 164 psError( __func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \164 psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \ 165 165 col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \ 166 166 return 10; \ 167 167 } \ 168 168 if (fabsf(img3Row[col-readM0]-img4Row[col]) > FLT_EPSILON) { \ 169 psError( __func__,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \169 psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \ 170 170 col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \ 171 171 return 11; \ … … 204 204 image = psImageReadSection(image,0,0,M,N,0,NULL,0,"foobar.fits"); 205 205 if (image != NULL) { 206 psError( __func__,"Image returned though filename did not exist.");206 psError(PS_ERR_UNKNOWN, true,"Image returned though filename did not exist."); 207 207 return 12; 208 208 } … … 220 220 image = psImageReadSection(image,0,0,M,N,0,NULL,0,NULL); 221 221 if (image != NULL) { 222 psError( __func__,"Image returned though filename was NULL.");222 psError(PS_ERR_UNKNOWN, true,"Image returned though filename was NULL."); 223 223 return 13; 224 224 } … … 233 233 image = psImageReadSection(image,0,0,M,N,0,NULL,4,"tmpImages/MxN_F32.fits"); 234 234 if (image != NULL) { 235 psError( __func__,"Image returned though extnum was invalid.");235 psError(PS_ERR_UNKNOWN, true,"Image returned though extnum was invalid."); 236 236 return 14; 237 237 } … … 239 239 image = psImageReadSection(image,0,0,M,N,0,"bogus",0,"tmpImages/MxN_F32.fits"); 240 240 if (image != NULL) { 241 psError( __func__,"Image returned though extnum was invalid.");241 psError(PS_ERR_UNKNOWN, true,"Image returned though extnum was invalid."); 242 242 return 15; 243 243 } … … 302 302 ; 303 303 if (! psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeTest.fits")) { 304 psError( __func__,"Couldn't write writeTest.fits.");304 psError(PS_ERR_UNKNOWN, true,"Couldn't write writeTest.fits."); 305 305 return 14; 306 306 } 307 307 if (! psImageWriteSection(img2,0,0,0,NULL,0,"tmpImages/writeTest.fits")) { 308 psError( __func__,"Couldn't overwrite writeTest.fits.");308 psError(PS_ERR_UNKNOWN, true,"Couldn't overwrite writeTest.fits."); 309 309 return 15; 310 310 } … … 315 315 img = psImageReadSection(NULL,0,0,m,n,0,NULL,0,"tmpImages/writeTest.fits"); 316 316 if (img == NULL) { 317 psError( __func__,"Could not read in writeTest.fits.");317 psError(PS_ERR_UNKNOWN, true,"Could not read in writeTest.fits."); 318 318 return 16; 319 319 } … … 322 322 for (psU32 col=0;col<m;col++) { 323 323 if (fabsf(imgRow[col] - (row+2*col)) > FLT_EPSILON) { 324 psError( __func__,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",324 psError(PS_ERR_UNKNOWN, true,"The image values were not overwritten at %d,%d (%.2f vs %.2f)", 325 325 col,row,imgRow[col],(row+2*col)); 326 326 return 17; … … 337 337 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message because input image is null."); 338 338 if ( psImageWriteSection(NULL,0,0,0,NULL,0,"tmpImages/writeTest.fits")) { 339 psError( __func__,"psImageWriteSection did not return false when input image is NULL.");339 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image is NULL."); 340 340 return 20; 341 341 } … … 347 347 GENIMAGE(img,32,32,S8,row+2*col); 348 348 if ( psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeTest.fits")) { 349 psError( __func__,"psImageWriteSection did not return false when input image type invalid.");349 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image type invalid."); 350 350 return 21; 351 351 } … … 358 358 GENIMAGE(img,32,32,U8,row+2*col); 359 359 if ( psImageWriteSection(img,0,0,0,NULL,0,"panstarrs/writeFits.fits")) { 360 psError( __func__,"psImageWriteSection did not return false for invalid path name.");360 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid path name."); 361 361 return 22; 362 362 } … … 370 370 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for passing invalid FITS file."); 371 371 if ( psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeInvalidFile.fits")) { 372 psError( __func__,"psImageWriteSection did not return false for invalid FITS file.");372 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid FITS file."); 373 373 return 22; 374 374 } … … 381 381 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid extension name."); 382 382 if ( psImageWriteSection(img,0,0,0,"ext2",0,"tmpImages/writeTest.fits")) { 383 psError( __func__,"psImageWriteSection did not return false for invalid extension name.");383 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid extension name."); 384 384 return 23; 385 385 } … … 390 390 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid extension number."); 391 391 if ( psImageWriteSection(img,0,0,0,NULL,99,"tmpImages/writeTest.fits")) { 392 psError( __func__,"psImageWriteSection did not return false for invalid extension number.");392 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid extension number."); 393 393 return 24; 394 394 } -
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.
