| |
|
| java.lang.Object org.geotools.coverage.grid.GeneralGridRange
GeneralGridRange | public class GeneralGridRange implements GridRange,Serializable(Code) | | Defines a range of grid coverage coordinates.
since: 2.1 version: $Id: GeneralGridRange.java 24925 2007-03-27 20:12:08Z jgarnett $ author: Martin Desruisseaux |
Constructor Summary | |
public | GeneralGridRange(int lower, int upper) Constructs one-dimensional grid range. | public | GeneralGridRange(int[] lower, int[] upper) Constructs a new grid range.
Parameters: lower - The valid minimum inclusive grid coordinate.The array contains a minimum value for eachdimension of the grid coverage. | public | GeneralGridRange(Rectangle rect) Constructs two-dimensional range defined by a
Rectangle . | public | GeneralGridRange(Raster raster) Constructs two-dimensional range defined by a
Raster . | public | GeneralGridRange(RenderedImage image) Constructs two-dimensional range defined by a
RenderedImage . | | GeneralGridRange(RenderedImage image, int dimension) Constructs multi-dimensional range defined by a
RenderedImage . | public | GeneralGridRange(Envelope envelope) Cast the specified envelope into a grid range. |
Method Summary | |
public boolean | equals(Object object) Compares the specified object with this grid range for equality. | public int | getDimension() Returns the number of dimensions. | public int | getLength(int dimension) Returns the number of integer grid coordinates along the specified dimension. | public int | getLower(int dimension) Returns the valid minimum inclusive grid coordinate along the specified dimension. | public GridCoordinates | getLower() Returns the valid minimum inclusive grid coordinate. | public int[] | getLowers() Returns the valid minimum inclusive grid coordinates along all dimensions. | public GeneralGridRange | getSubGridRange(int lower, int upper) Returns a new grid range that encompass only some dimensions of this grid range.
This method copy this grid range's index into a new grid range, beginning at
dimension
lower and extending to dimension
upper-1 .
Thus the dimension of the subgrid range is
upper-lower .
Parameters: lower - The first dimension to copy, inclusive. Parameters: upper - The last dimension to copy, exclusive. | public int | getUpper(int dimension) Returns the valid maximum exclusive grid coordinate along the specified dimension. | public GridCoordinates | getUpper() Returns the valid maximum exclusive grid coordinate. | public int[] | getUppers() Returns the valid maximum exclusive grid coordinates along all dimensions. | public int | hashCode() Returns a hash value for this grid range. | public Rectangle | toRectangle() Returns a
Rectangle with the same bounds as this
GeneralGridRange . | public String | toString() Returns a string représentation of this grid range. |
GeneralGridRange | public GeneralGridRange(int lower, int upper)(Code) | | Constructs one-dimensional grid range.
Parameters: lower - The minimal inclusive value. Parameters: upper - The maximal exclusive value. |
GeneralGridRange | public GeneralGridRange(int[] lower, int[] upper)(Code) | | Constructs a new grid range.
Parameters: lower - The valid minimum inclusive grid coordinate.The array contains a minimum value for eachdimension of the grid coverage. The lowestvalid grid coordinate is zero. Parameters: upper - The valid maximum exclusive grid coordinate.The array contains a maximum value for eachdimension of the grid coverage. See Also: GeneralGridRange.getLowers See Also: GeneralGridRange.getUppers |
GeneralGridRange | public GeneralGridRange(Raster raster)(Code) | | Constructs two-dimensional range defined by a
Raster .
|
GeneralGridRange | public GeneralGridRange(RenderedImage image)(Code) | | Constructs two-dimensional range defined by a
RenderedImage .
|
GeneralGridRange | GeneralGridRange(RenderedImage image, int dimension)(Code) | | Constructs multi-dimensional range defined by a
RenderedImage .
Parameters: image - The image. Parameters: dimension - Number of dimensions for this grid range.Dimensions over 2 will be set to the [0..1] range. |
GeneralGridRange | public GeneralGridRange(Envelope envelope)(Code) | | Cast the specified envelope into a grid range. This is sometime useful after an
envelope has been transformed from "real world" coordinates to grid coordinates
using the "
" transform.
The floating point values are rounded toward the nearest integers.
Note about rounding mode:
It would have been possible to round the
toward
and the
toward
in order to make sure that the grid range encompass all
the envelope (something similar to what Java2D does when casting
Rectangle2D to
Rectangle ). But this approach has an undesirable
side effect: it may changes the image
or
. For example the range
[-0.25 ... 99.75] would be casted to
[-1 ... 100] , which leads to unexpected result when using grid
range with image operations like "
javax.media.jai.operator.AffineDescriptor Affine ".
For avoiding such changes in size, it is necessary to use the same rounding mode for both
minimal and maximal values. The selected rounding mode is
in this implementation.
since: 2.2 |
equals | public boolean equals(Object object)(Code) | | Compares the specified object with this grid range for equality.
|
getDimension | public int getDimension()(Code) | | Returns the number of dimensions.
|
getLength | public int getLength(int dimension)(Code) | | Returns the number of integer grid coordinates along the specified dimension.
This is equals to
getUpper(dimension)-getLower(dimension) .
|
getLower | public int getLower(int dimension)(Code) | | Returns the valid minimum inclusive grid coordinate along the specified dimension.
See Also: GeneralGridRange.getLowers |
getLower | public GridCoordinates getLower()(Code) | | Returns the valid minimum inclusive grid coordinate.
The sequence contains a minimum value for each dimension of the grid coverage.
since: 2.4 |
getSubGridRange | public GeneralGridRange getSubGridRange(int lower, int upper)(Code) | | Returns a new grid range that encompass only some dimensions of this grid range.
This method copy this grid range's index into a new grid range, beginning at
dimension
lower and extending to dimension
upper-1 .
Thus the dimension of the subgrid range is
upper-lower .
Parameters: lower - The first dimension to copy, inclusive. Parameters: upper - The last dimension to copy, exclusive. The subgrid range. throws: IndexOutOfBoundsException - if an index is out of bounds. |
getUpper | public int getUpper(int dimension)(Code) | | Returns the valid maximum exclusive grid coordinate along the specified dimension.
See Also: GeneralGridRange.getUppers |
getUpper | public GridCoordinates getUpper()(Code) | | Returns the valid maximum exclusive grid coordinate.
The sequence contains a maximum value for each dimension of the grid coverage.
since: 2.4 |
hashCode | public int hashCode()(Code) | | Returns a hash value for this grid range. This value need not remain
consistent between different implementations of the same class.
|
toString | public String toString()(Code) | | Returns a string représentation of this grid range. The returned string is
implementation dependent. It is usually provided for debugging purposes.
|
|
|
|