public class Average extends PredictorAlgorithm
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
Constructor and Description |
---|
Average() |
Modifier and Type | Method and Description |
---|---|
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.
|
aboveLeftPixel, abovePixel, checkBufsiz, decode, encode, getBpp, getFilter, getHeight, getWidth, leftPixel, main, setBpp, setHeight, setWidth
public void encodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)
encodeLine
in class PredictorAlgorithm
src
- raw image datadest
- encoded datasrcDy
- byte offset between linessrcOffset
- beginning of line datadestDy
- byte offset between linesdestOffset
- beginning of line datapublic void decodeLine(byte[] src, byte[] dest, int srcDy, int srcOffset, int destDy, int destOffset)
decodeLine
in class PredictorAlgorithm
src
- encoded image datadest
- raw datasrcDy
- byte offset between linessrcOffset
- beginning of line datadestDy
- byte offset between linesdestOffset
- beginning of line dataCopyright © 2002–2017 The Apache Software Foundation. All rights reserved.