APIdia Launch Partner
Top Description Fields Constructors Methods
sun.java2d.pipe

public Class RegionClipSpanIterator

extends Object
implements SpanIterator
Class Inheritance
All Implemented Interfaces
sun.java2d.pipe.SpanIterator

This class clips a SpanIterator to a Region and outputs the resulting spans as another SpanIterator. Spans are output in the usual y/x order, unless the input span iterator doesn't conform to this order, or the iterator's span straddle more than one band of the Region used for clipping. Principle of operation: The iterator maintains a several cursors onto the RegionIterator in order to avoid having to buffer spans from the SpanIterator. They are: resetState The initial state of the RegionIterator lwm Low Water Mark, a running start point for processing each band. Usually goes down, but can be reset to resetState if a span has a lower start coordinate than the previous one. row The start of the current band of the RegionIterator box The current span of the current row The main nextSpan() loop implements a coroutine like structure, with three producers to get the next span, row and box calling each other to iterate through the span iterator and region. REMIND: Needs a native implementation!

Field Summary

Modifier and TypeField and Description
pack-priv RegionIterator
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv RegionIterator
pack-priv int
pack-priv int
pack-priv RegionIterator
pack-priv Region
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int[]
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv RegionIterator
pack-priv int[]
pack-priv int
pack-priv int
pack-priv SpanIterator
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public long
getNativeIterator()

Implements sun.java2d.pipe.SpanIterator.getNativeIterator.

This method returns a native pointer to a function block that can be used by a native method to perform the same iteration cycle that the above methods provide while avoiding upcalls to the Java object.

public void
getPathBox(int[] pathbox)

Implements sun.java2d.pipe.SpanIterator.getPathBox.

This method returns the bounding box of the spans that the iterator will be returning.

public void
intersectClipBox(int lox, int loy, int hix, int hiy)

Implements sun.java2d.pipe.SpanIterator.intersectClipBox.

This method constrains the spans returned by nextSpan() to the rectangle whose bounds are given.

public boolean
nextSpan(int[] resultbox)

Implements sun.java2d.pipe.SpanIterator.nextSpan.

This method returns the next span in the shape being iterated.

public void
skipDownTo(int y)

Implements sun.java2d.pipe.SpanIterator.skipDownTo.

This method tells the iterator that it may skip all spans whose Y range is completely above the indicated Y coordinate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

boxback to summary
pack-priv RegionIterator box
doneback to summary
pack-priv boolean done
doNextBoxback to summary
pack-priv boolean doNextBox
doNextSpanback to summary
pack-priv boolean doNextSpan
lwmback to summary
pack-priv RegionIterator lwm
lwmhiyback to summary
pack-priv int lwmhiy
lwmloyback to summary
pack-priv int lwmloy
resetStateback to summary
pack-priv RegionIterator resetState
rgnback to summary
pack-priv Region rgn
rgnbndshixback to summary
pack-priv int rgnbndshix
rgnbndshiyback to summary
pack-priv int rgnbndshiy
rgnbndsloxback to summary
pack-priv int rgnbndslox
rgnbndsloyback to summary
pack-priv int rgnbndsloy
rgnboxback to summary
pack-priv int[] rgnbox
rgnhixback to summary
pack-priv int rgnhix
rgnhiyback to summary
pack-priv int rgnhiy
rgnloxback to summary
pack-priv int rgnlox
rgnloyback to summary
pack-priv int rgnloy
rowback to summary
pack-priv RegionIterator row
spanboxback to summary
pack-priv int[] spanbox
spanhixback to summary
pack-priv int spanhix
spanhiyback to summary
pack-priv int spanhiy
spanIterback to summary
pack-priv SpanIterator spanIter
spanloxback to summary
pack-priv int spanlox
spanloyback to summary
pack-priv int spanloy

Constructor Detail

RegionClipSpanIteratorback to summary
public RegionClipSpanIterator(Region rgn, SpanIterator spanIter)

Method Detail

getNativeIteratorback to summary
public long getNativeIterator()

Implements sun.java2d.pipe.SpanIterator.getNativeIterator.

This method returns a native pointer to a function block that can be used by a native method to perform the same iteration cycle that the above methods provide while avoiding upcalls to the Java object. The definition of the structure whose pointer is returned by this method is defined in:

    src/share/native/sun/java2d/pipe/SpanIterator.h
getPathBoxback to summary
public void getPathBox(int[] pathbox)

Implements sun.java2d.pipe.SpanIterator.getPathBox.

Doc from sun.java2d.pipe.SpanIterator.getPathBox.

This method returns the bounding box of the spans that the iterator will be returning. The array must be of length at least 4 and upon return, it will be filled with the values:

    {PathMinX, PathMinY, PathMaxX, PathMaxY}.
intersectClipBoxback to summary
public void intersectClipBox(int lox, int loy, int hix, int hiy)

Implements sun.java2d.pipe.SpanIterator.intersectClipBox.

Doc from sun.java2d.pipe.SpanIterator.intersectClipBox.

This method constrains the spans returned by nextSpan() to the rectangle whose bounds are given.

nextSpanback to summary
public boolean nextSpan(int[] resultbox)

Implements sun.java2d.pipe.SpanIterator.nextSpan.

Doc from sun.java2d.pipe.SpanIterator.nextSpan.

This method returns the next span in the shape being iterated. The array must be of length at least 4 and upon return, it will be filled with the values:

    {SpanMinX, SpanMinY, SpanMaxX, SpanMaxY}.
skipDownToback to summary
public void skipDownTo(int y)

Implements sun.java2d.pipe.SpanIterator.skipDownTo.

This method tells the iterator that it may skip all spans whose Y range is completely above the indicated Y coordinate.