Package com.esri.core.geometry
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 ClassesModifier and TypeClassDescription(package private) static class
private static class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SimpleRasterizer.Edge
private SimpleRasterizer.ScanCallback
private static final SimpleRasterizer.EdgeComparator
static final int
Even odd fill ruleprivate boolean
private int
private int
private int
private int
private int[]
(package private) int
private SimpleRasterizer.Edge[]
private int
private int
static final int
Winding fill ruleprivate SimpleRasterizer.Edge[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addEdge
(double x1, double y1, double x2, double y2) Add a single edge.private final void
addNewEdgesToAET_
(int y) final void
addRing
(double[] xy) Adds edges of the ring to the rasterizer.(package private) final boolean
addSegmentStroke
(double x1, double y1, double x2, double y2, double half_width, boolean skip_short, double[] helper_xy_10_elm) final void
addTriangle
(double x1, double y1, double x2, double y2, double x3, double y3) Adds edges of a triangle.private final void
private final void
long
final void
fillEnvelope
(Envelope2D envIn) final void
flush()
Flushes any cached scans.final int
final int
getWidth()
final 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.private static int
snap_
(int x, int mi, int ma) private final SimpleRasterizer.Edge
final void
Call 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:
-
edgeCompare_
-
activeEdgesTable_
-
ySortedEdges_
-
sortBuffer_
-
scanBuffer_
private int[] scanBuffer_ -
scanPtr_
int scanPtr_ -
callback_
-
width_
private int width_ -
height_
private int height_ -
minY_
private int minY_ -
maxY_
private int maxY_ -
numEdges_
private int numEdges_ -
sortedNum_
private int sortedNum_ -
evenOdd_
private boolean evenOdd_
-
-
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
-
addSegmentStroke
final boolean addSegmentStroke(double x1, double y1, double x2, double y2, double half_width, boolean skip_short, double[] helper_xy_10_elm) -
getScanCallback
-
estimateMemorySize
public long estimateMemorySize() -
advanceAET_
private final void advanceAET_() -
addNewEdgesToAET_
private final void addNewEdgesToAET_(int y) -
snap_
private static int snap_(int x, int mi, int ma) -
emitScans_
private final void emitScans_() -
sortAET_
-