Class Average
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
-
- com.tom_roush.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)/2decodingraw(i,j) = avarage(i,j) - (raw(i-1,j)+raw(i,j-1)/2
-
-
Constructor Summary
Constructors Constructor Description Average()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecodeLine(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.voidencodeLine(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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
aboveLeftPixel, abovePixel, checkBufsiz, decode, encode, getBpp, getFilter, getHeight, getWidth, leftPixel, main, setBpp, setHeight, setWidth
-
-
-
-
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:
encodeLinein classPredictorAlgorithm- Parameters:
src- raw image datadest- encoded datasrcDy- byte offset between linessrcOffset- beginning of line datadestDy- byte offset between linesdestOffset- 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:
decodeLinein classPredictorAlgorithm- Parameters:
src- encoded image datadest- raw datasrcDy- byte offset between linessrcOffset- beginning of line datadestDy- byte offset between linesdestOffset- beginning of line data
-
-