net.sf.fmj.media.renderer.video
Class Java2dRenderer

java.lang.Object
  extended by net.sf.fmj.media.renderer.video.Java2dRenderer
All Implemented Interfaces:
Controls, PlugIn, Renderer, VideoRenderer

public class Java2dRenderer
extends java.lang.Object
implements VideoRenderer

A VideoRenderer that handles packed integer RGB formats. It uses Java2D to render incoming RGB images. TODO: support byte-array based images. See ImageToBuffer.

Author:
Warren Bloomer

Field Summary
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
Java2dRenderer()
          Constructor
 
Method Summary
 void close()
          Close the plugin.
 java.awt.Rectangle getBounds()
          Get the bounds of the component.
 java.awt.Component getComponent()
          Get the visual component.
 java.lang.Object getControl(java.lang.String controlType)
          Return the control based on a control type for the PlugIn.
 java.lang.Object[] getControls()
          Returns an array of supported controls
 java.lang.String getName()
          Return the name of the plugin
 Format[] getSupportedInputFormats()
          Lists the possible input formats supported by this plug-in.
 void open()
          Opens the plugin
 int process(Buffer buffer)
          Processes the data and renders it to a component
 void reset()
          Resets the state of the plug-in.
 void setBounds(java.awt.Rectangle rect)
          Set the bounds of the visual component.
 boolean setComponent(java.awt.Component comp)
          Try to set the component to render to.
 Format setInputFormat(Format format)
          Set the data input format.
 void start()
          Start the renderer.
 void stop()
          Stop the renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java2dRenderer

public Java2dRenderer()
Constructor

Method Detail

getName

public java.lang.String getName()
Return the name of the plugin

Specified by:
getName in interface PlugIn

open

public void open()
          throws ResourceUnavailableException
Opens the plugin

Specified by:
open in interface PlugIn
Throws:
ResourceUnavailableException

reset

public void reset()
Resets the state of the plug-in. Typically at end of media or when media is repositioned.

Specified by:
reset in interface PlugIn

close

public void close()
Close the plugin.

Specified by:
close in interface PlugIn

getControls

public java.lang.Object[] getControls()
Returns an array of supported controls

Specified by:
getControls in interface Controls

getControl

public java.lang.Object getControl(java.lang.String controlType)
Return the control based on a control type for the PlugIn.

Specified by:
getControl in interface Controls

start

public void start()
Start the renderer.

Specified by:
start in interface Renderer

stop

public void stop()
Stop the renderer.

Specified by:
stop in interface Renderer

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Lists the possible input formats supported by this plug-in.

Specified by:
getSupportedInputFormats in interface Renderer

setInputFormat

public Format setInputFormat(Format format)
Set the data input format.

Specified by:
setInputFormat in interface Renderer

process

public int process(Buffer buffer)
Processes the data and renders it to a component

Specified by:
process in interface Renderer

setComponent

public boolean setComponent(java.awt.Component comp)
Try to set the component to render to.

Specified by:
setComponent in interface VideoRenderer

getComponent

public java.awt.Component getComponent()
Get the visual component.

Specified by:
getComponent in interface VideoRenderer

getBounds

public java.awt.Rectangle getBounds()
Get the bounds of the component.

Specified by:
getBounds in interface VideoRenderer

setBounds

public void setBounds(java.awt.Rectangle rect)
Set the bounds of the visual component.

Specified by:
setBounds in interface VideoRenderer