static void start_input_pass (jpeg_decompress_struct cinfo) { per_scan_setup(cinfo); latch_quant_tables(cinfo); cinfo.entropy.start_pass(cinfo); cinfo.coef.start_input_pass (cinfo); cinfo.inputctl.consume_input = COEF_CONSUME_INPUT; }
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
private void assertBlockAtEnd() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining > 0) stream.error(); } else if (copyBytesRemaining > 0 || (huffmanTables.getNextLiteralValue(stream) != END_OF_COMPRESSED_BLOCK)) { stream.error(); } } void assertCompressedDataAtEnd() throws IOException {
byte getNextByte() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining == 0) { readNextBlockHeader(); return getNextByte(); } uncompressedBytesRemaining--; return stream.getNextIdatByte(); } else { return getNextCompressedByte(); } }
PngDecodingDataStream(InputStream stream) throws IOException { super(); this.stream = stream; nextBitIndex = MAX_BIT + 1; adlerValue = 1; lzBlockReader = new PngLzBlockReader(this); readCompressedDataHeader(); lzBlockReader.readNextBlockHeader(); }
@Override boolean isFileFormat(LEDataInputStream stream) { try { JPEGStartOfImage soi = new JPEGStartOfImage(stream); stream.unread(soi.reference); return soi.verify(); // we no longer check for appN } catch (Exception e) { return false; } } boolean isZeroInColumn(int[] dataUnit, int col) {
static void jinit_master_decompress (jpeg_decompress_struct cinfo) { jpeg_decomp_master master = new jpeg_decomp_master(); cinfo.master = master; // master.prepare_for_output_pass = prepare_for_output_pass; // master.finish_output_pass = finish_output_pass; master.is_dummy_pass = false; master_selection(cinfo); }
@Override public int read() throws IOException { byte nextDecodedByte = lzBlockReader.getNextByte(); updateAdler(nextDecodedByte); return nextDecodedByte & 0xFF; }
byte getNextByte() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining == 0) { readNextBlockHeader(); return getNextByte(); } uncompressedBytesRemaining--; return stream.getNextIdatByte(); } else { return getNextCompressedByte(); } }
/** * 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()); } /**
private void assertBlockAtEnd() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining > 0) stream.error(); } else if (copyBytesRemaining > 0 || (huffmanTables.getNextLiteralValue(stream) != END_OF_COMPRESSED_BLOCK)) { stream.error(); } } void assertCompressedDataAtEnd() throws IOException {
static void jinit_master_decompress (jpeg_decompress_struct cinfo) { jpeg_decomp_master master = new jpeg_decomp_master(); cinfo.master = master; // master.prepare_for_output_pass = prepare_for_output_pass; // master.finish_output_pass = finish_output_pass; master.is_dummy_pass = false; master_selection(cinfo); }
@Override public int read() throws IOException { byte nextDecodedByte = lzBlockReader.getNextByte(); updateAdler(nextDecodedByte); return nextDecodedByte & 0xFF; }
byte getNextByte() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining == 0) { readNextBlockHeader(); return getNextByte(); } uncompressedBytesRemaining--; return stream.getNextIdatByte(); } else { return getNextCompressedByte(); } }
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
private void assertBlockAtEnd() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining > 0) stream.error(); } else if (copyBytesRemaining > 0 || (huffmanTables.getNextLiteralValue(stream) != END_OF_COMPRESSED_BLOCK)) { stream.error(); } } void assertCompressedDataAtEnd() throws IOException {
static void jinit_master_decompress (jpeg_decompress_struct cinfo) { jpeg_decomp_master master = new jpeg_decomp_master(); cinfo.master = master; // master.prepare_for_output_pass = prepare_for_output_pass; // master.finish_output_pass = finish_output_pass; master.is_dummy_pass = false; master_selection(cinfo); }
/** * Answer the number of bytes in a word-aligned row of pixel data. */ int getAlignedBytesPerRow() { return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4; } /**
private void assertBlockAtEnd() throws IOException { if (compressionType == UNCOMPRESSED) { if (uncompressedBytesRemaining > 0) stream.error(); } else if (copyBytesRemaining > 0 || (huffmanTables.getNextLiteralValue(stream) != END_OF_COMPRESSED_BLOCK)) { stream.error(); } } void assertCompressedDataAtEnd() throws IOException {
/** * 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()); } /**