org.pdfbox.pdmodel.graphics.predictor
Class Uptimum

java.lang.Object
  extended byorg.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
      extended byorg.pdfbox.pdmodel.graphics.predictor.Uptimum

public class Uptimum
extends PredictorAlgorithm

In an Uptimum encoded image, each line takes up width*bpp+1 bytes. The first byte holds a number that signifies which algorithm encoded the line.

Version:
$Revision: 1.2 $
Author:
xylifyx@yahoo.co.uk

Constructor Summary
Uptimum()
           
 
Method Summary
 void checkBufsiz(byte[] filtered, byte[] raw)
          check that buffer sizes matches width,height,bpp.
 void decode(byte[] src, byte[] dest)
          decode a byte array full of image data using the filter that this object implements.
 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 encode(byte[] src, byte[] dest)
          encode a byte array full of image data using the filter that this object implements.
 void encodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)
          encode line of pixel data in src from srcOffset and width*bpp bytes forward, put the decoded bytes into dest.
 void setBpp(int bpp)
           
 void setHeight(int height)
           
 void setWidth(int width)
           
 
Methods inherited from class org.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
aboveLeftPixel, abovePixel, getBpp, getFilter, getHeight, getWidth, leftPixel, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Uptimum

public Uptimum()
Method Detail

checkBufsiz

public void checkBufsiz(byte[] filtered,
                        byte[] raw)
Description copied from class: PredictorAlgorithm
check that buffer sizes matches width,height,bpp. This implementation is used by most of the filters, but not Uptimum.

Overrides:
checkBufsiz in class PredictorAlgorithm
Parameters:
filtered - The source buffer.
raw - The destination buffer.
See Also:
PredictorAlgorithm.checkBufsiz(byte[], byte[])

encodeLine

public void encodeLine(byte[] src,
                       byte[] dest,
                       int srcDy,
                       int srcOffset,
                       int destDy,
                       int destOffset)
Description copied from class: PredictorAlgorithm
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
See Also:
PredictorAlgorithm.encodeLine(byte[], byte[], int, int, int, int)

decodeLine

public void decodeLine(byte[] src,
                       byte[] dest,
                       int srcDy,
                       int srcOffset,
                       int destDy,
                       int destOffset)
Description copied from class: PredictorAlgorithm
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
See Also:
PredictorAlgorithm.decodeLine(byte[], byte[], int, int, int, int)

encode

public void encode(byte[] src,
                   byte[] dest)
Description copied from class: PredictorAlgorithm
encode a byte array full of image data using the filter that this object implements.

Overrides:
encode in class PredictorAlgorithm
Parameters:
src - buffer
dest - buffer
See Also:
PredictorAlgorithm.encode(byte[], byte[])

setBpp

public void setBpp(int bpp)
Overrides:
setBpp in class PredictorAlgorithm
Parameters:
bpp - The bpp to set.
See Also:
PredictorAlgorithm.setBpp(int)

setHeight

public void setHeight(int height)
Overrides:
setHeight in class PredictorAlgorithm
Parameters:
height - The height to set.
See Also:
PredictorAlgorithm.setHeight(int)

setWidth

public void setWidth(int width)
Overrides:
setWidth in class PredictorAlgorithm
Parameters:
width - The width to set.
See Also:
PredictorAlgorithm.setWidth(int)

decode

public void decode(byte[] src,
                   byte[] dest)
Description copied from class: PredictorAlgorithm
decode a byte array full of image data using the filter that this object implements.

Overrides:
decode in class PredictorAlgorithm
Parameters:
src - buffer
dest - buffer
See Also:
PredictorAlgorithm.decode(byte[], byte[])