[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/digikam
From:       Gilles Caulier <caulier.gilles () gmail ! com>
Date:       2010-02-27 9:37:27
Message-ID: 1267263447.962141.13557.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1096655 by cgilles:

memory allocation optimization.


 M  +2 -7      imageplugins/coreplugin/whitebalancetool.cpp  
 M  +4 -4      libs/dimg/filters/wb/wbfilter.cpp  
 M  +0 -1      libs/dimg/filters/wb/wbfilter.h  


--- trunk/extragear/graphics/digikam/imageplugins/coreplugin/whitebalancetool.cpp \
#1096654:1096655 @@ -187,15 +187,10 @@
     kapp->activeWindow()->setCursor(Qt::WaitCursor);
 
     ImageIface iface(0, 0);
-    uchar* data = iface.getOriginalImage();
-    int width   = iface.originalWidth();
-    int height  = iface.originalHeight();
-    bool sb     = iface.originalSixteenBit();
-
+    DImg* img            = iface.getOriginalImg();
     WBContainer settings = d->settingsView->settings();
-    WBFilter::autoExposureAdjustement(data, width, height, sb, settings.black, \
settings.exposition); +    WBFilter::autoExposureAdjustement(img, settings.black, \
settings.exposition);  d->settingsView->setSettings(settings);
-    delete [] data;
 
     kapp->activeWindow()->unsetCursor();
     slotTimer();
--- trunk/extragear/graphics/digikam/libs/dimg/filters/wb/wbfilter.cpp \
#1096654:1096655 @@ -158,11 +158,11 @@
 
 void WBFilter::autoExposureAdjustement(DImg* img, double& black, double& expo)
 {
-    autoExposureAdjustement(img->bits(), img->width(), img->height(), \
                img->sixteenBit(), black, expo);
-}
+    uchar* data = img->bits();
+    int width   = img->width();
+    int height  = img->height();
+    bool sb     = img->sixteenBit();
 
-void WBFilter::autoExposureAdjustement(uchar* data, int width, int height, bool sb, \
                double& black, double& expo)
-{
     // Create an histogram of original image.
 
     ImageHistogram* histogram = new ImageHistogram(data, width, height, sb);
--- trunk/extragear/graphics/digikam/libs/dimg/filters/wb/wbfilter.h #1096654:1096655
@@ -85,7 +85,6 @@
     virtual ~WBFilter();
 
     static void autoExposureAdjustement(DImg* img, double& black, double& expo);
-    static void autoExposureAdjustement(uchar* data, int width, int height, bool sb, \
                double& black, double& expo);
     static void autoWBAdjustementFromColor(const QColor& tc, double& temperature, \
double& green);  
 protected:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic