summaryrefslogtreecommitdiffstats
path: root/Doc/lib/librgbimg.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-01-02 01:22:07 (GMT)
committerGuido van Rossum <guido@python.org>1994-01-02 01:22:07 (GMT)
commit5fdeeeae2a12b9956cc84d62eae82f72cabc8664 (patch)
treeac0053479e10099850c8e0d06e31cb3afbf632bb /Doc/lib/librgbimg.tex
parent0b0719866e8a32d0a787e73bca9e79df1d1a74f8 (diff)
downloadcpython-5fdeeeae2a12b9956cc84d62eae82f72cabc8664.zip
cpython-5fdeeeae2a12b9956cc84d62eae82f72cabc8664.tar.gz
cpython-5fdeeeae2a12b9956cc84d62eae82f72cabc8664.tar.bz2
Restructured library documentation
Diffstat (limited to 'Doc/lib/librgbimg.tex')
-rw-r--r--Doc/lib/librgbimg.tex45
1 files changed, 45 insertions, 0 deletions
diff --git a/Doc/lib/librgbimg.tex b/Doc/lib/librgbimg.tex
new file mode 100644
index 0000000..367851b
--- /dev/null
+++ b/Doc/lib/librgbimg.tex
@@ -0,0 +1,45 @@
+\section{Built-in module \sectcode{rgbimg}}
+\bimodindex{rgbimg}
+
+The 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
+is enough in some cases. Currently, colormap files are not supported.
+
+The module defines the following variables and functions:
+
+\renewcommand{\indexsubitem}{(in module rgbimg)}
+\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 \code{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 \code{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}