2007.07.27 07:13 "[Tiff] Scanline-Interface", by Oliver Geisen

2007.07.27 07:13 "[Tiff] Scanline-Interface", by Oliver Geisen

Hello,

as far as i know the function
   int TIFFReadScanline(TIFF *tif, tdata_t buf, uint32 row, tsample_t
sample)
can only handle subsequent lines (no random access).

If find this irritating because the the function name and the 'row'
param suggest that there may be an random access.

int TIFFReadNextScanline(TIFF *tif, tdata_t buf, tsample_t sample) would be more intuitive?!

What will happen if:

Maybe:

- TIFFReadScanline could random access lines, even if data is compressed using this algo:

     strip = (row / rps); // leads in the absolute strip (do -1 to
get an offset)
     stripsize = TIFFStripSize(tiff);
     TIFFReadEncodedStrip(tiff, strip, stripdata, stripsize);
     stripline = (row % rps); // get the line# inside the strip

     linesize = TIFFScanlineSize(tiff);  // get the size of one line
     offset = (stripline-1) * linesize;  // offset from stripdata to  

begin of line
     return (stripdata + offset); // return pointer to wanted line

Oliver Geisen
Systemadministrator
_____________________________
Kreisboten Verlag Mühlfellner KG
82362 Weilheim i. Ob.
Tel. 0881/686-904
Fax 0881/686-74
Sitz Weilheim, AG München, HRA 64016, p.h.G.:
Kreisboten-Verlag Verwaltungsgesellschaft mbH,
Weilheim, AG München, HRB 119773,
Geschäftsführer: Dr. Dirk Ippen, Dr. Gerd Waldenmaier