Imported from libpng-1.0.9beta2.tar
This commit is contained in:
parent
fbbb5ecb52
commit
f5ed0e130c
25
ANNOUNCE
25
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.0.9beta10 - January 16, 2001
|
Libpng 1.0.9beta2 - November 19, 2000
|
||||||
|
|
||||||
This is a public release of libpng, intended for use in production codes.
|
This is a public release of libpng, intended for use in production codes.
|
||||||
|
|
||||||
@ -28,29 +28,6 @@ Changes since the last public release (1.0.8):
|
|||||||
subdirectory and added projects/borland project subdirectory.
|
subdirectory and added projects/borland project subdirectory.
|
||||||
Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate.
|
Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate.
|
||||||
Add error message in png_set_compression_buffer_size() when malloc fails.
|
Add error message in png_set_compression_buffer_size() when malloc fails.
|
||||||
Revised PNG_LIBPNG_BUILD_TYPE macro in png.h, used in the msvc project.
|
|
||||||
Removed the png_flush() in pngwrite.c that crashes some applications
|
|
||||||
that don't set png_output_flush_fn.
|
|
||||||
Added makefile.macosx and makefile.aix to scripts directory.
|
|
||||||
Change png_chunk_warning to png_warning in png_check_keyword().
|
|
||||||
Increased the first part of msg buffer from 16 to 18 in png_chunk_error().
|
|
||||||
Added support for filter method 64 (for PNG datastreams embedded in MNG)
|
|
||||||
Revised png_set_filter() to accept filter method 64 when appropriate.
|
|
||||||
Added new PNG_HAVE_PNG_SIGNATURE bit to png_ptr->mode and use it to
|
|
||||||
help prevent applications from using MNG features in PNG datastreams.
|
|
||||||
Revised libpng.3/libpng.txt. Changed "filter type" to "filter method".
|
|
||||||
Fixed error handling of unknown compression type in png_decompress_chunk().
|
|
||||||
In pngconf.h, define __cdecl when _MSC_VER is defined.
|
|
||||||
Changed PNG_TEXT_COMPRESSION_zTXt to PNG_COMPRESSION_TYPE_BASE several places.
|
|
||||||
Revised memory management in png_set_hIST and png_handle_hIST in a backward
|
|
||||||
compatible manner. PLTE and tRNS were revised similarly.
|
|
||||||
Revised the iCCP chunk reader to ignore trailing garbage.
|
|
||||||
Moved pngasmrd.h into pngconf.h.
|
|
||||||
Improved handling of out-of-spec garbage iCCP chunks generated by PhotoShop.
|
|
||||||
Added png_set_invalid, png_permit_mng_features, and png_mmx_supported to
|
|
||||||
wince and msvc project module definition files.
|
|
||||||
Fixed bug with progressive reading of narrow interlaced images in pngpread.c
|
|
||||||
Do not typedef png_FILE_io in pngconf.h when PNG_NO_STDIO is defined.
|
|
||||||
|
|
||||||
Send comments/corrections/commendations to
|
Send comments/corrections/commendations to
|
||||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||||
|
36
CHANGES
36
CHANGES
@ -798,6 +798,7 @@ version 1.0.7rc2 [June 28, 2000]
|
|||||||
Fixed "DJBPP" typo in pnggccrd.c introduced in beta18.
|
Fixed "DJBPP" typo in pnggccrd.c introduced in beta18.
|
||||||
version 1.0.7 [July 1, 2000]
|
version 1.0.7 [July 1, 2000]
|
||||||
Revised the definition of "trans_values" in libpng.3/libpng.txt
|
Revised the definition of "trans_values" in libpng.3/libpng.txt
|
||||||
|
version 1.0.9beta2 [November 19, 2000]
|
||||||
version 1.0.8beta1 [July 8, 2000]
|
version 1.0.8beta1 [July 8, 2000]
|
||||||
Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks.
|
Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks.
|
||||||
Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and
|
Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and
|
||||||
@ -847,41 +848,6 @@ version 1.0.9beta2 [November 19, 2000]
|
|||||||
Added borland project files to "projects" subdirectory.
|
Added borland project files to "projects" subdirectory.
|
||||||
Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate.
|
Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate.
|
||||||
Add error message in png_set_compression_buffer_size() when malloc fails.
|
Add error message in png_set_compression_buffer_size() when malloc fails.
|
||||||
version 1.0.9beta3 [November 23, 2000]
|
|
||||||
Revised PNG_LIBPNG_BUILD_TYPE macro in png.h, used in the msvc project.
|
|
||||||
Removed the png_flush() in pngwrite.c that crashes some applications
|
|
||||||
that don't set png_output_flush_fn.
|
|
||||||
Added makefile.macosx and makefile.aix to scripts directory.
|
|
||||||
version 1.0.9beta4 [December 1, 2000]
|
|
||||||
Change png_chunk_warning to png_warning in png_check_keyword().
|
|
||||||
Increased the first part of msg buffer from 16 to 18 in png_chunk_error().
|
|
||||||
version 1.0.9beta5 [December 15, 2000]
|
|
||||||
Added support for filter method 64 (for PNG datastreams embedded in MNG)
|
|
||||||
version 1.0.9beta6 [December 18, 2000]
|
|
||||||
Revised png_set_filter() to accept filter method 64 when appropriate.
|
|
||||||
Added new PNG_HAVE_PNG_SIGNATURE bit to png_ptr->mode and use it to
|
|
||||||
help prevent applications from using MNG features in PNG datastreams.
|
|
||||||
Revised libpng.3/libpng.txt. Changed "filter type" to "filter method".
|
|
||||||
version 1.0.9rc1 [December 23, 2000]
|
|
||||||
Revised test for PNG_HAVE_PNG_SIGNATURE in pngrutil.c
|
|
||||||
Fixed error handling of unknown compression type in png_decompress_chunk().
|
|
||||||
In pngconf.h, define __cdecl when _MSC_VER is defined.
|
|
||||||
version 1.0.9beta7 [December 28, 2000]
|
|
||||||
Changed PNG_TEXT_COMPRESSION_zTXt to PNG_COMPRESSION_TYPE_BASE several places.
|
|
||||||
Revised memory management in png_set_hIST and png_handle_hIST in a backward
|
|
||||||
compatible manner. PLTE and tRNS were revised similarly.
|
|
||||||
Revised the iCCP chunk reader to ignore trailing garbage.
|
|
||||||
version 1.0.9beta8 [January 12, 2001]
|
|
||||||
Moved pngasmrd.h into pngconf.h.
|
|
||||||
Improved handling of out-of-spec garbage iCCP chunks generated by PhotoShop.
|
|
||||||
version 1.0.9beta9 [January 15, 2001]
|
|
||||||
Added png_set_invalid, png_permit_mng_features, and png_mmx_supported to
|
|
||||||
wince and msvc project module definition files.
|
|
||||||
Minor revision of makefile.cygwin.
|
|
||||||
Fixed bug with progressive reading of narrow interlaced images in pngpread.c
|
|
||||||
version 1.0.9beta10 [January 16, 2001]
|
|
||||||
Do not typedef png_FILE_io in pngconf.h when PNG_NO_STDIO is defined.
|
|
||||||
Fixe "png_mmx_supported" typo in project definition files
|
|
||||||
|
|
||||||
Send comments/corrections/commendations to
|
Send comments/corrections/commendations to
|
||||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||||
|
14
INSTALL
14
INSTALL
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Installing libpng version 1.0.9beta10 - January 16, 2001
|
Installing libpng version 1.0.9beta2 - November 19, 2000
|
||||||
|
|
||||||
Before installing libpng, you must first install zlib. zlib
|
Before installing libpng, you must first install zlib. zlib
|
||||||
can usually be found wherever you got libpng. zlib can be
|
can usually be found wherever you got libpng. zlib can be
|
||||||
@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
|
|||||||
version of zlib that's installed.
|
version of zlib that's installed.
|
||||||
|
|
||||||
You can rename the directories that you downloaded (they
|
You can rename the directories that you downloaded (they
|
||||||
might be called "libpng-1.0.9beta10" or "lpng109" and "zlib-1.1.3"
|
might be called "libpng-1.0.9beta2" or "lpng109" and "zlib-1.1.3"
|
||||||
or "zlib113") so that you have directories called "zlib" and "libpng".
|
or "zlib113") so that you have directories called "zlib" and "libpng".
|
||||||
|
|
||||||
Your directory structure should look like this:
|
Your directory structure should look like this:
|
||||||
@ -59,25 +59,23 @@ The files that are presently available in the scripts directory
|
|||||||
include
|
include
|
||||||
|
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.9beta10)
|
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.9beta2)
|
||||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.9beta10,
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.9beta2,
|
||||||
uses assembler code tuned for Intel MMX platform)
|
uses assembler code tuned for Intel MMX platform)
|
||||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
ansi2knr (Requires ansi2knr.c from
|
ansi2knr (Requires ansi2knr.c from
|
||||||
ftp://ftp.cs.wisc.edu/ghost)
|
ftp://ftp.cs.wisc.edu/ghost)
|
||||||
makefile.aix => AIX makefile
|
|
||||||
makefile.cygwin => Cygwin/gcc makefile
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||||
makefile.intel => Intel C/C++ version 4.0 and later
|
makefile.intel => Intel C/C++ version 4.0 and later
|
||||||
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||||
makefile.macosx => MACOS X Makefile
|
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.9beta10)
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.9beta2)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.9beta10)
|
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.9beta2)
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
makefile.mips => MIPS makefile
|
makefile.mips => MIPS makefile
|
||||||
makefile.acorn => Acorn makefile
|
makefile.acorn => Acorn makefile
|
||||||
|
66
KNOWNBUG
66
KNOWNBUG
@ -1,9 +1,65 @@
|
|||||||
|
|
||||||
Known bugs in libpng-1.0.9
|
Known bugs and suggested enhancements in libpng-1.0.8
|
||||||
|
|
||||||
1: January 16, 2001 -- BUG -- progressive reading narrow interlaced PNGs
|
0: November 3, 2000 -- BUG -- incorrect iCCP chunk is written
|
||||||
|
|
||||||
A crash occurs in Mozilla when reading a 2x533 interlaced RGB image.
|
The compression_type byte in the iCCP chunk written by libpng is
|
||||||
|
usually incorrect.
|
||||||
|
|
||||||
|
Status: Fixed in libpng-1.0.9beta1
|
||||||
|
|
||||||
|
1. October 12, 2000 -- BUG -- pngtest fails
|
||||||
|
|
||||||
|
The three WRITEFILE calls in pngtest.c are incorrect. They must be
|
||||||
|
changed to read
|
||||||
|
|
||||||
|
WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check);
|
||||||
|
WRITEFILE(io_ptr, near_data, length, check);
|
||||||
|
WRITEFILE(io_ptr, buf, written, err);
|
||||||
|
|
||||||
|
2. August 28, 2000 -- BUG -- pnggccrd.c
|
||||||
|
|
||||||
|
The interlacing() function has still not been fully converted and
|
||||||
|
will not compile under gcc-2.95.2; it is currently ifdef'ed out.
|
||||||
|
|
||||||
|
STATUS: Fixed in libpng-1.0.9. There were also bugs in pngvcrd.c
|
||||||
|
which have been fixed. The replacement files are available at the
|
||||||
|
PNG web site (http://www.libpng.org/pub/png).
|
||||||
|
|
||||||
|
3. March 15, 1998 -- OPTIMIZATION -- Kevin Bracey
|
||||||
|
|
||||||
|
Loops need to be optimized everywhere
|
||||||
|
|
||||||
|
Make them count down instead of up -- Kevin Bracey
|
||||||
|
|
||||||
|
Optimizing compilers don't need this, and making
|
||||||
|
the change would be error prone -- Tom Lane, Glenn R-P
|
||||||
|
|
||||||
|
Question whether i-- or --i is better.
|
||||||
|
|
||||||
|
STATUS: Under investigation, postponed until after
|
||||||
|
libpng-2.0.0. About 160 loops will be turned around
|
||||||
|
in libpng-2.0.x betaxx, for testing.
|
||||||
|
|
||||||
|
4. July 4, 1998 -- ENHANCEMENT -- Glenn R-P
|
||||||
|
|
||||||
|
libpng-1.0.5 and earlier transform colors to gamma=1.0 space for
|
||||||
|
merging with background, and then back to the image's gamma. The
|
||||||
|
bit_depth of the intermediate (gamma=1.0) representation is probably
|
||||||
|
not sufficient. In the typical gamma=1/2.2 situation, the linear
|
||||||
|
pixels need about 4 more bits than the gamma-encoded ones, to avoid
|
||||||
|
loss of precision. A similar situation exists with the rgb_to_gray
|
||||||
|
operation.
|
||||||
|
|
||||||
|
STATUS: under development.
|
||||||
|
|
||||||
|
5. September 1999 -- ENHANCEMENT --
|
||||||
|
|
||||||
|
It should be possible to use libpng without floating-point arithmetic.
|
||||||
|
|
||||||
|
STATUS: Under investigation, implementation postponed until after
|
||||||
|
libpng-2.0.0.
|
||||||
|
|
||||||
|
Much of this was completed in libpng-1.0.6, but gamma compensation
|
||||||
|
is not yet done in fixed-point arithmetic.
|
||||||
|
|
||||||
Status: Under investigation. It appears that pngpread.c is not
|
|
||||||
taking care to skip empty passes.
|
|
||||||
|
4
LICENSE
4
LICENSE
@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
|||||||
If you modify libpng you may insert additional notices immediately following
|
If you modify libpng you may insert additional notices immediately following
|
||||||
this sentence.
|
this sentence.
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000, through 1.0.9beta10, January 16, 2001, are
|
libpng versions 1.0.7, July 1, 2000, through 1.0.9beta2, November 19, 2000, are
|
||||||
Copyright (c) 2000 Glenn Randers-Pehrson
|
Copyright (c) 2000 Glenn Randers-Pehrson
|
||||||
and are distributed according to the same disclaimer and license as libpng-1.0.6
|
and are distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
with the following individuals added to the list of Contributing Authors
|
with the following individuals added to the list of Contributing Authors
|
||||||
@ -99,4 +99,4 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
randeg@alum.rpi.edu
|
randeg@alum.rpi.edu
|
||||||
January 16, 2001
|
November 19, 2000
|
||||||
|
12
README
12
README
@ -1,4 +1,4 @@
|
|||||||
README for libpng 1.0.9beta10 - January 16, 2001 (shared library 2.1)
|
README for libpng 1.0.9beta2 - November 19, 2000 (shared library 2.1)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
@ -182,27 +182,25 @@ Files in this distribution:
|
|||||||
descrip.mms => VMS makefile for MMS or MMK
|
descrip.mms => VMS makefile for MMS or MMK
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
makefile.linux => Linux/ELF makefile
|
makefile.linux => Linux/ELF makefile
|
||||||
(gcc, creates libpng.so.2.1.0.9beta10)
|
(gcc, creates libpng.so.2.1.0.9beta2)
|
||||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||||
libpng.so.2.1.0.9beta10, uses assembler code
|
libpng.so.2.1.0.9beta2, uses assembler code
|
||||||
tuned for Intel MMX platform)
|
tuned for Intel MMX platform)
|
||||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
ansi2knr (Requires ansi2knr.c from
|
ansi2knr (Requires ansi2knr.c from
|
||||||
ftp://ftp.cs.wisc.edu/ghost)
|
ftp://ftp.cs.wisc.edu/ghost)
|
||||||
makefile.aix => AIX makefile
|
|
||||||
makefile.cygwin => Cygwin/gcc makefile
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||||
makefile.intel => Intel C/C++ version 4.0 and later
|
makefile.intel => Intel C/C++ version 4.0 and later
|
||||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||||
makefile.macosx => MACOS X Makefile
|
|
||||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.9beta10)
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.9beta2)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.solaris => Solaris 2.X makefile
|
makefile.solaris => Solaris 2.X makefile
|
||||||
(gcc, creates libpng.so.2.1.0.9beta10)
|
(gcc, creates libpng.so.2.1.0.9beta2)
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
makefile.mips => MIPS makefile
|
makefile.mips => MIPS makefile
|
||||||
makefile.acorn => Acorn makefile
|
makefile.acorn => Acorn makefile
|
||||||
|
5
TODO
5
TODO
@ -17,8 +17,3 @@ Better filter selection
|
|||||||
(counting huffman bits/precompression? filter inertia? filter costs?).
|
(counting huffman bits/precompression? filter inertia? filter costs?).
|
||||||
Histogram creation.
|
Histogram creation.
|
||||||
Text conversion between different code pages (Latin-1 -> Mac and DOS).
|
Text conversion between different code pages (Latin-1 -> Mac and DOS).
|
||||||
Should we always malloc 2^bit_depth PLTE/tRNS/hIST entries for safety?
|
|
||||||
Build gamma tables using fixed point (and do away with floating point entirely).
|
|
||||||
Use greater precision when changing to linear gamma for compositing against
|
|
||||||
background and doing rgb-to-gray transformation.
|
|
||||||
Investigate pre-incremented loop counters and other loop constructions.
|
|
||||||
|
4
Y2KINFO
4
Y2KINFO
@ -1,13 +1,13 @@
|
|||||||
Y2K compliance in libpng:
|
Y2K compliance in libpng:
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
January 16, 2001
|
November 19, 2000
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.0.9beta10 are Y2K compliant. It is my belief that earlier
|
upward through 1.0.9beta2 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -1,5 +1,5 @@
|
|||||||
echo "
|
echo "
|
||||||
There is no \"configure\" script for Libpng-1.0.9beta10. Instead, please
|
There is no \"configure\" script for Libpng-1.0.9beta2. Instead, please
|
||||||
copy the appropriate makefile for your system from the \"scripts\"
|
copy the appropriate makefile for your system from the \"scripts\"
|
||||||
directory. Read the INSTALL file for more details.
|
directory. Read the INSTALL file for more details.
|
||||||
"
|
"
|
||||||
|
@ -1,102 +0,0 @@
|
|||||||
# Sample makefile for rpng-x / rpng2-x / wpng for SGI using cc and make.
|
|
||||||
# Greg Roelofs
|
|
||||||
# Last modified: 16 January 1000
|
|
||||||
#
|
|
||||||
# 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.)
|
|
||||||
#
|
|
||||||
# Invoke this makefile from a shell prompt in the usual way; for example:
|
|
||||||
#
|
|
||||||
# make -f Makefile.sgi
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This makefile builds dynamically linked executables (against libpng and zlib,
|
|
||||||
# that is), but that can be changed by uncommenting the appropriate PNGLIB and
|
|
||||||
# ZLIB lines.
|
|
||||||
|
|
||||||
|
|
||||||
# macros --------------------------------------------------------------------
|
|
||||||
|
|
||||||
PNGINC = -I/usr/local/include
|
|
||||||
PNGLIB = -L/usr/local/lib -lpng # dynamically linked against libpng
|
|
||||||
#PNGLIB = /usr/local/lib/libpng.a # statically linked against libpng
|
|
||||||
# or:
|
|
||||||
#PNGINC = -I../..
|
|
||||||
#PNGLIB = -L../.. -lpng
|
|
||||||
#PNGLIB = ../../libpng.a
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
XINC = -I/usr/include/X11 # old-style, stock X distributions
|
|
||||||
XLIB = -L/usr/lib/X11 -lX11
|
|
||||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
|
||||||
#XLIB = -L/usr/openwin/lib -lX11
|
|
||||||
#XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.)
|
|
||||||
#XLIB = -L/usr/X11R6/lib -lX11
|
|
||||||
|
|
||||||
INCS = $(PNGINC) $(ZINC) $(XINC)
|
|
||||||
RLIBS = $(PNGLIB) $(ZLIB) $(XLIB) -lm
|
|
||||||
WLIBS = $(PNGLIB) $(ZLIB)
|
|
||||||
|
|
||||||
CC = cc
|
|
||||||
LD = cc
|
|
||||||
RM = rm -f
|
|
||||||
CFLAGS = -O -fullwarn $(INCS)
|
|
||||||
LDFLAGS =
|
|
||||||
O = .o
|
|
||||||
E =
|
|
||||||
|
|
||||||
RPNG = rpng-x
|
|
||||||
RPNG2 = rpng2-x
|
|
||||||
WPNG = wpng
|
|
||||||
|
|
||||||
ROBJS = $(RPNG)$(O) readpng$(O)
|
|
||||||
ROBJS2 = $(RPNG2)$(O) readpng2$(O)
|
|
||||||
WOBJS = $(WPNG)$(O) writepng$(O)
|
|
||||||
|
|
||||||
EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
|
||||||
|
|
||||||
|
|
||||||
# implicit make rules -------------------------------------------------------
|
|
||||||
|
|
||||||
.c$(O):
|
|
||||||
$(CC) -c $(CFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
# dependencies --------------------------------------------------------------
|
|
||||||
|
|
||||||
all: $(EXES)
|
|
||||||
|
|
||||||
$(RPNG)$(E): $(ROBJS)
|
|
||||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBS)
|
|
||||||
|
|
||||||
$(RPNG2)$(E): $(ROBJS2)
|
|
||||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBS)
|
|
||||||
|
|
||||||
$(WPNG)$(E): $(WOBJS)
|
|
||||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBS)
|
|
||||||
|
|
||||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
|
||||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
|
||||||
$(WPNG)$(O): $(WPNG).c writepng.h
|
|
||||||
|
|
||||||
readpng$(O): readpng.c readpng.h
|
|
||||||
readpng2$(O): readpng2.c readpng2.h
|
|
||||||
writepng$(O): writepng.c writepng.h
|
|
||||||
|
|
||||||
|
|
||||||
# maintenance ---------------------------------------------------------------
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) $(EXES) $(ROBJS) $(ROBJS2) $(WOBJS)
|
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||||
|
|
||||||
This software is provided "as is," without warranty of any kind,
|
This software is provided "as is," without warranty of any kind,
|
||||||
express or implied. In no event shall the author or contributors
|
express or implied. In no event shall the author or contributors
|
||||||
@ -51,7 +51,6 @@ void readpng2_version_info(void)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
|
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
|
||||||
PNG_LIBPNG_VER_STRING, png_libpng_ver);
|
PNG_LIBPNG_VER_STRING, png_libpng_ver);
|
||||||
|
|
||||||
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
|
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
|
||||||
ZLIB_VERSION, zlib_version);
|
ZLIB_VERSION, zlib_version);
|
||||||
}
|
}
|
||||||
@ -111,6 +110,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
|||||||
png_set_progressive_read_fn(png_ptr, mainprog_ptr,
|
png_set_progressive_read_fn(png_ptr, mainprog_ptr,
|
||||||
readpng2_info_callback, readpng2_row_callback, readpng2_end_callback);
|
readpng2_info_callback, readpng2_row_callback, readpng2_end_callback);
|
||||||
|
|
||||||
|
|
||||||
/* make sure we save our pointers for use in readpng2_decode_data() */
|
/* make sure we save our pointers for use in readpng2_decode_data() */
|
||||||
|
|
||||||
mainprog_ptr->png_ptr = png_ptr;
|
mainprog_ptr->png_ptr = png_ptr;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||||
|
|
||||||
This software is provided "as is," without warranty of any kind,
|
This software is provided "as is," without warranty of any kind,
|
||||||
express or implied. In no event shall the author or contributors
|
express or implied. In no event shall the author or contributors
|
||||||
@ -66,11 +66,6 @@ typedef struct _mainprog_info {
|
|||||||
int rowbytes;
|
int rowbytes;
|
||||||
int channels;
|
int channels;
|
||||||
int need_bgcolor;
|
int need_bgcolor;
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
int nommxfilters;
|
|
||||||
int nommxcombine;
|
|
||||||
int nommxinterlace;
|
|
||||||
#endif
|
|
||||||
int done;
|
int done;
|
||||||
uch bg_red;
|
uch bg_red;
|
||||||
uch bg_green;
|
uch bg_green;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
Meulen for the "diamond" and "radial waves" patterns, respectively.
|
Meulen for the "diamond" and "radial waves" patterns, respectively.
|
||||||
|
|
||||||
to do:
|
to do:
|
||||||
|
- stdout/stderr don't work! need message window (maybe scrollable?)
|
||||||
- handle quoted command-line args (especially filenames with spaces)
|
- handle quoted command-line args (especially filenames with spaces)
|
||||||
- finish resizable checkerboard-gradient (sizes 4-128?)
|
- finish resizable checkerboard-gradient (sizes 4-128?)
|
||||||
- use %.1023s to simplify truncation of title-bar string?
|
- use %.1023s to simplify truncation of title-bar string?
|
||||||
@ -24,12 +25,10 @@
|
|||||||
- 1.03: modified to allow abbreviated options
|
- 1.03: modified to allow abbreviated options
|
||||||
- 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?];
|
- 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?];
|
||||||
fixed command-line parsing bug
|
fixed command-line parsing bug
|
||||||
- 1.10: enabled "message window" (console), thanks to David Geldreich
|
|
||||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||||
|
|
||||||
This software is provided "as is," without warranty of any kind,
|
This software is provided "as is," without warranty of any kind,
|
||||||
express or implied. In no event shall the author or contributors
|
express or implied. In no event shall the author or contributors
|
||||||
@ -56,7 +55,7 @@
|
|||||||
|
|
||||||
#define PROGNAME "rpng2-win"
|
#define PROGNAME "rpng2-win"
|
||||||
#define LONGNAME "Progressive PNG Viewer for Windows"
|
#define LONGNAME "Progressive PNG Viewer for Windows"
|
||||||
#define VERSION "1.20 of 4 January 2001"
|
#define VERSION "1.04 of 19 March 2000"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -65,7 +64,6 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <math.h> /* only for PvdM background code */
|
#include <math.h> /* only for PvdM background code */
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <conio.h> /* only for _getch() */
|
|
||||||
|
|
||||||
/* all for PvdM background code: */
|
/* all for PvdM background code: */
|
||||||
#ifndef PI
|
#ifndef PI
|
||||||
@ -241,16 +239,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
|||||||
memset(&rpng2_info, 0, sizeof(mainprog_info));
|
memset(&rpng2_info, 0, sizeof(mainprog_info));
|
||||||
|
|
||||||
|
|
||||||
/* Next reenable console output, which normally goes to the bit bucket
|
|
||||||
* for windowed apps. Closing the console window will terminate the
|
|
||||||
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
|
|
||||||
* incantation. */
|
|
||||||
|
|
||||||
AllocConsole();
|
|
||||||
freopen("CONOUT$", "a", stderr);
|
|
||||||
freopen("CONOUT$", "a", stdout);
|
|
||||||
|
|
||||||
|
|
||||||
/* Set the default value for our display-system exponent, i.e., the
|
/* Set the default value for our display-system exponent, i.e., the
|
||||||
* product of the CRT exponent and the exponent corresponding to
|
* product of the CRT exponent and the exponent corresponding to
|
||||||
* the frame-buffer's lookup table (LUT), if any. This is not an
|
* the frame-buffer's lookup table (LUT), if any. This is not an
|
||||||
@ -366,14 +354,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
|||||||
}
|
}
|
||||||
} else if (!strncmp(*argv, "-timing", 2)) {
|
} else if (!strncmp(*argv, "-timing", 2)) {
|
||||||
timing = TRUE;
|
timing = TRUE;
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
} else if (!strncmp(*argv, "-nommxfilters", 7)) {
|
|
||||||
rpng2_info.nommxfilters = TRUE;
|
|
||||||
} else if (!strncmp(*argv, "-nommxcombine", 7)) {
|
|
||||||
rpng2_info.nommxcombine = TRUE;
|
|
||||||
} else if (!strncmp(*argv, "-nommxinterlace", 7)) {
|
|
||||||
rpng2_info.nommxinterlace = TRUE;
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
if (**argv != '-') {
|
if (**argv != '-') {
|
||||||
filename = *argv;
|
filename = *argv;
|
||||||
@ -421,47 +401,25 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
|||||||
/* usage screen */
|
/* usage screen */
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
int ch;
|
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||||
|
|
||||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
|
||||||
readpng2_version_info();
|
readpng2_version_info();
|
||||||
fprintf(stderr, "\n"
|
fprintf(stderr, "\n"
|
||||||
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"
|
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]"
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
" file.png\n\n"
|
||||||
" %*s [-nommxfilters] [-nommxcombine] [-nommxinterlace]\n"
|
|
||||||
#endif
|
|
||||||
" %*s file.png\n\n"
|
|
||||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
" 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 (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||||
"\t\t used with transparent images; overrides -bgpat option\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 (1-%d); used with\n"
|
||||||
"\t\t transparent images; overrides -bgcolor option\n"
|
"\t\t transparent images; overrides -bgcolor\n"
|
||||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||||
"\t\t download of image (~36 Kbps)\n"
|
"\t\t download of image (~36 Kbps)\n"
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
" -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"
|
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||||
"Press Q or Esc to quit this usage screen.\n"
|
"\n", PROGNAME, default_display_exponent, num_bgpat);
|
||||||
"\n", PROGNAME,
|
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
strlen(PROGNAME), " ",
|
|
||||||
#endif
|
|
||||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
|
||||||
do
|
|
||||||
ch = _getch();
|
|
||||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
} else {
|
|
||||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
|
||||||
fprintf(stderr,
|
|
||||||
"\n [console window: closing this window will terminate %s]\n\n",
|
|
||||||
PROGNAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,11 +25,10 @@
|
|||||||
- 1.10: added support for non-default visuals; fixed X pixel-conversion
|
- 1.10: added support for non-default visuals; fixed X pixel-conversion
|
||||||
- 1.11: added -usleep option for demos; fixed command-line parsing bug
|
- 1.11: added -usleep option for demos; fixed command-line parsing bug
|
||||||
- 1.12: added -pause option for demos and testing
|
- 1.12: added -pause option for demos and testing
|
||||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||||
|
|
||||||
This software is provided "as is," without warranty of any kind,
|
This software is provided "as is," without warranty of any kind,
|
||||||
express or implied. In no event shall the author or contributors
|
express or implied. In no event shall the author or contributors
|
||||||
@ -56,7 +55,7 @@
|
|||||||
|
|
||||||
#define PROGNAME "rpng2-x"
|
#define PROGNAME "rpng2-x"
|
||||||
#define LONGNAME "Progressive PNG Viewer for X"
|
#define LONGNAME "Progressive PNG Viewer for X"
|
||||||
#define VERSION "1.20 of 4 January 2001"
|
#define VERSION "1.12 of 19 March 2000"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -360,14 +359,6 @@ int main(int argc, char **argv)
|
|||||||
pause_after_pass = TRUE;
|
pause_after_pass = TRUE;
|
||||||
} else if (!strncmp(*argv, "-timing", 2)) {
|
} else if (!strncmp(*argv, "-timing", 2)) {
|
||||||
timing = TRUE;
|
timing = TRUE;
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
} else if (!strncmp(*argv, "-nommxfilters", 7)) {
|
|
||||||
rpng2_info.nommxfilters = TRUE;
|
|
||||||
} else if (!strncmp(*argv, "-nommxcombine", 7)) {
|
|
||||||
rpng2_info.nommxcombine = TRUE;
|
|
||||||
} else if (!strncmp(*argv, "-nommxinterlace", 7)) {
|
|
||||||
rpng2_info.nommxinterlace = TRUE;
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
if (**argv != '-') {
|
if (**argv != '-') {
|
||||||
filename = *argv;
|
filename = *argv;
|
||||||
@ -423,13 +414,10 @@ int main(int argc, char **argv)
|
|||||||
/* usage screen */
|
/* usage screen */
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||||
readpng2_version_info();
|
readpng2_version_info();
|
||||||
fprintf(stderr, "\n"
|
fprintf(stderr, "\n"
|
||||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n"
|
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n"
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
" %*s [-nommxfilters] [-nommxcombine] [-nommxinterlace]\n"
|
|
||||||
#endif
|
|
||||||
" %*s [-usleep dur | -timing] [-pause] file.png\n\n"
|
" %*s [-usleep dur | -timing] [-pause] file.png\n\n"
|
||||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||||
@ -441,10 +429,6 @@ int main(int argc, char **argv)
|
|||||||
"\t\t used with transparent images; overrides -bgpat\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 (1-%d); used with\n"
|
||||||
"\t\t transparent images; overrides -bgcolor\n"
|
"\t\t transparent images; overrides -bgcolor\n"
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
|
||||||
" -nommx*\tdisable optimized MMX routines for decoding row filters,\n"
|
|
||||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
|
||||||
#endif
|
|
||||||
" dur \tduration in microseconds to wait after displaying each\n"
|
" dur \tduration in microseconds to wait after displaying each\n"
|
||||||
"\t\t row (for demo purposes)\n"
|
"\t\t row (for demo purposes)\n"
|
||||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||||
@ -452,11 +436,8 @@ int main(int argc, char **argv)
|
|||||||
" -pause\tpauses after displaying each pass until key pressed\n"
|
" -pause\tpauses after displaying each pass until key pressed\n"
|
||||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||||
"is displayed) to quit.\n"
|
"is displayed) to quit.\n"
|
||||||
"\n", PROGNAME,
|
"\n", PROGNAME, strlen(PROGNAME), " ", default_display_exponent,
|
||||||
#if (defined(__i386__) || defined(_M_IX86))
|
num_bgpat);
|
||||||
strlen(PROGNAME), " ",
|
|
||||||
#endif
|
|
||||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
|||||||
*/
|
*/
|
||||||
if (color_type & PNG_COLOR_MASK_COLOR)
|
if (color_type & PNG_COLOR_MASK_COLOR)
|
||||||
{
|
{
|
||||||
int num_palette;
|
png_uint_32 num_palette;
|
||||||
png_colorp palette;
|
png_colorp palette;
|
||||||
|
|
||||||
/* This reduces the image to the application supplied palette */
|
/* This reduces the image to the application supplied palette */
|
||||||
@ -603,9 +603,9 @@ void write_png(char *file_name /* , ... other image information ... */)
|
|||||||
PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||||
|
|
||||||
/* set the palette if there is one. REQUIRED for indexed-color images */
|
/* set the palette if there is one. REQUIRED for indexed-color images */
|
||||||
palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof (png_color));
|
palette = (png_colorp)png_malloc(png_ptr, 256 * sizeof (png_color));
|
||||||
/* ... set palette colors ... */
|
/* ... set palette colors ... */
|
||||||
png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);
|
png_set_PLTE(png_ptr, info_ptr, palette, 256);
|
||||||
/* You must not free palette here, because png_set_PLTE only makes a link to
|
/* You must not free palette here, because png_set_PLTE only makes a link to
|
||||||
the palette that you malloced. Wait until you are about to destroy
|
the palette that you malloced. Wait until you are about to destroy
|
||||||
the png structure. */
|
the png structure. */
|
||||||
|
114
libpng.3
114
libpng.3
@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNG 3 "January 16, 2001"
|
.TH LIBPNG 3 "November 19, 2000"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta10
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta2
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
@ -100,10 +100,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta10
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_uint_32 png_get_asm_flags (png_structp \fIpng_ptr\fP\fB);\fP
|
|
||||||
|
|
||||||
\fI\fB
|
|
||||||
|
|
||||||
\fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
@ -338,10 +334,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta10
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
\fBint png_mmx_support \fI(void\fP\fB);\fP
|
|
||||||
|
|
||||||
\fI\fB
|
|
||||||
|
|
||||||
\fBvoid png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP
|
\fBvoid png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
@ -392,10 +384,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta10
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_set_asm_flags (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIasm_flags\fP\fB);\fP
|
|
||||||
|
|
||||||
\fI\fB
|
|
||||||
|
|
||||||
\fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP
|
\fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
@ -759,7 +747,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
|||||||
.SH LIBPNG.TXT
|
.SH LIBPNG.TXT
|
||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.0.9beta10 - January 16, 2001
|
libpng version 1.0.9beta2 - November 19, 2000
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<randeg@alum.rpi.edu>
|
<randeg@alum.rpi.edu>
|
||||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
@ -826,7 +814,7 @@ majority of the needs of its users.
|
|||||||
|
|
||||||
Libpng uses zlib for its compression and decompression of PNG files.
|
Libpng uses zlib for its compression and decompression of PNG files.
|
||||||
Further information about zlib, and the latest version of zlib, can
|
Further information about zlib, and the latest version of zlib, can
|
||||||
be found at the zlib home page, <http://www.info-zip.org/pub/infozip/zlib/>.
|
be found at the zlib home page, <ftp://ftp.freesoftware.com/pub/infozip/zlib/>.
|
||||||
The zlib compression utility is a general purpose utility that is
|
The zlib compression utility is a general purpose utility that is
|
||||||
useful for more than PNG files, and can be used without libpng.
|
useful for more than PNG files, and can be used without libpng.
|
||||||
See the documentation delivered with zlib for more details.
|
See the documentation delivered with zlib for more details.
|
||||||
@ -1159,7 +1147,7 @@ in until png_read_end() has read the chunk data following the image.
|
|||||||
|
|
||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height,
|
png_get_IHDR(png_ptr, info_ptr, &width, &height,
|
||||||
&bit_depth, &color_type, &interlace_type,
|
&bit_depth, &color_type, &interlace_type,
|
||||||
&compression_type, &filter_method);
|
&compression_type, &filter_type);
|
||||||
|
|
||||||
width - holds the width of the image
|
width - holds the width of the image
|
||||||
in pixels (up to 2^31).
|
in pixels (up to 2^31).
|
||||||
@ -1187,18 +1175,15 @@ in until png_read_end() has read the chunk data following the image.
|
|||||||
PNG_COLOR_MASK_COLOR
|
PNG_COLOR_MASK_COLOR
|
||||||
PNG_COLOR_MASK_ALPHA
|
PNG_COLOR_MASK_ALPHA
|
||||||
|
|
||||||
filter_method - (must be PNG_FILTER_TYPE_BASE
|
filter_type - (must be PNG_FILTER_TYPE_BASE
|
||||||
for PNG 1.0, and can also be
|
for PNG 1.0)
|
||||||
PNG_INTRAPIXEL_DIFFERENCING if
|
|
||||||
the PNG datastream is embedded in
|
|
||||||
a MNG-1.0 datastream)
|
|
||||||
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
||||||
for PNG 1.0)
|
for PNG 1.0)
|
||||||
interlace_type - (PNG_INTERLACE_NONE or
|
interlace_type - (PNG_INTERLACE_NONE or
|
||||||
PNG_INTERLACE_ADAM7)
|
PNG_INTERLACE_ADAM7)
|
||||||
Any or all of interlace_type, compression_type, of
|
Any or all of interlace_type, compression_type, of
|
||||||
filter_method can be NULL if you are
|
filter_type can be NULL if you are not
|
||||||
not interested in their values.
|
interested in their values.
|
||||||
|
|
||||||
channels = png_get_channels(png_ptr, info_ptr);
|
channels = png_get_channels(png_ptr, info_ptr);
|
||||||
channels - number of channels of info for the
|
channels - number of channels of info for the
|
||||||
@ -1228,7 +1213,7 @@ in until png_read_end() has read the chunk data following the image.
|
|||||||
info_ptr);
|
info_ptr);
|
||||||
color_type = png_get_color_type(png_ptr,
|
color_type = png_get_color_type(png_ptr,
|
||||||
info_ptr);
|
info_ptr);
|
||||||
filter_method = png_get_filter_type(png_ptr,
|
filter_type = png_get_filter_type(png_ptr,
|
||||||
info_ptr);
|
info_ptr);
|
||||||
compression_type = png_get_compression_type(png_ptr,
|
compression_type = png_get_compression_type(png_ptr,
|
||||||
info_ptr);
|
info_ptr);
|
||||||
@ -1721,7 +1706,7 @@ histogram, it may not do as good a job.
|
|||||||
if (png_get_valid(png_ptr, info_ptr,
|
if (png_get_valid(png_ptr, info_ptr,
|
||||||
PNG_INFO_PLTE))
|
PNG_INFO_PLTE))
|
||||||
{
|
{
|
||||||
png_uint_16p histogram;
|
png_color_16p histogram;
|
||||||
|
|
||||||
png_get_hIST(png_ptr, info_ptr,
|
png_get_hIST(png_ptr, info_ptr,
|
||||||
&histogram);
|
&histogram);
|
||||||
@ -2301,11 +2286,10 @@ maximum possible compression at the expense of slower writing. If you
|
|||||||
have no special needs in this area, let the library do what it wants by
|
have no special needs in this area, let the library do what it wants by
|
||||||
not calling this function at all, as it has been tuned to deliver a good
|
not calling this function at all, as it has been tuned to deliver a good
|
||||||
speed/compression ratio. The second parameter to png_set_filter() is
|
speed/compression ratio. The second parameter to png_set_filter() is
|
||||||
the filter method, for which the only valid values are 0 (as of the
|
the filter method, for which the only valid value is '0' (as of the
|
||||||
July 1999 PNG specification, version 1.2) or 64 (if you are writing
|
July 1999 PNG specification, version 1.2). The third parameter is a
|
||||||
a PNG datastream that is to be embedded in a MNG datastream). The third
|
flag that indicates which filter type(s) are to be tested for each
|
||||||
parameter is a flag that indicates which filter type(s) are to be tested
|
scanline. See the PNG specification for details on the specific filter
|
||||||
for each scanline. See the PNG specification for details on the specific filter
|
|
||||||
types.
|
types.
|
||||||
|
|
||||||
|
|
||||||
@ -2326,9 +2310,6 @@ it should start out with all of the filters (to ensure that the previous
|
|||||||
row of pixels will be stored in case it's needed later), and then add
|
row of pixels will be stored in case it's needed later), and then add
|
||||||
and remove them after the start of compression.
|
and remove them after the start of compression.
|
||||||
|
|
||||||
If you are writing a PNG datastream that is to be embedded in a MNG
|
|
||||||
datastream, the second parameter can be either 0 or 64.
|
|
||||||
|
|
||||||
The png_set_compression_*() functions interface to the zlib compression
|
The png_set_compression_*() functions interface to the zlib compression
|
||||||
library, and should mostly be ignored unless you really know what you are
|
library, and should mostly be ignored unless you really know what you are
|
||||||
doing. The only generally useful call is png_set_compression_level()
|
doing. The only generally useful call is png_set_compression_level()
|
||||||
@ -2367,7 +2348,7 @@ Some of the more important parts of the png_info are:
|
|||||||
|
|
||||||
png_set_IHDR(png_ptr, info_ptr, width, height,
|
png_set_IHDR(png_ptr, info_ptr, width, height,
|
||||||
bit_depth, color_type, interlace_type,
|
bit_depth, color_type, interlace_type,
|
||||||
compression_type, filter_method)
|
compression_type, filter_type)
|
||||||
width - holds the width of the image
|
width - holds the width of the image
|
||||||
in pixels (up to 2^31).
|
in pixels (up to 2^31).
|
||||||
height - holds the height of the image
|
height - holds the height of the image
|
||||||
@ -2399,11 +2380,7 @@ Some of the more important parts of the png_info are:
|
|||||||
PNG_INTERLACE_ADAM7
|
PNG_INTERLACE_ADAM7
|
||||||
compression_type - (must be
|
compression_type - (must be
|
||||||
PNG_COMPRESSION_TYPE_DEFAULT)
|
PNG_COMPRESSION_TYPE_DEFAULT)
|
||||||
filter_method - (must be PNG_FILTER_TYPE_DEFAULT
|
filter_type - (must be PNG_FILTER_TYPE_DEFAULT)
|
||||||
or, if you are writing a PNG to
|
|
||||||
be embedded in a MNG datastream,
|
|
||||||
can also be
|
|
||||||
PNG_INTRAPIXEL_DIFFERENCING)
|
|
||||||
|
|
||||||
png_set_PLTE(png_ptr, info_ptr, palette,
|
png_set_PLTE(png_ptr, info_ptr, palette,
|
||||||
num_palette);
|
num_palette);
|
||||||
@ -3001,22 +2978,13 @@ For a more compact example of writing a PNG image, see the file example.c.
|
|||||||
|
|
||||||
.SH V. Modifying/Customizing libpng:
|
.SH V. Modifying/Customizing libpng:
|
||||||
|
|
||||||
There are three issues here. The first is changing how libpng does
|
There are two issues here. The first is changing how libpng does
|
||||||
standard things like memory allocation, input/output, and error handling.
|
standard things like memory allocation, input/output, and error handling.
|
||||||
The second deals with more complicated things like adding new chunks,
|
The second deals with more complicated things like adding new chunks,
|
||||||
adding new transformations, and generally changing how libpng works.
|
adding new transformations, and generally changing how libpng works.
|
||||||
Both of those are compile-time issues; that is, they are generally
|
|
||||||
determined at the time the code is written, and there is rarely a need
|
|
||||||
to provide the user with a means of changing them. The third is a
|
|
||||||
run-time issue: choosing between and/or tuning one or more alternate
|
|
||||||
versions of computationally intensive routines; specifically, optimized
|
|
||||||
assembly-language (and therefore compiler- and platform-dependent)
|
|
||||||
versions.
|
|
||||||
|
|
||||||
Memory allocation, input/output, and error handling
|
|
||||||
|
|
||||||
All of the memory allocation, input/output, and error handling in libpng
|
All of the memory allocation, input/output, and error handling in libpng
|
||||||
goes through callbacks that are user-settable. The default routines are
|
goes through callbacks that are user settable. The default routines are
|
||||||
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
||||||
these functions, call the appropriate png_set_*_fn() function.
|
these functions, call the appropriate png_set_*_fn() function.
|
||||||
|
|
||||||
@ -3249,10 +3217,6 @@ structures appropriately for all of the filter types.
|
|||||||
|
|
||||||
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE,
|
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE,
|
||||||
filters);
|
filters);
|
||||||
The second parameter can also be PNG_INTRAPIXEL_DIFFERENCING
|
|
||||||
if you are writing a PNG to be embedded in a MNG
|
|
||||||
datastream. This parameter must be the same as the
|
|
||||||
value of filter_method used in png_set_IHDR().
|
|
||||||
|
|
||||||
It is also possible to influence how libpng chooses from among the
|
It is also possible to influence how libpng chooses from among the
|
||||||
available filters. This is done in two ways - by telling it how
|
available filters. This is done in two ways - by telling it how
|
||||||
@ -3364,33 +3328,7 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
|
|||||||
having level = 0 will be printed. There aren't any such statements in
|
having level = 0 will be printed. There aren't any such statements in
|
||||||
this version of libpng, but if you insert some they will be printed.
|
this version of libpng, but if you insert some they will be printed.
|
||||||
|
|
||||||
|
.SH VI. Changes to Libpng from version 0.88
|
||||||
.SH VI. MNG support
|
|
||||||
|
|
||||||
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
|
||||||
certain extensions to PNG for PNG images that are embedded in MNG datastreams.
|
|
||||||
Libpng can support some of these extensions. To enable them, use the
|
|
||||||
png_permit_mng_features() function:
|
|
||||||
|
|
||||||
feature_set = png_permit_mng_features(png_ptr, mask)
|
|
||||||
mask is a png_uint_32 containing the logical OR of the
|
|
||||||
features you want to enable. These include
|
|
||||||
PNG_FLAG_MNG_EMPTY_PLTE
|
|
||||||
PNG_FLAG_MNG_FILTER_64
|
|
||||||
PNG_ALL_MNG_FEATURES
|
|
||||||
feature_set is a png_32_uint that is the logical AND of
|
|
||||||
your mask with the set of MNG features that is
|
|
||||||
supported by the version of libpng that you are using.
|
|
||||||
|
|
||||||
It is an error to use this function when reading or writing a standalone
|
|
||||||
PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped
|
|
||||||
in a MNG datastream. As a minimum, it must have the MNG 8-byte signature
|
|
||||||
and the MHDR and MEND chunks. Libpng does not provide support for these
|
|
||||||
or any other MNG chunks; your application must provide its own support for
|
|
||||||
them. You may wish to consider using libmng (available at
|
|
||||||
http://www.libmng.com) instead.
|
|
||||||
|
|
||||||
.SH VII. Changes to Libpng from version 0.88
|
|
||||||
|
|
||||||
It should be noted that versions of libpng later than 0.96 are not
|
It should be noted that versions of libpng later than 0.96 are not
|
||||||
distributed by the original libpng author, Guy Schalnat, nor by
|
distributed by the original libpng author, Guy Schalnat, nor by
|
||||||
@ -3439,15 +3377,15 @@ application:
|
|||||||
|
|
||||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||||
|
|
||||||
.SH VIII. Y2K Compliance in libpng
|
.SH VII. Y2K Compliance in libpng
|
||||||
|
|
||||||
January 16, 2001
|
November 19, 2000
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.0.9beta10 are Y2K compliant. It is my belief that earlier
|
upward through 1.0.9beta2 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||||
@ -3588,7 +3526,7 @@ possible without all of you.
|
|||||||
|
|
||||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||||
|
|
||||||
Libpng version 1.0.9beta10 - January 16, 2001:
|
Libpng version 1.0.9beta2 - November 19, 2000:
|
||||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||||
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
|
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
|
||||||
|
|
||||||
@ -3605,7 +3543,7 @@ included in the libpng distribution, the latter shall prevail.)
|
|||||||
If you modify libpng you may insert additional notices immediately following
|
If you modify libpng you may insert additional notices immediately following
|
||||||
this sentence.
|
this sentence.
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000, through 1.0.9beta10, January 16, 2001, are
|
libpng versions 1.0.7, July 1, 2000, through 1.0.9beta2, November 19, 2000, are
|
||||||
Copyright (c) 2000 Glenn Randers-Pehrson, and are
|
Copyright (c) 2000 Glenn Randers-Pehrson, and are
|
||||||
distributed according to the same disclaimer and license as libpng-1.0.6
|
distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
with the following individuals added to the list of Contributing Authors
|
with the following individuals added to the list of Contributing Authors
|
||||||
@ -3696,7 +3634,7 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
randeg@alum.rpi.edu
|
randeg@alum.rpi.edu
|
||||||
January 16, 2001
|
November 19, 2000
|
||||||
|
|
||||||
.\" end of man page
|
.\" end of man page
|
||||||
|
|
||||||
|
92
libpng.txt
92
libpng.txt
@ -1,6 +1,6 @@
|
|||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.0.9beta10 - January 16, 2001
|
libpng version 1.0.9beta2 - November 19, 2000
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<randeg@alum.rpi.edu>
|
<randeg@alum.rpi.edu>
|
||||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
@ -67,7 +67,7 @@ majority of the needs of its users.
|
|||||||
|
|
||||||
Libpng uses zlib for its compression and decompression of PNG files.
|
Libpng uses zlib for its compression and decompression of PNG files.
|
||||||
Further information about zlib, and the latest version of zlib, can
|
Further information about zlib, and the latest version of zlib, can
|
||||||
be found at the zlib home page, <http://www.info-zip.org/pub/infozip/zlib/>.
|
be found at the zlib home page, <ftp://ftp.freesoftware.com/pub/infozip/zlib/>.
|
||||||
The zlib compression utility is a general purpose utility that is
|
The zlib compression utility is a general purpose utility that is
|
||||||
useful for more than PNG files, and can be used without libpng.
|
useful for more than PNG files, and can be used without libpng.
|
||||||
See the documentation delivered with zlib for more details.
|
See the documentation delivered with zlib for more details.
|
||||||
@ -400,7 +400,7 @@ in until png_read_end() has read the chunk data following the image.
|
|||||||
|
|
||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height,
|
png_get_IHDR(png_ptr, info_ptr, &width, &height,
|
||||||
&bit_depth, &color_type, &interlace_type,
|
&bit_depth, &color_type, &interlace_type,
|
||||||
&compression_type, &filter_method);
|
&compression_type, &filter_type);
|
||||||
|
|
||||||
width - holds the width of the image
|
width - holds the width of the image
|
||||||
in pixels (up to 2^31).
|
in pixels (up to 2^31).
|
||||||
@ -428,18 +428,15 @@ in until png_read_end() has read the chunk data following the image.
|
|||||||
PNG_COLOR_MASK_COLOR
|
PNG_COLOR_MASK_COLOR
|
||||||
PNG_COLOR_MASK_ALPHA
|
PNG_COLOR_MASK_ALPHA
|
||||||
|
|
||||||
filter_method - (must be PNG_FILTER_TYPE_BASE
|
filter_type - (must be PNG_FILTER_TYPE_BASE
|
||||||
for PNG 1.0, and can also be
|
for PNG 1.0)
|
||||||
PNG_INTRAPIXEL_DIFFERENCING if
|
|
||||||
the PNG datastream is embedded in
|
|
||||||
a MNG-1.0 datastream)
|
|
||||||
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
||||||
for PNG 1.0)
|
for PNG 1.0)
|
||||||
interlace_type - (PNG_INTERLACE_NONE or
|
interlace_type - (PNG_INTERLACE_NONE or
|
||||||
PNG_INTERLACE_ADAM7)
|
PNG_INTERLACE_ADAM7)
|
||||||
Any or all of interlace_type, compression_type, of
|
Any or all of interlace_type, compression_type, of
|
||||||
filter_method can be NULL if you are
|
filter_type can be NULL if you are not
|
||||||
not interested in their values.
|
interested in their values.
|
||||||
|
|
||||||
channels = png_get_channels(png_ptr, info_ptr);
|
channels = png_get_channels(png_ptr, info_ptr);
|
||||||
channels - number of channels of info for the
|
channels - number of channels of info for the
|
||||||
@ -469,7 +466,7 @@ in until png_read_end() has read the chunk data following the image.
|
|||||||
info_ptr);
|
info_ptr);
|
||||||
color_type = png_get_color_type(png_ptr,
|
color_type = png_get_color_type(png_ptr,
|
||||||
info_ptr);
|
info_ptr);
|
||||||
filter_method = png_get_filter_type(png_ptr,
|
filter_type = png_get_filter_type(png_ptr,
|
||||||
info_ptr);
|
info_ptr);
|
||||||
compression_type = png_get_compression_type(png_ptr,
|
compression_type = png_get_compression_type(png_ptr,
|
||||||
info_ptr);
|
info_ptr);
|
||||||
@ -962,7 +959,7 @@ histogram, it may not do as good a job.
|
|||||||
if (png_get_valid(png_ptr, info_ptr,
|
if (png_get_valid(png_ptr, info_ptr,
|
||||||
PNG_INFO_PLTE))
|
PNG_INFO_PLTE))
|
||||||
{
|
{
|
||||||
png_uint_16p histogram;
|
png_color_16p histogram;
|
||||||
|
|
||||||
png_get_hIST(png_ptr, info_ptr,
|
png_get_hIST(png_ptr, info_ptr,
|
||||||
&histogram);
|
&histogram);
|
||||||
@ -1542,11 +1539,10 @@ maximum possible compression at the expense of slower writing. If you
|
|||||||
have no special needs in this area, let the library do what it wants by
|
have no special needs in this area, let the library do what it wants by
|
||||||
not calling this function at all, as it has been tuned to deliver a good
|
not calling this function at all, as it has been tuned to deliver a good
|
||||||
speed/compression ratio. The second parameter to png_set_filter() is
|
speed/compression ratio. The second parameter to png_set_filter() is
|
||||||
the filter method, for which the only valid values are 0 (as of the
|
the filter method, for which the only valid value is '0' (as of the
|
||||||
July 1999 PNG specification, version 1.2) or 64 (if you are writing
|
July 1999 PNG specification, version 1.2). The third parameter is a
|
||||||
a PNG datastream that is to be embedded in a MNG datastream). The third
|
flag that indicates which filter type(s) are to be tested for each
|
||||||
parameter is a flag that indicates which filter type(s) are to be tested
|
scanline. See the PNG specification for details on the specific filter
|
||||||
for each scanline. See the PNG specification for details on the specific filter
|
|
||||||
types.
|
types.
|
||||||
|
|
||||||
|
|
||||||
@ -1567,9 +1563,6 @@ it should start out with all of the filters (to ensure that the previous
|
|||||||
row of pixels will be stored in case it's needed later), and then add
|
row of pixels will be stored in case it's needed later), and then add
|
||||||
and remove them after the start of compression.
|
and remove them after the start of compression.
|
||||||
|
|
||||||
If you are writing a PNG datastream that is to be embedded in a MNG
|
|
||||||
datastream, the second parameter can be either 0 or 64.
|
|
||||||
|
|
||||||
The png_set_compression_*() functions interface to the zlib compression
|
The png_set_compression_*() functions interface to the zlib compression
|
||||||
library, and should mostly be ignored unless you really know what you are
|
library, and should mostly be ignored unless you really know what you are
|
||||||
doing. The only generally useful call is png_set_compression_level()
|
doing. The only generally useful call is png_set_compression_level()
|
||||||
@ -1608,7 +1601,7 @@ Some of the more important parts of the png_info are:
|
|||||||
|
|
||||||
png_set_IHDR(png_ptr, info_ptr, width, height,
|
png_set_IHDR(png_ptr, info_ptr, width, height,
|
||||||
bit_depth, color_type, interlace_type,
|
bit_depth, color_type, interlace_type,
|
||||||
compression_type, filter_method)
|
compression_type, filter_type)
|
||||||
width - holds the width of the image
|
width - holds the width of the image
|
||||||
in pixels (up to 2^31).
|
in pixels (up to 2^31).
|
||||||
height - holds the height of the image
|
height - holds the height of the image
|
||||||
@ -1640,11 +1633,7 @@ Some of the more important parts of the png_info are:
|
|||||||
PNG_INTERLACE_ADAM7
|
PNG_INTERLACE_ADAM7
|
||||||
compression_type - (must be
|
compression_type - (must be
|
||||||
PNG_COMPRESSION_TYPE_DEFAULT)
|
PNG_COMPRESSION_TYPE_DEFAULT)
|
||||||
filter_method - (must be PNG_FILTER_TYPE_DEFAULT
|
filter_type - (must be PNG_FILTER_TYPE_DEFAULT)
|
||||||
or, if you are writing a PNG to
|
|
||||||
be embedded in a MNG datastream,
|
|
||||||
can also be
|
|
||||||
PNG_INTRAPIXEL_DIFFERENCING)
|
|
||||||
|
|
||||||
png_set_PLTE(png_ptr, info_ptr, palette,
|
png_set_PLTE(png_ptr, info_ptr, palette,
|
||||||
num_palette);
|
num_palette);
|
||||||
@ -2242,22 +2231,13 @@ For a more compact example of writing a PNG image, see the file example.c.
|
|||||||
|
|
||||||
V. Modifying/Customizing libpng:
|
V. Modifying/Customizing libpng:
|
||||||
|
|
||||||
There are three issues here. The first is changing how libpng does
|
There are two issues here. The first is changing how libpng does
|
||||||
standard things like memory allocation, input/output, and error handling.
|
standard things like memory allocation, input/output, and error handling.
|
||||||
The second deals with more complicated things like adding new chunks,
|
The second deals with more complicated things like adding new chunks,
|
||||||
adding new transformations, and generally changing how libpng works.
|
adding new transformations, and generally changing how libpng works.
|
||||||
Both of those are compile-time issues; that is, they are generally
|
|
||||||
determined at the time the code is written, and there is rarely a need
|
|
||||||
to provide the user with a means of changing them. The third is a
|
|
||||||
run-time issue: choosing between and/or tuning one or more alternate
|
|
||||||
versions of computationally intensive routines; specifically, optimized
|
|
||||||
assembly-language (and therefore compiler- and platform-dependent)
|
|
||||||
versions.
|
|
||||||
|
|
||||||
Memory allocation, input/output, and error handling
|
|
||||||
|
|
||||||
All of the memory allocation, input/output, and error handling in libpng
|
All of the memory allocation, input/output, and error handling in libpng
|
||||||
goes through callbacks that are user-settable. The default routines are
|
goes through callbacks that are user settable. The default routines are
|
||||||
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
||||||
these functions, call the appropriate png_set_*_fn() function.
|
these functions, call the appropriate png_set_*_fn() function.
|
||||||
|
|
||||||
@ -2490,10 +2470,6 @@ structures appropriately for all of the filter types.
|
|||||||
|
|
||||||
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE,
|
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE,
|
||||||
filters);
|
filters);
|
||||||
The second parameter can also be PNG_INTRAPIXEL_DIFFERENCING
|
|
||||||
if you are writing a PNG to be embedded in a MNG
|
|
||||||
datastream. This parameter must be the same as the
|
|
||||||
value of filter_method used in png_set_IHDR().
|
|
||||||
|
|
||||||
It is also possible to influence how libpng chooses from among the
|
It is also possible to influence how libpng chooses from among the
|
||||||
available filters. This is done in two ways - by telling it how
|
available filters. This is done in two ways - by telling it how
|
||||||
@ -2605,33 +2581,7 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
|
|||||||
having level = 0 will be printed. There aren't any such statements in
|
having level = 0 will be printed. There aren't any such statements in
|
||||||
this version of libpng, but if you insert some they will be printed.
|
this version of libpng, but if you insert some they will be printed.
|
||||||
|
|
||||||
|
VI. Changes to Libpng from version 0.88
|
||||||
VI. MNG support
|
|
||||||
|
|
||||||
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
|
||||||
certain extensions to PNG for PNG images that are embedded in MNG datastreams.
|
|
||||||
Libpng can support some of these extensions. To enable them, use the
|
|
||||||
png_permit_mng_features() function:
|
|
||||||
|
|
||||||
feature_set = png_permit_mng_features(png_ptr, mask)
|
|
||||||
mask is a png_uint_32 containing the logical OR of the
|
|
||||||
features you want to enable. These include
|
|
||||||
PNG_FLAG_MNG_EMPTY_PLTE
|
|
||||||
PNG_FLAG_MNG_FILTER_64
|
|
||||||
PNG_ALL_MNG_FEATURES
|
|
||||||
feature_set is a png_32_uint that is the logical AND of
|
|
||||||
your mask with the set of MNG features that is
|
|
||||||
supported by the version of libpng that you are using.
|
|
||||||
|
|
||||||
It is an error to use this function when reading or writing a standalone
|
|
||||||
PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped
|
|
||||||
in a MNG datastream. As a minimum, it must have the MNG 8-byte signature
|
|
||||||
and the MHDR and MEND chunks. Libpng does not provide support for these
|
|
||||||
or any other MNG chunks; your application must provide its own support for
|
|
||||||
them. You may wish to consider using libmng (available at
|
|
||||||
http://www.libmng.com) instead.
|
|
||||||
|
|
||||||
VII. Changes to Libpng from version 0.88
|
|
||||||
|
|
||||||
It should be noted that versions of libpng later than 0.96 are not
|
It should be noted that versions of libpng later than 0.96 are not
|
||||||
distributed by the original libpng author, Guy Schalnat, nor by
|
distributed by the original libpng author, Guy Schalnat, nor by
|
||||||
@ -2680,15 +2630,15 @@ application:
|
|||||||
|
|
||||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||||
|
|
||||||
VIII. Y2K Compliance in libpng
|
VII. Y2K Compliance in libpng
|
||||||
|
|
||||||
January 16, 2001
|
November 19, 2000
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.0.9beta10 are Y2K compliant. It is my belief that earlier
|
upward through 1.0.9beta2 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNGPF 3 "January 16, 2001"
|
.TH LIBPNGPF 3 "November 19, 2000"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta10
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.9beta2
|
||||||
(private functions)
|
(private functions)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB#include <png.h>\fP
|
\fB#include <png.h>\fP
|
||||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "January 16, 2001"
|
.TH PNG 5 "November 19, 2000"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
26
png.c
26
png.c
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* libpng version 1.0.9beta10 - January 16, 2001
|
* libpng version 1.0.9beta2 - November 19, 2000
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -13,14 +13,14 @@
|
|||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_0_9beta10 Your_png_h_is_not_version_1_0_9beta10;
|
typedef version_1_0_9beta2 Your_png_h_is_not_version_1_0_9beta2;
|
||||||
|
|
||||||
/* Version information for C files. This had better match the version
|
/* Version information for C files. This had better match the version
|
||||||
* string defined in png.h. */
|
* string defined in png.h. */
|
||||||
|
|
||||||
#ifdef PNG_USE_GLOBAL_ARRAYS
|
#ifdef PNG_USE_GLOBAL_ARRAYS
|
||||||
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
||||||
const char png_libpng_ver[18] = "1.0.9beta10";
|
const char png_libpng_ver[18] = "1.0.9beta2";
|
||||||
|
|
||||||
/* png_sig was changed to a function in version 1.0.5c */
|
/* png_sig was changed to a function in version 1.0.5c */
|
||||||
/* Place to hold the signature string for a PNG file. */
|
/* Place to hold the signature string for a PNG file. */
|
||||||
@ -626,8 +626,8 @@ png_charp PNGAPI
|
|||||||
png_get_copyright(png_structp png_ptr)
|
png_get_copyright(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
|
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
|
||||||
return ((png_charp) "\n libpng version 1.0.9beta10 - January 16, 2001\n\
|
return ((png_charp) "\n libpng version 1.0.9beta2 - November 19, 2000\n\
|
||||||
Copyright (c) 1998-2001 Glenn Randers-Pehrson\n\
|
Copyright (c) 1998-2000 Glenn Randers-Pehrson\n\
|
||||||
Copyright (c) 1996, 1997 Andreas Dilger\n\
|
Copyright (c) 1996, 1997 Andreas Dilger\n\
|
||||||
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||||
return ((png_charp) "");
|
return ((png_charp) "");
|
||||||
@ -644,8 +644,8 @@ png_get_libpng_ver(png_structp png_ptr)
|
|||||||
{
|
{
|
||||||
/* Version of *.c files used when building libpng */
|
/* Version of *.c files used when building libpng */
|
||||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
||||||
return((png_charp) "1.0.9beta10");
|
return((png_charp) "1.0.9beta2");
|
||||||
return((png_charp) "1.0.9beta10");
|
return((png_charp) "1.0.9beta2");
|
||||||
}
|
}
|
||||||
|
|
||||||
png_charp PNGAPI
|
png_charp PNGAPI
|
||||||
@ -697,13 +697,3 @@ png_access_version_number(void)
|
|||||||
/* Version of *.c files used when building libpng */
|
/* Version of *.c files used when building libpng */
|
||||||
return((png_uint_32) 10009L);
|
return((png_uint_32) 10009L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* this function was added to libpng 1.0.9 (porting aid to libpng-1.2.0) */
|
|
||||||
#ifndef PNG_ASSEMBLER_CODE_SUPPORTED
|
|
||||||
int PNGAPI
|
|
||||||
png_mmx_support(void)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
108
png.h
108
png.h
@ -1,15 +1,15 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.0.9beta10 - January 16, 2001
|
* libpng version 1.0.9beta2 - November 19, 2000
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* 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.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.0.9beta10 - January 16, 2001: Glenn
|
* libpng versions 0.97, January 1998, through 1.0.9beta2 - November 19, 2000: Glenn
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@ -58,14 +58,12 @@
|
|||||||
* 1.0.8beta1-4 10008 2.1.0.8beta1-4
|
* 1.0.8beta1-4 10008 2.1.0.8beta1-4
|
||||||
* 1.0.8rc1 10008 2.1.0.8rc1
|
* 1.0.8rc1 10008 2.1.0.8rc1
|
||||||
* 1.0.8 10008 2.1.0.8
|
* 1.0.8 10008 2.1.0.8
|
||||||
* 1.0.9beta1-6 10009 2.1.0.9beta1-6
|
* 1.0.9beta1-2 10009 2.1.0.9
|
||||||
* 1.0.9rc1 10009 2.1.0.9rc1
|
|
||||||
* 1.0.9beta7-10 10009 2.1.0.9beta7-10
|
|
||||||
*
|
*
|
||||||
* Henceforth the source version will match the shared-library major
|
* Henceforth the source version will match the shared-library major
|
||||||
* and minor numbers; the shared-library major version number will be
|
* and minor numbers; the shared-library major version number will be
|
||||||
* used for changes in backward compatibility, as it is intended. The
|
* used for changes in backward compatibility, as it is intended. The
|
||||||
* PNG_LIBPNG_VER macro, which is not used within libpng but is available
|
* PNG_PNGLIB_VER macro, which is not used within libpng but is available
|
||||||
* for applications, is an unsigned integer of the form xyyzz corresponding
|
* for applications, is an unsigned integer of the form xyyzz corresponding
|
||||||
* to the source version x.y.z (leading zeros in y and z). Beta versions
|
* to the source version x.y.z (leading zeros in y and z). Beta versions
|
||||||
* were given the previous public release number plus a letter, until
|
* were given the previous public release number plus a letter, until
|
||||||
@ -87,8 +85,8 @@
|
|||||||
* If you modify libpng you may insert additional notices immediately following
|
* If you modify libpng you may insert additional notices immediately following
|
||||||
* this sentence.
|
* this sentence.
|
||||||
*
|
*
|
||||||
* libpng versions 1.0.7, July 1, 2000, through 1.0.9beta10, January 16, 2001, are
|
* libpng versions 1.0.7, July 1, 2000, through 1.0.9beta2, November 19, 2000, are
|
||||||
* Copyright (c) 2000, 2001 Glenn Randers-Pehrson, and are
|
* Copyright (c) 2000 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.0.6
|
* distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
* with the following individuals added to the list of Contributing Authors
|
* with the following individuals added to the list of Contributing Authors
|
||||||
*
|
*
|
||||||
@ -192,13 +190,13 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* January 16, 2001
|
* November 19, 2000
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
*
|
*
|
||||||
* This is your unofficial assurance that libpng from version 0.71 and
|
* This is your unofficial assurance that libpng from version 0.71 and
|
||||||
* upward through 1.0.9beta10 are Y2K compliant. It is my belief that earlier
|
* upward through 1.0.9beta2 are Y2K compliant. It is my belief that earlier
|
||||||
* versions were also Y2K compliant.
|
* versions were also Y2K compliant.
|
||||||
*
|
*
|
||||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||||
@ -254,7 +252,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.0.9beta10"
|
#define PNG_LIBPNG_VER_STRING "1.0.9beta2"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 2
|
#define PNG_LIBPNG_VER_SONUM 2
|
||||||
|
|
||||||
@ -264,16 +262,8 @@
|
|||||||
#define PNG_LIBPNG_VER_RELEASE 9
|
#define PNG_LIBPNG_VER_RELEASE 9
|
||||||
/* This should match the numeric part of the final component of
|
/* This should match the numeric part of the final component of
|
||||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||||
|
#define PNG_LIBPNG_VER_BUILD 2
|
||||||
#define PNG_LIBPNG_VER_BUILD 10
|
#define PNG_LIBPNG_BUILD_TYPE beta /* alpha, beta, rc, stable, patched */
|
||||||
|
|
||||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
|
||||||
#define PNG_LIBPNG_BUILD_BETA 2
|
|
||||||
#define PNG_LIBPNG_BUILD_RC 3
|
|
||||||
#define PNG_LIBPNG_BUILD_STABLE 4
|
|
||||||
#define PNG_LIBPNG_BUILD_TYPEMASK 7
|
|
||||||
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */
|
|
||||||
#define PNG_LIBPNG_BUILD_TYPE 2
|
|
||||||
|
|
||||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||||
* We must not include leading zeros.
|
* We must not include leading zeros.
|
||||||
@ -287,9 +277,14 @@
|
|||||||
/* include the compression library's header */
|
/* include the compression library's header */
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
|
|
||||||
/* include all user configurable info, including optional assembler routines */
|
/* include all user configurable info */
|
||||||
#include "pngconf.h"
|
#include "pngconf.h"
|
||||||
|
|
||||||
|
/* macros for optional assembler routines */
|
||||||
|
#if defined(PNG_INTERNAL) && defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||||
|
# include "pngasmrd.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
|
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -443,7 +438,7 @@ typedef png_text FAR * FAR * png_textpp;
|
|||||||
* Two conversions are provided, both from time_t and struct tm. There
|
* Two conversions are provided, both from time_t and struct tm. There
|
||||||
* is no portable way to convert to either of these structures, as far
|
* is no portable way to convert to either of these structures, as far
|
||||||
* as I know. If you know of a portable way, send it to me. As a side
|
* as I know. If you know of a portable way, send it to me. As a side
|
||||||
* note - PNG has always been Year 2000 compliant!
|
* note - PNG is Year 2000 compliant!
|
||||||
*/
|
*/
|
||||||
typedef struct png_time_struct
|
typedef struct png_time_struct
|
||||||
{
|
{
|
||||||
@ -501,20 +496,20 @@ typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
|
|||||||
* The following members may have allocated storage attached that should be
|
* The following members may have allocated storage attached that should be
|
||||||
* cleaned up before the structure is discarded: palette, trans, text,
|
* cleaned up before the structure is discarded: palette, trans, text,
|
||||||
* pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
|
* pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
|
||||||
* splt_palettes, scal_unit, row_pointers, and unknowns. By default, these
|
* splt_palettes, scal_unit, row_pointers, and unknowns. By default, these are
|
||||||
* are automatically freed when the info structure is deallocated, if they were
|
* automatically freed when the info structure is deallocated, if they were
|
||||||
* allocated internally by libpng. This behavior can be changed by means
|
* allocated internally by libpng. This behavior can be changed by means
|
||||||
* of the png_data_freer() function.
|
* of the png_data_freer() function.
|
||||||
*
|
*
|
||||||
* More allocation details: all the chunk-reading functions that
|
* More allocation details: all the chunk-reading functions that change these
|
||||||
* change these members go through the corresponding png_set_*
|
* members go through the corresponding png_set_* functions. A function to
|
||||||
* functions. A function to clear these members is available: see
|
* clear these members is available: see png_free_data(). Some of the
|
||||||
* png_free_data(). The png_set_* functions do not depend on being
|
* png_set_* functions do not depend on being able to point info structure
|
||||||
* able to point info structure members to any of the storage they are
|
* members to any of the storage they are passed (they make their own copies),
|
||||||
* passed (they make their own copies), EXCEPT that the png_set_text
|
* EXCEPT that the png_set_text functions use the same storage passed to them
|
||||||
* functions use the same storage passed to them in the text_ptr or
|
* in the text_ptr or itxt_ptr structure argument, and the png_set_tRNS,
|
||||||
* itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
|
* png_set_PLTE, png_set_hIST, png_set_iCCP, png_set_rows, png_set_sPLT,
|
||||||
* functions do not make their own copies.
|
* and png_set_unknowns do not make their own copies.
|
||||||
*/
|
*/
|
||||||
typedef struct png_info_struct
|
typedef struct png_info_struct
|
||||||
{
|
{
|
||||||
@ -700,7 +695,6 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
|||||||
/* iCCP chunk data. */
|
/* iCCP chunk data. */
|
||||||
png_charp iccp_name; /* profile name */
|
png_charp iccp_name; /* profile name */
|
||||||
png_charp iccp_profile; /* International Color Consortium profile data */
|
png_charp iccp_profile; /* International Color Consortium profile data */
|
||||||
/* Note to maintainer: should be png_bytep */
|
|
||||||
png_uint_32 iccp_proflen; /* ICC profile data length */
|
png_uint_32 iccp_proflen; /* ICC profile data length */
|
||||||
png_byte iccp_compression; /* Always zero */
|
png_byte iccp_compression; /* Always zero */
|
||||||
#endif
|
#endif
|
||||||
@ -781,7 +775,6 @@ typedef png_info FAR * FAR * png_infopp;
|
|||||||
|
|
||||||
/* This is for filter type. PNG 1.0-1.2 only define the single type. */
|
/* This is for filter type. PNG 1.0-1.2 only define the single type. */
|
||||||
#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */
|
#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */
|
||||||
#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */
|
|
||||||
#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE
|
#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE
|
||||||
|
|
||||||
/* These are for the interlacing type. These values should NOT be changed. */
|
/* These are for the interlacing type. These values should NOT be changed. */
|
||||||
@ -822,8 +815,6 @@ typedef png_info FAR * FAR * png_infopp;
|
|||||||
/* This is for text chunks */
|
/* This is for text chunks */
|
||||||
#define PNG_KEYWORD_MAX_LENGTH 79
|
#define PNG_KEYWORD_MAX_LENGTH 79
|
||||||
|
|
||||||
/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
|
|
||||||
#define PNG_MAX_PALETTE_LENGTH 256
|
|
||||||
|
|
||||||
/* These determine if an ancillary chunk's data has been successfully read
|
/* These determine if an ancillary chunk's data has been successfully read
|
||||||
* from the PNG header, or if the application has filled in the corresponding
|
* from the PNG header, or if the application has filled in the corresponding
|
||||||
@ -919,8 +910,7 @@ typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp));
|
|||||||
|
|
||||||
/* Flags for MNG supported features */
|
/* Flags for MNG supported features */
|
||||||
#define PNG_FLAG_MNG_EMPTY_PLTE 0x01
|
#define PNG_FLAG_MNG_EMPTY_PLTE 0x01
|
||||||
#define PNG_FLAG_MNG_FILTER_64 0x04
|
#define PNG_ALL_MNG_FEATURES 0x01
|
||||||
#define PNG_ALL_MNG_FEATURES 0x05
|
|
||||||
|
|
||||||
typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t));
|
typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t));
|
||||||
typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp));
|
typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp));
|
||||||
@ -1166,15 +1156,12 @@ struct png_struct_def
|
|||||||
png_fixed_point int_gamma;
|
png_fixed_point int_gamma;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
png_byte filter_type;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* This prevents a compiler error in png_get_copyright() in png.c if png.c
|
/* This prevents a compiler error in png_get_copyright() in png.c if png.c
|
||||||
and png.h are both at * version 1.0.9beta10
|
and png.h are both at * version 1.0.9beta2
|
||||||
*/
|
*/
|
||||||
typedef png_structp version_1_0_9beta10;
|
typedef png_structp version_1_0_9beta2;
|
||||||
|
|
||||||
typedef png_struct FAR * FAR * png_structpp;
|
typedef png_struct FAR * FAR * png_structpp;
|
||||||
|
|
||||||
@ -2026,14 +2013,12 @@ extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
|
|||||||
extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr, png_charpp name, int *compression_type,
|
png_infop info_ptr, png_charpp name, int *compression_type,
|
||||||
png_charpp profile, png_uint_32 *proflen));
|
png_charpp profile, png_uint_32 *proflen));
|
||||||
/* Note to maintainer: profile should be png_bytepp */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_iCCP_SUPPORTED)
|
#if defined(PNG_iCCP_SUPPORTED)
|
||||||
extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr, png_charp name, int compression_type,
|
png_infop info_ptr, png_charp name, int compression_type,
|
||||||
png_charp profile, png_uint_32 proflen));
|
png_charp profile, png_uint_32 proflen));
|
||||||
/* Note to maintainer: profile should be png_bytep */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_sPLT_SUPPORTED)
|
#if defined(PNG_READ_sPLT_SUPPORTED)
|
||||||
@ -2214,13 +2199,8 @@ extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
|
|||||||
png_ptr, png_uint_32 mng_features_permitted));
|
png_ptr, png_uint_32 mng_features_permitted));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* png.c, pnggccrd.c, or pngvcrd.c */
|
|
||||||
extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
|
|
||||||
|
|
||||||
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
|
|
||||||
|
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING \
|
||||||
" libpng version 1.0.9beta10 - January 16, 2001 (header)\n"
|
" libpng version 1.0.9beta2 - November 19, 2000 (header)\n"
|
||||||
|
|
||||||
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
||||||
/* With these routines we avoid an integer divide, which will be slower on
|
/* With these routines we avoid an integer divide, which will be slower on
|
||||||
@ -2286,7 +2266,6 @@ extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
|
|||||||
#define PNG_WROTE_tIME 0x200
|
#define PNG_WROTE_tIME 0x200
|
||||||
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
|
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
|
||||||
#define PNG_BACKGROUND_IS_GRAY 0x800
|
#define PNG_BACKGROUND_IS_GRAY 0x800
|
||||||
#define PNG_HAVE_PNG_SIGNATURE 0x1000
|
|
||||||
|
|
||||||
/* flags for the transformations the PNG library does on the image data */
|
/* flags for the transformations the PNG library does on the image data */
|
||||||
#define PNG_BGR 0x0001
|
#define PNG_BGR 0x0001
|
||||||
@ -2448,7 +2427,7 @@ PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf));
|
|||||||
#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
|
#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
|
||||||
|
|
||||||
/* Initialize png_ptr struct for reading, and allocate any other memory.
|
/* Initialize png_ptr struct for reading, and allocate any other memory.
|
||||||
* (old interface - DEPRECATED - use png_create_read_struct instead).
|
* (old interface - DEPRECATED).
|
||||||
*/
|
*/
|
||||||
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
|
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
|
||||||
#define png_read_init(png_ptr) png_read_init_2(png_ptr, \
|
#define png_read_init(png_ptr) png_read_init_2(png_ptr, \
|
||||||
@ -2458,7 +2437,7 @@ extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
|
|||||||
png_info_size));
|
png_info_size));
|
||||||
|
|
||||||
/* Initialize png_ptr struct for writing, and allocate any other memory.
|
/* Initialize png_ptr struct for writing, and allocate any other memory.
|
||||||
* (old interface - DEPRECATED - use png_create_write_struct instead).
|
* (old interface - DEPRECATED).
|
||||||
*/
|
*/
|
||||||
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
|
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
|
||||||
#define png_write_init(png_ptr) png_write_init_2(png_ptr, \
|
#define png_write_init(png_ptr) png_write_init_2(png_ptr, \
|
||||||
@ -2605,7 +2584,6 @@ PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
|
|||||||
PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
|
||||||
png_charp name, int compression_type,
|
png_charp name, int compression_type,
|
||||||
png_charp profile, int proflen));
|
png_charp profile, int proflen));
|
||||||
/* Note to maintainer: profile should be png_bytep */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_WRITE_sPLT_SUPPORTED)
|
#if defined(PNG_WRITE_sPLT_SUPPORTED)
|
||||||
@ -2700,15 +2678,10 @@ PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
|
|||||||
|
|
||||||
#if defined(PNG_READ_INTERLACING_SUPPORTED)
|
#if defined(PNG_READ_INTERLACING_SUPPORTED)
|
||||||
/* expand an interlaced row */
|
/* expand an interlaced row */
|
||||||
/* OLD interface:
|
|
||||||
PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
|
PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
|
||||||
png_bytep row, int pass, png_uint_32 transformations));
|
png_bytep row, int pass, png_uint_32 transformations));
|
||||||
*/
|
|
||||||
PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */
|
|
||||||
|
|
||||||
#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
|
#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
|
||||||
/* grab pixels out of a row for an interlaced pass */
|
/* grab pixels out of a row for an interlaced pass */
|
||||||
PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
|
PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
|
||||||
@ -3013,15 +2986,6 @@ PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
|
|||||||
|
|
||||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
|
||||||
PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
|
|
||||||
png_bytep row));
|
|
||||||
PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
|
|
||||||
png_bytep row));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
|
||||||
|
|
||||||
#endif /* PNG_INTERNAL */
|
#endif /* PNG_INTERNAL */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
36
pngasmrd.h
36
pngasmrd.h
@ -1,11 +1,39 @@
|
|||||||
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 2001 Glenn Randers-Pehrson
|
* Copyright (c) 1999, 2000 Glenn Randers-Pehrson
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This file is obsolete in libpng-1.0.9 and later; its contents now appear
|
#ifndef PNGASMRD_H
|
||||||
* at the end of pngconf.h.
|
#define PNGASMRD_H
|
||||||
|
|
||||||
|
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||||
|
|
||||||
|
/* Set this in the makefile for VC++ on Pentium, not in pngconf.h */
|
||||||
|
/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c .
|
||||||
|
* MMX will be detected at run time and used if present.
|
||||||
*/
|
*/
|
||||||
|
#ifdef PNG_USE_PNGVCRD
|
||||||
|
# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
||||||
|
# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
|
||||||
|
# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Set this in the makefile for gcc/as on Pentium, not in pngconf.h */
|
||||||
|
/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c .
|
||||||
|
* MMX will be detected at run time and used if present.
|
||||||
|
*/
|
||||||
|
#ifdef PNG_USE_PNGGCCRD
|
||||||
|
# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
||||||
|
# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
|
||||||
|
# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
GRR notes:
|
||||||
|
- see pnggccrd.c for info about what is currently enabled
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif /* PNGASMRD_H */
|
||||||
|
81
pngconf.h
81
pngconf.h
@ -1,8 +1,8 @@
|
|||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -233,7 +233,6 @@
|
|||||||
|
|
||||||
/* Other defines for things like memory and the like can go here. */
|
/* Other defines for things like memory and the like can go here. */
|
||||||
#ifdef PNG_INTERNAL
|
#ifdef PNG_INTERNAL
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
|
/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
|
||||||
@ -484,22 +483,18 @@
|
|||||||
#define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
|
#define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
|
||||||
#endif /* about interlacing capability! You'll */
|
#endif /* about interlacing capability! You'll */
|
||||||
/* still have interlacing unless you change the following line: */
|
/* still have interlacing unless you change the following line: */
|
||||||
|
|
||||||
#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
|
#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
|
||||||
|
|
||||||
#ifndef PNG_NO_READ_COMPOSITE_NODIV
|
#ifndef PNG_NO_READ_COMPOSITE_NODIV
|
||||||
#ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
|
#ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
|
||||||
# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */
|
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel and SGI */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Disable if you don't need to support PNGs that are embedded in MNG
|
|
||||||
datastreams */
|
|
||||||
#ifndef PNG_NO_MNG_FEATURES
|
#ifndef PNG_NO_MNG_FEATURES
|
||||||
# define PNG_MNG_FEATURES_SUPPORTED
|
#define PNG_MNG_FEATURES_SUPPORTED /* Useful for MNG applications */
|
||||||
#endif
|
#endif
|
||||||
|
/* Deprecated, will be removed */
|
||||||
/* Deprecated, will be removed from version 2.0.0 */
|
|
||||||
#ifndef PNG_NO_READ_EMPTY_PLTE
|
#ifndef PNG_NO_READ_EMPTY_PLTE
|
||||||
#define PNG_READ_EMPTY_PLTE_SUPPORTED
|
#define PNG_READ_EMPTY_PLTE_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
@ -524,7 +519,7 @@
|
|||||||
#define PNG_WRITE_INVERT_SUPPORTED
|
#define PNG_WRITE_INVERT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PNG_NO_WRITE_FILLER
|
#ifndef PNG_NO_WRITE_FILLER
|
||||||
# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
|
#define PNG_WRITE_FILLER_SUPPORTED /* This is the same as WRITE_STRIP_ALPHA */
|
||||||
#endif
|
#endif
|
||||||
#ifndef PNG_NO_WRITE_SWAP_ALPHA
|
#ifndef PNG_NO_WRITE_SWAP_ALPHA
|
||||||
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||||
@ -586,13 +581,9 @@
|
|||||||
#define PNG_EASY_ACCESS_SUPPORTED
|
#define PNG_EASY_ACCESS_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* PNG_ASSEMBLER_CODE will be enabled by default in version 1.2.0
|
#if defined(PNG_USE_PNGVCRD) || defined(PNG_USE_PNGGCCRD) && \
|
||||||
even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */
|
!defined(PNG_NO_ASSEMBLER_CODE)
|
||||||
#ifndef PNG_NO_ASSEMBLER_CODE
|
|
||||||
# if defined(PNG_USE_PNGVCRD) || defined(PNG_USE_PNGGCCRD)
|
|
||||||
#define PNG_ASSEMBLER_CODE_SUPPORTED
|
#define PNG_ASSEMBLER_CODE_SUPPORTED
|
||||||
# define PNG_MMX_CODE_SUPPORTED
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These are currently experimental features, define them if you want */
|
/* These are currently experimental features, define them if you want */
|
||||||
@ -743,11 +734,9 @@
|
|||||||
# define PNG_READ_TEXT_SUPPORTED
|
# define PNG_READ_TEXT_SUPPORTED
|
||||||
# define PNG_TEXT_SUPPORTED
|
# define PNG_TEXT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
|
#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
|
#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
|
||||||
|
|
||||||
#ifdef PNG_NO_WRITE_TEXT
|
#ifdef PNG_NO_WRITE_TEXT
|
||||||
# define PNG_NO_WRITE_iTXt
|
# define PNG_NO_WRITE_iTXt
|
||||||
# define PNG_NO_WRITE_tEXt
|
# define PNG_NO_WRITE_tEXt
|
||||||
@ -873,7 +862,6 @@
|
|||||||
# define PNG_TEXT_SUPPORTED
|
# define PNG_TEXT_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
|
#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
|
||||||
|
|
||||||
/* Turn this off to disable png_read_png() and
|
/* Turn this off to disable png_read_png() and
|
||||||
@ -928,7 +916,7 @@ typedef size_t png_size_t;
|
|||||||
#else
|
#else
|
||||||
#define LDATA 0
|
#define LDATA 0
|
||||||
#endif
|
#endif
|
||||||
/* GRR: why is Cygwin in here? Cygwin is not Borland C... */
|
|
||||||
#if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
|
#if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
|
||||||
#define PNG_MAX_MALLOC_64K
|
#define PNG_MAX_MALLOC_64K
|
||||||
#if (LDATA != 1)
|
#if (LDATA != 1)
|
||||||
@ -937,12 +925,14 @@ typedef size_t png_size_t;
|
|||||||
#endif
|
#endif
|
||||||
#define USE_FAR_KEYWORD
|
#define USE_FAR_KEYWORD
|
||||||
#endif /* LDATA != 1 */
|
#endif /* LDATA != 1 */
|
||||||
|
|
||||||
/* Possibly useful for moving data out of default segment.
|
/* Possibly useful for moving data out of default segment.
|
||||||
* Uncomment it if you want. Could also define FARDATA as
|
* Uncomment it if you want. Could also define FARDATA as
|
||||||
* const if your compiler supports it. (SJT)
|
* const if your compiler supports it. (SJT)
|
||||||
# define FARDATA FAR
|
# define FARDATA FAR
|
||||||
*/
|
*/
|
||||||
#endif /* __WIN32__, __FLAT__, __CYGWIN__ */
|
#endif /* __WIN32__, __FLAT__, __CYGWIN__ */
|
||||||
|
|
||||||
#endif /* __BORLANDC__ */
|
#endif /* __BORLANDC__ */
|
||||||
|
|
||||||
|
|
||||||
@ -984,15 +974,11 @@ typedef png_int_16 FAR * png_int_16p;
|
|||||||
typedef PNG_CONST char FAR * png_const_charp;
|
typedef PNG_CONST char FAR * png_const_charp;
|
||||||
typedef char FAR * png_charp;
|
typedef char FAR * png_charp;
|
||||||
typedef png_fixed_point FAR * png_fixed_point_p;
|
typedef png_fixed_point FAR * png_fixed_point_p;
|
||||||
|
|
||||||
#ifndef PNG_NO_STDIO
|
|
||||||
#if defined(_WIN32_WCE)
|
#if defined(_WIN32_WCE)
|
||||||
typedef HANDLE png_FILE_p;
|
typedef HANDLE png_FILE_p;
|
||||||
#else
|
#else
|
||||||
typedef FILE * png_FILE_p;
|
typedef FILE * png_FILE_p;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||||
typedef double FAR * png_doublep;
|
typedef double FAR * png_doublep;
|
||||||
#endif
|
#endif
|
||||||
@ -1010,7 +996,7 @@ typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
|
|||||||
typedef double FAR * FAR * png_doublepp;
|
typedef double FAR * FAR * png_doublepp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Pointers to pointers to pointers; i.e., pointer to array */
|
/* Pointers to pointers to pointers; i.e. pointer to array */
|
||||||
typedef char FAR * FAR * FAR * png_charppp;
|
typedef char FAR * FAR * FAR * png_charppp;
|
||||||
|
|
||||||
/* libpng typedefs for types in zlib. If zlib changes
|
/* libpng typedefs for types in zlib. If zlib changes
|
||||||
@ -1078,9 +1064,9 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef PNGAPI
|
#ifndef PNGAPI
|
||||||
|
|
||||||
|
|
||||||
#if defined(__MINGW32__) || defined(__CYGWIN__) && !defined(PNG_MODULEDEF)
|
#if defined(__MINGW32__) || defined(__CYGWIN__) && !defined(PNG_MODULEDEF)
|
||||||
# ifndef PNG_NO_MODULEDEF
|
# ifndef PNG_NO_MODULEDEF
|
||||||
# define PNG_NO_MODULEDEF
|
# define PNG_NO_MODULEDEF
|
||||||
@ -1096,7 +1082,7 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
|
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
|
||||||
) && !defined(__CYGWIN__))
|
) && !defined(__CYGWIN__))
|
||||||
|
|
||||||
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
|
# ifdef __GNUC__
|
||||||
# define PNGAPI __cdecl
|
# define PNGAPI __cdecl
|
||||||
# else
|
# else
|
||||||
# define PNGAPI _cdecl
|
# define PNGAPI _cdecl
|
||||||
@ -1214,44 +1200,5 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
#define PNG_ZBUF_SIZE 65536
|
#define PNG_ZBUF_SIZE 65536
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Prior to libpng-1.0.9, this block was in pngasmrd.h */
|
|
||||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_INTERNAL)
|
|
||||||
|
|
||||||
/* These are the default thresholds before the MMX code kicks in; if either
|
|
||||||
* rowbytes or bitdepth is below the threshold, plain C code is used. These
|
|
||||||
* can be overridden at runtime via the png_set_mmx_thresholds() call in
|
|
||||||
* libpng 1.2.0 and later. The values below were chosen by Intel.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
|
|
||||||
# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */
|
|
||||||
#endif
|
|
||||||
#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
|
|
||||||
# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set this in the makefile for VC++ on Pentium, not here. */
|
|
||||||
/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c .
|
|
||||||
* MMX will be detected at run time and used if present.
|
|
||||||
*/
|
|
||||||
#ifdef PNG_USE_PNGVCRD
|
|
||||||
# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
|
||||||
# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
|
|
||||||
# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set this in the makefile for gcc/as on Pentium, not here. */
|
|
||||||
/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c .
|
|
||||||
* MMX will be detected at run time and used if present.
|
|
||||||
*/
|
|
||||||
#ifdef PNG_USE_PNGGCCRD
|
|
||||||
# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
|
||||||
# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
|
|
||||||
# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
|
||||||
#endif
|
|
||||||
/* - see pnggccrd.c for info about what is currently enabled */
|
|
||||||
|
|
||||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
|
||||||
|
|
||||||
#endif /* PNGCONF_H */
|
#endif /* PNGCONF_H */
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngerror.c - stub functions for i/o and memory allocation
|
/* pngerror.c - stub functions for i/o and memory allocation
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -99,7 +99,7 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp message
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_chunk_error(png_structp png_ptr, png_const_charp message)
|
png_chunk_error(png_structp png_ptr, png_const_charp message)
|
||||||
{
|
{
|
||||||
char msg[18+64];
|
char msg[16+64];
|
||||||
png_format_buffer(png_ptr, msg, message);
|
png_format_buffer(png_ptr, msg, message);
|
||||||
png_error(png_ptr, msg);
|
png_error(png_ptr, msg);
|
||||||
}
|
}
|
||||||
|
221
pnggccrd.c
221
pnggccrd.c
@ -6,14 +6,14 @@
|
|||||||
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
|
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
|
||||||
* for Intel's performance analysis of the MMX vs. non-MMX code.
|
* for Intel's performance analysis of the MMX vs. non-MMX code.
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998, Intel Corporation
|
* Copyright (c) 1998, Intel Corporation
|
||||||
*
|
*
|
||||||
* Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998.
|
* Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998.
|
||||||
* Interface to libpng contributed by Gilles Vollant, 1999.
|
* Interface to libpng contributed by Gilles Vollant, 1999.
|
||||||
* GNU C port by Greg Roelofs, 1999-2001.
|
* GNU C port by Greg Roelofs, 1999-2000.
|
||||||
*
|
*
|
||||||
* Lines 2350-4300 converted in place with intel2gas 1.3.1:
|
* Lines 2350-4300 converted in place with intel2gas 1.3.1:
|
||||||
*
|
*
|
||||||
@ -203,15 +203,6 @@
|
|||||||
* - "_ShiftRem.use = 40;" should have been "_ShiftRem.use = 48;"
|
* - "_ShiftRem.use = 40;" should have been "_ShiftRem.use = 48;"
|
||||||
* - "psllq _ShiftRem, %%mm2" should have been "psrlq _ShiftRem, %%mm2"
|
* - "psllq _ShiftRem, %%mm2" should have been "psrlq _ShiftRem, %%mm2"
|
||||||
*
|
*
|
||||||
* 20010103:
|
|
||||||
* - renamed mmxsupport() to png_mmx_support(), with auto-set of mmx_supported,
|
|
||||||
* and made it public
|
|
||||||
*
|
|
||||||
* 20010104:
|
|
||||||
* - removed dependency on png_read_filter_row_c() (C code already duplicated
|
|
||||||
* within MMX version of png_read_filter_row()) so no longer necessary to
|
|
||||||
* compile it into pngrutil.o
|
|
||||||
*
|
|
||||||
* STILL TO DO:
|
* STILL TO DO:
|
||||||
* - test png_do_read_interlace() 64-bit case (pixel_bytes == 8)
|
* - test png_do_read_interlace() 64-bit case (pixel_bytes == 8)
|
||||||
* - write MMX code for 48-bit case (pixel_bytes == 6)
|
* - write MMX code for 48-bit case (pixel_bytes == 6)
|
||||||
@ -220,7 +211,7 @@
|
|||||||
* (only width_mmx case) (near line 1606)
|
* (only width_mmx case) (near line 1606)
|
||||||
* - rewrite all MMX interlacing code so it's aligned with beginning
|
* - rewrite all MMX interlacing code so it's aligned with beginning
|
||||||
* of the row buffer, not the end (see 19991007 for details)
|
* of the row buffer, not the end (see 19991007 for details)
|
||||||
* x pick one version of mmxsupport() and get rid of the other
|
* - pick one version of mmxsupport() and get rid of the other
|
||||||
* - add error messages to any remaining bogus default cases
|
* - add error messages to any remaining bogus default cases
|
||||||
* - enable pixel_depth == 8 cases in png_read_filter_row()? (test speed)
|
* - enable pixel_depth == 8 cases in png_read_filter_row()? (test speed)
|
||||||
* - add support for runtime enable/disable/query of various MMX routines
|
* - add support for runtime enable/disable/query of various MMX routines
|
||||||
@ -233,6 +224,10 @@
|
|||||||
|
|
||||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGGCCRD)
|
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGGCCRD)
|
||||||
|
|
||||||
|
int mmxsupport(void);
|
||||||
|
|
||||||
|
static int mmx_supported = 2;
|
||||||
|
|
||||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||||
static const int FARDATA png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
static const int FARDATA png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||||
static const int FARDATA png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
static const int FARDATA png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
@ -242,7 +237,6 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
|||||||
// djgpp, Win32, and Cygwin add their own underscores to global variables,
|
// djgpp, Win32, and Cygwin add their own underscores to global variables,
|
||||||
// so define them without:
|
// so define them without:
|
||||||
#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__)
|
#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__)
|
||||||
# define _mmx_supported mmx_supported
|
|
||||||
# define _unmask unmask
|
# define _unmask unmask
|
||||||
# define _const4 const4
|
# define _const4 const4
|
||||||
# define _const6 const6
|
# define _const6 const6
|
||||||
@ -277,8 +271,6 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
|||||||
# define _pctemp pctemp
|
# define _pctemp pctemp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int _mmx_supported = 2;
|
|
||||||
|
|
||||||
/* These constants are used in the inlined MMX assembly code.
|
/* These constants are used in the inlined MMX assembly code.
|
||||||
Ignore gcc's "At top level: defined but not used" warnings. */
|
Ignore gcc's "At top level: defined but not used" warnings. */
|
||||||
|
|
||||||
@ -326,6 +318,11 @@ static int _pbtemp;
|
|||||||
static int _pctemp;
|
static int _pctemp;
|
||||||
|
|
||||||
|
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_read_filter_row_c(png_structp png_ptr, png_row_infop row_info,
|
||||||
|
png_bytep row, png_bytep prev_row, int filter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================//
|
//===========================================================================//
|
||||||
@ -355,16 +352,16 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
{
|
{
|
||||||
png_debug(1,"in png_combine_row_asm\n");
|
png_debug(1,"in png_combine_row_asm\n");
|
||||||
|
|
||||||
if (_mmx_supported == 2) {
|
if (mmx_supported == 2)
|
||||||
png_mmx_support();
|
mmx_supported = mmxsupport();
|
||||||
}
|
|
||||||
|
|
||||||
if (mask == 0xff)
|
if (mask == 0xff)
|
||||||
{
|
{
|
||||||
png_memcpy(row, png_ptr->row_buf + 1,
|
png_memcpy(row, png_ptr->row_buf + 1,
|
||||||
(png_size_t)((png_ptr->width * png_ptr->row_info.pixel_depth + 7) >> 3));
|
(png_size_t)((png_ptr->width * png_ptr->row_info.pixel_depth + 7) >> 3));
|
||||||
}
|
}
|
||||||
/* GRR: png_combine_row() never called with mask == 0 */
|
/* GRR: add "else if (mask == 0)" case?
|
||||||
|
* or does png_combine_row() not even get called in that case? */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (png_ptr->row_info.pixel_depth)
|
switch (png_ptr->row_info.pixel_depth)
|
||||||
@ -540,7 +537,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
png_bytep srcptr;
|
png_bytep srcptr;
|
||||||
png_bytep dstptr;
|
png_bytep dstptr;
|
||||||
|
|
||||||
if ( _mmx_supported )
|
if (mmx_supported)
|
||||||
{
|
{
|
||||||
png_uint_32 len;
|
png_uint_32 len;
|
||||||
int diff;
|
int diff;
|
||||||
@ -656,7 +653,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
png_bytep srcptr;
|
png_bytep srcptr;
|
||||||
png_bytep dstptr;
|
png_bytep dstptr;
|
||||||
|
|
||||||
if ( _mmx_supported )
|
if (mmx_supported)
|
||||||
{
|
{
|
||||||
png_uint_32 len;
|
png_uint_32 len;
|
||||||
int diff;
|
int diff;
|
||||||
@ -788,7 +785,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
png_bytep srcptr;
|
png_bytep srcptr;
|
||||||
png_bytep dstptr;
|
png_bytep dstptr;
|
||||||
|
|
||||||
if ( _mmx_supported )
|
if (mmx_supported)
|
||||||
{
|
{
|
||||||
png_uint_32 len;
|
png_uint_32 len;
|
||||||
int diff;
|
int diff;
|
||||||
@ -935,7 +932,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
png_bytep srcptr;
|
png_bytep srcptr;
|
||||||
png_bytep dstptr;
|
png_bytep dstptr;
|
||||||
|
|
||||||
if ( _mmx_supported )
|
if (mmx_supported)
|
||||||
{
|
{
|
||||||
png_uint_32 len;
|
png_uint_32 len;
|
||||||
int diff;
|
int diff;
|
||||||
@ -1089,7 +1086,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
png_bytep srcptr;
|
png_bytep srcptr;
|
||||||
png_bytep dstptr;
|
png_bytep dstptr;
|
||||||
|
|
||||||
if ( _mmx_supported )
|
if (mmx_supported)
|
||||||
{
|
{
|
||||||
png_uint_32 len;
|
png_uint_32 len;
|
||||||
int diff;
|
int diff;
|
||||||
@ -1314,18 +1311,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_do_read_interlace(png_structp png_ptr)
|
png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
|
||||||
|
png_uint_32 transformations)
|
||||||
{
|
{
|
||||||
png_row_infop row_info = &(png_ptr->row_info);
|
|
||||||
png_bytep row = png_ptr->row_buf + 1;
|
|
||||||
int pass = png_ptr->pass;
|
|
||||||
png_uint_32 transformations = png_ptr->transformations;
|
|
||||||
|
|
||||||
png_debug(1,"in png_do_read_interlace\n");
|
png_debug(1,"in png_do_read_interlace\n");
|
||||||
|
|
||||||
if (_mmx_supported == 2) {
|
if (mmx_supported == 2)
|
||||||
png_mmx_support();
|
mmx_supported = mmxsupport();
|
||||||
}
|
|
||||||
|
|
||||||
if (row != NULL && row_info != NULL)
|
if (row != NULL && row_info != NULL)
|
||||||
{
|
{
|
||||||
@ -1528,7 +1520,7 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
|
|
||||||
// New code by Nirav Chhatrapati - Intel Corporation
|
// New code by Nirav Chhatrapati - Intel Corporation
|
||||||
|
|
||||||
if ( _mmx_supported )
|
if (mmx_supported) // use MMX code if machine supports it
|
||||||
{
|
{
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
if (pixel_bytes == 3)
|
if (pixel_bytes == 3)
|
||||||
@ -2406,7 +2398,7 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
sptr-= pixel_bytes;
|
sptr-= pixel_bytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end of _mmx_supported ========================================
|
} // end of mmx_supported =========================================
|
||||||
|
|
||||||
else /* MMX not supported: use modified C code - takes advantage
|
else /* MMX not supported: use modified C code - takes advantage
|
||||||
* of inlining of memcpy for a constant */
|
* of inlining of memcpy for a constant */
|
||||||
@ -4757,32 +4749,43 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
row, png_bytep prev_row, int filter)
|
row, png_bytep prev_row, int filter)
|
||||||
{
|
{
|
||||||
#ifdef PNG_DEBUG
|
#ifdef PNG_DEBUG
|
||||||
char filnm[10];
|
char filnm[6];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* GRR: these are superseded by png_ptr->asm_flags: */
|
#define UseMMX 1
|
||||||
|
|
||||||
#define UseMMX_sub 1 // GRR: converted 20000730
|
#define UseMMX_sub 1 // GRR: converted 20000730
|
||||||
#define UseMMX_up 1 // GRR: converted 20000729
|
#define UseMMX_up 1 // GRR: converted 20000729
|
||||||
#define UseMMX_avg 1 // GRR: converted 20000828 (+ 16-bit bugfix 20000916)
|
#define UseMMX_avg 1 // GRR: converted 20000828 (+ 16-bit bugfix 20000916)
|
||||||
#define UseMMX_paeth 1 // GRR: converted 20000828
|
#define UseMMX_paeth 1 // GRR: converted 20000828
|
||||||
|
|
||||||
if (_mmx_supported == 2) {
|
if (mmx_supported == 2)
|
||||||
png_mmx_support();
|
mmx_supported = mmxsupport();
|
||||||
|
|
||||||
|
if (!mmx_supported)
|
||||||
|
{
|
||||||
|
png_read_filter_row_c(png_ptr, row_info, row, prev_row, filter);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PNG_DEBUG
|
#ifdef PNG_DEBUG
|
||||||
png_debug(1, "in png_read_filter_row\n");
|
png_debug(1, "in png_read_filter_row\n");
|
||||||
|
#if (UseMMX == 1)
|
||||||
|
png_debug1(0,"%s, ", "MMX");
|
||||||
|
#else
|
||||||
|
png_debug1(0,"%s, ", "x86");
|
||||||
|
#endif
|
||||||
switch (filter)
|
switch (filter)
|
||||||
{
|
{
|
||||||
case 0: sprintf(filnm, "none");
|
case 0: sprintf(filnm, "none");
|
||||||
break;
|
break;
|
||||||
case 1: sprintf(filnm, "sub-%s", "MMX");
|
case 1: sprintf(filnm, "sub");
|
||||||
break;
|
break;
|
||||||
case 2: sprintf(filnm, "up-%s", "MMX");
|
case 2: sprintf(filnm, "up");
|
||||||
break;
|
break;
|
||||||
case 3: sprintf(filnm, "avg-%s", "MMX");
|
case 3: sprintf(filnm, "avg");
|
||||||
break;
|
break;
|
||||||
case 4: sprintf(filnm, "Paeth-%s", "MMX");
|
case 4: sprintf(filnm, "Paeth");
|
||||||
break;
|
break;
|
||||||
default: sprintf(filnm, "unknw");
|
default: sprintf(filnm, "unknw");
|
||||||
break;
|
break;
|
||||||
@ -4792,7 +4795,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
png_debug2(0, "pixdepth=%2d, bytes=%d, ", (int)row_info->pixel_depth,
|
png_debug2(0, "pixdepth=%2d, bytes=%d, ", (int)row_info->pixel_depth,
|
||||||
(int)((row_info->pixel_depth + 7) >> 3));
|
(int)((row_info->pixel_depth + 7) >> 3));
|
||||||
png_debug1(0,"rowbytes=%8ld\n", row_info->rowbytes);
|
png_debug1(0,"rowbytes=%8ld\n", row_info->rowbytes);
|
||||||
#endif /* PNG_DEBUG */
|
#endif
|
||||||
|
|
||||||
switch (filter)
|
switch (filter)
|
||||||
{
|
{
|
||||||
@ -4800,13 +4803,13 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_SUB:
|
case PNG_FILTER_VALUE_SUB:
|
||||||
if (
|
#if (UseMMX_sub == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) && (row_info->rowbytes >= 128))
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_sub(row_info, row);
|
png_read_filter_row_mmx_sub(row_info, row);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 istop = row_info->rowbytes;
|
png_uint_32 istop = row_info->rowbytes;
|
||||||
@ -4823,35 +4826,33 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_UP:
|
case PNG_FILTER_VALUE_UP:
|
||||||
if (
|
#if (UseMMX_up == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) && (row_info->rowbytes >= 128))
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_up(row_info, row, prev_row);
|
png_read_filter_row_mmx_up(row_info, row, prev_row);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
png_bytep rp;
|
||||||
|
png_bytep pp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 istop = row_info->rowbytes;
|
for (i = 0, rp = row, pp = prev_row;
|
||||||
png_bytep rp = row;
|
i < row_info->rowbytes; i++, rp++, pp++)
|
||||||
png_bytep pp = prev_row;
|
|
||||||
|
|
||||||
for (i = 0; i < istop; ++i)
|
|
||||||
{
|
{
|
||||||
*rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
|
*rp = (png_byte)(((int)(*rp) + (int)(*pp)) & 0xff);
|
||||||
rp++;
|
|
||||||
}
|
}
|
||||||
} //end !UseMMX_up
|
} //end !UseMMX_up
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_AVG:
|
case PNG_FILTER_VALUE_AVG:
|
||||||
if (
|
#if (UseMMX_avg == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) && (row_info->rowbytes >= 128))
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_avg(row_info, row, prev_row);
|
png_read_filter_row_mmx_avg(row_info, row, prev_row);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_bytep rp = row;
|
png_bytep rp = row;
|
||||||
@ -4877,13 +4878,13 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_PAETH:
|
case PNG_FILTER_VALUE_PAETH:
|
||||||
if (
|
#if (UseMMX_paeth == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) && (row_info->rowbytes >= 128))
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_bytep rp = row;
|
png_bytep rp = row;
|
||||||
@ -4899,7 +4900,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
rp++;
|
rp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < istop; i++) /* use leftover rp,pp */
|
for (i = 0; i < istop; i++) // use leftover rp,pp
|
||||||
{
|
{
|
||||||
int a, b, c, pa, pb, pc, p;
|
int a, b, c, pa, pb, pc, p;
|
||||||
|
|
||||||
@ -4938,7 +4939,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
png_warning(png_ptr, "Ignoring bad row-filter type");
|
png_warning(png_ptr, "Ignoring bad adaptive filter type");
|
||||||
*row=0;
|
*row=0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -4963,24 +4964,85 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
// [is there a way to signal that a *single* function should
|
// [is there a way to signal that a *single* function should
|
||||||
// not be inlined? is there a way to modify the label for
|
// not be inlined? is there a way to modify the label for
|
||||||
// each inlined instance, e.g., by appending _1, _2, etc.?
|
// each inlined instance, e.g., by appending _1, _2, etc.?
|
||||||
// maybe if don't use leading "." in label name? (nope...sigh)]
|
// maybe if don't use leading "." in label name? (not tested)]
|
||||||
|
|
||||||
int PNGAPI
|
#ifdef ORIG_THAT_USED_TO_CLOBBER_EBX
|
||||||
png_mmx_support(void)
|
|
||||||
|
int mmxsupport(void)
|
||||||
{
|
{
|
||||||
|
int mmx_supported_local = 0;
|
||||||
|
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction
|
|
||||||
"pushl %%ecx \n\t" // so does ecx...
|
|
||||||
"pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux)
|
|
||||||
// ".byte 0x66 \n\t" // convert 16-bit pushf to 32-bit pushfd
|
// ".byte 0x66 \n\t" // convert 16-bit pushf to 32-bit pushfd
|
||||||
// "pushf \n\t" // 16-bit pushf
|
// "pushf \n\t" // save Eflag to stack
|
||||||
"pushfl \n\t" // save Eflag to stack
|
"pushfl \n\t" // save Eflag to stack
|
||||||
"popl %%eax \n\t" // get Eflag from stack into eax
|
"popl %%eax \n\t" // get Eflag from stack into eax
|
||||||
"movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx
|
"movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx
|
||||||
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
||||||
"pushl %%eax \n\t" // save modified Eflag back to stack
|
"pushl %%eax \n\t" // save modified Eflag back to stack
|
||||||
// ".byte 0x66 \n\t" // convert 16-bit popf to 32-bit popfd
|
// ".byte 0x66 \n\t" // convert 16-bit popf to 32-bit popfd
|
||||||
// "popf \n\t" // 16-bit popf
|
// "popf \n\t" // restore modified value to Eflag reg
|
||||||
|
"popfl \n\t" // restore modified value to Eflag reg
|
||||||
|
"pushfl \n\t" // save Eflag to stack
|
||||||
|
"popl %%eax \n\t" // get Eflag from stack
|
||||||
|
"xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag
|
||||||
|
"jz .NOT_SUPPORTED \n\t" // if same, CPUID instr. is not supported
|
||||||
|
|
||||||
|
"xorl %%eax, %%eax \n\t" // set eax to zero
|
||||||
|
// ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode)
|
||||||
|
"cpuid \n\t" // get the CPU identification info
|
||||||
|
"cmpl $1, %%eax \n\t" // make sure eax return non-zero value
|
||||||
|
"jl .NOT_SUPPORTED \n\t" // if eax is zero, MMX is not supported
|
||||||
|
|
||||||
|
"xorl %%eax, %%eax \n\t" // set eax to zero and...
|
||||||
|
"incl %%eax \n\t" // ...increment eax to 1. This pair is
|
||||||
|
// faster than the instruction "mov eax, 1"
|
||||||
|
"cpuid \n\t" // get the CPU identification info again
|
||||||
|
"andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23)
|
||||||
|
"cmpl $0, %%edx \n\t" // 0 = MMX not supported
|
||||||
|
"jz .NOT_SUPPORTED \n\t" // non-zero = yes, MMX IS supported
|
||||||
|
|
||||||
|
"movl $1, %0 \n\t" // set return value to 1 and fall through
|
||||||
|
|
||||||
|
".NOT_SUPPORTED: \n\t" // target label for jump instructions
|
||||||
|
"movl %0, %%eax \n\t" // move return value to eax
|
||||||
|
// DONE
|
||||||
|
|
||||||
|
: "=m" (mmx_supported_local) // %0 (output list: memory only)
|
||||||
|
|
||||||
|
: // any variables used on input (none)
|
||||||
|
|
||||||
|
: "%eax", "%ebx", // clobber list
|
||||||
|
"%ecx", "%edx"
|
||||||
|
// , "memory" // if write to a variable gcc thought was in a reg
|
||||||
|
// , "cc" // "condition codes" (flag bits)
|
||||||
|
);
|
||||||
|
|
||||||
|
//mmx_supported_local=0; // test code for force don't support MMX
|
||||||
|
//printf("MMX : %u (1=MMX supported)\n",mmx_supported_local);
|
||||||
|
|
||||||
|
return mmx_supported_local;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#else /* !ORIG_THAT_USED_TO_CLOBBER_EBX */
|
||||||
|
|
||||||
|
|
||||||
|
int mmxsupport(void)
|
||||||
|
{
|
||||||
|
__asm__ __volatile__ (
|
||||||
|
"pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction
|
||||||
|
"pushl %%ecx \n\t" // so does ecx...
|
||||||
|
"pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux)
|
||||||
|
// ".byte 0x66 \n\t" // convert 16-bit pushf to 32-bit pushfd
|
||||||
|
// "pushf \n\t" // save Eflag to stack
|
||||||
|
"pushfl \n\t" // save Eflag to stack
|
||||||
|
"popl %%eax \n\t" // get Eflag from stack into eax
|
||||||
|
"movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx
|
||||||
|
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
||||||
|
"pushl %%eax \n\t" // save modified Eflag back to stack
|
||||||
|
// ".byte 0x66 \n\t" // convert 16-bit popf to 32-bit popfd
|
||||||
|
// "popf \n\t" // restore modified value to Eflag reg
|
||||||
"popfl \n\t" // restore modified value to Eflag reg
|
"popfl \n\t" // restore modified value to Eflag reg
|
||||||
"pushfl \n\t" // save Eflag to stack
|
"pushfl \n\t" // save Eflag to stack
|
||||||
"popl %%eax \n\t" // get Eflag from stack
|
"popl %%eax \n\t" // get Eflag from stack
|
||||||
@ -5002,7 +5064,6 @@ png_mmx_support(void)
|
|||||||
"jz .NOT_SUPPORTED \n\t" // non-zero = yes, MMX IS supported
|
"jz .NOT_SUPPORTED \n\t" // non-zero = yes, MMX IS supported
|
||||||
|
|
||||||
"movl $1, %%eax \n\t" // set return value to 1
|
"movl $1, %%eax \n\t" // set return value to 1
|
||||||
"movl %%eax, _mmx_supported \n\t" // save in global static variable, too
|
|
||||||
"popl %%edx \n\t" // restore edx
|
"popl %%edx \n\t" // restore edx
|
||||||
"popl %%ecx \n\t" // restore ecx
|
"popl %%ecx \n\t" // restore ecx
|
||||||
"popl %%ebx \n\t" // restore ebx ("row" in png_do_interlace)
|
"popl %%ebx \n\t" // restore ebx ("row" in png_do_interlace)
|
||||||
@ -5010,14 +5071,13 @@ png_mmx_support(void)
|
|||||||
|
|
||||||
".NOT_SUPPORTED: \n\t" // target label for jump instructions
|
".NOT_SUPPORTED: \n\t" // target label for jump instructions
|
||||||
"movl $0, %%eax \n\t" // set return value to 0
|
"movl $0, %%eax \n\t" // set return value to 0
|
||||||
"movl %%eax, _mmx_supported \n\t" // save in global static variable, too
|
|
||||||
"popl %%edx \n\t" // restore edx
|
"popl %%edx \n\t" // restore edx
|
||||||
"popl %%ecx \n\t" // restore ecx
|
"popl %%ecx \n\t" // restore ecx
|
||||||
"popl %%ebx \n\t" // restore ebx ("row" in png_do_interlace)
|
"popl %%ebx \n\t" // restore ebx ("row" in png_do_interlace)
|
||||||
// "ret \n\t" // DONE: no MMX support
|
// "ret \n\t" // DONE: no MMX support
|
||||||
// (fall through to standard C "ret")
|
// (fall through to standard C "ret")
|
||||||
|
|
||||||
: // output list (none)
|
: // "=m" (mmx_supported_local) // %0 (output list: memory only)
|
||||||
|
|
||||||
: // any variables used on input (none)
|
: // any variables used on input (none)
|
||||||
|
|
||||||
@ -5027,7 +5087,12 @@ png_mmx_support(void)
|
|||||||
// , "cc" // "condition codes" (flag bits)
|
// , "cc" // "condition codes" (flag bits)
|
||||||
);
|
);
|
||||||
|
|
||||||
// return %%eax;
|
//mmx_supported_local=0; // test code for force don't support MMX
|
||||||
|
//printf("MMX : %u (1=MMX supported)\n",mmx_supported_local);
|
||||||
|
|
||||||
|
//return mmx_supported_local;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* ?ORIG_THAT_USED_TO_CLOBBER_EBX */
|
||||||
|
|
||||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGGCCRD */
|
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGGCCRD */
|
||||||
|
11
pngget.c
11
pngget.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngget.c - retrieval of values from info struct
|
/* pngget.c - retrieval of values from info struct
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -807,7 +807,7 @@ png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
|
|||||||
png_byte PNGAPI
|
png_byte PNGAPI
|
||||||
png_get_rgb_to_gray_status (png_structp png_ptr)
|
png_get_rgb_to_gray_status (png_structp png_ptr)
|
||||||
{
|
{
|
||||||
return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0);
|
return png_ptr->rgb_to_gray_status;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -815,7 +815,7 @@ png_get_rgb_to_gray_status (png_structp png_ptr)
|
|||||||
png_voidp PNGAPI
|
png_voidp PNGAPI
|
||||||
png_get_user_chunk_ptr(png_structp png_ptr)
|
png_get_user_chunk_ptr(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
return (png_ptr? png_ptr->user_chunk_ptr : NULL);
|
return (png_ptr->user_chunk_ptr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -823,6 +823,5 @@ png_get_user_chunk_ptr(png_structp png_ptr)
|
|||||||
png_uint_32 PNGAPI
|
png_uint_32 PNGAPI
|
||||||
png_get_compression_buffer_size(png_structp png_ptr)
|
png_get_compression_buffer_size(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L);
|
return(png_ptr->zbuf_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
pngmem.c
4
pngmem.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngmem.c - stub functions for memory allocation
|
/* pngmem.c - stub functions for memory allocation
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
|
39
pngpread.c
39
pngpread.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -772,11 +772,8 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
|
if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
|
||||||
{
|
{
|
||||||
if (png_ptr->pass < 6)
|
if (png_ptr->pass < 6)
|
||||||
/* old interface (pre-1.0.9):
|
|
||||||
png_do_read_interlace(&(png_ptr->row_info),
|
png_do_read_interlace(&(png_ptr->row_info),
|
||||||
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
|
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
|
||||||
*/
|
|
||||||
png_do_read_interlace(png_ptr);
|
|
||||||
|
|
||||||
switch (png_ptr->pass)
|
switch (png_ptr->pass)
|
||||||
{
|
{
|
||||||
@ -786,16 +783,8 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
for (i = 0; i < 8 && png_ptr->pass == 0; i++)
|
for (i = 0; i < 8 && png_ptr->pass == 0; i++)
|
||||||
{
|
{
|
||||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||||
png_read_push_finish_row(png_ptr); /* updates png_ptr->pass */
|
|
||||||
}
|
|
||||||
if (png_ptr->pass == 2) /* pass 1 might be empty */
|
|
||||||
{
|
|
||||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
|
||||||
{
|
|
||||||
png_push_have_row(png_ptr, NULL);
|
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
@ -806,7 +795,7 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 2) /* skip top 4 generated rows */
|
if (png_ptr->pass == 2)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||||
{
|
{
|
||||||
@ -829,14 +818,6 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_push_have_row(png_ptr, NULL);
|
png_push_have_row(png_ptr, NULL);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 4) /* pass 3 might be empty */
|
|
||||||
{
|
|
||||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
|
||||||
{
|
|
||||||
png_push_have_row(png_ptr, NULL);
|
|
||||||
png_read_push_finish_row(png_ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
@ -847,7 +828,7 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 4) /* skip top two generated rows */
|
if (png_ptr->pass == 4)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||||
{
|
{
|
||||||
@ -870,11 +851,6 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_push_have_row(png_ptr, NULL);
|
png_push_have_row(png_ptr, NULL);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 6) /* pass 5 might be empty */
|
|
||||||
{
|
|
||||||
png_push_have_row(png_ptr, NULL);
|
|
||||||
png_read_push_finish_row(png_ptr);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
@ -885,7 +861,7 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 6) /* skip top generated row */
|
if (png_ptr->pass == 6)
|
||||||
{
|
{
|
||||||
png_push_have_row(png_ptr, NULL);
|
png_push_have_row(png_ptr, NULL);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
@ -952,11 +928,6 @@ png_read_push_finish_row(png_structp png_ptr)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
png_ptr->pass++;
|
png_ptr->pass++;
|
||||||
if ((png_ptr->pass == 1 && png_ptr->width < 5) ||
|
|
||||||
(png_ptr->pass == 3 && png_ptr->width < 3) ||
|
|
||||||
(png_ptr->pass == 5 && png_ptr->width < 2))
|
|
||||||
png_ptr->pass++;
|
|
||||||
|
|
||||||
if (png_ptr->pass >= 7)
|
if (png_ptr->pass >= 7)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
22
pngread.c
22
pngread.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -246,8 +246,6 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
|||||||
else
|
else
|
||||||
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
|
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
|
||||||
}
|
}
|
||||||
if (num_checked < 3)
|
|
||||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
@ -649,15 +647,6 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
|
png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
|
||||||
png_ptr->rowbytes + 1);
|
png_ptr->rowbytes + 1);
|
||||||
|
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
|
|
||||||
(png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING))
|
|
||||||
{
|
|
||||||
/* Intrapixel differencing */
|
|
||||||
png_do_read_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (png_ptr->transformations)
|
if (png_ptr->transformations)
|
||||||
png_do_read_transformations(png_ptr);
|
png_do_read_transformations(png_ptr);
|
||||||
|
|
||||||
@ -667,11 +656,8 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
(png_ptr->transformations & PNG_INTERLACE))
|
(png_ptr->transformations & PNG_INTERLACE))
|
||||||
{
|
{
|
||||||
if (png_ptr->pass < 6)
|
if (png_ptr->pass < 6)
|
||||||
/* old interface (pre-1.0.9):
|
|
||||||
png_do_read_interlace(&(png_ptr->row_info),
|
png_do_read_interlace(&(png_ptr->row_info),
|
||||||
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
|
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
|
||||||
*/
|
|
||||||
png_do_read_interlace(png_ptr);
|
|
||||||
|
|
||||||
if (dsp_row != NULL)
|
if (dsp_row != NULL)
|
||||||
png_combine_row(png_ptr, dsp_row,
|
png_combine_row(png_ptr, dsp_row,
|
||||||
@ -715,7 +701,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
* not called png_set_interlace_handling(), the display_row buffer will
|
* not called png_set_interlace_handling(), the display_row buffer will
|
||||||
* be ignored, so pass NULL to it.
|
* be ignored, so pass NULL to it.
|
||||||
*
|
*
|
||||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.9beta10
|
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.9beta2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
@ -764,7 +750,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
|||||||
* only call this function once. If you desire to have an image for
|
* only call this function once. If you desire to have an image for
|
||||||
* each pass of a interlaced image, use png_read_rows() instead.
|
* each pass of a interlaced image, use png_read_rows() instead.
|
||||||
*
|
*
|
||||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.9beta10
|
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.9beta2
|
||||||
*/
|
*/
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_read_image(png_structp png_ptr, png_bytepp image)
|
png_read_image(png_structp png_ptr, png_bytepp image)
|
||||||
|
4
pngrio.c
4
pngrio.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngrio.c - functions for data input
|
/* pngrio.c - functions for data input
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
|
64
pngrtran.c
64
pngrtran.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -4053,63 +4053,3 @@ png_build_gamma_table(png_structp png_ptr)
|
|||||||
/* To do: install integer version of png_build_gamma_table here */
|
/* To do: install integer version of png_build_gamma_table here */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
/* undoes intrapixel differencing */
|
|
||||||
void /* PRIVATE */
|
|
||||||
png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
|
||||||
{
|
|
||||||
png_debug(1, "in png_do_read_intrapixel\n");
|
|
||||||
if (
|
|
||||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
|
||||||
row != NULL && row_info != NULL &&
|
|
||||||
#endif
|
|
||||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
|
||||||
{
|
|
||||||
int bytes_per_pixel;
|
|
||||||
png_uint_32 row_width = row_info->width;
|
|
||||||
if (row_info->bit_depth == 8)
|
|
||||||
{
|
|
||||||
png_bytep rp;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
|
||||||
bytes_per_pixel = 3;
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
|
||||||
bytes_per_pixel = 4;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
|
||||||
{
|
|
||||||
*(rp) = (png_byte)((256 + *rp + *(rp+1))&0xff);
|
|
||||||
*(rp+2) = (png_byte)((256 + *(rp+2) + *(rp+1))&0xff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (row_info->bit_depth == 16)
|
|
||||||
{
|
|
||||||
png_bytep rp;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
|
||||||
bytes_per_pixel = 6;
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
|
||||||
bytes_per_pixel = 8;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
|
||||||
{
|
|
||||||
png_uint_32 s0=*(rp )<<8 | *(rp+1);
|
|
||||||
png_uint_32 s1=*(rp+2)<<8 | *(rp+3);
|
|
||||||
png_uint_32 s2=*(rp+4)<<8 | *(rp+5);
|
|
||||||
png_uint_32 red=(65536+s0+s1)&0xffff;
|
|
||||||
png_uint_32 blue=(65536+s2+s1)&0xffff;
|
|
||||||
*(rp ) = (png_byte)((red>>8)&0xff);
|
|
||||||
*(rp+1) = (png_byte)(red&0xff);
|
|
||||||
*(rp+4) = (png_byte)((blue>>8)&0xff);
|
|
||||||
*(rp+5) = (png_byte)(blue&0xff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
|
||||||
|
142
pngrutil.c
142
pngrutil.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngrutil.c - utilities to read a PNG file
|
/* pngrutil.c - utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -174,7 +174,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
png_charp text = NULL;
|
png_charp text = NULL;
|
||||||
png_size_t text_size;
|
png_size_t text_size;
|
||||||
|
|
||||||
if (comp_type == PNG_COMPRESSION_TYPE_BASE)
|
if (comp_type == PNG_TEXT_COMPRESSION_zTXt)
|
||||||
{
|
{
|
||||||
int ret = Z_OK;
|
int ret = Z_OK;
|
||||||
png_ptr->zstream.next_in = (png_bytep)(chunkdata + prefix_size);
|
png_ptr->zstream.next_in = (png_bytep)(chunkdata + prefix_size);
|
||||||
@ -266,13 +266,6 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
png_warning(png_ptr,
|
png_warning(png_ptr,
|
||||||
"Incomplete compressed datastream in chunk other than IDAT");
|
"Incomplete compressed datastream in chunk other than IDAT");
|
||||||
#endif
|
#endif
|
||||||
text_size=prefix_size;
|
|
||||||
if (text == NULL)
|
|
||||||
{
|
|
||||||
text = (png_charp)png_malloc(png_ptr, text_size+1);
|
|
||||||
png_memcpy(text, chunkdata, prefix_size);
|
|
||||||
}
|
|
||||||
*(text + text_size) = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inflateReset(&png_ptr->zstream);
|
inflateReset(&png_ptr->zstream);
|
||||||
@ -282,7 +275,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
chunkdata = text;
|
chunkdata = text;
|
||||||
*newlength=text_size;
|
*newlength=text_size;
|
||||||
}
|
}
|
||||||
else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
|
else /* if (comp_type != PNG_TEXT_COMPRESSION_zTXt) */
|
||||||
{
|
{
|
||||||
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
||||||
char umsg[50];
|
char umsg[50];
|
||||||
@ -293,8 +286,10 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
png_warning(png_ptr, "Unknown zTXt compression type");
|
png_warning(png_ptr, "Unknown zTXt compression type");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*(chunkdata + prefix_size) = 0x00;
|
/* Copy what we can of the error message into the text chunk */
|
||||||
*newlength=prefix_size;
|
text_size = (png_size_t)(chunklength - (text - chunkdata));
|
||||||
|
text_size = sizeof(msg) > text_size ? text_size : sizeof(msg);
|
||||||
|
png_memcpy(text, msg, text_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
return chunkdata;
|
return chunkdata;
|
||||||
@ -358,33 +353,8 @@ png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (compression_type != PNG_COMPRESSION_TYPE_BASE)
|
if (compression_type != PNG_COMPRESSION_TYPE_BASE)
|
||||||
png_error(png_ptr, "Unknown compression method in IHDR");
|
png_error(png_ptr, "Unknown compression method in IHDR");
|
||||||
|
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
/* Accept filter_method 64 (intrapixel differencing) only if
|
|
||||||
* 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
|
|
||||||
* 2. Libpng did not read a PNG signature (this filter_method is only
|
|
||||||
* used in PNG datastreams that are embedded in MNG datastreams) and
|
|
||||||
* 3. The application called png_permit_mng_features with a mask that
|
|
||||||
* included PNG_FLAG_MNG_FILTER_64 and
|
|
||||||
* 4. The filter_method is 64 and
|
|
||||||
* 5. The color_type is RGB or RGBA
|
|
||||||
*/
|
|
||||||
if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted)
|
|
||||||
png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n");
|
|
||||||
if(filter_type != PNG_FILTER_TYPE_BASE)
|
|
||||||
{
|
|
||||||
if(!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
|
|
||||||
(filter_type == PNG_INTRAPIXEL_DIFFERENCING) &&
|
|
||||||
((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
|
|
||||||
(color_type == PNG_COLOR_TYPE_RGB ||
|
|
||||||
color_type == PNG_COLOR_TYPE_RGB_ALPHA)))
|
|
||||||
png_error(png_ptr, "Unknown filter method in IHDR");
|
|
||||||
if(png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)
|
|
||||||
png_warning(png_ptr, "Invalid filter method in IHDR");
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (filter_type != PNG_FILTER_TYPE_BASE)
|
if (filter_type != PNG_FILTER_TYPE_BASE)
|
||||||
png_error(png_ptr, "Unknown filter method in IHDR");
|
png_error(png_ptr, "Unknown filter method in IHDR");
|
||||||
#endif
|
|
||||||
|
|
||||||
/* set internal variables */
|
/* set internal variables */
|
||||||
png_ptr->width = width;
|
png_ptr->width = width;
|
||||||
@ -392,7 +362,6 @@ png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_ptr->bit_depth = (png_byte)bit_depth;
|
png_ptr->bit_depth = (png_byte)bit_depth;
|
||||||
png_ptr->interlaced = (png_byte)interlace_type;
|
png_ptr->interlaced = (png_byte)interlace_type;
|
||||||
png_ptr->color_type = (png_byte)color_type;
|
png_ptr->color_type = (png_byte)color_type;
|
||||||
png_ptr->filter_type = (png_byte)filter_type;
|
|
||||||
|
|
||||||
/* find number of channels */
|
/* find number of channels */
|
||||||
switch (png_ptr->color_type)
|
switch (png_ptr->color_type)
|
||||||
@ -428,7 +397,7 @@ png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
{
|
{
|
||||||
png_color palette[PNG_MAX_PALETTE_LENGTH];
|
png_colorp palette;
|
||||||
int num, i;
|
int num, i;
|
||||||
#ifndef PNG_NO_POINTER_INDEXING
|
#ifndef PNG_NO_POINTER_INDEXING
|
||||||
png_colorp pal_ptr;
|
png_colorp pal_ptr;
|
||||||
@ -457,7 +426,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3)
|
if (length > 768 || length % 3)
|
||||||
{
|
{
|
||||||
if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
|
if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||||
{
|
{
|
||||||
@ -473,6 +442,8 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
num = (int)length / 3;
|
num = (int)length / 3;
|
||||||
|
|
||||||
|
palette = (png_colorp)png_zalloc(png_ptr, (uInt)num, sizeof (png_color));
|
||||||
|
|
||||||
#ifndef PNG_NO_POINTER_INDEXING
|
#ifndef PNG_NO_POINTER_INDEXING
|
||||||
for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
|
for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
|
||||||
{
|
{
|
||||||
@ -522,6 +493,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
png_chunk_warning(png_ptr, "CRC error");
|
png_chunk_warning(png_ptr, "CRC error");
|
||||||
|
png_zfree(png_ptr, palette);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,7 +504,15 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
png_ptr->palette = palette;
|
||||||
|
png_ptr->num_palette = (png_uint_16)num;
|
||||||
|
|
||||||
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
|
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
|
||||||
|
png_ptr->free_me |= PNG_FREE_PLTE;
|
||||||
|
#else
|
||||||
|
png_ptr->flags |= PNG_FLAG_FREE_PLTE;
|
||||||
|
#endif
|
||||||
png_set_PLTE(png_ptr, info_ptr, palette, num);
|
png_set_PLTE(png_ptr, info_ptr, palette, num);
|
||||||
|
|
||||||
#if defined(PNG_READ_tRNS_SUPPORTED)
|
#if defined(PNG_READ_tRNS_SUPPORTED)
|
||||||
@ -1070,8 +1050,6 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
slength, prefix_length, &data_length);
|
slength, prefix_length, &data_length);
|
||||||
|
|
||||||
profile_length = data_length - prefix_length;
|
profile_length = data_length - prefix_length;
|
||||||
|
|
||||||
/* Check the profile_size recorded in the first 32 bits of the ICC profile */
|
|
||||||
profile_size = ((*(chunkdata+prefix_length))<<24) |
|
profile_size = ((*(chunkdata+prefix_length))<<24) |
|
||||||
((*(chunkdata+prefix_length+1))<<16) |
|
((*(chunkdata+prefix_length+1))<<16) |
|
||||||
((*(chunkdata+prefix_length+2))<< 8) |
|
((*(chunkdata+prefix_length+2))<< 8) |
|
||||||
@ -1087,7 +1065,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
png_set_iCCP(png_ptr, info_ptr, chunkdata, compression_type,
|
png_set_iCCP(png_ptr, info_ptr, chunkdata, compression_type,
|
||||||
chunkdata + prefix_length, profile_length);
|
chunkdata + prefix_length, data_length-prefix_length);
|
||||||
png_free(png_ptr, chunkdata);
|
png_free(png_ptr, chunkdata);
|
||||||
}
|
}
|
||||||
#endif /* PNG_READ_iCCP_SUPPORTED */
|
#endif /* PNG_READ_iCCP_SUPPORTED */
|
||||||
@ -1224,8 +1202,6 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
{
|
{
|
||||||
png_byte readbuf[PNG_MAX_PALETTE_LENGTH];
|
|
||||||
|
|
||||||
png_debug(1, "in png_handle_tRNS\n");
|
png_debug(1, "in png_handle_tRNS\n");
|
||||||
|
|
||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||||
@ -1263,7 +1239,8 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_crc_read(png_ptr, readbuf, (png_size_t)length);
|
png_ptr->trans = (png_bytep)png_malloc(png_ptr, length);
|
||||||
|
png_crc_read(png_ptr, png_ptr->trans, (png_size_t)length);
|
||||||
png_ptr->num_trans = (png_uint_16)length;
|
png_ptr->num_trans = (png_uint_16)length;
|
||||||
}
|
}
|
||||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
|
else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
|
||||||
@ -1308,7 +1285,15 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (png_crc_finish(png_ptr, 0))
|
if (png_crc_finish(png_ptr, 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans,
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
|
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
||||||
|
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
|
png_ptr->free_me |= PNG_FREE_TRNS;
|
||||||
|
#else
|
||||||
|
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
|
png_ptr->flags |= PNG_FLAG_FREE_TRNS;
|
||||||
|
#endif
|
||||||
|
png_set_tRNS(png_ptr, info_ptr, png_ptr->trans, png_ptr->num_trans,
|
||||||
&(png_ptr->trans_values));
|
&(png_ptr->trans_values));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1407,7 +1392,6 @@ void /* PRIVATE */
|
|||||||
png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
{
|
{
|
||||||
int num, i;
|
int num, i;
|
||||||
png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];
|
|
||||||
|
|
||||||
png_debug(1, "in png_handle_hIST\n");
|
png_debug(1, "in png_handle_hIST\n");
|
||||||
|
|
||||||
@ -1432,26 +1416,34 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
num = (int)length / 2 ;
|
if (length != (png_uint_32)(2 * png_ptr->num_palette))
|
||||||
if (num != png_ptr->num_palette)
|
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Incorrect hIST chunk length");
|
png_warning(png_ptr, "Incorrect hIST chunk length");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num = (int)length / 2 ;
|
||||||
|
png_ptr->hist = (png_uint_16p)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(num * sizeof (png_uint_16)));
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
png_byte buf[2];
|
png_byte buf[2];
|
||||||
|
|
||||||
png_crc_read(png_ptr, buf, 2);
|
png_crc_read(png_ptr, buf, 2);
|
||||||
readbuf[i] = png_get_uint_16(buf);
|
png_ptr->hist[i] = png_get_uint_16(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, 0))
|
if (png_crc_finish(png_ptr, 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
png_set_hIST(png_ptr, info_ptr, readbuf);
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
|
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
||||||
|
png_ptr->free_me |= PNG_FREE_HIST;
|
||||||
|
#else
|
||||||
|
png_ptr->flags |= PNG_FLAG_FREE_HIST;
|
||||||
|
#endif
|
||||||
|
png_set_hIST(png_ptr, info_ptr, png_ptr->hist);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1930,11 +1922,6 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
comp_type = *(++text);
|
comp_type = *(++text);
|
||||||
if (comp_type != PNG_TEXT_COMPRESSION_zTXt)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "Unknown compression type in zTXt chunk");
|
|
||||||
comp_type = PNG_TEXT_COMPRESSION_zTXt;
|
|
||||||
}
|
|
||||||
text++; /* skip the compression_method byte */
|
text++; /* skip the compression_method byte */
|
||||||
}
|
}
|
||||||
prefix_len = text - chunkdata;
|
prefix_len = text - chunkdata;
|
||||||
@ -2165,9 +2152,13 @@ png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name)
|
|||||||
a zero indicates the pixel is to be skipped. This is in addition
|
a zero indicates the pixel is to be skipped. This is in addition
|
||||||
to any alpha or transparency value associated with the pixel. If
|
to any alpha or transparency value associated with the pixel. If
|
||||||
you want all pixels to be combined, pass 0xff (255) in mask. */
|
you want all pixels to be combined, pass 0xff (255) in mask. */
|
||||||
#ifndef PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
||||||
|
png_combine_row_c
|
||||||
|
#else
|
||||||
|
png_combine_row
|
||||||
|
#endif /* PNG_HAVE_ASSEMBLER_COMBINE_ROW */
|
||||||
|
(png_structp png_ptr, png_bytep row, int mask)
|
||||||
{
|
{
|
||||||
png_debug(1,"in png_combine_row\n");
|
png_debug(1,"in png_combine_row\n");
|
||||||
if (mask == 0xff)
|
if (mask == 0xff)
|
||||||
@ -2367,24 +2358,25 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !PNG_HAVE_ASSEMBLER_COMBINE_ROW */
|
|
||||||
|
|
||||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
#if defined(PNG_READ_INTERLACING_SUPPORTED)
|
||||||
#ifndef PNG_HAVE_ASSEMBLER_READ_INTERLACE /* else in pngvcrd.c, pnggccrd.c */
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_do_read_interlace(png_structp png_ptr)
|
#ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE
|
||||||
|
png_do_read_interlace_c
|
||||||
|
#else
|
||||||
|
png_do_read_interlace
|
||||||
|
#endif /* PNG_HAVE_ASSEMBLER_READ_INTERLACE */
|
||||||
|
(png_row_infop row_info, png_bytep row, int pass,
|
||||||
|
png_uint_32 transformations)
|
||||||
{
|
{
|
||||||
png_row_infop row_info = &(png_ptr->row_info);
|
|
||||||
png_bytep row = png_ptr->row_buf + 1;
|
|
||||||
int pass = png_ptr->pass;
|
|
||||||
png_uint_32 transformations = png_ptr->transformations;
|
|
||||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||||
/* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
/* offset to next interlace block */
|
/* offset to next interlace block */
|
||||||
const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
png_debug(1,"in png_do_read_interlace (stock C version)\n");
|
png_debug(1,"in png_do_read_interlace\n");
|
||||||
if (row != NULL && row_info != NULL)
|
if (row != NULL && row_info != NULL)
|
||||||
{
|
{
|
||||||
png_uint_32 final_width;
|
png_uint_32 final_width;
|
||||||
@ -2594,12 +2586,15 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* !PNG_HAVE_ASSEMBLER_READ_INTERLACE */
|
#endif
|
||||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
|
||||||
|
|
||||||
#ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
|
#ifdef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
||||||
|
png_read_filter_row_c
|
||||||
|
#else
|
||||||
|
png_read_filter_row
|
||||||
|
#endif /* PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */
|
||||||
|
(png_structp png_ptr, png_row_infop row_info, png_bytep row,
|
||||||
png_bytep prev_row, int filter)
|
png_bytep prev_row, int filter)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_read_filter_row\n");
|
png_debug(1, "in png_read_filter_row\n");
|
||||||
@ -2720,7 +2715,6 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */
|
|
||||||
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_read_finish_row(png_structp png_ptr)
|
png_read_finish_row(png_structp png_ptr)
|
||||||
|
65
pngset.c
65
pngset.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngset.c - storage of image information into info struct
|
/* pngset.c - storage of image information into info struct
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -133,31 +133,12 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
png_debug1(1, "in %s storage function\n", "hIST");
|
png_debug1(1, "in %s storage function\n", "hIST");
|
||||||
if (png_ptr == NULL || info_ptr == NULL)
|
if (png_ptr == NULL || info_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
if (info_ptr->num_palette == 0)
|
|
||||||
png_warning(png_ptr,
|
|
||||||
"Palette size 0, hIST allocation skipped.");
|
|
||||||
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
info_ptr->hist = hist;
|
||||||
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
|
||||||
#endif
|
|
||||||
png_ptr->hist = (png_uint_16p)png_malloc(png_ptr,
|
|
||||||
(png_uint_32)(info_ptr->num_palette * sizeof (png_uint_16)));
|
|
||||||
|
|
||||||
for (i = 0; i < info_ptr->num_palette; i++)
|
|
||||||
png_ptr->hist[i] = hist[i];
|
|
||||||
info_ptr->hist = png_ptr->hist;
|
|
||||||
info_ptr->valid |= PNG_INFO_hIST;
|
info_ptr->valid |= PNG_INFO_hIST;
|
||||||
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
|
||||||
info_ptr->free_me |= PNG_FREE_HIST;
|
|
||||||
#else
|
|
||||||
png_ptr->flags |= PNG_FLAG_FREE_HIST;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -339,26 +320,9 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
|||||||
if (png_ptr == NULL || info_ptr == NULL)
|
if (png_ptr == NULL || info_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
info_ptr->palette = palette;
|
||||||
* It may not actually be necessary to set png_ptr->palette here;
|
|
||||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
|
||||||
* function used to do the allocation.
|
|
||||||
*/
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
|
||||||
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
|
|
||||||
#endif
|
|
||||||
png_ptr->palette = (png_colorp)png_zalloc(png_ptr, (uInt)num_palette,
|
|
||||||
sizeof (png_color));
|
|
||||||
memcpy(png_ptr->palette, palette, num_palette * sizeof (png_color));
|
|
||||||
info_ptr->palette = png_ptr->palette;
|
|
||||||
info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
|
|
||||||
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
|
||||||
info_ptr->free_me |= PNG_FREE_PLTE;
|
|
||||||
#else
|
|
||||||
png_ptr->flags |= PNG_FLAG_FREE_PLTE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
info_ptr->num_palette = (png_uint_16)num_palette;
|
||||||
info_ptr->valid |= PNG_INFO_PLTE;
|
info_ptr->valid |= PNG_INFO_PLTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,23 +631,7 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (trans != NULL)
|
if (trans != NULL)
|
||||||
{
|
info_ptr->trans = trans;
|
||||||
/*
|
|
||||||
* It may not actually be necessary to set png_ptr->trans here;
|
|
||||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
|
||||||
* function used to do the allocation.
|
|
||||||
*/
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
|
||||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
|
||||||
#endif
|
|
||||||
png_ptr->trans = info_ptr->trans = png_malloc(png_ptr, num_trans);
|
|
||||||
memcpy(info_ptr->trans, trans, num_trans);
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
|
||||||
info_ptr->free_me |= PNG_FREE_TRNS;
|
|
||||||
#else
|
|
||||||
png_ptr->flags |= PNG_FLAG_FREE_TRNS;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trans_values != NULL)
|
if (trans_values != NULL)
|
||||||
{
|
{
|
||||||
@ -906,4 +854,3 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
|
|||||||
if (png_ptr && info_ptr)
|
if (png_ptr && info_ptr)
|
||||||
info_ptr->valid &= ~(mask);
|
info_ptr->valid &= ~(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
pngtest.c
15
pngtest.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngtest.c - a simple test program to test libpng
|
/* pngtest.c - a simple test program to test libpng
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@ -50,14 +50,6 @@
|
|||||||
# define FCLOSE(file) fclose(file)
|
# define FCLOSE(file) fclose(file)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_NO_STDIO)
|
|
||||||
#if defined(_WIN32_WCE)
|
|
||||||
typedef HANDLE png_FILE_p;
|
|
||||||
#else
|
|
||||||
typedef FILE * png_FILE_p;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Makes pngtest verbose so we can find problems (needs to be before png.h) */
|
/* Makes pngtest verbose so we can find problems (needs to be before png.h) */
|
||||||
#ifndef PNG_DEBUG
|
#ifndef PNG_DEBUG
|
||||||
#define PNG_DEBUG 0
|
#define PNG_DEBUG 0
|
||||||
@ -265,7 +257,6 @@ static int wrote_question = 0;
|
|||||||
not reading from a standard C stream, you should create a replacement
|
not reading from a standard C stream, you should create a replacement
|
||||||
read_data function and use it at run time with png_set_read_fn(), rather
|
read_data function and use it at run time with png_set_read_fn(), rather
|
||||||
than changing the library. */
|
than changing the library. */
|
||||||
|
|
||||||
#ifndef USE_FAR_KEYWORD
|
#ifndef USE_FAR_KEYWORD
|
||||||
static void
|
static void
|
||||||
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||||
@ -1458,4 +1449,4 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_0_9beta10 your_png_h_is_not_version_1_0_9beta10;
|
typedef version_1_0_9beta2 your_png_h_is_not_version_1_0_9beta2;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -606,4 +606,3 @@ png_get_user_transform_ptr(png_structp png_ptr)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
172
pngvcrd.c
172
pngvcrd.c
@ -2,20 +2,13 @@
|
|||||||
*
|
*
|
||||||
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998, Intel Corporation
|
* Copyright (c) 1998, Intel Corporation
|
||||||
*
|
*
|
||||||
* Contributed by Nirav Chhatrapati, Intel Corporation, 1998
|
* Contributed by Nirav Chhatrapati, Intel Corporation, 1998
|
||||||
* Interface to libpng contributed by Gilles Vollant, 1999
|
* Interface to libpng contributed by Gilles Vollant, 1999
|
||||||
* Debugging and cleanup by Greg Roelofs, 2000, 2001
|
|
||||||
*
|
|
||||||
* In png_do_read_interlace() in libpng versions 1.0.3a through 1.0.4d,
|
|
||||||
* a sign error in the post-MMX cleanup code for each pixel_depth resulted
|
|
||||||
* in bad pixels at the beginning of some rows of some images, and also
|
|
||||||
* (due to out-of-range memory reads and writes) caused heap corruption
|
|
||||||
* when compiled with MSVC 6.0. The error was fixed in version 1.0.4e.
|
|
||||||
*
|
*
|
||||||
* [png_read_filter_row_mmx_avg() bpp == 2 bugfix, GRR 20000916]
|
* [png_read_filter_row_mmx_avg() bpp == 2 bugfix, GRR 20000916]
|
||||||
*
|
*
|
||||||
@ -26,11 +19,19 @@
|
|||||||
|
|
||||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD)
|
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD)
|
||||||
|
|
||||||
|
/*
|
||||||
|
One of these might need to be defined.
|
||||||
|
#define DISABLE_PNGVCRD_COMBINE
|
||||||
|
#define DISABLE_PNGVCRD_INTERLACE
|
||||||
|
*/
|
||||||
|
|
||||||
static int mmx_supported=2;
|
static int mmx_supported=2;
|
||||||
|
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_read_filter_row_c(png_structp png_ptr, png_row_infop row_info,
|
||||||
|
png_bytep row, png_bytep prev_row, int filter);
|
||||||
|
|
||||||
int PNGAPI
|
static int mmxsupport()
|
||||||
png_mmx_support(void)
|
|
||||||
{
|
{
|
||||||
int mmx_supported_local = 0;
|
int mmx_supported_local = 0;
|
||||||
_asm {
|
_asm {
|
||||||
@ -82,7 +83,6 @@ NOT_SUPPORTED:
|
|||||||
//mmx_supported_local=0; // test code for force don't support MMX
|
//mmx_supported_local=0; // test code for force don't support MMX
|
||||||
//printf("MMX : %u (1=MMX supported)\n",mmx_supported_local);
|
//printf("MMX : %u (1=MMX supported)\n",mmx_supported_local);
|
||||||
|
|
||||||
mmx_supported = mmx_supported_local;
|
|
||||||
return mmx_supported_local;
|
return mmx_supported_local;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,12 +106,19 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||||
const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DISABLE_PNGVCRD_COMBINE
|
||||||
|
int save_mmx_supported = mmx_supported;
|
||||||
|
#endif
|
||||||
|
|
||||||
png_debug(1,"in png_combine_row_asm\n");
|
png_debug(1,"in png_combine_row_asm\n");
|
||||||
|
|
||||||
if (mmx_supported == 2) {
|
#ifdef DISABLE_PNGVCRD_COMBINE
|
||||||
png_mmx_support();
|
if ((png_ptr->transformations & PNG_INTERLACE) && png_ptr->pass != 6)
|
||||||
}
|
mmx_supported = 0;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (mmx_supported == 2)
|
||||||
|
mmx_supported = mmxsupport();
|
||||||
|
|
||||||
if (mask == 0xff)
|
if (mask == 0xff)
|
||||||
{
|
{
|
||||||
@ -956,27 +963,43 @@ end48:
|
|||||||
} /* end switch (png_ptr->row_info.pixel_depth) */
|
} /* end switch (png_ptr->row_info.pixel_depth) */
|
||||||
} /* end if (non-trivial mask) */
|
} /* end if (non-trivial mask) */
|
||||||
|
|
||||||
|
#ifdef DISABLE_PNGVCRD_COMBINE
|
||||||
|
mmx_supported = save_mmx_supported;
|
||||||
|
#endif
|
||||||
|
|
||||||
} /* end png_combine_row() */
|
} /* end png_combine_row() */
|
||||||
|
|
||||||
|
|
||||||
#if defined(PNG_READ_INTERLACING_SUPPORTED)
|
#if defined(PNG_READ_INTERLACING_SUPPORTED)
|
||||||
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_do_read_interlace(png_structp png_ptr)
|
png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
|
||||||
|
png_uint_32 transformations)
|
||||||
{
|
{
|
||||||
png_row_infop row_info = &(png_ptr->row_info);
|
|
||||||
png_bytep row = png_ptr->row_buf + 1;
|
|
||||||
int pass = png_ptr->pass;
|
|
||||||
png_uint_32 transformations = png_ptr->transformations;
|
|
||||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||||
const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DISABLE_PNGVCRD_INTERLACE
|
||||||
|
int save_mmx_supported = mmx_supported;
|
||||||
|
#endif
|
||||||
|
|
||||||
png_debug(1,"in png_do_read_interlace\n");
|
png_debug(1,"in png_do_read_interlace\n");
|
||||||
|
|
||||||
if (mmx_supported == 2) {
|
#ifdef DISABLE_PNGVCRD_INTERLACE
|
||||||
png_mmx_support();
|
/* In libpng versions 1.0.3a through 1.0.4d,
|
||||||
}
|
* a sign error in the post-MMX cleanup code for each pixel_depth resulted
|
||||||
|
* in bad pixels at the beginning of some rows of some images, and also
|
||||||
|
* (due to out-of-range memory reads and writes) caused heap corruption
|
||||||
|
* when compiled with MSVC 6.0. The error was fixed in version 1.0.4e,
|
||||||
|
* and the code appears to work completely correctly, so it is enabled
|
||||||
|
* by default.
|
||||||
|
*/
|
||||||
|
if (1) /* all passes caused a heap problem in the old code */
|
||||||
|
mmx_supported = 0;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (mmx_supported == 2)
|
||||||
|
mmx_supported = mmxsupport();
|
||||||
|
|
||||||
if (row != NULL && row_info != NULL)
|
if (row != NULL && row_info != NULL)
|
||||||
{
|
{
|
||||||
@ -1174,8 +1197,7 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
// sign fix by GRR
|
// sign fix by GRR
|
||||||
// NOTE: there is NO MMX code for 48-bit and 64-bit images
|
// NOTE: there is NO MMX code for 48-bit and 64-bit images
|
||||||
|
|
||||||
// use MMX routine if machine supports it
|
if (mmx_supported) // use MMX routine if machine supports it
|
||||||
if ( mmx_supported )
|
|
||||||
{
|
{
|
||||||
if (pixel_bytes == 3)
|
if (pixel_bytes == 3)
|
||||||
{
|
{
|
||||||
@ -1863,6 +1885,9 @@ loop4_pass4:
|
|||||||
(png_uint_32)row_info->pixel_depth + 7) >> 3);
|
(png_uint_32)row_info->pixel_depth + 7) >> 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DISABLE_PNGVCRD_INTERLACE
|
||||||
|
mmx_supported = save_mmx_supported;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||||
@ -3298,7 +3323,7 @@ dsub3lp:
|
|||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
// Placed here just in case this is a duplicate of the
|
// Placed here just in case this is a duplicate of the
|
||||||
// non-MMX code for the SUB filter in png_read_filter_row below
|
// non-MMX code for the SUB filter in png_read_filter_row above
|
||||||
//
|
//
|
||||||
// png_bytep rp;
|
// png_bytep rp;
|
||||||
// png_bytep lp;
|
// png_bytep lp;
|
||||||
@ -3633,50 +3658,61 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
row, png_bytep prev_row, int filter)
|
row, png_bytep prev_row, int filter)
|
||||||
{
|
{
|
||||||
#ifdef PNG_DEBUG
|
#ifdef PNG_DEBUG
|
||||||
char filnm[10];
|
char filnm[6];
|
||||||
#endif
|
#endif
|
||||||
|
#define UseMMX 1
|
||||||
|
|
||||||
if (mmx_supported == 2) {
|
if (mmx_supported == 2)
|
||||||
png_mmx_support();
|
mmx_supported = mmxsupport();
|
||||||
|
|
||||||
|
if (!mmx_supported)
|
||||||
|
{
|
||||||
|
png_read_filter_row_c(png_ptr, row_info, row, prev_row, filter);
|
||||||
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PNG_DEBUG
|
#ifdef PNG_DEBUG
|
||||||
png_debug(1, "in png_read_filter_row\n");
|
png_debug(1, "in png_read_filter_row\n");
|
||||||
|
# if (UseMMX == 1)
|
||||||
|
png_debug1(0,"%s, ", "MMX");
|
||||||
|
# else
|
||||||
|
png_debug1(0,"%s, ", "x86");
|
||||||
|
# endif
|
||||||
switch (filter)
|
switch (filter)
|
||||||
{
|
{
|
||||||
case 0: sprintf(filnm, "none");
|
case 0: sprintf(filnm, "None ");
|
||||||
break;
|
break;
|
||||||
case 1: sprintf(filnm, "sub-%s", "MMX");
|
case 1: sprintf(filnm, "Sub ");
|
||||||
break;
|
break;
|
||||||
case 2: sprintf(filnm, "up-%s", "MMX");
|
case 2: sprintf(filnm, "Up ");
|
||||||
break;
|
break;
|
||||||
case 3: sprintf(filnm, "avg-%s", "MMX");
|
case 3: sprintf(filnm, "Avg ");
|
||||||
break;
|
break;
|
||||||
case 4: sprintf(filnm, "Paeth-%s", "MMX");
|
case 4: sprintf(filnm, "Paeth");
|
||||||
break;
|
break;
|
||||||
default: sprintf(filnm, "unknw");
|
default: sprintf(filnm, "Unknw");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
png_debug2(0,"row=%5d, %s, ", png_ptr->row_number, filnm);
|
png_debug2(0,"row=%5d, %s, ", png_ptr->row_number, filnm);
|
||||||
png_debug2(0, "pd=%2d, b=%d, ", (int)row_info->pixel_depth,
|
png_debug2(0, "pd=%2d, b=%d, ", (int)row_info->pixel_depth,
|
||||||
(int)((row_info->pixel_depth + 7) >> 3));
|
(int)((row_info->pixel_depth + 7) >> 3));
|
||||||
png_debug1(0,"len=%8d, ", row_info->rowbytes);
|
png_debug1(0,"len=%8d, ", row_info->rowbytes);
|
||||||
#endif /* PNG_DEBUG */
|
#endif
|
||||||
|
|
||||||
switch (filter)
|
switch (filter)
|
||||||
{
|
{
|
||||||
case PNG_FILTER_VALUE_NONE:
|
case PNG_FILTER_VALUE_NONE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_SUB:
|
case PNG_FILTER_VALUE_SUB:
|
||||||
{
|
{
|
||||||
if (
|
#if (UseMMX == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) &&
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
(row_info->rowbytes >= 128) )
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_sub(row_info, row);
|
png_read_filter_row_mmx_sub(row_info, row);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 istop = row_info->rowbytes;
|
png_uint_32 istop = row_info->rowbytes;
|
||||||
@ -3689,43 +3725,41 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
*rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff);
|
*rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff);
|
||||||
rp++;
|
rp++;
|
||||||
}
|
}
|
||||||
}
|
} //end !UseMMX
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_UP:
|
case PNG_FILTER_VALUE_UP:
|
||||||
{
|
{
|
||||||
if (
|
#if (UseMMX == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) &&
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
(row_info->rowbytes >= 128) )
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_up(row_info, row, prev_row);
|
png_read_filter_row_mmx_up(row_info, row, prev_row);
|
||||||
}
|
} //end if UseMMX
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
png_bytep rp;
|
||||||
|
png_bytep pp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 istop = row_info->rowbytes;
|
for (i = 0, rp = row, pp = prev_row;
|
||||||
png_bytep rp = row;
|
i < row_info->rowbytes; i++, rp++, pp++)
|
||||||
png_bytep pp = prev_row;
|
|
||||||
|
|
||||||
for (i = 0; i < istop; ++i)
|
|
||||||
{
|
{
|
||||||
*rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
|
*rp = (png_byte)(((int)(*rp) + (int)(*pp)) & 0xff);
|
||||||
rp++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} //end !UseMMX
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_AVG:
|
case PNG_FILTER_VALUE_AVG:
|
||||||
{
|
{
|
||||||
if (
|
#if (UseMMX == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) &&
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
(row_info->rowbytes >= 128) )
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_avg(row_info, row, prev_row);
|
png_read_filter_row_mmx_avg(row_info, row, prev_row);
|
||||||
}
|
} //end if UseMMX
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_bytep rp = row;
|
png_bytep rp = row;
|
||||||
@ -3747,19 +3781,19 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
((int)(*pp++ + *lp++) >> 1)) & 0xff);
|
((int)(*pp++ + *lp++) >> 1)) & 0xff);
|
||||||
rp++;
|
rp++;
|
||||||
}
|
}
|
||||||
}
|
} //end !UseMMX
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNG_FILTER_VALUE_PAETH:
|
case PNG_FILTER_VALUE_PAETH:
|
||||||
{
|
{
|
||||||
if (
|
#if (UseMMX == 1)
|
||||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
if ((row_info->pixel_depth > 8) &&
|
||||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
(row_info->rowbytes >= 128) )
|
||||||
{
|
{
|
||||||
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
||||||
}
|
} //end if UseMMX
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_bytep rp = row;
|
png_bytep rp = row;
|
||||||
@ -3810,15 +3844,13 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
|||||||
*rp = (png_byte)(((int)(*rp) + p) & 0xff);
|
*rp = (png_byte)(((int)(*rp) + p) & 0xff);
|
||||||
rp++;
|
rp++;
|
||||||
}
|
}
|
||||||
}
|
} //end !UseMMX
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
png_warning(png_ptr, "Ignoring bad row filter type");
|
png_warning(png_ptr, "Ignoring bad adaptive filter type");
|
||||||
*row=0;
|
*row=0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGVCRD */
|
|
||||||
|
4
pngwio.c
4
pngwio.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngwio.c - functions for data output
|
/* pngwio.c - functions for data output
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
|
40
pngwrite.c
40
pngwrite.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngwrite.c - general routines to write a PNG file
|
/* pngwrite.c - general routines to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -28,13 +28,6 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
|
|||||||
if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
|
if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
|
||||||
{
|
{
|
||||||
png_write_sig(png_ptr); /* write PNG signature */
|
png_write_sig(png_ptr); /* write PNG signature */
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted))
|
|
||||||
{
|
|
||||||
png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n");
|
|
||||||
png_ptr->mng_features_permitted=0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* write IHDR information. */
|
/* write IHDR information. */
|
||||||
png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
|
png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
|
||||||
info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
|
info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
|
||||||
@ -64,7 +57,7 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
|
|||||||
#endif
|
#endif
|
||||||
#if defined(PNG_WRITE_iCCP_SUPPORTED)
|
#if defined(PNG_WRITE_iCCP_SUPPORTED)
|
||||||
if (info_ptr->valid & PNG_INFO_iCCP)
|
if (info_ptr->valid & PNG_INFO_iCCP)
|
||||||
png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE,
|
png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_TEXT_COMPRESSION_zTXt,
|
||||||
info_ptr->iccp_profile, (int)info_ptr->iccp_proflen);
|
info_ptr->iccp_profile, (int)info_ptr->iccp_proflen);
|
||||||
#endif
|
#endif
|
||||||
#if defined(PNG_WRITE_sBIT_SUPPORTED)
|
#if defined(PNG_WRITE_sBIT_SUPPORTED)
|
||||||
@ -382,11 +375,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
|
|||||||
|
|
||||||
/* write end of PNG file */
|
/* write end of PNG file */
|
||||||
png_write_IEND(png_ptr);
|
png_write_IEND(png_ptr);
|
||||||
#if 0
|
|
||||||
/* This flush, added in libpng-1.0.8, causes some applications to crash
|
|
||||||
because they do not set png_ptr->output_flush_fn */
|
|
||||||
png_flush(png_ptr);
|
png_flush(png_ptr);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_WRITE_tIME_SUPPORTED)
|
#if defined(PNG_WRITE_tIME_SUPPORTED)
|
||||||
@ -780,24 +769,6 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
|||||||
if (png_ptr->transformations)
|
if (png_ptr->transformations)
|
||||||
png_do_write_transformations(png_ptr);
|
png_do_write_transformations(png_ptr);
|
||||||
|
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
/* Write filter_method 64 (intrapixel differencing) only if
|
|
||||||
* 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
|
|
||||||
* 2. Libpng did not write a PNG signature (this filter_method is only
|
|
||||||
* used in PNG datastreams that are embedded in MNG datastreams) and
|
|
||||||
* 3. The application called png_permit_mng_features with a mask that
|
|
||||||
* included PNG_FLAG_MNG_FILTER_64 and
|
|
||||||
* 4. The filter_method is 64 and
|
|
||||||
* 5. The color_type is RGB or RGBA
|
|
||||||
*/
|
|
||||||
if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
|
|
||||||
(png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING))
|
|
||||||
{
|
|
||||||
/* Intrapixel differencing */
|
|
||||||
png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Find a filter if necessary, filter the row and write it out. */
|
/* Find a filter if necessary, filter the row and write it out. */
|
||||||
png_write_find_filter(png_ptr, &(png_ptr->row_info));
|
png_write_find_filter(png_ptr, &(png_ptr->row_info));
|
||||||
|
|
||||||
@ -993,11 +964,6 @@ void PNGAPI
|
|||||||
png_set_filter(png_structp png_ptr, int method, int filters)
|
png_set_filter(png_structp png_ptr, int method, int filters)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_set_filter\n");
|
png_debug(1, "in png_set_filter\n");
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
|
|
||||||
(method == PNG_INTRAPIXEL_DIFFERENCING))
|
|
||||||
method = PNG_FILTER_TYPE_BASE;
|
|
||||||
#endif
|
|
||||||
if (method == PNG_FILTER_TYPE_BASE)
|
if (method == PNG_FILTER_TYPE_BASE)
|
||||||
{
|
{
|
||||||
switch (filters & (PNG_ALL_FILTERS | 0x07))
|
switch (filters & (PNG_ALL_FILTERS | 0x07))
|
||||||
|
65
pngwtran.c
65
pngwtran.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -498,64 +498,3 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
/* undoes intrapixel differencing */
|
|
||||||
void /* PRIVATE */
|
|
||||||
png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
|
|
||||||
{
|
|
||||||
png_debug(1, "in png_do_write_intrapixel\n");
|
|
||||||
if (
|
|
||||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
|
||||||
row != NULL && row_info != NULL &&
|
|
||||||
#endif
|
|
||||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
|
||||||
{
|
|
||||||
int bytes_per_pixel;
|
|
||||||
png_uint_32 row_width = row_info->width;
|
|
||||||
if (row_info->bit_depth == 8)
|
|
||||||
{
|
|
||||||
png_bytep rp;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
|
||||||
bytes_per_pixel = 3;
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
|
||||||
bytes_per_pixel = 4;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
|
||||||
{
|
|
||||||
*(rp) = (png_byte)((*rp - *(rp+1))&0xff);
|
|
||||||
*(rp+2) = (png_byte)((*(rp+2) - *(rp+1))&0xff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (row_info->bit_depth == 16)
|
|
||||||
{
|
|
||||||
png_bytep rp;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
|
||||||
bytes_per_pixel = 6;
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
|
||||||
bytes_per_pixel = 8;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
|
||||||
{
|
|
||||||
png_uint_32 s0=*(rp )<<8 | *(rp+1);
|
|
||||||
png_uint_32 s1=*(rp+2)<<8 | *(rp+3);
|
|
||||||
png_uint_32 s2=*(rp+4)<<8 | *(rp+5);
|
|
||||||
png_uint_32 red=(s0-s1)&0xffff;
|
|
||||||
png_uint_32 blue=(s2-s1)&0xffff;
|
|
||||||
*(rp ) = (png_byte)((red>>8)&0xff);
|
|
||||||
*(rp+1) = (png_byte)(red&0xff);
|
|
||||||
*(rp+4) = (png_byte)((blue>>8)&0xff);
|
|
||||||
*(rp+5) = (png_byte)(blue&0xff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
|
||||||
|
48
pngwutil.c
48
pngwutil.c
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* pngwutil.c - utilities to write a PNG file
|
/* pngwutil.c - utilities to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.9beta10 - January 16, 2001
|
* libpng 1.0.9beta2 - November 19, 2000
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@ -131,8 +131,6 @@ png_write_sig(png_structp png_ptr)
|
|||||||
/* write the rest of the 8 byte signature */
|
/* write the rest of the 8 byte signature */
|
||||||
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
|
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
|
||||||
(png_size_t)8 - png_ptr->sig_bytes);
|
(png_size_t)8 - png_ptr->sig_bytes);
|
||||||
if(png_ptr->sig_bytes < 3)
|
|
||||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)
|
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)
|
||||||
@ -421,24 +419,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
|||||||
compression_type = PNG_COMPRESSION_TYPE_BASE;
|
compression_type = PNG_COMPRESSION_TYPE_BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write filter_method 64 (intrapixel differencing) only if
|
if (filter_type != PNG_FILTER_TYPE_BASE)
|
||||||
* 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
|
|
||||||
* 2. Libpng did not write a PNG signature (this filter_method is only
|
|
||||||
* used in PNG datastreams that are embedded in MNG datastreams) and
|
|
||||||
* 3. The application called png_permit_mng_features with a mask that
|
|
||||||
* included PNG_FLAG_MNG_FILTER_64 and
|
|
||||||
* 4. The filter_method is 64 and
|
|
||||||
* 5. The color_type is RGB or RGBA
|
|
||||||
*/
|
|
||||||
if (
|
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
|
||||||
!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
|
|
||||||
((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
|
|
||||||
(color_type == PNG_COLOR_TYPE_RGB ||
|
|
||||||
color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
|
|
||||||
(filter_type == PNG_INTRAPIXEL_DIFFERENCING)) &&
|
|
||||||
#endif
|
|
||||||
filter_type != PNG_FILTER_TYPE_BASE)
|
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Invalid filter type specified");
|
png_warning(png_ptr, "Invalid filter type specified");
|
||||||
filter_type = PNG_FILTER_TYPE_BASE;
|
filter_type = PNG_FILTER_TYPE_BASE;
|
||||||
@ -459,7 +440,6 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
|||||||
png_ptr->bit_depth = (png_byte)bit_depth;
|
png_ptr->bit_depth = (png_byte)bit_depth;
|
||||||
png_ptr->color_type = (png_byte)color_type;
|
png_ptr->color_type = (png_byte)color_type;
|
||||||
png_ptr->interlaced = (png_byte)interlace_type;
|
png_ptr->interlaced = (png_byte)interlace_type;
|
||||||
png_ptr->filter_type = (png_byte)filter_type;
|
|
||||||
png_ptr->width = width;
|
png_ptr->width = width;
|
||||||
png_ptr->height = height;
|
png_ptr->height = height;
|
||||||
|
|
||||||
@ -677,7 +657,7 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compression_type != PNG_COMPRESSION_TYPE_BASE)
|
if (compression_type)
|
||||||
png_warning(png_ptr, "Unknown compression type in iCCP chunk");
|
png_warning(png_ptr, "Unknown compression type in iCCP chunk");
|
||||||
|
|
||||||
if (profile == NULL)
|
if (profile == NULL)
|
||||||
@ -685,7 +665,7 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
|
|||||||
|
|
||||||
if (profile_len)
|
if (profile_len)
|
||||||
profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len,
|
profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len,
|
||||||
PNG_COMPRESSION_TYPE_BASE, &comp);
|
PNG_TEXT_COMPRESSION_zTXt, &comp);
|
||||||
|
|
||||||
/* make sure we include the NULL after the name and the compression type */
|
/* make sure we include the NULL after the name and the compression type */
|
||||||
png_write_chunk_start(png_ptr, (png_bytep)png_iCCP,
|
png_write_chunk_start(png_ptr, (png_bytep)png_iCCP,
|
||||||
@ -1092,14 +1072,13 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
|||||||
png_size_t key_len;
|
png_size_t key_len;
|
||||||
png_charp kp, dp;
|
png_charp kp, dp;
|
||||||
int kflag;
|
int kflag;
|
||||||
int kwarn=0;
|
|
||||||
|
|
||||||
png_debug(1, "in png_check_keyword\n");
|
png_debug(1, "in png_check_keyword\n");
|
||||||
*new_key = NULL;
|
*new_key = NULL;
|
||||||
|
|
||||||
if (key == NULL || (key_len = png_strlen(key)) == 0)
|
if (key == NULL || (key_len = png_strlen(key)) == 0)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "zero length keyword");
|
png_chunk_warning(png_ptr, "zero length keyword");
|
||||||
return ((png_size_t)0);
|
return ((png_size_t)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1116,9 +1095,9 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
|||||||
char msg[40];
|
char msg[40];
|
||||||
|
|
||||||
sprintf(msg, "invalid keyword character 0x%02X", *kp);
|
sprintf(msg, "invalid keyword character 0x%02X", *kp);
|
||||||
png_warning(png_ptr, msg);
|
png_chunk_warning(png_ptr, msg);
|
||||||
#else
|
#else
|
||||||
png_warning(png_ptr, "invalid character in keyword");
|
png_chunk_warning(png_ptr, "invalid character in keyword");
|
||||||
#endif
|
#endif
|
||||||
*dp = ' ';
|
*dp = ' ';
|
||||||
}
|
}
|
||||||
@ -1133,7 +1112,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
|||||||
kp = *new_key + key_len - 1;
|
kp = *new_key + key_len - 1;
|
||||||
if (*kp == ' ')
|
if (*kp == ' ')
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "trailing spaces removed from keyword");
|
png_chunk_warning(png_ptr, "trailing spaces removed from keyword");
|
||||||
|
|
||||||
while (*kp == ' ')
|
while (*kp == ' ')
|
||||||
{
|
{
|
||||||
@ -1146,7 +1125,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
|||||||
kp = *new_key;
|
kp = *new_key;
|
||||||
if (*kp == ' ')
|
if (*kp == ' ')
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "leading spaces removed from keyword");
|
png_chunk_warning(png_ptr, "leading spaces removed from keyword");
|
||||||
|
|
||||||
while (*kp == ' ')
|
while (*kp == ' ')
|
||||||
{
|
{
|
||||||
@ -1168,7 +1147,6 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
|||||||
else if (*kp == ' ')
|
else if (*kp == ' ')
|
||||||
{
|
{
|
||||||
key_len--;
|
key_len--;
|
||||||
kwarn=1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1177,19 +1155,17 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*dp = '\0';
|
*dp = '\0';
|
||||||
if(kwarn)
|
|
||||||
png_warning(png_ptr, "extra interior spaces removed from keyword");
|
|
||||||
|
|
||||||
if (key_len == 0)
|
if (key_len == 0)
|
||||||
{
|
{
|
||||||
png_free(png_ptr, *new_key);
|
png_free(png_ptr, *new_key);
|
||||||
*new_key=NULL;
|
*new_key=NULL;
|
||||||
png_warning(png_ptr, "Zero length keyword");
|
png_chunk_warning(png_ptr, "Zero length keyword");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_len > 79)
|
if (key_len > 79)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "keyword length must be 1 - 79 characters");
|
png_chunk_warning(png_ptr, "keyword length must be 1 - 79 characters");
|
||||||
new_key[79] = '\0';
|
new_key[79] = '\0';
|
||||||
key_len = 79;
|
key_len = 79;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Microsoft Developer Studio Build File, Format Version 6.00 for
|
Microsoft Developer Studio Build File, Format Version 6.00 for
|
||||||
libpng 1.0.9beta10 (January 16, 2001) and zlib
|
libpng 1.0.9beta2 (November 19, 2000) and zlib
|
||||||
|
|
||||||
Copyright (C) 2000 Simon-Pierre Cadieux
|
Copyright (C) 2000 Simon-Pierre Cadieux
|
||||||
For conditions of distribution and use, see copyright notice in png.h
|
For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
@ -50,18 +50,23 @@
|
|||||||
# define VS_SPECIALBUILD 0
|
# define VS_SPECIALBUILD 0
|
||||||
#endif /* SPECIALBUILD */
|
#endif /* SPECIALBUILD */
|
||||||
|
|
||||||
#if ((PNG_LIBPNG_BUILD_TYPE & PNG_LIBPNG_BUILD_TYPEMASK) != \
|
#if defined(PNG_LIBPNG_BUILD_TYPE)
|
||||||
PNG_LIBPNG_BUILD_STABLE)
|
# if (PNG_LIBPNG_BUILD_TYPE != stable)
|
||||||
|
# if(PNG_LIBPNG_BUILD_TYPE == patched)
|
||||||
|
# define VS_PATCHED VS_FF_PATCHED
|
||||||
|
# define VS_PRERELEASE 0
|
||||||
|
# else
|
||||||
# define VS_PRERELEASE VS_FF_PRERELEASE
|
# define VS_PRERELEASE VS_FF_PRERELEASE
|
||||||
# define VS_PATCHED 0
|
# define VS_PATCHED 0
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
# define VS_PRERELEASE 0
|
# define VS_PRERELEASE 0
|
||||||
# if (PNG_LIBPNG_BUILD_TYPE & PNG_LIBPNG_BUILD_PATCHED)
|
|
||||||
# define VS_PATCHED VS_FF_PATCHED
|
|
||||||
# else
|
|
||||||
# define VS_PATCHED 0
|
# define VS_PATCHED 0
|
||||||
# endif
|
# endif /* PNG_LIBPNG_BUILD_TYPE != stable */
|
||||||
#endif
|
#else
|
||||||
|
# define VS_PRERELEASE 0
|
||||||
|
# define VS_PATCHED 0
|
||||||
|
#endif /* PNG_LIBPNG_BUILD_TYPE */
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
|
FILEVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
|
||||||
|
@ -6,7 +6,7 @@ LIBRARY
|
|||||||
DESCRIPTION "PNG image compression library for Windows"
|
DESCRIPTION "PNG image compression library for Windows"
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
;Version 1.0.9beta10
|
;Version 1.0.9beta2
|
||||||
png_build_grayscale_palette @1
|
png_build_grayscale_palette @1
|
||||||
png_check_sig @2
|
png_check_sig @2
|
||||||
png_chunk_error @3
|
png_chunk_error @3
|
||||||
@ -176,8 +176,3 @@ EXPORTS
|
|||||||
png_write_init_2 @167
|
png_write_init_2 @167
|
||||||
png_access_version_number @168
|
png_access_version_number @168
|
||||||
; png_sig_bytes @169
|
; png_sig_bytes @169
|
||||||
; png_libpng_ver @170
|
|
||||||
png_init_io @171
|
|
||||||
png_convert_to_rfc1123 @172
|
|
||||||
png_set_invalid @173
|
|
||||||
png_mmx_support @174
|
|
||||||
|
@ -8,9 +8,9 @@ libpng for WindowsCE Rel.1.0
|
|||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
This is libpng 1.0.9beta10 ported to WindowsCE 2.0 and 2.11.
|
This is libpng 1.0.9beta2 ported to WindowsCE 2.0 and 2.11.
|
||||||
libpng 1.0.9beta10 is a PNG reference library.
|
libpng 1.0.9beta2 is a PNG reference library.
|
||||||
See README, a document of original libpng 1.0.9beta10.
|
See README, a document of original libpng 1.0.9beta2.
|
||||||
|
|
||||||
zlib for WindowsCE
|
zlib for WindowsCE
|
||||||
==================
|
==================
|
||||||
@ -23,7 +23,7 @@ This software is provided 'as-is', without any express or implied
|
|||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
arising from the use of this software.
|
||||||
|
|
||||||
See README and LICENSE, documents of original libpng 1.0.9beta10, for conditions
|
See README and LICENSE, documents of original libpng 1.0.9beta2, for conditions
|
||||||
of use and distribution.
|
of use and distribution.
|
||||||
|
|
||||||
Files
|
Files
|
||||||
|
@ -24,7 +24,7 @@ libpng
|
|||||||
になったいかなる被害についても、作者、配布者、その他利用者以外の人物、
|
になったいかなる被害についても、作者、配布者、その他利用者以外の人物、
|
||||||
団体に責任をとる義務はないものとします。
|
団体に責任をとる義務はないものとします。
|
||||||
|
|
||||||
その他、このソフトウェアの利用条件については、原版である libpng 1.0.9beta10に
|
その他、このソフトウェアの利用条件については、原版である libpng 1.0.9beta2に
|
||||||
準拠するものとします。詳しくは、付属の README,LICENSE をお読みください。
|
準拠するものとします。詳しくは、付属の README,LICENSE をお読みください。
|
||||||
|
|
||||||
収録内容
|
収録内容
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@
|
|||||||
LIBRARY lpngce
|
LIBRARY lpngce
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
;Version 1.0.9beta10
|
;Version 1.0.9beta2
|
||||||
png_build_grayscale_palette @1
|
png_build_grayscale_palette @1
|
||||||
png_check_sig @2
|
png_check_sig @2
|
||||||
png_chunk_error @3
|
png_chunk_error @3
|
||||||
@ -178,5 +178,3 @@ EXPORTS
|
|||||||
png_libpng_ver @170
|
png_libpng_ver @170
|
||||||
png_init_io @171
|
png_init_io @171
|
||||||
png_convert_to_rfc1123 @172
|
png_convert_to_rfc1123 @172
|
||||||
png_set_invalid @173
|
|
||||||
png_mmx_support @174
|
|
||||||
|
@ -571,6 +571,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -583,6 +584,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -595,6 +597,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -607,6 +610,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -619,6 +623,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -631,6 +636,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -643,6 +649,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -655,6 +662,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -667,6 +675,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -679,6 +688,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -691,6 +701,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -703,6 +714,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -715,6 +727,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -727,6 +740,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -739,6 +753,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
@ -751,6 +766,7 @@ DEP_CPP_PNGTE=\
|
|||||||
"..\..\..\zlib\zconf.h"\
|
"..\..\..\zlib\zconf.h"\
|
||||||
"..\..\..\zlib\zlib.h"\
|
"..\..\..\zlib\zlib.h"\
|
||||||
"..\..\png.h"\
|
"..\..\png.h"\
|
||||||
|
"..\..\pngasmrd.h"\
|
||||||
"..\..\pngconf.h"\
|
"..\..\pngconf.h"\
|
||||||
|
|
||||||
NODEP_CPP_PNGTE=\
|
NODEP_CPP_PNGTE=\
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
# makefile for libpng using gcc (generic, static library)
|
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
||||||
# Copyright (C) 2000 Cosmin Truta
|
|
||||||
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
|
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
|
||||||
|
|
||||||
# Location of the zlib library and include files
|
|
||||||
ZLIBINC = ../zlib
|
|
||||||
ZLIBLIB = ../zlib
|
|
||||||
|
|
||||||
# Compiler, linker, lib and other tools
|
|
||||||
CC = gcc
|
|
||||||
LD = $(CC)
|
|
||||||
AR = ar rcs
|
|
||||||
RANLIB = ranlib
|
|
||||||
RM = rm -f
|
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 2
|
|
||||||
PNGMIN = 1.0.9beta10
|
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
|
||||||
|
|
||||||
prefix=/usr/local
|
|
||||||
INCPATH=$(prefix)/include
|
|
||||||
LIBPATH=$(prefix)/lib
|
|
||||||
|
|
||||||
CDEBUG = -g -DPNG_DEBUG=5
|
|
||||||
LDDEBUG =
|
|
||||||
CRELEASE = -O2
|
|
||||||
LDRELEASE = -s
|
|
||||||
CFLAGS = -I$(ZLIBINC) -Wall $(CRELEASE)
|
|
||||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE)
|
|
||||||
|
|
||||||
# File extensions
|
|
||||||
O=.o
|
|
||||||
A=.a
|
|
||||||
E=
|
|
||||||
|
|
||||||
# Variables
|
|
||||||
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
|
|
||||||
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
|
|
||||||
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
|
|
||||||
|
|
||||||
# Targets
|
|
||||||
all: libpng$(A) pngtest$(E)
|
|
||||||
|
|
||||||
libpng$(A): $(OBJS)
|
|
||||||
$(AR) $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
test: pngtest$(E)
|
|
||||||
./pngtest$(E)
|
|
||||||
|
|
||||||
pngtest$(E): pngtest$(O) libpng$(A)
|
|
||||||
$(LD) -o $@ pngtest$(O) $(LDFLAGS)
|
|
||||||
|
|
||||||
install: libpng.a
|
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
|
||||||
cp png.h pngconf.h $(INCPATH)
|
|
||||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
|
||||||
cp libpng.a $(LIBPATH)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
|
||||||
|
|
||||||
png$(O): png.h pngconf.h
|
|
||||||
pngerror$(O): png.h pngconf.h
|
|
||||||
pngget$(O): png.h pngconf.h
|
|
||||||
pngmem$(O): png.h pngconf.h
|
|
||||||
pngpread$(O): png.h pngconf.h
|
|
||||||
pngread$(O): png.h pngconf.h
|
|
||||||
pngrio$(O): png.h pngconf.h
|
|
||||||
pngrtran$(O): png.h pngconf.h
|
|
||||||
pngrutil$(O): png.h pngconf.h
|
|
||||||
pngset$(O): png.h pngconf.h
|
|
||||||
pngtest$(O): png.h pngconf.h
|
|
||||||
pngtrans$(O): png.h pngconf.h
|
|
||||||
pngwio$(O): png.h pngconf.h
|
|
||||||
pngwrite$(O): png.h pngconf.h
|
|
||||||
pngwtran$(O): png.h pngconf.h
|
|
||||||
pngwutil$(O): png.h pngconf.h
|
|
||||||
|
|
@ -31,7 +31,7 @@ RANLIB=ranlib
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng.so*, and png.h
|
# where make install puts libpng.a, libpng.so*, and png.h
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h
|
# where "make install" puts libpng.a, libpng.so*, png.h and pngconf.h
|
||||||
prefix=/usr
|
prefix=/usr
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
@ -38,8 +38,7 @@ CFLAGS=-I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGMIN_BASE = 1.0.9
|
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
SHAREDLIB=cygpng$(PNGMAJ).dll
|
SHAREDLIB=cygpng$(PNGMAJ).dll
|
||||||
@ -61,7 +60,7 @@ LIBPATH=$(prefix)/lib
|
|||||||
BINPATH=$(prefix)/bin
|
BINPATH=$(prefix)/bin
|
||||||
MANPATH=$(prefix)/man
|
MANPATH=$(prefix)/man
|
||||||
MAN3PATH=$(MANPATH)/man3
|
MAN3PATH=$(MANPATH)/man3
|
||||||
DOCPATH=$(prefix)/doc/libpng-$(PNGMIN_BASE)
|
DOCPATH=$(prefix)/doc/libpng-$(PNGMIN)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@ -87,14 +86,14 @@ all-static: $(STATLIB) pngtest-stat$(EXE)
|
|||||||
|
|
||||||
all-shared: $(SHAREDLIB) pngtest$(EXE)
|
all-shared: $(SHAREDLIB) pngtest$(EXE)
|
||||||
|
|
||||||
pnggccrd.o: png.h pngconf.h
|
pnggccrd.o: png.h pngconf.h pngasmrd.h
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
@echo ' You can ignore the single "control reaches end of non-void function"'
|
||||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
||||||
@echo ""
|
@echo ""
|
||||||
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $*.c
|
||||||
|
|
||||||
pnggccrd.pic.o: png.h pngconf.h
|
pnggccrd.pic.o: png.h pngconf.h pngasmrd.h
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
@echo ' You can ignore the single "control reaches end of non-void function"'
|
||||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
||||||
@ -165,7 +164,7 @@ writelock:
|
|||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|
||||||
png.o png.pic.o: png.h pngconf.h png.c
|
png.o png.pic.o: png.h pngconf.h png.c pngasmrd.h
|
||||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
|
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
|
||||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
|
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
|
||||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
|
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
|
||||||
@ -174,7 +173,7 @@ pngset.o pngset.pic.o: png.h pngconf.h pngset.c
|
|||||||
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
|
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
|
||||||
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
|
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
|
||||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
|
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
|
||||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c
|
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c pngasmrd.h
|
||||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
|
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
|
||||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
|
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
|
||||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
|
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
|
||||||
|
@ -17,7 +17,7 @@ ZLIBINC=../zlib
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
CC=cc
|
CC=cc
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
# makefile for libpng on Linux ELF with gcc using MMX assembler code
|
# makefile for libpng on Linux ELF with gcc using MMX assembler code
|
||||||
# Copyright 1996-1997 Andreas Dilger
|
# Copyright 1996-1997 Andreas Dilger
|
||||||
# Copyright 1998-2001 Greg Roelofs
|
# Copyright 1998-2000 Greg Roelofs
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# CAUTION: Do not use this makefile with gcc versions 2.7.2.2 and earlier.
|
# CAUTION: Do not use this makefile with gcc versions 2.7.2.2 and earlier.
|
||||||
|
|
||||||
# NOTE: When testing MMX performance on a multitasking system, make sure
|
|
||||||
# there are no floating-point programs (e.g., SETI@Home) running in
|
|
||||||
# the background! Context switches between MMX and FPU are expensive.
|
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h
|
# where "make install" puts libpng.a, libpng.so*, png.h and pngconf.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
@ -30,18 +26,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
|
|
||||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||||
|
|
||||||
### for generic gcc:
|
|
||||||
CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
||||||
-fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
-fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
### for gcc 2.95.2 on 686:
|
|
||||||
#CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 \
|
|
||||||
# -mcpu=i686 -malign-double -ffast-math -fstrict-aliasing \
|
|
||||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
|
||||||
### for gcc 2.7.2.3 on 486 and up:
|
|
||||||
#CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 \
|
|
||||||
# -m486 -malign-double -ffast-math \
|
|
||||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
|
||||||
|
|
||||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
|
||||||
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
||||||
|
|
||||||
@ -51,7 +37,7 @@ RANLIB=ranlib
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
@ -70,21 +56,19 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
|
|
||||||
all: libpng.a libpng.so pngtest pngtest-static
|
all: libpng.a libpng.so pngtest pngtest-static
|
||||||
|
|
||||||
pnggccrd.o: pnggccrd.c png.h pngconf.h
|
pnggccrd.o: pnggccrd.c png.h pngconf.h pngasmrd.h
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
@echo ' You can ignore the single "control reaches end of non-void function"'
|
||||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
||||||
@echo ""
|
@echo ""
|
||||||
$(CC) -c $(CFLAGS) -o $@ $*.c
|
$(CC) -c $(CFLAGS) -o $@ $*.c
|
||||||
@echo ""
|
|
||||||
|
|
||||||
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h
|
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h pngasmrd.h
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
@echo ' You can ignore the single "control reaches end of non-void function"'
|
||||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
||||||
@echo ""
|
@echo ""
|
||||||
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c
|
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c
|
||||||
@echo ""
|
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
@ -134,7 +118,7 @@ DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
|||||||
writelock:
|
writelock:
|
||||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
chmod a-w *.[ch35] $(DOCS) scripts/*
|
||||||
|
|
||||||
png.o png.pic.o: png.h pngconf.h png.c
|
png.o png.pic.o: png.h pngconf.h png.c pngasmrd.h
|
||||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
|
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
|
||||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
|
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
|
||||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
|
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
|
||||||
@ -143,7 +127,7 @@ pngset.o pngset.pic.o: png.h pngconf.h pngset.c
|
|||||||
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
|
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
|
||||||
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
|
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
|
||||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
|
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
|
||||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c
|
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c pngasmrd.h
|
||||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
|
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
|
||||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
|
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
|
||||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
|
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
|
||||||
|
@ -18,7 +18,7 @@ RANLIB=ranlib
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install puts libpng.a and png.h
|
||||||
|
@ -70,7 +70,7 @@ pngrtran$(O): png.h pngconf.h
|
|||||||
pngrutil$(O): png.h pngconf.h
|
pngrutil$(O): png.h pngconf.h
|
||||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngvcrd$(O): png.h pngconf.h
|
pngvcrd$(O): png.h pngconf.h pngasmrd.h
|
||||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngerror$(O): png.h pngconf.h
|
pngerror$(O): png.h pngconf.h
|
||||||
|
@ -34,7 +34,7 @@ RANLIB=ranlib
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
# makefile for libpng, MACOS X
|
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
|
||||||
prefix=/usr/local
|
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
|
||||||
#ZLIBLIB=/usr/local/lib
|
|
||||||
#ZLIBINC=/usr/local/include
|
|
||||||
ZLIBLIB=../zlib
|
|
||||||
ZLIBINC=../zlib
|
|
||||||
|
|
||||||
CC=cc
|
|
||||||
CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
|
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
|
||||||
|
|
||||||
#RANLIB=echo
|
|
||||||
RANLIB=ranlib
|
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
|
||||||
|
|
||||||
all: libpng.a pngtest
|
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
|
||||||
ar rc $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
|
||||||
|
|
||||||
test: pngtest
|
|
||||||
./pngtest
|
|
||||||
|
|
||||||
install: libpng.a
|
|
||||||
-@mkdir $(prefix)/include
|
|
||||||
-@mkdir $(prefix)/lib
|
|
||||||
cp png.h $(prefix)/include
|
|
||||||
cp pngconf.h $(prefix)/include
|
|
||||||
chmod 644 $(prefix)/include/png.h
|
|
||||||
chmod 644 $(prefix)/include/pngconf.h
|
|
||||||
cp libpng.a $(prefix)/lib
|
|
||||||
chmod 644 $(prefix)/lib/libpng.a
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o libpng.a pngtest pngout.png
|
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
|
||||||
writelock:
|
|
||||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
||||||
|
|
||||||
png.o: png.h pngconf.h
|
|
||||||
pngerror.o: png.h pngconf.h
|
|
||||||
pngrio.o: png.h pngconf.h
|
|
||||||
pngwio.o: png.h pngconf.h
|
|
||||||
pngmem.o: png.h pngconf.h
|
|
||||||
pngset.o: png.h pngconf.h
|
|
||||||
pngget.o: png.h pngconf.h
|
|
||||||
pngread.o: png.h pngconf.h
|
|
||||||
pngrtran.o: png.h pngconf.h
|
|
||||||
pngrutil.o: png.h pngconf.h
|
|
||||||
pngtest.o: png.h pngconf.h
|
|
||||||
pngtrans.o: png.h pngconf.h
|
|
||||||
pngwrite.o: png.h pngconf.h
|
|
||||||
pngwtran.o: png.h pngconf.h
|
|
||||||
pngwutil.o: png.h pngconf.h
|
|
||||||
pngpread.o: png.h pngconf.h
|
|
||||||
|
|
@ -25,7 +25,7 @@ RANLIB=echo
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
|
@ -13,14 +13,14 @@ ZLIBINC=/usr/local/include
|
|||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
WARNMORE= # -g -DPNG_DEBUG=5
|
WARNMORE=
|
||||||
CFLAGS=-I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32
|
CFLAGS=-I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 # -g -DPNG_DEBUG=5
|
||||||
# zlib must also be compiled with n32
|
# zlib must also be compiled with n32
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||||
LDSHARED=gcc -shared
|
LDSHARED=gcc -shared
|
||||||
|
|
||||||
VER=1.0.9beta10
|
VER=1.0.9beta2
|
||||||
LIBS=libpng.so.1.0.9beta10
|
LIBS=libpng.so.1.0.9beta2
|
||||||
SHAREDLIB=libpng.so
|
SHAREDLIB=libpng.so
|
||||||
libdir=$(prefix)/lib32
|
libdir=$(prefix)/lib32
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ RANLIB=echo
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0.9beta10
|
PNGMIN = 1.0.9beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
|
@ -46,10 +46,10 @@ pngpread$(O): png.h pngconf.h
|
|||||||
pngrtran$(O): png.h pngconf.h
|
pngrtran$(O): png.h pngconf.h
|
||||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngrutil$(O): png.h pngconf.h
|
pngrutil$(O): png.h pngconf.h pngasmrd.h
|
||||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngvcrd$(O): png.h pngconf.h
|
pngvcrd$(O): png.h pngconf.h pngasmrd.h
|
||||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngerror$(O): png.h pngconf.h
|
pngerror$(O): png.h pngconf.h
|
||||||
|
@ -42,7 +42,7 @@ pngpread$(O): png.h pngconf.h
|
|||||||
pngrtran$(O): png.h pngconf.h
|
pngrtran$(O): png.h pngconf.h
|
||||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngrutil$(O): png.h pngconf.h
|
pngrutil$(O): png.h pngconf.h pngasmrd.h
|
||||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||||
|
|
||||||
pngerror$(O): png.h pngconf.h
|
pngerror$(O): png.h pngconf.h
|
||||||
|
@ -5,7 +5,7 @@ unit pngdef;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
const
|
const
|
||||||
PNG_LIBPNG_VER_STRING = '1.0.9beta10';
|
PNG_LIBPNG_VER_STRING = '1.0.9beta2';
|
||||||
PNG_LIBPNG_VER = 10009;
|
PNG_LIBPNG_VER = 10009;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -325,6 +325,3 @@ EXPORTS
|
|||||||
png_tIME
|
png_tIME
|
||||||
png_tRNS
|
png_tRNS
|
||||||
png_zTXt
|
png_zTXt
|
||||||
|
|
||||||
png_mmx_supported
|
|
||||||
png_permit_empty_plte
|
|
||||||
|
Reference in New Issue
Block a user