public abstract class SimpleRenderedImage
extends java.lang.Object
implements java.awt.image.RenderedImage
Modifier and Type | Field and Description |
---|---|
protected java.awt.image.ColorModel |
colorModel
The image's ColorModel.
|
protected int |
height
The image's height in pixels.
|
protected int |
minX
The X coordinate of the image's upper-left pixel.
|
protected int |
minY
The Y coordinate of the image's upper-left pixel.
|
protected java.util.Hashtable |
properties
A Hashtable containing the image properties.
|
protected java.awt.image.SampleModel |
sampleModel
The image's SampleModel.
|
protected java.util.Vector |
sources
The image's sources, stored in a Vector.
|
protected int |
tileGridXOffset
The X coordinate of the upper-left pixel of tile (0, 0).
|
protected int |
tileGridYOffset
The Y coordinate of the upper-left pixel of tile (0, 0).
|
protected int |
tileHeight
The height of a tile.
|
protected int |
tileWidth
The width of a tile.
|
protected int |
width
The image's width in pixels.
|
Constructor and Description |
---|
SimpleRenderedImage() |
Modifier and Type | Method and Description |
---|---|
java.awt.image.WritableRaster |
copyData(java.awt.image.WritableRaster dest)
Copies an arbitrary rectangular region of the RenderedImage
into a caller-supplied WritableRaster.
|
java.awt.Rectangle |
getBounds()
Returns a Rectangle indicating the image bounds.
|
java.awt.image.ColorModel |
getColorModel()
Returns the ColorModel of the image.
|
java.awt.image.Raster |
getData()
Returns the entire image in a single Raster.
|
java.awt.image.Raster |
getData(java.awt.Rectangle bounds)
Returns an arbitrary rectangular region of the RenderedImage
in a Raster.
|
int |
getHeight()
Returns the height of the image.
|
int |
getMaxTileX()
Returns the horizontal index of the rightmost column of tiles.
|
int |
getMaxTileY()
Returns the vertical index of the bottom row of tiles.
|
int |
getMaxX()
Returns the X coordinate of the column immediatetely to the
right of the rightmost column of the image.
|
int |
getMaxY()
Returns the Y coordinate of the row immediately below the
bottom row of the image.
|
int |
getMinTileX()
Returns the horizontal index of the leftmost column of tiles.
|
int |
getMinTileY()
Returns the vertical index of the uppermost row of tiles.
|
int |
getMinX()
Returns the X coordinate of the leftmost column of the image.
|
int |
getMinY()
Returns the X coordinate of the uppermost row of the image.
|
int |
getNumXTiles()
Returns the number of tiles along the tile grid in the
horizontal direction.
|
int |
getNumYTiles()
Returns the number of tiles along the tile grid in the vertical
direction.
|
java.lang.Object |
getProperty(java.lang.String name)
Gets a property from the property set of this image.
|
java.lang.String[] |
getPropertyNames()
Returns a list of the properties recognized by this image.
|
java.lang.String[] |
getPropertyNames(java.lang.String prefix)
Returns an array of
String s recognized as names by
this property source that begin with the supplied prefix. |
java.awt.image.SampleModel |
getSampleModel()
Returns the SampleModel of the image.
|
java.util.Vector |
getSources() |
int |
getTileGridXOffset()
Returns the X coordinate of the upper-left pixel of tile (0, 0).
|
int |
getTileGridYOffset()
Returns the Y coordinate of the upper-left pixel of tile (0, 0).
|
int |
getTileHeight()
Returns the height of a tile.
|
int |
getTileWidth()
Returns the width of a tile.
|
int |
getWidth()
Returns the width of the image.
|
int |
tileXToX(int tx)
Converts a horizontal tile index into the X coordinate of its
upper left pixel.
|
static int |
tileXToX(int tx,
int tileGridXOffset,
int tileWidth)
Converts a horizontal tile index into the X coordinate of its
upper left pixel relative to a given tile grid layout specified
by its X offset and tile width.
|
int |
tileYToY(int ty)
Converts a vertical tile index into the Y coordinate of its
upper left pixel.
|
static int |
tileYToY(int ty,
int tileGridYOffset,
int tileHeight)
Converts a vertical tile index into the Y coordinate of
its upper left pixel relative to a given tile grid layout
specified by its Y offset and tile height.
|
int |
XToTileX(int x)
Converts a pixel's X coordinate into a horizontal tile index.
|
static int |
XToTileX(int x,
int tileGridXOffset,
int tileWidth)
Converts a pixel's X coordinate into a horizontal tile index
relative to a given tile grid layout specified by its X offset
and tile width.
|
int |
YToTileY(int y)
Converts a pixel's Y coordinate into a vertical tile index.
|
static int |
YToTileY(int y,
int tileGridYOffset,
int tileHeight)
Converts a pixel's Y coordinate into a vertical tile index
relative to a given tile grid layout specified by its Y offset
and tile height.
|
protected int minX
protected int minY
protected int width
protected int height
protected int tileWidth
protected int tileHeight
protected int tileGridXOffset
protected int tileGridYOffset
protected java.awt.image.SampleModel sampleModel
protected java.awt.image.ColorModel colorModel
protected java.util.Vector sources
protected java.util.Hashtable properties
public int getMinX()
getMinX
in interface java.awt.image.RenderedImage
public final int getMaxX()
public int getMinY()
getMinY
in interface java.awt.image.RenderedImage
public final int getMaxY()
public int getWidth()
getWidth
in interface java.awt.image.RenderedImage
public int getHeight()
getHeight
in interface java.awt.image.RenderedImage
public java.awt.Rectangle getBounds()
public int getTileWidth()
getTileWidth
in interface java.awt.image.RenderedImage
public int getTileHeight()
getTileHeight
in interface java.awt.image.RenderedImage
public int getTileGridXOffset()
getTileGridXOffset
in interface java.awt.image.RenderedImage
public int getTileGridYOffset()
getTileGridYOffset
in interface java.awt.image.RenderedImage
public int getMinTileX()
getMinTileX
in interface java.awt.image.RenderedImage
public int getMaxTileX()
public int getNumXTiles()
getNumXTiles
in interface java.awt.image.RenderedImage
public int getMinTileY()
getMinTileY
in interface java.awt.image.RenderedImage
public int getMaxTileY()
public int getNumYTiles()
getNumYTiles
in interface java.awt.image.RenderedImage
public java.awt.image.SampleModel getSampleModel()
getSampleModel
in interface java.awt.image.RenderedImage
public java.awt.image.ColorModel getColorModel()
getColorModel
in interface java.awt.image.RenderedImage
public java.lang.Object getProperty(java.lang.String name)
java.awt.Image.UndefinedProperty
will be returned.getProperty
in interface java.awt.image.RenderedImage
name
- the name of the property to get, as a
String
. @return a reference to the property
Object
, or the value
java.awt.Image.UndefinedProperty.
public java.lang.String[] getPropertyNames()
null
will be
returned.getPropertyNames
in interface java.awt.image.RenderedImage
String
s representing valid
property names.public java.lang.String[] getPropertyNames(java.lang.String prefix)
String
s recognized as names by
this property source that begin with the supplied prefix. If
no property names match, null
will be returned.
The comparison is done in a case-independent manner.
The default implementation calls
getPropertyNames()
and searches the list of names
for matches.
String
s giving the valid
property names.public static int XToTileX(int x, int tileGridXOffset, int tileWidth)
public static int YToTileY(int y, int tileGridYOffset, int tileHeight)
public int XToTileX(int x)
x
- the X coordinate of a pixel.public int YToTileY(int y)
y
- the Y coordinate of a pixel.public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)
public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)
public int tileXToX(int tx)
tx
- the horizontal index of a tile.public int tileYToY(int ty)
ty
- the vertical index of a tile.public java.util.Vector getSources()
getSources
in interface java.awt.image.RenderedImage
public java.awt.image.Raster getData()
The returned Raster is semantically a copy. This means that updates to the source image will not be reflected in the returned Raster. For non-writable (immutable) source images, the returned value may be a reference to the image's internal data. The returned Raster should be considered non-writable; any attempt to alter its pixel data (such as by casting it to WritableRaster or obtaining and modifying its DataBuffer) may result in undefined behavior. The copyData method should be used if the returned Raster is to be modified.
getData
in interface java.awt.image.RenderedImage
public java.awt.image.Raster getData(java.awt.Rectangle bounds)
The returned Raster is semantically a copy. This means that updates to the source image will not be reflected in the returned Raster. For non-writable (immutable) source images, the returned value may be a reference to the image's internal data. The returned Raster should be considered non-writable; any attempt to alter its pixel data (such as by casting it to WritableRaster or obtaining and modifying its DataBuffer) may result in undefined behavior. The copyData method should be used if the returned Raster is to be modified.
getData
in interface java.awt.image.RenderedImage
bounds
- the region of the RenderedImage to be returned.public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster dest)
If the raster argument is null, the entire image will be copied into a newly-created WritableRaster with a SampleModel that is compatible with that of the image.
copyData
in interface java.awt.image.RenderedImage
dest
- a WritableRaster to hold the returned portion of
the image.Copyright © 2014 Open Microscopy Environment