SVN commit 505151 by cgilles:
DigikamImagePlugins from trunk : and finally, toogle preview mode to display original image automaticly when a pickup color button is used with any color correction tools. The preview mode is restored to previous mode when user has get the color from image. CCMAIL: [hidden email] M +13 -0 adjustcurves/adjustcurves.cpp M +7 -4 adjustcurves/adjustcurves.h M +14 -0 adjustlevels/adjustlevels.cpp M +7 -5 adjustlevels/adjustlevels.h M +21 -5 whitebalance/imageeffect_whitebalance.cpp M +6 -5 whitebalance/imageeffect_whitebalance.h --- trunk/extragear/graphics/digikamimageplugins/adjustcurves/adjustcurves.cpp #505150:505151 @@ -324,6 +324,9 @@ connect(m_resetButton, SIGNAL(clicked()), this, SLOT(slotResetCurrentChannel())); + + connect(m_pickerColorButtonGroup, SIGNAL(released(int)), + this, SLOT(slotPickerColorButtonActived())); } AdjustCurveDialog::~AdjustCurveDialog() @@ -339,6 +342,13 @@ delete m_curves; } +void AdjustCurveDialog::slotPickerColorButtonActived() +{ + // Save previous rendering mode and toggle to original image. + m_currentPreviewMode = m_previewWidget->getRenderingPreviewMode(); + m_previewWidget->setRenderingPreviewMode(Digikam::ImageGuideWidget::PreviewOriginalImage); +} + void AdjustCurveDialog::slotSpotColorChanged(const Digikam::DColor &color) { Digikam::DColor sc = color; @@ -382,6 +392,9 @@ m_curves->curvesCalculateCurve(i); m_curvesWidget->repaint(false); + + // restore previous rendering mode. + m_previewWidget->setRenderingPreviewMode(m_currentPreviewMode); slotEffect(); } --- trunk/extragear/graphics/digikamimageplugins/adjustcurves/adjustcurves.h #505150:505151 @@ -82,6 +82,7 @@ uchar *m_destinationPreviewData; int m_histoSegments; + int m_currentPreviewMode; QComboBox *m_channelCB; @@ -110,6 +111,10 @@ Digikam::ImageCurves *m_curves; Digikam::DImg m_originalImage; +protected: + + void finalRendering(); + private slots: void slotDefault(); @@ -121,11 +126,9 @@ void slotScaleChanged(int scale); void slotCurveTypeChanged(int type); void slotSpotColorChanged(const Digikam::DColor &color); - void slotColorSelectedFromTarget(const Digikam::DColor &color); + void slotColorSelectedFromTarget(const Digikam::DColor &color); + void slotPickerColorButtonActived(); -protected: - - void finalRendering(); }; } // NameSpace DigikamAdjustCurvesImagesPlugin --- trunk/extragear/graphics/digikamimageplugins/adjustlevels/adjustlevels.cpp #505150:505151 @@ -382,6 +382,10 @@ connect(m_resetButton, SIGNAL(clicked()), this, SLOT(slotResetCurrentChannel())); + + connect(m_pickerColorButtonGroup, SIGNAL(released(int)), + this, SLOT(slotPickerColorButtonActived())); + } AdjustLevelDialog::~AdjustLevelDialog() @@ -396,6 +400,13 @@ delete m_levels; } +void AdjustLevelDialog::slotPickerColorButtonActived() +{ + // Save previous rendering mode and toggle to original image. + m_currentPreviewMode = m_previewWidget->getRenderingPreviewMode(); + m_previewWidget->setRenderingPreviewMode(Digikam::ImageGuideWidget::PreviewOriginalImage); +} + void AdjustLevelDialog::slotSpotColorChanged(const Digikam::DColor &color) { if ( m_pickBlack->isOn() ) @@ -422,6 +433,9 @@ // Refresh the current levels config. slotChannelChanged(m_channelCB->currentItem()); + // restore previous rendering mode. + m_previewWidget->setRenderingPreviewMode(m_currentPreviewMode); + slotEffect(); } --- trunk/extragear/graphics/digikamimageplugins/adjustlevels/adjustlevels.h #505150:505151 @@ -75,7 +75,8 @@ uchar *m_destinationPreviewData; int m_histoSegments; - + int m_currentPreviewMode; + QComboBox *m_channelCB; QSpinBox *m_minInput; @@ -109,6 +110,10 @@ Digikam::ImageLevels *m_levels; Digikam::DImg m_originalImage; +protected: + + void finalRendering(); + private: void adjustSliders(int minIn, double gamIn, int maxIn, int minOut, int maxOut); @@ -131,11 +136,8 @@ void slotAdjustMaxOutputSpinBox(int val); void slotSpotColorChanged(const Digikam::DColor &color); void slotColorSelectedFromTarget(const Digikam::DColor &color); + void slotPickerColorButtonActived(); -protected: - - void finalRendering(); - }; } // NameSpace DigikamAdjustLevelsImagesPlugin --- trunk/extragear/graphics/digikamimageplugins/whitebalance/imageeffect_whitebalance.cpp #505150:505151 @@ -318,14 +318,11 @@ this, SLOT(slotScaleChanged(int))); connect(m_previewWidget, SIGNAL(spotPositionChangedFromOriginal( const Digikam::DColor &, const QPoint & )), - this, SLOT(slotColorSelectedFromOriginal( const Digikam::DColor &, bool ))); + this, SLOT(slotColorSelectedFromOriginal( const Digikam::DColor & ))); connect(m_previewWidget, SIGNAL(spotPositionChangedFromTarget( const Digikam::DColor &, const QPoint & )), this, SLOT(slotColorSelectedFromTarget( const Digikam::DColor & ))); - connect(m_autoAdjustExposure, SIGNAL(clicked()), - this, SLOT(slotAutoAdjustExposure())); - connect(m_overExposureIndicatorBox, SIGNAL(toggled (bool)), this, SLOT(slotEffect())); @@ -358,6 +355,15 @@ connect(m_greenInput, SIGNAL(valueChanged (double)), this, SLOT(slotTimer())); + + // ------------------------------------------------------------- + // Bouttons slots. + + connect(m_autoAdjustExposure, SIGNAL(clicked()), + this, SLOT(slotAutoAdjustExposure())); + + connect(m_pickTemperature, SIGNAL(released()), + this, SLOT(slotPickerColorButtonActived())); } ImageEffect_WhiteBalance::~ImageEffect_WhiteBalance() @@ -521,6 +527,13 @@ slotEffect(); } +void ImageEffect_WhiteBalance::slotPickerColorButtonActived() +{ + // Save previous rendering mode and toggle to original image. + m_currentPreviewMode = m_previewWidget->getRenderingPreviewMode(); + m_previewWidget->setRenderingPreviewMode(Digikam::ImageGuideWidget::PreviewOriginalImage); +} + void ImageEffect_WhiteBalance::slotColorSelectedFromOriginal( const Digikam::DColor &color ) { if ( m_pickTemperature->isOn() ) @@ -567,7 +580,10 @@ m_greenInput->setValue(t); m_pickTemperature->setOn(false); } - + + // restore previous rendering mode. + m_previewWidget->setRenderingPreviewMode(m_currentPreviewMode); + slotEffect(); } --- trunk/extragear/graphics/digikamimageplugins/whitebalance/imageeffect_whitebalance.h #505150:505151 @@ -95,6 +95,7 @@ double m_green; int m_BP, m_WP; + int m_currentPreviewMode; uint m_rgbMax; @@ -136,6 +137,10 @@ Digikam::ImageWidget *m_previewWidget; +protected: + + void finalRendering(); + private: void setRGBmult(void); @@ -156,11 +161,7 @@ void slotTemperatureChanged(double temperature); void slotTemperaturePresetChanged(int tempPreset); void slotAutoAdjustExposure(void); - -protected: - - void finalRendering(); - + void slotPickerColorButtonActived(); }; } // NameSpace DigikamWhiteBalanceImagesPlugin _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |