[Digikam-devel] extragear/graphics/digikam/imageplugins

Gilles Caulier caulier.gilles at kdemail.net
Mon Jan 8 13:40:56 GMT 2007


SVN commit 621174 by cgilles:

digikam from trunk : Hues/Saturation/Lightness image editor tool : add Hue and Saturation settings preview applied to a gradient of color like Photoshop do. It more easy to see how the color will be translated to compare the reference color gradient provided bye the HS Selector and this preview.

CCMAIL: digikam-devel at kde.org

 M  +19 -19    Makefile.am  
 AM            hspreviewwidget.cpp   [License: GPL]
 AM            hspreviewwidget.h   [License: GPL]
 M  +21 -12    imageeffect_hsl.cpp  
 M  +22 -19    imageeffect_hsl.h  


--- trunk/extragear/graphics/digikam/imageplugins/Makefile.am #621173:621174
@@ -1,32 +1,32 @@
 METASOURCES = AUTO
 
 INCLUDES = -I$(top_srcdir)/digikam/utilities/imageeditor/editor \
-	       -I$(top_srcdir)/digikam/utilities/imageeditor/canvas \
-	       -I$(top_srcdir)/digikam/libs/histogram \
-	       -I$(top_srcdir)/digikam/libs/levels \
-	       -I$(top_srcdir)/digikam/libs/curves \
-	       -I$(top_srcdir)/digikam/libs/widgets/common \
-	       -I$(top_srcdir)/digikam/libs/widgets/iccprofiles \
-	       -I$(top_srcdir)/digikam/libs/widgets/imageplugins \
-	       -I$(top_srcdir)/digikam/libs/dialogs \
-	       -I$(top_srcdir)/digikam/libs/dimg \
-	       -I$(top_srcdir)/digikam/libs/dmetadata \
-	       -I$(top_srcdir)/digikam/libs/dimg/filters \
-	       -I$(top_srcdir)/digikam/digikam \
-	       $(all_includes) 
+	   -I$(top_srcdir)/digikam/utilities/imageeditor/canvas \
+	   -I$(top_srcdir)/digikam/libs/histogram \
+	   -I$(top_srcdir)/digikam/libs/levels \
+	   -I$(top_srcdir)/digikam/libs/curves \
+	   -I$(top_srcdir)/digikam/libs/widgets/common \
+	   -I$(top_srcdir)/digikam/libs/widgets/iccprofiles \
+	   -I$(top_srcdir)/digikam/libs/widgets/imageplugins \
+	   -I$(top_srcdir)/digikam/libs/dialogs \
+	   -I$(top_srcdir)/digikam/libs/dimg \
+	   -I$(top_srcdir)/digikam/libs/dmetadata \
+	   -I$(top_srcdir)/digikam/libs/dimg/filters \
+	   -I$(top_srcdir)/digikam/digikam \
+	   $(all_includes) 
 
-digikamimageplugin_core_la_SOURCES = imageplugin_core.cpp  imageeffect_sharpen.cpp \
-	                                 imageeffect_autocorrection.cpp imageeffect_bwsepia.cpp \
-	                                 imageeffect_ratiocrop.cpp imageeffect_rgb.cpp \
-	                                 imageeffect_redeye.cpp imageeffect_blur.cpp \
-	                                 imageeffect_hsl.cpp imageeffect_iccproof.cpp imageeffect_bcg.cpp 
+digikamimageplugin_core_la_SOURCES = hspreviewwidget.cpp imageplugin_core.cpp  imageeffect_sharpen.cpp \
+	                             imageeffect_autocorrection.cpp imageeffect_bwsepia.cpp \
+	                             imageeffect_ratiocrop.cpp imageeffect_rgb.cpp \
+	                             imageeffect_redeye.cpp imageeffect_blur.cpp \
+	                             imageeffect_hsl.cpp imageeffect_iccproof.cpp imageeffect_bcg.cpp 
 
 noinst_HEADERS = imageeffect_autocorrection.h imageeffect_blur.h imageeffect_hsl.h \
                  imageeffect_ratiocrop.h imageeffect_rgb.h imageplugin_core.h imageeffect_bcg.h \
                  imageeffect_bwsepia.h imageeffect_iccproof.h imageeffect_redeye.h imageeffect_sharpen.h 
 
 digikamimageplugin_core_la_LIBADD = $(LIB_KPARTS) \
-	                                $(top_builddir)/digikam/digikam/libdigikam.la
+	                            $(top_builddir)/digikam/digikam/libdigikam.la
 
 digikamimageplugin_core_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
 
** trunk/extragear/graphics/digikam/imageplugins/hspreviewwidget.cpp #property svn:eol-style
   + native
** trunk/extragear/graphics/digikam/imageplugins/hspreviewwidget.h #property svn:eol-style
   + native
--- trunk/extragear/graphics/digikam/imageplugins/imageeffect_hsl.cpp #621173:621174
@@ -1,10 +1,10 @@
 /* ============================================================
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2004-07-16
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2004-07-16
  * Description : digiKam image editor Hue/Saturation/Lightness 
  *               correction tool
  * 
- * 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
@@ -57,6 +57,7 @@
 
 // Local includes.
 
+#include "hspreviewwidget.h"
 #include "imageeffect_hsl.h"
 #include "imageeffect_hsl.moc"
 
@@ -79,7 +80,7 @@
     // -------------------------------------------------------------
     
     QWidget *gboxSettings     = new QWidget(plainPage());
-    QGridLayout* gridSettings = new QGridLayout( gboxSettings, 10, 4, marginHint(), spacingHint());
+    QGridLayout* gridSettings = new QGridLayout( gboxSettings, 12, 4, marginHint(), spacingHint());
 
     QLabel *label1 = new QLabel(i18n("Channel:"), gboxSettings);
     label1->setAlignment ( Qt::AlignRight | Qt::AlignVCenter );
@@ -143,17 +144,24 @@
     // -------------------------------------------------------------
 
     m_HSSelector = new KHSSelector(gboxSettings);
+    QWhatsThis::add( m_HSSelector, i18n("<p>Select here the hue and saturation adjustments of the image."));
     m_HSSelector->setMinimumSize(256, 142);
     gridSettings->addMultiCellWidget(m_HSSelector, 3, 3, 0, 4);
 
+    m_HSPreview = new HSPreviewWidget(gboxSettings, spacingHint());
+    QWhatsThis::add( m_HSPreview, i18n("<p>You can see here the color preview of hue and "
+                                       "saturation adjustments."));
+    m_HSPreview->setMinimumSize(256, 15);
+    gridSettings->addMultiCellWidget(m_HSPreview, 4, 4, 0, 4);
+
     QLabel *label2 = new QLabel(i18n("Hue:"), gboxSettings);
     m_hInput       = new KDoubleNumInput(gboxSettings);
     m_hInput->setPrecision(0);
     m_hInput->setRange(-180.0, 180.0, 1.0, true);
     m_hInput->setValue(0.0);
     QWhatsThis::add( m_hInput, i18n("<p>Set here the hue adjustment of the image."));
-    gridSettings->addMultiCellWidget(label2, 4, 4, 0, 4);
-    gridSettings->addMultiCellWidget(m_hInput, 5, 5, 0, 4);
+    gridSettings->addMultiCellWidget(label2, 5, 5, 0, 4);
+    gridSettings->addMultiCellWidget(m_hInput, 6, 6, 0, 4);
 
     QLabel *label3 = new QLabel(i18n("Saturation:"), gboxSettings);
     m_sInput       = new KDoubleNumInput(gboxSettings);
@@ -161,8 +169,8 @@
     m_sInput->setRange(-100.0, 100.0, 0.01, true);
     m_sInput->setValue(0.0);
     QWhatsThis::add( m_sInput, i18n("<p>Set here the saturation adjustment of the image."));
-    gridSettings->addMultiCellWidget(label3, 6, 6, 0, 4);
-    gridSettings->addMultiCellWidget(m_sInput, 7, 7, 0, 4);
+    gridSettings->addMultiCellWidget(label3, 7, 7, 0, 4);
+    gridSettings->addMultiCellWidget(m_sInput, 8, 8, 0, 4);
 
     QLabel *label4 = new QLabel(i18n("Lightness:"), gboxSettings);
     m_lInput       = new KDoubleNumInput(gboxSettings);
@@ -170,16 +178,16 @@
     m_lInput->setRange(-100.0, 100.0, 0.01, true);
     m_lInput->setValue(0.0);
     QWhatsThis::add( m_lInput, i18n("<p>Set here the lightness adjustment of the image."));    
-    gridSettings->addMultiCellWidget(label4, 8, 8, 0, 4);
-    gridSettings->addMultiCellWidget(m_lInput, 9, 9, 0, 4);
+    gridSettings->addMultiCellWidget(label4, 9, 9, 0, 4);
+    gridSettings->addMultiCellWidget(m_lInput, 10, 10, 0, 4);
 
     m_overExposureIndicatorBox = new QCheckBox(i18n("Over exposure indicator"), gboxSettings);
     QWhatsThis::add( m_overExposureIndicatorBox, i18n("<p>If you enable this option, over-exposed pixels "
                     "from the target image preview will be over-colored. "
                     "This will not have an effect on the final rendering."));
-    gridSettings->addMultiCellWidget(m_overExposureIndicatorBox, 10, 10, 0, 4);
+    gridSettings->addMultiCellWidget(m_overExposureIndicatorBox, 11, 11, 0, 4);
 
-    gridSettings->setRowStretch(11, 10);
+    gridSettings->setRowStretch(12, 10);
     setUserAreaWidget(gboxSettings);
 
     // -------------------------------------------------------------
@@ -337,6 +345,7 @@
     
     enableButtonOK( hu != 0.0 || sa != 0.0 || lu != 0.0);
     
+    m_HSPreview->setHS(hu, sa);
     m_histogramWidget->stopHistogramComputation();
 
     if (m_destinationPreviewData) 
--- trunk/extragear/graphics/digikam/imageplugins/imageeffect_hsl.h #621173:621174
@@ -1,10 +1,10 @@
 /* ============================================================
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2004-07-16
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2004-07-16
  * Description : digiKam image editor Hue/Saturation/Lightness 
  *               correction tool
  * 
- * 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
@@ -43,6 +43,7 @@
 
 namespace DigikamImagesPluginCore
 {
+class HSPreviewWidget;
 
 class ImageEffect_HSL : public Digikam::ImageDlgBase
 {
@@ -53,6 +54,21 @@
     ImageEffect_HSL(QWidget *parent);
     ~ImageEffect_HSL();
 
+private slots:
+
+    void slotDefault();
+    void slotEffect();
+    void slotChannelChanged(int channel);
+    void slotScaleChanged(int scale);
+    void slotColorSelectedFromTarget( const Digikam::DColor &color );
+    void slotHSChanged(int h, int s);
+    void slotHChanged(double h);
+    void slotSChanged(double s);
+
+protected:
+
+    void finalRendering();
+
 private:
 
     enum HistogramScale
@@ -82,27 +98,14 @@
     KDoubleNumInput              *m_lInput;
 
     KHSSelector                  *m_HSSelector;
-    
+
+    HSPreviewWidget              *m_HSPreview;    
+
     Digikam::ImageWidget         *m_previewWidget;
 
     Digikam::ColorGradientWidget *m_hGradient;
     
     Digikam::HistogramWidget     *m_histogramWidget;
-    
-private slots:
-
-    void slotDefault();
-    void slotEffect();
-    void slotChannelChanged(int channel);
-    void slotScaleChanged(int scale);
-    void slotColorSelectedFromTarget( const Digikam::DColor &color );
-    void slotHSChanged(int h, int s);
-    void slotHChanged(double h);
-    void slotSChanged(double s);
-
-protected:
-
-    void finalRendering();
 };
 
 }  // NameSpace DigikamImagesPluginCore



More information about the Digikam-devel mailing list