Staging
v0.5.1
https://github.com/python/cpython
Revision 1109fbca76d08bb2f11f2899580d2ab7dbe796fa authored by Guido van Rossum on 10 April 1998, 22:16:39 UTC, committed by Guido van Rossum on 10 April 1998, 22:16:39 UTC
1 parent bb3649e
Raw File
Tip revision: 1109fbca76d08bb2f11f2899580d2ab7dbe796fa authored by Guido van Rossum on 10 April 1998, 22:16:39 UTC
Make new gcc -Wall happy
Tip revision: 1109fbc
librgbimg.tex
\section{Built-in Module \module{rgbimg}}
\label{module-rgbimg}
\bimodindex{rgbimg}

The \module{rgbimg} module allows Python programs to access SGI imglib image
files (also known as \file{.rgb} files).  The module is far from
complete, but is provided anyway since the functionality that there is
enough in some cases.  Currently, colormap files are not supported.

The module defines the following variables and functions:

\begin{excdesc}{error}
This exception is raised on all errors, such as unsupported file type, etc.
\end{excdesc}

\begin{funcdesc}{sizeofimage}{file}
This function returns a tuple \code{(\var{x}, \var{y})} where
\var{x} and \var{y} are the size of the image in pixels.
Only 4 byte RGBA pixels, 3 byte RGB pixels, and 1 byte greyscale pixels
are currently supported.
\end{funcdesc}

\begin{funcdesc}{longimagedata}{file}
This function reads and decodes the image on the specified file, and
returns it as a Python string. The string has 4 byte RGBA pixels.
The bottom left pixel is the first in
the string. This format is suitable to pass to \function{gl.lrectwrite()},
for instance.
\end{funcdesc}

\begin{funcdesc}{longstoimage}{data, x, y, z, file}
This function writes the RGBA data in \var{data} to image
file \var{file}. \var{x} and \var{y} give the size of the image.
\var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the
saved image should be 3 byte RGB data, or 4 if the saved images should
be 4 byte RGBA data.  The input data always contains 4 bytes per pixel.
These are the formats returned by \function{gl.lrectread()}.
\end{funcdesc}

\begin{funcdesc}{ttob}{flag}
This function sets a global flag which defines whether the scan lines
of the image are read or written from bottom to top (flag is zero,
compatible with SGI GL) or from top to bottom(flag is one,
compatible with X)\@.  The default is zero.
\end{funcdesc}
back to top