SVN commit 866299 by aclemens:
re-factorize histogramwidget in all editor tools and sidebars Until now the histogram widget in the editor tools and the sidebar has been implemented by copy & paste. Changes to that code had to be made in all of the 13 editor tools and the sidebars that use a histogram. Also the slots slotChannelChanged() and slotScaleChanged() where implemented in every single editor tool, although they use a common code base most of the time (only channel mixer, adjustcurves and adjustlevels use slightly different slots). So it is time to factorize this code. This patch will move all histogram related code into a new widget: HistogramBox. This widget holds a histogram widget as well as all the control widgets for it, like the scale buttons, the channel selector and the optional gradient widget. To use the histogrambox in editor tools, a new toolcode is introduced to enable the histogram. To set its mode, a third parameter 'histogramType' is added to the ctor of EditorToolSettings. The different modes for the HistogramBox are defined in the enum HistogramType. HistogramBox defines the following methods: ---------------------------------------------------------------------- histogram() : returns the histogram widget setGradientVisible(bool) : show / hide the color gradient widget beneath the histogram widget. Some tools like adjustcurves and adjustlevels don't need that widget so we need a way to disable it setGradientColors(const QColor &from, const QColor &to) : set the color range for the gradient widget. channel() : returns the selected channel (Luminosity, RGB etc). Since a QVariant is used in the channel combobox, we need to convert the ID of the combobox item to the actual channel value. This method handles the conversion. setChannel(int channel) : set the current histogram channel. Due to the use of the QVariant we need to convert the channel id properly. This method handles the conversion. setColorsEnabled(bool) : if 'Colors' channel can be used in the editor tool, we need to provide a method to enable / disable this combobox. setColors(int color) : set the current ColorsChannel scale() : get the current selected histogram scale (linear, logarithmic) setScale(int scale) : set the current histogram scale ---------------------------------------------------------------------- Andi CCMAIL: [hidden email] M +1 -0 CMakeLists.txt M +93 -165 imageplugins/adjustcurves/adjustcurvestool.cpp M +2 -21 imageplugins/adjustcurves/adjustcurvestool.h M +109 -187 imageplugins/adjustlevels/adjustlevelstool.cpp M +2 -23 imageplugins/adjustlevels/adjustlevelstool.h M +23 -23 imageplugins/blurfx/blurfxtool.cpp M +11 -11 imageplugins/border/bordertool.cpp M +93 -194 imageplugins/channelmixer/channelmixertool.cpp M +1 -28 imageplugins/channelmixer/channelmixertool.h M +2 -2 imageplugins/charcoal/charcoaltool.cpp M +43 -134 imageplugins/colorfx/colorfxtool.cpp M +2 -26 imageplugins/colorfx/colorfxtool.h M +23 -127 imageplugins/coreplugin/autocorrectiontool.cpp M +1 -26 imageplugins/coreplugin/autocorrectiontool.h M +24 -126 imageplugins/coreplugin/bcgtool.cpp M +0 -30 imageplugins/coreplugin/bcgtool.h M +1 -1 imageplugins/coreplugin/blurtool.cpp M +34 -132 imageplugins/coreplugin/bwsepiatool.cpp M +4 -26 imageplugins/coreplugin/bwsepiatool.h M +31 -134 imageplugins/coreplugin/hsl/hsltool.cpp M +0 -28 imageplugins/coreplugin/hsl/hsltool.h M +42 -139 imageplugins/coreplugin/iccprooftool.cpp M +0 -24 imageplugins/coreplugin/iccprooftool.h M +37 -37 imageplugins/coreplugin/ratiocrop/ratiocroptool.cpp M +38 -143 imageplugins/coreplugin/redeyetool.cpp M +2 -27 imageplugins/coreplugin/redeyetool.h M +37 -139 imageplugins/coreplugin/rgbtool.cpp M +0 -23 imageplugins/coreplugin/rgbtool.h M +0 -1 imageplugins/coreplugin/sharpnesseditor/matrix.cpp M +10 -10 imageplugins/coreplugin/sharpnesseditor/sharpentool.cpp M +26 -26 imageplugins/distortionfx/distortionfxtool.cpp M +1 -1 imageplugins/emboss/embosstool.cpp M +1 -1 imageplugins/filmgrain/filmgraintool.cpp M +5 -5 imageplugins/freerotation/freerotationtool.cpp M +1 -1 imageplugins/hotpixels/hotpixelstool.cpp M +1 -1 imageplugins/infrared/infraredtool.cpp M +6 -6 imageplugins/inpainting/inpaintingtool.cpp M +8 -8 imageplugins/inserttext/inserttexttool.cpp M +5 -5 imageplugins/lenscorrection/distortion/lensdistortiontool.cpp M +7 -7 imageplugins/lenscorrection/vignetting/antivignettingtool.cpp M +10 -10 imageplugins/noisereduction/noisereductiontool.cpp M +3 -15 imageplugins/oilpaint/oilpainttool.cpp M +3 -3 imageplugins/perspective/perspectivetool.cpp M +5 -5 imageplugins/raindrop/raindroptool.cpp M +5 -5 imageplugins/restoration/restorationtool.cpp M +6 -6 imageplugins/sheartool/sheartool.cpp M +2 -3 imageplugins/superimpose/superimposetool.cpp M +2 -2 imageplugins/texture/texturetool.cpp M +74 -184 imageplugins/whitebalance/whitebalancetool.cpp M +2 -28 imageplugins/whitebalance/whitebalancetool.h M +98 -231 libs/imageproperties/imagepropertiescolorstab.cpp M +5 -5 libs/imageproperties/imagepropertiescolorstab.h M +5 -4 libs/widgets/common/CMakeLists.txt A libs/widgets/common/histogrambox.cpp [License: GPL (v2+)] A libs/widgets/common/histogrambox.h [License: GPL (v2+)] M +11 -0 utilities/imageeditor/editor/editortool.cpp M +4 -1 utilities/imageeditor/editor/editortool.h M +90 -41 utilities/imageeditor/editor/editortoolsettings.cpp M +24 -7 utilities/imageeditor/editor/editortoolsettings.h M +4 -3 utilities/imageeditor/rawimport/rawimport.cpp M +26 -204 utilities/imageeditor/rawimport/rawsettingsbox.cpp M +0 -5 utilities/imageeditor/rawimport/rawsettingsbox.h _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |