comparison dwt/internal/image/PNGFileFormat.d @ 6:b903c16b6f48

Removed throws decls
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:10:03 +0200
parents 380af2bdd8e5
children e831403a80a9
comparison
equal deleted inserted replaced
5:1a8b3cb347e0 6:b903c16b6f48
35 35
36 /** 36 /**
37 * Skip over signature data. This has already been 37 * Skip over signature data. This has already been
38 * verified in isFileFormat(). 38 * verified in isFileFormat().
39 */ 39 */
40 void readSignature() throws IOException { 40 void readSignature() {
41 byte[] signature = new byte[SIGNATURE_LENGTH]; 41 byte[] signature = new byte[SIGNATURE_LENGTH];
42 inputStream.read(signature); 42 inputStream.read(signature);
43 } 43 }
44 /** 44 /**
45 * Load the PNG image from the byte stream. 45 * Load the PNG image from the byte stream.
88 } 88 }
89 /** 89 /**
90 * Read and handle the next chunk of data from the 90 * Read and handle the next chunk of data from the
91 * PNG file. 91 * PNG file.
92 */ 92 */
93 void readNextChunk(PngChunkReader chunkReader) throws IOException { 93 void readNextChunk(PngChunkReader chunkReader) {
94 PngChunk chunk = chunkReader.readNextChunk(); 94 PngChunk chunk = chunkReader.readNextChunk();
95 switch (chunk.getChunkType()) { 95 switch (chunk.getChunkType()) {
96 case PngChunk.CHUNK_IEND: 96 case PngChunk.CHUNK_IEND:
97 break; 97 break;
98 case PngChunk.CHUNK_PLTE: 98 case PngChunk.CHUNK_PLTE:
291 } 291 }
292 /** 292 /**
293 * Read the image data from the data stream. This must handle 293 * Read the image data from the data stream. This must handle
294 * decoding the data, filtering, and interlacing. 294 * decoding the data, filtering, and interlacing.
295 */ 295 */
296 void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) throws IOException { 296 void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) {
297 InputStream stream = new PngInputStream(chunk, chunkReader); 297 InputStream stream = new PngInputStream(chunk, chunkReader);
298 //TEMPORARY CODE 298 //TEMPORARY CODE
299 bool use3_2 = System.getProperty("dwt.internal.image.PNGFileFormat_3.2") !is null; 299 bool use3_2 = System.getProperty("dwt.internal.image.PNGFileFormat_3.2") !is null;
300 InputStream inflaterStream = use3_2 ? null : Compatibility.newInflaterInputStream(stream); 300 InputStream inflaterStream = use3_2 ? null : Compatibility.newInflaterInputStream(stream);
301 if (inflaterStream !is null) { 301 if (inflaterStream !is null) {
364 InputStream inputStream, 364 InputStream inputStream,
365 int rowInterval, 365 int rowInterval,
366 int columnInterval, 366 int columnInterval,
367 int startRow, 367 int startRow,
368 int startColumn, 368 int startColumn,
369 int frameCount) throws IOException 369 int frameCount)
370 { 370 {
371 int width = headerChunk.getWidth(); 371 int width = headerChunk.getWidth();
372 int alignedBytesPerRow = getAlignedBytesPerRow(); 372 int alignedBytesPerRow = getAlignedBytesPerRow();
373 int height = headerChunk.getHeight(); 373 int height = headerChunk.getHeight();
374 if (startRow >= height || startColumn >= width) return; 374 if (startRow >= height || startColumn >= width) return;
426 } 426 }
427 /** 427 /**
428 * Read the pixel data for an interlaced image from the 428 * Read the pixel data for an interlaced image from the
429 * data stream. 429 * data stream.
430 */ 430 */
431 void readInterlacedImage(InputStream inputStream) throws IOException { 431 void readInterlacedImage(InputStream inputStream) {
432 readInterlaceFrame(inputStream, 8, 8, 0, 0, 0); 432 readInterlaceFrame(inputStream, 8, 8, 0, 0, 0);
433 readInterlaceFrame(inputStream, 8, 8, 0, 4, 1); 433 readInterlaceFrame(inputStream, 8, 8, 0, 4, 1);
434 readInterlaceFrame(inputStream, 8, 4, 4, 0, 2); 434 readInterlaceFrame(inputStream, 8, 4, 4, 0, 2);
435 readInterlaceFrame(inputStream, 4, 4, 0, 2, 3); 435 readInterlaceFrame(inputStream, 4, 4, 0, 2, 3);
436 readInterlaceFrame(inputStream, 4, 2, 2, 0, 4); 436 readInterlaceFrame(inputStream, 4, 2, 2, 0, 4);
453 /** 453 /**
454 * Read the pixel data for a non-interlaced image from the 454 * Read the pixel data for a non-interlaced image from the
455 * data stream. 455 * data stream.
456 * Update the imageData to reflect the new data. 456 * Update the imageData to reflect the new data.
457 */ 457 */
458 void readNonInterlacedImage(InputStream inputStream) throws IOException { 458 void readNonInterlacedImage(InputStream inputStream) {
459 int dataOffset = 0; 459 int dataOffset = 0;
460 int alignedBytesPerRow = getAlignedBytesPerRow(); 460 int alignedBytesPerRow = getAlignedBytesPerRow();
461 int bytesPerRow = getBytesPerRow(); 461 int bytesPerRow = getBytesPerRow();
462 byte[] row1 = new byte[bytesPerRow]; 462 byte[] row1 = new byte[bytesPerRow];
463 byte[] row2 = new byte[bytesPerRow]; 463 byte[] row2 = new byte[bytesPerRow];