public interface ImageConsumer
ImageProducer
interface can
use objects implementing this interface to deliver the image data.Modifier and Type | Field and Description |
---|---|
static int |
COMPLETESCANLINES
The pixel order is in multiples of complete scanlines.
|
static int |
IMAGEABORTED
Production of the image has been aborted.
|
static int |
IMAGEERROR
Indicates an error occurred while producing an image.
|
static int |
RANDOMPIXELORDER
The pixel order may be random.
|
static int |
SINGLEFRAME
The pixels will be delivered with multiple calls to
setPixels . |
static int |
SINGLEFRAMEDONE
A single frame is complete but more will follow.
|
static int |
SINGLEPASS
The pixels will be delivered in a single pass.
|
static int |
STATICIMAGEDONE
The image is complete and no more pixels or frames will follow.
|
static int |
TOPDOWNLEFTRIGHT
The pixel order is top-down, left-right.
|
Modifier and Type | Method and Description |
---|---|
void |
imageComplete(int status)
The
ImageProducer calls this method to indicate a
single frame or the entire image is complete. |
void |
setColorModel(ColorModel model)
This
ColorModel should indicate the model used by
the majority of calls to setPixels . |
void |
setDimensions(int width,
int height)
An
ImageProducer indicates the size of the image
being produced using this method. |
void |
setHints(int flags)
The
ImageProducer should call this method with a
bit mask of hints from any of RANDOMPIXELORDER ,
TOPDOWNLEFTRIGHT , COMPLETESCANLINES ,
SINGLEPASS , SINGLEFRAME . |
void |
setPixels(int x,
int y,
int w,
int h,
ColorModel model,
byte[] pixels,
int offset,
int scansize)
Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
|
void |
setPixels(int x,
int y,
int w,
int h,
ColorModel model,
int[] pixels,
int offset,
int scansize)
Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
|
void |
setProperties(Hashtable<?,?> props)
An
ImageProducer can set a list of properties
associated with this image by using this method. |
static final int RANDOMPIXELORDER
ImageConsumer
.setHints(int)
,
Constant Field Valuesstatic final int TOPDOWNLEFTRIGHT
setHints(int)
,
Constant Field Valuesstatic final int COMPLETESCANLINES
setHints(int)
,
Constant Field Valuesstatic final int SINGLEPASS
setPixels
for any single pixel.static final int SINGLEFRAME
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.setHints(int)
,
imageComplete(int)
,
Constant Field Valuesstatic final int IMAGEERROR
imageComplete(int)
,
Constant Field Valuesstatic final int SINGLEFRAMEDONE
imageComplete(int)
,
Constant Field Valuesstatic final int STATICIMAGEDONE
imageComplete(int)
,
Constant Field Valuesstatic final int IMAGEABORTED
imageComplete(int)
,
Constant Field Valuesvoid setDimensions(int width, int height)
ImageProducer
indicates the size of the image
being produced using this method.width
- the width of the imageheight
- the height of the imagevoid setProperties(Hashtable<?,?> props)
ImageProducer
can set a list of properties
associated with this image by using this method.props
- the list of properties associated with this imagevoid setColorModel(ColorModel model)
ColorModel
should indicate the model used by
the majority of calls to setPixels
. Each call to
setPixels
could however indicate a different
ColorModel
.model
- the color model to be used most often by setPixelsColorModel
void setHints(int flags)
ImageProducer
should call this method with a
bit mask of hints from any of RANDOMPIXELORDER
,
TOPDOWNLEFTRIGHT
, COMPLETESCANLINES
,
SINGLEPASS
, SINGLEFRAME
.flags
- a bit mask of hintsvoid setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int offset, int scansize)
x
- x coordinate of pixel blocky
- y coordinate of pixel blockw
- width of pixel blockh
- height of pixel blockmodel
- color model used to interpret pixel datapixels
- pixel block dataoffset
- offset into pixels arrayscansize
- width of one row in the pixel blockvoid setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int offset, int scansize)
x
- x coordinate of pixel blocky
- y coordinate of pixel blockw
- width of pixel blockh
- height of pixel blockmodel
- color model used to interpret pixel datapixels
- pixel block dataoffset
- offset into pixels arrayscansize
- width of one row in the pixel blockvoid imageComplete(int status)
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.status
- the status of image production, represented by a
bitwise OR of ImageConsumer flags