Package ptolemy.actor.lib.jmf
Class JMFImageToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.data.ObjectToken
-
- ptolemy.data.ImageToken
-
- ptolemy.actor.lib.jmf.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)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ObjectToken
_class, NULL
-
-
Constructor Summary
Constructors Constructor Description JMFImageToken(javax.media.Buffer value)Construct a token with a specified Buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ImageasAWTImage()Convert a javax.media.Buffer to a java.awt.Image and return it.TypegetType()Return the type of this token.javax.media.BuffergetValue()Return the value of this token.java.lang.StringtoString()Return a description of the token.-
Methods inherited from class ptolemy.data.ObjectToken
_isCloseTo, _isEqualTo, convert, equals, getValueClass, hashCode, isCloseTo, isEqualTo, object
-
Methods inherited from class ptolemy.data.Token
add, addReverse, divide, divideReverse, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType
-
-
-
-
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:
asAWTImagein classImageToken- Returns:
- The image.
-
getType
public Type getType()
Return the type of this token.- Overrides:
getTypein classObjectToken- Returns:
- BaseType.OBJECT
-
getValue
public javax.media.Buffer getValue()
Return the value of this token.- Overrides:
getValuein classObjectToken- 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:
toStringin classObjectToken- Returns:
- A string representation of a record that partially describes the token.
-
-