| org.libtiff.jai.codec.XTIFFTileCodec
All known Subclasses: org.libtiff.jai.codec.XTIFFTileCodecImpl,
XTIFFTileCodec | public interface XTIFFTileCodec (Code) | | The XTIFFTileCodec is the common interface used by all
registered implementations of TIFF data compression.
Unlike other file formats, TIFF has no fixed set of
data compressions schemes, but allows for new and
user-defined compression types.
To use a new codec with the XTIFFDirectory you must
do the following things:
- register XTIFF methods with JAI through the XTIFFDescriptor
- implement the methods below; it is recommended to
use the XTIFFTileCodecImpl class for this purpose, as
it reduces the problem to one of defining the actual
data compression and decompression algorithms. If you
do not support encoding (e.g LZW), be sure the canEncode()
methods returns false.
- register the implemented code with the XTIFFDirectory,
indicating in the register method all TIFF compression
codes that this codec can handle.
See Also: XTIFFTileCodecImpl |
Method Summary | |
public XTIFFTileCodec | create(XTIFFEncodeParam param) Create a codec for encoding data.
Parameters: param - the encoding parameter. | public XTIFFTileCodec | create(XTIFFDecodeParam param) Create a codec for decoding
Parameters: param - the decoding parameter. | public WritableRaster | decode(RenderedImage im, Rectangle rect, byte[] input) | public int | encode(RenderedImage im, Rectangle rect, byte[] output) Encode some data from RenderedImage, and return the
actual number of bytes stored in output buffer. | public int | getCompressedTileSize(RenderedImage im) Return the largest possible compressed buffer size
for this image in bytes. | public int | getCompression() | public void | register() Register this codec with the XTIFFDirectory. |
create | public XTIFFTileCodec create(XTIFFEncodeParam param) throws IOException(Code) | | Create a codec for encoding data.
Parameters: param - the encoding parameter. It is the responsibilityof the codec to initialize itself from this parameter. |
decode | public WritableRaster decode(RenderedImage im, Rectangle rect, byte[] input)(Code) | | Decode input byte data into a new WritableRaster, using
information from underlying RenderedImage
|
encode | public int encode(RenderedImage im, Rectangle rect, byte[] output)(Code) | | Encode some data from RenderedImage, and return the
actual number of bytes stored in output buffer.
|
getCompressedTileSize | public int getCompressedTileSize(RenderedImage im)(Code) | | Return the largest possible compressed buffer size
for this image in bytes. This is used by the XTIFFImage
constructor to allocate a decoding buffer.
|
getCompression | public int getCompression()(Code) | | Return the associated TIFF compression code
|
register | public void register()(Code) | | Register this codec with the XTIFFDirectory.
The method may register itself with multiple
TIFF compression codes, if it supports more than
one.
See Also: XTIFFDirectory |
|
|