Just wanted to add my info on a similar topic. I ended up just building libTiff from the latest (4.0.3) source. My project is all in x64, but it was pretty easy:
- Download and unzip libTIFF source
- Open the VS2010 (or whatever) for x64 (or x32) cmd
- cd to your unzipped folder from step 1
- type: nmake /f makefile.vc
- Fetch the files from /libtiff folder and add to your project
Here's an example of reading 16-bit TIFF data:
TIFF *MultiPageTiff = TIFFOpen("C:\\MultiPageTiff.tif", "r");
std::vector<unsigned short*> SimulatedQueue;
//Read First TIFF to setup the Buffers and init
//everything
int Width, Height;
//Bit depth, in bits
unsigned short depth;
TIFFGetField(MultiPageTiff, TIFFTAG_IMAGEWIDTH, &Width);
TIFFGetField(MultiPageTiff, TIFFTAG_IMAGELENGTH, &Height);
TIFFGetField(MultiPageTiff, TIFFTAG_BITSPERSAMPLE, &depth);
//This should be Width*(depth / sizeof(char))
tsize_t ScanlineSizeBytes = TIFFScanlineSize(MultiPageTiff);
if(MultiPageTiff){
int dircount = 0;
do{
dircount++;
//I'm going to be QQueue'ing these up, so a buffer needs to be
//allocated per new TIFF page
unsigned short *Buffer = new unsigned short[Width*Height];
//Copy all the scan lines
for(int Row = 0; Row < Height; Row++){
TIFFReadScanline(MultiPageTiff, &Buffer[Row*Width], Row, 0);
}
SimulatedQueue.push_back(Buffer);
}while(TIFFReadDirectory(MultiPageTiff));
TIFFClose(MultiPageTiff);
}
Sources:
Building libTIFF from VS - http://www.remotesensing.org/libtiff/build.html#PC
Example MultiPage TIFF - http://www.remotesensing.org/libtiff/libtiff.html
Misc. Tiff Manuals - http://www.remotesensing.org/libtiff/man/