2004.10.28 12:03 "[Tiff] why does tiffcp::cpSeparateBufToContigBuf takes BYTES_per_sample as parameter?", by Sachin Garg

2004.10.28 15:18 "Re: [Tiff] why does tiffcp::cpSeparateBufToContigBuf takes BYTES_per_sample as parameter?", by Sachin Garg

Also, is it that in a tiff, bits_per_sample can take only some valid values, or can any value be assigned/expected for this tag? (4, 8, 16, 24, 32 seem to be popular ones but are these the only valid values, or can I expect other values like 3, 6, 19 etc... too)

The bits_per_sample value can be almost any value. I have used libtiff with values ranging from 1 to 32 without problem. For example, 7 is a legitimate value. Most software only reads and writes 1 and powers of two, but TIFF files with bits_per_sample of 10 or 12 are in common use for some trades (e.g. to support medical/scientific CCD cameras).

Thanks Bob, this means that I should be expecting any bit-depth in a tiff image.

But I am confused (as mentioned in my original post) how tiffcp routines (cpSeparateBufToContigBuf and cpContigBufToSeparateBuf) handle all bit-depths, they seem to be byte oriented.

I want to use these routines on the buffers returned by readSeparateTilesIntoBuffer (and other similar tiffcp routines), will the above mentioned routines work on these buffers for all-possible bit depths?

Sachin Garg [India]
http://www.geocities.com/schngrg