X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fgraphics%2FPixelBuffer.java;h=24c4b01fc0afc4e9c899cf0b01cf993f7557f02c;hp=6107f71fe3f947204a133504c23723fd7754a964;hb=297fdbde87e6db4732448a0950d1141c7265c169;hpb=8e190fb0ff508ccf4962bbfbf8295a431805c12b diff --git a/src/org/ibex/graphics/PixelBuffer.java b/src/org/ibex/graphics/PixelBuffer.java index 6107f71..24c4b01 100644 --- a/src/org/ibex/graphics/PixelBuffer.java +++ b/src/org/ibex/graphics/PixelBuffer.java @@ -1,5 +1,9 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the GNU General Public License version 2 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.graphics; +import org.ibex.util.*; /** *

@@ -12,30 +16,22 @@ package org.ibex.graphics; * 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. - *

*/ -public abstract class PixelBuffer { +public interface PixelBuffer { + public abstract void drawLine(int x1, int y1, int x2, int y2, int color); + public abstract void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, int color); + public abstract void drawPicture(Picture p, int x, int y, int x1, int y1, int w, int h); // names may be wrong + public abstract void drawGlyph(Font.Glyph source, int dx1, int dy1, int cx1, int cy1, int cx2, int cy2, int rgb, int bg); + public abstract void stroke(Polygon p, int color); + public abstract void fill(Polygon p, Paint paint); +} - /** draw the picture at (dx1, dy1), cropping to (cx1, cy1, cx2, cy2) */ - public abstract void drawPicture(Picture source, int dx1, int dy1, int cx1, int cy1, int cx2, int cy2); - /** 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 drawGlyph(Font.Glyph source, int dx1, int dy1, int cx1, int cy1, int cx2, int cy2, int rgb); +/* // FEATURE: we want floats (inter-pixel spacing) for antialiasing, but this hoses the fastpath line drawing... argh! - /** draws a line of width w; note that the coordinates here are post-transform */ + // draws a line of width w; note that the coordinates here are post-transform public void drawLine(int x1, int y1, int x2, int y2, int w, int color, boolean capped) { if (y1 > y2) { int t = x1; x1 = x2; x2 = t; t = y1; y1 = y2; y2 = t; } @@ -87,3 +83,4 @@ public abstract class PixelBuffer { } } +*/