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
ConstructorsModifierConstructorDescriptionprotected
Predictor
(int algorithm) Create an instance of a predictor. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the algorithm in useint
Get the number of bits per color componentint
Get the number of colors per sampleint
Get the number of columnsstatic Predictor
getPredictor
(PDFObject params) Get an instance of a predictorvoid
setBitsPerComponent
(int bpc) Set the number of bits per color componentprotected void
setColors
(int colors) Set the number of colors per samplevoid
setColumns
(int columns) Set the number of columnsabstract ByteBuffer
unpredict
(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
-