com.t4l.jmf
Class JPEGEncoder

java.lang.Object
  extended by com.t4l.jmf.JPEGEncoder
All Implemented Interfaces:
Codec, Controls, PlugIn

public class JPEGEncoder
extends java.lang.Object
implements Codec

This type of MOV file just stores frames as a series of JPEG images. This codec uses ImageIO classes to convert from the jpeg VideoFormat to RGBFormats.

Author:
Jeremy Wood

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
JPEGEncoder()
           
 
Method Summary
 void close()
           
 java.lang.Object getControl(java.lang.String controlType)
           
 java.lang.Object[] getControls()
           
 java.lang.String getName()
           
 Format[] getSupportedInputFormats()
           
 Format[] getSupportedOutputFormats(Format input)
           
 void open()
           
 int process(Buffer input, Buffer output)
           
protected  int processRGBtoJPEG(Buffer input, Buffer output)
           
 void reset()
           
 Format setInputFormat(Format f)
           
 Format setOutputFormat(Format f)
           
protected static int writeJPEG(java.awt.image.BufferedImage image, byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPEGEncoder

public JPEGEncoder()
Method Detail

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Specified by:
getSupportedInputFormats in interface Codec

getSupportedOutputFormats

public Format[] getSupportedOutputFormats(Format input)
Specified by:
getSupportedOutputFormats in interface Codec

process

public int process(Buffer input,
                   Buffer output)
Specified by:
process in interface Codec

processRGBtoJPEG

protected int processRGBtoJPEG(Buffer input,
                               Buffer output)

writeJPEG

protected static int writeJPEG(java.awt.image.BufferedImage image,
                               byte[] data)
                        throws java.io.IOException
Parameters:
image -
data -
Returns:
the number if bytes written in the array
Throws:
java.io.IOException

setInputFormat

public Format setInputFormat(Format f)
Specified by:
setInputFormat in interface Codec

setOutputFormat

public Format setOutputFormat(Format f)
Specified by:
setOutputFormat in interface Codec

close

public void close()
Specified by:
close in interface PlugIn

getName

public java.lang.String getName()
Specified by:
getName in interface PlugIn

open

public void open()
          throws ResourceUnavailableException
Specified by:
open in interface PlugIn
Throws:
ResourceUnavailableException

reset

public void reset()
Specified by:
reset in interface PlugIn

getControl

public java.lang.Object getControl(java.lang.String controlType)
Specified by:
getControl in interface Controls

getControls

public java.lang.Object[] getControls()
Specified by:
getControls in interface Controls