Class JPEGLosslessDecoder
- java.lang.Object
-
- com.twelvemonkeys.imageio.plugins.jpeg.JPEGLosslessDecoder
-
final class JPEGLosslessDecoder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private int[][]acTabprivate int[][]dcTabprivate Frameframeprivate int[][][]HuffTabprivate java.util.List<HuffmanTable>huffTablesprivate static int[]IDCT_Pprivate int[]IDCT_Sourceprivate javax.imageio.stream.ImageInputStreaminputprivate JPEGImageReaderlistenerDelegateprivate intmarkerprivate intmarkerIndexprivate intmaskprivate static intMAX_HUFFMAN_SUBTREEprivate static intMSBprivate int[]nBlockprivate intnumCompprivate int[][]outputDataprivate int[][]qTabprivate QuantizationTablequantTableprivate static intRESTART_MARKER_BEGINprivate static intRESTART_MARKER_ENDprivate booleanrestartingprivate intrestartIntervalprivate Scanscanprivate intselectionprivate intxDimprivate intxLocprivate intyDimprivate intyLoc
-
Constructor Summary
Constructors Constructor Description JPEGLosslessDecoder(java.util.List<Segment> segments, javax.imageio.stream.ImageInputStream data, JPEGImageReader listenerDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int[][]decode()private intdecode(int[] prev, int[] temp, int[] index)private intdecode0(int[] prev, int[] temp, int[] index)private intdecodeAny(int[] prev, int[] temp, int[] index)private intdecodeRGB(int[] prev, int[] temp, int[] index)private intdecodeSingle(int[] prev, int[] temp, int[] index)private <T> Tget(java.util.List<Segment> segments, java.lang.Class<T> type)private <T> java.util.List<T>getAll(java.util.List<Segment> segments, java.lang.Class<T> type)private Frame.ComponentgetComponentSpec(Frame.Component[] components, int sel)(package private) intgetDimX()(package private) intgetDimY()private intgetHuffmanValue(int[] table, int[] temp, int[] index)private intgetn(int[] pred, int n, int[] temp, int[] index)(package private) intgetNumComponents()(package private) intgetPrecision()private intgetPreviousX(int[] data)private intgetPreviousXY(int[] data)private intgetPreviousY(int[] data)private booleanisLastPixel()private booleanisLossless()private voidoutput(int[] pred)private voidoutputAny(int[] pred)private voidoutputRGB(int[] pred)private voidoutputSingle(int[] pred)private voidprocessWarningOccured(java.lang.String warning)private intreadNumber()private ScanreadScan()private booleanuseACForDC(int dcTabSel)
-
-
-
Field Detail
-
input
private final javax.imageio.stream.ImageInputStream input
-
listenerDelegate
private final JPEGImageReader listenerDelegate
-
frame
private final Frame frame
-
huffTables
private final java.util.List<HuffmanTable> huffTables
-
quantTable
private final QuantizationTable quantTable
-
scan
private Scan scan
-
HuffTab
private final int[][][] HuffTab
-
IDCT_Source
private final int[] IDCT_Source
-
nBlock
private final int[] nBlock
-
acTab
private final int[][] acTab
-
dcTab
private final int[][] dcTab
-
qTab
private final int[][] qTab
-
restarting
private boolean restarting
-
marker
private int marker
-
markerIndex
private int markerIndex
-
numComp
private int numComp
-
restartInterval
private int restartInterval
-
selection
private int selection
-
xDim
private int xDim
-
yDim
private int yDim
-
xLoc
private int xLoc
-
yLoc
private int yLoc
-
mask
private int mask
-
outputData
private int[][] outputData
-
IDCT_P
private static final int[] IDCT_P
-
RESTART_MARKER_BEGIN
private static final int RESTART_MARKER_BEGIN
- See Also:
- Constant Field Values
-
RESTART_MARKER_END
private static final int RESTART_MARKER_END
- See Also:
- Constant Field Values
-
MAX_HUFFMAN_SUBTREE
private static final int MAX_HUFFMAN_SUBTREE
- See Also:
- Constant Field Values
-
MSB
private static final int MSB
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JPEGLosslessDecoder
JPEGLosslessDecoder(java.util.List<Segment> segments, javax.imageio.stream.ImageInputStream data, JPEGImageReader listenerDelegate)
-
-
Method Detail
-
getDimX
int getDimX()
-
getDimY
int getDimY()
-
getAll
private <T> java.util.List<T> getAll(java.util.List<Segment> segments, java.lang.Class<T> type)
-
get
private <T> T get(java.util.List<Segment> segments, java.lang.Class<T> type)
-
decode
int[][] decode() throws java.io.IOException- Throws:
java.io.IOException
-
processWarningOccured
private void processWarningOccured(java.lang.String warning)
-
useACForDC
private boolean useACForDC(int dcTabSel)
-
isLossless
private boolean isLossless()
-
getComponentSpec
private Frame.Component getComponentSpec(Frame.Component[] components, int sel)
-
readScan
private Scan readScan() throws java.io.IOException
- Throws:
java.io.IOException
-
decode
private int decode(int[] prev, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
decodeSingle
private int decodeSingle(int[] prev, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
decodeRGB
private int decodeRGB(int[] prev, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
decodeAny
private int decodeAny(int[] prev, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
decode0
private int decode0(int[] prev, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
getHuffmanValue
private int getHuffmanValue(int[] table, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
getn
private int getn(int[] pred, int n, int[] temp, int[] index) throws java.io.IOException- Throws:
java.io.IOException
-
getPreviousX
private int getPreviousX(int[] data)
-
getPreviousXY
private int getPreviousXY(int[] data)
-
getPreviousY
private int getPreviousY(int[] data)
-
isLastPixel
private boolean isLastPixel()
-
output
private void output(int[] pred)
-
outputSingle
private void outputSingle(int[] pred)
-
outputRGB
private void outputRGB(int[] pred)
-
outputAny
private void outputAny(int[] pred)
-
readNumber
private int readNumber() throws java.io.IOException- Throws:
java.io.IOException
-
getNumComponents
int getNumComponents()
-
getPrecision
int getPrecision()
-
-