AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
August 2007

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



2007.08.22 06:19 "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