Package com.sun.pdfview.decode
Class Predictor
java.lang.Object
com.sun.pdfview.decode.Predictor
- Direct Known Subclasses:
PNGPredictor
The abstract superclass of various predictor objects that undo well-known
prediction algorithms.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPredictor(int algorithm) Create an instance of a predictor. -
Method Summary
Modifier and TypeMethodDescriptionintGet the algorithm in useintGet the number of bits per color componentintGet the number of colors per sampleintGet the number of columnsstatic PredictorgetPredictor(PDFObject params) Get an instance of a predictorvoidsetBitsPerComponent(int bpc) Set the number of bits per color componentprotected voidsetColors(int colors) Set the number of colors per samplevoidsetColumns(int columns) Set the number of columnsabstract ByteBufferunpredict(ByteBuffer imageData) Actually perform this algorithm on decoded image data.
-
Field Details
-
TIFF
public static final int TIFFwell known algorithms- See Also:
-
PNG
public static final int PNG- See Also:
-
algorithm
private int algorithmthe algorithm to use -
colors
private int colorsthe number of colors per sample -
bpc
private int bpcthe number of bits per color component -
columns
private int columnsthe number of columns per row
-
-
Constructor Details
-
Predictor
protected Predictor(int algorithm) Create an instance of a predictor. UsegetPredictor()instead of this.
-
-
Method Details
-
unpredict
Actually perform this algorithm on decoded image data. Subclasses must implement this method- Throws:
IOException
-
getPredictor
Get an instance of a predictor- Parameters:
params- the filter parameters- Throws:
IOException
-
getAlgorithm
public int getAlgorithm()Get the algorithm in use- Returns:
- one of the known algorithm types
-
getColors
public int getColors()Get the number of colors per sample -
setColors
protected void setColors(int colors) Set the number of colors per sample -
getBitsPerComponent
public int getBitsPerComponent()Get the number of bits per color component -
setBitsPerComponent
public void setBitsPerComponent(int bpc) Set the number of bits per color component -
getColumns
public int getColumns()Get the number of columns -
setColumns
public void setColumns(int columns) Set the number of columns
-