annotate Doc/lib/libjpeg.tex @ 21467:4e35fa5d5708 legacy-trunk

Add documentation for the help() built-in; contributed by Ka-Ping Yee. This is part of SF patch #494622.
author Fred Drake <fdrake@acm.org>
date Tue, 18 Dec 2001 16:31:08 +0000
parents 45c1825196ed
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{jpeg} ---
10252
c27c10c6b9f2 Shorten section title.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
2 Read and write JPEG files}
c27c10c6b9f2 Shorten section title.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8018
diff changeset
4 \declaremodule{builtin}{jpeg}
10334
61224459bb09 Added \platform annotations.
Fred Drake <fdrake@acm.org>
parents: 10252
diff changeset
5 \platform{IRIX}
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8018
diff changeset
6 \modulesynopsis{Read and write image files in compressed JPEG format.}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8018
diff changeset
7
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
8
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
9 The module \module{jpeg} provides access to the jpeg compressor and
10384
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
10 decompressor written by the Independent JPEG Group
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
11 \index{Independent JPEG Group}(IJG). JPEG is a standard for
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
12 compressing pictures; it is defined in ISO 10918. For details on JPEG
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
13 or the Independent JPEG Group software refer to the JPEG standard or
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
14 the documentation provided with the software.
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
15
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
16 A portable interface to JPEG image files is available with the Python
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
17 Imaging Library (PIL) by Fredrik Lundh. Information on PIL is
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
18 available at \url{http://www.pythonware.com/products/pil/}.
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
19 \index{Python Imaging Library}
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
20 \index{PIL (the Python Imaging Library)}
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
21 \index{Lundh, Fredrik}
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
22
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
23 The \module{jpeg} module defines an exception and some functions.
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
24
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
25 \begin{excdesc}{error}
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
26 Exception raised by \function{compress()} and \function{decompress()}
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
27 in case of errors.
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
28 \end{excdesc}
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
29
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
30 \begin{funcdesc}{compress}{data, w, h, b}
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
31 Treat data as a pixmap of width \var{w} and height \var{h}, with
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
32 \var{b} bytes per pixel. The data is in SGI GL order, so the first
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7686
diff changeset
33 pixel is in the lower-left corner. This means that \function{gl.lrectread()}
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
34 return data can immediately be passed to \function{compress()}.
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
35 Currently only 1 byte and 4 byte pixels are allowed, the former being
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
36 treated as greyscale and the latter as RGB color.
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
37 \function{compress()} returns a string that contains the compressed
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7686
diff changeset
38 picture, in JFIF\index{JFIF} format.
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 \end{funcdesc}
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 \begin{funcdesc}{decompress}{data}
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7686
diff changeset
42 Data is a string containing a picture in JFIF\index{JFIF} format. It
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7686
diff changeset
43 returns a tuple \code{(\var{data}, \var{width}, \var{height},
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
44 \var{bytesperpixel})}. Again, the data is suitable to pass to
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7686
diff changeset
45 \function{gl.lrectwrite()}.
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 \end{funcdesc}
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
47
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
48 \begin{funcdesc}{setoption}{name, value}
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
49 Set various options. Subsequent \function{compress()} and
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
50 \function{decompress()} calls will use these options. The following
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
51 options are available:
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
52
8018
011ae71fea96 Lighten up tables.
Fred Drake <fdrake@acm.org>
parents: 8014
diff changeset
53 \begin{tableii}{l|p{3in}}{code}{Option}{Effect}
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
54 \lineii{'forcegray'}{%
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
55 Force output to be grayscale, even if input is RGB.}
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
56 \lineii{'quality'}{%
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
57 Set the quality of the compressed image to a value between
8014
6e8be6096e56 When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
58 \code{0} and \code{100} (default is \code{75}). This only affects
6e8be6096e56 When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
59 compression.}
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
60 \lineii{'optimize'}{%
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
61 Perform Huffman table optimization. Takes longer, but results in
8014
6e8be6096e56 When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
62 smaller compressed image. This only affects compression.}
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
63 \lineii{'smooth'}{%
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
64 Perform inter-block smoothing on uncompressed image. Only useful
8014
6e8be6096e56 When the text of a table cell should be wrapped, used a "p" column.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
65 for low-quality images. This only affects decompression.}
7686
483970062915 Logical markup.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
66 \end{tableii}
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 \end{funcdesc}
10384
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
68
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
69
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
70 \begin{seealso}
17448
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
71 \seetitle{JPEG Still Image Data Compression Standard}{The
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
72 canonical reference for the JPEG image format, by
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
73 Pennebaker and Mitchell.}
10384
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
74
17448
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
75 \seetitle[http://www.w3.org/Graphics/JPEG/itu-t81.pdf]{Information
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
76 Technology - Digital Compression and Coding of
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
77 Continuous-tone Still Images - Requirements and
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
78 Guidelines}{The ISO standard for JPEG is also published as
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 10384
diff changeset
79 ITU T.81. This is available online in PDF form.}
10384
d3dc62004776 Updates based on comments from /F.
Fred Drake <fdrake@acm.org>
parents: 10334
diff changeset
80 \end{seealso}