- java.lang.Object
-
- java.awt.image.renderable.RenderableImageProducer
-
- All Implemented Interfaces:
- ImageProducer, Runnable
public class RenderableImageProducer extends Object implements ImageProducer, Runnable
An adapter class that implements ImageProducer to allow the asynchronous production of a RenderableImage. The size of the ImageConsumer is determined by the scale factor of the usr2dev transform in the RenderContext. If the RenderContext is null, the default rendering of the RenderableImage is used. This class implements an asynchronous production that produces the image in one thread at one resolution. This class may be subclassed to implement versions that will render the image using several threads. These threads could render either the same image at progressively better quality, or different sections of the image at a single resolution.
-
-
Constructor Summary
Constructors Constructor and Description RenderableImageProducer(RenderableImage rdblImage, RenderContext rc)
Constructs a new RenderableImageProducer from a RenderableImage and a RenderContext.
-
Method Summary
Methods Modifier and Type Method and Description void
addConsumer(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image.boolean
isConsumer(ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.void
removeConsumer(ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in data for this image.void
requestTopDownLeftRightResend(ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.void
run()
The runnable method for this class.void
setRenderContext(RenderContext rc)
Sets a new RenderContext to use for the next startProduction() call.void
startProduction(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately starts delivery of the image data through the ImageConsumer interface.
-
-
-
Constructor Detail
-
RenderableImageProducer
public RenderableImageProducer(RenderableImage rdblImage, RenderContext rc)
Constructs a new RenderableImageProducer from a RenderableImage and a RenderContext.- Parameters:
rdblImage
- the RenderableImage to be rendered.rc
- the RenderContext to use for producing the pixels.
-
-
Method Detail
-
setRenderContext
public void setRenderContext(RenderContext rc)
Sets a new RenderContext to use for the next startProduction() call.- Parameters:
rc
- the new RenderContext.
-
addConsumer
public void addConsumer(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image.- Specified by:
addConsumer
in interfaceImageProducer
- Parameters:
ic
- an ImageConsumer to be added to the interest list.- See Also:
ImageProducer.startProduction(java.awt.image.ImageConsumer)
-
isConsumer
public boolean isConsumer(ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.- Specified by:
isConsumer
in interfaceImageProducer
- Parameters:
ic
- the ImageConsumer to be checked.- Returns:
- true if the ImageConsumer is on the list; false otherwise.
-
removeConsumer
public void removeConsumer(ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in data for this image.- Specified by:
removeConsumer
in interfaceImageProducer
- Parameters:
ic
- the ImageConsumer to be removed.
-
startProduction
public void startProduction(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately starts delivery of the image data through the ImageConsumer interface.- Specified by:
startProduction
in interfaceImageProducer
- Parameters:
ic
- the ImageConsumer to be added to the list of consumers.- See Also:
ImageProducer.addConsumer(java.awt.image.ImageConsumer)
-
requestTopDownLeftRightResend
public void requestTopDownLeftRightResend(ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.- Specified by:
requestTopDownLeftRightResend
in interfaceImageProducer
- Parameters:
ic
- the ImageConsumer requesting the resend.- See Also:
ImageConsumer.setHints(int)
-
run
public void run()
The runnable method for this class. This will produce an image using the current RenderableImage and RenderContext and send it to all the ImageConsumer currently registered with this class.- Specified by:
run
in interfaceRunnable
- See Also:
Thread.run()
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
05/11/2024 16:37:25 Cette version de la page est en cache (à la date du 05/11/2024 16:37:25) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 18/12/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/awt/image/renderable/RenderableImageProducer.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.