2012.01.04 15:24 "Re: [Tiff] reading rgb values from 16 bits tif images", by Bob Friesenhahn
Thanks for your suggestions on the high-level libraries. At the beginning, I was thniking to use Magick++ for my application, but it seemed to me that it was going to be more faster to integrate the libtiff library into my code, also due to time constraints. If you have any illustrations on how to use libtiff for 16bits images, it will be great or if you also have some good webpointers where I could get more information? I found a very illustrative webpage on how to use libtiff (http://bitmiracle.com/libtiff/help/samples.aspx), but it was mainly for C#, and I'm currently working with C++.
It makes a huge difference if you plan to accept arbitrary TIFF files written by some other software or if you only plan to accept a very limited set of TIFF formats. If the former, then you should expect to do quite a lot of development (e.g. weeks, months).
You can use TIFFReadRGBAStrip() to access strip-oriented files or TIFFReadTile() for tile-oriented files. These interfaces provide "raw" decompressed + native-endian-swapped pixel sample data. The swapping to native endian is only done if the sample bits are evenly divisible by 8 (e.g. 16-bit "short" is swapped to native format).
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/