JSR-209 (Final Release)

java.awt.image
Interface RenderedImage

All Known Implementing Classes:
BufferedImage

public interface RenderedImage

RenderedImage is a common interface for objects which contain or can produce image data in the form of Rasters.

Restrictions

All implementing classes of this interface must be BufferedImage


Method Summary
 WritableRaster copyData(WritableRaster raster)
          Computes an arbitrary rectangular region of the RenderedImage and copies it into a caller-supplied WritableRaster.
 java.awt.image.ColorModel getColorModel()
          Returns the ColorModel associated with this image.
 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).
 Raster getData(Rectangle rect)
          Computes and returns an arbitrary region of the RenderedImage.
 int getHeight()
          Returns the height of the RenderedImage.
 int getMinX()
          Returns the minimum X coordinate (inclusive) of the RenderedImage.
 int getMinY()
          Returns the minimum Y coordinate (inclusive) of the RenderedImage.
 java.lang.Object getProperty(java.lang.String name)
          Gets a property from the property set of this image.
 java.lang.String[] getPropertyNames()
          Returns an array of names recognized by getProperty(String) or null, if no property names are recognized.
 SampleModel getSampleModel()
          Returns the SampleModel associated with this image.
 java.util.Vector getSources()
          Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage.
 int getWidth()
          Returns the width of the RenderedImage.
 

Method Detail

getSources

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

getProperty

public java.lang.Object getProperty(java.lang.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.
See Also:
Image.UndefinedProperty

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns an array of names recognized by 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.

getColorModel

public java.awt.image.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.

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.

getWidth

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

Returns:
the width of this RenderedImage.

getHeight

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

Returns:
the height of this RenderedImage.

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.

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.

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.

JSR-209 (Final Release)

Java and Java 2D are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Copyright 1993 - 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All Rights Reserved.
Use of this specification is subject to this license.