1998.06.10 15:00 "TIFFGetField syntax and use", by Steve Garcia

1998.06.10 15:00 "TIFFGetField syntax and use", by Steve Garcia

I want to retrieve the value of the tag's PHOTOMETRIC and BITSPERSAMPLE. I'm presuming that it is easiest to use the TIFFGetField function to do this, but I'm not having any real success. I'm using tiff-v3.4.

I'm not sure I understand the syntax of the function properly. My code (truncated for e-mail purposes) is as follows:

#include <tiffio.h>
int photo, bitspersample;

main ()
{
        TIFF *tif = TIFFOpen("myfile.tif", "r");
        TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, photo);
        TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, bitspersample);
        printf("Photo = %d, Bits/Sample = %d", photo, bitspersample);
        TIFFClose(tif);
}

Now I know I'm getting the memory address when I print out the "photo" and "bitspersample", yet I can't seem to retrieve the actual value that the Tags contain.

Any suggestions? First major C program I'm trying to write (still a novice at this) but I really like this programming stuff. Thanks for any suggestions!

Steve

    /\         /^\    Steven Garcia         Graduate School, Bioengineering
   /^^\       /^^^\   steveg@engin.umich.edu              Univ. of Michigan
  /    \/^\  /     \      
 /      \  \/       \                          
/        \  \        \                   "I AM the last one!" - Dragonheart