IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17459


Ignore:
Timestamp:
Apr 21, 2008, 8:18:33 AM (18 years ago)
Author:
eugene
Message:

pmSetFootprintID now recycles an image if supplied

Location:
branches/eam_branch_20080413/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080413/psphot/src/pmFootprint.h

    r17443 r17459  
    4747
    4848psImage *pmSetFootprintArrayIDs(const psArray *footprints, const bool relativeIDs);
    49 psImage *pmSetFootprintID(const pmFootprint *fp, const int id);
     49psImage *pmSetFootprintID(psImage *idImage, const pmFootprint *fp, const int id);
    5050void pmSetFootprintArrayIDsForImage(psImage *idImage,
    5151                                    const psArray *footprints, // the footprints to insert
  • branches/eam_branch_20080413/psphot/src/pmFootprintIDs.c

    r17443 r17459  
    7474 * Set an image to the value of footprint's ID whever they may fall
    7575 */
    76 psImage *pmSetFootprintID(const pmFootprint *fp, // the footprint to insert
     76psImage *pmSetFootprintID(psImage *idImage,
     77                          const pmFootprint *fp, // the footprint to insert
    7778                          const int id) {       // the desired ID
    7879   assert(fp != NULL && pmFootprintTest((const psPtr)fp));
     
    8384   assert (numCols >= 0 && numRows >= 0);
    8485   
    85    psImage *idImage = psImageAlloc(numCols, numRows, PS_TYPE_S32);
     86   if (idImage == NULL) {
     87       idImage = psImageAlloc(numCols, numRows, PS_TYPE_S32);
     88   } else {
     89       assert (idImage->numCols == numCols);
     90       assert (idImage->numRows == numRows);
     91       // XXX assert on type (S32)
     92   }
    8693   P_PSIMAGE_SET_ROW0(idImage, row0);
    8794   P_PSIMAGE_SET_COL0(idImage, col0);
Note: See TracChangeset for help on using the changeset viewer.