# [Python-checkins] python/dist/src/Doc/lib libimageop.tex,1.12,1.13

sjoerd at users.sourceforge.net sjoerd at users.sourceforge.net
Sat Jan 10 15:43:45 EST 2004

Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv5552/Doc/lib

Modified Files:
libimageop.tex
Log Message:
The format of the string data used in the imageop module is described
as "This is the same format as used by gl.lrectwrite() and the imgfile
module."  This implies a certain byte order in multi-byte pixel
formats.  However, the code was originally written on an SGI
(big-endian) and *uses* the fact that bytes are stored in a particular
order in ints.  This means that the code uses and produces different
byte order on little-endian systems.

This fix adds a module-level flag "backward_compatible" (default not
set, and if not set, behaves as if set to 1--i.e. backward compatible)
that can be used on a little-endian system to use the same byte order
as the SGI.  Using this flag it is then possible to prepare
SGI-compatible images on a little-endian system.

This patch is the result of a (small) discussion on python-dev and was
submitted to SourceForge as patch #874358.

Index: libimageop.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libimageop.tex,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** libimageop.tex	16 Jul 2000 19:01:09 -0000	1.12
--- libimageop.tex	10 Jan 2004 20:43:43 -0000	1.13
***************
*** 87,88 ****
--- 87,100 ----
Convert a 2-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc}
+
+ If set to 0, the functions in this module use a non-backward
+ compatible way of representing multi-byte pixels on little-endian
+ systems.  The SGI for which this module was originally written is a
+ big-endian system, so setting this variable will have no effect.
+ However, the code wasn't originally intended to run on anything else,
+ so it made assumptions about byte order which are not universal.
+ Setting this variable to 0 will cause the byte order to be reversed on
+ little-endian systems, so that it then is the same as on big-endian
+ systems.