Changeset 13123 for trunk/psLib/test/imageops/tap_psImageStats.c
- Timestamp:
- May 1, 2007, 6:14:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/imageops/tap_psImageStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tap_psImageStats.c
r11729 r13123 273 273 const int CHEBY_Y_DIM = 8; 274 274 const int THRESHOLD = 1; 275 psImage *imgIn = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32);276 psImage *imgOut = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32);277 for (int i = 0;i < IMAGE_SIZE;i++ ) {278 for (int j = 0;j < IMAGE_SIZE;j++ ) {275 psImage *imgIn = psImageAlloc(IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32); 276 psImage *imgOut = psImageAlloc(IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32); 277 for (int i = 0;i < IMAGE_SIZE;i++) { 278 for (int j = 0;j < IMAGE_SIZE;j++) { 279 279 imgIn->data.F32[ i ][ j ] = 4.0; 280 imgIn->data.F32[ i ][ j ] = ( float ) ( i + j);281 imgIn->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i);280 imgIn->data.F32[ i ][ j ] = (float) (i + j); 281 imgIn->data.F32[ i ][ j ] = (float) (i + j) + (4.0 * (float) i); 282 282 imgOut->data.F32[ i ][ j ] = 0.0; 283 283 } 284 284 } 285 285 psPolynomial2D *my2DPoly = psPolynomial2DAlloc(PS_POLYNOMIAL_CHEB, CHEBY_X_DIM-1, CHEBY_Y_DIM-1); 286 my2DPoly = psImageFitPolynomial(my2DPoly, imgIn );286 my2DPoly = psImageFitPolynomial(my2DPoly, imgIn); 287 287 ok(my2DPoly != NULL, "psImageFitPolynomial() returned non-NULL"); 288 288 289 imgOut = psImageEvalPolynomial( imgOut, my2DPoly);289 imgOut = psImageEvalPolynomial(imgOut, my2DPoly); 290 290 bool errorFlag = false; 291 for (int i = 0;i < IMAGE_SIZE;i++ ) {292 for (int j = 0;j < IMAGE_SIZE;j++ ) {293 if ( fabs( imgOut->data.F32[ i ][ j ] - imgIn->data.F32[ i ][ j ] ) > THRESHOLD) {291 for (int i = 0;i < IMAGE_SIZE;i++) { 292 for (int j = 0;j < IMAGE_SIZE;j++) { 293 if (fabs(imgOut->data.F32[ i ][ j ] - imgIn->data.F32[ i ][ j ]) > THRESHOLD) { 294 294 diag("Pixel (%d, %d) is %.2f, should be %.2f\n", i, j, 295 295 imgOut->data.F32[ i ][ j ], … … 357 357 ok(hist2 == hist, "psImageHistogram() correctly recycled the input psHistogram"); 358 358 bool errorFlag = false; 359 for (int i = 0;i < numBins;i++ ) {359 for (int i = 0;i < numBins;i++) { 360 360 if (hist2->nums->data.F32[i] != (numCols * (numRows/numBins))) { 361 361 diag("ERROR: Bin number %d bounds: (%.1f - %.1f) data (%.2f)\n", i, … … 434 434 } 435 435 436 // Ensure psImageCountPixelMask returns -1 for NULL input image436 // Ensure psImageCountPixelMask returns -1 for wrong input image type 437 437 // Following should generate error 438 438 // XXX: Verify error … … 486 486 // -------------------------------------------------------------- 487 487 // psImageStats() 488 // Ensure psImageStats() return es NULL for NULL input image488 // Ensure psImageStats() returns NULL for NULL input image 489 489 // Following should generate error 490 490 // XXX: Verify error … … 499 499 } 500 500 501 // Ensure psImageStats() return es NULL for NULL psStats501 // Ensure psImageStats() returns NULL for NULL psStats 502 502 // Following should generate error 503 503 // XXX: Verify error
Note:
See TracChangeset
for help on using the changeset viewer.
