java::awt::image::ImageConsumer Class Reference

Inheritance diagram for java::awt::image::ImageConsumer:

Inheritance graph
java::awt::image::ImageFilterjava::lang::Interfacejava::lang::Object
[legend]
Collaboration diagram for java::awt::image::ImageConsumer:

Collaboration graph
java::lang::Interfacejava::lang::Object
[legend]

List of all members.


Detailed Description

The interface for objects expressing interest in image data through the ImageProducer interfaces.

When a consumer is added to an image producer, the producer delivers all of the data about the image using the method calls defined in this interface.

See also:
ImageProducer
Version:
1.20 01/23/03
Author:
Jim Graham

Public Types

enum  HINT_FLAGS {
  RANDOMPIXELORDER = 1, TOPDOWNLEFTRIGHT = 2, COMPLETESCANLINES = 4, SINGLEPASS = 8,
  SINGLEFRAME = 16
}
enum  COMPLETE_STATUS { IMAGEERROR = 1, SINGLEFRAMEDONE, STATICIMAGEDONE, IMAGEABORTED }

Public Member Functions

virtual void setDimensions (jint width, jint height)=0
 The dimensions of the source image are reported using the setDimensions method call.
virtual void setProperties (const Ref< Map > &props)=0
 Sets the extensible list of properties associated with this image.
virtual void setColorModel (const Ref< ColorModel > &model)=0
 Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls.
virtual void setHints (jint hintflags)=0
 Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer.
virtual void setPixels (jint x, jint y, jint w, jint h, const Ref< ColorModel > &model, const Array< jbyte > &pixels, jint off, jint scansize)=0
 Delivers the pixels of the image with one or more calls to this method.
virtual void setPixels (jint x, jint y, jint w, jint h, const Ref< ColorModel > &model, const Array< jint > &pixels, jint off, jint scansize)=0
 The pixels of the image are delivered using one or more calls to the setPixels method.
virtual void imageComplete (jint status)=0
 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.

Member Enumeration Documentation

enum java::awt::image::ImageConsumer::HINT_FLAGS

Enumerator:
RANDOMPIXELORDER  The pixels will be delivered in a random order.

This tells the ImageConsumer not to use any optimizations that depend on the order of pixel delivery, which should be the default assumption in the absence of any call to the setHints method.

See also:
setHints
TOPDOWNLEFTRIGHT  The pixels will be delivered in top-down, left-to-right order.

See also:
setHints
COMPLETESCANLINES  The pixels will be delivered in (multiples of) complete scanlines at a time.

See also:
setHints
SINGLEPASS  The pixels will be delivered in a single pass.

Each pixel will appear in only one call to any of the setPixels methods. An example of an image format which does not meet this criterion is a progressive JPEG image which defines pixels in multiple passes, each more refined than the previous.

See also:
setHints
SINGLEFRAME  The image contain a single static image.

The pixels will be defined in calls to the setPixels methods and then the imageComplete method will be called with the STATICIMAGEDONE flag after which no more image data will be delivered. An example of an image type which would not meet these criteria would be the output of a video feed, or the representation of a 3D rendering being manipulated by the user. The end of each frame in those types of images will be indicated by calling imageComplete with the SINGLEFRAMEDONE flag.

See also:
setHints

imageComplete

enum java::awt::image::ImageConsumer::COMPLETE_STATUS

Enumerator:
IMAGEERROR  An error was encountered while producing the image.

See also:
imageComplete
SINGLEFRAMEDONE  One frame of the image is complete but there are more frames to be delivered.

See also:
imageComplete
STATICIMAGEDONE  The image is complete and there are no more pixels or frames to be delivered.

See also:
imageComplete
IMAGEABORTED  The image creation process was deliberately aborted.

See also:
imageComplete


Member Function Documentation

virtual void java::awt::image::ImageConsumer::setDimensions ( jint  width,
jint  height 
) [pure virtual]

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

Parameters:
width the width of the source image
height the height of the source image

Implemented in java::awt::image::ImageFilter.

virtual void java::awt::image::ImageConsumer::setProperties ( const Ref< Map > &  props  )  [pure virtual]

Sets the extensible list of properties associated with this image.

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

Implemented in java::awt::image::ImageFilter.

virtual void java::awt::image::ImageConsumer::setColorModel ( const Ref< ColorModel > &  model  )  [pure virtual]

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
See also:
ColorModel

Implemented in java::awt::image::ImageFilter.

virtual void java::awt::image::ImageConsumer::setHints ( jint  hintflags  )  [pure virtual]

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:
hintflags a set of hints that the ImageConsumer uses to process the pixels

Implemented in java::awt::image::ImageFilter.

virtual void java::awt::image::ImageConsumer::setPixels ( jint  x,
jint  y,
jint  w,
jint  h,
const Ref< ColorModel > &  model,
const Array< jbyte > &  pixels,
jint  off,
jint  scansize 
) [pure virtual]

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,&nbsp;y the coordinates 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
pixels 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
See also:
ColorModel

Implemented in java::awt::image::ImageFilter.

virtual void java::awt::image::ImageConsumer::setPixels ( jint  x,
jint  y,
jint  w,
jint  h,
const Ref< ColorModel > &  model,
const Array< jint > &  pixels,
jint  off,
jint  scansize 
) [pure virtual]

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,&nbsp;y the coordinates 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
pixels 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
See also:
ColorModel

Implemented in java::awt::image::ImageFilter.

virtual void java::awt::image::ImageConsumer::imageComplete ( jint  status  )  [pure virtual]

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
See also:
ImageProducer::removeConsumer

Implemented in java::awt::image::ImageFilter.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:22 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3