IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 28, 2004, 3:10:27 PM (22 years ago)
Author:
desonia
Message:

fixed psImageSlice to match current SDR specifications (image range
specified differently).

File:
1 edited

Legend:

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

    r1797 r1924  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-09-11 02:55:29 $
     8*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-09-29 01:10:27 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2020
    2121testDescription tests[] = {
    22                               {
    23                                   testImageSlice, 552, "psImageSlice", 0, false
    24                               },
    25                               {
    26                                   NULL
    27                               }
     22                              {testImageSlice, 552, "psImageSlice", 0, false},
     23                              {NULL}
    2824                          };
    2925
     
    7268
    7369    #define PSIMAGESLICE_TEST1(M,N,DIRECTION,TRUTH_SIZE,TRUTHPIX_X,TRUTHPIX_Y,TESTNUM) \
    74     out = psImageSlice(out,positions,image,mask,1,c/10,r/10,M,N,DIRECTION,stat); \
     70    out = psImageSlice(out,positions,image,mask,1,c/10,r/10,c/10+M,r/10+N,DIRECTION,stat); \
    7571    \
    7672    if (out->n != TRUTH_SIZE) { \
     
    136132    */
    137133    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    138     out = psImageSlice( out, NULL, NULL, NULL, 0, c / 10, r / 10, 1, 1, PS_CUT_X_POS, stat );
     134    out = psImageSlice( out,
     135                        NULL, NULL,
     136                        NULL, 0,
     137                        c/10, r/10,
     138                        c/10 + 1, r/10 + 1,
     139                        PS_CUT_X_POS,
     140                        stat );
    139141    if ( out != NULL ) {
    140142        psError( __func__, "Giving a NULL image, psImageSlice didn't return NULL as expected" );
     
    148150    */
    149151    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    150     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, 1, PS_CUT_X_POS, NULL );
     152    out = psImageSlice( out,
     153                        NULL, image,
     154                        mask, 1,
     155                        c/10, r/10,
     156                        c/10 + 1,
     157                        r/10 + 1,
     158                        PS_CUT_X_POS,
     159                        NULL );
    151160    if ( out != NULL ) {
    152161        psError( __func__, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" );
     
    161170    */
    162171    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    163     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, 1, 5, stat );
     172    out = psImageSlice( out, NULL,
     173                        image,
     174                        mask, 1,
     175                        c/10, r/10,
     176                        c/10+1, r/10+1,
     177                        5,
     178                        stat);
    164179    if ( out != NULL ) {
    165180        psError( __func__, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" );
     
    172187    */
    173188    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    174     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 0, 0, PS_CUT_X_POS, stat );
     189    out = psImageSlice( out,
     190                        NULL,
     191                        image,
     192                        mask, 1,
     193                        c/10, r/10,
     194                        c/10, r/10,
     195                        PS_CUT_X_POS,
     196                        stat );
    175197    if ( out != NULL ) {
    176198        psError( __func__, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" );
     
    184206    */
    185207    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    186     out = psImageSlice( out, NULL, image, mask, 1, c + 1, r / 10, 1, 1, PS_CUT_X_POS, stat );
     208    out = psImageSlice( out, NULL,
     209                        image,
     210                        mask, 1,
     211                        c+1, r/10,
     212                        c+2, r/10+10,
     213                        PS_CUT_X_POS,
     214                        stat );
    187215    if ( out != NULL ) {
    188216        psError( __func__, "Giving an invalid x position, psImageSlice didn't return NULL as expected" );
     
    191219
    192220    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    193     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r + 1, 1, 1, PS_CUT_X_POS, stat );
     221    out = psImageSlice( out, NULL,
     222                        image,
     223                        mask, 1,
     224                        c/10, r+1,
     225                        c/10+1,r+5,
     226                        PS_CUT_X_POS,
     227                        stat );
    194228    if ( out != NULL ) {
    195229        psError( __func__, "Giving an invalid y position, psImageSlice didn't return NULL as expected" );
     
    198232
    199233    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    200     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, c, 1, PS_CUT_X_POS, stat );
     234    out = psImageSlice( out, NULL,
     235                        image,
     236                        mask, 1,
     237                        c/10, r/10,
     238                        c+1, r/10+1,
     239                        PS_CUT_X_POS,
     240                        stat);
    201241    if ( out != NULL ) {
    202242        psError( __func__, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" );
     
    205245
    206246    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    207     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, r, PS_CUT_X_POS, stat );
     247    out = psImageSlice( out, NULL,
     248                        image,
     249                        mask, 1,
     250                        c/10, r/10,
     251                        c/10+1, r + 1,
     252                        PS_CUT_X_POS,
     253                        stat);
    208254    if ( out != NULL ) {
    209255        psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
     
    218264    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
    219265    stat->options = 0;
    220     out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, 1, PS_CUT_X_POS, stat );
     266    out = psImageSlice( out, NULL,
     267                        image,
     268                        mask, 1,
     269                        c/10, r/10,
     270                        c/10+1, r/10+1,
     271                        PS_CUT_X_POS,
     272                        stat);
    221273    if ( out != NULL ) {
    222274        psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
Note: See TracChangeset for help on using the changeset viewer.