APIdia Launch Partner
Top Fields Constructors Methods
com.sun.imageio.plugins.common

public abstract Class SimpleRenderedImage

extends Object
implements RenderedImage
Class Inheritance
All Implemented Interfaces
java.awt.image.RenderedImage
Known Direct Subclasses
com.sun.imageio.plugins.common.SingleTileRenderedImage, com.sun.imageio.plugins.tiff.EmptyImage
Imports
java.awt.Point, .Rectangle, java.awt.image.RenderedImage, .ColorModel, .SampleModel, .Raster, .WritableRaster, java.util.ArrayList, .Enumeration, .Hashtable, .Vector

Field Summary

Modifier and TypeField and Description
protected 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 Hashtable<String, Object>
properties

A Hashtable containing the image properties.

protected SampleModel
sampleModel

The image's SampleModel.

protected Vector<RenderedImage>
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 Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public WritableRaster

Returns:

a reference to the supplied WritableRaster, or to a new WritableRaster if the supplied one was null.
copyData
(WritableRaster
a WritableRaster to hold the returned portion of the image.
dest
)

Implements java.awt.image.RenderedImage.copyData.

Copies an arbitrary rectangular region of the RenderedImage into a caller-supplied WritableRaster.

public Rectangle
getBounds()

Returns a Rectangle indicating the image bounds.

public ColorModel
getColorModel()

Implements java.awt.image.RenderedImage.getColorModel.

Returns the ColorModel of the image.

public Raster

Returns:

a Raster containing a copy of this image's data.
getData
()

Implements java.awt.image.RenderedImage.getData.

Returns the entire image in a single Raster.

public Raster
getData(Rectangle
the region of the RenderedImage to be returned.
bounds
)

Implements java.awt.image.RenderedImage.getData.

Returns an arbitrary rectangular region of the RenderedImage in a Raster.

public int
getHeight()

Implements java.awt.image.RenderedImage.getHeight.

Returns the height of the image.

public int
getMaxTileX()

Returns the horizontal index of the rightmost column of tiles.

public int
getMaxTileY()

Returns the vertical index of the bottom row of tiles.

public final int
getMaxX()

Returns the X coordinate of the column immediately to the right of the rightmost column of the image.

public final int
getMaxY()

Returns the Y coordinate of the row immediately below the bottom row of the image.

public int
getMinTileX()

Implements java.awt.image.RenderedImage.getMinTileX.

Returns the horizontal index of the leftmost column of tiles.

public int
getMinTileY()

Implements java.awt.image.RenderedImage.getMinTileY.

Returns the vertical index of the uppermost row of tiles.

public int
getMinX()

Implements java.awt.image.RenderedImage.getMinX.

Returns the X coordinate of the leftmost column of the image.

public int
getMinY()

Implements java.awt.image.RenderedImage.getMinY.

Returns the X coordinate of the uppermost row of the image.

public int
getNumXTiles()

Implements java.awt.image.RenderedImage.getNumXTiles.

Returns the number of tiles along the tile grid in the horizontal direction.

public int
getNumYTiles()

Implements java.awt.image.RenderedImage.getNumYTiles.

Returns the number of tiles along the tile grid in the vertical direction.

public Object
getProperty(String
the name of the property to get, as a String. @return a reference to the property Object, or the value java.awt.Image.UndefinedProperty.
name
)

Implements java.awt.image.RenderedImage.getProperty.

Gets a property from the property set of this image.

public String[]

Returns:

an array of Strings representing valid property names.
getPropertyNames
()

Implements java.awt.image.RenderedImage.getPropertyNames.

Returns a list of the properties recognized by this image.

public String[]

Returns:

an array of Strings giving the valid property names.
getPropertyNames
(String prefix)

Returns an array of Strings recognized as names by this property source that begin with the supplied prefix.

public SampleModel
getSampleModel()

Implements java.awt.image.RenderedImage.getSampleModel.

Returns the SampleModel of the image.

public Vector<RenderedImage>
getSources()

Implements java.awt.image.RenderedImage.getSources.

Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage.

public int
getTileGridXOffset()

Implements java.awt.image.RenderedImage.getTileGridXOffset.

Returns the X coordinate of the upper-left pixel of tile (0, 0).

public int
getTileGridYOffset()

Implements java.awt.image.RenderedImage.getTileGridYOffset.

Returns the Y coordinate of the upper-left pixel of tile (0, 0).

public int
getTileHeight()

Implements java.awt.image.RenderedImage.getTileHeight.

Returns the height of a tile.

public int
getTileWidth()

Implements java.awt.image.RenderedImage.getTileWidth.

Returns the width of a tile.

public int
getWidth()

Implements java.awt.image.RenderedImage.getWidth.

Returns the width of the image.

public 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.

public int

Returns:

the X coordinate of the tile's upper left pixel.
tileXToX
(int
the horizontal index of a tile.
tx
)

Converts a horizontal tile index into the X coordinate of its upper left pixel.

public 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.

public int

Returns:

the Y coordinate of the tile's upper left pixel.
tileYToY
(int
the vertical index of a tile.
ty
)

Converts a vertical tile index into the Y coordinate of its upper left pixel.

public 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.

public int

Returns:

the X index of the tile containing the pixel.
XToTileX
(int
the X coordinate of a pixel.
x
)

Converts a pixel's X coordinate into a horizontal tile index.

public 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.

public int

Returns:

the Y index of the tile containing the pixel.
YToTileY
(int
the Y coordinate of a pixel.
y
)

Converts a pixel's Y coordinate into a vertical tile index.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colorModelback to summary
protected ColorModel colorModel

The image's ColorModel.

heightback to summary
protected int height

The image's height in pixels.

minXback to summary
protected int minX

The X coordinate of the image's upper-left pixel.

minYback to summary
protected int minY

The Y coordinate of the image's upper-left pixel.

propertiesback to summary
protected Hashtable<String, Object> properties

A Hashtable containing the image properties.

sampleModelback to summary
protected SampleModel sampleModel

The image's SampleModel.

sourcesback to summary
protected Vector<RenderedImage> sources

The image's sources, stored in a Vector.

tileGridXOffsetback to summary
protected int tileGridXOffset

The X coordinate of the upper-left pixel of tile (0, 0).

tileGridYOffsetback to summary
protected int tileGridYOffset

The Y coordinate of the upper-left pixel of tile (0, 0).

tileHeightback to summary
protected int tileHeight

The height of a tile.

tileWidthback to summary
protected int tileWidth

The width of a tile.

widthback to summary
protected int width

The image's width in pixels.

Constructor Detail

SimpleRenderedImageback to summary
public SimpleRenderedImage()

Method Detail

copyDataback to summary
public WritableRaster copyData(WritableRaster dest)

Implements java.awt.image.RenderedImage.copyData.

Copies an arbitrary rectangular region of the RenderedImage into a caller-supplied WritableRaster. The region to be computed is determined by clipping the bounds of the supplied WritableRaster against the bounds of the image. The supplied WritableRaster must have a SampleModel that is compatible with that of the image.

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.

Parameters
dest:WritableRaster

a WritableRaster to hold the returned portion of the image.

Returns:WritableRaster

a reference to the supplied WritableRaster, or to a new WritableRaster if the supplied one was null.

Annotations
@Override
getBoundsback to summary
public Rectangle getBounds()

Returns a Rectangle indicating the image bounds.

getColorModelback to summary
public ColorModel getColorModel()

Implements java.awt.image.RenderedImage.getColorModel.

Returns the ColorModel of the image.

Annotations
@Override
getDataback to summary
public Raster getData()

Implements java.awt.image.RenderedImage.getData.

Returns the entire image in a single Raster. For images with multiple tiles this will require making a copy.

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.

Returns:Raster

a Raster containing a copy of this image's data.

Annotations
@Override
getDataback to summary
public Raster getData(Rectangle bounds)

Implements java.awt.image.RenderedImage.getData.

Returns an arbitrary rectangular region of the RenderedImage in a Raster. The rectangle of interest will be clipped against the image 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.

Parameters
bounds:Rectangle

the region of the RenderedImage to be returned.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements java.awt.image.RenderedImage.getHeight.

Returns the height of the image.

Annotations
@Override
getMaxTileXback to summary
public int getMaxTileX()

Returns the horizontal index of the rightmost column of tiles. getMaxTileX() is implemented in terms of getMaxX() and so does not need to be implemented by subclasses.

getMaxTileYback to summary
public int getMaxTileY()

Returns the vertical index of the bottom row of tiles. getMaxTileY() is implemented in terms of getMaxY() and so does not need to be implemented by subclasses.

getMaxXback to summary
public final int getMaxX()

Returns the X coordinate of the column immediately to the right of the rightmost column of the image. getMaxX() is implemented in terms of getMinX() and getWidth() and so does not need to be implemented by subclasses.

getMaxYback to summary
public final int getMaxY()

Returns the Y coordinate of the row immediately below the bottom row of the image. getMaxY() is implemented in terms of getMinY() and getHeight() and so does not need to be implemented by subclasses.

getMinTileXback to summary
public int getMinTileX()

Implements java.awt.image.RenderedImage.getMinTileX.

Returns the horizontal index of the leftmost column of tiles. getMinTileX() is implemented in terms of getMinX() and so does not need to be implemented by subclasses.

Annotations
@Override
getMinTileYback to summary
public int getMinTileY()

Implements java.awt.image.RenderedImage.getMinTileY.

Returns the vertical index of the uppermost row of tiles. getMinTileY() is implemented in terms of getMinY() and so does not need to be implemented by subclasses.

Annotations
@Override
getMinXback to summary
public int getMinX()

Implements java.awt.image.RenderedImage.getMinX.

Returns the X coordinate of the leftmost column of the image.

Annotations
@Override
getMinYback to summary
public int getMinY()

Implements java.awt.image.RenderedImage.getMinY.

Returns the X coordinate of the uppermost row of the image.

Annotations
@Override
getNumXTilesback to summary
public int getNumXTiles()

Implements java.awt.image.RenderedImage.getNumXTiles.

Returns the number of tiles along the tile grid in the horizontal direction. getNumXTiles() is implemented in terms of getMinTileX() and getMaxTileX() and so does not need to be implemented by subclasses.

Annotations
@Override
getNumYTilesback to summary
public int getNumYTiles()

Implements java.awt.image.RenderedImage.getNumYTiles.

Returns the number of tiles along the tile grid in the vertical direction. getNumYTiles() is implemented in terms of getMinTileY() and getMaxTileY() and so does not need to be implemented by subclasses.

Annotations
@Override
getPropertyback to summary
public Object getProperty(String name)

Implements java.awt.image.RenderedImage.getProperty.

Gets a property from the property set of this image. If the property name is not recognized, java.awt.Image.UndefinedProperty will be returned.

Parameters
name:String

the name of the property to get, as a String. @return a reference to the property Object, or the value java.awt.Image.UndefinedProperty.

Annotations
@Override
getPropertyNamesback to summary
public String[] getPropertyNames()

Implements java.awt.image.RenderedImage.getPropertyNames.

Returns a list of the properties recognized by this image. If no properties are available, null will be returned.

Returns:String[]

an array of Strings representing valid property names.

Annotations
@Override
getPropertyNamesback to summary
public String[] getPropertyNames(String prefix)

Returns an array of Strings 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.

Returns:String[]

an array of Strings giving the valid property names.

getSampleModelback to summary
public SampleModel getSampleModel()

Implements java.awt.image.RenderedImage.getSampleModel.

Returns the SampleModel of the image.

Annotations
@Override
getSourcesback to summary
public Vector<RenderedImage> getSources()

Implements java.awt.image.RenderedImage.getSources.

Doc from java.awt.image.RenderedImage.getSources.

Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage. This method returns null if the RenderedImage object has no information about its immediate sources. It returns an empty Vector if the RenderedImage object has no immediate sources.

Annotations
@Override
getTileGridXOffsetback to summary
public int getTileGridXOffset()

Implements java.awt.image.RenderedImage.getTileGridXOffset.

Returns the X coordinate of the upper-left pixel of tile (0, 0).

Annotations
@Override
getTileGridYOffsetback to summary
public int getTileGridYOffset()

Implements java.awt.image.RenderedImage.getTileGridYOffset.

Returns the Y coordinate of the upper-left pixel of tile (0, 0).

Annotations
@Override
getTileHeightback to summary
public int getTileHeight()

Implements java.awt.image.RenderedImage.getTileHeight.

Returns the height of a tile.

Annotations
@Override
getTileWidthback to summary
public int getTileWidth()

Implements java.awt.image.RenderedImage.getTileWidth.

Returns the width of a tile.

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements java.awt.image.RenderedImage.getWidth.

Returns the width of the image.

Annotations
@Override
tileXToXback to summary
public 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.

tileXToXback to summary
public int tileXToX(int tx)

Converts a horizontal tile index into the X coordinate of its upper left pixel. This is a convenience method. No attempt is made to detect out-of-range indices.

Parameters
tx:int

the horizontal index of a tile.

Returns:int

the X coordinate of the tile's upper left pixel.

tileYToYback to summary
public 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.

tileYToYback to summary
public int tileYToY(int ty)

Converts a vertical tile index into the Y coordinate of its upper left pixel. This is a convenience method. No attempt is made to detect out-of-range indices.

Parameters
ty:int

the vertical index of a tile.

Returns:int

the Y coordinate of the tile's upper left pixel.

XToTileXback to summary
public 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.

XToTileXback to summary
public int XToTileX(int x)

Converts a pixel's X coordinate into a horizontal tile index. This is a convenience method. No attempt is made to detect out-of-range coordinates.

Parameters
x:int

the X coordinate of a pixel.

Returns:int

the X index of the tile containing the pixel.

YToTileYback to summary
public 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.

YToTileYback to summary
public int YToTileY(int y)

Converts a pixel's Y coordinate into a vertical tile index. This is a convenience method. No attempt is made to detect out-of-range coordinates.

Parameters
y:int

the Y coordinate of a pixel.

Returns:int

the Y index of the tile containing the pixel.