Changeset 30815
- Timestamp:
- Mar 6, 2011, 2:59:23 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psModules/src/objects
- Files:
-
- 2 edited
-
pmFootprintAssignPeaks.c (modified) (2 diffs)
-
pmFootprintIDs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintAssignPeaks.c
r30621 r30815 46 46 */ 47 47 psImage *ids = pmSetFootprintArrayIDs(footprints, true); 48 assert (ids != NULL);49 assert (ids->type.type == PS_TYPE_S32);50 const int row0 = ids ->row0;51 const int col0 = ids ->col0;52 const int numRows = ids ->numRows;53 const int numCols = ids ->numCols;48 if (ids) { assert (ids->type.type == PS_TYPE_S32); } 49 50 const int row0 = ids ? ids->row0 : 0; 51 const int col0 = ids ? ids->col0 : 0; 52 const int numRows = ids ? ids->numRows : -1; 53 const int numCols = ids ? ids->numCols : -1; 54 54 55 55 for (int i = 0; i < peaks->n; i++) { … … 58 58 const int y = peak->y - row0; 59 59 60 assert (x >= 0 && x < numCols && y >= 0 && y < numRows);61 int id = ids ->data.S32[y][x - col0];60 if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);} 61 int id = ids ? ids->data.S32[y][x - col0] : 0; 62 62 63 63 if (id == 0) { // peak isn't in a footprint, so make one for it -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintIDs.c
r29004 r30815 66 66 67 67 if (footprints->n == 0) { 68 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "You didn't provide any footprints"); 68 // XXX this was an error, but is an allowed condition -- NULL returned image means no footprints for any peaks 69 // psError(PS_ERR_BAD_PARAMETER_SIZE, true, "You didn't provide any footprints"); 69 70 return NULL; 70 71 }
Note:
See TracChangeset
for help on using the changeset viewer.
