Class FilteredImageSource
- All Implemented Interfaces:
ImageProducer
FilteredImageSource is safe for use by multiple threads.
Here is an example which filters an image by swapping the red and
blue components:
Image src = getImage("doc:///demo/images/duke/T1.gif");
ImageFilter colorfilter = new RedBlueSwapFilter();
Image img = createImage(new FilteredImageSource(src.getSource(),
colorfilter));
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFilteredImageSource(ImageProducer orig, ImageFilter imgf) Constructs an ImageProducer object from an existing ImageProducer and a filter object. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specifiedImageConsumerto the list of consumers interested in data for the filtered image.booleanDetermines whether an ImageConsumer is on the list of consumers currently interested in data for this image.voidRemoves an ImageConsumer from the list of consumers interested in data for this image.voidRequests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.voidStarts production of the filtered image.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
FilteredImageSource
Constructs an ImageProducer object from an existing ImageProducer and a filter object.- Parameters:
orig- the specifiedImageProducerimgf- the specifiedImageFilter- See Also:
-
-
Method Details
-
addConsumer
Adds the specifiedImageConsumerto the list of consumers interested in data for the filtered image. An instance of the originalImageFilteris created (using the filter'sgetFilterInstancemethod) to manipulate the image data for the specifiedImageConsumer. The newly created filter instance is then passed to theaddConsumermethod of the originalImageProducer.This method is public as a side effect of this class implementing the
ImageProducerinterface. It should not be called from user code, and its behavior if called from user code is unspecified.- Specified by:
addConsumerin interfaceImageProducer- Parameters:
ic- the consumer for the filtered image- See Also:
-
isConsumer
Determines whether an ImageConsumer is on the list of consumers currently interested in data for this image.This method is public as a side effect of this class implementing the
ImageProducerinterface. It should not be called from user code, and its behavior if called from user code is unspecified.- Specified by:
isConsumerin interfaceImageProducer- Parameters:
ic- the specifiedImageConsumer- Returns:
- true if the ImageConsumer is on the list; false otherwise
- See Also:
-
removeConsumer
Removes an ImageConsumer from the list of consumers interested in data for this image.This method is public as a side effect of this class implementing the
ImageProducerinterface. It should not be called from user code, and its behavior if called from user code is unspecified.- Specified by:
removeConsumerin interfaceImageProducer- Parameters:
ic- the specifiedImageConsumer- See Also:
-
startProduction
Starts production of the filtered image. If the specifiedImageConsumerisn't already a consumer of the filtered image, an instance of the originalImageFilteris created (using the filter'sgetFilterInstancemethod) to manipulate the image data for theImageConsumer. The filter instance for theImageConsumeris then passed to thestartProductionmethod of the originalImageProducer.This method is public as a side effect of this class implementing the
ImageProducerinterface. It should not be called from user code, and its behavior if called from user code is unspecified.- Specified by:
startProductionin interfaceImageProducer- Parameters:
ic- the consumer for the filtered image- See Also:
-
requestTopDownLeftRightResend
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order. The request is handed to the ImageFilter for further processing, since the ability to preserve the pixel ordering depends on the filter.This method is public as a side effect of this class implementing the
ImageProducerinterface. It should not be called from user code, and its behavior if called from user code is unspecified.- Specified by:
requestTopDownLeftRightResendin interfaceImageProducer- Parameters:
ic- the specifiedImageConsumer- See Also:
-