public class RasterLayout extends Object
OpImage
.
The RasterLayout
class encapsulates three types of information about an image:
Methods that modify the state of an RasterLayout
return a reference to 'this'
following the change. This allows multiple modifications to be made in a single expression. This
provides a way of modifying an RasterLayout
within a superclass constructor call.
Constructor and Description |
---|
RasterLayout()
Constructs an
RasterLayout with no parameters set. |
RasterLayout(int minX,
int minY,
int width,
int height)
Constructs an
RasterLayout with only the image dimension parameters set. |
RasterLayout(int minX,
int minY,
int width,
int height,
int tileGridXOffset,
int tileGridYOffset,
int tileWidth,
int tileHeight)
Constructs an
RasterLayout with all its parameters set. |
RasterLayout(Rectangle bounds) |
RasterLayout(RenderedImage im)
Constructs an
RasterLayout with all its parameters set to equal those of a given
RenderedImage . |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a clone of the
RasterLayout as an Object. |
boolean |
equals(Object obj)
Tests if the specified
Object equals this RasterLayout . |
int |
getHeight()
Returns the value of height if it is valid, and otherwise returns the value from the supplied
RenderedImage . |
int |
getMinX()
Returns the value of
minX if it is valid, and otherwise returns the value from
the supplied RenderedImage . |
int |
getMinY()
Returns the value of
minY if it is valid, and otherwise returns the value from
the supplied RenderedImage . |
int |
getTileGridXOffset()
Returns the value of
tileGridXOffset if it is valid, and otherwise returns the
value from the supplied RenderedImage . |
int |
getTileGridYOffset()
Returns the value of
tileGridYOffset if it is valid, and otherwise returns the
value from the supplied RenderedImage . |
int |
getTileHeight()
Returns the value of tileHeight if it is valid, and otherwise returns the value from the
supplied
RenderedImage . |
int |
getTileWidth()
Returns the value of
tileWidth if it is valid, and otherwise returns the value
from the supplied RenderedImage . |
int |
getWidth()
Returns the value of
width if it is valid, and otherwise returns the value from
the supplied RenderedImage . |
int |
hashCode() |
RasterLayout |
setHeight(int height)
Sets height to the supplied value and marks it as valid.
|
RasterLayout |
setMinX(int minX)
Sets
minX to the supplied value and marks it as valid. |
RasterLayout |
setMinY(int minY)
Sets
minY to the supplied value and marks it as valid. |
RasterLayout |
setTileGridXOffset(int tileGridXOffset)
Sets
tileGridXOffset to the supplied value and marks it as valid. |
RasterLayout |
setTileGridYOffset(int tileGridYOffset)
Sets
tileGridYOffset to the supplied value and marks it as valid. |
RasterLayout |
setTileHeight(int tileHeight)
Sets tileHeight to the supplied value and marks it as valid.
|
RasterLayout |
setTileWidth(int tileWidth)
Sets
tileWidth to the supplied value and marks it as valid. |
RasterLayout |
setWidth(int width)
Sets
width to the supplied value and marks it as valid. |
Rectangle |
toRectangle() |
String |
toString()
Returns a String containing the values of all valid fields.
|
public RasterLayout()
RasterLayout
with no parameters set.public RasterLayout(int minX, int minY, int width, int height, int tileGridXOffset, int tileGridYOffset, int tileWidth, int tileHeight)
RasterLayout
with all its parameters set. The sampleModel
and colorModel
parameters are ignored if null.minX
- the image's minimum X coordinate.minY
- the image's minimum Y coordinate.width
- the image's width.height
- the image's height.tileGridXOffset
- the X coordinate of tile (0, 0).tileGridYOffset
- the Y coordinate of tile (0, 0).tileWidth
- the width of a tile.tileHeight
- the height of a tile.sampleModel
- the image's SampleModel
.colorModel
- the image's ColorModel
.public RasterLayout(int minX, int minY, int width, int height)
RasterLayout
with only the image dimension parameters set.minX
- the image's minimum X coordinate.minY
- the image's minimum Y coordinate.width
- the image's width.height
- the image's height.public RasterLayout(RenderedImage im)
RasterLayout
with all its parameters set to equal those of a given
RenderedImage
.im
- a RenderedImage
whose layout will be copied.public RasterLayout(Rectangle bounds)
public Rectangle toRectangle()
public int getMinX()
minX
if it is valid, and otherwise returns the value from
the supplied RenderedImage
. If minX
is not valid and fallback is
null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setMinX(int minX)
minX
to the supplied value and marks it as valid.minX
- the minimum X coordinate of the image, as an int.RasterLayout
following the change.public int getMinY()
minY
if it is valid, and otherwise returns the value from
the supplied RenderedImage
. If minY
is not valid and fallback is
null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setMinY(int minY)
minY
to the supplied value and marks it as valid.minY
- the minimum Y coordinate of the image, as an int.RasterLayout
following the change.public int getWidth()
width
if it is valid, and otherwise returns the value from
the supplied RenderedImage
. If width
is not valid and fallback is
null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setWidth(int width)
width
to the supplied value and marks it as valid.width
- the width of the image, as an int.RasterLayout
following the change.IllegalArgumentException
- if width
is non-positive.public int getHeight()
RenderedImage
. If height is not valid and fallback is null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setHeight(int height)
height
- the height of the image, as an int.RasterLayout
following the change.IllegalArgumentException
- if height
is non-positive.public int getTileGridXOffset()
tileGridXOffset
if it is valid, and otherwise returns the
value from the supplied RenderedImage
. If tileGridXOffset
is not
valid and fallback is null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setTileGridXOffset(int tileGridXOffset)
tileGridXOffset
to the supplied value and marks it as valid.tileGridXOffset
- the X coordinate of tile (0, 0), as an int.RasterLayout
following the change.public int getTileGridYOffset()
tileGridYOffset
if it is valid, and otherwise returns the
value from the supplied RenderedImage
. If tileGridYOffset
is not
valid and fallback is null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setTileGridYOffset(int tileGridYOffset)
tileGridYOffset
to the supplied value and marks it as valid.tileGridYOffset
- the Y coordinate of tile (0, 0), as an int.RasterLayout
following the change.public int getTileWidth()
tileWidth
if it is valid, and otherwise returns the value
from the supplied RenderedImage
. If tileWidth
is not valid and
fallback is null, 0 is returned.fallback
- the RenderedImage
fallback.public RasterLayout setTileWidth(int tileWidth)
tileWidth
to the supplied value and marks it as valid.tileWidth
- the width of a tile, as an int.RasterLayout
following the change.IllegalArgumentException
- if tileWidth
is non-positive.public int getTileHeight()
RenderedImage
. If tileHeight is not valid and fallback is null, 0 is
returned.fallback
- the RenderedImage
fallback.public RasterLayout setTileHeight(int tileHeight)
tileHeight
- the height of a tile, as an int.RasterLayout
following the change.IllegalArgumentException
- if tileHeight
is non-positive.public String toString()
public Object clone()
RasterLayout
as an Object.public boolean equals(Object obj)
Object
equals this RasterLayout
.Copyright © 1996–2019 Geotools. All rights reserved.