Copyright 2012-04-26 Werner Randelshofer

org.monte.media
Class AbstractVideoCodec

java.lang.Object
  extended by org.monte.media.AbstractCodec
      extended by org.monte.media.AbstractVideoCodec
All Implemented Interfaces:
Codec
Direct Known Subclasses:
AnimationCodec, BitmapCodec, BitmapCodec, ColorAdjustCodec, DIBCodec, FFRtoVFRConverter, FrameRateConverter, JPEGCodec, PNGCodec, RawCodec, RunLengthCodec, ScaleImageCodec, TechSmithCodec, ZMBVCodec

public abstract class AbstractVideoCodec
extends AbstractCodec

AbstractVideoCodec.

Version:
$Id: AbstractVideoCodec.java 188 2012-03-28 14:03:19Z werner $
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class org.monte.media.AbstractCodec
inputFormat, inputFormats, name, outputFormat, outputFormats
 
Fields inherited from interface org.monte.media.Codec
CODEC_FAILED, CODEC_INPUT_NOT_CONSUMED, CODEC_OK, CODEC_OUTPUT_NOT_FILLED
 
Constructor Summary
AbstractVideoCodec(Format[] supportedInputFormats, Format[] supportedOutputFormats)
           
 
Method Summary
protected static java.awt.image.BufferedImage copyImage(java.awt.image.BufferedImage img)
          Copies a buffered image.
protected  int[] getARGB32(Buffer buf)
          Gets 32-bit ARGB pixels from a buffer.
protected  java.awt.image.BufferedImage getBufferedImage(Buffer buf)
          Gets a buffered image from a buffer.
protected  byte[] getIndexed8(Buffer buf)
          Gets 8-bit indexed pixels from a buffer.
protected  short[] getRGB15(Buffer buf)
          Gets 15-bit RGB pixels from a buffer.
protected  short[] getRGB16(Buffer buf)
          Gets 16-bit RGB-5-6-5 pixels from a buffer.
protected  int[] getRGB24(Buffer buf)
          Gets 24-bit RGB pixels from a buffer.
protected  void writeInt24(javax.imageio.stream.ImageOutputStream out, int v)
           
protected  void writeInt24LE(javax.imageio.stream.ImageOutputStream out, int v)
           
protected  void writeInts24(javax.imageio.stream.ImageOutputStream out, int[] i, int off, int len)
           
protected  void writeInts24LE(javax.imageio.stream.ImageOutputStream out, int[] i, int off, int len)
           
 
Methods inherited from class org.monte.media.AbstractCodec
getInputFormat, getInputFormats, getName, getOutputFormat, getOutputFormats, reset, setInputFormat, setOutputFormat, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.monte.media.Codec
process
 

Constructor Detail

AbstractVideoCodec

public AbstractVideoCodec(Format[] supportedInputFormats,
                          Format[] supportedOutputFormats)
Method Detail

getIndexed8

protected byte[] getIndexed8(Buffer buf)
Gets 8-bit indexed pixels from a buffer. Returns null if conversion failed.


getRGB15

protected short[] getRGB15(Buffer buf)
Gets 15-bit RGB pixels from a buffer. Returns null if conversion failed.


getRGB16

protected short[] getRGB16(Buffer buf)
Gets 16-bit RGB-5-6-5 pixels from a buffer. Returns null if conversion failed.


getRGB24

protected int[] getRGB24(Buffer buf)
Gets 24-bit RGB pixels from a buffer. Returns null if conversion failed.


getARGB32

protected int[] getARGB32(Buffer buf)
Gets 32-bit ARGB pixels from a buffer. Returns null if conversion failed.


getBufferedImage

protected java.awt.image.BufferedImage getBufferedImage(Buffer buf)
Gets a buffered image from a buffer. Returns null if conversion failed.


writeInt24

protected void writeInt24(javax.imageio.stream.ImageOutputStream out,
                          int v)
                   throws java.io.IOException
Throws:
java.io.IOException

writeInt24LE

protected void writeInt24LE(javax.imageio.stream.ImageOutputStream out,
                            int v)
                     throws java.io.IOException
Throws:
java.io.IOException

writeInts24

protected void writeInts24(javax.imageio.stream.ImageOutputStream out,
                           int[] i,
                           int off,
                           int len)
                    throws java.io.IOException
Throws:
java.io.IOException

writeInts24LE

protected void writeInts24LE(javax.imageio.stream.ImageOutputStream out,
                             int[] i,
                             int off,
                             int len)
                      throws java.io.IOException
Throws:
java.io.IOException

copyImage

protected static java.awt.image.BufferedImage copyImage(java.awt.image.BufferedImage img)
Copies a buffered image.


Copyright 2012-04-26 Werner Randelshofer