public class SimpleRasterizer extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SimpleRasterizer.ScanCallback |
Modifier and Type | Field and Description |
---|---|
static int |
EVEN_ODD
Even odd fill rule
|
static int |
WINDING
Winding fill rule
|
Constructor and Description |
---|
SimpleRasterizer() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(double x1,
double y1,
double x2,
double y2)
Add a single edge.
|
void |
addRing(double[] xy)
Adds edges of the ring to the rasterizer.
|
void |
addTriangle(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Adds edges of a triangle.
|
void |
fillEnvelope(Envelope2D envIn) |
void |
flush()
Flushes any cached scans.
|
int |
getHeight() |
SimpleRasterizer.ScanCallback |
getScanCallback() |
int |
getWidth() |
void |
renderEdges(int fillMode)
Renders all edges added so far, and removes them.
|
void |
setup(int width,
int height,
SimpleRasterizer.ScanCallback callback)
Sets up the rasterizer.
|
void |
startAddingEdges()
Call before starting the edges.
|
public static final int EVEN_ODD
public static final int WINDING
public void setup(int width, int height, SimpleRasterizer.ScanCallback callback)
public final int getWidth()
public final int getHeight()
public final void flush()
public final void addTriangle(double x1, double y1, double x2, double y2, double x3, double y3)
public final void addRing(double[] xy)
xy
- interleaved coordinates x1, y1, x2, y2,...public final void startAddingEdges()
public final void renderEdges(int fillMode)
fillMode
- Fill mode for the polygon fill can be one of two values: EVEN_ODD or WINDING.
Note, as any other graphics algorithm, the scan line rasterizer doesn't require polygons
to be topologically simple, or have correct ring orientation.public final void addEdge(double x1, double y1, double x2, double y2)
x1
- y1
- x2
- y2
- public final void fillEnvelope(Envelope2D envIn)
public final SimpleRasterizer.ScanCallback getScanCallback()
Copyright © 2018. All rights reserved.