mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng10] Imported from libpng-1.0.13.tar
This commit is contained in:
53
ANNOUNCE
53
ANNOUNCE
@@ -1,20 +1,49 @@
|
||||
|
||||
Libpng 1.0.12beta1 - May 14, 2001
|
||||
Libpng 1.0.13 - April 15, 2002
|
||||
|
||||
This is a public release of libpng, intended for use in production codes.
|
||||
|
||||
Changes since the last public release (1.0.11):
|
||||
Changes since the last public release (1.2.1):
|
||||
|
||||
Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot)
|
||||
Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h
|
||||
Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings.
|
||||
Bumped DLLNUM to 2.
|
||||
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
|
||||
Eliminated the png_error about apps using png_read|write_init(). Instead,
|
||||
libpng will reallocate the png_struct and info_struct if they are too small.
|
||||
This achieves future binary compatibility for old applications written for
|
||||
libpng-0.88 and earlier.
|
||||
Modified png_create_struct so it passes user mem_ptr to user memory allocator.
|
||||
Fixed a bug with reading the length of iCCP profiles (Larry Reeves).
|
||||
Revised makefile.linux, makefile.gcmmx, and others to generate
|
||||
libpng.a, libpngNN.so, libpng.so.NN, and libpngNN/png.h
|
||||
Revised makefile.darwin to remove "-undefined suppress" option.
|
||||
Added checks for gamma and chromaticity values over 21474.83, which exceed
|
||||
the limit for PNG unsigned 32-bit integers when encoded.
|
||||
Revised calls to png_create_read_struct() and png_create_write_struct()
|
||||
for simpler debugging.
|
||||
Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK)
|
||||
Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths.
|
||||
Check for invalid image dimensions in png_get_IHDR.
|
||||
Added install-shared and install-static targets to all makefiles that make
|
||||
shared libraries.
|
||||
Always do gamma compensation when image is partially transparent.
|
||||
Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
|
||||
Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
|
||||
Removed unused png_write_destroy_info prototype from png.h
|
||||
Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
|
||||
Stopped a double free of palette, hist, and trans when not using free_me.
|
||||
Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
|
||||
Compute background.gray and background_1.gray even when color_type is RGB
|
||||
in case image gets reduced to gray later (Jason Summers).
|
||||
Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library.
|
||||
Added missing PNGAPI to several function definitions.
|
||||
Check for invalid bit_depth or color_type in png_get_IHDR(), and
|
||||
check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen).
|
||||
Revised iTXt support to accept NULL for lang and lang_key.
|
||||
Compute gamma for color components of background even when color_type is gray.
|
||||
Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN
|
||||
Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so
|
||||
Prevent png_zalloc() from trying to memset memory that it failed to acquire.
|
||||
Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate).
|
||||
Ensure that the right function (user or default) is used to free the
|
||||
png_struct after an error in png_create_read_struct_2().
|
||||
Save the ebx register in pnggccrd.c (Sami Farin)
|
||||
Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner).
|
||||
Updated makefiles to put headers in include/libpng and remove old include/*.h.
|
||||
Revised description of png_set_filter() in libpng.3/libpng.txt.
|
||||
Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||
|
||||
141
CHANGES
141
CHANGES
@@ -1,3 +1,4 @@
|
||||
|
||||
CHANGES - changes for libpng
|
||||
|
||||
version 0.2
|
||||
@@ -732,10 +733,11 @@ version 1.0.6j [May 3, 2000]
|
||||
version 1.0.7beta11 [May 7, 2000]
|
||||
Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
|
||||
which are no longer used.
|
||||
Eliminated the three new members of png_text when PNG_NO_iTXt_SUPPORTED
|
||||
or PNG_LEGACY_SUPPORTED is defined.
|
||||
Made PNG_NO_ITXT_SUPPORTED the default setting, to avoid memory overrun
|
||||
when old applications fill the info_ptr->text structure directly.
|
||||
Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is
|
||||
defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED
|
||||
is defined.
|
||||
Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory
|
||||
overrun when old applications fill the info_ptr->text structure directly.
|
||||
Added PNGAPI macro, and added it to the definitions of all exported functions.
|
||||
Relocated version macro definitions ahead of the includes of zlib.h and
|
||||
pngconf.h in png.h.
|
||||
@@ -934,13 +936,138 @@ version 1.0.12beta1 [May 14, 2001]
|
||||
Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot)
|
||||
Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h
|
||||
Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings.
|
||||
Bumped DLLNUM to 2.
|
||||
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
|
||||
Eliminated the png_error about apps using png_read|write_init(). Instead,
|
||||
libpng will reallocate the png_struct and info_struct if they are too small.
|
||||
This achieves future binary compatibility for old applications written for
|
||||
This retains future binary compatibility for old applications written for
|
||||
libpng-0.88 and earlier.
|
||||
version 1.2.0beta1 [May 6, 2001]
|
||||
Bumped DLLNUM to 2.
|
||||
Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
by default.
|
||||
Added runtime selection of MMX features.
|
||||
Added png_set_strip_error_numbers function and related macros.
|
||||
version 1.2.0beta2 [May 7, 2001]
|
||||
Finished merging 1.2.0beta1 with version 1.0.11
|
||||
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
|
||||
version 1.2.0beta3 [May 17, 2001]
|
||||
Enabled user memory function by default.
|
||||
Modified png_create_struct so it passes user mem_ptr to user memory allocator.
|
||||
Increased png_mng_features flag from png_byte to png_uint_32.
|
||||
Bumped shared-library (so-number) and dll-number to 3.
|
||||
version 1.2.0beta4 [June 23, 2001]
|
||||
Check for missing profile length field in iCCP chunk and free chunk_data
|
||||
in case of truncated iCCP chunk.
|
||||
Bumped shared-library number to 3 in makefile.sgi and makefile.sggcc
|
||||
Bumped dll-number from 2 to 3 in makefile.cygwin
|
||||
Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly
|
||||
if user attempts to run it on an 8-bit display.
|
||||
Updated contrib/gregbook
|
||||
Use png_malloc instead of png_zalloc to allocate palette in pngset.c
|
||||
Updated makefile.ibmc
|
||||
Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes
|
||||
of png_write_oFFS width and height from png_uint_32 to png_int_32.
|
||||
Updated example.c
|
||||
Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c
|
||||
version 1.2.0beta5 [August 8, 2001]
|
||||
Revised contrib/gregbook
|
||||
Revised makefile.gcmmx
|
||||
Revised pnggccrd.c to conditionally compile some thread-unsafe code only
|
||||
when PNG_THREAD_UNSAFE_OK is defined.
|
||||
Added tests to prevent pngwutil.c from writing a bKGD or tRNS chunk with
|
||||
value exceeding 2^bit_depth-1
|
||||
Revised makefile.sgi and makefile.sggcc
|
||||
Replaced calls to fprintf(stderr,...) with png_warning() in pnggccrd.c
|
||||
Removed restriction that do_invert_mono only operate on 1-bit opaque files
|
||||
version 1.2.0 [September 1, 2001]
|
||||
Changed a png_warning() to png_debug() in pnggccrd.c
|
||||
Fixed contrib/gregbook/rpng-x.c, rpng2-x.c to avoid crash with XFreeGC().
|
||||
version 1.2.1beta1 [October 19, 2001]
|
||||
Revised makefile.std in contrib/pngminus
|
||||
Include background_1 in png_struct regardless of gamma support.
|
||||
Revised makefile.netbsd and makefile.macosx, added makefile.darwin.
|
||||
Revised example.c to provide more details about using row_callback().
|
||||
version 1.2.1beta2 [October 25, 2001]
|
||||
Added type cast to each NULL appearing in a function call, except for
|
||||
WINCE functions.
|
||||
Added makefile.so9.
|
||||
version 1.2.1beta3 [October 27, 2001]
|
||||
Removed type casts from all NULLs.
|
||||
Simplified png_create_struct_2().
|
||||
version 1.2.1beta4 [November 7, 2001]
|
||||
Revised png_create_info_struct() and png_creat_struct_2().
|
||||
Added error message if png_write_info() was omitted.
|
||||
Type cast NULLs appearing in function calls when _NO_PROTO or
|
||||
PNG_TYPECAST_NULL is defined.
|
||||
version 1.2.1rc1 [November 24, 2001]
|
||||
Type cast NULLs appearing in function calls except when PNG_NO_TYPECAST_NULL
|
||||
is defined.
|
||||
Changed typecast of "size" argument to png_size_t in pngmem.c calls to
|
||||
the user malloc_fn, to agree with the prototype in png.h
|
||||
Added a pop/push operation to pnggccrd.c, to preserve Eflag (Maxim Sobolev)
|
||||
Updated makefile.sgi to recognize LIBPATH and INCPATH.
|
||||
Updated various makefiles so "make clean" does not remove previous major
|
||||
version of the shared library.
|
||||
version 1.2.1rc2 [December 4, 2001]
|
||||
Added a pop/push operation to pngvcrd.c, to preserve Eflag.
|
||||
Always allocate 256-entry internal palette, hist, and trans arrays, to
|
||||
avoid out-of-bounds memory reference caused by invalid PNG datastreams.
|
||||
Added a check for prefix_length > data_length in iCCP chunk handler.
|
||||
version 1.2.1 [December 7, 2001]
|
||||
None.
|
||||
version 1.2.2beta1 [February 22, 2002]
|
||||
Fixed a bug with reading the length of iCCP profiles (Larry Reeves).
|
||||
Revised makefile.linux, makefile.gcmmx, and makefile.sgi to generate
|
||||
libpng.a, libpng12.so (not libpng.so.3), and libpng12/png.h
|
||||
Revised makefile.darwin to remove "-undefined suppress" option.
|
||||
Added checks for gamma and chromaticity values over 21474.83, which exceed
|
||||
the limit for PNG unsigned 32-bit integers when encoded.
|
||||
Revised calls to png_create_read_struct() and png_create_write_struct()
|
||||
for simpler debugging.
|
||||
Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK)
|
||||
version 1.2.2beta2 [February 23, 2002]
|
||||
Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths.
|
||||
Check for invalid image dimensions in png_get_IHDR.
|
||||
Added missing "fi;" in the install target of the SGI makefiles.
|
||||
Added install-static to all makefiles that make shared libraries.
|
||||
Always do gamma compensation when image is partially transparent.
|
||||
version 1.2.2beta3 [March 7, 2002]
|
||||
Compute background.gray and background_1.gray even when color_type is RGB
|
||||
in case image gets reduced to gray later.
|
||||
Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
|
||||
Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
|
||||
Removed unused png_write_destroy_info prototype from png.h
|
||||
Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
|
||||
Added install-shared target to all makefiles that make shared libraries.
|
||||
Stopped a double free of palette, hist, and trans when not using free_me.
|
||||
Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
|
||||
version 1.2.2beta4 [March 8, 2002]
|
||||
Compute background.gray and background_1.gray even when color_type is RGB
|
||||
in case image gets reduced to gray later (Jason Summers).
|
||||
Relocated a misplaced /bin/rm in the "install-shared" makefile targets
|
||||
Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library.
|
||||
version 1.2.2beta5 [March 26, 2002]
|
||||
Added missing PNGAPI to several function definitions.
|
||||
Check for invalid bit_depth or color_type in png_get_IHDR(), and
|
||||
check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen).
|
||||
Revised iTXt support to accept NULL for lang and lang_key.
|
||||
Compute gamma for color components of background even when color_type is gray.
|
||||
Changed "()" to "{}" in scripts/libpng.pc.in.
|
||||
Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN
|
||||
Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so
|
||||
version 1.2.2beta6 [March 31, 2002]
|
||||
version 1.0.13beta1 [March 31, 2002]
|
||||
Prevent png_zalloc() from trying to memset memory that it failed to acquire.
|
||||
Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate).
|
||||
Ensure that the right function (user or default) is used to free the
|
||||
png_struct after an error in png_create_read_struct_2().
|
||||
version 1.2.2rc1 [April 7, 2002]
|
||||
version 1.0.13rc1 [April 7, 2002]
|
||||
Save the ebx register in pnggccrd.c (Sami Farin)
|
||||
Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner).
|
||||
Updated makefiles to put headers in include/libpng and remove old include/*.h.
|
||||
version 1.0.13 [April 15, 2002]
|
||||
Revised description of png_set_filter() in libpng.3/libpng.txt.
|
||||
Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||
|
||||
29
INSTALL
29
INSTALL
@@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.0.12beta1 - May 14, 2001
|
||||
Installing libpng version 1.0.13 - April 15, 2002
|
||||
|
||||
Before installing libpng, you must first install zlib. zlib
|
||||
can usually be found wherever you got libpng. zlib can be
|
||||
@@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
|
||||
version of zlib that's installed.
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.0.12beta1" or "lpng109" and "zlib-1.1.3"
|
||||
might be called "libpng-1.0.13" or "lpng109" and "zlib-1.1.3"
|
||||
or "zlib113") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
@@ -31,7 +31,8 @@ Your directory structure should look like this:
|
||||
beos
|
||||
borland
|
||||
msvc
|
||||
wince
|
||||
netware.txt
|
||||
wince.txt
|
||||
scripts
|
||||
makefile.*
|
||||
pngtest.png
|
||||
@@ -48,9 +49,12 @@ distribution of libpng. It is available in both tar.gz (UNIX style line
|
||||
endings) and zip (DOS style line endings) formats.
|
||||
|
||||
If you are building libpng with MSVC, you can enter the libpng\msvc directory
|
||||
and follow the instructions in msvc\README.txt. You can build libpng for
|
||||
WindowsCE by entering the libpng\wince directory and following the
|
||||
instructions in the README* files.
|
||||
and follow the instructions in msvc\README.txt.
|
||||
|
||||
You can build libpng for WindowsCE by entering the downloading and installing
|
||||
the libpng\wince directory as instructed in the projects\wince.txt file, and
|
||||
then following the instructions in the README* files. Similarly, you can
|
||||
build libpng for Netware as instructed in projects\netware.txt.
|
||||
|
||||
Else enter the zlib directory and follow the instructions in zlib/README,
|
||||
then come back here and choose the appropriate makefile.sys in the scripts
|
||||
@@ -60,8 +64,8 @@ The files that are presently available in the scripts directory
|
||||
include
|
||||
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.12beta1,
|
||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng10.so.0.1.0.13,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@@ -69,6 +73,7 @@ include
|
||||
ftp://ftp.cs.wisc.edu/ghost)
|
||||
makefile.aix => AIX makefile
|
||||
makefile.cygwin => Cygwin/gcc makefile
|
||||
makefile.darwin => Darwin makefile
|
||||
makefile.dec => DEC Alpha UNIX makefile
|
||||
makefile.hpgcc => HPUX makefile using gcc
|
||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||
@@ -77,10 +82,14 @@ include
|
||||
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||
makefile.macosx => MACOS X Makefile
|
||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.so9 => Solaris 9 makefile (gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.mips => MIPS makefile
|
||||
makefile.acorn => Acorn makefile
|
||||
|
||||
6
KNOWNBUG
6
KNOWNBUG
@@ -1,7 +1,9 @@
|
||||
|
||||
Known bugs in libpng-1.0.11
|
||||
Known bugs in libpng version 1.0.13
|
||||
|
||||
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
||||
reading interlaced PNG files, when assembler code is enabled.
|
||||
|
||||
STATUS: Under investigation.
|
||||
STATUS: Under investigation. The change to pnggccrd.c in libpng-1.2.1
|
||||
fixed a problem under FreeBSD but not the problem with NetBSD.
|
||||
|
||||
|
||||
14
LICENSE
14
LICENSE
@@ -8,8 +8,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.0.12beta1, May 14, 2001, are
|
||||
Copyright (c) 2000, 2001 Glenn Randers-Pehrson
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.0.13, April 15, 2002, are
|
||||
Copyright (c) 2000-2002 Glenn Randers-Pehrson
|
||||
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
|
||||
|
||||
@@ -73,11 +73,11 @@ to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented.
|
||||
|
||||
2. Altered versions must be plainly marked as such and
|
||||
must not be misrepresented as being the original source.
|
||||
2. Altered versions must be plainly marked as such and must not
|
||||
be misrepresented as being the original source.
|
||||
|
||||
3. This Copyright notice may not be removed or altered from
|
||||
any source or altered source distribution.
|
||||
3. This Copyright notice may not be removed or altered from any
|
||||
source or altered source distribution.
|
||||
|
||||
The Contributing Authors and Group 42, Inc. specifically permit, without
|
||||
fee, and encourage the use of this source code as a component to
|
||||
@@ -99,4 +99,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
randeg@alum.rpi.edu
|
||||
May 14, 2001
|
||||
April 15, 2002
|
||||
|
||||
24
README
24
README
@@ -1,4 +1,4 @@
|
||||
README for libpng 1.0.12beta1 - May 14, 2001 (shared library 2.1)
|
||||
README for libpng 1.0.13 - April 15, 2002 (shared library 2.1)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
@@ -177,15 +177,19 @@ Files in this distribution:
|
||||
and zlib
|
||||
msvc => Contains a Microsoft Visual C++ (MSVC) workspace
|
||||
for building libpng and zlib
|
||||
wince => Contains a Microsoft Visual C++ (Windows CD Toolkit)
|
||||
workspace for building libpng and zlib on WindowsCE
|
||||
netware.txt => Contains instructions for downloading a set of
|
||||
project files for building libpng and zlib on
|
||||
Netware.
|
||||
wince.txt => Contains instructions for downloading a Microsoft
|
||||
Visual C++ (Windows CD Toolkit) workspace for
|
||||
building libpng and zlib on WindowsCE
|
||||
scripts => Directory containing scripts for building libpng:
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng.so.2.1.0.12beta1)
|
||||
(gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||
libpng.so.2.1.0.12beta1, uses assembler code
|
||||
libpng10.so.0.1.0.13, uses assembler code
|
||||
tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@@ -193,6 +197,7 @@ Files in this distribution:
|
||||
ftp://ftp.cs.wisc.edu/ghost)
|
||||
makefile.aix => AIX makefile
|
||||
makefile.cygwin => Cygwin/gcc makefile
|
||||
makefile.darwin => Darwin makefile
|
||||
makefile.dec => DEC Alpha UNIX makefile
|
||||
makefile.hpgcc => HPUX makefile using gcc
|
||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||
@@ -201,11 +206,16 @@ Files in this distribution:
|
||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||
makefile.macosx => MACOS X Makefile
|
||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng.so.2.1.0.12beta1)
|
||||
(gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.so9 => Solaris 9 makefile
|
||||
(gcc, creates libpng10.so.0.1.0.13)
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.mips => MIPS makefile
|
||||
makefile.acorn => Acorn makefile
|
||||
|
||||
4
Y2KINFO
4
Y2KINFO
@@ -1,13 +1,13 @@
|
||||
Y2K compliance in libpng:
|
||||
=========================
|
||||
|
||||
May 14, 2001
|
||||
April 15, 2002
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.0.12beta1 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.0.13 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
|
||||
2
configure
vendored
2
configure
vendored
@@ -1,5 +1,5 @@
|
||||
echo "
|
||||
There is no \"configure\" script for Libpng-1.0.12beta1. Instead, please
|
||||
There is no \"configure\" script for Libpng-1.0.13. Instead, please
|
||||
copy the appropriate makefile for your system from the \"scripts\"
|
||||
directory. Read the INSTALL file for more details.
|
||||
"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Sample makefile for rpng-x / rpng2-x / wpng for SGI using cc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 16 January 1000
|
||||
# Last modified: 7 March 2002
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
# 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
|
||||
PNGINC = -I/usr/local/include/libpng10
|
||||
PNGLIB = -L/usr/local/lib -lpng10 # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng10.a # statically linked against libpng
|
||||
# or:
|
||||
#PNGINC = -I../..
|
||||
#PNGLIB = -L../.. -lpng
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 28 February 2000
|
||||
# Last modified: 7 March 2002
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
@@ -23,24 +23,24 @@
|
||||
|
||||
# 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
|
||||
PNGINC = -I/usr/local/include/libpng10
|
||||
#PNGLIB = -L/usr/local/lib -lpng10 # dynamically linked against libpng
|
||||
PNGLIB = /usr/local/lib/libpng10.a # statically linked against libpng
|
||||
# or:
|
||||
#PNGINC = -I../..
|
||||
#PNGLIB = -L../.. -lpng
|
||||
#PNGLIB = ../../libpng.a
|
||||
#PNGINC = -I../libpng
|
||||
#PNGLIB = -L../libpng -lpng
|
||||
#PNGLIB = ../libpng/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
|
||||
#ZLIB = ../zlib/libz.a
|
||||
|
||||
#XINC = -I/usr/include/X11 # old-style, stock X distributions
|
||||
#XINC = -I/usr/include # old-style, stock X distributions
|
||||
#XLIB = -L/usr/lib/X11 -lX11
|
||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||
#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
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGPATH = ../..
|
||||
PNGPATH = ../libpng
|
||||
PNGINC = -I$(PNGPATH)
|
||||
#PNGLIB = $(PNGPATH)/pngdll.lib
|
||||
PNGLIB = $(PNGPATH)/libpng.lib
|
||||
|
||||
ZPATH = ../../../zlib
|
||||
ZPATH = ../zlib
|
||||
ZINC = -I$(ZPATH)
|
||||
#ZLIB = $(ZPATH)/zlibdll.lib
|
||||
ZLIB = $(ZPATH)/zlibstat.lib
|
||||
|
||||
@@ -16,13 +16,12 @@ of PBMPLUS/NetPBM) and converts them to PNG.
|
||||
The source code for all three demo programs currently compiles under
|
||||
Unix, OpenVMS, and 32-bit Windows. (Special thanks to Martin Zinser,
|
||||
zinser@decus.de, for making the necessary changes for OpenVMS and for
|
||||
providing an appropriate build script.) Build instructions can be
|
||||
found below.
|
||||
providing an appropriate build script.) Build instructions can be found
|
||||
below.
|
||||
|
||||
Files:
|
||||
|
||||
README this file
|
||||
README.w32 additional Windows-specific information
|
||||
LICENSE terms of distribution and reuse (BSD-like)
|
||||
|
||||
Makefile.unx Unix makefile
|
||||
@@ -45,26 +44,27 @@ Files:
|
||||
|
||||
toucan.png transparent PNG for testing (by Stefan Schneider)
|
||||
|
||||
Note that the programs are designed to be functional, but their primary
|
||||
purpose is to demonstrate how to use libpng to add PNG support to other
|
||||
programs. As such, their user interfaces are crude and definitely not
|
||||
intended for everyday use.
|
||||
Note that, although the programs are designed to be functional, their
|
||||
primary purpose is to illustrate how to use libpng to add PNG support to
|
||||
other programs. As such, their user interfaces are crude and definitely
|
||||
are not intended for everyday use.
|
||||
|
||||
Please see http://www.cdrom.com/pub/png/pngbook.html for further infor-
|
||||
Please see http://www.libpng.org/pub/png/pngbook.html for further infor-
|
||||
mation and links to the latest version of the source code, and Chapters
|
||||
13-15 of the book for detailed discussion of the three programs.
|
||||
|
||||
Greg Roelofs
|
||||
19 March 2000
|
||||
newt@pobox.com
|
||||
30 June 2001
|
||||
|
||||
|
||||
BUILD INSTRUCTIONS
|
||||
|
||||
- Prerequisites:
|
||||
- Prerequisites (in order of compilation):
|
||||
|
||||
- zlib ftp://ftp.cdrom.com/pub/infozip/zlib/zlib.html
|
||||
- libpng http://www.cdrom.com/pub/png/pngcode.html
|
||||
- pngbook http://www.cdrom.com/pub/png/book/sources.html
|
||||
- zlib http://www.gzip.org/zlib/
|
||||
- libpng http://www.libpng.org/pub/png/libpng.html
|
||||
- pngbook http://www.libpng.org/pub/png/book/sources.html
|
||||
|
||||
The pngbook demo programs are explicitly designed to demonstrate proper
|
||||
coding techniques for using the libpng reference library. As a result,
|
||||
@@ -128,11 +128,13 @@ BUILD INSTRUCTIONS
|
||||
|
||||
The result should be three executables: rpng-win.exe, rpng2-win.exe,
|
||||
and wpng.exe. Copy them somewhere in your PATH or run them from the
|
||||
current folder. Unlike the Unix versions, the two windowed programs
|
||||
(rpng and rpng2) do not display a usage screen when invoked without
|
||||
command-line arguments; see README.w32 for brief help or the book for
|
||||
details. Note that the programs use the Unix-style "-" character to
|
||||
specify options, instead of the more common DOS/Windows "/" character.
|
||||
current folder. Like the Unix versions, the two windowed programs
|
||||
(rpng and rpng2) now display a usage screen in a console window when
|
||||
invoked without command-line arguments; this is new behavior as of
|
||||
the June 2001 release. Note that the programs use the Unix-style "-"
|
||||
character to specify options, instead of the more common DOS/Windows
|
||||
"/" character. (For example: "rpng2-win -bgpat 4 foo.png", not
|
||||
"rpng2-win /bgpat 4 foo.png")
|
||||
|
||||
|
||||
- OpenVMS:
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
See the main README file for basic instructions on compiling and running
|
||||
the programs. See http://www.cdrom.com/pub/png/pngbook.html for further
|
||||
information and links to the source code, and Chapters 13-15 of the book
|
||||
for detailed discussion of the three programs.
|
||||
|
||||
Since the two viewers, rpng and rpng2, are both designed to write infor-
|
||||
mation to the console (i.e., a DOS-window command line) while displaying
|
||||
the image in a graphical window--and since I haven't yet figured out how
|
||||
to do that under Windows--here are the usage screens for the two programs:
|
||||
|
||||
|
||||
rpng-win 1.02 of 19 March 2000: Simple PNG Viewer for Windows
|
||||
Compiled with libpng 1.0.5; using libpng 1.0.5.
|
||||
Compiled with zlib 1.1.3; using zlib 1.1.3.
|
||||
|
||||
Usage: rpng-win [-gamma exp] [-bgcolor bg] file.png
|
||||
exp transfer-function exponent (``gamma'') of the display
|
||||
system in floating-point format (e.g., ``2.2''); equal
|
||||
to the product of the lookup-table exponent (varies)
|
||||
and the CRT exponent (usually 2.2); must be positive
|
||||
bg desired background color in 7-character hex RGB format
|
||||
(e.g., ``#ff7f00'' for orange: same as HTML colors);
|
||||
used with transparent images
|
||||
|
||||
Press Q, Esc or mouse button 1 after image is displayed to quit.
|
||||
|
||||
|
||||
rpng2-win 1.04 of 19 March 2000: Progressive PNG Viewer for Windows
|
||||
Compiled with libpng 1.0.5; using libpng 1.0.5.
|
||||
Compiled with zlib 1.1.3; using zlib 1.1.3.
|
||||
|
||||
Usage: rpng2-win [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing] file.png
|
||||
|
||||
exp transfer-function exponent (``gamma'') of the display
|
||||
system in floating-point format (e.g., ``2.2''); equal
|
||||
to the product of the lookup-table exponent (varies)
|
||||
and the CRT exponent (usually 2.2); must be positive
|
||||
bg desired background color in 7-character hex RGB format
|
||||
(e.g., ``#ff7f00'' for orange: same as HTML colors);
|
||||
used with transparent images; overrides -bgpat
|
||||
pat desired background pattern number (1-16); used with
|
||||
transparent images; overrides -bgcolor
|
||||
-timing enables delay for every block read, to simulate modem
|
||||
download of image (~36 Kbps)
|
||||
|
||||
Press Q, Esc or mouse button 1 after image is displayed to quit.
|
||||
|
||||
|
||||
The usage screen for the third (non-windowed) program, wpng, can be seen
|
||||
simply by invoking it without any parameters (``wpng'').
|
||||
|
||||
Greg Roelofs
|
||||
19 March 2000
|
||||
@@ -9,21 +9,22 @@ $! Set locations where zlib and libpng sources live.
|
||||
$!
|
||||
$ zpath = ""
|
||||
$ pngpath = ""
|
||||
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
|
||||
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
|
||||
$!
|
||||
$ if f$search("[---.zlib]zlib.h").nes."" then zpath = "[---.zlib]"
|
||||
$ if f$search("[--]png.h").nes."" then pngpath = "[--]"
|
||||
$!
|
||||
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
|
||||
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
|
||||
$!
|
||||
$ if zpath .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Zlib include not found. Exiting..."
|
||||
$ write sys$output "zlib include not found. Exiting..."
|
||||
$ exit 2
|
||||
$ endif
|
||||
$!
|
||||
$ if pngpath .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Libpng include not found. Exiting..."
|
||||
$ write sys$output "libpng include not found. Exiting..."
|
||||
$ exit 2
|
||||
$ endif
|
||||
$!
|
||||
|
||||
@@ -239,7 +239,7 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height));
|
||||
Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n", *pChannels, rowbytes, height));
|
||||
|
||||
|
||||
/* set the individual row_pointers to point at the correct offsets */
|
||||
|
||||
@@ -49,8 +49,77 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg);
|
||||
|
||||
void readpng2_version_info(void)
|
||||
{
|
||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
|
||||
PNG_LIBPNG_VER_STRING, png_libpng_ver);
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
|
||||
(defined(__i386__) || defined(_M_IX86)) && \
|
||||
defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||
/*
|
||||
* WARNING: This preprocessor approach means that the following code
|
||||
* cannot be used with a libpng DLL older than 1.2.0--the
|
||||
* compiled-in symbols for the new functions will not exist.
|
||||
* (Could use dlopen() and dlsym() on Unix and corresponding
|
||||
* calls for Windows, but not portable...)
|
||||
*/
|
||||
{
|
||||
int mmxsupport = png_mmx_support();
|
||||
if (mmxsupport < 0)
|
||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s "
|
||||
"without MMX support.\n", PNG_LIBPNG_VER_STRING, png_libpng_ver);
|
||||
else {
|
||||
int compilerID;
|
||||
png_uint_32 mmx_mask = png_get_mmx_flagmask(
|
||||
PNG_SELECT_READ | PNG_SELECT_WRITE, &compilerID);
|
||||
|
||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s "
|
||||
"with MMX support\n (%s version).", PNG_LIBPNG_VER_STRING,
|
||||
png_libpng_ver, compilerID == 1? "MSVC++" :
|
||||
(compilerID == 2? "GNU C" : "unknown"));
|
||||
fprintf(stderr, " Processor %s MMX instructions.\n",
|
||||
mmxsupport? "supports" : "does not support");
|
||||
if (mmxsupport > 0) {
|
||||
int num_optims = 0;
|
||||
|
||||
fprintf(stderr,
|
||||
" Potential MMX optimizations supported by libpng:\n");
|
||||
if (mmx_mask & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)
|
||||
++num_optims;
|
||||
if (mmx_mask & PNG_ASM_FLAG_MMX_READ_FILTER_UP)
|
||||
++num_optims;
|
||||
if (mmx_mask & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)
|
||||
++num_optims;
|
||||
if (mmx_mask & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)
|
||||
++num_optims;
|
||||
if (num_optims)
|
||||
fprintf(stderr,
|
||||
" decoding %s row filters (reading)\n",
|
||||
(num_optims == 4)? "all non-trivial" : "some");
|
||||
if (mmx_mask & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) {
|
||||
fprintf(stderr, " combining rows (reading)\n");
|
||||
++num_optims;
|
||||
}
|
||||
if (mmx_mask & PNG_ASM_FLAG_MMX_READ_INTERLACE) {
|
||||
fprintf(stderr,
|
||||
" expanding interlacing (reading)\n");
|
||||
++num_optims;
|
||||
}
|
||||
mmx_mask &= ~( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
||||
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_UP \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH );
|
||||
if (mmx_mask) {
|
||||
fprintf(stderr, " other (unknown)\n");
|
||||
++num_optims;
|
||||
}
|
||||
if (num_optims == 0)
|
||||
fprintf(stderr, " (none)\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s "
|
||||
"without MMX support.\n", PNG_LIBPNG_VER_STRING, png_libpng_ver);
|
||||
#endif
|
||||
|
||||
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
|
||||
ZLIB_VERSION, zlib_version);
|
||||
@@ -111,6 +180,97 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
png_set_progressive_read_fn(png_ptr, mainprog_ptr,
|
||||
readpng2_info_callback, readpng2_row_callback, readpng2_end_callback);
|
||||
|
||||
|
||||
/*
|
||||
* may as well enable or disable MMX routines here, if supported;
|
||||
*
|
||||
* to enable all: mask = png_get_mmx_flagmask (
|
||||
* PNG_SELECT_READ | PNG_SELECT_WRITE, &compilerID);
|
||||
* flags = png_get_asm_flags (png_ptr);
|
||||
* flags |= mask;
|
||||
* png_set_asm_flags (png_ptr, flags);
|
||||
*
|
||||
* to disable all: mask = png_get_mmx_flagmask (
|
||||
* PNG_SELECT_READ | PNG_SELECT_WRITE, &compilerID);
|
||||
* flags = png_get_asm_flags (png_ptr);
|
||||
* flags &= ~mask;
|
||||
* png_set_asm_flags (png_ptr, flags);
|
||||
*/
|
||||
|
||||
#if (defined(__i386__) || defined(_M_IX86)) && \
|
||||
defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||
/*
|
||||
* WARNING: This preprocessor approach means that the following code
|
||||
* cannot be used with a libpng DLL older than 1.2.0--the
|
||||
* compiled-in symbols for the new functions will not exist.
|
||||
* (Could use dlopen() and dlsym() on Unix and corresponding
|
||||
* calls for Windows, but not portable...)
|
||||
*/
|
||||
{
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
png_uint_32 mmx_disable_mask = 0;
|
||||
png_uint_32 asm_flags, mmx_mask;
|
||||
int compilerID;
|
||||
|
||||
if (mainprog_ptr->nommxfilters)
|
||||
mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_UP \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH );
|
||||
if (mainprog_ptr->nommxcombine)
|
||||
mmx_disable_mask |= PNG_ASM_FLAG_MMX_READ_COMBINE_ROW;
|
||||
if (mainprog_ptr->nommxinterlace)
|
||||
mmx_disable_mask |= PNG_ASM_FLAG_MMX_READ_INTERLACE;
|
||||
asm_flags = png_get_asm_flags(png_ptr);
|
||||
png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask);
|
||||
|
||||
|
||||
/* Now query libpng's asm settings, just for yuks. Note that this
|
||||
* differs from the querying of its *potential* MMX capabilities
|
||||
* in readpng2_version_info(); this is true runtime verification. */
|
||||
|
||||
asm_flags = png_get_asm_flags(png_ptr);
|
||||
mmx_mask = png_get_mmx_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE,
|
||||
&compilerID);
|
||||
if (asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_COMPILED)
|
||||
fprintf(stderr,
|
||||
" MMX support (%s version) is compiled into libpng\n",
|
||||
compilerID == 1? "MSVC++" :
|
||||
(compilerID == 2? "GNU C" : "unknown"));
|
||||
else
|
||||
fprintf(stderr, " MMX support is not compiled into libpng\n");
|
||||
fprintf(stderr, " MMX instructions are %ssupported by CPU\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU)? "" : "not ");
|
||||
fprintf(stderr, " MMX read support for combining rows is %sabled\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)? "en" : "dis");
|
||||
fprintf(stderr,
|
||||
" MMX read support for expanding interlacing is %sabled\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE)? "en" : "dis");
|
||||
fprintf(stderr, " MMX read support for \"sub\" filter is %sabled\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "en" : "dis");
|
||||
fprintf(stderr, " MMX read support for \"up\" filter is %sabled\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "en" : "dis");
|
||||
fprintf(stderr, " MMX read support for \"avg\" filter is %sabled\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "en" : "dis");
|
||||
fprintf(stderr, " MMX read support for \"Paeth\" filter is %sabled\n",
|
||||
(asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "en" : "dis");
|
||||
asm_flags &= (mmx_mask & ~( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
||||
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_UP \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ));
|
||||
if (asm_flags)
|
||||
fprintf(stderr,
|
||||
" additional MMX support is also enabled (0x%02lx)\n",
|
||||
asm_flags);
|
||||
#else /* !PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
fprintf(stderr, " MMX querying is disabled in libpng.\n");
|
||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* make sure we save our pointers for use in readpng2_decode_data() */
|
||||
|
||||
mainprog_ptr->png_ptr = png_ptr;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
with a little tweaking (or maybe not).
|
||||
|
||||
to do:
|
||||
- stdout/stderr don't work! need message window (maybe scrollable?)
|
||||
- handle quoted command-line args (especially filenames with spaces)
|
||||
- have minimum window width: oh well
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
@@ -22,10 +21,11 @@
|
||||
match; switched to png_jmpbuf() macro
|
||||
- 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
@@ -52,13 +52,14 @@
|
||||
|
||||
#define PROGNAME "rpng-win"
|
||||
#define LONGNAME "Simple PNG Viewer for Windows"
|
||||
#define VERSION "1.02 of 19 March 2000"
|
||||
#define VERSION "1.20 of 28 May 2001"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#include <conio.h> /* only for _getch() */
|
||||
|
||||
/* #define DEBUG : this enables the Trace() macros */
|
||||
|
||||
@@ -128,7 +129,17 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
filename = (char *)NULL;
|
||||
|
||||
|
||||
/* First set the default value for our display-system exponent, i.e.,
|
||||
/* First 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);
|
||||
|
||||
|
||||
/* Next set the default value for our display-system exponent, i.e.,
|
||||
* the product of the CRT exponent and the exponent corresponding to
|
||||
* the frame-buffer's lookup table (LUT), if any. This is not an
|
||||
* exhaustive list of LUT values (e.g., OpenStep has a lot of weird
|
||||
@@ -272,20 +283,31 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
/* usage screen */
|
||||
|
||||
if (error) {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
int ch;
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\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 and the CRT exponent (usually 2.2); must be positive\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 used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\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 and the CRT exponent (usually 2.2); must be positive\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 used with transparent images\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);
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
- 1.10: added support for non-default visuals; fixed X pixel-conversion
|
||||
- 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.12: fixed small X memory leak (thanks to Francois Petitjean)
|
||||
- 1.13: fixed XFreeGC() crash bug
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
@@ -51,7 +53,7 @@
|
||||
|
||||
#define PROGNAME "rpng-x"
|
||||
#define LONGNAME "Simple PNG Viewer for X"
|
||||
#define VERSION "1.11 of 19 March 2000"
|
||||
#define VERSION "1.13 of 16 August 2001"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -117,6 +119,7 @@ static Colormap colormap;
|
||||
static int have_nondefault_visual = FALSE;
|
||||
static int have_colormap = FALSE;
|
||||
static int have_window = FALSE;
|
||||
static int have_gc = FALSE;
|
||||
/*
|
||||
ulg numcolors=0, pixels[256];
|
||||
ush reds[256], greens[256], blues[256];
|
||||
@@ -542,9 +545,20 @@ static int rpng_x_create_window(void)
|
||||
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
|
||||
size_hints, wm_hints, NULL);
|
||||
|
||||
/* various properties and hints no longer needed; free memory */
|
||||
if (pWindowName)
|
||||
XFree(pWindowName->value);
|
||||
if (pIconName)
|
||||
XFree(pIconName->value);
|
||||
if (size_hints)
|
||||
XFree(size_hints);
|
||||
if (wm_hints)
|
||||
XFree(wm_hints);
|
||||
|
||||
XMapWindow(display, window);
|
||||
|
||||
gc = XCreateGC(display, window, 0, &gcvalues);
|
||||
have_gc = TRUE;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Fill window with the specified background color.
|
||||
@@ -814,7 +828,8 @@ static void rpng_x_cleanup(void)
|
||||
ximage = NULL;
|
||||
}
|
||||
|
||||
XFreeGC(display, gc);
|
||||
if (have_gc)
|
||||
XFreeGC(display, gc);
|
||||
|
||||
if (have_window)
|
||||
XDestroyWindow(display, window);
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
- 1.03: modified to allow abbreviated options
|
||||
- 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?];
|
||||
fixed command-line parsing bug
|
||||
- 1.10: enabled "message window" (console), thanks to David Geldreich
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
||||
- 1.21: made minor tweak to usage screen to fit within 25-line console
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
@@ -56,7 +57,7 @@
|
||||
|
||||
#define PROGNAME "rpng2-win"
|
||||
#define LONGNAME "Progressive PNG Viewer for Windows"
|
||||
#define VERSION "1.20 of 29 January 2001"
|
||||
#define VERSION "1.21 of 29 June 2001"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -451,12 +452,13 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
||||
#endif
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"Press Q or Esc to quit this usage screen.\n"
|
||||
"\n", PROGNAME,
|
||||
"Press Q or Esc to quit this usage screen. ",
|
||||
PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
strlen(PROGNAME), " ",
|
||||
#endif
|
||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fflush(stderr);
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
@@ -466,6 +468,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
fprintf(stderr,
|
||||
"\n [console window: closing this window will terminate %s]\n\n",
|
||||
PROGNAME);
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
- 1.11: added -usleep option for demos; fixed command-line parsing bug
|
||||
- 1.12: added -pause option for demos and testing
|
||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
||||
- 1.21: fixed small X memory leak (thanks to Francois Petitjean)
|
||||
- 1.22: fixed XFreeGC() crash bug
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
@@ -56,7 +58,7 @@
|
||||
|
||||
#define PROGNAME "rpng2-x"
|
||||
#define LONGNAME "Progressive PNG Viewer for X"
|
||||
#define VERSION "1.20 of 29 January 2001"
|
||||
#define VERSION "1.22 of 16 August 2001"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -227,6 +229,7 @@ static Colormap colormap;
|
||||
static int have_nondefault_visual = FALSE;
|
||||
static int have_colormap = FALSE;
|
||||
static int have_window = FALSE;
|
||||
static int have_gc = FALSE;
|
||||
|
||||
|
||||
|
||||
@@ -585,8 +588,15 @@ static void rpng2_x_init(void)
|
||||
* pattern */
|
||||
|
||||
if (rpng2_x_create_window()) {
|
||||
|
||||
/* GRR TEMPORARY HACK: this is fundamentally no different from cases
|
||||
* above; libpng should longjmp() back to us when png_ptr goes away.
|
||||
* If we/it segfault instead, seems like a libpng bug... */
|
||||
|
||||
/* we're here via libpng callback, so if window fails, clean and bail */
|
||||
readpng2_cleanup(&rpng2_info);
|
||||
return;
|
||||
rpng2_x_cleanup();
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,9 +748,20 @@ static int rpng2_x_create_window(void)
|
||||
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
|
||||
size_hints, wm_hints, NULL);
|
||||
|
||||
/* various properties and hints no longer needed; free memory */
|
||||
if (pWindowName)
|
||||
XFree(pWindowName->value);
|
||||
if (pIconName)
|
||||
XFree(pIconName->value);
|
||||
if (size_hints)
|
||||
XFree(size_hints);
|
||||
if (wm_hints)
|
||||
XFree(wm_hints);
|
||||
|
||||
XMapWindow(display, window);
|
||||
|
||||
gc = XCreateGC(display, window, 0, &gcvalues);
|
||||
have_gc = TRUE;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Allocate memory for the X- and display-specific version of the image.
|
||||
@@ -1356,7 +1377,8 @@ static void rpng2_x_cleanup(void)
|
||||
ximage = NULL;
|
||||
}
|
||||
|
||||
XFreeGC(display, gc);
|
||||
if (have_gc)
|
||||
XFreeGC(display, gc);
|
||||
|
||||
if (have_window)
|
||||
XDestroyWindow(display, window);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll\libpng2.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll\libpng10.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbg\libpng2d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbg\libpng10d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_dbg
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -114,7 +114,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_asm\libpng2a.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_asm\libpng10a.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_asm
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -144,7 +144,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbga\libpng2b.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbga\libpng10b.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_dbga
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
@@ -1,26 +1,31 @@
|
||||
# Makefile for PngMinus (png2pnm and pnm2png)
|
||||
# Linux / Unix
|
||||
|
||||
CC=cc -O
|
||||
LD=cc -O
|
||||
#CC=gcc -O
|
||||
#LD=gcc -O
|
||||
LB=ar
|
||||
RM=rm
|
||||
CP=cp
|
||||
#CC=cc
|
||||
CC=gcc
|
||||
LD=$(CC)
|
||||
|
||||
PNGPATH = /usr/local
|
||||
PNGINC = $(PNGPATH)/include
|
||||
#PNGLIB = $(PNGPATH)/lib -lpng
|
||||
PNGLIB = $(PNGPATH)/lib/libpng.a
|
||||
RM=rm -f
|
||||
|
||||
ZPATH = /usr/local
|
||||
ZINC = $(ZPATH)/include
|
||||
#ZLIB = $(ZPATH)/lib -lz
|
||||
ZLIB = $(ZPATH)/lib/libz.a
|
||||
#PNGPATH = /usr/local
|
||||
#PNGINC = -I$(PNGPATH)/include/libpng10
|
||||
#PNGLIB = -L$(PNGPATH)/lib -lpng10
|
||||
#PNGLIBS = $(PNGPATH)/lib/libpng10.a
|
||||
PNGINC = -I../..
|
||||
PNGLIB = -L../.. -lpng
|
||||
PNGLIBS = ../../libpng.a
|
||||
|
||||
CCFLAGS=-I$(PNGINC) -I$(ZINC)
|
||||
LDFLAGS=-L$(PNGLIB) -L$(ZLIB)
|
||||
#ZPATH = /usr/local
|
||||
#ZINC = -I$(ZPATH)/include
|
||||
#ZLIB = -L$(ZPATH)/lib -lz
|
||||
#ZLIBS = $(ZPATH)/lib/libz.a
|
||||
ZINC = -I../../../zlib
|
||||
ZLIB = -L../../../zlib -lz
|
||||
ZLIBS = ../../../zlib/libz.a
|
||||
|
||||
CFLAGS=-O3 $(PNGINC) $(ZINC)
|
||||
LDFLAGS=$(PNGLIB) $(ZLIB)
|
||||
LDFLAGSS=$(PNGLIBS) $(ZLIBS)
|
||||
C=.c
|
||||
O=.o
|
||||
L=.a
|
||||
@@ -28,25 +33,33 @@ E=
|
||||
|
||||
# dependencies
|
||||
|
||||
all: png2pnm$(E) pnm2png$(E)
|
||||
#all: png2pnm$(E) pnm2png$(E)
|
||||
all: png2pnm$(E) pnm2png$(E) png2pnm-static$(E) pnm2png-static$(E)
|
||||
|
||||
png2pnm$(O): png2pnm$(C)
|
||||
$(CC) -c $(CCFLAGS) png2pnm$(C)
|
||||
$(CC) -c $(CFLAGS) png2pnm$(C)
|
||||
|
||||
png2pnm$(E): png2pnm$(O)
|
||||
$(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lpng -lz -lm
|
||||
$(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm
|
||||
|
||||
png2pnm-static$(E): png2pnm$(O)
|
||||
$(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm
|
||||
|
||||
pnm2png$(O): pnm2png$(C)
|
||||
$(CC) -c $(CCFLAGS) pnm2png$(C)
|
||||
$(CC) -c $(CFLAGS) pnm2png$(C)
|
||||
|
||||
pnm2png$(E): pnm2png$(O)
|
||||
$(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lpng -lz -lm
|
||||
$(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm
|
||||
|
||||
pnm2png-static$(E): pnm2png$(O)
|
||||
$(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm
|
||||
|
||||
clean:
|
||||
$(RM) png2pnm$(O)
|
||||
$(RM) pnm2png$(O)
|
||||
$(RM) png2pnm$(E)
|
||||
$(RM) pnm2png$(E)
|
||||
$(RM) png2pnm-static$(E)
|
||||
$(RM) pnm2png-static$(E)
|
||||
|
||||
# End of makefile for png2pnm / pnm2png
|
||||
|
||||
|
||||
0
contrib/pngminus/png2pnm.sh
Executable file → Normal file
0
contrib/pngminus/png2pnm.sh
Executable file → Normal file
0
contrib/pngminus/pngminus.sh
Executable file → Normal file
0
contrib/pngminus/pngminus.sh
Executable file → Normal file
0
contrib/pngminus/pnm2png.sh
Executable file → Normal file
0
contrib/pngminus/pnm2png.sh
Executable file → Normal file
@@ -370,14 +370,14 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
|
||||
|
||||
// clean up after the write, and free any memory allocated
|
||||
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
|
||||
|
||||
// yepp, done
|
||||
}
|
||||
|
||||
Catch (msg)
|
||||
{
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
|
||||
|
||||
if(ppbRowPointers)
|
||||
free (ppbRowPointers);
|
||||
|
||||
@@ -59,8 +59,8 @@ BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 libpng2.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"libpng" /libpath:"zlib"
|
||||
# ADD LINK32 libpng2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
||||
# ADD BASE LINK32 libpng10.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"libpng" /libpath:"zlib"
|
||||
# ADD LINK32 libpng10.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -92,9 +92,9 @@ BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 libpng2.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"libpng" /libpath:"zlib"
|
||||
# ADD BASE LINK32 libpng10.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"libpng" /libpath:"zlib"
|
||||
# SUBTRACT BASE LINK32 /nodefaultlib
|
||||
# ADD LINK32 libpng2d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
||||
# ADD LINK32 libpng10d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
||||
# SUBTRACT LINK32 /nodefaultlib
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_dbg
|
||||
@@ -128,7 +128,7 @@ BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 libpng2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
||||
# ADD BASE LINK32 libpng10.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
||||
# ADD LINK32 libpng.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\lib"
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\lib
|
||||
@@ -161,7 +161,7 @@ BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 libpng2d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
||||
# ADD BASE LINK32 libpng10d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
||||
# SUBTRACT BASE LINK32 /nodefaultlib
|
||||
# ADD LINK32 libpng.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\lib_dbg"
|
||||
# SUBTRACT LINK32 /nodefaultlib
|
||||
|
||||
86
example.c
86
example.c
@@ -114,7 +114,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
if (info_ptr == NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
|
||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
/* Free all of the memory associated with the png_ptr and info_ptr */
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
fclose(fp);
|
||||
/* If we get here, we had a problem reading the file */
|
||||
return (ERROR);
|
||||
@@ -157,7 +157,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
* adjustment), then you can read the entire image (including
|
||||
* pixels) into the info structure with this call:
|
||||
*/
|
||||
png_read_png(png_ptr, info_ptr, png_transforms, NULL);
|
||||
png_read_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL);
|
||||
#else
|
||||
/* OK, you're doing it the hard way, with the lower-level functions */
|
||||
|
||||
@@ -167,7 +167,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||
&interlace_type, NULL, NULL);
|
||||
&interlace_type, int_p_NULL, int_p_NULL);
|
||||
|
||||
/**** Set up the data transformations you want. Note that these are all
|
||||
**** optional. Only call them if you want/need them. Many of the
|
||||
@@ -194,17 +194,17 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
|
||||
/* Expand paletted colors into true RGB triplets */
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
png_set_expand(png_ptr);
|
||||
png_set_palette_rgb(png_ptr);
|
||||
|
||||
/* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
|
||||
png_set_expand(png_ptr);
|
||||
png_set_gray_1_2_4_to_8(png_ptr);
|
||||
|
||||
/* Expand paletted or RGB images with transparency to full alpha channels
|
||||
* so the data will be available as RGBA quartets.
|
||||
*/
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||
png_set_expand(png_ptr);
|
||||
png_set_tRNS_to_alpha(png_ptr);
|
||||
|
||||
/* Set the background color to draw transparent and alpha images over.
|
||||
* It is possible to set the red, green, and blue components directly
|
||||
@@ -277,7 +277,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
png_color std_color_cube[MAX_SCREEN_COLORS];
|
||||
|
||||
png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS,
|
||||
MAX_SCREEN_COLORS, NULL, 0);
|
||||
MAX_SCREEN_COLORS, png_uint_16p_NULL, 0);
|
||||
}
|
||||
/* This reduces the image to the palette supplied in the file */
|
||||
else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette))
|
||||
@@ -354,18 +354,18 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
#ifdef single /* Read the image a single row at a time */
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
png_read_rows(png_ptr, &row_pointers[y], NULL, 1);
|
||||
png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL, 1);
|
||||
}
|
||||
|
||||
#else no_single /* Read the image several rows at a time */
|
||||
for (y = 0; y < height; y += number_of_rows)
|
||||
{
|
||||
#ifdef sparkle /* Read the image using the "sparkle" effect. */
|
||||
png_read_rows(png_ptr, &row_pointers[y], NULL, number_of_rows);
|
||||
|
||||
png_read_rows(png_ptr, NULL, row_pointers[y], number_of_rows);
|
||||
png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL,
|
||||
number_of_rows);
|
||||
#else no_sparkle /* Read the image using the "rectangle" effect */
|
||||
png_read_rows(png_ptr, NULL, &row_pointers[y], number_of_rows);
|
||||
png_read_rows(png_ptr, png_bytepp_NULL, &row_pointers[y],
|
||||
number_of_rows);
|
||||
#endif no_sparkle /* use only one of these two methods */
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
/* At this point you have read the entire image */
|
||||
|
||||
/* clean up after the read, and free any memory allocated - REQUIRED */
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
|
||||
/* close the file */
|
||||
fclose(fp);
|
||||
@@ -415,13 +415,13 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
|
||||
|
||||
if (*info_ptr == NULL)
|
||||
{
|
||||
png_destroy_read_struct(png_ptr, info_ptr, (png_infopp)NULL);
|
||||
png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
if (setjmp(png_jmpbuf((*png_ptr))))
|
||||
{
|
||||
png_destroy_read_struct(png_ptr, info_ptr, (png_infopp)NULL);
|
||||
png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
|
||||
if (setjmp(png_jmpbuf((*png_ptr))))
|
||||
{
|
||||
/* Free the png_ptr and info_ptr memory on error */
|
||||
png_destroy_read_struct(png_ptr, info_ptr, (png_infopp)NULL);
|
||||
png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -482,21 +482,47 @@ info_callback(png_structp png_ptr, png_infop info)
|
||||
row_callback(png_structp png_ptr, png_bytep new_row,
|
||||
png_uint_32 row_num, int pass)
|
||||
{
|
||||
/* this function is called for every row in the image. If the
|
||||
* image is interlacing, and you turned on the interlace handler,
|
||||
/*
|
||||
* This function is called for every row in the image. If the
|
||||
* image is interlaced, and you turned on the interlace handler,
|
||||
* this function will be called for every row in every pass.
|
||||
* Some of these rows will not be changed from the previous pass.
|
||||
* When the row is not changed, the new_row variable will be NULL.
|
||||
*
|
||||
* In this function you will receive a pointer to new row data from
|
||||
* libpng called new_row that is to replace a corresponding row (of
|
||||
* the same data format) in a buffer allocated by your application.
|
||||
*
|
||||
* The new row data pointer new_row may be NULL, indicating there is
|
||||
* no new data to be replaced (in cases of interlace loading).
|
||||
*
|
||||
* If new_row is not NULL then you need to call
|
||||
* png_progressive_combine_row() to replace the corresponding row as
|
||||
* shown below:
|
||||
*/
|
||||
/* Check if row_num is in bounds. */
|
||||
if((row_num >= 0) && (row_num < height))
|
||||
{
|
||||
/* Get pointer to corresponding row in our
|
||||
* PNG read buffer.
|
||||
*/
|
||||
png_bytep old_row = ((png_bytep *)our_data)[row_num];
|
||||
|
||||
/* If both rows are allocated then copy the new row
|
||||
* data to the corresponding row data.
|
||||
*/
|
||||
if((old_row != NULL) && (new_row != NULL))
|
||||
png_progressive_combine_row(png_ptr, old_row, new_row);
|
||||
}
|
||||
/*
|
||||
* The rows and passes are called in order, so you don't really
|
||||
* need the row_num and pass, but I'm supplying them because it
|
||||
* may make your life easier.
|
||||
*
|
||||
* For the non-NULL rows of interlaced images, you must call
|
||||
* png_progressive_combine_row() passing in the row and the
|
||||
* old row. You can call this function for NULL rows (it will
|
||||
* just return) and for non-interlaced images (it just does the
|
||||
* png_memcpy for you) if it will make the code easier. Thus, you
|
||||
* can just do this for all cases:
|
||||
* png_progressive_combine_row() passing in the new row and the
|
||||
* old row, as demonstrated above. You can call this function for
|
||||
* NULL rows (it will just return) and for non-interlaced images
|
||||
* (it just does the png_memcpy for you) if it will make the code
|
||||
* easier. Thus, you can just do this for all cases:
|
||||
*/
|
||||
|
||||
png_progressive_combine_row(png_ptr, old_row, new_row);
|
||||
@@ -505,8 +531,8 @@ row_callback(png_structp png_ptr, png_bytep new_row,
|
||||
* that the first pass (pass == 0 really) will completely cover
|
||||
* the old row, so the rows do not have to be initialized. After
|
||||
* the first pass (and only for interlaced images), you will have
|
||||
* to pass the current row, and the function will combine the
|
||||
* old row and the new row.
|
||||
* to pass the current row as new_row, and the function will combine
|
||||
* the old row and the new row.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -556,7 +582,7 @@ void write_png(char *file_name /* , ... other image information ... */)
|
||||
if (info_ptr == NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
|
||||
png_destroy_write_struct(&png_ptr, png_infopp_NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -588,7 +614,7 @@ void write_png(char *file_name /* , ... other image information ... */)
|
||||
* image info living info in the structure. You could "|" many
|
||||
* PNG_TRANSFORM flags into the png_transforms integer here.
|
||||
*/
|
||||
png_write_png(png_ptr, info_ptr, png_transforms, NULL);
|
||||
png_write_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL);
|
||||
#else
|
||||
/* This is the hard way */
|
||||
|
||||
|
||||
139
libpng.3
139
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "May 14, 2001"
|
||||
.TH LIBPNG 3 "April 15, 2002"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.13
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@@ -302,7 +302,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_info_init (png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -310,6 +310,14 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_info_init (png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_info_init_2 (png_infopp \fP\fIptr_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -334,7 +342,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP
|
||||
\fBDEPRECATED: void png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -362,7 +370,9 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_read_init_2 (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
|
||||
\fBDEPRECATED: void png_read_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
@@ -692,10 +702,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_destroy_info (png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -712,7 +718,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_write_init_2 (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
|
||||
\fBDEPRECATED: void png_write_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -736,6 +742,14 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.I libpng
|
||||
@@ -747,10 +761,10 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.12beta1 - May 14, 2001
|
||||
libpng version 1.0.13 - April 15, 2002
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alum.rpi.edu>
|
||||
Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
For conditions of distribution and use, see copyright
|
||||
notice in png.h.
|
||||
|
||||
@@ -825,7 +839,9 @@ Libpng is thread safe, provided the threads are using different
|
||||
instances of the structures. Each thread should have its own
|
||||
png_struct and png_info instances, and thus its own image.
|
||||
Libpng does not protect itself against two threads using the
|
||||
same instance of a structure.
|
||||
same instance of a structure. Note: thread safety may be defeated
|
||||
by use of some of the MMX assembler code in pnggccrd.c, which is only
|
||||
compiled when the user defines PNG_THREAD_UNSAFE_OK.
|
||||
|
||||
|
||||
.SH II. Structures
|
||||
@@ -1322,7 +1338,7 @@ into the info_ptr is returned for any complex types.
|
||||
after decompression, 0 for tEXt/zTXt
|
||||
text_ptr[i].lang - language of comment (empty
|
||||
string for unknown).
|
||||
text_ptr[i].translated_keyword - keyword in UTF-8
|
||||
text_ptr[i].lang_key - keyword in UTF-8
|
||||
(empty string for unknown).
|
||||
num_text - number of comments (same as
|
||||
num_comments; you can put NULL here
|
||||
@@ -1537,7 +1553,7 @@ higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] to
|
||||
convert the PNG pixel data back to the original bit depth of the image.
|
||||
This call reduces the pixels back down to the original bit depth:
|
||||
|
||||
png_color_16p sig_bit;
|
||||
png_color_8p sig_bit;
|
||||
|
||||
if (png_get_sBIT(png_ptr, info_ptr, &sig_bit))
|
||||
png_set_shift(png_ptr, sig_bit);
|
||||
@@ -1549,17 +1565,18 @@ changes the storage of the pixels to blue, green, red:
|
||||
color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
png_set_bgr(png_ptr);
|
||||
|
||||
PNG files store RGB pixels packed into 3 bytes. This code expands them
|
||||
into 4 bytes for windowing systems that need them in this format:
|
||||
PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them
|
||||
into 4 or 8 bytes for windowing systems that need them in this format:
|
||||
|
||||
if (bit_depth == 8 && color_type ==
|
||||
PNG_COLOR_TYPE_RGB) png_set_filler(png_ptr,
|
||||
filler, PNG_FILLER_BEFORE);
|
||||
if (color_type == PNG_COLOR_TYPE_RGB)
|
||||
png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE);
|
||||
|
||||
where "filler" is the 8 or 16-bit number to fill with, and the location is
|
||||
either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether
|
||||
you want the filler before the RGB or after. This transformation
|
||||
does not affect images that already have full alpha channels.
|
||||
does not affect images that already have full alpha channels. To add an
|
||||
opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which
|
||||
will generate RGBA pixels.
|
||||
|
||||
If you are reading an image with an alpha channel, and you need the
|
||||
data as ARGB instead of the normal PNG format RGBA:
|
||||
@@ -1629,8 +1646,8 @@ which can be expressed with integers as
|
||||
The calculation is done in a linear colorspace, if the image gamma
|
||||
is known.
|
||||
|
||||
If you have a grayscale and you are using png_set_expand_depth() or
|
||||
png_set_expand() to change to
|
||||
If you have a grayscale and you are using png_set_expand_depth(),
|
||||
png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to
|
||||
a higher bit-depth, you must either supply the background color as a gray
|
||||
value at the original file bit-depth (need_expand = 1) or else supply the
|
||||
background color as an RGB triplet at the final, expanded bit depth
|
||||
@@ -1749,7 +1766,13 @@ PNG files describe monochrome as black being zero and white being one.
|
||||
The following code will reverse this (make black be one and white be
|
||||
zero):
|
||||
|
||||
if (bit_depth == 1 && color_type == PNG_COLOR_GRAY)
|
||||
if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY)
|
||||
png_set_invert_mono(png_ptr);
|
||||
|
||||
This function can also be used to invert grayscale and gray-alpha images:
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_invert_mono(png_ptr);
|
||||
|
||||
PNG files store 16 bit pixels in network byte order (big-endian,
|
||||
@@ -1994,8 +2017,7 @@ or png_destroy_*() is supposed to free the data. When the user assumes
|
||||
responsibility for libpng-allocated data, the application must use
|
||||
png_free() to free it, and when the user transfers responsibility to libpng
|
||||
for data that the user has allocated, the user must have used png_malloc()
|
||||
or png_zalloc() to allocate it (the png_zalloc() function is the same
|
||||
as png_malloc() except that it also zeroes the newly-allocated memory).
|
||||
or png_zalloc() to allocate it.
|
||||
|
||||
If you allocated your row_pointers in a single block, as suggested above in
|
||||
the description of the high level read interface, you must not transfer
|
||||
@@ -2143,7 +2165,6 @@ png_infop info_ptr;
|
||||
|
||||
/* This function is called when each row of image
|
||||
data is complete */
|
||||
|
||||
void
|
||||
row_callback(png_structp png_ptr, png_bytep new_row,
|
||||
png_uint_32 row_num, int pass)
|
||||
@@ -3059,7 +3080,7 @@ This function also provides a void pointer that can be retrieved via
|
||||
Your replacement memory functions must have prototypes as follows:
|
||||
|
||||
png_voidp malloc_fn(png_structp png_ptr,
|
||||
png_uint_32 size);
|
||||
png_size_t size);
|
||||
void free_fn(png_structp png_ptr, png_voidp ptr);
|
||||
|
||||
Your malloc_fn() can return NULL in case of failure. The png_malloc()
|
||||
@@ -3225,6 +3246,10 @@ compression level by calling:
|
||||
Another useful one is to reduce the memory level used by the library.
|
||||
The memory level defaults to 8, but it can be lowered if you are
|
||||
short on memory (running DOS, for example, where you only have 640K).
|
||||
Note that the memory level does have an effect on compression; among
|
||||
other things, lower levels will result in sections of incompressible
|
||||
data being emitted in smaller stored blocks, with a correspondingly
|
||||
larger relative overhead of up to 15% in the worst case.
|
||||
|
||||
png_set_compression_mem_level(png_ptr, level);
|
||||
|
||||
@@ -3259,19 +3284,18 @@ to turn filtering on and off, respectively.
|
||||
Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB,
|
||||
PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise
|
||||
ORed together with '|' to specify one or more filters to use.
|
||||
These filters are described in more detail in the PNG specification. If
|
||||
you intend to change the filter type during the course of writing
|
||||
These filters are described in more detail in the PNG specification.
|
||||
If you intend to change the filter type during the course of writing
|
||||
the image, you should start with flags set for all of the filters
|
||||
you intend to use so that libpng can initialize its internal
|
||||
structures appropriately for all of the filter types.
|
||||
structures appropriately for all of the filter types. (Note that this
|
||||
means the first row must always be adaptively filtered, because libpng
|
||||
currently does not allocate the filter buffers until png_write_row()
|
||||
is called for the first time.)
|
||||
|
||||
filters = PNG_FILTER_NONE | PNG_FILTER_SUB
|
||||
PNG_FILTER_UP | PNG_FILTER_AVE |
|
||||
PNG_FILTER_PAETH | PNG_ALL_FILTERS;
|
||||
or
|
||||
filters = one of PNG_FILTER_VALUE_NONE,
|
||||
PNG_FILTER_VALUE_SUB, PNG_FILTER_VALUE_UP,
|
||||
PNG_FILTER_VALUE_AVE, PNG_FILTER_VALUE_PAETH
|
||||
|
||||
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE,
|
||||
filters);
|
||||
@@ -3283,16 +3307,16 @@ structures appropriately for all of the filter types.
|
||||
in png_set_IHDR().
|
||||
|
||||
It is also possible to influence how libpng chooses from among the
|
||||
available filters. This is done in two ways - by telling it how
|
||||
important it is to keep the same filter for successive rows, and
|
||||
by telling it the relative computational costs of the filters.
|
||||
available filters. This is done in one or both of two ways - by
|
||||
telling it how important it is to keep the same filter for successive
|
||||
rows, and by telling it the relative computational costs of the filters.
|
||||
|
||||
double weights[3] = {1.5, 1.3, 1.1},
|
||||
costs[PNG_FILTER_VALUE_LAST] =
|
||||
{1.0, 1.3, 1.3, 1.5, 1.7};
|
||||
|
||||
png_set_filter_selection(png_ptr,
|
||||
PNG_FILTER_SELECTION_WEIGHTED, 3,
|
||||
png_set_filter_heuristics(png_ptr,
|
||||
PNG_FILTER_HEURISTIC_WEIGHTED, 3,
|
||||
weights, costs);
|
||||
|
||||
The weights are multiplying factors that indicate to libpng that the
|
||||
@@ -3392,7 +3416,6 @@ 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
|
||||
this version of libpng, but if you insert some they will be printed.
|
||||
|
||||
|
||||
.SH VI. MNG support
|
||||
|
||||
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
||||
@@ -3406,7 +3429,7 @@ png_permit_mng_features() function:
|
||||
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
|
||||
feature_set is a png_byte 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.
|
||||
|
||||
@@ -3467,15 +3490,15 @@ application:
|
||||
|
||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||
|
||||
.SH VIII. Y2K Compliance in libpng
|
||||
.SH VII. Y2K Compliance in libpng
|
||||
|
||||
May 14, 2001
|
||||
April 15, 2002
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.0.12beta1 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.0.13 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
@@ -3587,7 +3610,23 @@ the first widely used release:
|
||||
1.0.11beta1-3 1 10011 2.1.0.11beta1-3
|
||||
1.0.11rc1 1 10011 2.1.0.11rc1
|
||||
1.0.11 1 10011 2.1.0.11
|
||||
1.0.12beta1 1 10012 2.1.0.12beta1
|
||||
1.0.12beta1-2 2 10012 2.1.0.12beta1-2
|
||||
1.0.12rc1 2 10012 2.1.0.12rc1
|
||||
1.0.12 2 10012 2.1.0.12
|
||||
1.1.0a-f - 10100 2.1.1.0a-f abandoned
|
||||
1.2.0beta1-2 2 10200 2.1.2.0beta1-2
|
||||
1.2.0beta3-5 3 10200 3.1.2.0beta3-5
|
||||
1.2.0rc1 3 10200 3.1.2.0rc1
|
||||
1.2.0 3 10200 3.1.2.0
|
||||
1.2.1beta-4 3 10201 3.1.2.1beta1-4
|
||||
1.2.1rc1-2 3 10201 3.1.2.1rc1-2
|
||||
1.2.1 3 10201 3.1.2.1
|
||||
1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6
|
||||
1.0.13beta1 10 10013 10.so.0.1.0.13beta1
|
||||
1.2.2rc1 12 10202 12.so.0.1.2.2rc1
|
||||
1.0.13rc1 10 10013 10.so.0.1.0.13rc1
|
||||
1.2.2 12 10202 12.so.0.1.2.2
|
||||
1.0.13 10 10013 10.so.0.1.0.13rc1
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@@ -3645,7 +3684,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.0.12beta1 - May 14, 2001:
|
||||
Libpng version 1.0.13 - April 15, 2002:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
|
||||
|
||||
@@ -3662,8 +3701,8 @@ included in the libpng distribution, the latter shall prevail.)
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.0.12beta1, May 14, 2001, are
|
||||
Copyright (c) 2000-2001 Glenn Randers-Pehrson, and are
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.0.13, April 15, 2002, are
|
||||
Copyright (c) 2000-2002 Glenn Randers-Pehrson, 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
|
||||
|
||||
@@ -3754,7 +3793,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
randeg@alum.rpi.edu
|
||||
May 14, 2001
|
||||
April 15, 2002
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
||||
79
libpng.txt
79
libpng.txt
@@ -1,9 +1,9 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.12beta1 - May 14, 2001
|
||||
libpng version 1.0.13 - April 15, 2002
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alum.rpi.edu>
|
||||
Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
For conditions of distribution and use, see copyright
|
||||
notice in png.h.
|
||||
|
||||
@@ -78,7 +78,9 @@ Libpng is thread safe, provided the threads are using different
|
||||
instances of the structures. Each thread should have its own
|
||||
png_struct and png_info instances, and thus its own image.
|
||||
Libpng does not protect itself against two threads using the
|
||||
same instance of a structure.
|
||||
same instance of a structure. Note: thread safety may be defeated
|
||||
by use of some of the MMX assembler code in pnggccrd.c, which is only
|
||||
compiled when the user defines PNG_THREAD_UNSAFE_OK.
|
||||
|
||||
|
||||
II. Structures
|
||||
@@ -575,7 +577,7 @@ into the info_ptr is returned for any complex types.
|
||||
after decompression, 0 for tEXt/zTXt
|
||||
text_ptr[i].lang - language of comment (empty
|
||||
string for unknown).
|
||||
text_ptr[i].translated_keyword - keyword in UTF-8
|
||||
text_ptr[i].lang_key - keyword in UTF-8
|
||||
(empty string for unknown).
|
||||
num_text - number of comments (same as
|
||||
num_comments; you can put NULL here
|
||||
@@ -790,7 +792,7 @@ higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] to
|
||||
convert the PNG pixel data back to the original bit depth of the image.
|
||||
This call reduces the pixels back down to the original bit depth:
|
||||
|
||||
png_color_16p sig_bit;
|
||||
png_color_8p sig_bit;
|
||||
|
||||
if (png_get_sBIT(png_ptr, info_ptr, &sig_bit))
|
||||
png_set_shift(png_ptr, sig_bit);
|
||||
@@ -802,17 +804,18 @@ changes the storage of the pixels to blue, green, red:
|
||||
color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
png_set_bgr(png_ptr);
|
||||
|
||||
PNG files store RGB pixels packed into 3 bytes. This code expands them
|
||||
into 4 bytes for windowing systems that need them in this format:
|
||||
PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them
|
||||
into 4 or 8 bytes for windowing systems that need them in this format:
|
||||
|
||||
if (bit_depth == 8 && color_type ==
|
||||
PNG_COLOR_TYPE_RGB) png_set_filler(png_ptr,
|
||||
filler, PNG_FILLER_BEFORE);
|
||||
if (color_type == PNG_COLOR_TYPE_RGB)
|
||||
png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE);
|
||||
|
||||
where "filler" is the 8 or 16-bit number to fill with, and the location is
|
||||
either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether
|
||||
you want the filler before the RGB or after. This transformation
|
||||
does not affect images that already have full alpha channels.
|
||||
does not affect images that already have full alpha channels. To add an
|
||||
opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which
|
||||
will generate RGBA pixels.
|
||||
|
||||
If you are reading an image with an alpha channel, and you need the
|
||||
data as ARGB instead of the normal PNG format RGBA:
|
||||
@@ -882,8 +885,8 @@ which can be expressed with integers as
|
||||
The calculation is done in a linear colorspace, if the image gamma
|
||||
is known.
|
||||
|
||||
If you have a grayscale and you are using png_set_expand_depth() or
|
||||
png_set_expand() to change to
|
||||
If you have a grayscale and you are using png_set_expand_depth(),
|
||||
png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to
|
||||
a higher bit-depth, you must either supply the background color as a gray
|
||||
value at the original file bit-depth (need_expand = 1) or else supply the
|
||||
background color as an RGB triplet at the final, expanded bit depth
|
||||
@@ -1002,7 +1005,13 @@ PNG files describe monochrome as black being zero and white being one.
|
||||
The following code will reverse this (make black be one and white be
|
||||
zero):
|
||||
|
||||
if (bit_depth == 1 && color_type == PNG_COLOR_GRAY)
|
||||
if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY)
|
||||
png_set_invert_mono(png_ptr);
|
||||
|
||||
This function can also be used to invert grayscale and gray-alpha images:
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_invert_mono(png_ptr);
|
||||
|
||||
PNG files store 16 bit pixels in network byte order (big-endian,
|
||||
@@ -1247,8 +1256,7 @@ or png_destroy_*() is supposed to free the data. When the user assumes
|
||||
responsibility for libpng-allocated data, the application must use
|
||||
png_free() to free it, and when the user transfers responsibility to libpng
|
||||
for data that the user has allocated, the user must have used png_malloc()
|
||||
or png_zalloc() to allocate it (the png_zalloc() function is the same
|
||||
as png_malloc() except that it also zeroes the newly-allocated memory).
|
||||
or png_zalloc() to allocate it.
|
||||
|
||||
If you allocated your row_pointers in a single block, as suggested above in
|
||||
the description of the high level read interface, you must not transfer
|
||||
@@ -1396,7 +1404,6 @@ png_infop info_ptr;
|
||||
|
||||
/* This function is called when each row of image
|
||||
data is complete */
|
||||
|
||||
void
|
||||
row_callback(png_structp png_ptr, png_bytep new_row,
|
||||
png_uint_32 row_num, int pass)
|
||||
@@ -2312,7 +2319,7 @@ This function also provides a void pointer that can be retrieved via
|
||||
Your replacement memory functions must have prototypes as follows:
|
||||
|
||||
png_voidp malloc_fn(png_structp png_ptr,
|
||||
png_uint_32 size);
|
||||
png_size_t size);
|
||||
void free_fn(png_structp png_ptr, png_voidp ptr);
|
||||
|
||||
Your malloc_fn() can return NULL in case of failure. The png_malloc()
|
||||
@@ -2478,6 +2485,10 @@ compression level by calling:
|
||||
Another useful one is to reduce the memory level used by the library.
|
||||
The memory level defaults to 8, but it can be lowered if you are
|
||||
short on memory (running DOS, for example, where you only have 640K).
|
||||
Note that the memory level does have an effect on compression; among
|
||||
other things, lower levels will result in sections of incompressible
|
||||
data being emitted in smaller stored blocks, with a correspondingly
|
||||
larger relative overhead of up to 15% in the worst case.
|
||||
|
||||
png_set_compression_mem_level(png_ptr, level);
|
||||
|
||||
@@ -2512,19 +2523,18 @@ to turn filtering on and off, respectively.
|
||||
Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB,
|
||||
PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise
|
||||
ORed together with '|' to specify one or more filters to use.
|
||||
These filters are described in more detail in the PNG specification. If
|
||||
you intend to change the filter type during the course of writing
|
||||
These filters are described in more detail in the PNG specification.
|
||||
If you intend to change the filter type during the course of writing
|
||||
the image, you should start with flags set for all of the filters
|
||||
you intend to use so that libpng can initialize its internal
|
||||
structures appropriately for all of the filter types.
|
||||
structures appropriately for all of the filter types. (Note that this
|
||||
means the first row must always be adaptively filtered, because libpng
|
||||
currently does not allocate the filter buffers until png_write_row()
|
||||
is called for the first time.)
|
||||
|
||||
filters = PNG_FILTER_NONE | PNG_FILTER_SUB
|
||||
PNG_FILTER_UP | PNG_FILTER_AVE |
|
||||
PNG_FILTER_PAETH | PNG_ALL_FILTERS;
|
||||
or
|
||||
filters = one of PNG_FILTER_VALUE_NONE,
|
||||
PNG_FILTER_VALUE_SUB, PNG_FILTER_VALUE_UP,
|
||||
PNG_FILTER_VALUE_AVE, PNG_FILTER_VALUE_PAETH
|
||||
|
||||
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE,
|
||||
filters);
|
||||
@@ -2536,16 +2546,16 @@ structures appropriately for all of the filter types.
|
||||
in png_set_IHDR().
|
||||
|
||||
It is also possible to influence how libpng chooses from among the
|
||||
available filters. This is done in two ways - by telling it how
|
||||
important it is to keep the same filter for successive rows, and
|
||||
by telling it the relative computational costs of the filters.
|
||||
available filters. This is done in one or both of two ways - by
|
||||
telling it how important it is to keep the same filter for successive
|
||||
rows, and by telling it the relative computational costs of the filters.
|
||||
|
||||
double weights[3] = {1.5, 1.3, 1.1},
|
||||
costs[PNG_FILTER_VALUE_LAST] =
|
||||
{1.0, 1.3, 1.3, 1.5, 1.7};
|
||||
|
||||
png_set_filter_selection(png_ptr,
|
||||
PNG_FILTER_SELECTION_WEIGHTED, 3,
|
||||
png_set_filter_heuristics(png_ptr,
|
||||
PNG_FILTER_HEURISTIC_WEIGHTED, 3,
|
||||
weights, costs);
|
||||
|
||||
The weights are multiplying factors that indicate to libpng that the
|
||||
@@ -2645,7 +2655,6 @@ 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
|
||||
this version of libpng, but if you insert some they will be printed.
|
||||
|
||||
|
||||
VI. MNG support
|
||||
|
||||
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
||||
@@ -2659,7 +2668,7 @@ png_permit_mng_features() function:
|
||||
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
|
||||
feature_set is a png_byte 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.
|
||||
|
||||
@@ -2720,15 +2729,15 @@ application:
|
||||
|
||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||
|
||||
VIII. Y2K Compliance in libpng
|
||||
VII. Y2K Compliance in libpng
|
||||
|
||||
May 14, 2001
|
||||
April 15, 2002
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.0.12beta1 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.0.13 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
|
||||
27
libpngpf.3
27
libpngpf.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "May 14, 2001"
|
||||
.TH LIBPNGPF 3 "April 15, 2002"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.13
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
@@ -47,11 +47,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_create_struct (int \fP\fItype\fP\fB, png_malloc_ptr \fImalloc_fn\fP\fB);\fP
|
||||
\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_create_struct_2 (int \fItype\fP\fB);\fP
|
||||
\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -63,7 +63,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -191,10 +191,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -425,6 +421,8 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -529,17 +527,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.12beta1
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
.SH DESCRIPTION
|
||||
The functions listed above are used privately by libpng
|
||||
and are not recommended for use by applications. They
|
||||
and are not recommended for use by applications. They are
|
||||
not "exported" to applications using shared libraries. They
|
||||
are listed alphabetically here as an aid to libpng maintainers.
|
||||
See png.h for more information on these functions.
|
||||
|
||||
|
||||
2
png.5
2
png.5
@@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "May 14, 2001"
|
||||
.TH PNG 5 "April 15, 2002"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
||||
110
png.c
110
png.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* libpng version 1.0.12beta1 - May 14, 2001
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* libpng version 1.0.13 - April 15, 2002
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -13,14 +13,14 @@
|
||||
#include "png.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_0_12beta1 Your_png_h_is_not_version_1_0_12beta1;
|
||||
typedef version_1_0_13 Your_png_h_is_not_version_1_0_13;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h. */
|
||||
|
||||
#ifdef PNG_USE_GLOBAL_ARRAYS
|
||||
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
||||
const char png_libpng_ver[18] = "1.0.12beta1";
|
||||
const char png_libpng_ver[18] = "1.0.13";
|
||||
|
||||
/* png_sig was changed to a function in version 1.0.5c */
|
||||
/* Place to hold the signature string for a PNG file. */
|
||||
@@ -135,13 +135,22 @@ png_check_sig(png_bytep sig, int num)
|
||||
}
|
||||
|
||||
/* Function to allocate memory for zlib and clear it to 0. */
|
||||
voidpf /* PRIVATE */
|
||||
voidpf PNGAPI
|
||||
png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
||||
{
|
||||
png_uint_32 num_bytes = (png_uint_32)items * size;
|
||||
png_voidp ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
|
||||
png_voidp ptr;
|
||||
png_structp p=png_ptr;
|
||||
png_uint_32 save_flags=p->flags;
|
||||
|
||||
p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
|
||||
ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
|
||||
p->flags=save_flags;
|
||||
|
||||
#ifndef PNG_NO_ZALLOC_ZERO
|
||||
if (ptr == NULL)
|
||||
return ((voidpf)ptr);
|
||||
|
||||
if (num_bytes > (png_uint_32)0x8000L)
|
||||
{
|
||||
png_memset(ptr, 0, (png_size_t)0x8000L);
|
||||
@@ -157,7 +166,7 @@ png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
||||
}
|
||||
|
||||
/* function to free memory for zlib */
|
||||
void /* PRIVATE */
|
||||
void PNGAPI
|
||||
png_zfree(voidpf png_ptr, voidpf ptr)
|
||||
{
|
||||
png_free((png_structp)png_ptr, (png_voidp)ptr);
|
||||
@@ -212,14 +221,13 @@ png_create_info_struct(png_structp png_ptr)
|
||||
png_debug(1, "in png_create_info_struct\n");
|
||||
if(png_ptr == NULL) return (NULL);
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if ((info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO,
|
||||
png_ptr->malloc_fn, png_ptr->mem_ptr)) != NULL)
|
||||
info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO,
|
||||
png_ptr->malloc_fn, png_ptr->mem_ptr);
|
||||
#else
|
||||
if ((info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO)) != NULL)
|
||||
info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
|
||||
#endif
|
||||
{
|
||||
if (info_ptr != NULL)
|
||||
png_info_init_3(&info_ptr, sizeof(png_info));
|
||||
}
|
||||
|
||||
return (info_ptr);
|
||||
}
|
||||
@@ -248,7 +256,7 @@ png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
|
||||
#else
|
||||
png_destroy_struct((png_voidp)info_ptr);
|
||||
#endif
|
||||
*info_ptr_ptr = (png_infop)NULL;
|
||||
*info_ptr_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,6 +354,9 @@ if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
|
||||
{
|
||||
png_free(png_ptr, info_ptr->trans);
|
||||
info_ptr->valid &= ~PNG_INFO_tRNS;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
info_ptr->trans = NULL;
|
||||
}
|
||||
#endif
|
||||
@@ -489,6 +500,9 @@ if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST))
|
||||
png_free(png_ptr, info_ptr->hist);
|
||||
info_ptr->hist = NULL;
|
||||
info_ptr->valid &= ~PNG_INFO_hIST;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -502,6 +516,9 @@ if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE))
|
||||
png_zfree(png_ptr, info_ptr->palette);
|
||||
info_ptr->palette = NULL;
|
||||
info_ptr->valid &= ~PNG_INFO_PLTE;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
|
||||
#endif
|
||||
info_ptr->num_palette = 0;
|
||||
}
|
||||
|
||||
@@ -646,10 +663,10 @@ png_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
|
||||
return ((png_charp) "\n libpng version 1.0.12beta1 - May 14, 2001\n\
|
||||
Copyright (c) 1998-2001 Glenn Randers-Pehrson\n\
|
||||
Copyright (c) 1996, 1997 Andreas Dilger\n\
|
||||
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||
return ((png_charp) "\n libpng version 1.0.13 - April 15, 2002\n\
|
||||
Copyright (c) 1998-2002 Glenn Randers-Pehrson\n\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||
return ((png_charp) "");
|
||||
}
|
||||
|
||||
@@ -664,8 +681,8 @@ png_get_libpng_ver(png_structp png_ptr)
|
||||
{
|
||||
/* Version of *.c files used when building libpng */
|
||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
||||
return((png_charp) "1.0.12beta1");
|
||||
return((png_charp) "1.0.12beta1");
|
||||
return((png_charp) "1.0.13");
|
||||
return((png_charp) "1.0.13");
|
||||
}
|
||||
|
||||
png_charp PNGAPI
|
||||
@@ -687,7 +704,7 @@ png_get_header_version(png_structp png_ptr)
|
||||
}
|
||||
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
int /* PRIVATE */
|
||||
int PNGAPI
|
||||
png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
|
||||
{
|
||||
/* check chunk_name and return "keep" value if it's on the list, else 0 */
|
||||
@@ -715,9 +732,59 @@ png_uint_32 PNGAPI
|
||||
png_access_version_number(void)
|
||||
{
|
||||
/* Version of *.c files used when building libpng */
|
||||
return((png_uint_32) 10012L);
|
||||
return((png_uint_32) 10013L);
|
||||
}
|
||||
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */
|
||||
/* this INTERNAL function was added to libpng 1.2.0 */
|
||||
void /* PRIVATE */
|
||||
png_init_mmx_flags (png_structp png_ptr)
|
||||
{
|
||||
png_ptr->mmx_rowbytes_threshold = 0;
|
||||
png_ptr->mmx_bitdepth_threshold = 0;
|
||||
|
||||
# if (defined(PNG_USE_PNGVCRD) || defined(PNG_USE_PNGGCCRD))
|
||||
|
||||
png_ptr->asm_flags |= PNG_ASM_FLAG_MMX_SUPPORT_COMPILED;
|
||||
|
||||
if (png_mmx_support()) {
|
||||
png_ptr->asm_flags |= PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU
|
||||
# ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
|
||||
| PNG_ASM_FLAG_MMX_READ_COMBINE_ROW
|
||||
# endif
|
||||
# ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE
|
||||
| PNG_ASM_FLAG_MMX_READ_INTERLACE
|
||||
# endif
|
||||
# ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
|
||||
;
|
||||
# else
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_UP
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
|
||||
|
||||
png_ptr->mmx_rowbytes_threshold = PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT;
|
||||
png_ptr->mmx_bitdepth_threshold = PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT;
|
||||
# endif
|
||||
} else {
|
||||
png_ptr->asm_flags &= ~( PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU
|
||||
| PNG_MMX_READ_FLAGS
|
||||
| PNG_MMX_WRITE_FLAGS );
|
||||
}
|
||||
|
||||
# else /* !((PNGVCRD || PNGGCCRD) && PNG_ASSEMBLER_CODE_SUPPORTED)) */
|
||||
|
||||
/* clear all MMX flags; no support is compiled in */
|
||||
png_ptr->asm_flags &= ~( PNG_MMX_FLAGS );
|
||||
|
||||
# endif /* ?(PNGVCRD || PNGGCCRD) */
|
||||
}
|
||||
|
||||
#endif /* !(PNG_ASSEMBLER_CODE_SUPPORTED) */
|
||||
|
||||
/* this function was added to libpng 1.2.0 */
|
||||
#if !defined(PNG_USE_PNGGCCRD) && \
|
||||
!(defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD))
|
||||
@@ -727,3 +794,4 @@ png_mmx_support(void)
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
209
png.h
209
png.h
@@ -1,15 +1,15 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.0.12beta1 - May 14, 2001
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* libpng version 1.0.13 - April 15, 2002
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.0.12beta1 - May 14, 2001: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.0.13 - April 15, 2002: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@@ -70,10 +70,23 @@
|
||||
* 1.0.11beta1-3 1 10011 2.1.0.11beta1-3
|
||||
* 1.0.11rc1 1 10011 2.1.0.11rc1
|
||||
* 1.0.11 1 10011 2.1.0.11
|
||||
* 1.0.12beta1 2 10012 2.1.0.11beta1
|
||||
* 1.1.0a-f 1 10100 2.1.1.0a-f (branch abandoned)
|
||||
* 1.0.12beta1-2 2 10012 2.1.0.12beta1-2
|
||||
* 1.0.12rc1 2 10012 2.1.0.12rc1
|
||||
* 1.0.12 2 10012 2.1.0.12
|
||||
* 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned)
|
||||
* 1.2.0beta1-2 2 10200 2.1.2.0beta1-2
|
||||
* 1.2.0beta3 3 10200 3.1.2.0beta3
|
||||
* 1.2.0beta3-5 3 10200 3.1.2.0beta3-5
|
||||
* 1.2.0rc1 3 10200 3.1.2.0rc1
|
||||
* 1.2.0 3 10200 3.1.2.0
|
||||
* 1.2.1beta1-4 3 10201 3.1.2.1beta1-4
|
||||
* 1.2.1rc1-2 3 10201 3.1.2.1rc1-2
|
||||
* 1.2.1 3 10201 3.1.2.1
|
||||
* 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6
|
||||
* 1.0.13beta1 10 10013 10.so.0.1.0.13beta1
|
||||
* 1.2.2rc1 12 10202 12.so.0.1.2.2rc1
|
||||
* 1.0.13rc1 10 10013 10.so.0.1.0.13rc1
|
||||
* 1.2.2 12 10202 12.so.0.1.2.2
|
||||
* 1.0.13 10 10013 10.so.0.1.0.13
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@@ -103,8 +116,8 @@
|
||||
* If you modify libpng you may insert additional notices immediately following
|
||||
* this sentence.
|
||||
*
|
||||
* libpng versions 1.0.7, July 1, 2000, through 1.0.12beta1, May 14, 2001, are
|
||||
* Copyright (c) 2000, 2001 Glenn Randers-Pehrson, and are
|
||||
* libpng versions 1.0.7, July 1, 2000, through 1.0.13, April 15, 2002, are
|
||||
* Copyright (c) 2000-2001 Glenn Randers-Pehrson, 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
|
||||
*
|
||||
@@ -208,13 +221,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* May 14, 2001
|
||||
* April 15, 2002
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.0.12beta1 are Y2K compliant. It is my belief that earlier
|
||||
* upward through 1.0.13 are Y2K compliant. It is my belief that earlier
|
||||
* versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
@@ -270,19 +283,19 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.0.12beta1"
|
||||
#define PNG_LIBPNG_VER_STRING "1.0.13"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 2
|
||||
#define PNG_LIBPNG_VER_SONUM 0
|
||||
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
|
||||
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 0
|
||||
#define PNG_LIBPNG_VER_RELEASE 12
|
||||
#define PNG_LIBPNG_VER_RELEASE 13
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 1
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
#define PNG_LIBPNG_BUILD_BETA 2
|
||||
@@ -290,14 +303,14 @@
|
||||
#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
|
||||
#define PNG_LIBPNG_BUILD_TYPE 4
|
||||
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||
* We must not include leading zeros.
|
||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
|
||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
|
||||
#define PNG_LIBPNG_VER 10012 /* 1.0.12 */
|
||||
#define PNG_LIBPNG_VER 10013 /* 1.0.13 */
|
||||
|
||||
#ifndef PNG_VERSION_INFO_ONLY
|
||||
|
||||
@@ -318,6 +331,40 @@ extern "C" {
|
||||
* which applications aren't expected to use directly.
|
||||
*/
|
||||
|
||||
#ifndef PNG_NO_TYPECAST_NULL
|
||||
#define int_p_NULL (int *)NULL
|
||||
#define png_bytep_NULL (png_bytep)NULL
|
||||
#define png_bytepp_NULL (png_bytepp)NULL
|
||||
#define png_doublep_NULL (png_doublep)NULL
|
||||
#define png_error_ptr_NULL (png_error_ptr)NULL
|
||||
#define png_flush_ptr_NULL (png_flush_ptr)NULL
|
||||
#define png_free_ptr_NULL (png_free_ptr)NULL
|
||||
#define png_infopp_NULL (png_infopp)NULL
|
||||
#define png_malloc_ptr_NULL (png_malloc_ptr)NULL
|
||||
#define png_read_status_ptr_NULL (png_read_status_ptr)NULL
|
||||
#define png_rw_ptr_NULL (png_rw_ptr)NULL
|
||||
#define png_structp_NULL (png_structp)NULL
|
||||
#define png_uint_16p_NULL (png_uint_16p)NULL
|
||||
#define png_voidp_NULL (png_voidp)NULL
|
||||
#define png_write_status_ptr_NULL (png_write_status_ptr)NULL
|
||||
#else
|
||||
#define int_p_NULL NULL
|
||||
#define png_bytep_NULL NULL
|
||||
#define png_bytepp_NULL NULL
|
||||
#define png_doublep_NULL NULL
|
||||
#define png_error_ptr_NULL NULL
|
||||
#define png_flush_ptr_NULL NULL
|
||||
#define png_free_ptr_NULL NULL
|
||||
#define png_infopp_NULL NULL
|
||||
#define png_malloc_ptr_NULL NULL
|
||||
#define png_read_status_ptr_NULL NULL
|
||||
#define png_rw_ptr_NULL NULL
|
||||
#define png_structp_NULL NULL
|
||||
#define png_uint_16p_NULL NULL
|
||||
#define png_voidp_NULL NULL
|
||||
#define png_write_status_ptr_NULL NULL
|
||||
#endif
|
||||
|
||||
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
|
||||
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
|
||||
/* Version information for C files, stored in png.c. This had better match
|
||||
@@ -1042,9 +1089,9 @@ struct png_struct_def
|
||||
float background_gamma;
|
||||
# endif
|
||||
png_color_16 background; /* background color in screen gamma space */
|
||||
# if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
png_color_16 background_1; /* background normalized to gamma 1.0 */
|
||||
# endif /* PNG_READ_GAMMA && PNG_bKGD_SUPPORTED */
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
png_color_16 background_1; /* background normalized to gamma 1.0 */
|
||||
#endif
|
||||
#endif /* PNG_bKGD_SUPPORTED */
|
||||
|
||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
|
||||
@@ -1174,7 +1221,11 @@ struct png_struct_def
|
||||
defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
|
||||
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
|
||||
/* changed from png_byte to png_uint_32 at version 1.2.0 */
|
||||
#ifdef PNG_1_0_X
|
||||
png_byte mng_features_permitted;
|
||||
#else
|
||||
png_uint_32 mng_features_permitted;
|
||||
#endif /* PNG_1_0_X */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.0.7 */
|
||||
@@ -1187,13 +1238,13 @@ struct png_struct_def
|
||||
png_byte filter_type;
|
||||
#endif
|
||||
|
||||
#if defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD)
|
||||
#if defined(PNG_1_0_X) || (defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD))
|
||||
/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */
|
||||
png_uint_32 row_buf_size;
|
||||
#endif
|
||||
|
||||
/* New members added in libpng-1.2.0 */
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
#if !defined(PNG_1_0_X) && defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
png_byte mmx_bitdepth_threshold;
|
||||
png_uint_32 mmx_rowbytes_threshold;
|
||||
png_uint_32 asm_flags;
|
||||
@@ -1206,13 +1257,15 @@ struct png_struct_def
|
||||
png_free_ptr free_fn; /* function for freeing memory */
|
||||
#endif
|
||||
|
||||
png_bytep big_row_buf; /* buffer to save current (unfiltered) row */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* This prevents a compiler error in png_get_copyright() in png.c if png.c
|
||||
and png.h are both at version 1.0.12beta1
|
||||
/* This prevents a compiler error in png.c if png.c and png.h are both at
|
||||
version 1.0.13
|
||||
*/
|
||||
typedef png_structp version_1_0_12beta1;
|
||||
typedef png_structp version_1_0_13;
|
||||
|
||||
typedef png_struct FAR * FAR * png_structpp;
|
||||
|
||||
@@ -1520,9 +1573,6 @@ extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
extern PNG_EXPORT(void,png_destroy_write_struct)
|
||||
PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
|
||||
|
||||
/* free any memory used in info_ptr struct (old method - NOT DLL EXPORTED) */
|
||||
extern void png_write_destroy_info PNGARG((png_infop info_ptr));
|
||||
|
||||
/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
|
||||
extern void png_write_destroy PNGARG((png_structp png_ptr));
|
||||
|
||||
@@ -1767,6 +1817,13 @@ extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
|
||||
/* frees a pointer allocated by png_malloc() */
|
||||
extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||
|
||||
/* Function to allocate memory for zlib. */
|
||||
extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
|
||||
uInt size));
|
||||
|
||||
/* Function to free memory for zlib */
|
||||
extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
|
||||
|
||||
/* Free data that was allocated internally */
|
||||
extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 free_me, int num));
|
||||
@@ -2174,6 +2231,10 @@ extern PNG_EXPORT(void, png_set_unknown_chunk_location)
|
||||
extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
|
||||
png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
|
||||
#endif
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
|
||||
chunk_name));
|
||||
#endif
|
||||
|
||||
/* Png_free_data() will turn off the "valid" flag for anything it frees.
|
||||
If you need to turn it off for a chunk that your application has freed,
|
||||
@@ -2256,11 +2317,71 @@ extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
|
||||
png_ptr, png_uint_32 mng_features_permitted));
|
||||
#endif
|
||||
|
||||
/* png_mmx_support will be included unconditionally starting in version 1.2.0 */
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) || defined(PNG_USE_PNGGCCRD)
|
||||
/* Added to version 1.2.0 */
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */
|
||||
#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */
|
||||
#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04
|
||||
#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08
|
||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10
|
||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20
|
||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40
|
||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
|
||||
#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */
|
||||
|
||||
#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
||||
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_UP \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH )
|
||||
#define PNG_MMX_WRITE_FLAGS ( 0 )
|
||||
|
||||
#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \
|
||||
| PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \
|
||||
| PNG_MMX_READ_FLAGS \
|
||||
| PNG_MMX_WRITE_FLAGS )
|
||||
|
||||
#define PNG_SELECT_READ 1
|
||||
#define PNG_SELECT_WRITE 2
|
||||
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
/* pngget.c */
|
||||
extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask)
|
||||
PNGARG((int flag_select, int *compilerID));
|
||||
|
||||
/* pngget.c */
|
||||
extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask)
|
||||
PNGARG((int flag_select));
|
||||
|
||||
/* pngget.c */
|
||||
extern PNG_EXPORT(png_uint_32,png_get_asm_flags)
|
||||
PNGARG((png_structp png_ptr));
|
||||
|
||||
/* pngget.c */
|
||||
extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold)
|
||||
PNGARG((png_structp png_ptr));
|
||||
|
||||
/* pngget.c */
|
||||
extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold)
|
||||
PNGARG((png_structp png_ptr));
|
||||
|
||||
/* pngset.c */
|
||||
extern PNG_EXPORT(void,png_set_asm_flags)
|
||||
PNGARG((png_structp png_ptr, png_uint_32 asm_flags));
|
||||
|
||||
/* pngset.c */
|
||||
extern PNG_EXPORT(void,png_set_mmx_thresholds)
|
||||
PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold,
|
||||
png_uint_32 mmx_rowbytes_threshold));
|
||||
|
||||
#endif /* PNG_1_0_X */
|
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
/* png.c, pnggccrd.c, or pngvcrd.c */
|
||||
extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
|
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
/* Strip the prepended error numbers ("#nnn ") from error and warning
|
||||
* messages before passing them to the error or warning handler. */
|
||||
@@ -2268,11 +2389,12 @@ extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
|
||||
extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
|
||||
png_ptr, png_uint_32 strip_mode));
|
||||
#endif
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
|
||||
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.0.12beta1 - May 14, 2001 (header)\n"
|
||||
" libpng version 1.0.13 - April 15, 2002 (header)\n"
|
||||
|
||||
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
||||
/* With these routines we avoid an integer divide, which will be slower on
|
||||
@@ -2397,6 +2519,7 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
|
||||
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L
|
||||
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L
|
||||
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L
|
||||
#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L
|
||||
|
||||
/* For use in png_set_keep_unknown, png_handle_as_unknown */
|
||||
#define HANDLE_CHUNK_AS_DEFAULT 0
|
||||
@@ -2540,12 +2663,6 @@ PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
|
||||
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
|
||||
/* Function to allocate memory for zlib. */
|
||||
PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
|
||||
|
||||
/* Function to free memory for zlib */
|
||||
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
|
||||
|
||||
/* Reset the CRC variable */
|
||||
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
|
||||
|
||||
@@ -2592,7 +2709,7 @@ PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
|
||||
*/
|
||||
PNG_EXTERN void png_save_uint_32 PNGARG((png_bytep buf, png_uint_32 i));
|
||||
|
||||
#if defined(PNG_WRITE_pCAL_SUPPORTED)
|
||||
#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED)
|
||||
PNG_EXTERN void png_save_int_32 PNGARG((png_bytep buf, png_int_32 i));
|
||||
#endif
|
||||
|
||||
@@ -2710,7 +2827,7 @@ PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
|
||||
|
||||
#if defined(PNG_WRITE_oFFs_SUPPORTED)
|
||||
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
|
||||
png_uint_32 x_offset, png_uint_32 y_offset, int unit_type));
|
||||
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_WRITE_pCAL_SUPPORTED)
|
||||
@@ -2885,12 +3002,17 @@ PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row,
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_color_16p trans_values, png_color_16p background,
|
||||
png_color_16p background_1,
|
||||
png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
|
||||
png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
|
||||
png_uint_16pp gamma_16_to_1, int gamma_shift));
|
||||
#else
|
||||
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_color_16p trans_values, png_color_16p background));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
@@ -3003,11 +3125,6 @@ PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
PNG_EXTERN int png_handle_as_unknown PNGARG((png_structp png_ptr, png_bytep
|
||||
chunk_name));
|
||||
#endif
|
||||
|
||||
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 length));
|
||||
|
||||
@@ -3078,6 +3195,10 @@ PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
/* png.c */ /* PRIVATE */
|
||||
PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr));
|
||||
#endif
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
|
||||
#endif /* PNG_INTERNAL */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 2002 Glenn Randers-Pehrson
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
62
pngconf.h
62
pngconf.h
@@ -1,8 +1,8 @@
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -16,6 +16,8 @@
|
||||
#ifndef PNGCONF_H
|
||||
#define PNGCONF_H
|
||||
|
||||
#define PNG_1_0_X
|
||||
|
||||
/* This is the size of the compression buffer, and thus the size of
|
||||
* an IDAT chunk. Make this whatever size you feel is best for your
|
||||
* machine. One of these will be allocated per png_struct. When this
|
||||
@@ -47,13 +49,11 @@
|
||||
|
||||
/* Enabled by default in 1.2.0. You can disable this if you don't need to
|
||||
support PNGs that are embedded in MNG datastreams */
|
||||
/*
|
||||
#ifndef PNG_NO_MNG_FEATURES
|
||||
#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
|
||||
# ifndef PNG_MNG_FEATURES_SUPPORTED
|
||||
# define PNG_MNG_FEATURES_SUPPORTED
|
||||
# endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
|
||||
# ifndef PNG_FLOATING_POINT_SUPPORTED
|
||||
@@ -204,6 +204,9 @@
|
||||
|
||||
#ifdef _NO_PROTO
|
||||
# define PNGARG(arglist) ()
|
||||
# ifndef PNG_TYPECAST_NULL
|
||||
# define PNG_TYPECAST_NULL
|
||||
# endif
|
||||
#else
|
||||
# define PNGARG(arglist) arglist
|
||||
#endif /* _NO_PROTO */
|
||||
@@ -228,7 +231,7 @@
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef PNG_SETJMP_NOT_SUPPORTED
|
||||
#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
|
||||
# define PNG_SETJMP_SUPPORTED
|
||||
#endif
|
||||
|
||||
@@ -401,10 +404,10 @@
|
||||
*/
|
||||
|
||||
#ifndef PNG_iTXt_SUPPORTED
|
||||
# ifndef PNG_READ_iTXt_SUPPORTED
|
||||
# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
|
||||
# define PNG_NO_READ_iTXt
|
||||
# endif
|
||||
# ifndef PNG_WRITE_iTXt_SUPPORTED
|
||||
# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
|
||||
# define PNG_NO_WRITE_iTXt
|
||||
# endif
|
||||
#endif
|
||||
@@ -590,12 +593,11 @@
|
||||
# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||
#endif
|
||||
|
||||
/* Will be enabled in libpng-1.2.0 */
|
||||
/*
|
||||
#ifndef PNG_1_0_X
|
||||
#ifndef PNG_NO_ERROR_NUMBERS
|
||||
#define PNG_ERROR_NUMBERS_SUPPORTED
|
||||
#endif
|
||||
*/
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
#ifndef PNG_NO_WRITE_FLUSH
|
||||
# define PNG_WRITE_FLUSH_SUPPORTED
|
||||
@@ -634,7 +636,6 @@
|
||||
|
||||
/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
|
||||
even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */
|
||||
/*
|
||||
#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
|
||||
# ifndef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
# define PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
@@ -643,24 +644,18 @@
|
||||
# define PNG_MMX_CODE_SUPPORTED
|
||||
# endif
|
||||
#endif
|
||||
*/
|
||||
#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
|
||||
# if defined(PNG_USE_PNGVCRD) || defined(PNG_USE_PNGGCCRD)
|
||||
# ifndef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
# define PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
# endif
|
||||
# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
|
||||
# define PNG_MMX_CODE_SUPPORTED
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* This will be enabled by default in libpng-1.2.0 */
|
||||
/*
|
||||
/* If you are sure that you don't need thread safety and you are compiling
|
||||
with PNG_USE_PNGCCRD for an MMX application, you can define this for
|
||||
faster execution. See pnggccrd.c.
|
||||
#define PNG_THREAD_UNSAFE_OK
|
||||
*/
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
|
||||
# define PNG_USER_MEM_SUPPORTED
|
||||
#endif
|
||||
*/
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
/* These are currently experimental features, define them if you want */
|
||||
|
||||
@@ -671,9 +666,6 @@
|
||||
# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||
# endif
|
||||
#endif
|
||||
#ifndef PNG_NO_ZALLOC_ZERO
|
||||
# define PNG_ZALLOC_ZERO
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* This is only for PowerPC big-endian and 680x0 systems */
|
||||
@@ -743,8 +735,12 @@
|
||||
# define PNG_iCCP_SUPPORTED
|
||||
#endif
|
||||
#ifndef PNG_NO_READ_iTXt
|
||||
# define PNG_READ_iTXt_SUPPORTED
|
||||
# define PNG_iTXt_SUPPORTED
|
||||
# ifndef PNG_READ_iTXt_SUPPORTED
|
||||
# define PNG_READ_iTXt_SUPPORTED
|
||||
# endif
|
||||
# ifndef PNG_iTXt_SUPPORTED
|
||||
# define PNG_iTXt_SUPPORTED
|
||||
# endif
|
||||
#endif
|
||||
#ifndef PNG_NO_READ_oFFs
|
||||
# define PNG_READ_oFFs_SUPPORTED
|
||||
@@ -859,7 +855,9 @@
|
||||
# endif
|
||||
#endif
|
||||
#ifndef PNG_NO_WRITE_iTXt
|
||||
# define PNG_WRITE_iTXt_SUPPORTED
|
||||
# ifndef PNG_WRITE_iTXt_SUPPORTED
|
||||
# define PNG_WRITE_iTXt_SUPPORTED
|
||||
# endif
|
||||
# ifndef PNG_iTXt_SUPPORTED
|
||||
# define PNG_iTXt_SUPPORTED
|
||||
# endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -277,7 +277,7 @@ png_get_error_ptr(png_structp png_ptr)
|
||||
|
||||
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
void
|
||||
void PNGAPI
|
||||
png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
|
||||
{
|
||||
if(png_ptr != NULL)
|
||||
@@ -287,4 +287,3 @@ png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
527
pnggccrd.c
527
pnggccrd.c
@@ -6,9 +6,9 @@
|
||||
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
|
||||
* for Intel's performance analysis of the MMX vs. non-MMX code.
|
||||
*
|
||||
* libpng version 1.0.12beta1 - May 14, 2001
|
||||
* libpng version 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998, Intel Corporation
|
||||
*
|
||||
* Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998.
|
||||
@@ -203,9 +203,14 @@
|
||||
* - "_ShiftRem.use = 40;" should have been "_ShiftRem.use = 48;"
|
||||
* - "psllq _ShiftRem, %%mm2" should have been "psrlq _ShiftRem, %%mm2"
|
||||
*
|
||||
* 20010101:
|
||||
* - added new png_init_mmx_flags() function (here only because it needs to
|
||||
* call mmxsupport(), which should probably become global png_mmxsupport());
|
||||
* modified other MMX routines to run conditionally (png_ptr->asm_flags)
|
||||
*
|
||||
* 20010103:
|
||||
* - renamed mmxsupport() to png_mmx_support(), with auto-set of mmx_supported,
|
||||
* and made it public
|
||||
* and made it public; moved png_init_mmx_flags() to png.c as internal func
|
||||
*
|
||||
* 20010104:
|
||||
* - removed dependency on png_read_filter_row_c() (C code already duplicated
|
||||
@@ -215,6 +220,9 @@
|
||||
* 20010310:
|
||||
* - fixed buffer-overrun bug in png_combine_row() C code (non-MMX)
|
||||
*
|
||||
* 20020304:
|
||||
* - eliminated incorrect use of width_mmx in pixel_bytes == 8 case
|
||||
*
|
||||
* STILL TO DO:
|
||||
* - test png_do_read_interlace() 64-bit case (pixel_bytes == 8)
|
||||
* - write MMX code for 48-bit case (pixel_bytes == 6)
|
||||
@@ -226,15 +234,9 @@
|
||||
* x pick one version of mmxsupport() and get rid of the other
|
||||
* - add error messages to any remaining bogus default cases
|
||||
* - enable pixel_depth == 8 cases in png_read_filter_row()? (test speed)
|
||||
* - add support for runtime enable/disable/query of various MMX routines
|
||||
* x add support for runtime enable/disable/query of various MMX routines
|
||||
*/
|
||||
|
||||
/*
|
||||
#ifndef PNG_DEBUG
|
||||
# define PNG_DEBUG 0
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
@@ -253,7 +255,6 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
* so define them without: */
|
||||
#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__)
|
||||
# define _mmx_supported mmx_supported
|
||||
# define _unmask unmask
|
||||
# define _const4 const4
|
||||
# define _const6 const6
|
||||
# define _mask8_0 mask8_0
|
||||
@@ -272,9 +273,6 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
# define _mask48_2 mask48_2
|
||||
# define _mask48_1 mask48_1
|
||||
# define _mask48_0 mask48_0
|
||||
# define _FullLength FullLength
|
||||
# define _MMXLength MMXLength
|
||||
# define _dif dif
|
||||
# define _LBCarryMask LBCarryMask
|
||||
# define _HBClearMask HBClearMask
|
||||
# define _ActiveMask ActiveMask
|
||||
@@ -282,10 +280,16 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
# define _ActiveMaskEnd ActiveMaskEnd
|
||||
# define _ShiftBpp ShiftBpp
|
||||
# define _ShiftRem ShiftRem
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
# define _unmask unmask
|
||||
# define _FullLength FullLength
|
||||
# define _MMXLength MMXLength
|
||||
# define _dif dif
|
||||
# define _patemp patemp
|
||||
# define _pbtemp pbtemp
|
||||
# define _pctemp pctemp
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* These constants are used in the inlined MMX assembly code.
|
||||
@@ -297,7 +301,9 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1};
|
||||
* "more than 10 operands in `asm'" errors when %ebx is used to preload unmask
|
||||
* in the non-PIC case, so we'll just use the global unconditionally now.
|
||||
*/
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
static int _unmask;
|
||||
#endif
|
||||
|
||||
static unsigned long long _mask8_0 = 0x0102040810204080LL;
|
||||
|
||||
@@ -326,15 +332,49 @@ static unsigned long long _const6 = 0x00000000000000FFLL;
|
||||
|
||||
// These are used in the row-filter routines and should/would be local
|
||||
// variables if not for gcc addressing limitations.
|
||||
// WARNING: Their presence probably defeats the thread safety of libpng.
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
static png_uint_32 _FullLength;
|
||||
static png_uint_32 _MMXLength;
|
||||
static int _dif;
|
||||
static int _patemp; // temp variables for Paeth routine
|
||||
static int _pbtemp;
|
||||
static int _pctemp;
|
||||
#endif
|
||||
|
||||
void /* PRIVATE */
|
||||
png_squelch_warnings(void)
|
||||
{
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
_dif = _dif;
|
||||
_patemp = _patemp;
|
||||
_pbtemp = _pbtemp;
|
||||
_pctemp = _pctemp;
|
||||
_MMXLength = _MMXLength;
|
||||
#endif
|
||||
_const4 = _const4;
|
||||
_const6 = _const6;
|
||||
_mask8_0 = _mask8_0;
|
||||
_mask16_1 = _mask16_1;
|
||||
_mask16_0 = _mask16_0;
|
||||
_mask24_2 = _mask24_2;
|
||||
_mask24_1 = _mask24_1;
|
||||
_mask24_0 = _mask24_0;
|
||||
_mask32_3 = _mask32_3;
|
||||
_mask32_2 = _mask32_2;
|
||||
_mask32_1 = _mask32_1;
|
||||
_mask32_0 = _mask32_0;
|
||||
_mask48_5 = _mask48_5;
|
||||
_mask48_4 = _mask48_4;
|
||||
_mask48_3 = _mask48_3;
|
||||
_mask48_2 = _mask48_2;
|
||||
_mask48_1 = _mask48_1;
|
||||
_mask48_0 = _mask48_0;
|
||||
}
|
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
|
||||
static int _mmx_supported = 2;
|
||||
|
||||
/*===========================================================================*/
|
||||
@@ -370,9 +410,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
{
|
||||
png_debug(1, "in png_combine_row (pnggccrd.c)\n");
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if (_mmx_supported == 2) {
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
png_warning(png_ptr, "asm_flags may not have been initialized");
|
||||
png_mmx_support();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mask == 0xff)
|
||||
{
|
||||
@@ -555,8 +599,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported )
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
#else
|
||||
if (_mmx_supported)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 len;
|
||||
int diff;
|
||||
@@ -688,8 +737,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported )
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
#else
|
||||
if (_mmx_supported)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 len;
|
||||
int diff;
|
||||
@@ -836,8 +890,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported )
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
#else
|
||||
if (_mmx_supported)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 len;
|
||||
int diff;
|
||||
@@ -999,8 +1058,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported )
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
#else
|
||||
if (_mmx_supported)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 len;
|
||||
int diff;
|
||||
@@ -1169,8 +1233,13 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_bytep srcptr;
|
||||
png_bytep dstptr;
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported )
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && _mmx_supported */ )
|
||||
#else
|
||||
if (_mmx_supported)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 len;
|
||||
int diff;
|
||||
@@ -1394,10 +1463,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
default: /* png_ptr->row_info.pixel_depth != 1,2,4,8,16,24,32,48,64 */
|
||||
{
|
||||
/* this should never happen */
|
||||
fprintf(stderr,
|
||||
"libpng internal error: png_ptr->row_info.pixel_depth = %d\n",
|
||||
png_ptr->row_info.pixel_depth);
|
||||
fflush(stderr);
|
||||
png_warning(png_ptr, "Invalid row_info.pixel_depth in pnggccrd");
|
||||
break;
|
||||
}
|
||||
} /* end switch (png_ptr->row_info.pixel_depth) */
|
||||
@@ -1436,9 +1502,13 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
|
||||
png_debug(1, "in png_do_read_interlace (pnggccrd.c)\n");
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if (_mmx_supported == 2) {
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
png_warning(png_ptr, "asm_flags may not have been initialized");
|
||||
png_mmx_support();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (row != NULL && row_info != NULL)
|
||||
{
|
||||
@@ -1644,7 +1714,12 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
/* New code by Nirav Chhatrapati - Intel Corporation */
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported )
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE)
|
||||
/* && _mmx_supported */ )
|
||||
#else
|
||||
if (_mmx_supported)
|
||||
#endif
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
if (pixel_bytes == 3)
|
||||
@@ -2416,9 +2491,8 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
{
|
||||
// source is 8-byte RRGGBBAA
|
||||
// dest is 32-byte RRGGBBAA RRGGBBAA RRGGBBAA RRGGBBAA
|
||||
int width_mmx = ((width >> 1) << 1) ;
|
||||
width -= width_mmx;
|
||||
if (width_mmx)
|
||||
// (recall that expansion is _in place_: sptr and dp
|
||||
// both point at locations within same row buffer)
|
||||
{
|
||||
int dummy_value_c; // fix 'forbidden register spilled'
|
||||
int dummy_value_S;
|
||||
@@ -2457,9 +2531,6 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
{
|
||||
// source is 8-byte RRGGBBAA
|
||||
// dest is 16-byte RRGGBBAA RRGGBBAA
|
||||
int width_mmx = ((width >> 1) << 1) ;
|
||||
width -= width_mmx;
|
||||
if (width_mmx)
|
||||
{
|
||||
int dummy_value_c; // fix 'forbidden register spilled'
|
||||
int dummy_value_S;
|
||||
@@ -2589,12 +2660,12 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
for (j = 0; j < png_pass_inc[pass]; j++)
|
||||
{
|
||||
#ifdef PNG_DEBUG
|
||||
if (dp < row || dp+3 > row+png_ptr->row_buf_size)
|
||||
{
|
||||
printf("dp out of bounds: row=%d, dp=%d, rp=%d\n",row, dp,
|
||||
row+png_ptr->row_buf_size);
|
||||
printf("row_buf=%d\n",png_ptr->row_buf_size);
|
||||
}
|
||||
if (dp < row || dp+3 > row+png_ptr->row_buf_size)
|
||||
{
|
||||
printf("dp out of bounds: row=%d, dp=%d, rp=%d\n",
|
||||
row, dp, row+png_ptr->row_buf_size);
|
||||
printf("row_buf=%d\n",png_ptr->row_buf_size);
|
||||
}
|
||||
#endif
|
||||
png_memcpy(dp, v, 4);
|
||||
dp -= 4;
|
||||
@@ -2665,7 +2736,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(PNG_HAVE_ASSEMBLER_READ_FILTER_ROW)
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
|
||||
// These variables are utilized in the functions below. They are declared
|
||||
@@ -2678,8 +2749,7 @@ union uAll {
|
||||
_HBClearMask = {0x7f7f7f7f7f7f7f7fLL},
|
||||
_ActiveMask, _ActiveMask2, _ActiveMaskEnd, _ShiftBpp, _ShiftRem;
|
||||
|
||||
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
//===========================================================================//
|
||||
// //
|
||||
// P N G _ R E A D _ F I L T E R _ R O W _ M M X _ A V G //
|
||||
@@ -2802,53 +2872,76 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"avg_3lp: \n\t"
|
||||
"movq (%%edi,%%ecx,), %%mm0 \n\t" // load mm0 with Avg(x)
|
||||
"movq %%mm5, %%mm3 \n\t"
|
||||
"psrlq _ShiftRem, %%mm2 \n\t" // correct position Raw(x-bpp) data
|
||||
"psrlq _ShiftRem, %%mm2 \n\t" // correct position Raw(x-bpp)
|
||||
// data
|
||||
"movq (%%esi,%%ecx,), %%mm1 \n\t" // load mm1 with Prior(x)
|
||||
"movq %%mm7, %%mm6 \n\t"
|
||||
"pand %%mm1, %%mm3 \n\t" // get lsb for each prev_row byte
|
||||
"psrlq $1, %%mm1 \n\t" // divide prev_row bytes by 2
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for each byte
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for
|
||||
// each byte
|
||||
// add 1st active group (Raw(x-bpp)/2) to average with LBCarry
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 1 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 1
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active
|
||||
// byte
|
||||
// add 2nd active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover bytes 3-5
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover
|
||||
// bytes 3-5
|
||||
"movq %%mm0, %%mm2 \n\t" // mov updated Raws to mm2
|
||||
"psllq _ShiftBpp, %%mm2 \n\t" // shift data to pos. correctly
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active
|
||||
// byte
|
||||
|
||||
// add 3rd active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift mm6 mask to cover last two
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift mm6 mask to cover last
|
||||
// two
|
||||
// bytes
|
||||
"movq %%mm0, %%mm2 \n\t" // mov updated Raws to mm2
|
||||
"psllq _ShiftBpp, %%mm2 \n\t" // shift data to pos. correctly
|
||||
// Data only needs to be shifted once here to
|
||||
// get the correct x-bpp offset.
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2 bytes to add to Avg
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2
|
||||
// bytes to add to Avg
|
||||
"addl $8, %%ecx \n\t"
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active
|
||||
// byte
|
||||
// now ready to write back to memory
|
||||
"movq %%mm0, -8(%%edi,%%ecx,) \n\t"
|
||||
@@ -2886,7 +2979,8 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"movq _HBClearMask, %%mm4 \n\t"
|
||||
|
||||
// re-init address pointers and offset
|
||||
"movl _dif, %%ecx \n\t" // ecx: x = offset to alignment boundary
|
||||
"movl _dif, %%ecx \n\t" // ecx: x = offset to
|
||||
// alignment boundary
|
||||
|
||||
// load _ActiveMask and clear all bytes except for 1st active group
|
||||
"movq _ActiveMask, %%mm7 \n\t"
|
||||
@@ -2895,7 +2989,8 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
// preload "movl prev_row, %%esi \n\t" // esi: Prior(x)
|
||||
"movq %%mm7, %%mm6 \n\t"
|
||||
"movq _LBCarryMask, %%mm5 \n\t"
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // create mask for 2nd active group
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // create mask for 2nd active
|
||||
// group
|
||||
|
||||
// prime the pump: load the first Raw(x-bpp) data set
|
||||
"movq -8(%%edi,%%ecx,), %%mm2 \n\t" // load previous aligned 8 bytes
|
||||
@@ -2908,30 +3003,44 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"movq %%mm5, %%mm3 \n\t"
|
||||
"pand %%mm1, %%mm3 \n\t" // get lsb for each prev_row byte
|
||||
"psrlq $1, %%mm1 \n\t" // divide prev_row bytes by 2
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for each byte
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for
|
||||
// each byte
|
||||
// add 1st active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm7, %%mm2 \n\t" // leave only Active Group 1 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm7, %%mm2 \n\t" // leave only Active Group 1
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg
|
||||
// for each Active
|
||||
// byte
|
||||
// add 2nd active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"movq %%mm0, %%mm2 \n\t" // mov updated Raws to mm2
|
||||
"psllq _ShiftBpp, %%mm2 \n\t" // shift data to pos. correctly
|
||||
"addl $8, %%ecx \n\t"
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active
|
||||
// byte
|
||||
"cmpl _MMXLength, %%ecx \n\t"
|
||||
// now ready to write back to memory
|
||||
@@ -2965,7 +3074,8 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
// load _ActiveMask
|
||||
"movq _ActiveMask, %%mm7 \n\t"
|
||||
// re-init address pointers and offset
|
||||
"movl _dif, %%ecx \n\t" // ecx: x = offset to alignment boundary
|
||||
"movl _dif, %%ecx \n\t" // ecx: x = offset to alignment
|
||||
// boundary
|
||||
"movq _LBCarryMask, %%mm5 \n\t"
|
||||
// preload "movl row, %%edi \n\t" // edi: Avg(x)
|
||||
"movq _HBClearMask, %%mm4 \n\t"
|
||||
@@ -2982,59 +3092,91 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"movq %%mm5, %%mm3 \n\t"
|
||||
"pand %%mm1, %%mm3 \n\t" // get lsb for each prev_row byte
|
||||
"psrlq $1, %%mm1 \n\t" // divide prev_row bytes by 2
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each byte
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"movq %%mm7, %%mm6 \n\t"
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for each byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for
|
||||
// each byte
|
||||
|
||||
// add 1st active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid
|
||||
// for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 1 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active byte
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 1
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg
|
||||
// for each Active byte
|
||||
|
||||
// add 2nd active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover bytes 2 & 3
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover
|
||||
// bytes 2 & 3
|
||||
"movq %%mm0, %%mm2 \n\t" // mov updated Raws to mm2
|
||||
"psllq _ShiftBpp, %%mm2 \n\t" // shift data to pos. correctly
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid
|
||||
// for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active byte
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active byte
|
||||
|
||||
// add 3rd active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover bytes 4 & 5
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover
|
||||
// bytes 4 & 5
|
||||
"movq %%mm0, %%mm2 \n\t" // mov updated Raws to mm2
|
||||
"psllq _ShiftBpp, %%mm2 \n\t" // shift data to pos. correctly
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both lsb's were == 1
|
||||
// (only valid for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active byte
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active byte
|
||||
|
||||
// add 4th active group (Raw(x-bpp)/2) to average with _LBCarry
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover bytes 6 & 7
|
||||
"psllq _ShiftBpp, %%mm6 \n\t" // shift the mm6 mask to cover
|
||||
// bytes 6 & 7
|
||||
"movq %%mm0, %%mm2 \n\t" // mov updated Raws to mm2
|
||||
"psllq _ShiftBpp, %%mm2 \n\t" // shift data to pos. correctly
|
||||
"addl $8, %%ecx \n\t"
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte where both
|
||||
// lsb's were == 1 (only valid for active group)
|
||||
"movq %%mm3, %%mm1 \n\t" // now use mm1 for getting
|
||||
// LBCarrys
|
||||
"pand %%mm2, %%mm1 \n\t" // get LBCarrys for each byte
|
||||
// where both
|
||||
// lsb's were == 1 (only valid
|
||||
// for active group)
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2) for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2 bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to Avg for each Active byte
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm2 \n\t" // add LBCarrys to (Raw(x-bpp)/2)
|
||||
// for each byte
|
||||
"pand %%mm6, %%mm2 \n\t" // leave only Active Group 2
|
||||
// bytes to add to Avg
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) + LBCarrys to
|
||||
// Avg for each Active byte
|
||||
|
||||
"cmpl _MMXLength, %%ecx \n\t"
|
||||
// now ready to write back to memory
|
||||
@@ -3065,7 +3207,8 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
#ifdef __PIC__
|
||||
"pushl %%ebx \n\t" // save Global Offset Table index
|
||||
#endif
|
||||
"movl _dif, %%ebx \n\t" // ebx: x = offset to alignment boundary
|
||||
"movl _dif, %%ebx \n\t" // ebx: x = offset to alignment
|
||||
// boundary
|
||||
// preload "movl row, %%edi \n\t" // edi: Avg(x)
|
||||
"cmpl _FullLength, %%ebx \n\t" // test if offset at end of array
|
||||
"jnb avg_1end \n\t"
|
||||
@@ -3084,7 +3227,8 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"addw %%cx, %%ax \n\t"
|
||||
"incl %%ebx \n\t"
|
||||
"shrw %%ax \n\t" // divide by 2
|
||||
"addb -1(%%edi,%%ebx,), %%al \n\t" // add Avg(x); -1 to offset inc ebx
|
||||
"addb -1(%%edi,%%ebx,), %%al \n\t" // add Avg(x); -1 to offset
|
||||
// inc ebx
|
||||
"cmpl _FullLength, %%ebx \n\t" // check if at end of array
|
||||
"movb %%al, -1(%%edi,%%ebx,) \n\t" // write back Raw(x);
|
||||
// mov does not affect flags; -1 to offset inc ebx
|
||||
@@ -3163,15 +3307,18 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
default: // bpp greater than 8 (!= 1,2,3,4,[5],6,[7],8)
|
||||
{
|
||||
|
||||
#ifdef PNG_DEBUG
|
||||
// GRR: PRINT ERROR HERE: SHOULD NEVER BE REACHED
|
||||
fprintf(stderr,
|
||||
"libpng: internal logic error (png_read_filter_row_mmx_avg())\n");
|
||||
png_debug(1,
|
||||
"Internal logic error in pnggccrd (png_read_filter_row_mmx_avg())\n");
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
__asm__ __volatile__ (
|
||||
"movq _LBCarryMask, %%mm5 \n\t"
|
||||
// re-init address pointers and offset
|
||||
"movl _dif, %%ebx \n\t" // ebx: x = offset to alignment boundary
|
||||
"movl _dif, %%ebx \n\t" // ebx: x = offset to
|
||||
// alignment boundary
|
||||
"movl row, %%edi \n\t" // edi: Avg(x)
|
||||
"movq _HBClearMask, %%mm4 \n\t"
|
||||
"movl %%edi, %%edx \n\t"
|
||||
@@ -3184,15 +3331,20 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
"pand %%mm1, %%mm3 \n\t" // get lsb for each prev_row byte
|
||||
"movq (%%edx,%%ebx,), %%mm2 \n\t"
|
||||
"psrlq $1, %%mm1 \n\t" // divide prev_row bytes by 2
|
||||
"pand %%mm2, %%mm3 \n\t" // get LBCarrys for each byte where both
|
||||
// lsb's were == 1
|
||||
"pand %%mm2, %%mm3 \n\t" // get LBCarrys for each byte
|
||||
// where both lsb's were == 1
|
||||
"psrlq $1, %%mm2 \n\t" // divide raw bytes by 2
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm3, %%mm0 \n\t" // add LBCarrys to Avg for each byte
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for each byte
|
||||
"pand %%mm4, %%mm1 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm3, %%mm0 \n\t" // add LBCarrys to Avg for each
|
||||
// byte
|
||||
"pand %%mm4, %%mm2 \n\t" // clear invalid bit 7 of each
|
||||
// byte
|
||||
"paddb %%mm1, %%mm0 \n\t" // add (Prev_row/2) to Avg for
|
||||
// each byte
|
||||
"addl $8, %%ebx \n\t"
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) to Avg for each byte
|
||||
"paddb %%mm2, %%mm0 \n\t" // add (Raw/2) to Avg for each
|
||||
// byte
|
||||
"cmpl _MMXLength, %%ebx \n\t"
|
||||
"movq %%mm0, -8(%%edi,%%ebx,) \n\t"
|
||||
"jb avg_Alp \n\t"
|
||||
@@ -3261,10 +3413,11 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row,
|
||||
);
|
||||
|
||||
} /* end png_read_filter_row_mmx_avg() */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
//===========================================================================//
|
||||
// //
|
||||
// P N G _ R E A D _ F I L T E R _ R O W _ M M X _ P A E T H //
|
||||
@@ -3310,9 +3463,11 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"movl %%edi, _dif \n\t" // take start of row
|
||||
"addl %%ebx, _dif \n\t" // add bpp
|
||||
"xorl %%ecx, %%ecx \n\t"
|
||||
"addl $0xf, _dif \n\t" // add 7 + 8 to incr past alignment boundary
|
||||
"addl $0xf, _dif \n\t" // add 7 + 8 to incr past alignment
|
||||
// boundary
|
||||
"andl $0xfffffff8, _dif \n\t" // mask to alignment boundary
|
||||
"subl %%edi, _dif \n\t" // subtract from start ==> value ebx at alignment
|
||||
"subl %%edi, _dif \n\t" // subtract from start ==> value ebx
|
||||
// at alignment
|
||||
"jz paeth_go \n\t"
|
||||
// fix alignment
|
||||
|
||||
@@ -3430,12 +3585,14 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
// prime the pump: load the first Raw(x-bpp) data set
|
||||
"movq -8(%%edi,%%ecx,), %%mm1 \n\t"
|
||||
"paeth_3lp: \n\t"
|
||||
"psrlq _ShiftRem, %%mm1 \n\t" // shift last 3 bytes to 1st 3 bytes
|
||||
"psrlq _ShiftRem, %%mm1 \n\t" // shift last 3 bytes to 1st
|
||||
// 3 bytes
|
||||
"movq (%%esi,%%ecx,), %%mm2 \n\t" // load b=Prior(x)
|
||||
"punpcklbw %%mm0, %%mm1 \n\t" // unpack High bytes of a
|
||||
"movq -8(%%esi,%%ecx,), %%mm3 \n\t" // prep c=Prior(x-bpp) bytes
|
||||
"punpcklbw %%mm0, %%mm2 \n\t" // unpack High bytes of b
|
||||
"psrlq _ShiftRem, %%mm3 \n\t" // shift last 3 bytes to 1st 3 bytes
|
||||
"psrlq _ShiftRem, %%mm3 \n\t" // shift last 3 bytes to 1st
|
||||
// 3 bytes
|
||||
// pav = p - a = (a + b - c) - a = b - c
|
||||
"movq %%mm2, %%mm4 \n\t"
|
||||
"punpcklbw %%mm0, %%mm3 \n\t" // unpack High bytes of c
|
||||
@@ -3490,7 +3647,8 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"paddb (%%edi,%%ecx,), %%mm7 \n\t" // add Paeth predictor with Raw(x)
|
||||
"punpcklbw %%mm0, %%mm3 \n\t" // unpack High bytes of c
|
||||
"movq %%mm7, (%%edi,%%ecx,) \n\t" // write back updated value
|
||||
"movq %%mm7, %%mm1 \n\t" // now mm1 will be used as Raw(x-bpp)
|
||||
"movq %%mm7, %%mm1 \n\t" // now mm1 will be used as
|
||||
// Raw(x-bpp)
|
||||
// now do Paeth for 2nd set of bytes (3-5)
|
||||
"psrlq _ShiftBpp, %%mm2 \n\t" // load b=Prior(x) step 2
|
||||
"punpcklbw %%mm0, %%mm1 \n\t" // unpack High bytes of a
|
||||
@@ -3547,7 +3705,8 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
"movq %%mm2, %%mm3 \n\t" // load c=Prior(x-bpp) step 1
|
||||
"pand _ActiveMask, %%mm7 \n\t"
|
||||
"punpckhbw %%mm0, %%mm2 \n\t" // unpack High bytes of b
|
||||
"psllq _ShiftBpp, %%mm7 \n\t" // shift bytes to 2nd group of 3 bytes
|
||||
"psllq _ShiftBpp, %%mm7 \n\t" // shift bytes to 2nd group of
|
||||
// 3 bytes
|
||||
// pav = p - a = (a + b - c) - a = b - c
|
||||
"movq %%mm2, %%mm4 \n\t"
|
||||
"paddb (%%edi,%%ecx,), %%mm7 \n\t" // add Paeth predictor with Raw(x)
|
||||
@@ -3607,7 +3766,8 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
// step ecx to next set of 8 bytes and repeat loop til done
|
||||
"addl $8, %%ecx \n\t"
|
||||
"pand _ActiveMaskEnd, %%mm1 \n\t"
|
||||
"paddb -8(%%edi,%%ecx,), %%mm1 \n\t" // add Paeth predictor with Raw(x)
|
||||
"paddb -8(%%edi,%%ecx,), %%mm1 \n\t" // add Paeth predictor with
|
||||
// Raw(x)
|
||||
|
||||
"cmpl _MMXLength, %%ecx \n\t"
|
||||
"pxor %%mm0, %%mm0 \n\t" // pxor does not affect flags
|
||||
@@ -4307,10 +4467,12 @@ png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row,
|
||||
);
|
||||
|
||||
} /* end png_read_filter_row_mmx_paeth() */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PNG_THREAD_UNSAFE_OK
|
||||
//===========================================================================//
|
||||
// //
|
||||
// P N G _ R E A D _ F I L T E R _ R O W _ M M X _ S U B //
|
||||
@@ -4729,6 +4891,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
||||
);
|
||||
|
||||
} // end of png_read_filter_row_mmx_sub()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -4755,6 +4918,9 @@ png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row,
|
||||
__asm__ __volatile__ (
|
||||
//pre "movl row, %%edi \n\t"
|
||||
// get # of bytes to alignment
|
||||
#ifdef __PIC__
|
||||
"pushl %%ebx \n\t"
|
||||
#endif
|
||||
"movl %%edi, %%ecx \n\t"
|
||||
"xorl %%ebx, %%ebx \n\t"
|
||||
"addl $0x7, %%ecx \n\t"
|
||||
@@ -4854,6 +5020,9 @@ png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row,
|
||||
|
||||
"up_end: \n\t"
|
||||
"EMMS \n\t" // conversion of filtered row complete
|
||||
#ifdef __PIC__
|
||||
"popl %%ebx \n\t"
|
||||
#endif
|
||||
|
||||
: "=d" (dummy_value_d), // 0 // output regs (dummy)
|
||||
"=S" (dummy_value_S), // 1
|
||||
@@ -4884,7 +5053,6 @@ png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row,
|
||||
/* */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if defined(PNG_HAVE_ASSEMBLER_READ_FILTER_ROW)
|
||||
|
||||
/* Optimized png_read_filter_row routines */
|
||||
|
||||
@@ -4904,6 +5072,8 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
#define UseMMX_paeth 1 // GRR: converted 20000828
|
||||
|
||||
if (_mmx_supported == 2) {
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
png_warning(png_ptr, "asm_flags may not have been initialized");
|
||||
png_mmx_support();
|
||||
}
|
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
@@ -4914,13 +5084,37 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
{
|
||||
case 0: sprintf(filnm, "none");
|
||||
break;
|
||||
case 1: sprintf(filnm, "sub-%s", "MMX");
|
||||
case 1: sprintf(filnm, "sub-%s",
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" :
|
||||
#endif
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
case 2: sprintf(filnm, "up-%s", "MMX");
|
||||
case 2: sprintf(filnm, "up-%s",
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" :
|
||||
#endif
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
case 3: sprintf(filnm, "avg-%s", "MMX");
|
||||
case 3: sprintf(filnm, "avg-%s",
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" :
|
||||
#endif
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
case 4: sprintf(filnm, "Paeth-%s", "MMX");
|
||||
case 4: sprintf(filnm, "Paeth-%s",
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":
|
||||
#endif
|
||||
#endif
|
||||
"x86");
|
||||
break;
|
||||
default: sprintf(filnm, "unknw");
|
||||
break;
|
||||
@@ -4938,10 +5132,14 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
break;
|
||||
|
||||
case PNG_FILTER_VALUE_SUB:
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported &&
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) &&
|
||||
#else
|
||||
if (
|
||||
#endif
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_sub(row_info, row);
|
||||
}
|
||||
@@ -4964,9 +5162,13 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
|
||||
case PNG_FILTER_VALUE_UP:
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported &&
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) &&
|
||||
#else
|
||||
if (
|
||||
#endif
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_up(row_info, row, prev_row);
|
||||
}
|
||||
@@ -4987,10 +5189,14 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
break;
|
||||
|
||||
case PNG_FILTER_VALUE_AVG:
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported &&
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) &&
|
||||
#else
|
||||
if (
|
||||
#endif
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_avg(row_info, row, prev_row);
|
||||
}
|
||||
@@ -5021,10 +5227,14 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
break;
|
||||
|
||||
case PNG_FILTER_VALUE_PAETH:
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
if ( _mmx_supported &&
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK)
|
||||
#if !defined(PNG_1_0_X)
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) &&
|
||||
#else
|
||||
if (
|
||||
#endif
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
||||
}
|
||||
@@ -5130,6 +5340,8 @@ png_mmx_support(void)
|
||||
"popfl \n\t" // restore modified value to Eflag reg
|
||||
"pushfl \n\t" // save Eflag to stack
|
||||
"popl %%eax \n\t" // get Eflag from stack
|
||||
"pushl %%ecx \n\t" // save original Eflag to stack
|
||||
"popfl \n\t" // restore original Eflag
|
||||
"xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag
|
||||
"jz .NOT_SUPPORTED \n\t" // if same, CPUID instr. is not supported
|
||||
|
||||
@@ -5177,4 +5389,5 @@ png_mmx_support(void)
|
||||
return _mmx_supported;
|
||||
}
|
||||
|
||||
|
||||
#endif /* PNG_USE_PNGGCCRD */
|
||||
|
||||
18
pngget.c
18
pngget.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -547,7 +547,11 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
*width = info_ptr->width;
|
||||
*height = info_ptr->height;
|
||||
*bit_depth = info_ptr->bit_depth;
|
||||
if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16)
|
||||
png_error(png_ptr, "Invalid bit depth");
|
||||
*color_type = info_ptr->color_type;
|
||||
if (info_ptr->color_type > 6)
|
||||
png_error(png_ptr, "Invalid color type");
|
||||
if (compression_type != NULL)
|
||||
*compression_type = info_ptr->compression_type;
|
||||
if (filter_type != NULL)
|
||||
@@ -556,9 +560,7 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
*interlace_type = info_ptr->interlace_type;
|
||||
|
||||
/* check for potential overflow of rowbytes */
|
||||
if (*color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
channels = 1;
|
||||
else if (*color_type & PNG_COLOR_MASK_COLOR)
|
||||
if (*color_type & PNG_COLOR_MASK_COLOR)
|
||||
channels = 3;
|
||||
else
|
||||
channels = 1;
|
||||
@@ -566,6 +568,10 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
channels++;
|
||||
pixel_depth = *bit_depth * channels;
|
||||
rowbytes_per_pixel = (pixel_depth + 7) >> 3;
|
||||
if (width == 0 || *width > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid image width");
|
||||
if (height == 0 || *height > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid image height");
|
||||
if ((*width > PNG_MAX_UINT/rowbytes_per_pixel))
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
@@ -827,6 +833,7 @@ png_get_compression_buffer_size(png_structp png_ptr)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PNG_1_0_X
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
/* this function was added to libpng 1.2.0 and should exist by default*/
|
||||
png_uint_32 PNGAPI
|
||||
@@ -915,3 +922,4 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr)
|
||||
return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L);
|
||||
}
|
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
112
pngmem.c
112
pngmem.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -27,7 +27,7 @@ png_voidp /* PRIVATE */
|
||||
png_create_struct(int type)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_struct_2(type, NULL, NULL));
|
||||
return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));
|
||||
}
|
||||
|
||||
/* Alternate version of png_create_struct, for use with user-defined malloc. */
|
||||
@@ -43,39 +43,30 @@ png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
|
||||
else if (type == PNG_STRUCT_PNG)
|
||||
size = sizeof(png_struct);
|
||||
else
|
||||
return ((png_voidp)NULL);
|
||||
return (png_get_copyright());
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if(malloc_fn != NULL)
|
||||
{
|
||||
if (mem_ptr != NULL)
|
||||
{
|
||||
png_struct dummy_struct;
|
||||
png_structp png_ptr = &dummy_struct;
|
||||
png_ptr->mem_ptr=mem_ptr;
|
||||
struct_ptr = (*(malloc_fn))(png_ptr, size);
|
||||
}
|
||||
else
|
||||
struct_ptr = (*(malloc_fn))(NULL, size);
|
||||
if (struct_ptr != NULL)
|
||||
png_memset(struct_ptr, 0, size);
|
||||
return (struct_ptr);
|
||||
png_struct dummy_struct;
|
||||
png_structp png_ptr = &dummy_struct;
|
||||
png_ptr->mem_ptr=mem_ptr;
|
||||
struct_ptr = (*(malloc_fn))(png_ptr, (png_uint_32)size);
|
||||
}
|
||||
else
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL)
|
||||
{
|
||||
struct_ptr = (png_voidp)farmalloc(size));
|
||||
if (struct_ptr != NULL)
|
||||
png_memset(struct_ptr, 0, size);
|
||||
}
|
||||
return (struct_ptr);
|
||||
}
|
||||
|
||||
|
||||
/* Free memory allocated by a png_create_struct() call */
|
||||
void /* PRIVATE */
|
||||
png_destroy_struct(png_voidp struct_ptr)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2(struct_ptr, (png_free_ptr)NULL, (png_voidp)NULL);
|
||||
png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL);
|
||||
}
|
||||
|
||||
/* Free memory allocated by a png_create_struct() call */
|
||||
@@ -126,13 +117,13 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_voidp ret;
|
||||
#endif
|
||||
if (png_ptr == NULL || size == 0)
|
||||
return ((png_voidp)NULL);
|
||||
return (NULL);
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if(png_ptr->malloc_fn != NULL)
|
||||
{
|
||||
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, size));
|
||||
if (ret == NULL)
|
||||
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
|
||||
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of memory!");
|
||||
return (ret);
|
||||
}
|
||||
@@ -186,12 +177,22 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
|
||||
if (table == NULL)
|
||||
{
|
||||
png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */
|
||||
if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */
|
||||
else
|
||||
png_warning(png_ptr, "Out Of Memory.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((png_size_t)table & 0xfff0)
|
||||
{
|
||||
png_error(png_ptr, "Farmalloc didn't return normalized pointer");
|
||||
if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr,
|
||||
"Farmalloc didn't return normalized pointer");
|
||||
else
|
||||
png_warning(png_ptr,
|
||||
"Farmalloc didn't return normalized pointer");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
png_ptr->offset_table = table;
|
||||
@@ -200,7 +201,11 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
|
||||
if (png_ptr->offset_table_ptr == NULL)
|
||||
{
|
||||
png_error(png_ptr, "Out Of memory.");
|
||||
if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */
|
||||
else
|
||||
png_warning(png_ptr, "Out Of memory.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
hptr = (png_byte huge *)table;
|
||||
@@ -222,7 +227,13 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
}
|
||||
|
||||
if (png_ptr->offset_table_count >= png_ptr->offset_table_number)
|
||||
png_error(png_ptr, "Out of Memory.");
|
||||
{
|
||||
if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of Memory."); /* Note "o" and "M" */
|
||||
else
|
||||
png_warning(png_ptr, "Out of Memory.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++];
|
||||
}
|
||||
@@ -231,7 +242,10 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
|
||||
if (ret == NULL)
|
||||
{
|
||||
png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */
|
||||
if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */
|
||||
else
|
||||
png_warning(png_ptr, "Out of memory."); /* Note "o" and "m" */
|
||||
}
|
||||
|
||||
return (ret);
|
||||
@@ -297,7 +311,7 @@ png_voidp /* PRIVATE */
|
||||
png_create_struct(int type)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_struct_2(type, NULL, NULL));
|
||||
return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));
|
||||
}
|
||||
|
||||
/* Allocate memory for a png_struct or a png_info. The malloc and
|
||||
@@ -315,20 +329,15 @@ png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
|
||||
else if (type == PNG_STRUCT_PNG)
|
||||
size = sizeof(png_struct);
|
||||
else
|
||||
return ((png_voidp)NULL);
|
||||
return (NULL);
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if(malloc_fn != NULL)
|
||||
{
|
||||
if (mem_ptr != NULL)
|
||||
{
|
||||
png_struct dummy_struct;
|
||||
png_structp png_ptr = &dummy_struct;
|
||||
png_ptr->mem_ptr=mem_ptr;
|
||||
struct_ptr = (*(malloc_fn))(png_ptr, size);
|
||||
}
|
||||
else
|
||||
struct_ptr = (*(malloc_fn))(NULL, size);
|
||||
png_struct dummy_struct;
|
||||
png_structp png_ptr = &dummy_struct;
|
||||
png_ptr->mem_ptr=mem_ptr;
|
||||
struct_ptr = (*(malloc_fn))(png_ptr, size);
|
||||
if (struct_ptr != NULL)
|
||||
png_memset(struct_ptr, 0, size);
|
||||
return (struct_ptr);
|
||||
@@ -357,7 +366,7 @@ void /* PRIVATE */
|
||||
png_destroy_struct(png_voidp struct_ptr)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2(struct_ptr, (png_free_ptr)NULL, (png_voidp)NULL);
|
||||
png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL);
|
||||
}
|
||||
|
||||
/* Free memory allocated by a png_create_struct() call */
|
||||
@@ -402,20 +411,20 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
{
|
||||
png_voidp ret;
|
||||
if (png_ptr == NULL || size == 0)
|
||||
return ((png_voidp)NULL);
|
||||
return (NULL);
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if(png_ptr->malloc_fn != NULL)
|
||||
{
|
||||
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, size));
|
||||
if (ret == NULL)
|
||||
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of Memory!");
|
||||
return (ret);
|
||||
}
|
||||
else
|
||||
return (png_malloc_default(png_ptr, size));
|
||||
}
|
||||
png_voidp /* PRIVATE */
|
||||
png_voidp PNGAPI
|
||||
png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
{
|
||||
png_voidp ret;
|
||||
@@ -423,7 +432,12 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K
|
||||
if (size > (png_uint_32)65536L)
|
||||
png_error(png_ptr, "Cannot Allocate > 64K");
|
||||
{
|
||||
if(png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Cannot Allocate > 64K");
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__TURBOC__) && !defined(__FLAT__)
|
||||
@@ -436,7 +450,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (ret == NULL)
|
||||
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of Memory");
|
||||
|
||||
return (ret);
|
||||
@@ -458,7 +472,7 @@ png_free(png_structp png_ptr, png_voidp ptr)
|
||||
}
|
||||
else png_free_default(png_ptr, ptr);
|
||||
}
|
||||
void /* PRIVATE */
|
||||
void PNGAPI
|
||||
png_free_default(png_structp png_ptr, png_voidp ptr)
|
||||
{
|
||||
if (png_ptr == NULL || ptr == NULL)
|
||||
@@ -479,7 +493,7 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
|
||||
|
||||
#endif /* Not Borland DOS special memory handler */
|
||||
|
||||
png_voidp /* PRIVATE */
|
||||
png_voidp PNGAPI
|
||||
png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
|
||||
png_uint_32 length)
|
||||
{
|
||||
@@ -492,7 +506,7 @@ png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
|
||||
return(png_memcpy (s1, s2, size));
|
||||
}
|
||||
|
||||
png_voidp /* PRIVATE */
|
||||
png_voidp PNGAPI
|
||||
png_memset_check (png_structp png_ptr, png_voidp s1, int value,
|
||||
png_uint_32 length)
|
||||
{
|
||||
|
||||
44
pngpread.c
44
pngpread.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -240,6 +240,12 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
* header chunks, and we can start reading the image (or if this
|
||||
* is called after the image has been read - we have an error).
|
||||
*/
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before IDAT");
|
||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
|
||||
!(png_ptr->mode & PNG_HAVE_PLTE))
|
||||
png_error(png_ptr, "Missing PLTE before IDAT");
|
||||
|
||||
if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||
{
|
||||
if (png_ptr->push_length == 0)
|
||||
@@ -792,7 +798,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -800,13 +806,13 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
if (png_ptr->pass == 6 && png_ptr->height <= 4)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
break;
|
||||
@@ -823,7 +829,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -839,14 +845,14 @@ png_push_process_row(png_structp png_ptr)
|
||||
}
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
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_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -864,7 +870,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -880,12 +886,12 @@ png_push_process_row(png_structp png_ptr)
|
||||
}
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
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_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
break;
|
||||
@@ -900,7 +906,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
}
|
||||
if (png_ptr->pass == 6) /* skip top generated row */
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
break;
|
||||
@@ -911,7 +917,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
png_read_push_finish_row(png_ptr);
|
||||
if (png_ptr->pass != 6)
|
||||
break;
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -1072,8 +1078,8 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
||||
text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
|
||||
text_ptr->key = key;
|
||||
#ifdef PNG_iTXt_SUPPORTED
|
||||
text_ptr->lang = (char *)NULL;
|
||||
text_ptr->lang_key = (char *)NULL;
|
||||
text_ptr->lang = NULL;
|
||||
text_ptr->lang_key = NULL;
|
||||
#endif
|
||||
text_ptr->text = text;
|
||||
|
||||
@@ -1257,8 +1263,8 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt;
|
||||
text_ptr->key = key;
|
||||
#ifdef PNG_iTXt_SUPPORTED
|
||||
text_ptr->lang = (char *)NULL;
|
||||
text_ptr->lang_key = (char *)NULL;
|
||||
text_ptr->lang = NULL;
|
||||
text_ptr->lang_key = NULL;
|
||||
#endif
|
||||
text_ptr->text = text;
|
||||
|
||||
@@ -1491,7 +1497,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr,
|
||||
png_ptr->row_fn = row_fn;
|
||||
png_ptr->end_fn = end_fn;
|
||||
|
||||
png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer);
|
||||
png_set_read_fn(png_ptr, progressive_ptr, (png_rw_ptr)png_push_fill_buffer);
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
@@ -1499,6 +1505,4 @@ png_get_progressive_ptr(png_structp png_ptr)
|
||||
{
|
||||
return png_ptr->io_ptr;
|
||||
}
|
||||
|
||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||
|
||||
|
||||
123
pngread.c
123
pngread.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -22,7 +22,7 @@ png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn,
|
||||
warn_fn, NULL, NULL, NULL));
|
||||
warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
|
||||
}
|
||||
|
||||
/* Alternate create PNG structure for reading, and allocate any memory needed. */
|
||||
@@ -45,14 +45,19 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
|
||||
png_debug(1, "in png_create_read_struct\n");
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if ((png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
|
||||
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr)) == NULL)
|
||||
png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
|
||||
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
|
||||
#else
|
||||
if ((png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG)) == NULL)
|
||||
png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
|
||||
#endif
|
||||
{
|
||||
return (png_structp)NULL;
|
||||
}
|
||||
if (png_ptr == NULL)
|
||||
return (NULL);
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
|
||||
#endif
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
@@ -63,8 +68,14 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
{
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf=NULL;
|
||||
png_destroy_struct(png_ptr);
|
||||
return (png_structp)NULL;
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2((png_voidp)png_ptr,
|
||||
(png_free_ptr)free_fn,
|
||||
(png_voidp)mem_ptr);
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf));
|
||||
@@ -95,23 +106,24 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
|
||||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
|
||||
{
|
||||
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
||||
char msg[80];
|
||||
if (user_png_ver)
|
||||
{
|
||||
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
|
||||
user_png_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
sprintf(msg, "Application is running with png.c from libpng-%.20s",
|
||||
png_libpng_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
#endif
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags=0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"Incompatible libpng version in application and library");
|
||||
}
|
||||
|
||||
/* Libpng 1.0.6 was not binary compatible, due to insertion of the
|
||||
info_ptr->free_me member. Libpng-1.0.1 and earlier were not
|
||||
compatible due to insertion of the user transform function. Note
|
||||
to maintainer: this test can be removed from version 1.2.0 and
|
||||
beyond because the previous test would have already rejected it. */
|
||||
|
||||
if (user_png_ver[0] == '1' && user_png_ver[2] == '0' &&
|
||||
(user_png_ver[4] < '2' || user_png_ver[4] == '6') &&
|
||||
user_png_ver[5] == '\0')
|
||||
{
|
||||
png_error(png_ptr,
|
||||
"Application must be recompiled; versions <= 1.0.6 were incompatible");
|
||||
}
|
||||
}
|
||||
|
||||
/* initialize zbuf - compression buffer */
|
||||
@@ -134,7 +146,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
|
||||
png_set_read_fn(png_ptr, NULL, NULL);
|
||||
png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
|
||||
|
||||
return (png_ptr);
|
||||
}
|
||||
@@ -147,7 +159,7 @@ void PNGAPI
|
||||
png_read_init(png_structp png_ptr)
|
||||
{
|
||||
/* We only come here via pre-1.0.7-compiled applications */
|
||||
png_read_init_2(png_ptr, "1.0.0", 0, 0);
|
||||
png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
||||
}
|
||||
|
||||
#undef png_read_init_2
|
||||
@@ -156,15 +168,37 @@ png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
||||
png_size_t png_struct_size, png_size_t png_info_size)
|
||||
{
|
||||
/* We only come here via pre-1.0.12-compiled applications */
|
||||
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
||||
if(sizeof(png_struct) > png_struct_size || sizeof(png_info) > png_info_size)
|
||||
{
|
||||
char msg[80];
|
||||
png_ptr->warning_fn=NULL;
|
||||
if (user_png_ver)
|
||||
{
|
||||
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
|
||||
user_png_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
sprintf(msg, "Application is running with png.c from libpng-%.20s",
|
||||
png_libpng_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
#endif
|
||||
if(sizeof(png_struct) > png_struct_size)
|
||||
{
|
||||
png_ptr->error_fn=(png_error_ptr)NULL;
|
||||
png_ptr->error_fn=NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags=0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The png struct allocated by the application for reading is too small.");
|
||||
}
|
||||
if(sizeof(png_info) > png_info_size)
|
||||
{
|
||||
png_ptr->error_fn=(png_error_ptr)NULL;
|
||||
png_ptr->error_fn=NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags=0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The info struct allocated by application for reading is too small.");
|
||||
}
|
||||
@@ -190,7 +224,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||
#else
|
||||
png_ptr->warning_fn=(png_error_ptr)NULL;
|
||||
png_ptr->warning_fn=NULL;
|
||||
png_warning(png_ptr,
|
||||
"Application uses deprecated png_read_init() and should be recompiled.");
|
||||
break;
|
||||
@@ -240,7 +274,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
|
||||
png_set_read_fn(png_ptr, NULL, NULL);
|
||||
png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
|
||||
}
|
||||
|
||||
/* Read the information before the actual image data. This has been
|
||||
@@ -348,6 +382,9 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
png_debug2(0, "Reading %s chunk, length=%lu.\n", png_ptr->chunk_name,
|
||||
length);
|
||||
|
||||
if (length > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid chunk length.");
|
||||
|
||||
/* This should be a binary subdivision search or a hash for
|
||||
* matching the chunk name rather than a linear search.
|
||||
*/
|
||||
@@ -631,6 +668,9 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
png_read_data(png_ptr, chunk_length, 4);
|
||||
png_ptr->idat_size = png_get_uint_32(chunk_length);
|
||||
|
||||
if (png_ptr->idat_size > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid chunk length.");
|
||||
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
|
||||
if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
@@ -742,7 +782,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
|
||||
* be ignored, so pass NULL to it.
|
||||
*
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.12beta1
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.13
|
||||
*/
|
||||
|
||||
void PNGAPI
|
||||
@@ -769,14 +809,14 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
||||
for (i = 0; i < num_rows; i++)
|
||||
{
|
||||
png_bytep rptr = *rp;
|
||||
png_read_row(png_ptr, rptr, NULL);
|
||||
png_read_row(png_ptr, rptr, png_bytep_NULL);
|
||||
rp++;
|
||||
}
|
||||
else if(dp != NULL)
|
||||
for (i = 0; i < num_rows; i++)
|
||||
{
|
||||
png_bytep dptr = *dp;
|
||||
png_read_row(png_ptr, NULL, dptr);
|
||||
png_read_row(png_ptr, png_bytep_NULL, dptr);
|
||||
dp++;
|
||||
}
|
||||
}
|
||||
@@ -791,7 +831,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
||||
* only call this function once. If you desire to have an image for
|
||||
* each pass of a interlaced image, use png_read_rows() instead.
|
||||
*
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.12beta1
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.13
|
||||
*/
|
||||
void PNGAPI
|
||||
png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
@@ -821,7 +861,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
rp = image;
|
||||
for (i = 0; i < image_height; i++)
|
||||
{
|
||||
png_read_row(png_ptr, *rp, NULL);
|
||||
png_read_row(png_ptr, *rp, png_bytep_NULL);
|
||||
rp++;
|
||||
}
|
||||
}
|
||||
@@ -909,6 +949,9 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
png_debug1(0, "Reading %s chunk.\n", png_ptr->chunk_name);
|
||||
|
||||
if (length > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid chunk length.");
|
||||
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
|
||||
png_handle_IHDR(png_ptr, info_ptr, length);
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
|
||||
@@ -1054,7 +1097,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
#else
|
||||
png_destroy_struct((png_voidp)info_ptr);
|
||||
#endif
|
||||
*info_ptr_ptr = (png_infop)NULL;
|
||||
*info_ptr_ptr = NULL;
|
||||
}
|
||||
|
||||
if (end_info_ptr != NULL)
|
||||
@@ -1068,7 +1111,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
#else
|
||||
png_destroy_struct((png_voidp)end_info_ptr);
|
||||
#endif
|
||||
*end_info_ptr_ptr = (png_infop)NULL;
|
||||
*end_info_ptr_ptr = NULL;
|
||||
}
|
||||
|
||||
if (png_ptr != NULL)
|
||||
@@ -1079,7 +1122,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
*png_ptr_ptr = (png_structp)NULL;
|
||||
*png_ptr_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1106,7 +1149,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
||||
png_info_destroy(png_ptr, end_info_ptr);
|
||||
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_free(png_ptr, png_ptr->row_buf);
|
||||
png_free(png_ptr, png_ptr->big_row_buf);
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
#if defined(PNG_READ_DITHER_SUPPORTED)
|
||||
png_free(png_ptr, png_ptr->palette_lookup);
|
||||
|
||||
7
pngrio.c
7
pngrio.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -140,7 +140,7 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
|
||||
if (read_data_fn != NULL)
|
||||
png_ptr->read_data_fn = read_data_fn;
|
||||
else
|
||||
png_ptr->read_data_fn = png_default_read_data;
|
||||
png_ptr->read_data_fn = (png_rw_ptr)png_default_read_data;
|
||||
#else
|
||||
png_ptr->read_data_fn = read_data_fn;
|
||||
#endif
|
||||
@@ -159,4 +159,3 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
|
||||
png_ptr->output_flush_fn = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
121
pngrtran.c
121
pngrtran.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -510,13 +510,19 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
||||
* only do transformations on images where the file_gamma and screen_gamma
|
||||
* are not close reciprocals, otherwise it slows things down slightly, and
|
||||
* also needlessly introduces small errors.
|
||||
*
|
||||
* We will turn off gamma transformation later if no semitransparent entries
|
||||
* are present in the tRNS array for palette images. We can't do it here
|
||||
* because we don't necessarily have the tRNS chunk yet.
|
||||
*/
|
||||
void PNGAPI
|
||||
png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
|
||||
{
|
||||
png_debug(1, "in png_set_gamma\n");
|
||||
if (fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD)
|
||||
png_ptr->transformations |= PNG_GAMMA;
|
||||
if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) ||
|
||||
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) ||
|
||||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
|
||||
png_ptr->transformations |= PNG_GAMMA;
|
||||
png_ptr->gamma = (float)file_gamma;
|
||||
png_ptr->screen_gamma = (float)scrn_gamma;
|
||||
}
|
||||
@@ -692,23 +698,23 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
{
|
||||
case 1:
|
||||
png_ptr->background.gray *= (png_uint_16)0xff;
|
||||
png_ptr->background.red = png_ptr->background.green =
|
||||
png_ptr->background.blue = png_ptr->background.gray;
|
||||
png_ptr->background.red = png_ptr->background.green
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
break;
|
||||
case 2:
|
||||
png_ptr->background.gray *= (png_uint_16)0x55;
|
||||
png_ptr->background.red = png_ptr->background.green =
|
||||
png_ptr->background.blue = png_ptr->background.gray;
|
||||
png_ptr->background.red = png_ptr->background.green
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
break;
|
||||
case 4:
|
||||
png_ptr->background.gray *= (png_uint_16)0x11;
|
||||
png_ptr->background.red = png_ptr->background.green =
|
||||
png_ptr->background.blue = png_ptr->background.gray;
|
||||
png_ptr->background.red = png_ptr->background.green
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
break;
|
||||
case 8:
|
||||
case 16:
|
||||
png_ptr->background.red = png_ptr->background.green =
|
||||
png_ptr->background.blue = png_ptr->background.gray;
|
||||
png_ptr->background.red = png_ptr->background.green
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -742,10 +748,26 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
png_ptr->background_1 = png_ptr->background;
|
||||
#endif
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
|
||||
if ((color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_trans != 0)
|
||||
&& (fabs(png_ptr->screen_gamma * png_ptr->gamma - 1.0)
|
||||
< PNG_GAMMA_THRESHOLD))
|
||||
{
|
||||
int i,k;
|
||||
k=0;
|
||||
for (i=0; i<png_ptr->num_trans; i++)
|
||||
{
|
||||
if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff)
|
||||
k=1; /* partial transparency is present */
|
||||
}
|
||||
if (k == 0)
|
||||
png_ptr->transformations &= (~PNG_GAMMA);
|
||||
}
|
||||
|
||||
if (png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY))
|
||||
{
|
||||
png_build_gamma_table(png_ptr);
|
||||
@@ -754,6 +776,8 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
{
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
/* could skip if no transparency and
|
||||
*/
|
||||
png_color back, back_1;
|
||||
png_colorp palette = png_ptr->palette;
|
||||
int num_palette = png_ptr->num_palette;
|
||||
@@ -873,9 +897,16 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
break;
|
||||
}
|
||||
|
||||
if (color_type & PNG_COLOR_MASK_COLOR)
|
||||
png_ptr->background_1.gray = (png_uint_16)(pow(
|
||||
(double)png_ptr->background.gray / m, g) * m + .5);
|
||||
png_ptr->background.gray = (png_uint_16)(pow(
|
||||
(double)png_ptr->background.gray / m, gs) * m + .5);
|
||||
|
||||
if ((png_ptr->background.red != png_ptr->background.green) ||
|
||||
(png_ptr->background.red != png_ptr->background.blue) ||
|
||||
(png_ptr->background.red != png_ptr->background.gray))
|
||||
{
|
||||
/* RGB or RGBA */
|
||||
/* RGB or RGBA with color background */
|
||||
png_ptr->background_1.red = (png_uint_16)(pow(
|
||||
(double)png_ptr->background.red / m, g) * m + .5);
|
||||
png_ptr->background_1.green = (png_uint_16)(pow(
|
||||
@@ -891,17 +922,17 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* GRAY or GRAY ALPHA */
|
||||
png_ptr->background_1.gray = (png_uint_16)(pow(
|
||||
(double)png_ptr->background.gray / m, g) * m + .5);
|
||||
png_ptr->background.gray = (png_uint_16)(pow(
|
||||
(double)png_ptr->background.gray / m, gs) * m + .5);
|
||||
/* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */
|
||||
png_ptr->background_1.red = png_ptr->background_1.green
|
||||
= png_ptr->background_1.blue = png_ptr->background_1.gray;
|
||||
png_ptr->background.red = png_ptr->background.green
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
/* transformation does not include PNG_BACKGROUND */
|
||||
#endif
|
||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_colorp palette = png_ptr->palette;
|
||||
@@ -919,7 +950,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
#endif /* PNG_READ_GAMMA_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
/* No GAMMA transformation */
|
||||
if ((png_ptr->transformations & PNG_BACKGROUND) &&
|
||||
@@ -952,7 +983,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_SHIFT_SUPPORTED)
|
||||
if ((png_ptr->transformations & PNG_SHIFT) &&
|
||||
@@ -977,7 +1008,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
png_ptr->palette[i].blue >>= sb;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_READ_SHIFT_SUPPORTED */
|
||||
}
|
||||
#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \
|
||||
&& !defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
@@ -1227,12 +1258,15 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
||||
((png_ptr->num_trans != 0 ) ||
|
||||
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA)))
|
||||
png_do_background(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||
&(png_ptr->trans_values), &(png_ptr->background),
|
||||
&(png_ptr->background_1),
|
||||
&(png_ptr->trans_values), &(png_ptr->background)
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
, &(png_ptr->background_1),
|
||||
png_ptr->gamma_table, png_ptr->gamma_from_1,
|
||||
png_ptr->gamma_to_1, png_ptr->gamma_16_table,
|
||||
png_ptr->gamma_16_from_1, png_ptr->gamma_16_to_1,
|
||||
png_ptr->gamma_shift);
|
||||
png_ptr->gamma_shift
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
@@ -2312,7 +2346,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
* paletted. Most useful for gamma correction and simplification
|
||||
* of code.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
void PNGAPI
|
||||
png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
||||
{
|
||||
int num_palette;
|
||||
@@ -2545,11 +2579,14 @@ png_correct_palette(png_structp png_ptr, png_colorp palette,
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_color_16p trans_values, png_color_16p background,
|
||||
png_color_16p background_1,
|
||||
png_color_16p trans_values, png_color_16p background
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
, png_color_16p background_1,
|
||||
png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
|
||||
png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
|
||||
png_uint_16pp gamma_16_to_1, int gamma_shift)
|
||||
png_uint_16pp gamma_16_to_1, int gamma_shift
|
||||
#endif
|
||||
)
|
||||
{
|
||||
png_bytep sp, dp;
|
||||
png_uint_32 i;
|
||||
@@ -2932,6 +2969,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
{
|
||||
*dp = *sp;
|
||||
}
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
else if (a == 0)
|
||||
{
|
||||
*dp = (png_byte)background->gray;
|
||||
@@ -2940,6 +2978,9 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
{
|
||||
png_composite(*dp, *sp, a, background_1->gray);
|
||||
}
|
||||
#else
|
||||
*dp = (png_byte)background->gray;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2963,12 +3004,17 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
*dp = (png_byte)((v >> 8) & 0xff);
|
||||
*(dp + 1) = (png_byte)(v & 0xff);
|
||||
}
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
else if (a == 0)
|
||||
#else
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* background is already in screen gamma */
|
||||
*dp = (png_byte)((background->gray >> 8) & 0xff);
|
||||
*(dp + 1) = (png_byte)(background->gray & 0xff);
|
||||
}
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
else
|
||||
{
|
||||
png_uint_16 g, v, w;
|
||||
@@ -2979,6 +3025,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
*dp = (png_byte)((w >> 8) & 0xff);
|
||||
*(dp + 1) = (png_byte)(w & 0xff);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2993,11 +3040,16 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
{
|
||||
png_memcpy(dp, sp, 2);
|
||||
}
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
else if (a == 0)
|
||||
#else
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*dp = (png_byte)((background->gray >> 8) & 0xff);
|
||||
*(dp + 1) = (png_byte)(background->gray & 0xff);
|
||||
}
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
else
|
||||
{
|
||||
png_uint_16 g, v;
|
||||
@@ -3007,6 +3059,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
*dp = (png_byte)((v >> 8) & 0xff);
|
||||
*(dp + 1) = (png_byte)(v & 0xff);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3128,17 +3181,17 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_uint_16 v, w, x;
|
||||
|
||||
v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
|
||||
png_composite_16(w, v, a, background->red);
|
||||
png_composite_16(w, v, a, background_1->red);
|
||||
x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
|
||||
*dp = (png_byte)((x >> 8) & 0xff);
|
||||
*(dp + 1) = (png_byte)(x & 0xff);
|
||||
v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)];
|
||||
png_composite_16(w, v, a, background->green);
|
||||
png_composite_16(w, v, a, background_1->green);
|
||||
x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
|
||||
*(dp + 2) = (png_byte)((x >> 8) & 0xff);
|
||||
*(dp + 3) = (png_byte)(x & 0xff);
|
||||
v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)];
|
||||
png_composite_16(w, v, a, background->blue);
|
||||
png_composite_16(w, v, a, background_1->blue);
|
||||
x = gamma_16_from_1[(w & 0xff) >> gamma_shift][w >> 8];
|
||||
*(dp + 4) = (png_byte)((x >> 8) & 0xff);
|
||||
*(dp + 5) = (png_byte)(x & 0xff);
|
||||
|
||||
95
pngrutil.c
95
pngrutil.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -691,6 +691,8 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green,
|
||||
int_y_green, int_x_blue, int_y_blue;
|
||||
|
||||
png_uint_32 uint_x, uint_y;
|
||||
|
||||
png_debug(1, "in png_handle_cHRM\n");
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
@@ -724,60 +726,69 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_x_white = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_x = png_get_uint_32(buf);
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_y_white = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_y = png_get_uint_32(buf);
|
||||
|
||||
if (int_x_white > 80000L || int_y_white > 80000L ||
|
||||
int_x_white + int_y_white > 100000L)
|
||||
if (uint_x > 80000L || uint_y > 80000L ||
|
||||
uint_x + uint_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid cHRM white point");
|
||||
png_crc_finish(png_ptr, 24);
|
||||
return;
|
||||
}
|
||||
int_x_white = (png_fixed_point)uint_x;
|
||||
int_y_white = (png_fixed_point)uint_y;
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_x_red = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_x = png_get_uint_32(buf);
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_y_red = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_y = png_get_uint_32(buf);
|
||||
|
||||
if (int_x_red > 80000L || int_y_red > 80000L ||
|
||||
int_x_red + int_y_red > 100000L)
|
||||
if (uint_x > 80000L || uint_y > 80000L ||
|
||||
uint_x + uint_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid cHRM red point");
|
||||
png_crc_finish(png_ptr, 16);
|
||||
return;
|
||||
}
|
||||
int_x_red = (png_fixed_point)uint_x;
|
||||
int_y_red = (png_fixed_point)uint_y;
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_x_green = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_x = png_get_uint_32(buf);
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_y_green = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_y = png_get_uint_32(buf);
|
||||
|
||||
if (int_x_green > 80000L || int_y_green > 80000L ||
|
||||
int_x_green + int_y_green > 100000L)
|
||||
if (uint_x > 80000L || uint_y > 80000L ||
|
||||
uint_x + uint_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid cHRM green point");
|
||||
png_crc_finish(png_ptr, 8);
|
||||
return;
|
||||
}
|
||||
int_x_green = (png_fixed_point)uint_x;
|
||||
int_y_green = (png_fixed_point)uint_y;
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_x_blue = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_x = png_get_uint_32(buf);
|
||||
|
||||
png_crc_read(png_ptr, buf, 4);
|
||||
int_y_blue = (png_fixed_point)png_get_uint_32(buf);
|
||||
uint_y = png_get_uint_32(buf);
|
||||
|
||||
if (int_x_blue > 80000L || int_y_blue > 80000L ||
|
||||
int_x_blue + int_y_blue > 100000L)
|
||||
if (uint_x > 80000L || uint_y > 80000L ||
|
||||
uint_x + uint_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid cHRM blue point");
|
||||
png_crc_finish(png_ptr, 0);
|
||||
return;
|
||||
}
|
||||
int_x_blue = (png_fixed_point)uint_x;
|
||||
int_y_blue = (png_fixed_point)uint_y;
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
white_x = (float)int_x_white / (float)100000.0;
|
||||
white_y = (float)int_y_white / (float)100000.0;
|
||||
@@ -794,12 +805,12 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
if (abs(int_x_white - 31270L) > 1000 ||
|
||||
abs(int_y_white - 32900L) > 1000 ||
|
||||
abs( int_x_red - 64000L) > 1000 ||
|
||||
abs( int_y_red - 33000L) > 1000 ||
|
||||
abs(int_x_red - 64000L) > 1000 ||
|
||||
abs(int_y_red - 33000L) > 1000 ||
|
||||
abs(int_x_green - 30000L) > 1000 ||
|
||||
abs(int_y_green - 60000L) > 1000 ||
|
||||
abs( int_x_blue - 15000L) > 1000 ||
|
||||
abs( int_y_blue - 6000L) > 1000)
|
||||
abs(int_x_blue - 15000L) > 1000 ||
|
||||
abs(int_y_blue - 6000L) > 1000)
|
||||
{
|
||||
|
||||
png_warning(png_ptr,
|
||||
@@ -894,17 +905,6 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
# ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
igamma=(int)(info_ptr->gamma * 100000.);
|
||||
# endif
|
||||
#endif
|
||||
#if 0 && defined(PNG_cHRM_SUPPORTED) && !defined(PNG_FIXED_POINT_SUPPORTED)
|
||||
/* We need to define these here because they aren't in png.h */
|
||||
png_fixed_point int_x_white;
|
||||
png_fixed_point int_y_white;
|
||||
png_fixed_point int_x_red;
|
||||
png_fixed_point int_y_red;
|
||||
png_fixed_point int_x_green;
|
||||
png_fixed_point int_y_green;
|
||||
png_fixed_point int_x_blue;
|
||||
png_fixed_point int_y_blue;
|
||||
#endif
|
||||
if(igamma < 45000L || igamma > 46000L)
|
||||
{
|
||||
@@ -928,12 +928,12 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
if (info_ptr->valid & PNG_INFO_cHRM)
|
||||
if (abs(info_ptr->int_x_white - 31270L) > 1000 ||
|
||||
abs(info_ptr->int_y_white - 32900L) > 1000 ||
|
||||
abs( info_ptr->int_x_red - 64000L) > 1000 ||
|
||||
abs( info_ptr->int_y_red - 33000L) > 1000 ||
|
||||
abs(info_ptr->int_x_red - 64000L) > 1000 ||
|
||||
abs(info_ptr->int_y_red - 33000L) > 1000 ||
|
||||
abs(info_ptr->int_x_green - 30000L) > 1000 ||
|
||||
abs(info_ptr->int_y_green - 60000L) > 1000 ||
|
||||
abs( info_ptr->int_x_blue - 15000L) > 1000 ||
|
||||
abs( info_ptr->int_y_blue - 6000L) > 1000)
|
||||
abs(info_ptr->int_x_blue - 15000L) > 1000 ||
|
||||
abs(info_ptr->int_y_blue - 6000L) > 1000)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring incorrect cHRM value when sRGB is also present");
|
||||
@@ -952,6 +952,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
png_charp chunkdata;
|
||||
png_byte compression_type;
|
||||
png_bytep pC;
|
||||
png_charp profile;
|
||||
png_uint_32 skip = 0;
|
||||
png_uint_32 profile_size = 0;
|
||||
@@ -1029,17 +1030,26 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
profile_length = data_length - prefix_length;
|
||||
|
||||
if ( prefix_length > data_length || profile_length < 4)
|
||||
{
|
||||
png_free(png_ptr, chunkdata);
|
||||
png_warning(png_ptr, "Profile size field missing from iCCP chunk");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check the profile_size recorded in the first 32 bits of the ICC profile */
|
||||
profile_size = ((*(chunkdata+prefix_length))<<24) |
|
||||
((*(chunkdata+prefix_length+1))<<16) |
|
||||
((*(chunkdata+prefix_length+2))<< 8) |
|
||||
((*(chunkdata+prefix_length+3)) );
|
||||
pC = (png_bytep)(chunkdata+prefix_length);
|
||||
profile_size = ((*(pC ))<<24) |
|
||||
((*(pC+1))<<16) |
|
||||
((*(pC+2))<< 8) |
|
||||
((*(pC+3)) );
|
||||
|
||||
if(profile_size < profile_length)
|
||||
profile_length = profile_size;
|
||||
|
||||
if(profile_size > profile_length)
|
||||
{
|
||||
png_free(png_ptr, chunkdata);
|
||||
png_warning(png_ptr, "Ignoring truncated iCCP profile.\n");
|
||||
return;
|
||||
}
|
||||
@@ -2967,7 +2977,8 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
if (row_bytes > (png_uint_32)65536L)
|
||||
png_error(png_ptr, "This image requires a row greater than 64KB");
|
||||
#endif
|
||||
png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, row_bytes);
|
||||
png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64);
|
||||
png_ptr->row_buf = png_ptr->big_row_buf+32;
|
||||
#if defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD)
|
||||
png_ptr->row_buf_size = row_bytes;
|
||||
#endif
|
||||
|
||||
130
pngset.c
130
pngset.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -40,6 +40,25 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (white_x < 0.0 || white_y < 0.0 ||
|
||||
red_x < 0.0 || red_y < 0.0 ||
|
||||
green_x < 0.0 || green_y < 0.0 ||
|
||||
blue_x < 0.0 || blue_y < 0.0)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to set negative chromaticity value");
|
||||
return;
|
||||
}
|
||||
if (white_x > 21474.83 || white_y > 21474.83 ||
|
||||
red_x > 21474.83 || red_y > 21474.83 ||
|
||||
green_x > 21474.83 || green_y > 21474.83 ||
|
||||
blue_x > 21474.83 || blue_y > 21474.83)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to set chromaticity value exceeding 21474.83");
|
||||
return;
|
||||
}
|
||||
|
||||
info_ptr->x_white = (float)white_x;
|
||||
info_ptr->y_white = (float)white_y;
|
||||
info_ptr->x_red = (float)red_x;
|
||||
@@ -51,12 +70,12 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5);
|
||||
info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5);
|
||||
info_ptr->int_x_red = (png_fixed_point)(red_x*100000.+0.5);
|
||||
info_ptr->int_y_red = (png_fixed_point)(red_y*100000.+0.5);
|
||||
info_ptr->int_x_red = (png_fixed_point)( red_x*100000.+0.5);
|
||||
info_ptr->int_y_red = (png_fixed_point)( red_y*100000.+0.5);
|
||||
info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5);
|
||||
info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5);
|
||||
info_ptr->int_x_blue = (png_fixed_point)(blue_x*100000.+0.5);
|
||||
info_ptr->int_y_blue = (png_fixed_point)(blue_y*100000.+0.5);
|
||||
info_ptr->int_x_blue = (png_fixed_point)( blue_x*100000.+0.5);
|
||||
info_ptr->int_y_blue = (png_fixed_point)( blue_y*100000.+0.5);
|
||||
#endif
|
||||
info_ptr->valid |= PNG_INFO_cHRM;
|
||||
}
|
||||
@@ -72,6 +91,24 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (white_x < 0 || white_y < 0 ||
|
||||
red_x < 0 || red_y < 0 ||
|
||||
green_x < 0 || green_y < 0 ||
|
||||
blue_x < 0 || blue_y < 0)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to set negative chromaticity value");
|
||||
return;
|
||||
}
|
||||
if (white_x > (double) PNG_MAX_UINT || white_y > (double) PNG_MAX_UINT ||
|
||||
red_x > (double) PNG_MAX_UINT || red_y > (double) PNG_MAX_UINT ||
|
||||
green_x > (double) PNG_MAX_UINT || green_y > (double) PNG_MAX_UINT ||
|
||||
blue_x > (double) PNG_MAX_UINT || blue_y > (double) PNG_MAX_UINT)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to set chromaticity value exceeding 21474.83");
|
||||
return;
|
||||
}
|
||||
info_ptr->int_x_white = white_x;
|
||||
info_ptr->int_y_white = white_y;
|
||||
info_ptr->int_x_red = red_x;
|
||||
@@ -83,12 +120,12 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
info_ptr->x_white = (float)(white_x/100000.);
|
||||
info_ptr->y_white = (float)(white_y/100000.);
|
||||
info_ptr->x_red = (float)(red_x/100000.);
|
||||
info_ptr->y_red = (float)(red_y/100000.);
|
||||
info_ptr->x_red = (float)( red_x/100000.);
|
||||
info_ptr->y_red = (float)( red_y/100000.);
|
||||
info_ptr->x_green = (float)(green_x/100000.);
|
||||
info_ptr->y_green = (float)(green_y/100000.);
|
||||
info_ptr->x_blue = (float)(blue_x/100000.);
|
||||
info_ptr->y_blue = (float)(blue_y/100000.);
|
||||
info_ptr->x_blue = (float)( blue_x/100000.);
|
||||
info_ptr->y_blue = (float)( blue_y/100000.);
|
||||
#endif
|
||||
info_ptr->valid |= PNG_INFO_cHRM;
|
||||
}
|
||||
@@ -100,16 +137,25 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
void PNGAPI
|
||||
png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
|
||||
{
|
||||
double gamma;
|
||||
png_debug1(1, "in %s storage function\n", "gAMA");
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
info_ptr->gamma = (float)file_gamma;
|
||||
/* Check for overflow */
|
||||
if (file_gamma > 21474.83)
|
||||
{
|
||||
png_warning(png_ptr, "Limiting gamma to 21474.83");
|
||||
gamma=21474.83;
|
||||
}
|
||||
else
|
||||
gamma=file_gamma;
|
||||
info_ptr->gamma = (float)gamma;
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
info_ptr->int_gamma = (int)(file_gamma*100000.+.5);
|
||||
info_ptr->int_gamma = (int)(gamma*100000.+.5);
|
||||
#endif
|
||||
info_ptr->valid |= PNG_INFO_gAMA;
|
||||
if(file_gamma == 0.0)
|
||||
if(gamma == 0.0)
|
||||
png_warning(png_ptr, "Setting gamma=0");
|
||||
}
|
||||
#endif
|
||||
@@ -117,18 +163,35 @@ void PNGAPI
|
||||
png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
|
||||
int_gamma)
|
||||
{
|
||||
png_fixed_point gamma;
|
||||
|
||||
png_debug1(1, "in %s storage function\n", "gAMA");
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (int_gamma > (png_fixed_point) PNG_MAX_UINT)
|
||||
{
|
||||
png_warning(png_ptr, "Limiting gamma to 21474.83");
|
||||
gamma=PNG_MAX_UINT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (int_gamma < 0)
|
||||
{
|
||||
png_warning(png_ptr, "Setting negative gamma to zero");
|
||||
gamma=0;
|
||||
}
|
||||
else
|
||||
gamma=int_gamma;
|
||||
}
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
info_ptr->gamma = (float)(int_gamma/100000.);
|
||||
info_ptr->gamma = (float)(gamma/100000.);
|
||||
#endif
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
info_ptr->int_gamma = int_gamma;
|
||||
info_ptr->int_gamma = gamma;
|
||||
#endif
|
||||
info_ptr->valid |= PNG_INFO_gAMA;
|
||||
if(int_gamma == 0)
|
||||
if(gamma == 0)
|
||||
png_warning(png_ptr, "Setting gamma=0");
|
||||
}
|
||||
#endif
|
||||
@@ -152,8 +215,9 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
||||
#endif
|
||||
/* Changed from info->num_palette to 256 in version 1.2.1 */
|
||||
png_ptr->hist = (png_uint_16p)png_malloc(png_ptr,
|
||||
(png_uint_32)(info_ptr->num_palette * sizeof (png_uint_16)));
|
||||
(png_uint_32)(256 * sizeof (png_uint_16)));
|
||||
|
||||
for (i = 0; i < info_ptr->num_palette; i++)
|
||||
png_ptr->hist[i] = hist[i];
|
||||
@@ -241,9 +305,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->compression_type = (png_byte)compression_type;
|
||||
info_ptr->filter_type = (png_byte)filter_type;
|
||||
info_ptr->interlace_type = (png_byte)interlace_type;
|
||||
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
info_ptr->channels = 1;
|
||||
else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
|
||||
if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
|
||||
info_ptr->channels = 3;
|
||||
else
|
||||
info_ptr->channels = 1;
|
||||
@@ -410,8 +472,12 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
||||
#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,
|
||||
/* Changed in libpng-1.2.1 to allocate 256 instead of num_palette entries,
|
||||
in case of an invalid PNG file that has too-large sample values. */
|
||||
png_ptr->palette = (png_colorp)png_zalloc(png_ptr, (uInt)256,
|
||||
sizeof (png_color));
|
||||
if (png_ptr->palette == NULL)
|
||||
png_error(png_ptr, "Unable to malloc palette");
|
||||
png_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;
|
||||
@@ -620,7 +686,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
#ifdef PNG_iTXt_SUPPORTED
|
||||
{
|
||||
/* set iTXt data */
|
||||
if (text_ptr[i].key != NULL)
|
||||
if (text_ptr[i].lang != NULL)
|
||||
lang_len = png_strlen(text_ptr[i].lang);
|
||||
else
|
||||
lang_len = 0;
|
||||
@@ -676,8 +742,8 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
#endif
|
||||
{
|
||||
#ifdef PNG_iTXt_SUPPORTED
|
||||
textp->lang=(png_charp)NULL;
|
||||
textp->lang_key=(png_charp)NULL;
|
||||
textp->lang=NULL;
|
||||
textp->lang_key=NULL;
|
||||
#endif
|
||||
textp->text=textp->key + key_len + 1;
|
||||
}
|
||||
@@ -740,9 +806,10 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
||||
#endif
|
||||
/* Changed from num_trans to 256 in version 1.2.1 */
|
||||
png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr,
|
||||
num_trans);
|
||||
png_memcpy(info_ptr->trans, trans, num_trans);
|
||||
(png_uint_32)256);
|
||||
png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans);
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_TRNS;
|
||||
#else
|
||||
@@ -905,14 +972,17 @@ png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
|
||||
if (chunk_list == NULL)
|
||||
return;
|
||||
old_num_chunks=png_ptr->num_chunk_list;
|
||||
new_list=(png_bytep)png_malloc(png_ptr,5*(num_chunks+old_num_chunks));
|
||||
new_list=(png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)(5*(num_chunks+old_num_chunks)));
|
||||
if(png_ptr->chunk_list != NULL)
|
||||
{
|
||||
png_memcpy(new_list, png_ptr->chunk_list, 5*old_num_chunks);
|
||||
png_memcpy(new_list, png_ptr->chunk_list,
|
||||
(png_size_t)(5*old_num_chunks));
|
||||
png_free(png_ptr, png_ptr->chunk_list);
|
||||
png_ptr->chunk_list=NULL;
|
||||
}
|
||||
png_memcpy(new_list+5*old_num_chunks, chunk_list, 5*num_chunks);
|
||||
png_memcpy(new_list+5*old_num_chunks, chunk_list,
|
||||
(png_size_t)(5*num_chunks));
|
||||
for (p=new_list+5*old_num_chunks+4, i=0; i<num_chunks; i++, p+=5)
|
||||
*p=(png_byte)keep;
|
||||
png_ptr->num_chunk_list=old_num_chunks+num_chunks;
|
||||
@@ -970,6 +1040,7 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PNG_1_0_X
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
/* this function was added to libpng 1.2.0 and should always exist by default */
|
||||
void PNGAPI
|
||||
@@ -1024,3 +1095,4 @@ png_set_mmx_thresholds (png_structp png_ptr,
|
||||
png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold;
|
||||
}
|
||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
#endif /* ?PNG_1_0_X */
|
||||
|
||||
61
pngtest.c
61
pngtest.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -470,10 +470,8 @@ static int maximum_allocation = 0;
|
||||
static int total_allocation = 0;
|
||||
static int num_allocations = 0;
|
||||
|
||||
extern PNG_EXPORT(png_voidp,png_debug_malloc) PNGARG((png_structp png_ptr,
|
||||
png_uint_32 size));
|
||||
extern PNG_EXPORT(void,png_debug_free) PNGARG((png_structp png_ptr,
|
||||
png_voidp ptr));
|
||||
png_voidp png_debug_malloc PNGARG((png_structp png_ptr, png_uint_32 size));
|
||||
void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||
|
||||
png_voidp
|
||||
png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
@@ -483,13 +481,13 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_debug_malloc directly, with png_ptr == NULL which is OK */
|
||||
|
||||
if (size == 0)
|
||||
return (png_voidp)(NULL);
|
||||
return (NULL);
|
||||
|
||||
/* This calls the library allocator twice, once to get the requested
|
||||
buffer and once to get a new free list entry. */
|
||||
{
|
||||
memory_infop pinfo = (memory_infop)png_malloc_default(png_ptr,
|
||||
sizeof *pinfo);
|
||||
(png_uint_32)sizeof *pinfo);
|
||||
pinfo->size = size;
|
||||
current_allocation += size;
|
||||
total_allocation += size;
|
||||
@@ -503,7 +501,7 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_memset(pinfo->pointer, 0xdd, pinfo->size);
|
||||
#if PNG_DEBUG
|
||||
if(verbose)
|
||||
printf("png_malloc %d bytes at %x\n",size,pinfo->pointer);
|
||||
printf("png_malloc %lu bytes at %x\n",size,pinfo->pointer);
|
||||
#endif
|
||||
assert(pinfo->size != 12345678);
|
||||
return (png_voidp)(pinfo->pointer);
|
||||
@@ -545,7 +543,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
|
||||
}
|
||||
if (pinfo->next == NULL)
|
||||
{
|
||||
fprintf(STDERR, "Pointer %x not found\n", ptr);
|
||||
fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr);
|
||||
break;
|
||||
}
|
||||
ppinfo = &pinfo->next;
|
||||
@@ -596,7 +594,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
char inbuf[256], outbuf[256];
|
||||
|
||||
row_buf = (png_bytep)NULL;
|
||||
row_buf = NULL;
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
||||
@@ -623,12 +621,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
|
||||
png_debug(0, "Allocating read and write structures\n");
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
read_ptr = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
(png_error_ptr)NULL, (png_error_ptr)NULL, (png_voidp)NULL,
|
||||
read_ptr = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL,
|
||||
(png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free);
|
||||
#else
|
||||
read_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
(png_error_ptr)NULL, (png_error_ptr)NULL);
|
||||
read_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL);
|
||||
#endif
|
||||
#if defined(PNG_NO_STDIO)
|
||||
png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error,
|
||||
@@ -636,12 +634,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
write_ptr = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
(png_error_ptr)NULL, (png_error_ptr)NULL, (png_voidp)NULL,
|
||||
write_ptr = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL,
|
||||
(png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free);
|
||||
#else
|
||||
write_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
(png_error_ptr)NULL, (png_error_ptr)NULL);
|
||||
write_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL);
|
||||
#endif
|
||||
#if defined(PNG_NO_STDIO)
|
||||
png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error,
|
||||
@@ -729,9 +727,9 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
else
|
||||
{
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_set_write_status_fn(write_ptr, NULL);
|
||||
png_set_write_status_fn(write_ptr, png_write_status_ptr_NULL);
|
||||
#endif
|
||||
png_set_read_status_fn(read_ptr, NULL);
|
||||
png_set_read_status_fn(read_ptr, png_read_status_ptr_NULL);
|
||||
}
|
||||
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
||||
@@ -750,10 +748,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#define HANDLE_CHUNK_IF_SAFE 2
|
||||
#define HANDLE_CHUNK_ALWAYS 3
|
||||
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
png_set_keep_unknown_chunks(read_ptr, HANDLE_CHUNK_ALWAYS, NULL, 0);
|
||||
png_set_keep_unknown_chunks(read_ptr, HANDLE_CHUNK_ALWAYS,
|
||||
png_bytep_NULL, 0);
|
||||
#endif
|
||||
#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
png_set_keep_unknown_chunks(write_ptr, HANDLE_CHUNK_IF_SAFE, NULL, 0);
|
||||
png_set_keep_unknown_chunks(write_ptr, HANDLE_CHUNK_IF_SAFE,
|
||||
png_bytep_NULL, 0);
|
||||
#endif
|
||||
|
||||
png_debug(0, "Reading info struct\n");
|
||||
@@ -1058,7 +1058,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
png_debug2(0, "0x%08lx (%ld bytes)\n", (unsigned long)row_buf,
|
||||
png_get_rowbytes(read_ptr, read_info_ptr));
|
||||
#endif /* !SINGLE_ROWBUF_ALLOC */
|
||||
png_read_rows(read_ptr, (png_bytepp)&row_buf, (png_bytepp)NULL, 1);
|
||||
png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1);
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#ifdef PNGTEST_TIMING
|
||||
@@ -1280,8 +1280,8 @@ main(int argc, char *argv[])
|
||||
/* Show the version of libpng used in building the application */
|
||||
fprintf(STDERR," pngtest (%lu):%s", (unsigned long)PNG_LIBPNG_VER,
|
||||
PNG_HEADER_VERSION_STRING);
|
||||
fprintf(STDERR," sizeof(png_struct)=%d, sizeof(png_info)=%d\n",
|
||||
sizeof(png_struct), sizeof(png_info));
|
||||
fprintf(STDERR," sizeof(png_struct)=%ld, sizeof(png_info)=%ld\n",
|
||||
(long)sizeof(png_struct), (long)sizeof(png_info));
|
||||
|
||||
/* Do some consistency checking on the memory allocation settings, I'm
|
||||
not sure this matters, but it is nice to know, the first of these
|
||||
@@ -1396,7 +1396,8 @@ main(int argc, char *argv[])
|
||||
current_allocation);
|
||||
while (pinfo != NULL)
|
||||
{
|
||||
fprintf(STDERR, " %d bytes at %x\n", pinfo->size, pinfo->pointer);
|
||||
fprintf(STDERR, " %lu bytes at %x\n", pinfo->size,
|
||||
(unsigned int) pinfo->pointer);
|
||||
pinfo = pinfo->next;
|
||||
}
|
||||
}
|
||||
@@ -1470,8 +1471,8 @@ main(int argc, char *argv[])
|
||||
current_allocation);
|
||||
while (pinfo != NULL)
|
||||
{
|
||||
fprintf(STDERR," %d bytes at %x\n",
|
||||
pinfo->size, pinfo->pointer);
|
||||
fprintf(STDERR," %lu bytes at %x\n",
|
||||
pinfo->size, (unsigned int)pinfo->pointer);
|
||||
pinfo = pinfo->next;
|
||||
}
|
||||
}
|
||||
@@ -1511,4 +1512,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_0_12beta1 your_png_h_is_not_version_1_0_12beta1;
|
||||
typedef version_1_0_13 your_png_h_is_not_version_1_0_13;
|
||||
|
||||
41
pngtrans.c
41
pngtrans.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -153,11 +153,14 @@ void /* PRIVATE */
|
||||
png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_invert\n");
|
||||
if (row_info->bit_depth == 1 &&
|
||||
/* This test removed from libpng version 1.0.13 and 1.2.0:
|
||||
* if (row_info->bit_depth == 1 &&
|
||||
*/
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
if (row == NULL || row_info == NULL)
|
||||
return;
|
||||
#endif
|
||||
row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_uint_32 i;
|
||||
@@ -169,6 +172,33 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
rp++;
|
||||
}
|
||||
}
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&
|
||||
row_info->bit_depth == 8)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_uint_32 i;
|
||||
png_uint_32 istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i+=2)
|
||||
{
|
||||
*rp = (png_byte)(~(*rp));
|
||||
rp+=2;
|
||||
}
|
||||
}
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&
|
||||
row_info->bit_depth == 16)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_uint_32 i;
|
||||
png_uint_32 istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i+=4)
|
||||
{
|
||||
*rp = (png_byte)(~(*rp));
|
||||
*(rp+1) = (png_byte)(~(*(rp+1)));
|
||||
rp+=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -608,4 +638,3 @@ png_get_user_transform_ptr(png_structp png_ptr)
|
||||
return (NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
85
pngvcrd.c
85
pngvcrd.c
@@ -2,14 +2,14 @@
|
||||
*
|
||||
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng version 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998, Intel Corporation
|
||||
*
|
||||
* Contributed by Nirav Chhatrapati, Intel Corporation, 1998
|
||||
* 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
|
||||
@@ -19,6 +19,8 @@
|
||||
*
|
||||
* [png_read_filter_row_mmx_avg() bpp == 2 bugfix, GRR 20000916]
|
||||
*
|
||||
* [runtime MMX configuration, GRR 20010102]
|
||||
*
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
@@ -37,6 +39,7 @@ png_mmx_support(void)
|
||||
push ebx //CPUID will trash these
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
pushfd //Save Eflag to stack
|
||||
pop eax //Get Eflag from stack into eax
|
||||
mov ecx, eax //Make another copy of Eflag in ecx
|
||||
@@ -46,6 +49,8 @@ png_mmx_support(void)
|
||||
popfd //Restored modified value back to Eflag reg
|
||||
pushfd //Save Eflag to stack
|
||||
pop eax //Get Eflag from stack
|
||||
push ecx // save original Eflag to stack
|
||||
popfd // restore original Eflag
|
||||
xor eax, ecx //Compare the new Eflag with the original Eflag
|
||||
jz NOT_SUPPORTED //If the same, CPUID instruction is not supported,
|
||||
//skip following instructions and jump to
|
||||
@@ -110,6 +115,8 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
png_debug(1,"in png_combine_row_asm\n");
|
||||
|
||||
if (mmx_supported == 2) {
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
png_warning(png_ptr, "asm_flags may not have been initialized");
|
||||
png_mmx_support();
|
||||
}
|
||||
|
||||
@@ -300,7 +307,8 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
||||
|
||||
__int64 mask0=0x0102040810204080;
|
||||
|
||||
if ( mmx_supported )
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && mmx_supported */ )
|
||||
{
|
||||
srcptr = png_ptr->row_buf + 1;
|
||||
dstptr = row;
|
||||
@@ -382,8 +390,6 @@ end8:
|
||||
incr1 = (disp)*pixel_bytes;
|
||||
for (i = initial_val; i < final_val; i += incr1)
|
||||
{
|
||||
if (pixel_bytes > (png_size_t)(final_val-i))
|
||||
pixel_bytes = (png_size_t)(final_val-i);
|
||||
png_memcpy(dstptr, srcptr, pixel_bytes);
|
||||
srcptr += incr1;
|
||||
dstptr += incr1;
|
||||
@@ -402,7 +408,8 @@ end8:
|
||||
__int64 mask1=0x0101020204040808,
|
||||
mask0=0x1010202040408080;
|
||||
|
||||
if ( mmx_supported )
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && mmx_supported */ )
|
||||
{
|
||||
srcptr = png_ptr->row_buf + 1;
|
||||
dstptr = row;
|
||||
@@ -495,8 +502,6 @@ end16:
|
||||
incr1 = (disp)*pixel_bytes;
|
||||
for (i = initial_val; i < final_val; i += incr1)
|
||||
{
|
||||
if (pixel_bytes > (png_size_t)(final_val-i))
|
||||
pixel_bytes = (png_size_t)(final_val-i);
|
||||
png_memcpy(dstptr, srcptr, pixel_bytes);
|
||||
srcptr += incr1;
|
||||
dstptr += incr1;
|
||||
@@ -524,7 +529,8 @@ end16:
|
||||
len = (png_ptr->width)&~7;
|
||||
diff = (png_ptr->width)&7;
|
||||
|
||||
if ( mmx_supported )
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && mmx_supported */ )
|
||||
{
|
||||
_asm
|
||||
{
|
||||
@@ -627,8 +633,6 @@ end24:
|
||||
incr1 = (disp)*pixel_bytes;
|
||||
for (i = initial_val; i < final_val; i += incr1)
|
||||
{
|
||||
if (pixel_bytes > (png_size_t)(final_val-i))
|
||||
pixel_bytes = (png_size_t)(final_val-i);
|
||||
png_memcpy(dstptr, srcptr, pixel_bytes);
|
||||
srcptr += incr1;
|
||||
dstptr += incr1;
|
||||
@@ -657,7 +661,8 @@ end24:
|
||||
len = (png_ptr->width)&~7;
|
||||
diff = (png_ptr->width)&7;
|
||||
|
||||
if ( mmx_supported )
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && mmx_supported */ )
|
||||
{
|
||||
_asm
|
||||
{
|
||||
@@ -768,8 +773,6 @@ end32:
|
||||
incr1 = (disp)*pixel_bytes;
|
||||
for (i = initial_val; i < final_val; i += incr1)
|
||||
{
|
||||
if (pixel_bytes > (png_size_t)(final_val-i))
|
||||
pixel_bytes = (png_size_t)(final_val-i);
|
||||
png_memcpy(dstptr, srcptr, pixel_bytes);
|
||||
srcptr += incr1;
|
||||
dstptr += incr1;
|
||||
@@ -793,7 +796,8 @@ end32:
|
||||
mask1=0x2020202040404040,
|
||||
mask0=0x4040808080808080;
|
||||
|
||||
if ( mmx_supported )
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
|
||||
/* && mmx_supported */ )
|
||||
{
|
||||
srcptr = png_ptr->row_buf + 1;
|
||||
dstptr = row;
|
||||
@@ -927,8 +931,6 @@ end48:
|
||||
incr1 = (disp)*pixel_bytes;
|
||||
for (i = initial_val; i < final_val; i += incr1)
|
||||
{
|
||||
if (pixel_bytes > (png_size_t)(final_val-i))
|
||||
pixel_bytes = (png_size_t)(final_val-i);
|
||||
png_memcpy(dstptr, srcptr, pixel_bytes);
|
||||
srcptr += incr1;
|
||||
dstptr += incr1;
|
||||
@@ -957,8 +959,6 @@ end48:
|
||||
incr1 = (disp)*pixel_bytes;
|
||||
for (i = initial_val; i < final_val; i += incr1)
|
||||
{
|
||||
if (pixel_bytes > (png_size_t)(final_val-i))
|
||||
pixel_bytes = (png_size_t)(final_val-i);
|
||||
png_memcpy(dp, sptr, pixel_bytes);
|
||||
sptr += incr1;
|
||||
dp += incr1;
|
||||
@@ -987,6 +987,8 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
png_debug(1,"in png_do_read_interlace\n");
|
||||
|
||||
if (mmx_supported == 2) {
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
png_warning(png_ptr, "asm_flags may not have been initialized");
|
||||
png_mmx_support();
|
||||
}
|
||||
|
||||
@@ -1187,7 +1189,8 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
// NOTE: there is NO MMX code for 48-bit and 64-bit images
|
||||
|
||||
// use MMX routine if machine supports it
|
||||
if ( mmx_supported )
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE)
|
||||
/* && mmx_supported */ )
|
||||
{
|
||||
if (pixel_bytes == 3)
|
||||
{
|
||||
@@ -1777,7 +1780,7 @@ loop4_pass4:
|
||||
} /* end of mmx_supported */
|
||||
|
||||
else /* MMX not supported: use modified C code - takes advantage
|
||||
* of inlining of png_memcpy for a constant */
|
||||
* of inlining of memcpy for a constant */
|
||||
{
|
||||
if (pixel_bytes == 1)
|
||||
{
|
||||
@@ -3649,6 +3652,8 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
#endif
|
||||
|
||||
if (mmx_supported == 2) {
|
||||
/* this should have happened in png_init_mmx_flags() already */
|
||||
png_warning(png_ptr, "asm_flags may not have been initialized");
|
||||
png_mmx_support();
|
||||
}
|
||||
|
||||
@@ -3658,13 +3663,17 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
{
|
||||
case 0: sprintf(filnm, "none");
|
||||
break;
|
||||
case 1: sprintf(filnm, "sub-%s", "MMX");
|
||||
case 1: sprintf(filnm, "sub-%s",
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : "x86");
|
||||
break;
|
||||
case 2: sprintf(filnm, "up-%s", "MMX");
|
||||
case 2: sprintf(filnm, "up-%s",
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : "x86");
|
||||
break;
|
||||
case 3: sprintf(filnm, "avg-%s", "MMX");
|
||||
case 3: sprintf(filnm, "avg-%s",
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : "x86");
|
||||
break;
|
||||
case 4: sprintf(filnm, "Paeth-%s", "MMX");
|
||||
case 4: sprintf(filnm, "Paeth-%s",
|
||||
(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":"x86");
|
||||
break;
|
||||
default: sprintf(filnm, "unknw");
|
||||
break;
|
||||
@@ -3682,9 +3691,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
|
||||
case PNG_FILTER_VALUE_SUB:
|
||||
{
|
||||
if (
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) &&
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_sub(row_info, row);
|
||||
}
|
||||
@@ -3707,9 +3716,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
|
||||
case PNG_FILTER_VALUE_UP:
|
||||
{
|
||||
if (
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) &&
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_up(row_info, row, prev_row);
|
||||
}
|
||||
@@ -3731,9 +3740,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
|
||||
case PNG_FILTER_VALUE_AVG:
|
||||
{
|
||||
if (
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) &&
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_avg(row_info, row, prev_row);
|
||||
}
|
||||
@@ -3765,9 +3774,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
|
||||
|
||||
case PNG_FILTER_VALUE_PAETH:
|
||||
{
|
||||
if (
|
||||
(row_info->pixel_depth >= PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT) &&
|
||||
(row_info->rowbytes >= PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT))
|
||||
if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) &&
|
||||
(row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
|
||||
(row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold))
|
||||
{
|
||||
png_read_filter_row_mmx_paeth(row_info, row, prev_row);
|
||||
}
|
||||
|
||||
8
pngwio.c
8
pngwio.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -171,7 +171,7 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
|
||||
if (write_data_fn != NULL)
|
||||
png_ptr->write_data_fn = write_data_fn;
|
||||
else
|
||||
png_ptr->write_data_fn = png_default_write_data;
|
||||
png_ptr->write_data_fn = (png_rw_ptr)png_default_write_data;
|
||||
#else
|
||||
png_ptr->write_data_fn = write_data_fn;
|
||||
#endif
|
||||
@@ -181,7 +181,7 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
|
||||
if (output_flush_fn != NULL)
|
||||
png_ptr->output_flush_fn = output_flush_fn;
|
||||
else
|
||||
png_ptr->output_flush_fn = png_default_flush;
|
||||
png_ptr->output_flush_fn = (png_flush_ptr)png_default_flush;
|
||||
#else
|
||||
png_ptr->output_flush_fn = output_flush_fn;
|
||||
#endif
|
||||
|
||||
114
pngwrite.c
114
pngwrite.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -424,7 +424,7 @@ png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn,
|
||||
warn_fn, NULL, NULL, NULL));
|
||||
warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
|
||||
}
|
||||
|
||||
/* Alternate initialize png_ptr structure, and allocate any memory needed */
|
||||
@@ -443,14 +443,19 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
int i;
|
||||
png_debug(1, "in png_create_write_struct\n");
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if ((png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
|
||||
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr)) == NULL)
|
||||
png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
|
||||
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
|
||||
#else
|
||||
if ((png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG)) == NULL)
|
||||
png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
{
|
||||
return ((png_structp)NULL);
|
||||
}
|
||||
if (png_ptr == NULL)
|
||||
return (NULL);
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
|
||||
#endif
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
@@ -462,7 +467,7 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf=NULL;
|
||||
png_destroy_struct(png_ptr);
|
||||
return ((png_structp)NULL);
|
||||
return (NULL);
|
||||
}
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf));
|
||||
@@ -492,23 +497,24 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
|
||||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
|
||||
{
|
||||
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
||||
char msg[80];
|
||||
if (user_png_ver)
|
||||
{
|
||||
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
|
||||
user_png_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
sprintf(msg, "Application is running with png.c from libpng-%.20s",
|
||||
png_libpng_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
#endif
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags=0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"Incompatible libpng version in application and library");
|
||||
}
|
||||
|
||||
/* Libpng 1.0.6 was not binary compatible, due to insertion of the
|
||||
info_ptr->free_me member. Libpng-1.0.1 and earlier were not
|
||||
compatible due to insertion of the user transform function. Note
|
||||
to maintainer: this test can be removed from version 1.2.0 and
|
||||
beyond because the previous test would have already rejected it. */
|
||||
|
||||
if (user_png_ver[0] == '1' && user_png_ver[2] == '0' &&
|
||||
(user_png_ver[4] < '2' || user_png_ver[4] == '6') &&
|
||||
user_png_ver[5] == '\0')
|
||||
{
|
||||
png_error(png_ptr,
|
||||
"Application must be recompiled; versions <= 1.0.6 were incompatible");
|
||||
}
|
||||
}
|
||||
|
||||
/* initialize zbuf - compression buffer */
|
||||
@@ -516,11 +522,12 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
|
||||
png_set_write_fn(png_ptr, NULL, NULL, NULL);
|
||||
png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
|
||||
png_flush_ptr_NULL);
|
||||
|
||||
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
|
||||
png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
|
||||
1, NULL, NULL);
|
||||
1, png_doublep_NULL, png_doublep_NULL);
|
||||
#endif
|
||||
|
||||
return ((png_structp)png_ptr);
|
||||
@@ -532,7 +539,7 @@ void PNGAPI
|
||||
png_write_init(png_structp png_ptr)
|
||||
{
|
||||
/* We only come here via pre-1.0.7-compiled applications */
|
||||
png_write_init_2(png_ptr, "1.0.0", 0, 0);
|
||||
png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
||||
}
|
||||
|
||||
#undef png_write_init_2
|
||||
@@ -541,17 +548,39 @@ png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
||||
png_size_t png_struct_size, png_size_t png_info_size)
|
||||
{
|
||||
/* We only come here via pre-1.0.12-compiled applications */
|
||||
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
||||
if(sizeof(png_struct) > png_struct_size || sizeof(png_info) > png_info_size)
|
||||
{
|
||||
char msg[80];
|
||||
png_ptr->warning_fn=NULL;
|
||||
if (user_png_ver)
|
||||
{
|
||||
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
|
||||
user_png_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
sprintf(msg, "Application is running with png.c from libpng-%.20s",
|
||||
png_libpng_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
#endif
|
||||
if(sizeof(png_struct) > png_struct_size)
|
||||
{
|
||||
png_ptr->error_fn=(png_error_ptr)NULL;
|
||||
png_ptr->error_fn=NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags=0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The png struct allocated by the application is too small.");
|
||||
"The png struct allocated by the application for writing is too small.");
|
||||
}
|
||||
if(sizeof(png_info) > png_info_size)
|
||||
{
|
||||
png_ptr->error_fn=(png_error_ptr)NULL;
|
||||
png_ptr->error_fn=NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags=0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The info struct allocated by the application is too small.");
|
||||
"The info struct allocated by the application for writing is too small.");
|
||||
}
|
||||
png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
|
||||
}
|
||||
@@ -573,7 +602,7 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||
#else
|
||||
png_ptr->warning_fn=(png_error_ptr)NULL;
|
||||
png_ptr->warning_fn=NULL;
|
||||
png_warning(png_ptr,
|
||||
"Application uses deprecated png_write_init() and should be recompiled.");
|
||||
break;
|
||||
@@ -598,12 +627,19 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
/* reset all variables to 0 */
|
||||
png_memset(png_ptr, 0, sizeof (png_struct));
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
|
||||
#endif
|
||||
#endif /* PNG_1_0_X */
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* restore jump buffer */
|
||||
png_memcpy(png_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf));
|
||||
#endif
|
||||
|
||||
png_set_write_fn(png_ptr, NULL, NULL, NULL);
|
||||
png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
|
||||
png_flush_ptr_NULL);
|
||||
|
||||
/* initialize zbuf - compression buffer */
|
||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||
@@ -612,7 +648,7 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
|
||||
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
|
||||
png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
|
||||
1, NULL, NULL);
|
||||
1, png_doublep_NULL, png_doublep_NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -674,6 +710,11 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
||||
/* initialize transformations and other stuff if first time */
|
||||
if (png_ptr->row_number == 0 && png_ptr->pass == 0)
|
||||
{
|
||||
/* make sure we wrote the header info */
|
||||
if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
|
||||
png_error(png_ptr,
|
||||
"png_write_info was never called before png_write_row.");
|
||||
|
||||
/* check for transforms that have been set but were defined out */
|
||||
#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||
@@ -912,6 +953,7 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
|
||||
png_ptr = *png_ptr_ptr;
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
free_fn = png_ptr->free_fn;
|
||||
mem_ptr = png_ptr->mem_ptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -937,7 +979,7 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
|
||||
#else
|
||||
png_destroy_struct((png_voidp)info_ptr);
|
||||
#endif
|
||||
*info_ptr_ptr = (png_infop)NULL;
|
||||
*info_ptr_ptr = NULL;
|
||||
}
|
||||
|
||||
if (png_ptr != NULL)
|
||||
@@ -949,7 +991,7 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
*png_ptr_ptr = (png_structp)NULL;
|
||||
*png_ptr_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
|
||||
97
pngwutil.c
97
pngwutil.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* libpng 1.0.12beta1 - May 14, 2001
|
||||
* libpng 1.0.13 - April 15, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ png_save_uint_32(png_bytep buf, png_uint_32 i)
|
||||
buf[3] = (png_byte)(i & 0xff);
|
||||
}
|
||||
|
||||
#if defined(PNG_WRITE_pCAL_SUPPORTED)
|
||||
#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED)
|
||||
/* The png_save_int_32 function assumes integers are stored in two's
|
||||
* complement format. If this isn't the case, then this routine needs to
|
||||
* be modified to write data in two's complement format.
|
||||
@@ -332,7 +332,8 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
||||
/* handle the no-compression case */
|
||||
if (comp->input)
|
||||
{
|
||||
png_write_chunk_data(png_ptr, (png_bytep)comp->input, comp->input_len);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)comp->input,
|
||||
(png_size_t)comp->input_len);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -537,8 +538,7 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
|
||||
|
||||
png_debug(1, "in png_write_PLTE\n");
|
||||
if ((
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED) || \
|
||||
defined(PNG_WRITE_EMPTY_PLTE_PERMITTED)
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
|
||||
#endif
|
||||
num_pal == 0) || num_pal > 256)
|
||||
@@ -608,7 +608,8 @@ png_write_IEND(png_structp png_ptr)
|
||||
PNG_IEND;
|
||||
#endif
|
||||
png_debug(1, "in png_write_IEND\n");
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IEND, NULL, (png_size_t)0);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL,
|
||||
(png_size_t)0);
|
||||
png_ptr->mode |= PNG_HAVE_IEND;
|
||||
}
|
||||
|
||||
@@ -642,7 +643,7 @@ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
|
||||
|
||||
png_debug(1, "in png_write_gAMA\n");
|
||||
/* file_gamma is saved in 1/100,000ths */
|
||||
png_save_uint_32(buf, file_gamma);
|
||||
png_save_uint_32(buf, (png_uint_32)file_gamma);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
|
||||
}
|
||||
#endif
|
||||
@@ -764,7 +765,7 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
|
||||
png_save_uint_16(entrybuf + 6, ep->alpha);
|
||||
png_save_uint_16(entrybuf + 8, ep->frequency);
|
||||
}
|
||||
png_write_chunk_data(png_ptr, entrybuf, entry_size);
|
||||
png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);
|
||||
}
|
||||
#else
|
||||
ep=spalette->entries;
|
||||
@@ -939,32 +940,32 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
png_save_uint_32(buf, white_x);
|
||||
png_save_uint_32(buf + 4, white_y);
|
||||
png_save_uint_32(buf, (png_uint_32)white_x);
|
||||
png_save_uint_32(buf + 4, (png_uint_32)white_y);
|
||||
|
||||
if (red_x > 80000L || red_y > 80000L || red_x + red_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid cHRM fixed red point specified");
|
||||
return;
|
||||
}
|
||||
png_save_uint_32(buf + 8, red_x);
|
||||
png_save_uint_32(buf + 12, red_y);
|
||||
png_save_uint_32(buf + 8, (png_uint_32)red_x);
|
||||
png_save_uint_32(buf + 12, (png_uint_32)red_y);
|
||||
|
||||
if (green_x > 80000L || green_y > 80000L || green_x + green_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid fixed cHRM green point specified");
|
||||
return;
|
||||
}
|
||||
png_save_uint_32(buf + 16, green_x);
|
||||
png_save_uint_32(buf + 20, green_y);
|
||||
png_save_uint_32(buf + 16, (png_uint_32)green_x);
|
||||
png_save_uint_32(buf + 20, (png_uint_32)green_y);
|
||||
|
||||
if (blue_x > 80000L || blue_y > 80000L || blue_x + blue_y > 100000L)
|
||||
{
|
||||
png_warning(png_ptr, "Invalid fixed cHRM blue point specified");
|
||||
return;
|
||||
}
|
||||
png_save_uint_32(buf + 24, blue_x);
|
||||
png_save_uint_32(buf + 28, blue_y);
|
||||
png_save_uint_32(buf + 24, (png_uint_32)blue_x);
|
||||
png_save_uint_32(buf + 28, (png_uint_32)blue_y);
|
||||
|
||||
png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);
|
||||
}
|
||||
@@ -996,6 +997,12 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
else if (color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
/* one 16 bit value */
|
||||
if(tran->gray >= (1 << png_ptr->bit_depth))
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to write tRNS chunk out-of-range for bit_depth");
|
||||
return;
|
||||
}
|
||||
png_save_uint_16(buf, tran->gray);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2);
|
||||
}
|
||||
@@ -1005,6 +1012,12 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
png_save_uint_16(buf, tran->red);
|
||||
png_save_uint_16(buf + 2, tran->green);
|
||||
png_save_uint_16(buf + 4, tran->blue);
|
||||
if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8");
|
||||
return;
|
||||
}
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6);
|
||||
}
|
||||
else
|
||||
@@ -1028,8 +1041,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED) || \
|
||||
defined(PNG_WRITE_EMPTY_PLTE_PERMITTED)
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||
(png_ptr->num_palette ||
|
||||
(!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) &&
|
||||
#endif
|
||||
@@ -1046,10 +1058,22 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
png_save_uint_16(buf, back->red);
|
||||
png_save_uint_16(buf + 2, back->green);
|
||||
png_save_uint_16(buf + 4, back->blue);
|
||||
if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8");
|
||||
return;
|
||||
}
|
||||
png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(back->gray >= (1 << png_ptr->bit_depth))
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring attempt to write bKGD chunk out-of-range for bit_depth");
|
||||
return;
|
||||
}
|
||||
png_save_uint_16(buf, back->gray);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2);
|
||||
}
|
||||
@@ -1325,22 +1349,28 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
|
||||
png_warning(png_ptr, "Empty keyword in iTXt chunk");
|
||||
return;
|
||||
}
|
||||
if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang,
|
||||
&new_lang))==0)
|
||||
if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0)
|
||||
{
|
||||
png_warning(png_ptr, "Empty language field in iTXt chunk");
|
||||
return;
|
||||
new_lang = NULL;
|
||||
lang_len = 0;
|
||||
}
|
||||
lang_key_len = png_strlen(lang_key);
|
||||
text_len = png_strlen(text);
|
||||
|
||||
if (text == NULL || *text == '\0')
|
||||
if (lang_key == NULL)
|
||||
lang_key_len = 0;
|
||||
else
|
||||
lang_key_len = png_strlen(lang_key);
|
||||
|
||||
if (text == NULL)
|
||||
text_len = 0;
|
||||
else
|
||||
text_len = png_strlen(text);
|
||||
|
||||
/* compute the compressed data; do it now for the length */
|
||||
text_len = png_text_compress(png_ptr, text, text_len, compression-2,
|
||||
&comp);
|
||||
|
||||
|
||||
/* make sure we include the compression flag, the compression byte,
|
||||
* and the NULs after the key, lang, and lang_key parts */
|
||||
|
||||
@@ -1370,23 +1400,22 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
|
||||
cbuf[1] = 0;
|
||||
png_write_chunk_data(png_ptr, cbuf, 2);
|
||||
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_lang, lang_len + 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)lang_key, lang_key_len+1);
|
||||
png_write_chunk_data(png_ptr, '\0', 1);
|
||||
|
||||
cbuf[0] = 0;
|
||||
png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), lang_len + 1);
|
||||
png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf), lang_key_len + 1);
|
||||
png_write_compressed_data_out(png_ptr, &comp);
|
||||
|
||||
png_write_chunk_end(png_ptr);
|
||||
png_free(png_ptr, new_key);
|
||||
png_free(png_ptr, new_lang);
|
||||
if (new_lang)
|
||||
png_free(png_ptr, new_lang);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PNG_WRITE_oFFs_SUPPORTED)
|
||||
/* write the oFFs chunk */
|
||||
void /* PRIVATE */
|
||||
png_write_oFFs(png_structp png_ptr, png_uint_32 x_offset,
|
||||
png_uint_32 y_offset,
|
||||
png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
|
||||
int unit_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
@@ -1398,8 +1427,8 @@ png_write_oFFs(png_structp png_ptr, png_uint_32 x_offset,
|
||||
if (unit_type >= PNG_OFFSET_LAST)
|
||||
png_warning(png_ptr, "Unrecognized unit type for oFFs chunk");
|
||||
|
||||
png_save_uint_32(buf, x_offset);
|
||||
png_save_uint_32(buf + 4, y_offset);
|
||||
png_save_int_32(buf, x_offset);
|
||||
png_save_int_32(buf + 4, y_offset);
|
||||
buf[8] = (png_byte)unit_type;
|
||||
|
||||
png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Microsoft Developer Studio Build File, Format Version 6.00 for
|
||||
libpng 1.0.12beta1 (May 14, 2001) and zlib
|
||||
libpng 1.0.13 (April 15, 2002) and zlib
|
||||
|
||||
Copyright (C) 2000 Simon-Pierre Cadieux
|
||||
For conditions of distribution and use, see copyright notice in png.h
|
||||
@@ -24,12 +24,12 @@ To build:
|
||||
This project will build the PNG Development Group's "official" versions of
|
||||
libpng and zlib libraries:
|
||||
|
||||
libpng2.dll (default version, currently C code only)
|
||||
libpng2.dll (C + Assembler version)
|
||||
libpng2.dll (C + Assembler debug version)
|
||||
libpng2.dll (C code debug version)
|
||||
libpng2[c,e-m].dll (reserved for official versions)
|
||||
libpng2[n-z].dll (available for private versions)
|
||||
libpng10.dll (default version, currently C code only)
|
||||
libpng10.dll (C + Assembler version)
|
||||
libpng10.dll (C + Assembler debug version)
|
||||
libpng10.dll (C code debug version)
|
||||
libpng10[c,e-m].dll (reserved for official versions)
|
||||
libpng10[n-z].dll (available for private versions)
|
||||
zlib.dll (default version, currently C code only)
|
||||
zlibd.dll (debug version)
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng2.dll"
|
||||
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng10.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
||||
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng2d.dll"
|
||||
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng10d.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM"
|
||||
|
||||
@@ -111,7 +111,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_asm\libpng2a.dll"
|
||||
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_asm\libpng10a.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM"
|
||||
@@ -139,7 +139,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbga\libpng2b.dll"
|
||||
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbga\libpng10b.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ BEGIN
|
||||
VALUE "FileDescription", "PNG image compression library\000"
|
||||
VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000"
|
||||
VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DLLFNAME_POSTFIX " (Windows 32 bit)\000"
|
||||
VALUE "LegalCopyright", "\251 1998-2000 Glenn Randers-Pehrson\000"
|
||||
VALUE "LegalCopyright", "\251 1998-2002 Glenn Randers-Pehrson\000"
|
||||
VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DLLFNAME_POSTFIX ".DLL\000"
|
||||
#ifdef PRIVATEBUILD
|
||||
VALUE "PrivateBuild", PRIVATEBUILD
|
||||
|
||||
@@ -6,7 +6,7 @@ LIBRARY
|
||||
DESCRIPTION "PNG image compression library for Windows"
|
||||
|
||||
EXPORTS
|
||||
;Version 1.0.12beta1
|
||||
;Version 1.0.13
|
||||
png_build_grayscale_palette @1
|
||||
png_check_sig @2
|
||||
png_chunk_error @3
|
||||
@@ -191,7 +191,7 @@ EXPORTS
|
||||
png_write_init_3 @176
|
||||
png_info_init_3 @177
|
||||
png_destroy_struct @178
|
||||
; To be added at version 1.2.0
|
||||
; Added at version 1.2.0
|
||||
; For use with PNG_USER_MEM_SUPPORTED
|
||||
; png_destroy_struct_2 @179
|
||||
; png_create_read_struct_2 @180
|
||||
@@ -211,3 +211,10 @@ EXPORTS
|
||||
; png_init_mmx_flags @192
|
||||
; Strip error numbers
|
||||
; png_set_strip_error_numbers @193
|
||||
; Added at version 1.2.2
|
||||
png_handle_as_unknown @179
|
||||
png_zalloc @180
|
||||
png_zfree @181
|
||||
; png_handle_as_unknown @194
|
||||
; png_zalloc @195
|
||||
; png_zfree @196
|
||||
|
||||
6
projects/netware.txt
Normal file
6
projects/netware.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
A set of project files is available for Netware. Get
|
||||
libpng-1.0.13-project-netware.zip from a libpng distribution
|
||||
site such as http://libpng.sourceforge.net
|
||||
|
||||
Put the zip file in this directory (projects) and then run
|
||||
"unzip -a libpng-1.0.13-project-netware.zip"
|
||||
6
projects/wince.txt
Normal file
6
projects/wince.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
A set of project files is available for WinCE. Get
|
||||
libpng-1.0.13-project-wince.zip from a libpng distribution
|
||||
site such as http://libpng.sourceforge.net
|
||||
|
||||
Put the zip file in this directory (projects) and then run
|
||||
"unzip -a libpng-1.0.13-project-wince.zip"
|
||||
@@ -1,43 +0,0 @@
|
||||
libpng for WindowsCE Rel.1.0
|
||||
============================
|
||||
Copyright (c) 2000 Glenn Randers-Pehrson
|
||||
Copyright (c) 2000 Tenik Co.,Ltd.
|
||||
|
||||
Porting for WindowsCE by Tenik Co.,Ltd.(Kazuo Adachi)
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
This is libpng 1.0.12beta1 ported to WindowsCE 2.0 and 2.11.
|
||||
libpng 1.0.12beta1 is a PNG reference library.
|
||||
See README, a document of original libpng 1.0.12beta1.
|
||||
|
||||
zlib for WindowsCE
|
||||
==================
|
||||
This library requires zlib for WindowsCE. You can use the supplied
|
||||
zlib.diff and zlibce.def files to add WindowsCE support to libpng-1.1.3.
|
||||
|
||||
Copyright notice
|
||||
================
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
See README and LICENSE, documents of original libpng 1.0.12beta1, for conditions
|
||||
of use and distribution.
|
||||
|
||||
Files
|
||||
=====
|
||||
|
||||
READMEE.WCE - this file(in English)
|
||||
READMEJ.WCE - this file(in Japanese)
|
||||
png32ce.def - module definition file to make DLLs
|
||||
|
||||
Sample programs(../../pngtest.c and ../../contrib/*) can build on WindowsCE
|
||||
2.11. WindowsCE 2.0 and below do not support 'console' functions.
|
||||
|
||||
Author
|
||||
======
|
||||
Tenik Co.,Ltd.
|
||||
Kazuo Adachi
|
||||
adachi@tenik.co.jp
|
||||
@@ -1,44 +0,0 @@
|
||||
libpng for WindowsCE Rel.1.0
|
||||
============================
|
||||
Copyright (c) 2000 Glenn Randers-Pehrson
|
||||
Copyright (c) 2000 Tenik Co.,Ltd.
|
||||
|
||||
Porting for WindowsCE by Tenik Co.,Ltd.(Kazuo Adachi)
|
||||
|
||||
|
||||
<EFBFBD>͂<EFBFBD><EFBFBD>߂<EFBFBD>
|
||||
========
|
||||
libpng for WindowsCE<43><45> PNG<4E>`<60><><EFBFBD>̉摜<CC89>f<EFBFBD>[<5B>^<5E><><EFBFBD>C<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD> libpng<6E><67>WindowsCE
|
||||
<EFBFBD>łł<EFBFBD><EFBFBD>Blibpng<EFBFBD>ɂ<EFBFBD><EFBFBD>Ă̏ڂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD>t<EFBFBD><EFBFBD><EFBFBD><EFBFBD> README <20><><EFBFBD><EFBFBD><EFBFBD>ǂ݂<C782><DD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
|
||||
|
||||
zlib for WindowsCE
|
||||
==================
|
||||
libpng<EFBFBD>ł́A<EFBFBD>f<EFBFBD>[<5B>^<5E><><EFBFBD>k<EFBFBD><6B><EFBFBD>C<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> zlib<69><62><EFBFBD>g<EFBFBD>p<EFBFBD><70><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>Blibpng<6E><67>
|
||||
<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>邽<EFBFBD>߂ɂ́A<EFBFBD>ʓr zlib<69><62><EFBFBD>p<EFBFBD>ӂ<EFBFBD><D382><EFBFBD><EFBFBD>K<EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
|
||||
|
||||
<EFBFBD>Ȃ<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>̃p<EFBFBD>b<EFBFBD>P<EFBFBD>[<5B>W<EFBFBD>ŗ<EFBFBD><C597>p<EFBFBD>ł<EFBFBD><C582><EFBFBD> zlib<69>͎<EFBFBD><CD8E>̍쐬<CC8D><EC90AC><EFBFBD><EFBFBD> zlibce.dll<6C>ł<EFBFBD><C582>B
|
||||
|
||||
<EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
========
|
||||
<EFBFBD><EFBFBD><EFBFBD>̃\<5C>t<EFBFBD>g<EFBFBD>E<EFBFBD>F<EFBFBD>A<EFBFBD>͖<EFBFBD><CD96>ۏł<D882><C582>B<EFBFBD><42><EFBFBD>̃\<5C>t<EFBFBD>g<EFBFBD>E<EFBFBD>F<EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŗ<EFBFBD><C597>p<EFBFBD>҂<EFBFBD><D282><EFBFBD><EFBFBD>邱<EFBFBD><E982B1>
|
||||
<EFBFBD>ɂȂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Q<EFBFBD>ɂ<EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>ҁA<EFBFBD>z<EFBFBD>z<EFBFBD>ҁA<EFBFBD><EFBFBD><EFBFBD>̑<EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>҈ȊO<EFBFBD>̐l<EFBFBD><EFBFBD><EFBFBD>A
|
||||
<EFBFBD>c<EFBFBD>̂ɐӔC<EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD>`<60><><EFBFBD>͂Ȃ<CD82><C882><EFBFBD><EFBFBD>̂Ƃ<CC82><C682>܂<EFBFBD><DC82>B
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>̑<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>̃\<5C>t<EFBFBD>g<EFBFBD>E<EFBFBD>F<EFBFBD>A<EFBFBD>̗<EFBFBD><CC97>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>ɂ<C982><C282>ẮA<CD81><41><EFBFBD>łł<C582><C582><EFBFBD> libpng 1.0.12beta1<EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂Ƃ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>ڂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD>t<EFBFBD><EFBFBD><EFBFBD><EFBFBD> README,LICENSE <20><><EFBFBD><EFBFBD><EFBFBD>ǂ݂<C782><DD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>^<5E><><EFBFBD>e
|
||||
========
|
||||
|
||||
READMEJ.WCE - <20><><EFBFBD>̃t<CC83>@<40>C<EFBFBD><43>
|
||||
READMEE.WCE - <20><><EFBFBD>̃t<CC83>@<40>C<EFBFBD><43>(<28>p<EFBFBD><70>)
|
||||
png32ce.def - DLL<4C>쐬<EFBFBD>p <20><><EFBFBD>`<60>t<EFBFBD>@<40>C<EFBFBD><43>
|
||||
|
||||
<EFBFBD>t<EFBFBD><EFBFBD><EFBFBD>T<EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><EFBFBD><EFBFBD>E<EFBFBD>v<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD><EFBFBD><EFBFBD>b<EFBFBD>Z<EFBFBD>[<5B>W<EFBFBD>o<EFBFBD>͂̓s<CC93><73><EFBFBD><EFBFBD><EFBFBD>AWindowsCE 2.11<EFBFBD>ȍ~
|
||||
<EFBFBD>ł̂ݎg<EFBFBD>p<EFBFBD>\<5C>ł<EFBFBD><C582>B
|
||||
|
||||
<EFBFBD>z<EFBFBD>z<EFBFBD><EFBFBD>
|
||||
======
|
||||
<EFBFBD>e<EFBFBD>j<EFBFBD>b<EFBFBD>N<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>J<EFBFBD><4A><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>a<EFBFBD>Y
|
||||
adachi@tenik.co.jp
|
||||
@@ -1,39 +0,0 @@
|
||||
zlib for WindowsCE Rel.1.0
|
||||
==========================
|
||||
(C) 1995-1998 Jean-loup Gailly and Mark Adler
|
||||
(C) 2000 Tenik Co.,Ltd.
|
||||
|
||||
Porting for WindowsCE by Tenik Co.,Ltd.(Kazuo Adachi)
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
This is zlib 1.1.3 ported to WindowsCE 2.0 and 2.11.
|
||||
zlib 1.1.3 is a general purpose data compression library.
|
||||
See README, a document of original zlib 1.1.3.
|
||||
|
||||
Copyright notice
|
||||
================
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
See README, a document of original zlib 1.1.3, for conditions of use and
|
||||
distribution.
|
||||
|
||||
Files
|
||||
=====
|
||||
|
||||
READMEE.WCE - this file(in English)
|
||||
READMEJ.WCE - this file(in Japanese)
|
||||
zlibce.def - module definition file to make DLLs
|
||||
zlibce.diff - patch file for source code
|
||||
|
||||
Sample programs(minigzip.c and example.c) can build on WindowsCE 2.11.
|
||||
WindowsCE 2.0 and below is not support 'console' functions.
|
||||
|
||||
Author
|
||||
======
|
||||
Tenik Co.,Ltd.
|
||||
Kazuo Adachi
|
||||
adachi@tenik.co.jp
|
||||
@@ -1,41 +0,0 @@
|
||||
zlib for WindowsCE Rel.1.0
|
||||
==========================
|
||||
(C) 1995-1998 Jean-loup Gailly and Mark Adler
|
||||
(C) 2000 Tenik Co.,Ltd.
|
||||
|
||||
Porting for WindowsCE by Tenik Co.,Ltd.(Kazuo Adachi)
|
||||
|
||||
|
||||
<EFBFBD>͂<EFBFBD><EFBFBD>߂<EFBFBD>
|
||||
========
|
||||
zlib for WindowsCE<43>͔ėp<C497>̃f<CC83>[<5B>^<5E><><EFBFBD>k<EFBFBD><6B><EFBFBD>C<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD> zlib<69><62> WindowsCE<43>łł<C582><C582>B
|
||||
zlib<EFBFBD>ɂ<EFBFBD><EFBFBD>Ă̏ڂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD>t<EFBFBD><EFBFBD><EFBFBD><EFBFBD> README <20><><EFBFBD><EFBFBD><EFBFBD>ǂ݂<C782><DD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
|
||||
|
||||
<EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
========
|
||||
<EFBFBD><EFBFBD><EFBFBD>̃\<5C>t<EFBFBD>g<EFBFBD>E<EFBFBD>F<EFBFBD>A<EFBFBD>͖<EFBFBD><CD96>ۏł<D882><C582>B<EFBFBD><42><EFBFBD>̃\<5C>t<EFBFBD>g<EFBFBD>E<EFBFBD>F<EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŗ<EFBFBD><C597>p<EFBFBD>҂<EFBFBD><D282><EFBFBD><EFBFBD>邱<EFBFBD><E982B1>
|
||||
<EFBFBD>ɂȂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Q<EFBFBD>ɂ<EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>ҁA<EFBFBD>z<EFBFBD>z<EFBFBD>ҁA<EFBFBD><EFBFBD><EFBFBD>̑<EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>҈ȊO<EFBFBD>̐l<EFBFBD><EFBFBD><EFBFBD>A
|
||||
<EFBFBD>c<EFBFBD>̂ɐӔC<EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD>`<60><><EFBFBD>͂Ȃ<CD82><C882><EFBFBD><EFBFBD>̂Ƃ<CC82><C682>܂<EFBFBD><DC82>B
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>̑<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>̃\<5C>t<EFBFBD>g<EFBFBD>E<EFBFBD>F<EFBFBD>A<EFBFBD>̗<EFBFBD><CC97>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>ɂ<C982><C282>ẮA<CD81><41><EFBFBD>łł<C582><C582><EFBFBD> zlib 1.1.3<EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂Ƃ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>ڂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD>t<EFBFBD><EFBFBD><EFBFBD><EFBFBD> README <20><><EFBFBD><EFBFBD><EFBFBD>ǂ݂<C782><DD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>^<5E><><EFBFBD>e
|
||||
========
|
||||
|
||||
READMEJ.WCE - <20><><EFBFBD>̃t<CC83>@<40>C<EFBFBD><43>
|
||||
READMEE.WCE - <20><><EFBFBD>̃t<CC83>@<40>C<EFBFBD><43>(<28>p<EFBFBD><70>)
|
||||
zlibce.diff - <20>\<5C>[<5B>X<EFBFBD>R<EFBFBD>[<5B>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43>
|
||||
zlibce.def - DLL<4C>쐬<EFBFBD>p <20><><EFBFBD>`<60>t<EFBFBD>@<40>C<EFBFBD><43>
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD> zlib 1.1.3<EFBFBD>Ƃ̍ő<EFBFBD><EFBFBD>̈Ⴂ<EFBFBD>́Agzio.c<>̃R<CC83>[<5B>h<EFBFBD>ł<EFBFBD><C582>BWindowsCE<43>ɂ<EFBFBD>
|
||||
stdio.h(open<65><6E><EFBFBD>̊<CC8A>)<29><><EFBFBD><EFBFBD><EFBFBD>݂<EFBFBD><DD82>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD>߁A<DF81>Ǝ<EFBFBD><C68E><EFBFBD> gziowce.c<><63><EFBFBD>쐬<EFBFBD><EC90AC><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
|
||||
|
||||
minigzip.c<><63> example.c<>̕t<CC95><74><EFBFBD>T<EFBFBD><54><EFBFBD>v<EFBFBD><76><EFBFBD>E<EFBFBD>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>́A<CD81><41><EFBFBD>b<EFBFBD>Z<EFBFBD>[<5B>W<EFBFBD>o<EFBFBD>͂<EFBFBD>
|
||||
<EFBFBD>s<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AWindowsCE 2.11<EFBFBD>ȍ~<7E>ł̂ݎg<DD8E>p<EFBFBD>\<5C>ł<EFBFBD><C582>B
|
||||
|
||||
<EFBFBD>z<EFBFBD>z<EFBFBD><EFBFBD>
|
||||
======
|
||||
<EFBFBD>e<EFBFBD>j<EFBFBD>b<EFBFBD>N<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>J<EFBFBD><4A><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>a<EFBFBD>Y
|
||||
adachi@tenik.co.jp
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "lpngce"=.\lpngce.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name zlibce
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "zlibce"=.\zlibce.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
;------------------------------------------
|
||||
; LIBPNG module definition file for Windows
|
||||
;------------------------------------------
|
||||
|
||||
LIBRARY lpngce
|
||||
|
||||
EXPORTS
|
||||
;Version 1.0.12beta1
|
||||
png_build_grayscale_palette @1
|
||||
png_check_sig @2
|
||||
png_chunk_error @3
|
||||
png_chunk_warning @4
|
||||
; png_convert_from_struct_tm @5
|
||||
; png_convert_from_time_t @6
|
||||
png_create_info_struct @7
|
||||
png_create_read_struct @8
|
||||
png_create_write_struct @9
|
||||
png_data_freer @10
|
||||
png_destroy_info_struct @11
|
||||
png_destroy_read_struct @12
|
||||
png_destroy_write_struct @13
|
||||
png_error @14
|
||||
png_free @15
|
||||
png_free_data @16
|
||||
png_get_IHDR @17
|
||||
png_get_PLTE @18
|
||||
png_get_bKGD @19
|
||||
png_get_bit_depth @20
|
||||
png_get_cHRM @21
|
||||
png_get_cHRM_fixed @22
|
||||
png_get_channels @23
|
||||
png_get_color_type @24
|
||||
png_get_compression_buffer_size @25
|
||||
png_get_compression_type @26
|
||||
png_get_copyright @27
|
||||
png_get_error_ptr @28
|
||||
png_get_filter_type @29
|
||||
png_get_gAMA @30
|
||||
png_get_gAMA_fixed @31
|
||||
png_get_hIST @32
|
||||
png_get_header_ver @33
|
||||
png_get_header_version @34
|
||||
png_get_iCCP @35
|
||||
png_get_image_height @36
|
||||
png_get_image_width @37
|
||||
png_get_interlace_type @38
|
||||
png_get_io_ptr @39
|
||||
png_get_libpng_ver @40
|
||||
png_get_oFFs @41
|
||||
png_get_pCAL @42
|
||||
png_get_pHYs @43
|
||||
png_get_pixel_aspect_ratio @44
|
||||
png_get_pixels_per_meter @45
|
||||
png_get_progressive_ptr @46
|
||||
png_get_rgb_to_gray_status @47
|
||||
png_get_rowbytes @48
|
||||
png_get_rows @49
|
||||
png_get_sBIT @50
|
||||
png_get_sCAL @51
|
||||
png_get_sPLT @52
|
||||
png_get_sRGB @53
|
||||
png_get_signature @54
|
||||
png_get_tIME @55
|
||||
png_get_tRNS @56
|
||||
png_get_text @57
|
||||
png_get_unknown_chunks @58
|
||||
png_get_user_chunk_ptr @59
|
||||
png_get_user_transform_ptr @60
|
||||
png_get_valid @61
|
||||
png_get_x_offset_microns @62
|
||||
png_get_x_offset_pixels @63
|
||||
png_get_x_pixels_per_meter @64
|
||||
png_get_y_offset_microns @65
|
||||
png_get_y_offset_pixels @66
|
||||
png_get_y_pixels_per_meter @67
|
||||
png_malloc @68
|
||||
png_memcpy_check @69
|
||||
png_memset_check @70
|
||||
; png_permit_empty_plte is deprecated
|
||||
png_permit_empty_plte @71
|
||||
png_process_data @72
|
||||
png_progressive_combine_row @73
|
||||
png_read_end @74
|
||||
png_read_image @75
|
||||
png_read_info @76
|
||||
; png_read_init is deprecated
|
||||
png_read_init @77
|
||||
png_read_png @78
|
||||
png_read_row @79
|
||||
png_read_rows @80
|
||||
png_read_update_info @81
|
||||
png_reset_zstream @82
|
||||
png_set_IHDR @83
|
||||
png_set_PLTE @84
|
||||
png_set_bKGD @85
|
||||
png_set_background @86
|
||||
png_set_bgr @87
|
||||
png_set_cHRM @88
|
||||
png_set_cHRM_fixed @89
|
||||
png_set_compression_buffer_size @90
|
||||
png_set_compression_level @91
|
||||
png_set_compression_mem_level @92
|
||||
png_set_compression_method @93
|
||||
png_set_compression_strategy @94
|
||||
png_set_compression_window_bits @95
|
||||
png_set_crc_action @96
|
||||
png_set_dither @97
|
||||
png_set_error_fn @98
|
||||
png_set_expand @99
|
||||
png_set_filler @100
|
||||
png_set_filter @101
|
||||
png_set_filter_heuristics @102
|
||||
png_set_flush @103
|
||||
png_set_gAMA @104
|
||||
png_set_gAMA_fixed @105
|
||||
png_set_gamma @106
|
||||
png_set_gray_1_2_4_to_8 @107
|
||||
png_set_gray_to_rgb @108
|
||||
png_set_hIST @109
|
||||
png_set_iCCP @110
|
||||
png_set_interlace_handling @111
|
||||
png_set_invert_alpha @112
|
||||
png_set_invert_mono @113
|
||||
png_set_keep_unknown_chunks @114
|
||||
png_set_oFFs @115
|
||||
png_set_pCAL @116
|
||||
png_set_pHYs @117
|
||||
png_set_packing @118
|
||||
png_set_packswap @119
|
||||
png_set_palette_to_rgb @120
|
||||
png_set_progressive_read_fn @121
|
||||
png_set_read_fn @122
|
||||
png_set_read_status_fn @123
|
||||
png_set_read_user_chunk_fn @124
|
||||
png_set_read_user_transform_fn @125
|
||||
png_set_rgb_to_gray @126
|
||||
png_set_rgb_to_gray_fixed @127
|
||||
png_set_rows @128
|
||||
png_set_sBIT @129
|
||||
png_set_sCAL @130
|
||||
png_set_sPLT @131
|
||||
png_set_sRGB @132
|
||||
png_set_sRGB_gAMA_and_cHRM @133
|
||||
png_set_shift @134
|
||||
png_set_sig_bytes @135
|
||||
png_set_strip_16 @136
|
||||
png_set_strip_alpha @137
|
||||
png_set_swap @138
|
||||
png_set_swap_alpha @139
|
||||
png_set_tIME @140
|
||||
png_set_tRNS @141
|
||||
png_set_tRNS_to_alpha @142
|
||||
png_set_text @143
|
||||
png_set_unknown_chunk_location @144
|
||||
png_set_unknown_chunks @145
|
||||
png_set_user_transform_info @146
|
||||
png_set_write_fn @147
|
||||
png_set_write_status_fn @148
|
||||
png_set_write_user_transform_fn @149
|
||||
png_sig_cmp @150
|
||||
png_start_read_image @151
|
||||
png_warning @152
|
||||
png_write_chunk @153
|
||||
png_write_chunk_data @154
|
||||
png_write_chunk_end @155
|
||||
png_write_chunk_start @156
|
||||
png_write_end @157
|
||||
png_write_flush @158
|
||||
png_write_image @159
|
||||
png_write_info @160
|
||||
png_write_info_before_PLTE @161
|
||||
; png_write_init is deprecated
|
||||
png_write_init @162
|
||||
png_write_png @163
|
||||
png_write_row @164
|
||||
png_write_rows @165
|
||||
; png_read_init_2 and png_write_init_2 are deprecated.
|
||||
png_read_init_2 @166
|
||||
png_write_init_2 @167
|
||||
png_access_version_number @168
|
||||
; png_sig_bytes @169
|
||||
; png_libpng_ver @170
|
||||
png_init_io @171
|
||||
png_convert_to_rfc1123 @172
|
||||
png_set_invalid @173
|
||||
; Added at version 1.0.12
|
||||
; For compatiblity with 1.0.7-1.0.11
|
||||
png_info_init @174
|
||||
png_read_init_3 @175
|
||||
png_write_init_3 @176
|
||||
png_info_init_3 @177
|
||||
png_destroy_struct @178
|
||||
; To be added at version 1.2.0
|
||||
; For use with PNG_USER_MEM_SUPPORTED
|
||||
; png_destroy_struct_2 @179
|
||||
; png_create_read_struct_2 @180
|
||||
; png_create_write_struct_2 @181
|
||||
; png_malloc_default @182
|
||||
; png_free_default @183
|
||||
; MNG features
|
||||
; png_permit_mng_features @184
|
||||
; MMX support
|
||||
; png_mmx_support @185
|
||||
; png_get_mmx_flagmask @186
|
||||
; png_get_asm_flagmask @187
|
||||
; png_get_asm_flags @188
|
||||
; png_get_mmx_bitdepth_threshold @189
|
||||
; png_get_mmx_rowbytes_threshold @190
|
||||
; png_set_asm_flags @191
|
||||
; png_init_mmx_flags @192
|
||||
; Strip error numbers
|
||||
; png_set_strip_error_numbers @193
|
||||
@@ -1,812 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="pngtest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (WCE x86) Application" 0x8301
|
||||
# TARGTYPE "Win32 (WCE ARM) Application" 0x8501
|
||||
# TARGTYPE "Win32 (WCE PPC) Application" 0x8401
|
||||
# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01
|
||||
# TARGTYPE "Win32 (WCE SH3) Application" 0x8101
|
||||
# TARGTYPE "Win32 (WCE SH4) Application" 0x8601
|
||||
# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201
|
||||
# TARGTYPE "Win32 (WCE MIPSFP) Application" 0x8701
|
||||
|
||||
CFG=pngtest - Win32 (WCE MIPS) Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "pngtest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "pngtest.mak" CFG="pngtest - Win32 (WCE MIPS) Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "pngtest - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE MIPSFP) Release" (based on "Win32 (WCE MIPSFP) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE MIPSFP) Debug" (based on "Win32 (WCE MIPSFP) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE PPC) Release" (based on "Win32 (WCE PPC) Application")
|
||||
!MESSAGE "pngtest - Win32 (WCE PPC) Debug" (based on "Win32 (WCE PPC) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath "H/PC Pro 2.11"
|
||||
# PROP WCE_FormatVersion "6.0"
|
||||
|
||||
!IF "$(CFG)" == "pngtest - Win32 (WCE MIPS) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WMIPSRel"
|
||||
# PROP BASE Intermediate_Dir "WMIPSRel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WMIPSRel"
|
||||
# PROP Intermediate_Dir "WMIPSRel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clmips.exe
|
||||
# ADD BASE CPP /nologo /M$(CECrt) /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /QMRWCE /c
|
||||
# ADD CPP /nologo /M$(CECrt) /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /QMRWCE /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPS) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WMIPSDbg"
|
||||
# PROP BASE Intermediate_Dir "WMIPSDbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WMIPSDbg"
|
||||
# PROP Intermediate_Dir "WMIPSDbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clmips.exe
|
||||
# ADD BASE CPP /nologo /M$(CECrtDebug) /W3 /Zi /Od /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /QMRWCE /c
|
||||
# ADD CPP /nologo /M$(CECrtDebug) /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /QMRWCE /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /debug /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /debug /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH4) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WCESH4Rel"
|
||||
# PROP BASE Intermediate_Dir "WCESH4Rel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WCESH4Rel"
|
||||
# PROP Intermediate_Dir "WCESH4Rel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=shcl.exe
|
||||
# ADD BASE CPP /nologo /Qsh4 /MC /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /Qsh4 /MC /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "SHx" /d "SH4" /d "_SH4_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "SHx" /d "SH4" /d "_SH4_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /machine:SH4 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /machine:SH4 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH4) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WCESH4Dbg"
|
||||
# PROP BASE Intermediate_Dir "WCESH4Dbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WCESH4Dbg"
|
||||
# PROP Intermediate_Dir "WCESH4Dbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=shcl.exe
|
||||
# ADD BASE CPP /nologo /Qsh4 /MC /W3 /Zi /Od /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /Qsh4 /MC /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "SHx" /d "SH4" /d "_SH4_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "SHx" /d "SH4" /d "_SH4_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /debug /machine:SH4 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /debug /machine:SH4 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH3) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WCESH3Rel"
|
||||
# PROP BASE Intermediate_Dir "WCESH3Rel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WCESH3Rel"
|
||||
# PROP Intermediate_Dir "WCESH3Rel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=shcl.exe
|
||||
# ADD BASE CPP /nologo /M$(CECrt) /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /M$(CECrt) /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /machine:SH3 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /machine:SH3 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH3) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WCESH3Dbg"
|
||||
# PROP BASE Intermediate_Dir "WCESH3Dbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WCESH3Dbg"
|
||||
# PROP Intermediate_Dir "WCESH3Dbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=shcl.exe
|
||||
# ADD BASE CPP /nologo /M$(CECrtDebug) /W3 /Zi /Od /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /M$(CECrtDebug) /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /debug /machine:SH3 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /debug /machine:SH3 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE ARM) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WCEARMRel"
|
||||
# PROP BASE Intermediate_Dir "WCEARMRel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WCEARMRel"
|
||||
# PROP Intermediate_Dir "WCEARMRel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clarm.exe
|
||||
# ADD BASE CPP /nologo /MC /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /MC /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "ARM" /D "_ARM_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "ARM" /d "_ARM_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "ARM" /d "_ARM_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 coredll.lib commctrl.lib /nologo /machine:ARM /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 coredll.lib commctrl.lib /nologo /machine:ARM /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE ARM) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WCEARMDbg"
|
||||
# PROP BASE Intermediate_Dir "WCEARMDbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WCEARMDbg"
|
||||
# PROP Intermediate_Dir "WCEARMDbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clarm.exe
|
||||
# ADD BASE CPP /nologo /MC /W3 /Zi /Od /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /MC /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "ARM" /D "_ARM_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "ARM" /d "_ARM_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "ARM" /d "_ARM_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 coredll.lib commctrl.lib /nologo /debug /machine:ARM /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 coredll.lib commctrl.lib /nologo /debug /machine:ARM /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPSFP) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WMIPSFPRel"
|
||||
# PROP BASE Intermediate_Dir "WMIPSFPRel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WMIPSFPRel"
|
||||
# PROP Intermediate_Dir "WMIPSFPRel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clmips.exe
|
||||
# ADD BASE CPP /nologo /QMFWCE /MC /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /QMFWCE /MC /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPSFP) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WMIPSFPDbg"
|
||||
# PROP BASE Intermediate_Dir "WMIPSFPDbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WMIPSFPDbg"
|
||||
# PROP Intermediate_Dir "WMIPSFPDbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clmips.exe
|
||||
# ADD BASE CPP /nologo /QMFWCE /MC /W3 /Zi /Od /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /QMFWCE /MC /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /debug /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /debug /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WCEX86Rel"
|
||||
# PROP BASE Intermediate_Dir "WCEX86Rel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WCEX86Rel"
|
||||
# PROP Intermediate_Dir "WCEX86Rel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /ML /W3 /O2 /D "x86" /D "_i386_" /D "_x86_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "NDEBUG" /D "i_386_" /D "_MBCS" /Gs8192 /GF /c
|
||||
# ADD CPP /nologo /ML /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "x86" /D "_i386_" /D "_x86_" /D "NDEBUG" /D "i_386_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /Gs8192 /GF /c
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "x86" /d "_i386_" /d "_x86_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "x86" /d "_i386_" /d "_x86_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /machine:IX86 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /machine:IX86 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WCEX86Dbg"
|
||||
# PROP BASE Intermediate_Dir "WCEX86Dbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WCEX86Dbg"
|
||||
# PROP Intermediate_Dir "WCEX86Dbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MLd /W3 /Zi /Od /D "x86" /D "_i386_" /D "_x86_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "DEBUG" /D "i_386_" /D "_MBCS" /Gs8192 /GF /c
|
||||
# ADD CPP /nologo /MLd /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "x86" /D "_i386_" /D "_x86_" /D "DEBUG" /D "i_386_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /Gs8192 /GF /c
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "x86" /d "_i386_" /d "_x86_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "x86" /d "_i386_" /d "_x86_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /debug /machine:IX86 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /debug /machine:IX86 /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86em) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "x86emRel"
|
||||
# PROP BASE Intermediate_Dir "x86emRel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x86emRel"
|
||||
# PROP Intermediate_Dir "x86emRel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /ML /W3 /O2 /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "STRICT" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "NDEBUG" /D "x86" /D "i486" /D "_x86_" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /ML /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "_UNICODE" /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "NDEBUG" /D "x86" /D "i486" /D "_x86_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /machine:I386 /nodefaultlib:"$(CENoDefaultLib)" /windowsce:emulation
|
||||
# ADD LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /machine:I386 /nodefaultlib:"$(CENoDefaultLib)" /windowsce:emulation
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86em) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "x86emDbg"
|
||||
# PROP BASE Intermediate_Dir "x86emDbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x86emDbg"
|
||||
# PROP Intermediate_Dir "x86emDbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MLd /W3 /Gm /Zi /Od /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "STRICT" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_DEBUG" /D "x86" /D "i486" /D "_x86_" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /MLd /W3 /Gm /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "_UNICODE" /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_DEBUG" /D "x86" /D "i486" /D "_x86_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "_DEBUG" /d "x86" /d "i486" /d "_x86_"
|
||||
# ADD RSC /l 0x411 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "_DEBUG" /d "x86" /d "i486" /d "_x86_"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /machine:I386 /nodefaultlib:"$(CENoDefaultLib)" /windowsce:emulation
|
||||
# ADD LINK32 $(CEx86Corelibc) commctrl.lib coredll.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /machine:I386 /nodefaultlib:"$(CENoDefaultLib)" /windowsce:emulation
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE PPC) Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "WCEPPCRel"
|
||||
# PROP BASE Intermediate_Dir "WCEPPCRel"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "WCEPPCRel"
|
||||
# PROP Intermediate_Dir "WCEPPCRel"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clppc.exe
|
||||
# ADD BASE CPP /nologo /M$(CECrt) /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "PPC" /D "_PPC_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /M$(CECrt) /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "PPC" /D "_PPC_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "ppc" /d "_ppc_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "NDEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "ppc" /d "_ppc_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "NDEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /machine:PPC /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /machine:PPC /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE PPC) Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "WCEPPCDbg"
|
||||
# PROP BASE Intermediate_Dir "WCEPPCDbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "WCEPPCDbg"
|
||||
# PROP Intermediate_Dir "WCEPPCDbg"
|
||||
# PROP Target_Dir ""
|
||||
CPP=clppc.exe
|
||||
# ADD BASE CPP /nologo /M$(CECrtDebug) /W3 /Zi /Od /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "PPC" /D "_PPC_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /YX /c
|
||||
# ADD CPP /nologo /M$(CECrtDebug) /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "PPC" /D "_PPC_" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_MBCS" /D "PNG_USE_DLL" /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x411 /r /d "ppc" /d "_ppc_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "DEBUG"
|
||||
# ADD RSC /l 0x411 /r /d "ppc" /d "_ppc_" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "DEBUG"
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /debug /machine:PPC /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
|
||||
# ADD LINK32 commctrl.lib coredll.lib /nologo /debug /machine:PPC /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /STACK:65536,4096
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "pngtest - Win32 (WCE MIPS) Release"
|
||||
# Name "pngtest - Win32 (WCE MIPS) Debug"
|
||||
# Name "pngtest - Win32 (WCE SH4) Release"
|
||||
# Name "pngtest - Win32 (WCE SH4) Debug"
|
||||
# Name "pngtest - Win32 (WCE SH3) Release"
|
||||
# Name "pngtest - Win32 (WCE SH3) Debug"
|
||||
# Name "pngtest - Win32 (WCE ARM) Release"
|
||||
# Name "pngtest - Win32 (WCE ARM) Debug"
|
||||
# Name "pngtest - Win32 (WCE MIPSFP) Release"
|
||||
# Name "pngtest - Win32 (WCE MIPSFP) Debug"
|
||||
# Name "pngtest - Win32 (WCE x86) Release"
|
||||
# Name "pngtest - Win32 (WCE x86) Debug"
|
||||
# Name "pngtest - Win32 (WCE x86em) Release"
|
||||
# Name "pngtest - Win32 (WCE x86em) Debug"
|
||||
# Name "pngtest - Win32 (WCE PPC) Release"
|
||||
# Name "pngtest - Win32 (WCE PPC) Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\pngtest.c
|
||||
|
||||
!IF "$(CFG)" == "pngtest - Win32 (WCE MIPS) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPS) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH4) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH4) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH3) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH3) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE ARM) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE ARM) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPSFP) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPSFP) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86em) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86em) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE PPC) Release"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE PPC) Debug"
|
||||
|
||||
DEP_CPP_PNGTE=\
|
||||
"..\..\..\zlib\zconf.h"\
|
||||
"..\..\..\zlib\zlib.h"\
|
||||
"..\..\png.h"\
|
||||
"..\..\pngconf.h"\
|
||||
|
||||
NODEP_CPP_PNGTE=\
|
||||
"..\..\alloc.h"\
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\winmain.c
|
||||
|
||||
!IF "$(CFG)" == "pngtest - Win32 (WCE MIPS) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPS) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH4) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH4) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH3) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE SH3) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE ARM) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE ARM) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPSFP) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE MIPSFP) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86em) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE x86em) Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE PPC) Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 (WCE PPC) Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,59 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "lpngce"=.\lpngce.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name zlibce
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "pngtest"=.\pngtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name lpngce
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "zlibce"=.\zlibce.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
/* winmain.c - a simple entry point for WindowsCE
|
||||
*
|
||||
* Copyright (c) 2000 Tenik Co.,Ltd.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
extern int main(int argc, char *argv[]);
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR lpszCmdLine, int nCmdShow)
|
||||
{
|
||||
#define SIZE_ARGV (32)
|
||||
|
||||
TCHAR path[MAX_PATH];
|
||||
LPTSTR file;
|
||||
char prog[MAX_PATH];
|
||||
int argc;
|
||||
char *argv[SIZE_ARGV];
|
||||
int size;
|
||||
char *buff;
|
||||
char *argp;
|
||||
char *args;
|
||||
char quote;
|
||||
|
||||
// get program name
|
||||
argc = 0;
|
||||
GetModuleFileName(GetCurrentProcess(), path, MAX_PATH);
|
||||
file = _tcsrchr(path, TEXT('\\'));
|
||||
if (NULL == file) {
|
||||
file = path;
|
||||
}
|
||||
else {
|
||||
file++;
|
||||
}
|
||||
WideCharToMultiByte(CP_ACP, 0, file, -1, prog, MAX_PATH, NULL, NULL);
|
||||
argv[argc++] = prog;
|
||||
|
||||
// analyze parameters
|
||||
size = WideCharToMultiByte(CP_ACP, 0, lpszCmdLine, -1, NULL, 0, NULL, NULL);
|
||||
buff = (char *)malloc(size);
|
||||
size = WideCharToMultiByte(CP_ACP, 0, lpszCmdLine, -1, buff, size, NULL, NULL);
|
||||
quote = 0x00;
|
||||
args = argp = buff;
|
||||
if (argp && *argp && size) {
|
||||
argv[argc++] = args;
|
||||
while (*argp) {
|
||||
if (quote) {
|
||||
if (*argp == quote) {
|
||||
argp++;
|
||||
if (*argp != quote) {
|
||||
quote = 0x00;
|
||||
}
|
||||
else {
|
||||
*args++ = *argp++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*args++ = *argp++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (*argp == ' ') {
|
||||
*args++ = *argp++ = '\0';
|
||||
while (*argp && *argp == ' ') {
|
||||
argp++;
|
||||
}
|
||||
if (*argp && argc < SIZE_ARGV) {
|
||||
argv[argc++] = args;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (*argp == '\"') {
|
||||
quote = *argp++;
|
||||
}
|
||||
else {
|
||||
*args++ = *argp++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*args = '\0';
|
||||
return main(argc, argv);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
LIBRARY zlibce.dll
|
||||
|
||||
EXPORTS
|
||||
adler32 @1
|
||||
compress @2
|
||||
crc32 @3
|
||||
deflate @4
|
||||
deflateCopy @5
|
||||
deflateEnd @6
|
||||
deflateInit2_ @7
|
||||
deflateInit_ @8
|
||||
deflateParams @9
|
||||
deflateReset @10
|
||||
deflateSetDictionary @11
|
||||
gzclose @12
|
||||
gzdopen @13
|
||||
gzerror @14
|
||||
gzflush @15
|
||||
gzopen @16
|
||||
gzread @17
|
||||
gzwrite @18
|
||||
inflate @19
|
||||
inflateEnd @20
|
||||
inflateInit2_ @21
|
||||
inflateInit_ @22
|
||||
inflateReset @23
|
||||
inflateSetDictionary @24
|
||||
inflateSync @25
|
||||
uncompress @26
|
||||
zlibVersion @27
|
||||
gzprintf @28
|
||||
gzputc @29
|
||||
gzgetc @30
|
||||
gzseek @31
|
||||
gzrewind @32
|
||||
gztell @33
|
||||
gzeof @34
|
||||
gzsetparams @35
|
||||
zError @36
|
||||
inflateSyncPoint @37
|
||||
get_crc_table @38
|
||||
compress2 @39
|
||||
gzputs @40
|
||||
gzgets @41
|
||||
File diff suppressed because it is too large
Load Diff
11
scripts/libpng.pc.in
Normal file
11
scripts/libpng.pc.in
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
prefix=@PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${exec_prefix}/include
|
||||
|
||||
Name: libpng10
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.0.13
|
||||
Libs: -L${libdir} -lpng10
|
||||
Cflags: -I${includedir}/libpng10
|
||||
147
scripts/makefile.32sunu
Normal file
147
scripts/makefile.32sunu
Normal file
@@ -0,0 +1,147 @@
|
||||
# makefile for libpng on Solaris 2.x with gcc
|
||||
# Contributed by William L. Sebok, based on makefile.linux
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1998 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
CC=cc
|
||||
SUN_CC_FLAGS=-fast -xtarget=ultra
|
||||
SUN_LD_FLAGS=-fast -xtarget=ultra
|
||||
|
||||
# where make install puts libpng.a, libpng10.so and libpng10/png.h
|
||||
prefix=/a
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
# Changing these to ../zlib poses a security risk. If you want
|
||||
# to have zlib in an adjacent directory, specify the full path instead of "..".
|
||||
#ZLIBLIB=../zlib
|
||||
#ZLIBINC=../zlib
|
||||
|
||||
ZLIBLIB=/usr/lib
|
||||
ZLIBINC=/usr/include
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
||||
# $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng10 -lz -lm
|
||||
|
||||
#RANLIB=ranlib
|
||||
RANLIB=echo
|
||||
|
||||
LIBNAME=libpng10
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
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
|
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
@case "`type ld`" in *ucb*) \
|
||||
echo; \
|
||||
echo '## WARNING:'; \
|
||||
echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
|
||||
echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
|
||||
echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
|
||||
echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
|
||||
echo '## at all. If it is, things are likely to break because of'; \
|
||||
echo '## the libucb dependency that is created.'; \
|
||||
echo; \
|
||||
;; \
|
||||
esac
|
||||
$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \
|
||||
-o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* 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.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
147
scripts/makefile.64sunu
Normal file
147
scripts/makefile.64sunu
Normal file
@@ -0,0 +1,147 @@
|
||||
# makefile for libpng on Solaris 2.x with gcc
|
||||
# Contributed by William L. Sebok, based on makefile.linux
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1998 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
CC=cc
|
||||
SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||
SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||
|
||||
# where make install puts libpng.a, libpng10.so and libpng10/png.h
|
||||
prefix=/a
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
# Changing these to ../zlib poses a security risk. If you want
|
||||
# to have zlib in an adjacent directory, specify the full path instead of "..".
|
||||
#ZLIBLIB=../zlib
|
||||
#ZLIBINC=../zlib
|
||||
|
||||
ZLIBLIB=/usr/lib
|
||||
ZLIBINC=/usr/include
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
||||
# $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng10 -lz -lm
|
||||
|
||||
#RANLIB=ranlib
|
||||
RANLIB=echo
|
||||
|
||||
LIBNAME=libpng10
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
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
|
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
@case "`type ld`" in *ucb*) \
|
||||
echo; \
|
||||
echo '## WARNING:'; \
|
||||
echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
|
||||
echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
|
||||
echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
|
||||
echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
|
||||
echo '## at all. If it is, things are likely to break because of'; \
|
||||
echo '## the libucb dependency that is created.'; \
|
||||
echo; \
|
||||
;; \
|
||||
esac
|
||||
$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \
|
||||
-o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* 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.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
@@ -15,10 +15,10 @@ AR = ar rcs
|
||||
RANLIB = ranlib
|
||||
RM = rm -f
|
||||
|
||||
# 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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
prefix=/usr/local
|
||||
@@ -57,13 +57,16 @@ pngtest$(E): pngtest$(O) libpng$(A)
|
||||
|
||||
install: libpng.a
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/libpng ]; then mkdir $(INCPATH)/libpng; fi
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@rm $(INCPATH)/png.h
|
||||
-@rm $(INCPATH)/pngconf.h
|
||||
cp png.h pngconf.h $(INCPATH)/libpng
|
||||
chmod 644 $(INCPATH)/libpng/png.h $(INCPATH)/libpng/pngconf.h
|
||||
cp libpng.a $(LIBPATH)
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a pngtest pngout.png
|
||||
|
||||
png$(O): png.h pngconf.h
|
||||
pngerror$(O): png.h pngconf.h
|
||||
|
||||
@@ -26,8 +26,11 @@ pngtest.ttp: pngtest.o $(LBR)
|
||||
|
||||
install: libpng.a
|
||||
-@mkdir $(prefix)/include
|
||||
-@mkdir $(prefix)/include/libpng
|
||||
-@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
|
||||
-@rm -f $(prefix)/include/png.h
|
||||
-@rm -f $(prefix)/include/pngconf.h
|
||||
cp png.h $(prefix)/include/libpng
|
||||
cp pngconf.h $(prefix)/include/libpng
|
||||
chmod 644 $(prefix)/include/libpng/png.h
|
||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# makefile for libpng on BeOS x86 ELF with gcc
|
||||
# modified from makefile.linux by Sander Stoks
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1999 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
@@ -10,10 +11,10 @@ CC=gcc
|
||||
ZLIBLIB=/usr/local/lib
|
||||
ZLIBINC=/usr/local/include
|
||||
|
||||
# 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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
ALIGN=
|
||||
@@ -29,15 +30,16 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
CFLAGS=-I$(ZLIBINC) -Wall -O1 -funroll-loops \
|
||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
|
||||
LDFLAGS=-L. -Wl,-soname=libpng.so.$(PNGMAJ) -L$(ZLIBLIB) -lz -lm
|
||||
LDFLAGS=-L. -Wl,-soname=$(LIBNAME).so.$(PNGMAJ) -L$(ZLIBLIB) -lz -lm
|
||||
|
||||
RANLIB=ranlib
|
||||
#RANLIB=echo
|
||||
|
||||
# where make install puts libpng.a, libpng.so*, and png.h
|
||||
# where make install puts libpng.a, libpng10.so*, and png.h
|
||||
prefix=/usr/local
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
LIBNAME=libpng10
|
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||
@@ -47,42 +49,70 @@ OBJSDLL = $(OBJS)
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
all: libpng.a libpng.so pngtest
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ)
|
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so
|
||||
cp libpng.so* /boot/home/config/lib
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
cp $(LIBNAME).so* /boot/home/config/lib
|
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -L$(ZLIBLIB) -lz -nostart -Wl,-soname,libpng.so.$(PNGMAJ) -o
|
||||
libpng.so.$(PNGVER) \
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -L$(ZLIBLIB) -lz -nostart -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) -o
|
||||
$(LIBNAME).so.$(PNGVER) \
|
||||
$(OBJSDLL)
|
||||
|
||||
pngtest: pngtest.o libpng.so
|
||||
$(CC) -L$(ZLIBLIB) -lz -lpng -o pngtest pngtest.o
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -L$(ZLIBLIB) -lz -lpng10 -o pngtest pngtest.o
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install: libpng.a libpng.so.$(PNGVER)
|
||||
-@mkdir $(INCPATH) $(LIBPATH)
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
|
||||
(cd $(LIBPATH); ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
|
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so)
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||
pngtest pngout.png
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
# $CFLAGS, and include pnggccrd.o in $OBJS, below.
|
||||
|
||||
CC=gcc
|
||||
ifdef MINGW
|
||||
MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw
|
||||
MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw
|
||||
endif
|
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h
|
||||
prefix=/usr
|
||||
@@ -32,16 +36,13 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
|
||||
#CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
||||
# -fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
||||
CFLAGS=$(MINGW_CCFLAGS) -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
||||
-fomit-frame-pointer
|
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
#PNGDLL = $2# msvc
|
||||
PNGDLL = 2# cygwin 1.0.12beta1
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMIN_BASE = 1.0.12
|
||||
PNGMAJ = 0
|
||||
#PNGDLL = $10
|
||||
PNGMIN = 1.0.13
|
||||
PNGMIN_BASE = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=cygpng$(PNGDLL).dll
|
||||
@@ -51,8 +52,8 @@ SHAREDDEF=libpng.def
|
||||
LIBS=$(SHAREDLIB) $(STATLIB)
|
||||
EXE=.exe
|
||||
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
||||
LDSHARED=gcc -shared -Wl,--enable-auto-image-base
|
||||
LDFLAGS=-L. $(MINGW_LDFLAGS) -L$(ZLIBLIB) -lpng -lz
|
||||
LDSFLAGS=-shared -L. $(MINGW_LDFLAGS) -Wl,--enable-auto-image-base
|
||||
LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(SHAREDDEF)
|
||||
|
||||
RANLIB=ranlib
|
||||
@@ -112,7 +113,7 @@ $(SHAREDDEF): projects/msvc/png32ms.def
|
||||
sed -e 's/\([^;]*\);/;/' > $@
|
||||
|
||||
$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF)
|
||||
$(LDSHARED) -o $@ $(LDEXTRA) $(OBJSDLL) -L. -L$(ZLIBLIB) -lz
|
||||
$(CC) $(LDSFLAGS) -o $@ $(LDEXTRA) $(OBJSDLL) -L. -L$(ZLIBLIB) -lz
|
||||
|
||||
pngtest$(EXE): pngtest.pic.o $(SHAREDLIB)
|
||||
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
|
||||
@@ -147,7 +148,10 @@ install-shared: $(SHAREDLIB) install-headers install-docs install-man
|
||||
install -s -m 755 $(SHAREDLIB) $(BINPATH)
|
||||
|
||||
install-headers:
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir -p $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)]; then mkdir -p $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/libpng ]; then mkdir -p $(INCPATH)/libpng; fi
|
||||
-@rm -f ${INCPATH)/png.h
|
||||
-@rm -f ${INCPATH)/pngconf.h
|
||||
install -m 644 png.h pngconf.h $(INCPATH)
|
||||
|
||||
install-docs:
|
||||
|
||||
134
scripts/makefile.darwin
Normal file
134
scripts/makefile.darwin
Normal file
@@ -0,0 +1,134 @@
|
||||
# makefile for libpng on Darwin / Mac OS X
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2001 Christoph Pfisterer
|
||||
# derived from makefile.linux:
|
||||
# Copyright (C) 1998, 1999 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# where "make install" puts libpng.a, libpng10.dylib, png.h and pngconf.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) -Wall -O3 -funroll-loops
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
||||
|
||||
#RANLIB=echo
|
||||
RANLIB=ranlib
|
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
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
|
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBNAME).dylib pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(LIBNAME).dylib: $(LIBNAME).$(PNGMAJ).dylib
|
||||
ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib
|
||||
|
||||
$(LIBNAME).$(PNGMAJ).dylib: $(LIBNAME).$(PNGVER).dylib
|
||||
ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib
|
||||
|
||||
$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL)
|
||||
$(CC) -dynamiclib \
|
||||
-install_name $(LIBPATH)/$(LIBNAME).$(PNGMAJ).dylib \
|
||||
-current_version $(PNGMIN) -compatibility_version $(PNGMIN) \
|
||||
-o $(LIBNAME).$(PNGVER).dylib \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||
|
||||
pngtest: pngtest.o $(LIBNAME).dylib
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).dylib
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(PNGMAJ)*.dylib
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).dylib
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.dylib
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.2.dylib
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.2.*.dylib
|
||||
cp $(LIBNAME).$(PNGVER).dylib $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).$(PNGVER).dylib
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.dylib; \
|
||||
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.2.dylib; \
|
||||
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.2.$(PNGMIN).dylib; \
|
||||
ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \
|
||||
ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a $(LIBNAME).*dylib 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.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
@@ -14,11 +14,12 @@ LIBPATH=$(prefix)/lib
|
||||
ZLIBLIB=../zlib
|
||||
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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
CC=cc
|
||||
CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1
|
||||
@@ -31,19 +32,19 @@ 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.so libpng.a pngtest
|
||||
all: $(LIBNAME).so libpng.a pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ)
|
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
libpng.so.$(PNGVER): $(OBJS)
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
||||
$(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) -lz -lm
|
||||
|
||||
pngtest: pngtest.o libpng.a
|
||||
@@ -52,23 +53,45 @@ pngtest: pngtest.o libpng.a
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install: libpng.a libpng.so.$(PNGVER)
|
||||
-@mkdir $(INCPATH)
|
||||
-@mkdir $(LIBPATH)
|
||||
cp png.h $(INCPATH)
|
||||
cp pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h
|
||||
chmod 644 $(INCPATH)/pngconf.h
|
||||
cp libpng.a $(LIBPATH)
|
||||
cp libpng.so.$(PNGVER) $(LIBPATH)
|
||||
chmod 644 $(LIBPATH)/libpng.a
|
||||
chmod 644 $(LIBPATH)/libpng.so.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
|
||||
(cd $(LIBPATH); ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
|
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so)
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a pngtest pngout.png libpng.so*
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
93
scripts/makefile.freebsd
Normal file
93
scripts/makefile.freebsd
Normal file
@@ -0,0 +1,93 @@
|
||||
# makefile for libpng under FreeBSD
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov
|
||||
# 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
|
||||
|
||||
PNGMAJ= 5
|
||||
.if (${OBJFORMAT} == "elf")
|
||||
PNGVER= $(PNGMAJ)
|
||||
.else
|
||||
PNGMIN= 0
|
||||
PNGVER= $(PNGMAJ).$(PNGMIN)
|
||||
.endif
|
||||
|
||||
CFLAGS+= -I. -DPNG_USE_PNGGCCRD
|
||||
.if (${MACHINE_ARCH} != "i386")
|
||||
CFLAGS+= -DPNG_NO_ASSEMBLER_CODE
|
||||
.endif
|
||||
LDFLAGS+=-L. -lpng -lz -lm -static
|
||||
|
||||
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 pnggccrd.o
|
||||
|
||||
.SUFFIXES: .c .so .o
|
||||
|
||||
.c.so:
|
||||
${CC} ${CFLAGS} -fPIC -DPIC -o $@ -c $<
|
||||
|
||||
all: libpng.a libpng.so.${PNGVER} pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so.${PNGVER}: $(OBJS:S/o$/so/g)
|
||||
.if (${OBJFORMAT} == "elf")
|
||||
${CC} -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:S/o$/so/g) -lz -lm
|
||||
.else
|
||||
${CC} -shared -Wl,-x -o $@ $(OBJS:S/o$/so/g) -lz -lm
|
||||
.endif
|
||||
|
||||
pngtest: pngtest.o libpng.a
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install: libpng.a libpng.so.${PNGVER}
|
||||
-@mkdir $(prefix)/include/libpng
|
||||
${INSTALL} -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \
|
||||
png.h pngconf.h $(prefix)/include/libpng
|
||||
ln -sf libpng/png.h $(prefix)/include/png.h
|
||||
ln -sf libpng/pngconf.h $(prefix)/include/pngconf.h
|
||||
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
libpng.a libpng.so.${PNGVER} $(prefix)/lib
|
||||
$(RANLIB) $(prefix)/lib/libpng.a
|
||||
ln -sf libpng.so.${PNGVER} $(prefix)/lib/libpng.so
|
||||
/sbin/ldconfig -R
|
||||
${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
libpng.3 libpngpf.3 $(prefix)/man/man3
|
||||
${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
png.5 $(prefix)/man/man5
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a libpng.so libpng.so.${PNGVER} 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
|
||||
pnggccrd.o: png.h pngconf.h
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
# makefile for libpng on Linux ELF with gcc using MMX assembler code
|
||||
# Copyright 1996-1997 Andreas Dilger
|
||||
# makefile for libpng.a and libpng10.so on Linux ELF with gcc using MMX
|
||||
# assembler code
|
||||
# Copyright 2002 Greg Roelofs and Glenn Randers-Pehrson
|
||||
# Copyright 1998-2001 Greg Roelofs
|
||||
# Copyright 1996-1997 Andreas Dilger
|
||||
# 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.
|
||||
|
||||
# WARNING: The assembler code in pnggccrd.c may not be thread safe.
|
||||
|
||||
# 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.
|
||||
|
||||
LIBNAME = libpng10
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
CC=gcc
|
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h
|
||||
# where "make install" puts libpng.a, libpng10/libpng10.so*,
|
||||
# $(LIBNAME)/png.h and $(LIBNAME)/pngconf.h
|
||||
prefix=/usr/local
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
@@ -30,30 +40,26 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||
|
||||
# Remove -DPNG_THREAD_UNSAFE_OK if you need thread safety
|
||||
### for generic gcc:
|
||||
CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
||||
CFLAGS=-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall \
|
||||
-O3 $(ALIGN) -funroll-loops \
|
||||
-fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
### for gcc 2.95.2 on 686:
|
||||
#CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 \
|
||||
#CFLAGS=-DPNG_THREAD_UNSAFE_OK -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 \
|
||||
#CFLAGS=-DPNG_THREAD_UNSAFE_OK -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) -lpng10 -lz -lm
|
||||
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
||||
|
||||
RANLIB=ranlib
|
||||
#RANLIB=echo
|
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
@@ -68,67 +74,84 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a libpng.so pngtest pngtest-static
|
||||
all: libpng.a $(LIBNAME).so pngtest pngtest-static
|
||||
|
||||
pnggccrd.o: pnggccrd.c png.h pngconf.h
|
||||
@echo ""
|
||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
||||
@echo ""
|
||||
$(CC) -c $(CFLAGS) -o $@ $*.c
|
||||
@echo ""
|
||||
|
||||
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h
|
||||
@echo ""
|
||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
||||
@echo ""
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c
|
||||
@echo ""
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
$(LIBNAME).a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ)
|
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) -o $(LIBNAME).so.$(PNGVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc
|
||||
|
||||
pngtest: pngtest.o libpng.so
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
pngtest-static: pngtest.o libpng.a
|
||||
pngtest-static: pngtest.o $(LIBNAME).a
|
||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||
|
||||
test: pngtest pngtest-static
|
||||
@echo ""
|
||||
@echo " Testing dynamically linked version:"
|
||||
@echo " Running pngtest dynamically linked with libpng10.so:"
|
||||
@echo ""
|
||||
./pngtest
|
||||
@echo ""
|
||||
@echo " Testing statically linked version:"
|
||||
@echo " Running pngtest statically linked with libpng.a:"
|
||||
@echo ""
|
||||
./pngtest-static
|
||||
|
||||
install: libpng.a libpng.so.$(PNGVER)
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
|
||||
(cd $(LIBPATH); ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
|
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so)
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||
pngtest pngout.png
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# makefile for libpng on HP-UX using GCC
|
||||
# Copyright (C) 2002, Glenn Randers-Pehrson
|
||||
# Copyright (C) 2001, Laurent faillie
|
||||
# Copyright (C) 1998, 1999 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@@ -31,11 +32,12 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
RANLIB=ranlib
|
||||
#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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
@@ -51,41 +53,69 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a libpng.sl pngtest
|
||||
all: libpng.a $(LIBNAME).sl pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.sl: libpng.sl.$(PNGMAJ)
|
||||
ln -f -s libpng.sl.$(PNGMAJ) libpng.sl
|
||||
$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
|
||||
|
||||
libpng.sl.$(PNGMAJ): libpng.sl.$(PNGVER)
|
||||
ln -f -s libpng.sl.$(PNGVER) libpng.sl.$(PNGMAJ)
|
||||
$(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
|
||||
|
||||
libpng.sl.$(PNGVER): $(OBJSDLL)
|
||||
$(LIBNAME).sl.$(PNGVER): $(OBJSDLL)
|
||||
$(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \
|
||||
+h libpng.sl.$(PNGMAJ) -o libpng.sl.$(PNGVER) $(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o libpng.sl
|
||||
pngtest: pngtest.o $(LIBNAME).sl
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install: libpng.a libpng.sl.$(PNGVER)
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
cp libpng.a libpng.sl.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libpng.sl.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.sl.$(PNGMAJ) $(LIBPATH)/libpng.sl
|
||||
(cd $(LIBPATH); ln -sf libpng.sl.$(PNGVER) libpng.sl.$(PNGMAJ); \
|
||||
ln -sf libpng.sl.$(PNGMAJ) libpng.sl)
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).sl.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).sl.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).sl
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).sl.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).sl.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.2; \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.2.$(PNGMIN); \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
|
||||
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.sl* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(SHAREDLIB).sl $(SHAREDLIB).sl.$(PNGMAJ)* \
|
||||
pngtest pngout.png
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# makefile for libpng, HPUX (10.20 and 11.00)
|
||||
# Copyright (C) 1999, 2000 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1999-2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42
|
||||
# contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
@@ -16,14 +16,17 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
|
||||
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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
# where make install puts libpng.a and png.h
|
||||
# where make install puts libpng.a, libpng10.sl, and png.h
|
||||
prefix=/opt/libpng
|
||||
LIBPATH=$prefix/lib
|
||||
INCPATH=$prefix/include
|
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||
@@ -36,21 +39,22 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) +z -o $@ $*.c
|
||||
|
||||
all: libpng.a libpng.sl pngtest
|
||||
all: libpng.a $(LIBNAME).sl pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.sl: libpng.sl.$(PNGMAJ)
|
||||
ln -f -s libpng.sl.$(PNGMAJ) libpng.sl
|
||||
$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
|
||||
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
|
||||
|
||||
libpng.sl.$(PNGMAJ): libpng.sl.$(PNGVER)
|
||||
ln -f -s libpng.sl.$(PNGVER) libpng.sl.$(PNGMAJ)
|
||||
$(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER)
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
|
||||
|
||||
libpng.sl.$(PNGVER): $(OBJSDLL)
|
||||
$(LIBNAME).sl.$(PNGVER): $(OBJSDLL)
|
||||
$(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \
|
||||
+h libpng.sl.$(PNGMAJ) -o libpng.sl.$(PNGVER) $(OBJSDLL) -lz
|
||||
+h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) \
|
||||
$(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o libpng.a
|
||||
$(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
|
||||
@@ -58,21 +62,46 @@ pngtest: pngtest.o libpng.a
|
||||
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 libpng.sl.$(PNGVER) $(prefix)/lib
|
||||
chmod 644 $(prefix)/lib/libpng.a
|
||||
chmod 755 $(prefix)/lib/libpng.sl.$(PNGVER)
|
||||
(cd $(prefix)/lib; ln -f -s libpng.sl.$(PNGVER) libpng.sl.$(PNGMAJ); \
|
||||
ln -f -s libpng.sl.$(PNGMAJ) libpng.sl)
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).sl.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).sl.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).sl
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.sl
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.sl.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.sl.2.*
|
||||
cp $(LIBNAME).sl.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).sl.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl; \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.2; \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.2.$(PNGMIN); \
|
||||
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
|
||||
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a libpng.sl* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \
|
||||
pngtest pngout.png
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Notes:
|
||||
# Derived from makefile.std
|
||||
# All modules are compiled in C mode
|
||||
# Tested with IBM C 3.6.5 under Win32, expected to work under OS/2 too
|
||||
# Tested under Win32, expected to work under OS/2
|
||||
# Can be easily adapted for IBM VisualAge/C++ for AIX
|
||||
|
||||
# Location of the zlib library and include files
|
||||
@@ -18,7 +18,7 @@ LD = ilink
|
||||
AR = ilib
|
||||
RM = del
|
||||
|
||||
CFLAGS = -I$(ZLIBINC) -O2 -W3
|
||||
CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3
|
||||
LDFLAGS =
|
||||
|
||||
# File extensions
|
||||
|
||||
@@ -47,11 +47,14 @@ test: pngtest
|
||||
|
||||
install: libpng.a
|
||||
-@mkdir $(prefix)/include
|
||||
-@mkdir $(prefix)/include/libpng
|
||||
-@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
|
||||
-@rm -f $(prefix)/include/png.h
|
||||
-@rm -f $(prefix)/include/pngconf.h
|
||||
cp png.h $(prefix)/include/libpng
|
||||
cp pngconf.h $(prefix)/include/libpng
|
||||
chmod 644 $(prefix)/include/libpng/png.h
|
||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
||||
cp libpng.a $(prefix)/lib
|
||||
chmod 644 $(prefix)/lib/libpng.a
|
||||
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
# makefile for libpng on Linux ELF with gcc
|
||||
# Copyright (C) 1998, 1999 Greg Roelofs
|
||||
# makefile for libpng.a and libpng10.so on Linux ELF with gcc
|
||||
# Copyright (C) 1998, 1999, 2002 Greg Roelofs and Glenn Randers-Pehrson
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
LIBNAME = libpng10
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
CC=gcc
|
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, png.h and pngconf.h
|
||||
# where "make install" puts libpng.a, libpng10/libpng10.so*,
|
||||
# libpng10/png.h and libpng10/pngconf.h
|
||||
prefix=/usr/local
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
@@ -26,17 +32,13 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
|
||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \
|
||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
|
||||
|
||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng10 -lz -lm
|
||||
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
||||
|
||||
RANLIB=ranlib
|
||||
#RANLIB=echo
|
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
@@ -51,41 +53,80 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a libpng.so pngtest
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ)
|
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
|
||||
-o $(LIBNAME).so.$(PNGVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc
|
||||
|
||||
pngtest: pngtest.o libpng.so
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
pngtest-static: pngtest.o $(LIBNAME).a
|
||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||
|
||||
install: libpng.a libpng.so.$(PNGVER)
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
test: pngtest pngtest-static
|
||||
@echo ""
|
||||
@echo " Running pngtest dynamically linked with libpng10.so:"
|
||||
@echo ""
|
||||
./pngtest
|
||||
@echo ""
|
||||
@echo " Running pngtest statically linked with libpng.a:"
|
||||
@echo ""
|
||||
./pngtest-static
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
|
||||
(cd $(LIBPATH); ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
|
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so)
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNMAJ)* \
|
||||
pngtest pngout.png
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
# makefile for libpng, MACOS X
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
# Modified by Karin Kosina <kyrah@sim.no> 20011010:
|
||||
# build shared library (*.dylib)
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# where make install puts libpng.a and png.h
|
||||
@@ -12,8 +15,17 @@ ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
CC=cc
|
||||
CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
|
||||
CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
||||
LDSHARED=cc -lz -dynamiclib -compatibility_version $(VER) -current_version $(VER)
|
||||
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
VER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME=libpng10
|
||||
SHAREDLIB_POSTFIX=dylib
|
||||
LIBPATH=$(prefix)/lib
|
||||
INCPATH=$(prefix)/include
|
||||
|
||||
#RANLIB=echo
|
||||
RANLIB=ranlib
|
||||
@@ -22,30 +34,71 @@ 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
|
||||
all: libpng.a pngtest shared
|
||||
|
||||
shared: $(LIBNAME).$(VER).$(SHAREDLIB_POSTFIX)
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(LIBNAME).$(VER).$(SHAREDLIB_POSTFIX): $(OBJS)
|
||||
$(LDSHARED) -o $@ $(OBJS)
|
||||
|
||||
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
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(PNGMAJ)*.$(SHAREDLIB_POSTFIX)
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
||||
-@/bin/rm -f libpng.$(SHARED_POSTFIX)
|
||||
-@/bin/rm -f libpng.2.$(SHARED_POSTFIX)
|
||||
-@/bin/rm -f libpng.2.*.$(SHARED_POSTFIX)
|
||||
cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) ]
|
||||
libpng.$(SHARED_POSTFIX); \
|
||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) ]
|
||||
libpng.2.$(SHARED_POSTFIX); \
|
||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) ]
|
||||
libpng.2.$(PNGMIN).$(SHARED_POSTFIX); \
|
||||
ln -sf $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
||||
$(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \
|
||||
ln -sf $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \
|
||||
$(LIBNAME).$(SHAREDLIB_POSTFIX))
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-shared
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a pngtest pngout.png
|
||||
rm -f *.o libpng.a pngtest pngout.png \
|
||||
$(LIBNAME).$(VER).$(SHAREDLIB_POSTFIX) \
|
||||
$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
@@ -31,11 +31,14 @@ test: pngtest
|
||||
|
||||
install: libpng.a
|
||||
-@mkdir $(prefix)/include
|
||||
-@mkdir $(prefix)/include/libpng
|
||||
-@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
|
||||
-@rm -f $(prefix)/include/png.h
|
||||
-@rm -f $(prefix)/include/pngconf.h
|
||||
cp png.h $(prefix)/include/libpng
|
||||
cp pngconf.h $(prefix)/include/libpng
|
||||
chmod 644 $(prefix)/include/libpng/png.h
|
||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
||||
cp libpng.a $(prefix)/lib
|
||||
chmod 644 $(prefix)/lib/libpng.a
|
||||
|
||||
|
||||
44
scripts/makefile.ne12bsd
Normal file
44
scripts/makefile.ne12bsd
Normal file
@@ -0,0 +1,44 @@
|
||||
# makefile for libpng for NetBSD for the standard
|
||||
# make obj && make depend && make && make test
|
||||
# make includes && make install
|
||||
# Copyright (C) 2002 Patrick R.L. Welche
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# You should also run makefile.netbsd
|
||||
|
||||
LOCALBASE?=/usr/local
|
||||
LIBDIR= ${LOCALBASE}/lib
|
||||
MANDIR= ${LOCALBASE}/man
|
||||
INCSDIR=${LOCALBASE}/include/libpng10
|
||||
|
||||
LIB= png10
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.0.13
|
||||
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
INCS= png.h pngconf.h
|
||||
MAN= libpng.3 libpngpf.3 png.5
|
||||
|
||||
CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD
|
||||
|
||||
# something like this for mmx assembler, but it core dumps for me at the moment
|
||||
# .if ${MACHINE_ARCH} == "i386"
|
||||
# CPPFLAGS+=-DPNG_THREAD_UNSAFE_OK
|
||||
# MKLINT= no
|
||||
# .else
|
||||
CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE
|
||||
# .endif
|
||||
|
||||
CLEANFILES+=pngtest.o pngtest
|
||||
|
||||
pngtest.o: pngtest.c
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
|
||||
|
||||
pngtest: pngtest.o libpng.a
|
||||
${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm
|
||||
|
||||
test: pngtest
|
||||
cd ${.CURDIR} && ${.OBJDIR}/pngtest
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
@@ -1,31 +1,33 @@
|
||||
# makefile for libpng for NetBSD for the standard
|
||||
# make obj && make depend && make && make test
|
||||
# make includes && make install
|
||||
# Copyright (C) 2001 Patrick R.L. Welche
|
||||
# Copyright (C) 2002 Patrick R.L. Welche
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# You should also run makefile.ne0bsd
|
||||
|
||||
LOCALBASE?=/usr/local
|
||||
LIBDIR= ${LOCALBASE}/lib
|
||||
MANDIR= ${LOCALBASE}/man
|
||||
INCSDIR=${LOCALBASE}/include
|
||||
INCSDIR=${LOCALBASE}/include/libpng
|
||||
|
||||
LIB=png
|
||||
SHLIB_MAJOR= 2
|
||||
SHLIB_MINOR= 1.0.12beta1
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 2
|
||||
SHLIB_MINOR= 1.0.13
|
||||
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
INCS= png.h pngconf.h
|
||||
MAN= libpng.3 libpngpf.3 png.5
|
||||
|
||||
CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD
|
||||
|
||||
CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE
|
||||
# something like this for mmx assembler, but it core dumps for me at the moment
|
||||
# .if ${MACHINE_ARCH} == "i386"
|
||||
# CPPFLAGS+=-DPNG_THREAD_UNSAFE_OK
|
||||
# MKLINT= no
|
||||
# .else
|
||||
# CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE
|
||||
CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE
|
||||
# .endif
|
||||
|
||||
CLEANFILES+=pngtest.o pngtest
|
||||
|
||||
70
scripts/makefile.openbsd
Normal file
70
scripts/makefile.openbsd
Normal file
@@ -0,0 +1,70 @@
|
||||
# makefile for libpng
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
PREFIX?= /usr/local
|
||||
LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.0.13
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
||||
pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
|
||||
pngwio.c pngwrite.c pngwtran.c pngwutil.c
|
||||
|
||||
HDRS= png.h pngconf.h
|
||||
|
||||
CFLAGS+= -Wall
|
||||
CPPFLAGS+= -I${.CURDIR} -DPNG_NO_ASSEMBLER_CODE -DPNG_USE_PNGGCCRD
|
||||
|
||||
NOPROFILE= Yes
|
||||
|
||||
CLEANFILES+= pngtest.o pngtest
|
||||
|
||||
MAN= libpng.3 libpngpf.3 png.5
|
||||
DOCS= ANNOUNCE CHANGES LICENSE README libpng.txt
|
||||
|
||||
pngtest.o: pngtest.c
|
||||
${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
|
||||
|
||||
pngtest: pngtest.o
|
||||
${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
|
||||
|
||||
test: pngtest
|
||||
cd ${.OBJDIR} && env \
|
||||
LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
|
||||
|
||||
beforeinstall:
|
||||
if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
|
||||
${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \
|
||||
fi
|
||||
if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
|
||||
${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
|
||||
fi
|
||||
if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
|
||||
${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
|
||||
fi
|
||||
if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
|
||||
${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
|
||||
fi
|
||||
if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
|
||||
${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
|
||||
fi
|
||||
if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
|
||||
${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
|
||||
fi
|
||||
|
||||
afterinstall:
|
||||
@rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
|
||||
@rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
|
||||
@rm -f ${DESTDIR}${PREFIX}/include/png.h
|
||||
@rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
|
||||
@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
|
||||
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||
-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
|
||||
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||
-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
@@ -22,13 +22,14 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
#RANLIB=ranlib
|
||||
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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
INCPATH=$(prefix)/include/libpng
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||
@@ -42,40 +43,70 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a libpng.so pngtest
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ)
|
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -G -Wl,-h,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
$(CC) -G -Wl,-h,$(LIBNAME).so.$(PNGMAJ) -o $(LIBNAME).so.$(PNGVER) \
|
||||
$(OBJSDLL)
|
||||
|
||||
pngtest: pngtest.o libpng.so
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install: libpng.a libpng.so.$(PNGVER)
|
||||
-@mkdir $(INCPATH) $(LIBPATH)
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
|
||||
(cd $(LIBPATH); ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
|
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so)
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
-@/bin/rm -f $(INCPATH)/png.h
|
||||
-@/bin/rm -f $(INCPATH)/pngconf.h
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# makefile for libpng, SGI IRIX with gcc
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
@@ -11,18 +12,24 @@ ZLIBINC=/usr/local/include
|
||||
#ZLIBLIB=../zlib
|
||||
#ZLIBINC=../zlib
|
||||
|
||||
# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
|
||||
# See "man abi". zlib must be built with the same ABI.
|
||||
ABI=
|
||||
|
||||
CC=gcc
|
||||
|
||||
WARNMORE= # -g -DPNG_DEBUG=5
|
||||
CFLAGS=-I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32
|
||||
# zlib must also be compiled with n32
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
LDSHARED=gcc -shared
|
||||
CFLAGS=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32
|
||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
LDSHARED=CC $(ABI) -shared
|
||||
|
||||
VER=1.0.12beta1
|
||||
LIBS=libpng.so.1.0.12beta1
|
||||
SHAREDLIB=libpng.so
|
||||
libdir=$(prefix)/lib32
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
# See "man dso" for info about shared objects
|
||||
LIBS=libpng10.so.$(PNGMAJ).$(PNGVER)
|
||||
LIBNAME=libpng10
|
||||
LIBPATH=$(prefix)/lib32
|
||||
|
||||
RANLIB=echo
|
||||
#RANLIB=ranlib
|
||||
@@ -31,17 +38,17 @@ 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 $(SHAREDLIB).$(VER) pngtest
|
||||
all: libpng.a $(LIBNAME).so.$(PNGVER) pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(SHAREDLIB).$(VER): $(OBJS)
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
||||
$(LDSHARED) -o $@ $(OBJS)
|
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).1
|
||||
ln -s $@ $(SHAREDLIB)
|
||||
ln -s $@ $(SHAREDLIB).1
|
||||
rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -s $@ $(LIBNAME).so
|
||||
ln -s $@ $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
pngtest: pngtest.o libpng.a
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
@@ -49,22 +56,43 @@ pngtest: pngtest.o libpng.a
|
||||
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
|
||||
cp $(SHAREDLIB).$(VER) $(libdir); chmod 755 $(SHAREDLIB).$(VER)
|
||||
(cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
|
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
|
||||
ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
|
||||
ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
|
||||
(ldconfig || true) >/dev/null 2>&1; \
|
||||
fi)
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a pngtest pngout.png
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
# makefile for libpng (.a and .so), SGI IRIX with 'cc'
|
||||
# Copyright (C) 2001 Glenn Randers-Pehrson
|
||||
# makefile for libpng.a and libpng10.so, SGI IRIX with 'cc'
|
||||
# Copyright (C) 2001-2002 Glenn Randers-Pehrson
|
||||
# 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
|
||||
# where make install puts libpng.a, libpng10.so and libpng10/png.h
|
||||
prefix=/usr/local
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
# You can add the -n32 option; then zlib must also be compiled with -n32
|
||||
#ZLIBLIB=/usr/local/lib32
|
||||
#ZLIBINC=/usr/local/include
|
||||
#ZLIBLIB=/usr/local/lib
|
||||
@@ -17,40 +16,48 @@ ZLIBINC=../zlib
|
||||
|
||||
CC=cc
|
||||
|
||||
WARNMORE=-fullwarn
|
||||
# You can add the -n32 option; then zlib must also be compiled with -n32
|
||||
# Note: -KPIC is the default anyhow
|
||||
#CFLAGS=-I$(ZLIBINC) -O $(WARNMORE) -KPIC -DPNG_USE_PNGGCCRD # -g -DPNG_DEBUG=5
|
||||
CFLAGS=-I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
LDSHARED=cc -shared
|
||||
# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
|
||||
# See "man abi". zlib must be built with the same ABI.
|
||||
ABI=
|
||||
|
||||
VER=1.0.12beta1
|
||||
SONUM=2
|
||||
SHAREDLIB=libpng.so
|
||||
libdir=$(prefix)
|
||||
#libdir=$(prefix)/lib32
|
||||
WARNMORE=-fullwarn
|
||||
# Note: -KPIC is the default anyhow
|
||||
#CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC -DPNG_USE_PNGGCCRD # -g -DPNG_DEBUG=5
|
||||
CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE
|
||||
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng10 -lz -lm
|
||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
LDSHARED=cc $(ABI) -shared
|
||||
|
||||
# See "man dso" for info about shared objects
|
||||
LIBNAME=libpng10
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
RANLIB=echo
|
||||
#RANLIB=ranlib
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
#LIBPATH=$(prefix)/lib32
|
||||
|
||||
OBJS = pnggccrd.o 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 shared
|
||||
|
||||
shared: $(SHAREDLIB).$(SONUM).$(VER)
|
||||
shared: $(LIBNAME).so.$(PNGMAJ).$(PNGVER)
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(SHAREDLIB).$(SONUM).$(VER): $(OBJS)
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
||||
$(LDSHARED) -o $@ $(OBJS)
|
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).?
|
||||
ln -s $@ $(SHAREDLIB)
|
||||
ln -s $@ $(SHAREDLIB).$(SONUM)
|
||||
rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -s $@ $(LIBNAME).so
|
||||
ln -s $@ $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
pngtest: pngtest.o libpng.a
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
@@ -58,26 +65,46 @@ pngtest: pngtest.o libpng.a
|
||||
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
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-shared: $(SHAREDLIB).$(SONUM).$(VER)
|
||||
cp $(SHAREDLIB).$(SONUM).$(VER) $(libdir)
|
||||
chmod 755 $(SHAREDLIB).$(SONUM).$(VER)
|
||||
(cd $(libdir)
|
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).$(SONUM)
|
||||
ln -s $(SHAREDLIB).$(SONUM).$(VER) $(SHAREDLIB).$(SONUM)
|
||||
ln -s $(SHAREDLIB).$(SONUM) $(SHAREDLIB))
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
rm -f *.o libpng.a pngtest pngout.png $(SHAREDLIB).*
|
||||
rm -f *.o libpng.a pngtest pngout.png $(LIBNAME).so \
|
||||
$(LIBNAME).so.$(PNGMAJ)*
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
153
scripts/makefile.so9
Normal file
153
scripts/makefile.so9
Normal file
@@ -0,0 +1,153 @@
|
||||
# makefile for libpng on Solaris 9 (beta) with Forte cc
|
||||
# Updated by Chad Schrock for Solaris 9
|
||||
# Contributed by William L. Sebok, based on makefile.linux
|
||||
# Copyright (C) 1998-2001 Greg Roelofs
|
||||
# Copyright (C) 1996-1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# gcc 2.95 doesn't work.
|
||||
CC=cc
|
||||
|
||||
# Where make install puts libpng.a, libpng.so*, and png.h
|
||||
prefix=/usr/local
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
# Changing these to ../zlib poses a security risk. If you want
|
||||
# to have zlib in an adjacent directory, specify the full path instead of "..".
|
||||
#ZLIBLIB=../zlib
|
||||
#ZLIBINC=../zlib
|
||||
#ZLIBLIB=/usr/local/lib
|
||||
#ZLIBINC=/usr/local/include
|
||||
#Use the preinstalled zlib that comes with Solaris 9:
|
||||
ZLIBLIB=/usr/lib
|
||||
ZLIBINC=/usr/include
|
||||
|
||||
#WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
#CFLAGS=-I$(ZLIBINC) -Wall -O3 $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
CFLAGS=-I$(ZLIBINC) -O3
|
||||
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm
|
||||
|
||||
#RANLIB=ranlib
|
||||
RANLIB=echo
|
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
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
|
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
@case "`type ld`" in *ucb*) \
|
||||
echo; \
|
||||
echo '## WARNING:'; \
|
||||
echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
|
||||
echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
|
||||
echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
|
||||
echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
|
||||
echo '## at all. If it is, things are likely to break because of'; \
|
||||
echo '## the libucb dependency that is created.'; \
|
||||
echo; \
|
||||
;; \
|
||||
esac
|
||||
$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \
|
||||
-o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||
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.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
@@ -1,4 +1,5 @@
|
||||
# makefile for libpng on Solaris 2.x with gcc
|
||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||
# Contributed by William L. Sebok, based on makefile.linux
|
||||
# Copyright (C) 1998 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@@ -6,7 +7,7 @@
|
||||
|
||||
CC=gcc
|
||||
|
||||
# Where make install puts libpng.a, libpng.so*, and png.h
|
||||
# Where make install puts libpng.a, libpng10.so*, and png.h
|
||||
prefix=/usr/local
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
@@ -28,11 +29,12 @@ LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm
|
||||
#RANLIB=ranlib
|
||||
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 0. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.12beta1
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.0.13
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng10
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
@@ -48,19 +50,19 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a libpng.so pngtest
|
||||
all: libpng.a $(LIBNAME).so pngtest
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ)
|
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so
|
||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||
@case "`type ld`" in *ucb*) \
|
||||
echo; \
|
||||
echo '## WARNING:'; \
|
||||
@@ -73,27 +75,55 @@ libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
echo; \
|
||||
;; \
|
||||
esac
|
||||
$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.$(PNGMAJ) \
|
||||
-o libpng.so.$(PNGVER) $(OBJSDLL) -lz
|
||||
$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \
|
||||
-o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o libpng.so
|
||||
pngtest: pngtest.o $(LIBNAME).so
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install: libpng.a libpng.so.$(PNGVER)
|
||||
-@mkdir $(INCPATH) $(LIBPATH)
|
||||
cp png.h pngconf.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
|
||||
(cd $(LIBPATH); ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
|
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so)
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
-@/bin/rm -f $(INCPATH)/libpng
|
||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
||||
|
||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2
|
||||
-@/bin/rm -f $(LIBPATH)/libpng.so.2.*
|
||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
||||
(cd $(LIBPATH); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.2.$(PNGMIN); \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so; \
|
||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ))
|
||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
chmod 644 $(LIBPATH)/pkgconfig/libpng10.pc
|
||||
|
||||
install: install-static install-shared
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
|
||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||
pngtest pngout.png
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user