Path: blob/master/src/java.desktop/share/classes/sun/java2d/pipe/SpanIterator.java
41159 views
/*1* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.java2d.pipe;2627/**28* This interface defines a general method for iterating through the29* rectangular "spans" that represent the interior of a filled path.30* <p>31* There can be many kinds of span iterators used in the rendering32* pipeline, the most basic being an iterator that scan converts a33* path defined by any PathIterator, or an nested iterator which34* intersects another iterator's spans with a clip region.35* Other iterators can be created for scan converting some of the36* primitive shapes more explicitly for speed or quality.37*38* @author Jim Graham39*/40public interface SpanIterator {41/**42* This method returns the bounding box of the spans that the43* iterator will be returning.44* The array must be of length at least 4 and upon return, it45* will be filled with the values:46* <pre>47* {PathMinX, PathMinY, PathMaxX, PathMaxY}.48* </pre>49*/50public void getPathBox(int[] pathbox);5152/**53* This method constrains the spans returned by nextSpan() to the54* rectangle whose bounds are given.55*/56public void intersectClipBox(int lox, int loy, int hix, int hiy);5758/**59* This method returns the next span in the shape being iterated.60* The array must be of length at least 4 and upon return, it61* will be filled with the values:62* <pre>63* {SpanMinX, SpanMinY, SpanMaxX, SpanMaxY}.64* </pre>65*/66public boolean nextSpan(int[] spanbox);6768/**69* This method tells the iterator that it may skip all spans70* whose Y range is completely above the indicated Y coordinate.71* This method is used to provide feedback from the caller when72* clipping prevents the display of any data in a given Y range.73* Typically it will only be called when this iterator has returned74* a span whose MaxY coordinate is less than the indicated Y and75* the calling mechanism wants to avoid unnecessary iteration work.76* While this request could technically be ignored (i.e. a NOP),77* doing so could potentially cause the caller to make this callback78* for each span that is being skipped.79*/80public void skipDownTo(int y);8182/**83* This method returns a native pointer to a function block that84* can be used by a native method to perform the same iteration85* cycle that the above methods provide while avoiding upcalls to86* the Java object.87* The definition of the structure whose pointer is returned by88* this method is defined in:89* <pre>90* src/share/native/sun/java2d/pipe/SpanIterator.h91* </pre>92*/93public long getNativeIterator();94}959697