Each row is read as an {@link ImageLineInt} object (one int per sample), but this can be changed by setting a different ImageLineFactory
Internally, this wraps a {@link ChunkSeqReaderPng} with a {@link BufferedStreamFeeder}
The reading sequence is as follows:
1. At construction time, the header and IHDR chunk are read (basic image info)
2. Afterwards you can set some additional global options. Eg. {@link #setCrcCheckDisabled()}.
3. Optional: If you call getMetadata() or getChunksLisk() before start reading the rows, all the chunks before IDAT are then loaded and available
4a. The rows are read in order by calling {@link #readRow()}. You can also call {@link #readRow(int)} to skip rows -but you can't go backwards, at least not with thisimplementation. This method returns a {@link IImageLine} object which can be casted to the concrete class. This class returns by default a {@link ImageLineInt}, but this can be changed.
4b. Alternatively, you can read all rows, or a subset, in a single call: {@link #readRows()}, {@link #readRows(int,int,int)} ,etc. In general this consumes more memory, butfor interlaced images this is equally efficient, and more so if reading a small subset of rows.
5. Reading of the last row automatically loads the trailing chunks, and ends the reader.
6. end() also loads the trailing chunks, if not done, and finishes cleanly the reading and closes the stream.
See also {@link PngReaderInt} (esentially the same as this, and slightly preferred) and {@link PngReaderByte} (uses byte instead of int to store the samples).
|
|