IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2009, 8:40:07 PM (17 years ago)
Author:
eugene
Message:

incorporating changes from 16bit mask upgrades (eam_branch_20081230)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageMaskOps.c

    r18494 r21183  
    88 *  @author David Robbins, MHPCC
    99 *
    10  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2008-07-12 21:08:33 $
     10 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2009-01-27 06:39:37 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737                       psRegion region,
    3838                       const char *op,
    39                        psMaskType maskValue)
     39                       psImageMaskType maskValue)
    4040{
    4141    if (image == NULL) {
     
    5353          if ((i + image->col0) < region.x0) continue; \
    5454          if ((i + image->col0) > region.x1) continue; /* is this correct (not >= ?) */ \
    55           image->data.PS_TYPE_MASK_DATA[j][i] OP maskValue; \
     55          image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] OP maskValue; \
    5656        } \
    5757      }
     
    8484                       psRegion region,
    8585                       const char *op,
    86                        psMaskType maskValue)
     86                       psImageMaskType maskValue)
    8787{
    8888    if (image == NULL) {
     
    100100            (i + image->col0) < region.x0 || \
    101101            (i + image->col0) > region.x1 ) { \
    102           image->data.PS_TYPE_MASK_DATA[j][i] OP maskValue; \
     102          image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] OP maskValue; \
    103103        } } }
    104104
     
    131131                       double radius,
    132132                       const char *op,
    133                        psMaskType maskValue)
     133                       psImageMaskType maskValue)
    134134{
    135135    if (image == NULL) {
     
    150150            r2 = PS_SQR(dx) + PS_SQR(dy); \
    151151            if (r2 <= R2) { \
    152               image->data.PS_TYPE_MASK_DATA[iy][ix] OP maskValue; \
     152              image->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] OP maskValue; \
    153153            } } }
    154154
     
    182182                       double radius,
    183183                       const char *op,
    184                        psMaskType maskValue)
     184                       psImageMaskType maskValue)
    185185{
    186186
     
    201201            r2 = PS_SQR(dx) + PS_SQR(dy); \
    202202            if (r2 > R2) { \
    203               image->data.PS_TYPE_MASK_DATA[iy][ix] OP maskValue; \
     203              image->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] OP maskValue; \
    204204            } } }
    205205
     
    228228psImage *psImageGrowMask(psImage *out,
    229229                         const psImage *in,
    230                          psMaskType maskVal,
     230                         psImageMaskType maskVal,
    231231                         unsigned int growSize,
    232                          psMaskType growVal)
     232                         psImageMaskType growVal)
    233233{
    234234    if (in == NULL) {
     
    237237        return NULL;
    238238    }
    239     if (in->type.type != PS_TYPE_MASK) {
     239    if (in->type.type != PS_TYPE_IMAGE_MASK) {
    240240        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    241                 "Invalid input image.  Input image type must match psMaskType.\n");
     241                "Invalid input image.  Input image type must match psImageMaskType.\n");
    242242        return NULL;
    243243    }
     
    261261    for (k = 0; k < in->numRows; k++) {
    262262        for (l = 0; l < in->numCols; l++) {
    263             out->data.PS_TYPE_MASK_DATA[k][l] = in->data.PS_TYPE_MASK_DATA[k][l];
    264             changed->data.PS_TYPE_MASK_DATA[k][l] = 0;
     263            out->data.PS_TYPE_IMAGE_MASK_DATA[k][l] = in->data.PS_TYPE_IMAGE_MASK_DATA[k][l];
     264            changed->data.PS_TYPE_IMAGE_MASK_DATA[k][l] = 0;
    265265        }
    266266    }
     
    268268    for (int i = 0; i < in->numRows; i++) {
    269269        for (int j = 0; j < in->numCols; j++) {
    270             if ( (in->data.PS_TYPE_MASK_DATA[i][j] & maskVal) != 0 &&
    271                     changed->data.PS_TYPE_MASK_DATA[i][j] == 0) {
     270            if ( (in->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) != 0 &&
     271                    changed->data.PS_TYPE_IMAGE_MASK_DATA[i][j] == 0) {
    272272                m = i - growSize;
    273273                if (m < 0) {
     
    281281                    for (l = n; l <= (j + growSize) && l < in->numCols; l++) {
    282282                        if (((k-i)*(k-i) + (l-j)*(l-j)) <= (growSize*growSize)) {
    283                             out->data.PS_TYPE_MASK_DATA[k][l] |= growVal;
    284                             if ( (in->data.PS_TYPE_MASK_DATA[i][j] & maskVal) == 0 ) {
    285                                 changed->data.PS_TYPE_MASK_DATA[k][l] = 1;
     283                            out->data.PS_TYPE_IMAGE_MASK_DATA[k][l] |= growVal;
     284                            if ( (in->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) == 0 ) {
     285                                changed->data.PS_TYPE_IMAGE_MASK_DATA[k][l] = 1;
    286286                            }
    287287                        }
Note: See TracChangeset for help on using the changeset viewer.