javax.media.util
Class BufferToImage

java.lang.Object
  |
  +--javax.media.util.BufferToImage

public class BufferToImage
extends java.lang.Object

This is a utility class to convert a video Buffer object to an AWT Image object that you can then render using AWT methods.

You can use this class in conjunction with the FrameGrabbingControl to grab frames from the video renderer and manipulate the image.

Since:
JMF 2.0
See Also:
FrameGrabbingControl

Constructor Summary
BufferToImage(VideoFormat format)
          Instantiates a Buffer to Image conversion object for the specified format.
 
Method Summary
 java.awt.Image createImage(Buffer buffer)
          Converts the input buffer to a standard AWT image and returns the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferToImage

public BufferToImage(VideoFormat format)
Instantiates a Buffer to Image conversion object for the specified format. The createImage method expects input buffers to have the format that is specified here.
Parameters:
format - the format of incoming Buffer objects.
Method Detail

createImage

public java.awt.Image createImage(Buffer buffer)
Converts the input buffer to a standard AWT image and returns the image. The buffer should contain video data of the format specified in the constructor. If the input data is not valid or a suitable converter couldn't be found, the method returns null.
Returns:
an AWT Image if the conversion was completed succesfully, else returns null.


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.