Imported from libpng-1.0.5s.tar

This commit is contained in:
Glenn Randers-Pehrson
2000-02-18 13:48:52 -06:00
parent 61c32d9e66
commit a77ef625a6
47 changed files with 532 additions and 544 deletions

152
libpng.3
View File

@@ -1,6 +1,6 @@
.TH LIBPNG 3 "February 5, 2000"
.TH LIBPNG 3 "February 18, 2000"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5q
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5s
.SH SYNOPSIS
\fI\fB
@@ -92,47 +92,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5q
\fI\fB
\fBvoid png_free_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fI\fP\fB);\fP
\fI\fB
\fBvoid png_free_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fI\fP\fB);\fP
\fI\fB
\fBvoid png_free_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_free_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_free_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_free_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_free_spalettes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum_text\fP\fB);\fP
\fI\fB
\fBvoid png_free_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_free_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum_text\fP\fB);\fP
\fI\fB
\fBvoid png_free_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_free_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum_unknowns\fP\fB);\fP
\fBvoid png_free_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum\fP\fB);\fP
\fI\fB
@@ -262,6 +222,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5q
\fI\fB
\fBpng_bytepp png_get_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBpng_uint_32 png_get_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP
\fI\fB
@@ -270,7 +234,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5q
\fI\fB
\fBpng_uint_32 png_get_spalettes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fI*splt_ptr\fP\fB, int \fInum\fP\fB);\fP
\fBpng_uint_32 png_get_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fI*splt_ptr\fP\fB, int \fInum\fP\fB);\fP
\fI\fB
@@ -578,6 +542,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5q
\fI\fB
\fBvoid png_set_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytepp \fIrow_pointers\fP\fB);\fP
\fI\fB
\fBvoid png_set_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fIsig_bit\fP\fB);\fP
\fI\fB
@@ -594,7 +562,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.5q
\fI\fB
\fBvoid png_set_spalettes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP
\fBvoid png_set_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP
\fI\fB
@@ -741,7 +709,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng.txt - A description on how to use and modify libpng
libpng version 1.0.5q - February 5, 2000
libpng version 1.0.5s - February 18, 2000
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@@ -931,17 +899,18 @@ handling and memory alloc/free functions.
When libpng encounters an error, it expects to longjmp back
to your routine. Therefore, you will need to call setjmp and pass
your png_ptr->jmpbuf. If you read the file from different
your png_jmp_env(png_ptr). If you read the file from different
routines, you will need to update the jmpbuf field every time you enter
a new routine that will call a png_ function.
See your documentation of setjmp/longjmp for your compiler for more
handling in the Customizing Libpng section below for more information on
the libpng error handling. If an error occurs, and libpng longjmp's
information on setjmp/longjmp. See the discussion on libpng error
handling in the Customizing Libpng section below for more information
on the libpng error handling. If an error occurs, and libpng longjmp's
back to your setjmp, you will want to call png_destroy_read_struct() to
free any memory.
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmp_env(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
&end_info);
@@ -1289,7 +1258,9 @@ into the info_ptr is returned for any complex types.
valid 16-bit red, green and blue
values, regardless of color_type
num_text = png_get_text(png_ptr, info_ptr, &text_ptr);
num_comments = png_get_text(png_ptr, info_ptr,
&text_ptr, &num_text);
num_comments - number of comments
text_ptr - array of png_text holding image
comments
text_ptr[i]->compression - type of compression used
@@ -1307,7 +1278,8 @@ into the info_ptr is returned for any complex types.
text_ptr[i]->lang - language of comment (NULL for unknown).
text_ptr[i]->translated_keyword - keyword in UTF-8 (NULL
for unknown).
num_text - number of comments
num_text - number of comments (same as num_comments;
you can put NULL here to avoid the duplication)
num_spalettes = png_get_spalettes(png_ptr, info_ptr, &palette_ptr);
palette_ptr - array of png_spalette structures holding contents
of one or more sPLT chunks read.
@@ -1850,32 +1822,26 @@ When you are done, you can free all memory allocated by libpng like this:
&end_info);
It is also possible to individually free the info_ptr members that
point to allocated storage with the following functions:
point to libpng-allocated storage with the following functions:
png_free_text(png_ptr, info_ptr, num)
num - number of text item to be freed (-1 for all items)
png_free_hIST(png_ptr, info_ptr)
png_free_iCCP(png_ptr, info_ptr)
png_free_pCAL(png_ptr, info_ptr)
png_free_sCAL(png_ptr, info_ptr)
png_free_spalettes(png_ptr, info_ptr, num)
num - number of suggested-paletted entry to be freed
(-1 for all suggested palettes)
png_free_pixels(png_ptr, info_ptr)
png_free_unknown_chunk(png_ptr, info_ptr, num)
num - number of unknown chunk to be freed
(-1 for all suggested palettes)
png_free_data(png_ptr, info_ptr, mask, n)
mask - identifies data to be freed, a mask
made up by the OR one or more of
PNG_FREE_PLTE, PNG_FREE_TRNS,
PNG_FREE_HIST, PNG_FREE_ICCP,
PNG_FREE_SPLT, PNG_FREE_ROWS,
PNG_FREE_PCAL, PNG_FREE_SCAL,
PNG_FREE_TEXT, PNG_FREE_UNKN,
or simply PNG_FREE_ALL
n - sequence number of item to be freed
(-1 for all items)
These functions may be safely called when the relevant storage has
already been freed, or has not yet been allocated, and will in that
case do nothing.
case do nothing. The "n" parameter is ignored if only one item
of the selected data type, such as PLTE, is allowed. If "n" is not
-1, and multiple items are allowed for the data type identified in
the mask, such as text or splt, only the n'th item is freed.
For a more compact example of reading a PNG image, see the file example.c.
@@ -1914,7 +1880,7 @@ png_infop info_ptr;
return -1;
}
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmp_env(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
@@ -1948,7 +1914,7 @@ png_infop info_ptr;
int
process_data(png_bytep buffer, png_uint_32 length)
{
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmp_env(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
@@ -2103,15 +2069,15 @@ png_create_write_struct_2() instead of png_create_read_struct():
After you have these structures, you will need to set up the
error handling. When libpng encounters an error, it expects to
longjmp() back to your routine. Therefore, you will need to call
setjmp() and pass the png_ptr->jmpbuf. If you
setjmp() and pass the png_jmp_env(png_ptr). If you
write the file from different routines, you will need to update
the jmpbuf field every time you enter a new routine that will
the png_jmp_env(png_ptr) every time you enter a new routine that will
call a png_ function. See your documentation of setjmp/longjmp
for your compiler for more information on setjmp/longjmp. See
the discussion on libpng error handling in the Customizing Libpng
section below for more information on the libpng error handling.
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmp_env(png_ptr)))
{
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
@@ -2172,7 +2138,7 @@ types.
PNG_FILTER_NONE | PNG_FILTER_SUB |
PNG_FILTER_PAETH);
The png_set_compression_???() functions interface to the zlib compression
The png_set_compression_*() functions interface to the zlib compression
library, and should mostly be ignored unless you really know what you are
doing. The only generally useful call is png_set_compression_level()
which changes how much time zlib spends on trying to compress the image
@@ -2476,7 +2442,7 @@ At this point there are two ways to proceed; through the high-level
write interface, or through a sequence of low-level write operations.
You can use the high-level interface if your image data is present
on the rowpointers member of the info structure. All defined output
transformations are pernmitted, enabled by the following masks.
transformations are permitted, enabled by the following masks.
PNG_TRANSFORM_IDENTITY No transformation
PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples
@@ -2496,7 +2462,7 @@ If you have valid image data on the rowpointers member, simply do this:
where png_transforms is an integer containing the logical-or of some set of
transformation flags. This call is equivalent to png_write_info(),
followed by the set of transformations indicated by the transform
mask, followed by followed by a write of the image bytes to the info
mask, followed by followed by a write of the image bytes from the info
member `rowpointers', followed by png_write_end().
(The final parameter of this call is not yet used. Someday it
@@ -2746,7 +2712,7 @@ When you are done, you can free all memory used by libpng like this:
png_destroy_write_struct(&png_ptr, &info_ptr);
It is also possible to individually free the info_ptr members that
point to allocated storage with the following functions:
point to libpng-allocated storage with the following functions:
png_free_text(png_ptr, info_ptr, num)
num - number of text item to be freed (-1 for all items)
@@ -2759,7 +2725,7 @@ point to allocated storage with the following functions:
png_free_sCAL(png_ptr, info_ptr)
png_free_spalettes(png_ptr, info_ptr, num)
png_free_sPLT(png_ptr, info_ptr, num)
num - number of suggested-paletted entry to be freed
(-1 for all suggested palettes)
@@ -2773,7 +2739,9 @@ These functions may be safely called when the relevant storage has
already been freed, or has not yet been allocated, and will in that
case do nothing.
If you allocated palette data, you must free it before the call to png_destroy_write_struct();
If you allocated data such as a palette that you passed in to libpng with
png_set_*, you must not free it until just before the call to
png_destroy_write_struct().
For a more compact example of writing a PNG image, see the file example.c.
@@ -2787,7 +2755,7 @@ adding new transformations, and generally changing how libpng works.
All of the memory allocation, input/output, and error handling in libpng
goes through callbacks that are user settable. The default routines are
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c respectively. To change
these functions, call the appropriate png_set_???_fn() function.
these functions, call the appropriate png_set_*_fn() function.
Memory allocation is done through the functions png_large_malloc(),
png_malloc(), png_realloc(), png_large_free(), and png_free(). These
@@ -2844,7 +2812,7 @@ fprintf() unless the library is compiled with PNG_NO_STDIO defined. If
you wish to change the behavior of the error functions, you will need to
set up your own message callbacks. These functions are normally supplied
at the time that the png_struct is created. It is also possible to change
these functions after png_create_???_struct() has been called by calling:
these functions after png_create_*_struct() has been called by calling:
png_set_error_fn(png_structp png_ptr,
png_voidp error_ptr, png_error_ptr error_fn,
@@ -2926,7 +2894,7 @@ unsigned char far * far *.
You will need to write new error and warning functions that use the GUI
interface, as described previously, and set them to be the error and
warning functions at the time that png_create_???_struct() is called,
warning functions at the time that png_create_*_struct() is called,
in order to have them available during the structure initialization.
They can be changed later via png_set_error_fn(). On some compilers,
you may also have to change the memory allocators (png_malloc, etc.).
@@ -3147,13 +3115,13 @@ the old method.
.SH VII. Y2K Compliance in libpng
February 5, 2000
February 18, 2000
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.0.5q are Y2K compliant. It is my belief that earlier
upward through 1.0.5s are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that
@@ -3279,7 +3247,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.0.5q - February 5, 2000:
Libpng version 1.0.5s - February 18, 2000:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
@@ -3294,7 +3262,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.90, December 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.5q, February 5, 2000)
(libpng versions 0.97, January 1998, through 1.0.5s, February 18, 2000)
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals: