IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2008, 12:23:06 PM (18 years ago)
Author:
Paul Price
Message:

map->stats doesn't have to be defined except for psImageMapGenerate: some may want to make their own map (e.g., pmPSFmodelRead). Created assertions for psImageMap, and an assertion for the statistics (used in psImageMapGenerate).

File:
1 edited

Legend:

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

    r15841 r19960  
    77 *  @author Eugene Magnier, IfA
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-12-15 01:20:03 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-10-07 22:23:06 $
    1111 *
    1212 *  Copyright 2007 Institute for Astronomy, University of Hawaii
     
    4141} psImageMap;
    4242
     43// Assertion for psImageMap
     44#define PS_ASSERT_IMAGE_MAP_NON_NULL(MAP, RVAL) \
     45if (!(MAP) || !(MAP)->binning || !(MAP)->map || !(MAP)->error) { \
     46    psError(PS_ERR_UNEXPECTED_NULL, true, "Image map %s or its contents is NULL.", #MAP); \
     47    return RVAL; \
     48} \
     49PS_ASSERT_IMAGE_NON_NULL((MAP)->map, RVAL); \
     50PS_ASSERT_IMAGE_NON_NULL((MAP)->error, RVAL); \
     51PS_ASSERT_IMAGE_TYPE((MAP)->map, PS_TYPE_F32, RVAL); \
     52PS_ASSERT_IMAGE_TYPE((MAP)->error, PS_TYPE_F32, RVAL); \
     53PS_ASSERT_IMAGES_SIZE_EQUAL((MAP)->map, (MAP)->error, RVAL);
     54
     55// Assertion for statistics in psImageMap
     56#define PS_ASSERT_IMAGE_MAP_STATS(MAP, RVAL) \
     57if (!(MAP)->stats) { \
     58    psError(PS_ERR_UNEXPECTED_NULL, true, "Image map %s statistics is unset.", #MAP); \
     59    return RVAL; \
     60}
     61
     62
    4363psImageMap *psImageMapAlloc(const psImage *field, psImageBinning *binning, psStats *stats) PS_ATTR_MALLOC;
    4464bool psMemCheckImageMap(psPtr ptr);
Note: See TracChangeset for help on using the changeset viewer.