IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21172 for trunk/psLib


Ignore:
Timestamp:
Jan 26, 2009, 2:00:45 PM (17 years ago)
Author:
eugene
Message:

adding mask and maskVal to vector eval functions

Location:
trunk/psLib/src/imageops
Files:
3 edited

Legend:

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

    r20767 r21172  
    77 *  @author Eugene Magnier, IfA
    88 *
    9  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-11-17 02:37:28 $
     9 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2009-01-27 00:00:21 $
    1111 *
    1212 *  Copyright 2007 Institute for Astronomy, University of Hawaii
     
    353353}
    354354
    355 psVector *psImageMapEvalVector(const psImageMap *map, const psVector *x, const psVector *y)
     355psVector *psImageMapEvalVector(const psImageMap *map, const psVector *mask, psMaskType maskValue, const psVector *x, const psVector *y)
    356356{
    357357    PS_ASSERT_IMAGE_MAP_NON_NULL(map, NULL);
     
    365365
    366366    for (int i = 0; i < x->n; i++) {
    367         result->data.F32[i] = psImageUnbinPixel(x->data.F32[i], y->data.F32[i], map->map, map->binning);
     367      if (mask && (mask->data.U8[i] & maskValue)) {
     368        result->data.F32[i] = 0.0;
     369      } else { 
     370        result->data.F32[i] = psImageUnbinPixel(x->data.F32[i], y->data.F32[i], map->map, map->binning);
     371      }
    368372    }
    369373
  • trunk/psLib/src/imageops/psImageMap.h

    r19960 r21172  
    77 *  @author Eugene Magnier, IfA
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-10-07 22:23:06 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2009-01-27 00:00:21 $
    1111 *
    1212 *  Copyright 2007 Institute for Astronomy, University of Hawaii
     
    7777
    7878// apply the psImageMap to the given coordinate vectors (fine image pixels)
    79 psVector *psImageMapEvalVector (const psImageMap *map, const psVector *x, const psVector *y);
     79psVector *psImageMapEvalVector (const psImageMap *map, const psVector *mask, psMaskType maskValue, const psVector *x, const psVector *y);
    8080
    8181/// @}
  • trunk/psLib/src/imageops/psImageMapFit.c

    r20075 r21172  
    77 *  @author Eugene Magnier, IfA
    88 *
    9  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-10-13 01:55:48 $
     9 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2009-01-27 00:00:21 $
    1111 *
    1212 *  Copyright 2007 Institute for Astronomy, University of Hawaii
     
    397397        }
    398398
    399         psVector *fit = psImageMapEvalVector(map, x, y);
     399        psVector *fit = psImageMapEvalVector(map, mask, maskValue, x, y);
    400400        if (fit == NULL) {
    401401            psError(PS_ERR_UNKNOWN, false, "Failure in psImageMapEvalVector().\n");
Note: See TracChangeset for help on using the changeset viewer.