This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.awt.image
interface RenderedImage

All Known Subinterfaces:
WritableRenderedImage

Most common way to construct:

IIOImage image = …;

RenderedImage im = image.getRenderedImage();

Based on 6 examples


public interface RenderedImage

RenderedImage is a common interface for objects which contain or can produce image data in the form of Rasters. The image data may be stored/produced as a single tile or a regular array of tiles.


Method Summary
 WritableRaster

          Computes an arbitrary rectangular region of the RenderedImage and copies it into a caller-supplied WritableRaster.
 ColorModel

          Returns the ColorModel associated with this image.
 Raster

          Returns the image as one large tile (for tile based images this will require fetching the whole image and copying the image data over).
 Raster

          Computes and returns an arbitrary region of the RenderedImage.
 int

          Returns the height of the RenderedImage.
 int

          Returns the minimum tile index in the X direction.
 int

          Returns the minimum tile index in the Y direction.
 int

          Returns the minimum X coordinate (inclusive) of the RenderedImage.
 int

          Returns the minimum Y coordinate (inclusive) of the RenderedImage.
 int

          Returns the number of tiles in the X direction.
 int

          Returns the number of tiles in the Y direction.
 Object

          Gets a property from the property set of this image.
 String[]

          Returns an array of names recognized by java.awt.image.RenderedImage.getProperty or null, if no property names are recognized.
 SampleModel

          Returns the SampleModel associated with this image.
 Vector

          Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage.
 Raster
getTile(int tileX, int tileY)

          Returns tile (tileX, tileY).
 int

          Returns the X offset of the tile grid relative to the origin, i.e., the X coordinate of the upper-left pixel of tile (0, 0).
 int

          Returns the Y offset of the tile grid relative to the origin, i.e., the Y coordinate of the upper-left pixel of tile (0, 0).
 int

          Returns the tile height in pixels.
 int

          Returns the tile width in pixels.
 int

          Returns the width of the RenderedImage.
 

Method Detail

copyData

public WritableRaster copyData(WritableRaster raster)
Computes an arbitrary rectangular region of the RenderedImage and copies it into a caller-supplied WritableRaster. The region to be computed is determined from the bounds of the supplied WritableRaster. The supplied WritableRaster must have a SampleModel that is compatible with this image. If raster is null, an appropriate WritableRaster is created.

Parameters:
raster - a WritableRaster to hold the returned portion of the image, or null.
Returns:
a reference to the supplied or created WritableRaster.

getColorModel

public ColorModel getColorModel()
Returns the ColorModel associated with this image. All Rasters returned from this image will have this as their ColorModel. This can return null.

Returns:
the ColorModel of this image.

getData

public Raster getData()
Returns the image as one large tile (for tile based images this will require fetching the whole image and copying the image data over). The Raster returned is a copy of the image data and will not be updated if the image is changed.

Returns:
the image as one large tile.

getData

public Raster getData(Rectangle rect)
Computes and returns an arbitrary region of the RenderedImage. The Raster returned is a copy of the image data and will not be updated if the image is changed.

Parameters:
rect - the region of the RenderedImage to be returned.
Returns:
the region of the RenderedImage indicated by the specified Rectangle.

getHeight

public int getHeight()
Returns the height of the RenderedImage.

Returns:
the height of this RenderedImage.

getMinTileX

public int getMinTileX()
Returns the minimum tile index in the X direction.

Returns:
the minimum tile index in the X direction.

getMinTileY

public int getMinTileY()
Returns the minimum tile index in the Y direction.

Returns:
the minimum tile index in the X direction.

getMinX

public int getMinX()
Returns the minimum X coordinate (inclusive) of the RenderedImage.

Returns:
the X coordinate of this RenderedImage.

getMinY

public int getMinY()
Returns the minimum Y coordinate (inclusive) of the RenderedImage.

Returns:
the Y coordinate of this RenderedImage.

getNumXTiles

public int getNumXTiles()
Returns the number of tiles in the X direction.

Returns:
the number of tiles in the X direction.

getNumYTiles

public int getNumYTiles()
Returns the number of tiles in the Y direction.

Returns:
the number of tiles in the Y direction.

getProperty

public Object getProperty(String name)
Gets a property from the property set of this image. The set of properties and whether it is immutable is determined by the implementing class. This method returns java.awt.Image.UndefinedProperty if the specified property is not defined for this RenderedImage.

Parameters:
name - the name of the property
Returns:
the property indicated by the specified name.

getPropertyNames

public String[] getPropertyNames()
Returns an array of names recognized by {@link #getProperty(String) getProperty(String)} or null, if no property names are recognized.

Returns:
a String array containing all of the property names that getProperty(String) recognizes; or null if no property names are recognized.

getSampleModel

public SampleModel getSampleModel()
Returns the SampleModel associated with this image. All Rasters returned from this image will have this as their SampleModel.

Returns:
the SampleModel of this image.

getSources

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

Returns:
a Vector of RenderedImage objects.

getTile

public Raster getTile(int tileX,
                      int tileY)
Returns tile (tileX, tileY). Note that tileX and tileY are indices into the tile array, not pixel locations. The Raster that is returned is live and will be updated if the image is changed.

Parameters:
tileX - the X index of the requested tile in the tile array
tileY - the Y index of the requested tile in the tile array
Returns:
the tile given the specified indices.

getTileGridXOffset

public int getTileGridXOffset()
Returns the X offset of the tile grid relative to the origin, i.e., the X coordinate of the upper-left pixel of tile (0, 0). (Note that tile (0, 0) may not actually exist.)

Returns:
the X offset of the tile grid relative to the origin.

getTileGridYOffset

public int getTileGridYOffset()
Returns the Y offset of the tile grid relative to the origin, i.e., the Y coordinate of the upper-left pixel of tile (0, 0). (Note that tile (0, 0) may not actually exist.)

Returns:
the Y offset of the tile grid relative to the origin.

getTileHeight

public int getTileHeight()
Returns the tile height in pixels. All tiles must have the same height.

Returns:
the tile height in pixels.

getTileWidth

public int getTileWidth()
Returns the tile width in pixels. All tiles must have the same width.

Returns:
the tile width in pixels.

getWidth

public int getWidth()
Returns the width of the RenderedImage.

Returns:
the width of this RenderedImage.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.