[Digikam-devel] extragear/graphics/digikamimageplugins/refocus

Gilles Caulier caulier.gilles at kdemail.net
Wed Jan 17 13:21:32 GMT 2007


SVN commit 624613 by cgilles:

digiKam from trunk : Refocus Tool : remember the settings between plugin sessions

CCMAIL: digikam-devel at kde.org

 M  +39 -6     imageeffect_refocus.cpp  
 M  +20 -19    imageeffect_refocus.h  
 M  +6 -8      imageplugin_refocus.h  


--- trunk/extragear/graphics/digikamimageplugins/refocus/imageeffect_refocus.cpp #624612:624613
@@ -1,11 +1,10 @@
 /* ============================================================
- * File  : imageeffect_refocus.cpp
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2005-04-29
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2005-04-29
  * Description : a digiKam image editor plugin to refocus 
  *               an image.
  * 
- * Copyright 2005-2006 by Gilles Caulier
+ * Copyright 2005-2007 by Gilles Caulier
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -31,6 +30,7 @@
 
 // KDE includes.
 
+#include <kconfig.h>
 #include <klocale.h>
 #include <kaboutdata.h>
 #include <kapplication.h>
@@ -45,6 +45,7 @@
 #include "refocus.h"
 #include "version.h"
 #include "imageeffect_refocus.h"
+#include "imageeffect_refocus.moc"
 
 #define MAX_MATRIX_SIZE 25
 
@@ -65,7 +66,7 @@
                                        digikamimageplugins_version,
                                        I18N_NOOP("A digiKam image plugin to refocus a photograph."),
                                        KAboutData::License_GPL,
-                                       "(c) 2006, Gilles Caulier",
+                                       "(c) 2006-2007, Gilles Caulier",
                                        0,
                                        "http://extragear.kde.org/apps/digikamimageplugins");
     
@@ -248,6 +249,39 @@
     m_noise->setEnabled(true);
 }
 
+void ImageEffect_Refocus::readUserSettings()
+{
+    KConfig* config = kapp->config();
+    config->setGroup("refocus Tool Dialog");
+    m_matrixSize->blockSignals(true);
+    m_radius->blockSignals(true);
+    m_gauss->blockSignals(true);
+    m_correlation->blockSignals(true);
+    m_noise->blockSignals(true);
+    m_matrixSize->setValue(config->readNumEntry("MatrixSize", 5));
+    m_radius->setValue(config->readDoubleNumEntry("RadiusAjustment", 1.0));
+    m_gauss->setValue(config->readDoubleNumEntry("GaussAjustment", 0.0));
+    m_correlation->setValue(config->readDoubleNumEntry("CorrelationAjustment", 0.5));
+    m_noise->setValue(config->readDoubleNumEntry("NoiseAjustment", 0.03));
+    m_matrixSize->blockSignals(false);
+    m_radius->blockSignals(false);
+    m_gauss->blockSignals(false);
+    m_correlation->blockSignals(false);
+    m_noise->blockSignals(false);
+}
+
+void ImageEffect_Refocus::writeUserSettings()
+{
+    KConfig* config = kapp->config();
+    config->setGroup("refocus Tool Dialog");
+    config->writeEntry("MatrixSize", m_matrixSize->value());
+    config->writeEntry("RadiusAjustment", m_radius->value());
+    config->writeEntry("GaussAjustment", m_gauss->value());
+    config->writeEntry("CorrelationAjustment", m_correlation->value());
+    config->writeEntry("NoiseAjustment", m_noise->value());
+    config->sync();
+}
+
 void ImageEffect_Refocus::resetValues(void)
 {
     m_matrixSize->blockSignals(true);
@@ -399,4 +433,3 @@
 
 }  // NameSpace DigikamRefocusImagesPlugin
 
-#include "imageeffect_refocus.moc"
--- trunk/extragear/graphics/digikamimageplugins/refocus/imageeffect_refocus.h #624612:624613
@@ -1,11 +1,10 @@
 /* ============================================================
- * File  : imageeffect_refocus.h
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2005-04-29
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2005-04-29
  * Description : a digiKam image editor plugin to refocus 
  *               an image.
  * 
- * Copyright 2005-2006 by Gilles Caulier
+ * Copyright 2005-2007 by Gilles Caulier
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -42,8 +41,25 @@
     ImageEffect_Refocus(QWidget* parent, QString title, QFrame* banner);
     ~ImageEffect_Refocus();
 
+private slots:
+
+    void slotUser2();
+    void slotUser3();
+
 private:
     
+    void readUserSettings();
+    void writeUserSettings();
+    void resetValues();     
+    void prepareEffect();
+    void prepareFinal();
+    void abortPreview();
+    void putPreviewData();
+    void putFinalData();
+    void renderingFinished();
+
+private:
+    
     Digikam::DImg    m_img;
     
     KIntNumInput    *m_matrixSize;
@@ -52,21 +68,6 @@
     KDoubleNumInput *m_gauss;
     KDoubleNumInput *m_correlation;
     KDoubleNumInput *m_noise;
-    
-private slots:
-
-    void slotUser2();
-    void slotUser3();
-
-protected:
-    
-    void prepareEffect(void);
-    void prepareFinal(void);
-    void abortPreview(void);
-    void putPreviewData(void);
-    void putFinalData(void);
-    void resetValues(void);   
-    void renderingFinished(void);
 };
 
 }  // NameSpace DigikamRefocusImagesPlugin
--- trunk/extragear/graphics/digikamimageplugins/refocus/imageplugin_refocus.h #624612:624613
@@ -1,10 +1,9 @@
 /* ============================================================
- * File  : imageplugin_refocus.h
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2005-04-29
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2005-04-29
  * Description : 
  * 
- * Copyright 2005 by Gilles Caulier
+ * Copyright 2005-2007 by Gilles Caulier
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -41,14 +40,13 @@
 
     void setEnabledActions(bool enable);
 
-private:
-
-    KAction *m_refocusAction;
-   
 private slots:
 
     void slotRefocus();
 
+private:
+
+    KAction *m_refocusAction;
 };
     
 #endif /* IMAGEPLUGIN_REFOCUS_H */



More information about the Digikam-devel mailing list