public interface

SpanIterator

sun.java2d.pipe.SpanIterator
Known Indirect Subclasses

Class Overview

This interface defines a general method for iterating through the rectangular "spans" that represent the interior of a filled path.

There can be many kinds of span iterators used in the rendering pipeline, the most basic being an iterator that scan converts a path defined by any PathIterator, or an nested iterator which intersects another iterator's spans with a clip region. Other iterators can be created for scan converting some of the primitive shapes more explicitly for speed or quality.

Summary

Public Methods
abstract long 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.
abstract void getPathBox(int[] pathbox)
This method returns the bounding box of the spans that the iterator will be returning.
abstract void intersectClipBox(int lox, int loy, int hix, int hiy)
This method constrains the spans returned by nextSpan() to the rectangle whose bounds are given.
abstract boolean nextSpan(int[] spanbox)
This method returns the next span in the shape being iterated.
abstract void skipDownTo(int y)
This method tells the iterator that it may skip all spans whose Y range is completely above the indicated Y coordinate.

Public Methods

public abstract long 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
 

public abstract void getPathBox (int[] pathbox)

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}.
 

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

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

public abstract boolean nextSpan (int[] spanbox)

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}.
 

public abstract void skipDownTo (int y)

This method tells the iterator that it may skip all spans whose Y range is completely above the indicated Y coordinate. This method is used to provide feedback from the caller when clipping prevents the display of any data in a given Y range. Typically it will only be called when this iterator has returned a span whose MaxY coordinate is less than the indicated Y and the calling mechanism wants to avoid unnecessary iteration work. While this request could technically be ignored (i.e. a NOP), doing so could potentially cause the caller to make this callback for each span that is being skipped.