bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug awt/46323] New: GrayScaleConverter.fromCIEXYZ


From: address@hidden
Subject: [Bug awt/46323] New: GrayScaleConverter.fromCIEXYZ
Date: Fri, 5 Nov 2010 19:58:18 +0000

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46323

           Summary: GrayScaleConverter.fromCIEXYZ
           Product: classpath
           Version: 0.98
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: awt
        AssignedTo: address@hidden
        ReportedBy: address@hidden


In the class gnu.java.awt.color.GrayScaleConverter there is a bug in the
calculation of the method fromCIEXYZ(float[]). In line 85 there is a missing
"+".

The follow lines:
for (int i = 0; i < 3; i++)
   out[0] = (float) (temp[i] * coeff[i]);

should be:
for (int i = 0; i < 3; i++)
   out[0] += (float) (temp[i] * coeff[i]);


Without the missing "+" only the last value of the loop will return. With this
change the result are equals to Java SE for the follow test code:

ColorSpace cs = ColorSpace.getInstance(ColorSpace.SC_GRAY);
float[] color = {0.5, 0.5, 0.5};
color = cs.fromCIEXYZ( color };
System.out.println(color[0]);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]