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