2010.09.08 18:00 "[Tiff] broken interface for TIFFTAG_SMINSAMPLEVALUE", by Olivier Paquet

2010.09.08 20:13 "Re: [Tiff] broken interface for TIFFTAG_SMINSAMPLEVALUE", by Bob Friesenhahn

Breaking the interface seems like a bad idea. certainly cause my  It would

own software to malfunction.

Ok. Out of curiosity, do you have a use for which a single value for all channels is fine? Are you dealing with single channel images?

These tags are just a usage 'hint'. If there are three channels, then I simply specify values which represent the maximum range (e.g. 0.0 to 1.0) when considering all three channels. The values set are not evaluated by finding the actual max/min of the data. Except for scientific applications, knowing the normal range of the data may be more useful than knowing the actual range since usually the channels are related to each other.

Perhaps it is better to add new functions which support access to channel-specific tags?

That would be another way of doing it. Would you have duplicates of all of TIFFGetField, TIFFVGetField, TIFFSetField and TIFFVSetField? If so, should the new functions handle the tag as an array or have a 'channel' parameter to specify for which channel the value is set/read?

A channel parameter seems best.

In the more hackish category, we could also have a flag which we'd or with the tag number to tell libtiff we want it per-channel. Something like TIFFGetField( tif, TIFFTAG_SMINSAMPLEVALUE,... ) for the old behavior and TIFFGetField( tif, TIFFTAG_SMINSAMPLEVALUE | TIFFTAG_PERSAMPLE,... ) to get the tag as an array of SamplesPerPixel values. This would seem to be the least disruptive option but it introduces a new meaning for the tag parameter (we have tags and pseudo tags but nothing which gets or'ed together AFAIK).

This may be least disruptive for existing users, but perhaps not in libtiff.

Note that specifying per channel values won't make them available to the 99.999% of the world which won't expect or use them.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/