|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Image
![]()
![]()
![]()
java.awt.image.BufferedImage
, WritableRenderedImage
, Transparency

public class BufferedImage

, Transparency

The BufferedImage 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 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.
ColorModel
,
Raster
,
WritableRaster

| Field Summary | |
|---|---|
static 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. |
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 1, 2, or 4 bit 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, 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
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 an unsigned short grayscale image, non-indexed). |
Fields inherited from class java.awt.Image ![]() |
|---|
accelerationPriority |
Fields inherited from interface java.awt.Transparency ![]() |
|---|
BITMASK |
| Constructor Summary | |
|---|---|
BufferedImage
Constructs a new BufferedImage with a specified
ColorModel and Raster. |
|
BufferedImage
Constructs a BufferedImage of one of the predefined
image types. |
|
BufferedImage
Constructs a BufferedImage of one of the predefined
image types:
TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED. |
|
| Method Summary | |
|---|---|
void |
addTileObserver
Adds a tile observer. |
void |
coerceData
Forces the data to match the state specified in the isAlphaPremultiplied variable. |
WritableRaster |
copyData
Computes an arbitrary rectangular region of the BufferedImage and copies it into a specified
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 WritableRaster representing the alpha
channel for BufferedImage objects
with ColorModel objects that support a separate
spatial alpha channel, such as ComponentColorModel and
DirectColorModel. |
ImageCapabilities |
getCapabilities
This overrides Image.getCapabilities(gc) to get the capabilities of its surfaceManager. |
ColorModel |
getColorModel
Returns the ColorModel. |
Raster |
getData
Returns the image as one large tile. |
Raster |
getData
Computes and returns an arbitrary region of the BufferedImage. |
Graphics |
getGraphics
This method returns a Graphics2D , but is here
for backwards compatibility. |
int |
getHeight
Returns the height of the BufferedImage. |
int |
getHeight
Returns the height of the BufferedImage. |
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 this BufferedImage. |
int |
getMinY
Returns the minimum y coordinate of this 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
Returns a property of the image by name. |
Object |
getProperty
Returns a property of the image by name. |
String |
getPropertyNames
Returns an array of names recognized by getProperty(String)
or null, if no property names are recognized. |
WritableRaster |
getRaster
Returns the WritableRaster . |
int |
getRGB
Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace. |
int[] |
getRGB
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 |
getSampleModel
Returns the SampleModel associated with this
BufferedImage. |
ImageProducer |
getSource
Returns the object that produces the pixels for the image. |
Vector |
getSources
Returns a Vector of RenderedImage objects that are
the immediate sources, not the sources of these immediate sources,
of image data for this BufferedImage. |
BufferedImage |
getSubimage
Returns a subimage defined by a specified rectangular region. |
Raster |
getTile
Returns tile ( tileX, tileY). |
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). |
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). |
int |
getTileHeight
Returns the tile height in pixels. |
int |
getTileWidth
Returns the tile width in pixels. |
int |
getTransparency
Returns the transparency. |
int |
getType
Returns the image type. |
int |
getWidth
Returns the width of the BufferedImage. |
int |
getWidth
Returns the width of the BufferedImage. |
WritableRaster |
getWritableTile
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 or not any tile is checked out for writing. |
boolean |
isAlphaPremultiplied
Returns whether or not the alpha has been premultiplied. |
boolean |
isTileWritable
Returns whether or not a tile is currently checked out for writing. |
void |
releaseWritableTile
Relinquishes permission to write to a tile. |
void |
removeTileObserver
Removes a tile observer. |
void |
setData
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
Sets a pixel in this BufferedImage to the specified
RGB value. |
void |
setRGB
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 |
toString
Returns a String representation of this
BufferedImage object and its values. |
Methods inherited from class java.awt.Image ![]() |
|---|
getAccelerationPriority |
Methods inherited from class java.lang.Object ![]() |
|---|
clone |
| Field Detail |
|---|

public static final int TYPE_CUSTOM