[Wavelet-commit] Wavelet Image.cc,1.20,1.21
Status: Beta
Brought to you by:
herbert
From: Herbert M. D. <he...@us...> - 2005-07-15 08:44:01
|
Update of /cvsroot/wavelet/Wavelet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7329 Modified Files: Image.cc Log Message: Slightly changed Image::gammaCorrection() again: should work now with minimum less than zero. Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Image.cc 14 Jul 2005 17:06:18 -0000 1.20 --- Image.cc 15 Jul 2005 08:43:53 -0000 1.21 *************** *** 247,264 **** int iMin = tools_coeff2int (min - 0.5); - iMin = MIN (0,iMin); - int iMax = tools_coeff2int (max); ! iMax = MAX (norm,iMax); ! norm = iMax-iMin; coeff normCoeff = (coeff)norm; ! coeff * replaceTable = replaceTable = NEW (coeff[norm+1]); for (int i = 0; i <= norm; i++) { ! replaceTable[i] = tools_coeff2int ! (norm * pow ((coeff)(i+iMin) / normCoeff, 1.0 / factor)); } --- 247,264 ---- int iMin = tools_coeff2int (min - 0.5); int iMax = tools_coeff2int (max); ! ! iMin = MIN (0, iMin); ! iMax = MAX (norm, iMax); ! norm = iMax - iMin; coeff normCoeff = (coeff)norm; ! coeff * replaceTable = replaceTable = NEW (coeff[norm + 1]); for (int i = 0; i <= norm; i++) { ! replaceTable[i] = tools_coeff2int (norm * pow ((coeff)(i) / normCoeff, ! 1.0 / factor)) + iMin; } *************** *** 267,271 **** for ( int x = xoffs; x < toX ; x++ ) { ! to (y, x, replaceTable[(int)(at (y,x)+iMin)]); } } --- 267,271 ---- for ( int x = xoffs; x < toX ; x++ ) { ! to (y, x, replaceTable[(int)(at (y, x) + iMin)]); } } |