Java Platform 1.2
Beta 4

Class java.awt.image.BufferedImage

java.lang.Object
  |
  +--java.awt.Image
        |
        +--java.awt.image.BufferedImage

public class BufferedImage
extends Image
implements WritableRenderedImage
This subclass describes an Image with an accessible buffer of image data. A BufferedImage is comprised of a ColorModel and a Raster of image data. The number and types of bands in the SampleModel of the Raster must match the number and types required by the ColorModel to represent its color and alpha components. All BufferedImages have an upper left corner coordinate of 0,0. Any Raster used to construct a BufferedImage must therefore have minX=0 and minY=0.

See Also:
ColorModel, Raster, WritableRaster

Field Summary
static int BANDED_CM
           
static int BINARY_CM
           
static int BITMASK
           
static int BYTE_COMPONENTS
           
static int GRAY_CS
           
static int INDEX_CM
           
static int INT_PACKED_CM
           
static int INTERLEAVED_CM
           
static int OPAQUE
           
static int PREMULTIPLIED
           
static int RGB_CS
           
static int TRANSLUCENT
           
static int TYPE_3BYTE_BGR
          Represents an image with 8-bit RGB color components (corresponds to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes.
static int TYPE_4BYTE_ABGR
          Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.
static int TYPE_4BYTE_ABGR_PRE
          Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.
static int TYPE_BYTE_BINARY
          Represents an opaque byte-packed binary image.
static int TYPE_BYTE_GRAY
          Represents a unsigned byte grayscale image (non-indexed).
static int TYPE_BYTE_INDEXED
          Represents an indexed byte image.
static int TYPE_CUSTOM
          Image type is not recognized so it must be a customized image.
static int TYPE_INT_ARGB
          Represents an image with 8-bit RGBA color components packed into integer pixels.
static int TYPE_INT_ARGB_PRE
          Represents an image with 8-bit RGBA color components packed into integer pixels.
static int TYPE_INT_BGR
          Represents an image with 8-bit RGB color components (corresponds to a Windows- or Solaris- style BGR color model) with the colors Blue, Green, and Red packed into integer pixels.
static int TYPE_INT_RGB
          Represents an image with 8-bit RGB color components packed into integer pixels.
static int TYPE_USHORT_555_RGB
          Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha.
static int TYPE_USHORT_565_RGB
          Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha.
static int TYPE_USHORT_GRAY
          Represents a unsigned short grayscale image (non-indexed).
static int UNKNOWN_CM
           
static int UNKNOWN_CS
           
 
Fields inherited from class java.awt.Image
SCALE_AREA_AVERAGING , SCALE_DEFAULT , SCALE_FAST , SCALE_REPLICATE , SCALE_SMOOTH , UndefinedProperty
 
Constructor Summary
BufferedImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable properties)
          Constructs a new BufferedImage with a given ColorModel and Raster.
BufferedImage(int width, int height, int imageType, IndexColorModel cm)
          Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED
BufferedImage(int width, int height, int imageType)
          Constructs a BufferedImage of one of the predefined image types.
 
Method Summary
 void addTileObserver(TileObserver to)
          Adds a tile observer.
 void coerceData(boolean isAlphaPremultiplied)
          Forces the data to match the state specified in the isAlphaPremultiplied variable.
 WritableRaster copyData(WritableRaster outRaster)
          Computes an arbitrary rectangular region of the BufferedImage and copies it into a caller-supplied WritableRaster.
 Graphics2D createGraphics()
          Creates a Graphics2D, which can be used to draw into this BufferedImage.
 void flush()
          Flushes all resources being used to cache optimization information.
 WritableRaster getAlphaRaster()
          Returns a Raster representing the alpha channel for BufferedImages with ColorModels that support a separate spatial alpha channel (such as ComponentColorModel and DirectColorModel).
 ColorModel getColorModel()
          Returns the ColorModel.
 Raster getData()
          Returns the image as one large tile.
 Raster getData(Rectangle rect)
          Computes and returns an arbitrary region of the BufferedImage.
 Graphics getGraphics()
          This method will actually return a Graphics2D but is here for backwards compatibility. createGraphics() is more convenient, since it is declared to return a Graphics2D.
 int getHeight()
          Returns the height of the BufferedImage.
 int getHeight(ImageObserver observer)
          Returns the actual height of the image.
 int getMinTileX()
          Returns the minimum tile index in the X direction.
 int getMinTileY()
          Returns the minimum tile index in the Y direction.
 int getMinX()
          Returns the minimum x coordinate of the BufferedImage.
 int getMinY()
          Returns the minimum y coordinate of the BufferedImage.
 int getNumXTiles()
          Returns the number of tiles in the X direction.
 int getNumYTiles()
          Returns the number of tiles in the Y direction.
 Object getProperty(String name, ImageObserver observer)
          Returns a property of the image by name.
 Object getProperty(String name)
          Returns a property of the image by name.
 String[] getPropertyNames()
          Returns a list of names recognized by getProperty(String).
 WritableRaster getRaster()
          Returns the Raster.
 int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
          Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data.
 int getRGB(int x, int y)
          Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace.
 SampleModel getSampleModel()
          Returns the sample model associated with this BufferedImage.
 ImageProducer getSource()
          Returns the object that produces the pixels for the image.
 Vector getSources()
          Returns a vector of RenderedImages that are the immediate sources of image data for this BufferedImage.
 BufferedImage getSubimage(int x, int y, int w, int h)
          Returns a subimage given a rectangular region.
 Raster getTile(int tileX, int tileY)
          Returns tile (tileX, tileY).
 int getTileGridXOffset()
          Returns the X offset of the tile grid relative to the origin, i.e.
 int getTileGridYOffset()
          Returns the Y offset of the tile grid relative to the origin, i.e.
 int getTileHeight()
          Returns the tile height in pixels.
 int getTileWidth()
          Returns the tile width in pixels.
 int getType()
          Returns the image type.
 int getWidth()
          Returns the width of the BufferedImage.
 int getWidth(ImageObserver observer)
          Returns the actual width of the image.
 WritableRaster getWritableTile(int tileX, int tileY)
          Checks out a tile for writing.
 Point[] getWritableTileIndices()
          Returns an array of Point objects indicating which tiles are checked out for writing.
 boolean hasTileWriters()
          Returns whether any tile is checked out for writing.
 boolean isAlphaPremultiplied()
          Returns whether or not the alpha has been premultiplied.
 boolean isTileWritable(int tileX, int tileY)
          Returns whether a tile is currently checked out for writing.
 void releaseWritableTile(int tileX, int tileY)
          Relinquishes the right to write to a tile.
 void removeTileObserver(TileObserver to)
          Removes a tile observer.
 void setData(Raster r)
          Sets a rect of the image to the contents of the Raster r, which is assumed to be in the same coordinate space as the BufferedImage.
 void setRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
          Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, into a portion of the image data.
 void setRGB(int x, int y, int rgb)
          Set a pixel in a BufferedImage.
 String toString()
           
 
Methods inherited from class java.awt.Image
getScaledInstance
 
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait
 

Field Detail

TYPE_CUSTOM

public static final int TYPE_CUSTOM
Image type is not recognized so it must be a customized image. This type is only used as a return value for the getType() method.

TYPE_INT_RGB

public static final int TYPE_INT_RGB
Represents an image with 8-bit RGB color components packed into integer pixels. The image has a DirectColorModel (without alpha).

TYPE_INT_ARGB

public static final int TYPE_INT_ARGB
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel (with alpha). The color data in this image is considered not to be premultiplied with alpha. When this type is used as the imageType argument to a BufferedImage constructor, the image created will be consistent with images created in the JDK1.1 and earlier releases.

TYPE_INT_ARGB_PRE

public static final int TYPE_INT_ARGB_PRE
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel (with alpha). The color data in this image is considered to be premultiplied with alpha.

TYPE_INT_BGR

public static final int TYPE_INT_BGR
Represents an image with 8-bit RGB color components (corresponds to a Windows- or Solaris- style BGR color model) with the colors Blue, Green, and Red packed into integer pixels. There is no alpha. The image has a ComponentColorModel.

TYPE_3BYTE_BGR

public static final int TYPE_3BYTE_BGR
Represents an image with 8-bit RGB color components (corresponds to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes. There is no alpha. The image has a ComponentColorModel.

TYPE_4BYTE_ABGR

public static final int TYPE_4BYTE_ABGR
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has a ComponentColorModel (with alpha). The color data in this image will be considered not to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.

TYPE_4BYTE_ABGR_PRE

public static final int TYPE_4BYTE_ABGR_PRE
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has a ComponentColorModel (with alpha). The color data in this image will be considered to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.

TYPE_USHORT_565_RGB

public static final int TYPE_USHORT_565_RGB
Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel.

TYPE_USHORT_555_RGB

public static final int TYPE_USHORT_555_RGB
Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel.

TYPE_BYTE_GRAY

public static final int TYPE_BYTE_GRAY
Represents a unsigned byte grayscale image (non-indexed). This image has a ComponentColorModel with a CS_GRAY ColorSpace.

TYPE_USHORT_GRAY

public static final int TYPE_USHORT_GRAY
Represents a unsigned short grayscale image (non-indexed). This image has a ComponentColorModel with a CS_GRAY ColorSpace.

TYPE_BYTE_BINARY

public static final int TYPE_BYTE_BINARY
Represents an opaque byte-packed binary image. The image has an IndexColorModel (without alpha). When this type is used as the imageType argument to the BufferedImage constructor which takes an imageType argument but no ColorModel argument, an IndexColorModel will be created with two colors in the default sRGB ColorSpace: {0, 0, 0} and {255, 255, 255}.

TYPE_BYTE_INDEXED

public static final int TYPE_BYTE_INDEXED
Represents an indexed byte image. When this type is used as the imageType argument to the BufferedImage constructor which takes an imageType argument but no ColorModel argument, an IndexColorModel will be created with a 216-color 6/6/6 color cube palette in the default sRGB ColorSpace.

OPAQUE

public static final int OPAQUE

BITMASK

public static final int BITMASK

TRANSLUCENT

public static final int TRANSLUCENT

PREMULTIPLIED

public static final int PREMULTIPLIED

BYTE_COMPONENTS

public static final int BYTE_COMPONENTS

INT_PACKED_CM

public static final int INT_PACKED_CM

BINARY_CM

public static final int BINARY_CM

INTERLEAVED_CM

public static final int INTERLEAVED_CM

BANDED_CM

public static final int BANDED_CM

INDEX_CM

public static final int INDEX_CM

UNKNOWN_CM

public static final int UNKNOWN_CM

RGB_CS

public static final int RGB_CS

GRAY_CS

public static final int GRAY_CS

UNKNOWN_CS

public static final int UNKNOWN_CS
Constructor Detail

BufferedImage

public BufferedImage(int width,
                     int height,
                     int imageType)
Constructs a BufferedImage of one of the predefined image types. The ColorSpace for the image will be the default sRGB space.
Parameters:
width - Width of the created image.
height - Height of the created image.
imageType - Type of the created image.
See Also:
ColorSpace, TYPE_INT_RGB, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_GRAY, TYPE_USHORT_GRAY, TYPE_BYTE_BINARY, TYPE_BYTE_INDEXED, TYPE_USHORT_565_RGB, TYPE_USHORT_555_RGB

BufferedImage

public BufferedImage(int width,
                     int height,
                     int imageType,
                     IndexColorModel cm)
Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED
Parameters:
width - Width of the created image.
height - Height of the created image.
imageType - Type of the created image.
cm - IndexColorModel of the created image.
Throws:
IllegalArgumentException - if the imageType is not TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED
See Also:
TYPE_BYTE_BINARY, TYPE_BYTE_INDEXED

BufferedImage

public BufferedImage(ColorModel cm,
                     WritableRaster raster,
                     boolean isRasterPremultiplied,
                     Hashtable properties)
Constructs a new BufferedImage with a given ColorModel and Raster. If the number and types of bands in the SampleModel of the Raster do not match the number and types required by the ColorModel to represent its color and alpha components, a RasterFormatException will be thrown. This method may multiply or divide the color Raster data by alpha to match the alphaPremultiplied state in the ColorModel. Properties for this BufferedImage may be established by passing in a Hashtable of String/Object pairs.
Parameters:
ColorModel - ColorModel for the new image
raster - Raster for the image data
isRasterPremultiplied - If true, the data in the raster has been premultiplied with alpha.
properties - Hashtable of String/Object pairs.
See Also:
ColorModel, Raster, WritableRaster
Method Detail

getType

public int getType()
Returns the image type. If it is not one of the known types, TYPE_CUSTOM is returned.
See Also:
TYPE_INT_RGB, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_GRAY, TYPE_BYTE_BINARY, TYPE_BYTE_INDEXED, TYPE_USHORT_GRAY, TYPE_USHORT_565_RGB, TYPE_USHORT_555_RGB, TYPE_CUSTOM

getColorModel

public ColorModel getColorModel()
Returns the ColorModel.

getRaster

public WritableRaster getRaster()
Returns the Raster.

getAlphaRaster

public WritableRaster getAlphaRaster()
Returns a Raster representing the alpha channel for BufferedImages with ColorModels that support a separate spatial alpha channel (such as ComponentColorModel and DirectColorModel). Returns null if there is no alpha channel associated with the ColorModel in this image. This method assumes that for all ColorModels other than IndexColorModel, if the ColorModel supports alpha, there is a separate alpha channel which is stored as the last band of image data. If the image uses an IndexColorModel which has alpha in the lookup table, this method will return null since there is no spatially discrete alpha channel. This method will create a new Raster (but will share the data array).

getRGB

public int getRGB(int x,
                  int y)
Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace. Color conversion will take place if this default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method.

getRGB

public int[] getRGB(int startX,
                    int startY,
                    int w,
                    int h,
                    int[] rgbArray,
                    int offset,
                    int scansize)
Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data. Color conversion will take place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. Given a coordinate (x,y) in the image, the ARGB pixel can be accessed using the following:
    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)];
 
Parameters:
startX - Starting x Coordinate
startY - Starting y Coordinate
w - Width of region
h - Height of region
rgbArray - If non-null, the rgb pixels will be written here
offset - Offset into the rgbArray
scansize - Scanline stride for the rgbArray
Returns:
Array of RGB pixels.

setRGB

public void setRGB(int x,
                   int y,
                   int rgb)
Set a pixel in a BufferedImage. The pixel is assumed to be in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space. For images with an IndexColorModel, the index with the nearest color will be chosen.

setRGB

public void setRGB(int startX,
                   int startY,
                   int w,
                   int h,
                   int[] rgbArray,
                   int offset,
                   int scansize)
Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, into a portion of the image data. Color conversion will take place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. Given a coordinate (x,y) in the image, the ARGB pixel can be accessed using the following:
    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)];
 
WARNING: No dithering will take place.
Parameters:
startX - Starting x Coordinate
startY - Starting y Coordinate
w - Width of region
h - Height of region
rgbArray - The rgb pixels
offset - Offset into the rgbArray
scansize - Scanline stride for the rgbArray

getWidth

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

getHeight

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

getWidth

public int getWidth(ImageObserver observer)
Returns the actual width of the image. If the width is not known yet, then the ImageObserver will be notified later and -1 will be returned.
Overrides:
getWidth in class Image
See Also:
Image.getHeight(java.awt.image.ImageObserver), ImageObserver

getHeight

public int getHeight(ImageObserver observer)
Returns the actual height of the image. If the height is not known yet, then the ImageObserver will be notified later and -1 will be returned.
Overrides:
getHeight in class Image
See Also:
Image.getWidth(java.awt.image.ImageObserver), ImageObserver

getSource

public ImageProducer getSource()
Returns the object that produces the pixels for the image.
Overrides:
getSource in class Image
See Also:
ImageProducer

getProperty

public Object getProperty(String name,
                          ImageObserver observer)
Returns a property of the image by name. Individual property names are defined by the various image formats. If a property is not defined for a particular image, this method will return the UndefinedProperty object. If the properties for this image are not yet known, then this method will return null and the ImageObserver object will be notified later. The property name "comment" should be used to store an optional comment which can be presented to the user as a description of the image, its source, or its author.
Overrides:
getProperty in class Image
See Also:
ImageObserver, Image.UndefinedProperty

getProperty

public Object getProperty(String name)
Returns a property of the image by name.

flush

public void flush()
Flushes all resources being used to cache optimization information. The underlying pixel data is unaffected.
Overrides:
flush in class Image

getGraphics

public Graphics getGraphics()
This method will actually return a Graphics2D but is here for backwards compatibility. createGraphics() is more convenient, since it is declared to return a Graphics2D.
Overrides:
getGraphics in class Image

createGraphics

public Graphics2D createGraphics()
Creates a Graphics2D, which can be used to draw into this BufferedImage.

getSubimage

public BufferedImage getSubimage(int x,
                                 int y,
                                 int w,
                                 int h)
Returns a subimage given a rectangular region. The returned BufferedImage will share the same data array as the original image.

isAlphaPremultiplied

public boolean isAlphaPremultiplied()
Returns whether or not the alpha has been premultiplied. It will return true if there is no alpha since the default alpha is OPAQUE.

coerceData

public void coerceData(boolean isAlphaPremultiplied)
Forces the data to match the state specified in the isAlphaPremultiplied variable. It may multiply or divide the color Raster data by alpha, or do nothing if the data is in the correct state.

toString

public String toString()
Overrides:
toString in class Object

getSources

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

getPropertyNames

public String[] getPropertyNames()
Returns a list of names recognized by getProperty(String).

getMinX

public int getMinX()
Returns the minimum x coordinate of the BufferedImage. This will always be zero.

getMinY

public int getMinY()
Returns the minimum y coordinate of the BufferedImage. This will always be zero.

getSampleModel

public SampleModel getSampleModel()
Returns the sample model associated with this BufferedImage.

getNumXTiles

public int getNumXTiles()
Returns the number of tiles in the X direction. This will always be one.

getNumYTiles

public int getNumYTiles()
Returns the number of tiles in the Y direction. This will always be one.

getMinTileX

public int getMinTileX()
Returns the minimum tile index in the X direction. This will always be zero.

getMinTileY

public int getMinTileY()
Returns the minimum tile index in the Y direction. This will always be zero.

getTileWidth

public int getTileWidth()
Returns the tile width in pixels.

getTileHeight

public int getTileHeight()
Returns the tile height in pixels.

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). This will always be zero.

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). This will always be zero.

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.

getData

public Raster getData()
Returns the image as one large tile. The Raster returned is a copy of the image data and will not be updated if the image is changed.

getData

public Raster getData(Rectangle rect)
Computes and returns an arbitrary region of the BufferedImage. 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 BufferedImage to be returned.

copyData

public WritableRaster copyData(WritableRaster outRaster)
Computes an arbitrary rectangular region of the BufferedImage 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 outRaster is null, an appropriate WritableRaster is created.
Parameters:
outRaster - a WritableRaster to hold the returned part of the image, or null
Returns:
a reference to the supplied or created WritableRaster.

setData

public void setData(Raster r)
Sets a rect of the image to the contents of the Raster r, which is assumed to be in the same coordinate space as the BufferedImage. The operation is clipped to the bounds of the BufferedImage.
Specified by:
setData in interface WritableRenderedImage

addTileObserver

public void addTileObserver(TileObserver to)
Adds a tile observer. If the observer is already present, it will receive multiple notifications.
Specified by:
addTileObserver in interface WritableRenderedImage

removeTileObserver

public void removeTileObserver(TileObserver to)
Removes a tile observer. If the observer was not registered, nothing happens. If the observer was registered for multiple notifications, it will now be registered for one fewer.
Specified by:
removeTileObserver in interface WritableRenderedImage

isTileWritable

public boolean isTileWritable(int tileX,
                              int tileY)
Returns whether a tile is currently checked out for writing.
Specified by:
isTileWritable in interface WritableRenderedImage
Parameters:
tileX - the X index of the tile.
tileY - the Y index of the tile.

getWritableTileIndices

public Point[] getWritableTileIndices()
Returns an array of Point objects indicating which tiles are checked out for writing. Returns null if none are checked out.
Specified by:
getWritableTileIndices in interface WritableRenderedImage

hasTileWriters

public boolean hasTileWriters()
Returns whether any tile is checked out for writing. Semantically equivalent to (getWritableTileIndices() != null).
Specified by:
hasTileWriters in interface WritableRenderedImage

getWritableTile

public WritableRaster getWritableTile(int tileX,
                                      int tileY)
Checks out a tile for writing. All registered TileObservers will be notified when a tile goes from having no writers to having one writer.
Specified by:
getWritableTile in interface WritableRenderedImage
Parameters:
tileX - the X index of the tile.
tileY - the Y index of the tile.

releaseWritableTile

public void releaseWritableTile(int tileX,
                                int tileY)
Relinquishes the right to write to a tile. If the caller continues to write to the tile, the results are undefined. Calls to this method should only appear in matching pairs with calls to getWritableTile; any other use will lead to undefined results. All registered TileObservers will be notified when a tile goes from having one writer to having no writers.
Specified by:
releaseWritableTile in interface WritableRenderedImage
Parameters:
tileX - the X index of the tile.
tileY - the Y index of the tile.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.