提交 17218294 编写于 作者: G Glenn Randers-Pehrson

Imported from libpng-1.4.0beta1.tar

上级 f628ee2f
Libpng 1.2.10rc1 - April 19, 2006
Libpng 1.4.0beta1 - April 20, 2006
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.
......@@ -9,32 +9,32 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
1.2.10rc1.tar.gz
1.2.10rc1.tar.bz2
1.4.0beta1.tar.gz
1.4.0beta1.tar.bz2
Source files with LF line endings (for Unix/Linux) without the
"configure" script
1.2.10rc1-no-config.tar.gz
1.2.10rc1-no-config.tar.bz2
1.4.0beta1-no-config.tar.gz
1.4.0beta1-no-config.tar.bz2
Source files with CRLF line endings (for Windows), without the
"configure" script
lp1210r01.zip
lp1210r01.tar.bz2
lp140b01.zip
lp140b01.tar.bz2
Project files
1.2.10rc1-project-netware.zip
1.2.10rc1-project-wince.zip
1.4.0beta1-project-netware.zip
1.4.0beta1-project-wince.zip
Other information:
1.2.10rc1-README.txt
1.2.10rc1-KNOWNBUGS.txt
1.2.10rc1-LICENSE.txt
1.2.10rc1-Y2K-compliance.txt
1.4.0beta1-README.txt
1.4.0beta1-KNOWNBUGS.txt
1.4.0beta1-LICENSE.txt
1.4.0beta1-Y2K-compliance.txt
Changes since the last public release (1.2.9):
......@@ -64,10 +64,27 @@ version 1.2.10beta6 [April 17, 2006]
version 1.2.10beta7 [April 18, 2006]
Change "exec_prefix=$prefix" to "exec_prefix=$(prefix)" in makefiles.
version 1.2.10beta8 [April 19, 2006]
version 1.2.10rc1 [April 19, 2006]
Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD
Fixed "LN_FS" typo in makefile.sco and makefile.solaris.
version 1.2.10rc2 [April 19, 2006]
Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE
in configure.ac
Made the configure warning about versioned symbols less arrogant.
version 1.4.0beta1 [April 20, 2006]
Enabled iTXt support (changes png_struct, thus requires so-number change).
Cleaned up PNG_ASSEMBLER_CODE_SUPPORTED vs PNG_MMX_CODE_SUPPORTED
Eliminated PNG_1_0_X and PNG_1_2_X macros.
Removed deprecated functions png_read_init, png_write_init, png_info_init,
png_permit_empty_plte, png_set_gray_1_2_4_to_8, and removed the
deprecated macro PNG_MAX_UINT.
Moved "PNG_INTERNAL" parts of png.h and pngconf.h into pngintrn.h
Removed many WIN32_WCE #ifdefs (Cosmin).
Reduced dependency on C-runtime library when on Windows (Simon-Pierre)
Replaced sprintf() with png_sprintf() (Simon-Pierre)
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
......
......@@ -1480,7 +1480,7 @@ version 1.2.9beta5 [March 4, 2006]
Restored scripts/makefile.elf which was inadvertently deleted.
version 1.2.9beta6 [March 6, 2006]
Fixed typo (10) in configuration files.
Fixed typo (0) in configuration files.
version 1.2.9beta7 [March 7, 2006]
Removed libpng.vers and libpng.sym from libpng12_la_SOURCES in Makefile.am
......@@ -1552,14 +1552,28 @@ version 1.2.10rc1 [April 19, 2006]
Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD
Fixed "LN_FS" typo in makefile.sco and makefile.solaris.
version 1.4.0beta1 [future]
version 1.2.10rc2 [April 19, 2006]
Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE
in configure.ac and configure
Made the configure warning about versioned symbols less arrogant.
version 1.4.0beta1 [April 20, 2006]
Enabled iTXt support (changes png_struct, thus requires so-number change).
Cleaned up PNG_ASSEMBLER_CODE_SUPPORTED vs PNG_MMX_CODE_SUPPORTED
Eliminated PNG_1_0_X and PNG_1_2_X macros.
Removed deprecated functions png_read_init, png_write_init, png_info_init,
png_permit_empty_plte, png_set_gray_1_2_4_to_8, and removed the
deprecated macro PNG_MAX_UINT.
Cleaned up PNG_ASSEMBLER_CODE_SUPPORTED vs PNG_MMX_CODE_SUPPORTED
Moved "PNG_INTERNAL" parts of png.h and pngconf.h into pngintrn.h
Removed many WIN32_WCE #ifdefs (Cosmin).
Reduced dependency on C-runtime library when on Windows (Simon-Pierre)
Replaced sprintf() with png_sprintf() (Simon-Pierre)
version 1.4.0betaN [future]
Cleaned up error and warning messages.
Implemented sTER chunk.
Cleaned up WINCE project.
Moved "PNG_INTERNAL" parts of png.h into a new private header, pngintrn.h
Build shared libraries with -lz and sometimes -lm.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
......
Installing libpng version 1.2.10rc1 - April 19, 2006
Installing libpng version 1.4.0beta1 - April 20, 2006
On Unix/Linux and similar systems, you can simply type
......@@ -29,7 +29,7 @@ to have access to the 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.2.10rc1" or "lpng109" and "zlib-1.2.1"
might be called "libpng-1.4.0beta1" or "lpng109" and "zlib-1.2.1"
or "zlib121") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
......@@ -85,11 +85,11 @@ include
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.10rc1)
gcc, creates libpng14.so.0.1.4.0beta1)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.10rc1)
(gcc, creates libpng14.so.0.1.4.0beta1)
makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.10rc1,
(gcc, creates libpng14.so.0.1.4.0beta1,
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
......@@ -107,17 +107,17 @@ include
makefile.intel => Intel C/C++ version 4.0 and later
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD,
makes libpng12.so
makefile.ne14bsd => NetBSD/cc makefile, uses PNGGCCRD,
makes libpng14.so
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc,
creates libpng12.so.0.1.2.10rc1)
creates libpng14.so.0.1.4.0beta1)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng12.so.0.1.2.10rc1)
creates libpng14.so.0.1.4.0beta1)
makefile.so9 => Solaris 9 makefile (gcc,
creates libpng12.so.0.1.2.10rc1)
creates libpng14.so.0.1.4.0beta1)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
......
Known bugs in libpng version 1.2.10rc1
Known bugs in libpng version 1.4.0beta1
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
reading interlaced PNG files, when assembler code is enabled but running
......
......@@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.10rc1, April 19, 2006, are
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta1, April 20, 2006, are
Copyright (c) 2004, 2006 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
......@@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
April 19, 2006
April 20, 2006
......@@ -16,7 +16,7 @@ AUTOMAKE_OPTIONS = foreign
# test programs - run on make check, make distcheck
check_PROGRAMS= pngtest
pngtest_SOURCES = pngtest.c
pngtest_LDADD = libpng12.la
pngtest_LDADD = libpng14.la
TESTS = test-pngtest.sh
TESTS_ENVIRONMENT= srcdir=$(srcdir)
......@@ -24,39 +24,39 @@ TESTS_ENVIRONMENT= srcdir=$(srcdir)
dist_man_MANS= libpng.3 libpngpf.3 png.5
# generate the -config scripts if required
binconfigs= libpng12-config
EXTRA_SCRIPTS= libpng-config libpng12-config
binconfigs= libpng14-config
EXTRA_SCRIPTS= libpng-config libpng14-config
bin_SCRIPTS= @binconfigs@
# rules to build libpng, only build the old library on request
lib_LTLIBRARIES=libpng12.la @compatlib@
lib_LTLIBRARIES=libpng14.la @compatlib@
EXTRA_LTLIBRARIES= libpng.la
libpng12_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
libpng14_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c \
png.h pngconf.h
libpng_la_SOURCES = $(libpng12_la_SOURCES)
png.h pngconf.h pngintrn.h
libpng_la_SOURCES = $(libpng14_la_SOURCES)
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@
libpng14_la_CPPFLAGS = @LIBPNG_DEFINES@
# MAJOR UPGRADE: the version-number settings below must be changed.
libpng12_la_LDFLAGS = -no-undefined -export-dynamic \
libpng14_la_LDFLAGS = -no-undefined -export-dynamic \
-version-number 0:@PNGLIB_MINOR@:0
# -rpath is needed as automake doesn't know the directory
libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
-version-number 3:@PNGLIB_MINOR@:0
-version-number 14:@PNGLIB_MINOR@:0
if HAVE_LD_VERSION_SCRIPT
# Versioned symbols and restricted exports
libpng12_la_LDFLAGS += -Wl,--version-script=libpng.vers
libpng12_la_DEPENDENCIES = libpng.vers
libpng14_la_LDFLAGS += -Wl,--version-script=libpng.vers
libpng14_la_DEPENDENCIES = libpng.vers
else
# Only restricted exports when possible
libpng12_la_LDFLAGS += -export-symbols libpng.sym
libpng12_la_DEPENDENCIES = libpng.sym
libpng14_la_LDFLAGS += -export-symbols libpng.sym
libpng14_la_DEPENDENCIES = libpng.sym
endif
libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES)
libpng_la_DEPENDENCIES = $(libpng14_la_DEPENDENCIES)
#distribute headers in /usr/include/libpng/*
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
......@@ -65,7 +65,7 @@ pkginclude_HEADERS= png.h pngconf.h
# pkg-config stuff, note that libpng.pc is always required in order
# to get the correct library
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libpng12.pc
pkgconfig_DATA = libpng14.pc
#extra source distribution files.
EXTRA_DIST= \
......@@ -85,7 +85,7 @@ EXTRA_DIST= \
$(TESTS) \
example.c libpng.txt pngvcrd.c
CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers libpng.sym
CLEANFILES= pngout.png libpng14.pc libpng14-config libpng.vers libpng.sym
$(PNGLIB_BASENAME).pc: libpng.pc
cp libpng.pc $@
......@@ -116,7 +116,7 @@ install-data-hook:
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
# do evil things to libpng to cause libpng12 to be used, if
# do evil things to libpng to cause libpng14 to be used, if
# the compat library is not being built do nothing.
install-exec-hook:
cd $(DESTDIR)$(bindir); rm -f libpng-config
......
此差异已折叠。
README for libpng version 1.2.10rc1 - April 19, 2006 (shared library 12.0)
README for libpng version 1.4.0beta1 - April 20, 2006 (shared library 14.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
......@@ -190,11 +190,11 @@ Files in this distribution:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.10rc1)
gcc, creates libpng14.so.0.1.4.0beta1)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.10rc1)
(gcc, creates libpng14.so.0.1.4.0beta1)
makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.10rc1,
(gcc, creates libpng14.so.0.1.4.0beta1,
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
......@@ -212,16 +212,16 @@ Files in this distribution:
makefile.intel => Intel C/C++ version 4.0 and later
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so.
makefile.ne12bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng12.so
makefile.ne14bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng14.so
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng12.so.0.1.2.10rc1)
(gcc, creates libpng14.so.0.1.4.0beta1)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng12.so.0.1.2.10rc1)
(gcc, creates libpng14.so.0.1.4.0beta1)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng12.so.0.1.2.10rc1)
(gcc, creates libpng14.so.0.1.4.0beta1)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
......
Y2K compliance in libpng:
=========================
April 19, 2006
April 20, 2006
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.2.10rc1 are Y2K compliant. It is my belief that earlier
upward through 1.4.0beta1 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
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for libpng 1.2.10rc1.
# Generated by GNU Autoconf 2.59 for libpng 1.4.0beta1.
#
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
#
......@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libpng'
PACKAGE_TARNAME='libpng'
PACKAGE_VERSION='1.2.10rc1'
PACKAGE_STRING='libpng 1.2.10rc1'
PACKAGE_VERSION='1.4.0beta1'
PACKAGE_STRING='libpng 1.4.0beta1'
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
ac_unique_file="pngget.c"
......@@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libpng 1.2.10rc1 to adapt to many kinds of systems.
\`configure' configures libpng 1.4.0beta1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1020,7 +1020,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libpng 1.2.10rc1:";;
short | recursive ) echo "Configuration of libpng 1.4.0beta1:";;
esac
cat <<\_ACEOF
......@@ -1167,7 +1167,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
libpng configure 1.2.10rc1
libpng configure 1.4.0beta1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
......@@ -1181,7 +1181,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpng $as_me 1.2.10rc1, which was
It was created by libpng $as_me 1.4.0beta1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
......@@ -1824,7 +1824,7 @@ fi
# Define the identity of the package.
PACKAGE='libpng'
VERSION='1.2.10rc1'
VERSION='1.4.0beta1'
cat >>confdefs.h <<_ACEOF
......@@ -1979,9 +1979,9 @@ fi
PNGLIB_VERSION=1.2.10rc1
PNGLIB_MAJOR=12
PNGLIB_MINOR=10
PNGLIB_VERSION=1.4.0beta1
PNGLIB_MAJOR=14
PNGLIB_MINOR=0
......@@ -20141,8 +20141,8 @@ echo "$as_me: error: zlib not installed" >&2;}
fi
echo "$as_me:$LINENO: checking if assembler code in pnggccrd.c can be compiled" >&5
echo $ECHO_N "checking if assembler code in pnggccrd.c can be compiled... $ECHO_C" >&6
echo "$as_me:$LINENO: checking if pnggccrd.c can be compiled without -DPNG_NO_MMX_CODE" >&5
echo $ECHO_N "checking if pnggccrd.c can be compiled without -DPNG_NO_MMX_CODE... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
......@@ -20185,7 +20185,7 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -DPNG_NO_ASSEMBLER_CODE
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG\ -DPNG_NO_MMX_CODE
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$LIBPNG_DEFINES"; then
......@@ -20209,8 +20209,8 @@ else
have_ld_version_script=no
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
{ echo "$as_me:$LINENO: WARNING: *** You may want to rerun configure using --with-gnu-ld to enable versioned symbols." >&5
echo "$as_me: WARNING: *** You may want to rerun configure using --with-gnu-ld to enable versioned symbols." >&2;}
{ echo "$as_me:$LINENO: WARNING: *** You have not enabled versioned symbols." >&5
echo "$as_me: WARNING: *** You have not enabled versioned symbols." >&2;}
fi
......@@ -20681,7 +20681,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by libpng $as_me 1.2.10rc1, which was
This file was extended by libpng $as_me 1.4.0beta1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -20744,7 +20744,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
libpng config.status 1.2.10rc1
libpng config.status 1.4.0beta1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
......
......@@ -18,14 +18,14 @@ AC_PREREQ(2.59)
dnl Version number stuff here:
AC_INIT([libpng], [1.2.10rc1], [png-mng-implement@lists.sourceforge.net])
AC_INIT([libpng], [1.4.0beta1], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE
dnl stop configure from automagically running automake
AM_MAINTAINER_MODE
PNGLIB_VERSION=1.2.10rc1
PNGLIB_MAJOR=12
PNGLIB_MINOR=10
PNGLIB_VERSION=1.4.0beta1
PNGLIB_MAJOR=14
PNGLIB_MINOR=0
dnl End of version number stuff
......@@ -58,12 +58,12 @@ AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
AC_MSG_CHECKING([if assembler code in pnggccrd.c can be compiled])
AC_MSG_CHECKING([if pnggccrd.c can be compiled without -DPNG_NO_MMX_CODE])
AC_TRY_COMPILE(
[#include "pnggccrd.c"],
[return 0;],
LIBPNG_DEFINES=,
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -DPNG_NO_ASSEMBLER_CODE)
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG\ -DPNG_NO_MMX_CODE)
if test "$LIBPNG_DEFINES"; then
AC_MSG_RESULT(no)
else
......@@ -80,7 +80,7 @@ if test "$GLD"; then
else
have_ld_version_script=no
AC_MSG_RESULT(no)
AC_MSG_WARN(*** You may want to rerun configure using --with-gnu-ld to enable versioned symbols.)
AC_MSG_WARN(*** You have not enabled versioned symbols.)
fi
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
......
.TH LIBPNG 3 "April 19, 2006"
.TH LIBPNG 3 "April 20, 2006"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.10rc1
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta1
.SH SYNOPSIS
\fI\fB
......@@ -821,7 +821,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.2.10rc1 - April 19, 2006
libpng version 1.4.0beta1 - April 20, 2006
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2005 Glenn Randers-Pehrson
......@@ -1620,8 +1620,6 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha.
At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
will be removed from a future version.
PNG can have files with 16 bits per channel. If you only can handle
8 bits per channel, this will strip the pixels down to 8 bit.
......@@ -3633,7 +3631,7 @@ The following code can be used to prevent an application from using the
thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK
defined:
#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \
#if defined(PNG_USE_PNGGCCRD) && defined(PNG_MMX_CODE_SUPPORTED) \
&& defined(PNG_THREAD_UNSAFE_OK)
/* Disable thread-unsafe features of pnggccrd */
if (png_access_version() >= 10200)
......@@ -3730,13 +3728,13 @@ application:
.SH IX. Y2K Compliance in libpng
April 19, 2006
April 20, 2006
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.2.10rc1 are Y2K compliant. It is my belief that earlier
upward through 1.4.0beta1 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
......@@ -3894,6 +3892,8 @@ the first widely used release:
1.2.9rc1 13 10209 12.so.0.9[.0]
1.2.9 13 10209 12.so.0.9[.0]
1.2.10beta1-8 13 10210 12.so.0.10[.0]
1.2.10rc1-2 13 10210 12.so.0.10[.0]
1.4.0beta1 14 10401 14.so.0.0[.0]
Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be
......@@ -3949,7 +3949,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.2.10rc1 - April 19, 2006:
Libpng version 1.4.0beta1 - April 20, 2006:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
......@@ -3970,7 +3970,7 @@ included in the libpng distribution, the latter shall prevail.)
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.10rc1, April 19, 2006, are
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta1, April 20, 2006, are
Copyright (c) 2004-2006 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
......@@ -4069,7 +4069,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
April 19, 2006
April 20, 2006
.\" end of man page
libpng.txt - A description on how to use and modify libpng
libpng version 1.2.10rc1 - April 19, 2006
libpng version 1.4.0beta1 - April 20, 2006
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2005 Glenn Randers-Pehrson
......@@ -799,8 +799,6 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha.
At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
will be removed from a future version.
PNG can have files with 16 bits per channel. If you only can handle
8 bits per channel, this will strip the pixels down to 8 bit.
......@@ -2812,7 +2810,7 @@ The following code can be used to prevent an application from using the
thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK
defined:
#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \
#if defined(PNG_USE_PNGGCCRD) && defined(PNG_MMX_CODE_SUPPORTED) \
&& defined(PNG_THREAD_UNSAFE_OK)
/* Disable thread-unsafe features of pnggccrd */
if (png_access_version() >= 10200)
......@@ -2909,13 +2907,13 @@ application:
IX. Y2K Compliance in libpng
April 19, 2006
April 20, 2006
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.2.10rc1 are Y2K compliant. It is my belief that earlier
upward through 1.4.0beta1 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
......
.TH LIBPNGPF 3 "April 19, 2006"
.TH LIBPNGPF 3 "April 20, 2006"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.10rc1
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta1
(private functions)
.SH SYNOPSIS
\fB#include <png.h>\fP
......
.TH PNG 5 "April 19, 2006"
.TH PNG 5 "April 20, 2006"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION
......
......@@ -8,12 +8,12 @@
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
#define PNG_INTERNAL
#define PNG_NO_EXTERN
#include "png.h"
#include "pngintrn.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_10rc1 Your_png_h_is_not_version_1_2_10rc1;
typedef version_1_4_0beta1 Your_png_h_is_not_version_1_4_0beta1;
/* Version information for C files. This had better match the version
* string defined in png.h. */
......@@ -68,7 +68,7 @@ const int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
const int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
/* width of interlace block (used in assembler routines only) */
#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
#ifdef PNG_HAVE_MMX_COMBINE_ROW
const int FARDATA png_pass_width[] = {8, 4, 4, 2, 2, 1, 1};
#endif
......@@ -130,26 +130,11 @@ png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check)));
}
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
/* (Obsolete) function to check signature bytes. It does not allow one
* 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 PNGAPI
png_check_sig(png_bytep sig, int num)
{
return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num));
}
#endif
#endif /* PNG_READ_SUPPORTED */
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
/* Function to allocate memory for zlib and clear it to 0. */
#ifdef PNG_1_0_X
voidpf PNGAPI
#else
voidpf /* private */
#endif
png_zalloc(voidpf png_ptr, uInt items, uInt size)
{
png_voidp ptr;
......@@ -168,30 +153,11 @@ png_zalloc(voidpf png_ptr, uInt items, uInt size)
ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
p->flags=save_flags;
#if defined(PNG_1_0_X) && !defined(PNG_NO_ZALLOC_ZERO)
if (ptr == NULL)
return ((voidpf)ptr);
if (num_bytes > (png_uint_32)0x8000L)
{
png_memset(ptr, 0, (png_size_t)0x8000L);
png_memset((png_bytep)ptr + (png_size_t)0x8000L, 0,
(png_size_t)(num_bytes - (png_uint_32)0x8000L));
}
else
{
png_memset(ptr, 0, (png_size_t)num_bytes);
}
#endif
return ((voidpf)ptr);
}
/* function to free memory for zlib */
#ifdef PNG_1_0_X
void PNGAPI
#else
void /* private */
#endif
png_zfree(voidpf png_ptr, voidpf ptr)
{
png_free((png_structp)png_ptr, (png_voidp)ptr);
......@@ -289,16 +255,6 @@ 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.
*/
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
#undef png_info_init
void PNGAPI
png_info_init(png_infop info_ptr)
{
/* We only come here via pre-1.0.12-compiled applications */
png_info_init_3(&info_ptr, 0);
}
#endif
void PNGAPI
png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
{
......@@ -647,21 +603,10 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
png_sizeof(char)));
}
#if defined(_WIN32_WCE)
{
wchar_t time_buf[29];
wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"),
ptime->day % 32, short_months[(ptime->month - 1) % 12],
ptime->year, ptime->hour % 24, ptime->minute % 60,
ptime->second % 61);
WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer, 29,
NULL, NULL);
}
#else
#ifdef USE_FAR_KEYWORD
{
char near_time_buf[29];
sprintf(near_time_buf, "%d %s %d %02d:%02d:%02d +0000",
png_sprintf(near_time_buf, "%d %s %d %02d:%02d:%02d +0000",
ptime->day % 32, short_months[(ptime->month - 1) % 12],
ptime->year, ptime->hour % 24, ptime->minute % 60,
ptime->second % 61);
......@@ -669,12 +614,11 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
29*png_sizeof(char));
}
#else
sprintf(png_ptr->time_buffer, "%d %s %d %02d:%02d:%02d +0000",
png_sprintf(png_ptr->time_buffer, "%d %s %d %02d:%02d:%02d +0000",
ptime->day % 32, short_months[(ptime->month - 1) % 12],
ptime->year, ptime->hour % 24, ptime->minute % 60,
ptime->second % 61);
#endif
#endif /* _WIN32_WCE */
return ((png_charp)png_ptr->time_buffer);
}
#endif /* PNG_TIME_RFC1123_SUPPORTED */
......@@ -693,7 +637,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr)
{
if (&png_ptr != NULL) /* silence compiler warning about unused png_ptr */
return ((png_charp) "\n libpng version 1.2.10rc1 - April 19, 2006\n\
return ((png_charp) "\n libpng version 1.4.0beta1 - April 20, 2006\n\
Copyright (c) 1998-2006 Glenn Randers-Pehrson\n\
Copyright (c) 1996-1997 Andreas Dilger\n\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
......@@ -771,8 +715,7 @@ png_access_version_number(void)
#if defined(PNG_READ_SUPPORTED)
#if !defined(PNG_1_0_X)
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if defined(PNG_MMX_CODE_SUPPORTED)
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */
/* this INTERNAL function was added to libpng 1.2.0 */
void /* PRIVATE */
......@@ -787,13 +730,13 @@ png_init_mmx_flags (png_structp png_ptr)
if (png_mmx_support() > 0) {
png_ptr->asm_flags |= PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU
# ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
# ifdef PNG_HAVE_MMX_COMBINE_ROW
| PNG_ASM_FLAG_MMX_READ_COMBINE_ROW
# endif
# ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE
# ifdef PNG_HAVE_MMX_READ_INTERLACE
| PNG_ASM_FLAG_MMX_READ_INTERLACE
# endif
# ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
# ifndef PNG_HAVE_MMX_READ_FILTER_ROW
;
# else
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB
......@@ -810,7 +753,7 @@ png_init_mmx_flags (png_structp png_ptr)
| PNG_MMX_WRITE_FLAGS );
}
# else /* !((PNGVCRD || PNGGCCRD) && PNG_ASSEMBLER_CODE_SUPPORTED)) */
# else /* !((PNGVCRD || PNGGCCRD) && PNG_MMX_CODE_SUPPORTED)) */
/* clear all MMX flags; no support is compiled in */
png_ptr->asm_flags &= ~( PNG_MMX_FLAGS );
......@@ -818,18 +761,17 @@ png_init_mmx_flags (png_structp png_ptr)
# endif /* ?(PNGVCRD || PNGGCCRD) */
}
#endif /* !(PNG_ASSEMBLER_CODE_SUPPORTED) */
#endif /* !(PNG_MMX_CODE_SUPPORTED) */
/* this function was added to libpng 1.2.0 */
#if !defined(PNG_USE_PNGGCCRD) && \
!(defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD))
!(defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD))
int PNGAPI
png_mmx_support(void)
{
return -1;
}
#endif
#endif /* PNG_1_0_X */
#endif /* PNG_READ_SUPPORTED */
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
......
此差异已折叠。
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.2.10rc1 - April 19, 2006
* libpng version 1.4.0beta1 - April 20, 2006
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2005 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
......@@ -17,7 +17,6 @@
#ifndef PNGCONF_H
#define PNGCONF_H
#define PNG_1_2_X
/*
* PNG_USER_CONFIG has to be defined on the compiler command line. This
......@@ -106,7 +105,7 @@
/* Enabled by default in 1.2.0. You can disable this if you don't need to
support PNGs that are embedded in MNG datastreams */
#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
#if !defined(PNG_NO_MNG_FEATURES)
# ifndef PNG_MNG_FEATURES_SUPPORTED
# define PNG_MNG_FEATURES_SUPPORTED
# endif
......@@ -248,10 +247,7 @@
# endif
# endif
# else
# if !defined(_WIN32_WCE)
/* "stdio.h" functions are not supported on WindowsCE */
# include <stdio.h>
# endif
# include <stdio.h>
# endif
/* This macro protects us against machines that don't have function
......@@ -337,93 +333,6 @@
#endif
/* Other defines for things like memory and the like can go here. */
#ifdef PNG_INTERNAL
#include <stdlib.h>
/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
* aren't usually used outside the library (as far as I know), so it is
* debatable if they should be exported at all. In the future, when it is
* possible to have run-time registry of chunk-handling functions, some of
* these will be made available again.
#define PNG_EXTERN extern
*/
#define PNG_EXTERN
/* Other defines specific to compilers can go here. Try to keep
* them inside an appropriate ifdef/endif pair for portability.
*/
#if defined(PNG_FLOATING_POINT_SUPPORTED)
# if defined(MACOS)
/* We need to check that <math.h> hasn't already been included earlier
* as it seems it doesn't agree with <fp.h>, yet we should really use
* <fp.h> if possible.
*/
# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
# include <fp.h>
# endif
# else
# include <math.h>
# endif
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
*/
# include <m68881.h>
# endif
#endif
/* Codewarrior on NT has linking problems without this. */
#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
# define PNG_ALWAYS_EXTERN
#endif
/* This provides the non-ANSI (far) memory allocation routines. */
#if defined(__TURBOC__) && defined(__MSDOS__)
# include <mem.h>
# include <alloc.h>
#endif
/* I have no idea why is this necessary... */
#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
# include <malloc.h>
#endif
/* This controls how fine the dithering gets. As this allocates
* a largish chunk of memory (32K), those who are not as concerned
* with dithering quality can decrease some or all of these.
*/
#ifndef PNG_DITHER_RED_BITS
# define PNG_DITHER_RED_BITS 5
#endif
#ifndef PNG_DITHER_GREEN_BITS
# define PNG_DITHER_GREEN_BITS 5
#endif
#ifndef PNG_DITHER_BLUE_BITS
# define PNG_DITHER_BLUE_BITS 5
#endif
/* This controls how fine the gamma correction becomes when you
* are only interested in 8 bits anyway. Increasing this value
* results in more memory being used, and more pow() functions
* being called to fill in the gamma tables. Don't set this value
* less then 8, and even that may not work (I haven't tested it).
*/
#ifndef PNG_MAX_GAMMA_8
# define PNG_MAX_GAMMA_8 11
#endif
/* This controls how much a difference in gamma we can tolerate before
* we actually start doing gamma conversion.
*/
#ifndef PNG_GAMMA_THRESHOLD
# define PNG_GAMMA_THRESHOLD 0.05
#endif
#endif /* PNG_INTERNAL */
/* The following uses const char * instead of char * for error
* and warning message functions, so some compilers won't complain.
......@@ -466,21 +375,9 @@
* iTXt support was added. iTXt support was turned off by default through
* libpng-1.2.x, to support old apps that malloc the png_text structure
* instead of calling png_set_text() and letting libpng malloc it. It
* was turned on by default in libpng-1.3.0.
* was turned on by default in libpng-1.4.0.
*/
#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
# ifndef PNG_NO_iTXt_SUPPORTED
# define PNG_NO_iTXt_SUPPORTED
# endif
# ifndef PNG_NO_READ_iTXt
# define PNG_NO_READ_iTXt
# endif
# ifndef PNG_NO_WRITE_iTXt
# define PNG_NO_WRITE_iTXt
# endif
#endif
#if !defined(PNG_NO_iTXt_SUPPORTED)
# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
# define PNG_READ_iTXt
......@@ -607,14 +504,6 @@
# endif
#endif
#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
/* Deprecated, will be removed from version 2.0.0.
Use PNG_MNG_FEATURES_SUPPORTED instead. */
#ifndef PNG_NO_READ_EMPTY_PLTE
# define PNG_READ_EMPTY_PLTE_SUPPORTED
#endif
#endif
#endif /* PNG_READ_SUPPORTED */
#if defined(PNG_WRITE_SUPPORTED)
......@@ -674,20 +563,11 @@
# define PNG_WRITE_FLUSH_SUPPORTED
#endif
#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
#ifndef PNG_NO_WRITE_EMPTY_PLTE
# define PNG_WRITE_EMPTY_PLTE_SUPPORTED
#endif
#endif
#endif /* PNG_WRITE_SUPPORTED */
#ifndef PNG_1_0_X
# ifndef PNG_NO_ERROR_NUMBERS
# define PNG_ERROR_NUMBERS_SUPPORTED
# endif
#endif /* PNG_1_0_X */
#ifndef PNG_NO_ERROR_NUMBERS
# define PNG_ERROR_NUMBERS_SUPPORTED
#endif
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
......@@ -742,20 +622,16 @@
#define PNG_THREAD_UNSAFE_OK
*/
#if !defined(PNG_1_0_X)
#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
# define PNG_USER_MEM_SUPPORTED
#endif
#endif /* PNG_1_0_X */
/* Added at libpng-1.2.6 */
#if !defined(PNG_1_0_X)
#ifndef PNG_SET_USER_LIMITS_SUPPORTED
#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
# define PNG_SET_USER_LIMITS_SUPPORTED
#endif
#endif
#endif /* PNG_1_0_X */
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
* how large, set these limits to 0x7fffffffL
......@@ -1200,18 +1076,6 @@ typedef double FAR * FAR * png_doublepp;
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char FAR * FAR * FAR * png_charppp;
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
/* SPC - Is this stuff deprecated? */
/* It'll be removed as of libpng-1.3.0 - GR-P */
/* libpng typedefs for types in zlib. If zlib changes
* or another compression library is used, then change these.
* Eliminates need to change all the source files.
*/
typedef charf * png_zcharp;
typedef charf * FAR * png_zcharpp;
typedef z_stream FAR * png_zstreamp;
#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
/*
* Define PNG_BUILD_DLL if the module being built is a Windows
* LIBPNG DLL.
......@@ -1382,10 +1246,6 @@ typedef z_stream FAR * png_zstreamp;
* functions that are passed far data must be model independent.
*/
#ifndef PNG_ABORT
# define PNG_ABORT() abort()
#endif
#ifdef PNG_SETJMP_SUPPORTED
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#else
......@@ -1393,7 +1253,16 @@ typedef z_stream FAR * png_zstreamp;
(LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
#endif
#if defined(USE_FAR_KEYWORD) /* memory model independent fns */
/* memory model/platform independent fns */
#ifndef PNG_ABORT
# ifdef _WINDOWS_
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
# endif
#endif
#if defined(USE_FAR_KEYWORD)
/* use this to make far-to-near assignments */
# define CHECK 1
# define NOCHECK 0
......@@ -1405,17 +1274,53 @@ typedef z_stream FAR * png_zstreamp;
# define png_memcmp _fmemcmp /* SJT: added */
# define png_memcpy _fmemcpy
# define png_memset _fmemset
#else /* use the usual functions */
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy strcpy
# define png_strncpy strncpy /* Added to v 1.2.6 */
# define png_strlen strlen
# define png_memcmp memcmp /* SJT: added */
# define png_memcpy memcpy
# define png_memset memset
#endif
/* End of memory model independent support */
# define png_sprintf sprintf
#else
# if defined(_WINDOWS_) /* favor Windows over C runtime fns */
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy lstrcpyA
# define png_strncpy lstrcpynA
# define png_strlen lstrlenA
# define png_memcmp memcmp
# define png_memcpy CopyMemory
# define png_memset memset
# define png_sprintf wsprintfA
# else
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy strcpy
# define png_strncpy strncpy /* Added to v 1.2.6 */
# define png_strlen strlen
# define png_memcmp memcmp /* SJT: added */
# define png_memcpy memcpy
# define png_memset memset
# define png_sprintf sprintf
# endif
#endif
#if defined(__TURBOC__) && !defined(__FLAT__)
# define png_mem_alloc farmalloc
# define png_mem_free farfree
typedef unsigned long png_mem_size_t;
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
# define png_mem_alloc(s) halloc(s, 1)
# define png_mem_free hfree
typedef unsigned long png_mem_size_t;
#else
# if defined(_WINDOWS_)
# define png_mem_alloc(s) HeapAlloc(GetProcessHeap(), 0, s)
# define png_mem_free(p) HeapFree(GetProcessHeap(), 0, p)
typedef SIZE_T png_mem_size_t;
# else
# define png_mem_alloc malloc
# define png_mem_free free
typedef size_t png_mem_size_t;
# endif
# endif
#endif
/* End of memory model/platform independent support */
/* Just a little check that someone hasn't tried to define something
* contradictory.
......@@ -1447,9 +1352,9 @@ typedef z_stream FAR * png_zstreamp;
* MMX will be detected at run time and used if present.
*/
#ifdef PNG_USE_PNGVCRD
# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
# define PNG_HAVE_MMX_COMBINE_ROW
# define PNG_HAVE_MMX_READ_INTERLACE
# define PNG_HAVE_MMX_READ_FILTER_ROW
#endif
/* Set this in the makefile for gcc/as on Pentium, not here. */
......@@ -1457,9 +1362,9 @@ typedef z_stream FAR * png_zstreamp;
* MMX will be detected at run time and used if present.
*/
#ifdef PNG_USE_PNGGCCRD
# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
# define PNG_HAVE_MMX_COMBINE_ROW
# define PNG_HAVE_MMX_READ_INTERLACE
# define PNG_HAVE_MMX_READ_FILTER_ROW
#endif
/* - see pnggccrd.c for info about what is currently enabled */
......
......@@ -13,8 +13,8 @@
* at each function.
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
static void /* PRIVATE */
......
......@@ -242,8 +242,8 @@
* x add support for runtime enable/disable/query of various MMX routines
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_USE_PNGGCCRD)
......@@ -255,7 +255,7 @@ static const int FARDATA png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
#endif
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if defined(PNG_MMX_CODE_SUPPORTED)
/* djgpp, Win32, Cygwin, and OS2 add their own underscores to global variables,
* so define them without: */
#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__) || \
......@@ -378,7 +378,7 @@ png_squelch_warnings(void)
_mask48_1 = _mask48_1;
_mask48_0 = _mask48_0;
}
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
static int _mmx_supported = 2;
......@@ -389,7 +389,7 @@ static int _mmx_supported = 2;
/* */
/*===========================================================================*/
#if defined(PNG_HAVE_ASSEMBLER_COMBINE_ROW)
#if defined(PNG_HAVE_MMX_COMBINE_ROW)
#define BPP2 2
#define BPP3 3 /* bytes per pixel (a.k.a. pixel_bytes) */
......@@ -416,12 +416,10 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
{
png_debug(1, "in png_combine_row (pnggccrd.c)\n");
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if defined(PNG_MMX_CODE_SUPPORTED)
if (_mmx_supported == 2) {
#if !defined(PNG_1_0_X)
/* this should have happened in png_init_mmx_flags() already */
png_warning(png_ptr, "asm_flags may not have been initialized");
#endif
png_mmx_support();
}
#endif
......@@ -607,13 +605,9 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
png_bytep srcptr;
png_bytep dstptr;
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && _mmx_supported */ )
#else
if (_mmx_supported)
#endif
{
png_uint_32 len;
int diff;
......@@ -700,7 +694,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
);
}
else /* mmx _not supported - Use modified C routine */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
register png_uint_32 i;
png_uint_32 initial_val = png_pass_start[png_ptr->pass];
......@@ -745,13 +739,9 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
png_bytep srcptr;
png_bytep dstptr;
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && _mmx_supported */ )
#else
if (_mmx_supported)
#endif
{
png_uint_32 len;
int diff;
......@@ -854,7 +844,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
);
}
else /* mmx _not supported - Use modified C routine */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
register png_uint_32 i;
png_uint_32 initial_val = BPP2 * png_pass_start[png_ptr->pass];
......@@ -898,13 +888,9 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
png_bytep srcptr;
png_bytep dstptr;
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && _mmx_supported */ )
#else
if (_mmx_supported)
#endif
{
png_uint_32 len;
int diff;
......@@ -1022,7 +1008,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
);
}
else /* mmx _not supported - Use modified C routine */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
register png_uint_32 i;
png_uint_32 initial_val = BPP3 * png_pass_start[png_ptr->pass];
......@@ -1066,13 +1052,9 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
png_bytep srcptr;
png_bytep dstptr;
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && _mmx_supported */ )
#else
if (_mmx_supported)
#endif
{
png_uint_32 len;
int diff;
......@@ -1197,7 +1179,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
);
}
else /* mmx _not supported - Use modified C routine */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
register png_uint_32 i;
png_uint_32 initial_val = BPP4 * png_pass_start[png_ptr->pass];
......@@ -1241,13 +1223,9 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
png_bytep srcptr;
png_bytep dstptr;
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && _mmx_supported */ )
#else
if (_mmx_supported)
#endif
{
png_uint_32 len;
int diff;
......@@ -1389,7 +1367,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
);
}
else /* mmx _not supported - Use modified C routine */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
register png_uint_32 i;
png_uint_32 initial_val = BPP6 * png_pass_start[png_ptr->pass];
......@@ -1480,7 +1458,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
} /* end png_combine_row() */
#endif /* PNG_HAVE_ASSEMBLER_COMBINE_ROW */
#endif /* PNG_HAVE_MMX_COMBINE_ROW */
......@@ -1492,7 +1470,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
/*===========================================================================*/
#if defined(PNG_READ_INTERLACING_SUPPORTED)
#if defined(PNG_HAVE_ASSEMBLER_READ_INTERLACE)
#if defined(PNG_HAVE_MMX_READ_INTERLACE)
/* png_do_read_interlace() is called after any 16-bit to 8-bit conversion
* has taken place. [GRR: what other steps come before and/or after?]
......@@ -1510,12 +1488,10 @@ png_do_read_interlace(png_structp png_ptr)
png_debug(1, "in png_do_read_interlace (pnggccrd.c)\n");
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if defined(PNG_MMX_CODE_SUPPORTED)
if (_mmx_supported == 2) {
#if !defined(PNG_1_0_X)
/* this should have happened in png_init_mmx_flags() already */
png_warning(png_ptr, "asm_flags may not have been initialized");
#endif
png_mmx_support();
}
#endif
......@@ -1723,13 +1699,9 @@ png_do_read_interlace(png_structp png_ptr)
/* New code by Nirav Chhatrapati - Intel Corporation */
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE)
/* && _mmx_supported */ )
#else
if (_mmx_supported)
#endif
{
//--------------------------------------------------------------
if (pixel_bytes == 3)
......@@ -2628,7 +2600,7 @@ png_do_read_interlace(png_structp png_ptr)
/* GRR 19991007: does it? or should pixel_bytes in each
* block be replaced with immediate value (e.g., 1)? */
/* GRR 19991017: replaced with constants in each case */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
if (pixel_bytes == 1)
{
......@@ -2753,13 +2725,13 @@ png_do_read_interlace(png_structp png_ptr)
} /* end png_do_read_interlace() */
#endif /* PNG_HAVE_ASSEMBLER_READ_INTERLACE */
#endif /* PNG_HAVE_MMX_READ_INTERLACE */
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#if defined(PNG_HAVE_ASSEMBLER_READ_FILTER_ROW)
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if defined(PNG_HAVE_MMX_READ_FILTER_ROW)
#if defined(PNG_MMX_CODE_SUPPORTED)
// These variables are utilized in the functions below. They are declared
// globally here to ensure alignment on 8-byte boundaries.
......@@ -5066,7 +5038,7 @@ png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row,
} // end of png_read_filter_row_mmx_up()
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
......@@ -5088,7 +5060,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
char filnm[10];
#endif
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if defined(PNG_MMX_CODE_SUPPORTED)
/* GRR: these are superseded by png_ptr->asm_flags: */
#define UseMMX_sub 1 // GRR: converted 20000730
#define UseMMX_up 1 // GRR: converted 20000729
......@@ -5097,12 +5069,10 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
if (_mmx_supported == 2) {
/* this should have happened in png_init_mmx_flags() already */
#if !defined(PNG_1_0_X)
png_warning(png_ptr, "asm_flags may not have been initialized");
#endif
png_mmx_support();
}
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
#ifdef PNG_DEBUG
png_debug(1, "in png_read_filter_row (pnggccrd.c)\n");
......@@ -5111,35 +5081,27 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
case 0: sprintf(filnm, "none");
break;
case 1: sprintf(filnm, "sub-%s",
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" :
#endif
#endif
"x86");
break;
case 2: sprintf(filnm, "up-%s",
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
#if !defined(PNG_1_0_X)
#ifdef PNG_MMX_CODE_SUPPORTED
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" :
#endif
#endif
"x86");
break;
case 3: sprintf(filnm, "avg-%s",
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" :
#endif
#endif
"x86");
break;
case 4: sprintf(filnm, "Paeth-%s",
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":
#endif
#endif
"x86");
break;
default: sprintf(filnm, "unknw");
......@@ -5158,19 +5120,15 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
break;
case PNG_FILTER_VALUE_SUB:
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (_mmx_supported)
#endif
{
png_read_filter_row_mmx_sub(row_info, row);
}
else
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
png_uint_32 i;
png_uint_32 istop = row_info->rowbytes;
......@@ -5187,19 +5145,15 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
break;
case PNG_FILTER_VALUE_UP:
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (_mmx_supported)
#endif
{
png_read_filter_row_mmx_up(row_info, row, prev_row);
}
else
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
png_uint_32 i;
png_uint_32 istop = row_info->rowbytes;
......@@ -5215,19 +5169,15 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
break;
case PNG_FILTER_VALUE_AVG:
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (_mmx_supported)
#endif
{
png_read_filter_row_mmx_avg(row_info, row, prev_row);
}
else
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
png_uint_32 i;
png_bytep rp = row;
......@@ -5253,19 +5203,15 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
break;
case PNG_FILTER_VALUE_PAETH:
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
#if !defined(PNG_1_0_X)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (_mmx_supported)
#endif
{
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
}
else
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* PNG_MMX_CODE_SUPPORTED */
{
png_uint_32 i;
png_bytep rp = row;
......@@ -5326,7 +5272,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
}
}
#endif /* PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */
#endif /* PNG_HAVE_MMX_READ_FILTER_ROW */
/*===========================================================================*/
......
......@@ -8,8 +8,8 @@
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
......@@ -829,7 +829,6 @@ png_get_compression_buffer_size(png_structp png_ptr)
}
#endif
#ifndef PNG_1_0_X
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
/* this function was added to libpng 1.2.0 and should exist by default */
png_uint_32 PNGAPI
......@@ -844,6 +843,7 @@ png_get_asm_flagmask (int flag_select)
{
png_uint_32 settable_asm_flags = 0;
#ifdef PNG_MMX_CODE_SUPPORTED
if (flag_select & PNG_SELECT_READ)
settable_asm_flags |=
PNG_ASM_FLAG_MMX_READ_COMBINE_ROW |
......@@ -853,6 +853,7 @@ png_get_asm_flagmask (int flag_select)
PNG_ASM_FLAG_MMX_READ_FILTER_AVG |
PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
/* no non-MMX flags yet */
#endif
#if 0
/* GRR: no write-flags yet, either, but someday... */
......@@ -866,8 +867,7 @@ png_get_asm_flagmask (int flag_select)
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */
#if defined(PNG_MMX_CODE_SUPPORTED)
/* this function was added to libpng 1.2.0 */
png_uint_32 PNGAPI
png_get_mmx_flagmask (int flag_select, int *compilerID)
......@@ -917,8 +917,7 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr)
{
return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L);
}
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* ?PNG_1_0_X */
#endif /* ?PNG_MMX_CODE_SUPPORTED */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* these functions were added to libpng 1.2.6 */
......
此差异已折叠。
......@@ -14,8 +14,8 @@
* identify the replacement functions.
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
......@@ -360,15 +360,7 @@ png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
}
#endif /* PNG_USER_MEM_SUPPORTED */
#if defined(__TURBOC__) && !defined(__FLAT__)
struct_ptr = (png_voidp)farmalloc(size);
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
struct_ptr = (png_voidp)halloc(size,1);
# else
struct_ptr = (png_voidp)malloc(size);
# endif
#endif
struct_ptr = (png_voidp)png_mem_alloc(size);
if (struct_ptr != NULL)
png_memset(struct_ptr, 0, size);
......@@ -402,15 +394,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
return;
}
#endif /* PNG_USER_MEM_SUPPORTED */
#if defined(__TURBOC__) && !defined(__FLAT__)
farfree(struct_ptr);
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
hfree(struct_ptr);
# else
free(struct_ptr);
# endif
#endif
png_mem_free(struct_ptr);
}
}
......@@ -460,24 +444,10 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
#endif
/* Check for overflow */
#if defined(__TURBOC__) && !defined(__FLAT__)
if (size != (unsigned long)size)
ret = NULL;
else
ret = farmalloc(size);
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
if (size != (unsigned long)size)
ret = NULL;
else
ret = halloc(size, 1);
# else
if (size != (size_t)size)
if (size != (png_mem_size_t)size)
ret = NULL;
else
ret = malloc((size_t)size);
# endif
#endif
ret = png_mem_alloc(size);
#ifndef PNG_USER_MEM_SUPPORTED
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
......@@ -510,23 +480,11 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
return;
#endif /* PNG_USER_MEM_SUPPORTED */
#if defined(__TURBOC__) && !defined(__FLAT__)
farfree(ptr);
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
hfree(ptr);
# else
free(ptr);
# endif
#endif
png_mem_free(ptr);
}
#endif /* Not Borland DOS special memory handler */
#if defined(PNG_1_0_X)
# define png_malloc_warn png_malloc
#else
/* This function was added at libpng version 1.2.3. The png_malloc_warn()
* function will set up png_malloc() to issue a png_warning and return NULL
* instead of issuing a png_error, if it fails to allocate the requested
......@@ -543,7 +501,6 @@ png_malloc_warn(png_structp png_ptr, png_uint_32 size)
png_ptr->flags=save_flags;
return(ptr);
}
#endif
png_voidp PNGAPI
png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
......
......@@ -8,8 +8,8 @@
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
......
......@@ -11,8 +11,8 @@
* read a PNG file or stream.
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED)
......@@ -55,11 +55,9 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
if (png_ptr == NULL)
return (NULL);
#if !defined(PNG_1_0_X)
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
#ifdef PNG_MMX_CODE_SUPPORTED
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
#endif
#endif /* PNG_1_0_X */
/* added at libpng-1.2.6 */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
......@@ -113,15 +111,15 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
#ifndef PNG_NO_STDIO
char msg[80];
if (user_png_ver)
{
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
png_sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
user_png_ver);
png_warning(png_ptr, msg);
}
sprintf(msg, "Application is running with png.c from libpng-%.20s",
png_sprintf(msg, "Application is running with png.c from libpng-%.20s",
png_libpng_ver);
png_warning(png_ptr, msg);
#endif
......@@ -171,61 +169,6 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
return (png_ptr);
}
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
/* Initialize PNG structure for reading, and allocate any memory needed.
This interface is deprecated in favour of the png_create_read_struct(),
and it will disappear as of libpng-1.3.0. */
#undef png_read_init
void PNGAPI
png_read_init(png_structp png_ptr)
{
/* We only come here via pre-1.0.7-compiled applications */
png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
}
void PNGAPI
png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
png_size_t png_struct_size, png_size_t png_info_size)
{
/* We only come here via pre-1.0.12-compiled applications */
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
if(png_sizeof(png_struct) > png_struct_size ||
png_sizeof(png_info) > png_info_size)
{
char msg[80];
png_ptr->warning_fn=NULL;
if (user_png_ver)
{
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
user_png_ver);
png_warning(png_ptr, msg);
}
sprintf(msg, "Application is running with png.c from libpng-%.20s",
png_libpng_ver);
png_warning(png_ptr, msg);
}
#endif
if(png_sizeof(png_struct) > png_struct_size)
{
png_ptr->error_fn=NULL;
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags=0;
#endif
png_error(png_ptr,
"The png struct allocated by the application for reading is too small.");
}
if(png_sizeof(png_info) > png_info_size)
{
png_ptr->error_fn=NULL;
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags=0;
#endif
png_error(png_ptr,
"The info struct allocated by application for reading is too small.");
}
png_read_init_3(&png_ptr, user_png_ver, png_struct_size);
}
#endif /* PNG_1_0_X || PNG_1_2_X */
void PNGAPI
png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
......
......@@ -15,8 +15,8 @@
* libpng use it at run time with png_set_read_fn(...).
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED)
......@@ -49,13 +49,8 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
* instead of an int, which is what fread() actually returns.
*/
#if defined(_WIN32_WCE)
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
check = 0;
#else
check = (png_size_t)fread(data, (png_size_t)1, length,
(png_FILE_p)png_ptr->io_ptr);
#endif
if (check != length)
png_error(png_ptr, "Read Error");
......@@ -81,12 +76,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
if ((png_bytep)n_data == data)
{
#if defined(_WIN32_WCE)
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
check = 0;
#else
check = fread(n_data, 1, length, io_ptr);
#endif
}
else
{
......@@ -97,12 +87,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
do
{
read = MIN(NEAR_BUF_SIZE, remaining);
#if defined(_WIN32_WCE)
if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) )
err = 0;
#else
err = fread(buf, (png_size_t)1, read, io_ptr);
#endif
png_memcpy(data, buf, read); /* copy far buffer to near buffer */
if(err != read)
break;
......
......@@ -13,8 +13,8 @@
* in pngtrans.c.
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED)
......@@ -579,7 +579,6 @@ png_set_palette_to_rgb(png_structp png_ptr)
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
}
#if !defined(PNG_1_0_X)
/* Expand grayscale images of less than 8-bit depth to 8 bits. */
void PNGAPI
png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
......@@ -587,19 +586,6 @@ png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n");
png_ptr->transformations |= PNG_EXPAND_tRNS;
}
#endif
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
/* Expand grayscale images of less than 8-bit depth to 8 bits. */
/* Deprecated as of libpng-1.2.9 */
void PNGAPI
png_set_gray_1_2_4_to_8(png_structp png_ptr)
{
png_debug(1, "in png_set_gray_1_2_4_to_8\n");
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
}
#endif
/* Expand tRNS chunks to alpha channels. */
void PNGAPI
......@@ -1179,10 +1165,8 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
{
info_ptr->channels++;
/* if adding a true alpha channel not just filler */
#if !defined(PNG_1_0_X)
if (png_ptr->transformations & PNG_ADD_ALPHA)
info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
#endif
}
#endif
......@@ -1219,11 +1203,11 @@ png_do_read_transformations(png_structp png_ptr)
#if !defined(PNG_USELESS_TESTS_SUPPORTED)
if (png_ptr->row_buf == NULL)
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
#ifndef PNG_NO_STDIO
char msg[50];
sprintf(msg, "NULL row buffer for row %ld, pass %d", png_ptr->row_number,
png_ptr->pass);
png_sprintf(msg, "NULL row buffer for row %ld, pass %d",
png_ptr->row_number, png_ptr->pass);
png_error(png_ptr, msg);
#else
png_error(png_ptr, "NULL row buffer");
......
......@@ -11,35 +11,11 @@
* libpng itself during the course of reading an image.
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED)
#if defined(_WIN32_WCE)
/* strtod() function is not supported on WindowsCE */
# ifdef PNG_FLOATING_POINT_SUPPORTED
__inline double strtod(const char *nptr, char **endptr)
{
double result = 0;
int len;
wchar_t *str, *end;
len = MultiByteToWideChar(CP_ACP, 0, nptr, -1, NULL, 0);
str = (wchar_t *)malloc(len * sizeof(wchar_t));
if ( NULL != str )
{
MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len);
result = wcstod(str, &end);
len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL);
*endptr = (char *)nptr + (png_strlen(nptr) - len + 1);
free(str);
}
return result;
}
# endif
#endif
png_uint_32 PNGAPI
png_get_uint_31(png_structp png_ptr, png_bytep buf)
{
......@@ -275,17 +251,17 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
}
if (ret != Z_STREAM_END)
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
#ifndef PNG_NO_STDIO
char umsg[50];
if (ret == Z_BUF_ERROR)
sprintf(umsg,"Buffer error in compressed datastream in %s chunk",
png_sprintf(umsg,"Buffer error in compressed datastream in %s chunk",
png_ptr->chunk_name);
else if (ret == Z_DATA_ERROR)
sprintf(umsg,"Data error in compressed datastream in %s chunk",
png_sprintf(umsg,"Data error in compressed datastream in %s chunk",
png_ptr->chunk_name);
else
sprintf(umsg,"Incomplete compressed datastream in %s chunk",
png_sprintf(umsg,"Incomplete compressed datastream in %s chunk",
png_ptr->chunk_name);
png_warning(png_ptr, umsg);
#else
......@@ -315,10 +291,10 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
}
else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
#ifndef PNG_NO_STDIO
char umsg[50];
sprintf(umsg, "Unknown zTXt compression type %d", comp_type);
png_sprintf(umsg, "Unknown zTXt compression type %d", comp_type);
png_warning(png_ptr, umsg);
#else
png_warning(png_ptr, "Unknown zTXt compression type");
......@@ -2247,7 +2223,7 @@ png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name)
a zero indicates the pixel is to be skipped. This is in addition
to any alpha or transparency value associated with the pixel. If
you want all pixels to be combined, pass 0xff (255) in mask. */
#ifndef PNG_HAVE_ASSEMBLER_COMBINE_ROW
#ifndef PNG_HAVE_MMX_COMBINE_ROW
void /* PRIVATE */
png_combine_row(png_structp png_ptr, png_bytep row, int mask)
{
......@@ -2448,10 +2424,10 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
}
}
}
#endif /* !PNG_HAVE_ASSEMBLER_COMBINE_ROW */
#endif /* !PNG_HAVE_MMX_COMBINE_ROW */
#ifdef PNG_READ_INTERLACING_SUPPORTED
#ifndef PNG_HAVE_ASSEMBLER_READ_INTERLACE /* else in pngvcrd.c, pnggccrd.c */
#ifndef PNG_HAVE_MMX_READ_INTERLACE /* else in pngvcrd.c, pnggccrd.c */
/* OLD pre-1.0.9 interface:
void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
png_uint_32 transformations)
......@@ -2677,10 +2653,10 @@ png_do_read_interlace(png_structp png_ptr)
return;
#endif
}
#endif /* !PNG_HAVE_ASSEMBLER_READ_INTERLACE */
#endif /* !PNG_HAVE_MMX_READ_INTERLACE */
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
#ifndef PNG_HAVE_MMX_READ_FILTER_ROW
void /* PRIVATE */
png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
png_bytep prev_row, int filter)
......@@ -2803,7 +2779,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
break;
}
}
#endif /* !PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */
#endif /* !PNG_HAVE_MMX_READ_FILTER_ROW */
void /* PRIVATE */
png_read_finish_row(png_structp png_ptr)
......
......@@ -13,8 +13,8 @@
* info struct and allows us to change the structure in the future.
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
......@@ -1055,24 +1055,6 @@ png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
}
#endif
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
void PNGAPI
png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
{
/* This function is deprecated in favor of png_permit_mng_features()
and will be removed from libpng-1.3.0 */
png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n");
if (png_ptr == NULL)
return;
png_ptr->mng_features_permitted = (png_byte)
((png_ptr->mng_features_permitted & (~(PNG_FLAG_MNG_EMPTY_PLTE))) |
((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE)));
}
#endif
#endif
#if defined(PNG_MNG_FEATURES_SUPPORTED)
png_uint_32 PNGAPI
png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
......@@ -1185,7 +1167,6 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
}
#ifndef PNG_1_0_X
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
/* this function was added to libpng 1.2.0 and should always exist by default */
void PNGAPI
......@@ -1198,13 +1179,13 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
return;
settable_mmx_flags =
#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
#ifdef PNG_HAVE_MMX_COMBINE_ROW
PNG_ASM_FLAG_MMX_READ_COMBINE_ROW |
#endif
#ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE
#ifdef PNG_HAVE_MMX_READ_INTERLACE
PNG_ASM_FLAG_MMX_READ_INTERLACE |
#endif
#ifdef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
#ifdef PNG_HAVE_MMX_READ_FILTER_ROW
PNG_ASM_FLAG_MMX_READ_FILTER_SUB |
PNG_ASM_FLAG_MMX_READ_FILTER_UP |
PNG_ASM_FLAG_MMX_READ_FILTER_AVG |
......@@ -1215,6 +1196,7 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
/* could be some non-MMX ones in the future, but not currently: */
settable_asm_flags = settable_mmx_flags;
#ifdef PNG_MMX_CODE_SUPPORTED
if (!(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_COMPILED) ||
!(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU))
{
......@@ -1222,6 +1204,7 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
settable_asm_flags &= ~settable_mmx_flags;
png_ptr->asm_flags &= ~settable_mmx_flags;
}
#endif
/* we're replacing the settable bits with those passed in by the user,
* so first zero them out of the master copy, then logical-OR in the
......@@ -1232,7 +1215,7 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
}
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
#ifdef PNG_MMX_CODE_SUPPORTED
/* this function was added to libpng 1.2.0 */
void PNGAPI
png_set_mmx_thresholds (png_structp png_ptr,
......@@ -1244,7 +1227,7 @@ png_set_mmx_thresholds (png_structp png_ptr,
png_ptr->mmx_bitdepth_threshold = mmx_bitdepth_threshold;
png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold;
}
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* ?PNG_MMX_CODE_SUPPORTED */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* this function was added to libpng 1.2.6 */
......@@ -1261,5 +1244,4 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
}
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
#endif /* ?PNG_1_0_X */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
......@@ -32,31 +32,15 @@
#if defined(_WIN32_WCE)
# if _WIN32_WCE < 211
__error__ (f|w)printf functions are not supported on old WindowsCE.;
__error__ "(f|w)printf functions are not supported on old WindowsCE.";
# endif
# include <windows.h>
# include <stdlib.h>
# define READFILE(file, data, length, check) \
if (ReadFile(file, data, length, &check,NULL)) check = 0
# define WRITEFILE(file, data, length, check)) \
if (WriteFile(file, data, length, &check, NULL)) check = 0
# define FCLOSE(file) CloseHandle(file)
#else
# include <stdio.h>
# include <stdlib.h>
# define READFILE(file, data, length, check) \
check=(png_size_t)fread(data,(png_size_t)1,length,file)
# define WRITEFILE(file, data, length, check) \
check=(png_size_t)fwrite(data,(png_size_t)1, length, file)
# define FCLOSE(file) fclose(file)
#endif
#if defined(PNG_NO_STDIO)
# if defined(_WIN32_WCE)
typedef HANDLE png_FILE_p;
# else
typedef FILE * png_FILE_p;
# endif
#include <stdio.h>
#include <stdlib.h>
#ifdef PNG_NO_STDIO
typedef FILE * png_FILE_p;
#endif
/* Makes pngtest verbose so we can find problems (needs to be before png.h) */
......@@ -116,14 +100,8 @@ static int status_dots_requested=0;
static int status_dots=1;
void
#ifdef PNG_1_0_X
PNGAPI
#endif
read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass);
void
#ifdef PNG_1_0_X
PNGAPI
#endif
read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
if(png_ptr == NULL || row_number > PNG_UINT_31_MAX) return;
......@@ -143,14 +121,8 @@ read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
}
void
#ifdef PNG_1_0_X
PNGAPI
#endif
write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass);
void
#ifdef PNG_1_0_X
PNGAPI
#endif
write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
if(png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7) return;
......@@ -164,14 +136,8 @@ write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
5 in case illegal filter values are present.) */
static png_uint_32 filters_used[256];
void
#ifdef PNG_1_0_X
PNGAPI
#endif
count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data);
void
#ifdef PNG_1_0_X
PNGAPI
#endif
count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data)
{
if(png_ptr != NULL && row_info != NULL)
......@@ -186,14 +152,8 @@ count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data)
static png_uint_32 zero_samples;
void
#ifdef PNG_1_0_X
PNGAPI
#endif
count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data);
void
#ifdef PNG_1_0_X
PNGAPI
#endif
count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
{
png_bytep dp = data;
......@@ -302,8 +262,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
* instead of an int, which is what fread() actually returns.
*/
READFILE((png_FILE_p)png_ptr->io_ptr, data, length, check);
check = (png_size_t)fread(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
if (check != length)
{
png_error(png_ptr, "Read Error!");
......@@ -330,7 +289,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
if ((png_bytep)n_data == data)
{
READFILE(io_ptr, n_data, length, check);
check = (png_size_t)fread(n_data, 1, length, io_ptr);
}
else
{
......@@ -341,7 +300,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
do
{
read = MIN(NEAR_BUF_SIZE, remaining);
READFILE(io_ptr, buf, 1, err);
err = (png_size_t)fread(buf, 1, 1, io_ptr);
png_memcpy(data, buf, read); /* copy far buffer to near buffer */
if(err != read)
break;
......@@ -363,12 +322,10 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
static void
pngtest_flush(png_structp png_ptr)
{
#if !defined(_WIN32_WCE)
png_FILE_p io_ptr;
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
if (io_ptr != NULL)
fflush(io_ptr);
#endif
}
#endif
......@@ -382,7 +339,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check);
check = (png_size_t)fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
if (check != length)
{
png_error(png_ptr, "Write Error");
......@@ -409,7 +366,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
if ((png_bytep)near_data == data)
{
WRITEFILE(io_ptr, near_data, length, check);
check = (png_size_t)fwrite(near_data, 1, length, io_ptr);
}
else
{
......@@ -421,7 +378,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
written = MIN(NEAR_BUF_SIZE, remaining);
png_memcpy(buf, data, written); /* copy far buffer to near buffer */
WRITEFILE(io_ptr, buf, written, err);
err = (png_size_t)fwrite(buf, 1, written, io_ptr);
if (err != written)
break;
else
......@@ -620,33 +577,20 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#endif
#if defined(_WIN32_WCE)
TCHAR path[MAX_PATH];
#endif
char inbuf[256], outbuf[256];
row_buf = NULL;
#if defined(_WIN32_WCE)
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
#else
if ((fpin = fopen(inname, "rb")) == NULL)
#endif
{
fprintf(STDERR, "Could not find input file %s\n", inname);
return (1);
}
#if defined(_WIN32_WCE)
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE)
#else
if ((fpout = fopen(outname, "wb")) == NULL)
#endif
{
fprintf(STDERR, "Could not open output file %s\n", outname);
FCLOSE(fpin);
fclose(fpin);
return (1);
}
......@@ -701,8 +645,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_destroy_info_struct(write_ptr, &write_end_info_ptr);
png_destroy_write_struct(&write_ptr, &write_info_ptr);
#endif
FCLOSE(fpin);
FCLOSE(fpout);
fclose(fpin);
fclose(fpout);
return (1);
}
#ifdef USE_FAR_KEYWORD
......@@ -723,8 +667,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#ifdef PNG_WRITE_SUPPORTED
png_destroy_write_struct(&write_ptr, &write_info_ptr);
#endif
FCLOSE(fpin);
FCLOSE(fpout);
fclose(fpin);
fclose(fpout);
return (1);
}
#ifdef USE_FAR_KEYWORD
......@@ -1208,30 +1152,20 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
png_debug(0, "Destruction complete.\n");
FCLOSE(fpin);
FCLOSE(fpout);
fclose(fpin);
fclose(fpout);
png_debug(0, "Opening files for comparison\n");
#if defined(_WIN32_WCE)
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
#else
if ((fpin = fopen(inname, "rb")) == NULL)
#endif
{
fprintf(STDERR, "Could not find file %s\n", inname);
return (1);
}
#if defined(_WIN32_WCE)
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
#else
if ((fpout = fopen(outname, "rb")) == NULL)
#endif
{
fprintf(STDERR, "Could not find file %s\n", outname);
FCLOSE(fpin);
fclose(fpin);
return (1);
}
......@@ -1239,8 +1173,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
png_size_t num_in, num_out;
READFILE(fpin, inbuf, 1, num_in);
READFILE(fpout, outbuf, 1, num_out);
num_in = (png_size_t)fread(inbuf, 1, 1, fpin);
num_out = (png_size_t)fread(outbuf, 1, 1, fpout);
if (num_in != num_out)
{
......@@ -1258,8 +1192,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
ZLIB_VERSION);
wrote_question=1;
}
FCLOSE(fpin);
FCLOSE(fpout);
fclose(fpin);
fclose(fpout);
return (0);
}
......@@ -1281,14 +1215,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
ZLIB_VERSION);
wrote_question=1;
}
FCLOSE(fpin);
FCLOSE(fpout);
fclose(fpin);
fclose(fpout);
return (0);
}
}
FCLOSE(fpin);
FCLOSE(fpout);
fclose(fpin);
fclose(fpout);
return (0);
}
......@@ -1549,4 +1483,4 @@ main(int argc, char *argv[])
}
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_10rc1 your_png_h_is_not_version_1_2_10rc1;
typedef version_1_4_0beta1 your_png_h_is_not_version_1_4_0beta1;
......@@ -8,8 +8,8 @@
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
......@@ -120,7 +120,6 @@ png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
}
}
#if !defined(PNG_1_0_X)
/* Added to libpng-1.2.7 */
void PNGAPI
png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
......@@ -129,7 +128,6 @@ png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
png_set_filler(png_ptr, filler, filler_loc);
png_ptr->transformations |= PNG_ADD_ALPHA;
}
#endif
#endif
......
......@@ -24,10 +24,10 @@
*
*/
#define PNG_INTERNAL
#include "png.h"
#include "pngintrn.h"
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD)
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD)
static int mmx_supported=2;
......@@ -116,10 +116,8 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
png_debug(1,"in png_combine_row_asm\n");
if (mmx_supported == 2) {
#if !defined(PNG_1_0_X)
/* this should have happened in png_init_mmx_flags() already */
png_warning(png_ptr, "asm_flags may not have been initialized");
#endif
png_mmx_support();
}
......@@ -311,12 +309,8 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
__int64 mask0=0x0102040810204080;
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && mmx_supported */ )
#else
if (mmx_supported)
#endif
{
srcptr = png_ptr->row_buf + 1;
dstptr = row;
......@@ -416,12 +410,8 @@ end8:
__int64 mask1=0x0101020204040808,
mask0=0x1010202040408080;
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && mmx_supported */ )
#else
if (mmx_supported)
#endif
{
srcptr = png_ptr->row_buf + 1;
dstptr = row;
......@@ -541,12 +531,8 @@ end16:
len = (png_ptr->width)&~7;
diff = (png_ptr->width)&7;
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && mmx_supported */ )
#else
if (mmx_supported)
#endif
{
_asm
{
......@@ -677,12 +663,8 @@ end24:
len = (png_ptr->width)&~7;
diff = (png_ptr->width)&7;
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && mmx_supported */ )
#else
if (mmx_supported)
#endif
{
_asm
{
......@@ -816,12 +798,8 @@ end32:
mask1=0x2020202040404040,
mask0=0x4040808080808080;
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
/* && mmx_supported */ )
#else
if (mmx_supported)
#endif
{
srcptr = png_ptr->row_buf + 1;
dstptr = row;
......@@ -1011,10 +989,8 @@ png_do_read_interlace(png_structp png_ptr)
png_debug(1,"in png_do_read_interlace\n");
if (mmx_supported == 2) {
#if !defined(PNG_1_0_X)
/* this should have happened in png_init_mmx_flags() already */
png_warning(png_ptr, "asm_flags may not have been initialized");
#endif
png_mmx_support();
}
......@@ -1215,12 +1191,8 @@ png_do_read_interlace(png_structp png_ptr)
// NOTE: there is NO MMX code for 48-bit and 64-bit images
// use MMX routine if machine supports it
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE)
/* && mmx_supported */ )
#else
if (mmx_supported)
#endif
{
if (pixel_bytes == 3)
{
......@@ -3682,10 +3654,8 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
#endif
if (mmx_supported == 2) {
#if !defined(PNG_1_0_X)
/* this should have happened in png_init_mmx_flags() already */
png_warning(png_ptr, "asm_flags may not have been initialized");
#endif
png_mmx_support();
}
......@@ -3693,32 +3663,21 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
png_debug(1, "in png_read_filter_row\n");
switch (filter)
{
case 0: sprintf(filnm, "none");
case 0: png_sprintf(filnm, "none");
break;
#if !defined(PNG_1_0_X)
case 1: sprintf(filnm, "sub-%s",
case 1: png_sprintf(filnm, "sub-%s",
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : "x86");
break;
case 2: sprintf(filnm, "up-%s",
case 2: png_sprintf(filnm, "up-%s",
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : "x86");
break;
case 3: sprintf(filnm, "avg-%s",
case 3: png_sprintf(filnm, "avg-%s",
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : "x86");
break;
case 4: sprintf(filnm, "Paeth-%s",
case 4: png_sprintf(filnm, "Paeth-%s",
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":"x86");
break;
#else
case 1: sprintf(filnm, "sub");
break;
case 2: sprintf(filnm, "up");
break;
case 3: sprintf(filnm, "avg");
break;
case 4: sprintf(filnm, "Paeth");
break;
#endif
default: sprintf(filnm, "unknw");
default: png_sprintf(filnm, "unknw");
break;
}
png_debug2(0,"row=%5d, %s, ", png_ptr->row_number, filnm);
......@@ -3734,13 +3693,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
case PNG_FILTER_VALUE_SUB:
{
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (mmx_supported)
#endif
{
png_read_filter_row_mmx_sub(row_info, row);
}
......@@ -3763,13 +3718,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
case PNG_FILTER_VALUE_UP:
{
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (mmx_supported)
#endif
{
png_read_filter_row_mmx_up(row_info, row, prev_row);
}
......@@ -3791,13 +3742,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
case PNG_FILTER_VALUE_AVG:
{
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (mmx_supported)
#endif
{
png_read_filter_row_mmx_avg(row_info, row, prev_row);
}
......@@ -3829,13 +3776,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
case PNG_FILTER_VALUE_PAETH:
{
#if !defined(PNG_1_0_X)
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) &&
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
#else
if (mmx_supported)
#endif
{
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
}
......@@ -3901,4 +3844,4 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
}
}
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGVCRD */
#endif /* PNG_MMX_CODE_SUPPORTED && PNG_USE_PNGVCRD */
此差异已折叠。
此差异已折叠。
......@@ -8,9 +8,9 @@
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
#define PNG_INTERNAL
#include "png.h"
#ifdef PNG_WRITE_SUPPORTED
#include "pngintrn.h"
/* Transform the data according to the user's wishes. The order of
* transformations is significant.
......
此差异已折叠。
......@@ -31,11 +31,11 @@ To use:
This project builds the libpng binaries as follows:
* Win32_DLL_Release\libpng13.dll DLL build
* Win32_DLL_Debug\libpng13d.dll DLL build (debug version)
* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code
* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version)
* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall
* Win32_DLL_Release\libpng14.dll DLL build
* Win32_DLL_Debug\libpng14d.dll DLL build (debug version)
* Win32_DLL_ASM_Release\libpng14.dll DLL build using ASM code
* Win32_DLL_ASM_Debug\libpng14d.dll DLL build using ASM (debug version)
* Win32_DLL_VB\libpng14vb.dll DLL build for Visual Basic, using stdcall
* Win32_LIB_Release\libpng.lib static build
* Win32_LIB_Debug\libpngd.lib static build (debug version)
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
......
此差异已折叠。
此差异已折叠。
......@@ -32,11 +32,11 @@ To use:
This project builds the libpng binaries as follows:
* Win32_DLL_Release\libpng13.dll DLL build
* Win32_DLL_Debug\libpng13d.dll DLL build (debug version)
* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code
* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version)
* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall
* Win32_DLL_Release\libpng14.dll DLL build
* Win32_DLL_Debug\libpng14d.dll DLL build (debug version)
* Win32_DLL_ASM_Release\libpng14.dll DLL build using ASM code
* Win32_DLL_ASM_Debug\libpng14d.dll DLL build using ASM (debug version)
* Win32_DLL_VB\libpng14vb.dll DLL build for Visual Basic, using stdcall
* Win32_LIB_Release\libpng.lib static build
* Win32_LIB_Debug\libpngd.lib static build (debug version)
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册