fixed gimp_rgb_intensity_uchar() which used to return 0 or 1 instead of 0

2003-02-27  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.c: fixed gimp_rgb_intensity_uchar() which
	used to return 0 or 1 instead of 0 to 255. Fixes bug #107202.
This commit is contained in:
Sven Neumann
2003-02-27 20:12:52 +00:00
committed by Sven Neumann
parent 8894a05d9a
commit 62052c0c62
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2003-02-27 Sven Neumann <sven@gimp.org>
* libgimpcolor/gimprgb.c: fixed gimp_rgb_intensity_uchar() which
used to return 0 or 1 instead of 0 to 255. Fixes bug #107202.
2003-02-27 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-undo-push.c (undo_push_layer_mask): fixed

View File

@ -177,11 +177,13 @@ gimp_rgb_gamma (GimpRGB *rgb,
gdouble
gimp_rgb_intensity (const GimpRGB *rgb)
{
gdouble intensity;
g_return_val_if_fail (rgb != NULL, 0.0);
return (INTENSITY_RED * rgb->r +
INTENSITY_GREEN * rgb->g +
INTENSITY_BLUE * rgb->b);
intensity = INTENSITY (rgb->r, rgb->g, rgb->b);
return CLAMP (intensity, 0.0, 1.0);
}
guchar
@ -189,7 +191,7 @@ gimp_rgb_intensity_uchar (const GimpRGB *rgb)
{
g_return_val_if_fail (rgb != NULL, 0);
return (CLAMP (gimp_rgb_intensity (rgb) * 255.999, 0.0, 1.0));
return gimp_rgb_intensity (rgb) * 255.999;
}
void