A rectangular Region is allowed to have a null band list in which case the rectangular shape is defined by the bounding box parameters (lox, loy, hix, hiy).
The band list, if present, consists of a list of rows in ascending Y order, ending at endIndex which is the index beyond the end of the last row. Each row consists of at least 3 + 2n entries (n >= 1) where the first 3 entries specify the Y range as start, end, and the number of X ranges in that Y range. These 3 entries are followed by pairs of X coordinates in ascending order:
bands[rowstart+0] = Y0; // starting Y coordinate bands[rowstart+1] = Y1; // ending Y coordinate - endY > startY bands[rowstart+2] = N; // number of X bands - N >= 1 bands[rowstart+3] = X10; // starting X coordinate of first band bands[rowstart+4] = X11; // ending X coordinate of first band bands[rowstart+5] = X20; // starting X coordinate of second band bands[rowstart+6] = X21; // ending X coordinate of second band ... bands[rowstart+3+N*2-2] = XN0; // starting X coord of last band bands[rowstart+3+N*2-1] = XN1; // ending X coord of last band bands[rowstart+3+N*2] = ... // start of next Y row
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int[] | |
| public static final Region | |
| pack-priv int | |
| private static final int | |
| private int | |
| private int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private int | |
| public static final Region |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | appendSpan(int[] box)
Appends a single span defined by the 4 parameters spanlox, spanloy, spanhix, spanhiy. |
| private void | |
| private void | |
| public static int | clipAdd(int v, int dv)
Adds the delta |
| public void | |
| public static int | Returns: the value of the argument rounded to the nearestint value.a floating-point value to be rounded to an integer coordinate)Returns the closest |
| public static int | clipScale(final int v, final double sv)
Multiply the scale factor |
| public boolean | |
| public static int | |
| public boolean | |
| public boolean | encompassesXYWH(int x, int y, int w, int h)
Quickly checks if this Region surrounds the specified rectangular area specified in x, y, width, height format. |
| public boolean | encompassesXYXY(int lox, int loy, int hix, int hiy)
Quickly checks if this Region surrounds the specified rectangular area specified in lox, loy, hix, hiy format. |
| private void | |
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public SpanIterator | filter(SpanIterator si)
Returns a SpanIterator that is the argument iterator filtered by this region. |
| private void | |
| public void | |
| public Region | getBoundsIntersection(Rectangle r)
Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified Region object. |
| public Region | getBoundsIntersection(Region r)
Returns a Region object that represents the intersection of this object with the bounds of the specified Region object. |
| public Region | getBoundsIntersectionXYWH(int x, int y, int w, int h)
Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in x, y, width, height format. |
| public Region | getBoundsIntersectionXYXY(int lox, int loy, int hix, int hiy)
Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in lox, loy, hix, hiy format. |
| public Region | getDifference(Region r)
Returns a Region object that represents the difference of the specified Region object subtracted from this object. |
| public Region | getExclusiveOr(Region r)
Returns a Region object that represents the exclusive or of this object with the specified Region object. |
| public int | |
| public int | |
| public int | |
| public static Region | getInstance(Shape
a non-null Shape object specifying the geometry enclosing
the pixels of interest s, AffineTransform an optional at)AffineTransform to be applied to the
coordinates as they are returned in the iteration, or
null if untransformed coordinates are desiredReturns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object. |
| public static Region | getInstance(Region
a non-null Region specifying some bounds to
clip the geometry to devBounds, Shape a non-null Shape object specifying the geometry enclosing
the pixels of interest s, AffineTransform an optional at)AffineTransform to be applied to the
coordinates as they are returned in the iteration, or
null if untransformed coordinates are desiredReturns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds. |
| public static Region | getInstance(Region
a non-null Region specifying some bounds to
clip the geometry to devBounds, boolean a boolean indicating whether or not to apply
normalization normalize, Shape a non-null Shape object specifying the geometry enclosing
the pixels of interest s, AffineTransform an optional at)AffineTransform to be applied to the
coordinates as they are returned in the iteration, or
null if untransformed coordinates are desiredReturns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds. |
| pack-priv static Region | getInstance(final int lox, final int loy, final int hix, final int hiy, final int[] edges)
Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy and edges array, which is located relative to the rectangular area. |
| public static Region | getInstance(Rectangle r)
Returns a Region object with a rectangle of interest specified by the indicated Rectangle object. |
| public static Region | getInstance(int[] box)
Returns a Region object with a rectangle of interest specified by the indicated span array. |
| public static Region | getInstance(int[] box, SpanIterator si)
Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format. |
| public static Region | getInstanceXYWH(int x, int y, int w, int h)
Returns a Region object with a rectangle of interest specified by the indicated rectangular area in x, y, width, height format. |
| public static Region | getInstanceXYXY(int lox, int loy, int hix, int hiy)
Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format. |
| public Region | getIntersection(Rectangle r)
Returns a Region object that represents the intersection of this object with the specified Rectangle. |
| public Region | getIntersection(final Rectangle2D r)
Returns a Region object that represents the intersection of this object with the specified Rectangle2D. |
| public Region | getIntersection(Region r)
Returns a Region object that represents the intersection of this object with the specified Region object. |
| public Region | getIntersectionXYWH(int x, int y, int w, int h)
Returns a Region object that represents the intersection of this object with the specified rectangular area. |
| public Region | getIntersectionXYXY(double lox, double loy, double hix, double hiy)
Returns a Region object that represents the intersection of this object with the specified rectangular area. |
| public Region | getIntersectionXYXY(int lox, int loy, int hix, int hiy)
Returns a Region object that represents the intersection of this object with the specified rectangular area. |
| public RegionIterator | |
| public int | |
| public int | |
| private Region | |
| public Region | getScaledRegion(final double sx, final double sy)
Returns a Region object that represents the same list of rectangles as the current Region object, scaled by the specified sx, sy factors. |
| public SpanIterator | |
| public SpanIterator | getSpanIterator(int[] bbox)
Gets a span iterator object that iterates over the spans in this region but clipped to the bounds given in the argument (xlo, ylo, xhi, yhi). |
| public Region | getTranslatedRegion(int dx, int dy)
Returns a Region object that represents the same list of rectangles as the current Region object, translated by the specified dx, dy translation factors. |
| public Region | |
| public int | |
| public int | |
| private static native void | |
| public boolean | |
| public boolean | intersectsQuickCheckXYXY(int lox, int loy, int hix, int hiy)
Quickly checks if this Region intersects the specified rectangular area specified in lox, loy, hix, hiy format. |
| public boolean | |
| public boolean | |
| public boolean | isInsideXYWH(int x, int y, int w, int h)
Returns true iff this Region lies inside the indicated rectangular area specified in x, y, width, height format with appropriate clipping performed as per the dimAdd method. |
| public boolean | isInsideXYXY(int lox, int loy, int hix, int hiy)
Returns true iff this Region lies inside the indicated rectangular area specified in lox, loy, hix, hiy format. |
| public boolean | |
| private void | |
| public String |
| bands | back to summary |
|---|---|
| pack-priv int[] bands | |
| EMPTY_REGION | back to summary |
|---|---|
| public static final Region EMPTY_REGION | |
| endIndex | back to summary |
|---|---|
| pack-priv int endIndex | |
| GROW_SIZE | back to summary |
|---|---|
| private static final int GROW_SIZE | |
| hix | back to summary |
|---|---|
| private int hix | |
| hiy | back to summary |
|---|---|
| private int hiy | |
| INCLUDE_A | back to summary |
|---|---|
| private static final int INCLUDE_A | |
| INCLUDE_B | back to summary |
|---|---|
| private static final int INCLUDE_B | |
| INCLUDE_COMMON | back to summary |
|---|---|
| private static final int INCLUDE_COMMON | |
| INIT_SIZE | back to summary |
|---|---|
| private static final int INIT_SIZE | |
| lox | back to summary |
|---|---|
| private int lox | |
| loy | back to summary |
|---|---|
| private int loy | |
| WHOLE_REGION | back to summary |
|---|---|
| public static final Region WHOLE_REGION | |
| Region | back to summary |
|---|---|
| private Region(int lox, int loy, int hix, int hiy) | |
| Region | back to summary |
|---|---|
| private Region(int lox, int loy, int hix, int hiy, int[] bands, int end) | |
| appendSpan | back to summary |
|---|---|
| private void appendSpan(int[] box) Appends a single span defined by the 4 parameters spanlox, spanloy, spanhix, spanhiy. This span must be at a higher starting Y coordinate than the previous data or it must have a Y range equal to the highest Y band in the region and a higher X coordinate than any of the spans in that band. | |
| appendSpans | back to summary |
|---|---|
| private void appendSpans(SpanIterator si) Appends the list of spans returned from the indicated SpanIterator. Each span must be at a higher starting Y coordinate than the previous data or it must have a Y range equal to the highest Y band in the region and a higher X coordinate than any of the spans in that band. | |
| calcBBox | back to summary |
|---|---|
| private void calcBBox() | |
| clipAdd | back to summary |
|---|---|
| public static int clipAdd(int v, int dv) Adds the delta | |
| clipBoxToBounds | back to summary |
|---|---|
| public void clipBoxToBounds(int[] bbox) Clips the indicated bbox array to the bounds of this Region. | |
| clipRound | back to summary |
|---|---|
| public static int clipRound(final double coordinate) Returns the closest Special cases:
| |
| clipScale | back to summary |
|---|---|
| public static int clipScale(final int v, final double sv) Multiply the scale factor | |
| contains | back to summary |
|---|---|
| public boolean contains(int x, int y) Returns true iff this Region contains the specified coordinate. | |
| dimAdd | back to summary |
|---|---|
| public static int dimAdd(int start, int dim) Adds the dimension | |
| encompasses | back to summary |
|---|---|
| public boolean encompasses(Region r) Quickly checks if this Region surrounds the specified Region object. This method will return false if this Region object is not a simple rectangle. | |
| encompassesXYWH | back to summary |
|---|---|
| public boolean encompassesXYWH(int x, int y, int w, int h) Quickly checks if this Region surrounds the specified rectangular area specified in x, y, width, height format. This method will return false if this Region object is not a simple rectangle. | |
| encompassesXYXY | back to summary |
|---|---|
| public boolean encompassesXYXY(int lox, int loy, int hix, int hiy) Quickly checks if this Region surrounds the specified rectangular area specified in lox, loy, hix, hiy format. This method will return false if this Region object is not a simple rectangle. | |
| endRow | back to summary |
|---|---|
| private void endRow(int[] box) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| filter | back to summary |
|---|---|
| public SpanIterator filter(SpanIterator si) Returns a SpanIterator that is the argument iterator filtered by this region. | |
| filterSpans | back to summary |
|---|---|
| private void filterSpans(Region ra, Region rb, int flags) | |
| getBounds | back to summary |
|---|---|
| public void getBounds(int[] pathbox) Gets the bbox of the available spans, clipped to the OutputArea. | |
| getBoundsIntersection | back to summary |
|---|---|
| public Region getBoundsIntersection(Rectangle r) Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified Region object. The return value may be this same object if no clipping occurs and this Region is rectangular. | |
| getBoundsIntersection | back to summary |
|---|---|
| public Region getBoundsIntersection(Region r) Returns a Region object that represents the intersection of this object with the bounds of the specified Region object. The return value may be this same object or the argument Region object if no clipping occurs and the Regions are rectangular. | |
| getBoundsIntersectionXYWH | back to summary |
|---|---|
| public Region getBoundsIntersectionXYWH(int x, int y, int w, int h) Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in x, y, width, height format. The return value may be this same object if no clipping occurs and this Region is rectangular. | |
| getBoundsIntersectionXYXY | back to summary |
|---|---|
| public Region getBoundsIntersectionXYXY(int lox, int loy, int hix, int hiy) Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in lox, loy, hix, hiy format. The return value may be this same object if no clipping occurs and this Region is rectangular. | |
| getDifference | back to summary |
|---|---|
| public Region getDifference(Region r) Returns a Region object that represents the difference of the specified Region object subtracted from this object.
If The return value may be this same object or the argument Region object if no clipping occurs. | |
| getExclusiveOr | back to summary |
|---|---|
| public Region getExclusiveOr(Region r) Returns a Region object that represents the exclusive or of this object with the specified Region object.
If The return value may be this same object or the argument Region object if either is empty. | |
| getHeight | back to summary |
|---|---|
| public int getHeight() Returns the height of this Region clipped to the range (0 - MAX_INT). | |
| getHiX | back to summary |
|---|---|
| public int getHiX() Returns the highest X coordinate in the Region. | |
| getHiY | back to summary |
|---|---|
| public int getHiY() Returns the highest Y coordinate in the Region. | |
| getInstance | back to summary |
|---|---|
| public static Region getInstance(Shape s, AffineTransform at) Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object.
| |
| getInstance | back to summary |
|---|---|
| public static Region getInstance(Region devBounds, Shape s, AffineTransform at) Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds. Note that only the bounds of the specified Region are used to restrict the resulting Region. If devBounds is non-rectangular and clipping to the specific bands of devBounds is needed, then an intersection of the resulting Region with devBounds must be performed in a subsequent step.
| |
| getInstance | back to summary |
|---|---|
| public static Region getInstance(Region devBounds, boolean normalize, Shape s, AffineTransform at) Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds. If the normalize parameter is true then coordinate normalization is performed as per the 2D Graphics non-antialiasing implementation of the VALUE_STROKE_NORMALIZE hint. Note that only the bounds of the specified Region are used to restrict the resulting Region. If devBounds is non-rectangular and clipping to the specific bands of devBounds is needed, then an intersection of the resulting Region with devBounds must be performed in a subsequent step.
| |
| getInstance | back to summary |
|---|---|
| pack-priv static Region getInstance(final int lox, final int loy, final int hix, final int hiy, final int[] edges) Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy and edges array, which is located relative to the rectangular area. Edges array - 0,1 are y range, 2N,2N+1 are x ranges, 1 per y range.
| |
| getInstance | back to summary |
|---|---|
| public static Region getInstance(Rectangle r) Returns a Region object with a rectangle of interest specified by the indicated Rectangle object. This method can also be used to create a simple rectangular region. | |
| getInstance | back to summary |
|---|---|
| public static Region getInstance(int[] box) Returns a Region object with a rectangle of interest specified by the indicated span array. This method can also be used to create a simple rectangular region. | |
| getInstance | back to summary |
|---|---|
| public static Region getInstance(int[] box, SpanIterator si) Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format. Appends the list of spans returned from the indicated SpanIterator. Each span must be at a higher starting Y coordinate than the previous data or it must have a Y range equal to the highest Y band in the region and a higher X coordinate than any of the spans in that band. | |
| getInstanceXYWH | back to summary |
|---|---|
| public static Region getInstanceXYWH(int x, int y, int w, int h) Returns a Region object with a rectangle of interest specified by the indicated rectangular area in x, y, width, height format. This method can also be used to create a simple rectangular region. | |
| getInstanceXYXY | back to summary |
|---|---|
| public static Region getInstanceXYXY(int lox, int loy, int hix, int hiy) Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format. This method can also be used to create a simple rectangular region. | |
| getIntersection | back to summary |
|---|---|
| public Region getIntersection(Rectangle r) Returns a Region object that represents the intersection of this object with the specified Rectangle. The return value may be this same object if no clipping occurs. | |
| getIntersection | back to summary |
|---|---|
| public Region getIntersection(final Rectangle2D r) Returns a Region object that represents the intersection of this object with the specified Rectangle2D. The return value may be this same object if no clipping occurs. | |
| getIntersection | back to summary |
|---|---|
| public Region getIntersection(Region r) Returns a Region object that represents the intersection of this object with the specified Region object.
If The return value may be this same object or the argument Region object if no clipping occurs. | |
| getIntersectionXYWH | back to summary |
|---|---|
| public Region getIntersectionXYWH(int x, int y, int w, int h) Returns a Region object that represents the intersection of this object with the specified rectangular area. The return value may be this same object if no clipping occurs. | |
| getIntersectionXYXY | back to summary |
|---|---|
| public Region getIntersectionXYXY(double lox, double loy, double hix, double hiy) Returns a Region object that represents the intersection of this object with the specified rectangular area. The return value may be this same object if no clipping occurs. | |
| getIntersectionXYXY | back to summary |
|---|---|
| public Region getIntersectionXYXY(int lox, int loy, int hix, int hiy) Returns a Region object that represents the intersection of this object with the specified rectangular area. The return value may be this same object if no clipping occurs. | |
| getIterator | back to summary |
|---|---|
| public RegionIterator getIterator() Gets an iterator object to iterate over the spans in this region. | |
| getLoX | back to summary |
|---|---|
| public int getLoX() Returns the lowest X coordinate in the Region. | |
| getLoY | back to summary |
|---|---|
| public int getLoY() Returns the lowest Y coordinate in the Region. | |
| getSafeTranslatedRegion | back to summary |
|---|---|
| private Region getSafeTranslatedRegion(int dx, int dy) | |
| getScaledRegion | back to summary |
|---|---|
| public Region getScaledRegion(final double sx, final double sy) Returns a Region object that represents the same list of rectangles as the current Region object, scaled by the specified sx, sy factors. | |
| getSpanIterator | back to summary |
|---|---|
| public SpanIterator getSpanIterator() Gets a span iterator object that iterates over the spans in this region | |
| getSpanIterator | back to summary |
|---|---|
| public SpanIterator getSpanIterator(int[] bbox) Gets a span iterator object that iterates over the spans in this region but clipped to the bounds given in the argument (xlo, ylo, xhi, yhi). | |
| getTranslatedRegion | back to summary |
|---|---|
| public Region getTranslatedRegion(int dx, int dy) Returns a Region object that represents the same list of rectangles as the current Region object, translated by the specified dx, dy translation factors. | |
| getUnion | back to summary |
|---|---|
| public Region getUnion(Region r) Returns a Region object that represents the union of this object with the specified Region object.
If The return value may be this same object or the argument Region object if no augmentation occurs. | |
| getWidth | back to summary |
|---|---|
| public int getWidth() Returns the width of this Region clipped to the range (0 - MAX_INT). | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initIDs | back to summary |
|---|---|
| private static native void initIDs() | |
| intersectsQuickCheck | back to summary |
|---|---|
| public boolean intersectsQuickCheck(Region r) Quickly checks if this Region intersects the specified Region object. This method tests only against the bounds of this region and does not bother to test if the rectangular region actually intersects any bands. | |
| intersectsQuickCheckXYXY | back to summary |
|---|---|
| public boolean intersectsQuickCheckXYXY(int lox, int loy, int hix, int hiy) Quickly checks if this Region intersects the specified rectangular area specified in lox, loy, hix, hiy format. This method tests only against the bounds of this region and does not bother to test if the rectangular region actually intersects any bands. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true iff this Region encloses no area. | |
| isInsideQuickCheck | back to summary |
|---|---|
| public boolean isInsideQuickCheck(Region r) Quickly checks if this Region lies inside the specified Region object. This method will return false if the specified Region object is not a simple rectangle. | |
| isInsideXYWH | back to summary |
|---|---|
| public boolean isInsideXYWH(int x, int y, int w, int h) Returns true iff this Region lies inside the indicated rectangular area specified in x, y, width, height format with appropriate clipping performed as per the dimAdd method. | |
| isInsideXYXY | back to summary |
|---|---|
| public boolean isInsideXYXY(int lox, int loy, int hix, int hiy) Returns true iff this Region lies inside the indicated rectangular area specified in lox, loy, hix, hiy format. | |
| isRectangular | back to summary |
|---|---|
| public boolean isRectangular() Returns true iff this Region represents a single simple rectangular area. | |
| needSpace | back to summary |
|---|---|
| private void needSpace(int num) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |