Changeset 25027 for branches/pap/psLib/src/imageops/psImageMap.c
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psLib/src/imageops/psImageMap.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/psLib/src/imageops/psImageMap.c
r21183 r25027 211 211 // XXX need to supply a mask and skip the masked pixels when calculating the centroid 212 212 // this will not in general be properly weighted... 213 if (psVectorStats (map->stats, fCell, dfCell, NULL, 0)) { 213 if (!psVectorStats (map->stats, fCell, dfCell, NULL, 0)) { 214 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 215 return false; 216 } 217 218 // XXX ensure only one option is selected, or save both position and width 219 map->map->data.F32[iy][ix] = psStatsGetValue (map->stats, map->stats->options); 220 221 if (isnan(map->map->data.F32[iy][ix])) { 222 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] = 1; 223 } else { 214 224 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] = 0; 215 // XXX ensure only one option is selected, or save both position and width216 map->map->data.F32[iy][ix] = psStatsGetValue (map->stats, map->stats->options);217 225 218 226 // calculate the mean position and save: 219 227 psStatsInit (meanStat); 220 psVectorStats (meanStat, xCell, NULL, NULL, 0); 228 if (!psVectorStats (meanStat, xCell, NULL, NULL, 0)) { 229 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 230 return false; 231 } 221 232 xCoord->data.F32[iy][ix] = psStatsGetValue (meanStat, meanStat->options); 222 233 psStatsInit (meanStat); 223 psVectorStats (meanStat, yCell, NULL, NULL, 0); 234 if (!psVectorStats (meanStat, yCell, NULL, NULL, 0)) { 235 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 236 return false; 237 } 224 238 yCoord->data.F32[iy][ix] = psStatsGetValue (meanStat, meanStat->options); 225 } else {226 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] = 1;227 239 } 228 240
Note:
See TracChangeset
for help on using the changeset viewer.
