|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Image
java.awt.image.BufferedImage
public class BufferedImage
A buffered image always starts at coordinates (0, 0). The buffered image is not subdivided into multiple tiles. Instead, the image consists of one large tile (0,0) with the width and height of the image. This tile is always considered to be checked out.
| Field Summary | |
|---|---|
static int |
TYPE_3BYTE_BGR
|
static int |
TYPE_4BYTE_ABGR
|
static int |
TYPE_4BYTE_ABGR_PRE
|
static int |
TYPE_BYTE_BINARY
|
static int |
TYPE_BYTE_GRAY
|
static int |
TYPE_BYTE_INDEXED
|
static int |
TYPE_CUSTOM
|
static int |
TYPE_INT_ARGB
|
static int |
TYPE_INT_ARGB_PRE
|
static int |
TYPE_INT_BGR
|
static int |
TYPE_INT_RGB
|
static int |
TYPE_USHORT_555_RGB
|
static int |
TYPE_USHORT_565_RGB
|
static int |
TYPE_USHORT_GRAY
|
| Fields inherited from class java.awt.Image |
|---|
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty |
| Fields inherited from interface java.awt.Transparency |
|---|
BITMASK, OPAQUE, TRANSLUCENT |
| Constructor Summary | |
|---|---|
BufferedImage(ColorModel colormodel,
WritableRaster writableraster,
boolean premultiplied,
Hashtable<?,?> properties)
|
|
BufferedImage(int width,
int height,
int type)
Creates a new BufferedImage with the specified width, height
and type. |
|
BufferedImage(int w,
int h,
int type,
IndexColorModel indexcolormodel)
|
|
| Method Summary | |
|---|---|
void |
addTileObserver(TileObserver to)
Adds a tile observer. |
void |
coerceData(boolean premultiplied)
|
WritableRaster |
copyData(WritableRaster dest)
|
Graphics2D |
createGraphics()
|
void |
flush()
Flushes (that is, destroys) any resources used for this image. |
WritableRaster |
getAlphaRaster()
|
ColorModel |
getColorModel()
|
Raster |
getData()
|
Raster |
getData(Rectangle rectangle)
|
Graphics |
getGraphics()
Returns a graphics context object for drawing an off-screen object. |
int |
getHeight()
|
int |
getHeight(ImageObserver imageobserver)
Returns the height of the image, or -1 if it is unknown. |
int |
getMinTileX()
|
int |
getMinTileY()
|
int |
getMinX()
|
int |
getMinY()
|
int |
getNumXTiles()
|
int |
getNumYTiles()
|
Object |
getProperty(String string)
Returns the value of the specified property, or Image.UndefinedProperty if the property is not defined. |
Object |
getProperty(String string,
ImageObserver imageobserver)
This method requests a named property for an object. |
String[] |
getPropertyNames()
Returns null always. |
WritableRaster |
getRaster()
|
int |
getRGB(int x,
int y)
|
int[] |
getRGB(int startX,
int startY,
int w,
int h,
int[] rgbArray,
int offset,
int scanlineStride)
|
SampleModel |
getSampleModel()
|
ImageProducer |
getSource()
Returns the image producer object for this object. |
Vector<RenderedImage> |
getSources()
|
BufferedImage |
getSubimage(int x,
int y,
int w,
int h)
|
Raster |
getTile(int tileX,
int tileY)
|
int |
getTileGridXOffset()
|
int |
getTileGridYOffset()
|
int |
getTileHeight()
|
int |
getTileWidth()
|
int |
getTransparency()
Return the transparency type. |
int |
getType()
|
int |
getWidth()
|
int |
getWidth(ImageObserver imageobserver)
Returns the width of the image, or -1 if it is unknown. |
WritableRaster |
getWritableTile(int tileX,
int tileY)
|
Point[] |
getWritableTileIndices()
|
boolean |
hasTileWriters()
|
boolean |
isAlphaPremultiplied()
|
boolean |
isTileWritable(int tileX,
int tileY)
|
void |
releaseWritableTile(int tileX,
int tileY)
|
void |
removeTileObserver(TileObserver to)
Removes a tile observer. |
void |
setData(Raster src)
|
void |
setRGB(int x,
int y,
int argb)
|
void |
setRGB(int startX,
int startY,
int w,
int h,
int[] argbArray,
int offset,
int scanlineStride)
|
String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.awt.Image |
|---|
getAccelerationPriority, getScaledInstance, setAccelerationPriority |
| 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
| Constructor Detail |
|---|
public BufferedImage(int width,
int height,
int type)
BufferedImage with the specified width, height
and type. Valid type values are:
TYPE_INT_RGBTYPE_INT_ARGBTYPE_INT_ARGB_PRETYPE_INT_BGRTYPE_3BYTE_BGRTYPE_4BYTE_ABGRTYPE_4BYTE_ABGR_PRETYPE_USHORT_565_RGBTYPE_USHORT_555_RGBTYPE_BYTE_GRAYTYPE_USHORT_GRAYTYPE_BYTE_BINARYTYPE_BYTE_INDEXED
width - the width (must be > 0).height - the height (must be > 0).type - the image type (see the list of valid types above).
IllegalArgumentException - if width or
height is less than or equal to zero.
IllegalArgumentException - if type is not one of the
specified values.
public BufferedImage(int w,
int h,
int type,
IndexColorModel indexcolormodel)
public BufferedImage(ColorModel colormodel,
WritableRaster writableraster,
boolean premultiplied,
Hashtable<?,?> properties)
| Method Detail |
|---|
public void coerceData(boolean premultiplied)
public WritableRaster copyData(WritableRaster dest)
copyData in interface RenderedImagepublic Graphics2D createGraphics()
public void flush()
Image
flush in class Imagepublic WritableRaster getAlphaRaster()
public ColorModel getColorModel()
getColorModel in interface RenderedImagepublic Raster getData()
getData in interface RenderedImagepublic Raster getData(Rectangle rectangle)
getData in interface RenderedImagepublic Graphics getGraphics()
Image
getGraphics in class Imagepublic int getHeight()
getHeight in interface RenderedImagepublic int getHeight(ImageObserver imageobserver)
Image
getHeight in class Imageimageobserver - the image observer for this object
Image.getWidth(ImageObserver)public int getMinTileX()
getMinTileX in interface RenderedImagepublic int getMinTileY()
getMinTileY in interface RenderedImagepublic int getMinX()
getMinX in interface RenderedImagepublic int getMinY()
getMinY in interface RenderedImagepublic int getNumXTiles()
getNumXTiles in interface RenderedImagepublic int getNumYTiles()
getNumYTiles in interface RenderedImagepublic Object getProperty(String string)
Image.UndefinedProperty if the property is not defined.
getProperty in interface RenderedImagestring - the property key (null not permitted).
NullPointerException - if string is null.
public Object getProperty(String string,
ImageObserver imageobserver)
ImageUndefinedProperty is
returned if there is no property with the specified name. The value
null is returned if the properties for the object are
not yet known. In this case, the specified image observer is notified
when the properties are known.
getProperty in class Imagestring - the requested property nameimageobserver - the image observer for this object
Image.UndefinedPropertypublic String[] getPropertyNames()
null always.
getPropertyNames in interface RenderedImagenull always.
public int getRGB(int x,
int y)
public int[] getRGB(int startX,
int startY,
int w,
int h,
int[] rgbArray,
int offset,
int scanlineStride)
public WritableRaster getRaster()
public SampleModel getSampleModel()
getSampleModel in interface RenderedImagepublic ImageProducer getSource()
Image
getSource in class Imagepublic Vector<RenderedImage> getSources()
getSources in interface RenderedImage
public BufferedImage getSubimage(int x,
int y,
int w,
int h)
public Raster getTile(int tileX,
int tileY)
getTile in interface RenderedImagepublic int getTileGridXOffset()
getTileGridXOffset in interface RenderedImagepublic int getTileGridYOffset()
getTileGridYOffset in interface RenderedImagepublic int getTileHeight()
getTileHeight in interface RenderedImagepublic int getTileWidth()
getTileWidth in interface RenderedImagepublic int getType()
public int getWidth()
getWidth in interface RenderedImagepublic int getWidth(ImageObserver imageobserver)
Image
getWidth in class Imageimageobserver - the image observer for this object
Image.getHeight(ImageObserver)
public WritableRaster getWritableTile(int tileX,
int tileY)
getWritableTile in interface WritableRenderedImagepublic Point[] getWritableTileIndices()
getWritableTileIndices in interface WritableRenderedImagepublic boolean hasTileWriters()
hasTileWriters in interface WritableRenderedImagepublic boolean isAlphaPremultiplied()
public boolean isTileWritable(int tileX,
int tileY)
isTileWritable in interface WritableRenderedImage
public void releaseWritableTile(int tileX,
int tileY)
releaseWritableTile in interface WritableRenderedImagepublic void setData(Raster src)
setData in interface WritableRenderedImage
public void setRGB(int x,
int y,
int argb)
public void setRGB(int startX,
int startY,
int w,
int h,
int[] argbArray,
int offset,
int scanlineStride)
public String toString()
ObjectSystem.out.println()
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
toString in class ObjectObject.getClass(),
Object.hashCode(),
Class.getName(),
Integer.toHexString(int)public void addTileObserver(TileObserver to)
addTileObserver in interface WritableRenderedImageto - The TileObserver to add.public void removeTileObserver(TileObserver to)
removeTileObserver in interface WritableRenderedImageto - The TileObserver to remove.public int getTransparency()
getTransparency in interface TransparencyTransparency.OPAQUE, Transparency.BITMASK, or Transparency.TRANSLUCENT.Transparency.getTransparency()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||