AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2011.12.22 00:50 "[Tiff] Announcing Libtiff 4.0.0", by Bob Friesenhahn
2012.01.05 09:12 "Re: [Tiff] reading rgb values from 16 bits tif images", by Martin Alegre
2012.01.04 10:54 "[Tiff] reading rgb values from 16 bits tif images", by Martin Alegre
2012.01.04 12:37 "Re: [Tiff] reading rgb values from 16 bits tif images", by mikk
2012.01.04 14:07 "Re: [Tiff] reading rgb values from 16 bits tif images", by Olivier Paquet
2012.01.04 14:55 "Re: [Tiff] reading rgb values from 16 bits tif images", by Martin Alegre
2012.01.04 15:08 "Re: [Tiff] reading rgb values from 16 bits tif images", by Olivier Paquet
2012.01.04 14:42 "Re: [Tiff] reading rgb values from 16 bits tif images", by Bob Friesenhahn
2012.01.04 15:02 "Re: [Tiff] reading rgb values from 16 bits tif images", by Martin Alegre
2012.01.04 15:24 "Re: [Tiff] reading rgb values from 16 bits tif images", by Bob Friesenhahn

2012.01.04 15:08 "Re: [Tiff] reading rgb values from 16 bits tif images", by Olivier Paquet

On Wed, Jan 4, 2012 at 9:55 AM, Martin Alegre <tin.alegre@gmail.com> wrote: > More precisely, how to post-process the buffer (buff) after calling the > function TIFFReadScanline(tif, buf, row)?

> Do you mind in illustratiing how to use the TIFFReadScanline for such sort > of images?

The buffer is raw image data. If your data is 16-bit RGB then it *might* look something like this:

for(c = 0; c < imageWidth; c++)
{
  uint16 red = static_cast<uint16*>(buf)[c*nsamples+0];
  uint16 green = static_cast<uint16*>(buf)[c*nsamples+1];
  uint16 blue = static_cast<uint16*>(buf)[c*nsamples+2];
}

But this makes a lot of assumptions about how the TIFF is written and will only work on a subset of images. Unless you know the files to always have the same structure, you should definitely follow Bob's advice and use a higher level library.

Olivier