Mercurial > cpython-lru_cache-weakref
annotate Doc/libjpeg.tex @ 4566:6403c94de50d legacy-trunk
Added safeguard against failure in __del__.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 27 Nov 1996 19:39:58 +0000 |
| parents | 9b7e6d9a528d |
| children | 3468ea8645ca |
| rev | line source |
|---|---|
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 \section{Built-in Module \sectcode{jpeg}} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 \bimodindex{jpeg} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
4 The module \code{jpeg} provides access to the jpeg compressor and |
|
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
5 decompressor written by the Independent JPEG Group. JPEG is a (draft?)\ |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 standard for compressing pictures. For details on jpeg or the |
|
1767
907605320a5f
Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents:
1471
diff
changeset
|
7 Independent JPEG Group software refer to the JPEG standard or the |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 documentation provided with the software. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
10 The \code{jpeg} module defines these functions: |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 \renewcommand{\indexsubitem}{(in module jpeg)} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 \begin{funcdesc}{compress}{data\, w\, h\, b} |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
14 Treat data as a pixmap of width \var{w} and height \var{h}, with \var{b} bytes per |
|
1767
907605320a5f
Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents:
1471
diff
changeset
|
15 pixel. The data is in SGI GL order, so the first pixel is in the |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
16 lower-left corner. This means that \code{lrectread} return data can |
|
2647
9b7e6d9a528d
typos, layout and other small things
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
17 immediately be passed to compress. Currently only 1 byte and 4 byte |
|
1767
907605320a5f
Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents:
1471
diff
changeset
|
18 pixels are allowed, the former being treated as greyscale and the |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 latter as RGB color. Compress returns a string that contains the |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
20 compressed picture, in JFIF format. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
23 \begin{funcdesc}{decompress}{data} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
24 Data is a string containing a picture in JFIF format. It returns a |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
25 tuple |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
26 \code{(\var{data}, \var{width}, \var{height}, \var{bytesperpixel})}. |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
27 Again, the data is suitable to pass to \code{lrectwrite}. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
29 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 \begin{funcdesc}{setoption}{name\, value} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 Set various options. Subsequent compress and decompress calls |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
32 will use these options. The following options are available: |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 \begin{description} |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
34 \item[\code{'forcegray' }] |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
35 Force output to be grayscale, even if input is RGB. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
36 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
37 \item[\code{'quality' }] |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
38 Set the quality of the compressed image to a |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
39 value between \code{0} and \code{100} (default is \code{75}). Compress only. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
40 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
41 \item[\code{'optimize' }] |
|
1767
907605320a5f
Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents:
1471
diff
changeset
|
42 Perform Huffman table optimization. Takes longer, but results in |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
43 smaller compressed image. Compress only. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
44 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
45 \item[\code{'smooth' }] |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
46 Perform inter-block smoothing on uncompressed image. Only useful for |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
47 low-quality images. Decompress only. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
48 \end{description} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
49 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
1767
diff
changeset
|
51 Compress and uncompress raise the error \code{jpeg.error} in case of errors. |
