diff --git a/plugins/filters/colorsfilters/kis_perchannel_filter.h b/plugins/filters/colorsfilters/kis_perchannel_filter.h --- a/plugins/filters/colorsfilters/kis_perchannel_filter.h +++ b/plugins/filters/colorsfilters/kis_perchannel_filter.h @@ -110,6 +110,7 @@ private Q_SLOTS: virtual void setActiveChannel(int ch); + void logHistView(bool l); private: @@ -118,7 +119,7 @@ // private routines - inline QPixmap getHistogram(); + inline QPixmap getHistogram(bool logarithmic = false); inline QPixmap createGradient(Qt::Orientation orient /*, int invert (not used now) */); // members diff --git a/plugins/filters/colorsfilters/kis_perchannel_filter.cpp b/plugins/filters/colorsfilters/kis_perchannel_filter.cpp --- a/plugins/filters/colorsfilters/kis_perchannel_filter.cpp +++ b/plugins/filters/colorsfilters/kis_perchannel_filter.cpp @@ -110,6 +110,8 @@ } connect(m_page->cmbChannel, SIGNAL(activated(int)), this, SLOT(setActiveChannel(int))); + connect((QObject*)(m_page->chkLogarithmic), SIGNAL(toggled(bool)), this, SLOT(logHistView(bool))); + // create the horizontal and vertical gradient labels m_page->hgradient->setPixmap(createGradient(Qt::Horizontal)); @@ -166,12 +168,18 @@ return gradientpix; } -inline QPixmap KisPerChannelConfigWidget::getHistogram() +inline QPixmap KisPerChannelConfigWidget::getHistogram(bool logarithmic) { int i; int height = 256; QPixmap pix(256, height); + if (logarithmic) + m_histogram->setHistogramType(LOGARITHMIC); + else + m_histogram->setHistogramType(LINEAR); + + QPalette appPalette = QApplication::palette(); pix.fill(QColor(appPalette.color(QPalette::Base))); @@ -596,3 +604,8 @@ Q_UNUSED(config); return cs->colorModelId() == AlphaColorModelID; } + +void KisPerChannelConfigWidget::logHistView(bool l) +{ + m_page->curveWidget->setPixmap(getHistogram(l)); +} diff --git a/plugins/filters/colorsfilters/wdg_perchannel.ui b/plugins/filters/colorsfilters/wdg_perchannel.ui --- a/plugins/filters/colorsfilters/wdg_perchannel.ui +++ b/plugins/filters/colorsfilters/wdg_perchannel.ui @@ -208,6 +208,26 @@ + + + + Qt::Horizontal + + + + 10 + 10 + + + + + + + + Logarithmic + + +