IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 5, 2005, 4:41:07 PM (21 years ago)
Author:
drobbin
Message:

Created ImageMaskOps file. started ImageGrowMask fxn.

Location:
trunk/psLib/test/imageops
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/Makefile.am

    r4981 r5227  
    1111        tst_psImagePixelManip \
    1212        tst_psImageStats \
    13         tst_psImageStructManip
     13        tst_psImageStructManip \
     14    tst_psImageMaskOps
    1415
    1516tst_psImageConvolve_SOURCES =  tst_psImageConvolve.c
     
    2021tst_psImageStats_SOURCES =  tst_psImageStats.c
    2122tst_psImageStructManip_SOURCES =  tst_psImageStructManip.c
     23tst_psImageMaskOps_SOURCES = tst_psImageMaskOps.c
    2224
    2325check_DATA =
  • trunk/psLib/test/imageops/tst_psImagePixelManip.c

    r5224 r5227  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-10-05 03:51:43 $
     8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-10-06 02:41:07 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2929static psS32 testImageClipComplexRegion(void);
    3030static psS32 testImageOverlay(void);
    31 static psS32 testImageKeepMask(void);
    3231
    3332testDescription tests[] = {
     
    3635                              {testImageClipComplexRegion,673,"psImageClipComplexRegion",0,false},
    3736                              {testImageOverlay,573,"psImageOverlay",0,false},
    38                               {testImageKeepMask,574,"psImageKeep and Mask",0,false},
    3937                              {NULL}
    4038                          };
     
    798796    return 0;
    799797}
    800 
    801 psS32 testImageKeepMask(void)
    802 {
    803     //psImageMaskRegion
    804     //psImageKeepRegion
    805     //psImageMaskCircle
    806     //psImageKeepCircle
    807     psImage *in = psImageAlloc(3,3,PS_TYPE_MASK);
    808     psRegion reg;
    809     reg.x0 = 0;
    810     reg.x1 = 1;
    811     reg.y0 = 0;
    812     reg.y1 = 1;
    813     psMaskType mask = 2;
    814     in->data.PS_TYPE_MASK_DATA[0][0] = 2;
    815     in->data.PS_TYPE_MASK_DATA[0][1] = 0;
    816     in->data.PS_TYPE_MASK_DATA[0][2] = 1;
    817     in->data.PS_TYPE_MASK_DATA[1][0] = 4;
    818     in->data.PS_TYPE_MASK_DATA[1][1] = 0;
    819     in->data.PS_TYPE_MASK_DATA[1][2] = 3;
    820     in->data.PS_TYPE_MASK_DATA[2][0] = 2;
    821     in->data.PS_TYPE_MASK_DATA[2][1] = 1;
    822     in->data.PS_TYPE_MASK_DATA[2][2] = 2;
    823 
    824     printf("\n Mask Region------");
    825     psImageMaskRegion(in, reg, "|", mask);
    826     for(int i = 0; i < 3; i++) {
    827         for (int j = 0; j < 3; j++) {
    828             printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
    829         }
    830     }
    831 
    832     in->data.PS_TYPE_MASK_DATA[0][0] = 2;
    833     in->data.PS_TYPE_MASK_DATA[0][1] = 0;
    834     in->data.PS_TYPE_MASK_DATA[0][2] = 1;
    835     in->data.PS_TYPE_MASK_DATA[1][0] = 4;
    836     in->data.PS_TYPE_MASK_DATA[1][1] = 0;
    837     in->data.PS_TYPE_MASK_DATA[1][2] = 3;
    838     in->data.PS_TYPE_MASK_DATA[2][0] = 2;
    839     in->data.PS_TYPE_MASK_DATA[2][1] = 1;
    840     in->data.PS_TYPE_MASK_DATA[2][2] = 2;
    841     psImageKeepRegion(in, reg, "AND", mask);
    842     printf("\n Keep Region------");
    843     for(int i = 0; i < 3; i++) {
    844         for (int j = 0; j < 3; j++) {
    845             printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
    846         }
    847     }
    848 
    849     //Mask Circle and Keep Circle Functions
    850     in->data.PS_TYPE_MASK_DATA[0][0] = 2;
    851     in->data.PS_TYPE_MASK_DATA[0][1] = 0;
    852     in->data.PS_TYPE_MASK_DATA[0][2] = 1;
    853     in->data.PS_TYPE_MASK_DATA[1][0] = 4;
    854     in->data.PS_TYPE_MASK_DATA[1][1] = 0;
    855     in->data.PS_TYPE_MASK_DATA[1][2] = 3;
    856     in->data.PS_TYPE_MASK_DATA[2][0] = 2;
    857     in->data.PS_TYPE_MASK_DATA[2][1] = 1;
    858     in->data.PS_TYPE_MASK_DATA[2][2] = 2;
    859     psImageMaskCircle(in, 1, 1, 1, "XOR", mask);
    860     printf("\n Mask Circle------");
    861     for(int i = 0; i < 3; i++) {
    862         for (int j = 0; j < 3; j++) {
    863             printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
    864         }
    865     }
    866 
    867     in->data.PS_TYPE_MASK_DATA[0][0] = 2;
    868     in->data.PS_TYPE_MASK_DATA[0][1] = 0;
    869     in->data.PS_TYPE_MASK_DATA[0][2] = 1;
    870     in->data.PS_TYPE_MASK_DATA[1][0] = 4;
    871     in->data.PS_TYPE_MASK_DATA[1][1] = 0;
    872     in->data.PS_TYPE_MASK_DATA[1][2] = 3;
    873     in->data.PS_TYPE_MASK_DATA[2][0] = 2;
    874     in->data.PS_TYPE_MASK_DATA[2][1] = 1;
    875     in->data.PS_TYPE_MASK_DATA[2][2] = 2;
    876     psImageKeepCircle(in, 1, 1, 1, "=", mask);
    877     printf("\n Keep Circle------");
    878     for(int i = 0; i < 3; i++) {
    879         for (int j = 0; j < 3; j++) {
    880             printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
    881         }
    882     }
    883     fflush(stdout);
    884 
    885     //Error Checks
    886     //incorrect logical operation
    887     printf("\n");
    888     psImageKeepRegion(in, reg, "+", mask);
    889     //null image
    890     psImage *none = NULL;
    891     psImageMaskCircle(none, 1, 1, 1, "&", mask);
    892 
    893     psFree(in);
    894     return 0;
    895 }
    896 
  • trunk/psLib/test/imageops/verified/tst_psImagePixelManip.stderr

    r5224 r5227  
    147147---> TESTPOINT PASSED (psImage{psImageOverlay} | tst_psImagePixelManip.c)
    148148
    149 /***************************** TESTPOINT ******************************************\
    150 *             TestFile: tst_psImagePixelManip.c                                    *
    151 *            TestPoint: psImage{psImageKeep and Mask}                              *
    152 *             TestType: Positive                                                   *
    153 \**********************************************************************************/
    154 
    155 <DATE><TIME>|<HOST>|E|psImageKeepRegion (FILE:LINENO)
    156     The logical operation specified is incorrect
    157 <DATE><TIME>|<HOST>|E|psImageMaskCircle (FILE:LINENO)
    158     Invalid image input.  Image is NULL.
    159 
    160 ---> TESTPOINT PASSED (psImage{psImageKeep and Mask} | tst_psImagePixelManip.c)
    161 
Note: See TracChangeset for help on using the changeset viewer.