Class MMRDecompressor
- java.lang.Object
-
- org.apache.pdfbox.jbig2.decoder.mmr.MMRDecompressor
-
public class MMRDecompressor extends java.lang.Object
A decompressor for MMR compression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MMRDecompressor.Code
private class
MMRDecompressor.RunData
A class encapsulating the compressed raw data.
-
Field Summary
Fields Modifier and Type Field Description private static MMRDecompressor.Code[]
blackTable
private MMRDecompressor.RunData
data
private static int
FIRST_LEVEL_TABLE_MASK
private static int
FIRST_LEVEL_TABLE_SIZE
private int
height
private static MMRDecompressor.Code[]
modeTable
private static int
SECOND_LEVEL_TABLE_MASK
private static int
SECOND_LEVEL_TABLE_SIZE
private static MMRDecompressor.Code[]
whiteTable
private int
width
-
Constructor Summary
Constructors Constructor Description MMRDecompressor(int width, int height, javax.imageio.stream.ImageInputStream stream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static MMRDecompressor.Code[]
createLittleEndianTable(int[][] codes)
For little endian, the tables are structured like this:private void
detectAndSkipEOL()
private void
fillBitmap(Bitmap result, int line, int[] currentOffsets, int count)
private static void
initTables()
Bitmap
uncompress()
private int
uncompress1D(MMRDecompressor.RunData runData, int[] runOffsets, int width)
private int
uncompress2D(MMRDecompressor.RunData runData, int[] referenceOffsets, int refRunLength, int[] runOffsets, int width)
-
-
-
Field Detail
-
width
private int width
-
height
private int height
-
FIRST_LEVEL_TABLE_SIZE
private static final int FIRST_LEVEL_TABLE_SIZE
- See Also:
- Constant Field Values
-
FIRST_LEVEL_TABLE_MASK
private static final int FIRST_LEVEL_TABLE_MASK
- See Also:
- Constant Field Values
-
SECOND_LEVEL_TABLE_SIZE
private static final int SECOND_LEVEL_TABLE_SIZE
- See Also:
- Constant Field Values
-
SECOND_LEVEL_TABLE_MASK
private static final int SECOND_LEVEL_TABLE_MASK
- See Also:
- Constant Field Values
-
whiteTable
private static MMRDecompressor.Code[] whiteTable
-
blackTable
private static MMRDecompressor.Code[] blackTable
-
modeTable
private static MMRDecompressor.Code[] modeTable
-
data
private MMRDecompressor.RunData data
-
-
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
-
-