Class Predictor

java.lang.Object
com.sun.pdfview.decode.Predictor
Direct Known Subclasses:
PNGPredictor

public abstract class Predictor extends Object
The abstract superclass of various predictor objects that undo well-known prediction algorithms.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    the algorithm to use
    private int
    the number of bits per color component
    private int
    the number of colors per sample
    private int
    the number of columns per row
    static final int
     
    static final int
    well known algorithms
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Predictor(int algorithm)
    Create an instance of a predictor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the algorithm in use
    int
    Get the number of bits per color component
    int
    Get the number of colors per sample
    int
    Get the number of columns
    static Predictor
    Get an instance of a predictor
    void
    Set the number of bits per color component
    protected void
    setColors(int colors)
    Set the number of colors per sample
    void
    setColumns(int columns)
    Set the number of columns
    abstract ByteBuffer
    unpredict(ByteBuffer imageData)
    Actually perform this algorithm on decoded image data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TIFF

      public static final int TIFF
      well known algorithms
      See Also:
    • PNG

      public static final int PNG
      See Also:
    • 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
  • Constructor Details

    • Predictor

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

    • unpredict

      public abstract ByteBuffer unpredict(ByteBuffer imageData) throws IOException
      Actually perform this algorithm on decoded image data. Subclasses must implement this method
      Throws:
      IOException
    • getPredictor

      public static Predictor getPredictor(PDFObject params) throws IOException
      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