Class MMRDecompressor


  • public class MMRDecompressor
    extends java.lang.Object
    A decompressor for MMR compression.
    • Constructor Detail

      • MMRDecompressor

        public MMRDecompressor​(int width,
                               int height,
                               javax.imageio.stream.ImageInputStream stream)
    • Method Detail

      • initTables

        private static final void initTables()
      • uncompress2D

        private final int uncompress2D​(MMRDecompressor.RunData runData,
                                       int[] referenceOffsets,
                                       int refRunLength,
                                       int[] runOffsets,
                                       int width)
      • uncompress

        public Bitmap uncompress()
      • detectAndSkipEOL

        private void detectAndSkipEOL()
      • fillBitmap

        private void fillBitmap​(Bitmap result,
                                int line,
                                int[] currentOffsets,
                                int count)
      • uncompress1D

        private final int uncompress1D​(MMRDecompressor.RunData runData,
                                       int[] runOffsets,
                                       int width)
      • createLittleEndianTable

        private static MMRDecompressor.Code[] createLittleEndianTable​(int[][] codes)
        For little endian, the tables are structured like this:
          v--------v length = FIRST_LEVEL_TABLE_LENGTH
                        v-----v length = SECOND_LEVEL_TABLE_LENGTH
         
          A code word which fits into the first level table (length=3)
          [Cccvvvvv]
         
          A code word which needs the second level table also (length=10)
          [Cccccccc] -> [ccvvv]
         
          "C" denotes the first code word bit
          "c" denotes a code word bit
          "v" denotes a variant bit