Boost logo

Boost :

Subject: Re: [boost] [gil::io] Feedback for scanline_read_iterator
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-02-24 20:17:38


On 24 February 2013 21:07, Christian Henning <chhenning_at_[hidden]> wrote:
>>> Skipping can be different for different formats. jpeg for instance
>>> still reads the scanline when skipping. For now, I think, we are good.
>>>
>>
>> Sure that makes sense, but the interface lies IMO. If I have jpeg and I call
>> skip( buffer, 0 ) it's not going to be skipping over scanline 0 (unless it
>> happens to be the first call to read/skip), it's just skipping forward one
>> scanline, the second parameter is unused.
>>
>> Similarly the TIFF reader seems to read skipped scanlines unnecessarily as skip
>> forwards to read but the TIFF interface supports reading any scanline you want
>> directly with TIFFReadScanline.
>
> As far as I can tell tiff needs the row number to be read and also
> tiff rows cannot be read in random order.

It's not precise, because rows of some TIFFs can be accessed in random order.
The spec confirms that too:

"random access to individual scanlines can only be provided when data
is not stored in a compressed
format, or when the number of rows in a strip of image data is set to
one (RowsPerStrip is one)."

http://www.remotesensing.org/libtiff/libtiff.html

Best regards,

--
Mateusz Loskot, http://mateusz.loskot.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk