Class JMFImageToken


  • public class JMFImageToken
    extends ImageToken
    A token that contains a javax.media.Buffer. This token is used when dealing with images in the Java Media Framework (JMF) library. Because it extends ImageToken, it can be used with the standard image processing tools by simply casting it, and calling asAWTImage().
    Since:
    Ptolemy II 3.0
    Version:
    $Id$
    Author:
    James Yeh
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Detail

      • JMFImageToken

        public JMFImageToken​(javax.media.Buffer value)
        Construct a token with a specified Buffer.
        Parameters:
        value - The buffer.
    • Method Detail

      • asAWTImage

        public java.awt.Image asAWTImage()
        Convert a javax.media.Buffer to a java.awt.Image and return it. A new javax.media.util.BufferToImage is created when the video format of the Buffer changes.
        Specified by:
        asAWTImage in class ImageToken
        Returns:
        The image.
      • getType

        public Type getType()
        Return the type of this token.
        Overrides:
        getType in class ObjectToken
        Returns:
        BaseType.OBJECT
      • getValue

        public javax.media.Buffer getValue()
        Return the value of this token.
        Overrides:
        getValue in class ObjectToken
        Returns:
        The value of this token.
      • toString

        public java.lang.String toString()
        Return a description of the token. If possible, derived classes should override this method and return the value of this token as a string that can be parsed by the expression language to recover a token with the same value. Unfortunately, in this base class, we can only return the a partial description of the token.
        Overrides:
        toString in class ObjectToken
        Returns:
        A string representation of a record that partially describes the token.