Class XTIFFPackTileCodec

java.lang.Object
org.libtiff.jai.codec.XTIFFTileCodecImpl
org.libtiff.jai.codecimpl.XTIFFPackTileCodec
All Implemented Interfaces:
XTIFFTileCodec

public class XTIFFPackTileCodec extends XTIFFTileCodecImpl
This codec encapsulates all the logic for the default TIFF "packbits" bit-packing codec algorithm.
  • Constructor Details

    • XTIFFPackTileCodec

      public XTIFFPackTileCodec()
  • Method Details

    • create

      public XTIFFTileCodec create()
      Description copied from class: XTIFFTileCodecImpl
      Implement this to return the corresponding empty codec object.
      Specified by:
      create in class XTIFFTileCodecImpl
    • canEncode

      public boolean canEncode()
      Description copied from class: XTIFFTileCodecImpl
      Indicate whether this codec can encode data. Override to return true only if your codec implments encoding.
      Overrides:
      canEncode in class XTIFFTileCodecImpl
    • register

      public void register()
      Description copied from class: XTIFFTileCodecImpl
      Registration method. Must be implemented by the extended class to register itself with the XTIFFDirectory for all compression codes it supports (e.g Fax codec supports 3 codes).
      Specified by:
      register in interface XTIFFTileCodec
      Specified by:
      register in class XTIFFTileCodecImpl
      See Also:
    • encodeTilePixels

      public int encodeTilePixels(int[] pixels, Rectangle newRect, byte[] bpixels)
      encode the tile into bpixels and return the byte size (uncompressed packing algorithm). The padding has already been done, so we may safely assume that pixels is exactly rows by cols by numBands ints.
      Overrides:
      encodeTilePixels in class XTIFFTileCodecImpl
      Parameters:
      pixels - input pixels
      newRect - the array dimensions of samples
      bpixels - the target array of compressed byte data
    • decodeTilePixels

      public void decodeTilePixels(byte[] input, Rectangle newRect, byte[] bdata)
      Decode a rectangle of pixels
      Specified by:
      decodeTilePixels in class XTIFFTileCodecImpl
      Parameters:
      input - the byte array of compressed input data
      newRect - the rectangular shape of the target pixels
      bdata - the target decompressed pixels.
    • decodeTilePixels

      public void decodeTilePixels(byte[] input, Rectangle newRect, short[] sdata)
      Decode a rectangle of pixels
      Specified by:
      decodeTilePixels in class XTIFFTileCodecImpl
      Parameters:
      input - the byte array of compressed input data
      newRect - the rectangular shape of the target pixels
      sdata - the target decompressed pixels.