java::awt::image::ImageFilter Class Reference

Inheritance diagram for java::awt::image::ImageFilter:

Inheritance graph
java::lang::Objectjava::lang::Interfacejava::awt::image::ImageConsumer
[legend]
Collaboration diagram for java::awt::image::ImageFilter:

Collaboration graph
java::lang::Objectjava::lang::Interfacejava::awt::image::ImageConsumer
[legend]

List of all members.


Detailed Description

This class implements a filter for the set of interface methods that are used to deliver data from an ImageProducer to an ImageConsumer.

It is meant to be used in conjunction with a FilteredImageSource object to produce filtered versions of existing images. It is a base class that provides the calls needed to implement a "Null filter" which has no effect on the data being passed through. Filters should subclass this class and override the methods which deal with the data that needs to be filtered and modify it as necessary.

See also:
FilteredImageSource

ImageConsumer

Version:
1.26 01/23/03
Author:
Jim Graham

Public Member Functions

 ImageFilter (const Ref< ImageConsumer > &_consumer=0)
Ref< ImageFiltergetFilterInstance (const Ref< ImageConsumer > &ic) const
 Returns a unique instance of an ImageFilter object which will actually perform the filtering for the specified ImageConsumer.
virtual void setDimensions (jint width, jint height)
 The dimensions of the source image are reported using the setDimensions method call.
virtual void setProperties (const Ref< Map > &props)
 Sets the extensible list of properties associated with this image.
virtual void setColorModel (const Ref< ColorModel > &model)
 Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls.
virtual void setHints (jint hintflags)
 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)
 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)
 The pixels of the image are delivered using one or more calls to the setPixels method.
virtual void imageComplete (jint 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.
virtual void resendTopDownLeftRight (const Ref< ImageProducer > &ip)
 Responds to a request for a TopDownLeftRight (TDLR) ordered resend of the pixel data from an ImageConsumer.

Constructor & Destructor Documentation

java::awt::image::ImageFilter::ImageFilter ( const Ref< ImageConsumer > &  _consumer = 0  ) 


Member Function Documentation

Ref<ImageFilter> java::awt::image::ImageFilter::getFilterInstance ( const Ref< ImageConsumer > &  ic  )  const

Returns a unique instance of an ImageFilter object which will actually perform the filtering for the specified ImageConsumer.

The default implementation just clones this object.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. Developers using this class to filter pixels from an image should avoid calling this method directly since that operation could interfere with the filtering operation.

Parameters:
ic the specified ImageConsumer
Returns:
an ImageFilter used to perform the filtering for the specified ImageConsumer.

virtual void java::awt::image::ImageFilter::setDimensions ( jint  width,
jint  height 
) [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

Implements java::awt::image::ImageConsumer.

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

Sets the extensible list of properties associated with this image.

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

Implements java::awt::image::ImageConsumer.

virtual void java::awt::image::ImageFilter::setColorModel ( const Ref< ColorModel > &  model  )  [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

Implements java::awt::image::ImageConsumer.

virtual void java::awt::image::ImageFilter::setHints ( jint  hintflags  )  [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

Implements java::awt::image::ImageConsumer.

virtual void java::awt::image::ImageFilter::setPixels ( jint  x,
jint  y,
jint  w,
jint  h,
const Ref< ColorModel > &  model,
const Array< jbyte > &  pixels,
jint  off,
jint  scansize 
) [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

Implements java::awt::image::ImageConsumer.

virtual void java::awt::image::ImageFilter::setPixels ( jint  x,
jint  y,
jint  w,
jint  h,
const Ref< ColorModel > &  model,
const Array< jint > &  pixels,
jint  off,
jint  scansize 
) [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

Implements java::awt::image::ImageConsumer.

virtual void java::awt::image::ImageFilter::imageComplete ( jint  status  )  [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

Implements java::awt::image::ImageConsumer.

virtual void java::awt::image::ImageFilter::resendTopDownLeftRight ( const Ref< ImageProducer > &  ip  )  [virtual]

Responds to a request for a TopDownLeftRight (TDLR) ordered resend of the pixel data from an ImageConsumer.

The ImageFilter can respond to this request in one of three ways.

  1. If the filter can determine that it will forward the pixels in TDLR order if its upstream producer object sends them in TDLR order, then the request is automatically forwarded by default to the indicated ImageProducer using this filter as the requesting ImageConsumer, so no override is necessary.
  2. If the filter can resend the pixels in the right order on its own (presumably because the generated pixels have been saved in some sort of buffer), then it can override this method and simply resend the pixels in TDLR order as specified in the ImageProducer API.
  3. If the filter simply returns from this method then the request will be ignored and no resend will occur.
See also:
ImageProducer::requestTopDownLeftRightResend
Parameters:
ip The ImageProducer that is feeding this instance of the filter - also the ImageProducer that the request should be forwarded to if necessary.


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