AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

1994.03.08 16:46 "float or double TIFFs", by Frederic Devernay

I want to use TIFF to store float (single precision IEEE floating point) and double (double precision IEEE floating point) images. For this, I set the following TIFF fields (the values are not documented in TIFF 6.0 but seem to fit here):

for float images:
    TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 32);
    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);

for double images:
    TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 64);
    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);

is this the good way of doing this (the library doesn't complain, the only problem is: will I be able to exchange data)?

Fred