Changeset 10273 for trunk/psLib/src/imageops/psImageBackground.c
- Timestamp:
- Nov 29, 2006, 7:51:05 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageBackground.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageBackground.c
r10169 r10273 26 26 PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(fmin, 1.0, NULL); 27 27 PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(fmax, 1.0, NULL); 28 PS_ASSERT_INT_ POSITIVE(nMax, NULL);28 PS_ASSERT_INT_NONNEGATIVE(nMax, NULL); 29 29 PS_ASSERT_PTR_NON_NULL(rng, NULL); 30 30 … … 33 33 long ny = image->numRows; 34 34 35 int Nsubset = PS_MIN(nMax, nx*ny); // Number of pixels in nubset36 int Npixels = nx*ny; // Total number of pixels35 const int Npixels = nx*ny; // Total number of pixels 36 const int Nsubset = (nMax == 0) ? Npixels : PS_MIN(nMax, Npixels); // Number of pixels in subset 37 37 38 38 psVector *values = psVectorAllocEmpty(Nsubset, PS_TYPE_F32); // Vector containing subsample … … 95 95 stats->clipSigma = 1.0; 96 96 } 97 psVectorStats (stats, values, NULL, NULL, 0); 97 if (psVectorStats (stats, values, NULL, NULL, 0) == NULL) { 98 psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background " 99 "(%dx%d, (row0,col0) = (%d,%d)", 100 image->numRows, image->numCols, image->row0, image->col0); 101 psFree(stats); 102 psFree(values); 103 return NULL; 104 } 98 105 } 99 106
Note:
See TracChangeset
for help on using the changeset viewer.
