Class RiceCompressor<T extends java.nio.Buffer>

  • All Implemented Interfaces:
    ICompressor<T>
    Direct Known Subclasses:
    RiceCompressor.ByteRiceCompressor, RiceCompressor.IntRiceCompressor, RiceCompressor.ShortRiceCompressor

    public abstract class RiceCompressor<T extends java.nio.Buffer>
    extends java.lang.Object
    implements ICompressor<T>
    The original compression was designed by Rice, Yeh, and Miller the code was written by Richard White at STSc at the STScI and included (ported to c and adapted) in cfitsio by William Pence, NASA/GSFC. That code was then ported to java by R. van Nieuwenhoven. Later it was massively refactored to harmonize the different compression algorithms and reduce the duplicate code pieces without obscuring the algorithm itself as far as possible.
    Author:
    Richard White, William Pence, Richard van Nieuwenhoven
    • Method Detail

      • compress

        protected void compress​(int dataLength,
                                int firstPixel,
                                BitBuffer buffer)
        compress the integer tiledImageOperation on a rise compressed byte buffer.
        Parameters:
        dataLength - length of the data to compress
        firstPixel - the value of the first pixel
        buffer - the buffer to write to
      • decompressBuffer

        protected void decompressBuffer​(java.nio.ByteBuffer readBuffer,
                                        int nx)
        decompress the readbuffer and fill the pixelarray.
        Parameters:
        readBuffer - input buffer
        nx - the number of pixel to uncompress
      • nextPixel

        protected abstract int nextPixel()
      • nextPixel

        protected abstract void nextPixel​(int pixel)