public final class Predictor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
Predictor.PredictorOutputStream
Output stream that implements predictor decoding.
|
Modifier | Constructor and Description |
---|---|
private |
Predictor() |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
calcSetBitSeq(int by,
int startBit,
int bitSize,
int val) |
(package private) static int |
calculateRowLength(int colors,
int bitsPerComponent,
int columns) |
(package private) static void |
decodePredictor(int predictor,
int colors,
int bitsPerComponent,
int columns,
java.io.InputStream in,
java.io.OutputStream out) |
(package private) static void |
decodePredictorRow(int predictor,
int colors,
int bitsPerComponent,
int columns,
byte[] actline,
byte[] lastline)
Decodes a single line of data in-place.
|
(package private) static int |
getBitSeq(int by,
int startBit,
int bitSize) |
(package private) static java.io.OutputStream |
wrapPredictor(java.io.OutputStream out,
COSDictionary decodeParams)
Wraps and
OutputStream in a predictor decoding stream as necessary. |
static void decodePredictorRow(int predictor, int colors, int bitsPerComponent, int columns, byte[] actline, byte[] lastline)
predictor
- Predictor value for the current linecolors
- Number of color components, from decode parameters.bitsPerComponent
- Number of bits per components, from decode parameters.columns
- Number samples in a row, from decode parameters.actline
- Current (active) line to decode. Data will be decoded in-place,
i.e. - the contents of this buffer will be modified.lastline
- The previous decoded line. When decoding the first line, this
parameter should be an empty byte array of the same length as
actline
.static void decodePredictor(int predictor, int colors, int bitsPerComponent, int columns, java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
static int calculateRowLength(int colors, int bitsPerComponent, int columns)
static int getBitSeq(int by, int startBit, int bitSize)
static int calcSetBitSeq(int by, int startBit, int bitSize, int val)
static java.io.OutputStream wrapPredictor(java.io.OutputStream out, COSDictionary decodeParams)
OutputStream
in a predictor decoding stream as necessary.
If no predictor is specified by the parameters, the original stream is returned as is.out
- The stream to which decoded data should be writtendecodeParams
- Decode parameters for the streamOutputStream
is returned, which will write decoded data
into the given stream. If no predictor is specified, the original stream is returned.