public class

ImageRepresentation

extends ImageWatched
implements ImageConsumer
java.lang.Object
   ↳ sun.awt.image.ImageWatched
     ↳ sun.awt.image.ImageRepresentation

Summary

[Expand]
Inherited Constants
From interface java.awt.image.ImageConsumer
Fields
protected ColorModel cmodel
[Expand]
Inherited Fields
From class sun.awt.image.ImageWatched
Public Constructors
ImageRepresentation(ToolkitImage im, ColorModel cmodel, boolean forceCMhint)
Create an ImageRepresentation for the given Image.
Public Methods
int check(ImageObserver iw)
boolean drawToBufImage(Graphics g, ToolkitImage img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bg, ImageObserver iw)
boolean drawToBufImage(Graphics g, ToolkitImage img, int x, int y, int w, int h, Color bg, ImageObserver iw)
boolean drawToBufImage(Graphics g, ToolkitImage img, int x, int y, Color bg, ImageObserver iw)
boolean drawToBufImage(Graphics g, ToolkitImage img, AffineTransform xform, ImageObserver iw)
int getHeight()
BufferedImage getOpaqueRGBImage()
int getWidth()
void imageComplete(int status)
The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the image has occured.
synchronized void notifyWatcherListEmpty()
boolean prepare(ImageObserver iw)
synchronized void reconstruct(int flags)
void setAccelerationPriority(float priority)
void setColorModel(ColorModel model)
Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls.
void setDimensions(int w, int h)
The dimensions of the source image are reported using the setDimensions method call.
void setHints(int h)
Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer.
void setPixels(int x, int y, int w, int h, ColorModel model, int[] pix, int off, int scansize)
The pixels of the image are delivered using one or more calls to the setPixels method.
void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pix, int off, int scansize)
Delivers the pixels of the image with one or more calls to this method.
void setProperties(Hashtable<?, ?> props)
Sets the extensible list of properties associated with this image.
Protected Methods
BufferedImage createImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable properties)
Returns the BufferedImage that will be used as the representation of the pixel data.
[Expand]
Inherited Methods
From class sun.awt.image.ImageWatched
From class java.lang.Object
From interface java.awt.image.ImageConsumer

Fields

protected ColorModel cmodel

Public Constructors

public ImageRepresentation (ToolkitImage im, ColorModel cmodel, boolean forceCMhint)

Create an ImageRepresentation for the given Image. The width and height are unknown at this point. The color model is a hint as to the color model to use when creating the buffered image. If null, the src color model will be used.

Public Methods

public int check (ImageObserver iw)

public boolean drawToBufImage (Graphics g, ToolkitImage img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bg, ImageObserver iw)

public boolean drawToBufImage (Graphics g, ToolkitImage img, int x, int y, int w, int h, Color bg, ImageObserver iw)

public boolean drawToBufImage (Graphics g, ToolkitImage img, int x, int y, Color bg, ImageObserver iw)

public boolean drawToBufImage (Graphics g, ToolkitImage img, AffineTransform xform, ImageObserver iw)

public int getHeight ()

public BufferedImage getOpaqueRGBImage ()

public int getWidth ()

public void imageComplete (int status)

The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the image has occured. The ImageConsumer should remove itself from the list of consumers registered with the ImageProducer at this time, unless it is interested in successive frames.

Parameters
status the status of image loading

public synchronized void notifyWatcherListEmpty ()

public boolean prepare (ImageObserver iw)

public synchronized void reconstruct (int flags)

public void setAccelerationPriority (float priority)

public void setColorModel (ColorModel model)

Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls. Note that each set of pixels delivered using setPixels contains its own ColorModel object, so no assumption should be made that this model will be the only one used in delivering pixel values. A notable case where multiple ColorModel objects may be seen is a filtered image when for each set of pixels that it filters, the filter determines whether the pixels can be sent on untouched, using the original ColorModel, or whether the pixels should be modified (filtered) and passed on using a ColorModel more convenient for the filtering process.

Parameters
model the specified ColorModel

public void setDimensions (int w, int h)

The dimensions of the source image are reported using the setDimensions method call.

Parameters
w the width of the source image
h the height of the source image

public void setHints (int h)

Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer. The ImageProducer can deliver the pixels in any order, but the ImageConsumer may be able to scale or convert the pixels to the destination ColorModel more efficiently or with higher quality if it knows some information about how the pixels will be delivered up front. The setHints method should be called before any calls to any of the setPixels methods with a bit mask of hints about the manner in which the pixels will be delivered. If the ImageProducer does not follow the guidelines for the indicated hint, the results are undefined.

Parameters
h a set of hints that the ImageConsumer uses to process the pixels

public void setPixels (int x, int y, int w, int h, ColorModel model, int[] pix, int off, int scansize)

The pixels of the image are delivered using one or more calls to the setPixels method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m,n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as ints. this method are all stored as ints.

Parameters
x the X coordinate of the upper-left corner of the area of pixels to be set
y the Y coordinate of the upper-left corner of the area of pixels to be set
w the width of the area of pixels
h the height of the area of pixels
model the specified ColorModel
pix the array of pixels
off the offset into the pixels array
scansize the distance from one row of pixels to the next in the pixels array

public void setPixels (int x, int y, int w, int h, ColorModel model, byte[] pix, int off, int scansize)

Delivers the pixels of the image with one or more calls to this method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m,n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as bytes.

Parameters
x the X coordinate of the upper-left corner of the area of pixels to be set
y the Y coordinate of the upper-left corner of the area of pixels to be set
w the width of the area of pixels
h the height of the area of pixels
model the specified ColorModel
pix the array of pixels
off the offset into the pixels array
scansize the distance from one row of pixels to the next in the pixels array

public void setProperties (Hashtable<?, ?> props)

Sets the extensible list of properties associated with this image.

Parameters
props the list of properties to be associated with this image

Protected Methods

protected BufferedImage createImage (ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable properties)

Returns the BufferedImage that will be used as the representation of the pixel data. Subclasses can override this method to return platform specific subclasses of BufferedImage that may or may not be accelerated. It is subclass' responsibility to propagate acceleration priority to the newly created image.