Kaydet (Commit) 434493b2 authored tarafından Fred Drake's avatar Fred Drake

Logical markup.

Replace ugly {description} with a {tableii}, for the option descriptions.
üst a8912306
...@@ -2,51 +2,56 @@ ...@@ -2,51 +2,56 @@
\label{module-jpeg} \label{module-jpeg}
\bimodindex{jpeg} \bimodindex{jpeg}
The module \code{jpeg} provides access to the jpeg compressor and The module \module{jpeg} provides access to the jpeg compressor and
decompressor written by the Independent JPEG Group. JPEG is a (draft?)\ decompressor written by the Independent JPEG Group. JPEG is a (draft?)
standard for compressing pictures. For details on jpeg or the standard for compressing pictures. For details on jpeg or the
Independent JPEG Group software refer to the JPEG standard or the Independent JPEG Group software refer to the JPEG standard or the
documentation provided with the software. documentation provided with the software.
The \code{jpeg} module defines these functions: The \module{jpeg} module defines an exception and some functions.
\setindexsubitem{(in module jpeg)} \begin{excdesc}{error}
\begin{funcdesc}{compress}{data\, w\, h\, b} Exception raised by \function{compress()} and \function{decompress()}
Treat data as a pixmap of width \var{w} and height \var{h}, with \var{b} bytes per in case of errors.
pixel. The data is in SGI GL order, so the first pixel is in the \end{excdesc}
lower-left corner. This means that \code{lrectread} return data can
immediately be passed to compress. Currently only 1 byte and 4 byte \begin{funcdesc}{compress}{data, w, h, b}
pixels are allowed, the former being treated as greyscale and the Treat data as a pixmap of width \var{w} and height \var{h}, with
latter as RGB color. Compress returns a string that contains the \var{b} bytes per pixel. The data is in SGI GL order, so the first
compressed picture, in JFIF format. pixel is in the lower-left corner. This means that \code{gl.lrectread}
return data can immediately be passed to \function{compress()}.
Currently only 1 byte and 4 byte pixels are allowed, the former being
treated as greyscale and the latter as RGB color.
\function{compress()} returns a string that contains the compressed
picture, in JFIF format.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{decompress}{data} \begin{funcdesc}{decompress}{data}
Data is a string containing a picture in JFIF format. It returns a Data is a string containing a picture in JFIF format. It returns a
tuple tuple \code{(\var{data}, \var{width}, \var{height},
\code{(\var{data}, \var{width}, \var{height}, \var{bytesperpixel})}. \var{bytesperpixel})}. Again, the data is suitable to pass to
Again, the data is suitable to pass to \code{lrectwrite}. \code{gl.lrectwrite}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setoption}{name\, value} \begin{funcdesc}{setoption}{name, value}
Set various options. Subsequent compress and decompress calls Set various options. Subsequent \function{compress()} and
will use these options. The following options are available: \function{decompress()} calls will use these options. The following
\begin{description} options are available:
\item[\code{'forcegray' }]
Force output to be grayscale, even if input is RGB. \begin{tableii}{|l|l|}{code}{Option}{Effect}
\lineii{'forcegray'}{%
\item[\code{'quality' }] Force output to be grayscale, even if input is RGB.}
Set the quality of the compressed image to a \lineii{'quality'}{%
value between \code{0} and \code{100} (default is \code{75}). Compress only. Set the quality of the compressed image to a value between
\code{0} and \code{100} (default is \code{75}). \\
\item[\code{'optimize' }] &This only affects compression.}
Perform Huffman table optimization. Takes longer, but results in \lineii{'optimize'}{%
smaller compressed image. Compress only. Perform Huffman table optimization. Takes longer, but results in
smaller compressed \\
\item[\code{'smooth' }] &image. This only affects compression.}
Perform inter-block smoothing on uncompressed image. Only useful for \lineii{'smooth'}{%
low-quality images. Decompress only. Perform inter-block smoothing on uncompressed image. Only useful
\end{description} for low-quality \\
&images. This only affects decompression.}
\end{tableii}
\end{funcdesc} \end{funcdesc}
Compress and uncompress raise the error \code{jpeg.error} in case of errors.
...@@ -2,51 +2,56 @@ ...@@ -2,51 +2,56 @@
\label{module-jpeg} \label{module-jpeg}
\bimodindex{jpeg} \bimodindex{jpeg}
The module \code{jpeg} provides access to the jpeg compressor and The module \module{jpeg} provides access to the jpeg compressor and
decompressor written by the Independent JPEG Group. JPEG is a (draft?)\ decompressor written by the Independent JPEG Group. JPEG is a (draft?)
standard for compressing pictures. For details on jpeg or the standard for compressing pictures. For details on jpeg or the
Independent JPEG Group software refer to the JPEG standard or the Independent JPEG Group software refer to the JPEG standard or the
documentation provided with the software. documentation provided with the software.
The \code{jpeg} module defines these functions: The \module{jpeg} module defines an exception and some functions.
\setindexsubitem{(in module jpeg)} \begin{excdesc}{error}
\begin{funcdesc}{compress}{data\, w\, h\, b} Exception raised by \function{compress()} and \function{decompress()}
Treat data as a pixmap of width \var{w} and height \var{h}, with \var{b} bytes per in case of errors.
pixel. The data is in SGI GL order, so the first pixel is in the \end{excdesc}
lower-left corner. This means that \code{lrectread} return data can
immediately be passed to compress. Currently only 1 byte and 4 byte \begin{funcdesc}{compress}{data, w, h, b}
pixels are allowed, the former being treated as greyscale and the Treat data as a pixmap of width \var{w} and height \var{h}, with
latter as RGB color. Compress returns a string that contains the \var{b} bytes per pixel. The data is in SGI GL order, so the first
compressed picture, in JFIF format. pixel is in the lower-left corner. This means that \code{gl.lrectread}
return data can immediately be passed to \function{compress()}.
Currently only 1 byte and 4 byte pixels are allowed, the former being
treated as greyscale and the latter as RGB color.
\function{compress()} returns a string that contains the compressed
picture, in JFIF format.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{decompress}{data} \begin{funcdesc}{decompress}{data}
Data is a string containing a picture in JFIF format. It returns a Data is a string containing a picture in JFIF format. It returns a
tuple tuple \code{(\var{data}, \var{width}, \var{height},
\code{(\var{data}, \var{width}, \var{height}, \var{bytesperpixel})}. \var{bytesperpixel})}. Again, the data is suitable to pass to
Again, the data is suitable to pass to \code{lrectwrite}. \code{gl.lrectwrite}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setoption}{name\, value} \begin{funcdesc}{setoption}{name, value}
Set various options. Subsequent compress and decompress calls Set various options. Subsequent \function{compress()} and
will use these options. The following options are available: \function{decompress()} calls will use these options. The following
\begin{description} options are available:
\item[\code{'forcegray' }]
Force output to be grayscale, even if input is RGB. \begin{tableii}{|l|l|}{code}{Option}{Effect}
\lineii{'forcegray'}{%
\item[\code{'quality' }] Force output to be grayscale, even if input is RGB.}
Set the quality of the compressed image to a \lineii{'quality'}{%
value between \code{0} and \code{100} (default is \code{75}). Compress only. Set the quality of the compressed image to a value between
\code{0} and \code{100} (default is \code{75}). \\
\item[\code{'optimize' }] &This only affects compression.}
Perform Huffman table optimization. Takes longer, but results in \lineii{'optimize'}{%
smaller compressed image. Compress only. Perform Huffman table optimization. Takes longer, but results in
smaller compressed \\
\item[\code{'smooth' }] &image. This only affects compression.}
Perform inter-block smoothing on uncompressed image. Only useful for \lineii{'smooth'}{%
low-quality images. Decompress only. Perform inter-block smoothing on uncompressed image. Only useful
\end{description} for low-quality \\
&images. This only affects decompression.}
\end{tableii}
\end{funcdesc} \end{funcdesc}
Compress and uncompress raise the error \code{jpeg.error} in case of errors.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment