Changeset 11759 for trunk/psLib/src/imageops/psImageStats.c
- Timestamp:
- Feb 12, 2007, 5:01:24 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageStats.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageStats.c
r10999 r11759 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-0 1-09 22:38:52$11 * @version $Revision: 1.104 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-02-13 03:01:23 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 44 44 order to do so, we create dummy psVectors and set their "data" pointer to that 45 45 of the input psImages. 46 46 47 47 XXX: use static psVectors 48 48 49 49 XXX: optimize this. 2k vs 4k, sample mean, takes8 seconds on Gene's machine. 50 50 Should take .2. 51 51 *****************************************************************************/ 52 psStats*psImageStats(psStats* stats,52 bool psImageStats(psStats* stats, 53 53 const psImage* in, 54 54 const psImage* mask, … … 58 58 psVector *junkMask = NULL; 59 59 60 PS_ASSERT_PTR_NON_NULL(stats, NULL);61 PS_ASSERT_INT_NONZERO(stats->options, NULL);62 PS_ASSERT_IMAGE_NON_NULL(in, NULL)60 PS_ASSERT_PTR_NON_NULL(stats, false); 61 PS_ASSERT_INT_NONZERO(stats->options, false); 62 PS_ASSERT_IMAGE_NON_NULL(in, false) 63 63 if (mask != NULL) { 64 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, NULL);65 PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, NULL);64 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, false); 65 PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, false); 66 66 } 67 67 … … 116 116 psFree(junkMask); 117 117 psFree(junkData); 118 return (stats);118 return true; 119 119 } 120 120 … … 123 123 and initialized. 124 124 *****************************************************************************/ 125 psHistogram*psImageHistogram(psHistogram* out,125 bool psImageHistogram(psHistogram* out, 126 126 const psImage* in, 127 127 const psImage* mask, 128 128 psMaskType maskVal) 129 129 { 130 PS_ASSERT_PTR_NON_NULL(out, NULL);131 PS_ASSERT_PTR_NON_NULL(in, NULL);130 PS_ASSERT_PTR_NON_NULL(out, false); 131 PS_ASSERT_PTR_NON_NULL(in, false); 132 132 if (mask != NULL) { 133 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, NULL);134 PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, NULL);133 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, false); 134 PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, false); 135 135 } 136 136 psVector* junkData = NULL; … … 188 188 psFree(junkData); 189 189 190 return (out);190 return true; 191 191 } 192 192 … … 197 197 0:512 to -1:1. This routine takes as input an integer N and produces as 198 198 output a vector of evenly spaced floating point values between -1.0:1.0. 199 199 200 200 XXX: Use the p_psNormalizeVector here? 201 201 *****************************************************************************/ 202 double* calcScaleFactors(psS32 n)202 static double* calcScaleFactors(psS32 n) 203 203 { 204 204 PS_ASSERT_INT_NONNEGATIVE(n, NULL); … … 235 235 over all pixels (x,y) in the image. 236 236 *****************************************************************************/ 237 psPolynomial2D*psImageFitPolynomial(psPolynomial2D* coeffs,237 bool psImageFitPolynomial(psPolynomial2D* coeffs, 238 238 const psImage* input) 239 239 { 240 PS_ASSERT_IMAGE_NON_NULL(input, NULL);241 PS_ASSERT_IMAGE_NON_EMPTY(input, NULL);240 PS_ASSERT_IMAGE_NON_NULL(input, false); 241 PS_ASSERT_IMAGE_NON_EMPTY(input, false); 242 242 if ((input->type.type != PS_TYPE_S8) && 243 243 (input->type.type != PS_TYPE_U16) && … … 245 245 (input->type.type != PS_TYPE_F64)) { 246 246 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Unallowable image type.\n"); 247 } 248 PS_ASSERT_POLY_NON_NULL(coeffs, NULL); 249 PS_ASSERT_POLY_TYPE(coeffs, PS_POLYNOMIAL_CHEB, NULL); 247 return false; 248 } 249 PS_ASSERT_POLY_NON_NULL(coeffs, false); 250 PS_ASSERT_POLY_TYPE(coeffs, PS_POLYNOMIAL_CHEB, false); 250 251 psS32 x = 0; 251 252 psS32 y = 0; … … 338 339 psFree(rScalingFactors); 339 340 340 return (coeffs);341 return true; 341 342 } 342 343
Note:
See TracChangeset
for help on using the changeset viewer.
