- Timestamp:
- May 13, 2010, 11:00:08 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psModules.20100506/src/objects/pmPhotObj.c
r27657 r27948 58 58 if (!object->sources) { 59 59 object->sources = psArrayAllocEmpty(1); 60 object->x = source->peak->xf; 61 object->y = source->peak->yf; 60 object->x = source->peak->xf; 61 object->y = source->peak->yf; 62 object->SN = source->peak->SN; 63 } else { 64 object->SN = PS_MAX(object->SN, source->peak->SN); 62 65 } 63 66 psArrayAdd (object->sources, 1, source); 64 67 return true; 65 68 } 69 70 // sort by SN (descending) 71 int pmPhotObjSortBySN (const void **a, const void **b) 72 { 73 pmPhotObj *objA = *(pmPhotObj **)a; 74 pmPhotObj *objB = *(pmPhotObj **)b; 75 76 psF32 fA = objA->SN; 77 psF32 fB = objB->SN; 78 79 psF32 diff = fA - fB; 80 if (diff > FLT_EPSILON) return (-1); 81 if (diff < FLT_EPSILON) return (+1); 82 return (0); 83 }
Note:
See TracChangeset
for help on using the changeset viewer.
