Class ImageDisplay

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Placeable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class ImageDisplay
    extends ImageDisplay
    Display an image on the screen using the ptolemy.media.Picture class. For a sequence of images that are all the same size, this class will continually update the picture with new data. If the size of the input image changes, then a new Picture object is created. This class will only accept a IntMatrixToken on its input, and assumes that the input image contains greyscale pixel intensities between 0 and 255 (inclusive). The token is read in postfire().

    Note that this actor really should be replaced by a conversion actor that converts IntMatrixTokens to ImageTokens. However, there is no easy way to do that without accessing the graphical context of the actor. An alternative would be to use the Java Advanced Imaging package and create an actor like $PTII/ptolemy/actor/lib/jai/DoubleMatrixToJAI.java.

    Since:
    Ptolemy II 0.2
    Version:
    $Id$
    Author:
    Steve Neuendorffer, Christopher Brooks
    Pt.AcceptedRating:
    Red
    Pt.ProposedRating:
    Yellow (neuendor)
    • Method Detail

      • _getImplementation

        protected ImageDisplayInterface _getImplementation()
        Get the right instance of the implementation depending upon the of the dependency specified through dependency injection. If the instance has not been created, then it is created. If the instance already exists then return the same.

        This code is used as part of the dependency injection needed for the HandSimDroid project, see $PTII/ptserver. This code uses dependency inject to determine what implementation to use at runtime. This method eventually reads ptolemy/actor/ActorModule.properties. ActorModuleInitializer.initializeInjector() should be called before this method is called. If it is not called, then a message is printed and initializeInjector() is called.

        Overrides:
        _getImplementation in class ImageDisplay
        Returns:
        the instance of the implementation.