java.awt.image
Class BufferedImage

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Image sample code for java.awt.Image definition code for java.awt.Image 
      extended by java.awt.image.BufferedImage
All Implemented Interfaces:
RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage , WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage , Transparency sample code for java.awt.Transparency definition code for java.awt.Transparency

public class BufferedImage
extends Image sample code for java.awt.Image definition code for java.awt.Image
implements WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage , Transparency sample code for java.awt.Transparency definition code for java.awt.Transparency

The BufferedImage subclass describes an Image sample code for java.awt.Image definition code for java.awt.Image with an accessible buffer of image data. A BufferedImage is comprised of a ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel and a Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster of image data. The number and types of bands in the SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel of the Raster must match the number and types required by the ColorModel to represent its color and alpha components. All BufferedImage objects have an upper left corner coordinate of (0, 0). Any Raster used to construct a BufferedImage must therefore have minX=0 and minY=0.

This class relies on the data fetching and setting methods of Raster, and on the color characterization methods of ColorModel.

See Also:
ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel , Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster , WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster

Field Summary
static int TYPE_3BYTE_BGR sample code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR definition code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR
          Represents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes.
static int TYPE_4BYTE_ABGR sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR definition code for java.awt.image.BufferedImage.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 sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE definition code for java.awt.image.BufferedImage.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 sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY definition code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY
          Represents an opaque byte-packed 1, 2, or 4 bit image.
static int TYPE_BYTE_GRAY sample code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY definition code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY
          Represents a unsigned byte grayscale image, non-indexed.
static int TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED definition code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED
          Represents an indexed byte image.
static int TYPE_CUSTOM sample code for java.awt.image.BufferedImage.TYPE_CUSTOM definition code for java.awt.image.BufferedImage.TYPE_CUSTOM
          Image type is not recognized so it must be a customized image.
static int TYPE_INT_ARGB sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB
          Represents an image with 8-bit RGBA color components packed into integer pixels.
static int TYPE_INT_ARGB_PRE sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE
          Represents an image with 8-bit RGBA color components packed into integer pixels.
static int TYPE_INT_BGR sample code for java.awt.image.BufferedImage.TYPE_INT_BGR definition code for java.awt.image.BufferedImage.TYPE_INT_BGR
          Represents an image with 8-bit RGB color components, corresponding 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 sample code for java.awt.image.BufferedImage.TYPE_INT_RGB definition code for java.awt.image.BufferedImage.TYPE_INT_RGB
          Represents an image with 8-bit RGB color components packed into integer pixels.
static int TYPE_USHORT_555_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB definition code for java.awt.image.BufferedImage.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 sample code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB definition code for java.awt.image.BufferedImage.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 sample code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY definition code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY
          Represents an unsigned short grayscale image, non-indexed).
 
Fields inherited from class java.awt.Image sample code for java.awt.Image definition code for java.awt.Image
accelerationPriority sample code for java.awt.Image.accelerationPriority definition code for java.awt.Image.accelerationPriority , SCALE_AREA_AVERAGING sample code for java.awt.Image.SCALE_AREA_AVERAGING definition code for java.awt.Image.SCALE_AREA_AVERAGING , SCALE_DEFAULT sample code for java.awt.Image.SCALE_DEFAULT definition code for java.awt.Image.SCALE_DEFAULT , SCALE_FAST sample code for java.awt.Image.SCALE_FAST definition code for java.awt.Image.SCALE_FAST , SCALE_REPLICATE sample code for java.awt.Image.SCALE_REPLICATE definition code for java.awt.Image.SCALE_REPLICATE , SCALE_SMOOTH sample code for java.awt.Image.SCALE_SMOOTH definition code for java.awt.Image.SCALE_SMOOTH , UndefinedProperty sample code for java.awt.Image.UndefinedProperty definition code for java.awt.Image.UndefinedProperty
 
Fields inherited from interface java.awt.Transparency sample code for java.awt.Transparency definition code for java.awt.Transparency
BITMASK sample code for java.awt.Transparency.BITMASK definition code for java.awt.Transparency.BITMASK , OPAQUE sample code for java.awt.Transparency.OPAQUE definition code for java.awt.Transparency.OPAQUE , TRANSLUCENT sample code for java.awt.Transparency.TRANSLUCENT definition code for java.awt.Transparency.TRANSLUCENT
 
Constructor Summary
BufferedImage sample code for java.awt.image.BufferedImage.BufferedImage(java.awt.image.ColorModel, java.awt.image.WritableRaster, boolean, java.util.Hashtable) definition code for java.awt.image.BufferedImage.BufferedImage(java.awt.image.ColorModel, java.awt.image.WritableRaster, boolean, java.util.Hashtable) (ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  cm, WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  raster, boolean isRasterPremultiplied, Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> properties)
          Constructs a new BufferedImage with a specified ColorModel and Raster.
BufferedImage sample code for java.awt.image.BufferedImage.BufferedImage(int, int, int) definition code for java.awt.image.BufferedImage.BufferedImage(int, int, int) (int width, int height, int imageType)
          Constructs a BufferedImage of one of the predefined image types.
BufferedImage sample code for java.awt.image.BufferedImage.BufferedImage(int, int, int, java.awt.image.IndexColorModel) definition code for java.awt.image.BufferedImage.BufferedImage(int, int, int, java.awt.image.IndexColorModel) (int width, int height, int imageType, IndexColorModel sample code for java.awt.image.IndexColorModel definition code for java.awt.image.IndexColorModel  cm)
          Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED.
 
Method Summary
 void addTileObserver sample code for java.awt.image.BufferedImage.addTileObserver(java.awt.image.TileObserver) definition code for java.awt.image.BufferedImage.addTileObserver(java.awt.image.TileObserver) (TileObserver sample code for java.awt.image.TileObserver definition code for java.awt.image.TileObserver  to)
          Adds a tile observer.
 void coerceData sample code for java.awt.image.BufferedImage.coerceData(boolean) definition code for java.awt.image.BufferedImage.coerceData(boolean) (boolean isAlphaPremultiplied)
          Forces the data to match the state specified in the isAlphaPremultiplied variable.
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster copyData sample code for java.awt.image.BufferedImage.copyData(java.awt.image.WritableRaster) definition code for java.awt.image.BufferedImage.copyData(java.awt.image.WritableRaster) (WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  outRaster)
          Computes an arbitrary rectangular region of the BufferedImage and copies it into a specified WritableRaster.
 Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D createGraphics sample code for java.awt.image.BufferedImage.createGraphics() definition code for java.awt.image.BufferedImage.createGraphics() ()
          Creates a Graphics2D, which can be used to draw into this BufferedImage.
 void flush sample code for java.awt.image.BufferedImage.flush() definition code for java.awt.image.BufferedImage.flush() ()
          Flushes all resources being used to cache optimization information.
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster getAlphaRaster sample code for java.awt.image.BufferedImage.getAlphaRaster() definition code for java.awt.image.BufferedImage.getAlphaRaster() ()
          Returns a WritableRaster representing the alpha channel for BufferedImage objects with ColorModel objects that support a separate spatial alpha channel, such as ComponentColorModel and DirectColorModel.
 ImageCapabilities sample code for java.awt.ImageCapabilities definition code for java.awt.ImageCapabilities getCapabilities sample code for java.awt.image.BufferedImage.getCapabilities(java.awt.GraphicsConfiguration) definition code for java.awt.image.BufferedImage.getCapabilities(java.awt.GraphicsConfiguration) (GraphicsConfiguration sample code for java.awt.GraphicsConfiguration definition code for java.awt.GraphicsConfiguration  gc)
          This overrides Image.getCapabilities(gc) to get the capabilities of its surfaceManager.
 ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel getColorModel sample code for java.awt.image.BufferedImage.getColorModel() definition code for java.awt.image.BufferedImage.getColorModel() ()
          Returns the ColorModel.
 Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster getData sample code for java.awt.image.BufferedImage.getData() definition code for java.awt.image.BufferedImage.getData() ()
          Returns the image as one large tile.
 Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster getData sample code for java.awt.image.BufferedImage.getData(java.awt.Rectangle) definition code for java.awt.image.BufferedImage.getData(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  rect)
          Computes and returns an arbitrary region of the BufferedImage.
 Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics getGraphics sample code for java.awt.image.BufferedImage.getGraphics() definition code for java.awt.image.BufferedImage.getGraphics() ()
          This method returns a Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D , but is here for backwards compatibility.
 int getHeight sample code for java.awt.image.BufferedImage.getHeight() definition code for java.awt.image.BufferedImage.getHeight() ()
          Returns the height of the BufferedImage.
 int getHeight sample code for java.awt.image.BufferedImage.getHeight(java.awt.image.ImageObserver) definition code for java.awt.image.BufferedImage.getHeight(java.awt.image.ImageObserver) (ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver  observer)
          Returns the height of the BufferedImage.
 int getMinTileX sample code for java.awt.image.BufferedImage.getMinTileX() definition code for java.awt.image.BufferedImage.getMinTileX() ()
          Returns the minimum tile index in the x direction.
 int getMinTileY sample code for java.awt.image.BufferedImage.getMinTileY() definition code for java.awt.image.BufferedImage.getMinTileY() ()
          Returns the minimum tile index in the y direction.
 int getMinX sample code for java.awt.image.BufferedImage.getMinX() definition code for java.awt.image.BufferedImage.getMinX() ()
          Returns the minimum x coordinate of this BufferedImage.
 int getMinY sample code for java.awt.image.BufferedImage.getMinY() definition code for java.awt.image.BufferedImage.getMinY() ()
          Returns the minimum y coordinate of this BufferedImage.
 int getNumXTiles sample code for java.awt.image.BufferedImage.getNumXTiles() definition code for java.awt.image.BufferedImage.getNumXTiles() ()
          Returns the number of tiles in the x direction.
 int getNumYTiles sample code for java.awt.image.BufferedImage.getNumYTiles() definition code for java.awt.image.BufferedImage.getNumYTiles() ()
          Returns the number of tiles in the y direction.
 Object sample code for java.lang.Object definition code for java.lang.Object getProperty sample code for java.awt.image.BufferedImage.getProperty(java.lang.String) definition code for java.awt.image.BufferedImage.getProperty(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Returns a property of the image by name.
 Object sample code for java.lang.Object definition code for java.lang.Object getProperty sample code for java.awt.image.BufferedImage.getProperty(java.lang.String, java.awt.image.ImageObserver) definition code for java.awt.image.BufferedImage.getProperty(java.lang.String, java.awt.image.ImageObserver) (String sample code for java.lang.String definition code for java.lang.String  name, ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver  observer)
          Returns a property of the image by name.
 String sample code for java.lang.String definition code for java.lang.String [] getPropertyNames sample code for java.awt.image.BufferedImage.getPropertyNames() definition code for java.awt.image.BufferedImage.getPropertyNames() ()
          Returns an array of names recognized by getProperty(String) sample code for java.awt.image.BufferedImage.getProperty(java.lang.String) definition code for java.awt.image.BufferedImage.getProperty(java.lang.String) or null, if no property names are recognized.
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster getRaster sample code for java.awt.image.BufferedImage.getRaster() definition code for java.awt.image.BufferedImage.getRaster() ()
          Returns the WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster .
 int getRGB sample code for java.awt.image.BufferedImage.getRGB(int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int) (int x, int y)
          Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace.
 int[] getRGB sample code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int) (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.
 SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel getSampleModel sample code for java.awt.image.BufferedImage.getSampleModel() definition code for java.awt.image.BufferedImage.getSampleModel() ()
          Returns the SampleModel associated with this BufferedImage.
 ImageProducer sample code for java.awt.image.ImageProducer definition code for java.awt.image.ImageProducer getSource sample code for java.awt.image.BufferedImage.getSource() definition code for java.awt.image.BufferedImage.getSource() ()
          Returns the object that produces the pixels for the image.
 Vector sample code for java.util.Vector definition code for java.util.Vector <RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage > getSources sample code for java.awt.image.BufferedImage.getSources() definition code for java.awt.image.BufferedImage.getSources() ()
          Returns a Vector sample code for java.util.Vector definition code for java.util.Vector of RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage objects that are the immediate sources, not the sources of these immediate sources, of image data for this BufferedImage.
 BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage getSubimage sample code for java.awt.image.BufferedImage.getSubimage(int, int, int, int) definition code for java.awt.image.BufferedImage.getSubimage(int, int, int, int) (int x, int y, int w, int h)
          Returns a subimage defined by a specified rectangular region.
 Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster getTile sample code for java.awt.image.BufferedImage.getTile(int, int) definition code for java.awt.image.BufferedImage.getTile(int, int) (int tileX, int tileY)
          Returns tile (tileXtileY).
 int getTileGridXOffset sample code for java.awt.image.BufferedImage.getTileGridXOffset() definition code for java.awt.image.BufferedImage.getTileGridXOffset() ()
          Returns the x offset of the tile grid relative to the origin, For example, the x coordinate of the location of tile (0, 0).
 int getTileGridYOffset sample code for java.awt.image.BufferedImage.getTileGridYOffset() definition code for java.awt.image.BufferedImage.getTileGridYOffset() ()
          Returns the y offset of the tile grid relative to the origin, For example, the y coordinate of the location of tile (0, 0).
 int getTileHeight sample code for java.awt.image.BufferedImage.getTileHeight() definition code for java.awt.image.BufferedImage.getTileHeight() ()
          Returns the tile height in pixels.
 int getTileWidth sample code for java.awt.image.BufferedImage.getTileWidth() definition code for java.awt.image.BufferedImage.getTileWidth() ()
          Returns the tile width in pixels.
 int getTransparency sample code for java.awt.image.BufferedImage.getTransparency() definition code for java.awt.image.BufferedImage.getTransparency() ()
          Returns the transparency.
 int getType sample code for java.awt.image.BufferedImage.getType() definition code for java.awt.image.BufferedImage.getType() ()
          Returns the image type.
 int getWidth sample code for java.awt.image.BufferedImage.getWidth() definition code for java.awt.image.BufferedImage.getWidth() ()
          Returns the width of the BufferedImage.
 int getWidth sample code for java.awt.image.BufferedImage.getWidth(java.awt.image.ImageObserver) definition code for java.awt.image.BufferedImage.getWidth(java.awt.image.ImageObserver) (ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver  observer)
          Returns the width of the BufferedImage.
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster getWritableTile sample code for java.awt.image.BufferedImage.getWritableTile(int, int) definition code for java.awt.image.BufferedImage.getWritableTile(int, int) (int tileX, int tileY)
          Checks out a tile for writing.
 Point sample code for java.awt.Point definition code for java.awt.Point [] getWritableTileIndices sample code for java.awt.image.BufferedImage.getWritableTileIndices() definition code for java.awt.image.BufferedImage.getWritableTileIndices() ()
          Returns an array of Point sample code for java.awt.Point definition code for java.awt.Point objects indicating which tiles are checked out for writing.
 boolean hasTileWriters sample code for java.awt.image.BufferedImage.hasTileWriters() definition code for java.awt.image.BufferedImage.hasTileWriters() ()
          Returns whether or not any tile is checked out for writing.
 boolean isAlphaPremultiplied sample code for java.awt.image.BufferedImage.isAlphaPremultiplied() definition code for java.awt.image.BufferedImage.isAlphaPremultiplied() ()
          Returns whether or not the alpha has been premultiplied.
 boolean isTileWritable sample code for java.awt.image.BufferedImage.isTileWritable(int, int) definition code for java.awt.image.BufferedImage.isTileWritable(int, int) (int tileX, int tileY)
          Returns whether or not a tile is currently checked out for writing.
 void releaseWritableTile sample code for java.awt.image.BufferedImage.releaseWritableTile(int, int) definition code for java.awt.image.BufferedImage.releaseWritableTile(int, int) (int tileX, int tileY)
          Relinquishes permission to write to a tile.
 void removeTileObserver sample code for java.awt.image.BufferedImage.removeTileObserver(java.awt.image.TileObserver) definition code for java.awt.image.BufferedImage.removeTileObserver(java.awt.image.TileObserver) (TileObserver sample code for java.awt.image.TileObserver definition code for java.awt.image.TileObserver  to)
          Removes a tile observer.
 void setData sample code for java.awt.image.BufferedImage.setData(java.awt.image.Raster) definition code for java.awt.image.BufferedImage.setData(java.awt.image.Raster) (Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  r)
          Sets a rectangular region of the image to the contents of the specified Raster r, which is assumed to be in the same coordinate space as the BufferedImage.
 void setRGB sample code for java.awt.image.BufferedImage.setRGB(int, int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int) (int x, int y, int rgb)
          Sets a pixel in this BufferedImage to the specified RGB value.
 void setRGB sample code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int) (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.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.awt.image.BufferedImage.toString() definition code for java.awt.image.BufferedImage.toString() ()
          Returns a String representation of this BufferedImage object and its values.
 
Methods inherited from class java.awt.Image sample code for java.awt.Image definition code for java.awt.Image
getAccelerationPriority sample code for java.awt.Image.getAccelerationPriority() definition code for java.awt.Image.getAccelerationPriority() , getScaledInstance sample code for java.awt.Image.getScaledInstance(int, int, int) definition code for java.awt.Image.getScaledInstance(int, int, int) , setAccelerationPriority sample code for java.awt.Image.setAccelerationPriority(float) definition code for java.awt.Image.setAccelerationPriority(float)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

TYPE_CUSTOM sample code for java.awt.image.BufferedImage.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.

See Also:
Constant Field Values

TYPE_INT_RGB sample code for java.awt.image.BufferedImage.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 sample code for java.awt.image.DirectColorModel definition code for java.awt.image.DirectColorModel without alpha. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_INT_ARGB sample code for java.awt.image.BufferedImage.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 created image is consistent with images created in the JDK1.1 and earlier releases.

See Also:
Constant Field Values

TYPE_INT_ARGB_PRE sample code for java.awt.image.BufferedImage.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.

See Also:
Constant Field Values

TYPE_INT_BGR sample code for java.awt.image.BufferedImage.TYPE_INT_BGR

public static final int TYPE_INT_BGR
Represents an image with 8-bit RGB color components, corresponding 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 DirectColorModel sample code for java.awt.image.DirectColorModel definition code for java.awt.image.DirectColorModel . When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_3BYTE_BGR sample code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR

public static final int TYPE_3BYTE_BGR
Represents an image with 8-bit RGB color components, corresponding 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. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_4BYTE_ABGR sample code for java.awt.image.BufferedImage.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 is 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.

See Also:
Constant Field Values

TYPE_4BYTE_ABGR_PRE sample code for java.awt.image.BufferedImage.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 is 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.

See Also:
Constant Field Values

TYPE_USHORT_565_RGB sample code for java.awt.image.BufferedImage.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. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_USHORT_555_RGB sample code for java.awt.image.BufferedImage.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. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_BYTE_GRAY sample code for java.awt.image.BufferedImage.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 sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace . When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_USHORT_GRAY sample code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY

public static final int TYPE_USHORT_GRAY
Represents an unsigned short grayscale image, non-indexed). This image has a ComponentColorModel with a CS_GRAY ColorSpace. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite sample code for java.awt.AlphaComposite definition code for java.awt.AlphaComposite documentation.

See Also:
Constant Field Values

TYPE_BYTE_BINARY sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY

public static final int TYPE_BYTE_BINARY
Represents an opaque byte-packed 1, 2, or 4 bit image. The image has an IndexColorModel sample code for java.awt.image.IndexColorModel definition code for java.awt.image.IndexColorModel without alpha. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, a 1-bit image is created with an IndexColorModel with two colors in the default sRGB ColorSpace: {0, 0, 0} and {255, 255, 255}.

Images with 2 or 4 bits per pixel may be constructed via the BufferedImage constructor that takes a ColorModel argument by supplying a ColorModel with an appropriate map size.

Images with 8 bits per pixel should use the image types TYPE_BYTE_INDEXED or TYPE_BYTE_GRAY depending on their ColorModel.

When color data is stored in an image of this type, the closest color in the colormap is determined by the IndexColorModel and the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in the IndexColorModel colormap.

See Also:
Constant Field Values

TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.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 that takes an imageType argument but no ColorModel argument, an IndexColorModel is created with a 256-color 6/6/6 color cube palette with the rest of the colors from 216-255 populated by grayscale values in the default sRGB ColorSpace.

When color data is stored in an image of this type, the closest color in the colormap is determined by the IndexColorModel and the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in the IndexColorModel colormap.

See Also:
Constant Field Values
Constructor Detail

BufferedImage sample code for java.awt.image.BufferedImage(int, int, int) definition code for java.awt.image.BufferedImage(int, int, int)

public BufferedImage(int width,
                     int height,
                     int imageType)
Constructs a BufferedImage of one of the predefined image types. The ColorSpace for the image is 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 sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace , TYPE_INT_RGB sample code for java.awt.image.BufferedImage.TYPE_INT_RGB definition code for java.awt.image.BufferedImage.TYPE_INT_RGB , TYPE_INT_ARGB sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB , TYPE_INT_ARGB_PRE sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE , TYPE_INT_BGR sample code for java.awt.image.BufferedImage.TYPE_INT_BGR definition code for java.awt.image.BufferedImage.TYPE_INT_BGR , TYPE_3BYTE_BGR sample code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR definition code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR , TYPE_4BYTE_ABGR sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR , TYPE_4BYTE_ABGR_PRE sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE , TYPE_BYTE_GRAY sample code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY definition code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY , TYPE_USHORT_GRAY sample code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY definition code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY , TYPE_BYTE_BINARY sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY definition code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY , TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED definition code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED , TYPE_USHORT_565_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB , TYPE_USHORT_555_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB

BufferedImage sample code for java.awt.image.BufferedImage(int, int, int, java.awt.image.IndexColorModel) definition code for java.awt.image.BufferedImage(int, int, int, java.awt.image.IndexColorModel)

public BufferedImage(int width,
                     int height,
                     int imageType,
                     IndexColorModel sample code for java.awt.image.IndexColorModel definition code for java.awt.image.IndexColorModel  cm)
Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED.

If the image type is TYPE_BYTE_BINARY, the number of entries in the color model is used to determine whether the image should have 1, 2, or 4 bits per pixel. If the color model has 1 or 2 entries, the image will have 1 bit per pixel. If it has 3 or 4 entries, the image with have 2 bits per pixel. If it has between 5 and 16 entries, the image will have 4 bits per pixel. Otherwise, an IllegalArgumentException will be thrown.

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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the imageType is not TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED or if the imageType is TYPE_BYTE_BINARY and the color map has more than 16 entries.
See Also:
TYPE_BYTE_BINARY sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY definition code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY , TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED definition code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED

BufferedImage sample code for java.awt.image.BufferedImage(java.awt.image.ColorModel, java.awt.image.WritableRaster, boolean, java.util.Hashtable<?, ?>) definition code for java.awt.image.BufferedImage(java.awt.image.ColorModel, java.awt.image.WritableRaster, boolean, java.util.Hashtable<?, ?>)

public BufferedImage(ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  cm,
                     WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  raster,
                     boolean isRasterPremultiplied,
                     Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> properties)
Constructs a new BufferedImage with a specified 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 sample code for java.awt.image.RasterFormatException definition code for java.awt.image.RasterFormatException is thrown. This method can multiply or divide the color Raster data by alpha to match the alphaPremultiplied state in the ColorModel. Properties for this BufferedImage can be established by passing in a Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable of String/Object pairs.

Parameters:
cm - 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.
Throws:
RasterFormatException - 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.
IllegalArgumentException - if raster is incompatible with cm
See Also:
ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel , Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster , WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster
Method Detail

getType sample code for java.awt.image.BufferedImage.getType() definition code for java.awt.image.BufferedImage.getType()

public int getType()
Returns the image type. If it is not one of the known types, TYPE_CUSTOM is returned.

Returns:
the image type of this BufferedImage.
See Also:
TYPE_INT_RGB sample code for java.awt.image.BufferedImage.TYPE_INT_RGB definition code for java.awt.image.BufferedImage.TYPE_INT_RGB , TYPE_INT_ARGB sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB , TYPE_INT_ARGB_PRE sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE , TYPE_INT_BGR sample code for java.awt.image.BufferedImage.TYPE_INT_BGR definition code for java.awt.image.BufferedImage.TYPE_INT_BGR , TYPE_3BYTE_BGR sample code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR definition code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR , TYPE_4BYTE_ABGR sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR , TYPE_4BYTE_ABGR_PRE sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE , TYPE_BYTE_GRAY sample code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY definition code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY , TYPE_BYTE_BINARY sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY definition code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY , TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED definition code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED , TYPE_USHORT_GRAY sample code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY definition code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY , TYPE_USHORT_565_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB , TYPE_USHORT_555_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB , TYPE_CUSTOM sample code for java.awt.image.BufferedImage.TYPE_CUSTOM definition code for java.awt.image.BufferedImage.TYPE_CUSTOM

getColorModel sample code for java.awt.image.BufferedImage.getColorModel() definition code for java.awt.image.BufferedImage.getColorModel()

public ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  getColorModel()
Returns the ColorModel.

Specified by:
getColorModel sample code for java.awt.image.RenderedImage.getColorModel() definition code for java.awt.image.RenderedImage.getColorModel() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the ColorModel of this BufferedImage.

getRaster sample code for java.awt.image.BufferedImage.getRaster() definition code for java.awt.image.BufferedImage.getRaster()

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  getRaster()
Returns the WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster .

Returns:
the WriteableRaster of this BufferedImage.

getAlphaRaster sample code for java.awt.image.BufferedImage.getAlphaRaster() definition code for java.awt.image.BufferedImage.getAlphaRaster()

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  getAlphaRaster()
Returns a WritableRaster representing the alpha channel for BufferedImage objects with ColorModel objects 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 ColorModel objects 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 that has alpha in the lookup table, this method returns null since there is no spatially discrete alpha channel. This method creates a new WritableRaster, but shares the data array.

Returns:
a WritableRaster or null if this BufferedImage has no alpha channel associated with its ColorModel.

getRGB sample code for java.awt.image.BufferedImage.getRGB(int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int)

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

An ArrayOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
x, y - the coordinates of the pixel from which to get the pixel in the default RGB color model and sRGB color space
Returns:
an integer pixel in the default RGB color model and default sRGB colorspace.
See Also:
setRGB(int, int, int) sample code for java.awt.image.BufferedImage.setRGB(int, int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int) , setRGB(int, int, int, int, int[], int, int) sample code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int)

getRGB sample code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int)

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 takes 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. With a specified coordinate (x, y) in the image, the ARGB pixel can be accessed in this way:

    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)]; 

An ArrayOutOfBoundsException may be thrown if the region is not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
startX, startY - the starting coordinates
w - width of region
h - height of region
rgbArray - if not null, the rgb pixels are written here
offset - offset into the rgbArray
scansize - scanline stride for the rgbArray
Returns:
array of RGB pixels.
See Also:
setRGB(int, int, int) sample code for java.awt.image.BufferedImage.setRGB(int, int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int) , setRGB(int, int, int, int, int[], int, int) sample code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int)

setRGB sample code for java.awt.image.BufferedImage.setRGB(int, int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int)

public void setRGB(int x,
                   int y,
                   int rgb)
Sets a pixel in this BufferedImage to the specified RGB value. 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 is chosen.

An ArrayOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
x, y - the coordinates of the pixel to set
rgb - the RGB value
See Also:
getRGB(int, int) sample code for java.awt.image.BufferedImage.getRGB(int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int) , getRGB(int, int, int, int, int[], int, int) sample code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int)

setRGB sample code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.setRGB(int, int, int, int, int[], int, int)

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 takes 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. With a specified coordinate (x, y) in the this image, the ARGB pixel can be accessed in this way:
    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)];
 
WARNING: No dithering takes place.

An ArrayOutOfBoundsException may be thrown if the region is not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
startX, startY - the starting coordinates
w - width of the region
h - height of the region
rgbArray - the rgb pixels
offset - offset into the rgbArray
scansize - scanline stride for the rgbArray
See Also:
getRGB(int, int) sample code for java.awt.image.BufferedImage.getRGB(int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int) , getRGB(int, int, int, int, int[], int, int) sample code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int) definition code for java.awt.image.BufferedImage.getRGB(int, int, int, int, int[], int, int)

getWidth sample code for java.awt.image.BufferedImage.getWidth() definition code for java.awt.image.BufferedImage.getWidth()

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

Specified by:
getWidth sample code for java.awt.image.RenderedImage.getWidth() definition code for java.awt.image.RenderedImage.getWidth() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the width of this BufferedImage

getHeight sample code for java.awt.image.BufferedImage.getHeight() definition code for java.awt.image.BufferedImage.getHeight()

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

Specified by:
getHeight sample code for java.awt.image.RenderedImage.getHeight() definition code for java.awt.image.RenderedImage.getHeight() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the height of this BufferedImage

getWidth sample code for java.awt.image.BufferedImage.getWidth(java.awt.image.ImageObserver) definition code for java.awt.image.BufferedImage.getWidth(java.awt.image.ImageObserver)

public int getWidth(ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver  observer)
Returns the width of the BufferedImage.

Specified by:
getWidth sample code for java.awt.Image.getWidth(java.awt.image.ImageObserver) definition code for java.awt.Image.getWidth(java.awt.image.ImageObserver) in class Image sample code for java.awt.Image definition code for java.awt.Image
Parameters:
observer - ignored
Returns:
the width of this BufferedImage
See Also:
Image.getHeight(java.awt.image.ImageObserver) sample code for java.awt.Image.getHeight(java.awt.image.ImageObserver) definition code for java.awt.Image.getHeight(java.awt.image.ImageObserver) , ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver

getHeight sample code for java.awt.image.BufferedImage.getHeight(java.awt.image.ImageObserver) definition code for java.awt.image.BufferedImage.getHeight(java.awt.image.ImageObserver)

public int getHeight(ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver  observer)
Returns the height of the BufferedImage.

Specified by:
getHeight sample code for java.awt.Image.getHeight(java.awt.image.ImageObserver) definition code for java.awt.Image.getHeight(java.awt.image.ImageObserver) in class Image sample code for java.awt.Image definition code for java.awt.Image
Parameters:
observer - ignored
Returns:
the height of this BufferedImage
See Also:
Image.getWidth(java.awt.image.ImageObserver) sample code for java.awt.Image.getWidth(java.awt.image.ImageObserver) definition code for java.awt.Image.getWidth(java.awt.image.ImageObserver) , ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver

getSource sample code for java.awt.image.BufferedImage.getSource() definition code for java.awt.image.BufferedImage.getSource()

public ImageProducer sample code for java.awt.image.ImageProducer definition code for java.awt.image.ImageProducer  getSource()
Returns the object that produces the pixels for the image.

Specified by:
getSource sample code for java.awt.Image.getSource() definition code for java.awt.Image.getSource() in class Image sample code for java.awt.Image definition code for java.awt.Image
Returns:
the ImageProducer sample code for java.awt.image.ImageProducer definition code for java.awt.image.ImageProducer that is used to produce the pixels for this image.
See Also:
ImageProducer sample code for java.awt.image.ImageProducer definition code for java.awt.image.ImageProducer

getProperty sample code for java.awt.image.BufferedImage.getProperty(java.lang.String, java.awt.image.ImageObserver) definition code for java.awt.image.BufferedImage.getProperty(java.lang.String, java.awt.image.ImageObserver)

public Object sample code for java.lang.Object definition code for java.lang.Object  getProperty(String sample code for java.lang.String definition code for java.lang.String  name,
                          ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.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 returns the UndefinedProperty field. If the properties for this image are not yet known, then this method returns null and the ImageObserver object is notified later. The property name "comment" should be used to store an optional comment that can be presented to the user as a description of the image, its source, or its author.

Specified by:
getProperty sample code for java.awt.Image.getProperty(java.lang.String, java.awt.image.ImageObserver) definition code for java.awt.Image.getProperty(java.lang.String, java.awt.image.ImageObserver) in class Image sample code for java.awt.Image definition code for java.awt.Image
Parameters:
name - the property name
observer - the ImageObserver that receives notification regarding image information
Returns:
an Object sample code for java.lang.Object definition code for java.lang.Object that is the property referred to by the specified name or null if the properties of this image are not yet known.
Throws:
NullPointerException - if the property name is null.
See Also:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , Image.UndefinedProperty sample code for java.awt.Image.UndefinedProperty definition code for java.awt.Image.UndefinedProperty

getProperty sample code for java.awt.image.BufferedImage.getProperty(java.lang.String) definition code for java.awt.image.BufferedImage.getProperty(java.lang.String)

public Object sample code for java.lang.Object definition code for java.lang.Object  getProperty(String sample code for java.lang.String definition code for java.lang.String  name)
Returns a property of the image by name.

Specified by:
getProperty sample code for java.awt.image.RenderedImage.getProperty(java.lang.String) definition code for java.awt.image.RenderedImage.getProperty(java.lang.String) in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Parameters:
name - the property name
Returns:
an Object that is the property referred to by the specified name.
Throws:
NullPointerException - if the property name is null.
See Also:
Image.UndefinedProperty sample code for java.awt.Image.UndefinedProperty definition code for java.awt.Image.UndefinedProperty

flush sample code for java.awt.image.BufferedImage.flush() definition code for java.awt.image.BufferedImage.flush()

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

Specified by:
flush sample code for java.awt.Image.flush() definition code for java.awt.Image.flush() in class Image sample code for java.awt.Image definition code for java.awt.Image

getGraphics sample code for java.awt.image.BufferedImage.getGraphics() definition code for java.awt.image.BufferedImage.getGraphics()

public Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  getGraphics()
This method returns a Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D , but is here for backwards compatibility. createGraphics sample code for java.awt.image.BufferedImage.createGraphics() definition code for java.awt.image.BufferedImage.createGraphics() is more convenient, since it is declared to return a Graphics2D.

Specified by:
getGraphics sample code for java.awt.Image.getGraphics() definition code for java.awt.Image.getGraphics() in class Image sample code for java.awt.Image definition code for java.awt.Image
Returns:
a Graphics2D, which can be used to draw into this image.
See Also:
Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics , Component.createImage(int, int) sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int)

createGraphics sample code for java.awt.image.BufferedImage.createGraphics() definition code for java.awt.image.BufferedImage.createGraphics()

public Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D  createGraphics()
Creates a Graphics2D, which can be used to draw into this BufferedImage.

Returns:
a Graphics2D, used for drawing into this image.

getSubimage sample code for java.awt.image.BufferedImage.getSubimage(int, int, int, int) definition code for java.awt.image.BufferedImage.getSubimage(int, int, int, int)

public BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage  getSubimage(int x,
                                 int y,
                                 int w,
                                 int h)
Returns a subimage defined by a specified rectangular region. The returned BufferedImage shares the same data array as the original image.

Parameters:
x, y - the coordinates of the upper-left corner of the specified rectangular region
w - the width of the specified rectangular region
h - the height of the specified rectangular region
Returns:
a BufferedImage that is the subimage of this BufferedImage.
Throws:
RasterFormatException - if the specified area is not contained within this BufferedImage.

isAlphaPremultiplied sample code for java.awt.image.BufferedImage.isAlphaPremultiplied() definition code for java.awt.image.BufferedImage.isAlphaPremultiplied()

public boolean isAlphaPremultiplied()
Returns whether or not the alpha has been premultiplied. It returns false if there is no alpha.

Returns:
true if the alpha has been premultiplied; false otherwise.

coerceData sample code for java.awt.image.BufferedImage.coerceData(boolean) definition code for java.awt.image.BufferedImage.coerceData(boolean)

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.

Parameters:
isAlphaPremultiplied - true if the alpha has been premultiplied; false otherwise.

toString sample code for java.awt.image.BufferedImage.toString() definition code for java.awt.image.BufferedImage.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a String representation of this BufferedImage object and its values.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a String representing this BufferedImage.

getSources sample code for java.awt.image.BufferedImage.getSources() definition code for java.awt.image.BufferedImage.getSources()

public Vector sample code for java.util.Vector definition code for java.util.Vector <RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage > getSources()
Returns a Vector sample code for java.util.Vector definition code for java.util.Vector of RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage objects that are the immediate sources, not the sources of these 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.

Specified by:
getSources sample code for java.awt.image.RenderedImage.getSources() definition code for java.awt.image.RenderedImage.getSources() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
a Vector containing immediate sources of this BufferedImage object's image date, or null if this BufferedImage has no information about its immediate sources, or an empty Vector if this BufferedImage has no immediate sources.

getPropertyNames sample code for java.awt.image.BufferedImage.getPropertyNames() definition code for java.awt.image.BufferedImage.getPropertyNames()

public String sample code for java.lang.String definition code for java.lang.String [] getPropertyNames()
Returns an array of names recognized by getProperty(String) sample code for java.awt.image.BufferedImage.getProperty(java.lang.String) definition code for java.awt.image.BufferedImage.getProperty(java.lang.String) or null, if no property names are recognized.

Specified by:
getPropertyNames sample code for java.awt.image.RenderedImage.getPropertyNames() definition code for java.awt.image.RenderedImage.getPropertyNames() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
a String array containing all of the property names that getProperty(String) recognizes; or null if no property names are recognized.

getMinX sample code for java.awt.image.BufferedImage.getMinX() definition code for java.awt.image.BufferedImage.getMinX()

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

Specified by:
getMinX sample code for java.awt.image.RenderedImage.getMinX() definition code for java.awt.image.RenderedImage.getMinX() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the minimum x coordinate of this BufferedImage.

getMinY sample code for java.awt.image.BufferedImage.getMinY() definition code for java.awt.image.BufferedImage.getMinY()

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

Specified by:
getMinY sample code for java.awt.image.RenderedImage.getMinY() definition code for java.awt.image.RenderedImage.getMinY() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the minimum y coordinate of this BufferedImage.

getSampleModel sample code for java.awt.image.BufferedImage.getSampleModel() definition code for java.awt.image.BufferedImage.getSampleModel()

public SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  getSampleModel()
Returns the SampleModel associated with this BufferedImage.

Specified by:
getSampleModel sample code for java.awt.image.RenderedImage.getSampleModel() definition code for java.awt.image.RenderedImage.getSampleModel() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the SampleModel of this BufferedImage.

getNumXTiles sample code for java.awt.image.BufferedImage.getNumXTiles() definition code for java.awt.image.BufferedImage.getNumXTiles()

public int getNumXTiles()
Returns the number of tiles in the x direction. This is always one.

Specified by:
getNumXTiles sample code for java.awt.image.RenderedImage.getNumXTiles() definition code for java.awt.image.RenderedImage.getNumXTiles() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the number of tiles in the x direction.

getNumYTiles sample code for java.awt.image.BufferedImage.getNumYTiles() definition code for java.awt.image.BufferedImage.getNumYTiles()

public int getNumYTiles()
Returns the number of tiles in the y direction. This is always one.

Specified by:
getNumYTiles sample code for java.awt.image.RenderedImage.getNumYTiles() definition code for java.awt.image.RenderedImage.getNumYTiles() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the number of tiles in the y direction.

getMinTileX sample code for java.awt.image.BufferedImage.getMinTileX() definition code for java.awt.image.BufferedImage.getMinTileX()

public int getMinTileX()
Returns the minimum tile index in the x direction. This is always zero.

Specified by:
getMinTileX sample code for java.awt.image.RenderedImage.getMinTileX() definition code for java.awt.image.RenderedImage.getMinTileX() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the minimum tile index in the x direction.

getMinTileY sample code for java.awt.image.BufferedImage.getMinTileY() definition code for java.awt.image.BufferedImage.getMinTileY()

public int getMinTileY()
Returns the minimum tile index in the y direction. This is always zero.

Specified by:
getMinTileY sample code for java.awt.image.RenderedImage.getMinTileY() definition code for java.awt.image.RenderedImage.getMinTileY() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the mininum tile index in the y direction.

getTileWidth sample code for java.awt.image.BufferedImage.getTileWidth() definition code for java.awt.image.BufferedImage.getTileWidth()

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

Specified by:
getTileWidth sample code for java.awt.image.RenderedImage.getTileWidth() definition code for java.awt.image.RenderedImage.getTileWidth() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the tile width in pixels.

getTileHeight sample code for java.awt.image.BufferedImage.getTileHeight() definition code for java.awt.image.BufferedImage.getTileHeight()

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

Specified by:
getTileHeight sample code for java.awt.image.RenderedImage.getTileHeight() definition code for java.awt.image.RenderedImage.getTileHeight() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the tile height in pixels.

getTileGridXOffset sample code for java.awt.image.BufferedImage.getTileGridXOffset() definition code for java.awt.image.BufferedImage.getTileGridXOffset()

public int getTileGridXOffset()
Returns the x offset of the tile grid relative to the origin, For example, the x coordinate of the location of tile (0, 0). This is always zero.

Specified by:
getTileGridXOffset sample code for java.awt.image.RenderedImage.getTileGridXOffset() definition code for java.awt.image.RenderedImage.getTileGridXOffset() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the x offset of the tile grid.

getTileGridYOffset sample code for java.awt.image.BufferedImage.getTileGridYOffset() definition code for java.awt.image.BufferedImage.getTileGridYOffset()

public int getTileGridYOffset()
Returns the y offset of the tile grid relative to the origin, For example, the y coordinate of the location of tile (0, 0). This is always zero.

Specified by:
getTileGridYOffset sample code for java.awt.image.RenderedImage.getTileGridYOffset() definition code for java.awt.image.RenderedImage.getTileGridYOffset() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
the y offset of the tile grid.

getTile sample code for java.awt.image.BufferedImage.getTile(int, int) definition code for java.awt.image.BufferedImage.getTile(int, int)

public Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  getTile(int tileX,
                      int tileY)
Returns tile (tileXtileY). Note that tileX and tileY are indices into the tile array, not pixel locations. The Raster that is returned is live, which means that it is updated if the image is changed.

Specified by:
getTile sample code for java.awt.image.RenderedImage.getTile(int, int) definition code for java.awt.image.RenderedImage.getTile(int, int) in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
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:
a Raster that is the tile defined by the arguments tileX and tileY.
Throws:
ArrayIndexOutOfBoundsException - if both tileX and tileY are not equal to 0

getData sample code for java.awt.image.BufferedImage.getData() definition code for java.awt.image.BufferedImage.getData()

public Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  getData()
Returns the image as one large tile. The Raster returned is a copy of the image data is not updated if the image is changed.

Specified by:
getData sample code for java.awt.image.RenderedImage.getData() definition code for java.awt.image.RenderedImage.getData() in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Returns:
a Raster that is a copy of the image data.
See Also:
setData(Raster) sample code for java.awt.image.BufferedImage.setData(java.awt.image.Raster) definition code for java.awt.image.BufferedImage.setData(java.awt.image.Raster)

getData sample code for java.awt.image.BufferedImage.getData(java.awt.Rectangle) definition code for java.awt.image.BufferedImage.getData(java.awt.Rectangle)

public Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  getData(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  rect)
Computes and returns an arbitrary region of the BufferedImage. The Raster returned is a copy of the image data and is not updated if the image is changed.

Specified by:
getData sample code for java.awt.image.RenderedImage.getData(java.awt.Rectangle) definition code for java.awt.image.RenderedImage.getData(java.awt.Rectangle) in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Parameters:
rect - the region of the BufferedImage to be returned.
Returns:
a Raster that is a copy of the image data of the specified region of the BufferedImage
See Also:
setData(Raster) sample code for java.awt.image.BufferedImage.setData(java.awt.image.Raster) definition code for java.awt.image.BufferedImage.setData(java.awt.image.Raster)

copyData sample code for java.awt.image.BufferedImage.copyData(java.awt.image.WritableRaster) definition code for java.awt.image.BufferedImage.copyData(java.awt.image.WritableRaster)

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  copyData(WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  outRaster)
Computes an arbitrary rectangular region of the BufferedImage and copies it into a specified WritableRaster. The region to be computed is determined from the bounds of the specified WritableRaster. The specified WritableRaster must have a SampleModel that is compatible with this image. If outRaster is null, an appropriate WritableRaster is created.

Specified by:
copyData sample code for java.awt.image.RenderedImage.copyData(java.awt.image.WritableRaster) definition code for java.awt.image.RenderedImage.copyData(java.awt.image.WritableRaster) in interface RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage
Parameters:
outRaster - a WritableRaster to hold the returned part of the image, or null
Returns:
a reference to the supplied or created WritableRaster.

setData sample code for java.awt.image.BufferedImage.setData(java.awt.image.Raster) definition code for java.awt.image.BufferedImage.setData(java.awt.image.Raster)

public void setData(Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  r)
Sets a rectangular region of the image to the contents of the specified 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 sample code for java.awt.image.WritableRenderedImage.setData(java.awt.image.Raster) definition code for java.awt.image.WritableRenderedImage.setData(java.awt.image.Raster) in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Parameters:
r - the specified Raster
See Also:
getData() sample code for java.awt.image.BufferedImage.getData() definition code for java.awt.image.BufferedImage.getData() , getData(Rectangle) sample code for java.awt.image.BufferedImage.getData(java.awt.Rectangle) definition code for java.awt.image.BufferedImage.getData(java.awt.Rectangle)

addTileObserver sample code for java.awt.image.BufferedImage.addTileObserver(java.awt.image.TileObserver) definition code for java.awt.image.BufferedImage.addTileObserver(java.awt.image.TileObserver)

public void addTileObserver(TileObserver sample code for java.awt.image.TileObserver definition code for java.awt.image.TileObserver  to)
Adds a tile observer. If the observer is already present, it receives multiple notifications.

Specified by:
addTileObserver sample code for java.awt.image.WritableRenderedImage.addTileObserver(java.awt.image.TileObserver) definition code for java.awt.image.WritableRenderedImage.addTileObserver(java.awt.image.TileObserver) in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Parameters:
to - the specified TileObserver sample code for java.awt.image.TileObserver definition code for java.awt.image.TileObserver

removeTileObserver sample code for java.awt.image.BufferedImage.removeTileObserver(java.awt.image.TileObserver) definition code for java.awt.image.BufferedImage.removeTileObserver(java.awt.image.TileObserver)

public void removeTileObserver(TileObserver sample code for java.awt.image.TileObserver definition code for java.awt.image.TileObserver  to)
Removes a tile observer. If the observer was not registered, nothing happens. If the observer was registered for multiple notifications, it is now registered for one fewer notification.

Specified by:
removeTileObserver sample code for java.awt.image.WritableRenderedImage.removeTileObserver(java.awt.image.TileObserver) definition code for java.awt.image.WritableRenderedImage.removeTileObserver(java.awt.image.TileObserver) in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Parameters:
to - the specified TileObserver.

isTileWritable sample code for java.awt.image.BufferedImage.isTileWritable(int, int) definition code for java.awt.image.BufferedImage.isTileWritable(int, int)

public boolean isTileWritable(int tileX,
                              int tileY)
Returns whether or not a tile is currently checked out for writing.

Specified by:
isTileWritable sample code for java.awt.image.WritableRenderedImage.isTileWritable(int, int) definition code for java.awt.image.WritableRenderedImage.isTileWritable(int, int) in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Parameters:
tileX - the x index of the tile.
tileY - the y index of the tile.
Returns:
true if the tile specified by the specified indices is checked out for writing; false otherwise.
Throws:
ArrayIndexOutOfBoundsException - if both tileX and tileY are not equal to 0

getWritableTileIndices sample code for java.awt.image.BufferedImage.getWritableTileIndices() definition code for java.awt.image.BufferedImage.getWritableTileIndices()

public Point sample code for java.awt.Point definition code for java.awt.Point [] getWritableTileIndices()
Returns an array of Point sample code for java.awt.Point definition code for java.awt.Point objects indicating which tiles are checked out for writing. Returns null if none are checked out.

Specified by:
getWritableTileIndices sample code for java.awt.image.WritableRenderedImage.getWritableTileIndices() definition code for java.awt.image.WritableRenderedImage.getWritableTileIndices() in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Returns:
a Point array that indicates the tiles that are checked out for writing, or null if no tiles are checked out for writing.

hasTileWriters sample code for java.awt.image.BufferedImage.hasTileWriters() definition code for java.awt.image.BufferedImage.hasTileWriters()

public boolean hasTileWriters()
Returns whether or not any tile is checked out for writing. Semantically equivalent to
 (getWritableTileIndices() != null).
 

Specified by:
hasTileWriters sample code for java.awt.image.WritableRenderedImage.hasTileWriters() definition code for java.awt.image.WritableRenderedImage.hasTileWriters() in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Returns:
true if any tile is checked out for writing; false otherwise.

getWritableTile sample code for java.awt.image.BufferedImage.getWritableTile(int, int) definition code for java.awt.image.BufferedImage.getWritableTile(int, int)

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  getWritableTile(int tileX,
                                      int tileY)
Checks out a tile for writing. All registered TileObservers are notified when a tile goes from having no writers to having one writer.

Specified by:
getWritableTile sample code for java.awt.image.WritableRenderedImage.getWritableTile(int, int) definition code for java.awt.image.WritableRenderedImage.getWritableTile(int, int) in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Parameters:
tileX - the x index of the tile
tileY - the y index of the tile
Returns:
a WritableRaster that is the tile, indicated by the specified indices, to be checked out for writing.

releaseWritableTile sample code for java.awt.image.BufferedImage.releaseWritableTile(int, int) definition code for java.awt.image.BufferedImage.releaseWritableTile(int, int)

public void releaseWritableTile(int tileX,
                                int tileY)
Relinquishes permission 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(int, int) sample code for java.awt.image.BufferedImage.getWritableTile(int, int) definition code for java.awt.image.BufferedImage.getWritableTile(int, int) . Any other leads to undefined results. All registered TileObservers are notified when a tile goes from having one writer to having no writers.

Specified by:
releaseWritableTile sample code for java.awt.image.WritableRenderedImage.releaseWritableTile(int, int) definition code for java.awt.image.WritableRenderedImage.releaseWritableTile(int, int) in interface WritableRenderedImage sample code for java.awt.image.WritableRenderedImage definition code for java.awt.image.WritableRenderedImage
Parameters:
tileX - the x index of the tile
tileY - the y index of the tile

getTransparency sample code for java.awt.image.BufferedImage.getTransparency() definition code for java.awt.image.BufferedImage.getTransparency()

public int getTransparency()
Returns the transparency. Returns either OPAQUE, BITMASK, or TRANSLUCENT.

Specified by:
getTransparency sample code for java.awt.Transparency.getTransparency() definition code for java.awt.Transparency.getTransparency() in interface Transparency sample code for java.awt.Transparency definition code for java.awt.Transparency
Returns:
the transparency of this BufferedImage.
Since:
1.5
See Also:
Transparency.OPAQUE sample code for java.awt.Transparency.OPAQUE definition code for java.awt.Transparency.OPAQUE , Transparency.BITMASK sample code for java.awt.Transparency.BITMASK definition code for java.awt.Transparency.BITMASK , Transparency.TRANSLUCENT sample code for java.awt.Transparency.TRANSLUCENT definition code for java.awt.Transparency.TRANSLUCENT

getCapabilities sample code for java.awt.image.BufferedImage.getCapabilities(java.awt.GraphicsConfiguration) definition code for java.awt.image.BufferedImage.getCapabilities(java.awt.GraphicsConfiguration)

public ImageCapabilities sample code for java.awt.ImageCapabilities definition code for java.awt.ImageCapabilities  getCapabilities(GraphicsConfiguration sample code for java.awt.GraphicsConfiguration definition code for java.awt.GraphicsConfiguration  gc)
This overrides Image.getCapabilities(gc) to get the capabilities of its surfaceManager. This means that BufferedImage objects that are accelerated may return a caps object that will indicate this acceleration.

Overrides:
getCapabilities sample code for java.awt.Image.getCapabilities(java.awt.GraphicsConfiguration) definition code for java.awt.Image.getCapabilities(java.awt.GraphicsConfiguration) in class Image sample code for java.awt.Image definition code for java.awt.Image
Parameters:
gc - a GraphicsConfiguration object. A value of null for this parameter will result in getting the image capabilities for the default GraphicsConfiguration.
Returns:
an ImageCapabilities object that contains the capabilities of this Image on the specified GraphicsConfiguration.
See Also:
VolatileImage.getCapabilities()