/** * Answer the number of bytes in each row of the image * data. Each PNG row is byte-aligned, so images with bit * depths less than a byte may have unused bits at the * end of each row. The value of these bits is undefined. */ int getBytesPerRow() { return getBytesPerRow(headerChunk.getWidth()); } /**
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
/** * Answer the number of bytes in each row of the image * data. Each PNG row is byte-aligned, so images with bit * depths less than a byte may have unused bits at the * end of each row. The value of these bits is undefined. */ int getBytesPerRow() { return getBytesPerRow(headerChunk.getWidth()); } /**
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
/** * Answer the number of bytes in each row of the image * data. Each PNG row is byte-aligned, so images with bit * depths less than a byte may have unused bits at the * end of each row. The value of these bits is undefined. */ int getBytesPerRow() { return getBytesPerRow(headerChunk.getWidth()); } /**
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
/** * Answer the number of bytes in each row of the image * data. Each PNG row is byte-aligned, so images with bit * depths less than a byte may have unused bits at the * end of each row. The value of these bits is undefined. */ int getBytesPerRow() { return getBytesPerRow(headerChunk.getWidth()); } /**
/** * Answer the number of bytes in each row of the image * data. Each PNG row is byte-aligned, so images with bit * depths less than a byte may have unused bits at the * end of each row. The value of these bits is undefined. */ int getBytesPerRow() { return getBytesPerRow(headerChunk.getWidth()); } /**
/** * Answer the number of bytes in each row of the image * data. Each PNG row is byte-aligned, so images with bit * depths less than a byte may have unused bits at the * end of each row. The value of these bits is undefined. */ int getBytesPerRow() { return getBytesPerRow(headerChunk.getWidth()); } /**
/** * Read the pixel data for a non-interlaced image from the * data stream. * Update the imageData to reflect the new data. */ void readNonInterlacedImage(InputStream inputStream) throws IOException { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow]; byte[] currentRow = row1; byte[] lastRow = row2; int height = headerChunk.getHeight(); for (int row = 0; row < height; row++) { byte filterType = (byte)inputStream.read(); int read = 0; while (read != bytesPerRow) { read += inputStream.read(currentRow, read, bytesPerRow - read); } filterRow(currentRow, lastRow, filterType); System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow); dataOffset += alignedBytesPerRow; currentRow = (currentRow == row1) ? row2 : row1; lastRow = (lastRow == row1) ? row2 : row1; } setImageDataValues(data, imageData); } /**
/** * Read the pixel data for a non-interlaced image from the * data stream. * Update the imageData to reflect the new data. */ void readNonInterlacedImage(InputStream inputStream) throws IOException { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow]; byte[] currentRow = row1; byte[] lastRow = row2; int height = headerChunk.getHeight(); for (int row = 0; row < height; row++) { byte filterType = (byte)inputStream.read(); int read = 0; while (read != bytesPerRow) { read += inputStream.read(currentRow, read, bytesPerRow - read); } filterRow(currentRow, lastRow, filterType); System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow); dataOffset += alignedBytesPerRow; currentRow = (currentRow == row1) ? row2 : row1; lastRow = (lastRow == row1) ? row2 : row1; } setImageDataValues(data, imageData); } /**
/** * Read the pixel data for a non-interlaced image from the * data stream. * Update the imageData to reflect the new data. */ void readNonInterlacedImage(InputStream inputStream) throws IOException { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow]; byte[] currentRow = row1; byte[] lastRow = row2; int height = headerChunk.getHeight(); for (int row = 0; row < height; row++) { byte filterType = (byte)inputStream.read(); int read = 0; while (read != bytesPerRow) { read += inputStream.read(currentRow, read, bytesPerRow - read); } filterRow(currentRow, lastRow, filterType); System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow); dataOffset += alignedBytesPerRow; currentRow = (currentRow == row1) ? row2 : row1; lastRow = (lastRow == row1) ? row2 : row1; } setImageDataValues(data, imageData); } /**
/** * Read the pixel data for a non-interlaced image from the * data stream. * Update the imageData to reflect the new data. */ void readNonInterlacedImage(InputStream inputStream) throws IOException { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow]; byte[] currentRow = row1; byte[] lastRow = row2; int height = headerChunk.getHeight(); for (int row = 0; row < height; row++) { byte filterType = (byte)inputStream.read(); int read = 0; while (read != bytesPerRow) { read += inputStream.read(currentRow, read, bytesPerRow - read); } filterRow(currentRow, lastRow, filterType); System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow); dataOffset += alignedBytesPerRow; currentRow = (currentRow == row1) ? row2 : row1; lastRow = (lastRow == row1) ? row2 : row1; } setImageDataValues(data, imageData); } /**
/** * Read the pixel data for a non-interlaced image from the * data stream. * Update the imageData to reflect the new data. */ void readNonInterlacedImage(InputStream inputStream) throws IOException { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow]; byte[] currentRow = row1; byte[] lastRow = row2; int height = headerChunk.getHeight(); for (int row = 0; row < height; row++) { byte filterType = (byte)inputStream.read(); int read = 0; while (read != bytesPerRow) { read += inputStream.read(currentRow, read, bytesPerRow - read); } filterRow(currentRow, lastRow, filterType); System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow); dataOffset += alignedBytesPerRow; currentRow = (currentRow == row1) ? row2 : row1; lastRow = (lastRow == row1) ? row2 : row1; } setImageDataValues(data, imageData); } /**
/** * Read the pixel data for a non-interlaced image from the * data stream. * Update the imageData to reflect the new data. */ void readNonInterlacedImage(InputStream inputStream) throws IOException { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow]; byte[] currentRow = row1; byte[] lastRow = row2; int height = headerChunk.getHeight(); for (int row = 0; row < height; row++) { byte filterType = (byte)inputStream.read(); int read = 0; while (read != bytesPerRow) { read += inputStream.read(currentRow, read, bytesPerRow - read); } filterRow(currentRow, lastRow, filterType); System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow); dataOffset += alignedBytesPerRow; currentRow = (currentRow == row1) ? row2 : row1; lastRow = (lastRow == row1) ? row2 : row1; } setImageDataValues(data, imageData); } /**
int bytesPerRow = getBytesPerRow(pixelsPerRow); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow];
int bytesPerRow = getBytesPerRow(pixelsPerRow); byte[] row1 = new byte[bytesPerRow]; byte[] row2 = new byte[bytesPerRow];