2003/10/01 03:08:32
[org.ibex.core.git] / src / org / xwt / PixelBuffer.java
index 065b027..9bb41be 100644 (file)
@@ -21,22 +21,20 @@ package org.xwt;
  */
 public abstract class PixelBuffer {
 
-    // FIXME: try to remove
-    /** returns the height of the PixelBuffer */
-    public abstract int getHeight();
-
-    // FIXME: try to remove
-    /** returns the width of the PixelBuffer */
-    public abstract int getWidth();
-
-
-
     /** Draw the region of source within s onto the region d on this PixelBuffer, scaling as needed */
     public abstract void drawPicture(Picture source, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2);
 
     /** fill a trapezoid whose top and bottom edges are horizontal */
     public abstract void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, int color);
 
+    /**
+     *  Same as drawPicture, but only uses the alpha channel of the Picture, and is allowed to destructively modify the RGB
+     *  channels of the Picture in the process.  This method may assume that the RGB channels of the image are all zero IFF it
+     *  restores this invariant before returning.
+     */
+    public abstract void drawPictureAlphaOnly(Picture source, int dx1, int dy1, int dx2, int dy2,
+                                              int sx1, int sy1, int sx2, int sy2, int rgb);
+
     // FIXME: we want floats (inter-pixel spacing) for antialiasing, but this hoses the fastpath line drawing... argh!
     /** draws a line of width <tt>w</tt>; note that the coordinates here are <i>post-transform</i> */
     public void drawLine(int x1, int y1, int x2, int y2, int w, int color, boolean capped) {