[Digikam-devel] [Bug 142571] Auto-exposure result is different from the preview

Gilles Caulier caulier.gilles at gmail.com
Mon Mar 12 08:28:46 GMT 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=142571         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From caulier.gilles gmail com  2007-03-12 09:28 -------
SVN commit 641661 by cgilles:

digikam from trunk : fix auto exposure computation algorithm. Patch from Joerg Kuehne.
BUG: 142571

 M  +4 -13     whitebalance.cpp  


--- trunk/extragear/graphics/digikam/libs/whitebalance/whitebalance.cpp #641660:641661
 @ -179,18 +179,13  @
        
     // Calculate optimal exposition and black level 
     
-    int    stop, i, scale, w, h;
-    double sum;
+    int    i;
+    double sum, stop;
     uint   rgbMax = sb ? 65536 : 256;
-    
-    w     = width  / 400;
-    h     = height / 400;
-    scale = QMAX(w, h);
-    scale = QMAX(1, scale);
-    
+        
     // Cutoff at 0.5% of the histogram.
     
-    stop = ((uint)(width / scale)*(uint)(height / scale)) / 200;
+    stop = width * height / 200;
     
     for (i = rgbMax, sum = 0; (i >= 0) && (sum < stop); i--)
         sum += histogram->getValue(Digikam::ImageHistogram::ValueChannel, i);
 @ -198,10 +193,6  @
     expo = -log((float)(i+1) / rgbMax) / log(2);
     DDebug() << "White level at:" << i << endl;
     
-    // Cutoff at 0.5% of the histogram. 
-    
-    stop = ((uint)(width / scale)*(uint)(height / scale)) / 200;
-    
     for (i = 1, sum = 0; (i < (int)rgbMax) && (sum < stop); i++)
         sum += histogram->getValue(Digikam::ImageHistogram::ValueChannel, i);



More information about the Digikam-devel mailing list