IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2004, 12:34:06 PM (22 years ago)
Author:
desonia
Message:

astyle fixed?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageStats02.c

    r1365 r1406  
    44   thouroughly tested elsewhere, we will only test psImageStats() with
    55   the PS_STAT_SAMPLE_MEAN here.
    6 
     6 
    77   NOTE: After you debug, set CHEBY_X_DIM != CHEBY_Y_DIM.
    88   Also, uses non-square images.
     
    3232    int rc = 0;
    3333    int currentId = 0;
    34    
     34
    3535    currentId = psMemGetId();
    3636    /*************************************************************************/
     
    4040    outImage = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32 );
    4141    for ( i = 0;i < IMAGE_SIZE;i++ ) {
    42             for ( j = 0;j < IMAGE_SIZE;j++ ) {
    43                     tmpImage->data.F32[ i ][ j ] = 4.0;
    44                     tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
    45                     tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i );
    46                     outImage->data.F32[ i ][ j ] = 0.0;
    47                 }
     42        for ( j = 0;j < IMAGE_SIZE;j++ ) {
     43            tmpImage->data.F32[ i ][ j ] = 4.0;
     44            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
     45            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i );
     46            outImage->data.F32[ i ][ j ] = 0.0;
    4847        }
     48    }
    4949    my2DPoly = psPolynomial2DAlloc( CHEBY_X_DIM, CHEBY_Y_DIM );
    5050    /*************************************************************************/
     
    5454                             "psImageStats functions",
    5555                             "Calculate Chebyshev Polynomials, no mask" );
    56                              
     56
    5757    my2DPoly = psImageFitPolynomial( tmpImage, my2DPoly );
    5858    for ( i = 0;i < CHEBY_X_DIM;i++ ) {
    59             for ( j = 0;j < CHEBY_Y_DIM;j++ ) {
    60                     printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, my2DPoly->coeff[ i ][ j ] );
    61                 }
     59        for ( j = 0;j < CHEBY_Y_DIM;j++ ) {
     60            printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, my2DPoly->coeff[ i ][ j ] );
    6261        }
    63        
     62    }
     63
    6464    psMemCheckCorruption( 1 );
    6565    printFooter( stdout,
     
    7373                             "psImageStats functions",
    7474                             "Calculate Chebyshev Polynomials, no mask" );
    75                              
     75
    7676    rc = psImageEvalPolynomial( outImage, my2DPoly );
    7777    for ( i = 0;i < IMAGE_SIZE;i++ ) {
    78             for ( j = 0;j < IMAGE_SIZE;j++ ) {
    79            
    80                     //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
    81                     //                     tmpImage->data.F32[i][j],
    82                     //                     outImage->data.F32[i][j]);
    83                     if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) {
    84                             printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j,
    85                                     outImage->data.F32[ i ][ j ],
    86                                     tmpImage->data.F32[ i ][ j ] );
    87                         }
    88                        
    89                 }
     78        for ( j = 0;j < IMAGE_SIZE;j++ ) {
     79
     80            //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
     81            //                     tmpImage->data.F32[i][j],
     82            //                     outImage->data.F32[i][j]);
     83            if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) {
     84                printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j,
     85                        outImage->data.F32[ i ][ j ],
     86                        tmpImage->data.F32[ i ][ j ] );
     87            }
     88
    9089        }
    91        
     90    }
     91
    9292    psMemCheckCorruption( 1 );
    9393    printFooter( stdout,
     
    9595                 "Calculate Chebyshev Polynomials, no mask",
    9696                 testStatus );
    97                  
     97
    9898    /*************************************************************************/
    9999    /*  Deallocate data structures                                   */
     
    106106    psFree( outImage );
    107107    psFree( my2DPoly );
    108    
     108
    109109    psMemCheckCorruption( 1 );
    110110    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    111111    if ( 0 != memLeaks ) {
    112             psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    113         }
    114        
     112        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     113    }
     114
    115115    printFooter( stdout,
    116116                 "psImageStats functions",
    117117                 "Deallocate the psStats/psImage structure.",
    118118                 testStatus );
    119                  
     119
    120120    return ( !testStatus );
    121121}
Note: See TracChangeset for help on using the changeset viewer.