|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
org.icepdf.core.pobjects.filters.ChunkingInputStream
org.icepdf.core.pobjects.filters.PredictorDecode
public class PredictorDecode
Predictor decoder for LZW and Flate data streams. Uses the same streaming as our other Filters but simplifies how the bytes are read in as we treat the parent (LZW or Flate) stream as a regular ChunkingInputStream.
| Field Summary | |
|---|---|
protected byte[] |
aboveBuffer
|
protected static Name |
BITS_PER_COMPONENT_VALUE
|
protected int |
bitsPerComponent
|
protected int |
bytesPerPixel
|
protected static Name |
COLORS_VALUE
|
protected static Name |
COLUMNS_VALUE
|
protected static Name |
DECODE_PARMS_VALUE
|
protected static Name |
EARLY_CHANGE_VALUE
|
protected int |
numComponents
|
protected int |
predictor
|
protected static int |
PREDICTOR_NONE
No predictor function is used |
protected static int |
PREDICTOR_PNG_AVG
For current row, derive each byte from average of byte left-by-bytesPerPixel and byte above |
protected static int |
PREDICTOR_PNG_NONE
For current row, PNG predictor to do nothing |
protected static int |
PREDICTOR_PNG_OPTIMUM
When given in DecodeParms dict, in stream dict, means first byte of each row is row's predictor |
protected static int |
PREDICTOR_PNG_PAETH
For current row, derive each byte from non-linear function of byte left-by-bytesPerPixel and byte above and byte left-by-bytesPerPixel of above |
protected static int |
PREDICTOR_PNG_SUB
For current row, derive each byte from byte left-by-bytesPerPixel |
protected static int |
PREDICTOR_PNG_UP
For current row, derive each byte from byte above |
protected static int |
PREDICTOR_TIFF_2
For every row, each component is derived from corresponding component in entry to left |
protected static Name |
PREDICTOR_VALUE
|
protected int |
width
|
protected static Name |
WIDTH_VALUE
|
| Fields inherited from class org.icepdf.core.pobjects.filters.ChunkingInputStream |
|---|
buffer, in |
| Constructor Summary | |
|---|---|
PredictorDecode(java.io.InputStream input,
Library library,
java.util.HashMap entries)
|
|
| Method Summary | |
|---|---|
protected void |
applyPredictor(int numRead,
int currPredictor)
Apply predictor logic to buffer[] using aboveBuffer[] from previous pass. |
protected int |
fillInternalBuffer()
This is only called if bufferAvailable is 0. |
static boolean |
isPredictor(Library library,
java.util.HashMap entries)
|
| Methods inherited from class org.icepdf.core.pobjects.filters.ChunkingInputStream |
|---|
available, close, fillBufferFromInputStream, fillBufferFromInputStream, mark, markSupported, read, read, read, reset, setBufferSize, setInputStream, skip, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int PREDICTOR_NONE
protected static final int PREDICTOR_TIFF_2
protected static final int PREDICTOR_PNG_NONE
protected static final int PREDICTOR_PNG_SUB
protected static final int PREDICTOR_PNG_UP
protected static final int PREDICTOR_PNG_AVG
protected static final int PREDICTOR_PNG_PAETH
protected static final int PREDICTOR_PNG_OPTIMUM
protected static final Name DECODE_PARMS_VALUE
protected static final Name PREDICTOR_VALUE
protected static final Name WIDTH_VALUE
protected static final Name COLUMNS_VALUE
protected static final Name COLORS_VALUE
protected static final Name BITS_PER_COMPONENT_VALUE
protected static final Name EARLY_CHANGE_VALUE
protected int predictor
protected int numComponents
protected int bitsPerComponent
protected int width
protected int bytesPerPixel
protected byte[] aboveBuffer
| Constructor Detail |
|---|
public PredictorDecode(java.io.InputStream input,
Library library,
java.util.HashMap entries)
| Method Detail |
|---|
protected int fillInternalBuffer()
throws java.io.IOException
ChunkingInputStream
fillInternalBuffer in class ChunkingInputStreamjava.io.IOException
protected void applyPredictor(int numRead,
int currPredictor)
numRead - number of bytes read in last pass.currPredictor - predictor to apply to buffer data.
public static boolean isPredictor(Library library,
java.util.HashMap entries)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||