loci.formats.codec
Interface Codec

All Known Implementing Classes:
AdobeDeflateCodec, Base64Codec, BaseCodec, JPEGCodec, LuraWaveCodec, LZOCodec, LZWCodec, MJPBCodec, MSRLECodec, MSVideoCodec, NikonCodec, PackbitsCodec, QTRLECodec, RPZACodec

public interface Codec

This class is an interface for any kind of compression or decompression. Data is presented to the compressor in a 1D or 2D byte array, with (optionally, depending on the compressor) pixel dimensions and an Object containing any other options the compressor may need. If an argument is not appropriate for the compressor type, it is expected to completely ignore the argument. i.e.: Passing a compressor that does not require pixel dimensions null for the dimensions must not cause the compressor to throw a NullPointerException. Classes implementing the Codec interface are expected to either implement both compression methods or neither. (The same is expected for decompression).

Source code:
Trac, SVN

Author:
Eric Kjellman egkjellman at wisc.edu

Method Summary
 byte[] compress(byte[][] data, int x, int y, int[] dims, Object options)
          Compresses a block of data.
 byte[] compress(byte[] data, int x, int y, int[] dims, Object options)
          Compresses a block of data.
 byte[] decompress(byte[] data)
          Decompresses a block of data.
 byte[] decompress(byte[][] data)
          Decompresses a block of data.
 byte[] decompress(byte[][] data, Object options)
          Decompresses a block of data.
 byte[] decompress(byte[] data, Object options)
          Decompresses a block of data.
 

Method Detail

compress

byte[] compress(byte[] data,
                int x,
                int y,
                int[] dims,
                Object options)
                throws loci.formats.FormatException
Compresses a block of data.

Parameters:
data - The data to be compressed.
x - Length of the x dimension of the image data, if appropriate.
y - Length of the y dimension of the image data, if appropriate.
dims - The dimensions of the image data, if appropriate.
options - Options to be used during compression, if appropriate.
Returns:
The compressed data.
Throws:
loci.formats.FormatException - If input is not a compressed data block of the appropriate type.

compress

byte[] compress(byte[][] data,
                int x,
                int y,
                int[] dims,
                Object options)
                throws loci.formats.FormatException
Compresses a block of data.

Parameters:
data - The data to be compressed.
x - Length of the x dimension of the image data, if appropriate.
y - Length of the y dimension of the image data, if appropriate.
dims - The dimensions of the image data, if appropriate.
options - Options to be used during compression, if appropriate.
Returns:
The compressed data.
Throws:
loci.formats.FormatException - If input is not a compressed data block of the appropriate type.

decompress

byte[] decompress(byte[] data,
                  Object options)
                  throws loci.formats.FormatException
Decompresses a block of data.

Parameters:
data - the data to be decompressed
options - Options to be used during decompression.
Returns:
the decompressed data.
Throws:
loci.formats.FormatException - If data is not valid.

decompress

byte[] decompress(byte[][] data,
                  Object options)
                  throws loci.formats.FormatException
Decompresses a block of data.

Parameters:
data - the data to be decompressed
options - Options to be used during decompression.
Returns:
the decompressed data.
Throws:
loci.formats.FormatException - If data is not valid.

decompress

byte[] decompress(byte[] data)
                  throws loci.formats.FormatException
Decompresses a block of data.

Parameters:
data - the data to be decompressed.
Returns:
The decompressed data.
Throws:
loci.formats.FormatException - If data is not valid compressed data for this decompressor.

decompress

byte[] decompress(byte[][] data)
                  throws loci.formats.FormatException
Decompresses a block of data.

Parameters:
data - The data to be decompressed.
Returns:
The decompressed data.
Throws:
loci.formats.FormatException - If data is not valid compressed data for this decompressor.