Received: by whizzer.wpd.sgi.com (921026.SGI.NOSTRIP/911001.SGI)
	 id AA04421; Tue, 17 Aug 93 00:07:06 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (921026.SGI.NOSTRIP/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA04414; Mon, 16 Aug 93 17:07:03 -0700
Received: from relay.sgi.com by sgi.sgi.com via SMTP (920330.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA05200; Mon, 16 Aug 93 17:07:00 -0700
Received: from giraffe.asd.sgi.com by relay.sgi.com via SMTP (920330.SGI/920502.SGI)
	for tiff@sgi.sgi.com id AA28656; Mon, 16 Aug 93 17:06:58 -0700
Received: from flake.asd.sgi.com by giraffe.asd.sgi.com via SMTP (920330.SGI/920502.SGI)
	for tiff@sgi.sgi.com id AA15585; Mon, 16 Aug 93 17:06:57 -0700
Received: from localhost.asd.sgi.com by flake.asd.sgi.com via SMTP (920330.SGI/911001.SGI)
	for @giraffe.asd.sgi.com:tiff@sgi.sgi.com id AA16248; Mon, 16 Aug 93 17:06:57 -0700
Message-Id: <9308170006.AA16248@flake.asd.sgi.com>
To: tiff@sgi.sgi.com
Subject: byte swapping 16- and 32-bit data
Date: Mon, 16 Aug 93 17:06:56 PDT
From: sam@flake.asd.sgi.com
Sender: tiff-owner@sgi.sgi.com

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





