private byte[] decode(PNGInputStream bytes) throws FormatException, IOException { return decode(bytes, getSizeX(), getSizeY()); }
private byte[] decode(PNGInputStream bytes) throws FormatException, IOException { return decode(bytes, getSizeX(), getSizeY()); }
decodeHeight += 8 - (decodeHeight % 8); lastImage = decode(stream, getSizeX(), decodeHeight); int plane = getSizeX() * getSizeY() * bpp; int newPlane = len * coords[3]; if (!isInterleaved()) { for (int row=0; row<coords[3]; row++) { System.arraycopy(newImage, c * newPlane + row * len, lastImage, c * plane + (coords[1] + row) * getSizeX() * bpp + coords[0] * bpp, len); for (int row=0; row<coords[3]; row++) { System.arraycopy(newImage, row * len, lastImage, (coords[1] + row) * getSizeX() * bpp * getRGBChannelCount() + coords[0] * bpp * getRGBChannelCount(), len);
decodeHeight += 8 - (decodeHeight % 8); lastImage = decode(stream, getSizeX(), decodeHeight); int plane = getSizeX() * getSizeY() * bpp; int newPlane = len * coords[3]; if (!isInterleaved()) { for (int row=0; row<coords[3]; row++) { System.arraycopy(newImage, c * newPlane + row * len, lastImage, c * plane + (coords[1] + row) * getSizeX() * bpp + coords[0] * bpp, len); for (int row=0; row<coords[3]; row++) { System.arraycopy(newImage, row * len, lastImage, (coords[1] + row) * getSizeX() * bpp * getRGBChannelCount() + coords[0] * bpp * getRGBChannelCount(), len);
int nColBlocks = getSizeX() / 8; nRowBlocks++; if (8 * nColBlocks != getSizeX()) { nColBlocks++; int extraCols = getSizeX() - (nColBlocks - 1) * 8; switch (extraCols) { case 1: byte[] expandedImage = new byte[FormatTools.getPlaneSize(this)]; try (RandomAccessInputStream bits = new RandomAccessInputStream(image)) { int skipBits = rowLen * 8 - getSizeX() * getBitsPerPixel(); for (int row=0; row<getSizeY(); row++) { for (int col=0; col<getSizeX(); col++) { int index = row * getSizeX() + col; expandedImage[index] = (byte) (bits.readBits(getBitsPerPixel()) & 0xff);
int nColBlocks = getSizeX() / 8; nRowBlocks++; if (8 * nColBlocks != getSizeX()) { nColBlocks++; int extraCols = getSizeX() - (nColBlocks - 1) * 8; switch (extraCols) { case 1: byte[] expandedImage = new byte[FormatTools.getPlaneSize(this)]; try (RandomAccessInputStream bits = new RandomAccessInputStream(image)) { int skipBits = rowLen * 8 - getSizeX() * getBitsPerPixel(); for (int row=0; row<getSizeY(); row++) { for (int col=0; col<getSizeX(); col++) { int index = row * getSizeX() + col; expandedImage[index] = (byte) (bits.readBits(getBitsPerPixel()) & 0xff);