aboveLeftPixel
public int aboveLeftPixel(byte[] buf,
int offset,
int dy,
int x) Get the above-left pixel from the buffer.
buf - The buffer.offset - The offset into the buffer.dy - The dy value.x - The x value.
abovePixel
public int abovePixel(byte[] buf,
int offset,
int dy,
int x) Get the above pixel from the buffer.
buf - The buffer.offset - The offset into the buffer.dy - The dy value.x - The x value.
checkBufsiz
public void checkBufsiz(byte[] src,
byte[] dest) check that buffer sizes matches width,height,bpp. This implementation is
used by most of the filters, but not Uptimum.
src - The source buffer.dest - The destination buffer.
decode
public void decode(byte[] src,
byte[] dest) decode a byte array full of image data using the filter that this object
implements.
src - bufferdest - buffer
decodeLine
public abstract 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.
src - encoded image datadest - raw datasrcDy - byte offset between linessrcOffset - beginning of line datadestDy - byte offset between linesdestOffset - beginning of line data
encode
public void encode(byte[] src,
byte[] dest) encode a byte array full of image data using the filter that this object
implements.
src - bufferdest - buffer
encodeLine
public abstract 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.
src - raw image datadest - encoded datasrcDy - byte offset between linessrcOffset - beginning of line datadestDy - byte offset between linesdestOffset - beginning of line data
getBpp
public int getBpp()
getFilter
public static PredictorAlgorithm getFilter(int predictor)
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()
getWidth
public int getWidth()
leftPixel
public int leftPixel(byte[] buf,
int offset,
int dy,
int x) Get the left pixel from the buffer.
buf - The buffer.offset - The offset into the buffer.dy - The dy value.x - The x value.
main
public static void main(String[] args)
Simple command line program to test the algorithm.
args - The command line arguments.
setBpp
public void setBpp(int newBpp)
setHeight
public void setHeight(int newHeight)
newHeight - The height to set.
setWidth
public void setWidth(int newWidth)
newWidth - The width to set.