[Digikam-devel] extragear/graphics/digikam/imageplugins/antivignetting
Gilles Caulier
caulier.gilles at gmail.com
Thu Jul 5 10:30:40 BST 2007
SVN commit 683775 by cgilles:
digiKam from trunk : complete KDE4 port of Antivignetting image plugin.
CCMAIL: digikam-devel at kde.org
M +10 -17 CMakeLists.txt
M +33 -39 imageeffect_antivignetting.cpp
M +0 -2 imageeffect_antivignetting.h
M +4 -2 imageplugin_antivignetting.cpp
M +1 -2 imageplugin_antivignetting.h
--- trunk/extragear/graphics/digikam/imageplugins/antivignetting/CMakeLists.txt #683774:683775
@@ -1,23 +1,16 @@
-include_directories( ${CMAKE_SOURCE_DIR}/digikam/utilities/imageeditor/editor ${CMAKE_SOURCE_DIR}/digikam/utilities/imageeditor/canvas ${CMAKE_SOURCE_DIR}/digikam/libs/histogram ${CMAKE_SOURCE_DIR}/digikam/libs/levels ${CMAKE_SOURCE_DIR}/digikam/libs/curves ${CMAKE_SOURCE_DIR}/digikam/libs/whitebalance ${CMAKE_SOURCE_DIR}/digikam/libs/widgets/common ${CMAKE_SOURCE_DIR}/digikam/libs/widgets/iccprofiles ${CMAKE_SOURCE_DIR}/digikam/libs/widgets/imageplugins ${CMAKE_SOURCE_DIR}/digikam/libs/dialogs ${CMAKE_SOURCE_DIR}/digikam/libs/dimg ${CMAKE_SOURCE_DIR}/digikam/libs/dmetadata ${CMAKE_SOURCE_DIR}/digikam/libs/dimg/filters ${CMAKE_SOURCE_DIR}/digikam/digikam )
+SET(digikamimageplugin_antivignetting_PART_SRCS imageplugin_antivignetting.cpp
+ imageeffect_antivignetting.cpp
+ antivignetting.cpp
+ )
+KDE4_AUTOMOC(${digikamimageplugin_antivignetting_PART_SRCS})
-########### next target ###############
+KDE4_ADD_PLUGIN(digikamimageplugin_antivignetting ${digikamimageplugin_antivignetting_PART_SRCS})
-set(digikamimageplugin_antivignetting_PART_SRCS imageplugin_antivignetting.cpp imageeffect_antivignetting.cpp antivignetting.cpp )
+TARGET_LINK_LIBRARIES(digikamimageplugin_antivignetting digikam )
+INSTALL(TARGETS digikamimageplugin_antivignetting DESTINATION ${PLUGIN_INSTALL_DIR})
-kde4_automoc(${digikamimageplugin_antivignetting_PART_SRCS})
-
-kde4_add_plugin(digikamimageplugin_antivignetting ${digikamimageplugin_antivignetting_PART_SRCS})
-
-target_link_libraries(digikamimageplugin_antivignetting digikam )
-
-install(TARGETS digikamimageplugin_antivignetting DESTINATION ${PLUGIN_INSTALL_DIR} )
-
-
-########### install files ###############
-
-install( FILES digikamimageplugin_antivignetting_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam )
-install( FILES digikamimageplugin_antivignetting.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
+INSTALL(FILES digikamimageplugin_antivignetting_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam)
+INSTALL(FILES digikamimageplugin_antivignetting.desktop DESTINATION ${SERVICES_INSTALL_DIR})
--- trunk/extragear/graphics/digikam/imageplugins/antivignetting/imageeffect_antivignetting.cpp #683774:683775
@@ -24,17 +24,14 @@
// Qt includes.
-#include <qlabel.h>
+#include <QLabel>
+#include <QImage>
+#include <QPixmap>
+#include <QPainter>
+#include <QPen>
+#include <QTabWidget>
+#include <QGridLayout>
-#include <qlayout.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qtabwidget.h>
-//Added by qt3to4:
-#include <Q3GridLayout>
-
// KDE includes.
#include <kconfig.h>
@@ -88,15 +85,13 @@
// -------------------------------------------------------------
- QWidget *gboxSettings = new QWidget(this);
- setMainWidget(gboxSettings);
- Q3GridLayout* gridSettings = new Q3GridLayout( gboxSettings, 13, 2, spacingHint());
+ QWidget *gboxSettings = new QWidget(mainWidget());
+ QGridLayout* gridSettings = new QGridLayout(gboxSettings);
m_maskPreviewLabel = new QLabel( gboxSettings );
m_maskPreviewLabel->setAlignment ( Qt::AlignHCenter | Qt::AlignVCenter );
m_maskPreviewLabel->setWhatsThis( i18n("<p>You can see here a thumbnail preview of the anti-vignetting "
- "mask applied to the image.") );
- gridSettings->addMultiCellWidget(m_maskPreviewLabel, 0, 0, 0, 2);
+ "mask applied to the image.") );
// -------------------------------------------------------------
@@ -105,12 +100,9 @@
m_densityInput = new KDoubleNumInput(gboxSettings);
m_densityInput->setPrecision(1);
m_densityInput->setRange(1.0, 20.0, 0.1, true);
- m_densityInput->setWhatsThis( i18n("<p>This value controls the degree of intensity attenuation by the filter "
- "at its point of maximum density."));
+ m_densityInput->setWhatsThis( i18n("<p>This value controls the degree of intensity attenuation "
+ "by the filter at its point of maximum density."));
- gridSettings->addMultiCellWidget(label1, 1, 1, 0, 2);
- gridSettings->addMultiCellWidget(m_densityInput, 2, 2, 0, 2);
-
// -------------------------------------------------------------
QLabel *label2 = new QLabel(i18n("Power:"), gboxSettings);
@@ -118,12 +110,9 @@
m_powerInput = new KDoubleNumInput(gboxSettings);
m_powerInput->setPrecision(1);
m_powerInput->setRange(0.1, 2.0, 0.1, true);
- m_powerInput->setWhatsThis( i18n("<p>This value is used as the exponent controlling the fall-off in density "
- "from the center of the filter to the periphery."));
+ m_powerInput->setWhatsThis( i18n("<p>This value is used as the exponent controlling the "
+ "fall-off in density from the center of the filter to the periphery."));
- gridSettings->addMultiCellWidget(label2, 3, 3, 0, 2);
- gridSettings->addMultiCellWidget(m_powerInput, 4, 4, 0, 2);
-
// -------------------------------------------------------------
QLabel *label3 = new QLabel(i18n("Radius:"), gboxSettings);
@@ -131,15 +120,11 @@
m_radiusInput = new KDoubleNumInput(gboxSettings);
m_radiusInput->setPrecision(1);
m_radiusInput->setRange(-100.0, 100.0, 0.1, true);
- m_radiusInput->setWhatsThis( i18n("<p>This value is the radius of the center filter. It is a multiple of the "
- "half-diagonal measure of the image, at which the density of the filter falls "
- "to zero."));
+ m_radiusInput->setWhatsThis( i18n("<p>This value is the radius of the center filter. It is a "
+ "multiple of the half-diagonal measure of the image, at which "
+ "the density of the filter falls to zero."));
- gridSettings->addMultiCellWidget(label3, 5, 5, 0, 2);
- gridSettings->addMultiCellWidget(m_radiusInput, 6, 6, 0, 2);
-
KSeparator *line = new KSeparator (Qt::Horizontal, gboxSettings);
- gridSettings->addMultiCellWidget(line, 7, 7, 0, 2);
// -------------------------------------------------------------
@@ -149,9 +134,6 @@
m_brightnessInput->setRange(0, 100, 1, true);
m_brightnessInput->setWhatsThis( i18n("<p>Set here the brightness re-adjustment of the target image."));
- gridSettings->addMultiCellWidget(label4, 8, 8, 0, 2);
- gridSettings->addMultiCellWidget(m_brightnessInput, 9, 9, 0, 2);
-
// -------------------------------------------------------------
QLabel *label5 = new QLabel(i18n("Contrast:"), gboxSettings);
@@ -160,9 +142,6 @@
m_contrastInput->setRange(0, 100, 1, true);
m_contrastInput->setWhatsThis( i18n("<p>Set here the contrast re-adjustment of the target image."));
- gridSettings->addMultiCellWidget(label5, 10, 10, 0, 2);
- gridSettings->addMultiCellWidget(m_contrastInput, 11, 11, 0, 2);
-
// -------------------------------------------------------------
QLabel *label6 = new QLabel(i18n("Gamma:"), gboxSettings);
@@ -173,8 +152,24 @@
m_gammaInput->setValue(1.0);
m_gammaInput->setWhatsThis( i18n("<p>Set here the gamma re-adjustment of the target image."));
+ // -------------------------------------------------------------
+
+ gridSettings->addMultiCellWidget(m_maskPreviewLabel, 0, 0, 0, 2);
+ gridSettings->addMultiCellWidget(label1, 1, 1, 0, 2);
+ gridSettings->addMultiCellWidget(m_densityInput, 2, 2, 0, 2);
+ gridSettings->addMultiCellWidget(label2, 3, 3, 0, 2);
+ gridSettings->addMultiCellWidget(m_powerInput, 4, 4, 0, 2);
+ gridSettings->addMultiCellWidget(label3, 5, 5, 0, 2);
+ gridSettings->addMultiCellWidget(m_radiusInput, 6, 6, 0, 2);
+ gridSettings->addMultiCellWidget(line, 7, 7, 0, 2);
+ gridSettings->addMultiCellWidget(label4, 8, 8, 0, 2);
+ gridSettings->addMultiCellWidget(m_brightnessInput, 9, 9, 0, 2);
+ gridSettings->addMultiCellWidget(label5, 10, 10, 0, 2);
+ gridSettings->addMultiCellWidget(m_contrastInput, 11, 11, 0, 2);
gridSettings->addMultiCellWidget(label6, 12, 12, 0, 2);
gridSettings->addMultiCellWidget(m_gammaInput, 13, 13, 0, 2);
+ gridSettings->setMargin(spacingHint());
+ gridSettings->setSpacing(spacingHint());
setUserAreaWidget(gboxSettings);
@@ -381,4 +376,3 @@
}
} // NameSpace DigikamAntiVignettingImagesPlugin
-
--- trunk/extragear/graphics/digikam/imageplugins/antivignetting/imageeffect_antivignetting.h #683774:683775
@@ -28,8 +28,6 @@
// Digikam includes.
#include "imageguidedlg.h"
-//Added by qt3to4:
-#include <QLabel>
class QLabel;
--- trunk/extragear/graphics/digikam/imageplugins/antivignetting/imageplugin_antivignetting.cpp #683774:683775
@@ -46,7 +46,10 @@
{
m_antivignettingAction = new KAction(KIcon("antivignetting"), i18n("Vignetting..."), this);
actionCollection()->addAction("imageplugin_antivignetting", m_antivignettingAction );
- connect(m_antivignettingAction, SIGNAL(triggered(bool) ), SLOT(slotAntiVignetting()));
+
+ connect(m_antivignettingAction, SIGNAL(triggered(bool)),
+ this, SLOT(slotAntiVignetting()));
+
setXMLFile("digikamimageplugin_antivignetting_ui.rc");
DDebug() << "ImagePlugin_AntiVignetting plugin loaded" << endl;
@@ -66,4 +69,3 @@
DigikamAntiVignettingImagesPlugin::ImageEffect_AntiVignetting dlg(parentWidget());
dlg.exec();
}
-
--- trunk/extragear/graphics/digikam/imageplugins/antivignetting/imageplugin_antivignetting.h #683774:683775
@@ -38,8 +38,7 @@
public:
- ImagePlugin_AntiVignetting(QObject *parent,
- const QStringList &args);
+ ImagePlugin_AntiVignetting(QObject *parent, const QStringList &args);
~ImagePlugin_AntiVignetting();
void setEnabledActions(bool enable);
More information about the Digikam-devel
mailing list