| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2005.12.08 09:22 "Re: Read TIFF at specific point with specific dimensions", by Andrey KiselevManuel, 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 |
|||||||