Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media.avi
Class TechSmithCodec

    java.lang.Object
      org.monte.media.AbstractCodec
          org.monte.media.AbstractVideoCodec
              org.monte.media.avi.TechSmithCodec

All Implemented Interfaces:
  Codec

    public class TechSmithCodec

extends AbstractVideoCodec

`TechSmithCodec` (tscc) encodes a BufferedImage as a byte[] array.

The TechSmith codec works with AVI and QuickTime.

This codec supports encoding from a `BufferedImage` into the file format, and decoding from the file format to a `BufferedImage`.

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

Supported input formats:

`Format` with `BufferedImage.class`, any width, any height, depth=8,16 or 24.

Supported output formats:

`Format` with `byte[].class`, same width and height as input format, depth=8,16 or 24.

The codec supports lossless delta- and key-frame encoding of images with 8, 16 or 24 bits per pixel.

Compression of a frame is performed in two steps: In the first, step a frame is compressed line by line from bottom to top. In the second step the resulting data is compressed again using zlib compression.

Apart from the second compression step and the support for 16- and 24-bit data, this encoder is identical to the `RunLengthCodec`.

Each line of a frame is compressed individually. A line consists of two-byte op-codes optionally followed by data. The end of the line is marked with the EOL op-code.

The following op-codes are supported:

- `0x00 0x00`
  Marks the end of a line.
- `0x00 0x01`
  Marks the end of the bitmap.
- `0x00 0x02 x y`
  Marks a delta (skip). `x` and `y` indicate the horizontal and vertical offset from the current position. `x` and `y` are unsigned 8-bit values.
- `0x00 n pixel{n} 0x00?`
  Marks a literal run. `n` gives the number of 8-, 16- or 24-bit pixels that follow. `n` must be between 3 and 255. If n is odd and 8-bit pixels are used, a pad byte with the value 0x00 must be added.
- `n pixel`
  Marks a repetition. `n` gives the number of times the given pixel is repeated. `n` must be between 1 and 255.

Example:

     Compressed data         Expanded data

     03 04                   04 04 04
     05 06                   06 06 06 06 06
     00 03 45 56 67 00       45 56 67
     02 78                   78 78
     00 02 05 01             Move 5 right and 1 down
     02 78                   78 78
     00 00                   End of line
     09 1E                   1E 1E 1E 1E 1E 1E 1E 1E 1E
     00 01                   End of RLE bitmap

References:
http://wiki.multimedia.cx/index.php?title=TechSmith_Screen_Capture_Codec

Version:
  $Id: TechSmithCodec.java 192 2012-03-29 22:00:37Z 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
`TechSmithCodec()`

Method Summary
`int` | `decode(Buffer in, Buffer out)`
`int` | `encode(Buffer in, Buffer out)`
`int` | `process(Buffer in, Buffer out)` Performs the media processing defined by this codec.
`void` | `reset()` Empty implementation of the reset method.

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, setInputFormat, setOutputFormat, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TechSmithCodec

    public TechSmithCodec()

Method Detail

### reset

    public void reset()

  Description copied from class: `AbstractCodec`
  Empty implementation of the reset method. Don't call super.

  Specified by:
    `reset` in interface `Codec`
  Overrides:
    `reset` in class `AbstractCodec`

### 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.

### decode

    public int decode(Buffer in,
                      Buffer out)

### encode

    public int encode(Buffer in,
                      Buffer out)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD