SVN commit 683840 by cgilles:
digiKam from trunk: complete KDE4 port of FilmGrain image plugin. CCMAIL: [hidden email] M +10 -16 CMakeLists.txt M +1 -1 filmgrain.cpp M +0 -1 filmgrain.h M +27 -19 imageeffect_filmgrain.cpp M +0 -1 imageeffect_filmgrain.h M +3 -1 imageplugin_filmgrain.cpp M +1 -2 imageplugin_filmgrain.h --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/CMakeLists.txt #683839:683840 @@ -1,22 +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_filmgrain_PART_SRCS imageplugin_filmgrain.cpp + imageeffect_filmgrain.cpp + filmgrain.cpp + ) +KDE4_AUTOMOC(${digikamimageplugin_filmgrain_PART_SRCS}) -########### next target ############### +KDE4_ADD_PLUGIN(digikamimageplugin_filmgrain ${digikamimageplugin_filmgrain_PART_SRCS}) -set(digikamimageplugin_filmgrain_PART_SRCS imageplugin_filmgrain.cpp imageeffect_filmgrain.cpp filmgrain.cpp) +TARGET_LINK_LIBRARIES(digikamimageplugin_filmgrain digikam) -kde4_automoc(${digikamimageplugin_filmgrain_PART_SRCS}) +INSTALL(TARGETS digikamimageplugin_filmgrain DESTINATION ${PLUGIN_INSTALL_DIR}) -kde4_add_plugin(digikamimageplugin_filmgrain ${digikamimageplugin_filmgrain_PART_SRCS}) - -target_link_libraries(digikamimageplugin_filmgrain digikam ) - -install(TARGETS digikamimageplugin_filmgrain DESTINATION ${PLUGIN_INSTALL_DIR} ) - - -########### install files ############### - -install( FILES digikamimageplugin_filmgrain_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam ) -install( FILES digikamimageplugin_filmgrain.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) - +INSTALL(FILES digikamimageplugin_filmgrain_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam) +INSTALL(FILES digikamimageplugin_filmgrain.desktop DESTINATION ${SERVICES_INSTALL_DIR}) --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/filmgrain.cpp #683839:683840 @@ -29,7 +29,7 @@ // Qt includes. -#include <qdatetime.h> +#include <QDateTime> // Local includes. --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/filmgrain.h #683839:683840 @@ -21,7 +21,6 @@ * GNU General Public License for more details. * * ============================================================ */ - #ifndef FILMGRAIN_H #define FILMGRAIN_H --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/imageeffect_filmgrain.cpp #683839:683840 @@ -25,15 +25,12 @@ // Qt includes. -#include <qlabel.h> +#include <QLabel> +#include <QLCDNumber> +#include <QSlider> +#include <QImage> +#include <QGridLayout> -#include <qlcdnumber.h> -#include <qslider.h> -#include <qlayout.h> -#include <qimage.h> -//Added by qt3to4: -#include <Q3GridLayout> - // KDE includes. #include <klocale.h> @@ -86,26 +83,36 @@ // ------------------------------------------------------------- - QWidget *gboxSettings = new QWidget(m_imagePreviewWidget); - Q3GridLayout* gridSettings = new Q3GridLayout( gboxSettings, 1, 1, 0, spacingHint()); - QLabel *label1 = new QLabel(i18n("Sensitivity (ISO):"), gboxSettings); + QWidget *gboxSettings = new QWidget(m_imagePreviewWidget); + QGridLayout* gridSettings = new QGridLayout( gboxSettings ); - m_sensibilitySlider = new QSlider(2, 30, 1, 12, Qt::Horizontal, gboxSettings); + QLabel *label1 = new QLabel(i18n("Sensitivity (ISO):"), gboxSettings); + + m_sensibilitySlider = new QSlider(Qt::Horizontal, gboxSettings); + m_sensibilitySlider->setMinimum(2); + m_sensibilitySlider->setMaximum(30); + m_sensibilitySlider->setPageStep(1); + m_sensibilitySlider->setValue(12); m_sensibilitySlider->setTracking ( false ); m_sensibilitySlider->setTickInterval(1); - m_sensibilitySlider->setTickmarks(QSlider::TicksBelow); + m_sensibilitySlider->setTickPosition(QSlider::TicksBelow); - m_sensibilityLCDValue = new QLCDNumber (4, gboxSettings); - m_sensibilityLCDValue->setSegmentStyle ( QLCDNumber::Flat ); + m_sensibilityLCDValue = new QLCDNumber(4, gboxSettings); + m_sensibilityLCDValue->setSegmentStyle( QLCDNumber::Flat ); m_sensibilityLCDValue->display( QString::number(2400) ); - whatsThis = i18n("<p>Set here the film ISO-sensitivity to use for simulating the film graininess."); + whatsThis = i18n("<p>Set here the film ISO-sensitivity to use for " + "simulating the film graininess."); m_sensibilityLCDValue->setWhatsThis( whatsThis); m_sensibilitySlider->setWhatsThis( whatsThis); + // ------------------------------------------------------------- + gridSettings->addMultiCellWidget(label1, 0, 0, 0, 1); gridSettings->addMultiCellWidget(m_sensibilitySlider, 1, 1, 0, 0); gridSettings->addMultiCellWidget(m_sensibilityLCDValue, 1, 1, 1, 1); + gridSettings->setMargin(spacingHint()); + gridSettings->setSpacing(spacingHint()); m_imagePreviewWidget->setUserAreaWidget(gboxSettings); @@ -169,7 +176,8 @@ Digikam::DImg image = m_imagePreviewWidget->getOriginalRegionImage(); int s = 400 + 200 * m_sensibilitySlider->value(); - m_threadedFilter = dynamic_cast<Digikam::DImgThreadedFilter *>(new FilmGrain(&image, this, s)); + m_threadedFilter = dynamic_cast<Digikam::DImgThreadedFilter *> + (new FilmGrain(&image, this, s)); } void ImageEffect_FilmGrain::prepareFinal() @@ -180,7 +188,8 @@ Digikam::ImageIface iface(0, 0); - m_threadedFilter = dynamic_cast<Digikam::DImgThreadedFilter *>(new FilmGrain(iface.getOriginalImg(), this, s)); + m_threadedFilter = dynamic_cast<Digikam::DImgThreadedFilter *> + (new FilmGrain(iface.getOriginalImg(), this, s)); } void ImageEffect_FilmGrain::putPreviewData(void) @@ -195,4 +204,3 @@ } } // NameSpace DigikamFilmGrainImagesPlugin - --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/imageeffect_filmgrain.h #683839:683840 @@ -23,7 +23,6 @@ * * ============================================================ */ - #ifndef IMAGEEFFECT_FILMGRAIN_H #define IMAGEEFFECT_FILMGRAIN_H --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/imageplugin_filmgrain.cpp #683839:683840 @@ -46,7 +46,9 @@ { m_filmgrainAction = new KAction(KIcon("filmgrain"), i18n("Add Film Grain..."), this); actionCollection()->addAction("imageplugin_filmgrain", m_filmgrainAction ); - connect(m_filmgrainAction, SIGNAL(triggered(bool) ), SLOT(slotFilmGrain())); + + connect(m_filmgrainAction, SIGNAL(triggered(bool)), + this, SLOT(slotFilmGrain())); setXMLFile( "digikamimageplugin_filmgrain_ui.rc" ); --- trunk/extragear/graphics/digikam/imageplugins/filmgrain/imageplugin_filmgrain.h #683839:683840 @@ -38,8 +38,7 @@ public: - ImagePlugin_FilmGrain(QObject *parent, - const QStringList &args); + ImagePlugin_FilmGrain(QObject *parent, const QStringList &args); ~ImagePlugin_FilmGrain(); void setEnabledActions(bool enable); _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |