mirror of https://github.com/GNOME/gimp.git
Applied a patch from S. Mukund <muks@mukund.org> fixing rounding problems
2003-06-16 Sven Neumann <sven@gimp.org> * libgimpcolor/gimpcolorspace.c: Applied a patch from S. Mukund <muks@mukund.org> fixing rounding problems that caused bug #55261.
This commit is contained in:
parent
58222c799c
commit
98fc5e380e
|
@ -1,3 +1,8 @@
|
||||||
|
2003-06-16 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpcolor/gimpcolorspace.c: Applied a patch from S. Mukund
|
||||||
|
<muks@mukund.org> fixing rounding problems that caused bug #55261.
|
||||||
|
|
||||||
2003-06-16 Michael Natterer <mitch@gimp.org>
|
2003-06-16 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* tools/pdbgen/pdb/brush_select.pdb (brush_args): don't fail on
|
* tools/pdbgen/pdb/brush_select.pdb (brush_args): don't fail on
|
||||||
|
|
|
@ -421,9 +421,9 @@ gimp_rgb_to_hsv_int (gint *red,
|
||||||
h -= 255;
|
h -= 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
*red = h;
|
*red = ROUND (h);
|
||||||
*green = s;
|
*green = ROUND (s);
|
||||||
*blue = v;
|
*blue = ROUND (v);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -446,12 +446,12 @@ gimp_hsv_to_rgb_int (gint *hue,
|
||||||
s = *saturation / 255.0;
|
s = *saturation / 255.0;
|
||||||
v = *value / 255.0;
|
v = *value / 255.0;
|
||||||
|
|
||||||
f = h - (gint) h;
|
f = h - ROUND (h);
|
||||||
p = v * (1.0 - s);
|
p = v * (1.0 - s);
|
||||||
q = v * (1.0 - (s * f));
|
q = v * (1.0 - (s * f));
|
||||||
t = v * (1.0 - (s * (1.0 - f)));
|
t = v * (1.0 - (s * (1.0 - f)));
|
||||||
|
|
||||||
switch ((gint) h)
|
switch (ROUND (h))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
*hue = ROUND (v * 255.0);
|
*hue = ROUND (v * 255.0);
|
||||||
|
@ -484,6 +484,7 @@ gimp_hsv_to_rgb_int (gint *hue,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
|
case 6:
|
||||||
*hue = ROUND (v * 255.0);
|
*hue = ROUND (v * 255.0);
|
||||||
*saturation = ROUND (p * 255.0);
|
*saturation = ROUND (p * 255.0);
|
||||||
*value = ROUND (q * 255.0);
|
*value = ROUND (q * 255.0);
|
||||||
|
@ -548,9 +549,9 @@ gimp_rgb_to_hls_int (gint *red,
|
||||||
h -= 255;
|
h -= 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
*red = h;
|
*red = ROUND (h);
|
||||||
*green = l;
|
*green = ROUND (l);
|
||||||
*blue = s;
|
*blue = ROUND (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
|
@ -571,7 +572,7 @@ gimp_rgb_to_l_int (gint red,
|
||||||
min = MIN (red, blue);
|
min = MIN (red, blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (max + min) / 2.0;
|
return ROUND ((max + min) / 2.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
|
@ -595,7 +596,7 @@ gimp_hls_value (gdouble n1,
|
||||||
else
|
else
|
||||||
value = n1;
|
value = n1;
|
||||||
|
|
||||||
return (gint) (value * 254.999 + 0.5);
|
return ROUND (value * 255.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue