Package com.sun.pdfview.decode
Class Predictor
- java.lang.Object
-
- com.sun.pdfview.decode.Predictor
-
- Direct Known Subclasses:
PNGPredictor
public abstract class Predictor extends java.lang.ObjectThe abstract superclass of various predictor objects that undo well-known prediction algorithms.
-
-
Field Summary
Fields Modifier and Type Field Description private intalgorithmthe algorithm to useprivate intbpcthe number of bits per color componentprivate intcolorsthe number of colors per sampleprivate intcolumnsthe number of columns per rowstatic intPNGstatic intTIFFwell known algorithms
-
Constructor Summary
Constructors Modifier Constructor Description protectedPredictor(int algorithm)Create an instance of a predictor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetAlgorithm()Get the algorithm in useintgetBitsPerComponent()Get the number of bits per color componentintgetColors()Get the number of colors per sampleintgetColumns()Get 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 java.nio.ByteBufferunpredict(java.nio.ByteBuffer imageData)Actually perform this algorithm on decoded image data.
-
-
-
Field Detail
-
TIFF
public static final int TIFF
well known algorithms- See Also:
- Constant Field Values
-
PNG
public static final int PNG
- See Also:
- Constant Field Values
-
algorithm
private int algorithm
the algorithm to use
-
colors
private int colors
the number of colors per sample
-
bpc
private int bpc
the number of bits per color component
-
columns
private int columns
the number of columns per row
-
-
Method Detail
-
unpredict
public abstract java.nio.ByteBuffer unpredict(java.nio.ByteBuffer imageData) throws java.io.IOExceptionActually perform this algorithm on decoded image data. Subclasses must implement this method- Throws:
java.io.IOException
-
getPredictor
public static Predictor getPredictor(PDFObject params) throws java.io.IOException
Get an instance of a predictor- Parameters:
params- the filter parameters- Throws:
java.io.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
-
-