2010.09.08 19:43 "Re: [Tiff] broken interface for TIFFTAG_SMINSAMPLEVALUE", by Olivier Paquet
On Wed, Sep 8, 2010 at 3:06 PM, Bob Friesenhahn <firstname.lastname@example.org> wrote:
Does libtiff currently support any channel-specific tags (other than via duplication)? one reason or another this historically has seemed like a For bad thing.
Well there is TIFFTAG_REFERENCEBLACKWHITE but it is fixed to 3 channels so I guess it doesn't qualify. The few other channel-specific tags certainly seem to work through duplication/merging as well.
I propose changing the interface so TIFFSetField/TIFFGetField deal with the tags as arrays. This would of course quietly break the interface for any application which uses libtiff to read/write these tags. For this reason, I'd put the change in libtiff4 only. Any objections? Or better ideas?
Breaking the interface seems like a bad idea. would certainly cause my It 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?
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?
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).