com.sun.pdfview.decode

Class Predictor

public abstract class Predictor extends Object

The abstract superclass of various predictor objects that undo well-known prediction algorithms.
Field Summary
static intPNG
static intTIFF
well known algorithms
Constructor Summary
protected Predictor(int algorithm)
Create an instance of a predictor.
Method Summary
intgetAlgorithm()
Get the algorithm in use
intgetBitsPerComponent()
Get the number of bits per color component
intgetColors()
Get the number of colors per sample
intgetColumns()
Get the number of columns
static PredictorgetPredictor(PDFObject params)
Get an instance of a predictor
voidsetBitsPerComponent(int bpc)
Set the number of bits per color component
protected voidsetColors(int colors)
Set the number of colors per sample
voidsetColumns(int columns)
Set the number of columns
abstract ByteBufferunpredict(ByteBuffer imageData)
Actually perform this algorithm on decoded image data.

Field Detail

PNG

public static final int PNG

TIFF

public static final int TIFF
well known algorithms

Constructor Detail

Predictor

protected Predictor(int algorithm)
Create an instance of a predictor. Use getPredictor() instead of this.

Method Detail

getAlgorithm

public int getAlgorithm()
Get the algorithm in use

Returns: one of the known algorithm types

getBitsPerComponent

public int getBitsPerComponent()
Get the number of bits per color component

getColors

public int getColors()
Get the number of colors per sample

getColumns

public int getColumns()
Get the number of columns

getPredictor

public static Predictor getPredictor(PDFObject params)
Get an instance of a predictor

Parameters: params the filter parameters

setBitsPerComponent

public void setBitsPerComponent(int bpc)
Set the number of bits per color component

setColors

protected void setColors(int colors)
Set the number of colors per sample

setColumns

public void setColumns(int columns)
Set the number of columns

unpredict

public abstract ByteBuffer unpredict(ByteBuffer imageData)
Actually perform this algorithm on decoded image data. Subclasses must implement this method