| java.lang.Object org.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
All known Subclasses: org.pdfbox.pdmodel.graphics.predictor.Sub, org.pdfbox.pdmodel.graphics.predictor.Up, org.pdfbox.pdmodel.graphics.predictor.None, org.pdfbox.pdmodel.graphics.predictor.Paeth, org.pdfbox.pdmodel.graphics.predictor.Average, org.pdfbox.pdmodel.graphics.predictor.Uptimum,
PredictorAlgorithm | abstract public class PredictorAlgorithm (Code) | | Implements different PNG predictor algorithms that is used in PDF files.
author: xylifyx@yahoo.co.uk version: $Revision: 1.3 $ See Also: PNG Filters |
Method Summary | |
public int | aboveLeftPixel(byte[] buf, int offset, int dy, int x) Get the above-left pixel from the buffer.
Parameters: buf - The buffer. Parameters: offset - The offset into the buffer. Parameters: dy - The dy value. Parameters: x - The x value. | public int | abovePixel(byte[] buf, int offset, int dy, int x) Get the above pixel from the buffer.
Parameters: buf - The buffer. Parameters: offset - The offset into the buffer. Parameters: dy - The dy value. Parameters: x - The x value. | public void | checkBufsiz(byte[] src, byte[] dest) check that buffer sizes matches width,height,bpp. | public void | decode(byte[] src, byte[] dest) decode a byte array full of image data using the filter that this object
implements. | abstract 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. | public void | encode(byte[] src, byte[] dest) encode a byte array full of image data using the filter that this object
implements. | abstract public 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. | public int | getBpp() | public static PredictorAlgorithm | getFilter(int predictor) | public int | getHeight() | public int | getWidth() | public int | leftPixel(byte[] buf, int offset, int dy, int x) Get the left pixel from the buffer.
Parameters: buf - The buffer. Parameters: offset - The offset into the buffer. Parameters: dy - The dy value. Parameters: x - The x value. | public static void | main(String[] args) Simple command line program to test the algorithm. | public void | setBpp(int newBpp) | public void | setHeight(int newHeight) | public void | setWidth(int newWidth) |
aboveLeftPixel | public int aboveLeftPixel(byte[] buf, int offset, int dy, int x)(Code) | | Get the above-left pixel from the buffer.
Parameters: buf - The buffer. Parameters: offset - The offset into the buffer. Parameters: dy - The dy value. Parameters: x - The x value. The above-left pixel. |
abovePixel | public int abovePixel(byte[] buf, int offset, int dy, int x)(Code) | | Get the above pixel from the buffer.
Parameters: buf - The buffer. Parameters: offset - The offset into the buffer. Parameters: dy - The dy value. Parameters: x - The x value. The above pixel. |
checkBufsiz | public void checkBufsiz(byte[] src, byte[] dest)(Code) | | check that buffer sizes matches width,height,bpp. This implementation is
used by most of the filters, but not Uptimum.
Parameters: src - The source buffer. Parameters: dest - The destination buffer. |
decode | public void decode(byte[] src, byte[] dest)(Code) | | decode a byte array full of image data using the filter that this object
implements.
Parameters: src - buffer Parameters: dest - buffer |
decodeLine | abstract public void decodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)(Code) | | decode line of pixel data in src from src_offset and width*bpp bytes
forward, put the decoded bytes into dest.
Parameters: src - encoded image data Parameters: dest - raw data Parameters: srcDy - byte offset between lines Parameters: srcOffset - beginning of line data Parameters: destDy - byte offset between lines Parameters: destOffset - beginning of line data |
encode | public void encode(byte[] src, byte[] dest)(Code) | | encode a byte array full of image data using the filter that this object
implements.
Parameters: src - buffer Parameters: dest - buffer |
encodeLine | abstract public void encodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)(Code) | | encode line of pixel data in src from srcOffset and width*bpp bytes
forward, put the decoded bytes into dest.
Parameters: src - raw image data Parameters: dest - encoded data Parameters: srcDy - byte offset between lines Parameters: srcOffset - beginning of line data Parameters: destDy - byte offset between lines Parameters: destOffset - beginning of line data |
getBpp | public int getBpp()(Code) | | Returns the bpp. |
getFilter | public static PredictorAlgorithm getFilter(int predictor)(Code) | | Parameters: predictor - - 1 No prediction (the default value)
- 2 TIFF Predictor 2
- 10 PNG prediction (on encoding, PNG None on all rows)
- 11 PNG prediction (on encoding, PNG Sub on all rows)
- 12 PNG prediction (on encoding, PNG Up on all rows)
- 13 PNG prediction (on encoding, PNG Average on all rows)
- 14 PNG prediction (on encoding, PNG Paeth on all rows)
- 15 PNG prediction (on encoding, PNG optimum)
The predictor class based on the predictor code. |
getHeight | public int getHeight()(Code) | | Returns the height. |
getWidth | public int getWidth()(Code) | | Returns the width. |
leftPixel | public int leftPixel(byte[] buf, int offset, int dy, int x)(Code) | | Get the left pixel from the buffer.
Parameters: buf - The buffer. Parameters: offset - The offset into the buffer. Parameters: dy - The dy value. Parameters: x - The x value. The left pixel. |
main | public static void main(String[] args)(Code) | | Simple command line program to test the algorithm.
Parameters: args - The command line arguments. |
setBpp | public void setBpp(int newBpp)(Code) | | Parameters: newBpp - The bpp to set. |
setHeight | public void setHeight(int newHeight)(Code) | | Parameters: newHeight - The height to set. |
setWidth | public void setWidth(int newWidth)(Code) | | Parameters: newWidth - The width to set. |
|
|