IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4206


Ignore:
Timestamp:
Jun 9, 2005, 4:30:47 PM (21 years ago)
Author:
desonia
Message:

changed psImageCut & psImageSlice to use psRegion.

Location:
trunk/psLib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImagePixelExtract.c

    r3968 r4206  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-05-19 02:08:21 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-06-10 02:30:47 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828                       const psImage* restrict mask,
    2929                       psU32 maskVal,
    30                        psS32 col0,
    31                        psS32 row0,
    32                        psS32 col1,
    33                        psS32 row1,
     30                       psRegion region,
    3431                       psImageCutDirection direction,
    3532                       const psStats* stats)
     
    4239    psS32 delta = 1;
    4340    psF64* outData;
     41    psS32 row0 = region.y0;
     42    psS32 row1 = region.y1;
     43    psS32 col0 = region.x0;
     44    psS32 col1 = region.x1;
    4445
    4546    if (in == NULL || in->data.V == NULL) {
     
    271272                     psVector* cutRows,
    272273                     const psImage* in,
    273                      const psImage* restrict mask,
     274                     const psImage* mask,
    274275                     psU32 maskVal,
    275                      float startCol,
    276                      float startRow,
    277                      float endCol,
    278                      float endRow,
     276                     psRegion region,
    279277                     psU32 nSamples,
    280278                     psImageInterpolateMode mode)
    281279{
     280
    282281    if (in == NULL || in->data.V == NULL) {
    283282        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     
    297296    }
    298297
     298    float startCol = region.x0;
     299    float startRow = region.y0;
     300    float endCol = region.x1;
     301    float endRow = region.y1;
    299302    if (startCol < 0 || startCol >= numCols ||
    300303            startRow < 0 || startRow >= numRows ||
  • trunk/psLib/src/image/psImagePixelExtract.h

    r4162 r4206  
    88*  @author Robert DeSonia, MHPCC
    99*
    10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-06-08 23:40:45 $
     10*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-06-10 02:30:47 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6565    const psImage* mask,               ///< the mask for the input image.
    6666    psU32 maskVal,                     ///< the mask value to apply to the mask
    67     psS32 col0,                        ///< the leftmost column of the slice region
    68     psS32 row0,                        ///< the bottommost row of the slice region
    69     psS32 col1,                        ///< exclusive end column of the slice region
    70     psS32 row1,                        ///< exclusive end row of the slice region
     67    psRegion region,                   ///< the slice region
    7168    psImageCutDirection direction,     ///< the slice dimension and direction
    7269    const psStats* stats               ///< the statistic to perform in slice operation
     
    9693    const psImage* mask,               ///< the mask for the input image.
    9794    psU32 maskVal,                     ///< the mask value to apply to the mask
    98     float startCol,                    ///< the column of the start of the cut line
    99     float startRow,                    ///< the row of the start of the cut line
    100     float endCol,                      ///< the column of the end of the cut line
    101     float endRow,                      ///< the row of the end of the cut line
     95    psRegion region,                   ///< the start and end points to cut along
    10296    psU32 nSamples,                    ///< the number of samples along the cut
    10397    psImageInterpolateMode mode        ///< the interpolation method to use
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r3968 r4206  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-05-19 02:08:21 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-06-10 02:30:47 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828                       const psImage* restrict mask,
    2929                       psU32 maskVal,
    30                        psS32 col0,
    31                        psS32 row0,
    32                        psS32 col1,
    33                        psS32 row1,
     30                       psRegion region,
    3431                       psImageCutDirection direction,
    3532                       const psStats* stats)
     
    4239    psS32 delta = 1;
    4340    psF64* outData;
     41    psS32 row0 = region.y0;
     42    psS32 row1 = region.y1;
     43    psS32 col0 = region.x0;
     44    psS32 col1 = region.x1;
    4445
    4546    if (in == NULL || in->data.V == NULL) {
     
    271272                     psVector* cutRows,
    272273                     const psImage* in,
    273                      const psImage* restrict mask,
     274                     const psImage* mask,
    274275                     psU32 maskVal,
    275                      float startCol,
    276                      float startRow,
    277                      float endCol,
    278                      float endRow,
     276                     psRegion region,
    279277                     psU32 nSamples,
    280278                     psImageInterpolateMode mode)
    281279{
     280
    282281    if (in == NULL || in->data.V == NULL) {
    283282        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     
    297296    }
    298297
     298    float startCol = region.x0;
     299    float startRow = region.y0;
     300    float endCol = region.x1;
     301    float endRow = region.y1;
    299302    if (startCol < 0 || startCol >= numCols ||
    300303            startRow < 0 || startRow >= numRows ||
  • trunk/psLib/src/imageops/psImagePixelExtract.h

    r4162 r4206  
    88*  @author Robert DeSonia, MHPCC
    99*
    10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-06-08 23:40:45 $
     10*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-06-10 02:30:47 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6565    const psImage* mask,               ///< the mask for the input image.
    6666    psU32 maskVal,                     ///< the mask value to apply to the mask
    67     psS32 col0,                        ///< the leftmost column of the slice region
    68     psS32 row0,                        ///< the bottommost row of the slice region
    69     psS32 col1,                        ///< exclusive end column of the slice region
    70     psS32 row1,                        ///< exclusive end row of the slice region
     67    psRegion region,                   ///< the slice region
    7168    psImageCutDirection direction,     ///< the slice dimension and direction
    7269    const psStats* stats               ///< the statistic to perform in slice operation
     
    9693    const psImage* mask,               ///< the mask for the input image.
    9794    psU32 maskVal,                     ///< the mask value to apply to the mask
    98     float startCol,                    ///< the column of the start of the cut line
    99     float startRow,                    ///< the row of the start of the cut line
    100     float endCol,                      ///< the column of the end of the cut line
    101     float endRow,                      ///< the row of the end of the cut line
     95    psRegion region,                   ///< the start and end points to cut along
    10296    psU32 nSamples,                    ///< the number of samples along the cut
    10397    psImageInterpolateMode mode        ///< the interpolation method to use
  • trunk/psLib/test/image/tst_psImagePixelExtract.c

    r3973 r4206  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-05-19 02:49:40 $
     8*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-06-10 02:30:47 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7777        } \
    7878    } \
    79     out = psImageSlice(out,positions,image,mask,1,c/10,r/10,c/10+M,r/10+N,DIRECTION,stat); \
     79    out = psImageSlice(out,positions,image,mask,1,psRegionSet(c/10,c/10+M,r/10,r/10+N),DIRECTION,stat); \
    8080    \
    8181    if (out->n != TRUTH_SIZE) { \
     
    153153                        NULL, NULL,
    154154                        NULL, 0,
    155                         c/10, r/10,
    156                         c/10 + 1, r/10 + 1,
     155                        psRegionSet(c/10, c/10 + 1, r/10, r/10 + 1),
    157156                        PS_CUT_X_POS,
    158157                        stat );
     
    171170                        NULL, image,
    172171                        mask, 1,
    173                         c/10, r/10,
    174                         c/10 + 1,
    175                         r/10 + 1,
     172                        psRegionSet(c/10, c/10 + 1, r/10, r/10 + 1),
    176173                        PS_CUT_X_POS,
    177174                        NULL );
     
    190187                        image,
    191188                        mask, 1,
    192                         c/10, r/10,
    193                         c/10+1, r/10+1,
     189                        psRegionSet(c/10, c/10 + 1, r/10, r/10 + 1),
    194190                        5,
    195191                        stat);
     
    208204                        image,
    209205                        mask, 1,
    210                         c/10, r/10,
    211                         c/10, r/10,
     206                        psRegionSet(c/10, c/10, r/10, r/10),
    212207                        PS_CUT_X_POS,
    213208                        stat );
     
    226221                        image,
    227222                        mask, 1,
    228                         c+1, r/10,
    229                         c+2, r/10+10,
     223                        psRegionSet(c+1, c+2, r/10, r/10 + 10),
    230224                        PS_CUT_X_POS,
    231225                        stat );
     
    239233                        image,
    240234                        mask, 1,
    241                         c/10, r+1,
    242                         c/10+1,r+5,
     235                        psRegionSet(c/10, c/10 + 1, r+1,r+5),
    243236                        PS_CUT_X_POS,
    244237                        stat );
     
    252245                        image,
    253246                        mask, 1,
    254                         c/10, r/10,
    255                         c+1, r/10+1,
     247                        psRegionSet(c/10, c+1, r/10, r/10+1),
    256248                        PS_CUT_X_POS,
    257249                        stat);
     
    265257                        image,
    266258                        mask, 1,
    267                         c/10, r/10,
    268                         c/10+1, r + 1,
     259                        psRegionSet(c/10, c/10 + 1, r/10, r + 1),
    269260                        PS_CUT_X_POS,
    270261                        stat);
     
    284275                        image,
    285276                        mask, 1,
    286                         c/10, r/10,
    287                         c/10+1, r/10+1,
     277                        psRegionSet(c/10, c/10 + 1, r/10, r/10+1),
    288278                        PS_CUT_X_POS,
    289279                        stat);
     
    302292                        image,
    303293                        maskSz, 1,
    304                         c/10, r/10,
    305                         c/10+1, r/10+1,
     294                        psRegionSet(c/10, c/10 + 1, r/10, r/10 + 1),
    306295                        PS_CUT_X_POS,
    307296                        stat);
     
    318307                         image,
    319308                         maskS8, 1,
    320                          c/10, r/10,
    321                          c/10+1, r/10+1,
     309                         psRegionSet(c/10, c/10 + 1, r/10, r/10 + 1),
    322310                         PS_CUT_X_POS,
    323311                         stat);
     
    377365                                image,
    378366                                NULL,0,
    379                                 startCol[n], startRow[n],
    380                                 endCol[n], endRow[n],
     367                                psRegionSet(startCol[n], endCol[n], startRow[n],endRow[n]),
    381368                                length,
    382369                                PS_INTERPOLATE_FLAT);
     
    386373                                image,
    387374                                mask,1,
    388                                 startCol[n], startRow[n],
    389                                 endCol[n], endRow[n],
     375                                psRegionSet(startCol[n], endCol[n], startRow[n], endRow[n]),
    390376                                length,
    391377                                PS_INTERPOLATE_FLAT);
     
    454440                        NULL,
    455441                        mask,1,
    456                         startCol[0], startRow[0],
    457                         endCol[0], endRow[0],
     442                        psRegionSet(startCol[0], endCol[0], startRow[0], endRow[0]),
    458443                        length,
    459444                        PS_INTERPOLATE_FLAT);
     
    476461                        image,
    477462                        mask,1,
    478                         startCol[0], startRow[0],
    479                         endCol[0], endRow[0],
     463                        psRegionSet(startCol[0], endCol[0], startRow[0], endRow[0]),
    480464                        0,
    481465                        PS_INTERPOLATE_FLAT);
Note: See TracChangeset for help on using the changeset viewer.