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 20:45 "Re: byte swapping 16- and 32-bit data", by Richard Minner

(Oh boy, design by committee, what fun! I'll bet Sam is thrilled. ;-)

Here's my proposal:

Libtiff provides swabbing for >8-bit samples, but not un-avoidably. Libtiff already provides a number of ways of reading pixel data; I suggest providing the following behaviors, with two new trivial routines:

Do swab:
        TIFFReadRGBAImage()             should always swab, even now
        TIFFReadScanline()              "fix" to always swab
        TIFFReadEncodedStrip()          ditto
        TIFFReadEncodedTile()           ditto
        TIFFReadTile()                  ditto

Don't swab:
        TIFFReadRawStrip()              as always, "raw bytes"
        TIFFReadRawTile()               ditto
  new   TIFFReadEncodedStripNoSwab()    decode without swab
  new   TIFFReadEncodedTileNoSwab()     ditto
? new   TIFFReadTileNoSwab()            (not really needed)

This just involves renaming TIFFReadEncoded*() to

TIFFReadEncoded*NoSwab() and providing TIFFReadEncoded*()

as simple wrappers that do the swabbing no done only in tif_dumpmode.c:DumpModeDecode(). I probably wouldn't bother providing TIFFReadTileNoSwab() since swab-avoiding clients can just use TIFFReadEncodedTileNoSwab() with little added overhead.

[Note: any direct replies use rtm@island.com explicitly; my return address is likely to be bogus.]

--

Richard Minner  rtm@island.com  {uunet,sun,well}!island!rtm
Island Graphics Corporation  Sacramento, CA  (916) 736-1323