Method from org.apache.pdfbox.pdmodel.graphics.predictor.Optimum Detail: |
public void checkBufsiz(byte[] filtered,
byte[] raw) {
if (filtered.length != (getWidth() * getBpp() + 1) * getHeight())
{
throw new IllegalArgumentException(
"filtered.length != (width*bpp + 1) * height, "
+ filtered.length + " "
+ (getWidth() * getBpp() + 1) * getHeight()
+ "w,h,bpp=" + getWidth() + "," + getHeight() + ","
+ getBpp());
}
if (raw.length != getWidth() * getHeight() * getBpp())
{
throw new IllegalArgumentException(
"raw.length != width * height * bpp, raw.length="
+ raw.length + " w,h,bpp=" + getWidth() + ","
+ getHeight() + "," + getBpp());
}
}
|
public void decode(byte[] src,
byte[] dest) {
checkBufsiz(src, dest);
int bpl = getWidth() * getBpp();
int srcDy = bpl + 1;
for (int y = 0; y < getHeight(); y++)
{
PredictorAlgorithm f = filter[src[y * srcDy]];
int srcOffset = y * srcDy + 1;
f.decodeLine(src, dest, srcDy, srcOffset, bpl, y * bpl);
}
}
|
public void decodeLine(byte[] src,
byte[] dest,
int srcDy,
int srcOffset,
int destDy,
int destOffset) {
throw new UnsupportedOperationException("decodeLine");
}
|
public void encode(byte[] src,
byte[] dest) {
checkBufsiz(dest, src);
throw new UnsupportedOperationException("encode");
}
|
public void encodeLine(byte[] src,
byte[] dest,
int srcDy,
int srcOffset,
int destDy,
int destOffset) {
throw new UnsupportedOperationException("encodeLine");
}
|
public void setBpp(int bpp) {
super.setBpp(bpp);
for (int i = 0; i < filter.length; i++)
{
filter[i].setBpp(bpp);
}
}
|
public void setHeight(int height) {
super.setHeight(height);
for (int i = 0; i < filter.length; i++)
{
filter[i].setHeight(height);
}
}
|
public void setWidth(int width) {
super.setWidth(width);
for (int i = 0; i < filter.length; i++)
{
filter[i].setWidth(width);
}
}
|