| sun.awt.image.BufferedImagePeer
All known Subclasses: sun.awt.pocketpc.PPCSubImage, sun.awt.gtk.GdkSubImage, sun.awt.qt.QtImage, java.awt.QtImage, java.awt.MWImage, sun.awt.pocketpc.PPCImage, sun.awt.gtk.GdkImage, sun.awt.qt.QtSubImage,
BufferedImagePeer | public interface BufferedImagePeer (Code) | | Provides a peer for the implementation of BufferedImage. In basis and personal
profile, BufferedImage is a very much stripped down version of its J2SE couterpart.
In effect, it only allows the getting and setting of RGBs and cannot be constructed
with any public constructors. Instead, it can only be constructed by the
GraphicsConfiguration.createCompatiableImage method. The result is
that BufferedImage in basis and personal is abstract and final and an instance can only
be created via the factory method. This has the advantage of reducing the graphics
formats to be supported by BufferedImage to the formats of the native graphics library.
To implement BufferedImage this interface is used to provide an interface to the implemntation.
BufferedImage delegates its method calls to an instance of this interface.
author: Nicholas Allen |
Method Summary | |
void | flush() Flushes all resources being used to cache optimization information. | ColorModel | getColorModel() Returns the ColorModel . | Graphics | getGraphics() This method returns a
Graphics2D , but is here
for backwards compatibility. | int | getHeight() Returns the height of the BufferedImage . | int | getHeight(ImageObserver observer) Returns the actual height of the image. | 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 an array of names recognized by
BufferedImagePeer.getProperty(String) getProperty(String) or null , if no property names are recognized. | int | getRGB(int x, int y) Returns an integer pixel in the default RGB color model
(TYPE_INT_ARGB) and default sRGB colorspace. | 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. | ImageProducer | getSource() Returns the object that produces the pixels for the 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.
x, y the coordinates of the upper-left corner of thespecified rectangular region Parameters: w - the width of the specified rectangular region Parameters: h - the height of the specified rectangular region a BufferedImage that is the subimage of thisBufferedImage . | 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. | void | setRGB(int x, int y, int rgb) Sets a pixel in this BufferedImage to the specified
RGB value. | 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. |
flush | void flush()(Code) | | Flushes all resources being used to cache optimization information.
The underlying pixel data is unaffected.
|
getColorModel | ColorModel getColorModel()(Code) | | Returns the ColorModel .
the ColorModel of thisBufferedImage . |
getGraphics | Graphics getGraphics()(Code) | | This method returns a
Graphics2D , but is here
for backwards compatibility.
BufferedImagePeer.createGraphics() createGraphics is more
convenient, since it is declared to return a
Graphics2D .
a Graphics2D , which can be used to draw intothis image. |
getHeight | int getHeight()(Code) | | Returns the height of the BufferedImage .
the height of this BufferedImage . |
getHeight | int getHeight(ImageObserver observer)(Code) | | Returns the actual height of the image. If the height is not known
yet then the ImageObserver is notified later and
-1 is returned.
Parameters: observer - the ImageObserver that receivesinformation about the image the height of the image or -1 if the heightis not yet known. See Also: java.awt.Image.getWidth(ImageObserver) See Also: ImageObserver |
getProperty | Object getProperty(String name, ImageObserver observer)(Code) | | 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.
Parameters: name - the property name Parameters: observer - the ImageObserver that receivesnotification regarding image information an Object that is the property referred to by thespecified name or null if theproperties of this image are not yet known. See Also: ImageObserver See Also: java.awt.Image.UndefinedProperty |
getProperty | Object getProperty(String name)(Code) | | Returns a property of the image by name.
Parameters: name - the property name an Object that is the property referred to bythe specified name . |
getPropertyNames | String[] getPropertyNames()(Code) | | Returns an array of names recognized by
BufferedImagePeer.getProperty(String) getProperty(String) or null , if no property names are recognized.
a String array containing all of the propertynames that getProperty(String) recognizes;or null if no property names are recognized. |
getRGB | int getRGB(int x, int y)(Code) | | 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.
x, y the coordinates of the pixel from which to getthe pixel in the default RGB color model and sRGBcolor space an integer pixel in the default RGB color model anddefault sRGB colorspace. |
getRGB | int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)(Code) | | 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)];
startX, startY the starting coordinates Parameters: w - width of region Parameters: h - height of region Parameters: rgbArray - if not null , the rgb pixels arewritten here Parameters: offset - offset into the rgbArray Parameters: scansize - scanline stride for the rgbArray array of RGB pixels. IllegalArgumentException if an unknowndatatype is specified |
getSubimage | BufferedImage getSubimage(int x, int y, int w, int h)(Code) | | Returns a subimage defined by a specified rectangular region.
The returned BufferedImage shares the same
data array as the original image.
x, y the coordinates of the upper-left corner of thespecified rectangular region Parameters: w - the width of the specified rectangular region Parameters: h - the height of the specified rectangular region a BufferedImage that is the subimage of thisBufferedImage . RasterFormatException if the specifiedarea is not contained within this BufferedImage . |
getWidth | int getWidth()(Code) | | Returns the width of the BufferedImage .
the width of this BufferedImage . |
setRGB | void setRGB(int x, int y, int rgb)(Code) | | 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.
x, y the coordinates of the pixel to set Parameters: rgb - the RGB value |
setRGB | void setRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)(Code) | | 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.
startX, startY the starting coordinates Parameters: w - width of the region Parameters: h - height of the region Parameters: rgbArray - the rgb pixels Parameters: offset - offset into the rgbArray Parameters: scansize - scanline stride for the rgbArray |
|
|