diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 2004-01-10 20:43:43 (GMT) |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 2004-01-10 20:43:43 (GMT) |
commit | 7e6bbe15162b7307174645e9c4eb2809931b1800 (patch) | |
tree | ea1875e446bad683581ee95c3ac11c81befcb2eb /Doc/lib/libimageop.tex | |
parent | 2e5e6445e7ab0c025061b13462cccf9321a4fa3e (diff) | |
download | cpython-7e6bbe15162b7307174645e9c4eb2809931b1800.zip cpython-7e6bbe15162b7307174645e9c4eb2809931b1800.tar.gz cpython-7e6bbe15162b7307174645e9c4eb2809931b1800.tar.bz2 |
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.
Diffstat (limited to 'Doc/lib/libimageop.tex')
-rw-r--r-- | Doc/lib/libimageop.tex | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/lib/libimageop.tex b/Doc/lib/libimageop.tex index 0f611e7..27ed056 100644 --- a/Doc/lib/libimageop.tex +++ b/Doc/lib/libimageop.tex @@ -86,3 +86,15 @@ Convert a 4-bit greyscale image to an 8-bit greyscale image. \begin{funcdesc}{grey22grey}{image, width, height} Convert a 2-bit greyscale image to an 8-bit greyscale image. \end{funcdesc} + +\begin{datadesc}{backward_compatible} +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. +\end{datadesc} |