[Digikam-devel] extragear/graphics/digikamimageplugins/unsharp
Gilles Caulier
caulier.gilles at kdemail.net
Wed Jan 17 12:42:54 GMT 2007
SVN commit 624597 by cgilles:
digiKam from trunk : Unsharp Mask Tool : remember the settings between plugin sessions
CCMAIL: digikam-devel at kde.org
M +29 -4 imageeffect_unsharp.cpp
M +12 -11 imageeffect_unsharp.h
M +2 -3 imageplugin_unsharp.cpp
M +4 -6 imageplugin_unsharp.h
--- trunk/extragear/graphics/digikamimageplugins/unsharp/imageeffect_unsharp.cpp #624596:624597
@@ -1,10 +1,9 @@
/* ============================================================
- * File : imageeffect_unsharp.cpp
* Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
* Date : 2004-08-27
* Description : Unsharp mask 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
@@ -30,6 +29,7 @@
// KDE includes.
+#include <kconfig.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <knuminput.h>
@@ -42,6 +42,7 @@
#include "version.h"
#include "unsharp.h"
#include "imageeffect_unsharp.h"
+#include "imageeffect_unsharp.moc"
namespace DigikamUnsharpMaskImagesPlugin
{
@@ -58,7 +59,7 @@
digikamimageplugins_version,
I18N_NOOP("An unsharp mask 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");
@@ -133,6 +134,31 @@
m_thresholdInput->setEnabled(true);
}
+void ImageEffect_Unsharp::readUserSettings()
+{
+ KConfig* config = kapp->config();
+ config->setGroup("unsharp Tool Dialog");
+ m_radiusInput->blockSignals(true);
+ m_amountInput->blockSignals(true);
+ m_thresholdInput->blockSignals(true);
+ m_radiusInput->setValue(config->readNumEntry("RadiusAjustment", 1));
+ m_amountInput->setValue(config->readDoubleNumEntry("AmountAjustment", 1.0));
+ m_thresholdInput->setValue(config->readDoubleNumEntry("ThresholdAjustment", 0.05));
+ m_radiusInput->blockSignals(false);
+ m_amountInput->blockSignals(false);
+ m_thresholdInput->blockSignals(false);
+}
+
+void ImageEffect_Unsharp::writeUserSettings()
+{
+ KConfig* config = kapp->config();
+ config->setGroup("unsharp Tool Dialog");
+ config->writeEntry("RadiusAjustment", m_radiusInput->value());
+ config->writeEntry("AmountAjustment", m_amountInput->value());
+ config->writeEntry("ThresholdAjustment", m_thresholdInput->value());
+ config->sync();
+}
+
void ImageEffect_Unsharp::resetValues()
{
m_radiusInput->blockSignals(true);
@@ -199,4 +225,3 @@
} // NameSpace DigikamUnsharpMaskImagesPlugin
-#include "imageeffect_unsharp.moc"
--- trunk/extragear/graphics/digikamimageplugins/unsharp/imageeffect_unsharp.h #624596:624597
@@ -1,10 +1,9 @@
/* ============================================================
- * File : imageeffect_unsharp.h
* Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
* Date : 2004-08-27
* Description : Unsharp mask 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
@@ -42,20 +41,22 @@
~ImageEffect_Unsharp();
private:
+
+ void readUserSettings();
+ void writeUserSettings();
+ void resetValues();
+ void prepareEffect();
+ void prepareFinal();
+ void putPreviewData();
+ void putFinalData();
+ void renderingFinished();
+
+private:
KIntNumInput *m_radiusInput;
KDoubleNumInput *m_amountInput;
KDoubleNumInput *m_thresholdInput;
-
-protected:
-
- void prepareEffect(void);
- void prepareFinal(void);
- void putPreviewData(void);
- void putFinalData(void);
- void resetValues(void);
- void renderingFinished(void);
};
} // NameSpace DigikamUnsharpMaskImagesPlugin
--- trunk/extragear/graphics/digikamimageplugins/unsharp/imageplugin_unsharp.cpp #624596:624597
@@ -1,10 +1,9 @@
/* ============================================================
- * File : imageplugin_unsharp.h
* Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
* Date : 2004-08-27
* 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_unsharp.h"
#include "imageplugin_unsharp.h"
+#include "imageplugin_unsharp.moc"
K_EXPORT_COMPONENT_FACTORY( digikamimageplugin_unsharp,
KGenericFactory<ImagePlugin_Unsharp>("digikamimageplugin_unsharp"));
@@ -68,4 +68,3 @@
delete headerFrame;
}
-#include "imageplugin_unsharp.moc"
--- trunk/extragear/graphics/digikamimageplugins/unsharp/imageplugin_unsharp.h #624596:624597
@@ -1,10 +1,9 @@
/* ============================================================
- * File : imageplugin_unsharp.h
* Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
* Date : 2004-08-27
* 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
@@ -40,14 +39,13 @@
void setEnabledActions(bool enable);
-private:
-
- KAction *m_unsharpAction;
-
private slots:
void slotUnsharp();
+private:
+
+ KAction *m_unsharpAction;
};
#endif /* IMAGEPLUGIN_UNSHARP_H */
More information about the Digikam-devel
mailing list