[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/graphics/digikam/libs
From: Marcel Wiesweg <marcel.wiesweg () gmx ! de>
Date: 2009-07-28 21:47:22
Message-ID: 1248817642.897822.32500.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1003834 by mwiesweg:
Fix behavior when histogram of current selection is displayed:
- when setting a new selection, again show selection's histogram, according with the \
button's state
- display statistics for currently rendered histogram
M +8 -6 imageproperties/imagepropertiescolorstab.cpp
M +8 -0 widgets/common/histogramwidget.cpp
M +1 -0 widgets/common/histogramwidget.h
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagepropertiescolorstab.cpp \
#1003833:1003834 @@ -536,6 +536,7 @@
d->histogramBox->histogram()->updateSelectionData(d->imageSelection.bits(), \
d->imageSelection.width(),
d->imageSelection.height(), \
d->imageSelection.sixteenBit()); d->regionBox->show();
+ slotRenderingChanged(d->regionBG->checkedId());
}
else
{
@@ -634,7 +635,8 @@
void ImagePropertiesColorsTab::updateStatistics()
{
- if (!d->histogramBox->histogram()->m_imageHistogram)
+ ImageHistogram *renderedHistogram = \
d->histogramBox->histogram()->currentHistogram(); + if (!renderedHistogram)
return;
QString value;
@@ -645,19 +647,19 @@
if ( channel == HistogramWidget::ColorChannelsHistogram )
channel = d->histogramBox->colorsChannel()+1;
- double mean = d->histogramBox->histogram()->m_imageHistogram->getMean(channel, \
min, max); + double mean = renderedHistogram->getMean(channel, min, max);
d->labelMeanValue->setText(value.setNum(mean, 'f', 1));
- double pixels = d->histogramBox->histogram()->m_imageHistogram->getPixels();
+ double pixels = renderedHistogram->getPixels();
d->labelPixelsValue->setText(value.setNum((float)pixels, 'f', 0));
- double stddev = \
d->histogramBox->histogram()->m_imageHistogram->getStdDev(channel, min, max); + \
double stddev = renderedHistogram->getStdDev(channel, min, max); \
d->labelStdDevValue->setText(value.setNum(stddev, 'f', 1));
- double counts = \
d->histogramBox->histogram()->m_imageHistogram->getCount(channel, min, max); + \
double counts = renderedHistogram->getCount(channel, min, max); \
d->labelCountValue->setText(value.setNum((float)counts, 'f', 0));
- double median = \
d->histogramBox->histogram()->m_imageHistogram->getMedian(channel, min, max); + \
double median = renderedHistogram->getMedian(channel, min, max); \
d->labelMedianValue->setText(value.setNum(median, 'f', 1));
double percentile = (pixels > 0 ? (100.0 * counts / pixels) : 0.0);
--- trunk/extragear/graphics/digikam/libs/widgets/common/histogramwidget.cpp \
#1003833:1003834 @@ -245,6 +245,14 @@
}
}
+ImageHistogram *HistogramWidget::currentHistogram()
+{
+ if (d->renderingType == ImageSelectionHistogram && m_selectionHistogram)
+ return m_selectionHistogram;
+ else
+ return m_imageHistogram;
+}
+
void HistogramWidget::reset()
{
d->guideVisible = false;
--- trunk/extragear/graphics/digikam/libs/widgets/common/histogramwidget.h \
#1003833:1003834 @@ -135,6 +135,7 @@
int m_scaleType; // Scale to use for drawing.
int m_colorType; // Color to use for drawing in All Colors \
Channel mode. void setRenderingType(HistogramRenderingType type);
+ ImageHistogram *currentHistogram(); // Currently rendered histogram, \
depending on current rendering type
ImageHistogram *m_imageHistogram; // Full image.
ImageHistogram *m_selectionHistogram; // Image selection.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic