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.
Vector<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.
RenderedImage
objects.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.
name
- the name of the propertyImage.UndefinedProperty
String[] getPropertyNames()
Returns an array of names recognized by getProperty(String)
or null
, if no property names are recognized.
String
array containing all of the property names that getProperty(String)
recognizes; or null
if no property names are recognized.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.
ColorModel
of this image.SampleModel getSampleModel()
Returns the SampleModel associated with this image. All Rasters returned from this image will have this as their SampleModel.
SampleModel
of this image.int getWidth()
Returns the width of the RenderedImage.
RenderedImage
.int getHeight()
Returns the height of the RenderedImage.
RenderedImage
.int getMinX()
Returns the minimum X coordinate (inclusive) of the RenderedImage.
RenderedImage
.int getMinY()
Returns the minimum Y coordinate (inclusive) of the RenderedImage.
RenderedImage
.int getNumXTiles()
Returns the number of tiles in the X direction.
int getNumYTiles()
Returns the number of tiles in the Y direction.
int getMinTileX()
Returns the minimum tile index in the X direction.
int getMinTileY()
Returns the minimum tile index in the Y direction.
int getTileWidth()
Returns the tile width in pixels. All tiles must have the same width.
int getTileHeight()
Returns the tile height in pixels. All tiles must have the same height.
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.)
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.)
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.
tileX
- the X index of the requested tile in the tile arraytileY
- the Y index of the requested tile in the tile arrayRaster 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.
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.
rect
- the region of the RenderedImage to be returned.RenderedImage
indicated by the specified Rectangle
.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.
raster
- a WritableRaster to hold the returned portion of the image, or null.
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.