org.xwt
Class PixelBuffer

java.lang.Object
  extended byorg.xwt.PixelBuffer
Direct Known Subclasses:
AWT.AWTPixelBuffer, Surface, Win32.Win32PixelBuffer, X11.X11PixelBuffer

public abstract class PixelBuffer
extends java.lang.Object

A block of pixels which can be drawn on.

Implementations of the Platform class should return objects supporting this interface from the _createPixelBuffer() method. These implementations may choose to use off-screen video ram for this purpose (for example, a Pixmap on X11).

Many of these functions come in pairs, one that uses ints and one that uses floats. The int functions are intended for situations in which the CTM is the identity transform.


Constructor Summary
PixelBuffer()
           
 
Method Summary
 void drawLine(int x1, int y1, int x2, int y2, int w, int color, boolean capped)
          draws a line of width w; note that the coordinates here are post-transform
abstract  void drawPicture(Picture source, int dx1, int dy1, int cx1, int cy1, int cx2, int cy2)
          draw the picture at (dx1, dy1), cropping to (cx1, cy1, cx2, cy2)
abstract  void drawPictureAlphaOnly(Picture source, int dx1, int dy1, int cx1, int cy1, int cx2, int cy2, int rgb)
          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.
abstract  void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, int color)
          fill a trapezoid whose top and bottom edges are horizontal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PixelBuffer

public PixelBuffer()
Method Detail

drawPicture

public abstract void drawPicture(Picture source,
                                 int dx1,
                                 int dy1,
                                 int cx1,
                                 int cy1,
                                 int cx2,
                                 int cy2)
draw the picture at (dx1, dy1), cropping to (cx1, cy1, cx2, cy2)


fillTrapezoid

public abstract void fillTrapezoid(int x1,
                                   int x2,
                                   int y1,
                                   int x3,
                                   int x4,
                                   int y2,
                                   int color)
fill a trapezoid whose top and bottom edges are horizontal


drawPictureAlphaOnly

public abstract void drawPictureAlphaOnly(Picture source,
                                          int dx1,
                                          int dy1,
                                          int cx1,
                                          int cy1,
                                          int cx2,
                                          int cy2,
                                          int rgb)
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.


drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2,
                     int w,
                     int color,
                     boolean capped)
draws a line of width w; note that the coordinates here are post-transform