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
December 2005

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!



Thread

2005.12.07 14:17 "Read TIFF at specific point with specific dimensions", by Manuel D Lago Reguera
2005.12.08 09:22 "Re: Read TIFF at specific point with specific dimensions", by Andrey Kiselev

2005.12.08 09:22 "Re: Read TIFF at specific point with specific dimensions", by Andrey Kiselev

Manuel,

On Wed, Dec 07, 2005 at 03:17:05PM +0100, Manuel D. Lago Reguera wrote:
> Hello, I am new in this and I would like to know if exists some function
> to read a fragment of a TIFF in the way read(x, y, w, h).
> I've to work with big images (minimun 300MB) and it's too expensive to have
> all the image loaded in memory.
> With a function read(x, y, w, h) I could work with the block of interest.

There is no such a function in libtiff. But you don't need to read the
whole image into memory to process it, TIFF image tipically stored in
data chunks (strips or tiles), so you should read one chunk per time.
TIFFComputeStrip() and TIFFComputeTile() functions return strip/tile
number for specified coordinates and you should use that number in
TIFFReadEncodedStrip()/TIFFReadTile() functions respectively.

Probably you may find GDAL library (http://www.gdal.org) useful for
your task. GDAL has flexible API which is one level higher than libtiff
API. With GDAL you can get access to pixels without bothering with
actual data layout.

Best regards,
Andrey

-- 
Andrey V. Kiselev
Home phone:  +7 812 5970603  ICQ# 26871517