Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.image

Interface ImageConsumer

java.lang.Object
|
+--java.awt.image.ImageConsumer


public interface ImageConsumer

An object implementing the ImageProducer interface can use objects implementing this interface to deliver the image data.

Author:

Field Summary

static intCOMPLETESCANLINES

The pixel order is in multiples of complete scanlines.
static intIMAGEABORTED

Production of the image has been aborted.
static intIMAGEERROR

Indicates an error occurred while producing an image.
static intRANDOMPIXELORDER

The pixel order may be random.
static intSINGLEFRAME

The pixels will be delivered with multiple calls to setPixels.
static intSINGLEFRAMEDONE

A single frame is complete but more will follow.
static intSINGLEPASS

The pixels will be delivered in a single pass.
static intSTATICIMAGEDONE

The image is complete and no more pixels or frames will follow.
static intTOPDOWNLEFTRIGHT

The pixel order is top-down, left-right.

Method Summary

voidimageComplete(int status)

The ImageProducer calls this method to indicate a single frame or the entire image is complete.
voidsetColorModel(java.awt.image.ColorModel model)

This ColorModel should indicate the model used by the majority of calls to setPixels.
voidsetDimensions(int width, int height)

An ImageProducer indicates the size of the image being produced using this method.
voidsetHints(int flags)

The ImageProducer should call this method with a bit mask of hints from any of RANDOMPIXELORDER, TOPDOWNLEFTRIGHT, COMPLETESCANLINES, SINGLEPASS, SINGLEFRAME.
voidsetPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int offset, int scansize)

This function delivers a rectangle of pixels where any pixel(m,n) is stored in the array as a byte at index (n * scansize + m + offset).
voidsetPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scansize)

This function delivers a rectangle of pixels where any pixel(m,n) is stored in the array as an int at index (n * scansize + m + offset).
voidsetProperties(java.util.Hashtable props)

An ImageProducer can set a list of properties associated with this image by using this method.

Field Details

COMPLETESCANLINES

public static final int COMPLETESCANLINES

The pixel order is in multiples of complete scanlines.

See Also:


IMAGEABORTED

public static final int IMAGEABORTED

Production of the image has been aborted.

See Also:


IMAGEERROR

public static final int IMAGEERROR

Indicates an error occurred while producing an image.

See Also:


RANDOMPIXELORDER

public static final int RANDOMPIXELORDER

The pixel order may be random. This should be the default assumption of the ImageConsumer.

See Also:


SINGLEFRAME

public static final int SINGLEFRAME

The pixels will be delivered with multiple calls to setPixels. The image contains a single frame which ends when imageComplete is called with the STATICIMAGEDONE flag. If the image is constantly changing such as with video then the end of each frame is marked by a similar call to imageComplete with the SINGLEFRAMEDONE flag.

See Also:


SINGLEFRAMEDONE

public static final int SINGLEFRAMEDONE

A single frame is complete but more will follow.

See Also:


SINGLEPASS

public static final int SINGLEPASS

The pixels will be delivered in a single pass. There is at most one call to setPixels for any single pixel.

See Also:


STATICIMAGEDONE

public static final int STATICIMAGEDONE

The image is complete and no more pixels or frames will follow.

See Also:


TOPDOWNLEFTRIGHT

public static final int TOPDOWNLEFTRIGHT

The pixel order is top-down, left-right.

See Also:


Method Details

imageComplete

public void imageComplete(int status)

The ImageProducer calls this method to indicate a single frame or the entire image is complete. The method is also used to indicate an error in loading or producing the image.

Parameters:


setColorModel

public void setColorModel(java.awt.image.ColorModel model)

This ColorModel should indicate the model used by the majority of calls to setPixels. Each call to setPixels could however indicate a different ColorModel.

Parameters:

See Also:


setDimensions

public void setDimensions(int width, int height)

An ImageProducer indicates the size of the image being produced using this method.

Parameters:


setHints

public void setHints(int flags)

The ImageProducer should call this method with a bit mask of hints from any of RANDOMPIXELORDER, TOPDOWNLEFTRIGHT, COMPLETESCANLINES, SINGLEPASS, SINGLEFRAME.

Parameters:


setPixels

public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int offset, int scansize)

This function delivers a rectangle of pixels where any pixel(m,n) is stored in the array as a byte at index (n * scansize + m + offset).

Parameters:


setPixels

public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scansize)

This function delivers a rectangle of pixels where any pixel(m,n) is stored in the array as an int at index (n * scansize + m + offset).

Parameters:


setProperties

public void setProperties(java.util.Hashtable props)

An ImageProducer can set a list of properties associated with this image by using this method.

Parameters: