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 classprivate static classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SimpleRasterizer.Edgeprivate SimpleRasterizer.ScanCallbackprivate static final SimpleRasterizer.EdgeComparatorstatic final intEven odd fill ruleprivate booleanprivate intprivate intprivate intprivate intprivate int[](package private) intprivate SimpleRasterizer.Edge[]private intprivate intstatic final intWinding fill ruleprivate SimpleRasterizer.Edge[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddEdge(double x1, double y1, double x2, double y2) Add a single edge.private final voidaddNewEdgesToAET_(int y) final voidaddRing(double[] xy) Adds edges of the ring to the rasterizer.(package private) final booleanaddSegmentStroke(double x1, double y1, double x2, double y2, double half_width, boolean skip_short, double[] helper_xy_10_elm) final voidaddTriangle(double x1, double y1, double x2, double y2, double x3, double y3) Adds edges of a triangle.private final voidprivate final voidlongfinal 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.private static intsnap_(int x, int mi, int ma) private final SimpleRasterizer.Edgefinal 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:
-
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_
-