Imported from libpng-1.2.19beta16.tar
This commit is contained in:
parent
f7794ec181
commit
7945bdb88f
32
ANNOUNCE
32
ANNOUNCE
@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.2.19beta15 - June 17, 2007
|
||||
Libpng 1.2.19beta16 - June 19, 2007
|
||||
|
||||
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
|
||||
|
||||
libpng-1.2.19beta15.tar.gz
|
||||
libpng-1.2.19beta15.tar.bz2
|
||||
libpng-1.2.19beta16.tar.gz
|
||||
libpng-1.2.19beta16.tar.bz2
|
||||
|
||||
Source files with LF line endings (for Unix/Linux) without the
|
||||
"configure" script
|
||||
|
||||
libpng-1.2.19beta15-no-config.tar.gz
|
||||
libpng-1.2.19beta15-no-config.tar.bz2
|
||||
libpng-1.2.19beta16-no-config.tar.gz
|
||||
libpng-1.2.19beta16-no-config.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lp1219b15.zip
|
||||
lp1219b15.tar.bz2
|
||||
lp1219b16.zip
|
||||
lp1219b16.tar.bz2
|
||||
|
||||
Project files
|
||||
|
||||
libpng-1.2.19beta15-project-netware.zip
|
||||
libpng-1.2.19beta15-project-wince.zip
|
||||
libpng-1.2.19beta16-project-netware.zip
|
||||
libpng-1.2.19beta16-project-wince.zip
|
||||
|
||||
Other information:
|
||||
|
||||
libpng-1.2.19beta15-README.txt
|
||||
libpng-1.2.19beta15-KNOWNBUGS.txt
|
||||
libpng-1.2.19beta15-LICENSE.txt
|
||||
libpng-1.2.19beta15-Y2K-compliance.txt
|
||||
libpng-1.2.19beta16-README.txt
|
||||
libpng-1.2.19beta16-KNOWNBUGS.txt
|
||||
libpng-1.2.19beta16-LICENSE.txt
|
||||
libpng-1.2.19beta16-Y2K-compliance.txt
|
||||
|
||||
Changes since the last public release (1.2.18):
|
||||
|
||||
@ -97,6 +97,12 @@ version 1.2.19beta14 [June 16, 2007]
|
||||
version 1.2.19beta15 [June 17, 2007]
|
||||
Revised pnggccrd.c.
|
||||
|
||||
version 1.2.19beta16 [June 19, 2007]
|
||||
Revised pnggccrd.c again.
|
||||
Updated contrib/gregbook.
|
||||
Changed '#include "$srcdir/pnggccrd.c"' 'include "$srcdir/pnggccrd.c"'
|
||||
in configure.ac
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
|
||||
(subscription required; visit
|
||||
|
6
CHANGES
6
CHANGES
@ -1790,6 +1790,12 @@ version 1.2.19beta14 [June 16, 2007]
|
||||
version 1.2.19beta15 [June 17, 2007]
|
||||
Revised pnggccrd.c.
|
||||
|
||||
version 1.2.19beta16 [June 19, 2007]
|
||||
Revised pnggccrd.c again.
|
||||
Updated contrib/gregbook.
|
||||
Changed '#include "$srcdir/pnggccrd.c"' 'include "$srcdir/pnggccrd.c"'
|
||||
in configure.ac
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
|
20
INSTALL
20
INSTALL
@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.2.19beta15 - June 17, 2007
|
||||
Installing libpng version 1.2.19beta16 - June 19, 2007
|
||||
|
||||
On Unix/Linux and similar systems, you can simply type
|
||||
|
||||
@ -44,7 +44,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.19beta15" or "lpng109" and "zlib-1.2.1"
|
||||
might be called "libpng-1.2.19beta16" 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:
|
||||
@ -101,14 +101,14 @@ include
|
||||
CMakeLists.txt => "cmake" script
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng12.so.0.1.2.19beta15)
|
||||
gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15)
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15,
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.nommx => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16
|
||||
does not use Intel MMX assembler code)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@ -131,14 +131,14 @@ include
|
||||
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.19beta15)
|
||||
creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng12.so.0.1.2.19beta15)
|
||||
creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc,
|
||||
creates libpng12.so.0.1.2.19beta15)
|
||||
creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng12.so.0.1.2.19beta15)
|
||||
creates libpng12.so.0.1.2.19beta16)
|
||||
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
|
||||
|
2
KNOWNBUG
2
KNOWNBUG
@ -1,5 +1,5 @@
|
||||
|
||||
Known bugs in libpng version 1.2.19beta15
|
||||
Known bugs in libpng version 1.2.19beta16
|
||||
|
||||
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
|
||||
|
4
LICENSE
4
LICENSE
@ -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.19beta15, June 17, 2007, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.2.19beta16, June 19, 2007, are
|
||||
Copyright (c) 2004, 2006-2007 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
|
||||
June 17, 2007
|
||||
June 19, 2007
|
||||
|
14
README
14
README
@ -1,4 +1,4 @@
|
||||
README for libpng version 1.2.19beta15 - June 17, 2007 (shared library 12.0)
|
||||
README for libpng version 1.2.19beta16 - June 19, 2007 (shared library 12.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.19beta15)
|
||||
gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15)
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15,
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16,
|
||||
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
|
||||
@ -216,12 +216,12 @@ Files in this distribution:
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15)
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15)
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
makefile.so9 => Solaris 9 makefile
|
||||
(gcc, creates libpng12.so.0.1.2.19beta15)
|
||||
(gcc, creates libpng12.so.0.1.2.19beta16)
|
||||
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
|
||||
|
4
Y2KINFO
4
Y2KINFO
@ -1,13 +1,13 @@
|
||||
Y2K compliance in libpng:
|
||||
=========================
|
||||
|
||||
June 17, 2007
|
||||
June 19, 2007
|
||||
|
||||
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.19beta15 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.2.19beta16 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
|
||||
|
24
configure
vendored
24
configure
vendored
@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.61 for libpng 1.2.19beta15.
|
||||
# Generated by GNU Autoconf 2.61 for libpng 1.2.19beta16.
|
||||
#
|
||||
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
|
||||
#
|
||||
@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='libpng'
|
||||
PACKAGE_TARNAME='libpng'
|
||||
PACKAGE_VERSION='1.2.19beta15'
|
||||
PACKAGE_STRING='libpng 1.2.19beta15'
|
||||
PACKAGE_VERSION='1.2.19beta16'
|
||||
PACKAGE_STRING='libpng 1.2.19beta16'
|
||||
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
|
||||
|
||||
ac_unique_file="pngget.c"
|
||||
@ -1405,7 +1405,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.19beta15 to adapt to many kinds of systems.
|
||||
\`configure' configures libpng 1.2.19beta16 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@ -1475,7 +1475,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of libpng 1.2.19beta15:";;
|
||||
short | recursive ) echo "Configuration of libpng 1.2.19beta16:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@ -1585,7 +1585,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
libpng configure 1.2.19beta15
|
||||
libpng configure 1.2.19beta16
|
||||
generated by GNU Autoconf 2.61
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@ -1599,7 +1599,7 @@ cat >config.log <<_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.19beta15, which was
|
||||
It was created by libpng $as_me 1.2.19beta16, which was
|
||||
generated by GNU Autoconf 2.61. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@ -2269,7 +2269,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='libpng'
|
||||
VERSION='1.2.19beta15'
|
||||
VERSION='1.2.19beta16'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@ -2440,7 +2440,7 @@ fi
|
||||
|
||||
|
||||
|
||||
PNGLIB_VERSION=1.2.19beta15
|
||||
PNGLIB_VERSION=1.2.19beta16
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=2
|
||||
PNGLIB_RELEASE=19
|
||||
@ -20558,7 +20558,7 @@ _ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include "pnggccrd.c"
|
||||
#include "$srcdir/pnggccrd.c"
|
||||
int
|
||||
main ()
|
||||
{
|
||||
@ -21119,7 +21119,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by libpng $as_me 1.2.19beta15, which was
|
||||
This file was extended by libpng $as_me 1.2.19beta16, which was
|
||||
generated by GNU Autoconf 2.61. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@ -21172,7 +21172,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
libpng config.status 1.2.19beta15
|
||||
libpng config.status 1.2.19beta16
|
||||
configured by $0, generated by GNU Autoconf 2.61,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
@ -18,12 +18,12 @@ AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.2.19beta15], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.2.19beta16], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.2.19beta15
|
||||
PNGLIB_VERSION=1.2.19beta16
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=2
|
||||
PNGLIB_RELEASE=19
|
||||
@ -62,7 +62,7 @@ LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
||||
AC_MSG_CHECKING(
|
||||
[if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
|
||||
AC_TRY_COMPILE(
|
||||
[#include "pnggccrd.c"],
|
||||
[#include "$srcdir/pnggccrd.c"],
|
||||
[return 0;],
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBPNG_NO_MMX="",
|
||||
|
340
contrib/gregbook/COPYING
Normal file
340
contrib/gregbook/COPYING
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
@ -1,12 +1,19 @@
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -23,4 +30,21 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
130
contrib/gregbook/Makefile.mingw32
Normal file
130
contrib/gregbook/Makefile.mingw32
Normal file
@ -0,0 +1,130 @@
|
||||
# Sample makefile for rpng-win / rpng2-win / wpng using mingw32-gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a DOS-prompt window via:
|
||||
#
|
||||
# make -f Makefile.mingw32
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are in subdirectories at the same level as the current subdirectory
|
||||
# (as indicated by the PNGDIR and ZDIR macros below). It makes no assumptions
|
||||
# at all about the mingw32 installation tree (W32DIR). Edit as appropriate.
|
||||
#
|
||||
# Note that the names of the dynamic and static libpng and zlib libraries
|
||||
# used below may change in later releases of the libraries. This makefile
|
||||
# builds both statically and dynamically linked executables by default.
|
||||
# (You need only one set, but for testing it can be handy to have both.)
|
||||
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
#PNGDIR = ../..# for libpng-x.y.z/contrib/gregbook builds
|
||||
PNGDIR = ../libpng-win32
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = $(PNGDIR)/libpng.dll.a # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
#ZDIR = ../../../zlib-win32# for libpng-x.y.z/contrib/gregbook builds
|
||||
ZDIR = ../zlib-win32
|
||||
ZINC = -I$(ZDIR)
|
||||
ZLIBd = $(ZDIR)/libzdll.a
|
||||
ZLIBs = $(ZDIR)/libz.a
|
||||
|
||||
# change this to be the path where mingw32 installs its stuff:
|
||||
W32DIR =
|
||||
#W32DIR = /usr/local/cross-tools/i386-mingw32msvc
|
||||
W32INC = -I$(W32DIR)/include
|
||||
W32LIB = $(W32DIR)/lib/libuser32.a $(W32DIR)/lib/libgdi32.a
|
||||
|
||||
CC = gcc
|
||||
#CC = i386-mingw32msvc-gcc # e.g., Linux -> Win32 cross-compilation
|
||||
LD = $(CC)
|
||||
RM = rm -f
|
||||
CFLAGS = -O -Wall $(INCS) $(MINGW_CCFLAGS)
|
||||
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
|
||||
# [-ansi, -pedantic and -W can also be used]
|
||||
LDFLAGS = $(MINGW_LDFLAGS)
|
||||
O = .o
|
||||
E = .exe
|
||||
|
||||
INCS = $(PNGINC) $(ZINC) $(W32INC)
|
||||
RLIBSd = $(PNGLIBd) $(ZLIBd) $(W32LIB) -lm
|
||||
RLIBSs = $(PNGLIBs) $(ZLIBs) $(W32LIB) -lm
|
||||
WLIBSd = $(PNGLIBd) $(ZLIBd)
|
||||
WLIBSs = $(PNGLIBs) $(ZLIBs)
|
||||
|
||||
RPNG = rpng-win
|
||||
RPNG2 = rpng2-win
|
||||
WPNG = wpng
|
||||
|
||||
ROBJSd = $(RPNG)$(O) readpng.pic$(O)
|
||||
ROBJS2d = $(RPNG2)$(O) readpng2.pic$(O)
|
||||
WOBJSd = $(WPNG)$(O) writepng.pic$(O)
|
||||
|
||||
RPNGs = $(RPNG)-static
|
||||
RPNG2s = $(RPNG2)-static
|
||||
WPNGs = $(WPNG)-static
|
||||
|
||||
ROBJSs = $(RPNG)$(O) readpng$(O)
|
||||
ROBJS2s = $(RPNG2)$(O) readpng2$(O)
|
||||
WOBJSs = $(WPNG)$(O) writepng$(O)
|
||||
|
||||
STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E)
|
||||
DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
|
||||
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O):
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
%.pic$(O): %.c
|
||||
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
|
||||
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
|
||||
all: $(EXES)
|
||||
|
||||
$(RPNGs)$(E): $(ROBJSs)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJSs) $(RLIBSs)
|
||||
|
||||
$(RPNG)$(E): $(ROBJSd)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJSd) $(RLIBSd)
|
||||
|
||||
$(RPNG2s)$(E): $(ROBJS2s)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2s) $(RLIBSs)
|
||||
|
||||
$(RPNG2)$(E): $(ROBJS2d)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2d) $(RLIBSd)
|
||||
|
||||
$(WPNGs)$(E): $(WOBJSs)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJSs) $(WLIBSs)
|
||||
|
||||
$(WPNG)$(E): $(WOBJSd)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJSd) $(WLIBSd)
|
||||
|
||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
||||
$(WPNG)$(O): $(WPNG).c writepng.h
|
||||
|
||||
readpng$(O) readpng.pic$(O): readpng.c readpng.h
|
||||
readpng2$(O) readpng2.pic$(O): readpng2.c readpng2.h
|
||||
writepng$(O) writepng.pic$(O): writepng.c writepng.h
|
||||
|
||||
|
||||
# maintenance ---------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
$(RM) $(EXES)
|
||||
$(RM) $(ROBJSs) $(ROBJS2s) $(WOBJSs)
|
||||
$(RM) $(ROBJSd) $(ROBJS2d) $(WOBJSd)
|
@ -1,58 +1,70 @@
|
||||
# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 7 March 2002
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Buy some for friends
|
||||
# and family, too. (Not that this is a blatant plug or anything.)
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a shell prompt in the usual way; for example:
|
||||
#
|
||||
# make -f Makefile.unx
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are both installed in /usr/local/{include,lib} (as indicated by the
|
||||
# PNG* and Z* macros below). Edit as appropriate--choose only ONE each of
|
||||
# the PNGINC, PNGLIB, ZINC and ZLIB lines.
|
||||
# and are installed in /usr/local/{include,lib} or as otherwise indicated by
|
||||
# the PNG* and Z* macros below. Edit as appropriate--choose only ONE each of
|
||||
# the PNGINC, PNGLIBd, PNGLIBs, ZINC, ZLIBd and ZLIBs lines.
|
||||
#
|
||||
# This makefile builds statically linked executables (against libpng and zlib,
|
||||
# that is), but that can be changed by uncommenting the appropriate PNGLIB and
|
||||
# ZLIB lines.
|
||||
# This makefile builds both dynamically and statically linked executables
|
||||
# (against libpng and zlib, that is), but that can be changed by modifying
|
||||
# the "EXES =" line. (You need only one set, but for testing it can be handy
|
||||
# to have both.)
|
||||
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGINC = -I/usr/local/include/libpng12
|
||||
#PNGLIB = -L/usr/local/lib -lpng12 # dynamically linked against libpng
|
||||
PNGLIB = /usr/local/lib/libpng12.a # statically linked against libpng
|
||||
#PNGDIR = /usr/local/lib
|
||||
#PNGINC = -I/usr/local/include/libpng12
|
||||
#PNGLIBd = -L$(PNGDIR) -lpng12 # dynamically linked, installed libpng
|
||||
#PNGLIBs = $(PNGDIR)/libpng12.a # statically linked, installed libpng
|
||||
# or:
|
||||
#PNGINC = -I../libpng
|
||||
#PNGLIB = -L../libpng -lpng
|
||||
#PNGLIB = ../libpng/libpng.a
|
||||
PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds
|
||||
#PNGDIR = ../libpng
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng12 # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
ZDIR = /usr/local/lib
|
||||
#ZDIR = /usr/lib64
|
||||
ZINC = -I/usr/local/include
|
||||
#ZLIB = -L/usr/local/lib -lz # dynamically linked against zlib
|
||||
ZLIB = /usr/local/lib/libz.a # statically linked against zlib
|
||||
#ZINC = -I../zlib
|
||||
#ZLIB = -L../zlib -lz
|
||||
#ZLIB = ../zlib/libz.a
|
||||
ZLIBd = -L$(ZDIR) -lz # dynamically linked against zlib
|
||||
ZLIBs = $(ZDIR)/libz.a # statically linked against zlib
|
||||
# or:
|
||||
#ZDIR = ../zlib
|
||||
#ZINC = -I$(ZDIR)
|
||||
#ZLIBd = -Wl,-rpath,$(ZDIR) -L$(ZDIR) -lz # -rpath allows in-place testing
|
||||
#ZLIBs = $(ZDIR)/libz.a
|
||||
|
||||
#XINC = -I/usr/include # old-style, stock X distributions
|
||||
#XLIB = -L/usr/lib/X11 -lX11
|
||||
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
|
||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||
#XLIB = -L/usr/openwin/lib -lX11
|
||||
XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.)
|
||||
XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
|
||||
XLIB = -L/usr/X11R6/lib -lX11
|
||||
#XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
|
||||
|
||||
INCS = $(PNGINC) $(ZINC) $(XINC)
|
||||
RLIBS = $(PNGLIB) $(ZLIB) $(XLIB) -lm
|
||||
WLIBS = $(PNGLIB) $(ZLIB)
|
||||
RLIBSd = $(PNGLIBd) $(ZLIBd) $(XLIB) -lm
|
||||
RLIBSs = $(PNGLIBs) $(ZLIBs) $(XLIB) -lm
|
||||
WLIBSd = $(PNGLIBd) $(ZLIBd) -lm
|
||||
WLIBSs = $(PNGLIBs) $(ZLIBs)
|
||||
|
||||
CC = gcc
|
||||
LD = gcc
|
||||
RM = rm -f
|
||||
CFLAGS = -O -Wall $(INCS)
|
||||
CFLAGS = -O -Wall $(INCS) -DFEATURE_LOOP
|
||||
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
|
||||
# [-ansi, -pedantic and -W can also be used]
|
||||
LDFLAGS =
|
||||
@ -63,11 +75,18 @@ RPNG = rpng-x
|
||||
RPNG2 = rpng2-x
|
||||
WPNG = wpng
|
||||
|
||||
RPNGs = $(RPNG)-static
|
||||
RPNG2s = $(RPNG2)-static
|
||||
WPNGs = $(WPNG)-static
|
||||
|
||||
ROBJS = $(RPNG)$(O) readpng$(O)
|
||||
ROBJS2 = $(RPNG2)$(O) readpng2$(O)
|
||||
WOBJS = $(WPNG)$(O) writepng$(O)
|
||||
|
||||
EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E)
|
||||
DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
|
||||
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
@ -80,14 +99,23 @@ EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
all: $(EXES)
|
||||
|
||||
$(RPNGs)$(E): $(ROBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSs)
|
||||
|
||||
$(RPNG)$(E): $(ROBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSd)
|
||||
|
||||
$(RPNG2s)$(E): $(ROBJS2)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSs)
|
||||
|
||||
$(RPNG2)$(E): $(ROBJS2)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSd)
|
||||
|
||||
$(WPNGs)$(E): $(WOBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSs)
|
||||
|
||||
$(WPNG)$(E): $(WOBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSd)
|
||||
|
||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
||||
|
@ -1,11 +1,12 @@
|
||||
# Sample makefile for rpng-win / rpng2-win / wpng using MSVC and NMAKE.
|
||||
# Greg Roelofs
|
||||
# Last modified: 16 February 1999
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Buy some for friends
|
||||
# and family, too. (Not that this is a blatant plug or anything.)
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a DOS prompt window via:
|
||||
#
|
||||
@ -53,7 +54,7 @@ CC = cl
|
||||
LD = link
|
||||
RM = del
|
||||
CFLAGS = -nologo -O -W3 $(INCS) $(cvars)
|
||||
# [note that -Wall is an MSVC-specific compilation flag ("all warnings on")]
|
||||
# [note that -W3 is an MSVC-specific compilation flag ("all warnings on")]
|
||||
# [see %devstudio%\vc\include\win32.mak for cvars macro definition]
|
||||
O = .obj
|
||||
E = .exe
|
||||
|
@ -22,7 +22,8 @@ below.
|
||||
Files:
|
||||
|
||||
README this file
|
||||
LICENSE terms of distribution and reuse (BSD-like)
|
||||
LICENSE terms of distribution and reuse (BSD-like or GNU GPL)
|
||||
COPYING GNU General Public License (GPL)
|
||||
|
||||
Makefile.unx Unix makefile
|
||||
Makefile.w32 Windows (MSVC) makefile
|
||||
@ -54,15 +55,15 @@ mation and links to the latest version of the source code, and Chapters
|
||||
13-15 of the book for detailed discussion of the three programs.
|
||||
|
||||
Greg Roelofs
|
||||
newt@pobox.com
|
||||
30 June 2001
|
||||
http://pobox.com/~newt/greg_contact.html
|
||||
2 June 2007
|
||||
|
||||
|
||||
BUILD INSTRUCTIONS
|
||||
|
||||
- Prerequisites (in order of compilation):
|
||||
|
||||
- zlib http://www.gzip.org/zlib/
|
||||
- zlib http://zlib.net/
|
||||
- libpng http://www.libpng.org/pub/png/libpng.html
|
||||
- pngbook http://www.libpng.org/pub/png/book/sources.html
|
||||
|
||||
@ -176,7 +177,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
|
||||
wpng is a purely command-line image converter from binary PBMPLUS/NetPBM
|
||||
format (.pgm or .ppm) to PNG; for example,
|
||||
|
||||
wpng -time < toucan.ppm > toucan.png
|
||||
wpng -time < toucan-notrans.ppm > toucan-notrans.png
|
||||
|
||||
would convert the specified PPM file (using redirection) to PNG, auto-
|
||||
matically setting the PNG modification-time chunk.
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
|
@ -4,19 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Changelog:
|
||||
- 1.01: initial public release
|
||||
- 1.02: added code to skip unused chunks (GR-P)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2002 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -33,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -56,7 +74,7 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg);
|
||||
void readpng2_version_info(void)
|
||||
{
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
|
||||
(defined(__i386__) || defined(_M_IX86)) && \
|
||||
(defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
|
||||
defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||
/*
|
||||
* WARNING: This preprocessor approach means that the following code
|
||||
@ -79,7 +97,12 @@ void readpng2_version_info(void)
|
||||
"with MMX support\n (%s version).", PNG_LIBPNG_VER_STRING,
|
||||
png_libpng_ver, compilerID == 1? "MSVC++" :
|
||||
(compilerID == 2? "GNU C" : "unknown"));
|
||||
fprintf(stderr, " Processor %s MMX instructions.\n",
|
||||
fprintf(stderr, " Processor (x86%s) %s MMX instructions.\n",
|
||||
#if defined(__x86_64__)
|
||||
"_64"
|
||||
#else
|
||||
"",
|
||||
#endif
|
||||
mmxsupport? "supports" : "does not support");
|
||||
if (mmxsupport > 0) {
|
||||
int num_optims = 0;
|
||||
@ -179,40 +202,38 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* prepare the reader to ignore all recognized chunks whose data isn't
|
||||
* going to be used, i.e., all chunks recognized by libpng except for
|
||||
* IHDR, PLTE, IDAT, IEND, tRNS, bKGD, gAMA, and sRGB : */
|
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
|
||||
/* prepare the reader to ignore all recognized chunks whose data won't be
|
||||
* used, i.e., all chunks recognized by libpng except for IHDR, PLTE, IDAT,
|
||||
* IEND, tRNS, bKGD, gAMA, and sRGB (small performance improvement) */
|
||||
{
|
||||
#ifndef HANDLE_CHUNK_NEVER
|
||||
/* prior to libpng-1.2.5, this macro was internal, so we define it here. */
|
||||
# define HANDLE_CHUNK_NEVER 1
|
||||
#endif
|
||||
/* these byte strings were copied from png.h.
|
||||
* If a future libpng version recognizes more chunks, add them
|
||||
* to this list. If a future version of readpng2.c recognizes
|
||||
* more chunks, delete them from this list. */
|
||||
png_byte png_chunk_types_to_ignore[]=
|
||||
{ 99, 72, 82, 77, '\0', /* cHRM */
|
||||
/* These byte strings were copied from png.h. If a future libpng
|
||||
* version recognizes more chunks, add them to this list. If a
|
||||
* future version of readpng2.c recognizes more chunks, delete them
|
||||
* from this list. */
|
||||
static const png_byte chunks_to_ignore[] = {
|
||||
99, 72, 82, 77, '\0', /* cHRM */
|
||||
104, 73, 83, 84, '\0', /* hIST */
|
||||
105, 67, 67, 80, '\0', /* iCCP */
|
||||
105, 84, 88, 116, '\0', /* iTXt */
|
||||
111, 70, 70, 115, '\0', /* oFFs */
|
||||
112, 67, 65, 76, '\0', /* pCAL */
|
||||
115, 67, 65, 76, '\0', /* sCAL */
|
||||
112, 72, 89, 115, '\0', /* pHYs */
|
||||
115, 66, 73, 84, '\0', /* sBIT */
|
||||
115, 67, 65, 76, '\0', /* sCAL */
|
||||
115, 80, 76, 84, '\0', /* sPLT */
|
||||
115, 84, 69, 82, '\0', /* sTER */
|
||||
116, 69, 88, 116, '\0', /* tEXt */
|
||||
116, 73, 77, 69, '\0', /* tIME */
|
||||
122, 84, 88, 116, '\0'}; /* zTXt */
|
||||
#define NUM_PNG_CHUNK_TYPES_TO_IGNORE 13
|
||||
122, 84, 88, 116, '\0' /* zTXt */
|
||||
};
|
||||
|
||||
png_set_keep_unknown_chunks(png_ptr, HANDLE_CHUNK_NEVER,
|
||||
png_chunk_types_to_ignore, NUM_PNG_CHUNK_TYPES_TO_IGNORE);
|
||||
png_set_keep_unknown_chunks(png_ptr, 1 /* PNG_HANDLE_CHUNK_NEVER */,
|
||||
chunks_to_ignore, sizeof(chunks_to_ignore)/5);
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_UNKNOWN_CHUNKS_SUPPORTED */
|
||||
|
||||
|
||||
/* instead of doing png_init_io() here, now we set up our callback
|
||||
* functions for progressive decoding */
|
||||
@ -237,7 +258,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
* png_set_asm_flags (png_ptr, flags);
|
||||
*/
|
||||
|
||||
#if (defined(__i386__) || defined(_M_IX86)) && \
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
|
||||
defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||
/*
|
||||
* WARNING: This preprocessor approach means that the following code
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
@ -66,7 +90,7 @@ typedef struct _mainprog_info {
|
||||
int rowbytes;
|
||||
int channels;
|
||||
int need_bgcolor;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
int nommxfilters;
|
||||
int nommxcombine;
|
||||
int nommxinterlace;
|
||||
|
179
contrib/gregbook/readppm.c
Normal file
179
contrib/gregbook/readppm.c
Normal file
@ -0,0 +1,179 @@
|
||||
/*---------------------------------------------------------------------------
|
||||
|
||||
rpng - simple PNG display program readppm.c
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
This is a special-purpose replacement for readpng.c that allows binary
|
||||
PPM files to be used in place of PNG images.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, disclaimer, and this list of conditions.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, disclaimer, and this list of conditions in the documenta-
|
||||
tion and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this
|
||||
software must display the following acknowledgment:
|
||||
|
||||
This product includes software developed by Greg Roelofs
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "readpng.h" /* typedefs, common macros, public prototypes */
|
||||
|
||||
|
||||
ulg width, height;
|
||||
int bit_depth, color_type, channels;
|
||||
uch *image_data = NULL;
|
||||
FILE *saved_infile;
|
||||
|
||||
|
||||
void readpng_version_info()
|
||||
{
|
||||
fprintf(stderr, " Compiled without libpng, zlib or PBMPLUS/NetPBM.\n");
|
||||
}
|
||||
|
||||
|
||||
/* return value = 0 for success, 1 for bad sig, 2 for bad IHDR, 4 for no mem */
|
||||
|
||||
int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight)
|
||||
{
|
||||
static uch ppmline[256];
|
||||
int maxval;
|
||||
|
||||
|
||||
saved_infile = infile;
|
||||
|
||||
fgets(ppmline, 256, infile);
|
||||
if (ppmline[0] != 'P' || ppmline[1] != '6') {
|
||||
fprintf(stderr, "ERROR: not a PPM file\n");
|
||||
return 1;
|
||||
}
|
||||
/* possible color types: P5 = grayscale (0), P6 = RGB (2), P8 = RGBA (6) */
|
||||
if (ppmline[1] == '6') {
|
||||
color_type = 2;
|
||||
channels = 3;
|
||||
} else if (ppmline[1] == '8') {
|
||||
color_type = 6;
|
||||
channels = 4;
|
||||
} else /* if (ppmline[1] == '5') */ {
|
||||
color_type = 0;
|
||||
channels = 1;
|
||||
}
|
||||
|
||||
do {
|
||||
fgets(ppmline, 256, infile);
|
||||
} while (ppmline[0] == '#');
|
||||
sscanf(ppmline, "%lu %lu", &width, &height);
|
||||
|
||||
do {
|
||||
fgets(ppmline, 256, infile);
|
||||
} while (ppmline[0] == '#');
|
||||
sscanf(ppmline, "%d", &maxval);
|
||||
if (maxval != 255) {
|
||||
fprintf(stderr, "ERROR: maxval = %d\n", maxval);
|
||||
return 2;
|
||||
}
|
||||
bit_depth = 8;
|
||||
|
||||
*pWidth = width;
|
||||
*pHeight = height;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* returns 0 if succeeds, 1 if fails due to no bKGD chunk, 2 if libpng error;
|
||||
* scales values to 8-bit if necessary */
|
||||
|
||||
int readpng_get_bgcolor(uch *red, uch *green, uch *blue)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* display_exponent == LUT_exponent * CRT_exponent */
|
||||
|
||||
uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
{
|
||||
ulg rowbytes;
|
||||
|
||||
|
||||
/* expand palette images to RGB, low-bit-depth grayscale images to 8 bits,
|
||||
* transparency chunks to full alpha channel; strip 16-bit-per-sample
|
||||
* images to 8 bits per sample; and convert grayscale to RGB[A] */
|
||||
|
||||
/* GRR WARNING: grayscale needs to be expanded and channels reset! */
|
||||
|
||||
*pRowbytes = rowbytes = channels*width;
|
||||
*pChannels = channels;
|
||||
|
||||
if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height));
|
||||
|
||||
|
||||
/* now we can go ahead and just read the whole image */
|
||||
|
||||
fread(image_data, 1L, rowbytes*height, saved_infile);
|
||||
|
||||
|
||||
return image_data;
|
||||
}
|
||||
|
||||
|
||||
void readpng_cleanup(int free_image_data)
|
||||
{
|
||||
if (free_image_data && image_data) {
|
||||
free(image_data);
|
||||
image_data = NULL;
|
||||
}
|
||||
}
|
@ -22,16 +22,24 @@
|
||||
- 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -48,11 +56,28 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng-win"
|
||||
#define LONGNAME "Simple PNG Viewer for Windows"
|
||||
#define VERSION "1.20 of 28 May 2001"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -85,10 +110,9 @@ static void rpng_win_cleanup(void);
|
||||
LRESULT CALLBACK rpng_win_wndproc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char titlebar[1024];
|
||||
static char *progname = PROGNAME;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME; /* GRR: not (yet) used */
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -325,9 +349,14 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
* check for one in the PNG file--if not, the initialized values of 0
|
||||
* (black) will be used */
|
||||
|
||||
if (have_bg)
|
||||
sscanf(bgstr+1, "%2x%2x%2x", &bg_red, &bg_green, &bg_blue);
|
||||
else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {
|
||||
if (have_bg) {
|
||||
unsigned r, g, b; /* this approach quiets compiler warnings */
|
||||
|
||||
sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b);
|
||||
bg_red = (uch)r;
|
||||
bg_green = (uch)g;
|
||||
bg_blue = (uch)b;
|
||||
} else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {
|
||||
readpng_cleanup(TRUE);
|
||||
fprintf(stderr, PROGNAME
|
||||
": libpng error while checking for background color\n");
|
||||
|
@ -9,7 +9,7 @@
|
||||
by Martin Zinser under OpenVMS; may work under OS/2 with some tweaking).
|
||||
|
||||
to do:
|
||||
- 8-bit support
|
||||
- 8-bit (colormapped) X support
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
@ -21,18 +21,27 @@
|
||||
- 1.10: added support for non-default visuals; fixed X pixel-conversion
|
||||
- 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.12: fixed small X memory leak (thanks to Francois Petitjean)
|
||||
- 1.13: fixed XFreeGC() crash bug
|
||||
- 1.12: fixed some small X memory leaks (thanks to François Petitjean)
|
||||
- 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche)
|
||||
- 1.14: added support for X resources (thanks to Gerhard Niklasch)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -49,11 +58,30 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng-x"
|
||||
#define LONGNAME "Simple PNG Viewer for X"
|
||||
#define VERSION "1.13 of 16 August 2001"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
#define RESNAME "rpng" /* our X resource application name */
|
||||
#define RESCLASS "Rpng" /* our X resource class name */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -91,6 +119,8 @@ static int rpng_x_msb(ulg u32val);
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME;
|
||||
static char *res_name = RESNAME;
|
||||
static char *res_class = RESCLASS;
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -399,11 +429,12 @@ static int rpng_x_create_window(void)
|
||||
XEvent e;
|
||||
XGCValues gcvalues;
|
||||
XSetWindowAttributes attr;
|
||||
XSizeHints *size_hints;
|
||||
XTextProperty windowName, *pWindowName = &windowName;
|
||||
XTextProperty iconName, *pIconName = &iconName;
|
||||
XVisualInfo visual_info;
|
||||
XSizeHints *size_hints;
|
||||
XWMHints *wm_hints;
|
||||
XClassHint *class_hints;
|
||||
|
||||
|
||||
screen = DefaultScreen(display);
|
||||
@ -526,7 +557,7 @@ static int rpng_x_create_window(void)
|
||||
if (!XStringListToTextProperty(&icon_name, 1, pIconName))
|
||||
pIconName = NULL;
|
||||
|
||||
/* OK if either hints allocation fails; XSetWMProperties() allows NULLs */
|
||||
/* OK if any hints allocation fails; XSetWMProperties() allows NULLs */
|
||||
|
||||
if ((size_hints = XAllocSizeHints()) != NULL) {
|
||||
/* window will not be resizable */
|
||||
@ -542,8 +573,13 @@ static int rpng_x_create_window(void)
|
||||
wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ;
|
||||
}
|
||||
|
||||
if ((class_hints = XAllocClassHint()) != NULL) {
|
||||
class_hints->res_name = res_name;
|
||||
class_hints->res_class = res_class;
|
||||
}
|
||||
|
||||
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
|
||||
size_hints, wm_hints, NULL);
|
||||
size_hints, wm_hints, class_hints);
|
||||
|
||||
/* various properties and hints no longer needed; free memory */
|
||||
if (pWindowName)
|
||||
@ -554,6 +590,8 @@ static int rpng_x_create_window(void)
|
||||
XFree(size_hints);
|
||||
if (wm_hints)
|
||||
XFree(wm_hints);
|
||||
if (class_hints)
|
||||
XFree(class_hints);
|
||||
|
||||
XMapWindow(display, window);
|
||||
|
||||
|
@ -27,16 +27,25 @@
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
||||
- 1.21: made minor tweak to usage screen to fit within 25-line console
|
||||
- 1.22: added AMD64/EM64T support (__x86_64__)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -53,11 +62,28 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng2-win"
|
||||
#define LONGNAME "Progressive PNG Viewer for Windows"
|
||||
#define VERSION "1.21 of 29 June 2001"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -119,10 +145,9 @@ static void rpng2_win_cleanup(void);
|
||||
LRESULT CALLBACK rpng2_win_wndproc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char titlebar[1024];
|
||||
static char *progname = PROGNAME;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME; /* GRR: not (yet) used */
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -367,7 +392,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
} else if (!strncmp(*argv, "-timing", 2)) {
|
||||
timing = TRUE;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
} else if (!strncmp(*argv, "-nommxfilters", 7)) {
|
||||
rpng2_info.nommxfilters = TRUE;
|
||||
} else if (!strncmp(*argv, "-nommxcombine", 7)) {
|
||||
@ -432,7 +457,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
readpng2_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
" %*s [[-nommxfilters] [-nommxcombine] [-nommxinterlace] | -nommx]\n"
|
||||
#endif
|
||||
" %*s file.png\n\n"
|
||||
@ -447,17 +472,17 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
"\t\t transparent images; overrides -bgcolor option\n"
|
||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||
"\t\t download of image (~36 Kbps)\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
" -nommx*\tdisable optimized MMX routines for decoding row filters,\n"
|
||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
||||
#endif
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"Press Q or Esc to quit this usage screen. ",
|
||||
PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
strlen(PROGNAME), " ",
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
(int)strlen(PROGNAME), " ",
|
||||
#endif
|
||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fflush(stderr);
|
||||
do
|
||||
ch = _getch();
|
||||
|
@ -13,7 +13,8 @@
|
||||
and "radial waves" patterns, respectively.
|
||||
|
||||
to do:
|
||||
- 8-bit support
|
||||
- fix expose/redraw code: don't draw entire row if only part exposed
|
||||
- 8-bit (colormapped) X support
|
||||
- finish resizable checkerboard-gradient (sizes 4-128?)
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
|
||||
@ -26,18 +27,32 @@
|
||||
- 1.11: added -usleep option for demos; fixed command-line parsing bug
|
||||
- 1.12: added -pause option for demos and testing
|
||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
||||
- 1.21: fixed small X memory leak (thanks to Francois Petitjean)
|
||||
- 1.22: fixed XFreeGC() crash bug
|
||||
- 1.21: fixed some small X memory leaks (thanks to François Petitjean)
|
||||
- 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche)
|
||||
- 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares)
|
||||
- 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp =
|
||||
24; added support for X resources (thanks to Gerhard Niklasch)
|
||||
- 1.31: added code to skip unused chunks (thanks to Glenn Randers-Pehrson)
|
||||
- 1.32: added AMD64/EM64T support (__x86_64__); added basic expose/redraw
|
||||
handling
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -54,14 +69,34 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng2-x"
|
||||
#define LONGNAME "Progressive PNG Viewer for X"
|
||||
#define VERSION "1.22 of 16 August 2001"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
#define RESNAME "rpng2" /* our X resource application name */
|
||||
#define RESCLASS "Rpng" /* our X resource class name */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h> /* for jmpbuf declaration in readpng2.h */
|
||||
#include <time.h>
|
||||
@ -88,6 +123,12 @@
|
||||
#define CLIP8P(c) MAX(0,(MIN((c),255))) /* 8-bit pos. integer (uch) */
|
||||
#define ROUNDF(f) ((int)(f + 0.5))
|
||||
|
||||
#define QUIT(e,k) ((e.type == ButtonPress && e.xbutton.button == Button1) || \
|
||||
(e.type == KeyPress && /* v--- or 1 for shifted keys */ \
|
||||
((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape)))
|
||||
|
||||
#define NO_24BIT_MASKS /* undef case not fully written--only for redisplay() */
|
||||
|
||||
#define rgb1_max bg_freq
|
||||
#define rgb1_min bg_gray
|
||||
#define rgb2_max bg_bsat
|
||||
@ -117,18 +158,26 @@
|
||||
* overhead) */
|
||||
|
||||
/* local prototypes */
|
||||
static void rpng2_x_init(void);
|
||||
static int rpng2_x_create_window(void);
|
||||
static int rpng2_x_load_bg_image(void);
|
||||
static void rpng2_x_display_row(ulg row);
|
||||
static void rpng2_x_finish_display(void);
|
||||
static void rpng2_x_cleanup(void);
|
||||
static int rpng2_x_msb(ulg u32val);
|
||||
static void rpng2_x_init (void);
|
||||
static int rpng2_x_create_window (void);
|
||||
static int rpng2_x_load_bg_image (void);
|
||||
static void rpng2_x_display_row (ulg row);
|
||||
static void rpng2_x_finish_display (void);
|
||||
static void rpng2_x_redisplay_image (ulg startcol, ulg startrow,
|
||||
ulg width, ulg height);
|
||||
#ifdef FEATURE_LOOP
|
||||
static void rpng2_x_reload_bg_image (void);
|
||||
static int is_number (char *p);
|
||||
#endif
|
||||
static void rpng2_x_cleanup (void);
|
||||
static int rpng2_x_msb (ulg u32val);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME;
|
||||
static char *res_name = RESNAME;
|
||||
static char *res_class = RESCLASS;
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -139,7 +188,7 @@ static int incount;
|
||||
|
||||
static int pat = 6; /* must be less than num_bgpat */
|
||||
static int bg_image = 0;
|
||||
static int bgscale = 16;
|
||||
static int bgscale, bgscale_default = 16;
|
||||
static ulg bg_rowbytes;
|
||||
static uch *bg_data;
|
||||
|
||||
@ -165,7 +214,8 @@ static struct rgb_color {
|
||||
{255, 127, 0}, /* 12: orange */
|
||||
{192, 96, 0}, /* 13: darker orange */
|
||||
{ 24, 60, 0}, /* 14: dark green-yellow */
|
||||
{ 85, 125, 200} /* 15: ice blue */
|
||||
{ 85, 125, 200}, /* 15: ice blue */
|
||||
{192, 192, 192} /* 16: Netscape/Mosaic gray */
|
||||
};
|
||||
/* not used for now, but should be for error-checking:
|
||||
static int num_rgb = sizeof(rgb) / sizeof(struct rgb_color);
|
||||
@ -193,6 +243,7 @@ static struct background_pattern {
|
||||
int rgb1_max, rgb1_min; /* or bg_freq, bg_gray */
|
||||
int rgb2_max, rgb2_min; /* or bg_bsat, bg_brot (both scaled by 10)*/
|
||||
} bg[] = {
|
||||
{0, 1,1, 16,16}, /* checkered: white vs. light gray (basic) */
|
||||
{0+8, 2,0, 1,15}, /* checkered: tan/black vs. white/ice blue */
|
||||
{0+24, 2,0, 1,0}, /* checkered: tan/black vs. white/black */
|
||||
{0+8, 4,5, 0,2}, /* checkered: gold/yellow vs. black/tan */
|
||||
@ -244,6 +295,10 @@ int main(int argc, char **argv)
|
||||
int error = 0;
|
||||
int timing = FALSE;
|
||||
int have_bg = FALSE;
|
||||
#ifdef FEATURE_LOOP
|
||||
int loop = FALSE;
|
||||
long loop_interval = -1; /* seconds (100,000 max) */
|
||||
#endif
|
||||
double LUT_exponent; /* just the lookup table */
|
||||
double CRT_exponent = 2.2; /* just the monitor */
|
||||
double default_display_exponent; /* whole display system */
|
||||
@ -344,13 +399,12 @@ int main(int argc, char **argv)
|
||||
if (!*++argv)
|
||||
++error;
|
||||
else {
|
||||
pat = atoi(*argv) - 1;
|
||||
if (pat < 0 || pat >= num_bgpat)
|
||||
++error;
|
||||
else {
|
||||
pat = atoi(*argv);
|
||||
if (pat >= 0 && pat < num_bgpat) {
|
||||
bg_image = TRUE;
|
||||
have_bg = FALSE;
|
||||
}
|
||||
} else
|
||||
++error;
|
||||
}
|
||||
} else if (!strncmp(*argv, "-usleep", 2)) {
|
||||
if (!*++argv)
|
||||
@ -363,7 +417,21 @@ int main(int argc, char **argv)
|
||||
pause_after_pass = TRUE;
|
||||
} else if (!strncmp(*argv, "-timing", 2)) {
|
||||
timing = TRUE;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#ifdef FEATURE_LOOP
|
||||
} else if (!strncmp(*argv, "-loop", 2)) {
|
||||
loop = TRUE;
|
||||
if (!argv[1] || !is_number(argv[1]))
|
||||
loop_interval = 2;
|
||||
else {
|
||||
++argv;
|
||||
loop_interval = atol(*argv);
|
||||
if (loop_interval < 0)
|
||||
loop_interval = 2;
|
||||
else if (loop_interval > 100000) /* bit more than one day */
|
||||
loop_interval = 100000;
|
||||
}
|
||||
#endif
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
} else if (!strncmp(*argv, "-nommxfilters", 7)) {
|
||||
rpng2_info.nommxfilters = TRUE;
|
||||
} else if (!strncmp(*argv, "-nommxcombine", 7)) {
|
||||
@ -434,10 +502,14 @@ int main(int argc, char **argv)
|
||||
readpng2_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
" %*s [[-nommxfilters] [-nommxcombine] [-nommxinterlace] | -nommx]\n"
|
||||
#endif
|
||||
#ifdef FEATURE_LOOP
|
||||
" %*s [-usleep dur | -timing] [-pause] [-loop [sec]] file.png\n\n"
|
||||
#else
|
||||
" %*s [-usleep dur | -timing] [-pause] file.png\n\n"
|
||||
#endif
|
||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
@ -446,9 +518,14 @@ int main(int argc, char **argv)
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images; overrides -bgpat\n"
|
||||
" pat \tdesired background pattern number (1-%d); used with\n"
|
||||
" pat \tdesired background pattern number (0-%d); used with\n"
|
||||
"\t\t transparent images; overrides -bgcolor\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#ifdef FEATURE_LOOP
|
||||
" -loop\tloops through background images after initial display\n"
|
||||
"\t\t is complete (depends on -bgpat)\n"
|
||||
" sec \tseconds to display each background image (default = 2)\n"
|
||||
#endif
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
" -nommx*\tdisable optimized MMX routines for decoding row filters,\n"
|
||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
||||
#endif
|
||||
@ -460,10 +537,10 @@ int main(int argc, char **argv)
|
||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||
"is displayed) to quit.\n"
|
||||
"\n", PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
strlen(PROGNAME), " ",
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
(int)strlen(PROGNAME), " ",
|
||||
#endif
|
||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat-1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -530,13 +607,111 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
#ifdef FEATURE_LOOP
|
||||
|
||||
if (loop && bg_image) {
|
||||
for (;;) {
|
||||
int i, use_sleep;
|
||||
struct timeval now, then;
|
||||
|
||||
/* get current time and add loop_interval to get target time */
|
||||
if (gettimeofday(&then, NULL) == 0) {
|
||||
then.tv_sec += loop_interval;
|
||||
use_sleep = FALSE;
|
||||
} else
|
||||
use_sleep = TRUE;
|
||||
|
||||
/* do quick check for a quit event but don't wait for it */
|
||||
/* GRR BUG: should also check for Expose events and redraw... */
|
||||
if (XCheckMaskEvent(display, KeyPressMask | ButtonPressMask, &e))
|
||||
if (QUIT(e,k))
|
||||
break;
|
||||
|
||||
/* generate next background image */
|
||||
if (++pat >= num_bgpat)
|
||||
pat = 0;
|
||||
rpng2_x_reload_bg_image();
|
||||
|
||||
/* wait for timeout, using whatever means are available */
|
||||
if (use_sleep || gettimeofday(&now, NULL) != 0) {
|
||||
for (i = loop_interval; i > 0; --i) {
|
||||
sleep(1);
|
||||
/* GRR BUG: also need to check for Expose (and redraw!) */
|
||||
if (XCheckMaskEvent(display, KeyPressMask | ButtonPressMask,
|
||||
&e) && QUIT(e,k))
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* Y2038 BUG! */
|
||||
if (now.tv_sec < then.tv_sec ||
|
||||
(now.tv_sec == then.tv_sec && now.tv_usec < then.tv_usec))
|
||||
{
|
||||
int quit = FALSE;
|
||||
long seconds_to_go = then.tv_sec - now.tv_sec;
|
||||
long usleep_usec;
|
||||
|
||||
/* basically chew up most of remaining loop-interval with
|
||||
* calls to sleep(1) interleaved with checks for quit
|
||||
* events, but also recalc time-to-go periodically; when
|
||||
* done, clean up any remaining time with usleep() call
|
||||
* (could also use SIGALRM, but signals are a pain...) */
|
||||
while (seconds_to_go-- > 1) {
|
||||
int seconds_done = 0;
|
||||
|
||||
for (i = seconds_to_go; i > 0 && !quit; --i) {
|
||||
sleep(1);
|
||||
/* GRR BUG: need to check for Expose and redraw */
|
||||
if (XCheckMaskEvent(display, KeyPressMask |
|
||||
ButtonPressMask, &e) && QUIT(e,k))
|
||||
quit = TRUE;
|
||||
if (++seconds_done > 1000)
|
||||
break; /* time to redo seconds_to_go meas. */
|
||||
}
|
||||
if (quit)
|
||||
break;
|
||||
|
||||
/* OK, more than 1000 seconds since last check:
|
||||
* correct the time-to-go measurement for drift */
|
||||
if (gettimeofday(&now, NULL) == 0) {
|
||||
if (now.tv_sec >= then.tv_sec)
|
||||
break;
|
||||
seconds_to_go = then.tv_sec - now.tv_sec;
|
||||
} else
|
||||
++seconds_to_go; /* restore what we subtracted */
|
||||
}
|
||||
if (quit)
|
||||
break; /* breaks outer do-loop, skips redisplay */
|
||||
|
||||
/* since difference between "now" and "then" is already
|
||||
* eaten up to within a couple of seconds, don't need to
|
||||
* worry about overflow--but might have overshot (neg.) */
|
||||
if (gettimeofday(&now, NULL) == 0) {
|
||||
usleep_usec = 1000000L*(then.tv_sec - now.tv_sec) +
|
||||
then.tv_usec - now.tv_usec;
|
||||
if (usleep_usec > 0)
|
||||
usleep((ulg)usleep_usec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* composite image against new background and display (note that
|
||||
* we do not take into account the time spent doing this...) */
|
||||
rpng2_x_redisplay_image (0, 0, rpng2_info.width, rpng2_info.height);
|
||||
}
|
||||
|
||||
} else /* FALL THROUGH and do the normal thing */
|
||||
|
||||
#endif /* FEATURE_LOOP */
|
||||
|
||||
/* wait for the user to tell us when to quit */
|
||||
|
||||
do
|
||||
do {
|
||||
XNextEvent(display, &e);
|
||||
while (!(e.type == ButtonPress && e.xbutton.button == Button1) &&
|
||||
!(e.type == KeyPress && /* v--- or 1 for shifted keys */
|
||||
((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape) ));
|
||||
if (e.type == Expose) {
|
||||
XExposeEvent *ex = (XExposeEvent *)&e;
|
||||
rpng2_x_redisplay_image (ex->x, ex->y, ex->width, ex->height);
|
||||
}
|
||||
} while (!QUIT(e,k));
|
||||
|
||||
|
||||
/* we're done: clean up all image and X resources and go away */
|
||||
@ -594,7 +769,6 @@ static void rpng2_x_init(void)
|
||||
* If we/it segfault instead, seems like a libpng bug... */
|
||||
|
||||
/* we're here via libpng callback, so if window fails, clean and bail */
|
||||
printf("readpng2_cleanup.\n");
|
||||
readpng2_cleanup(&rpng2_info);
|
||||
rpng2_x_cleanup();
|
||||
exit(2);
|
||||
@ -619,11 +793,12 @@ static int rpng2_x_create_window(void)
|
||||
XEvent e;
|
||||
XGCValues gcvalues;
|
||||
XSetWindowAttributes attr;
|
||||
XSizeHints *size_hints;
|
||||
XTextProperty windowName, *pWindowName = &windowName;
|
||||
XTextProperty iconName, *pIconName = &iconName;
|
||||
XVisualInfo visual_info;
|
||||
XSizeHints *size_hints;
|
||||
XWMHints *wm_hints;
|
||||
XClassHint *class_hints;
|
||||
|
||||
|
||||
Trace((stderr, "beginning rpng2_x_create_window()\n"))
|
||||
@ -746,8 +921,13 @@ static int rpng2_x_create_window(void)
|
||||
wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ;
|
||||
}
|
||||
|
||||
if ((class_hints = XAllocClassHint()) != NULL) {
|
||||
class_hints->res_name = res_name;
|
||||
class_hints->res_class = res_class;
|
||||
}
|
||||
|
||||
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
|
||||
size_hints, wm_hints, NULL);
|
||||
size_hints, wm_hints, class_hints);
|
||||
|
||||
/* various properties and hints no longer needed; free memory */
|
||||
if (pWindowName)
|
||||
@ -758,6 +938,8 @@ static int rpng2_x_create_window(void)
|
||||
XFree(size_hints);
|
||||
if (wm_hints)
|
||||
XFree(wm_hints);
|
||||
if (class_hints)
|
||||
XFree(class_hints);
|
||||
|
||||
XMapWindow(display, window);
|
||||
|
||||
@ -855,7 +1037,7 @@ static int rpng2_x_load_bg_image(void)
|
||||
uch r1, r2, g1, g2, b1, b2;
|
||||
uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv;
|
||||
int k, hmax, max;
|
||||
int xidx, yidx, yidx_max = (bgscale-1);
|
||||
int xidx, yidx, yidx_max;
|
||||
int even_odd_vert, even_odd_horiz, even_odd;
|
||||
int invert_gradient2 = (bg[pat].type & 0x08);
|
||||
int invert_column;
|
||||
@ -877,6 +1059,9 @@ static int rpng2_x_load_bg_image(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bgscale = (pat == 0)? 8 : bgscale_default;
|
||||
yidx_max = bgscale - 1;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Vertical gradients (ramps) in NxN squares, alternating direction and
|
||||
colors (N == bgscale).
|
||||
@ -1068,10 +1253,12 @@ static int rpng2_x_load_bg_image(void)
|
||||
|
||||
if (depth == 24 || depth == 32) {
|
||||
ulg red, green, blue;
|
||||
int bpp = ximage->bits_per_pixel;
|
||||
|
||||
for (row = 0; row < rpng2_info.height; ++row) {
|
||||
src = bg_data + row*bg_rowbytes;
|
||||
dest = ximage->data + row*ximage_rowbytes;
|
||||
if (bpp == 32) { /* slightly optimized version */
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
red = *src++;
|
||||
green = *src++;
|
||||
@ -1080,12 +1267,27 @@ static int rpng2_x_load_bg_image(void)
|
||||
(green << GShift) |
|
||||
(blue << BShift);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
/* GRR BUG: this assumes bpp == 32, but may be 24: */
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
} else {
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
red = *src++;
|
||||
green = *src++;
|
||||
blue = *src++;
|
||||
pixel = (red << RShift) |
|
||||
(green << GShift) |
|
||||
(blue << BShift);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
/* GRR BUG? this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift, RMask, etc.) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (depth == 16) {
|
||||
@ -1155,10 +1357,7 @@ static void rpng2_x_display_row(ulg row)
|
||||
PROGNAME, prevpass + 1);
|
||||
do
|
||||
XNextEvent(display, &e);
|
||||
while (!(e.type == ButtonPress && e.xbutton.button == Button1)
|
||||
&& !(e.type == KeyPress &&
|
||||
((k = XLookupKeysym(&e.xkey, 0)) == XK_q
|
||||
|| k == XK_Escape) )) ;
|
||||
while (!QUIT(e,k));
|
||||
}
|
||||
fprintf(stderr, "%s: pass %d of 7\r", PROGNAME, rpng2_info.pass + 1);
|
||||
fflush(stderr);
|
||||
@ -1179,6 +1378,7 @@ static void rpng2_x_display_row(ulg row)
|
||||
|
||||
if (depth == 24 || depth == 32) {
|
||||
ulg red, green, blue;
|
||||
int bpp = ximage->bits_per_pixel;
|
||||
|
||||
src = rpng2_info.image_data + row*rpng2_info.rowbytes;
|
||||
if (bg_image)
|
||||
@ -1193,11 +1393,18 @@ static void rpng2_x_display_row(ulg row)
|
||||
(green << GShift) |
|
||||
(blue << BShift);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
/* GRR BUG: this assumes bpp == 32, but may be 24: */
|
||||
if (bpp == 32) {
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
} else {
|
||||
/* GRR BUG? this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift, RMask, etc.) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
}
|
||||
} else /* if (rpng2_info.channels == 4) */ {
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
@ -1230,11 +1437,18 @@ static void rpng2_x_display_row(ulg row)
|
||||
(green << GShift) |
|
||||
(blue << BShift);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
/* GRR BUG: this assumes bpp == 32, but may be 24: */
|
||||
if (bpp == 32) {
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
} else {
|
||||
/* GRR BUG? this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift, RMask, etc.) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1352,6 +1566,472 @@ static void rpng2_x_finish_display(void)
|
||||
|
||||
|
||||
|
||||
static void rpng2_x_redisplay_image(ulg startcol, ulg startrow,
|
||||
ulg width, ulg height)
|
||||
{
|
||||
uch bg_red = rpng2_info.bg_red;
|
||||
uch bg_green = rpng2_info.bg_green;
|
||||
uch bg_blue = rpng2_info.bg_blue;
|
||||
uch *src, *src2=NULL;
|
||||
char *dest;
|
||||
uch r, g, b, a;
|
||||
ulg i, row, lastrow = 0;
|
||||
ulg pixel;
|
||||
int ximage_rowbytes = ximage->bytes_per_line;
|
||||
|
||||
|
||||
Trace((stderr, "beginning display loop (image_channels == %d)\n",
|
||||
image_channels))
|
||||
Trace((stderr, " (width = %ld, rowbytes = %ld, ximage_rowbytes = %d)\n",
|
||||
rpng2_info.width, image_rowbytes, ximage_rowbytes))
|
||||
Trace((stderr, " (bpp = %d)\n", ximage->bits_per_pixel))
|
||||
Trace((stderr, " (byte_order = %s)\n", ximage->byte_order == MSBFirst?
|
||||
"MSBFirst" : (ximage->byte_order == LSBFirst? "LSBFirst" : "unknown")))
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Aside from the use of the rpng2_info struct and of src2 (for background
|
||||
image), this routine is identical to rpng_x_display_image() in the non-
|
||||
progressive version of the program--for the simple reason that redisplay
|
||||
of the image against a new background happens after the image is fully
|
||||
decoded and therefore is, by definition, non-progressive.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
if (depth == 24 || depth == 32) {
|
||||
ulg red, green, blue;
|
||||
int bpp = ximage->bits_per_pixel;
|
||||
|
||||
for (lastrow = row = startrow; row < startrow+height; ++row) {
|
||||
src = rpng2_info.image_data + row*rpng2_info.rowbytes;
|
||||
if (bg_image)
|
||||
src2 = bg_data + row*bg_rowbytes;
|
||||
dest = ximage->data + row*ximage_rowbytes;
|
||||
if (rpng2_info.channels == 3) {
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
red = *src++;
|
||||
green = *src++;
|
||||
blue = *src++;
|
||||
#ifdef NO_24BIT_MASKS
|
||||
pixel = (red << RShift) |
|
||||
(green << GShift) |
|
||||
(blue << BShift);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
if (bpp == 32) {
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
} else {
|
||||
/* this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift, RMask, etc.) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
#else
|
||||
red = (RShift < 0)? red << (-RShift) : red >> RShift;
|
||||
green = (GShift < 0)? green << (-GShift) : green >> GShift;
|
||||
blue = (BShift < 0)? blue << (-BShift) : blue >> BShift;
|
||||
pixel = (red & RMask) | (green & GMask) | (blue & BMask);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
if (bpp == 32) {
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
} else {
|
||||
/* GRR BUG */
|
||||
/* this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift/RMask/etc. here, too) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} else /* if (rpng2_info.channels == 4) */ {
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
r = *src++;
|
||||
g = *src++;
|
||||
b = *src++;
|
||||
a = *src++;
|
||||
if (bg_image) {
|
||||
bg_red = *src2++;
|
||||
bg_green = *src2++;
|
||||
bg_blue = *src2++;
|
||||
}
|
||||
if (a == 255) {
|
||||
red = r;
|
||||
green = g;
|
||||
blue = b;
|
||||
} else if (a == 0) {
|
||||
red = bg_red;
|
||||
green = bg_green;
|
||||
blue = bg_blue;
|
||||
} else {
|
||||
/* this macro (from png.h) composites the foreground
|
||||
* and background values and puts the result into the
|
||||
* first argument */
|
||||
alpha_composite(red, r, a, bg_red);
|
||||
alpha_composite(green, g, a, bg_green);
|
||||
alpha_composite(blue, b, a, bg_blue);
|
||||
}
|
||||
#ifdef NO_24BIT_MASKS
|
||||
pixel = (red << RShift) |
|
||||
(green << GShift) |
|
||||
(blue << BShift);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
if (bpp == 32) {
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
} else {
|
||||
/* this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift, RMask, etc.) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
#else
|
||||
red = (RShift < 0)? red << (-RShift) : red >> RShift;
|
||||
green = (GShift < 0)? green << (-GShift) : green >> GShift;
|
||||
blue = (BShift < 0)? blue << (-BShift) : blue >> BShift;
|
||||
pixel = (red & RMask) | (green & GMask) | (blue & BMask);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
if (bpp == 32) {
|
||||
*dest++ = (char)((pixel >> 24) & 0xff);
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
} else {
|
||||
/* GRR BUG */
|
||||
/* this assumes bpp == 24 & bits are packed low */
|
||||
/* (probably need to use RShift/RMask/etc. here, too) */
|
||||
*dest++ = (char)((pixel >> 16) & 0xff);
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/* display after every 16 lines */
|
||||
if (((row+1) & 0xf) == 0) {
|
||||
XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0,
|
||||
(int)lastrow, rpng2_info.width, 16);
|
||||
XFlush(display);
|
||||
lastrow = row + 1;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (depth == 16) {
|
||||
ush red, green, blue;
|
||||
|
||||
for (lastrow = row = startrow; row < startrow+height; ++row) {
|
||||
src = rpng2_info.row_pointers[row];
|
||||
if (bg_image)
|
||||
src2 = bg_data + row*bg_rowbytes;
|
||||
dest = ximage->data + row*ximage_rowbytes;
|
||||
if (rpng2_info.channels == 3) {
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
red = ((ush)(*src) << 8);
|
||||
++src;
|
||||
green = ((ush)(*src) << 8);
|
||||
++src;
|
||||
blue = ((ush)(*src) << 8);
|
||||
++src;
|
||||
pixel = ((red >> RShift) & RMask) |
|
||||
((green >> GShift) & GMask) |
|
||||
((blue >> BShift) & BMask);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
} else /* if (rpng2_info.channels == 4) */ {
|
||||
for (i = rpng2_info.width; i > 0; --i) {
|
||||
r = *src++;
|
||||
g = *src++;
|
||||
b = *src++;
|
||||
a = *src++;
|
||||
if (bg_image) {
|
||||
bg_red = *src2++;
|
||||
bg_green = *src2++;
|
||||
bg_blue = *src2++;
|
||||
}
|
||||
if (a == 255) {
|
||||
red = ((ush)r << 8);
|
||||
green = ((ush)g << 8);
|
||||
blue = ((ush)b << 8);
|
||||
} else if (a == 0) {
|
||||
red = ((ush)bg_red << 8);
|
||||
green = ((ush)bg_green << 8);
|
||||
blue = ((ush)bg_blue << 8);
|
||||
} else {
|
||||
/* this macro (from png.h) composites the foreground
|
||||
* and background values and puts the result back into
|
||||
* the first argument (== fg byte here: safe) */
|
||||
alpha_composite(r, r, a, bg_red);
|
||||
alpha_composite(g, g, a, bg_green);
|
||||
alpha_composite(b, b, a, bg_blue);
|
||||
red = ((ush)r << 8);
|
||||
green = ((ush)g << 8);
|
||||
blue = ((ush)b << 8);
|
||||
}
|
||||
pixel = ((red >> RShift) & RMask) |
|
||||
((green >> GShift) & GMask) |
|
||||
((blue >> BShift) & BMask);
|
||||
/* recall that we set ximage->byte_order = MSBFirst above */
|
||||
*dest++ = (char)((pixel >> 8) & 0xff);
|
||||
*dest++ = (char)( pixel & 0xff);
|
||||
}
|
||||
}
|
||||
/* display after every 16 lines */
|
||||
if (((row+1) & 0xf) == 0) {
|
||||
XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0,
|
||||
(int)lastrow, rpng2_info.width, 16);
|
||||
XFlush(display);
|
||||
lastrow = row + 1;
|
||||
}
|
||||
}
|
||||
|
||||
} else /* depth == 8 */ {
|
||||
|
||||
/* GRR: add 8-bit support */
|
||||
|
||||
}
|
||||
|
||||
Trace((stderr, "calling final XPutImage()\n"))
|
||||
if (lastrow < startrow+height) {
|
||||
XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0,
|
||||
(int)lastrow, rpng2_info.width, rpng2_info.height-lastrow);
|
||||
XFlush(display);
|
||||
}
|
||||
|
||||
} /* end function rpng2_x_redisplay_image() */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef FEATURE_LOOP
|
||||
|
||||
static void rpng2_x_reload_bg_image(void)
|
||||
{
|
||||
char *dest;
|
||||
uch r1, r2, g1, g2, b1, b2;
|
||||
uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv;
|
||||
int k, hmax, max;
|
||||
int xidx, yidx, yidx_max;
|
||||
int even_odd_vert, even_odd_horiz, even_odd;
|
||||
int invert_gradient2 = (bg[pat].type & 0x08);
|
||||
int invert_column;
|
||||
ulg i, row;
|
||||
|
||||
|
||||
bgscale = (pat == 0)? 8 : bgscale_default;
|
||||
yidx_max = bgscale - 1;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Vertical gradients (ramps) in NxN squares, alternating direction and
|
||||
colors (N == bgscale).
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
if ((bg[pat].type & 0x07) == 0) {
|
||||
uch r1_min = rgb[bg[pat].rgb1_min].r;
|
||||
uch g1_min = rgb[bg[pat].rgb1_min].g;
|
||||
uch b1_min = rgb[bg[pat].rgb1_min].b;
|
||||
uch r2_min = rgb[bg[pat].rgb2_min].r;
|
||||
uch g2_min = rgb[bg[pat].rgb2_min].g;
|
||||
uch b2_min = rgb[bg[pat].rgb2_min].b;
|
||||
int r1_diff = rgb[bg[pat].rgb1_max].r - r1_min;
|
||||
int g1_diff = rgb[bg[pat].rgb1_max].g - g1_min;
|
||||
int b1_diff = rgb[bg[pat].rgb1_max].b - b1_min;
|
||||
int r2_diff = rgb[bg[pat].rgb2_max].r - r2_min;
|
||||
int g2_diff = rgb[bg[pat].rgb2_max].g - g2_min;
|
||||
int b2_diff = rgb[bg[pat].rgb2_max].b - b2_min;
|
||||
|
||||
for (row = 0; row < rpng2_info.height; ++row) {
|
||||
yidx = (int)(row % bgscale);
|
||||
even_odd_vert = (int)((row / bgscale) & 1);
|
||||
|
||||
r1 = r1_min + (r1_diff * yidx) / yidx_max;
|
||||
g1 = g1_min + (g1_diff * yidx) / yidx_max;
|
||||
b1 = b1_min + (b1_diff * yidx) / yidx_max;
|
||||
r1_inv = r1_min + (r1_diff * (yidx_max-yidx)) / yidx_max;
|
||||
g1_inv = g1_min + (g1_diff * (yidx_max-yidx)) / yidx_max;
|
||||
b1_inv = b1_min + (b1_diff * (yidx_max-yidx)) / yidx_max;
|
||||
|
||||
r2 = r2_min + (r2_diff * yidx) / yidx_max;
|
||||
g2 = g2_min + (g2_diff * yidx) / yidx_max;
|
||||
b2 = b2_min + (b2_diff * yidx) / yidx_max;
|
||||
r2_inv = r2_min + (r2_diff * (yidx_max-yidx)) / yidx_max;
|
||||
g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max;
|
||||
b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max;
|
||||
|
||||
dest = (char *)bg_data + row*bg_rowbytes;
|
||||
for (i = 0; i < rpng2_info.width; ++i) {
|
||||
even_odd_horiz = (int)((i / bgscale) & 1);
|
||||
even_odd = even_odd_vert ^ even_odd_horiz;
|
||||
invert_column =
|
||||
(even_odd_horiz && (bg[pat].type & 0x10));
|
||||
if (even_odd == 0) { /* gradient #1 */
|
||||
if (invert_column) {
|
||||
*dest++ = r1_inv;
|
||||
*dest++ = g1_inv;
|
||||
*dest++ = b1_inv;
|
||||
} else {
|
||||
*dest++ = r1;
|
||||
*dest++ = g1;
|
||||
*dest++ = b1;
|
||||
}
|
||||
} else { /* gradient #2 */
|
||||
if ((invert_column && invert_gradient2) ||
|
||||
(!invert_column && !invert_gradient2))
|
||||
{
|
||||
*dest++ = r2; /* not inverted or */
|
||||
*dest++ = g2; /* doubly inverted */
|
||||
*dest++ = b2;
|
||||
} else {
|
||||
*dest++ = r2_inv;
|
||||
*dest++ = g2_inv; /* singly inverted */
|
||||
*dest++ = b2_inv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Soft gradient-diamonds with scale = bgscale. Code contributed by Adam
|
||||
M. Costello.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
} else if ((bg[pat].type & 0x07) == 1) {
|
||||
|
||||
hmax = (bgscale-1)/2; /* half the max weight of a color */
|
||||
max = 2*hmax; /* the max weight of a color */
|
||||
|
||||
r1 = rgb[bg[pat].rgb1_max].r;
|
||||
g1 = rgb[bg[pat].rgb1_max].g;
|
||||
b1 = rgb[bg[pat].rgb1_max].b;
|
||||
r2 = rgb[bg[pat].rgb2_max].r;
|
||||
g2 = rgb[bg[pat].rgb2_max].g;
|
||||
b2 = rgb[bg[pat].rgb2_max].b;
|
||||
|
||||
for (row = 0; row < rpng2_info.height; ++row) {
|
||||
yidx = (int)(row % bgscale);
|
||||
if (yidx > hmax)
|
||||
yidx = bgscale-1 - yidx;
|
||||
dest = (char *)bg_data + row*bg_rowbytes;
|
||||
for (i = 0; i < rpng2_info.width; ++i) {
|
||||
xidx = (int)(i % bgscale);
|
||||
if (xidx > hmax)
|
||||
xidx = bgscale-1 - xidx;
|
||||
k = xidx + yidx;
|
||||
*dest++ = (k*r1 + (max-k)*r2) / max;
|
||||
*dest++ = (k*g1 + (max-k)*g2) / max;
|
||||
*dest++ = (k*b1 + (max-k)*b2) / max;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Radial "starburst" with azimuthal sinusoids; [eventually number of sinu-
|
||||
soids will equal bgscale?]. This one is slow but very cool. Code con-
|
||||
tributed by Pieter S. van der Meulen (originally in Smalltalk).
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
} else if ((bg[pat].type & 0x07) == 2) {
|
||||
uch ch;
|
||||
int ii, x, y, hw, hh, grayspot;
|
||||
double freq, rotate, saturate, gray, intensity;
|
||||
double angle=0.0, aoffset=0.0, maxDist, dist;
|
||||
double red=0.0, green=0.0, blue=0.0, hue, s, v, f, p, q, t;
|
||||
|
||||
hh = (int)(rpng2_info.height / 2);
|
||||
hw = (int)(rpng2_info.width / 2);
|
||||
|
||||
/* variables for radial waves:
|
||||
* aoffset: number of degrees to rotate hue [CURRENTLY NOT USED]
|
||||
* freq: number of color beams originating from the center
|
||||
* grayspot: size of the graying center area (anti-alias)
|
||||
* rotate: rotation of the beams as a function of radius
|
||||
* saturate: saturation of beams' shape azimuthally
|
||||
*/
|
||||
angle = CLIP(angle, 0.0, 360.0);
|
||||
grayspot = CLIP(bg[pat].bg_gray, 1, (hh + hw));
|
||||
freq = MAX((double)bg[pat].bg_freq, 0.0);
|
||||
saturate = (double)bg[pat].bg_bsat * 0.1;
|
||||
rotate = (double)bg[pat].bg_brot * 0.1;
|
||||
gray = 0.0;
|
||||
intensity = 0.0;
|
||||
maxDist = (double)((hw*hw) + (hh*hh));
|
||||
|
||||
for (row = 0; row < rpng2_info.height; ++row) {
|
||||
y = (int)(row - hh);
|
||||
dest = (char *)bg_data + row*bg_rowbytes;
|
||||
for (i = 0; i < rpng2_info.width; ++i) {
|
||||
x = (int)(i - hw);
|
||||
angle = (x == 0)? PI_2 : atan((double)y / (double)x);
|
||||
gray = (double)MAX(ABS(y), ABS(x)) / grayspot;
|
||||
gray = MIN(1.0, gray);
|
||||
dist = (double)((x*x) + (y*y)) / maxDist;
|
||||
intensity = cos((angle+(rotate*dist*PI)) * freq) *
|
||||
gray * saturate;
|
||||
intensity = (MAX(MIN(intensity,1.0),-1.0) + 1.0) * 0.5;
|
||||
hue = (angle + PI) * INV_PI_360 + aoffset;
|
||||
s = gray * ((double)(ABS(x)+ABS(y)) / (double)(hw + hh));
|
||||
s = MIN(MAX(s,0.0), 1.0);
|
||||
v = MIN(MAX(intensity,0.0), 1.0);
|
||||
|
||||
if (s == 0.0) {
|
||||
ch = (uch)(v * 255.0);
|
||||
*dest++ = ch;
|
||||
*dest++ = ch;
|
||||
*dest++ = ch;
|
||||
} else {
|
||||
if ((hue < 0.0) || (hue >= 360.0))
|
||||
hue -= (((int)(hue / 360.0)) * 360.0);
|
||||
hue /= 60.0;
|
||||
ii = (int)hue;
|
||||
f = hue - (double)ii;
|
||||
p = (1.0 - s) * v;
|
||||
q = (1.0 - (s * f)) * v;
|
||||
t = (1.0 - (s * (1.0 - f))) * v;
|
||||
if (ii == 0) { red = v; green = t; blue = p; }
|
||||
else if (ii == 1) { red = q; green = v; blue = p; }
|
||||
else if (ii == 2) { red = p; green = v; blue = t; }
|
||||
else if (ii == 3) { red = p; green = q; blue = v; }
|
||||
else if (ii == 4) { red = t; green = p; blue = v; }
|
||||
else if (ii == 5) { red = v; green = p; blue = q; }
|
||||
*dest++ = (uch)(red * 255.0);
|
||||
*dest++ = (uch)(green * 255.0);
|
||||
*dest++ = (uch)(blue * 255.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* end function rpng2_x_reload_bg_image() */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static int is_number(char *p)
|
||||
{
|
||||
while (*p) {
|
||||
if (!isdigit(*p))
|
||||
return FALSE;
|
||||
++p;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* FEATURE_LOOP */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void rpng2_x_cleanup(void)
|
||||
{
|
||||
if (bg_image && bg_data) {
|
||||
|
@ -5,8 +5,10 @@
|
||||
This program converts certain NetPBM binary files (grayscale and RGB,
|
||||
maxval = 255) to PNG. Non-interlaced PNGs are written progressively;
|
||||
interlaced PNGs are read and written in one memory-intensive blast.
|
||||
|
||||
Thanks to Jean-loup Gailly for providing the necessary trick to read
|
||||
interactive text from the keyboard while stdin is redirected.
|
||||
interactive text from the keyboard while stdin is redirected. Thanks
|
||||
to Cosmin Truta for Cygwin fixes.
|
||||
|
||||
NOTE: includes provisional support for PNM type "8" (portable alphamap)
|
||||
images, presumed to be a 32-bit interleaved RGBA format; no pro-
|
||||
@ -24,16 +26,32 @@
|
||||
- 1.02: modified to allow abbreviated options
|
||||
- 1.03: removed extraneous character from usage screen; fixed bug in
|
||||
command-line parsing
|
||||
- 1.04: fixed DOS/OS2/Win32 detection, including partial Cygwin fix
|
||||
(see http://home.att.net/~perlspinr/diffs/GregBook_cygwin.diff)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
|
||||
[REPORTED BUG (win32 only): "contrib/gregbook/wpng.c - cmd line
|
||||
dose not work! In order to do something useful I needed to redirect
|
||||
both input and output, with cygwin and with bcc32 as well. Under
|
||||
Linux, the same wpng appears to work fine. I don't know what is
|
||||
the problem."]
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -50,16 +68,35 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "wpng"
|
||||
#define VERSION "1.03 of 19 March 2000"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
#define APPNAME "Simple PGM/PPM/PAM to PNG Converter"
|
||||
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
# define DOS_OS2_W32
|
||||
#elif defined(_WIN32) || defined(__WIN32__)
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
# ifndef __GNUC__ /* treat Win32 native ports of gcc as Unix environments */
|
||||
# define DOS_OS2_W32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
|
@ -1,6 +1,6 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.2.19beta15 - June 17, 2007
|
||||
libpng version 1.2.19beta16 - June 19, 2007
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
@ -2921,13 +2921,13 @@ application:
|
||||
|
||||
IX. Y2K Compliance in libpng
|
||||
|
||||
June 17, 2007
|
||||
June 19, 2007
|
||||
|
||||
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.19beta15 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.2.19beta16 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
|
18
libpng.3
18
libpng.3
@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "June 17, 2007"
|
||||
.TH LIBPNG 3 "June 19, 2007"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta15
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta16
|
||||
.SH SYNOPSIS
|
||||
\fB
|
||||
#include <png.h>\fP
|
||||
@ -410,7 +410,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.19beta15 - June 17, 2007
|
||||
libpng version 1.2.19beta16 - June 19, 2007
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
@ -3331,13 +3331,13 @@ application:
|
||||
|
||||
.SH IX. Y2K Compliance in libpng
|
||||
|
||||
June 17, 2007
|
||||
June 19, 2007
|
||||
|
||||
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.19beta15 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.2.19beta16 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
|
||||
@ -3526,7 +3526,7 @@ the first widely used release:
|
||||
1.2.17 13 10217 12.so.0.17[.0]
|
||||
1.0.26 10 10026 10.so.0.26[.0]
|
||||
1.2.18 13 10218 12.so.0.18[.0]
|
||||
1.2.19beta1-15 13 10219 12.so.0.19[.0]
|
||||
1.2.19beta1-16 13 10219 12.so.0.19[.0]
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@ -3582,7 +3582,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.2.19beta15 - June 17, 2007:
|
||||
Libpng version 1.2.19beta16 - June 19, 2007:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||
|
||||
@ -3603,7 +3603,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.19beta15, June 17, 2007, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.2.19beta16, June 19, 2007, are
|
||||
Copyright (c) 2004,2006-2007 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
|
||||
@ -3702,7 +3702,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
June 17, 2007
|
||||
June 19, 2007
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "June 17, 2007"
|
||||
.TH LIBPNGPF 3 "June 19, 2007"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta15
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta16
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "June 17, 2007"
|
||||
.TH PNG 5 "June 19, 2007"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
6
png.c
6
png.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -13,7 +13,7 @@
|
||||
#include "png.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_2_19beta15 Your_png_h_is_not_version_1_2_19beta15;
|
||||
typedef version_1_2_19beta16 Your_png_h_is_not_version_1_2_19beta16;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h. */
|
||||
@ -706,7 +706,7 @@ png_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
|
||||
return ((png_charp) "\n libpng version 1.2.19beta15 - June 17, 2007\n\
|
||||
return ((png_charp) "\n libpng version 1.2.19beta16 - June 19, 2007\n\
|
||||
Copyright (c) 1998-2007 Glenn Randers-Pehrson\n\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||
|
20
png.h
20
png.h
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.2.19beta15 - June 17, 2007
|
||||
* libpng version 1.2.19beta16 - June 19, 2007
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
@ -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.2.19beta15 - June 17, 2007: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.2.19beta16 - June 19, 2007: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@ -150,7 +150,7 @@
|
||||
* 1.2.17 13 10217 12.so.0.17[.0]
|
||||
* 1.0.26 10 10026 10.so.0.26[.0]
|
||||
* 1.2.18 13 10218 12.so.0.18[.0]
|
||||
* 1.2.19beta1-15 13 10219 12.so.0.19[.0]
|
||||
* 1.2.19beta1-16 13 10219 12.so.0.19[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@ -180,7 +180,7 @@
|
||||
* If you modify libpng you may insert additional notices immediately following
|
||||
* this sentence.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.2.19beta15, June 17, 2007, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.2.19beta16, June 19, 2007, are
|
||||
* Copyright (c) 2004, 2006-2007 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:
|
||||
@ -292,13 +292,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* June 17, 2007
|
||||
* June 19, 2007
|
||||
*
|
||||
* 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.19beta15 are Y2K compliant. It is my belief that earlier
|
||||
* upward through 1.2.19beta16 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
|
||||
@ -354,9 +354,9 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.2.19beta15"
|
||||
#define PNG_LIBPNG_VER_STRING "1.2.19beta16"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.2.19beta15 - June 17, 2007 (header)\n"
|
||||
" libpng version 1.2.19beta16 - June 19, 2007 (header)\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 0
|
||||
#define PNG_LIBPNG_VER_DLLNUM 13
|
||||
@ -368,7 +368,7 @@
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 15
|
||||
#define PNG_LIBPNG_VER_BUILD 16
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
@ -1407,7 +1407,7 @@ struct png_struct_def
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef png_structp version_1_2_19beta15;
|
||||
typedef png_structp version_1_2_19beta16;
|
||||
|
||||
typedef png_struct FAR * FAR * png_structpp;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.2.19beta15 - June 17, 2007
|
||||
* libpng version 1.2.19beta16 - June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
259
pnggccrd.c
259
pnggccrd.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* For Intel x86 CPU (Pentium-MMX or later) and GNU C compiler.
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998 Intel Corporation
|
||||
* Copyright (c) 1999-2002,2007 Greg Roelofs
|
||||
@ -327,11 +327,14 @@
|
||||
* 20070616:
|
||||
* - finished replacing direct _FullLength accesses with register constraints
|
||||
* (*ugly* conditional clobber-separator macros for avg and paeth, sigh)
|
||||
* Changed all "ifdef *" to "if defined(*)"
|
||||
*
|
||||
*
|
||||
* [TODO: reevaluate PNG_THREAD_UNSAFE_OK blocks for non-const global-var use]
|
||||
*
|
||||
* STILL TO DO:
|
||||
* - fix final thread-unsafe code using stack vars and pointer? (paeth top,
|
||||
* default, bottom only; default, bottom already 5 reg constraints; could
|
||||
* replace bpp with pointer and group bpp/patemp/pbtemp/pctemp in array)
|
||||
* - fix ebp/no-reg-constraint inefficiency (avg/paeth/sub top)
|
||||
* - test png_do_read_interlace() 64-bit case (pixel_bytes == 8)
|
||||
* - write MMX code for 48-bit case (pixel_bytes == 6)
|
||||
* - figure out what's up with 24-bit case (pixel_bytes == 3):
|
||||
@ -354,14 +357,14 @@
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGGCCRD)
|
||||
|
||||
#if defined(__x86_64__) && defined(__PIC__)
|
||||
# define PNG_x86_64_USE_GOTPCREL
|
||||
#if defined(__x86_64__) && defined(__PIC__) // optionally comment out __PIC__:
|
||||
# define PNG_x86_64_USE_GOTPCREL // GOTPCREL => full thread-safety
|
||||
# define PNG_CLOBBER_x86_64_REGS_SUPPORTED // works as of gcc 3.4.3 ...
|
||||
#endif
|
||||
|
||||
int PNGAPI png_mmx_support(void);
|
||||
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
#if defined(PNG_USE_LOCAL_ARRAYS)
|
||||
static PNG_CONST int FARDATA png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static PNG_CONST int FARDATA png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static PNG_CONST int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
@ -400,7 +403,7 @@ static PNG_CONST int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
# define _amask0_2_6 amask0_2_6
|
||||
# define _amask2_3_3 amask2_3_3
|
||||
# define _amask4_2_2 amask4_2_2
|
||||
# ifdef PNG_THREAD_UNSAFE_OK
|
||||
# if defined(PNG_THREAD_UNSAFE_OK)
|
||||
# define _patemp patemp
|
||||
# define _pbtemp pbtemp
|
||||
# define _pctemp pctemp
|
||||
@ -412,7 +415,7 @@ static PNG_CONST int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
|
||||
typedef unsigned long long ull;
|
||||
|
||||
#ifdef PNG_x86_64_USE_GOTPCREL
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL)
|
||||
static PNG_CONST struct {
|
||||
//ull _mask_array[26];
|
||||
|
||||
@ -579,13 +582,13 @@ static PNG_CONST ull _amask4_2_2 __attribute__((used, aligned(8))) = 0x00000000
|
||||
|
||||
|
||||
#if defined(PNG_HAVE_MMX_READ_FILTER_ROW)
|
||||
#ifdef PNG_THREAD_UNSAFE_OK // used only within thread-unsafe functions (at least for now)
|
||||
|
||||
#ifdef PNG_x86_64_USE_GOTPCREL
|
||||
// this block is specific to png_read_filter_row_mmx_paeth()
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL)
|
||||
# define pa_TEMP "%%r11d"
|
||||
# define pb_TEMP "%%r12d"
|
||||
# define pc_TEMP "%%r13d"
|
||||
# ifdef PNG_CLOBBER_x86_64_REGS_SUPPORTED // works as of gcc 3.4.3 ...
|
||||
# if defined(PNG_CLOBBER_x86_64_REGS_SUPPORTED) // works as of gcc 3.4.3 ...
|
||||
# define SAVE_r11_r12_r13
|
||||
# define RESTORE_r11_r12_r13
|
||||
# define _CLOBBER_r11_r12_r13 ,"%r11", "%r12", "%r13"
|
||||
@ -604,6 +607,7 @@ static PNG_CONST ull _amask4_2_2 __attribute__((used, aligned(8))) = 0x00000000
|
||||
"movq _c64@GOTPCREL(%%rip), %%rbp \n\t"
|
||||
# define RESTORE_rbp "popq %%rbp \n\t"
|
||||
#else // 32-bit and/or non-PIC
|
||||
# if defined(PNG_THREAD_UNSAFE_OK)
|
||||
// These variables are used in png_read_filter_row_mmx_paeth() and would be
|
||||
// local variables if not for gcc-inline-assembly addressing limitations
|
||||
// (some apparently related to ELF format, others to CPU type).
|
||||
@ -619,18 +623,19 @@ static PNG_CONST ull _amask4_2_2 __attribute__((used, aligned(8))) = 0x00000000
|
||||
# define RESTORE_r11_r12_r13
|
||||
# define _CLOBBER_r11_r12_r13 // not using regs => not clobbering
|
||||
# define CLOBBER_r11_r12_r13
|
||||
# endif // PNG_THREAD_UNSAFE_OK
|
||||
# define LOAD_GOT_rbp
|
||||
# define RESTORE_rbp
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
#if defined(__x86_64__)
|
||||
# define SAVE_ebp
|
||||
# define RESTORE_ebp
|
||||
# define _CLOBBER_ebp ,"%ebp"
|
||||
# define CLOBBER_ebp "%ebp"
|
||||
# define SAVE_FullLength "movl %%eax, %%r15d \n\t"
|
||||
# define RESTORE_FullLength "movl %%r15d, " // may go into eax or ecx
|
||||
# ifdef PNG_CLOBBER_x86_64_REGS_SUPPORTED // works as of gcc 3.4.3 ...
|
||||
# if defined(PNG_CLOBBER_x86_64_REGS_SUPPORTED) // works as of gcc 3.4.3 ...
|
||||
# define SAVE_r15
|
||||
# define RESTORE_r15
|
||||
# define _CLOBBER_r15 ,"%r15"
|
||||
@ -690,11 +695,10 @@ static PNG_CONST ull _amask4_2_2 __attribute__((used, aligned(8))) = 0x00000000
|
||||
# define CLOB_COLON_ebx_ebp_r1X : // clobbering ebp OR ebx OR r11_r12_r13
|
||||
#endif
|
||||
|
||||
#endif // PNG_THREAD_UNSAFE_OK
|
||||
#endif // PNG_HAVE_MMX_READ_FILTER_ROW
|
||||
|
||||
#ifdef __PIC__ // macros to save, restore index to Global Offset Table
|
||||
# ifdef __x86_64__
|
||||
#if defined(__PIC__) // macros to save, restore index to Global Offset Table
|
||||
# if defined(__x86_64__)
|
||||
# define SAVE_GOT_ebx "pushq %%rbx \n\t"
|
||||
# define RESTORE_GOT_ebx "popq %%rbx \n\t"
|
||||
# else
|
||||
@ -747,7 +751,7 @@ png_mmx_support(void)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
int result;
|
||||
__asm__ __volatile__ (
|
||||
#ifdef __x86_64__
|
||||
#if defined(__x86_64__)
|
||||
"pushq %%rbx \n\t" // rbx gets clobbered by CPUID instruction
|
||||
"pushq %%rcx \n\t" // so does rcx...
|
||||
"pushq %%rdx \n\t" // ...and rdx (but rcx & rdx safe on Linux)
|
||||
@ -799,7 +803,7 @@ png_mmx_support(void)
|
||||
"0: \n\t" // .NOT_SUPPORTED: target label for jump instructions
|
||||
"movl $0, %%eax \n\t" // set return value to 0
|
||||
"1: \n\t" // .RETURN: target label for jump instructions
|
||||
#ifdef __x86_64__
|
||||
#if defined(__x86_64__)
|
||||
"popq %%rdx \n\t" // restore rdx
|
||||
"popq %%rcx \n\t" // restore rcx
|
||||
"popq %%rbx \n\t" // restore rbx
|
||||
@ -889,7 +893,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
@ -1017,7 +1021,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
"2" (len), // ecx
|
||||
"1" (mask) // edx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -1234,7 +1238,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
@ -1326,7 +1330,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
"2" (len), // ecx
|
||||
"1" (mask) // edx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm4", "%mm6", "%mm7" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -1377,7 +1381,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
@ -1483,7 +1487,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
"3" (srcptr), // esi
|
||||
"4" (dstptr) // edi
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm4" // clobber list
|
||||
, "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -1534,7 +1538,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
@ -1655,7 +1659,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
"2" (len), // ecx
|
||||
"1" (mask) // edx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -1706,7 +1710,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
@ -1851,7 +1855,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
"2" (len), // ecx
|
||||
"1" (mask) // edx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -2241,13 +2245,13 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
: "1" (sptr), // esi // input regs
|
||||
"2" (dp), // edi
|
||||
"0" (width), // ecx
|
||||
#ifdef PNG_x86_64_USE_GOTPCREL // formerly _const4:
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL) // formerly _const4:
|
||||
"3" (&_c64._amask5_3_0) // (0x0000000000FFFFFFLL)
|
||||
#else
|
||||
"3" (&_amask5_3_0) // (0x0000000000FFFFFFLL)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2" // clobber list
|
||||
, "%mm3", "%mm4"
|
||||
#endif
|
||||
@ -2291,13 +2295,13 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
: "1" (sptr), // esi // input regs
|
||||
"2" (dp), // edi
|
||||
"0" (width), // ecx
|
||||
#ifdef PNG_x86_64_USE_GOTPCREL // formerly _const4:
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL) // formerly _const4:
|
||||
"3" (&_c64._amask5_3_0) // (0x0000000000FFFFFFLL)
|
||||
#else
|
||||
"3" (&_amask5_3_0) // (0x0000000000FFFFFFLL)
|
||||
#endif
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2354,7 +2358,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
: "1" (sptr), // esi // input regs
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx), // ecx
|
||||
#ifdef PNG_x86_64_USE_GOTPCREL // formerly _const4 and _const6:
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL) // formerly _const4 and _const6:
|
||||
"3" (&_c64._amask5_3_0), // (0x0000000000FFFFFFLL)
|
||||
"4" (&_c64._amask7_1_0) // (0x00000000000000FFLL)
|
||||
#else
|
||||
@ -2362,7 +2366,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"4" (&_amask7_1_0) // (0x00000000000000FFLL)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
, "%mm2", "%mm3"
|
||||
#endif
|
||||
@ -2435,7 +2439,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2" // clobber list
|
||||
, "%mm3", "%mm4"
|
||||
#endif
|
||||
@ -2509,7 +2513,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2563,7 +2567,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2625,7 +2629,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2682,7 +2686,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2735,7 +2739,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2802,7 +2806,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2860,7 +2864,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2916,7 +2920,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width_mmx) // ecx
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -2979,7 +2983,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -3018,7 +3022,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width) // ecx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -3054,7 +3058,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
"2" (dp), // edi
|
||||
"0" (width) // ecx
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0" // clobber list
|
||||
#endif
|
||||
);
|
||||
@ -3156,7 +3160,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
png_memcpy(v, sptr, 4);
|
||||
for (j = 0; j < png_pass_inc[pass]; j++)
|
||||
{
|
||||
#ifdef PNG_DEBUG
|
||||
#if defined(PNG_DEBUG)
|
||||
if (dp < row || dp+3 > row+png_ptr->row_buf_size)
|
||||
{
|
||||
printf("dp out of bounds: row=%d, dp=%d, rp=%d\n",
|
||||
@ -3236,7 +3240,6 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
#if defined(PNG_HAVE_MMX_READ_FILTER_ROW)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
//===========================================================================//
|
||||
// //
|
||||
// P N G _ R E A D _ F I L T E R _ R O W _ M M X _ A V G //
|
||||
@ -3261,7 +3264,6 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
bpp = (row_info->pixel_depth + 7) >> 3; // calc number of bytes per pixel
|
||||
FullLength = row_info->rowbytes; // number of bytes to filter
|
||||
|
||||
//printf("GRR DEBUG: avgtop start\n"); fflush(stdout);
|
||||
__asm__ __volatile__ (
|
||||
SAVE_GOT_ebx
|
||||
SAVE_r15
|
||||
@ -3322,7 +3324,7 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"subl %%eax, %%ecx \n\t" // drop over bytes from original length
|
||||
//out "movl %%ecx, MMXLength \n\t"
|
||||
"movl %%ebp, %%edi \n\t" // ebp = diff, but no reg constraint(?)
|
||||
RESTORE_ebp
|
||||
RESTORE_ebp // (could swap ebp and ecx functions)
|
||||
RESTORE_r15
|
||||
RESTORE_GOT_ebx
|
||||
|
||||
@ -3341,14 +3343,12 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
_CLOBBER_ebp
|
||||
_CLOBBER_GOT_ebx
|
||||
);
|
||||
//printf("GRR DEBUG: avgtop end\n"); fflush(stdout);
|
||||
|
||||
// now do the math for the rest of the row
|
||||
switch (bpp)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
//printf("GRR DEBUG: avg3 start\n"); fflush(stdout);
|
||||
// _ShiftBpp = 24; // == 3 * 8
|
||||
// _ShiftRem = 40; // == 64 - 24
|
||||
|
||||
@ -3454,12 +3454,11 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
);
|
||||
//printf("GRR DEBUG: avg3 end\n"); fflush(stdout);
|
||||
}
|
||||
break; // end 3 bpp
|
||||
|
||||
@ -3552,7 +3551,7 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -3648,7 +3647,7 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -3787,7 +3786,7 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -3903,7 +3902,7 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2" // clobber list
|
||||
, "%mm3", "%mm4", "%mm5"
|
||||
#endif
|
||||
@ -3913,7 +3912,7 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
|
||||
default: // bpp != 1,2,3,4,6,8: doesn't exist
|
||||
{
|
||||
#ifdef PNG_DEBUG
|
||||
#if defined(PNG_DEBUG)
|
||||
// ERROR: SHOULD NEVER BE REACHED
|
||||
png_debug(1,
|
||||
"Internal libpng logic error (GCC png_read_filter_row_mmx_avg())\n");
|
||||
@ -3923,7 +3922,6 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
|
||||
} // end switch (bpp)
|
||||
|
||||
//printf("GRR DEBUG: avgbot start\n"); fflush(stdout);
|
||||
__asm__ __volatile__ (
|
||||
// MMX acceleration complete; now do clean-up
|
||||
// check if any remaining bytes left to decode
|
||||
@ -3980,14 +3978,13 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
CLOB_COMMA_ebx_ebp
|
||||
CLOBBER_ebp
|
||||
);
|
||||
//printf("GRR DEBUG: avgbot end\n"); fflush(stdout);
|
||||
|
||||
} /* end png_read_filter_row_mmx_avg() */
|
||||
#endif // PNG_THREAD_UNSAFE_OK
|
||||
|
||||
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL) || defined(PNG_THREAD_UNSAFE_OK)
|
||||
|
||||
//===========================================================================//
|
||||
// //
|
||||
// P N G _ R E A D _ F I L T E R _ R O W _ M M X _ P A E T H //
|
||||
@ -4012,7 +4009,6 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
bpp = (row_info->pixel_depth + 7) >> 3; // calc number of bytes per pixel
|
||||
FullLength = row_info->rowbytes; // number of bytes to filter
|
||||
|
||||
//printf("GRR DEBUG: paethtop start\n"); fflush(stdout);
|
||||
__asm__ __volatile__ (
|
||||
SAVE_GOT_ebx
|
||||
SAVE_r15
|
||||
@ -4131,7 +4127,7 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"subl %%eax, %%ecx \n\t" // drop over bytes from original length
|
||||
//out "movl %%ecx, MMXLength \n\t"
|
||||
"movl %%ebp, %%edi \n\t" // ebp = diff, but no reg constraint(?)
|
||||
RESTORE_ebp
|
||||
RESTORE_ebp // (could swap ebp and ecx functions)
|
||||
RESTORE_r15
|
||||
RESTORE_GOT_ebx
|
||||
|
||||
@ -4151,14 +4147,12 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
_CLOBBER_ebp
|
||||
_CLOBBER_GOT_ebx
|
||||
);
|
||||
//printf("GRR DEBUG: paethtop end\n"); fflush(stdout);
|
||||
|
||||
// now do the math for the rest of the row
|
||||
switch (bpp)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
//printf("GRR DEBUG: paeth3 start\n"); fflush(stdout);
|
||||
// _ShiftBpp = 24; // == bpp * 8
|
||||
// _ShiftRem = 40; // == 64 - _ShiftBpp
|
||||
|
||||
@ -4373,12 +4367,11 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
);
|
||||
//printf("GRR DEBUG: paeth3 end\n"); fflush(stdout);
|
||||
}
|
||||
break; // end 3 bpp
|
||||
|
||||
@ -4538,7 +4531,7 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -4687,7 +4680,7 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -4836,7 +4829,7 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"2" (diff), // ecx
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
: "%mm0", "%mm1", "%mm2", "%mm3" // clobber list
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -4966,7 +4959,6 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
|
||||
} // end switch (bpp)
|
||||
|
||||
//printf("GRR DEBUG: paethend start\n"); fflush(stdout);
|
||||
__asm__ __volatile__ (
|
||||
// MMX acceleration complete; now do clean-up
|
||||
// check if any remaining bytes left to decode
|
||||
@ -5085,15 +5077,14 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
CLOB_COMMA_ebX_r1X
|
||||
CLOBBER_r11_r12_r13
|
||||
);
|
||||
//printf("GRR DEBUG: paethend end\n"); fflush(stdout);
|
||||
|
||||
} /* end png_read_filter_row_mmx_paeth() */
|
||||
#endif // PNG_THREAD_UNSAFE_OK
|
||||
|
||||
#endif // PNG_x86_64_USE_GOTPCREL || PNG_THREAD_UNSAFE_OK
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
//===========================================================================//
|
||||
// //
|
||||
// P N G _ R E A D _ F I L T E R _ R O W _ M M X _ S U B //
|
||||
@ -5117,7 +5108,6 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
FullLength = row_info->rowbytes - bpp; // number of bytes to filter
|
||||
// (why do we subtract off bpp? not so in avg or paeth...)
|
||||
|
||||
//printf("GRR DEBUG: subtop start\n"); fflush(stdout);
|
||||
__asm__ __volatile__ (
|
||||
SAVE_r15
|
||||
SAVE_ebp
|
||||
@ -5166,14 +5156,12 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
_CLOBBER_r15
|
||||
_CLOBBER_ebp
|
||||
);
|
||||
//printf("GRR DEBUG: subtop end\n"); fflush(stdout);
|
||||
|
||||
// now do the math for the rest of the row
|
||||
switch (bpp)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
//printf("GRR DEBUG: sub3 start\n"); fflush(stdout);
|
||||
// _ShiftBpp = 24; // == 3 * 8
|
||||
// _ShiftRem = 40; // == 64 - 24
|
||||
|
||||
@ -5230,11 +5218,10 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
: "%esi" // clobber list
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
, "%mm0", "%mm1", "%mm6", "%mm7"
|
||||
#endif
|
||||
);
|
||||
//printf("GRR DEBUG: sub3 end\n"); fflush(stdout);
|
||||
}
|
||||
break; // end 3 bpp
|
||||
|
||||
@ -5282,7 +5269,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
: "%esi" // clobber list
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
, "%mm0", "%mm1"
|
||||
#endif
|
||||
);
|
||||
@ -5332,7 +5319,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
: "%esi" // clobber list
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
, "%mm0", "%mm1"
|
||||
#endif
|
||||
);
|
||||
@ -5441,7 +5428,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
"3" (MMXLength) // eax
|
||||
|
||||
: "%esi" // clobber list
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
, "%mm0", "%mm1", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
);
|
||||
@ -5526,7 +5513,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
|
||||
: "%esi" // clobber list
|
||||
_CLOBBER_ebp
|
||||
#ifdef CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(CLOBBER_MMX_REGS_SUPPORTED)
|
||||
, "%mm0", "%mm1", "%mm2", "%mm3"
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -5536,7 +5523,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
|
||||
default: // bpp != 1,2,3,4,6,8: doesn't exist
|
||||
{
|
||||
#ifdef PNG_DEBUG
|
||||
#if defined(PNG_DEBUG)
|
||||
// ERROR: SHOULD NEVER BE REACHED
|
||||
png_debug(1,
|
||||
"Internal libpng logic error (GCC png_read_filter_row_mmx_sub())\n");
|
||||
@ -5546,7 +5533,6 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
|
||||
} // end switch (bpp)
|
||||
|
||||
//printf("GRR DEBUG: subend start\n"); fflush(stdout);
|
||||
__asm__ __volatile__ (
|
||||
//pre "movl MMXLength, %%eax \n\t"
|
||||
//pre "movl row, %%edi \n\t"
|
||||
@ -5581,10 +5567,8 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
|
||||
: "%esi" // clobber list
|
||||
);
|
||||
//printf("GRR DEBUG: subend end\n"); fflush(stdout);
|
||||
|
||||
} // end of png_read_filter_row_mmx_sub()
|
||||
#endif // PNG_THREAD_UNSAFE_OK
|
||||
|
||||
|
||||
|
||||
@ -5724,7 +5708,7 @@ png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row,
|
||||
: "%eax", "%ecx" // clobber list (no input regs!)
|
||||
_CLOBBER_GOT_ebx
|
||||
|
||||
#ifdef PNG_CLOBBER_MMX_REGS_SUPPORTED
|
||||
#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
|
||||
, "%mm0", "%mm1", "%mm2", "%mm3"
|
||||
, "%mm4", "%mm5", "%mm6", "%mm7"
|
||||
#endif
|
||||
@ -5750,17 +5734,11 @@ void /* PRIVATE */
|
||||
png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
row, png_bytep prev_row, int filter)
|
||||
{
|
||||
#ifdef PNG_DEBUG
|
||||
#if defined(PNG_DEBUG)
|
||||
char filnm[10];
|
||||
#endif
|
||||
|
||||
#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
|
||||
#define UseMMX_avg 1 // GRR: converted 20000828 (+ 16-bit bugfix 20000916)
|
||||
#define UseMMX_paeth 1 // GRR: converted 20000828
|
||||
|
||||
if (_mmx_supported == 2) {
|
||||
#if !defined(PNG_1_0_X)
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
@ -5770,48 +5748,79 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
}
|
||||
#endif /* PNG_MMX_CODE_SUPPORTED */
|
||||
|
||||
#ifdef PNG_DEBUG
|
||||
#if defined(PNG_DEBUG)
|
||||
png_debug(1, "in png_read_filter_row (pnggccrd.c)\n");
|
||||
switch (filter)
|
||||
{
|
||||
case 0: png_snprintf(filnm, 10, "none");
|
||||
case 0:
|
||||
png_snprintf(filnm, 10, "none");
|
||||
break;
|
||||
case 1: png_snprintf(filnm, 10, "sub-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
|
||||
case 1:
|
||||
png_snprintf(filnm, 10, "sub-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" :
|
||||
#endif
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
case 2: png_snprintf(filnm, 10, "up-%s",
|
||||
#ifdef PNG_MMX_CODE_SUPPORTED
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" :
|
||||
((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
|
||||
_mmx_supported
|
||||
#endif
|
||||
? "MMX" :
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
case 3: png_snprintf(filnm, 10, "avg-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
|
||||
case 2:
|
||||
png_snprintf(filnm, 10, "up-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" :
|
||||
((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
|
||||
_mmx_supported
|
||||
#endif
|
||||
? "MMX" :
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
case 4: png_snprintf(filnm, 10, "Paeth-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
|
||||
case 3:
|
||||
png_snprintf(filnm, 10, "avg-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":
|
||||
((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
|
||||
_mmx_supported
|
||||
#endif
|
||||
? "MMX" :
|
||||
#endif
|
||||
"x86");
|
||||
"x86");
|
||||
break;
|
||||
default: png_snprintf(filnm, 10, "unknw");
|
||||
|
||||
case 4:
|
||||
png_snprintf(filnm, 10, "Paeth-%s",
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X)
|
||||
((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
|
||||
_mmx_supported
|
||||
#endif
|
||||
? "MMX" :
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
|
||||
default:
|
||||
png_snprintf(filnm, 10, "unknown");
|
||||
break;
|
||||
}
|
||||
png_debug2(0, "row_number=%5ld, %5s, ", png_ptr->row_number, filnm);
|
||||
png_debug2(0, "row_number=%5ld, %10s, ", png_ptr->row_number, filnm);
|
||||
png_debug1(0, "row=0x%08lx, ", (unsigned long)row);
|
||||
png_debug2(0, "pixdepth=%2d, bytes=%d, ", (int)row_info->pixel_depth,
|
||||
(int)((row_info->pixel_depth + 7) >> 3));
|
||||
@ -5824,7 +5833,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
break;
|
||||
|
||||
case PNG_FILTER_VALUE_SUB:
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#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) &&
|
||||
@ -5881,7 +5890,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
break;
|
||||
|
||||
case PNG_FILTER_VALUE_AVG:
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#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) &&
|
||||
@ -5919,7 +5928,8 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
break;
|
||||
|
||||
case PNG_FILTER_VALUE_PAETH:
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if defined(PNG_MMX_CODE_SUPPORTED)
|
||||
#if defined(PNG_x86_64_USE_GOTPCREL) || defined(PNG_THREAD_UNSAFE_OK)
|
||||
#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) &&
|
||||
@ -5931,6 +5941,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
||||
}
|
||||
else
|
||||
#endif /* PNG_x86_64_USE_GOTPCREL || PNG_THREAD_UNSAFE_OK */
|
||||
#endif /* PNG_MMX_CODE_SUPPORTED */
|
||||
{
|
||||
png_uint_32 i;
|
||||
@ -5958,7 +5969,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
p = b - c;
|
||||
pc = a - c;
|
||||
|
||||
#ifdef PNG_USE_ABS
|
||||
#if defined(PNG_USE_ABS)
|
||||
pa = abs(p);
|
||||
pb = abs(pc);
|
||||
pc = abs(p + pc);
|
||||
@ -5995,4 +6006,4 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
#endif /* PNG_HAVE_MMX_READ_FILTER_ROW */
|
||||
|
||||
|
||||
#endif /* PNG_USE_PNGGCCRD */
|
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGGCCRD */
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1553,4 +1553,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_19beta15 your_png_h_is_not_version_1_2_19beta15;
|
||||
typedef version_1_2_19beta16 your_png_h_is_not_version_1_2_19beta16;
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998, Intel Corporation
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.19 June 17, 2007
|
||||
* Last changed in libpng 1.2.19 June 19, 2007
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -179,7 +179,7 @@ configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||
|
||||
# SET UP LINKS
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 0.${PNGLIB_RELEASE}.1.2.19beta15
|
||||
# VERSION 0.${PNGLIB_RELEASE}.1.2.19beta16
|
||||
VERSION 0.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 0
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.2.19beta15
|
||||
version=1.2.19beta16
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
@ -5,6 +5,6 @@ includedir=@includedir@/libpng12
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.2.19beta15
|
||||
Version: 1.2.19beta16
|
||||
Libs: -L${libdir} -lpng12
|
||||
Cflags: -I${includedir} @LIBPNG_NO_MMX@
|
||||
|
@ -5,6 +5,6 @@ includedir=@includedir@/libpng12
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.2.19beta15
|
||||
Version: 1.2.19beta16
|
||||
Libs: -L${libdir} -lpng12
|
||||
Cflags: -I${includedir}
|
||||
|
@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -20,7 +20,7 @@ LN_SF = ln -f -s
|
||||
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
prefix=/usr/local
|
||||
|
@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -80,7 +80,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
CYGDLL = 12
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=cygpng$(CYGDLL).dll
|
||||
|
@ -19,7 +19,7 @@ ZLIBINC=../zlib
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
# Library name:
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng12
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -16,7 +16,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -6,7 +6,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -81,7 +81,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
MINGDLL = 12
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=libpng$(MINGDLL).dll
|
||||
|
@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng12
|
||||
|
||||
LIB= png12
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.2.19beta15
|
||||
SHLIB_MINOR= 1.2.19beta16
|
||||
SRCS= pnggccrd.c 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
|
||||
|
@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 3
|
||||
SHLIB_MINOR= 1.2.19beta15
|
||||
SHLIB_MINOR= 1.2.19beta16
|
||||
SRCS= pnggccrd.c 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
|
||||
|
@ -7,7 +7,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -8,7 +8,7 @@ LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.2.19beta15
|
||||
SHLIB_MINOR= 1.2.19beta16
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
||||
|
@ -9,7 +9,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -6,7 +6,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -6,7 +6,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# Library name:
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng12
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.19beta15
|
||||
PNGMIN = 1.2.19beta16
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -2,7 +2,7 @@
|
||||
; PNG.LIB module definition file for OS/2
|
||||
;----------------------------------------
|
||||
|
||||
; Version 1.2.19beta15
|
||||
; Version 1.2.19beta16
|
||||
|
||||
LIBRARY PNG
|
||||
DESCRIPTION "PNG image compression library for OS/2"
|
||||
|
@ -5,7 +5,7 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
;Version 1.2.19beta15
|
||||
;Version 1.2.19beta16
|
||||
png_build_grayscale_palette @1
|
||||
png_check_sig @2
|
||||
png_chunk_error @3
|
||||
|
Reference in New Issue
Block a user