Imported from libpng-1.0.7beta11.tar

This commit is contained in:
Glenn Randers-Pehrson 2000-05-06 14:09:57 -05:00
parent 98c9d73605
commit 752945701e
42 changed files with 799 additions and 860 deletions

View File

@ -1,12 +1,10 @@
Libpng 1.0.6j - May 4, 2000
Libpng 1.0.7beta11 - May 6, 2000
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
This is a public release of libpng, intended for use in production codes.
Changes since the last public release (1.0.6):
version 1.0.6d [April 8, 2000]
Changed sprintf() to strcpy() in png_write_sCAL_s() to work without STDIO
Added data_length parameter to png_decompress_chunk() function
Revised documentation to remove reference to abandoned png_free_chnk functions
@ -15,36 +13,33 @@ version 1.0.6d [April 8, 2000]
Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file
Added a check for info_ptr->free_me&PNG_FREE_TEXT when free'ing text in png.c
Simplify png_sig_bytes() function to remove use of non-ISO-C strdup().
version 1.0.6e [April 9, 2000]
Added png_data_freer() function.
In the code that checks for over-length tRNS chunks, added check of
info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann)
Minor revisions of libpng.txt/libpng.3.
Check for existing data and free it if the free_me flag is set, in png_set_*()
and png_handle_*().
Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED
is defined.
Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c
and mentioned the purposes of the two macros in libpng.txt/libpng.3.
version 1.0.6f [April 14, 2000]
Revised png_set_iCCP() and png_set_rows() to avoid prematurely freeing data.
Add checks in png_set_text() for NULL members of the input text structure.
Revised libpng.txt/libpng.3.
Removed superfluous prototype for png_set_itxt from png.h
Removed "else" from pngread.c, after png_error(), and changed "0" to "length".
Changed several png_errors about malformed ancillary chunks to png_warnings.
version 1.0.6g [April 24, 2000]
Added png_pass-* arrays to pnggccrd.c when PNG_USE_LOCAL_ARRAYS is defined.
Relocated paragraph about png_set_background() in libpng.3/libpng.txt
and other revisions (Matthias Benckmann)
Relocated info_ptr->free_me to restore binary compatibility with libpng-1.0.5
(breaks compatibility with libpng-1.0.6).
Relocated info_ptr->free_me, png_ptr->free_me, and other info_ptr and
png_ptr members to restore binary compatibility with libpng-1.0.5
(breaks compatibility with libpng-1.0.6).
version 1.0.6h [April 24, 2000]
Changed shared library so-number pattern from 2.x.y.z to xy.z (this builds
libpng.so.10 & libpng.so.10.6h instead of libpng.so.2 & libpng.so.2.1.0.6h)
This is a temporary change for test purposes.
version 1.0.6i [May 3, 2000]
Rearranged some members at the end of png_info and png_struct, to put
unknown_chunks_num and free_me within the original size of the png_structs
and free_me, png_read_user_fn, and png_free_fn within the original png_info,
because some old applications allocate the structs directly instead of
using png_create_*().
Added documentation of user memory functions in libpng.txt/libpng.3
Modified png_read_png so that it will use user_allocated row_pointers
if present, unless free_me directs that it be freed, and added description
@ -56,14 +51,15 @@ version 1.0.6i [May 3, 2000]
(new in version 1.0.2), rgb_to_gray (new in 1.0.5), iCCP, sCAL, sPLT,
the high-level interface, and unknown chunks support (all new in 1.0.6).
This was necessary because of old applications that allocate the structs
directly instead of using png_create_*(), as authors were instructed to
do in libpng-0.88 and earlier.
directly as authors were instructed to do in libpng-0.88 and earlier,
instead of using png_create_*().
Added makefile.intel and updated makefile.watcom (Pawel Mrochen)
version 1.0.6j [May 4, 2000]
Overloaded png_read_init() and png_write_init() with macros that convert
calls to png_read_init_2() or png_write_init_2() that check the version
and structure sizes.
Restored original shared library so-number pattern (2.x.y.z)
In png_set_text, check if old application had allocated the png_text structure;
if so, only allow one text chunk to be processed to avoid memory overrun.
Added PNGAPI macro, and added it to the definitions of all exported functions.
Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

15
CHANGES
View File

@ -717,19 +717,26 @@ version 1.0.6i [May 2, 2000]
(new in version 1.0.2), rgb_to_gray (new in 1.0.5), iCCP, sCAL, sPLT,
the high-level interface, and unknown chunks support (all new in 1.0.6).
This was necessary because of old applications that allocate the structs
directly instead of using png_create_*(), as authors were instructed to
do in libpng-0.88 and earlier.
directly as authors were instructed to do in libpng-0.88 and earlier,
instead of using png_create_*().
Added modes PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT which
can be used to detect codes that directly allocate the structs, and
code to check these modes in png_read_init() and png_write_init() and
generate a libpng error if the modes aren't set and PNG_LEGACY_SUPPORTED
was not defined.
Added makefile.intel and updated makefile.watcom (Pawel Mrochen)
version 1.0.6j [May 4, 2000]
version 1.0.6j [May 3, 2000]
Overloaded png_read_init() and png_write_init() with macros that convert
calls to png_read_init_2() or png_write_init_2() that check the version
and structure sizes.
version 1.0.7beta11 [May 6, 2000]
Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
which are no longer used.
Eliminated the three new members of png_text when PNG_NO_iTXt_SUPPORTED
or PNG_LEGACY_SUPPORTED is defined.
In png_set_text, check if old application had allocated the png_text structure;
if so, only allow one text chunk to be processed to avoid memory overrun.
Added PNGAPI macro, and added it to the definitions of all exported functions.
Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

12
INSTALL
View File

@ -1,5 +1,5 @@
Installing libpng version 1.0.6j - May 4, 2000
Installing libpng version 1.0.7beta11 - May 6, 2000
Before installing libpng, you must first install zlib. zlib
can usually be found wherever you got libpng. zlib can be
@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
version of zlib that's installed.
You can rename the directories that you downloaded (they
might be called "libpng-1.0.6j" or "lpng106" and "zlib-1.1.3"
might be called "libpng-1.0.7beta11" or "lpng106" and "zlib-1.1.3"
or "zlib113") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
@ -47,8 +47,8 @@ The files that are presently available in the scripts directory
include
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.6j)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.6j,
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta11)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta11,
uses assembler code tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
@ -59,9 +59,9 @@ include
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.6j)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta11)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.6j)
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta11)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile

View File

@ -5,7 +5,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.6j, May 4, 2000)
(libpng versions 0.97, January 1998, through 1.0.7beta11, May 6, 2000)
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
@ -68,4 +68,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
randeg@alum.rpi.edu
May 4, 2000
May 6, 2000

10
README
View File

@ -1,4 +1,4 @@
README for libpng 1.0.6j - May 4, 2000 (shared library 2.1)
README for libpng 1.0.7beta11 - May 6, 2000 (shared library 2.1)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@ -172,9 +172,9 @@ Files in this distribution:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng.so.2.1.0.6j)
(gcc, creates libpng.so.2.1.0.7beta11)
makefile.gcmmx => Linux/ELF makefile (gcc, creates
libpng.so.2.1.0.6j, uses assembler code
libpng.so.2.1.0.7beta11, uses assembler code
tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
@ -185,10 +185,10 @@ Files in this distribution:
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.6j)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta11)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng.so.2.1.0.6j)
(gcc, creates libpng.so.2.1.0.7beta11)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile

2
TODO
View File

@ -1,6 +1,7 @@
TODO - list of things to do for libpng:
Final bug fixes.
Improve API by hiding the png_struct and png_info structs.
Finish work on the no-floating-point version (including gamma compensation)
Better C++ wrapper/full C++ implementation?
Fix problem with C++ and EXTERN "C".
@ -16,4 +17,3 @@ Better filter selection
(counting huffman bits/precompression? filter inertia? filter costs?).
Histogram creation.
Text conversion between different code pages (Latin-1 -> Mac and DOS).
Improve API by hiding the info_ptr.

View File

@ -1,13 +1,13 @@
Y2K compliance in libpng:
=========================
May 4, 2000
May 6, 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.6j are Y2K compliant. It is my belief that earlier
upward through 1.0.7beta11 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

2
configure vendored
View File

@ -1,5 +1,5 @@
echo "
There is no \"configure\" script for Libpng-1.0.6j. Instead, please
There is no \"configure\" script for Libpng-1.0.7beta11. Instead, please
copy the appropriate makefile for your system from the \"scripts\"
directory. Read the INSTALL file for more details.
"

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "May 4, 2000"
.TH LIBPNG 3 "May 6, 2000"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6j
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta11
.SH SYNOPSIS
\fI\fB
@ -354,6 +354,12 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6j
\fI\fB
\fBDEPRECATED: void png_read_init (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fBDEPRECATED: void png_read_init_2 (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
\fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
@ -694,6 +700,14 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6j
\fI\fB
\fBDEPRECATED: void png_write_init (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fBDEPRECATED: void png_write_init_2 (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
\fI\fB
\fBvoid png_write_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
@ -725,7 +739,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.6j - May 4, 2000
libpng version 1.0.7beta11 - May 6, 2000
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -819,9 +833,20 @@ The png_info structure is designed to provide information about the
PNG file. At one time, the fields of png_info were intended to be
directly accessible to the user. However, this tended to cause problems
with applications using dynamically loaded libraries, and as a result
a set of interface functions for png_info was developed. The fields
of png_info are still available for older applications, but it is
suggested that applications use the new interfaces if at all possible.
a set of interface functions for png_info (the png_get_*() and png_set_*()
functions) was developed. The fields of png_info are still available for
older applications, but it is suggested that applications use the new
interfaces if at all possible.
Applications that do make direct access to the members of png_struct (except
for png_ptr->jmpbuf) must be recompiled whenever the library is updated,
and applications that make direct access to the members of png_info must
be recompiled if they were compiled or loaded with libpng version 1.0.6,
in which the members were in a different order. In version 1.0.7, the
members of the png_info structure reverted to the old order, as they were
in versions 0.97c through 1.0.5. Starting with version 2.0.0, both
structures are going to be hidden, and the contents of the structures will
only be accessible through the png_get/png_set functions.
The png.h header file is an invaluable reference for programming with libpng.
And while I'm on the topic, make sure you include the libpng header file:
@ -3263,8 +3288,10 @@ still alive and well, but they have moved on to other things.
The old libpng functions png_read_init(), png_write_init(),
png_info_init(), png_read_destroy(), and png_write_destory() have been
moved to PNG_INTERNAL in version 0.95 to discourage their use. The
preferred method of creating and initializing the libpng structures is
moved to PNG_INTERNAL in version 0.95 to discourage their use. These
functions will be removed from libpng version 2.0.0.
The preferred method of creating and initializing the libpng structures is
via the png_create_read_struct(), png_create_write_struct(), and
png_create_info_struct() because they isolate the size of the structures
from the application, allow version error checking, and also allow the
@ -3281,19 +3308,19 @@ png_read_init() as was suggested in libpng-0.88 is no longer supported
because this caused applications that do not use custom error functions
to fail if the png_ptr was not initialized to zero. It is still possible
to set the error callbacks AFTER png_read_init(), or to change them with
png_set_error_fn(), which is essentially the same function, but with a
new name to force compilation errors with applications that try to use
the old method.
png_set_error_fn(), which is essentially the same function, but with a new
name to force compilation errors with applications that try to use the old
method.
.SH VII. Y2K Compliance in libpng
May 4, 2000
May 6, 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.6j are Y2K compliant. It is my belief that earlier
upward through 1.0.7beta11 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
@ -3434,7 +3461,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.0.6j - May 4, 2000:
Libpng version 1.0.7beta11 - May 6, 2000:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
@ -3449,7 +3476,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.89c, May 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.6j, May 4, 2000)
(libpng versions 0.97, January 1998, through 1.0.7beta11, May 6, 2000)
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:

View File

@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng
libpng version 1.0.6j - May 4, 2000
libpng version 1.0.7beta11 - May 6, 2000
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -94,9 +94,20 @@ The png_info structure is designed to provide information about the
PNG file. At one time, the fields of png_info were intended to be
directly accessible to the user. However, this tended to cause problems
with applications using dynamically loaded libraries, and as a result
a set of interface functions for png_info was developed. The fields
of png_info are still available for older applications, but it is
suggested that applications use the new interfaces if at all possible.
a set of interface functions for png_info (the png_get_*() and png_set_*()
functions) was developed. The fields of png_info are still available for
older applications, but it is suggested that applications use the new
interfaces if at all possible.
Applications that do make direct access to the members of png_struct (except
for png_ptr->jmpbuf) must be recompiled whenever the library is updated,
and applications that make direct access to the members of png_info must
be recompiled if they were compiled or loaded with libpng version 1.0.6,
in which the members were in a different order. In version 1.0.7, the
members of the png_info structure reverted to the old order, as they were
in versions 0.97c through 1.0.5. Starting with version 2.0.0, both
structures are going to be hidden, and the contents of the structures will
only be accessible through the png_get/png_set functions.
The png.h header file is an invaluable reference for programming with libpng.
And while I'm on the topic, make sure you include the libpng header file:
@ -2538,8 +2549,10 @@ still alive and well, but they have moved on to other things.
The old libpng functions png_read_init(), png_write_init(),
png_info_init(), png_read_destroy(), and png_write_destory() have been
moved to PNG_INTERNAL in version 0.95 to discourage their use. The
preferred method of creating and initializing the libpng structures is
moved to PNG_INTERNAL in version 0.95 to discourage their use. These
functions will be removed from libpng version 2.0.0.
The preferred method of creating and initializing the libpng structures is
via the png_create_read_struct(), png_create_write_struct(), and
png_create_info_struct() because they isolate the size of the structures
from the application, allow version error checking, and also allow the
@ -2556,19 +2569,19 @@ png_read_init() as was suggested in libpng-0.88 is no longer supported
because this caused applications that do not use custom error functions
to fail if the png_ptr was not initialized to zero. It is still possible
to set the error callbacks AFTER png_read_init(), or to change them with
png_set_error_fn(), which is essentially the same function, but with a
new name to force compilation errors with applications that try to use
the old method.
png_set_error_fn(), which is essentially the same function, but with a new
name to force compilation errors with applications that try to use the old
method.
VII. Y2K Compliance in libpng
May 4, 2000
May 6, 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.6j are Y2K compliant. It is my belief that earlier
upward through 1.0.7beta11 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

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "May 4, 2000"
.TH LIBPNGPF 3 "May 6, 2000"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6j
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta11
(private functions)
.SH SYNOPSIS
\fB#include <png.h>\fP
@ -383,10 +383,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6j
\fI\fB
\fBvoid png_read_init (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
@ -469,10 +465,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6j
\fI\fB
\fBvoid png_write_init (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext)\fP\fB);\fP
\fI\fB

2
png.5
View File

@ -1,4 +1,4 @@
.TH PNG 5 "May 4, 2000"
.TH PNG 5 "May 6, 2000"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

58
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
* libpng version 1.0.6j - May 4, 2000
* libpng version 1.0.7beta11 - May 6, 2000
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -14,14 +14,14 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_0_6j Your_png_h_is_not_version_1_0_6j;
typedef version_1_0_7beta11 Your_png_h_is_not_version_1_0_7beta11;
/* Version information for C files. This had better match the version
* string defined in png.h. */
#ifdef PNG_USE_GLOBAL_ARRAYS
/* png_libpng_ver was changed to a function in version 1.0.5c */
char png_libpng_ver[12] = "1.0.6j";
char png_libpng_ver[12] = "1.0.7beta11";
/* png_sig was changed to a function in version 1.0.5c */
/* Place to hold the signature string for a PNG file. */
@ -88,7 +88,7 @@ int FARDATA png_pass_dsp_mask[] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff};
* or write any of the magic bytes before it starts on the IHDR.
*/
void
void PNGAPI
png_set_sig_bytes(png_structp png_ptr, int num_bytes)
{
png_debug(1, "in png_set_sig_bytes\n");
@ -106,7 +106,7 @@ png_set_sig_bytes(png_structp png_ptr, int num_bytes)
* respectively, to be less than, to match, or be greater than the correct
* PNG signature (this is the same behaviour as strcmp, memcmp, etc).
*/
int
int PNGAPI
png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
{
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
@ -128,14 +128,14 @@ png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
* to check a partial signature. This function might be removed in the
* future - use png_sig_cmp(). Returns true (nonzero) if the file is a PNG.
*/
int
int PNGAPI
png_check_sig(png_bytep sig, int num)
{
return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num));
}
/* Function to allocate memory for zlib and clear it to 0. */
voidpf
voidpf PNGAPI
png_zalloc(voidpf png_ptr, uInt items, uInt size)
{
png_uint_32 num_bytes = (png_uint_32)items * size;
@ -155,7 +155,7 @@ png_zalloc(voidpf png_ptr, uInt items, uInt size)
}
/* function to free memory for zlib */
void
void PNGAPI
png_zfree(voidpf png_ptr, voidpf ptr)
{
png_free((png_structp)png_ptr, (png_voidp)ptr);
@ -164,7 +164,7 @@ png_zfree(voidpf png_ptr, voidpf ptr)
/* Reset the CRC variable to 32 bits of 1's. Care must be taken
* in case CRC is > 32 bits to leave the top bits 0.
*/
void
void /* PRIVATE */
png_reset_crc(png_structp png_ptr)
{
png_ptr->crc = crc32(0, Z_NULL, 0);
@ -175,7 +175,7 @@ png_reset_crc(png_structp png_ptr)
* also check that this data will actually be used before going to the
* trouble of calculating it.
*/
void
void /* PRIVATE */
png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length)
{
int need_crc = 1;
@ -202,7 +202,7 @@ png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length)
* and png_info_init() so that applications that want to use a shared
* libpng don't have to be recompiled if png_info changes size.
*/
png_infop
png_infop PNGAPI
png_create_info_struct(png_structp png_ptr)
{
png_infop info_ptr;
@ -227,7 +227,7 @@ png_create_info_struct(png_structp png_ptr)
* png_destroy_write_struct() to free an info struct, but this may be
* useful for some applications.
*/
void
void PNGAPI
png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
{
png_infop info_ptr = NULL;
@ -253,7 +253,7 @@ png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
* and applications using it are urged to use png_create_info_struct()
* instead.
*/
void
void PNGAPI
png_info_init(png_infop info_ptr)
{
png_debug(1, "in png_info_init\n");
@ -262,7 +262,7 @@ png_info_init(png_infop info_ptr)
}
#ifdef PNG_FREE_ME_SUPPORTED
void
void PNGAPI
png_data_freer(png_structp png_ptr, png_infop info_ptr,
int freer, png_uint_32 mask)
{
@ -279,7 +279,7 @@ png_data_freer(png_structp png_ptr, png_infop info_ptr,
}
#endif
void
void PNGAPI
png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
{
png_debug(1, "in png_free_data\n");
@ -490,7 +490,7 @@ if (mask & PNG_FREE_ROWS)
* pointing to before re-using it or freeing the struct itself. Recall
* that png_free() checks for NULL pointers for us.
*/
void
void /* PRIVATE */
png_info_destroy(png_structp png_ptr, png_infop info_ptr)
{
png_debug(1, "in png_info_destroy\n");
@ -512,7 +512,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr)
* functions. The application should free any memory associated with this
* pointer before png_write_destroy() or png_read_destroy() are called.
*/
png_voidp
png_voidp PNGAPI
png_get_io_ptr(png_structp png_ptr)
{
return (png_ptr->io_ptr);
@ -525,7 +525,7 @@ png_get_io_ptr(png_structp png_ptr)
* PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't
* necessarily available.
*/
void
void PNGAPI
png_init_io(png_structp png_ptr, FILE *fp)
{
png_debug(1, "in png_init_io\n");
@ -537,7 +537,7 @@ png_init_io(png_structp png_ptr, FILE *fp)
/* Convert the supplied time into an RFC 1123 string suitable for use in
* a "Creation Time" or other text-based time string.
*/
png_charp
png_charp PNGAPI
png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
{
static PNG_CONST char short_months[12][4] =
@ -572,18 +572,18 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
#if 0
/* Signature string for a PNG file. */
png_bytep
png_bytep PNGAPI
png_sig_bytes(void)
{
return ((png_bytep)"\211\120\116\107\015\012\032\012");
}
#endif
png_charp
png_charp PNGAPI
png_get_copyright(png_structp png_ptr)
{
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
return ("\n libpng version 1.0.6j - May 4, 2000\n\
return ("\n libpng version 1.0.7beta11 - May 6, 2000\n\
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\
Copyright (c) 1996, 1997 Andreas Dilger\n\
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson\n");
@ -596,16 +596,16 @@ png_get_copyright(png_structp png_ptr)
* in png.h.
*/
png_charp
png_charp PNGAPI
png_get_libpng_ver(png_structp png_ptr)
{
/* Version of *.c files used when building libpng */
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
return("1.0.6j");
return("1.0.6j");
return("1.0.7beta11");
return("1.0.7beta11");
}
png_charp
png_charp PNGAPI
png_get_header_ver(png_structp png_ptr)
{
/* Version of *.h files used when building libpng */
@ -614,7 +614,7 @@ png_get_header_ver(png_structp png_ptr)
return(PNG_LIBPNG_VER_STRING);
}
png_charp
png_charp PNGAPI
png_get_header_version(png_structp png_ptr)
{
/* Returns longer string containing both version and date */
@ -624,7 +624,7 @@ png_get_header_version(png_structp png_ptr)
}
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
int
int PNGAPI
png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
{
/* check chunk_name and return "keep" value if it's on the list, else 0 */
@ -641,7 +641,7 @@ png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
#endif
/* This function, added to libpng-1.0.6g, is untested. */
int
int PNGAPI
png_reset_zstream(png_structp png_ptr)
{
return (inflateReset(&png_ptr->zstream));

137
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.0.6j - May 4, 2000
* libpng version 1.0.7beta11 - May 6, 2000
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -9,7 +9,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.0.6j - May 4, 2000: Glenn
* libpng versions 0.97, January 1998, through 1.0.7beta11 - May 6, 2000: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -20,40 +20,43 @@
* The following table summarizes matters since version 0.89c, which was
* the first widely used release:
*
* source png.h png.h shared-lib
* version string int version
* ------- ------ ----- ----------
* 0.89c "1.0 beta 3" 0.89 89 1.0.89
* 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90]
* 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95]
* 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96]
* 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97]
* 0.97c 0.97 97 2.0.97
* 0.98 0.98 98 2.0.98
* 0.99 0.99 98 2.0.99
* 0.99a-m 0.99 99 2.0.99
* 1.00 1.00 100 2.1.0 [100 should be 10000]
* 1.0.0 1.0.0 100 2.1.0 [100 should be 10000]
* 1.0.1 1.0.1 10001 2.1.0
* 1.0.1a-e 1.0.1a-e 10002 2.1.0.1a-e
* 1.0.2 1.0.2 10002 2.1.0.2
* 1.0.2a-b 1.0.2a-b 10003 2.1.0.2a-b
* 1.0.3 1.0.3 10003 2.1.0.3
* 1.0.3a-d 1.0.3a-d 10004 2.1.0.3a-d
* 1.0.4 1.0.4 10004 2.1.0.4
* 1.0.4a-f 1.0.4a-f 10005 2.1.0.4a-f
* 1.0.5 (+ 2 patches) 1.0.5 10005 2.1.0.5
* 1.0.5a-d 1.0.5a-d 10006 2.1.0.5a-d
* 1.0.5e-r 1.0.5e-r 10100 2.1.0.5e-r (not source compatible)
* 1.0.5s-v 1.0.5s-v 10006 2.1.0.5s-v (not binary compatible)
* 1.0.6 (+ 3 patches) 1.0.6 10006 2.1.0.6 (still binary incompat)
* 1.0.6d-f 1.0.6d-f 10007 2.1.0.6d-f (still binary incompat)
* 1.0.6g 1.0.6g 10007 2.1.0.6g
* 1.0.6h 1.0.6h 10007 10.6h (testing xy.z so-numbering)
* 1.0.6i 1.0.6i 10007 10.6i (can be compatible w/ 1.0.0)
* 1.0.6j 1.0.6j 10007 2.1.0.6j (compatible with 1.0.0)
* 1.0.6 (+ 4 patches) 1.0.6 10006 2.1.0.6ad (compatible with 1.0.0)
* 1.0.7 1.0.7 10007 2.1.0.7 (still compatible)
* source png.h png.h shared-lib
* version string int version
* ------- ------ ----- ----------
* 0.89c "1.0 beta 3" 0.89 89 1.0.89
* 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90]
* 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95]
* 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96]
* 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97]
* 0.97c 0.97 97 2.0.97
* 0.98 0.98 98 2.0.98
* 0.99 0.99 98 2.0.99
* 0.99a-m 0.99 99 2.0.99
* 1.00 1.00 100 2.1.0 [100 should be 10000]
* 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000]
* 1.0.1 png.h string is 10001 2.1.0
* 1.0.1a-e identical to the 10002 from here on, the shared library
* 1.0.2 source version) 10002 is 2.V where V is the source code
* 1.0.2a-b 10003 version, except as noted.
* 1.0.3 10003
* 1.0.3a-d 10004
* 1.0.4 10004
* 1.0.4a-f 10005
* 1.0.5 (+ 2 patches) 10005
* 1.0.5a-d 10006
* 1.0.5e-r 10100 (not source compatible)
* 1.0.5s-v 10006 (not binary compatible)
* 1.0.6 (+ 3 patches) 10006 (still binary incompatible)
* 1.0.6d-f 10007 (still binary incompatible)
* 1.0.6g 10007
* 1.0.6h 10007 10.6h (testing xy.z so-numbering)
* 1.0.6i 10007 10.6i
* 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0)
* 1.0.7beta11 10007 2.1.0.7beta11 (still compatible)
* planned:
* 1.0.7prep00 10007 2.1.0.7prep00 (still compatible)
* 1.0.6ptch04 (w/4 patches) 10006 2.1.0.6 (binary compatible)
* 1.0.7 10007 (still compatible)
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@ -61,7 +64,9 @@
* PNG_PNGLIB_VER macro, which is not used within libpng but is available
* for applications, is an unsigned integer of the form xyyzz corresponding
* to the source version x.y.z (leading zeros in y and z). Beta versions
* are given the previous public release number plus a letter or two.
* were given the previous public release number plus a letter, until
* version 1.0.6j; from then on they were given the upcoming public
* release number plus "-beta-nn" or "-pre-nn".
*
* Binary incompatibility exists only when applications make direct access
* to the info_ptr or png_ptr members through png.h, and the compiled
@ -82,7 +87,7 @@
* Copyright (c) 1996, 1997 Andreas Dilger
* (libpng versions 0.89c, June 1996, through 0.96, May 1997)
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
* (libpng versions 0.97, January 1998, through 1.0.6j, May 4, 2000)
* (libpng versions 0.97, January 1998, through 1.0.7beta11, May 6, 2000)
*
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
@ -157,13 +162,13 @@
* Y2K compliance in libpng:
* =========================
*
* May 4, 2000
* May 6, 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.6j are Y2K compliant. It is my belief that earlier
* upward through 1.0.7beta11 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
@ -241,7 +246,7 @@ extern "C" {
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.0.6j"
#define PNG_LIBPNG_VER_STRING "1.0.7beta11"
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
@ -258,7 +263,8 @@ extern "C" {
* the version above.
*/
#ifdef PNG_USE_GLOBAL_ARRAYS
PNG_EXPORT_VAR (char) png_libpng_ver[12]; /* need room for 99.99.99aa */
PNG_EXPORT_VAR (char) png_libpng_ver[12]; /* need room for 99.99.99-patch-aa0*/
/* Note to maintainer: increase to 18 at the next opportunity */
#else
#define png_libpng_ver png_get_header_ver(NULL)
#endif
@ -367,11 +373,13 @@ typedef struct png_text_struct
png_charp text; /* comment, may be an empty string (ie "")
or a NULL pointer */
png_size_t text_length; /* length of the text string */
#ifdef PNG_iTXt_SUPPORTED
png_size_t itxt_length; /* length of the itxt string */
png_charp lang; /* language code, 0-79 characters
or a NULL pointer */
png_charp lang_key; /* keyword translated UTF-8 string, 0 or more
chars or a NULL pointer */
#endif
} png_text;
typedef png_text FAR * png_textp;
typedef png_text FAR * FAR * png_textpp;
@ -814,31 +822,33 @@ typedef png_row_info FAR * FAR * png_row_infopp;
typedef struct png_struct_def png_struct;
typedef png_struct FAR * png_structp;
typedef void (*png_error_ptr) PNGARG((png_structp, png_const_charp));
typedef void (*png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
typedef void (*png_flush_ptr) PNGARG((png_structp));
typedef void (*png_read_status_ptr) PNGARG((png_structp, png_uint_32, int));
typedef void (*png_write_status_ptr) PNGARG((png_structp, png_uint_32, int));
typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp));
typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32,
int));
typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32,
int));
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
typedef void (*png_progressive_info_ptr) PNGARG((png_structp, png_infop));
typedef void (*png_progressive_end_ptr) PNGARG((png_structp, png_infop));
typedef void (*png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop));
typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop));
typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
png_uint_32, int));
#endif
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_LEGACY_SUPPORTED)
typedef void (*png_user_transform_ptr) PNGARG((png_structp,
typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp,
png_row_infop, png_bytep));
#endif
#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
typedef int (*png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp));
typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp));
#endif
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
typedef void (*png_unknown_chunk_ptr) PNGARG((png_structp));
typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp));
#endif
/* Transform masks for the high-level interface */
@ -1101,9 +1111,9 @@ struct png_struct_def
};
/* This prevents a compiler error in png_get_copyright() in png.c if png.c
and png.h are both at * version 1.0.6j
and png.h are both at * version 1.0.7beta11
*/
typedef png_structp version_1_0_6j;
typedef png_structp version_1_0_7beta11;
typedef png_struct FAR * FAR * png_structpp;
@ -2103,7 +2113,7 @@ extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)
extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.0.6j - May 4, 2000 (header)\n"
" libpng version 1.0.7beta11 - May 6, 2000 (header)\n"
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* With these routines we avoid an integer divide, which will be slower on
@ -2169,8 +2179,6 @@ extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
#define PNG_WROTE_tIME 0x200
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
#define PNG_BACKGROUND_IS_GRAY 0x800
#define PNG_CREATED_READ_STRUCT 0x1000
#define PNG_CREATED_WRITE_STRUCT 0x2000
/* flags for the transformations the PNG library does on the image data */
#define PNG_BGR 0x0001
@ -2226,6 +2234,7 @@ extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
#define PNG_FLAG_FREE_HIST 0x4000
#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L
#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L
/* For use in png_set_keep_unknown, png_handle_as_unknown */
#define HANDLE_CHUNK_AS_DEFAULT 0
@ -2331,22 +2340,22 @@ PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf));
#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
/* Initialize png_ptr struct for reading, and allocate any other memory.
* (old interface - NOT DLL EXPORTED).
* (old interface - DEPRECATED).
*/
extern void png_read_init PNGARG((png_structp png_ptr));
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
#define png_read_init(png_ptr) png_read_init_2(png_ptr, \
PNG_LIBPNG_VER_STRING, sizeof(png_struct), sizeof(png_info));
extern void png_read_init_2 PNGARG((png_structp png_ptr,
extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
png_info_size));
/* Initialize png_ptr struct for writing, and allocate any other memory.
* (old interface - NOT DLL EXPORTED).
* (old interface - DEPRECATED).
*/
extern void png_write_init PNGARG((png_structp png_ptr));
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
#define png_write_init(png_ptr) png_write_init_2(png_ptr, \
PNG_LIBPNG_VER_STRING, sizeof(png_struct), sizeof(png_info));
extern void png_write_init_2 PNGARG((png_structp png_ptr,
extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr,
png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
png_info_size));

221
png_ptr.h
View File

@ -1,221 +0,0 @@
struct png_struct_def
{
#ifdef PNG_SETJMP_SUPPORTED
jmp_buf jmpbuf; /* used in png_error */
#endif
png_error_ptr error_fn; /* function for printing errors and aborting */
png_error_ptr warning_fn; /* function for printing warnings */
png_voidp error_ptr; /* user supplied struct for error functions */
png_rw_ptr write_data_fn; /* function for writing output data */
png_rw_ptr read_data_fn; /* function for reading input data */
png_voidp io_ptr; /* ptr to application struct for I/O functions*/
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
png_user_transform_ptr read_user_transform_fn; /* user read transform */
#endif
#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
png_user_transform_ptr write_user_transform_fn; /* user write transform */
#endif
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
png_voidp user_transform_ptr; /* user supplied struct for user transform */
png_byte user_transform_depth; /* bit depth of user transformed pixels */
png_byte user_transform_channels; /* channels in user transformed pixels */
#endif
#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
png_voidp user_chunk_ptr;
png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
#endif
png_uint_32 mode; /* tells us where we are in the PNG file */
png_uint_32 flags; /* flags indicating various things to libpng */
png_uint_32 transformations; /* which transformations to perform */
z_stream zstream; /* pointer to decompression structure (below) */
png_bytep zbuf; /* buffer for zlib */
png_size_t zbuf_size; /* size of zbuf */
int zlib_level; /* holds zlib compression level */
int zlib_method; /* holds zlib compression method */
int zlib_window_bits; /* holds zlib compression window bits */
int zlib_mem_level; /* holds zlib compression memory level */
int zlib_strategy; /* holds zlib compression strategy */
png_uint_32 width; /* width of image in pixels */
png_uint_32 height; /* height of image in pixels */
png_uint_32 num_rows; /* number of rows in current pass */
png_uint_32 usr_width; /* width of row at start of write */
png_uint_32 rowbytes; /* size of row in bytes */
png_uint_32 irowbytes; /* size of current interlaced row in bytes */
png_uint_32 iwidth; /* width of current interlaced row in pixels */
png_uint_32 row_number; /* current row in interlace pass */
png_bytep prev_row; /* buffer to save previous (unfiltered) row */
png_bytep row_buf; /* buffer to save current (unfiltered) row */
png_bytep sub_row; /* buffer to save "sub" row when filtering */
png_bytep up_row; /* buffer to save "up" row when filtering */
png_bytep avg_row; /* buffer to save "avg" row when filtering */
png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */
png_row_info row_info; /* used for transformation routines */
png_uint_32 idat_size; /* current IDAT size for read */
png_uint_32 crc; /* current chunk CRC value */
png_colorp palette; /* palette from the input file */
png_uint_16 num_palette; /* number of color entries in palette */
png_uint_16 num_trans; /* number of transparency values */
png_byte chunk_name[5]; /* null-terminated name of current chunk */
png_byte compression; /* file compression type (always 0) */
png_byte filter; /* file filter type (always 0) */
png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
png_byte pass; /* current interlace pass (0 - 6) */
png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */
png_byte color_type; /* color type of file */
png_byte bit_depth; /* bit depth of file */
png_byte usr_bit_depth; /* bit depth of users row */
png_byte pixel_depth; /* number of bits per pixel */
png_byte channels; /* number of channels in file */
png_byte usr_channels; /* channels at start of write */
png_byte sig_bytes; /* magic bytes read/written from start of file */
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
png_uint_16 filler; /* filler bytes for pixel expansion */
#endif
#if defined(PNG_READ_bKGD_SUPPORTED)
png_byte background_gamma_type;
#ifdef PNG_FLOATING_POINT_SUPPORTED
float background_gamma;
#endif
png_color_16 background; /* background color in screen gamma space */
# if defined(PNG_READ_GAMMA_SUPPORTED)
png_color_16 background_1; /* background normalized to gamma 1.0 */
# endif /* PNG_READ_GAMMA && PNG_READ_bKGD_SUPPORTED */
#endif /* PNG_READ_bKGD_SUPPORTED */
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
png_flush_ptr output_flush_fn;/* Function for flushing output */
png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */
png_uint_32 flush_rows; /* number of rows written since last flush */
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
int gamma_shift; /* number of "insignificant" bits 16-bit gamma */
#ifdef PNG_FLOATING_POINT_SUPPORTED
float gamma; /* file gamma value */
float screen_gamma; /* screen gamma value (display_exponent) */
#endif
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
png_bytep gamma_table; /* gamma table for 8-bit depth files */
png_bytep gamma_from_1; /* converts from 1.0 to screen */
png_bytep gamma_to_1; /* converts from file to 1.0 */
png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined (PNG_READ_sBIT_SUPPORTED)
png_color_8 sig_bit; /* significant bits in each available channel */
#endif
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
png_color_8 shift; /* shift for significant bit tranformation */
#endif
#if defined(PNG_READ_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
|| defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
png_bytep trans; /* transparency values for paletted files */
png_color_16 trans_values; /* transparency values for non-paletted files */
#endif
png_read_status_ptr read_row_fn; /* called after each row is decoded */
png_write_status_ptr write_row_fn; /* called after each row is encoded */
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
png_progressive_info_ptr info_fn; /* called after header data fully read */
png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */
png_progressive_end_ptr end_fn; /* called after image is complete */
png_bytep save_buffer_ptr; /* current location in save_buffer */
png_bytep save_buffer; /* buffer for previously read data */
png_bytep current_buffer_ptr; /* current location in current_buffer */
png_bytep current_buffer; /* buffer for recently used data */
png_uint_32 push_length; /* size of current input chunk */
png_uint_32 skip_length; /* bytes to skip in input data */
png_size_t save_buffer_size; /* amount of data now in save_buffer */
png_size_t save_buffer_max; /* total size of save_buffer */
png_size_t buffer_size; /* total amount of available input data */
png_size_t current_buffer_size; /* amount of data now in current_buffer */
int process_mode; /* what push library is currently doing */
int cur_palette; /* current push library palette index */
# if defined(PNG_READ_TEXT_SUPPORTED)
png_size_t current_text_size; /* current size of text input data */
png_size_t current_text_left; /* how much text left to read in input */
png_charp current_text; /* current text chunk buffer */
png_charp current_text_ptr; /* current location in current_text */
# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_READ_TEXT_SUPPORTED */
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
/* for the Borland special 64K segment handler */
png_bytepp offset_table_ptr;
png_bytep offset_table;
png_uint_16 offset_table_number;
png_uint_16 offset_table_count;
png_uint_16 offset_table_count_free;
#endif
#if defined(PNG_READ_DITHER_SUPPORTED)
png_bytep palette_lookup; /* lookup table for dithering */
png_bytep dither_index; /* index translation for palette files */
#endif
#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_READ_hIST_SUPPORTED)
png_uint_16p hist; /* histogram */
#endif
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
png_byte heuristic_method; /* heuristic for row filter selection */
png_byte num_prev_filters; /* number of weights for previous rows */
png_bytep prev_filters; /* filter type(s) of previous row(s) */
png_uint_16p filter_weights; /* weight(s) for previous line(s) */
png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */
png_uint_16p filter_costs; /* relative filter calculation cost */
png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */
#endif
#if defined(PNG_TIME_RFC1123_SUPPORTED)
png_charp time_buffer; /* String to hold RFC 1123 time text */
#endif
#ifdef PNG_USER_MEM_SUPPORTED
png_voidp mem_ptr; /* user supplied struct for mem functions */
png_malloc_ptr malloc_fn; /* function for allocating memory */
png_free_ptr free_fn; /* function for freeing memory */
#endif
#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
png_byte rgb_to_gray_status;
png_uint_16 rgb_to_gray_red_coeff;
png_uint_16 rgb_to_gray_green_coeff;
png_uint_16 rgb_to_gray_blue_coeff;
#endif
#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
png_byte empty_plte_permitted;
#endif
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
int num_chunk_list;
png_bytep chunk_list;
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
png_fixed_point int_gamma;
#endif
png_uint_32 free_me; /* flags items libpng is responsible for freeing */
};

View File

@ -1,6 +1,6 @@
/* pngasmrd.h - assembler version of utilities to read a PNG file
*
* libpng 1.0.6j - May 4, 2000
* libpng 1.0.7beta11 - May 6, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1999, 2000 Glenn Randers-Pehrson
*

141
pngconf.h
View File

@ -1,7 +1,6 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng 1.0.6j - May 4, 2000
* libpng 1.0.7beta11 - May 6, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -258,15 +257,31 @@
/* Any features you will not be using can be undef'ed here */
/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
on the compile line, then pick and choose which ones to define without
having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
if you only want to have a png-compliant reader/writer but don't need
any of the extra transformations. This saves about 80 kbytes in a
typical installation of the library. (PNG_NO_* form added in version
1.0.1c, for consistency)
* to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
* on the compile line, then pick and choose which ones to define without
* having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
* if you only want to have a png-compliant reader/writer but don't need
* any of the extra transformations. This saves about 80 kbytes in a
* typical installation of the library. (PNG_NO_* form added in version
* 1.0.1c, for consistency)
*/
/* The size of the png_text structure changed in libpng-1.0.6 when
* iTXt is supported. It is turned off by default, to support old apps
* that malloc the png_text structure instead of calling png_set_text()
* and letting libpng malloc it. It will be turned on by default in
* libpng-2.0.0.
*/
#ifndef PNG_iTXt_SUPPORTED
# ifndef PNG_READ_iTXt_SUPPORTED
# define PNG_NO_READ_iTXt
# endif
# ifndef PNG_WRITE_iTXt_SUPPORTED
# define PNG_NO_WRITE_iTXt
# endif
#endif
/* The following support, added after version 1.0.0, can be turned off here en
* masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
* with old applications that require the length of png_struct and png_info
@ -280,6 +295,8 @@
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_iCCP
#define PNG_NO_WRITE_iCCP
#define PNG_NO_READ_iTXt
#define PNG_NO_WRITE_iTXt
#define PNG_NO_READ_sCAL
#define PNG_NO_WRITE_sCAL
#define PNG_NO_READ_sPLT
@ -290,6 +307,7 @@
#define PNG_NO_WRITE_USER_TRANSFORM
#define PNG_NO_USER_MEM
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_FIXED_POINT_SUPPORTED
#endif
#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
@ -298,7 +316,8 @@
/* Ignore attempt to turn off both floating and fixed point support */