AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1993.08.17 00:06 "byte swapping 16- and 32-bit data", by Sam Leffler
1993.08.17 13:32 "Re: byte swapping 16- and 32-bit data", by Gaile G. Gordon
1993.08.17 13:54 "Re: byte swapping 16- and 32-bit data", by Quincey Koziol
1993.08.17 14:55 "Re: byte swapping 16- and 32-bit data", by Sam Leffler
1993.08.17 16:51 "Re: byte swapping 16- and 32-bit data", by Dan McCoy
1993.08.17 18:19 "Re: byte swapping 16- and 32-bit data", by Sam Leffler
1993.08.17 19:44 "Re: byte swapping 16- and 32-bit data", by Rick Richardson
1993.08.17 19:29 "Re: byte swapping 16- and 32-bit data", by Dan McCoy
1993.08.18 01:57 "Re: byte swapping 16- and 32-bit data", by Craig Hockenberry
1993.08.18 17:57 "Re: byte swapping 16- and 32-bit data", by Dan McCoy
1993.08.18 19:11 "Re: byte swapping 16- and 32-bit data", by Sam Leffler
1993.08.17 20:45 "Re: byte swapping 16- and 32-bit data", by Richard Minner

1993.08.17 00:06 "byte swapping 16- and 32-bit data", by Sam Leffler

I'm preparing a 3.3beta distribution and ran across an old design decision that I don't like (someone talked me into it, but I now regret it). When reading data either as scanlines, tiles, or strips, if the data is not compressed and has samples >8 bits, the library currently does the appropriate work to byte swap the data. This is non-orthogonal; an application must still check if the data is encoded with a compression algorithm other than 1 and handle byte swapping for samples >8 bits.

I've added a call TIFFIsByteSwapped that lets apps find out if >8-bit data needs to be byte swapped. I'd like to change the library so that the no compression decoding and encoding routines no longer byte swap data.

Anyone have a problem with my doing this? It will mean that some folks will need to change some code.

BTW, I don't plan to add this byte-swapping into the library because my experience indicates this is a mistake--byte swapping can almost always be combined with some other operation and so amortize the cost. If the swapping is done in the library then it's a fixed cost that can't be amortized.

Sam