[Digikam-devel] extragear/graphics/digikamimageplugins/noisereduction
Gilles Caulier
caulier.gilles at kdemail.net
Wed Jan 17 13:39:01 GMT 2007
SVN commit 624619 by cgilles:
digiKam from trunk : Noise Reduction Tool : remember the settings between plugin sessions
CCMAIL: digikam-devel at kde.org
M +59 -4 imageeffect_noisereduction.cpp
M +17 -16 imageeffect_noisereduction.h
M +5 -5 imageplugin_noisereduction.cpp
M +6 -9 imageplugin_noisereduction.h
--- trunk/extragear/graphics/digikamimageplugins/noisereduction/imageeffect_noisereduction.cpp #624618:624619
@@ -1,12 +1,11 @@
/* ============================================================
- * File : imageeffect_noisereduction.cpp
* Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
* Peter Heckert <peter dot heckert at arcor dot de>
* Date : 2004-08-24
* Description : noise reduction image filter for digiKam
* image editor.
*
- * Copyright 2004-2006 by Gilles Caulier
+ * Copyright 2004-2007 by Gilles Caulier
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
@@ -45,12 +44,14 @@
#include <kfiledialog.h>
#include <kglobalsettings.h>
#include <kmessagebox.h>
+#include <kconfig.h>
// Local includes.
#include "version.h"
#include "noisereduction.h"
#include "imageeffect_noisereduction.h"
+#include "imageeffect_noisereduction.moc"
namespace DigikamNoiseReductionImagesPlugin
{
@@ -66,7 +67,7 @@
digikamimageplugins_version,
I18N_NOOP("A noise reduction image filter plugin for digiKam."),
KAboutData::License_GPL,
- "(c) 2004-2006, Gilles Caulier",
+ "(c) 2004-2007, Gilles Caulier",
0,
"http://extragear.kde.org/apps/digikamimageplugins");
@@ -304,6 +305,61 @@
m_phaseInput->setEnabled(true);
}
+void ImageEffect_NoiseReduction::readUserSettings()
+{
+ KConfig* config = kapp->config();
+ config->setGroup("noisereduction Tool Dialog");
+ m_radiusInput->setEnabled(true);
+ m_lumToleranceInput->setEnabled(true);
+ m_thresholdInput->setEnabled(true);
+ m_textureInput->setEnabled(true);
+ m_sharpnessInput->setEnabled(true);
+ m_csmoothInput->setEnabled(true);
+ m_lookaheadInput->setEnabled(true);
+ m_gammaInput->setEnabled(true);
+ m_dampingInput->setEnabled(true);
+ m_phaseInput->setEnabled(true);
+
+ m_radiusInput->setValue(config->readDoubleNumEntry("RadiusAjustment", 1.0));
+ m_lumToleranceInput->setValue(config->readDoubleNumEntry("LumToleranceAjustment", 1.0));
+ m_thresholdInput->setValue(config->readDoubleNumEntry("ThresholdAjustment", 0.08));
+ m_textureInput->setValue(config->readDoubleNumEntry("TextureAjustment", 0.0));
+ m_sharpnessInput->setValue(config->readDoubleNumEntry("SharpnessAjustment", 0.25));
+ m_csmoothInput->setValue(config->readDoubleNumEntry("CsmoothAjustment", 1.0));
+ m_lookaheadInput->setValue(config->readDoubleNumEntry("LookAheadAjustment", 2.0));
+ m_gammaInput->setValue(config->readDoubleNumEntry("GammaAjustment", 1.4));
+ m_dampingInput->setValue(config->readDoubleNumEntry("DampingAjustment", 5.0));
+ m_phaseInput->setValue(config->readDoubleNumEntry("PhaseAjustment", 1.0));
+
+ m_radiusInput->setEnabled(false);
+ m_lumToleranceInput->setEnabled(false);
+ m_thresholdInput->setEnabled(false);
+ m_textureInput->setEnabled(false);
+ m_sharpnessInput->setEnabled(false);
+ m_csmoothInput->setEnabled(false);
+ m_lookaheadInput->setEnabled(false);
+ m_gammaInput->setEnabled(false);
+ m_dampingInput->setEnabled(false);
+ m_phaseInput->setEnabled(false);
+}
+
+void ImageEffect_NoiseReduction::writeUserSettings()
+{
+ KConfig* config = kapp->config();
+ config->setGroup("noisereduction Tool Dialog");
+ config->writeEntry("RadiusAjustment", m_radiusInput->value());
+ config->writeEntry("LumToleranceAjustment", m_lumToleranceInput->value());
+ config->writeEntry("ThresholdAjustment", m_thresholdInput->value());
+ config->writeEntry("TextureAjustment", m_textureInput->value());
+ config->writeEntry("SharpnessAjustment", m_sharpnessInput->value());
+ config->writeEntry("CsmoothAjustment", m_csmoothInput->value());
+ config->writeEntry("LookAheadAjustment", m_lookaheadInput->value());
+ config->writeEntry("GammaAjustment", m_gammaInput->value());
+ config->writeEntry("DampingAjustment", m_dampingInput->value());
+ config->writeEntry("PhaseAjustment", m_phaseInput->value());
+ config->sync();
+}
+
void ImageEffect_NoiseReduction::resetValues()
{
m_radiusInput->setEnabled(true);
@@ -486,4 +542,3 @@
} // NameSpace DigikamNoiseReductionImagesPlugin
-#include "imageeffect_noisereduction.moc"
--- trunk/extragear/graphics/digikamimageplugins/noisereduction/imageeffect_noisereduction.h #624618:624619
@@ -1,12 +1,11 @@
/* ============================================================
- * File : imageeffect_noisereduction.h
* Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
* Peter Heckert <peter dot heckert at arcor dot de>
* Date : 2004-08-24
* Description : noise reduction image filter for digiKam
* image editor.
*
- * Copyright 2004-2006 by Gilles Caulier
+ * Copyright 2004-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,7 +40,23 @@
ImageEffect_NoiseReduction(QWidget* parent, QString title, QFrame* banner);
~ImageEffect_NoiseReduction();
+
+private:
+
+ void readUserSettings();
+ void writeUserSettings();
+ void resetValues();
+ void prepareEffect();
+ void prepareFinal();
+ void putPreviewData();
+ void putFinalData();
+ void renderingFinished();
+private slots:
+
+ void slotUser2();
+ void slotUser3();
+
private:
KDoubleNumInput *m_radiusInput;
@@ -55,20 +70,6 @@
KDoubleNumInput *m_gammaInput;
KDoubleNumInput *m_dampingInput;
KDoubleNumInput *m_phaseInput;
-
-private slots:
-
- void slotUser2();
- void slotUser3();
-
-protected:
-
- void prepareEffect(void);
- void prepareFinal(void);
- void putPreviewData(void);
- void putFinalData(void);
- void resetValues(void);
- void renderingFinished(void);
};
} // NameSpace DigikamNoiseReductionImagesPlugin
--- trunk/extragear/graphics/digikamimageplugins/noisereduction/imageplugin_noisereduction.cpp #624618:624619
@@ -1,10 +1,9 @@
/* ============================================================
- * File : imageplugin_noisereduction.cpp
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date : 2004-08-24
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date : 2004-08-24
* Description :
*
- * Copyright 2004-2006 by Gilles Caulier
+ * Copyright 2004-2007 by Gilles Caulier
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
@@ -32,6 +31,7 @@
#include "bannerwidget.h"
#include "imageeffect_noisereduction.h"
#include "imageplugin_noisereduction.h"
+#include "imageplugin_noisereduction.moc"
K_EXPORT_COMPONENT_FACTORY( digikamimageplugin_despeckle,
KGenericFactory<ImagePlugin_NoiseReduction>("digikamimageplugin_despeckle"));
@@ -67,4 +67,4 @@
delete headerFrame;
}
-#include "imageplugin_noisereduction.moc"
+
--- trunk/extragear/graphics/digikamimageplugins/noisereduction/imageplugin_noisereduction.h #624618:624619
@@ -1,10 +1,9 @@
/* ============================================================
- * File : imageplugin_noisereduction.h
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date : 2004-08-24
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date : 2004-08-24
* Description :
*
- * Copyright 2004-2006 by Gilles Caulier
+ * Copyright 2004-2007 by Gilles Caulier
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
@@ -19,7 +18,6 @@
*
* ============================================================ */
-
#ifndef IMAGEPLUGIN_NOISEREDUCTION_H
#define IMAGEPLUGIN_NOISEREDUCTION_H
@@ -41,14 +39,13 @@
void setEnabledActions(bool enable);
-private:
-
- KAction *m_noiseReductionAction;
-
private slots:
void slotNoiseReduction();
+private:
+
+ KAction *m_noiseReductionAction;
};
#endif /* IMAGEPLUGIN_NOISEREDUCTION_H */
More information about the Digikam-devel
mailing list