commit-classpath
[Top][All Lists]
Advanced

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

[commit-cp] [bug #12710] java.awt.image.ColorModel bits calculation erro


From: Ewout Prangsma
Subject: [commit-cp] [bug #12710] java.awt.image.ColorModel bits calculation error
Date: Sat, 16 Apr 2005 16:54:43 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12710>

                 Summary: java.awt.image.ColorModel bits calculation error
                 Project: classpath
            Submitted by: epr
            Submitted on: Sat 04/16/2005 at 16:54
                Category: classpath
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
        Platform Version: None

    _______________________________________________________

Details:

The calculation of the number of bits in the ColorModel(int bits) constructor
is incorrect.
Instead of multiplying by 4, it should divide the bits by 4, in order to be
compatible with sun's implementation.

Here is the REVERSE patch.

--- java\awt\image\ColorModel.java      Sun Mar 06 10:03:13 2005
+++ D:\epr\cvswork\classpath\java\awt\image\ColorModel.java     Tue Nov 16
23:10:27 2004
@@ -111,13 +111,12 @@
         * Constructs the default color model.  The default color model 
         * can be obtained by calling <code>getRGBdefault</code> of this
         * class.
-        * @param b the number of bits wide used for bit size of pixel values
+   * @param bits the number of bits wide used for bit size of pixel values
         */
   public ColorModel(int bits)
   {
-      // @classpath-bugfix Fix difference between Sun's class and this
class. 
-    this(bits, // total bits, sRGB, four channels
-        nArray(bits / 4, 4), // bits for each channel
+    this(bits * 4, // total bits, sRGB, four channels
+        nArray(bits, 4), // bits for each channel
         ColorSpace.getInstance(ColorSpace.CS_sRGB), // sRGB
         true, // has alpha
         false, // not premultiplied






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12710>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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