Changeset 795 for trunk/psLib/src/image/psImageStats.c
- Timestamp:
- May 27, 2004, 11:55:44 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImageStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageStats.c
r784 r795 132 132 } 133 133 } 134 135 136 // Free the Chebyshev polynomials that were created in this routine. 137 for (i=0;i<maxChebyPoly;i++) { 138 psFree(chebPolys[i]); 139 } 140 134 141 return(coeffs); 135 142 } 136 143 144 /***************************************************************************** 145 146 *****************************************************************************/ 137 147 int 138 148 psImageEvalPolynomial(const psImage *input, … … 141 151 int i = 0; 142 152 int j = 0; 153 int x = 0; 154 int y = 0; 143 155 float **sums = NULL; 144 156 psPolynomial1D **chebPolys = NULL; 145 157 int maxChebyPoly = 0; 158 float polySum = 0.0; 146 159 147 160 // Create the sums[][] data structure. This will hold the LHS of equation … … 181 194 182 195 196 for (x=0;x<input->numRows;x++) { 197 for (y=0;y<input->numCols;y++) { 198 polySum = 0.0; 199 for (i=0;i<coeffs->nX;i++) { 200 for (j=0;j<coeffs->nY;j++) { 201 polySum+= psEvalPolynomial1D((float)x, chebPolys[i]) * 202 psEvalPolynomial1D((float)y, chebPolys[y]) * 203 coeffs->coeff[i][j]; 204 205 } 206 } 207 input->data.F32[x][y] = polySum; 208 } 209 } 210 211 212 // Free the Chebyshev polynomials that were created in this routine. 213 for (i=0;i<maxChebyPoly;i++) { 214 psFree(chebPolys[i]); 215 } 216 183 217 return(0); 184 218 }
Note:
See TracChangeset
for help on using the changeset viewer.
