AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2007.07.27 07:13 "[Tiff] Scanline-Interface", by Oliver Geisen
2007.08.22 06:19 "[Tiff] Get random lines using TIFFReadScanline()", by Oliver Geisen

2007.08.22 06:19 "[Tiff] Get random lines using TIFFReadScanline()", by Oliver Geisen

Hello,

as far as i know the function can only handle subsequent lines (no random access).

The API of this function is not very good, because it implies some random access to the programmer by using the 'row' property. Maybe it would be better this way:

   TIFFReadFirstScanline()
   TIFFReadNextScanline()

Here is a way to provide random access for TIFFReadScanline:

     strip = (row / rps); // points to 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