Class SimpleRasterizer
java.lang.Object
com.esri.core.geometry.SimpleRasterizer
Simple scanline rasterizer. Caller provides a callback to draw pixels to actual surface.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddEdge(double x1, double y1, double x2, double y2) Add a single edge.final voidaddRing(double[] xy) Adds edges of the ring to the rasterizer.final voidaddTriangle(double x1, double y1, double x2, double y2, double x3, double y3) Adds edges of a triangle.longfinal voidfillEnvelope(Envelope2D envIn) final voidflush()Flushes any cached scans.final intfinal intgetWidth()final voidrenderEdges(int fillMode) Renders all edges added so far, and removes them.voidsetup(int width, int height, SimpleRasterizer.ScanCallback callback) Sets up the rasterizer.final voidCall before starting the edges.
-
Field Details
-
EVEN_ODD
public static final int EVEN_ODDEven odd fill rule- See Also:
-
WINDING
public static final int WINDINGWinding fill rule- See Also:
-
-
Constructor Details
-
SimpleRasterizer
public SimpleRasterizer()
-
-
Method Details
-
setup
Sets up the rasterizer. -
getWidth
public final int getWidth() -
getHeight
public final int getHeight() -
flush
public final void flush()Flushes any cached scans. -
addTriangle
public final void addTriangle(double x1, double y1, double x2, double y2, double x3, double y3) Adds edges of a triangle. -
addRing
public final void addRing(double[] xy) Adds edges of the ring to the rasterizer.- Parameters:
xy- interleaved coordinates x1, y1, x2, y2,...
-
startAddingEdges
public final void startAddingEdges()Call before starting the edges. For example to render two polygons that consist of a single ring: startAddingEdges(); addRing(...); renderEdges(Rasterizer.EVEN_ODD); addRing(...); renderEdges(Rasterizer.EVEN_ODD); For example to render a polygon consisting of three rings: startAddingEdges(); addRing(...); addRing(...); addRing(...); renderEdges(Rasterizer.EVEN_ODD); -
renderEdges
public final void renderEdges(int fillMode) Renders all edges added so far, and removes them. Calls startAddingEdges after it's done.- Parameters:
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.
-
addEdge
public final void addEdge(double x1, double y1, double x2, double y2) Add a single edge.- Parameters:
x1-y1-x2-y2-
-
fillEnvelope
-
getScanCallback
-
estimateMemorySize
public long estimateMemorySize()
-