Changeset 17371 for trunk/psLib/src/imageops/psImageBackground.c
- Timestamp:
- Apr 7, 2008, 2:16:31 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageBackground.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageBackground.c
r15938 r17371 42 42 const int Nsubset = (stats->nSubsample == 0) ? Npixels : PS_MIN(stats->nSubsample, Npixels); // Number of pixels in subset 43 43 44 psVector *values = psVectorAllocEmpty(Nsubset, PS_TYPE_F32); // Vector containing subsample 44 psVector *values; // Vector containing subsample 45 if (sample) { 46 *sample = psVectorRecycle(*sample, Nsubset, PS_TYPE_F32); 47 values = psMemIncrRefCounter(*sample); 48 values->n = 0; 49 } else { 50 values = psVectorAllocEmpty(Nsubset, PS_TYPE_F32); 51 } 45 52 46 53 // Minimum and maximum values … … 67 74 } 68 75 if (n < 0.01*Nsubset) { 69 psLogMsg ("psLib", PS_LOG_INFO, "too few data points");70 psFree (values);71 return false;76 psLogMsg ("psLib", PS_LOG_INFO, "too few data points"); 77 psFree (values); 78 return false; 72 79 } 73 80 … … 121 128 } 122 129 123 if (sample != NULL) { 124 *sample = values; 125 } else { 126 psFree(values); 127 } 130 psFree(values); 131 128 132 return true; 129 133 }
Note:
See TracChangeset
for help on using the changeset viewer.
