Class Optimum
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.graphics.predictor.PredictorAlgorithm
-
- com.tom_roush.pdfbox.pdmodel.graphics.predictor.Optimum
-
public class Optimum 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.
-
-
Constructor Summary
Constructors Constructor Description Optimum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckBufsiz(byte[] filtered, byte[] raw)check that buffer sizes matches width,height,bpp.voiddecode(byte[] src, byte[] dest)decode a byte array full of image data using the filter that this object implements.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.voidencode(byte[] src, byte[] dest)encode a byte array full of image data using the filter that this object implements.voidencodeLine(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.voidsetBpp(int bpp)voidsetHeight(int height)voidsetWidth(int width)-
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, getBpp, getFilter, getHeight, getWidth, leftPixel, main
-
-
-
-
Method Detail
-
checkBufsiz
public void checkBufsiz(byte[] filtered, byte[] raw)check that buffer sizes matches width,height,bpp. This implementation is used by most of the filters, but not Uptimum.- Overrides:
checkBufsizin classPredictorAlgorithm- Parameters:
filtered- The source buffer.raw- The destination buffer.
-
encodeLine
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.- 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
-
encode
public void encode(byte[] src, byte[] dest)encode a byte array full of image data using the filter that this object implements.- Overrides:
encodein classPredictorAlgorithm- Parameters:
src- bufferdest- buffer
-
setBpp
public void setBpp(int bpp)
- Overrides:
setBppin classPredictorAlgorithm- Parameters:
bpp- The bpp to set.
-
setHeight
public void setHeight(int height)
- Overrides:
setHeightin classPredictorAlgorithm- Parameters:
height- The height to set.
-
setWidth
public void setWidth(int width)
- Overrides:
setWidthin classPredictorAlgorithm- Parameters:
width- The width to set.
-
decode
public void decode(byte[] src, byte[] dest)decode a byte array full of image data using the filter that this object implements.- Overrides:
decodein classPredictorAlgorithm- Parameters:
src- bufferdest- buffer
-
-