Commit 8ad3385a by Scott Gilbertson Committed by Tom Tromey

ColorModel.java (getUnnormalizedComponents, [...]): Fix calculation which was…

ColorModel.java (getUnnormalizedComponents, [...]): Fix calculation which was using one too many bits in the unnormalized format.

2002-11-29  Scott Gilbertson  <scottg@mantatest.com>

	* java/awt/image/ColorModel.java (getUnnormalizedComponents,
	getNormalizedComponents): Fix calculation which was using one too
	many bits in the unnormalized format.

From-SVN: r59651
parent 6d6661fe
2002-11-29 Scott Gilbertson <scottg@mantatest.com>
* java/awt/image/ColorModel.java (getUnnormalizedComponents,
getNormalizedComponents): Fix calculation which was using one too
many bits in the unnormalized format.
2002-11-29 Gary Benson <gbenson@redhat.com>
For PR libgcj/8759:
......
......@@ -424,7 +424,7 @@ public abstract class ColorModel implements Transparency
for (int i=0; i<numComponents; i++)
{
float in = normComponents[normOffset++];
int out = (int) (in * ((2<<getComponentSize(i)) - 1));
int out = (int) (in * ((1<<getComponentSize(i)) - 1));
components[offset++] = out;
}
return components;
......@@ -447,7 +447,7 @@ public abstract class ColorModel implements Transparency
for (int i=0; i<numComponents; i++)
{
float in = components[offset++];
float out = in / ((2<<getComponentSize(i)) - 1);
float out = in / ((1<<getComponentSize(i)) - 1);
normComponents[normOffset++] = out;
}
return normComponents;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment