source: vendor/python/2.5/Doc/lib/librgbimg.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 2.2 KB
Line 
1\section{\module{rgbimg} ---
2 Read and write ``SGI RGB'' files}
3
4\declaremodule{builtin}{rgbimg}
5\modulesynopsis{Read and write image files in ``SGI RGB'' format (the module
6 is \emph{not} SGI specific though!).}
7
8\deprecated{2.5}{This module is not maintained anymore and seems to be
9 unused.}
10
11The \module{rgbimg} module allows Python programs to access SGI imglib image
12files (also known as \file{.rgb} files). The module is far from
13complete, but is provided anyway since the functionality that there is
14enough in some cases. Currently, colormap files are not supported.
15
16\note{This module is only built by default for 32-bit platforms; it is
17not expected to work properly on other systems.}
18
19The module defines the following variables and functions:
20
21\begin{excdesc}{error}
22This exception is raised on all errors, such as unsupported file type, etc.
23\end{excdesc}
24
25\begin{funcdesc}{sizeofimage}{file}
26This function returns a tuple \code{(\var{x}, \var{y})} where
27\var{x} and \var{y} are the size of the image in pixels.
28Only 4 byte RGBA pixels, 3 byte RGB pixels, and 1 byte greyscale pixels
29are currently supported.
30\end{funcdesc}
31
32\begin{funcdesc}{longimagedata}{file}
33This function reads and decodes the image on the specified file, and
34returns it as a Python string. The string has 4 byte RGBA pixels.
35The bottom left pixel is the first in
36the string. This format is suitable to pass to \function{gl.lrectwrite()},
37for instance.
38\end{funcdesc}
39
40\begin{funcdesc}{longstoimage}{data, x, y, z, file}
41This function writes the RGBA data in \var{data} to image
42file \var{file}. \var{x} and \var{y} give the size of the image.
43\var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the
44saved image should be 3 byte RGB data, or 4 if the saved images should
45be 4 byte RGBA data. The input data always contains 4 bytes per pixel.
46These are the formats returned by \function{gl.lrectread()}.
47\end{funcdesc}
48
49\begin{funcdesc}{ttob}{flag}
50This function sets a global flag which defines whether the scan lines
51of the image are read or written from bottom to top (flag is zero,
52compatible with SGI GL) or from top to bottom (flag is one,
53compatible with X). The default is zero.
54\end{funcdesc}
Note: See TracBrowser for help on using the repository browser.