The ImageFilter class sits between the ImageProducer and ImageConsumer as an image is being created to provide a filtered version of that image. Image filters are always used in conjunction with a FilteredImageSource. As an implementer of the ImageConsumer interface, an image filter receives pixel data from the original image's source and delivers it to another image consumer. The ImageFilter class implements a null filter (i.e., the new image is the same as the original); to produce a filter that modifies an image, create a subclass of ImageFilter.
public class java.awt.image.ImageFilter extends java.lang.Object implements java.awt.image.ImageConsumer, java.lang.Cloneable { // Variables protected ImageConsumer consumer; // Constructors public ImageFilter(); // Instance Methods public Object clone(); public ImageFilter getFilterInstance (ImageConsumer ic); public void imageComplete (int status); public void resendTopDownLeftRight (ImageProducer ip); public void setColorModel (ColorModel model); public void setDimensions (int width, int height); public void setHints (int hints); public void setPixels (int x, int y, int width, int height, ColorModel model, byte[] pixels, int offset, int scansize); public void setPixels (int x, int y, int width, int height, ColorModel model, int[] pixels, int offset, int scansize); public void setProperties (Hashtable properties); }
The consumer variable is a reference to the actual ImageConsumer for the Image.
Constructs an empty ImageFilter instance.
Object.clone()
A copy of the ImageFilter instance.
The consumer in question.
A copy of the ImageFilter instance.
Returns the filter that will do the filtering for ic.
Image loading completion status flags.
ImageConsumer.imageComplete(int)
Called by the ImageProducer to indicate an image's completion status. ImageFilter passes these flags to the consumer unchanged.
The ImageProducer generating the original image.
Called by the ImageConsumer to ask the filter to resend the image data in the top-down, left-to-right order. In ImageFilter, this method calls the same method in the ImageProducer, thus relaying the request.
The color model for the image.
ImageConsumer.setColorModel(ColorModel)
Sets the image's color model.
Width for image.
Height for image.
ImageConsumer.setDimensions(int, int)
Sets the image's dimensions.
Image consumption hints.
ImageConsumer.setHints(int)
Called by the ImageProducer to deliver hints about how the image data will be delivered. ImageFilter passes these hints on to the ImageConsumer.
x-coordinate of top-left corner of pixel data delivered with this method call.
y-coordinate of top-left corner of pixel data delivered with this method call.
Width of the rectangle of pixel data delivered with this method call.
Height of the rectangle of pixel data delivered with this method call.
Color model of image data.
Image data.
Offset from beginning of the pixels array.
Size of each line of data in pixels array.
ImageConsumer.setPixels(int, int, int, int, ColorModel, byte[], int, int)
Delivers a rectangular block of pixels to the ImageFilter. ImageFilter passes these pixels on to the consumer unchanged.
x-coordinate of top-left corner of pixel data delivered with this method call.
y-coordinate of top-left corner of pixel data delivered with this method call.
Width of the rectangle of pixel data delivered with this method call.
Height of the rectangle of pixel data delivered with this method call.
Color model of image data.
Image data.
Offset from beginning of the pixels array.
Size of each line of data in pixels array.
ImageConsumer.setPixels(int, int, int, int, ColorModel, int[], int, int)
Delivers a rectangular block of pixels to the ImageFilter. ImageFilter passes these pixels on to the consumer unchanged.
The properties for the image.
ImageConsumer.setProperties(Hashtable)
Initializes the image's properties. ImageFilter adds the property "filter" to the Hashtable, and passes the result on to the image consumer; the value of the property is the string returned by the filter's toString() method. If the property "filter" is already in the Hashtable, ImageFilter adds the string returned by its toString() method to the value already associated with that property.
Cloneable, ColorModel, CropImageFilter, Hashtable, ImageConsumer, ImageProducer, Object, ReplicateImageFilter, RGBImageFilter
This HTML Help has been published using the chm2web software. |