mirror of https://github.com/GNOME/gimp.git
corrected caluclation for the histogram in RGB mode (bug #466189).
2007-08-13 Sven Neumann <sven@gimp.org> * app/base/gimphistogram.c (gimp_histogram_get_std_dev): corrected caluclation for the histogram in RGB mode (bug #466189). svn path=/trunk/; revision=23232
This commit is contained in:
parent
5df43c2cbb
commit
2d1c0dddc5
|
@ -1,3 +1,8 @@
|
|||
2007-08-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/gimphistogram.c (gimp_histogram_get_std_dev): corrected
|
||||
caluclation for the histogram in RGB mode (bug #466189).
|
||||
|
||||
2007-08-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpnumberpairentry.c: use italic font if not in
|
||||
|
|
|
@ -469,7 +469,22 @@ gimp_histogram_get_std_dev (GimpHistogram *histogram,
|
|||
count = 1.0;
|
||||
|
||||
for (i = start; i <= end; i++)
|
||||
dev += gimp_histogram_get_value (histogram, channel, i) * SQR (i - mean);
|
||||
{
|
||||
gdouble value;
|
||||
|
||||
if (channel == GIMP_HISTOGRAM_RGB)
|
||||
{
|
||||
value = (HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) +
|
||||
HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) +
|
||||
HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i));
|
||||
}
|
||||
else
|
||||
{
|
||||
value = gimp_histogram_get_value (histogram, channel, i);
|
||||
}
|
||||
|
||||
dev += value * SQR (i - mean);
|
||||
}
|
||||
|
||||
return sqrt (dev / count);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue