public class PredictorDecode extends ChunkingInputStream
| Modifier and Type | Field and Description |
|---|---|
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 |
buffer, in| Constructor and Description |
|---|
PredictorDecode(java.io.InputStream input,
Library library,
java.util.HashMap entries) |
| Modifier and Type | Method and Description |
|---|---|
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) |
available, close, fillBufferFromInputStream, fillBufferFromInputStream, mark, markSupported, read, read, read, reset, setBufferSize, setInputStream, skip, toStringprotected 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
public PredictorDecode(java.io.InputStream input,
Library library,
java.util.HashMap entries)
protected int fillInternalBuffer()
throws java.io.IOException
ChunkingInputStreamfillInternalBuffer in class ChunkingInputStreamjava.io.IOExceptionprotected 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)