Copyright 2013-01-06 Werner Randelshofer

org.monte.media.quicktime
Class RawCodec

java.lang.Object
  extended by org.monte.media.AbstractCodec
      extended by org.monte.media.AbstractVideoCodec
          extended by org.monte.media.quicktime.RawCodec
All Implemented Interfaces:
Codec

public class RawCodec
extends AbstractVideoCodec

RawCodec encodes a BufferedImage as a byte[] array.

This codec does not encode the color palette of an image. This must be done separately.

The pixels of a frame are written row by row from top to bottom and from the left to the right.

Supported input formats:

Supported output formats:

Version:
1.0 2011-03-15 Created.
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
RawCodec()
           
 
Method Summary
 int process(Buffer in, Buffer out)
          Performs the media processing defined by this codec.
 void writeKey16(java.io.OutputStream out, short[] data, int width, int height, int offset, int scanlineStride)
          Encodes a 24-bit key frame.
 void writeKey24(java.io.OutputStream out, java.awt.image.BufferedImage image)
          Encodes a 24-bit key frame.
 void writeKey24(java.io.OutputStream out, int[] data, int width, int height, int offset, int scanlineStride)
          Encodes a 24-bit key frame.
 void writeKey32(java.io.OutputStream out, int[] data, int width, int height, int offset, int scanlineStride)
          Encodes a 24-bit key frame.
 void writeKey8(java.io.OutputStream out, byte[] data, int width, int height, int offset, int scanlineStride)
          Encodes an 8-bit key frame.
 
Methods inherited from class org.monte.media.AbstractVideoCodec
copyImage, getARGB32, getBufferedImage, getIndexed8, getRGB15, getRGB16, getRGB24, writeInt24, writeInt24LE, writeInts24, writeInts24LE
 
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
 

Constructor Detail

RawCodec

public RawCodec()
Method Detail

writeKey8

public void writeKey8(java.io.OutputStream out,
                      byte[] data,
                      int width,
                      int height,
                      int offset,
                      int scanlineStride)
               throws java.io.IOException
Encodes an 8-bit key frame.

Parameters:
out - The output stream.
data - The image data.
width - The width of the image in data elements.
height - The height of the image in data elements.
offset - The offset to the first pixel in the data array.
scanlineStride - The number to append to offset to get to the next scanline.
Throws:
java.io.IOException

writeKey16

public void writeKey16(java.io.OutputStream out,
                       short[] data,
                       int width,
                       int height,
                       int offset,
                       int scanlineStride)
                throws java.io.IOException
Encodes a 24-bit key frame.

Parameters:
out - The output stream.
data - The image data.
width - The width of the image in data elements.
height - The height of the image in data elements.
offset - The offset to the first pixel in the data array.
scanlineStride - The number to append to offset to get to the next scanline.
Throws:
java.io.IOException

writeKey24

public void writeKey24(java.io.OutputStream out,
                       int[] data,
                       int width,
                       int height,
                       int offset,
                       int scanlineStride)
                throws java.io.IOException
Encodes a 24-bit key frame.

Parameters:
out - The output stream.
data - The image data.
width - The width of the image in data elements.
height - The height of the image in data elements.
offset - The offset to the first pixel in the data array.
scanlineStride - The number to append to offset to get to the next scanline.
Throws:
java.io.IOException

writeKey32

public void writeKey32(java.io.OutputStream out,
                       int[] data,
                       int width,
                       int height,
                       int offset,
                       int scanlineStride)
                throws java.io.IOException
Encodes a 24-bit key frame.

Parameters:
out - The output stream.
data - The image data.
width - The width of the image in data elements.
height - The height of the image in data elements.
offset - The offset to the first pixel in the data array.
scanlineStride - The number to append to offset to get to the next scanline.
Throws:
java.io.IOException

writeKey24

public void writeKey24(java.io.OutputStream out,
                       java.awt.image.BufferedImage image)
                throws java.io.IOException
Encodes a 24-bit key frame.

Parameters:
out - The output stream.
image - The image.
Throws:
java.io.IOException

process

public int process(Buffer in,
                   Buffer out)
Description copied from interface: Codec
Performs the media processing defined by this codec.

Copies the data from the input buffer into the output buffer.

Returns:
A combination of processing flags.

Copyright 2013-01-06 Werner Randelshofer