org.apache.pdfbox.pdmodel.graphics.predictor
Class Average

java.lang.Object
  extended by org.apache.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
      extended by org.apache.pdfbox.pdmodel.graphics.predictor.Average

public class Average
extends PredictorAlgorithm

We can use raw on the right hand side of the decoding formula because it is already decoded. average(i,j) = raw(i,j) + (raw(i-1,j)+raw(i,j-1)/2 decoding raw(i,j) = avarage(i,j) - (raw(i-1,j)+raw(i,j-1)/2

Version:
$Revision: 1.3 $
Author:
[email protected]

Constructor Summary
Average()
           
 
Method Summary
 void decodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)
          decode line of pixel data in src from src_offset and width*bpp bytes forward, put the decoded bytes into dest.
 void encodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)
          Not an optimal version, but close to the def.
 
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
aboveLeftPixel, abovePixel, checkBufsiz, decode, encode, getBpp, getFilter, getHeight, getWidth, leftPixel, main, setBpp, setHeight, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Average

public Average()
Method Detail

encodeLine

public void encodeLine(byte[] src,
                       byte[] dest,
                       int srcDy,
                       int srcOffset,
                       int destDy,
                       int destOffset)
Not an optimal version, but close to the def. encode line of pixel data in src from srcOffset and width*bpp bytes forward, put the decoded bytes into dest.

Specified by:
encodeLine in class PredictorAlgorithm
Parameters:
src - raw image data
dest - encoded data
srcDy - byte offset between lines
srcOffset - beginning of line data
destDy - byte offset between lines
destOffset - beginning of line data

decodeLine

public void decodeLine(byte[] src,
                       byte[] dest,
                       int srcDy,
                       int srcOffset,
                       int destDy,
                       int destOffset)
decode line of pixel data in src from src_offset and width*bpp bytes forward, put the decoded bytes into dest.

Specified by:
decodeLine in class PredictorAlgorithm
Parameters:
src - encoded image data
dest - raw data
srcDy - byte offset between lines
srcOffset - beginning of line data
destDy - byte offset between lines
destOffset - beginning of line data


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.