classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] Patch: RFA: BufferedImage -vs- Transparency


From: Tom Tromey
Subject: [cp-patches] Patch: RFA: BufferedImage -vs- Transparency
Date: 27 Oct 2005 10:29:41 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

In 1.5, BufferedImage implements Transparency.  This requires adding
one method; it seems to me that it is always correct to just forward
the call to the underlying ColorModel.  So, that is what I
implemented.

Ok?

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * java/awt/image/BufferedImage.java (BufferedImage): Implement
        Transparency.
        (getTransparency): New method.

Index: java/awt/image/BufferedImage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/image/BufferedImage.java,v
retrieving revision 1.12
diff -u -r1.12 BufferedImage.java
--- java/awt/image/BufferedImage.java 3 Oct 2005 17:21:09 -0000 1.12
+++ java/awt/image/BufferedImage.java 27 Oct 2005 16:34:28 -0000
@@ -1,5 +1,5 @@
 /* BufferedImage.java --
-   Copyright (C) 2000, 2002, 2003, 2004  Free Software Foundation
+   Copyright (C) 2000, 2002, 2003, 2004, 2005  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -62,7 +62,7 @@
  * @author Rolf W. Rasmussen (address@hidden)
  */
 public class BufferedImage extends Image
-  implements WritableRenderedImage
+  implements WritableRenderedImage, Transparency
 {
   public static final int TYPE_CUSTOM         =  0,
                           TYPE_INT_RGB        =  1,
@@ -687,5 +687,17 @@
       return;
        
     observers.remove (to);
+  }
+
+  /**
+   * Return the transparency type.
+   *
+   * @return One of address@hidden #OPAQUE}, address@hidden #BITMASK}, or 
address@hidden #TRANSLUCENT}.
+   * @see Transparency#getTransparency()
+   * @since 1.5
+   */
+  public int getTransparency()
+  {
+    return colorModel.getTransparency();
   }
 }




reply via email to

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