Browse Source
As for other library dependencies, source and binaries are no longer included but must be installed separately. The file layout has changed in one detail: zlib headers are now under XPlatform/zlib rather than XPlatform/zlib/inc. Rather than working around that by moving the headers after the build, I've updated those projects relying on that that I could find, hope it doesn't upset any that are not here. Installation instructions: 1. Download zlib126.zip (or a newer version) from http://www.zlib.net/ , extract the zlib-1.2.6 folder it contains and move/rename it to MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/zlib . 2. Download lpng1510.zip (or a newer version) from http://libpng.org/pub/png/libpng.html , extract the lpng1510 folder it contains and move/rename it to MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/png . 3. Open png/projects/visualc71/libpng.sln in Visual Studio 2003. 4. Select "LIB Debug" from the Solution Configurations popup menu in the toolbar, then Build > Build Solution. 5. Select the "LIB Release" configuration and build the solution. 6. Make a new folder png/lib and move png/projects/visualc71/Win32_LIB_Debug/libpngd.lib as well as png/projects/visualc71/Win32_LIB_Release/libpng.lib into it. 7. Make a new folder zlib/lib and move png/projects/visualc71/Win32_LIB_Debug/ZLib/zlibd.lib as well as png/projects/visualc71/Win32_LIB_Release/ZLib/zlib.lib into it.
Christian Walther
13 years ago
206 changed files with 22 additions and 70113 deletions
@ -1,31 +0,0 @@
|
||||
|
||||
Libpng 1.2.1 - December 12, 2001 |
||||
|
||||
This is a public release of libpng, intended for use in production codes. |
||||
|
||||
Changes since the last public release (1.2.0): |
||||
|
||||
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(). |
||||
Added makefile.so9. |
||||
Removed type casts from all NULLs, except for those appearing in function |
||||
calls when PNG_NO_TYPECAST_NULL is defined. |
||||
Simplified png_create_info_struct() and png_creat_struct_2(). |
||||
Added error message if png_write_info() was omitted. |
||||
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. |
||||
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. |
||||
|
||||
Send comments/corrections/commendations to |
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu |
||||
|
||||
Glenn R-P |
File diff suppressed because it is too large
Load Diff
@ -1,143 +0,0 @@
|
||||
|
||||
Installing libpng version 1.2.1 - December 12, 2001 |
||||
|
||||
Before installing libpng, you must first install zlib. zlib |
||||
can usually be found wherever you got libpng. zlib can be |
||||
placed in another directory, at the same level as libpng. |
||||
Note that your system might already have a preinstalled |
||||
zlib, but you will still need to have access to the |
||||
zlib.h and zconf.h include files that correspond to the |
||||
version of zlib that's installed. |
||||
|
||||
You can rename the directories that you downloaded (they |
||||
might be called "libpng-1.2.1" 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: |
||||
|
||||
.. (the parent directory) |
||||
libpng (this directory) |
||||
INSTALL (this file) |
||||
README |
||||
*.h |
||||
*.c |
||||
contrib |
||||
gregbook |
||||
msvctest |
||||
pngminus |
||||
pngsuite |
||||
visupng |
||||
projects |
||||
beos |
||||
borland |
||||
msvc |
||||
netware.txt |
||||
wince.txt |
||||
scripts |
||||
makefile.* |
||||
pngtest.png |
||||
etc. |
||||
zlib |
||||
README |
||||
*.h |
||||
*.c |
||||
contrib |
||||
etc. |
||||
|
||||
If the line endings in the files look funny, you may wish to get the other |
||||
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 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 |
||||
directory. |
||||
|
||||
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.3.1.2.1) |
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.3.1.2.1, |
||||
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 |
||||
ansi2knr (Requires ansi2knr.c from |
||||
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 |
||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) |
||||
makefile.intel => Intel C/C++ version 4.0 and later |
||||
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.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) |
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.3.1.2.1) |
||||
makefile.sunos => Sun makefile |
||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.3.1.2.1) |
||||
makefile.so9 => Solaris 9 makefile (gcc, creates libpng.so.3.1.2.1) |
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc |
||||
makefile.mips => MIPS makefile |
||||
makefile.acorn => Acorn makefile |
||||
makefile.amiga => Amiga makefile |
||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler |
||||
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc) |
||||
makefile.atari => Atari makefile |
||||
makefile.beos => BEOS makefile for X86 |
||||
makefile.bor => Borland makefile (uses bcc) |
||||
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode) |
||||
makefile.bd32 => To make a png32bd.dll with Borland C++ 4.5 |
||||
makefile.tc3 => Turbo C 3.0 makefile |
||||
makefile.dj2 => DJGPP 2 makefile |
||||
makefile.msc => Microsoft C makefile |
||||
makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and later (uses |
||||
assembler code tuned for Intel MMX platform) |
||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later (does |
||||
not use assembler code) |
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) |
||||
pngos2.def => OS/2 module definition file used by makefile.os2 |
||||
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model |
||||
makevms.com => VMS build script |
||||
descrip.mms => VMS makefile for MMS or MMK |
||||
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5 |
||||
SCOPTIONS.ppc => Used with smakefile.ppc |
||||
|
||||
Copy the file (or files) that you need from the |
||||
scripts directory into this directory, for example |
||||
|
||||
MSDOS example: copy scripts\makefile.msc makefile |
||||
UNIX example: cp scripts/makefile.std makefile |
||||
|
||||
Read the makefile to see if you need to change any source or |
||||
target directories to match your preferences. |
||||
|
||||
Then read pngconf.h to see if you want to make any configuration |
||||
changes. |
||||
|
||||
Then just run "make test" which will create the libpng library in |
||||
this directory and run a quick test that reads the "pngtest.png" |
||||
file and writes a "pngout.png" file that should be identical to it. |
||||
Look for "9782 zero samples" in the output of the test. For more |
||||
confidence, you can run another test by typing "pngtest pngnow.png" |
||||
and looking for "289 zero samples" in the output. Also, you can |
||||
run "pngtest -m *.png" in the "contrib/pngsuite" directory and compare |
||||
your output with the result shown in contrib/pngsuite/README. |
||||
|
||||
Most of the makefiles will allow you to run "make install" to |
||||
put the library in its final resting place (if you want to |
||||
do that, run "make install" in the zlib directory first if necessary). |
||||
|
||||
Further information can be found in the README and libpng.txt |
||||
files, in the individual makefiles, in png.h, in the README files in |
||||
subdirectories of the LIB directory, and the manual pages libpng.3 and png.5. |
@ -1,9 +0,0 @@
|
||||
|
||||
Known bugs in libpng version 1.2.1 |
||||
|
||||
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. The change to pnggccrd.c in libpng-1.2.1 |
||||
fixed a problem under FreeBSD but not the problem with NetBSD. |
||||
|
@ -1,102 +0,0 @@
|
||||
|
||||
This copy of the libpng notices is provided for your convenience. In case of |
||||
any discrepancy between this copy and the notices in the file png.h that is |
||||
included in the libpng distribution, the latter shall prevail. |
||||
|
||||
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.2.1, December 12, 2001, are |
||||
Copyright (c) 2000 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 |
||||
|
||||
Simon-Pierre Cadieux |
||||
Eric S. Raymond |
||||
Gilles Vollant |
||||
|
||||
and with the following additions to the disclaimer: |
||||
|
||||
There is no warranty against interference with your enjoyment of the |
||||
library or against infringement. There is no warranty that our |
||||
efforts or the library will fulfill any of your particular purposes |
||||
or needs. This library is provided with all faults, and the entire |
||||
risk of satisfactory quality, performance, accuracy, and effort is with |
||||
the user. |
||||
|
||||
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are |
||||
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are |
||||
distributed according to the same disclaimer and license as libpng-0.96, |
||||
with the following individuals added to the list of Contributing Authors: |
||||
|
||||
Tom Lane |
||||
Glenn Randers-Pehrson |
||||
Willem van Schaik |
||||
|
||||
libpng versions 0.89, June 1996, through 0.96, May 1997, are |
||||
Copyright (c) 1996, 1997 Andreas Dilger |
||||
Distributed according to the same disclaimer and license as libpng-0.88, |
||||
with the following individuals added to the list of Contributing Authors: |
||||
|
||||
John Bowler |
||||
Kevin Bracey |
||||
Sam Bushell |
||||
Magnus Holmgren |
||||
Greg Roelofs |
||||
Tom Tanner |
||||
|
||||
libpng versions 0.5, May 1995, through 0.88, January 1996, are |
||||
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. |
||||
|
||||
For the purposes of this copyright and license, "Contributing Authors" |
||||
is defined as the following set of individuals: |
||||
|
||||
Andreas Dilger |
||||
Dave Martindale |
||||
Guy Eric Schalnat |
||||
Paul Schmidt |
||||
Tim Wegner |
||||
|
||||
The PNG Reference Library is supplied "AS IS". The Contributing Authors |
||||
and Group 42, Inc. disclaim all warranties, expressed or implied, |
||||
including, without limitation, the warranties of merchantability and of |
||||
fitness for any purpose. The Contributing Authors and Group 42, Inc. |
||||
assume no liability for direct, indirect, incidental, special, exemplary, |
||||
or consequential damages, which may result from the use of the PNG |
||||
Reference Library, even if advised of the possibility of such damage. |
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this |
||||
source code, or portions hereof, for any purpose, without fee, subject |
||||
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. |
||||
|
||||
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 |
||||
supporting the PNG file format in commercial products. If you use this |
||||
source code in a product, acknowledgment is not required but would be |
||||
appreciated. |
||||
|
||||
|
||||
A "png_get_copyright" function is available, for convenient use in "about" |
||||
boxes and the like: |
||||
|
||||
printf("%s",png_get_copyright(NULL)); |
||||
|
||||
Also, the PNG logo (in PNG format, of course) is supplied in the |
||||
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). |
||||
|
||||
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a |
||||
certification mark of the Open Source Initiative. |
||||
|
||||
Glenn Randers-Pehrson |
||||
randeg@alum.rpi.edu |
||||
December 12, 2001 |
@ -1,112 +0,0 @@
|
||||
# makefile for libpng on Linux ELF with gcc
|
||||
# Copyright (C) 1998, 1999 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
CC=gcc
|
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, 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
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||
|
||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5 -DPNG_NO_STDIO -DPNG_STATIC -DALL_STATIC
|
||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
|
||||
|
||||
RANLIB=ranlib
|
||||
#RANLIB=echo
|
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 3
|
||||
PNGMIN = 1.2.1
|
||||
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) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
-cp libpng.a ./lib
|
||||
|
||||
#libpng.so: libpng.so.$(PNGMAJ)
|
||||
# ln -sf libpng.so.$(PNGMAJ) libpng.so
|
||||
#
|
||||
#libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
|
||||
# ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
|
||||
#
|
||||
#libpng.so.$(PNGVER): $(OBJSDLL)
|
||||
# $(CC) -shared -Wl,-soname,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \
|
||||
# $(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc
|
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest |
||||
./pngtest
|
||||
|
||||
#install: libpng.a libpng.so.$(PNGVER)
|
||||
# -@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
||||
# -@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
||||
# cp png.h pngconf.h $(INCPATH)
|
||||
# chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
||||
# cp libpng.a 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)
|
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.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,254 +0,0 @@
|
||||
README for libpng 1.2.1 - December 12, 2001 (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. |
||||
|
||||
Libpng comes in two distribution formats. Get libpng-*.tar.gz if you |
||||
want UNIX-style line endings in the text files, or lpng*.zip if you want |
||||
DOS-style line endings. |
||||
|
||||
Version 0.89 was the first official release of libpng. Don't let the |
||||
fact that it's the first release fool you. The libpng library has been in |
||||
extensive use and testing since mid-1995. By late 1997 it had |
||||
finally gotten to the stage where there hadn't been significant |
||||
changes to the API in some time, and people have a bad feeling about |
||||
libraries with versions < 1.0. Version 1.0.0 was released in |
||||
March 1998. |
||||
|
||||
**** |
||||
Note that some of the changes to the png_info structure render this |
||||
version of the library binary incompatible with libpng-0.89 or |
||||
earlier versions if you are using a shared library. The type of the |
||||
"filler" parameter for png_set_filler() has changed from png_byte to |
||||
png_uint_32, which will affect shared-library applications that use |
||||
this function. |
||||
|
||||
To avoid problems with changes to the internals of png_info_struct, |
||||
new APIs have been made available in 0.95 to avoid direct application |
||||
access to info_ptr. These functions are the png_set_<chunk> and |
||||
png_get_<chunk> functions. These functions should be used when |
||||
accessing/storing the info_struct data, rather than manipulating it |
||||
directly, to avoid such problems in the future. |
||||
|
||||
It is important to note that the APIs do not make current programs |
||||
that access the info struct directly incompatible with the new |
||||
library. However, it is strongly suggested that new programs use |
||||
the new APIs (as shown in example.c and pngtest.c), and older programs |
||||
be converted to the new format, to facilitate upgrades in the future. |
||||
**** |
||||
|
||||
Additions since 0.90 include the ability to compile libpng as a |
||||
Windows DLL, and new APIs for accessing data in the info struct. |
||||
Experimental functions include the ability to set weighting and cost |
||||
factors for row filter selection, direct reads of integers from buffers |
||||
on big-endian processors that support misaligned data access, faster |
||||
methods of doing alpha composition, and more accurate 16->8 bit color |
||||
conversion. |
||||
|
||||
The additions since 0.89 include the ability to read from a PNG stream |
||||
which has had some (or all) of the signature bytes read by the calling |
||||
application. This also allows the reading of embedded PNG streams that |
||||
do not have the PNG file signature. As well, it is now possible to set |
||||
the library action on the detection of chunk CRC errors. It is possible |
||||
to set different actions based on whether the CRC error occurred in a |
||||
critical or an ancillary chunk. |
||||
|
||||
The changes made to the library, and bugs fixed are based on discussions |
||||
on the PNG implementation mailing list <png-implement@ccrc.wustl.edu> |
||||
and not on material submitted privately to Guy, Andreas, or Glenn. They will |
||||
forward any good suggestions to the list. |
||||
|
||||
For a detailed description on using libpng, read libpng.txt. For |
||||
examples of libpng in a program, see example.c and pngtest.c. For usage |
||||
information and restrictions (what little they are) on libpng, see |
||||
png.h. For a description on using zlib (the compression library used by |
||||
libpng) and zlib's restrictions, see zlib.h |
||||
|
||||
I have included a general makefile, as well as several machine and |
||||
compiler specific ones, but you may have to modify one for your own needs. |
||||
|
||||
You should use zlib 1.0.4 or later to run this, but it MAY work with |
||||
versions as old as zlib 0.95. Even so, there are bugs in older zlib |
||||
versions which can cause the output of invalid compression streams for |
||||
some images. You will definitely need zlib 1.0.4 or later if you are |
||||
taking advantage of the MS-DOS "far" structure allocation for the small |
||||
and medium memory models. You should also note that zlib is a |
||||
compression library that is useful for more things than just PNG files. |
||||
You can use zlib as a drop-in replacement for fread() and fwrite() if |
||||
you are so inclined. |
||||
|
||||
zlib should be available at the same place that libpng is. |
||||
If not, it should be at ftp.uu.net in /graphics/png |
||||
Eventually, it will be at ftp.uu.net in /pub/archiving/zip/zlib |
||||
|
||||
You may also want a copy of the PNG specification. It is available |
||||
as an RFC and a W3C Recommendation. Failing |
||||
these resources you can try ftp.uu.net in the /graphics/png directory. |
||||
|
||||
This code is currently being archived at ftp.uu.net in the |
||||
/graphics/png directory, and on CompuServe, Lib 20 (PNG SUPPORT) |
||||
at GO GRAPHSUP. If you can't find it in any of those places, |
||||
e-mail me, and I'll help you find it. |
||||
|
||||
If you have any code changes, requests, problems, etc., please e-mail |
||||
them to me. Also, I'd appreciate any make files or project files, |
||||
and any modifications you needed to make to get libpng to compile, |
||||
along with a #define variable to tell what compiler/system you are on. |
||||
If you needed to add transformations to libpng, or wish libpng would |
||||
provide the image in a different way, drop me a note (and code, if |
||||
possible), so I can consider supporting the transformation. |
||||
Finally, if you get any warning messages when compiling libpng |
||||
(note: not zlib), and they are easy to fix, I'd appreciate the |
||||
fix. Please mention "libpng" somewhere in the subject line. Thanks. |
||||
|
||||
This release was created and will be supported by myself (of course |
||||
based in a large way on Guy's and Andreas' earlier work), and the PNG group. |
||||
|
||||
randeg@alum.rpi.edu |
||||
png-implement@ccrc.wustl.edu |
||||
|
||||
You can't reach Guy, the original libpng author, at the addresses |
||||
given in previous versions of this document. He and Andreas will read mail |
||||
addressed to the png-implement list, however. |
||||
|
||||
Please do not send general questions about PNG. Send them to |
||||
the address in the specification (png-group@w3.org). At the same |
||||
time, please do not send libpng questions to that address, send them to me |
||||
or to png-implement@ccrc.wustl.edu. I'll |
||||
get them in the end anyway. If you have a question about something |
||||
in the PNG specification that is related to using libpng, send it |
||||
to me. Send me any questions that start with "I was using libpng, |
||||
and ...". If in doubt, send questions to me. I'll bounce them |
||||
to others, if necessary. |
||||
|
||||
Please do not send suggestions on how to change PNG. We have |
||||
been discussing PNG for three years now, and it is official and |
||||
finished. If you have suggestions for libpng, however, I'll |
||||
gladly listen. Even if your suggestion is not used for version |
||||
1.0, it may be used later. |
||||
|
||||
Files in this distribution: |
||||
|
||||
ANNOUNCE => Announcement of this version, with recent changes |
||||
CHANGES => Description of changes between libpng versions |
||||
KNOWNBUG => List of known bugs and deficiencies |
||||
LICENSE => License to use and redistribute libpng |
||||
README => This file |
||||
TODO => Things not implemented in the current library |
||||
Y2KINFO => Statement of Y2K compliance |
||||
example.c => Example code for using libpng functions |
||||
libpng.3 => manual page for libpng (includes libpng.txt) |
||||
libpng.txt => Description of libpng and its functions |
||||
libpngpf.3 => manual page for libpng's private functions |
||||
png.5 => manual page for the PNG format |
||||
png.c => Basic interface functions common to library |
||||
png.h => Library function and interface declarations |
||||
pngconf.h => System specific library configuration |
||||
pngasmrd.h => Header file for assembler-coded functions |
||||
pngerror.c => Error/warning message I/O functions |
||||
pngget.c => Functions for retrieving info from struct |
||||
pngmem.c => Memory handling functions |
||||
pngbar.png => PNG logo, 88x31 |
||||
pngnow.png => PNG logo, 98x31 |
||||
pngpread.c => Progressive reading functions |
||||
pngread.c => Read data/helper high-level functions |
||||
pngrio.c => Lowest-level data read I/O functions |
||||
pngrtran.c => Read data transformation functions |
||||
pngrutil.c => Read data utility functions |
||||
pngset.c => Functions for storing data into the info_struct |
||||
pngtest.c => Library test program |
||||
pngtest.png => Library test sample image |
||||
pngtrans.c => Common data transformation functions |
||||
pngwio.c => Lowest-level write I/O functions |
||||
pngwrite.c => High-level write functions |
||||
pngwtran.c => Write data transformations |
||||
pngwutil.c => Write utility functions |
||||
contrib => Contributions |
||||
gregbook => source code for PNG reading and writing, from |
||||
Greg Roelofs' "PNG: The Definitive Guide", |
||||
O'Reilly, 1999 |
||||
msvctest => Builds and runs pngtest using a MSVC workspace |
||||
pngminus => Simple pnm2png and png2pnm programs |
||||
pngsuite => Test images |
||||
visupng => Contains a MSVC workspace for VisualPng |
||||
projects => Contains project files and workspaces for building DLL |
||||
beos => Contains a Beos workspace for building libpng |
||||
borland => Contains a Borland workspace for building libpng |
||||
and zlib |
||||
msvc => Contains a Microsoft Visual C++ (MSVC) workspace |
||||
for building libpng and zlib |
||||
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.3.1.2.1) |
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates |
||||
libpng.so.3.1.2.1, 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 |
||||
ansi2knr (Requires ansi2knr.c from |
||||
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 |
||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) |
||||
makefile.intel => Intel C/C++ version 4.0 and later |
||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later |
||||
makefile.macosx => MACOS X Makefile |
||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD |
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) |
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.3.1.2.1) |
||||
makefile.sunos => Sun makefile |
||||
makefile.solaris => Solaris 2.X makefile |
||||
(gcc, creates libpng.so.3.1.2.1) |
||||
makefile.so9 => Solaris 9 makefile |
||||
(gcc, creates libpng.so.3.1.2.1) |
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc |
||||
makefile.mips => MIPS makefile |
||||
makefile.acorn => Acorn makefile |
||||
makefile.amiga => Amiga makefile |
||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC |
||||
compiler (Requires SCOPTIONS, copied from |
||||
scripts/SCOPTIONS.ppc) |
||||
makefile.atari => Atari makefile |
||||
makefile.beos => BEOS makefile for X86 |
||||
makefile.bor => Borland makefile (uses bcc) |
||||
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode) |
||||
makefile.bd32 => To make a png32bd.dll with Borland C++ 4.5 |
||||
makefile.tc3 => Turbo C 3.0 makefile |
||||
makefile.dj2 => DJGPP 2 makefile |
||||
makefile.msc => Microsoft C makefile |
||||
makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and |
||||
later (uses assembler code tuned for Intel MMX |
||||
platform) |
||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and |
||||
later (does not use assembler code) |
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) |
||||
pngos2.def => OS/2 module definition file used by makefile.os2 |
||||
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model |
||||
makevms.com => VMS build script |
||||
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5 |
||||
SCOPTIONS.ppc => Used with smakefile.ppc |
||||
|
||||
Good luck, and happy coding. |
||||
|
||||
-Glenn Randers-Pehrson |
||||
Internet: randeg@alum.rpi.edu |
||||
|
||||
-Andreas Eric Dilger |
||||
Internet: adilger@enel.ucalgary.ca |
||||
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/ |
||||
|
||||
-Guy Eric Schalnat |
||||
(formerly of Group 42, Inc) |
||||
Internet: gschal@infinet.com |
@ -1,24 +0,0 @@
|
||||
TODO - list of things to do for libpng: |
||||
|
||||
Final bug fixes. |
||||
Improve API by hiding the png_struct and png_info structs. |
||||
Finish work on the no-floating-point version (including gamma compensation) |
||||
Better C++ wrapper/full C++ implementation? |
||||
Fix problem with C++ and EXTERN "C". |
||||
cHRM transformation. |
||||
Improve setjmp/longjmp usage or remove it in favor of returning error codes. |
||||
Add "grayscale->palette" transformation and "palette->grayscale" detection. |
||||
Improved dithering. |
||||
Multi-lingual error and warning message support. |
||||
Complete sRGB transformation (presently it simply uses gamma=0.45455). |
||||
Man pages for function calls. |
||||
Better documentation. |
||||
Better filter selection |
||||
(counting huffman bits/precompression? filter inertia? filter costs?). |
||||
Histogram creation. |
||||
Text conversion between different code pages (Latin-1 -> Mac and DOS). |
||||
Should we always malloc 2^bit_depth PLTE/tRNS/hIST entries for safety? |
||||
Build gamma tables using fixed point (and do away with floating point entirely). |
||||
Use greater precision when changing to linear gamma for compositing against |
||||
background and doing rgb-to-gray transformation. |
||||
Investigate pre-incremented loop counters and other loop constructions. |
@ -1,55 +0,0 @@
|
||||
Y2K compliance in libpng: |
||||
========================= |
||||
|
||||
December 12, 2001 |
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make |
||||
an official declaration. |
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and |
||||
upward through 1.2.1 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 will hold years up to 65535. The other two hold the date in text |
||||
format, and will hold years up to 9999. |
||||
|
||||
The integer is |
||||
"png_uint_16 year" in png_time_struct. |
||||
|
||||
The strings are |
||||
"png_charp time_buffer" in png_struct and |
||||
"near_time_buffer", which is a local character string in png.c. |
||||
|
||||
There are seven time-related functions: |
||||
|
||||
png_convert_to_rfc_1123() in png.c |
||||
(formerly png_convert_to_rfc_1152() in error) |
||||
png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c |
||||
png_convert_from_time_t() in pngwrite.c |
||||
png_get_tIME() in pngget.c |
||||
png_handle_tIME() in pngrutil.c, called in pngread.c |
||||
png_set_tIME() in pngset.c |
||||
png_write_tIME() in pngwutil.c, called in pngwrite.c |
||||
|
||||
All appear to handle dates properly in a Y2K environment. The |
||||
png_convert_from_time_t() function calls gmtime() to convert from system |
||||
clock time, which returns (year - 1900), which we properly convert to |
||||
the full 4-digit year. There is a possibility that applications using |
||||
libpng are not passing 4-digit years into the png_convert_to_rfc_1123() |
||||
function, or that they are incorrectly passing only a 2-digit year |
||||
instead of "year - 1900" into the png_convert_from_struct_tm() function, |
||||
but this is not under our control. The libpng documentation has always |
||||
stated that it works with 4-digit years, and the APIs have been |
||||
documented as such. |
||||
|
||||
The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned |
||||
integer to hold the year, and can hold years as large as 65535. |
||||
|
||||
zlib, upon which libpng depends, is also Y2K compliant. It contains |
||||
no date-related code. |
||||
|
||||
|
||||
Glenn Randers-Pehrson |
||||
libpng maintainer |
||||
PNG Development Group |
@ -1,804 +0,0 @@
|
||||
|
||||
#if 0 /* in case someone actually tries to compile this */
|
||||
|
||||
/* example.c - an example of using libpng */ |
||||
|
||||
/* This is an example of how to use libpng to read and write PNG files.
|
||||
* The file libpng.txt is much more verbose then this. If you have not |
||||
* read it, do so first. This was designed to be a starting point of an |
||||
* implementation. This is not officially part of libpng, is hereby placed |
||||
* in the public domain, and therefore does not require a copyright notice. |
||||
* |
||||
* This file does not currently compile, because it is missing certain |
||||
* parts, like allocating memory to hold an image. You will have to |
||||
* supply these parts to get it to compile. For an example of a minimal |
||||
* working PNG reader/writer, see pngtest.c, included in this distribution; |
||||
* see also the programs in the contrib directory. |
||||
*/ |
||||
|
||||
#include "png.h" |
||||
|
||||
/* The png_jmpbuf() macro, used in error handling, became available in
|
||||
* libpng version 1.0.6. If you want to be able to run your code with older |
||||
* versions of libpng, you must define the macro yourself (but only if it |
||||
* is not already defined by libpng!). |
||||
*/ |
||||
|
||||
#ifndef png_jmpbuf |
||||
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) |
||||
#endif |
||||
|
||||
/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp()
|
||||
* returns zero if the image is a PNG and nonzero if it isn't a PNG. |
||||
* |
||||
* The function check_if_png() shown here, but not used, returns nonzero (true) |
||||
* if the file can be opened and is a PNG, 0 (false) otherwise. |
||||
* |
||||
* If this call is successful, and you are going to keep the file open, |
||||
* you should call png_set_sig_bytes(png_ptr, PNG_BYTES_TO_CHECK); once |
||||
* you have created the png_ptr, so that libpng knows your application |
||||
* has read that many bytes from the start of the file. Make sure you |
||||
* don't call png_set_sig_bytes() with more than 8 bytes read or give it |
||||
* an incorrect number of bytes read, or you will either have read too |
||||
* many bytes (your fault), or you are telling libpng to read the wrong |
||||
* number of magic bytes (also your fault). |
||||
* |
||||
* Many applications already read the first 2 or 4 bytes from the start |
||||
* of the image to determine the file type, so it would be easiest just |
||||
* to pass the bytes to png_sig_cmp() or even skip that if you know |
||||
* you have a PNG file, and call png_set_sig_bytes(). |
||||
*/ |
||||
#define PNG_BYTES_TO_CHECK 4 |
||||
int check_if_png(char *file_name, FILE **fp) |
||||
{ |
||||
char buf[PNG_BYTES_TO_CHECK]; |
||||
|
||||
/* Open the prospective PNG file. */ |
||||
if ((*fp = fopen(file_name, "rb")) == NULL) |
||||
return 0; |
||||
|
||||
/* Read in some of the signature bytes */ |
||||
if (fread(buf, 1, PNG_BYTES_TO_CHECK, *fp) != PNG_BYTES_TO_CHECK) |
||||
return 0; |
||||
|
||||
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature.
|
||||
Return nonzero (true) if they match */ |
||||
|
||||
return(!png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK)); |
||||
} |
||||
|
||||
/* Read a PNG file. You may want to return an error code if the read
|
||||
* fails (depending upon the failure). There are two "prototypes" given |
||||
* here - one where we are given the filename, and we need to open the |
||||
* file, and the other where we are given an open file (possibly with |
||||
* some or all of the magic bytes read - see comments above). |
||||
*/ |
||||
#ifdef open_file /* prototype 1 */ |
||||
void read_png(char *file_name) /* We need to open the file */ |
||||
{ |
||||
png_structp png_ptr; |
||||
png_infop info_ptr; |
||||
unsigned int sig_read = 0; |
||||
png_uint_32 width, height; |
||||
int bit_depth, color_type, interlace_type; |
||||
FILE *fp; |
||||
|
||||
if ((fp = fopen(file_name, "rb")) == NULL) |
||||
return (ERROR); |
||||
#else no_open_file /* prototype 2 */ |
||||
void read_png(FILE *fp, unsigned int sig_read) /* file is already open */ |
||||
{ |
||||
png_structp png_ptr; |
||||
png_infop info_ptr; |
||||
png_uint_32 width, height; |
||||
int bit_depth, color_type, interlace_type; |
||||
#endif no_open_file /* only use one prototype! */ |
||||
|
||||
/* Create and initialize the png_struct with the desired error handler
|
||||
* functions. If you want to use the default stderr and longjump method, |
||||
* you can supply NULL for the last three parameters. We also supply the |
||||
* the compiler header file version, so that we know if the application |
||||
* was compiled with a compatible version of the library. REQUIRED |
||||
*/ |
||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, |
||||
png_voidp user_error_ptr, user_error_fn, user_warning_fn); |
||||
|
||||
if (png_ptr == NULL) |
||||
{ |
||||
fclose(fp); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* Allocate/initialize the memory for image information. REQUIRED. */ |
||||
info_ptr = png_create_info_struct(png_ptr); |
||||
if (info_ptr == NULL) |
||||
{ |
||||
fclose(fp); |
||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* Set error handling if you are using the setjmp/longjmp method (this is
|
||||
* the normal method of doing things with libpng). REQUIRED unless you |
||||
* set up your own error handlers in the png_create_read_struct() earlier. |
||||
*/ |
||||
|
||||
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); |
||||
fclose(fp); |
||||
/* If we get here, we had a problem reading the file */ |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* One of the following I/O initialization methods is REQUIRED */ |
||||
#ifdef streams /* PNG file I/O method 1 */ |
||||
/* Set up the input control if you are using standard C streams */ |
||||
png_init_io(png_ptr, fp); |
||||
|
||||
#else no_streams /* PNG file I/O method 2 */ |
||||
/* If you are using replacement read functions, instead of calling
|
||||
* png_init_io() here you would call: |
||||
*/ |
||||
png_set_read_fn(png_ptr, (void *)user_io_ptr, user_read_fn); |
||||
/* where user_io_ptr is a structure you want available to the callbacks */ |
||||
#endif no_streams /* Use only one I/O method! */ |
||||
|
||||
/* If we have already read some of the signature */ |
||||
png_set_sig_bytes(png_ptr, sig_read); |
||||
|
||||
#ifdef hilevel |
||||
/*
|
||||
* If you have enough memory to read in the entire image at once, |
||||
* and you need to specify only transforms that can be controlled |
||||
* with one of the PNG_TRANSFORM_* bits (this presently excludes |
||||
* dithering, filling, setting background, and doing gamma |
||||
* 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, png_voidp_NULL); |
||||
#else |
||||
/* OK, you're doing it the hard way, with the lower-level functions */ |
||||
|
||||
/* The call to png_read_info() gives us all of the information from the
|
||||
* PNG file before the first IDAT (image data chunk). REQUIRED |
||||
*/ |
||||
png_read_info(png_ptr, info_ptr); |
||||
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, |
||||
&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 |
||||
**** transformations only work on specific types of images, and many |
||||
**** are mutually exclusive. |
||||
****/ |
||||
|
||||
/* tell libpng to strip 16 bit/color files down to 8 bits/color */ |
||||
png_set_strip_16(png_ptr); |
||||
|
||||
/* Strip alpha bytes from the input data without combining with the
|
||||
* background (not recommended). |
||||
*/ |
||||
png_set_strip_alpha(png_ptr); |
||||
|
||||
/* Extract multiple pixels with bit depths of 1, 2, and 4 from a single
|
||||
* byte into separate bytes (useful for paletted and grayscale images). |
||||
*/ |
||||
png_set_packing(png_ptr); |
||||
|
||||
/* Change the order of packed pixels to least significant bit first
|
||||
* (not useful if you are using png_set_packing). */ |
||||
png_set_packswap(png_ptr); |
||||
|
||||
/* Expand paletted colors into true RGB triplets */ |
||||
if (color_type == PNG_COLOR_TYPE_PALETTE) |
||||
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_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_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 |
||||
* for paletted images instead of supplying a palette index. Note that |
||||
* even if the PNG file supplies a background, you are not required to |
||||
* use it - you should use the (solid) application background if it has one. |
||||
*/ |
||||
|
||||
png_color_16 my_background, *image_background; |
||||
|
||||
if (png_get_bKGD(png_ptr, info_ptr, &image_background)) |
||||
png_set_background(png_ptr, image_background, |
||||
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); |
||||
else |
||||
png_set_background(png_ptr, &my_background, |
||||
PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); |
||||
|
||||
/* Some suggestions as to how to get a screen gamma value */ |
||||
|
||||
/* Note that screen gamma is the display_exponent, which includes
|
||||
* the CRT_exponent and any correction for viewing conditions */ |
||||
if (/* We have a user-defined screen gamma value */) |
||||
{ |
||||
screen_gamma = user-defined screen_gamma; |
||||
} |
||||
/* This is one way that applications share the same screen gamma value */ |
||||
else if ((gamma_str = getenv("SCREEN_GAMMA")) != NULL) |
||||
{ |
||||
screen_gamma = atof(gamma_str); |
||||
} |
||||
/* If we don't have another value */ |
||||
else |
||||
{ |
||||
screen_gamma = 2.2; /* A good guess for a PC monitors in a dimly
|
||||
lit room */ |
||||
screen_gamma = 1.7 or 1.0; /* A good guess for Mac systems */ |
||||
} |
||||
|
||||
/* Tell libpng to handle the gamma conversion for you. The final call
|
||||
* is a good guess for PC generated images, but it should be configurable |
||||
* by the user at run time by the user. It is strongly suggested that |
||||
* your application support gamma correction. |
||||
*/ |
||||
|
||||
int intent; |
||||
|
||||
if (png_get_sRGB(png_ptr, info_ptr, &intent)) |
||||
png_set_gamma(png_ptr, screen_gamma, 0.45455); |
||||
else |
||||
{ |
||||
double image_gamma; |
||||
if (png_get_gAMA(png_ptr, info_ptr, &image_gamma)) |
||||
png_set_gamma(png_ptr, screen_gamma, image_gamma); |
||||
else |
||||
png_set_gamma(png_ptr, screen_gamma, 0.45455); |
||||
} |
||||
|
||||
/* Dither RGB files down to 8 bit palette or reduce palettes
|
||||
* to the number of colors available on your screen. |
||||
*/ |
||||
if (color_type & PNG_COLOR_MASK_COLOR) |
||||
{ |
||||
int num_palette; |
||||
png_colorp palette; |
||||
|
||||
/* This reduces the image to the application supplied palette */ |
||||
if (/* we have our own palette */) |
||||
{ |
||||
/* An array of colors to which the image should be dithered */ |
||||
png_color std_color_cube[MAX_SCREEN_COLORS]; |
||||
|
||||
png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS, |
||||
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)) |
||||
{ |
||||
png_uint_16p histogram; |
||||
|
||||
png_get_hIST(png_ptr, info_ptr, &histogram); |
||||
|
||||
png_set_dither(png_ptr, palette, num_palette, |
||||
max_screen_colors, histogram, 0); |
||||
} |
||||
} |
||||
|
||||
/* invert monochrome files to have 0 as white and 1 as black */ |
||||
png_set_invert_mono(png_ptr); |
||||
|
||||
/* If you want to shift the pixel values from the range [0,255] or
|
||||
* [0,65535] to the original [0,7] or [0,31], or whatever range the |
||||
* colors were originally in: |
||||
*/ |
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) |
||||
{ |
||||
png_color_8p sig_bit; |
||||
|
||||
png_get_sBIT(png_ptr, info_ptr, &sig_bit); |
||||
png_set_shift(png_ptr, sig_bit); |
||||
} |
||||
|
||||
/* flip the RGB pixels to BGR (or RGBA to BGRA) */ |
||||
if (color_type & PNG_COLOR_MASK_COLOR) |
||||
png_set_bgr(png_ptr); |
||||
|
||||
/* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */ |
||||
png_set_swap_alpha(png_ptr); |
||||
|
||||
/* swap bytes of 16 bit files to least significant byte first */ |
||||
png_set_swap(png_ptr); |
||||
|
||||
/* Add filler (or alpha) byte (before/after each RGB triplet) */ |
||||
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); |
||||
|
||||
/* Turn on interlace handling. REQUIRED if you are not using
|
||||
* png_read_image(). To see how to handle interlacing passes, |
||||
* see the png_read_row() method below: |
||||
*/ |
||||
number_passes = png_set_interlace_handling(png_ptr); |
||||
|
||||
/* Optional call to gamma correct and add the background to the palette
|
||||
* and update info structure. REQUIRED if you are expecting libpng to |
||||
* update the palette for you (ie you selected such a transform above). |
||||
*/ |
||||
png_read_update_info(png_ptr, info_ptr); |
||||
|
||||
/* Allocate the memory to hold the image using the fields of info_ptr. */ |
||||
|
||||
/* The easiest way to read the image: */ |
||||
png_bytep row_pointers[height]; |
||||
|
||||
for (row = 0; row < height; row++) |
||||
{ |
||||
row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, |
||||
info_ptr)); |
||||
} |
||||
|
||||
/* Now it's time to read the image. One of these methods is REQUIRED */ |
||||
#ifdef entire /* Read the entire image in one go */ |
||||
png_read_image(png_ptr, row_pointers); |
||||
|
||||
#else no_entire /* Read the image one or more scanlines at a time */ |
||||
/* The other way to read images - deal with interlacing: */ |
||||
|
||||
for (pass = 0; pass < number_passes; pass++) |
||||
{ |
||||
#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], 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], png_bytepp_NULL, |
||||
number_of_rows); |
||||
#else no_sparkle /* Read the image using the "rectangle" effect */ |
||||
png_read_rows(png_ptr, png_bytepp_NULL, &row_pointers[y], |
||||
number_of_rows); |
||||
#endif no_sparkle /* use only one of these two methods */ |
||||
} |
||||
|
||||
/* if you want to display the image after every pass, do
|
||||
so here */ |
||||
#endif no_single /* use only one of these two methods */ |
||||
} |
||||
#endif no_entire /* use only one of these two methods */ |
||||
|
||||
/* read rest of file, and get additional chunks in info_ptr - REQUIRED */ |
||||
png_read_end(png_ptr, info_ptr); |
||||
#endif hilevel |
||||
|
||||
/* 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); |
||||
|
||||
/* close the file */ |
||||
fclose(fp); |
||||
|
||||
/* that's it */ |
||||
return (OK); |
||||
} |
||||
|
||||
/* progressively read a file */ |
||||
|
||||
int |
||||
initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr) |
||||
{ |
||||
/* Create and initialize the png_struct with the desired error handler
|
||||
* functions. If you want to use the default stderr and longjump method, |
||||
* you can supply NULL for the last three parameters. We also check that |
||||
* the library version is compatible in case we are using dynamically |
||||
* linked libraries. |
||||
*/ |
||||
*png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, |
||||
png_voidp user_error_ptr, user_error_fn, user_warning_fn); |
||||
|
||||
if (*png_ptr == NULL) |
||||
{ |
||||
*info_ptr = NULL; |
||||
return (ERROR); |
||||
} |
||||
|
||||
*info_ptr = png_create_info_struct(png_ptr); |
||||
|
||||
if (*info_ptr == 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); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* This one's new. You will need to provide all three
|
||||
* function callbacks, even if you aren't using them all. |
||||
* If you aren't using all functions, you can specify NULL |
||||
* parameters. Even when all three functions are NULL, |
||||
* you need to call png_set_progressive_read_fn(). |
||||
* These functions shouldn't be dependent on global or |
||||
* static variables if you are decoding several images |
||||
* simultaneously. You should store stream specific data |
||||
* in a separate struct, given as the second parameter, |
||||
* and retrieve the pointer from inside the callbacks using |
||||
* the function png_get_progressive_ptr(png_ptr). |
||||
*/ |
||||
png_set_progressive_read_fn(*png_ptr, (void *)stream_data, |
||||
info_callback, row_callback, end_callback); |
||||
|
||||
return (OK); |
||||
} |
||||
|
||||
int |
||||
process_data(png_structp *png_ptr, png_infop *info_ptr, |
||||
png_bytep buffer, png_uint_32 length) |
||||
{ |
||||
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); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* This one's new also. Simply give it chunks of data as
|
||||
* they arrive from the data stream (in order, of course). |
||||
* On Segmented machines, don't give it any more than 64K. |
||||
* The library seems to run fine with sizes of 4K, although |
||||
* you can give it much less if necessary (I assume you can |
||||
* give it chunks of 1 byte, but I haven't tried with less |
||||
* than 256 bytes yet). When this function returns, you may |
||||
* want to display any rows that were generated in the row |
||||
* callback, if you aren't already displaying them there. |
||||
*/ |
||||
png_process_data(*png_ptr, *info_ptr, buffer, length); |
||||
return (OK); |
||||
} |
||||
|
||||
info_callback(png_structp png_ptr, png_infop info) |
||||
{ |
||||
/* do any setup here, including setting any of the transformations
|
||||
* mentioned in the Reading PNG files section. For now, you _must_ |
||||
* call either png_start_read_image() or png_read_update_info() |
||||
* after all the transformations are set (even if you don't set |
||||
* any). You may start getting rows before png_process_data() |
||||
* returns, so this is your last chance to prepare for that. |
||||
*/ |
||||
} |
||||
|
||||
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 interlaced, and you turned on the interlace handler, |
||||
* this function will be called for every row in every pass. |
||||
* |
||||
* 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 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); |
||||
|
||||
/* where old_row is what was displayed for previous rows. Note
|
||||
* 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 as new_row, and the function will combine |
||||
* the old row and the new row. |
||||
*/ |
||||
} |
||||
|
||||
end_callback(png_structp png_ptr, png_infop info) |
||||
{ |
||||
/* this function is called when the whole image has been read,
|
||||
* including any chunks after the image (up to and including |
||||
* the IEND). You will usually have the same info chunk as you |
||||
* had in the header, although some data may have been added |
||||
* to the comments and time fields. |
||||
* |
||||
* Most people won't do much here, perhaps setting a flag that |
||||
* marks the image as finished. |
||||
*/ |
||||
} |
||||
|
||||
/* write a png file */ |
||||
void write_png(char *file_name /* , ... other image information ... */) |
||||
{ |
||||
FILE *fp; |
||||
png_structp png_ptr; |
||||
png_infop info_ptr; |
||||
png_colorp palette; |
||||
|
||||
/* open the file */ |
||||
fp = fopen(file_name, "wb"); |
||||
if (fp == NULL) |
||||
return (ERROR); |
||||
|
||||
/* Create and initialize the png_struct with the desired error handler
|
||||
* functions. If you want to use the default stderr and longjump method, |
||||
* you can supply NULL for the last three parameters. We also check that |
||||
* the library version is compatible with the one used at compile time, |
||||
* in case we are using dynamically linked libraries. REQUIRED. |
||||
*/ |
||||
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, |
||||
png_voidp user_error_ptr, user_error_fn, user_warning_fn); |
||||
|
||||
if (png_ptr == NULL) |
||||
{ |
||||
fclose(fp); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* Allocate/initialize the image information data. REQUIRED */ |
||||
info_ptr = png_create_info_struct(png_ptr); |
||||
if (info_ptr == NULL) |
||||
{ |
||||
fclose(fp); |
||||
png_destroy_write_struct(&png_ptr, png_infopp_NULL); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* Set error handling. REQUIRED if you aren't supplying your own
|
||||
* error handling functions in the png_create_write_struct() call. |
||||
*/ |
||||
if (setjmp(png_jmpbuf(png_ptr))) |
||||
{ |
||||
/* If we get here, we had a problem reading the file */ |
||||
fclose(fp); |
||||
png_destroy_write_struct(&png_ptr, &info_ptr); |
||||
return (ERROR); |
||||
} |
||||
|
||||
/* One of the following I/O initialization functions is REQUIRED */ |
||||
#ifdef streams /* I/O initialization method 1 */ |
||||
/* set up the output control if you are using standard C streams */ |
||||
png_init_io(png_ptr, fp); |
||||
#else no_streams /* I/O initialization method 2 */ |
||||
/* If you are using replacement read functions, instead of calling
|
||||
* png_init_io() here you would call */ |
||||
png_set_write_fn(png_ptr, (void *)user_io_ptr, user_write_fn, |
||||
user_IO_flush_function); |
||||
/* where user_io_ptr is a structure you want available to the callbacks */ |
||||
#endif no_streams /* only use one initialization method */ |
||||
|
||||
#ifdef hilevel |
||||
/* This is the easy way. Use it if you already have all the
|
||||
* 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, png_voidp_NULL); |
||||
#else |
||||
/* This is the hard way */ |
||||
|
||||
/* Set the image information here. Width and height are up to 2^31,
|
||||
* bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on |
||||
* the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY, |
||||
* PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, |
||||
* or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or |
||||
* PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST |
||||
* currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED |
||||
*/ |
||||
png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_???, |
||||
PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); |
||||
|
||||
/* set the palette if there is one. REQUIRED for indexed-color images */ |
||||
palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH |
||||
* sizeof (png_color)); |
||||
/* ... set palette colors ... */ |
||||
png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH); |
||||
/* You must not free palette here, because png_set_PLTE only makes a link to
|
||||
the palette that you malloced. Wait until you are about to destroy |
||||
the png structure. */ |
||||
|
||||
/* optional significant bit chunk */ |
||||
/* if we are dealing with a grayscale image then */ |
||||
sig_bit.gray = true_bit_depth; |
||||
/* otherwise, if we are dealing with a color image then */ |
||||
sig_bit.red = true_red_bit_depth; |
||||
sig_bit.green = true_green_bit_depth; |
||||
sig_bit.blue = true_blue_bit_depth; |
||||
/* if the image has an alpha channel then */ |
||||
sig_bit.alpha = true_alpha_bit_depth; |
||||
png_set_sBIT(png_ptr, info_ptr, sig_bit); |
||||
|
||||
|
||||
/* Optional gamma chunk is strongly suggested if you have any guess
|
||||
* as to the correct gamma of the image. |
||||
*/ |
||||
png_set_gAMA(png_ptr, info_ptr, gamma); |
||||
|
||||
/* Optionally write comments into the image */ |
||||
text_ptr[0].key = "Title"; |
||||
text_ptr[0].text = "Mona Lisa"; |
||||
text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; |
||||
text_ptr[1].key = "Author"; |
||||
text_ptr[1].text = "Leonardo DaVinci"; |
||||
text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; |
||||
text_ptr[2].key = "Description"; |
||||
text_ptr[2].text = "<long text>"; |
||||
text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt; |
||||
#ifdef PNG_iTXt_SUPPORTED |
||||
text_ptr[0].lang = NULL; |
||||
text_ptr[1].lang = NULL; |
||||
text_ptr[2].lang = NULL; |
||||
#endif |
||||
png_set_text(png_ptr, info_ptr, text_ptr, 3); |
||||
|
||||
/* other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs, */ |
||||
/* note that if sRGB is present the gAMA and cHRM chunks must be ignored
|
||||
* on read and must be written in accordance with the sRGB profile */ |
||||
|
||||
/* Write the file header information. REQUIRED */ |
||||
png_write_info(png_ptr, info_ptr); |
||||
|
||||
/* If you want, you can write the info in two steps, in case you need to
|
||||
* write your private chunk ahead of PLTE: |
||||
* |
||||
* png_write_info_before_PLTE(write_ptr, write_info_ptr); |
||||
* write_my_chunk(); |
||||
* png_write_info(png_ptr, info_ptr); |
||||
* |
||||
* However, given the level of known- and unknown-chunk support in 1.1.0 |
||||
* and up, this should no longer be necessary. |
||||
*/ |
||||
|
||||
/* Once we write out the header, the compression type on the text
|
||||
* chunks gets changed to PNG_TEXT_COMPRESSION_NONE_WR or |
||||
* PNG_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again |
||||
* at the end. |
||||
*/ |
||||
|
||||
/* set up the transformations you want. Note that these are
|
||||
* all optional. Only call them if you want them. |
||||
*/ |
||||
|
||||
/* invert monochrome pixels */ |
||||
png_set_invert_mono(png_ptr); |
||||
|
||||
/* Shift the pixels up to a legal bit depth and fill in
|
||||
* as appropriate to correctly scale the image. |
||||
*/ |
||||
png_set_shift(png_ptr, &sig_bit); |
||||
|
||||
/* pack pixels into bytes */ |
||||
png_set_packing(png_ptr); |
||||
|
||||
/* swap location of alpha bytes from ARGB to RGBA */ |
||||
png_set_swap_alpha(png_ptr); |
||||
|
||||
/* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into
|
||||
* RGB (4 channels -> 3 channels). The second parameter is not used. |
||||
*/ |
||||
png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); |
||||
|
||||
/* flip BGR pixels to RGB */ |
||||
png_set_bgr(png_ptr); |
||||
|
||||
/* swap bytes of 16-bit files to most significant byte first */ |
||||
png_set_swap(png_ptr); |
||||
|
||||
/* swap bits of 1, 2, 4 bit packed pixel formats */ |
||||
png_set_packswap(png_ptr); |
||||
|
||||
/* turn on interlace handling if you are not using png_write_image() */ |
||||
if (interlacing) |
||||
number_passes = png_set_interlace_handling(png_ptr); |
||||
else |
||||
number_passes = 1; |
||||
|
||||
/* The easiest way to write the image (you may have a different memory
|
||||
* layout, however, so choose what fits your needs best). You need to |
||||
* use the first method if you aren't handling interlacing yourself. |
||||
*/ |
||||
png_uint_32 k, height, width; |
||||
png_byte image[height][width*bytes_per_pixel]; |
||||
png_bytep row_pointers[height]; |
||||
for (k = 0; k < height; k++) |
||||
row_pointers[k] = image + k*width*bytes_per_pixel; |
||||
|
||||
/* One of the following output methods is REQUIRED */ |
||||
#ifdef entire /* write out the entire image data in one call */ |
||||
png_write_image(png_ptr, row_pointers); |
||||
|
||||
/* the other way to write the image - deal with interlacing */ |
||||
|
||||
#else no_entire /* write out the image data by one or more scanlines */ |
||||
/* The number of passes is either 1 for non-interlaced images,
|
||||
* or 7 for interlaced images. |
||||
*/ |
||||
for (pass = 0; pass < number_passes; pass++) |
||||
{ |
||||
/* Write a few rows at a time. */ |
||||
png_write_rows(png_ptr, &row_pointers[first_row], number_of_rows); |
||||
|
||||
/* If you are only writing one row at a time, this works */ |
||||
for (y = 0; y < height; y++) |
||||
{ |
||||
png_write_rows(png_ptr, &row_pointers[y], 1); |
||||
} |
||||
} |
||||
#endif no_entire /* use only one output method */ |
||||
|
||||
/* You can write optional chunks like tEXt, zTXt, and tIME at the end
|
||||
* as well. Shouldn't be necessary in 1.1.0 and up as all the public |
||||
* chunks are supported and you can use png_set_unknown_chunks() to |
||||
* register unknown chunks into the info structure to be written out. |
||||
*/ |
||||
|
||||
/* It is REQUIRED to call this to finish writing the rest of the file */ |
||||
png_write_end(png_ptr, info_ptr); |
||||
#endif hilevel |
||||
|
||||
/* If you png_malloced a palette, free it here (don't free info_ptr->palette,
|
||||
as recommended in versions 1.0.5m and earlier of this example; if |
||||
libpng mallocs info_ptr->palette, libpng will free it). If you |
||||
allocated it with malloc() instead of png_malloc(), use free() instead |
||||
of png_free(). */ |
||||
png_free(png_ptr, palette); |
||||
palette=NULL; |
||||
|
||||
/* Similarly, if you png_malloced any data that you passed in with
|
||||
png_set_something(), such as a hist or trans array, free it here, |
||||
when you can be sure that libpng is through with it. */ |
||||
png_free(png_ptr, trans); |
||||
trans=NULL; |
||||
|
||||
/* clean up after the write, and free any memory allocated */ |
||||
png_destroy_write_struct(&png_ptr, &info_ptr); |
||||
|
||||
/* close the file */ |
||||
fclose(fp); |
||||
|
||||
/* that's it */ |
||||
return (OK); |
||||
} |
||||
|
||||
#endif /* if 0 */ |
Binary file not shown.
Binary file not shown.
@ -1,176 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="libpng" - Package Owner=<4> |
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00 |
||||
# ** DO NOT EDIT ** |
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104 |
||||
|
||||
CFG=libpng - Win32 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 "libpng.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 "libpng.mak" CFG="libpng - Win32 Debug" |
||||
!MESSAGE |
||||
!MESSAGE Possible choices for configuration are: |
||||
!MESSAGE |
||||
!MESSAGE "libpng - Win32 Release" (based on "Win32 (x86) Static Library") |
||||
!MESSAGE "libpng - Win32 Debug" (based on "Win32 (x86) Static Library") |
||||
!MESSAGE |
||||
|
||||
# Begin Project |
||||
# PROP AllowPerConfigDependencies 0 |
||||
# PROP Scc_ProjName "" |
||||
# PROP Scc_LocalPath "" |
||||
CPP=cl.exe |
||||
RSC=rc.exe |
||||
|
||||
!IF "$(CFG)" == "libpng - Win32 Release" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir "Release" |
||||
# PROP BASE Intermediate_Dir "Release" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir "lib" |
||||
# PROP Intermediate_Dir "Release" |
||||
# PROP Target_Dir "" |
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c |
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../zlib/inc" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c |
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" |
||||
# ADD RSC /l 0x409 /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LIB32=link.exe -lib |
||||
# ADD BASE LIB32 /nologo |
||||
# ADD LIB32 /nologo |
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 Debug" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 1 |
||||
# PROP BASE Output_Dir "Debug" |
||||
# PROP BASE Intermediate_Dir "Debug" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 1 |
||||
# PROP Output_Dir "lib" |
||||
# PROP Intermediate_Dir "Debug" |
||||
# PROP Target_Dir "" |
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c |
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../zlib/inc" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c |
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" |
||||
# ADD RSC /l 0x409 /d "_DEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LIB32=link.exe -lib |
||||
# ADD BASE LIB32 /nologo |
||||
# ADD LIB32 /nologo /out:"lib\libpng_dbg.lib" |
||||
|
||||
!ENDIF |
||||
|
||||
# Begin Target |
||||
|
||||
# Name "libpng - Win32 Release" |
||||
# Name "libpng - Win32 Debug" |
||||
# Begin Group "Source Files" |
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\example.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\png.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngerror.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pnggccrd.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngget.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngmem.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngpread.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngread.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngrio.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngrtran.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngrutil.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngset.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngtrans.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngvcrd.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngwio.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngwrite.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngwtran.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngwutil.c |
||||
# End Source File |
||||
# End Group |
||||
# Begin Group "Header Files" |
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\png.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngasmrd.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngconf.h |
||||
# End Source File |
||||
# End Group |
||||
# End Target |
||||
# End Project |
@ -1,44 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00 |
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! |
||||
|
||||
############################################################################### |
||||
|
||||
Project: "libpng"=.\libpng.dsp - Package Owner=<4> |
||||
|
||||
Package=<5> |
||||
{{{ |
||||
}}} |
||||
|
||||
Package=<4> |
||||
{{{ |
||||
}}} |
||||
|
||||
############################################################################### |
||||
|
||||
Project: "pngtest"=.\pngtest.dsp - Package Owner=<4> |
||||
|
||||
Package=<5> |
||||
{{{ |
||||
}}} |
||||
|
||||
Package=<4> |
||||
{{{ |
||||
Begin Project Dependency |
||||
Project_Dep_Name libpng |
||||
End Project Dependency |
||||
}}} |
||||
|
||||
############################################################################### |
||||
|
||||
Global: |
||||
|
||||
Package=<5> |
||||
{{{ |
||||
}}} |
||||
|
||||
Package=<3> |
||||
{{{ |
||||
}}} |
||||
|
||||
############################################################################### |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
What do you see? An empty folder. |
@ -1,777 +0,0 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
* |
||||
* libpng version 1.2.1 - December 12, 2001 |
||||
* Copyright (c) 1998-2001 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.) |
||||
* |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#define PNG_NO_EXTERN |
||||
#include "png.h" |
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */ |
||||
typedef version_1_2_1 Your_png_h_is_not_version_1_2_1; |
||||
|
||||
/* 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.2.1"; |
||||
|
||||
/* png_sig was changed to a function in version 1.0.5c */ |
||||
/* Place to hold the signature string for a PNG file. */ |
||||
const png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10}; |
||||
|
||||
/* Invoke global declarations for constant strings for known chunk types */ |
||||
PNG_IHDR; |
||||
PNG_IDAT; |
||||
PNG_IEND; |
||||
PNG_PLTE; |
||||
PNG_bKGD; |
||||
PNG_cHRM; |
||||
PNG_gAMA; |
||||
PNG_hIST; |
||||
PNG_iCCP; |
||||
PNG_iTXt; |
||||
PNG_oFFs; |
||||
PNG_pCAL; |
||||
PNG_sCAL; |
||||
PNG_pHYs; |
||||
PNG_sBIT; |
||||
PNG_sPLT; |
||||
PNG_sRGB; |
||||
PNG_tEXt; |
||||
PNG_tIME; |
||||
PNG_tRNS; |
||||
PNG_zTXt; |
||||
|
||||
/* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ |
||||
|
||||
/* start of interlace block */ |
||||
const int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; |
||||
|
||||
/* offset to next interlace block */ |
||||
const int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; |
||||
|
||||
/* start of interlace block in the y direction */ |
||||
const int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; |
||||
|
||||
/* offset to next interlace block in the y direction */ |
||||
const int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; |
||||
|
||||
/* width of interlace block (used in assembler routines only) */ |
||||
#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW |
||||
const int FARDATA png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; |
||||
#endif |
||||
|
||||
/* Height of interlace block. This is not currently used - if you need
|
||||
* it, uncomment it here and in png.h |
||||
const int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; |
||||
*/ |
||||
|
||||
/* Mask to determine which pixels are valid in a pass */ |
||||
const int FARDATA png_pass_mask[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; |
||||
|
||||
/* Mask to determine which pixels to overwrite while displaying */ |
||||
const int FARDATA png_pass_dsp_mask[] |
||||
= {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; |
||||
|
||||
#endif |
||||
|
||||
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
||||
* of the PNG file signature. If the PNG data is embedded into another |
||||
* stream we can set num_bytes = 8 so that libpng will not attempt to read |
||||
* or write any of the magic bytes before it starts on the IHDR. |
||||
*/ |
||||
|
||||
void PNGAPI |
||||
png_set_sig_bytes(png_structp png_ptr, int num_bytes) |
||||
{ |
||||
png_debug(1, "in png_set_sig_bytes\n"); |
||||
if (num_bytes > 8) |
||||
png_error(png_ptr, "Too many bytes for PNG signature."); |
||||
|
||||
png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes); |
||||
} |
||||
|
||||
/* Checks whether the supplied bytes match the PNG signature. We allow
|
||||
* checking less than the full 8-byte signature so that those apps that |
||||
* already read the first few bytes of a file to determine the file type |
||||
* can simply check the remaining bytes for extra assurance. Returns |
||||
* an integer less than, equal to, or greater than zero if sig is found, |
||||
* respectively, to be less than, to match, or be greater than the correct |
||||
* PNG signature (this is the same behaviour as strcmp, memcmp, etc). |
||||
*/ |
||||
int PNGAPI |
||||
png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check) |
||||
{ |
||||
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; |
||||
if (num_to_check > 8) |
||||
num_to_check = 8; |
||||
else if (num_to_check < 1) |
||||
return (0); |
||||
|
||||
if (start > 7) |
||||
return (0); |
||||
|
||||
if (start + num_to_check > 8) |
||||
num_to_check = 8 - start; |
||||
|
||||
return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check))); |
||||
} |
||||
|
||||
/* (Obsolete) function to check signature bytes. It does not allow one
|
||||
* to check a partial signature. This function might be removed in the |
||||
* future - use png_sig_cmp(). Returns true (nonzero) if the file is a PNG. |
||||
*/ |
||||
int PNGAPI |
||||
png_check_sig(png_bytep sig, int num) |
||||
{ |
||||
return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num)); |
||||
} |
||||
|
||||
/* Function to allocate memory for zlib and clear it to 0. */ |
||||
voidpf /* PRIVATE */ |
||||
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); |
||||
|
||||
#ifndef PNG_NO_ZALLOC_ZERO |
||||
if (num_bytes > (png_uint_32)0x8000L) |
||||
{ |
||||
png_memset(ptr, 0, (png_size_t)0x8000L); |
||||
png_memset((png_bytep)ptr + (png_size_t)0x8000L, 0, |
||||
(png_size_t)(num_bytes - (png_uint_32)0x8000L)); |
||||
} |
||||
else |
||||
{ |
||||
png_memset(ptr, 0, (png_size_t)num_bytes); |
||||
} |
||||
#endif |
||||
return ((voidpf)ptr); |
||||
} |
||||
|
||||
/* function to free memory for zlib */ |
||||
void /* PRIVATE */ |
||||
png_zfree(voidpf png_ptr, voidpf ptr) |
||||
{ |
||||
png_free((png_structp)png_ptr, (png_voidp)ptr); |
||||
} |
||||
|
||||
/* Reset the CRC variable to 32 bits of 1's. Care must be taken
|
||||
* in case CRC is > 32 bits to leave the top bits 0. |
||||
*/ |
||||
void /* PRIVATE */ |
||||
png_reset_crc(png_structp png_ptr) |
||||
{ |
||||
png_ptr->crc = crc32(0, Z_NULL, 0); |
||||
} |
||||
|
||||
/* Calculate the CRC over a section of data. We can only pass as
|
||||
* much data to this routine as the largest single buffer size. We |
||||
* also check that this data will actually be used before going to the |
||||
* trouble of calculating it. |
||||
*/ |
||||
void /* PRIVATE */ |
||||
png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length) |
||||
{ |
||||
int need_crc = 1; |
||||
|
||||
if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ |
||||
{ |
||||
if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == |
||||
(PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) |
||||
need_crc = 0; |
||||
} |
||||
else /* critical */ |
||||
{ |
||||
if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) |
||||
need_crc = 0; |
||||
} |
||||
|
||||
if (need_crc) |
||||
png_ptr->crc = crc32(png_ptr->crc, ptr, (uInt)length); |
||||
} |
||||
|
||||
/* Allocate the memory for an info_struct for the application. We don't
|
||||
* really need the png_ptr, but it could potentially be useful in the |
||||
* future. This should be used in favour of malloc(sizeof(png_info)) |
||||
* and png_info_init() so that applications that want to use a shared |
||||
* libpng don't have to be recompiled if png_info changes size. |
||||
*/ |
||||
png_infop PNGAPI |
||||
png_create_info_struct(png_structp png_ptr) |
||||
{ |
||||
png_infop info_ptr; |
||||
|
||||
png_debug(1, "in png_create_info_struct\n"); |
||||
if(png_ptr == NULL) return (NULL); |
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO, |
||||
png_ptr->malloc_fn, png_ptr->mem_ptr); |
||||
#else |
||||
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); |
||||
} |
||||
|
||||
/* This function frees the memory associated with a single info struct.
|
||||
* Normally, one would use either png_destroy_read_struct() or |
||||
* png_destroy_write_struct() to free an info struct, but this may be |
||||
* useful for some applications. |
||||
*/ |
||||
void PNGAPI |
||||
png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr) |
||||
{ |
||||
png_infop info_ptr = NULL; |
||||
|
||||
png_debug(1, "in png_destroy_info_struct\n"); |
||||
if (info_ptr_ptr != NULL) |
||||
info_ptr = *info_ptr_ptr; |
||||
|
||||
if (info_ptr != NULL) |
||||
{ |
||||
png_info_destroy(png_ptr, info_ptr); |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
png_destroy_struct_2((png_voidp)info_ptr, png_ptr->free_fn, |
||||
png_ptr->mem_ptr); |
||||
#else |
||||
png_destroy_struct((png_voidp)info_ptr); |
||||
#endif |
||||
*info_ptr_ptr = NULL; |
||||
} |
||||
} |
||||
|
||||
/* Initialize the info structure. This is now an internal function (0.89)
|
||||
* and applications using it are urged to use png_create_info_struct() |
||||
* instead. |
||||
*/ |
||||
#undef png_info_init |
||||
void PNGAPI |
||||
png_info_init(png_infop info_ptr) |
||||
{ |
||||
/* We only come here via pre-1.0.12-compiled applications */ |
||||
png_info_init_3(&info_ptr, 0); |
||||
} |
||||
|
||||
void PNGAPI |
||||
png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size) |
||||
{ |
||||
png_infop info_ptr = *ptr_ptr; |
||||
|
||||
png_debug(1, "in png_info_init_3\n"); |
||||
|
||||
if(sizeof(png_info) > png_info_struct_size) |
||||
{ |
||||
png_destroy_struct(info_ptr); |
||||
info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO); |
||||
*ptr_ptr = info_ptr; |
||||
} |
||||
|
||||
/* set everything to 0 */ |
||||
png_memset(info_ptr, 0, sizeof (png_info)); |
||||
} |
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
void PNGAPI |
||||
png_data_freer(png_structp png_ptr, png_infop info_ptr, |
||||
int freer, png_uint_32 mask) |
||||
{ |
||||
png_debug(1, "in png_data_freer\n"); |
||||
if (png_ptr == NULL || info_ptr == NULL) |
||||
return; |
||||
if(freer == PNG_DESTROY_WILL_FREE_DATA) |
||||
info_ptr->free_me |= mask; |
||||
else if(freer == PNG_USER_WILL_FREE_DATA) |
||||
info_ptr->free_me &= ~mask; |
||||
else |
||||
png_warning(png_ptr, |
||||
"Unknown freer parameter in png_data_freer."); |
||||
} |
||||
#endif |
||||
|
||||
void PNGAPI |
||||
png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, |
||||
int num) |
||||
{ |
||||
png_debug(1, "in png_free_data\n"); |
||||
if (png_ptr == NULL || info_ptr == NULL) |
||||
return; |
||||
|
||||
#if defined(PNG_TEXT_SUPPORTED) |
||||
/* free text item num or (if num == -1) all text items */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_TEXT) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_TEXT) |
||||
#endif |
||||
{ |
||||
if (num != -1) |
||||
{ |
||||
if (info_ptr->text && info_ptr->text[num].key) |
||||
{ |
||||
png_free(png_ptr, info_ptr->text[num].key); |
||||
info_ptr->text[num].key = NULL; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
int i; |
||||
for (i = 0; i < info_ptr->num_text; i++) |
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, i); |
||||
png_free(png_ptr, info_ptr->text); |
||||
info_ptr->text = NULL; |
||||
info_ptr->num_text=0; |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_tRNS_SUPPORTED) |
||||
/* free any tRNS entry */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_TRNS) & info_ptr->free_me) |
||||
#else |
||||
if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS)) |
||||
#endif |
||||
{ |
||||
png_free(png_ptr, info_ptr->trans); |
||||
info_ptr->valid &= ~PNG_INFO_tRNS; |
||||
info_ptr->trans = NULL; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_sCAL_SUPPORTED) |
||||
/* free any sCAL entry */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_SCAL) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_SCAL) |
||||
#endif |
||||
{ |
||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) |
||||
png_free(png_ptr, info_ptr->scal_s_width); |
||||
png_free(png_ptr, info_ptr->scal_s_height); |
||||
info_ptr->scal_s_width = NULL; |
||||
info_ptr->scal_s_height = NULL; |
||||
#endif |
||||
info_ptr->valid &= ~PNG_INFO_sCAL; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_pCAL_SUPPORTED) |
||||
/* free any pCAL entry */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_PCAL) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_PCAL) |
||||
#endif |
||||
{ |
||||
png_free(png_ptr, info_ptr->pcal_purpose); |
||||
png_free(png_ptr, info_ptr->pcal_units); |
||||
info_ptr->pcal_purpose = NULL; |
||||
info_ptr->pcal_units = NULL; |
||||
if (info_ptr->pcal_params != NULL) |
||||
{ |
||||
int i; |
||||
for (i = 0; i < (int)info_ptr->pcal_nparams; i++) |
||||
{ |
||||
png_free(png_ptr, info_ptr->pcal_params[i]); |
||||
info_ptr->pcal_params[i]=NULL; |
||||
} |
||||
png_free(png_ptr, info_ptr->pcal_params); |
||||
info_ptr->pcal_params = NULL; |
||||
} |
||||
info_ptr->valid &= ~PNG_INFO_pCAL; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_iCCP_SUPPORTED) |
||||
/* free any iCCP entry */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_ICCP) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_ICCP) |
||||
#endif |
||||
{ |
||||
png_free(png_ptr, info_ptr->iccp_name); |
||||
png_free(png_ptr, info_ptr->iccp_profile); |
||||
info_ptr->iccp_name = NULL; |
||||
info_ptr->iccp_profile = NULL; |
||||
info_ptr->valid &= ~PNG_INFO_iCCP; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_sPLT_SUPPORTED) |
||||
/* free a given sPLT entry, or (if num == -1) all sPLT entries */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_SPLT) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_SPLT) |
||||
#endif |
||||
{ |
||||
if (num != -1) |
||||
{ |
||||
if(info_ptr->splt_palettes) |
||||
{ |
||||
png_free(png_ptr, info_ptr->splt_palettes[num].name); |
||||
png_free(png_ptr, info_ptr->splt_palettes[num].entries); |
||||
info_ptr->splt_palettes[num].name = NULL; |
||||
info_ptr->splt_palettes[num].entries = NULL; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if(info_ptr->splt_palettes_num) |
||||
{ |
||||
int i; |
||||
for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) |
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i); |
||||
|
||||
png_free(png_ptr, info_ptr->splt_palettes); |
||||
info_ptr->splt_palettes = NULL; |
||||
info_ptr->splt_palettes_num = 0; |
||||
} |
||||
info_ptr->valid &= ~PNG_INFO_sPLT; |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_UNKN) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_UNKN) |
||||
#endif |
||||
{ |
||||
if (num != -1) |
||||
{ |
||||
if(info_ptr->unknown_chunks) |
||||
{ |
||||
png_free(png_ptr, info_ptr->unknown_chunks[num].data); |
||||
info_ptr->unknown_chunks[num].data = NULL; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
int i; |
||||
|
||||
if(info_ptr->unknown_chunks_num) |
||||
{ |
||||
for (i = 0; i < (int)info_ptr->unknown_chunks_num; i++) |
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i); |
||||
|
||||
png_free(png_ptr, info_ptr->unknown_chunks); |
||||
info_ptr->unknown_chunks = NULL; |
||||
info_ptr->unknown_chunks_num = 0; |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_hIST_SUPPORTED) |
||||
/* free any hIST entry */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_HIST) & info_ptr->free_me) |
||||
#else |
||||
if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST)) |
||||
#endif |
||||
{ |
||||
png_free(png_ptr, info_ptr->hist); |
||||
info_ptr->hist = NULL; |
||||
info_ptr->valid &= ~PNG_INFO_hIST; |
||||
} |
||||
#endif |
||||
|
||||
/* free any PLTE entry that was internally allocated */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_PLTE) & info_ptr->free_me) |
||||
#else |
||||
if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE)) |
||||
#endif |
||||
{ |
||||
png_zfree(png_ptr, info_ptr->palette); |
||||
info_ptr->palette = NULL; |
||||
info_ptr->valid &= ~PNG_INFO_PLTE; |
||||
info_ptr->num_palette = 0; |
||||
} |
||||
|
||||
#if defined(PNG_INFO_IMAGE_SUPPORTED) |
||||
/* free any image bits attached to the info structure */ |
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if ((mask & PNG_FREE_ROWS) & info_ptr->free_me) |
||||
#else |
||||
if (mask & PNG_FREE_ROWS) |
||||
#endif |
||||
{ |
||||
if(info_ptr->row_pointers) |
||||
{ |
||||
int row; |
||||
for (row = 0; row < (int)info_ptr->height; row++) |
||||
{ |
||||
png_free(png_ptr, info_ptr->row_pointers[row]); |
||||
info_ptr->row_pointers[row]=NULL; |
||||
} |
||||
png_free(png_ptr, info_ptr->row_pointers); |
||||
info_ptr->row_pointers=NULL; |
||||
} |
||||
info_ptr->valid &= ~PNG_INFO_IDAT; |
||||
} |
||||
#endif |
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED |
||||
if(num == -1) |
||||
info_ptr->free_me &= ~mask; |
||||
else |
||||
info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL); |
||||
#endif |
||||
} |
||||
|
||||
/* This is an internal routine to free any memory that the info struct is
|
||||
* pointing to before re-using it or freeing the struct itself. Recall |
||||
* that png_free() checks for NULL pointers for us. |
||||
*/ |
||||
void /* PRIVATE */ |
||||
png_info_destroy(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
png_debug(1, "in png_info_destroy\n"); |
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); |
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) |
||||
if (png_ptr->num_chunk_list) |
||||
{ |
||||
png_free(png_ptr, png_ptr->chunk_list); |
||||
png_ptr->chunk_list=NULL; |
||||
png_ptr->num_chunk_list=0; |
||||
} |
||||
#endif |
||||
|
||||
png_info_init_3(&info_ptr, sizeof(png_info)); |
||||
} |
||||
|
||||
/* This function returns a pointer to the io_ptr associated with the user
|
||||
* functions. The application should free any memory associated with this |
||||
* pointer before png_write_destroy() or png_read_destroy() are called. |
||||
*/ |
||||
png_voidp PNGAPI |
||||
png_get_io_ptr(png_structp png_ptr) |
||||
{ |
||||
return (png_ptr->io_ptr); |
||||
} |
||||
|
||||
#if !defined(PNG_NO_STDIO) |
||||
/* Initialize the default input/output functions for the PNG file. If you
|
||||
* use your own read or write routines, you can call either png_set_read_fn() |
||||
* or png_set_write_fn() instead of png_init_io(). If you have defined |
||||
* PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't |
||||
* necessarily available. |
||||
*/ |
||||
void PNGAPI |
||||
png_init_io(png_structp png_ptr, png_FILE_p fp) |
||||
{ |
||||
png_debug(1, "in png_init_io\n"); |
||||
png_ptr->io_ptr = (png_voidp)fp; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_TIME_RFC1123_SUPPORTED) |
||||
/* Convert the supplied time into an RFC 1123 string suitable for use in
|
||||
* a "Creation Time" or other text-based time string. |
||||
*/ |
||||
png_charp PNGAPI |
||||
png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime) |
||||
{ |
||||
static PNG_CONST char short_months[12][4] = |
||||
{"Jan", "Feb", "Mar", "Apr", "May", "Jun", |
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; |
||||
|
||||
if (png_ptr->time_buffer == NULL) |
||||
{ |
||||
png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29* |
||||
sizeof(char))); |
||||
} |
||||
|
||||
#if defined(_WIN32_WCE) |
||||
{ |
||||
wchar_t time_buf[29]; |
||||
wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"), |
||||
ptime->day % 32, short_months[(ptime->month - 1) % 12], |
||||
ptime->year, ptime->hour % 24, ptime->minute % 60, |
||||
ptime->second % 61); |
||||
WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer, 29, |
||||
NULL, NULL); |
||||
} |
||||
#else |
||||
#ifdef USE_FAR_KEYWORD |
||||
{ |
||||
char near_time_buf[29]; |
||||
sprintf(near_time_buf, "%d %s %d %02d:%02d:%02d +0000", |
||||
ptime->day % 32, short_months[(ptime->month - 1) % 12], |
||||
ptime->year, ptime->hour % 24, ptime->minute % 60, |
||||
ptime->second % 61); |
||||
png_memcpy(png_ptr->time_buffer, near_time_buf, |
||||
29*sizeof(char)); |
||||
} |
||||
#else |
||||
sprintf(png_ptr->time_buffer, "%d %s %d %02d:%02d:%02d +0000", |
||||
ptime->day % 32, short_months[(ptime->month - 1) % 12], |
||||
ptime->year, ptime->hour % 24, ptime->minute % 60, |
||||
ptime->second % 61); |
||||
#endif |
||||
#endif /* _WIN32_WCE */ |
||||
return ((png_charp)png_ptr->time_buffer); |
||||
} |
||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */ |
||||
|
||||
#if 0 |
||||
/* Signature string for a PNG file. */ |
||||
png_bytep PNGAPI |
||||
png_sig_bytes(void) |
||||
{ |
||||
return ((png_bytep)"\211\120\116\107\015\012\032\012"); |
||||
} |
||||
#endif |
||||
|
||||
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.2.1 - December 12, 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) ""); |
||||
} |
||||
|
||||
/* The following return the library version as a short string in the
|
||||
* format 1.0.0 through 99.99.99zz. To get the version of *.h files used |
||||
* with your application, print out PNG_LIBPNG_VER_STRING, which is defined |
||||
* in png.h. |
||||
*/ |
||||
|
||||
png_charp PNGAPI |
||||
png_get_libpng_ver(png_structp png_ptr) |
||||
{ |
||||
/* Version of *.c files used when building libpng */ |
||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */ |
||||
return((png_charp) "1.2.1"); |
||||
return((png_charp) "1.2.1"); |
||||
} |
||||
|
||||
png_charp PNGAPI |
||||
png_get_header_ver(png_structp png_ptr) |
||||
{ |
||||
/* Version of *.h files used when building libpng */ |
||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */ |
||||
return((png_charp) PNG_LIBPNG_VER_STRING); |
||||
return((png_charp) PNG_LIBPNG_VER_STRING); |
||||
} |
||||
|
||||
png_charp PNGAPI |
||||
png_get_header_version(png_structp png_ptr) |
||||
{ |
||||
/* Returns longer string containing both version and date */ |
||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */ |
||||
return((png_charp) PNG_HEADER_VERSION_STRING); |
||||
return((png_charp) PNG_HEADER_VERSION_STRING); |
||||
} |
||||
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED |
||||
int /* PRIVATE */ |
||||
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 */ |
||||
int i; |
||||
png_bytep p; |
||||
if((png_ptr == NULL && chunk_name == NULL) || png_ptr->num_chunk_list<=0) |
||||
return 0; |
||||
p=png_ptr->chunk_list+png_ptr->num_chunk_list*5-5; |
||||
for (i = png_ptr->num_chunk_list; i; i--, p-=5) |
||||
if (!png_memcmp(chunk_name, p, 4)) |
||||
return ((int)*(p+4)); |
||||
return 0; |
||||
} |
||||
#endif |
||||
|
||||
/* This function, added to libpng-1.0.6g, is untested. */ |
||||
int PNGAPI |
||||
png_reset_zstream(png_structp png_ptr) |
||||
{ |
||||
return (inflateReset(&png_ptr->zstream)); |
||||
} |
||||
|
||||
/* This function was added to libpng-1.0.7 */ |
||||
png_uint_32 PNGAPI |
||||
png_access_version_number(void) |
||||
{ |
||||
/* Version of *.c files used when building libpng */ |
||||
return((png_uint_32) 10201L); |
||||
} |
||||
|
||||
|
||||
#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)) |
||||
int PNGAPI |
||||
png_mmx_support(void) |
||||
{ |
||||
return -1; |
||||
} |
||||
#endif |
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 2001 Glenn Randers-Pehrson |
||||
* |
||||
*/ |
||||
|
||||
/* This file is obsolete in libpng-1.0.9 and later; its contents now appear
|
||||
* at the end of pngconf.h. |
||||
*/ |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
File diff suppressed because it is too large
Load Diff
@ -1,289 +0,0 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
* |
||||
* This file provides a location for all error handling. Users who |
||||
* need special error handling are expected to write replacement functions |
||||
* and use png_set_error_fn() to use those functions. See the instructions |
||||
* at each function. |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
|
||||
static void /* PRIVATE */ |
||||
png_default_error PNGARG((png_structp png_ptr, |
||||
png_const_charp message)); |
||||
static void /* PRIVATE */ |
||||
png_default_warning PNGARG((png_structp png_ptr, |
||||
png_const_charp message)); |
||||
|
||||
/* This function is called whenever there is a fatal error. This function
|
||||
* should not be changed. If there is a need to handle errors differently, |
||||
* you should supply a replacement error function and use png_set_error_fn() |
||||
* to replace the error function at run-time. |
||||
*/ |
||||
void PNGAPI |
||||
png_error(png_structp png_ptr, png_const_charp message) |
||||
{ |
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED |
||||
char msg[16]; |
||||
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) |
||||
{ |
||||
int offset = 0; |
||||
if (*message == '#') |
||||
{ |
||||
for (offset=1; offset<15; offset++) |
||||
if (*(message+offset) == ' ') |
||||
break; |
||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) |
||||
{ |
||||
int i; |
||||
for (i=0; i<offset-1; i++) |
||||
msg[i]=message[i+1]; |
||||
msg[i]='\0'; |
||||
message=msg; |
||||
} |
||||
else |
||||
message+=offset; |
||||
} |
||||
else |
||||
{ |
||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) |
||||
{ |
||||
msg[0]='0';
|
||||
msg[1]='\0'; |
||||
message=msg; |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
if (png_ptr->error_fn != NULL) |
||||
(*(png_ptr->error_fn))(png_ptr, message); |
||||
|
||||
/* if the following returns or doesn't exist, use the default function,
|
||||
which will not return */ |
||||
png_default_error(png_ptr, message); |
||||
} |
||||
|
||||
/* This function is called whenever there is a non-fatal error. This function
|
||||
* should not be changed. If there is a need to handle warnings differently, |
||||
* you should supply a replacement warning function and use |
||||
* png_set_error_fn() to replace the warning function at run-time. |
||||
*/ |
||||
void PNGAPI |
||||
png_warning(png_structp png_ptr, png_const_charp message) |
||||
{ |
||||
int offset = 0; |
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED |
||||
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) |
||||
#endif |
||||
{ |
||||
if (*message == '#') |
||||
{ |
||||
for (offset=1; offset<15; offset++) |
||||
if (*(message+offset) == ' ') |
||||
break; |
||||
} |
||||
} |
||||
if (png_ptr->warning_fn != NULL) |
||||
(*(png_ptr->warning_fn))(png_ptr, (png_const_charp)(message+offset)); |
||||
else |
||||
png_default_warning(png_ptr, (png_const_charp)(message+offset)); |
||||
} |
||||
|
||||
/* These utilities are used internally to build an error message that relates
|
||||
* to the current chunk. The chunk name comes from png_ptr->chunk_name, |
||||
* this is used to prefix the message. The message is limited in length |
||||
* to 63 bytes, the name characters are output as hex digits wrapped in [] |
||||
* if the character is invalid. |
||||
*/ |
||||
#define isnonalpha(c) ((c) < 41 || (c) > 122 || ((c) > 90 && (c) < 97)) |
||||
static PNG_CONST char png_digit[16] = { |
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', |
||||
'F' }; |
||||
|
||||
static void /* PRIVATE */ |
||||
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp |
||||
message) |
||||
{ |
||||
int iout = 0, iin = 0; |
||||
|
||||
while (iin < 4) |
||||
{ |
||||
int c = png_ptr->chunk_name[iin++]; |
||||
if (isnonalpha(c)) |
||||
{ |
||||
buffer[iout++] = '['; |
||||
buffer[iout++] = png_digit[(c & 0xf0) >> 4]; |
||||
buffer[iout++] = png_digit[c & 0x0f]; |
||||
buffer[iout++] = ']'; |
||||
} |
||||
else |
||||
{ |
||||
buffer[iout++] = (png_byte)c; |
||||
} |
||||
} |
||||
|
||||
if (message == NULL) |
||||
buffer[iout] = 0; |
||||
else |
||||
{ |
||||
buffer[iout++] = ':'; |
||||
buffer[iout++] = ' '; |
||||
png_memcpy(buffer+iout, message, 64); |
||||
buffer[iout+63] = 0; |
||||
} |
||||
} |
||||
|
||||
void PNGAPI |
||||
png_chunk_error(png_structp png_ptr, png_const_charp message) |
||||
{ |
||||
char msg[18+64]; |
||||
png_format_buffer(png_ptr, msg, message); |
||||
png_error(png_ptr, msg); |
||||
} |
||||
|
||||
void PNGAPI |
||||
png_chunk_warning(png_structp png_ptr, png_const_charp message) |
||||
{ |
||||
char msg[18+64]; |
||||
png_format_buffer(png_ptr, msg, message); |
||||
png_warning(png_ptr, msg); |
||||
} |
||||
|
||||
/* This is the default error handling function. Note that replacements for
|
||||
* this function MUST NOT RETURN, or the program will likely crash. This |
||||
* function is used by default, or if the program supplies NULL for the |
||||
* error function pointer in png_set_error_fn(). |
||||
*/ |
||||
static void /* PRIVATE */ |
||||
png_default_error(png_structp png_ptr, png_const_charp message) |
||||
{ |
||||
#ifndef PNG_NO_CONSOLE_IO |
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED |
||||
if (*message == '#') |
||||
{ |
||||
int offset; |
||||
char error_number[16]; |
||||
for (offset=0; offset<15; offset++) |
||||
{ |
||||
error_number[offset] = *(message+offset+1); |
||||
if (*(message+offset) == ' ') |
||||
break; |
||||
} |
||||
if((offset > 1) && (offset < 15)) |
||||
{ |
||||
error_number[offset-1]='\0'; |
||||
fprintf(stderr, "libpng error no. %s: %s\n", error_number, message+offset); |
||||
} |
||||
else |
||||
fprintf(stderr, "libpng error: %s, offset=%d\n", message,offset); |
||||
} |
||||
else |
||||
#endif |
||||
fprintf(stderr, "libpng error: %s\n", message); |
||||
#else |
||||
if (message) |
||||
/* make compiler happy */ ; |
||||
#endif |
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED |
||||
# ifdef USE_FAR_KEYWORD |
||||
{ |
||||
jmp_buf jmpbuf; |
||||
png_memcpy(jmpbuf,png_ptr->jmpbuf,sizeof(jmp_buf)); |
||||
longjmp(jmpbuf, 1); |
||||
} |
||||
# else |
||||
longjmp(png_ptr->jmpbuf, 1); |
||||
# endif |
||||
#else |
||||
if (png_ptr) |
||||
/* make compiler happy */ ; |
||||
PNG_ABORT(); |
||||
#endif |
||||
} |
||||
|
||||
/* This function is called when there is a warning, but the library thinks
|
||||
* it can continue anyway. Replacement functions don't have to do anything |
||||
* here if you don't want them to. In the default configuration, png_ptr is |
||||
* not used, but it is passed in case it may be useful. |
||||
*/ |
||||
static void /* PRIVATE */ |
||||
png_default_warning(png_structp png_ptr, png_const_charp message) |
||||
{ |
||||
#ifndef PNG_NO_CONSOLE_IO |
||||
# ifdef PNG_ERROR_NUMBERS_SUPPORTED |
||||
if (*message == '#') |
||||
{ |
||||
int offset; |
||||
char warning_number[16]; |
||||
for (offset=0; offset<15; offset++) |
||||
{ |
||||
warning_number[offset]=*(message+offset+1); |
||||
if (*(message+offset) == ' ') |
||||
break; |
||||
} |
||||
if((offset > 1) && (offset < 15)) |
||||
{ |
||||
warning_number[offset-1]='\0'; |
||||
fprintf(stderr, "libpng warning no. %s: %s\n", warning_number, |
||||
message+offset); |
||||
} |
||||
else |
||||
fprintf(stderr, "libpng warning: %s\n", message); |
||||
} |
||||
else |
||||
# endif |
||||
fprintf(stderr, "libpng warning: %s\n", message); |
||||
#else |
||||
if (message) |
||||
/* appease compiler */ ; |
||||
#endif |
||||
if (png_ptr) |
||||
return; |
||||
} |
||||
|
||||
/* This function is called when the application wants to use another method
|
||||
* of handling errors and warnings. Note that the error function MUST NOT |
||||
* return to the calling routine or serious problems will occur. The return |
||||
* method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) |
||||
*/ |
||||
void PNGAPI |
||||
png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, |
||||
png_error_ptr error_fn, png_error_ptr warning_fn) |
||||
{ |
||||
png_ptr->error_ptr = error_ptr; |
||||
png_ptr->error_fn = error_fn; |
||||
png_ptr->warning_fn = warning_fn; |
||||
} |
||||
|
||||
|
||||
/* This function returns a pointer to the error_ptr associated with the user
|
||||
* functions. The application should free any memory associated with this |
||||
* pointer before png_write_destroy and png_read_destroy are called. |
||||
*/ |
||||
png_voidp PNGAPI |
||||
png_get_error_ptr(png_structp png_ptr) |
||||
{ |
||||
return ((png_voidp)png_ptr->error_ptr); |
||||
} |
||||
|
||||
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED |
||||
void |
||||
png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) |
||||
{ |
||||
if(png_ptr != NULL) |
||||
{ |
||||
png_ptr->flags &= |
||||
((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); |
||||
} |
||||
} |
||||
#endif |
File diff suppressed because it is too large
Load Diff
@ -1,917 +0,0 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
return(info_ptr->valid & flag); |
||||
else |
||||
return(0); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_rowbytes(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
return(info_ptr->rowbytes); |
||||
else |
||||
return(0); |
||||
} |
||||
|
||||
#if defined(PNG_INFO_IMAGE_SUPPORTED) |
||||
png_bytepp PNGAPI |
||||
png_get_rows(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
return(info_ptr->row_pointers); |
||||
else |
||||
return(0); |
||||
} |
||||
#endif |
||||
|
||||
#ifdef PNG_EASY_ACCESS_SUPPORTED |
||||
/* easy access to info, added in libpng-0.99 */ |
||||
png_uint_32 PNGAPI |
||||
png_get_image_width(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->width; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_image_height(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->height; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_byte PNGAPI |
||||
png_get_bit_depth(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->bit_depth; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_byte PNGAPI |
||||
png_get_color_type(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->color_type; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_byte PNGAPI |
||||
png_get_filter_type(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->filter_type; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_byte PNGAPI |
||||
png_get_interlace_type(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->interlace_type; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_byte PNGAPI |
||||
png_get_compression_type(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
{ |
||||
return info_ptr->compression_type; |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_pHYs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_pHYs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_x_pixels_per_meter"); |
||||
if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER) |
||||
return (0); |
||||
else return (info_ptr->x_pixels_per_unit); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_pHYs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_pHYs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter"); |
||||
if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER) |
||||
return (0); |
||||
else return (info_ptr->y_pixels_per_unit); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_pHYs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_pHYs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter"); |
||||
if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER || |
||||
info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) |
||||
return (0); |
||||
else return (info_ptr->x_pixels_per_unit); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED |
||||
float PNGAPI |
||||
png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_pHYs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_pHYs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio"); |
||||
if (info_ptr->x_pixels_per_unit == 0) |
||||
return ((float)0.0); |
||||
else |
||||
return ((float)((float)info_ptr->y_pixels_per_unit |
||||
/(float)info_ptr->x_pixels_per_unit)); |
||||
} |
||||
#else |
||||
return (0.0); |
||||
#endif |
||||
return ((float)0.0); |
||||
} |
||||
#endif |
||||
|
||||
png_int_32 PNGAPI |
||||
png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_oFFs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_oFFs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); |
||||
if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) |
||||
return (0); |
||||
else return (info_ptr->x_offset); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
png_int_32 PNGAPI |
||||
png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_oFFs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_oFFs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); |
||||
if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) |
||||
return (0); |
||||
else return (info_ptr->y_offset); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
png_int_32 PNGAPI |
||||
png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_oFFs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_oFFs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); |
||||
if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) |
||||
return (0); |
||||
else return (info_ptr->x_offset); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
png_int_32 PNGAPI |
||||
png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
#if defined(PNG_oFFs_SUPPORTED) |
||||
if (info_ptr->valid & PNG_INFO_oFFs) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); |
||||
if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) |
||||
return (0); |
||||
else return (info_ptr->y_offset); |
||||
} |
||||
#else |
||||
return (0); |
||||
#endif |
||||
return (0); |
||||
} |
||||
|
||||
#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr) |
||||
*.0254 +.5)); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr) |
||||
*.0254 +.5)); |
||||
} |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr) |
||||
*.0254 +.5)); |
||||
} |
||||
|
||||
float PNGAPI |
||||
png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
return ((float)png_get_x_offset_microns(png_ptr, info_ptr) |
||||
*.00003937); |
||||
} |
||||
|
||||
float PNGAPI |
||||
png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
return ((float)png_get_y_offset_microns(png_ptr, info_ptr) |
||||
*.00003937); |
||||
} |
||||
|
||||
#if defined(PNG_pHYs_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr, |
||||
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) |
||||
{ |
||||
png_uint_32 retval = 0; |
||||
|
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "pHYs"); |
||||
if (res_x != NULL) |
||||
{ |
||||
*res_x = info_ptr->x_pixels_per_unit; |
||||
retval |= PNG_INFO_pHYs; |
||||
} |
||||
if (res_y != NULL) |
||||
{ |
||||
*res_y = info_ptr->y_pixels_per_unit; |
||||
retval |= PNG_INFO_pHYs; |
||||
} |
||||
if (unit_type != NULL) |
||||
{ |
||||
*unit_type = (int)info_ptr->phys_unit_type; |
||||
retval |= PNG_INFO_pHYs; |
||||
if(*unit_type == 1) |
||||
{ |
||||
if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50); |
||||
if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50); |
||||
} |
||||
} |
||||
} |
||||
return (retval); |
||||
} |
||||
#endif /* PNG_pHYs_SUPPORTED */ |
||||
#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ |
||||
|
||||
/* png_get_channels really belongs in here, too, but it's been around longer */ |
||||
|
||||
#endif /* PNG_EASY_ACCESS_SUPPORTED */ |
||||
|
||||
png_byte PNGAPI |
||||
png_get_channels(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
return(info_ptr->channels); |
||||
else |
||||
return (0); |
||||
} |
||||
|
||||
png_bytep PNGAPI |
||||
png_get_signature(png_structp png_ptr, png_infop info_ptr) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL) |
||||
return(info_ptr->signature); |
||||
else |
||||
return (NULL); |
||||
} |
||||
|
||||
#if defined(PNG_bKGD_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_bKGD(png_structp png_ptr, png_infop info_ptr, |
||||
png_color_16p *background) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) |
||||
&& background != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "bKGD"); |
||||
*background = &(info_ptr->background); |
||||
return (PNG_INFO_bKGD); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_cHRM_SUPPORTED) |
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED |
||||
png_uint_32 PNGAPI |
||||
png_get_cHRM(png_structp png_ptr, png_infop info_ptr, |
||||
double *white_x, double *white_y, double *red_x, double *red_y, |
||||
double *green_x, double *green_y, double *blue_x, double *blue_y) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "cHRM"); |
||||
if (white_x != NULL) |
||||
*white_x = (double)info_ptr->x_white; |
||||
if (white_y != NULL) |
||||
*white_y = (double)info_ptr->y_white; |
||||
if (red_x != NULL) |
||||
*red_x = (double)info_ptr->x_red; |
||||
if (red_y != NULL) |
||||
*red_y = (double)info_ptr->y_red; |
||||
if (green_x != NULL) |
||||
*green_x = (double)info_ptr->x_green; |
||||
if (green_y != NULL) |
||||
*green_y = (double)info_ptr->y_green; |
||||
if (blue_x != NULL) |
||||
*blue_x = (double)info_ptr->x_blue; |
||||
if (blue_y != NULL) |
||||
*blue_y = (double)info_ptr->y_blue; |
||||
return (PNG_INFO_cHRM); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
#ifdef PNG_FIXED_POINT_SUPPORTED |
||||
png_uint_32 PNGAPI |
||||
png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, |
||||
png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x, |
||||
png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y, |
||||
png_fixed_point *blue_x, png_fixed_point *blue_y) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "cHRM"); |
||||
if (white_x != NULL) |
||||
*white_x = info_ptr->int_x_white; |
||||
if (white_y != NULL) |
||||
*white_y = info_ptr->int_y_white; |
||||
if (red_x != NULL) |
||||
*red_x = info_ptr->int_x_red; |
||||
if (red_y != NULL) |
||||
*red_y = info_ptr->int_y_red; |
||||
if (green_x != NULL) |
||||
*green_x = info_ptr->int_x_green; |
||||
if (green_y != NULL) |
||||
*green_y = info_ptr->int_y_green; |
||||
if (blue_x != NULL) |
||||
*blue_x = info_ptr->int_x_blue; |
||||
if (blue_y != NULL) |
||||
*blue_y = info_ptr->int_y_blue; |
||||
return (PNG_INFO_cHRM); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
#endif |
||||
|
||||
#if defined(PNG_gAMA_SUPPORTED) |
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED |
||||
png_uint_32 PNGAPI |
||||
png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) |
||||
&& file_gamma != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "gAMA"); |
||||
*file_gamma = (double)info_ptr->gamma; |
||||
return (PNG_INFO_gAMA); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
#ifdef PNG_FIXED_POINT_SUPPORTED |
||||
png_uint_32 PNGAPI |
||||
png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, |
||||
png_fixed_point *int_file_gamma) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) |
||||
&& int_file_gamma != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "gAMA"); |
||||
*int_file_gamma = info_ptr->int_gamma; |
||||
return (PNG_INFO_gAMA); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
#endif |
||||
|
||||
#if defined(PNG_sRGB_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) |
||||
&& file_srgb_intent != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "sRGB"); |
||||
*file_srgb_intent = (int)info_ptr->srgb_intent; |
||||
return (PNG_INFO_sRGB); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_iCCP_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_iCCP(png_structp png_ptr, png_infop info_ptr, |
||||
png_charpp name, int *compression_type, |
||||
png_charpp profile, png_uint_32 *proflen) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) |
||||
&& name != NULL && profile != NULL && proflen != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "iCCP"); |
||||
*name = info_ptr->iccp_name; |
||||
*profile = info_ptr->iccp_profile; |
||||
/* compression_type is a dummy so the API won't have to change
|
||||
if we introduce multiple compression types later. */ |
||||
*proflen = (int)info_ptr->iccp_proflen; |
||||
*compression_type = (int)info_ptr->iccp_compression; |
||||
return (PNG_INFO_iCCP); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_sPLT_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_sPLT(png_structp png_ptr, png_infop info_ptr, |
||||
png_sPLT_tpp spalettes) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) |
||||
*spalettes = info_ptr->splt_palettes; |
||||
return ((png_uint_32)info_ptr->splt_palettes_num); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_hIST_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) |
||||
&& hist != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "hIST"); |
||||
*hist = info_ptr->hist; |
||||
return (PNG_INFO_hIST); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_IHDR(png_structp png_ptr, png_infop info_ptr, |
||||
png_uint_32 *width, png_uint_32 *height, int *bit_depth, |
||||
int *color_type, int *interlace_type, int *compression_type, |
||||
int *filter_type) |
||||
|
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL && |
||||
bit_depth != NULL && color_type != NULL) |
||||
{ |
||||
int pixel_depth, channels; |
||||
png_uint_32 rowbytes_per_pixel; |
||||
|
||||
png_debug1(1, "in %s retrieval function\n", "IHDR"); |
||||
*width = info_ptr->width; |
||||
*height = info_ptr->height; |
||||
*bit_depth = info_ptr->bit_depth; |
||||
*color_type = info_ptr->color_type; |
||||
if (compression_type != NULL) |
||||
*compression_type = info_ptr->compression_type; |
||||
if (filter_type != NULL) |
||||
*filter_type = info_ptr->filter_type; |
||||
if (interlace_type != NULL) |
||||
*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) |
||||
channels = 3; |
||||
else |
||||
channels = 1; |
||||
if (*color_type & PNG_COLOR_MASK_ALPHA) |
||||
channels++; |
||||
pixel_depth = *bit_depth * channels; |
||||
rowbytes_per_pixel = (pixel_depth + 7) >> 3; |
||||
if ((*width > PNG_MAX_UINT/rowbytes_per_pixel)) |
||||
{ |
||||
png_warning(png_ptr, |
||||
"Width too large for libpng to process image data."); |
||||
} |
||||
return (1); |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
#if defined(PNG_oFFs_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_oFFs(png_structp png_ptr, png_infop info_ptr, |
||||
png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) |
||||
&& offset_x != NULL && offset_y != NULL && unit_type != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "oFFs"); |
||||
*offset_x = info_ptr->x_offset; |
||||
*offset_y = info_ptr->y_offset; |
||||
*unit_type = (int)info_ptr->offset_unit_type; |
||||
return (PNG_INFO_oFFs); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_pCAL_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_pCAL(png_structp png_ptr, png_infop info_ptr, |
||||
png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, |
||||
png_charp *units, png_charpp *params) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) |
||||
&& purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && |
||||
nparams != NULL && units != NULL && params != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "pCAL"); |
||||
*purpose = info_ptr->pcal_purpose; |
||||
*X0 = info_ptr->pcal_X0; |
||||
*X1 = info_ptr->pcal_X1; |
||||
*type = (int)info_ptr->pcal_type; |
||||
*nparams = (int)info_ptr->pcal_nparams; |
||||
*units = info_ptr->pcal_units; |
||||
*params = info_ptr->pcal_params; |
||||
return (PNG_INFO_pCAL); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_sCAL_SUPPORTED) |
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED |
||||
png_uint_32 PNGAPI |
||||
png_get_sCAL(png_structp png_ptr, png_infop info_ptr, |
||||
int *unit, double *width, double *height) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && |
||||
(info_ptr->valid & PNG_INFO_sCAL)) |
||||
{ |
||||
*unit = info_ptr->scal_unit; |
||||
*width = info_ptr->scal_pixel_width; |
||||
*height = info_ptr->scal_pixel_height; |
||||
return (PNG_INFO_sCAL); |
||||
} |
||||
return(0); |
||||
} |
||||
#else |
||||
#ifdef PNG_FIXED_POINT_SUPPORTED |
||||
png_uint_32 PNGAPI |
||||
png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr, |
||||
int *unit, png_charpp width, png_charpp height) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && |
||||
(info_ptr->valid & PNG_INFO_sCAL)) |
||||
{ |
||||
*unit = info_ptr->scal_unit; |
||||
*width = info_ptr->scal_s_width; |
||||
*height = info_ptr->scal_s_height; |
||||
return (PNG_INFO_sCAL); |
||||
} |
||||
return(0); |
||||
} |
||||
#endif |
||||
#endif |
||||
#endif |
||||
|
||||
#if defined(PNG_pHYs_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_pHYs(png_structp png_ptr, png_infop info_ptr, |
||||
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) |
||||
{ |
||||
png_uint_32 retval = 0; |
||||
|
||||
if (png_ptr != NULL && info_ptr != NULL && |
||||
(info_ptr->valid & PNG_INFO_pHYs)) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "pHYs"); |
||||
if (res_x != NULL) |
||||
{ |
||||
*res_x = info_ptr->x_pixels_per_unit; |
||||
retval |= PNG_INFO_pHYs; |
||||
} |
||||
if (res_y != NULL) |
||||
{ |
||||
*res_y = info_ptr->y_pixels_per_unit; |
||||
retval |= PNG_INFO_pHYs; |
||||
} |
||||
if (unit_type != NULL) |
||||
{ |
||||
*unit_type = (int)info_ptr->phys_unit_type; |
||||
retval |= PNG_INFO_pHYs; |
||||
} |
||||
} |
||||
return (retval); |
||||
} |
||||
#endif |
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, |
||||
int *num_palette) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) |
||||
&& palette != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "PLTE"); |
||||
*palette = info_ptr->palette; |
||||
*num_palette = info_ptr->num_palette; |
||||
png_debug1(3, "num_palette = %d\n", *num_palette); |
||||
return (PNG_INFO_PLTE); |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
#if defined(PNG_sBIT_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) |
||||
&& sig_bit != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "sBIT"); |
||||
*sig_bit = &(info_ptr->sig_bit); |
||||
return (PNG_INFO_sBIT); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_TEXT_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, |
||||
int *num_text) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", |
||||
(png_ptr->chunk_name[0] == '\0' ? "text" |
||||
: (png_const_charp)png_ptr->chunk_name)); |
||||
if (text_ptr != NULL) |
||||
*text_ptr = info_ptr->text; |
||||
if (num_text != NULL) |
||||
*num_text = info_ptr->num_text; |
||||
return ((png_uint_32)info_ptr->num_text); |
||||
} |
||||
if (num_text != NULL) |
||||
*num_text = 0; |
||||
return(0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_tIME_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) |
||||
&& mod_time != NULL) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "tIME"); |
||||
*mod_time = &(info_ptr->mod_time); |
||||
return (PNG_INFO_tIME); |
||||
} |
||||
return (0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_tRNS_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_tRNS(png_structp png_ptr, png_infop info_ptr, |
||||
png_bytep *trans, int *num_trans, png_color_16p *trans_values) |
||||
{ |
||||
png_uint_32 retval = 0; |
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) |
||||
{ |
||||
png_debug1(1, "in %s retrieval function\n", "tRNS"); |
||||
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) |
||||
{ |
||||
if (trans != NULL) |
||||
{ |
||||
*trans = info_ptr->trans; |
||||
retval |= PNG_INFO_tRNS; |
||||
} |
||||
if (trans_values != NULL) |
||||
*trans_values = &(info_ptr->trans_values); |
||||
} |
||||
else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ |
||||
{ |
||||
if (trans_values != NULL) |
||||
{ |
||||
*trans_values = &(info_ptr->trans_values); |
||||
retval |= PNG_INFO_tRNS; |
||||
} |
||||
if(trans != NULL) |
||||
*trans = NULL; |
||||
} |
||||
if(num_trans != NULL) |
||||
{ |
||||
*num_trans = info_ptr->num_trans; |
||||
retval |= PNG_INFO_tRNS; |
||||
} |
||||
} |
||||
return (retval); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) |
||||
png_uint_32 PNGAPI |
||||
png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, |
||||
png_unknown_chunkpp unknowns) |
||||
{ |
||||
if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) |
||||
*unknowns = info_ptr->unknown_chunks; |
||||
return ((png_uint_32)info_ptr->unknown_chunks_num); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) |
||||
png_byte PNGAPI |
||||
png_get_rgb_to_gray_status (png_structp png_ptr) |
||||
{ |
||||
return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_USER_CHUNKS_SUPPORTED) |
||||
png_voidp PNGAPI |
||||
png_get_user_chunk_ptr(png_structp png_ptr) |
||||
{ |
||||
return (png_ptr? png_ptr->user_chunk_ptr : NULL); |
||||
} |
||||
#endif |
||||
|
||||
|
||||
png_uint_32 PNGAPI |
||||
png_get_compression_buffer_size(png_structp png_ptr) |
||||
{ |
||||
return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L); |
||||
} |
||||
|
||||
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED |
||||
/* this function was added to libpng 1.2.0 and should exist by default*/ |
||||
png_uint_32 PNGAPI |
||||
png_get_asm_flags (png_structp png_ptr) |
||||
{ |
||||
return (png_uint_32)(png_ptr? png_ptr->asm_flags : 0L); |
||||
} |
||||
|
||||
/* this function was added to libpng 1.2.0 and should exist by default */ |
||||
png_uint_32 PNGAPI |
||||
png_get_asm_flagmask (int flag_select) |
||||
{ |
||||
png_uint_32 settable_asm_flags = 0; |
||||
|
||||
if (flag_select & PNG_SELECT_READ) |
||||
settable_asm_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 ; |
||||
/* no non-MMX flags yet */ |
||||
|
||||
#if 0 |
||||
/* GRR: no write-flags yet, either, but someday... */ |
||||
if (flag_select & PNG_SELECT_WRITE) |
||||
settable_asm_flags |= |
||||
PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; |
||||
#endif /* 0 */ |
||||
|
||||
return settable_asm_flags; /* _theoretically_ settable capabilities only */ |
||||
} |
||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ |
||||
|
||||
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) |
||||
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ |
||||
/* this function was added to libpng 1.2.0 */ |
||||
png_uint_32 PNGAPI |
||||
png_get_mmx_flagmask (int flag_select, int *compilerID) |
||||
{ |
||||
png_uint_32 settable_mmx_flags = 0; |
||||
|
||||
if (flag_select & PNG_SELECT_READ) |
||||
settable_mmx_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 ; |
||||
#if 0 |
||||
/* GRR: no MMX write support yet, but someday... */ |
||||
if (flag_select & PNG_SELECT_WRITE) |
||||
settable_mmx_flags |= |
||||
PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; |
||||
#endif /* 0 */ |
||||
|
||||
if (compilerID != NULL) { |
||||
#ifdef PNG_USE_PNGVCRD |
||||
*compilerID = 1; /* MSVC */ |
||||
#else |
||||
#ifdef PNG_USE_PNGGCCRD |
||||
*compilerID = 2; /* gcc/gas */ |
||||
#else |
||||
*compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ |
||||
#endif |
||||
#endif |
||||
} |
||||
|
||||
return settable_mmx_flags; /* _theoretically_ settable capabilities only */ |
||||
} |
||||
|
||||
/* this function was added to libpng 1.2.0 */ |
||||
png_byte PNGAPI |
||||
png_get_mmx_bitdepth_threshold (png_structp png_ptr) |
||||
{ |
||||
return (png_byte)(png_ptr? png_ptr->mmx_bitdepth_threshold : 0); |
||||
} |
||||
|
||||
/* this function was added to libpng 1.2.0 */ |
||||
png_uint_32 PNGAPI |
||||
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 */ |
@ -1,517 +0,0 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
* |
||||
* This file provides a location for all memory allocation. Users who |
||||
* need special memory handling are expected to supply replacement |
||||
* functions for png_malloc() and png_free(), and to use |
||||
* png_create_read_struct_2() and png_create_write_struct_2() to |
||||
* identify the replacement functions. |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
|
||||
/* Borland DOS special memory handler */ |
||||
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) |
||||
/* if you change this, be sure to change the one in png.h also */ |
||||
|
||||
/* Allocate memory for a png_struct. The malloc and memset can be replaced
|
||||
by a single call to calloc() if this is thought to improve performance. */ |
||||
png_voidp /* PRIVATE */ |
||||
png_create_struct(int type) |
||||
{ |
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
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. */ |
||||
png_voidp /* PRIVATE */ |
||||
png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr) |
||||
{ |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
png_size_t size; |
||||
png_voidp struct_ptr; |
||||
|
||||
if (type == PNG_STRUCT_INFO) |
||||
size = sizeof(png_info); |
||||
else if (type == PNG_STRUCT_PNG) |
||||
size = sizeof(png_struct); |
||||
else |
||||
return (NULL); |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if(malloc_fn != NULL) |
||||
{ |
||||
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 */ |
||||
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); |
||||
} |
||||
|
||||
/* Free memory allocated by a png_create_struct() call */ |
||||
void /* PRIVATE */ |
||||
png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, |
||||
png_voidp mem_ptr) |
||||
{ |
||||
#endif |
||||
if (struct_ptr != NULL) |
||||
{ |
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if(free_fn != NULL) |
||||
{ |
||||
png_struct dummy_struct; |
||||
png_structp png_ptr = &dummy_struct; |
||||
png_ptr->mem_ptr=mem_ptr; |
||||
(*(free_fn))(png_ptr, struct_ptr); |
||||
return; |
||||
} |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
farfree (struct_ptr); |
||||
} |
||||
} |
||||
|
||||
/* Allocate memory. For reasonable files, size should never exceed
|
||||
* 64K. However, zlib may allocate more then 64K if you don't tell |
||||
* it not to. See zconf.h and png.h for more information. zlib does |
||||
* need to allocate exactly 64K, so whatever you call here must |
||||
* have the ability to do that. |
||||
* |
||||
* Borland seems to have a problem in DOS mode for exactly 64K. |
||||
* It gives you a segment with an offset of 8 (perhaps to store its |
||||
* memory stuff). zlib doesn't like this at all, so we have to |
||||
* detect and deal with it. This code should not be needed in |
||||
* Windows or OS/2 modes, and only in 16 bit mode. This code has |
||||
* been updated by Alexander Lehmann for version 0.89 to waste less |
||||
* memory. |
||||
* |
||||
* Note that we can't use png_size_t for the "size" declaration, |
||||
* since on some systems a png_size_t is a 16-bit quantity, and as a |
||||
* result, we would be truncating potentially larger memory requests |
||||
* (which should cause a fatal error) and introducing major problems. |
||||
*/ |
||||
png_voidp PNGAPI |
||||
png_malloc(png_structp png_ptr, png_uint_32 size) |
||||
{ |
||||
#ifndef PNG_USER_MEM_SUPPORTED |
||||
png_voidp ret; |
||||
#endif |
||||
if (png_ptr == NULL || size == 0) |
||||
return (NULL); |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if(png_ptr->malloc_fn != NULL) |
||||
{ |
||||
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); |
||||
if (ret == NULL) |
||||
png_error(png_ptr, "Out of memory!"); |
||||
return (ret); |
||||
} |
||||
else |
||||
return png_malloc_default(png_ptr, size); |
||||
} |
||||
|
||||
png_voidp PNGAPI |
||||
png_malloc_default(png_structp png_ptr, png_uint_32 size) |
||||
{ |
||||
png_voidp ret; |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K |
||||
if (size > (png_uint_32)65536L) |
||||
png_error(png_ptr, "Cannot Allocate > 64K"); |
||||
#endif |
||||
|
||||
if (size == (png_uint_32)65536L) |
||||
{ |
||||
if (png_ptr->offset_table == NULL) |
||||
{ |
||||
/* try to see if we need to do any of this fancy stuff */ |
||||
ret = farmalloc(size); |
||||
if (ret == NULL || ((png_size_t)ret & 0xffff)) |
||||
{ |
||||
int num_blocks; |
||||
png_uint_32 total_size; |
||||
png_bytep table; |
||||
int i; |
||||
png_byte huge * hptr; |
||||
|
||||
if (ret != NULL) |
||||
{ |
||||
farfree(ret); |
||||
ret = NULL; |
||||
} |
||||
|
||||
if(png_ptr->zlib_window_bits > 14) |
||||
num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14)); |
||||
else |
||||
num_blocks = 1; |
||||
if (png_ptr->zlib_mem_level >= 7) |
||||
num_blocks += (int)(1 << (png_ptr->zlib_mem_level - 7)); |
||||
else |
||||
num_blocks++; |
||||
|
||||
total_size = ((png_uint_32)65536L) * (png_uint_32)num_blocks+16; |
||||
|
||||
table = farmalloc(total_size); |
||||
|
||||
if (table == NULL) |
||||
{ |
||||
png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */ |
||||
} |
||||
|
||||
if ((png_size_t)table & 0xfff0) |
||||
{ |
||||
png_error(png_ptr, "Farmalloc didn't return normalized pointer"); |
||||
} |
||||
|
||||
png_ptr->offset_table = table; |
||||
png_ptr->offset_table_ptr = farmalloc(num_blocks * |
||||
sizeof (png_bytep)); |
||||
|
||||
if (png_ptr->offset_table_ptr == NULL) |
||||
{ |
||||
png_error(png_ptr, "Out Of memory."); |
||||
} |
||||
|
||||
hptr = (png_byte huge *)table; |
||||
if ((png_size_t)hptr & 0xf) |
||||
{ |
||||
hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L); |
||||
hptr = hptr + 16L; /* "hptr += 16L" fails on Turbo C++ 3.0 */ |
||||
} |
||||
for (i = 0; i < num_blocks; i++) |
||||
{ |
||||
png_ptr->offset_table_ptr[i] = (png_bytep)hptr; |
||||
hptr = hptr + (png_uint_32)65536L; /* "+=" fails on TC++3.0 */ |
||||
} |
||||
|
||||
png_ptr->offset_table_number = num_blocks; |
||||
png_ptr->offset_table_count = 0; |
||||
png_ptr->offset_table_count_free = 0; |
||||
} |
||||
} |
||||
|
||||
if (png_ptr->offset_table_count >= png_ptr->offset_table_number) |
||||
png_error(png_ptr, "Out of Memory."); |
||||
|
||||
ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++]; |
||||
} |
||||
else |
||||
ret = farmalloc(size); |
||||
|
||||
if (ret == NULL) |
||||
{ |
||||
png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */ |
||||
} |
||||
|
||||
return (ret); |
||||
} |
||||
|
||||
/* free a pointer allocated by png_malloc(). In the default
|
||||
configuration, png_ptr is not used, but is passed in case it |
||||
is needed. If ptr is NULL, return without taking any action. */ |
||||
void PNGAPI |
||||
png_free(png_structp png_ptr, png_voidp ptr) |
||||
{ |
||||
if (png_ptr == NULL || ptr == NULL) |
||||
return; |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if (png_ptr->free_fn != NULL) |
||||
{ |
||||
(*(png_ptr->free_fn))(png_ptr, ptr); |
||||
return; |
||||
} |
||||
else png_free_default(png_ptr, ptr); |
||||
} |
||||
|
||||
void PNGAPI |
||||
png_free_default(png_structp png_ptr, png_voidp ptr) |
||||
{ |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
|
||||
if (png_ptr->offset_table != NULL) |
||||
{ |
||||
int i; |
||||
|
||||
for (i = 0; i < png_ptr->offset_table_count; i++) |
||||
{ |
||||
if (ptr == png_ptr->offset_table_ptr[i]) |
||||
{ |
||||
ptr = NULL; |
||||
png_ptr->offset_table_count_free++; |
||||
break; |
||||
} |
||||
} |
||||
if (png_ptr->offset_table_count_free == png_ptr->offset_table_count) |
||||
{ |
||||
farfree(png_ptr->offset_table); |
||||
farfree(png_ptr->offset_table_ptr); |
||||
png_ptr->offset_table = NULL; |
||||
png_ptr->offset_table_ptr = NULL; |
||||
} |
||||
} |
||||
|
||||
if (ptr != NULL) |
||||
{ |
||||
farfree(ptr); |
||||
} |
||||
} |
||||
|
||||
#else /* Not the Borland DOS special memory handler */ |
||||
|
||||
/* Allocate memory for a png_struct or a png_info. The malloc and
|
||||
memset can be replaced by a single call to calloc() if this is thought |
||||
to improve performance noticably.*/ |
||||
png_voidp /* PRIVATE */ |
||||
png_create_struct(int type) |
||||
{ |
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
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
|
||||
memset can be replaced by a single call to calloc() if this is thought |
||||
to improve performance noticably.*/ |
||||
png_voidp /* PRIVATE */ |
||||
png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr) |
||||
{ |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
png_size_t size; |
||||
png_voidp struct_ptr; |
||||
|
||||
if (type == PNG_STRUCT_INFO) |
||||
size = sizeof(png_info); |
||||
else if (type == PNG_STRUCT_PNG) |
||||
size = sizeof(png_struct); |
||||
else |
||||
return (NULL); |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if(malloc_fn != NULL) |
||||
{ |
||||
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); |
||||
} |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
|
||||
#if defined(__TURBOC__) && !defined(__FLAT__) |
||||
if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL) |
||||
#else |
||||
# if defined(_MSC_VER) && defined(MAXSEG_64K) |
||||
if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL) |
||||
# else |
||||
if ((struct_ptr = (png_voidp)malloc(size)) != NULL) |
||||
# endif |
||||
#endif |
||||
{ |
||||
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); |
||||
} |
||||
|
||||
/* Free memory allocated by a png_create_struct() call */ |
||||
void /* PRIVATE */ |
||||
png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, |
||||
png_voidp mem_ptr) |
||||
{ |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
if (struct_ptr != NULL) |
||||
{ |
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if(free_fn != NULL) |
||||
{ |
||||
png_struct dummy_struct; |
||||
png_structp png_ptr = &dummy_struct; |
||||
png_ptr->mem_ptr=mem_ptr; |
||||
(*(free_fn))(png_ptr, struct_ptr); |
||||
return; |
||||
} |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
#if defined(__TURBOC__) && !defined(__FLAT__) |
||||
farfree(struct_ptr); |
||||
#else |
||||
# if defined(_MSC_VER) && defined(MAXSEG_64K) |
||||
hfree(struct_ptr); |
||||
# else |
||||
free(struct_ptr); |
||||
# endif |
||||
#endif |
||||
} |
||||
} |
||||
|
||||
|
||||
/* Allocate memory. For reasonable files, size should never exceed
|
||||
64K. However, zlib may allocate more then 64K if you don't tell |
||||
it not to. See zconf.h and png.h for more information. zlib does |
||||
need to allocate exactly 64K, so whatever you call here must |
||||
have the ability to do that. */ |
||||
|
||||
png_voidp PNGAPI |
||||
png_malloc(png_structp png_ptr, png_uint_32 size) |
||||
{ |
||||
png_voidp ret; |
||||
if (png_ptr == NULL || size == 0) |
||||
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) |
||||
png_error(png_ptr, "Out of Memory!"); |
||||
return (ret); |
||||
} |
||||
else |
||||
return (png_malloc_default(png_ptr, size)); |
||||
} |
||||
png_voidp /* PRIVATE */ |
||||
png_malloc_default(png_structp png_ptr, png_uint_32 size) |
||||
{ |
||||
png_voidp ret; |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K |
||||
if (size > (png_uint_32)65536L) |
||||
png_error(png_ptr, "Cannot Allocate > 64K"); |
||||
#endif |
||||
|
||||
#if defined(__TURBOC__) && !defined(__FLAT__) |
||||
ret = farmalloc(size); |
||||
#else |
||||
# if defined(_MSC_VER) && defined(MAXSEG_64K) |
||||
ret = halloc(size, 1); |
||||
# else |
||||
ret = malloc((size_t)size); |
||||
# endif |
||||
#endif |
||||
|
||||
if (ret == NULL) |
||||
png_error(png_ptr, "Out of Memory"); |
||||
|
||||
return (ret); |
||||
} |
||||
|
||||
/* Free a pointer allocated by png_malloc(). If ptr is NULL, return
|
||||
without taking any action. */ |
||||
void PNGAPI |
||||
png_free(png_structp png_ptr, png_voidp ptr) |
||||
{ |
||||
if (png_ptr == NULL || ptr == NULL) |
||||
return; |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
if (png_ptr->free_fn != NULL) |
||||
{ |
||||
(*(png_ptr->free_fn))(png_ptr, ptr); |
||||
return; |
||||
} |
||||
else png_free_default(png_ptr, ptr); |
||||
} |
||||
void /* PRIVATE */ |
||||
png_free_default(png_structp png_ptr, png_voidp ptr) |
||||
{ |
||||
if (png_ptr == NULL || ptr == NULL) |
||||
return; |
||||
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
||||
|
||||
#if defined(__TURBOC__) && !defined(__FLAT__) |
||||
farfree(ptr); |
||||
#else |
||||
# if defined(_MSC_VER) && defined(MAXSEG_64K) |
||||
hfree(ptr); |
||||
# else |
||||
free(ptr); |
||||
# endif |
||||
#endif |
||||
} |
||||
|
||||
#endif /* Not Borland DOS special memory handler */ |
||||
|
||||
png_voidp /* PRIVATE */ |
||||
png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2, |
||||
png_uint_32 length) |
||||
{ |
||||
png_size_t size; |
||||
|
||||
size = (png_size_t)length; |
||||
if ((png_uint_32)size != length) |
||||
png_error(png_ptr,"Overflow in png_memcpy_check."); |
||||
|
||||
return(png_memcpy (s1, s2, size)); |
||||
} |
||||
|
||||
png_voidp /* PRIVATE */ |
||||
png_memset_check (png_structp png_ptr, png_voidp s1, int value, |
||||
png_uint_32 length) |
||||
{ |
||||
png_size_t size; |
||||
|
||||
size = (png_size_t)length; |
||||
if ((png_uint_32)size != length) |
||||
png_error(png_ptr,"Overflow in png_memset_check."); |
||||
|
||||
return (png_memset (s1, value, size)); |
||||
|
||||
} |
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED |
||||
/* This function is called when the application wants to use another method
|
||||
* of allocating and freeing memory. |
||||
*/ |
||||
void PNGAPI |
||||
png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr |
||||
malloc_fn, png_free_ptr free_fn) |
||||
{ |
||||
png_ptr->mem_ptr = mem_ptr; |
||||
png_ptr->malloc_fn = malloc_fn; |
||||
png_ptr->free_fn = free_fn; |
||||
} |
||||
|
||||
/* This function returns a pointer to the mem_ptr associated with the user
|
||||
* functions. The application should free any memory associated with this |
||||
* pointer before png_write_destroy and png_read_destroy are called. |
||||
*/ |
||||
png_voidp PNGAPI |
||||
png_get_mem_ptr(png_structp png_ptr) |
||||
{ |
||||
return ((png_voidp)png_ptr->mem_ptr); |
||||
} |
||||
#endif /* PNG_USER_MEM_SUPPORTED */ |
Before Width: | Height: | Size: 2.0 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,161 +0,0 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
* |
||||
* This file provides a location for all input. Users who need |
||||
* special handling are expected to write a function that has the same |
||||
* arguments as this and performs a similar function, but that possibly |
||||
* has a different input method. Note that you shouldn't change this |
||||
* function, but rather write a replacement function and then make |
||||
* libpng use it at run time with png_set_read_fn(...). |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
|
||||
/* Read the data from whatever input you are using. The default routine
|
||||
reads from a file pointer. Note that this routine sometimes gets called |
||||
with very small lengths, so you should implement some kind of simple |
||||
buffering if you are using unbuffered reads. This should never be asked |
||||
to read more then 64K on a 16 bit machine. */ |
||||
void /* PRIVATE */ |
||||
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) |
||||
{ |
||||
png_debug1(4,"reading %d bytes\n", (int)length); |
||||
if (png_ptr->read_data_fn != NULL) |
||||
(*(png_ptr->read_data_fn))(png_ptr, data, length); |
||||
else |
||||
png_error(png_ptr, "Call to NULL read function"); |
||||
} |
||||
|
||||
#if !defined(PNG_NO_STDIO) |
||||
/* This is the function that does the actual reading of data. If you are
|
||||
not reading from a standard C stream, you should create a replacement |
||||
read_data function and use it at run time with png_set_read_fn(), rather |
||||
than changing the library. */ |
||||
#ifndef USE_FAR_KEYWORD |
||||
static void /* PRIVATE */ |
||||
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) |
||||
{ |
||||
png_size_t check; |
||||
|
||||
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
||||
* instead of an int, which is what fread() actually returns. |
||||
*/ |
||||
#if defined(_WIN32_WCE) |
||||
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) |
||||
check = 0; |
||||
#else |
||||
check = (png_size_t)fread(data, (png_size_t)1, length, |
||||
(png_FILE_p)png_ptr->io_ptr); |
||||
#endif |
||||
|
||||
if (check != length) |
||||
png_error(png_ptr, "Read Error"); |
||||
} |
||||
#else |
||||
/* this is the model-independent version. Since the standard I/O library
|
||||
can't handle far buffers in the medium and small models, we have to copy |
||||
the data. |
||||
*/ |
||||
|
||||
#define NEAR_BUF_SIZE 1024 |
||||
#define MIN(a,b) (a <= b ? a : b) |
||||
|
||||
static void /* PRIVATE */ |
||||
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) |
||||
{ |
||||
int check; |
||||
png_byte *n_data; |
||||
png_FILE_p io_ptr; |
||||
|
||||
/* Check if data really is near. If so, use usual code. */ |
||||
n_data = (png_byte *)CVT_PTR_NOCHECK(data); |
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); |
||||
if ((png_bytep)n_data == data) |
||||
{ |
||||
#if defined(_WIN32_WCE) |
||||
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) |
||||
check = 0; |
||||
#else |
||||
check = fread(n_data, 1, length, io_ptr); |
||||
#endif |
||||
} |
||||
else |
||||
{ |
||||
png_byte buf[NEAR_BUF_SIZE]; |
||||
png_size_t read, remaining, err; |
||||
check = 0; |
||||
remaining = length; |
||||
do |
||||
{ |
||||
read = MIN(NEAR_BUF_SIZE, remaining); |
||||
#if defined(_WIN32_WCE) |
||||
if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) ) |
||||
err = 0; |
||||
#else |
||||
err = fread(buf, (png_size_t)1, read, io_ptr); |
||||
#endif |
||||
png_memcpy(data, buf, read); /* copy far buffer to near buffer */ |
||||
if(err != read) |
||||
break; |
||||
else |
||||
check += err; |
||||
data += read; |
||||
remaining -= read; |
||||
} |
||||
while (remaining != 0); |
||||
} |
||||
if ((png_uint_32)check != (png_uint_32)length) |
||||
png_error(png_ptr, "read Error"); |
||||
} |
||||
#endif |
||||
#endif |
||||
|
||||
/* This function allows the application to supply a new input function
|
||||
for libpng if standard C streams aren't being used. |
||||
|
||||
This function takes as its arguments: |
||||
png_ptr - pointer to a png input data structure |
||||
io_ptr - pointer to user supplied structure containing info about |
||||
the input functions. May be NULL. |
||||
read_data_fn - pointer to a new input function that takes as its |
||||
arguments a pointer to a png_struct, a pointer to |
||||
a location where input data can be stored, and a 32-bit |
||||
unsigned int that is the number of bytes to be read. |
||||
To exit and output any fatal error messages the new write |
||||
function should call png_error(png_ptr, "Error msg"). */ |
||||
void PNGAPI |
||||
png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, |
||||
png_rw_ptr read_data_fn) |
||||
{ |
||||
png_ptr->io_ptr = io_ptr; |
||||
|
||||
#if !defined(PNG_NO_STDIO) |
||||
if (read_data_fn != NULL) |
||||
png_ptr->read_data_fn = read_data_fn; |
||||
else |
||||
png_ptr->read_data_fn = png_default_read_data; |
||||
#else |
||||
png_ptr->read_data_fn = read_data_fn; |
||||
#endif |
||||
|
||||
/* It is an error to write to a read device */ |
||||
if (png_ptr->write_data_fn != NULL) |
||||
{ |
||||
png_ptr->write_data_fn = NULL; |
||||
png_warning(png_ptr, |
||||
"It's an error to set both read_data_fn and write_data_fn in the "); |
||||
png_warning(png_ptr, |
||||
"same structure. Resetting write_data_fn to NULL."); |
||||
} |
||||
|
||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED) |
||||
png_ptr->output_flush_fn = NULL; |
||||
#endif |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,104 +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 (x86) Console Application" 0x0103 |
||||
|
||||
CFG=pngtest - Win32 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 Debug" |
||||
!MESSAGE |
||||
!MESSAGE Possible choices for configuration are: |
||||
!MESSAGE |
||||
!MESSAGE "pngtest - Win32 Release" (based on "Win32 (x86) Console Application") |
||||
!MESSAGE "pngtest - Win32 Debug" (based on "Win32 (x86) Console Application") |
||||
!MESSAGE |
||||
|
||||
# Begin Project |
||||
# PROP AllowPerConfigDependencies 0 |
||||
# PROP Scc_ProjName "" |
||||
# PROP Scc_LocalPath "" |
||||
CPP=cl.exe |
||||
RSC=rc.exe |
||||
|
||||
!IF "$(CFG)" == "pngtest - Win32 Release" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir "Release" |
||||
# PROP BASE Intermediate_Dir "Release" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir "bin" |
||||
# PROP Intermediate_Dir "Release" |
||||
# PROP Ignore_Export_Lib 0 |
||||
# PROP Target_Dir "" |
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c |
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../zlib/inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c |
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" |
||||
# ADD RSC /l 0x409 /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.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:console /machine:I386 |
||||
# ADD LINK32 ../zlib/lib/zlib.lib /nologo /subsystem:console /machine:I386 |
||||
# SUBTRACT LINK32 /nodefaultlib |
||||
|
||||
!ELSEIF "$(CFG)" == "pngtest - Win32 Debug" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 1 |
||||
# PROP BASE Output_Dir "pngtest___Win32_Debug" |
||||
# PROP BASE Intermediate_Dir "pngtest___Win32_Debug" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 1 |
||||
# PROP Output_Dir "bin" |
||||
# PROP Intermediate_Dir "Debug" |
||||
# PROP Ignore_Export_Lib 0 |
||||
# PROP Target_Dir "" |
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c |
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../zlib/inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c |
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" |
||||
# ADD RSC /l 0x409 /d "_DEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.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:console /debug /machine:I386 /pdbtype:sept |
||||
# ADD LINK32 ../zlib/lib/zlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept |
||||
# SUBTRACT LINK32 /nodefaultlib |
||||
|
||||
!ENDIF |
||||
|
||||
# Begin Target |
||||
|
||||
# Name "pngtest - Win32 Release" |
||||
# Name "pngtest - Win32 Debug" |
||||
# Begin Group "Source Files" |
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\pngtest.c |
||||
# 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,99 +0,0 @@
|
||||
<html> |
||||
<body> |
||||
<pre> |
||||
<h1>Build Log</h1> |
||||
<h3> |
||||
--------------------Configuration: libpng - Win32 Release-------------------- |
||||
</h3> |
||||
<h3>Command Lines</h3> |
||||
Creating temporary file "C:\DOCUME~1\ERICAN~1\LOCALS~1\Temp\RSPEE8.tmp" with contents |
||||
[ |
||||
/nologo /MD /W3 /GX /O2 /I "../zlib/inc" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"Release/libpng.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c |
||||
"E:\StaticSDKs\XPlatform\png\example.c" |
||||
"E:\StaticSDKs\XPlatform\png\png.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngerror.c" |
||||
"E:\StaticSDKs\XPlatform\png\pnggccrd.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngget.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngmem.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngpread.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngread.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngrio.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngrtran.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngrutil.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngset.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngtrans.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngvcrd.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngwio.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngwrite.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngwtran.c" |
||||
"E:\StaticSDKs\XPlatform\png\pngwutil.c" |
||||
] |
||||
Creating command line "cl.exe @C:\DOCUME~1\ERICAN~1\LOCALS~1\Temp\RSPEE8.tmp" |
||||
Creating temporary file "C:\DOCUME~1\ERICAN~1\LOCALS~1\Temp\RSPEE9.tmp" with contents |
||||
[ |
||||
/nologo /out:"lib\libpng.lib" |
||||
.\Release\example.obj |
||||
.\Release\png.obj |
||||
.\Release\pngerror.obj |
||||
.\Release\pnggccrd.obj |
||||
.\Release\pngget.obj |
||||
.\Release\pngmem.obj |
||||
.\Release\pngpread.obj |
||||
.\Release\pngread.obj |
||||
.\Release\pngrio.obj |
||||
.\Release\pngrtran.obj |
||||
.\Release\pngrutil.obj |
||||
.\Release\pngset.obj |
||||
.\Release\pngtrans.obj |
||||
.\Release\pngvcrd.obj |
||||
.\Release\pngwio.obj |
||||
.\Release\pngwrite.obj |
||||
.\Release\pngwtran.obj |
||||
.\Release\pngwutil.obj |
||||
] |
||||
Creating command line "link.exe -lib @C:\DOCUME~1\ERICAN~1\LOCALS~1\Temp\RSPEE9.tmp" |
||||
<h3>Output Window</h3> |
||||
Compiling... |
||||
example.c |
||||
png.c |
||||
pngerror.c |
||||
pnggccrd.c |
||||
pngget.c |
||||
pngmem.c |
||||
pngpread.c |
||||
pngread.c |
||||
pngrio.c |
||||
pngrtran.c |
||||
pngrutil.c |
||||
pngset.c |
||||
pngtrans.c |
||||
pngvcrd.c |
||||
pngwio.c |
||||
pngwrite.c |
||||
pngwtran.c |
||||
pngwutil.c |
||||
Creating library... |
||||
<h3> |
||||
--------------------Configuration: pngtest - Win32 Release-------------------- |
||||
</h3> |
||||
<h3>Command Lines</h3> |
||||
Creating temporary file "C:\DOCUME~1\ERICAN~1\LOCALS~1\Temp\RSPEEB.tmp" with contents |
||||
[ |
||||
/nologo /MD /W3 /GX /O2 /I "../zlib/inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/pngtest.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c |
||||
"E:\StaticSDKs\XPlatform\png\pngtest.c" |
||||
] |
||||
Creating command line "cl.exe @C:\DOCUME~1\ERICAN~1\LOCALS~1\Temp\RSPEEB.tmp" |
||||
Creating command line "link.exe ../zlib/lib/zlib.lib /nologo /subsystem:console /incremental:no /pdb:"bin/pngtest.pdb" /machine:I386 /out:"bin/pngtest.exe" .\Release\pngtest.obj .\lib\libpng.lib " |
||||
<h3>Output Window</h3> |
||||
Compiling... |
||||
pngtest.c |
||||
Linking... |
||||
MSVCRT.lib(cinitexe.obj) : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library |
||||
|
||||
|
||||
|
||||
<h3>Results</h3> |
||||
pngtest.exe - 0 error(s), 1 warning(s) |
||||
</pre> |
||||
</body> |
||||
</html> |
Before Width: | Height: | Size: 8.4 KiB |
@ -1,640 +0,0 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
|
||||
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) |
||||
/* turn on BGR-to-RGB mapping */ |
||||
void PNGAPI |
||||
png_set_bgr(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_bgr\n"); |
||||
png_ptr->transformations |= PNG_BGR; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) |
||||
/* turn on 16 bit byte swapping */ |
||||
void PNGAPI |
||||
png_set_swap(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_swap\n"); |
||||
if (png_ptr->bit_depth == 16) |
||||
png_ptr->transformations |= PNG_SWAP_BYTES; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) |
||||
/* turn on pixel packing */ |
||||
void PNGAPI |
||||
png_set_packing(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_packing\n"); |
||||
if (png_ptr->bit_depth < 8) |
||||
{ |
||||
png_ptr->transformations |= PNG_PACK; |
||||
png_ptr->usr_bit_depth = 8; |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) |
||||
/* turn on packed pixel swapping */ |
||||
void PNGAPI |
||||
png_set_packswap(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_packswap\n"); |
||||
if (png_ptr->bit_depth < 8) |
||||
png_ptr->transformations |= PNG_PACKSWAP; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) |
||||
void PNGAPI |
||||
png_set_shift(png_structp png_ptr, png_color_8p true_bits) |
||||
{ |
||||
png_debug(1, "in png_set_shift\n"); |
||||
png_ptr->transformations |= PNG_SHIFT; |
||||
png_ptr->shift = *true_bits; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ |
||||
defined(PNG_WRITE_INTERLACING_SUPPORTED) |
||||
int PNGAPI |
||||
png_set_interlace_handling(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_interlace handling\n"); |
||||
if (png_ptr->interlaced) |
||||
{ |
||||
png_ptr->transformations |= PNG_INTERLACE; |
||||
return (7); |
||||
} |
||||
|
||||
return (1); |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) |
||||
/* Add a filler byte on read, or remove a filler or alpha byte on write.
|
||||
* The filler type has changed in v0.95 to allow future 2-byte fillers |
||||
* for 48-bit input data, as well as to avoid problems with some compilers |
||||
* that don't like bytes as parameters. |
||||
*/ |
||||
void PNGAPI |
||||
png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) |
||||
{ |
||||
png_debug(1, "in png_set_filler\n"); |
||||
png_ptr->transformations |= PNG_FILLER; |
||||
png_ptr->filler = (png_byte)filler; |
||||
if (filler_loc == PNG_FILLER_AFTER) |
||||
png_ptr->flags |= PNG_FLAG_FILLER_AFTER; |
||||
else |
||||
png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER; |
||||
|
||||
/* This should probably go in the "do_filler" routine.
|
||||
* I attempted to do that in libpng-1.0.1a but that caused problems |
||||
* so I restored it in libpng-1.0.2a |
||||
*/ |
||||
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) |
||||
{ |
||||
png_ptr->usr_channels = 4; |
||||
} |
||||
|
||||
/* Also I added this in libpng-1.0.2a (what happens when we expand
|
||||
* a less-than-8-bit grayscale to GA? */ |
||||
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8) |
||||
{ |
||||
png_ptr->usr_channels = 2; |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ |
||||
defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) |
||||
void PNGAPI |
||||
png_set_swap_alpha(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_swap_alpha\n"); |
||||
png_ptr->transformations |= PNG_SWAP_ALPHA; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ |
||||
defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) |
||||
void PNGAPI |
||||
png_set_invert_alpha(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_invert_alpha\n"); |
||||
png_ptr->transformations |= PNG_INVERT_ALPHA; |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) |
||||
void PNGAPI |
||||
png_set_invert_mono(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_set_invert_mono\n"); |
||||
png_ptr->transformations |= PNG_INVERT_MONO; |
||||
} |
||||
|
||||
/* invert monochrome grayscale data */ |
||||
void /* PRIVATE */ |
||||
png_do_invert(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_invert\n"); |
||||
/* 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) |
||||
if (row == NULL || row_info == NULL) |
||||
return; |
||||
#endif |
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY) |
||||
{ |
||||
png_bytep rp = row; |
||||
png_uint_32 i; |
||||
png_uint_32 istop = row_info->rowbytes; |
||||
|
||||
for (i = 0; i < istop; i++) |
||||
{ |
||||
*rp = (png_byte)(~(*rp)); |
||||
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 |
||||
|
||||
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) |
||||
/* swaps byte order on 16 bit depth images */ |
||||
void /* PRIVATE */ |
||||
png_do_swap(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_swap\n"); |
||||
if ( |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
row != NULL && row_info != NULL && |
||||
#endif |
||||
row_info->bit_depth == 16) |
||||
{ |
||||
png_bytep rp = row; |
||||
png_uint_32 i; |
||||
png_uint_32 istop= row_info->width * row_info->channels; |
||||
|
||||
for (i = 0; i < istop; i++, rp += 2) |
||||
{ |
||||
png_byte t = *rp; |
||||
*rp = *(rp + 1); |
||||
*(rp + 1) = t; |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) |
||||
static png_byte onebppswaptable[256] = { |
||||
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, |
||||
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, |
||||
0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, |
||||
0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, |
||||
0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, |
||||
0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, |
||||
0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, |
||||
0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, |
||||
0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, |
||||
0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, |
||||
0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, |
||||
0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, |
||||
0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, |
||||
0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, |
||||
0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, |
||||
0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, |
||||
0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, |
||||
0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, |
||||
0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, |
||||
0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, |
||||
0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, |
||||
0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, |
||||
0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, |
||||
0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, |
||||
0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, |
||||
0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, |
||||
0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, |
||||
0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, |
||||
0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, |
||||
0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, |
||||
0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, |
||||
0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF |
||||
}; |
||||
|
||||
static png_byte twobppswaptable[256] = { |
||||
0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0, |
||||
0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0, |
||||
0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4, |
||||
0x24, 0x64, 0xA4, 0xE4, 0x34, 0x74, 0xB4, 0xF4, |
||||
0x08, 0x48, 0x88, 0xC8, 0x18, 0x58, 0x98, 0xD8, |
||||
0x28, 0x68, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, |
||||
0x0C, 0x4C, 0x8C, 0xCC, 0x1C, 0x5C, 0x9C, 0xDC, |
||||
0x2C, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC, |
||||
0x01, 0x41, 0x81, 0xC1, 0x11, 0x51, 0x91, 0xD1, |
||||
0x21, 0x61, 0xA1, 0xE1, 0x31, 0x71, 0xB1, 0xF1, |
||||
0x05, 0x45, 0x85, 0xC5, 0x15, 0x55, 0x95, 0xD5, |
||||
0x25, 0x65, 0xA5, 0xE5, 0x35, 0x75, 0xB5, 0xF5, |
||||
0x09, 0x49, 0x89, 0xC9, 0x19, 0x59, 0x99, 0xD9, |
||||
0x29, 0x69, 0xA9, 0xE9, 0x39, 0x79, 0xB9, 0xF9, |
||||
0x0D, 0x4D, 0x8D, 0xCD, 0x1D, 0x5D, 0x9D, 0xDD, |
||||
0x2D, 0x6D, 0xAD, 0xED, 0x3D, 0x7D, 0xBD, 0xFD, |
||||
0x02, 0x42, 0x82, 0xC2, 0x12, 0x52, 0x92, 0xD2, |
||||
0x22, 0x62, 0xA2, 0xE2, 0x32, 0x72, 0xB2, 0xF2, |
||||
0x06, 0x46, 0x86, 0xC6, 0x16, 0x56, 0x96, 0xD6, |
||||
0x26, 0x66, 0xA6, 0xE6, 0x36, 0x76, 0xB6, 0xF6, |
||||
0x0A, 0x4A, 0x8A, 0xCA, 0x1A, 0x5A, 0x9A, 0xDA, |
||||
0x2A, 0x6A, 0xAA, 0xEA, 0x3A, 0x7A, 0xBA, 0xFA, |
||||
0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xDE, |
||||
0x2E, 0x6E, 0xAE, 0xEE, 0x3E, 0x7E, 0xBE, 0xFE, |
||||
0x03, 0x43, 0x83, 0xC3, 0x13, 0x53, 0x93, 0xD3, |
||||
0x23, 0x63, 0xA3, 0xE3, 0x33, 0x73, 0xB3, 0xF3, |
||||
0x07, 0x47, 0x87, 0xC7, 0x17, 0x57, 0x97, 0xD7, |
||||
0x27, 0x67, 0xA7, 0xE7, 0x37, 0x77, 0xB7, 0xF7, |
||||
0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x5B, 0x9B, 0xDB, |
||||
0x2B, 0x6B, 0xAB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, |
||||
0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x5F, 0x9F, 0xDF, |
||||
0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF |
||||
}; |
||||
|
||||
static png_byte fourbppswaptable[256] = { |
||||
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, |
||||
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, |
||||
0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, |
||||
0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1, |
||||
0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72, |
||||
0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2, |
||||
0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x73, |
||||
0x83, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3, |
||||
0x04, 0x14, 0x24, 0x34, 0x44, 0x54, 0x64, 0x74, |
||||
0x84, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4, |
||||
0x05, 0x15, 0x25, 0x35, 0x45, 0x55, 0x65, 0x75, |
||||
0x85, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5, |
||||
0x06, 0x16, 0x26, 0x36, 0x46, 0x56, 0x66, 0x76, |
||||
0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6, |
||||
0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, |
||||
0x87, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7, |
||||
0x08, 0x18, 0x28, 0x38, 0x48, 0x58, 0x68, 0x78, |
||||
0x88, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8, |
||||
0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, |
||||
0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9, |
||||
0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A, |
||||
0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA, |
||||
0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, |
||||
0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB, |
||||
0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, |
||||
0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC, |
||||
0x0D, 0x1D, 0x2D, 0x3D, 0x4D, 0x5D, 0x6D, 0x7D, |
||||
0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD, |
||||
0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E, |
||||
0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE, |
||||
0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, |
||||
0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF |
||||
}; |
||||
|
||||
/* swaps pixel packing order within bytes */ |
||||
void /* PRIVATE */ |
||||
png_do_packswap(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_packswap\n"); |
||||
if ( |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
row != NULL && row_info != NULL && |
||||
#endif |
||||
row_info->bit_depth < 8) |
||||
{ |
||||
png_bytep rp, end, table; |
||||
|
||||
end = row + row_info->rowbytes; |
||||
|
||||
if (row_info->bit_depth == 1) |
||||
table = onebppswaptable; |
||||
else if (row_info->bit_depth == 2) |
||||
table = twobppswaptable; |
||||
else if (row_info->bit_depth == 4) |
||||
table = fourbppswaptable; |
||||
else |
||||
return; |
||||
|
||||
for (rp = row; rp < end; rp++) |
||||
*rp = table[*rp]; |
||||
} |
||||
} |
||||
#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */ |
||||
|
||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ |
||||
defined(PNG_READ_STRIP_ALPHA_SUPPORTED) |
||||
/* remove filler or alpha byte(s) */ |
||||
void /* PRIVATE */ |
||||
png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) |
||||
{ |
||||
png_debug(1, "in png_do_strip_filler\n"); |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
if (row != NULL && row_info != NULL) |
||||
#endif |
||||
{ |
||||
/*
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB || |
||||
row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
*/ |
||||
png_bytep sp=row; |
||||
png_bytep dp=row; |
||||
png_uint_32 row_width=row_info->width; |
||||
png_uint_32 i; |
||||
|
||||
if (row_info->channels == 4) |
||||
{ |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
/* This converts from RGBX or RGBA to RGB */ |
||||
if (flags & PNG_FLAG_FILLER_AFTER) |
||||
{ |
||||
dp+=3; sp+=4; |
||||
for (i = 1; i < row_width; i++) |
||||
{ |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
sp++; |
||||
} |
||||
} |
||||
/* This converts from XRGB or ARGB to RGB */ |
||||
else |
||||
{ |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
} |
||||
} |
||||
row_info->pixel_depth = 24; |
||||
row_info->rowbytes = row_width * 3; |
||||
} |
||||
else /* if (row_info->bit_depth == 16) */ |
||||
{ |
||||
if (flags & PNG_FLAG_FILLER_AFTER) |
||||
{ |
||||
/* This converts from RRGGBBXX or RRGGBBAA to RRGGBB */ |
||||
sp += 8; dp += 6; |
||||
for (i = 1; i < row_width; i++) |
||||
{ |
||||
/* This could be (although png_memcpy is probably slower):
|
||||
png_memcpy(dp, sp, 6); |
||||
sp += 8; |
||||
dp += 6; |
||||
*/ |
||||
|
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
sp += 2; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
/* This converts from XXRRGGBB or AARRGGBB to RRGGBB */ |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
/* This could be (although png_memcpy is probably slower):
|
||||
png_memcpy(dp, sp, 6); |
||||
sp += 8; |
||||
dp += 6; |
||||
*/ |
||||
|
||||
sp+=2; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
} |
||||
} |
||||
row_info->pixel_depth = 48; |
||||
row_info->rowbytes = row_width * 6; |
||||
} |
||||
row_info->channels = 3; |
||||
row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; |
||||
} |
||||
/*
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY || |
||||
row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) |
||||
*/ |
||||
else if (row_info->channels == 2) |
||||
{ |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
/* This converts from GX or GA to G */ |
||||
if (flags & PNG_FLAG_FILLER_AFTER) |
||||
{ |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
*dp++ = *sp++; |
||||
sp++; |
||||
} |
||||
} |
||||
/* This converts from XG or AG to G */ |
||||
else |
||||
{ |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
sp++; |
||||
*dp++ = *sp++; |
||||
} |
||||
} |
||||
row_info->pixel_depth = 8; |
||||
row_info->rowbytes = row_width; |
||||
} |
||||
else /* if (row_info->bit_depth == 16) */ |
||||
{ |
||||
if (flags & PNG_FLAG_FILLER_AFTER) |
||||
{ |
||||
/* This converts from GGXX or GGAA to GG */ |
||||
sp += 4; dp += 2; |
||||
for (i = 1; i < row_width; i++) |
||||
{ |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
sp += 2; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
/* This converts from XXGG or AAGG to GG */ |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
sp += 2; |
||||
*dp++ = *sp++; |
||||
*dp++ = *sp++; |
||||
} |
||||
} |
||||
row_info->pixel_depth = 16; |
||||
row_info->rowbytes = row_width * 2; |
||||
} |
||||
row_info->channels = 1; |
||||
row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) |
||||
/* swaps red and blue bytes within a pixel */ |
||||
void /* PRIVATE */ |
||||
png_do_bgr(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_bgr\n"); |
||||
if ( |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
row != NULL && row_info != NULL && |
||||
#endif |
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR)) |
||||
{ |
||||
png_uint_32 row_width = row_info->width; |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB) |
||||
{ |
||||
png_bytep rp; |
||||
png_uint_32 i; |
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += 3) |
||||
{ |
||||
png_byte save = *rp; |
||||
*rp = *(rp + 2); |
||||
*(rp + 2) = save; |
||||
} |
||||
} |
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
{ |
||||
png_bytep rp; |
||||
png_uint_32 i; |
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += 4) |
||||
{ |
||||
png_byte save = *rp; |
||||
*rp = *(rp + 2); |
||||
*(rp + 2) = save; |
||||
} |
||||
} |
||||
} |
||||
else if (row_info->bit_depth == 16) |
||||
{ |
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB) |
||||
{ |
||||
png_bytep rp; |
||||
png_uint_32 i; |
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += 6) |
||||
{ |
||||
png_byte save = *rp; |
||||
*rp = *(rp + 4); |
||||
*(rp + 4) = save; |
||||
save = *(rp + 1); |
||||
*(rp + 1) = *(rp + 5); |
||||
*(rp + 5) = save; |
||||
} |
||||
} |
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
{ |
||||
png_bytep rp; |
||||
png_uint_32 i; |
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += 8) |
||||
{ |
||||
png_byte save = *rp; |
||||
*rp = *(rp + 4); |
||||
*(rp + 4) = save; |
||||
save = *(rp + 1); |
||||
*(rp + 1) = *(rp + 5); |
||||
*(rp + 5) = save; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */ |
||||
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ |
||||
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
|
||||
defined(PNG_LEGACY_SUPPORTED) |
||||
void PNGAPI |
||||
png_set_user_transform_info(png_structp png_ptr, png_voidp |
||||
user_transform_ptr, int user_transform_depth, int user_transform_channels) |
||||
{ |
||||
png_debug(1, "in png_set_user_transform_info\n"); |
||||
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) |
||||
png_ptr->user_transform_ptr = user_transform_ptr; |
||||
png_ptr->user_transform_depth = (png_byte)user_transform_depth; |
||||
png_ptr->user_transform_channels = (png_byte)user_transform_channels; |
||||
#else |
||||
if(user_transform_ptr || user_transform_depth || user_transform_channels) |
||||
png_warning(png_ptr, |
||||
"This version of libpng does not support user transform info"); |
||||
#endif |
||||
} |
||||
#endif |
||||
|
||||
/* This function returns a pointer to the user_transform_ptr associated with
|
||||
* the user transform functions. The application should free any memory |
||||
* associated with this pointer before png_write_destroy and png_read_destroy |
||||
* are called. |
||||
*/ |
||||
png_voidp PNGAPI |
||||
png_get_user_transform_ptr(png_structp png_ptr) |
||||
{ |
||||
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) |
||||
return ((png_voidp)png_ptr->user_transform_ptr); |
||||
#else |
||||
if(png_ptr) |
||||
return (NULL); |
||||
return (NULL); |
||||
#endif |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -1,228 +0,0 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
* |
||||
* This file provides a location for all output. Users who need |
||||
* special handling are expected to write functions that have the same |
||||
* arguments as these and perform similar functions, but that possibly |
||||
* use different output methods. Note that you shouldn't change these |
||||
* functions, but rather write replacement functions and then change |
||||
* them at run time with png_set_write_fn(...). |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
#ifdef PNG_WRITE_SUPPORTED |
||||
|
||||
/* Write the data to whatever output you are using. The default routine
|
||||
writes to a file pointer. Note that this routine sometimes gets called |
||||
with very small lengths, so you should implement some kind of simple |
||||
buffering if you are using unbuffered writes. This should never be asked |
||||
to write more than 64K on a 16 bit machine. */ |
||||
|
||||
void /* PRIVATE */ |
||||
png_write_data(png_structp png_ptr, png_bytep data, png_size_t length) |
||||
{ |
||||
if (png_ptr->write_data_fn != NULL ) |
||||
(*(png_ptr->write_data_fn))(png_ptr, data, length); |
||||
else |
||||
png_error(png_ptr, "Call to NULL write function"); |
||||
} |
||||
|
||||
#if !defined(PNG_NO_STDIO) |
||||
/* This is the function that does the actual writing of data. If you are
|
||||
not writing to a standard C stream, you should create a replacement |
||||
write_data function and use it at run time with png_set_write_fn(), rather |
||||
than changing the library. */ |
||||
#ifndef USE_FAR_KEYWORD |
||||
static void /* PRIVATE */ |
||||
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) |
||||
{ |
||||
png_uint_32 check; |
||||
|
||||
#if defined(_WIN32_WCE) |
||||
if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) |
||||
check = 0; |
||||
#else |
||||
check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); |
||||
#endif |
||||
if (check != length) |
||||
png_error(png_ptr, "Write Error"); |
||||
} |
||||
#else |
||||
/* this is the model-independent version. Since the standard I/O library
|
||||
can't handle far buffers in the medium and small models, we have to copy |
||||
the data. |
||||
*/ |
||||
|
||||
#define NEAR_BUF_SIZE 1024 |
||||
#define MIN(a,b) (a <= b ? a : b) |
||||
|
||||
static void /* PRIVATE */ |
||||
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) |
||||
{ |
||||
png_uint_32 check; |
||||
png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ |
||||
png_FILE_p io_ptr; |
||||
|
||||
/* Check if data really is near. If so, use usual code. */ |
||||
near_data = (png_byte *)CVT_PTR_NOCHECK(data); |
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); |
||||
if ((png_bytep)near_data == data) |
||||
{ |
||||
#if defined(_WIN32_WCE) |
||||
if ( !WriteFile(io_ptr, near_data, length, &check, NULL) ) |
||||
check = 0; |
||||
#else |
||||
check = fwrite(near_data, 1, length, io_ptr); |
||||
#endif |
||||
} |
||||
else |
||||
{ |
||||
png_byte buf[NEAR_BUF_SIZE]; |
||||
png_size_t written, remaining, err; |
||||
check = 0; |
||||
remaining = length; |
||||
do |
||||
{ |
||||
written = MIN(NEAR_BUF_SIZE, remaining); |
||||
png_memcpy(buf, data, written); /* copy far buffer to near buffer */ |
||||
#if defined(_WIN32_WCE) |
||||
if ( !WriteFile(io_ptr, buf, written, &err, NULL) ) |
||||
err = 0; |
||||
#else |
||||
err = fwrite(buf, 1, written, io_ptr); |
||||
#endif |
||||
if (err != written) |
||||
break; |
||||
else |
||||
check += err; |
||||
data += written; |
||||
remaining -= written; |
||||
} |
||||
while (remaining != 0); |
||||
} |
||||
if (check != length) |
||||
png_error(png_ptr, "Write Error"); |
||||
} |
||||
|
||||
#endif |
||||
#endif |
||||
|
||||
/* This function is called to output any data pending writing (normally
|
||||
to disk). After png_flush is called, there should be no data pending |
||||
writing in any buffers. */ |
||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED) |
||||
void /* PRIVATE */ |
||||
png_flush(png_structp png_ptr) |
||||
{ |
||||
if (png_ptr->output_flush_fn != NULL) |
||||
(*(png_ptr->output_flush_fn))(png_ptr); |
||||
} |
||||
|
||||
#if !defined(PNG_NO_STDIO) |
||||
static void /* PRIVATE */ |
||||
png_default_flush(png_structp png_ptr) |
||||
{ |
||||
#if !defined(_WIN32_WCE) |
||||
png_FILE_p io_ptr; |
||||
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); |
||||
if (io_ptr != NULL) |
||||
fflush(io_ptr); |
||||
#endif |
||||
} |
||||
#endif |
||||
#endif |
||||
|
||||
/* This function allows the application to supply new output functions for
|
||||
libpng if standard C streams aren't being used. |
||||
|
||||
This function takes as its arguments: |
||||
png_ptr - pointer to a png output data structure |
||||
io_ptr - pointer to user supplied structure containing info about |
||||
the output functions. May be NULL. |
||||
write_data_fn - pointer to a new output function that takes as its |
||||
arguments a pointer to a png_struct, a pointer to |
||||
data to be written, and a 32-bit unsigned int that is |
||||
the number of bytes to be written. The new write |
||||
function should call png_error(png_ptr, "Error msg") |
||||
to exit and output any fatal error messages. |
||||
flush_data_fn - pointer to a new flush function that takes as its |
||||
arguments a pointer to a png_struct. After a call to |
||||
the flush function, there should be no data in any buffers |
||||
or pending transmission. If the output method doesn't do |
||||
any buffering of ouput, a function prototype must still be |
||||
supplied although it doesn't have to do anything. If |
||||
PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile |
||||
time, output_flush_fn will be ignored, although it must be |
||||
supplied for compatibility. */ |
||||
void PNGAPI |
||||
png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, |
||||
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn) |
||||
{ |
||||
png_ptr->io_ptr = io_ptr; |
||||
|
||||
#if !defined(PNG_NO_STDIO) |
||||
if (write_data_fn != NULL) |
||||
png_ptr->write_data_fn = write_data_fn; |
||||
else |
||||
png_ptr->write_data_fn = png_default_write_data; |
||||
#else |
||||
png_ptr->write_data_fn = write_data_fn; |
||||
#endif |
||||
|
||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED) |
||||
#if !defined(PNG_NO_STDIO) |
||||
if (output_flush_fn != NULL) |
||||
png_ptr->output_flush_fn = output_flush_fn; |
||||
else |
||||
png_ptr->output_flush_fn = png_default_flush; |
||||
#else |
||||
png_ptr->output_flush_fn = output_flush_fn; |
||||
#endif |
||||
#endif /* PNG_WRITE_FLUSH_SUPPORTED */ |
||||
|
||||
/* It is an error to read while writing a png file */ |
||||
if (png_ptr->read_data_fn != NULL) |
||||
{ |
||||
png_ptr->read_data_fn = NULL; |
||||
png_warning(png_ptr, |
||||
"Attempted to set both read_data_fn and write_data_fn in"); |
||||
png_warning(png_ptr, |
||||
"the same structure. Resetting read_data_fn to NULL."); |
||||
} |
||||
} |
||||
|
||||
#if defined(USE_FAR_KEYWORD) |
||||
#if defined(_MSC_VER) |
||||
void *png_far_to_near(png_structp png_ptr,png_voidp ptr, int check) |
||||
{ |
||||
void *near_ptr; |
||||
void FAR *far_ptr; |
||||
FP_OFF(near_ptr) = FP_OFF(ptr); |
||||
far_ptr = (void FAR *)near_ptr; |
||||
if(check != 0) |
||||
if(FP_SEG(ptr) != FP_SEG(far_ptr)) |
||||
png_error(png_ptr,"segment lost in conversion"); |
||||
return(near_ptr); |
||||
} |
||||
# else |
||||
void *png_far_to_near(png_structp png_ptr,png_voidp ptr, int check) |
||||
{ |
||||
void *near_ptr; |
||||
void FAR *far_ptr; |
||||
near_ptr = (void FAR *)ptr; |
||||
far_ptr = (void FAR *)near_ptr; |
||||
if(check != 0) |
||||
if(far_ptr != ptr) |
||||
png_error(png_ptr,"segment lost in conversion"); |
||||
return(near_ptr); |
||||
} |
||||
# endif |
||||
# endif |
||||
#endif /* PNG_WRITE_SUPPORTED */ |
File diff suppressed because it is too large
Load Diff
@ -1,563 +0,0 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
* |
||||
* libpng 1.2.1 - December 12, 2001 |
||||
* For conditions of distribution and use, see copyright notice in png.h |
||||
* Copyright (c) 1998-2001 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.) |
||||
*/ |
||||
|
||||
#define PNG_INTERNAL |
||||
#include "png.h" |
||||
#ifdef PNG_WRITE_SUPPORTED |
||||
|
||||
/* Transform the data according to the user's wishes. The order of
|
||||
* transformations is significant. |
||||
*/ |
||||
void /* PRIVATE */ |
||||
png_do_write_transformations(png_structp png_ptr) |
||||
{ |
||||
png_debug(1, "in png_do_write_transformations\n"); |
||||
|
||||
if (png_ptr == NULL) |
||||
return; |
||||
|
||||
#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_USER_TRANSFORM) |
||||
if(png_ptr->write_user_transform_fn != NULL) |
||||
(*(png_ptr->write_user_transform_fn)) /* user write transform function */ |
||||
(png_ptr, /* png_ptr */ |
||||
&(png_ptr->row_info), /* row_info: */ |
||||
/* png_uint_32 width; width of row */ |
||||
/* png_uint_32 rowbytes; number of bytes in row */ |
||||
/* png_byte color_type; color type of pixels */ |
||||
/* png_byte bit_depth; bit depth of samples */ |
||||
/* png_byte channels; number of channels (1-4) */ |
||||
/* png_byte pixel_depth; bits per pixel (depth*channels) */ |
||||
png_ptr->row_buf + 1); /* start of pixel data for row */ |
||||
#endif |
||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_FILLER) |
||||
png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, |
||||
png_ptr->flags); |
||||
#endif |
||||
#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_PACKSWAP) |
||||
png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); |
||||
#endif |
||||
#if defined(PNG_WRITE_PACK_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_PACK) |
||||
png_do_pack(&(png_ptr->row_info), png_ptr->row_buf + 1, |
||||
(png_uint_32)png_ptr->bit_depth); |
||||
#endif |
||||
#if defined(PNG_WRITE_SWAP_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_SWAP_BYTES) |
||||
png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); |
||||
#endif |
||||
#if defined(PNG_WRITE_SHIFT_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_SHIFT) |
||||
png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1, |
||||
&(png_ptr->shift)); |
||||
#endif |
||||
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_INVERT_ALPHA) |
||||
png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); |
||||
#endif |
||||
#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_SWAP_ALPHA) |
||||
png_do_write_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); |
||||
#endif |
||||
#if defined(PNG_WRITE_BGR_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_BGR) |
||||
png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); |
||||
#endif |
||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) |
||||
if (png_ptr->transformations & PNG_INVERT_MONO) |
||||
png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); |
||||
#endif |
||||
} |
||||
|
||||
#if defined(PNG_WRITE_PACK_SUPPORTED) |
||||
/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The
|
||||
* row_info bit depth should be 8 (one pixel per byte). The channels |
||||
* should be 1 (this only happens on grayscale and paletted images). |
||||
*/ |
||||
void /* PRIVATE */ |
||||
png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) |
||||
{ |
||||
png_debug(1, "in png_do_pack\n"); |
||||
if (row_info->bit_depth == 8 && |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
row != NULL && row_info != NULL && |
||||
#endif |
||||
row_info->channels == 1) |
||||
{ |
||||
switch ((int)bit_depth) |
||||
{ |
||||
case 1: |
||||
{ |
||||
png_bytep sp, dp; |
||||
int mask, v; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
sp = row; |
||||
dp = row; |
||||
mask = 0x80; |
||||
v = 0; |
||||
|
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
if (*sp != 0) |
||||
v |= mask; |
||||
sp++; |
||||
if (mask > 1) |
||||
mask >>= 1; |
||||
else |
||||
{ |
||||
mask = 0x80; |
||||
*dp = (png_byte)v; |
||||
dp++; |
||||
v = 0; |
||||
} |
||||
} |
||||
if (mask != 0x80) |
||||
*dp = (png_byte)v; |
||||
break; |
||||
} |
||||
case 2: |
||||
{ |
||||
png_bytep sp, dp; |
||||
int shift, v; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
sp = row; |
||||
dp = row; |
||||
shift = 6; |
||||
v = 0; |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
png_byte value; |
||||
|
||||
value = (png_byte)(*sp & 0x03); |
||||
v |= (value << shift); |
||||
if (shift == 0) |
||||
{ |
||||
shift = 6; |
||||
*dp = (png_byte)v; |
||||
dp++; |
||||
v = 0; |
||||
} |
||||
else |
||||
shift -= 2; |
||||
sp++; |
||||
} |
||||
if (shift != 6) |
||||
*dp = (png_byte)v; |
||||
break; |
||||
} |
||||
case 4: |
||||
{ |
||||
png_bytep sp, dp; |
||||
int shift, v; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
sp = row; |
||||
dp = row; |
||||
shift = 4; |
||||
v = 0; |
||||
for (i = 0; i < row_width; i++) |
||||
{ |
||||
png_byte value; |
||||
|
||||
value = (png_byte)(*sp & 0x0f); |
||||
v |= (value << shift); |
||||
|
||||
if (shift == 0) |
||||
{ |
||||
shift = 4; |
||||
*dp = (png_byte)v; |
||||
dp++; |
||||
v = 0; |
||||
} |
||||
else |
||||
shift -= 4; |
||||
|
||||
sp++; |
||||
} |
||||
if (shift != 4) |
||||
*dp = (png_byte)v; |
||||
break; |
||||
} |
||||
} |
||||
row_info->bit_depth = (png_byte)bit_depth; |
||||
row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels); |
||||
row_info->rowbytes = |
||||
((row_info->width * row_info->pixel_depth + 7) >> 3); |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_WRITE_SHIFT_SUPPORTED) |
||||
/* Shift pixel values to take advantage of whole range. Pass the
|
||||
* true number of bits in bit_depth. The row should be packed |
||||
* according to row_info->bit_depth. Thus, if you had a row of |
||||
* bit depth 4, but the pixels only had values from 0 to 7, you |
||||
* would pass 3 as bit_depth, and this routine would translate the |
||||
* data to 0 to 15. |
||||
*/ |
||||
void /* PRIVATE */ |
||||
png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) |
||||
{ |
||||
png_debug(1, "in png_do_shift\n"); |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
if (row != NULL && row_info != NULL && |
||||
#else |
||||
if ( |
||||
#endif |
||||
row_info->color_type != PNG_COLOR_TYPE_PALETTE) |
||||
{ |
||||
int shift_start[4], shift_dec[4]; |
||||
int channels = 0; |
||||
|
||||
if (row_info->color_type & PNG_COLOR_MASK_COLOR) |
||||
{ |
||||
shift_start[channels] = row_info->bit_depth - bit_depth->red; |
||||
shift_dec[channels] = bit_depth->red; |
||||
channels++; |
||||
shift_start[channels] = row_info->bit_depth - bit_depth->green; |
||||
shift_dec[channels] = bit_depth->green; |
||||
channels++; |
||||
shift_start[channels] = row_info->bit_depth - bit_depth->blue; |
||||
shift_dec[channels] = bit_depth->blue; |
||||
channels++; |
||||
} |
||||
else |
||||
{ |
||||
shift_start[channels] = row_info->bit_depth - bit_depth->gray; |
||||
shift_dec[channels] = bit_depth->gray; |
||||
channels++; |
||||
} |
||||
if (row_info->color_type & PNG_COLOR_MASK_ALPHA) |
||||
{ |
||||
shift_start[channels] = row_info->bit_depth - bit_depth->alpha; |
||||
shift_dec[channels] = bit_depth->alpha; |
||||
channels++; |
||||
} |
||||
|
||||
/* with low row depths, could only be grayscale, so one channel */ |
||||
if (row_info->bit_depth < 8) |
||||
{ |
||||
png_bytep bp = row; |
||||
png_uint_32 i; |
||||
png_byte mask; |
||||
png_uint_32 row_bytes = row_info->rowbytes; |
||||
|
||||
if (bit_depth->gray == 1 && row_info->bit_depth == 2) |
||||
mask = 0x55; |
||||
else if (row_info->bit_depth == 4 && bit_depth->gray == 3) |
||||
mask = 0x11; |
||||
else |
||||
mask = 0xff; |
||||
|
||||
for (i = 0; i < row_bytes; i++, bp++) |
||||
{ |
||||
png_uint_16 v; |
||||
int j; |
||||
|
||||
v = *bp; |
||||
*bp = 0; |
||||
for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0]) |
||||
{ |
||||
if (j > 0) |
||||
*bp |= (png_byte)((v << j) & 0xff); |
||||
else |
||||
*bp |= (png_byte)((v >> (-j)) & mask); |
||||
} |
||||
} |
||||
} |
||||
else if (row_info->bit_depth == 8) |
||||
{ |
||||
png_bytep bp = row; |
||||
png_uint_32 i; |
||||
png_uint_32 istop = channels * row_info->width; |
||||
|
||||
for (i = 0; i < istop; i++, bp++) |
||||
{ |
||||
|
||||
png_uint_16 v; |
||||
int j; |
||||
int c = (int)(i%channels); |
||||
|
||||
v = *bp; |
||||
*bp = 0; |
||||
for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) |
||||
{ |
||||
if (j > 0) |
||||
*bp |= (png_byte)((v << j) & 0xff); |
||||
else |
||||
*bp |= (png_byte)((v >> (-j)) & 0xff); |
||||
} |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
png_bytep bp; |
||||
png_uint_32 i; |
||||
png_uint_32 istop = channels * row_info->width; |
||||
|
||||
for (bp = row, i = 0; i < istop; i++) |
||||
{ |
||||
int c = (int)(i%channels); |
||||
png_uint_16 value, v; |
||||
int j; |
||||
|
||||
v = (png_uint_16)(((png_uint_16)(*bp) << 8) + *(bp + 1)); |
||||
value = 0; |
||||
for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) |
||||
{ |
||||
if (j > 0) |
||||
value |= (png_uint_16)((v << j) & (png_uint_16)0xffff); |
||||
else |
||||
value |= (png_uint_16)((v >> (-j)) & (png_uint_16)0xffff); |
||||
} |
||||
*bp++ = (png_byte)(value >> 8); |
||||
*bp++ = (png_byte)(value & 0xff); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) |
||||
void /* PRIVATE */ |
||||
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_write_swap_alpha\n"); |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
if (row != NULL && row_info != NULL) |
||||
#endif |
||||
{ |
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
{ |
||||
/* This converts from ARGB to RGBA */ |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
png_byte save = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = save; |
||||
} |
||||
} |
||||
/* This converts from AARRGGBB to RRGGBBAA */ |
||||
else |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
png_byte save[2]; |
||||
save[0] = *(sp++); |
||||
save[1] = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = save[0]; |
||||
*(dp++) = save[1]; |
||||
} |
||||
} |
||||
} |
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) |
||||
{ |
||||
/* This converts from AG to GA */ |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
png_byte save = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = save; |
||||
} |
||||
} |
||||
/* This converts from AAGG to GGAA */ |
||||
else |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
png_byte save[2]; |
||||
save[0] = *(sp++); |
||||
save[1] = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = save[0]; |
||||
*(dp++) = save[1]; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) |
||||
void /* PRIVATE */ |
||||
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_write_invert_alpha\n"); |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
if (row != NULL && row_info != NULL) |
||||
#endif |
||||
{ |
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
{ |
||||
/* This inverts the alpha channel in RGBA */ |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = (png_byte)(255 - *(sp++)); |
||||
} |
||||
} |
||||
/* This inverts the alpha channel in RRGGBBAA */ |
||||
else |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = (png_byte)(255 - *(sp++)); |
||||
*(dp++) = (png_byte)(255 - *(sp++)); |
||||
} |
||||
} |
||||
} |
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) |
||||
{ |
||||
/* This inverts the alpha channel in GA */ |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = (png_byte)(255 - *(sp++)); |
||||
} |
||||
} |
||||
/* This inverts the alpha channel in GGAA */ |
||||
else |
||||
{ |
||||
png_bytep sp, dp; |
||||
png_uint_32 i; |
||||
png_uint_32 row_width = row_info->width; |
||||
|
||||
for (i = 0, sp = dp = row; i < row_width; i++) |
||||
{ |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = *(sp++); |
||||
*(dp++) = (png_byte)(255 - *(sp++)); |
||||
*(dp++) = (png_byte)(255 - *(sp++)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED) |
||||
/* undoes intrapixel differencing */ |
||||
void /* PRIVATE */ |
||||
png_do_write_intrapixel(png_row_infop row_info, png_bytep row) |
||||
{ |
||||
png_debug(1, "in png_do_write_intrapixel\n"); |
||||
if ( |
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED) |
||||
row != NULL && row_info != NULL && |
||||
#endif |
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR)) |
||||
{ |
||||
int bytes_per_pixel; |
||||
png_uint_32 row_width = row_info->width; |
||||
if (row_info->bit_depth == 8) |
||||
{ |
||||
png_bytep rp; |
||||
png_uint_32 i; |
||||
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB) |
||||
bytes_per_pixel = 3; |
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
bytes_per_pixel = 4; |
||||
else |
||||
return; |
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) |
||||
{ |
||||
*(rp) = (png_byte)((*rp - *(rp+1))&0xff); |
||||
*(rp+2) = (png_byte)((*(rp+2) - *(rp+1))&0xff); |
||||
} |
||||
} |
||||
else if (row_info->bit_depth == 16) |
||||
{ |
||||
png_bytep rp; |
||||
png_uint_32 i; |
||||
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB) |
||||
bytes_per_pixel = 6; |
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) |
||||
bytes_per_pixel = 8; |
||||
else |
||||
return; |
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) |
||||
{ |
||||
png_uint_32 s0=*(rp )<<8 | *(rp+1); |
||||
png_uint_32 s1=*(rp+2)<<8 | *(rp+3); |
||||
png_uint_32 s2=*(rp+4)<<8 | *(rp+5); |
||||
png_uint_32 red=(s0-s1)&0xffff; |
||||
png_uint_32 blue=(s2-s1)&0xffff; |
||||
*(rp ) = (png_byte)((red>>8)&0xff); |
||||
*(rp+1) = (png_byte)(red&0xff); |
||||
*(rp+4) = (png_byte)((blue>>8)&0xff); |
||||
*(rp+5) = (png_byte)(blue&0xff); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */ |
||||
#endif /* PNG_WRITE_SUPPORTED */ |
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
||||
OPTIMIZE |
||||
OPTPEEP |
||||
OPTTIME |
||||
OPTSCHED |
||||
AUTOREGISTER |
||||
PARMS=REGISTERS |
||||
INCLUDEDIR=hlp:ppc/include |
@ -1,52 +0,0 @@
|
||||
|
||||
cc_defs = /inc=$(ZLIBSRC) |
||||
c_deb = |
||||
|
||||
.ifdef __DECC__ |
||||
pref = /prefix=all |
||||
.endif |
||||
|
||||
|
||||
|
||||
OBJS = png.obj, pngset.obj, pngget.obj, pngrutil.obj, pngtrans.obj,\ |
||||
pngwutil.obj, pngread.obj, pngmem.obj, pngwrite.obj, pngrtran.obj,\ |
||||
pngwtran.obj, pngrio.obj, pngwio.obj, pngerror.obj, pngpread.obj |
||||
|
||||
|
||||
CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) |
||||
|
||||
all : pngtest.exe libpng.olb |
||||
@ write sys$output " pngtest available" |
||||
|
||||
libpng.olb : libpng.olb($(OBJS)) |
||||
@ write sys$output " Libpng available" |
||||
|
||||
|
||||
pngtest.exe : pngtest.obj libpng.olb |
||||
link pngtest,libpng.olb/lib,$(ZLIBSRC)libz.olb/lib |
||||
|
||||
test : pngtest.exe |
||||
run pngtest |
||||
|
||||
clean : |
||||
delete *.obj;*,*.exe;* |
||||
|
||||
|
||||
# Other dependencies. |
||||
png.obj : png.h, pngconf.h |
||||
pngpread.obj : png.h, pngconf.h |
||||
pngset.obj : png.h, pngconf.h |
||||
pngget.obj : png.h, pngconf.h |
||||
pngread.obj : png.h, pngconf.h |
||||
pngrtran.obj : png.h, pngconf.h |
||||
pngrutil.obj : png.h, pngconf.h |
||||
pngerror.obj : png.h, pngconf.h |
||||
pngmem.obj : png.h, pngconf.h |
||||
pngrio.obj : png.h, pngconf.h |
||||
pngwio.obj : png.h, pngconf.h |
||||
pngtest.obj : png.h, pngconf.h |
||||
pngtrans.obj : png.h, pngconf.h |
||||
pngwrite.obj : png.h, pngconf.h |
||||
pngwtran.obj : png.h, pngconf.h |
||||
pngwutil.obj : png.h, pngconf.h |
||||
|
@ -1,44 +0,0 @@
|
||||
// Project file for libpng (static) |
||||
// IBM VisualAge/C++ version 4.0 or later |
||||
// Copyright (C) 2000 Cosmin Truta |
||||
// For conditions of distribution and use, see copyright notice in png.h |
||||
// Notes: |
||||
// All modules are compiled in C mode |
||||
// Tested with IBM VAC++ 4.0 under Win32 |
||||
// Expected to work with IBM VAC++ 4.0 or later under OS/2 and Win32 |
||||
// Can be easily adapted for IBM VAC++ 4.0 or later under AIX |
||||
// For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
option incl(searchpath, "../zlib"), opt(level, "2"), |
||||
link(libsearchpath, "../zlib") |
||||
{ |
||||
target type(lib) "libpng.lib" |
||||
{ |
||||
source type(c) "png.c" |
||||
source type(c) "pngerror.c" |
||||
source type(c) "pngget.c" |
||||
source type(c) "pngmem.c" |
||||
source type(c) "pngpread.c" |
||||
source type(c) "pngread.c" |
||||
source type(c) "pngrio.c" |
||||
source type(c) "pngrtran.c" |
||||
source type(c) "pngrutil.c" |
||||
source type(c) "pngset.c" |
||||
source type(c) "pngtrans.c" |
||||
source type(c) "pngwio.c" |
||||
source type(c) "pngwrite.c" |
||||
source type(c) "pngwtran.c" |
||||
source type(c) "pngwutil.c" |
||||
} |
||||
} |
||||
|
||||
option incl(searchpath, "../zlib"), opt(level, "2"), |
||||
link(libsearchpath, "../zlib") |
||||
{ |
||||
target type(exe) "pngtest.exe" |
||||
{ |
||||
source type(c) "pngtest.c" |
||||
source type(lib) "libpng.lib" |
||||
source type(lib) "zlib.lib" |
||||
} |
||||
} |
@ -1,51 +0,0 @@
|
||||
# Project: libpng |
||||
|
||||
|
||||
# Toolflags: |
||||
CCflags = -c -depend !Depend -IC:,Zlib: -g -throwback -DRISCOS -fnah |
||||
C++flags = -c -depend !Depend -IC: -throwback |
||||
Linkflags = -aif -c++ -o $@ |
||||
ObjAsmflags = -throwback -NoCache -depend !Depend |
||||
CMHGflags = |
||||
LibFileflags = -c -l -o $@ |
||||
Squeezeflags = -o $@ |
||||
|
||||
|
||||
# Final targets: |
||||
@.libpng-lib: @.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \ |
||||
@.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \ |
||||
@.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil |
||||
LibFile $(LibFileflags) @.o.png @.o.pngerror @.o.pngrio @.o.pngrtran \ |
||||
@.o.pngmem @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngwio \ |
||||
@.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil |
||||
@.mm-libpng-lib: @.mm.png @.mm.pngerror @.mm.pngrio @.mm.pngwio @.mm.pngmem \ |
||||
@.mm.pngpread @.mm.pngset @.mm.pngget @.mm.pngread @.mm.pngrtran \ |
||||
@.mm.pngrutil @.mm.pngtrans @.mm.pngwrite @.mm.pngwtran @.mm.pngwutil |
||||
LibFile $(LibFileflags) @.mm.png @.mm.pngerror @.mm.pngrio \ |
||||
@.mm.pngwio @.mm.pngmem @.mm.pngpread @.mm.pngset @.mm.pngget \ |
||||
@.mm.pngread @.mm.pngrtran @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite \ |
||||
@.mm.pngwtran @.mm.pngwutil |
||||
|
||||
|
||||
# User-editable dependencies: |
||||
# (C) Copyright 1997 Tom Tanner |
||||
Test: @.pngtest |
||||
<Prefix$Dir>.pngtest |
||||
@remove <Prefix$Dir>.pngtest |
||||
|
||||
#It would be nice if you could stop "make" listing from here on! |
||||
@.pngtest: @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib |
||||
Link $(Linkflags) @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib |
||||
|
||||
.SUFFIXES: .o .mm .c |
||||
|
||||
.c.mm: |
||||
MemCheck.CC cc $(ccflags) -o $@ LibPng:$< |
||||
.c.o: |
||||
cc $(ccflags) -o $@ $< |
||||
|
||||
|
||||
# Static dependencies: |
||||
|
||||
|
||||
# Dynamic dependencies: |
@ -1,84 +0,0 @@
|
||||
# makefile for libpng using gcc (generic, static library) |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# Copyright (C) 2000 Cosmin Truta |
||||
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc) |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# Location of the zlib library and include files |
||||
ZLIBINC = ../zlib |
||||
ZLIBLIB = ../zlib |
||||
|
||||
# Compiler, linker, lib and other tools |
||||
CC = gcc |
||||
LD = $(CC) |
||||
AR = ar rcs |
||||
RANLIB = ranlib |
||||
RM = rm -f |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
PNGVER = $(PNGMAJ).$(PNGMIN) |
||||
|
||||
prefix=/usr/local |
||||
INCPATH=$(prefix)/include |
||||
LIBPATH=$(prefix)/lib |
||||
|
||||
CDEBUG = -g -DPNG_DEBUG=5 |
||||
LDDEBUG = |
||||
CRELEASE = -O2 |
||||
LDRELEASE = -s |
||||
CFLAGS = -I$(ZLIBINC) -Wall $(CRELEASE) |
||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE) |
||||
|
||||
# File extensions |
||||
O=.o |
||||
A=.a |
||||
E= |
||||
|
||||
# Variables |
||||
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ |
||||
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ |
||||
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) |
||||
|
||||
# Targets |
||||
all: libpng$(A) pngtest$(E) |
||||
|
||||
libpng$(A): $(OBJS) |
||||
$(AR) $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
test: pngtest$(E) |
||||
./pngtest$(E) |
||||
|
||||
pngtest$(E): pngtest$(O) libpng$(A) |
||||
$(LD) -o $@ pngtest$(O) $(LDFLAGS) |
||||
|
||||
install: libpng.a |
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi |
||||
cp png.h pngconf.h $(INCPATH) |
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
||||
cp libpng.a $(LIBPATH) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a pngtest pngout.png |
||||
|
||||
png$(O): png.h pngconf.h |
||||
pngerror$(O): png.h pngconf.h |
||||
pngget$(O): png.h pngconf.h |
||||
pngmem$(O): png.h pngconf.h |
||||
pngpread$(O): png.h pngconf.h |
||||
pngread$(O): png.h pngconf.h |
||||
pngrio$(O): png.h pngconf.h |
||||
pngrtran$(O): png.h pngconf.h |
||||
pngrutil$(O): png.h pngconf.h |
||||
pngset$(O): png.h pngconf.h |
||||
pngtest$(O): png.h pngconf.h |
||||
pngtrans$(O): png.h pngconf.h |
||||
pngwio$(O): png.h pngconf.h |
||||
pngwrite$(O): png.h pngconf.h |
||||
pngwtran$(O): png.h pngconf.h |
||||
pngwutil$(O): png.h pngconf.h |
||||
|
@ -1,48 +0,0 @@
|
||||
# Commodore Amiga Makefile |
||||
# makefile for libpng and SAS C V6.5x compiler |
||||
# Copyright (C) 1995-2000 Wolf Faust |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
# |
||||
# Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h |
||||
# |
||||
# Location/path of zlib include files |
||||
ZLIB=/zlib |
||||
#compiler |
||||
CC=sc |
||||
#compiler flags |
||||
# WARNING: a bug in V6.51 causes bad code with OPTGO |
||||
# So use V6.55 or set NOOPTGO!!!!!!!!! |
||||
CFLAGS= NOSTKCHK PARMS=REG OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL\ |
||||
OPTLOOP OPTRDEP=4 OPTDEP=4 OPTCOMP=4 INCLUDEDIR=$(ZLIB) \ |
||||
DEFINE=PNG_INTERNAL |
||||
#linker flags |
||||
LDFLAGS= SD ND BATCH |
||||
#link libs |
||||
LDLIBS= libpng.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib |
||||
# linker |
||||
LN= slink |
||||
# file deletion command |
||||
RM= delete quiet |
||||
# library (.lib) file creation command |
||||
AR= oml |
||||
# make directory command |
||||
MKDIR= makedir |
||||
|
||||
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.lib pngtest |
||||
|
||||
libpng.lib: $(OBJS) |
||||
-$(RM) libpng.lib |
||||
$(AR) libpng.lib r $(OBJS) |
||||
|
||||
pngtest: pngtest.o libpng.lib |
||||
$(LN) <WITH < |
||||
$(LDFLAGS) |
||||
TO pngtest |
||||
FROM LIB:c.o pngtest.o |
||||
LIB $(LDLIBS) |
||||
< |
||||
|
@ -1,33 +0,0 @@
|
||||
# makefile for libpng |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
# modified for LC56/ATARI assumes libz.lib is in same dir and uses default |
||||
# rules for library management |
||||
# |
||||
CFLAGS=-I..\zlib -O |
||||
LBR = png.lib |
||||
LDFLAGS=-lpng -lz -lm |
||||
|
||||
# where make install puts libpng.a and png.h |
||||
prefix=/usr/local |
||||
|
||||
OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\ |
||||
$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\ |
||||
$(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\ |
||||
$(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\ |
||||
$(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o) |
||||
|
||||
all: $(LBR) pngtest.ttp |
||||
|
||||
$(LBR): $(OBJS) |
||||
|
||||
pngtest.ttp: pngtest.o $(LBR) |
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o |
||||
|
||||
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 |
@ -1,151 +0,0 @@
|
||||
# Makefile for libpng |
||||
# 32-bit Borland C++ (Note: All modules are compiled in C mode) |
||||
# To build the library, do: |
||||
# "make -fmakefile.bc32" |
||||
# |
||||
# -------------------- 32-bit Borland C++ -------------------- |
||||
|
||||
### Absolutely necessary for this makefile to work |
||||
.AUTODEPEND |
||||
|
||||
## Where zlib.h, zconf.h and zlib.lib are |
||||
ZLIB_DIR=..\zlib |
||||
|
||||
|
||||
## Compiler, linker and lib stuff |
||||
CC=bcc32 |
||||
LD=bcc32 |
||||
LIB=tlib |
||||
|
||||
#TARGET_CPU=6 |
||||
# 3 = 386, 4 = 486, 5 = Pentium etc. |
||||
!ifndef TARGET_CPU |
||||
TARGET_CPU=5 |
||||
!endif |
||||
|
||||
# Use this if you don't want Borland's fancy exception handling |
||||
NOEHLIB=noeh32.lib |
||||
|
||||
!ifdef DEBUG |
||||
CDEBUG=-v |
||||
LDEBUG=-v |
||||
!else |
||||
CDEBUG= |
||||
LDEBUG= |
||||
!endif |
||||
|
||||
# STACKOFLOW=1 |
||||
!ifdef STACKOFLOW |
||||
CDEBUG=$(CDEBUG) -N |
||||
LDEBUG=$(LDEBUG) -N |
||||
!endif |
||||
|
||||
# -X- turn on dependency generation in the object file |
||||
# -w set all warnings on |
||||
# -O2 optimize for speed |
||||
# -Z global optimization |
||||
CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(CDEBUG) |
||||
|
||||
# -M generate map file |
||||
LDFLAGS=-M -L$(ZLIB_DIR) $(LDEBUG) |
||||
|
||||
|
||||
## Variables |
||||
OBJS = \ |
||||
png.obj \ |
||||
pngerror.obj \ |
||||
pngget.obj \ |
||||
pngmem.obj \ |
||||
pngpread.obj \ |
||||
pngread.obj \ |
||||
pngrio.obj \ |
||||
pngrtran.obj \ |
||||
pngrutil.obj \ |
||||
pngset.obj \ |
||||
pngtrans.obj \ |
||||
pngwio.obj \ |
||||
pngwrite.obj \ |
||||
pngwtran.obj \ |
||||
pngwutil.obj |
||||
|
||||
LIBOBJS = \ |
||||
+png.obj \ |
||||
+pngerror.obj \ |
||||
+pngget.obj \ |
||||
+pngmem.obj \ |
||||
+pngpread.obj \ |
||||
+pngread.obj \ |
||||
+pngrio.obj \ |
||||
+pngrtran.obj \ |
||||
+pngrutil.obj \ |
||||
+pngset.obj \ |
||||
+pngtrans.obj \ |
||||
+pngwio.obj \ |
||||
+pngwrite.obj \ |
||||
+pngwtran.obj \ |
||||
+pngwutil.obj |
||||
|
||||
LIBNAME=libpng.lib |
||||
|
||||
|
||||
## Implicit rules |
||||
# Braces let make "batch" calls to the compiler, |
||||
# 2 calls instead of 12; space is important. |
||||
.c.obj: |
||||
$(CC) $(CFLAGS) -c {$*.c } |
||||
|
||||
.c.exe: |
||||
$(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib.lib $(NOEHLIB) |
||||
|
||||
.obj.exe: |
||||
$(LD) $(LDFLAGS) $*.obj $(LIBNAME) zlib.lib $(NOEHLIB) |
||||
|
||||
|
||||
## Major targets |
||||
all: libpng pngtest |
||||
|
||||
libpng: $(LIBNAME) |
||||
|
||||
pngtest: pngtest.exe |
||||
|
||||
test: pngtest.exe |
||||
pngtest |
||||
|
||||
|
||||
## Minor Targets |
||||
|
||||
png.obj: png.c |
||||
pngerror.obj: pngerror.c |
||||
pngget.obj: pngget.c |
||||
pngmem.obj: pngmem.c |
||||
pngpread.obj: pngpread.c |
||||
pngread.obj: pngread.c |
||||
pngrio.obj: pngrio.c |
||||
pngrtran.obj: pngrtran.c |
||||
pngrutil.obj: pngrutil.c |
||||
pngset.obj: pngset.c |
||||
pngtrans.obj: pngtrans.c |
||||
pngwio.obj: pngwio.c |
||||
pngwrite.obj: pngwrite.c |
||||
pngwtran.obj: pngwtran.c |
||||
pngwutil.obj: pngwutil.c |
||||
|
||||
|
||||
$(LIBNAME): $(OBJS) |
||||
-del $(LIBNAME) |
||||
$(LIB) $(LIBNAME) @&&| |
||||
$(LIBOBJS), libpng |
||||
| |
||||
|
||||
|
||||
# Clean up anything else you want |
||||
clean: |
||||
-del *.obj |
||||
-del *.exe |
||||
-del *.lib |
||||
-del *.lst |
||||
-del *.map |
||||
-del *.tds |
||||
|
||||
|
||||
# End of makefile for libpng |
@ -1,76 +0,0 @@
|
||||
# Makefile for png32bd.dll |
||||
# -------------------- 32-bit Borland C++ -------------------- |
||||
|
||||
# This makefile expects to find zlib.h and zlib32bd.lib in the |
||||
# $(ZLIBDIR) directory. |
||||
|
||||
# The object files here are compiled with the "stdcall" calling convention. |
||||
# This DLL requires zlib32bd.lib to be compiled in the same way. |
||||
|
||||
# Note that png32bd.dll exports the zlib functions adler32, crc32 and |
||||
# the deflate... and inflate... functions. It does not export the |
||||
# compress and uncompress functions, nor any of the gz... functions, |
||||
# since libpng does not call them. |
||||
|
||||
.AUTODEPEND |
||||
|
||||
ZLIBDIR=..\zlib |
||||
ZLIB=zlib32bd.lib |
||||
PNGDLL=png32bd.dll |
||||
PNGLIB=png32bd.lib |
||||
|
||||
CC=bcc32 |
||||
CFLAGS= -ps -O2 -N- -k- -d -r- -w-par -w-aus -I$(ZLIBDIR) \ |
||||
-DPNG_NO_GLOBAL_ARRAYS #-DPNG_DEBUG=5 |
||||
#LINK=tlink32 |
||||
#LINK=ilink32 |
||||
LINK=bcc32 |
||||
#LINKFLAGS= -Tpd -aa -c |
||||
LINKFLAGS= -WDE |
||||
IMPLIB=implib |
||||
|
||||
# Use this if you don't want Borland's fancy exception handling |
||||
NOEHLIB=noeh32.lib |
||||
|
||||
.c.obj: |
||||
$(CC) -c $(CFLAGS) $< |
||||
|
||||
.c.exe: |
||||
$(CC) $(CFLAGS) $< $(PNGLIB) $(NOEHLIB) |
||||
|
||||
|
||||
OBJ1=png.obj pngerror.obj pngget.obj pngmem.obj pngpread.obj |
||||
OBJ2=pngread.obj pngrio.obj pngrtran.obj pngrutil.obj pngset.obj |
||||
OBJ3=pngtrans.obj pngwio.obj pngwrite.obj pngwtran.obj pngwutil.obj |
||||
|
||||
all: $(PNGDLL) |
||||
|
||||
test: pngtest.exe |
||||
pngtest |
||||
|
||||
|
||||
$(PNGDLL): $(OBJ1) $(OBJ2) $(OBJ3) $(ZLIBDIR)\$(ZLIB) |
||||
$(LINK) @&&| |
||||
$(LINKFLAGS) |
||||
-e$(PNGDLL) |
||||
$(OBJ1) |
||||
$(OBJ2) |
||||
$(OBJ3) |
||||
$(ZLIBDIR)\$(ZLIB) |
||||
$(NOEHLIB) |
||||
| |
||||
$(IMPLIB) -c $(@R).lib $@ |
||||
|
||||
|
||||
# Clean up anything else you want |
||||
clean: |
||||
-del *.obj |
||||
-del *.dll |
||||
-del *.exe |
||||
-del *.lib |
||||
-del *.lst |
||||
-del *.map |
||||
-del *.tds |
||||
|
||||
|
||||
# End of makefile for png32bd.dll |
@ -1,104 +0,0 @@
|
||||
# makefile for libpng on BeOS x86 ELF with gcc |
||||
# modified from makefile.linux by Sander Stoks |
||||
# Copyright (C) 1999 Greg Roelofs |
||||
# Copyright (C) 1996, 1997 Andreas Dilger |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
CC=gcc |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=/usr/local/lib |
||||
ZLIBINC=/usr/local/include |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
PNGVER = $(PNGMAJ).$(PNGMIN) |
||||
|
||||
ALIGN= |
||||
# For i386: |
||||
# ALIGN=-malign-loops=2 -malign-functions=2 |
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
||||
|
||||
# On BeOS, -O1 is actually better than -O3. This is a known bug but it's |
||||
# still here in R4.5 |
||||
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 |
||||
|
||||
RANLIB=ranlib |
||||
#RANLIB=echo |
||||
|
||||
# where make install puts libpng.a, libpng.so*, and png.h |
||||
prefix=/usr/local |
||||
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) |
||||
|
||||
.SUFFIXES: .c .o |
||||
|
||||
all: libpng.a libpng.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 |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL) |
||||
$(CC) -L$(ZLIBLIB) -lz -nostart -Wl,-soname,libpng.so.$(PNGMAJ) -o |
||||
libpng.so.$(PNGVER) \ |
||||
$(OBJSDLL) |
||||
|
||||
pngtest: pngtest.o libpng.so |
||||
$(CC) -L$(ZLIBLIB) -lz -lpng -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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.so.$(PNGMAJ)* pngtest pngout.png |
||||
|
||||
# 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,162 +0,0 @@
|
||||
# Makefile for libpng |
||||
# 16-bit Borland C++ (Note: All modules are compiled in C mode) |
||||
# To build the library, do: |
||||
# "make -fmakefile.bor -DMODEL=c" |
||||
# or: "make -fmakefile.bor -DMODEL=l" |
||||
# |
||||
# ------------ Borland C++ ------------ |
||||
|
||||
### Absolutely necessary for this makefile to work |
||||
.AUTODEPEND |
||||
|
||||
## Where zlib.h, zconf.h and zlib_MODEL.lib are |
||||
ZLIB_DIR=..\zlib |
||||
|
||||
|
||||
## Compiler, linker and lib stuff |
||||
CC=bcc |
||||
LD=bcc |
||||
LIB=tlib |
||||
|
||||
!ifndef MODEL |
||||
MODEL=l |
||||
!endif |
||||
|
||||
MODEL_ARG=-m$(MODEL) |
||||
|
||||
#TARGET_CPU=3 |
||||
# 2 = 286, 3 = 386, etc. |
||||
!ifndef TARGET_CPU |
||||
TARGET_CPU=2 |
||||
!endif |
||||
|
||||
# Use this if you don't want Borland's fancy exception handling |
||||
# (for Borland C++ 4.0 or later) |
||||
#NOEHLIB=noeh$(MODEL).lib |
||||
|
||||
!ifdef DEBUG |
||||
CDEBUG=-v |
||||
LDEBUG=-v |
||||
!else |
||||
CDEBUG= |
||||
LDEBUG= |
||||
!endif |
||||
|
||||
# STACKOFLOW=1 |
||||
!ifdef STACKOFLOW |
||||
CDEBUG=$(CDEBUG) -N |
||||
LDEBUG=$(LDEBUG) -N |
||||
!endif |
||||
|
||||
# -X- turn on dependency generation in the object file |
||||
# -w set all warnings on |
||||
# -O2 optimize for speed |
||||
# -Z global optimization |
||||
CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG) |
||||
|
||||
# -M generate map file |
||||
LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG) |
||||
|
||||
|
||||
## Variables |
||||
OBJS = \ |
||||
png.obj \ |
||||
pngerror.obj \ |
||||
pngget.obj \ |
||||
pngmem.obj \ |
||||
pngpread.obj \ |
||||
pngread.obj \ |
||||
pngrio.obj \ |
||||
pngrtran.obj \ |
||||
pngrutil.obj \ |
||||
pngset.obj \ |
||||
pngtrans.obj \ |
||||
pngwio.obj \ |
||||
pngwrite.obj \ |
||||
pngwtran.obj \ |
||||
pngwutil.obj |
||||
|
||||
LIBOBJS = \ |
||||
+png.obj \ |
||||
+pngerror.obj \ |
||||
+pngget.obj \ |
||||
+pngmem.obj \ |
||||
+pngpread.obj \ |
||||
+pngread.obj \ |
||||
+pngrio.obj \ |
||||
+pngrtran.obj \ |
||||
+pngrutil.obj \ |
||||
+pngset.obj \ |
||||
+pngtrans.obj \ |
||||
+pngwio.obj \ |
||||
+pngwrite.obj \ |
||||
+pngwtran.obj \ |
||||
+pngwutil.obj |
||||
|
||||
LIBNAME=libpng$(MODEL).lib |
||||
|
||||
|
||||
## Implicit rules |
||||
# Braces let make "batch" calls to the compiler, |
||||
# 2 calls instead of 12; space is important. |
||||
.c.obj: |
||||
$(CC) $(CFLAGS) -c {$*.c } |
||||
|
||||
.c.exe: |
||||
$(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) |
||||
|
||||
|
||||
## Major targets |
||||
all: libpng pngtest |
||||
|
||||
libpng: $(LIBNAME) |
||||
|
||||
pngtest: pngtest$(MODEL).exe |
||||
|
||||
test: pngtest$(MODEL).exe |
||||
pngtest$(MODEL) |
||||
|
||||
|
||||
## Minor Targets |
||||
|
||||
png.obj: png.c |
||||
pngerror.obj: pngerror.c |
||||
pngget.obj: pngget.c |
||||
pngmem.obj: pngmem.c |
||||
pngpread.obj: pngpread.c |
||||
pngread.obj: pngread.c |
||||
pngrio.obj: pngrio.c |
||||
pngrtran.obj: pngrtran.c |
||||
pngrutil.obj: pngrutil.c |
||||
pngset.obj: pngset.c |
||||
pngtrans.obj: pngtrans.c |
||||
pngwio.obj: pngwio.c |
||||
pngwrite.obj: pngwrite.c |
||||
pngwtran.obj: pngwtran.c |
||||
pngwutil.obj: pngwutil.c |
||||
|
||||
|
||||
$(LIBNAME): $(OBJS) |
||||
-del $(LIBNAME) |
||||
$(LIB) $(LIBNAME) @&&| |
||||
$(LIBOBJS), libpng$(MODEL) |
||||
| |
||||
|
||||
|
||||
pngtest$(MODEL).obj: pngtest.c |
||||
$(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c |
||||
|
||||
pngtest$(MODEL).exe: pngtest$(MODEL).obj |
||||
$(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) |
||||
|
||||
|
||||
# Clean up anything else you want |
||||
clean: |
||||
-del *.obj |
||||
-del *.exe |
||||
-del *.lib |
||||
-del *.lst |
||||
-del *.map |
||||
|
||||
|
||||
# End of makefile for libpng |
@ -1,187 +0,0 @@
|
||||
# makefile for cygwin on x86 |
||||
# builds both dll (with import lib) and static lib versions |
||||
# of the library, and builds two copies of pngtest: one |
||||
# statically linked and one dynamically linked. |
||||
# |
||||
# based on makefile for linux-elf w/mmx by: |
||||
# Copyright (C) 1998-2000 Greg Roelofs |
||||
# Copyright (C) 1996, 1997 Andreas Dilger |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to |
||||
# $CFLAGS, and include pnggccrd.o in $OBJS, below. |
||||
|
||||
CC=gcc |
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h |
||||
prefix=/usr |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=${prefix}/lib |
||||
ZLIBINC=${prefix}/include |
||||
#ZLIBLIB=../zlib |
||||
#ZLIBINC=../zlib |
||||
|
||||
ALIGN= |
||||
# for i386: |
||||
#ALIGN=-malign-loops=2 -malign-functions=2 |
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
||||
|
||||
#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 \ |
||||
-fomit-frame-pointer |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
#PNGDLL = $3 |
||||
PNGMIN = 1.2.1 |
||||
PNGMIN_BASE = 1.2.1 |
||||
PNGVER = $(PNGMAJ).$(PNGMIN) |
||||
|
||||
SHAREDLIB=cygpng$(PNGDLL).dll |
||||
STATLIB=libpng.a |
||||
IMPLIB=libpng.dll.a |
||||
SHAREDDEF=libpng.def |
||||
LIBS=$(SHAREDLIB) $(STATLIB) |
||||
EXE=.exe |
||||
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz |
||||
LDSHARED=gcc -shared -Wl,--enable-auto-image-base |
||||
LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(SHAREDDEF) |
||||
|
||||
RANLIB=ranlib |
||||
#RANLIB=echo |
||||
|
||||
INCPATH=$(prefix)/include |
||||
LIBPATH=$(prefix)/lib |
||||
BINPATH=$(prefix)/bin |
||||
MANPATH=$(prefix)/man |
||||
MAN3PATH=$(MANPATH)/man3 |
||||
DOCPATH=$(prefix)/doc/libpng-$(PNGMIN_BASE) |
||||
|
||||
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 |
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o) |
||||
|
||||
.SUFFIXES: .c .o .pic.o |
||||
|
||||
%.o : %.c |
||||
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $< |
||||
|
||||
%.pic.o : %.c |
||||
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $< |
||||
|
||||
all: all-static all-shared |
||||
|
||||
static: all-static |
||||
|
||||
shared: all-shared |
||||
|
||||
all-static: $(STATLIB) pngtest-stat$(EXE) |
||||
|
||||
all-shared: $(SHAREDLIB) pngtest$(EXE) |
||||
|
||||
pnggccrd.o: 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) -DPNG_STATIC -DZLIB_STATIC -o $@ $*.c |
||||
|
||||
pnggccrd.pic.o: 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) -DPNG_BUILD_DLL -o $@ pnggccrd.c |
||||
|
||||
$(STATLIB): $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
$(SHAREDDEF): projects/msvc/png32ms.def |
||||
cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \ |
||||
sed -e 's/\([^;]*\);/;/' > $@ |
||||
|
||||
$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF) |
||||
$(LDSHARED) -o $@ $(LDEXTRA) $(OBJSDLL) -L. -L$(ZLIBLIB) -lz |
||||
|
||||
pngtest$(EXE): pngtest.pic.o $(SHAREDLIB) |
||||
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ |
||||
|
||||
pngtest-stat$(EXE): pngtest.o $(STATLIB) |
||||
$(CC) -static $(CFLAGS) $< $(LDFLAGS) -o $@ |
||||
|
||||
pngtest.pic.o: pngtest.c |
||||
$(CC) $(CFLAGS) -c $< -o $@ |
||||
|
||||
pngtest.o: pngtest.c |
||||
$(CC) $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -c $< -o $@ |
||||
|
||||
test: test-static test-shared |
||||
|
||||
test-static: pngtest-stat$(EXE) |
||||
./pngtest-stat |
||||
|
||||
test-shared: pngtest$(EXE) |
||||
./pngtest |
||||
|
||||
install: install-static install-shared |
||||
|
||||
install-static: $(STATLIB) install-headers install-docs install-man |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir -p $(LIBPATH); fi |
||||
install -m 755 $(STATLIB) $(LIBPATH) |
||||
|
||||
install-shared: $(SHAREDLIB) install-headers install-docs install-man |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir -p $(LIBPATH); fi |
||||
-@if [ ! -d $(BINPATH) ]; then mkdir -p $(BINPATH); fi |
||||
install -m 755 $(IMPLIB) $(LIBPATH) |
||||
install -s -m 755 $(SHAREDLIB) $(BINPATH) |
||||
|
||||
install-headers: |
||||
-@if [ ! -d $(INCPATH) ]; then mkdir -p $(INCPATH); fi |
||||
install -m 644 png.h pngconf.h $(INCPATH) |
||||
|
||||
install-docs: |
||||
-@if [ ! -d $(DOCPATH) ]; then mkdir -p $(DOCPATH); fi |
||||
install -m 644 $(DOCS) $(DOCPATH) |
||||
|
||||
install-man: |
||||
-@if [ ! -d $(MAN3PATH) ]; then mkdir -p $(MAN3PATH); fi |
||||
install -m 644 libpngpf.3 libpng.3 $(MAN3PATH) |
||||
|
||||
clean: |
||||
/bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \ |
||||
pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF) |
||||
|
||||
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 png.c |
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c |
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c |
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c |
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c |
||||
pngset.o pngset.pic.o: png.h pngconf.h pngset.c |
||||
pngget.o pngget.pic.o: png.h pngconf.h pngget.c |
||||
pngread.o pngread.pic.o: png.h pngconf.h pngread.c |
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c |
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c |
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c |
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c |
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c |
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c |
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c |
||||
|
||||
pngtest.o: png.h pngconf.h pngtest.c |
||||
pngtest-stat.o: png.h pngconf.h pngtest.c |
@ -1,106 +0,0 @@
|
||||
# makefile for libpng on Darwin / Mac OS X |
||||
# 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, libpng.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 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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) -fno-common -o $@ $*.c |
||||
|
||||
all: libpng.a libpng.dylib pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.dylib: libpng.$(PNGMAJ).dylib |
||||
ln -sf libpng.$(PNGMAJ).dylib libpng.dylib |
||||
|
||||
libpng.$(PNGMAJ).dylib: libpng.$(PNGVER).dylib |
||||
ln -sf libpng.$(PNGVER).dylib libpng.$(PNGMAJ).dylib |
||||
|
||||
libpng.$(PNGVER).dylib: $(OBJSDLL) |
||||
$(CC) -dynamiclib -undefined suppress \ |
||||
-install_name $(LIBPATH)/libpng.$(PNGMAJ).dylib \ |
||||
-current_version $(PNGMIN) -compatibility_version $(PNGMIN) \ |
||||
-o libpng.$(PNGVER).dylib \ |
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz |
||||
|
||||
pngtest: pngtest.o libpng.dylib |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a libpng.dylib |
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi |
||||
cp png.h pngconf.h $(INCPATH) |
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
||||
cp libpng.a libpng.$(PNGVER).dylib $(LIBPATH) |
||||
chmod 755 $(LIBPATH)/libpng.$(PNGVER).dylib |
||||
ranlib $(LIBPATH)/libpng.a |
||||
-@/bin/rm -f $(LIBPATH)/libpng.$(PNGMAJ).dylib $(LIBPATH)/libpng.dylib |
||||
(cd $(LIBPATH); ln -sf libpng.$(PNGVER).dylib libpng.$(PNGMAJ).dylib; \ |
||||
ln -sf libpng.$(PNGMAJ).dylib libpng.dylib) |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a libpng.*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 |
@ -1,91 +0,0 @@
|
||||
# makefile for libpng on DEC Alpha Unix |
||||
# Copyright (C) 2000 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 |
||||
prefix=/usr/local |
||||
INCPATH=$(prefix)/include |
||||
LIBPATH=$(prefix)/lib |
||||
|
||||
# Where the zlib library and include files are located |
||||
#ZLIBLIB=/usr/local/lib |
||||
#ZLIBINC=/usr/local/include |
||||
ZLIBLIB=../zlib |
||||
ZLIBINC=../zlib |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
PNGVER = $(PNGMAJ).$(PNGMIN) |
||||
|
||||
CC=cc |
||||
CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1 |
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
|
||||
#RANLIB=echo |
||||
RANLIB=ranlib |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
||||
pngwtran.o pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.so libpng.a pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ) |
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.so.$(PNGVER): $(OBJS) |
||||
$(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) -lz -lm |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.so.$(PNGMAJ)* pngtest pngout.png |
||||
|
||||
# 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 |
||||
|
@ -1,52 +0,0 @@
|
||||
# DJGPP (DOS gcc) makefile for libpng |
||||
# 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 |
||||
prefix=. |
||||
|
||||
CC=gcc |
||||
CFLAGS=-I../zlib -O |
||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm |
||||
|
||||
RANLIB=ranlib |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o pngwtran.o \ |
||||
pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.a pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
coff2exe pngtest |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png |
||||
|
||||
# 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 |
||||
pngpread.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 |
||||
|
@ -1,66 +0,0 @@
|
||||
# makefile for libpng using gcc (generic, static library) |
||||
# Copyright (C) 2000 Cosmin Truta |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# Location of the zlib library and include files |
||||
ZLIBINC = ../zlib |
||||
ZLIBLIB = ../zlib |
||||
|
||||
# Compiler, linker, lib and other tools |
||||
CC = gcc |
||||
LD = $(CC) |
||||
AR = ar rcs |
||||
RANLIB = ranlib |
||||
RM = rm -f |
||||
|
||||
CDEBUG = -g -DPNG_DEBUG=5 |
||||
LDDEBUG = |
||||
CRELEASE = -O2 |
||||
LDRELEASE = -s |
||||
CFLAGS = -I$(ZLIBINC) -Wall $(CRELEASE) |
||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE) |
||||
|
||||
# File extensions |
||||
O=.o |
||||
A=.a |
||||
E= |
||||
|
||||
# Variables |
||||
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ |
||||
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ |
||||
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) |
||||
|
||||
# Targets |
||||
all: libpng$(A) pngtest$(E) |
||||
|
||||
libpng$(A): $(OBJS) |
||||
$(AR) $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
test: pngtest$(E) |
||||
./pngtest$(E) |
||||
|
||||
pngtest$(E): pngtest$(O) libpng$(A) |
||||
$(LD) -o $@ pngtest$(O) $(LDFLAGS) |
||||
|
||||
clean: |
||||
$(RM) *$(O) libpng$(A) pngtest$(E) pngout.png |
||||
|
||||
png$(O): png.h pngconf.h |
||||
pngerror$(O): png.h pngconf.h |
||||
pngget$(O): png.h pngconf.h |
||||
pngmem$(O): png.h pngconf.h |
||||
pngpread$(O): png.h pngconf.h |
||||
pngread$(O): png.h pngconf.h |
||||
pngrio$(O): png.h pngconf.h |
||||
pngrtran$(O): png.h pngconf.h |
||||
pngrutil$(O): png.h pngconf.h |
||||
pngset$(O): png.h pngconf.h |
||||
pngtest$(O): png.h pngconf.h |
||||
pngtrans$(O): png.h pngconf.h |
||||
pngwio$(O): png.h pngconf.h |
||||
pngwrite$(O): png.h pngconf.h |
||||
pngwtran$(O): png.h pngconf.h |
||||
pngwutil$(O): png.h pngconf.h |
||||
|
@ -1,147 +0,0 @@
|
||||
# makefile for libpng on Linux ELF with gcc using MMX assembler code |
||||
# Copyright 1996-1997 Andreas Dilger |
||||
# Copyright 1998-2001 Greg Roelofs |
||||
# 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. |
||||
|
||||
CC=gcc |
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, 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 |
||||
|
||||
ALIGN= |
||||
# for i386: |
||||
#ALIGN=-malign-loops=2 -malign-functions=2 |
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
||||
|
||||
# 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_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_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_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_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 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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 pnggccrd.o |
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o) |
||||
|
||||
.SUFFIXES: .c .o .pic.o |
||||
|
||||
.c.pic.o: |
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c |
||||
|
||||
all: libpng.a libpng.so pngtest pngtest-static |
||||
|
||||
pnggccrd.o: pnggccrd.c png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) -o $@ $*.c |
||||
|
||||
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ) |
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL) |
||||
$(CC) -shared -Wl,-soname,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \ |
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc |
||||
|
||||
pngtest: pngtest.o libpng.so |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
pngtest-static: pngtest.o libpng.a |
||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A) |
||||
|
||||
test: pngtest pngtest-static |
||||
@echo "" |
||||
@echo " Testing dynamically linked version:" |
||||
@echo "" |
||||
./pngtest |
||||
@echo "" |
||||
@echo " Testing statically linked version:" |
||||
@echo "" |
||||
./pngtest-static |
||||
|
||||
install: libpng.a libpng.so.$(PNGVER) |
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi |
||||
cp png.h pngconf.h $(INCPATH) |
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
||||
cp libpng.a 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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.so.$(PNGMAJ)* pngtest pngout.png |
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
||||
writelock: |
||||
chmod a-w *.[ch35] $(DOCS) scripts/* |
||||
|
||||
png.o png.pic.o: png.h pngconf.h png.c |
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c |
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c |
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c |
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c |
||||
pngset.o pngset.pic.o: png.h pngconf.h pngset.c |
||||
pngget.o pngget.pic.o: png.h pngconf.h pngget.c |
||||
pngread.o pngread.pic.o: png.h pngconf.h pngread.c |
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c |
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c |
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c |
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c |
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c |
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c |
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c |
||||
|
||||
pngtest.o: png.h pngconf.h pngtest.c |
@ -1,112 +0,0 @@
|
||||
# makefile for libpng on HP-UX using GCC |
||||
# Copyright (C) 2001, Laurent faillie |
||||
# Copyright (C) 1998, 1999 Greg Roelofs |
||||
# Copyright (C) 1996, 1997 Andreas Dilger |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
CC=gcc |
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, png.h and pngconf.h |
||||
prefix=/usr/local |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=/opt/zlib/lib |
||||
ZLIBINC=/opt/zlib/include |
||||
|
||||
ALIGN= |
||||
# for i386: |
||||
#ALIGN=-malign-loops=2 -malign-functions=2 |
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it. |
||||
|
||||
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. -L$(ZLIBLIB) -lpng -lz -lm |
||||
|
||||
RANLIB=ranlib |
||||
#RANLIB=echo |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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) -fPIC -o $@ $*.c |
||||
|
||||
all: libpng.a libpng.sl pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.sl: libpng.sl.$(PNGMAJ) |
||||
ln -f -s libpng.sl.$(PNGMAJ) libpng.sl |
||||
|
||||
libpng.sl.$(PNGMAJ): libpng.sl.$(PNGVER) |
||||
ln -f -s libpng.sl.$(PNGVER) libpng.sl.$(PNGMAJ) |
||||
|
||||
libpng.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 |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a libpng.sl.$(PNGVER) |
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi |
||||
cp png.h pngconf.h $(INCPATH) |
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
||||
cp libpng.a 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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.sl libpng.sl.$(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,98 +0,0 @@
|
||||
# makefile for libpng, HPUX (10.20 and 11.00) |
||||
# Copyright (C) 1999, 2000 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 |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=/opt/zlib/lib |
||||
ZLIBINC=/opt/zlib/include |
||||
|
||||
CC=cc |
||||
CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 |
||||
# Caution: be sure you have built zlib with the same CFLAGS. |
||||
CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 |
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
|
||||
RANLIB=ranlib |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
PNGVER = $(PNGMAJ).$(PNGMIN) |
||||
|
||||
# where make install puts libpng.a and png.h |
||||
prefix=/opt/libpng |
||||
|
||||
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) +z -o $@ $*.c |
||||
|
||||
all: libpng.a libpng.sl pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.sl: libpng.sl.$(PNGMAJ) |
||||
ln -f -s libpng.sl.$(PNGMAJ) libpng.sl |
||||
|
||||
libpng.sl.$(PNGMAJ): libpng.sl.$(PNGVER) |
||||
ln -f -s libpng.sl.$(PNGVER) libpng.sl.$(PNGMAJ) |
||||
|
||||
libpng.sl.$(PNGVER): $(OBJSDLL) |
||||
$(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \ |
||||
+h libpng.sl.$(PNGMAJ) -o libpng.sl.$(PNGVER) $(OBJSDLL) -lz |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CCFLAGS) 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 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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.sl libpng.sl.$(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.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 |
@ -1,71 +0,0 @@
|
||||
# Makefile for libpng (static) |
||||
# IBM C version 3.x for Win32 and OS/2 |
||||
# Copyright (C) 2000 Cosmin Truta |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
# Notes: |
||||
# Derived from makefile.std |
||||
# All modules are compiled in C mode |
||||
# 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 |
||||
ZLIBINC = ../zlib |
||||
ZLIBLIB = ../zlib |
||||
|
||||
# Compiler, linker, lib and other tools |
||||
CC = icc |
||||
LD = ilink |
||||
AR = ilib |
||||
RM = del |
||||
|
||||
CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3 |
||||
LDFLAGS = |
||||
|
||||
# File extensions |
||||
O=.obj |
||||
A=.lib |
||||
E=.exe |
||||
|
||||
# Variables |
||||
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ |
||||
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ |
||||
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) |
||||
|
||||
LIBS = libpng$(A) $(ZLIBLIB)/zlib$(A) |
||||
|
||||
# Targets |
||||
all: libpng$(A) pngtest$(E) |
||||
|
||||
libpng$(A): $(OBJS) |
||||
$(AR) -out:$@ $(OBJS) |
||||
|
||||
test: pngtest$(E) |
||||
pngtest$(E) |
||||
|
||||
pngtest: pngtest$(E) |
||||
|
||||
pngtest$(E): pngtest$(O) libpng$(A) |
||||
$(LD) $(LDFLAGS) pngtest$(O) $(LIBS) |
||||
|
||||
clean: |
||||
$(RM) *$(O) |
||||
$(RM) libpng$(A) |
||||
$(RM) pngtest$(E) |
||||
$(RM) pngout.png |
||||
|
||||
png$(O): png.h pngconf.h |
||||
pngerror$(O): png.h pngconf.h |
||||
pngget$(O): png.h pngconf.h |
||||
pngmem$(O): png.h pngconf.h |
||||
pngpread$(O): png.h pngconf.h |
||||
pngread$(O): png.h pngconf.h |
||||
pngrio$(O): png.h pngconf.h |
||||
pngrtran$(O): png.h pngconf.h |
||||
pngrutil$(O): png.h pngconf.h |
||||
pngset$(O): png.h pngconf.h |
||||
pngtest$(O): png.h pngconf.h |
||||
pngtrans$(O): png.h pngconf.h |
||||
pngwio$(O): png.h pngconf.h |
||||
pngwrite$(O): png.h pngconf.h |
||||
pngwtran$(O): png.h pngconf.h |
||||
pngwutil$(O): png.h pngconf.h |
@ -1,114 +0,0 @@
|
||||
# Makefile for libpng |
||||
# Microsoft Visual C++ with Intel C/C++ Compiler 4.0 and later |
||||
|
||||
# Copyright (C) 2000, Pawel Mrochen, based on makefile.msc which is |
||||
# copyright 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# To use, do "nmake /f scripts\makefile.intel" |
||||
|
||||
|
||||
# ------------------- Intel C/C++ Compiler 4.0 and later ------------------- |
||||
|
||||
# Caution: the assembler code was introduced at libpng version 1.0.4 and has |
||||
# not yet been thoroughly tested. |
||||
|
||||
# Use assembler code |
||||
ASMCODE=-DPNG_USE_PNGVCRD |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=..\zlib |
||||
ZLIBINC=..\zlib |
||||
|
||||
# Target CPU |
||||
CPU=6 # Pentium II |
||||
#CPU=5 # Pentium |
||||
|
||||
# Calling convention |
||||
CALLING=r # __fastcall |
||||
#CALLING=z # __stdcall |
||||
#CALLING=d # __cdecl |
||||
|
||||
# Uncomment next to put error messages in a file |
||||
#ERRFILE=>>pngerrs |
||||
|
||||
# -------------------------------------------------------------------------- |
||||
|
||||
|
||||
CC=icl -c |
||||
CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -I$(ZLIBINC) $(ASMCODE) -nologo |
||||
LD=link |
||||
LDFLAGS=/SUBSYSTEM:CONSOLE /NOLOGO |
||||
|
||||
O=.obj |
||||
|
||||
OBJS=png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) \ |
||||
pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) \ |
||||
pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) pngvcrd$(O) |
||||
|
||||
|
||||
all: test |
||||
|
||||
png$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngset$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngget$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngread$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngpread$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrtran$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrutil$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngvcrd$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngerror$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngmem$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrio$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwio$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngtest$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngtrans$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwrite$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwtran$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwutil$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
libpng.lib: $(OBJS) |
||||
if exist libpng.lib del libpng.lib |
||||
lib /NOLOGO /OUT:libpng.lib $(OBJS) |
||||
|
||||
pngtest.exe: pngtest.obj libpng.lib |
||||
$(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib |
||||
|
||||
test: pngtest.exe |
||||
pngtest.exe |
||||
|
||||
|
||||
# End of makefile for libpng |
@ -1,82 +0,0 @@
|
||||
# makefile for libpng |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# This makefile requires the file ansi2knr.c, which you can get |
||||
# from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/ |
||||
# If you have libjpeg, you probably already have ansi2knr.c in the jpeg |
||||
# source distribution. |
||||
|
||||
# where make install puts libpng.a and png.h |
||||
prefix=/usr/local |
||||
|
||||
CC=cc |
||||
CFLAGS=-I../zlib -O |
||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm |
||||
# flags for ansi2knr |
||||
ANSI2KNRFLAGS= |
||||
|
||||
RANLIB=ranlib |
||||
#RANLIB=echo |
||||
|
||||
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: ansi2knr libpng.a pngtest |
||||
|
||||
# general rule to allow ansi2knr to work |
||||
.c.o: |
||||
./ansi2knr $*.c T$*.c |
||||
$(CC) $(CFLAGS) -c T$*.c |
||||
rm -f T$*.c $*.o |
||||
mv T$*.o $*.o |
||||
|
||||
ansi2knr: ansi2knr.c |
||||
$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c |
||||
|
||||
libpng.a: ansi2knr $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a |
||||
-@mkdir $(prefix)/include |
||||
-@mkdir $(prefix)/lib |
||||
cp png.h $(prefix)/include |
||||
cp pngconf.h $(prefix)/include |
||||
chmod 644 $(prefix)/include/png.h |
||||
chmod 644 $(prefix)/include/pngconf.h |
||||
cp libpng.a $(prefix)/lib |
||||
chmod 644 $(prefix)/lib/libpng.a |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png ansi2knr |
||||
|
||||
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 |
||||
pngpread.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 |
@ -1,112 +0,0 @@
|
||||
# makefile for libpng on Linux ELF with gcc |
||||
# Copyright (C) 1998, 1999 Greg Roelofs |
||||
# Copyright (C) 1996, 1997 Andreas Dilger |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
CC=gcc |
||||
|
||||
# where "make install" puts libpng.a, libpng.so*, 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 |
||||
|
||||
ALIGN= |
||||
# for i386: |
||||
#ALIGN=-malign-loops=2 -malign-functions=2 |
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it. |
||||
|
||||
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 |
||||
|
||||
RANLIB=ranlib |
||||
#RANLIB=echo |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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) -fPIC -o $@ $*.c |
||||
|
||||
all: libpng.a libpng.so pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ) |
||||
ln -sf libpng.so.$(PNGMAJ) libpng.so |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL) |
||||
$(CC) -shared -Wl,-soname,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \ |
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc |
||||
|
||||
pngtest: pngtest.o libpng.so |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a libpng.so.$(PNGVER) |
||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi |
||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi |
||||
cp png.h pngconf.h $(INCPATH) |
||||
chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
||||
cp libpng.a 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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.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,92 +0,0 @@
|
||||
# makefile for libpng, MACOS X |
||||
# 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 |
||||
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=-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 = 3 |
||||
PNGMIN = 1.2.1 |
||||
VER = $(PNGMAJ).$(PNGMIN) |
||||
SHAREDLIB=libpng |
||||
SHAREDLIB_POSTFIX=dylib |
||||
libdir=$(prefix)/lib |
||||
|
||||
#RANLIB=echo |
||||
RANLIB=ranlib |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
||||
pngwtran.o pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.a pngtest shared |
||||
|
||||
shared: $(SHAREDLIB).$(VER).$(SHAREDLIB_POSTFIX) |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
$(SHAREDLIB).$(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-shared: $(SHAREDLIB).$(VER).$(SHAREDLIB_POSTFIX) |
||||
cp $(SHAREDLIB).$(VER).$(SHAREDLIB_POSTFIX) $(libdir) |
||||
(cd $(libdir); \ |
||||
ln -s $(SHAREDLIB).$(VER).$(SHAREDLIB_POSTFIX) $(SHAREDLIB).$(SHAREDLIB_POSTFIX)) |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png $(SHAREDLIB).$(VER).$(SHAREDLIB_POSTFIX) $(SHAREDLIB).$(SHAREDLIB_POSTFIX) |
||||
|
||||
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 |
||||
|
@ -1,66 +0,0 @@
|
||||
# makefile for libpng |
||||
# 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 |
||||
|
||||
CC=cc |
||||
CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips |
||||
#CFLAGS=-O |
||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm |
||||
|
||||
#RANLIB=ranlib |
||||
RANLIB=echo |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
||||
pngwtran.o pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.a pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a |
||||
-@mkdir $(prefix)/include |
||||
-@mkdir $(prefix)/lib |
||||
cp png.h $(prefix)/include |
||||
cp pngconf.h $(prefix)/include |
||||
chmod 644 $(prefix)/include/png.h |
||||
chmod 644 $(prefix)/include/pngconf.h |
||||
cp libpng.a $(prefix)/lib |
||||
chmod 644 $(prefix)/lib/libpng.a |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png |
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
||||
writelock: |
||||
chmod a-w *.[ch35] $(DOCS) scripts/* |
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it. |
||||
|
||||
png.o: png.h pngconf.h |
||||
pngerror.o: png.h pngconf.h |
||||
pngrio.o: png.h pngconf.h |
||||
pngwio.o: png.h pngconf.h |
||||
pngmem.o: png.h pngconf.h |
||||
pngset.o: png.h pngconf.h |
||||
pngget.o: png.h pngconf.h |
||||
pngread.o: png.h pngconf.h |
||||
pngpread.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 |
@ -1,86 +0,0 @@
|
||||
# makefile for libpng |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib |
||||
|
||||
# -------- Microsoft C 5.1 and later, does not use assembler code -------- |
||||
MODEL=L |
||||
CFLAGS=-Oait -Gs -nologo -W3 -A$(MODEL) -I..\zlib |
||||
#-Ox generates bad code with MSC 5.1 |
||||
CC=cl |
||||
LD=link |
||||
LDFLAGS=/e/st:0x1500/noe |
||||
O=.obj |
||||
|
||||
#uncomment next to put error messages in a file |
||||
ERRFILE= >> pngerrs |
||||
|
||||
# variables |
||||
OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) |
||||
OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) |
||||
OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) |
||||
|
||||
all: libpng.lib |
||||
|
||||
png$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngset$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngget$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngread$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngpread$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrtran$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrutil$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngerror$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngmem$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrio$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwio$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngtest$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngtrans$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwrite$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwtran$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwutil$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) |
||||
del libpng.lib |
||||
lib libpng $(OBJS1); |
||||
lib libpng $(OBJS2); |
||||
lib libpng $(OBJS3); |
||||
|
||||
pngtest.exe: pngtest.obj libpng.lib |
||||
$(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ; |
||||
|
||||
test: pngtest.exe |
||||
pngtest |
||||
|
||||
# End of makefile for libpng |
||||
|
@ -1,42 +0,0 @@
|
||||
# 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 |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
LOCALBASE?=/usr/local |
||||
LIBDIR= ${LOCALBASE}/lib |
||||
MANDIR= ${LOCALBASE}/man |
||||
INCSDIR=${LOCALBASE}/include |
||||
|
||||
LIB=png |
||||
SHLIB_MAJOR= 3 |
||||
SHLIB_MINOR= 1.2.1 |
||||
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,69 +0,0 @@
|
||||
# makefile for libpng on OS/2 with gcc |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# Related files: pngos2.def |
||||
|
||||
CC=gcc -Zomf -s |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=../zlib |
||||
ZLIBINC=../zlib |
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
||||
CFLAGS=-I$(ZLIBINC) -Wall -O6 -funroll-loops -malign-loops=2 \ |
||||
-malign-functions=2 #$(WARNMORE) -g -DPNG_DEBUG=5 |
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lzdll -Zcrtdll |
||||
AR=emxomfar |
||||
|
||||
PNGLIB=png.lib |
||||
IMPLIB=emximp |
||||
SHAREDLIB=png.dll |
||||
SHAREDLIBIMP=pngdll.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 |
||||
|
||||
.SUFFIXES: .c .o |
||||
|
||||
all: $(PNGLIB) $(SHAREDLIB) $(SHAREDLIBIMP) |
||||
|
||||
$(PNGLIB): $(OBJS) |
||||
$(AR) rc $@ $(OBJS) |
||||
|
||||
$(SHAREDLIB): $(OBJS) pngos2.def |
||||
$(CC) $(LDFLAGS) -Zdll -o $@ $^ |
||||
|
||||
$(SHAREDLIBIMP): pngos2.def |
||||
$(IMPLIB) -o $@ $^ |
||||
|
||||
pngtest.exe: pngtest.o png.dll pngdll.lib |
||||
$(CC) -o $@ $(CFLAGS) $< $(LDFLAGS) |
||||
|
||||
test: pngtest.exe |
||||
./pngtest.exe |
||||
|
||||
clean: |
||||
rm -f *.o $(PNGLIB) png.dll pngdll.lib pngtest.exe pngout.png |
||||
|
||||
# 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,102 +0,0 @@
|
||||
# makefile for SCO OSr5 ELF and Unixware 7 with Native cc |
||||
# Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx |
||||
# force ELF build dynamic linking, SONAME setting in lib and RPATH in app |
||||
# 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 |
||||
|
||||
# where make install puts libpng.a, libpng.so*, and png.h |
||||
prefix=/usr/local |
||||
|
||||
# Where the zlib library and include files are located |
||||
#ZLIBLIB=/usr/local/lib |
||||
#ZLIBINC=/usr/local/include |
||||
ZLIBLIB=../zlib |
||||
ZLIBINC=../zlib |
||||
|
||||
CFLAGS= -dy -belf -I$(ZLIBINC) -O3 |
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
|
||||
#RANLIB=ranlib |
||||
RANLIB=echo |
||||
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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 libpng.so pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ) |
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.so.$(PNGVER): $(OBJSDLL) |
||||
$(CC) -G -Wl,-h,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \ |
||||
$(OBJSDLL) |
||||
|
||||
pngtest: pngtest.o libpng.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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.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,97 +0,0 @@
|
||||
# makefile for libpng, SGI IRIX with gcc |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# where make install puts libpng.a and png.h |
||||
prefix=/usr/local |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=/usr/local/lib32 |
||||
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=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 |
||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
LDSHARED=CC $(ABI) -shared |
||||
|
||||
VER=1.2.1 |
||||
# See "man dso" for info about shared objects |
||||
SONUM=3 |
||||
LIBS=libpng.so.$(SONUM).$(VER) |
||||
SHAREDLIB=libpng.so |
||||
libdir=$(prefix)/lib32 |
||||
|
||||
RANLIB=echo |
||||
#RANLIB=ranlib |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
||||
pngwtran.o pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.a $(SHAREDLIB).$(VER) pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
$(SHAREDLIB).$(VER): $(OBJS) |
||||
$(LDSHARED) -o $@ $(OBJS) |
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).$(SONUM) |
||||
ln -s $@ $(SHAREDLIB) |
||||
ln -s $@ $(SHAREDLIB).$(SONUM) |
||||
|
||||
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-shared: $(SHAREDLIB).$(VER) |
||||
cp $(SHAREDLIB).$(VER) $(libdir); chmod 755 $(SHAREDLIB).$(VER) |
||||
(cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \ |
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).$(SONUM); \ |
||||
ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \ |
||||
ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).$(SONUM); \ |
||||
(ldconfig || true) >/dev/null 2>&1; \ |
||||
fi) |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png |
||||
|
||||
# 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 |
||||
|
@ -1,110 +0,0 @@
|
||||
# makefile for libpng (.a and .so), SGI IRIX with 'cc' |
||||
# Copyright (C) 2001 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 |
||||
prefix=/usr/local |
||||
|
||||
# Where the zlib library and include files are located |
||||
#ZLIBLIB=/usr/local/lib32 |
||||
#ZLIBINC=/usr/local/include |
||||
#ZLIBLIB=/usr/local/lib |
||||
#ZLIBINC=/usr/local/include |
||||
ZLIBLIB=../zlib |
||||
ZLIBINC=../zlib |
||||
|
||||
CC=cc |
||||
|
||||
# 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= |
||||
|
||||
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=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
LDSHARED=cc $(ABI) -shared |
||||
|
||||
VER=1.2.1 |
||||
# See "man dso" for info about shared objects |
||||
SONUM=3 |
||||
SHAREDLIB=libpng.so |
||||
|
||||
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) |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
$(SHAREDLIB).$(SONUM).$(VER): $(OBJS) |
||||
$(LDSHARED) -o $@ $(OBJS) |
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).$(SONUM) |
||||
ln -s $@ $(SHAREDLIB) |
||||
ln -s $@ $(SHAREDLIB).$(SONUM) |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a |
||||
-@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) |
||||
chmod 644 $(LIBPATH)/libpng.a |
||||
|
||||
install-shared: $(SHAREDLIB).$(SONUM).$(VER) |
||||
cp $(SHAREDLIB).$(SONUM).$(VER) $(LIBPATH) |
||||
chmod 755 $(SHAREDLIB).$(SONUM).$(VER) |
||||
(cd $(LIBPATH); if test -f $(SHAREDLIB).$(SONUM).$(VER); then \ |
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).$(SONUM); \ |
||||
ln -s $(SHAREDLIB).$(SONUM).$(VER) $(SHAREDLIB).$(SONUM); \ |
||||
ln -s $(SHAREDLIB).$(SONUM) $(SHAREDLIB)) |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png $(SHAREDLIB) $(SHAREDLIB).$(SONUM)* |
||||
|
||||
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,124 +0,0 @@
|
||||
# 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 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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 libpng.so pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ) |
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.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 libpng.so.$(PNGMAJ) \ |
||||
-o libpng.so.$(PNGVER) $(OBJSDLL) -lz |
||||
|
||||
pngtest: pngtest.o libpng.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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.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,120 +0,0 @@
|
||||
# makefile for libpng on Solaris 2.x with gcc |
||||
# Contributed by William L. Sebok, based on makefile.linux |
||||
# Copyright (C) 1998 Greg Roelofs |
||||
# Copyright (C) 1996, 1997 Andreas Dilger |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
CC=gcc |
||||
|
||||
# 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 |
||||
|
||||
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 |
||||
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 3. You should not |
||||
# have to change it. |
||||
PNGMAJ = 3 |
||||
PNGMIN = 1.2.1 |
||||
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) -fPIC -o $@ $*.c |
||||
|
||||
all: libpng.a libpng.so pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
libpng.so: libpng.so.$(PNGMAJ) |
||||
ln -f -s libpng.so.$(PNGMAJ) libpng.so |
||||
|
||||
libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
||||
ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
||||
|
||||
libpng.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 libpng.so.$(PNGMAJ) \ |
||||
-o libpng.so.$(PNGVER) $(OBJSDLL) -lz |
||||
|
||||
pngtest: pngtest.o libpng.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) |
||||
|
||||
clean: |
||||
/bin/rm -f *.o libpng.a libpng.so libpng.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,72 +0,0 @@
|
||||
# makefile for libpng |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# where make install puts libpng.a and png.h |
||||
prefix=/usr/local |
||||
|
||||
# Where the zlib library and include files are located |
||||
#ZLIBLIB=/usr/local/lib |
||||
#ZLIBINC=/usr/local/include |
||||
ZLIBLIB=../zlib |
||||
ZLIBINC=../zlib |
||||
|
||||
CC=cc |
||||
CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5 |
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
|
||||
#RANLIB=echo |
||||
RANLIB=ranlib |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
||||
pngwtran.o pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.a pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a |
||||
-@mkdir $(prefix)/include |
||||
-@mkdir $(prefix)/lib |
||||
cp png.h $(prefix)/include |
||||
cp pngconf.h $(prefix)/include |
||||
chmod 644 $(prefix)/include/png.h |
||||
chmod 644 $(prefix)/include/pngconf.h |
||||
cp libpng.a $(prefix)/lib |
||||
chmod 644 $(prefix)/lib/libpng.a |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png |
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
||||
writelock: |
||||
chmod a-w *.[ch35] $(DOCS) scripts/* |
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it. |
||||
|
||||
png.o: png.h pngconf.h |
||||
pngerror.o: png.h pngconf.h |
||||
pngrio.o: png.h pngconf.h |
||||
pngwio.o: png.h pngconf.h |
||||
pngmem.o: png.h pngconf.h |
||||
pngset.o: png.h pngconf.h |
||||
pngget.o: png.h pngconf.h |
||||
pngread.o: png.h pngconf.h |
||||
pngrtran.o: png.h pngconf.h |
||||
pngrutil.o: png.h pngconf.h |
||||
pngtest.o: png.h pngconf.h |
||||
pngtrans.o: png.h pngconf.h |
||||
pngwrite.o: png.h pngconf.h |
||||
pngwtran.o: png.h pngconf.h |
||||
pngwutil.o: png.h pngconf.h |
||||
pngpread.o: png.h pngconf.h |
||||
|
@ -1,76 +0,0 @@
|
||||
# makefile for libpng |
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# where make install puts libpng.a and png.h |
||||
prefix=/usr/local |
||||
|
||||
# Where the zlib library and include files are located |
||||
#ZLIBLIB=/usr/local/lib |
||||
#ZLIBINC=/usr/local/include |
||||
ZLIBLIB=../zlib |
||||
ZLIBINC=../zlib |
||||
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow -Wconversion \ |
||||
-Wmissing-declarations -Wtraditional -Wcast-align \ |
||||
-Wstrict-prototypes -Wmissing-prototypes |
||||
CC=gcc |
||||
CFLAGS=-I$(ZLIBINC) -O # $(WARNMORE) -DPNG_DEBUG=5 |
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
||||
|
||||
RANLIB=ranlib |
||||
#RANLIB=echo |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
||||
pngwtran.o pngmem.o pngerror.o pngpread.o |
||||
|
||||
all: libpng.a pngtest |
||||
|
||||
libpng.a: $(OBJS) |
||||
ar rc $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
pngtest: pngtest.o libpng.a |
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
||||
|
||||
test: pngtest |
||||
./pngtest |
||||
|
||||
install: libpng.a |
||||
-@mkdir $(prefix)/include |
||||
-@mkdir $(prefix)/lib |
||||
cp png.h $(prefix)/include |
||||
cp pngconf.h $(prefix)/include |
||||
chmod 644 $(prefix)/include/png.h |
||||
chmod 644 $(prefix)/include/pngconf.h |
||||
cp libpng.a $(prefix)/lib |
||||
chmod 644 $(prefix)/lib/libpng.a |
||||
|
||||
clean: |
||||
rm -f *.o libpng.a pngtest pngout.png |
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
||||
writelock: |
||||
chmod a-w *.[ch35] $(DOCS) scripts/* |
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it. |
||||
|
||||
png.o: png.h pngconf.h |
||||
pngerror.o: png.h pngconf.h |
||||
pngrio.o: png.h pngconf.h |
||||
pngwio.o: png.h pngconf.h |
||||
pngmem.o: png.h pngconf.h |
||||
pngset.o: png.h pngconf.h |
||||
pngget.o: png.h pngconf.h |
||||
pngread.o: png.h pngconf.h |
||||
pngrtran.o: png.h pngconf.h |
||||
pngrutil.o: png.h pngconf.h |
||||
pngtest.o: png.h pngconf.h |
||||
pngtrans.o: png.h pngconf.h |
||||
pngwrite.o: png.h pngconf.h |
||||
pngwtran.o: png.h pngconf.h |
||||
pngwutil.o: png.h pngconf.h |
||||
pngpread.o: png.h pngconf.h |
||||
|
@ -1,89 +0,0 @@
|
||||
# Makefile for libpng |
||||
# TurboC/C++ (Note: All modules are compiled in C mode) |
||||
|
||||
# To use, do "make -fmakefile.tc3" |
||||
|
||||
# ----- Turbo C 3.00 (can be modified to work with earlier versions) ----- |
||||
|
||||
MODEL=l |
||||
CFLAGS=-O2 -Z -m$(MODEL) -I..\zlib |
||||
#CFLAGS=-D_NO_PROTO -O2 -Z -m$(MODEL) -I..\zlib # Turbo C older than 3.00 |
||||
CC=tcc |
||||
LD=tcc |
||||
LIB=tlib |
||||
LDFLAGS=-m$(MODEL) -L..\zlib |
||||
O=.obj |
||||
E=.exe |
||||
|
||||
# variables |
||||
OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) |
||||
OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) |
||||
OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) |
||||
OBJSL1 = +png$(O) +pngset$(O) +pngget$(O) +pngrutil$(O) +pngtrans$(O) |
||||
OBJSL2 = +pngwutil$(O) +pngmem$(O) +pngpread$(O) +pngread$(O) +pngerror$(O) |
||||
OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O) +pngwio$(O) |
||||
|
||||
all: libpng$(MODEL).lib pngtest$(E) |
||||
|
||||
pngtest: pngtest$(E) |
||||
|
||||
test: pngtest$(E) |
||||
pngtest$(E) |
||||
|
||||
png$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngset$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngget$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngread$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngpread$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngrtran$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngrutil$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngerror$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngmem$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngrio$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngwio$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngtest$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngtrans$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngwrite$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngwtran$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
pngwutil$(O): png.h pngconf.h |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3) |
||||
$(LIB) libpng$(MODEL) +$(OBJSL1) |
||||
$(LIB) libpng$(MODEL) +$(OBJSL2) |
||||
$(LIB) libpng$(MODEL) +$(OBJSL3) |
||||
|
||||
pngtest$(E): pngtest$(O) libpng$(MODEL).lib |
||||
$(LD) $(LDFLAGS) pngtest.obj libpng$(MODEL).lib zlib_$(MODEL).lib |
||||
|
||||
# End of makefile for libpng |
@ -1,109 +0,0 @@
|
||||
# Makefile for libpng |
||||
# Watcom C/C++ 10.0 and later, 32-bit protected mode, flat memory model |
||||
|
||||
# Copyright (C) 2000, Pawel Mrochen, based on makefile.msc which is |
||||
# copyright 1995 Guy Eric Schalnat, Group 42, Inc. |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
# To use, do "wmake /f scripts\makefile.watcom" |
||||
|
||||
|
||||
# ---------------------- Watcom C/C++ 10.0 and later ----------------------- |
||||
|
||||
# Where the zlib library and include files are located |
||||
ZLIBLIB=..\zlib |
||||
ZLIBINC=..\zlib |
||||
|
||||
# Target OS |
||||
OS=DOS |
||||
#OS=NT |
||||
|
||||
# Target CPU |
||||
CPU=6 # Pentium Pro |
||||
#CPU=5 # Pentium |
||||
|
||||
# Calling convention |
||||
CALLING=r # registers |
||||
#CALLING=s # stack |
||||
|
||||
# Uncomment next to put error messages in a file |
||||
#ERRFILE=>>pngerrs |
||||
|
||||
# -------------------------------------------------------------------------- |
||||
|
||||
|
||||
CC=wcc386 |
||||
CFLAGS=-$(CPU)$(CALLING) -fp$(CPU) -fpi87 -oneatx -mf -bt=$(OS) -i=$(ZLIBINC) -zq |
||||
LD=wcl386 |
||||
LDFLAGS=-zq |
||||
|
||||
O=.obj |
||||
|
||||
OBJS1=png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) |
||||
OBJS2=pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) |
||||
OBJS3=pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) |
||||
|
||||
|
||||
all: test |
||||
|
||||
png$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngset$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngget$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngread$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngpread$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrtran$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrutil$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngerror$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngmem$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngrio$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwio$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngtest$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngtrans$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwrite$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwtran$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
pngwutil$(O): png.h pngconf.h |
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE) |
||||
|
||||
libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) |
||||
wlib -b -c -n -q libpng.lib $(OBJS1) |
||||
wlib -b -c -q libpng.lib $(OBJS2) |
||||
wlib -b -c -q libpng.lib $(OBJS3) |
||||
|
||||
pngtest.exe: pngtest.obj libpng.lib |
||||
$(LD) $(LDFLAGS) pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib |
||||
|
||||
test: pngtest.exe .symbolic |
||||
pngtest.exe |
||||
|
||||
|
||||
# End of makefile for libpng |
@ -1,144 +0,0 @@
|
||||
$! make libpng under VMS |
||||
$! |
||||
$! |
||||
$! Check for MMK/MMS |
||||
$! |
||||
$! This procedure accepts one parameter (contrib), which causes it to build |
||||
$! the programs from the contrib directory instead of libpng. |
||||
$! |
||||
$ p1 = f$edit(p1,"UPCASE") |
||||
$ if p1 .eqs. "CONTRIB" |
||||
$ then |
||||
$ set def [.contrib.gregbook] |
||||
$ @makevms |
||||
$ set def [-.pngminus] |
||||
$ @makevms |
||||
$ set def [--] |
||||
$ exit |
||||
$ endif |
||||
$ Make = "" |
||||
$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS" |
||||
$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK" |
||||
$! |
||||
$! Look for the compiler used |
||||
$! |
||||
$ zlibsrc = "[-.zlib]" |
||||
$ ccopt="/include=''zlibsrc'" |
||||
$ if f$getsyi("HW_MODEL").ge.1024 |
||||
$ then |
||||
$ ccopt = "/prefix=all"+ccopt |
||||
$ comp = "__decc__=1" |
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library: |
||||
$ else |
||||
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" |
||||
$ then |
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library: |
||||
$ if f$search("SYS$SYSTEM:VAXC.EXE").eqs."" |
||||
$ then |
||||
$ comp = "__gcc__=1" |
||||
$ CC :== GCC |
||||
$ else |
||||
$ comp = "__vaxc__=1" |
||||
$ endif |
||||
$ else |
||||
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include: |
||||
$ ccopt = "/decc/prefix=all"+ccopt |
||||
$ comp = "__decc__=1" |
||||
$ endif |
||||
$ endif |
||||
$! |
||||
$! Build the thing plain or with mms/mmk |
||||
$! |
||||
$ write sys$output "Compiling Libpng sources ..." |
||||
$ if make.eqs."" |
||||
$ then |
||||
$ dele pngtest.obj;* |
||||
$ CALL MAKE png.OBJ "cc ''CCOPT' png" - |
||||
png.c png.h pngconf.h |
||||
$ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" - |
||||
pngpread.c png.h pngconf.h |
||||
$ CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" - |
||||
pngset.c png.h pngconf.h |
||||
$ CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" - |
||||
pngget.c png.h pngconf.h |
||||
$ CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" - |
||||
pngread.c png.h pngconf.h |
||||
$ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" - |
||||
pngpread.c png.h pngconf.h |
||||
$ CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" - |
||||
pngrtran.c png.h pngconf.h |
||||
$ CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" - |
||||
pngrutil.c png.h pngconf.h |
||||
$ CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" - |
||||
pngerror.c png.h pngconf.h |
||||
$ CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" - |
||||
pngmem.c png.h pngconf.h |
||||
$ CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" - |
||||
pngrio.c png.h pngconf.h |
||||
$ CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" - |
||||
pngwio.c png.h pngconf.h |
||||
$ CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" - |
||||
pngtrans.c png.h pngconf.h |
||||
$ CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" - |
||||
pngwrite.c png.h pngconf.h |
||||
$ CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" - |
||||
pngwtran.c png.h pngconf.h |
||||
$ CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" - |
||||
pngwutil.c png.h pngconf.h |
||||
$ write sys$output "Building Libpng ..." |
||||
$ CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ |
||||
$ write sys$output "Building pngtest..." |
||||
$ CALL MAKE pngtest.OBJ "cc ''CCOPT' pngtest" - |
||||
pngtest.c png.h pngconf.h |
||||
$ call make pngtest.exe - |
||||
"LINK pngtest,libpng.olb/lib,''zlibsrc'libz.olb/lib" - |
||||
pngtest.obj libpng.olb |
||||
$ write sys$output "Testing Libpng..." |
||||
$ run pngtest |
||||
$ else |
||||
$ if f$search("DESCRIP.MMS") .eqs. "" then copy/nolog [.SCRIPTS]DESCRIP.MMS [] |
||||
$ 'make'/macro=('comp',zlibsrc='zlibsrc') |
||||
$ endif |
||||
$ write sys$output "Libpng build completed" |
||||
$ exit |
||||
$! |
||||
$! |
||||
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES |
||||
$ V = 'F$Verify(0) |
||||
$! P1 = What we are trying to make |
||||
$! P2 = Command to make it |
||||
$! P3 - P8 What it depends on |
||||
$ |
||||
$ If F$Search(P1) .Eqs. "" Then Goto Makeit |
||||
$ Time = F$CvTime(F$File(P1,"RDT")) |
||||
$arg=3 |
||||
$Loop: |
||||
$ Argument = P'arg |
||||
$ If Argument .Eqs. "" Then Goto Exit |
||||
$ El=0 |
||||
$Loop2: |
||||
$ File = F$Element(El," ",Argument) |
||||
$ If File .Eqs. " " Then Goto Endl |
||||
$ AFile = "" |
||||
$Loop3: |
||||
$ OFile = AFile |
||||
$ AFile = F$Search(File) |
||||
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl |
||||
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit |
||||
$ Goto Loop3 |
||||
$NextEL: |
||||
$ El = El + 1 |
||||
$ Goto Loop2 |
||||
$EndL: |
||||
$ arg=arg+1 |
||||
$ If arg .Le. 8 Then Goto Loop |
||||
$ Goto Exit |
||||
$ |
||||
$Makeit: |
||||
$ VV=F$VERIFY(0) |
||||
$ write sys$output P2 |
||||
$ 'P2 |
||||
$ VV='F$Verify(VV) |
||||
$Exit: |
||||
$ If V Then Set Verify |
||||
$ENDSUBROUTINE |
@ -1,795 +0,0 @@
|
||||
unit pngdef; |
||||
|
||||
// Caution: this file has fallen out of date since version 1.0.5. Write to |
||||
// png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu about bringing |
||||
// it up to date. |
||||
|
||||
interface |
||||
|
||||
const |
||||
PNG_LIBPNG_VER_STRING = '1.2.1'; |
||||
PNG_LIBPNG_VER = 10201; |
||||
|
||||
type |
||||
png_uint_32 = Cardinal; |
||||
png_int_32 = Longint; |
||||
png_uint_16 = Word; |
||||
png_int_16 = Smallint; |
||||
png_byte = Byte; |
||||
png_size_t = png_uint_32; |
||||
png_charpp = ^png_charp; |
||||
png_charp = PChar; |
||||
float = single; |
||||
int = Integer; |
||||
png_bytepp = ^png_bytep; |
||||
png_bytep = ^png_byte; |
||||
png_uint_16p = ^png_uint_16; |
||||
png_uint_16pp = ^png_uint_16p; |
||||
png_voidp = pointer; |
||||
time_t = Longint; |
||||
png_doublep = ^png_double; |
||||
png_double = double; |
||||
|
||||
user_error_ptr = Pointer; |
||||
png_error_ptrp = ^png_error_ptr; |
||||
png_error_ptr = procedure(png_ptr: Pointer; msg: Pointer); |
||||
stdcall; |
||||
png_rw_ptrp = ^png_rw_ptr; |
||||
png_rw_ptr = procedure(png_ptr: Pointer; data: Pointer; |
||||
length: png_size_t); |
||||
stdcall; |
||||
png_flush_ptrp = ^png_flush_ptr; |
||||
png_flush_ptr = procedure(png_ptr: Pointer); |
||||
stdcall; |
||||
png_progressive_info_ptrp = ^png_progressive_info_ptr; |
||||
png_progressive_info_ptr = procedure(png_ptr: Pointer; |
||||
info_ptr: Pointer); |
||||
stdcall; |
||||
png_progressive_end_ptrp = ^png_progressive_end_ptr; |
||||
png_progressive_end_ptr = procedure(png_ptr: Pointer; |
||||
info_ptr: Pointer); |
||||
stdcall; |
||||
png_progressive_row_ptrp = ^png_progressive_row_ptr; |
||||
png_progressive_row_ptr = procedure(png_ptr: Pointer; |
||||
data: Pointer; length: png_uint_32; |
||||
count: int); |
||||
stdcall; |
||||
png_read_status_ptr = procedure(png_ptr: Pointer; |
||||
row_number: png_uint_32; pass: int); |
||||
stdcall; |
||||
png_write_status_ptr = procedure(png_ptr: Pointer; |
||||
row_number: png_uint_32; pass: int); |
||||
stdcall; |
||||
png_user_chunk_ptr = procedure(png_ptr: Pointer; |
||||
data: png_unknown_chunkp); |
||||
stdcall; |
||||
png_user_transform_ptr = procedure(png_ptr: Pointer; |
||||
row_info: Pointer; data: png_bytep); |
||||
stdcall; |
||||
|
||||
png_colorpp = ^png_colorp; |
||||
png_colorp = ^png_color; |
||||
png_color = packed record |
||||
red, green, blue: png_byte; |
||||
end; |
||||
|
||||
png_color_16pp = ^png_color_16p; |
||||
png_color_16p = ^png_color_16; |
||||
png_color_16 = packed record |
||||
index: png_byte; //used for palette files |
||||
red, green, blue: png_uint_16; //for use in red green blue files |
||||
gray: png_uint_16; //for use in grayscale files |
||||
end; |
||||
|
||||
png_color_8pp = ^png_color_8p; |
||||
png_color_8p = ^png_color_8; |
||||
png_color_8 = packed record |
||||
red, green, blue: png_byte; //for use in red green blue files |
||||
gray: png_byte; //for use in grayscale files |
||||
alpha: png_byte; //for alpha channel files |
||||
end; |
||||
|
||||
png_textpp = ^png_textp; |
||||
png_textp = ^png_text; |
||||
png_text = packed record |
||||
compression: int; //compression value |
||||
key: png_charp; //keyword, 1-79 character description of "text" |
||||
text: png_charp; //comment, may be empty ("") |
||||
text_length: png_size_t; //length of text field |
||||
end; |
||||
|
||||
png_timepp = ^png_timep; |
||||
png_timep = ^png_time; |
||||
png_time = packed record |
||||
year: png_uint_16; //yyyy |
||||
month: png_byte; //1..12 |
||||
day: png_byte; //1..31 |
||||
hour: png_byte; //0..23 |
||||
minute: png_byte; //0..59 |
||||
second: png_byte; //0..60 (leap seconds) |
||||
end; |
||||
|
||||
png_infopp = ^png_infop; |
||||
png_infop = Pointer; |
||||
|
||||
png_row_infopp = ^png_row_infop; |
||||
png_row_infop = ^png_row_info; |
||||
png_row_info = packed record |
||||
width: png_uint_32; //width of row |
||||
rowbytes: png_size_t; //number of bytes in row |
||||
color_type: png_byte; //color type of row |
||||
bit_depth: png_byte; //bit depth of row |
||||
channels: png_byte; //number of channels (1, 2, 3, or 4) |
||||
pixel_depth: png_byte; //bits per pixel (depth * channels) |
||||
end; |
||||
|
||||
png_structpp = ^png_structp; |
||||
png_structp = Pointer; |
||||
|
||||
const |
||||
|
||||
// Supported compression types for text in PNG files (tEXt, and zTXt). |
||||
// The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. |
||||
|
||||
PNG_TEXT_COMPRESSION_NONE_WR = -3; |
||||
PNG_TEXT_COMPRESSION_zTXt_WR = -2; |
||||
PNG_TEXT_COMPRESSION_NONE = -1; |
||||
PNG_TEXT_COMPRESSION_zTXt = 0; |
||||
|
||||
// These describe the color_type field in png_info. |
||||
// color type masks |
||||
|
||||
PNG_COLOR_MASK_PALETTE = 1; |
||||
PNG_COLOR_MASK_COLOR = 2; |
||||
PNG_COLOR_MASK_ALPHA = 4; |
||||
|
||||
// color types. Note that not all combinations are legal |
||||
|
||||
PNG_COLOR_TYPE_GRAY = 0; |
||||
PNG_COLOR_TYPE_PALETTE = PNG_COLOR_MASK_COLOR or |
||||
PNG_COLOR_MASK_PALETTE; |
||||
PNG_COLOR_TYPE_RGB = PNG_COLOR_MASK_COLOR; |
||||
PNG_COLOR_TYPE_RGB_ALPHA = PNG_COLOR_MASK_COLOR or |
||||
PNG_COLOR_MASK_ALPHA; |
||||
PNG_COLOR_TYPE_GRAY_ALPHA = PNG_COLOR_MASK_ALPHA; |
||||
|
||||
// This is for compression type. PNG 1.0 only defines the single type. |
||||
|
||||
PNG_COMPRESSION_TYPE_BASE = 0; // Deflate method 8, 32K window |
||||
PNG_COMPRESSION_TYPE_DEFAULT = PNG_COMPRESSION_TYPE_BASE; |
||||
|
||||
// This is for filter type. PNG 1.0 only defines the single type. |
||||
|
||||
PNG_FILTER_TYPE_BASE = 0; // Single row per-byte filtering |
||||
PNG_FILTER_TYPE_DEFAULT = PNG_FILTER_TYPE_BASE; |
||||
|
||||
// These are for the interlacing type. These values should NOT be changed. |
||||
|
||||
PNG_INTERLACE_NONE = 0; // Non-interlaced image |
||||
PNG_INTERLACE_ADAM7 = 1; // Adam7 interlacing |
||||
|
||||
// These are for the oFFs chunk. These values should NOT be changed. |
||||
|
||||
PNG_OFFSET_PIXEL = 0; // Offset in pixels |
||||
PNG_OFFSET_MICROMETER = 1; // Offset in micrometers (1/10^6 meter) |
||||
|
||||
// These are for the pCAL chunk. These values should NOT be changed. |
||||
|
||||
PNG_EQUATION_LINEAR = 0; // Linear transformation |
||||
PNG_EQUATION_BASE_E = 1; // Exponential base e transform |
||||
PNG_EQUATION_ARBITRARY = 2; // Arbitrary base exponential transform |
||||
PNG_EQUATION_HYPERBOLIC = 3; // Hyperbolic sine transformation |
||||
|
||||
// These are for the pHYs chunk. These values should NOT be changed. |
||||
|
||||
PNG_RESOLUTION_UNKNOWN = 0; // pixels/unknown unit (aspect ratio) |
||||
PNG_RESOLUTION_METER = 1; // pixels/meter |
||||
|
||||
// These are for the sRGB chunk. These values should NOT be changed. |
||||
PNG_sRGB_INTENT_PERCEPTUAL = 0; |
||||
PNG_sRGB_INTENT_RELATIVE = 1; |
||||
PNG_sRGB_INTENT_SATURATION = 2; |
||||
PNG_sRGB_INTENT_ABSOLUTE = 3; |
||||
|
||||
// Handle alpha and tRNS by replacing with a background color. |
||||
PNG_BACKGROUND_GAMMA_UNKNOWN = 0; |
||||
PNG_BACKGROUND_GAMMA_SCREEN = 1; |
||||
PNG_BACKGROUND_GAMMA_FILE = 2; |
||||
PNG_BACKGROUND_GAMMA_UNIQUE = 3; |
||||
|
||||
// Values for png_set_crc_action() to say how to handle CRC errors in |
||||
// ancillary and critical chunks, and whether to use the data contained |
||||
// therein. Note that it is impossible to "discard" data in a critical |
||||
// chunk. For versions prior to 0.90, the action was always error/quit, |
||||
// whereas in version 0.90 and later, the action for CRC errors in ancillary |
||||
// chunks is warn/discard. These values should NOT be changed. |
||||
|
||||
// value action:critical action:ancillary |
||||
|
||||
PNG_CRC_DEFAULT = 0; // error/quit warn/discard data |
||||
PNG_CRC_ERROR_QUIT = 1; // error/quit error/quit |
||||
PNG_CRC_WARN_DISCARD = 2; // (INVALID) warn/discard data |
||||
PNG_CRC_WARN_USE = 3; // warn/use data warn/use data |
||||
PNG_CRC_QUIET_USE = 4; // quiet/use data quiet/use data |
||||
PNG_CRC_NO_CHANGE = 5; // use current value use current value |
||||
|
||||
// Flags for png_set_filter() to say which filters to use. The flags |
||||
// are chosen so that they don't conflict with real filter types |
||||
// below, in case they are supplied instead of the #defined constants. |
||||
// These values should NOT be changed. |
||||
|
||||
PNG_NO_FILTERS = $00; |
||||
PNG_FILTER_NONE = $08; |
||||
PNG_FILTER_SUB = $10; |
||||
PNG_FILTER_UP = $20; |
||||
PNG_FILTER_AVG = $40; |
||||
PNG_FILTER_PAETH = $80; |
||||
PNG_ALL_FILTERS = PNG_FILTER_NONE or PNG_FILTER_SUB or |
||||
PNG_FILTER_UP or PNG_FILTER_AVG or |
||||
PNG_FILTER_PAETH; |
||||
|
||||
// Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. |
||||
// These defines should NOT be changed. |
||||
|
||||
PNG_FILTER_VALUE_NONE = 0; |
||||
PNG_FILTER_VALUE_SUB = 1; |
||||
PNG_FILTER_VALUE_UP = 2; |
||||
PNG_FILTER_VALUE_AVG = 3; |
||||
PNG_FILTER_VALUE_PAETH = 4; |
||||
|
||||
// Heuristic used for row filter selection. These defines should NOT be |
||||
// changed. |
||||
|
||||
PNG_FILTER_HEURISTIC_DEFAULT = 0; // Currently "UNWEIGHTED" |
||||
PNG_FILTER_HEURISTIC_UNWEIGHTED = 1; // Used by libpng < 0.95 |
||||
PNG_FILTER_HEURISTIC_WEIGHTED = 2; // Experimental feature |
||||
PNG_FILTER_HEURISTIC_LAST = 3; // Not a valid value |
||||
|
||||
procedure png_build_grayscale_palette(bit_depth: int; palette: png_colorp); |
||||
stdcall; |
||||
function png_check_sig(sig: png_bytep; num: int): int; |
||||
stdcall; |
||||
procedure png_chunk_error(png_ptr: png_structp; |
||||
const mess: png_charp); |
||||
stdcall; |
||||
procedure png_chunk_warning(png_ptr: png_structp; |
||||
const mess: png_charp); |
||||
stdcall; |
||||
procedure png_convert_from_time_t(ptime: png_timep; ttime: time_t); |
||||
stdcall; |
||||
function png_convert_to_rfc1123(png_ptr: png_structp; ptime: png_timep): |
||||
png_charp; |
||||
stdcall; |
||||
function png_create_info_struct(png_ptr: png_structp): png_infop; |
||||
stdcall; |
||||
function png_create_read_struct(user_png_ver: png_charp; |
||||
error_ptr: user_error_ptr; error_fn: png_error_ptr; |
||||
warn_fn: png_error_ptr): png_structp; |
||||
stdcall; |
||||
function png_get_copyright(png_ptr: png_structp): png_charp; |
||||
stdcall; |
||||
function png_get_header_ver(png_ptr: png_structp): png_charp; |
||||
stdcall; |
||||
function png_get_header_version(png_ptr: png_structp): png_charp; |
||||
stdcall; |
||||
function png_get_libpng_ver(png_ptr: png_structp): png_charp; |
||||
stdcall; |
||||
function png_create_write_struct(user_png_ver: png_charp; |
||||
error_ptr: user_error_ptr; error_fn: png_error_ptr; |
||||
warn_fn: png_error_ptr): png_structp; |
||||
stdcall; |
||||
procedure png_destroy_info_struct(png_ptr: png_structp; |
||||
info_ptr_ptr: png_infopp); |
||||
stdcall; |
||||
procedure png_destroy_read_struct(png_ptr_ptr: png_structpp; |
||||
info_ptr_ptr, end_info_ptr_ptr: png_infopp); |
||||
stdcall; |
||||
procedure png_destroy_write_struct(png_ptr_ptr: png_structpp; |
||||
info_ptr_ptr: png_infopp); |
||||
stdcall; |
||||
function png_get_IHDR(png_ptr: png_structp; info_ptr: png_infop; |
||||
var width, height: png_uint_32; var bit_depth, |
||||
color_type, interlace_type, compression_type, |
||||
filter_type: int): png_uint_32; |
||||
stdcall; |
||||
function png_get_PLTE(png_ptr: png_structp; info_ptr: png_infop; |
||||
var palette: png_colorp; var num_palette: int): |
||||
png_uint_32; |
||||
stdcall; |
||||
function png_get_bKGD(png_ptr: png_structp; info_ptr: png_infop; |
||||
var background: png_color_16p): png_uint_32; |
||||
stdcall; |
||||
function png_get_bit_depth(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_byte; |
||||
stdcall; |
||||
function png_get_cHRM(png_ptr: png_structp; info_ptr: png_infop; |
||||
var white_x, white_y, red_x, red_y, green_x, green_y, |
||||
blue_x, blue_y: double): png_uint_32; |
||||
stdcall; |
||||
function png_get_channels(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_byte; |
||||
stdcall; |
||||
function png_get_color_type(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_byte; |
||||
stdcall; |
||||
function png_get_compression_type(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_byte; |
||||
stdcall; |
||||
function png_get_error_ptr(png_ptr: png_structp): png_voidp; |
||||
stdcall; |
||||
function png_get_filter_type(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_byte; |
||||
stdcall; |
||||
function png_get_gAMA(png_ptr: png_structp; info_ptr: png_infop; |
||||
var file_gamma: double): png_uint_32; |
||||
stdcall; |
||||
function png_get_hIST(png_ptr: png_structp; info_ptr: png_infop; |
||||
var hist: png_uint_16p): png_uint_32; |
||||
stdcall; |
||||
function png_get_image_height(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_uint_32; |
||||
stdcall; |
||||
function png_get_image_width(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_uint_32; |
||||
stdcall; |
||||
function png_get_interlace_type(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_byte; |
||||
stdcall; |
||||
function png_get_io_ptr(png_ptr: png_structp): png_voidp; |
||||
stdcall; |
||||
function png_get_oFFs(png_ptr: png_structp; info_ptr: png_infop; |
||||
var offset_x, offset_y: png_uint_32; |
||||
var unit_type: int): png_uint_32; |
||||
stdcall; |
||||
function png_get_sCAL(png_ptr: png_structp; info_ptr: png_infop; |
||||
var unit:int; var width: png_uint_32; height: png_uint_32): |
||||
png_uint_32; |
||||
stdcall |
||||
function png_get_pCAL(png_ptr: png_structp; info_ptr: png_infop; |
||||
var purpose: png_charp; var X0, X1: png_int_32; |
||||
var typ, nparams: int; var units: png_charp; |
||||
var params: png_charpp): png_uint_32; |
||||
stdcall; |
||||
function png_get_pHYs(png_ptr: png_structp; info_ptr: png_infop; |
||||
var res_x, res_y: png_uint_32; var unit_type: int): |
||||
png_uint_32; |
||||
stdcall; |
||||
function png_get_pixel_aspect_ratio(png_ptr: png_structp; |
||||
info_ptr: png_infop): float; |
||||
stdcall; |
||||
function png_get_pixels_per_meter(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
function png_get_progressive_ptr(png_ptr: png_structp): png_voidp; |
||||
stdcall; |
||||
function png_get_rgb_to_gray_status(png_ptr: png_structp); |
||||
stdcall; |
||||
function png_get_rowbytes(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_uint_32; |
||||
stdcall; |
||||
function png_get_rows(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_bytepp; |
||||
stdcall; |
||||
function png_get_sBIT(png_ptr: png_structp; info_ptr: png_infop; |
||||
var sig_bits: png_color_8p): png_uint_32; |
||||
stdcall; |
||||
function png_get_sRGB(png_ptr: png_structp; info_ptr: png_infop; |
||||
var file_srgb_intent: int): png_uint_32; |
||||
stdcall; |
||||
function png_get_signature(png_ptr: png_structp; info_ptr: png_infop): |
||||
png_bytep; |
||||
stdcall; |
||||
function png_get_tIME(png_ptr: png_structp; info_ptr: png_infop; |
||||
var mod_time: png_timep): png_uint_32; |
||||
stdcall; |
||||
function png_get_tRNS(png_ptr: png_structp; info_ptr: png_infop; |
||||
var trans: png_bytep; var num_trans: int; |
||||
var trans_values: png_color_16p): png_uint_32; |
||||
stdcall; |
||||
function png_get_text(png_ptr: png_structp; info_ptr: png_infop; |
||||
var text_ptr: png_textp; var num_text: int): |
||||
png_uint_32; |
||||
stdcall; |
||||
function png_get_user_chunk_ptr(png_ptr: png_structp): |
||||
png_voidp; |
||||
stdcall; |
||||
function png_get_valid(png_ptr: png_structp; info_ptr: png_infop; |
||||
flag: png_uint_32): png_uint_32; |
||||
stdcall; |
||||
function png_get_x_offset_microns(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
function png_get_x_offset_pixels(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
function png_get_x_pixels_per_meter(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
function png_get_y_offset_microns(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
function png_get_y_offset_pixels(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
function png_get_y_pixels_per_meter(png_ptr: png_structp; |
||||
info_ptr: png_infop): png_uint_32; |
||||
stdcall; |
||||
procedure png_process_data(png_ptr: png_structp; info_ptr: png_infop; |
||||
buffer: png_bytep; buffer_size: png_size_t); |
||||
stdcall; |
||||
procedure png_progressive_combine_row(png_ptr: png_structp; |
||||
old_row, new_row: png_bytep); |
||||
stdcall; |
||||
procedure png_read_end(png_ptr: png_structp; info_ptr: png_infop); |
||||
stdcall; |
||||
procedure png_read_image(png_ptr: png_structp; image: png_bytepp); |
||||
stdcall; |
||||
procedure png_read_info(png_ptr: png_structp; info_ptr: png_infop); |
||||
stdcall; |
||||
procedure png_read_row(png_ptr: png_structp; row, dsp_row: png_bytep); |
||||
stdcall; |
||||
procedure png_read_rows(png_ptr: png_structp; row, display_row: |
||||
png_bytepp; num_rows: png_uint_32); |
||||
stdcall; |
||||
procedure png_read_update_info(png_ptr: png_structp; info_ptr: png_infop); |
||||
stdcall; |
||||
procedure png_set_IHDR(png_ptr: png_structp; info_ptr: png_infop; |
||||
width, height: png_uint_32; bit_depth, color_type, |
||||
interlace_type, compression_type, filter_type: int); |
||||
stdcall; |
||||
procedure png_set_PLTE(png_ptr: png_structp; info_ptr: png_infop; |
||||
palette: png_colorp; num_palette: int); |
||||
stdcall; |
||||
procedure png_set_bKGD(png_ptr: png_structp; info_ptr: png_infop; |
||||
background: png_color_16p); |
||||
stdcall; |
||||
procedure png_set_background(png_ptr: png_structp; |
||||
background_color: png_color_16p; |
||||
background_gamma_code, need_expand: int; |
||||
background_gamma: double); |
||||
stdcall; |
||||
procedure png_set_bgr(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_cHRM(png_ptr: png_structp; info_ptr: png_infop; |
||||
white_x, white_y, red_x, red_y, green_x, green_y, |
||||
blue_x, blue_y: double); |
||||
stdcall; |
||||
procedure png_set_cHRM_fixed(png_ptr: png_structp; info_ptr: png_infop; |
||||
white_x, white_y, red_x, red_y, green_x, green_y, |
||||
blue_x, blue_y: png_fixed_point); |
||||
stdcall; |
||||
procedure png_set_compression_level(png_ptr: png_structp; level: int); |
||||
stdcall; |
||||
procedure png_set_compression_mem_level(png_ptr: png_structp; |
||||
mem_level: int); |
||||
stdcall; |
||||
procedure png_set_compression_method(png_ptr: png_structp; method: int); |
||||
stdcall; |
||||
procedure png_set_compression_strategy(png_ptr: png_structp; |
||||
strategy: int); |
||||
stdcall; |
||||
procedure png_set_compression_window_bits(png_ptr: png_structp; |
||||
window_bits: int); |
||||
stdcall; |
||||
procedure png_set_crc_action(png_ptr: png_structp; |
||||
crit_action, ancil_action: int); |
||||
stdcall; |
||||
procedure png_set_dither(png_ptr: png_structp; plaette: png_colorp; |
||||
num_palette, maximum_colors: int; |
||||
histogram: png_uint_16p; full_dither: int); |
||||
stdcall; |
||||
procedure png_set_error_fn(png_ptr: png_structp; error_ptr: png_voidp; |
||||
error_fn, warning_fn: png_error_ptr); |
||||
stdcall; |
||||
procedure png_set_expand(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_filler(png_ptr: png_structp; filler: png_uint_32; |
||||
filler_loc: int); |
||||
stdcall; |
||||
procedure png_set_filter(png_ptr: png_structp; method, filters: int); |
||||
stdcall; |
||||
procedure png_set_filter_heuristics(png_ptr: png_structp; |
||||
heuristic_method, num_weights: int; |
||||
filter_weights, filter_costs: png_doublep); |
||||
stdcall; |
||||
procedure png_set_flush(png_ptr: png_structp; nrows: int); |
||||
stdcall; |
||||
procedure png_set_gAMA(png_ptr: png_structp; info_ptr: png_infop; |
||||
file_gamma: double); |
||||
stdcall; |
||||
procedure png_set_gAMA_fixed(png_ptr: png_structp; info_ptr: png_infop; |
||||
file_gamma: png_fixed_point); |
||||
stdcall; |
||||
procedure png_set_gamma(png_ptr: png_structp; screen_gamma, |
||||
default_file_gamma: double); |
||||
stdcall; |
||||
procedure png_set_gray_1_2_4_to_8(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_gray_to_rgb(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_hIST(png_ptr: png_structp; info_ptr: png_infop; |
||||
hist: png_uint_16p); |
||||
stdcall; |
||||
function png_set_interlace_handling(png_ptr: png_structp): int; |
||||
stdcall; |
||||
procedure png_set_invalid(png_ptr: png_structp; info_ptr:png_infop; |
||||
mask: int); |
||||
stdcall; |
||||
procedure png_set_invert_alpha(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_invert_mono(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_oFFs(png_ptr: png_structp; info_ptr: png_infop; |
||||
offset_x, offset_y: png_uint_32; unit_type: int); |
||||
stdcall; |
||||
procedure png_set_palette_to_rgb(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_pCAL(png_ptr: png_structp; info_ptr: png_infop; |
||||
purpose: png_charp; X0, X1: png_int_32; |
||||
typ, nparams: int; units: png_charp; |
||||
params: png_charpp); |
||||
stdcall; |
||||
procedure png_set_pHYs(png_ptr: png_structp; info_ptr: png_infop; |
||||
res_x, res_y: png_uint_32; unit_type: int); |
||||
stdcall; |
||||
procedure png_set_packing(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_packswap(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_progressive_read_fn(png_ptr: png_structp; |
||||
progressive_ptr: png_voidp; |
||||
info_fn: png_progressive_info_ptr; |
||||
row_fn: png_progressive_row_ptr; |
||||
end_fn: png_progressive_end_ptr); |
||||
stdcall; |
||||
procedure png_set_read_fn(png_ptr: png_structp; |
||||
io_ptr: png_voidp; read_data_fn: png_rw_ptr); |
||||
stdcall; |
||||
procedure png_set_read_status_fn(png_ptr: png_structp; |
||||
read_row_fn: png_read_status_ptr); |
||||
stdcall; |
||||
procedure png_set_read_user_chunk_fn(png_ptr: png_structp; |
||||
read_user_chunk_fn: png_user_chunk_ptr); |
||||
stdcall; |
||||
procedure png_set_read_user_transform_fn(png_ptr: png_structp; |
||||
read_user_transform_fn: png_user_transform_ptr); |
||||
stdcall; |
||||
procedure png_set_rgb_to_gray(png_ptr: png_structp; int: error_action; |
||||
red_weight, green_weight: double); |
||||
stdcall; |
||||
procedure png_set_rgb_to_gray_fixed(png_ptr: png_structp; int: error_action; |
||||
red_weight, green_weight: png_fixed_point); |
||||
stdcall; |
||||
procedure png_set_rows(png_ptr: png_structp; info_ptr: png_infop; |
||||
row_pointers: png_bytepp); |
||||
stdcall; |
||||
procedure png_set_sBIT(png_ptr: png_structp; info_ptr: png_infop; |
||||
sig_bits: png_color_8p); |
||||
stdcall; |
||||
procedure png_set_sRGB(png_ptr: png_structp; info_ptr: png_infop; |
||||
intent: int); |
||||
stdcall; |
||||
procedure png_set_sRGB_gAMA_and_cHRM(png_ptr: png_structp; |
||||
info_ptr: png_infop; intent: int); |
||||
stdcall; |
||||
procedure png_set_shift(png_ptr: png_structp; true_bits: png_color_8p); |
||||
stdcall; |
||||
procedure png_set_sig_bytes(png_ptr: png_structp; num_bytes: int); |
||||
stdcall; |
||||
procedure png_set_strip_16(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_strip_alpha(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_swap(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_swap_alpha(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_tIME(png_ptr: png_structp; info_ptr: png_infop; |
||||
mod_time: png_timep); |
||||
stdcall; |
||||
procedure png_set_tRNS(png_ptr: png_structp; info_ptr: png_infop; |
||||
trans: png_bytep; num_trans: int; |
||||
trans_values: png_color_16p); |
||||
stdcall; |
||||
procedure png_set_tRNS_to_alpha(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_set_text(png_ptr: png_structp; info_ptr: png_infop; |
||||
text_ptr: png_textp; num_text: int); |
||||
stdcall; |
||||
procedure png_set_write_fn(png_ptr: png_structp; |
||||
io_ptr: png_voidp; write_data_fn: png_rw_ptr; |
||||
output_flush_fn: png_flush_ptr); |
||||
stdcall; |
||||
procedure png_set_write_status_fn(png_ptr: png_structp; |
||||
write_row_fn: png_write_status_ptr); |
||||
stdcall; |
||||
procedure png_set_write_user_transform_fn(png_ptr: png_structp; |
||||
write_user_transform_fn: png_user_transform_ptr); |
||||
stdcall; |
||||
function png_sig_cmp(sig: png_bytep; start, num_to_check: png_size_t): |
||||
int; |
||||
stdcall; |
||||
procedure png_start_read_image(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_write_chunk(png_ptr: png_structp; |
||||
chunk_name, data: png_bytep; length: png_size_t); |
||||
stdcall; |
||||
procedure png_write_chunk_data(png_ptr: png_structp; |
||||
data: png_bytep; length: png_size_t); |
||||
stdcall; |
||||
procedure png_write_chunk_end(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_write_chunk_start(png_ptr: png_structp; |
||||
chunk_name: png_bytep; length: png_uint_32); |
||||
stdcall; |
||||
procedure png_write_end(png_ptr: png_structp; info_ptr: png_infop); |
||||
stdcall; |
||||
procedure png_write_flush(png_ptr: png_structp); |
||||
stdcall; |
||||
procedure png_write_image(png_ptr: png_structp; image: png_bytepp); |
||||
stdcall; |
||||
procedure png_write_info(png_ptr: png_structp; info_ptr: png_infop); |
||||
stdcall; |
||||
procedure png_write_info_before_PLTE(png_ptr: png_structp; info_ptr: png_infop); |
||||
stdcall; |
||||
procedure png_write_row(png_ptr: png_structp; row: png_bytep); |
||||
stdcall; |
||||
procedure png_write_rows(png_ptr: png_structp; row: png_bytepp; |
||||
num_rows: png_uint_32); |
||||
stdcall; |
||||
procedure png_get_iCCP(png_ptr: png_structp; info_ptr: png_infop; |
||||
name: png_charpp; compression_type: int *; profile: png_charpp; |
||||
proflen: png_int_32): png_bytep; |
||||
stdcall; |
||||
procedure png_get_sPLT(png_ptr: png_structp; |
||||
info_ptr: png_infop; entries: png_spalette_pp): png_uint_32; |
||||
stdcall; |
||||
procedure png_set_iCCP(png_ptr: png_structp; info_ptr: png_infop; |
||||
name: png_charp; compression_type: int; profile: png_charp; |
||||
proflen: int); |
||||
stdcall; |
||||
procedure png_free_data(png_ptr: png_structp; info_ptr: png_infop; num: int); |
||||
stdcall; |
||||
procedure png_set_sPLT(png_ptr: png_structp; info_ptr: png_infop; |
||||
entries: png_spalette_p; nentries: int); |
||||
stdcall; |
||||
|
||||
implementation |
||||
|
||||
const |
||||
pngDLL = 'png32bd.dll'; |
||||
|
||||
procedure png_build_grayscale_palette; external pngDLL; |
||||
function png_check_sig; external pngDLL; |
||||
procedure png_chunk_error; external pngDLL; |
||||
procedure png_chunk_warning; external pngDLL; |
||||
procedure png_convert_from_time_t; external pngDLL; |
||||
function png_convert_to_rfc1123; external pngDLL; |
||||
function png_create_info_struct; external pngDLL; |
||||
function png_create_read_struct; external pngDLL; |
||||
function png_create_write_struct; external pngDLL; |
||||
procedure png_destroy_info_struct; external pngDLL; |
||||
procedure png_destroy_read_struct; external pngDLL; |
||||
procedure png_destroy_write_struct; external pngDLL; |
||||
function png_get_IHDR; external pngDLL; |
||||
function png_get_PLTE; external pngDLL; |
||||
function png_get_bKGD; external pngDLL; |
||||
function png_get_bit_depth; external pngDLL; |
||||
function png_get_cHRM; external pngDLL; |
||||
function png_get_channels; external pngDLL; |
||||
function png_get_color_type; external pngDLL; |
||||
function png_get_compression_type; external pngDLL; |
||||
function png_get_error_ptr; external pngDLL; |
||||
function png_get_filter_type; external pngDLL; |
||||
function png_get_gAMA; external pngDLL; |
||||
function png_get_hIST; external pngDLL; |
||||
function png_get_image_height; external pngDLL; |
||||
function png_get_image_width; external pngDLL; |
||||
function png_get_interlace_type; external pngDLL; |
||||
function png_get_io_ptr; external pngDLL; |
||||
function png_get_oFFs; external pngDLL; |
||||
function png_get_pCAL; external pngDLL; |
||||
function png_get_pHYs; external pngDLL; |
||||
function png_get_pixel_aspect_ratio; external pngDLL; |
||||
function png_get_pixels_per_meter; external pngDLL; |
||||
function png_get_progressive_ptr; external pngDLL; |
||||
function png_get_rowbytes; external pngDLL; |
||||
function png_get_rows; external pngDLL; |
||||
function png_get_sBIT; external pngDLL; |
||||
function png_get_sRGB; external pngDLL; |
||||
function png_get_signature; external pngDLL; |
||||
function png_get_tIME; external pngDLL; |
||||
function png_get_tRNS; external pngDLL; |
||||
function png_get_text; external pngDLL; |
||||
function png_get_user_chunk_ptr; external pngDLL; |
||||
function png_get_valid; external pngDLL; |
||||
function png_get_x_offset_microns; external pngDLL; |
||||
function png_get_x_offset_pixels; external pngDLL; |
||||
function png_get_x_pixels_per_meter; external pngDLL; |
||||
function png_get_y_offset_microns; external pngDLL; |
||||
function png_get_y_offset_pixels; external pngDLL; |
||||
function png_get_y_pixels_per_meter; external pngDLL; |
||||
procedure png_process_data; external pngDLL; |
||||
procedure png_progressive_combine_row; external pngDLL; |
||||
procedure png_read_end; external pngDLL; |
||||
procedure png_read_image; external pngDLL; |
||||
procedure png_read_info; external pngDLL; |
||||
procedure png_read_row; external pngDLL; |
||||
procedure png_read_rows; external pngDLL; |
||||
procedure png_read_update_info; external pngDLL; |
||||
procedure png_set_IHDR; external pngDLL; |
||||
procedure png_set_PLTE; external pngDLL; |
||||
procedure png_set_bKGD; external pngDLL; |
||||
procedure png_set_background; external pngDLL; |
||||
procedure png_set_bgr; external pngDLL; |
||||
procedure png_set_cHRM; external pngDLL; |
||||
procedure png_set_cHRM_fixed; external pngDLL; |
||||
procedure png_set_compression_level; external pngDLL; |
||||
procedure png_set_compression_mem_level; external pngDLL; |
||||
procedure png_set_compression_method; external pngDLL; |
||||
procedure png_set_compression_strategy; external pngDLL; |
||||
procedure png_set_compression_window_bits; external pngDLL; |
||||
procedure png_set_crc_action; external pngDLL; |
||||
procedure png_set_dither; external pngDLL; |
||||
procedure png_set_error_fn; external pngDLL; |
||||
procedure png_set_expand; external pngDLL; |
||||
procedure png_set_filler; external pngDLL; |
||||
procedure png_set_filter; external pngDLL; |
||||
procedure png_set_filter_heuristics; external pngDLL; |
||||
procedure png_set_flush; external pngDLL; |
||||
procedure png_set_gAMA; external pngDLL; |
||||
procedure png_set_gAMA_fixed; external pngDLL; |
||||
procedure png_set_gamma; external pngDLL; |
||||
procedure png_set_gray_to_rgb; external pngDLL; |
||||
procedure png_set_hIST; external pngDLL; |
||||
function png_set_interlace_handling; external pngDLL; |
||||
procedure png_set_invert_alpha; external pngDLL; |
||||
procedure png_set_invert_mono; external pngDLL; |
||||
procedure png_set_oFFs; external pngDLL; |
||||
procedure png_set_pCAL; external pngDLL; |
||||
procedure png_set_pHYs; external pngDLL; |
||||
procedure png_set_packing; external pngDLL; |
||||
procedure png_set_packswap; external pngDLL; |
||||
procedure png_set_progressive_read_fn; external pngDLL; |
||||
procedure png_set_read_fn; external pngDLL; |
||||
procedure png_set_read_status_fn; external pngDLL; |
||||
procedure png_set_read_user_transform_fn; external pngDLL; |
||||
procedure png_set_rgb_to_gray; external pngDLL; |
||||
procedure png_set_rgb_to_gray_fixed; external pngDLL; |
||||
procedure png_set_rows; external pngDLL; |
||||
procedure png_set_sBIT; external pngDLL; |
||||
procedure png_set_sRGB; external pngDLL; |
||||
procedure png_set_sRGB_gAMA_and_cHRM; external pngDLL; |
||||
procedure png_set_shift; external pngDLL; |
||||
procedure png_set_sig_bytes; external pngDLL; |
||||
procedure png_set_strip_16; external pngDLL; |
||||
procedure png_set_strip_alpha; external pngDLL; |
||||
procedure png_set_swap; external pngDLL; |
||||
procedure png_set_swap_alpha; external pngDLL; |
||||
procedure png_set_tIME; external pngDLL; |
||||
procedure png_set_tRNS; external pngDLL; |
||||
procedure png_set_text; external pngDLL; |
||||
procedure png_set_user_chunk_fn; external pngDLL; |
||||
procedure png_set_write_fn; external pngDLL; |
||||
procedure png_set_write_status_fn; external pngDLL; |
||||
procedure png_set_write_user_transform_fn; external pngDLL; |
||||
function png_sig_cmp; external pngDLL; |
||||
procedure png_start_read_image; external pngDLL; |
||||
procedure png_write_chunk; external pngDLL; |
||||
procedure png_write_chunk_data; external pngDLL; |
||||
procedure png_write_chunk_end; external pngDLL; |
||||
procedure png_write_chunk_start; external pngDLL; |
||||
procedure png_write_end; external pngDLL; |
||||
procedure png_write_flush; external pngDLL; |
||||
procedure png_write_image; external pngDLL; |
||||
procedure png_write_info; external pngDLL; |
||||
procedure png_write_info_before_PLTE; external pngDLL; |
||||
procedure png_write_row; external pngDLL; |
||||
procedure png_write_rows; external pngDLL; |
||||
procedure png_get_iCCP; external pngDLL; |
||||
procedure png_get_sPLT; external pngDLL; |
||||
procedure png_set_iCCP; external pngDLL; |
||||
procedure png_set_sPLT; external pngDLL; |
||||
procedure png_free_data; external pngDLL; |
||||
|
||||
end. |
@ -1,234 +0,0 @@
|
||||
;---------------------------------------- |
||||
; PNG.LIB module definition file for OS/2 |
||||
;---------------------------------------- |
||||
|
||||
; Version 1.2.1 |
||||
|
||||
LIBRARY PNG |
||||
DESCRIPTION "PNG image compression library for OS/2" |
||||
CODE PRELOAD MOVEABLE DISCARDABLE |
||||
DATA PRELOAD MOVEABLE MULTIPLE |
||||
|
||||
EXPORTS |
||||
|
||||
|
||||
png_build_grayscale_palette |
||||
png_check_sig |
||||
png_chunk_error |
||||
png_chunk_warning |
||||
png_convert_from_struct_tm |
||||
png_convert_from_time_t |
||||
png_create_info_struct |
||||
png_create_read_struct |
||||
png_create_write_struct |
||||
png_data_freer |
||||
png_destroy_info_struct |
||||
png_destroy_read_struct |
||||
png_destroy_write_struct |
||||
png_error |
||||
png_free |
||||
png_free_data |
||||
png_get_IHDR |
||||
png_get_PLTE |
||||
png_get_bKGD |
||||
png_get_bit_depth |
||||
png_get_cHRM |
||||
png_get_cHRM_fixed |
||||
png_get_channels |
||||
png_get_color_type |
||||
png_get_compression_buffer_size |
||||
png_get_compression_type |
||||
png_get_copyright |
||||
png_get_error_ptr |
||||
png_get_filter_type |
||||
png_get_gAMA |
||||
png_get_gAMA_fixed |
||||
png_get_hIST |
||||
png_get_header_ver |
||||
png_get_header_version |
||||
png_get_iCCP |
||||
png_get_image_height |
||||
png_get_image_width |
||||
png_get_interlace_type |
||||
png_get_io_ptr |
||||
png_get_libpng_ver |
||||
png_get_oFFs |
||||
png_get_pCAL |
||||
png_get_pHYs |
||||
png_get_pixel_aspect_ratio |
||||
png_get_pixels_per_meter |
||||
png_get_progressive_ptr |
||||
png_get_rgb_to_gray_status |
||||
png_get_rowbytes |
||||
png_get_rows |
||||
png_get_sBIT |
||||
png_get_sCAL |
||||
png_get_sPLT |
||||
png_get_sRGB |
||||
png_get_signature |
||||
png_get_tIME |
||||
png_get_tRNS |
||||
png_get_text |
||||
png_get_unknown_chunks |
||||
png_get_user_chunk_ptr |
||||
png_get_user_transform_ptr |
||||
png_get_valid |
||||
png_get_x_offset_microns |
||||
png_get_x_offset_pixels |
||||
png_get_x_pixels_per_meter |
||||
png_get_y_offset_microns |
||||
png_get_y_offset_pixels |
||||
png_get_y_pixels_per_meter |
||||
png_malloc |
||||
png_memcpy_check |
||||
png_memset_check |
||||
png_permit_empty_plte |
||||
png_process_data |
||||
png_progressive_combine_row |
||||
png_read_end |
||||
png_read_image |
||||
png_read_info |
||||
png_read_init ; deprecated |
||||
png_read_png |
||||
png_read_row |
||||
png_read_rows |
||||
png_read_update_info |
||||
png_reset_zstream |
||||
png_set_IHDR |
||||
png_set_PLTE |
||||
png_set_bKGD |
||||
png_set_background |
||||
png_set_bgr |
||||
png_set_cHRM |
||||
png_set_cHRM_fixed |
||||
png_set_compression_buffer_size |
||||
png_set_compression_level |
||||
png_set_compression_mem_level |
||||
png_set_compression_method |
||||
png_set_compression_strategy |
||||
png_set_compression_window_bits |
||||
png_set_crc_action |
||||
png_set_dither |
||||
png_set_error_fn |
||||
png_set_expand |
||||
png_set_filler |
||||
png_set_filter |
||||
png_set_filter_heuristics |
||||
png_set_flush |
||||
png_set_gAMA |
||||
png_set_gAMA_fixed |
||||
png_set_gamma |
||||
png_set_gray_1_2_4_to_8 |
||||
png_set_gray_to_rgb |
||||
png_set_hIST |
||||
png_set_iCCP |
||||
png_set_interlace_handling |
||||
png_set_invert_alpha |
||||
png_set_invert_mono |
||||
png_set_keep_unknown_chunks |
||||
png_set_oFFs |
||||
png_set_pCAL |
||||
png_set_pHYs |
||||
png_set_packing |
||||
png_set_packswap |
||||
png_set_palette_to_rgb |
||||
png_set_progressive_read_fn |
||||
png_set_read_fn |
||||
png_set_read_status_fn |
||||
png_set_read_user_chunk_fn |
||||
png_set_read_user_transform_fn |
||||
png_set_rgb_to_gray |
||||
png_set_rgb_to_gray_fixed |
||||
png_set_rows |
||||
png_set_sBIT |
||||
png_set_sCAL |
||||
png_set_sPLT |
||||
png_set_sRGB |
||||
png_set_sRGB_gAMA_and_cHRM |
||||
png_set_shift |
||||
png_set_sig_bytes |
||||
png_set_strip_16 |
||||
png_set_strip_alpha |
||||
png_set_swap |
||||
png_set_swap_alpha |
||||
png_set_tIME |
||||
png_set_tRNS |
||||
png_set_tRNS_to_alpha |
||||
png_set_text |
||||
png_set_unknown_chunk_location |
||||
png_set_unknown_chunks |
||||
png_set_user_transform_info |
||||
png_set_write_fn |
||||
png_set_write_status_fn |
||||
png_set_write_user_transform_fn |
||||
png_sig_cmp |
||||
png_start_read_image |
||||
png_warning |
||||
png_write_chunk |
||||
png_write_chunk_data |
||||
png_write_chunk_end |
||||
png_write_chunk_start |
||||
png_write_end |
||||
png_write_flush |
||||
png_write_image |
||||
png_write_info |
||||
png_write_info_before_PLTE |
||||
png_write_init ; deprecated |
||||
png_write_png |
||||
png_write_row |
||||
png_write_rows |
||||
png_read_init_2 |
||||
png_write_init_2 |
||||
png_access_version_number |
||||
png_init_io |
||||
png_convert_to_rfc1123 |
||||
png_set_invalid |
||||
|
||||
;To be added at version 1.2.0 |
||||
; png_permit_mng_features |
||||
|
||||
; Added at version 1.2.0: |
||||
png_mmx_support |
||||
png_permit_empty_plte |
||||
png_permit_mng_features |
||||
png_get_mmx_flagmask |
||||
png_get_asm_flagmask |
||||
png_get_asm_flags |
||||
png_get_mmx_bitdepth_threshold |
||||
png_get_mmx_rowbytes_threshold |
||||
png_set_asm_flags |
||||
png_init_mmx_flags |
||||
|
||||
; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS |
||||
png_libpng_ver |
||||
png_pass_start |
||||
png_pass_inc |
||||
png_pass_ystart |
||||
png_pass_yinc |
||||
png_pass_mask |
||||
png_pass_dsp_mask |
||||
; png_pass_width |
||||
; png_pass_height |
||||
|
||||
; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS |
||||
png_IHDR |
||||
png_IDAT |
||||
png_IEND |
||||
png_PLTE |
||||
png_bKGD |
||||
png_cHRM |
||||
png_gAMA |
||||
png_hIST |
||||
png_iCCP |
||||
png_iTXt |
||||
png_oFFs |
||||
png_pCAL |
||||
png_pHYs |
||||
png_sBIT |
||||
png_sCAL |
||||
png_sPLT |
||||
png_sRGB |
||||
png_tEXt |
||||
png_tIME |
||||
png_tRNS |
||||
png_zTXt |
@ -1,30 +0,0 @@
|
||||
# Amiga powerUP (TM) Makefile |
||||
# makefile for libpng and SAS C V6.58/7.00 PPC compiler |
||||
# Copyright (C) 1998 by Andreas R. Kleinert |
||||
# For conditions of distribution and use, see copyright notice in png.h |
||||
|
||||
CC = scppc |
||||
CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \ |
||||
OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 |
||||
LIBNAME = libpng.a |
||||
AR = ppc-amigaos-ar |
||||
AR_FLAGS = cr |
||||
RANLIB = ppc-amigaos-ranlib |
||||
LDFLAGS = -r -o |
||||
LDLIBS = ../zlib/libzip.a LIB:scppc.a |
||||
LN = ppc-amigaos-ld |
||||
RM = delete quiet |
||||
MKDIR = makedir |
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o pngread.o \ |
||||
pngerror.o pngpread.o pngwrite.o pngrtran.o pngwtran.o pngrio.o pngwio.o pngmem.o |
||||
|
||||
all: $(LIBNAME) pngtest |
||||
|
||||
$(LIBNAME): $(OBJS) |
||||
$(AR) $(AR_FLAGS) $@ $(OBJS) |
||||
$(RANLIB) $@ |
||||
|
||||
pngtest: pngtest.o $(LIBNAME) |
||||
$(LN) $(LDFLAGS) pngtest LIB:c_ppc.o pngtest.o $(LIBNAME) $(LDLIBS) \ |
||||
LIB:end.o |
@ -1,481 +0,0 @@
|
||||
|
||||
ChangeLog file for zlib |
||||
|
||||
Changes in 1.1.4 (11 March 2002) |
||||
- ZFREE was repeated on same allocation on some error conditions. |
||||
This creates a security problem described in |
||||
http://www.zlib.org/advisory-2002-03-11.txt |
||||
- Returned incorrect error (Z_MEM_ERROR) on some invalid data |
||||
- Avoid accesses before window for invalid distances with inflate window |
||||
less than 32K. |
||||
- force windowBits > 8 to avoid a bug in the encoder for a window size |
||||
of 256 bytes. (A complete fix will be available in 1.1.5). |
||||
|
||||
Changes in 1.1.3 (9 July 1998) |
||||
- fix "an inflate input buffer bug that shows up on rare but persistent |
||||
occasions" (Mark) |
||||
- fix gzread and gztell for concatenated .gz files (Didier Le Botlan) |
||||
- fix gzseek(..., SEEK_SET) in write mode |
||||
- fix crc check after a gzeek (Frank Faubert) |
||||
- fix miniunzip when the last entry in a zip file is itself a zip file |
||||
(J Lillge) |
||||
- add contrib/asm586 and contrib/asm686 (Brian Raiter) |
||||
See http://www.muppetlabs.com/~breadbox/software/assembly.html |
||||
- add support for Delphi 3 in contrib/delphi (Bob Dellaca) |
||||
- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti) |
||||
- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren) |
||||
- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks) |
||||
- added a FAQ file |
||||
|
||||
- Support gzdopen on Mac with Metrowerks (Jason Linhart) |
||||
- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart) |
||||
- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young) |
||||
- avoid some warnings with Borland C (Tom Tanner) |
||||
- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant) |
||||
- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant) |
||||
- allow several arguments to configure (Tim Mooney, Frodo Looijaard) |
||||
- use libdir and includedir in Makefile.in (Tim Mooney) |
||||
- support shared libraries on OSF1 V4 (Tim Mooney) |
||||
- remove so_locations in "make clean" (Tim Mooney) |
||||
- fix maketree.c compilation error (Glenn, Mark) |
||||
- Python interface to zlib now in Python 1.5 (Jeremy Hylton) |
||||
- new Makefile.riscos (Rich Walker) |
||||
- initialize static descriptors in trees.c for embedded targets (Nick Smith) |
||||
- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) |
||||
- add the OS/2 files in Makefile.in too (Andrew Zabolotny) |
||||
- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) |
||||
- fix maketree.c to allow clean compilation of inffixed.h (Mark) |
||||
- fix parameter check in deflateCopy (Gunther Nikl) |
||||
- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) |
||||
- Many portability patches by Christian Spieler: |
||||
. zutil.c, zutil.h: added "const" for zmem* |
||||
. Make_vms.com: fixed some typos |
||||
. Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists |
||||
. msdos/Makefile.msc: remove "default rtl link library" info from obj files |
||||
. msdos/Makefile.*: use model-dependent name for the built zlib library |
||||
. msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc: |
||||
new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT) |
||||
- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane) |
||||
- replace __far with _far for better portability (Christian Spieler, Tom Lane) |
||||
- fix test for errno.h in configure (Tim Newsham) |
||||
|
||||
Changes in 1.1.2 (19 March 98) |
||||
- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) |
||||
See http://www.winimage.com/zLibDll/unzip.html |
||||
- preinitialize the inflate tables for fixed codes, to make the code |
||||
completely thread safe (Mark) |
||||
- some simplifications and slight speed-up to the inflate code (Mark) |
||||
- fix gzeof on non-compressed files (Allan Schrum) |
||||
- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) |
||||
- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) |
||||
- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) |
||||
- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) |
||||
- do not wrap extern "C" around system includes (Tom Lane) |
||||
- mention zlib binding for TCL in README (Andreas Kupries) |
||||
- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) |
||||
- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) |
||||
- allow "configure --prefix $HOME" (Tim Mooney) |
||||
- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) |
||||
- move Makefile.sas to amiga/Makefile.sas |
||||
|
||||
Changes in 1.1.1 (27 Feb 98) |
||||
- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson) |
||||
- remove block truncation heuristic which had very marginal effect for zlib |
||||
(smaller lit_bufsize than in gzip 1.2.4) and degraded a little the |
||||
compression ratio on some files. This also allows inlining _tr_tally for |
||||
matches in deflate_slow. |
||||
- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) |
||||
|
||||
Changes in 1.1.0 (24 Feb 98) |
||||
- do not return STREAM_END prematurely in inflate (John Bowler) |
||||
- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler) |
||||
- compile with -DFASTEST to get compression code optimized for speed only |
||||
- in minigzip, try mmap'ing the input file first (Miguel Albrecht) |
||||
- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain |
||||
on Sun but significant on HP) |
||||
|
||||
- add a pointer to experimental unzip library in README (Gilles Vollant) |
||||
- initialize variable gcc in configure (Chris Herborth) |
||||
|
||||
Changes in 1.0.9 (17 Feb 1998) |
||||
- added gzputs and gzgets functions |
||||
- do not clear eof flag in gzseek (Mark Diekhans) |
||||
- fix gzseek for files in transparent mode (Mark Diekhans) |
||||
- do not assume that vsprintf returns the number of bytes written (Jens Krinke) |
||||
- replace EXPORT with ZEXPORT to avoid conflict with other programs |
||||
- added compress2 in zconf.h, zlib.def, zlib.dnt |
||||
- new asm code from Gilles Vollant in contrib/asm386 |
||||
- simplify the inflate code (Mark): |
||||
. Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new() |
||||
. ZALLOC the length list in inflate_trees_fixed() instead of using stack |
||||
. ZALLOC the value area for huft_build() instead of using stack |
||||
. Simplify Z_FINISH check in inflate() |
||||
|
||||
- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 |
||||
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) |
||||
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with |
||||
the declaration of FAR (Gilles VOllant) |
||||
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) |
||||
- read_buf buf parameter of type Bytef* instead of charf* |
||||
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) |
||||
- do not redeclare unlink in minigzip.c for WIN32 (John Bowler) |
||||
- fix check for presence of directories in "make install" (Ian Willis) |
||||
|
||||
Changes in 1.0.8 (27 Jan 1998) |
||||
- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant) |
||||
- fix gzgetc and gzputc for big endian systems (Markus Oberhumer) |
||||
- added compress2() to allow setting the compression level |
||||
- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) |
||||
- use constant arrays for the static trees in trees.c instead of computing |
||||
them at run time (thanks to Ken Raeburn for this suggestion). To create |
||||
trees.h, compile with GEN_TREES_H and run "make test". |
||||
- check return code of example in "make test" and display result |
||||
- pass minigzip command line options to file_compress |
||||
- simplifying code of inflateSync to avoid gcc 2.8 bug |
||||
|
||||
- support CC="gcc -Wall" in configure -s (QingLong) |
||||
- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn) |
||||
- fix test for shared library support to avoid compiler warnings |
||||
- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant) |
||||
- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit) |
||||
- do not use fdopen for Metrowerks on Mac (Brad Pettit)) |
||||
- add checks for gzputc and gzputc in example.c |
||||
- avoid warnings in gzio.c and deflate.c (Andreas Kleinert) |
||||
- use const for the CRC table (Ken Raeburn) |
||||
- fixed "make uninstall" for shared libraries |
||||
- use Tracev instead of Trace in infblock.c |
||||
- in example.c use correct compressed length for test_sync |
||||
- suppress +vnocompatwarnings in configure for HPUX (not always supported) |
||||
|
||||
Changes in 1.0.7 (20 Jan 1998) |
||||
- fix gzseek which was broken in write mode |
||||
- return error for gzseek to negative absolute position |
||||
- fix configure for Linux (Chun-Chung Chen) |
||||
- increase stack space for MSC (Tim Wegner) |
||||
- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant) |
||||
- define EXPORTVA for gzprintf (Gilles Vollant) |
||||
- added man page zlib.3 (Rick Rodgers) |
||||
- for contrib/untgz, fix makedir() and improve Makefile |
||||
|
||||
- check gzseek in write mode in example.c |
||||
- allocate extra buffer for seeks only if gzseek is actually called |
||||
- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant) |
||||
- add inflateSyncPoint in zconf.h |
||||
- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def |
||||
|
||||
Changes in 1.0.6 (19 Jan 1998) |
||||
- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and |
||||
gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) |
||||
- Fix a deflate bug occuring only with compression level 0 (thanks to |
||||
Andy Buckler for finding this one). |
||||
- In minigzip, pass transparently also the first byte for .Z files. |
||||
- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() |
||||
- check Z_FINISH in inflate (thanks to Marc Schluper) |
||||
- Implement deflateCopy (thanks to Adam Costello) |
||||
- make static libraries by default in configure, add --shared option. |
||||
- move MSDOS or Windows specific files to directory msdos |
||||
- suppress the notion of partial flush to simplify the interface |
||||
(but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) |
||||
- suppress history buffer provided by application to simplify the interface |
||||
(this feature was not implemented anyway in 1.0.4) |
||||
- next_in and avail_in must be initialized before calling inflateInit or |
||||
inflateInit2 |
||||
- add EXPORT in all exported functions (for Windows DLL) |
||||
- added Makefile.nt (thanks to Stephen Williams) |
||||
- added the unsupported "contrib" directory: |
||||
contrib/asm386/ by Gilles Vollant <info@winimage.com> |
||||
386 asm code replacing longest_match(). |
||||
contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu> |
||||
A C++ I/O streams interface to the zlib gz* functions |
||||
contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no> |
||||
Another C++ I/O streams interface |
||||
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es> |
||||
A very simple tar.gz file extractor using zlib |
||||
contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl> |
||||
How to use compress(), uncompress() and the gz* functions from VB. |
||||
- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression |
||||
level) in minigzip (thanks to Tom Lane) |
||||
|
||||
- use const for rommable constants in deflate |
||||
- added test for gzseek and gztell in example.c |
||||
- add undocumented function inflateSyncPoint() (hack for Paul Mackerras) |
||||
- add undocumented function zError to convert error code to string |
||||
(for Tim Smithers) |
||||
- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. |
||||
- Use default memcpy for Symantec MSDOS compiler. |
||||
- Add EXPORT keyword for check_func (needed for Windows DLL) |
||||
- add current directory to LD_LIBRARY_PATH for "make test" |
||||
- create also a link for libz.so.1 |
||||
- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura) |
||||
- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX) |
||||
- added -soname for Linux in configure (Chun-Chung Chen, |
||||
- assign numbers to the exported functions in zlib.def (for Windows DLL) |
||||
- add advice in zlib.h for best usage of deflateSetDictionary |
||||
- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn) |
||||
- allow compilation with ANSI keywords only enabled for TurboC in large model |
||||
- avoid "versionString"[0] (Borland bug) |
||||
- add NEED_DUMMY_RETURN for Borland |
||||
- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). |
||||
- allow compilation with CC |
||||
- defined STDC for OS/2 (David Charlap) |
||||
- limit external names to 8 chars for MVS (Thomas Lund) |
||||
- in minigzip.c, use static buffers only for 16-bit systems |
||||
- fix suffix check for "minigzip -d foo.gz" |
||||
- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee) |
||||
- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) |
||||
- added makelcc.bat for lcc-win32 (Tom St Denis) |
||||
- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) |
||||
- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. |
||||
- check for unistd.h in configure (for off_t) |
||||
- remove useless check parameter in inflate_blocks_free |
||||
- avoid useless assignment of s->check to itself in inflate_blocks_new |
||||
- do not flush twice in gzclose (thanks to Ken Raeburn) |
||||
- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h |
||||
- use NO_ERRNO_H instead of enumeration of operating systems with errno.h |
||||
- work around buggy fclose on pipes for HP/UX |
||||
- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson) |
||||
- fix configure if CC is already equal to gcc |
||||
|
||||
Changes in 1.0.5 (3 Jan 98) |
||||
- Fix inflate to terminate gracefully when fed corrupted or invalid data |
||||
- Use const for rommable constants in inflate |
||||
- Eliminate memory leaks on error conditions in inflate |
||||
- Removed some vestigial code in inflate |
||||
- Update web address in README |
||||
|
||||
Changes in 1.0.4 (24 Jul 96) |
||||
- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF |
||||
bit, so the decompressor could decompress all the correct data but went |
||||
on to attempt decompressing extra garbage data. This affected minigzip too. |
||||
- zlibVersion and gzerror return const char* (needed for DLL) |
||||
- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) |
||||
- use z_error only for DEBUG (avoid problem with DLLs) |
||||
|
||||
Changes in 1.0.3 (2 Jul 96) |
||||
- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS |
||||
small and medium models; this makes the library incompatible with previous |
||||
versions for these models. (No effect in large model or on other systems.) |
||||
- return OK instead of BUF_ERROR if previous deflate call returned with |
||||
avail_out as zero but there is nothing to do |
||||
- added memcmp for non STDC compilers |
||||
- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) |
||||
- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) |
||||
- better check for 16-bit mode MSC (avoids problem with Symantec) |
||||
|
||||
Changes in 1.0.2 (23 May 96) |
||||
- added Windows DLL support |
||||
- added a function zlibVersion (for the DLL support) |
||||
- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model) |
||||
- Bytef is define's instead of typedef'd only for Borland C |
||||
- avoid reading uninitialized memory in example.c |
||||
- mention in README that the zlib format is now RFC1950 |
||||
- updated Makefile.dj2 |
||||
- added algorithm.doc |
||||
|
||||
Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] |
||||
- fix array overlay in deflate.c which sometimes caused bad compressed data |
||||
- fix inflate bug with empty stored block |
||||
- fix MSDOS medium model which was broken in 0.99 |
||||
- fix deflateParams() which could generated bad compressed data. |
||||
- Bytef is define'd instead of typedef'ed (work around Borland bug) |
||||
- added an INDEX file |
||||
- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), |
||||
Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) |
||||
- speed up adler32 for modern machines without auto-increment |
||||
- added -ansi for IRIX in configure |
||||
- static_init_done in trees.c is an int |
||||
- define unlink as delete for VMS |
||||
- fix configure for QNX |
||||
- add configure branch for SCO and HPUX |
||||
- avoid many warnings (unused variables, dead assignments, etc...) |
||||
- no fdopen for BeOS |
||||
- fix the Watcom fix for 32 bit mode (define FAR as empty) |
||||
- removed redefinition of Byte for MKWERKS |
||||
- work around an MWKERKS bug (incorrect merge of all .h files) |
||||
|
||||
Changes in 0.99 (27 Jan 96) |
||||
- allow preset dictionary shared between compressor and decompressor |
||||
- allow compression level 0 (no compression) |
||||
- add deflateParams in zlib.h: allow dynamic change of compression level |
||||
and compression strategy. |
||||
- test large buffers and deflateParams in example.c |
||||
- add optional "configure" to build zlib as a shared library |
||||
- suppress Makefile.qnx, use configure instead |
||||
- fixed deflate for 64-bit systems (detected on Cray) |
||||
- fixed inflate_blocks for 64-bit systems (detected on Alpha) |
||||
- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2) |
||||
- always return Z_BUF_ERROR when deflate() has nothing to do |
||||
- deflateInit and inflateInit are now macros to allow version checking |
||||
- prefix all global functions and types with z_ with -DZ_PREFIX |
||||
- make falloc completely reentrant (inftrees.c) |
||||
- fixed very unlikely race condition in ct_static_init |
||||
- free in reverse order of allocation to help memory manager |
||||
- use zlib-1.0/* instead of zlib/* inside the tar.gz |
||||
- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith |
||||
-Wconversion -Wstrict-prototypes -Wmissing-prototypes" |
||||
- allow gzread on concatenated .gz files |
||||
- deflateEnd now returns Z_DATA_ERROR if it was premature |
||||
- deflate is finally (?) fully deterministic (no matches beyond end of input) |
||||
- Document Z_SYNC_FLUSH |
||||
- add uninstall in Makefile |
||||
- Check for __cpluplus in zlib.h |
||||
- Better test in ct_align for partial flush |
||||
- avoid harmless warnings for Borland C++ |
||||
- initialize hash_head in deflate.c |
||||
- avoid warning on fdopen (gzio.c) for HP cc -Aa |
||||
- include stdlib.h for STDC compilers |
||||
- include errno.h for Cray |
||||
- ignore error if ranlib doesn't exist |
||||
- call ranlib twice for NeXTSTEP |
||||
- use exec_prefix instead of prefix for libz.a |
||||
- renamed ct_* as _tr_* to avoid conflict with applications |
||||
- clear z->msg in inflateInit2 before any error return |
||||
- initialize opaque in example.c, gzio.c, deflate.c and inflate.c |
||||
- fixed typo in zconf.h (_GNUC__ => __GNUC__) |
||||
- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode) |
||||
- fix typo in Make_vms.com (f$trnlnm -> f$getsyi) |
||||
- in fcalloc, normalize pointer if size > 65520 bytes |
||||
- don't use special fcalloc for 32 bit Borland C++ |
||||
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... |
||||
- use Z_BINARY instead of BINARY |
||||
- document that gzclose after gzdopen will close the file |
||||
- allow "a" as mode in gzopen. |
||||
- fix error checking in gzread |
||||
- allow skipping .gz extra-field on pipes |
||||
- added reference to Perl interface in README |
||||
- put the crc table in FAR data (I dislike more and more the medium model :) |
||||
- added get_crc_table |
||||
- added a dimension to all arrays (Borland C can't count). |
||||
- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast |
||||
- guard against multiple inclusion of *.h (for precompiled header on Mac) |
||||
- Watcom C pretends to be Microsoft C small model even in 32 bit mode. |
||||
- don't use unsized arrays to avoid silly warnings by Visual C++: |
||||
warning C4746: 'inflate_mask' : unsized array treated as '__far' |
||||
(what's wrong with far data in far model?). |
||||
- define enum out of inflate_blocks_state to allow compilation with C++ |
||||
|
||||
Changes in 0.95 (16 Aug 95) |
||||
- fix MSDOS small and medium model (now easier to adapt to any compiler) |
||||
- inlined send_bits |
||||
- fix the final (:-) bug for deflate with flush (output was correct but |
||||
not completely flushed in rare occasions). |
||||
- default window size is same for compression and decompression |
||||
(it's now sufficient to set MAX_WBITS in zconf.h). |
||||
- voidp -> voidpf and voidnp -> voidp (for consistency with other |
||||
typedefs and because voidnp was not near in large model). |
||||
|
||||
Changes in 0.94 (13 Aug 95) |
||||
- support MSDOS medium model |
||||
- fix deflate with flush (could sometimes generate bad output) |
||||
- fix deflateReset (zlib header was incorrectly suppressed) |
||||
- added support for VMS |
||||
- allow a compression level in gzopen() |
||||
- gzflush now calls fflush |
||||
- For deflate with flush, flush even if no more input is provided. |
||||
- rename libgz.a as libz.a |
||||
- avoid complex expression in infcodes.c triggering Turbo C bug |
||||
- work around a problem with gcc on Alpha (in INSERT_STRING) |
||||
- don't use inline functions (problem with some gcc versions) |
||||
- allow renaming of Byte, uInt, etc... with #define. |
||||
- avoid warning about (unused) pointer before start of array in deflate.c |
||||
- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c |
||||
- avoid reserved word 'new' in trees.c |
||||
|
||||
Changes in 0.93 (25 June 95) |
||||
- temporarily disable inline functions |
||||
- make deflate deterministic |
||||
- give enough lookahead for PARTIAL_FLUSH |
||||
- Set binary mode for stdin/stdout in minigzip.c for OS/2 |
||||
- don't even use signed char in inflate (not portable enough) |
||||
- fix inflate memory leak for segmented architectures |
||||
|
||||
Changes in 0.92 (3 May 95) |
||||
- don't assume that char is signed (problem on SGI) |
||||
- Clear bit buffer when starting a stored block |
||||
- no memcpy on Pyramid |
||||
- suppressed inftest.c |
||||
- optimized fill_window, put longest_match inline for gcc |
||||
- optimized inflate on stored blocks. |
||||
- untabify all sources to simplify patches |
||||
|
||||
Changes in 0.91 (2 May 95) |
||||
- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h |
||||
- Document the memory requirements in zconf.h |
||||
- added "make install" |
||||
- fix sync search logic in inflateSync |
||||
- deflate(Z_FULL_FLUSH) now works even if output buffer too short |
||||
- after inflateSync, don't scare people with just "lo world" |
||||
- added support for DJGPP |
||||
|
||||
Changes in 0.9 (1 May 95) |
||||
- don't assume that zalloc clears the allocated memory (the TurboC bug |
||||
was Mark's bug after all :) |
||||
- let again gzread copy uncompressed data unchanged (was working in 0.71) |
||||
- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented |
||||
- added a test of inflateSync in example.c |
||||
- moved MAX_WBITS to zconf.h because users might want to change that. |
||||
- document explicitly that zalloc(64K) on MSDOS must return a normalized |
||||
pointer (zero offset) |
||||
- added Makefiles for Microsoft C, Turbo C, Borland C++ |
||||
- faster crc32() |
||||
|
||||
Changes in 0.8 (29 April 95) |
||||
- added fast inflate (inffast.c) |
||||
- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this |
||||
is incompatible with previous versions of zlib which returned Z_OK. |
||||
- work around a TurboC compiler bug (bad code for b << 0, see infutil.h) |
||||
(actually that was not a compiler bug, see 0.81 above) |
||||
- gzread no longer reads one extra byte in certain cases |
||||
- In gzio destroy(), don't reference a freed structure |
||||
- avoid many warnings for MSDOS |
||||
- avoid the ERROR symbol which is used by MS Windows |
||||
|
||||
Changes in 0.71 (14 April 95) |
||||
- Fixed more MSDOS compilation problems :( There is still a bug with |
||||
TurboC large model. |
||||
|
||||
Changes in 0.7 (14 April 95) |
||||
- Added full inflate support. |
||||
- Simplified the crc32() interface. The pre- and post-conditioning |
||||
(one's complement) is now done inside crc32(). WARNING: this is |
||||
incompatible with previous versions; see zlib.h for the new usage. |
||||
|
||||
Changes in 0.61 (12 April 95) |
||||
- workaround for a bug in TurboC. example and minigzip now work on MSDOS. |
||||
|
||||
Changes in 0.6 (11 April 95) |
||||
- added minigzip.c |
||||
- added gzdopen to reopen a file descriptor as gzFile |
||||
- added transparent reading of non-gziped files in gzread. |
||||
- fixed bug in gzread (don't read crc as data) |
||||
- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). |
||||
- don't allocate big arrays in the stack (for MSDOS) |
||||
- fix some MSDOS compilation problems |
||||
|
||||
Changes in 0.5: |
||||
- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but |
||||
not yet Z_FULL_FLUSH. |
||||
- support decompression but only in a single step (forced Z_FINISH) |
||||
- added opaque object for zalloc and zfree. |
||||
- added deflateReset and inflateReset |
||||
- added a variable zlib_version for consistency checking. |
||||
- renamed the 'filter' parameter of deflateInit2 as 'strategy'. |
||||
Added Z_FILTERED and Z_HUFFMAN_ONLY constants. |
||||
|
||||
Changes in 0.4: |
||||
- avoid "zip" everywhere, use zlib instead of ziplib. |
||||
- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush |
||||
if compression method == 8. |
||||
- added adler32 and crc32 |
||||
- renamed deflateOptions as deflateInit2, call one or the other but not both |
||||
- added the method parameter for deflateInit2. |
||||
- added inflateInit2 |
||||
- simplied considerably deflateInit and inflateInit by not supporting |
||||
user-provided history buffer. This is supported only in deflateInit2 |
||||
and inflateInit2. |
||||
|
||||
Changes in 0.3: |
||||
- prefix all macro names with Z_ |
||||
- use Z_FINISH instead of deflateEnd to finish compression. |
||||
- added Z_HUFFMAN_ONLY |
||||
- added gzerror() |
@ -1,100 +0,0 @@
|
||||
|
||||
Frequently Asked Questions about zlib |
||||
|
||||
|
||||
If your question is not there, please check the zlib home page |
||||
http://www.zlib.org which may have more recent information. |
||||
The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html |
||||
|
||||
|
||||
1. Is zlib Y2K-compliant? |
||||
|
||||
Yes. zlib doesn't handle dates. |
||||
|
||||
2. Where can I get a Windows DLL version? |
||||
|
||||
The zlib sources can be compiled without change to produce a DLL. If you |
||||
want a precompiled DLL, see http://www.winimage.com/zLibDll/ . Questions |
||||
about the zlib DLL should be sent to Gilles Vollant (info@winimage.com). |
||||
|
||||
3. Where can I get a Visual Basic interface to zlib? |
||||
|
||||
See |
||||
* http://www.winimage.com/zLibDll/cmp-z-it.zip |
||||
* http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm |
||||
* contrib/visual-basic.txt in the zlib distribution |
||||
|
||||
4. compress() returns Z_BUF_ERROR |
||||
|
||||
Make sure that before the call of compress, the length of the compressed |
||||
buffer is equal to the total size of the compressed buffer and not |
||||
zero. For Visual Basic, check that this parameter is passed by reference |
||||
("as any"), not by value ("as long"). |
||||
|
||||
5. deflate() or inflate() returns Z_BUF_ERROR |
||||
|
||||
Before making the call, make sure that avail_in and avail_out are not |
||||
zero. When setting the parameter flush equal to Z_FINISH, also make sure |
||||
that avail_out is big enough to allow processing all pending input. |
||||
|
||||
6. Where's the zlib documentation (man pages, etc.)? |
||||
|
||||
It's in zlib.h for the moment, and Francis S. Lin has converted it to a |
||||
web page zlib.html. Volunteers to transform this to Unix-style man pages, |
||||
please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage |
||||
are in the files example.c and minigzip.c. |
||||
|
||||
7. Why don't you use GNU autoconf or libtool or ...? |
||||
|
||||
Because we would like to keep zlib as a very small and simple |
||||
package. zlib is rather portable and doesn't need much configuration. |
||||
|
||||
8. I found a bug in zlib. |
||||
|
||||
Most of the time, such problems are due to an incorrect usage of |
||||
zlib. Please try to reproduce the problem with a small program and send |
||||
the corresponding source to us at zlib@gzip.org . Do not send |
||||
multi-megabyte data files without prior agreement. |
||||
|
||||
9. Why do I get "undefined reference to gzputc"? |
||||
|
||||
If "make test" produces something like |
||||
|
||||
example.o(.text+0x154): undefined reference to `gzputc' |
||||
|
||||
check that you don't have old files libz.* in /usr/lib, /usr/local/lib or |
||||
/usr/X11R6/lib. Remove any old versions, then do "make install". |
||||
|
||||
10. I need a Delphi interface to zlib. |
||||
|
||||
See the directories contrib/delphi and contrib/delphi2 in the zlib |
||||
distribution. |
||||
|
||||
11. Can zlib handle .zip archives? |
||||
|
||||
See the directory contrib/minizip in the zlib distribution. |
||||
|
||||
12. Can zlib handle .Z files? |
||||
|
||||
No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt |
||||
the code of uncompress on your own. |
||||
|
||||
13. How can I make a Unix shared library? |
||||
|
||||
make clean |
||||
./configure -s |
||||
make |
||||
|
||||
14. Why does "make test" fail on Mac OS X? |
||||
|
||||
Mac OS X already includes zlib as a shared library, and so -lz links the |
||||
shared library instead of the one that the "make" compiled. For zlib |
||||
1.1.3, the two are incompatible due to different compile-time |
||||
options. Simply change the -lz in the Makefile to libz.a, and it will use |
||||
the compiled library instead of the shared one and the "make test" will |
||||
succeed. |
||||
|
||||
15. I have a question about OttoPDF |
||||
|
||||
We are not the authors of OttoPDF. The real author is on the OttoPDF web |
||||
site Joel Hainley jhainley@myndkryme.com. |
@ -1,86 +0,0 @@
|
||||
ChangeLog history of changes |
||||
INDEX this file |
||||
FAQ Frequently Asked Questions about zlib |
||||
Make_vms.com script for Vax/VMS |
||||
Makefile makefile for Unix (generated by configure) |
||||
Makefile.in makefile for Unix (template for configure) |
||||
Makefile.riscos makefile for RISCOS |
||||
README guess what |
||||
algorithm.txt description of the (de)compression algorithm |
||||
configure configure script for Unix |
||||
descrip.mms makefile for Vax/VMS |
||||
zlib.3 mini man page for zlib (volunteers to write full |
||||
man pages from zlib.h welcome. write to jloup@gzip.org) |
||||
|
||||
amiga/Makefile.sas makefile for Amiga SAS/C |
||||
amiga/Makefile.pup makefile for Amiga powerUP SAS/C PPC |
||||
|
||||
msdos/Makefile.w32 makefile for Microsoft Visual C++ 32-bit |
||||
msdos/Makefile.b32 makefile for Borland C++ 32-bit |
||||
msdos/Makefile.bor makefile for Borland C/C++ 16-bit |
||||
msdos/Makefile.dj2 makefile for DJGPP 2.x |
||||
msdos/Makefile.emx makefile for EMX 0.9c (32-bit DOS/OS2) |
||||
msdos/Makefile.msc makefile for Microsoft C 16-bit |
||||
msdos/Makefile.tc makefile for Turbo C |
||||
msdos/Makefile.wat makefile for Watcom C |
||||
msdos/zlib.def definition file for Windows DLL |
||||
msdos/zlib.rc definition file for Windows DLL |
||||
|
||||
nt/Makefile.nt makefile for Windows NT |
||||
nt/zlib.dnt definition file for Windows NT DLL |
||||
nt/Makefile.emx makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel) |
||||
nt/Makefile.gcc makefile for Windows NT using GCC (mingw32) |
||||
|
||||
|
||||
zlib public header files (must be kept): |
||||
zconf.h |
||||
zlib.h |
||||
|
||||
private source files used to build the zlib library: |
||||
adler32.c |
||||
compress.c |
||||
crc32.c |
||||
deflate.c |
||||
deflate.h |
||||
gzio.c |
||||
infblock.c |
||||
infblock.h |
||||
infcodes.c |
||||
infcodes.h |
||||
inffast.c |
||||
inffast.h |
||||
inflate.c |
||||
inftrees.c |
||||
inftrees.h |
||||
infutil.c |
||||
infutil.h |
||||
maketree.c |
||||
trees.c |
||||
uncompr.c |
||||
zutil.c |
||||
zutil.h |
||||
|
||||
source files for sample programs: |
||||
example.c |
||||
minigzip.c |
||||
|
||||
unsupported contribution by third parties |
||||
|
||||
contrib/asm386/ by Gilles Vollant <info@winimage.com> |
||||
386 asm code replacing longest_match(). |
||||
|
||||
contrib/minizip/ by Gilles Vollant <info@winimage.com> |
||||
Mini zip and unzip based on zlib |
||||
See http://www.winimage.com/zLibDll/unzip.html |
||||
|
||||
contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu> |
||||
A C++ I/O streams interface to the zlib gz* functions |
||||
|
||||
contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no> |
||||
Another C++ I/O streams interface |
||||
|
||||
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es> |
||||
A very simple tar.gz extractor using zlib |
||||
|
||||
contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl> |
||||
How to use compress(), uncompress() and the gz* functions from VB. |
@ -1,115 +0,0 @@
|
||||
$! make libz under VMS |
||||
$! written by Martin P.J. Zinser <m.zinser@gsi.de> |
||||
$! |
||||
$! Look for the compiler used |
||||
$! |
||||
$ ccopt = "" |
||||
$ if f$getsyi("HW_MODEL").ge.1024 |
||||
$ then |
||||
$ ccopt = "/prefix=all"+ccopt |
||||
$ comp = "__decc__=1" |
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library: |
||||
$ else |
||||
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" |
||||
$ then |
||||
$ comp = "__vaxc__=1" |
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library: |
||||
$ else |
||||
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include: |
||||
$ ccopt = "/decc/prefix=all"+ccopt |
||||
$ comp = "__decc__=1" |
||||
$ endif |
||||
$ endif |
||||
$! |
||||
$! Build the thing plain or with mms |
||||
$! |
||||
$ write sys$output "Compiling Zlib sources ..." |
||||
$ if f$search("SYS$SYSTEM:MMS.EXE").eqs."" |
||||
$ then |
||||
$ dele example.obj;*,minigzip.obj;* |
||||
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - |
||||
adler32.c zlib.h zconf.h |
||||
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - |
||||
compress.c zlib.h zconf.h |
||||
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - |
||||
crc32.c zlib.h zconf.h |
||||
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - |
||||
deflate.c deflate.h zutil.h zlib.h zconf.h |
||||
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - |
||||
gzio.c zutil.h zlib.h zconf.h |
||||
$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" - |
||||
infblock.c zutil.h zlib.h zconf.h infblock.h |
||||
$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" - |
||||
infcodes.c zutil.h zlib.h zconf.h inftrees.h |
||||
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - |
||||
inffast.c zutil.h zlib.h zconf.h inffast.h |
||||
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - |
||||
inflate.c zutil.h zlib.h zconf.h infblock.h |
||||
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - |
||||
inftrees.c zutil.h zlib.h zconf.h inftrees.h |
||||
$ CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" - |
||||
infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h |
||||
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - |
||||
trees.c deflate.h zutil.h zlib.h zconf.h |
||||
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - |
||||
uncompr.c zlib.h zconf.h |
||||
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - |
||||
zutil.c zutil.h zlib.h zconf.h |
||||
$ write sys$output "Building Zlib ..." |
||||
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ |
||||
$ write sys$output "Building example..." |
||||
$ CALL MAKE example.OBJ "CC ''CCOPT' example" - |
||||
example.c zlib.h zconf.h |
||||
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb |
||||
$ write sys$output "Building minigzip..." |
||||
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" - |
||||
minigzip.c zlib.h zconf.h |
||||
$ call make minigzip.exe - |
||||
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - |
||||
minigzip.obj libz.olb |
||||
$ else |
||||
$ mms/macro=('comp') |
||||
$ endif |
||||
$ write sys$output "Zlib build completed" |
||||
$ exit |
||||
$! |
||||
$! |
||||
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES |
||||
$ V = 'F$Verify(0) |
||||
$! P1 = What we are trying to make |
||||
$! P2 = Command to make it |
||||
$! P3 - P8 What it depends on |
||||
$ |
||||
$ If F$Search(P1) .Eqs. "" Then Goto Makeit |
||||
$ Time = F$CvTime(F$File(P1,"RDT")) |
||||
$arg=3 |
||||
$Loop: |
||||
$ Argument = P'arg |
||||
$ If Argument .Eqs. "" Then Goto Exit |
||||
$ El=0 |
||||
$Loop2: |
||||
$ File = F$Element(El," ",Argument) |
||||
$ If File .Eqs. " " Then Goto Endl |
||||
$ AFile = "" |
||||
$Loop3: |
||||
$ OFile = AFile |
||||
$ AFile = F$Search(File) |
||||
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl |
||||
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit |
||||
$ Goto Loop3 |
||||
$NextEL: |
||||
$ El = El + 1 |
||||
$ Goto Loop2 |
||||
$EndL: |
||||
$ arg=arg+1 |
||||
$ If arg .Le. 8 Then Goto Loop |
||||
$ Goto Exit |
||||
$ |
||||
$Makeit: |
||||
$ VV=F$VERIFY(0) |
||||
$ write sys$output P2 |
||||
$ 'P2 |
||||
$ VV='F$Verify(VV) |
||||
$Exit: |
||||
$ If V Then Set Verify |
||||
$ENDSUBROUTINE |
@ -1,175 +0,0 @@
|
||||
# Makefile for zlib
|
||||
# Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
# For conditions of distribution and use, see copyright notice in zlib.h
|
||||
|
||||
# To compile and test, type:
|
||||
# ./configure; make test
|
||||
# The call of configure is optional if you don't have special requirements
|
||||
# If you wish to build zlib as a shared library, use: ./configure -s
|
||||
|
||||
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
|
||||
# make install
|
||||
# To install in $HOME instead of /usr/local, use:
|
||||
# make install prefix=$HOME
|
||||
|
||||
CC=cc
|
||||
|
||||
CFLAGS=-O
|
||||
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
|
||||
#CFLAGS=-g -DDEBUG
|
||||
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
|
||||
# -Wstrict-prototypes -Wmissing-prototypes
|
||||
|
||||
LDFLAGS=-L. -lz
|
||||
LDSHARED=$(CC)
|
||||
CPP=$(CC) -E
|
||||
|
||||
VER=1.1.4
|
||||
LIBS=libz.a
|
||||
SHAREDLIB=libz.so
|
||||
|
||||
AR=ar rc
|
||||
RANLIB=ranlib
|
||||
TAR=tar
|
||||
SHELL=/bin/sh
|
||||
|
||||
prefix = /usr/local
|
||||
exec_prefix = ${prefix}
|
||||
libdir = ${exec_prefix}/lib
|
||||
includedir = ${prefix}/include
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
||||
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
||||
|
||||
OBJA =
|
||||
# to use the asm code: make OBJA=match.o
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
|
||||
algorithm.txt zlib.3 zlib.html \
|
||||
msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
|
||||
nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
|
||||
contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
|
||||
contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
|
||||
contrib/asm[56]86/*.S contrib/iostream/*.cpp \
|
||||
contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
|
||||
contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
|
||||
contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
|
||||
contrib/delphi*/*.???
|
||||
|
||||
all: example minigzip |
||||
|
||||
test: all |
||||
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
|
||||
echo hello world | ./minigzip | ./minigzip -d || \
|
||||
echo ' *** minigzip test FAILED ***' ; \
|
||||
if ./example; then \
|
||||
echo ' *** zlib test OK ***'; \
|
||||
else \
|
||||
echo ' *** zlib test FAILED ***'; \
|
||||
fi
|
||||
|
||||
libz.a: $(OBJS) $(OBJA) |
||||
$(AR) $@ $(OBJS) $(OBJA)
|
||||
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
|
||||
|
||||
match.o: match.S |
||||
$(CPP) match.S > _match.s
|
||||
$(CC) -c _match.s
|
||||
mv _match.o match.o
|
||||
rm -f _match.s
|
||||
|
||||
$(SHAREDLIB).$(VER): $(OBJS) |
||||
$(LDSHARED) -o $@ $(OBJS)
|
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).1
|
||||
ln -s $@ $(SHAREDLIB)
|
||||
ln -s $@ $(SHAREDLIB).1
|
||||
|
||||
example: example.o $(LIBS) |
||||
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
|
||||
|
||||
minigzip: minigzip.o $(LIBS) |
||||
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
|
||||
|
||||
install: $(LIBS) |
||||
-@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
|
||||
-@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
|
||||
cp zlib.h zconf.h $(includedir)
|
||||
chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
|
||||
cp $(LIBS) $(libdir)
|
||||
cd $(libdir); chmod 755 $(LIBS)
|
||||
-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
|
||||
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
|
||||
# The ranlib in install is needed on NeXTSTEP which checks file times
|
||||
# ldconfig is for Linux
|
||||
|
||||
uninstall: |
||||
cd $(includedir); \
|
||||
v=$(VER); \
|
||||
if test -f zlib.h; then \
|
||||
v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
|
||||
rm -f zlib.h zconf.h; \
|
||||
fi; \
|
||||
cd $(libdir); rm -f libz.a; \
|
||||
if test -f $(SHAREDLIB).$$v; then \
|
||||
rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
|
||||
fi
|
||||
|
||||
clean: |
||||
rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
|
||||
_match.s maketree
|
||||
|
||||
distclean: clean |
||||
|
||||
zip: |
||||
mv Makefile Makefile~; cp -p Makefile.in Makefile
|
||||
rm -f test.c ztest*.c contrib/minizip/test.zip
|
||||
v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
|
||||
zip -ul9 zlib$$v $(DISTFILES)
|
||||
mv Makefile~ Makefile
|
||||
|
||||
dist: |
||||
mv Makefile Makefile~; cp -p Makefile.in Makefile
|
||||
rm -f test.c ztest*.c contrib/minizip/test.zip
|
||||
d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
|
||||
rm -f $$d.tar.gz; \
|
||||
if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
|
||||
files=""; \
|
||||
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
|
||||
cd ..; \
|
||||
GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
|
||||
if test ! -d $$d; then rm -f $$d; fi
|
||||
mv Makefile~ Makefile
|
||||
|
||||
tags: |
||||
etags *.[ch]
|
||||
|
||||
depend: |
||||
makedepend -- $(CFLAGS) -- *.[ch]
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
adler32.o: zlib.h zconf.h |
||||
compress.o: zlib.h zconf.h |
||||
crc32.o: zlib.h zconf.h |
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h |
||||
example.o: zlib.h zconf.h |
||||
gzio.o: zutil.h zlib.h zconf.h |
||||
infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h |
||||
infcodes.o: zutil.h zlib.h zconf.h |
||||
infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h |
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h |
||||
inffast.o: infblock.h infcodes.h infutil.h inffast.h |
||||
inflate.o: zutil.h zlib.h zconf.h infblock.h |
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
||||
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h |
||||
minigzip.o: zlib.h zconf.h |
||||
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h |
||||
uncompr.o: zlib.h zconf.h |
||||
zutil.o: zutil.h zlib.h zconf.h |
@ -1,175 +0,0 @@
|
||||
# Makefile for zlib
|
||||
# Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
# For conditions of distribution and use, see copyright notice in zlib.h
|
||||
|
||||
# To compile and test, type:
|
||||
# ./configure; make test
|
||||
# The call of configure is optional if you don't have special requirements
|
||||
# If you wish to build zlib as a shared library, use: ./configure -s
|
||||
|
||||
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
|
||||
# make install
|
||||
# To install in $HOME instead of /usr/local, use:
|
||||
# make install prefix=$HOME
|
||||
|
||||
CC=cc
|
||||
|
||||
CFLAGS=-O
|
||||
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
|
||||
#CFLAGS=-g -DDEBUG
|
||||
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
|
||||
# -Wstrict-prototypes -Wmissing-prototypes
|
||||
|
||||
LDFLAGS=-L. -lz
|
||||
LDSHARED=$(CC)
|
||||
CPP=$(CC) -E
|
||||
|
||||
VER=1.1.4
|
||||
LIBS=libz.a
|
||||
SHAREDLIB=libz.so
|
||||
|
||||
AR=ar rc
|
||||
RANLIB=ranlib
|
||||
TAR=tar
|
||||
SHELL=/bin/sh
|
||||
|
||||
prefix = /usr/local
|
||||
exec_prefix = ${prefix}
|
||||
libdir = ${exec_prefix}/lib
|
||||
includedir = ${prefix}/include
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
||||
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
||||
|
||||
OBJA =
|
||||
# to use the asm code: make OBJA=match.o
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
|
||||
algorithm.txt zlib.3 zlib.html \
|
||||
msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
|
||||
nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
|
||||
contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
|
||||
contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
|
||||
contrib/asm[56]86/*.S contrib/iostream/*.cpp \
|
||||
contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
|
||||
contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
|
||||
contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
|
||||
contrib/delphi*/*.???
|
||||
|
||||
all: example minigzip |
||||
|
||||
test: all |
||||
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
|
||||
echo hello world | ./minigzip | ./minigzip -d || \
|
||||
echo ' *** minigzip test FAILED ***' ; \
|
||||
if ./example; then \
|
||||
echo ' *** zlib test OK ***'; \
|
||||
else \
|
||||
echo ' *** zlib test FAILED ***'; \
|
||||
fi
|
||||
|
||||
libz.a: $(OBJS) $(OBJA) |
||||
$(AR) $@ $(OBJS) $(OBJA)
|
||||
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
|
||||
|
||||
match.o: match.S |
||||
$(CPP) match.S > _match.s
|
||||
$(CC) -c _match.s
|
||||
mv _match.o match.o
|
||||
rm -f _match.s
|
||||
|
||||
$(SHAREDLIB).$(VER): $(OBJS) |
||||
$(LDSHARED) -o $@ $(OBJS)
|
||||
rm -f $(SHAREDLIB) $(SHAREDLIB).1
|
||||
ln -s $@ $(SHAREDLIB)
|
||||
ln -s $@ $(SHAREDLIB).1
|
||||
|
||||
example: example.o $(LIBS) |
||||
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
|
||||
|
||||
minigzip: minigzip.o $(LIBS) |
||||
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
|
||||
|
||||
install: $(LIBS) |
||||
-@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
|
||||
-@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
|
||||
cp zlib.h zconf.h $(includedir)
|
||||
chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
|
||||
cp $(LIBS) $(libdir)
|
||||
cd $(libdir); chmod 755 $(LIBS)
|
||||
-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
|
||||
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
|
||||
# The ranlib in install is needed on NeXTSTEP which checks file times
|
||||
# ldconfig is for Linux
|
||||
|
||||
uninstall: |
||||
cd $(includedir); \
|
||||
v=$(VER); \
|
||||
if test -f zlib.h; then \
|
||||
v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
|
||||
rm -f zlib.h zconf.h; \
|
||||
fi; \
|
||||
cd $(libdir); rm -f libz.a; \
|
||||
if test -f $(SHAREDLIB).$$v; then \
|
||||
rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
|
||||
fi
|
||||
|
||||
clean: |
||||
rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
|
||||
_match.s maketree
|
||||
|
||||
distclean: clean |
||||
|
||||
zip: |
||||
mv Makefile Makefile~; cp -p Makefile.in Makefile
|
||||
rm -f test.c ztest*.c contrib/minizip/test.zip
|
||||
v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
|
||||
zip -ul9 zlib$$v $(DISTFILES)
|
||||
mv Makefile~ Makefile
|
||||
|
||||
dist: |
||||
mv Makefile Makefile~; cp -p Makefile.in Makefile
|
||||
rm -f test.c ztest*.c contrib/minizip/test.zip
|
||||
d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
|
||||
rm -f $$d.tar.gz; \
|
||||
if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
|
||||
files=""; \
|
||||
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
|
||||
cd ..; \
|
||||
GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
|
||||
if test ! -d $$d; then rm -f $$d; fi
|
||||
mv Makefile~ Makefile
|
||||
|
||||
tags: |
||||
etags *.[ch]
|
||||
|
||||
depend: |
||||
makedepend -- $(CFLAGS) -- *.[ch]
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
adler32.o: zlib.h zconf.h |
||||
compress.o: zlib.h zconf.h |
||||
crc32.o: zlib.h zconf.h |
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h |
||||
example.o: zlib.h zconf.h |
||||
gzio.o: zutil.h zlib.h zconf.h |
||||
infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h |
||||
infcodes.o: zutil.h zlib.h zconf.h |
||||
infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h |
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h |
||||
inffast.o: infblock.h infcodes.h infutil.h inffast.h |
||||
inflate.o: zutil.h zlib.h zconf.h infblock.h |
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
||||
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h |
||||
minigzip.o: zlib.h zconf.h |
||||
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h |
||||
uncompr.o: zlib.h zconf.h |
||||
zutil.o: zutil.h zlib.h zconf.h |
@ -1,151 +0,0 @@
|
||||
# Project: zlib_1_03
|
||||
# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
|
||||
# test works out-of-the-box, installs `somewhere' on demand
|
||||
|
||||
# Toolflags:
|
||||
CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
|
||||
C++flags = -c -depend !Depend -IC: -throwback |
||||
Linkflags = -aif -c++ -o $@
|
||||
ObjAsmflags = -throwback -NoCache -depend !Depend
|
||||
CMHGflags =
|
||||
LibFileflags = -c -l -o $@
|
||||
Squeezeflags = -o $@
|
||||
|
||||
# change the line below to where _you_ want the library installed.
|
||||
libdest = lib:zlib
|
||||
|
||||
# Final targets:
|
||||
@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
|
||||
@.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
|
||||
@.o.uncompr @.o.zutil
|
||||
LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
|
||||
@.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
|
||||
@.o.trees @.o.uncompr @.o.zutil
|
||||
test: @.minigzip @.example @.lib |
||||
@copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
|
||||
@echo running tests: hang on.
|
||||
@/@.minigzip -f -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -f -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -h -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -h -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@diff @.lib @.libc
|
||||
@echo that should have reported '@.lib and @.libc identical' if you have diff.
|
||||
@/@.example @.fred @.fred
|
||||
@echo that will have given lots of hello!'s.
|
||||
|
||||
@.minigzip: @.o.minigzip @.lib C:o.Stubs |
||||
Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
|
||||
@.example: @.o.example @.lib C:o.Stubs |
||||
Link $(Linkflags) @.o.example @.lib C:o.Stubs
|
||||
|
||||
install: @.lib |
||||
cdir $(libdest)
|
||||
cdir $(libdest).h
|
||||
@copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
|
||||
@copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
|
||||
@copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
|
||||
@echo okay, installed zlib in $(libdest)
|
||||
|
||||
clean:; remove @.minigzip |
||||
remove @.example
|
||||
remove @.libc
|
||||
-wipe @.o.* F~r~cV
|
||||
remove @.fred
|
||||
|
||||
# User-editable dependencies:
|
||||
.c.o: |
||||
cc $(ccflags) -o $@ $<
|
||||
|
||||
# Static dependencies:
|
||||
|
||||
# Dynamic dependencies:
|
||||
o.example: c.example |
||||
o.example: h.zlib |
||||
o.example: h.zconf |
||||
o.minigzip: c.minigzip |
||||
o.minigzip: h.zlib |
||||
o.minigzip: h.zconf |
||||
o.adler32: c.adler32 |
||||
o.adler32: h.zlib |
||||
o.adler32: h.zconf |
||||
o.compress: c.compress |
||||
o.compress: h.zlib |
||||
o.compress: h.zconf |
||||
o.crc32: c.crc32 |
||||
o.crc32: h.zlib |
||||
o.crc32: h.zconf |
||||
o.deflate: c.deflate |
||||
o.deflate: h.deflate |
||||
o.deflate: h.zutil |
||||
o.deflate: h.zlib |
||||
o.deflate: h.zconf |
||||
o.gzio: c.gzio |
||||
o.gzio: h.zutil |
||||
o.gzio: h.zlib |
||||
o.gzio: h.zconf |
||||
o.infblock: c.infblock |
||||
o.infblock: h.zutil |
||||
o.infblock: h.zlib |
||||
o.infblock: h.zconf |
||||
o.infblock: h.infblock |
||||
o.infblock: h.inftrees |
||||
o.infblock: h.infcodes |
||||
o.infblock: h.infutil |
||||
o.infcodes: c.infcodes |
||||
o.infcodes: h.zutil |
||||
o.infcodes: h.zlib |
||||
o.infcodes: h.zconf |
||||
o.infcodes: h.inftrees |
||||
o.infcodes: h.infblock |
||||
o.infcodes: h.infcodes |
||||
o.infcodes: h.infutil |
||||
o.infcodes: h.inffast |
||||
o.inffast: c.inffast |
||||
o.inffast: h.zutil |
||||
o.inffast: h.zlib |
||||
o.inffast: h.zconf |
||||
o.inffast: h.inftrees |
||||
o.inffast: h.infblock |
||||
o.inffast: h.infcodes |
||||
o.inffast: h.infutil |
||||
o.inffast: h.inffast |
||||
o.inflate: c.inflate |
||||
o.inflate: h.zutil |
||||
o.inflate: h.zlib |
||||
o.inflate: h.zconf |
||||
o.inflate: h.infblock |
||||
o.inftrees: c.inftrees |
||||
o.inftrees: h.zutil |
||||
o.inftrees: h.zlib |
||||
o.inftrees: h.zconf |
||||
o.inftrees: h.inftrees |
||||
o.inftrees: h.inffixed |
||||
o.infutil: c.infutil |
||||
o.infutil: h.zutil |
||||
o.infutil: h.zlib |
||||
o.infutil: h.zconf |
||||
o.infutil: h.infblock |
||||
o.infutil: h.inftrees |
||||
o.infutil: h.infcodes |
||||
o.infutil: h.infutil |
||||
o.trees: c.trees |
||||
o.trees: h.deflate |
||||
o.trees: h.zutil |
||||
o.trees: h.zlib |
||||
o.trees: h.zconf |
||||
o.trees: h.trees |
||||
o.uncompr: c.uncompr |
||||
o.uncompr: h.zlib |
||||
o.uncompr: h.zconf |
||||
o.zutil: c.zutil |
||||
o.zutil: h.zutil |
||||
o.zutil: h.zlib |
||||
o.zutil: h.zconf |
@ -1,147 +0,0 @@
|
||||
zlib 1.1.4 is a general purpose data compression library. All the code |
||||
is thread safe. The data format used by the zlib library |
||||
is described by RFCs (Request for Comments) 1950 to 1952 in the files |
||||
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate |
||||
format) and rfc1952.txt (gzip format). These documents are also available in |
||||
other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html |
||||
|
||||
All functions of the compression library are documented in the file zlib.h |
||||
(volunteer to write man pages welcome, contact jloup@gzip.org). A usage |
||||
example of the library is given in the file example.c which also tests that |
||||
the library is working correctly. Another example is given in the file |
||||
minigzip.c. The compression library itself is composed of all source files |
||||
except example.c and minigzip.c. |
||||
|
||||
To compile all files and run the test program, follow the instructions |
||||
given at the top of Makefile. In short "make test; make install" |
||||
should work for most machines. For Unix: "./configure; make test; make install" |
||||
For MSDOS, use one of the special makefiles such as Makefile.msc. |
||||
For VMS, use Make_vms.com or descrip.mms. |
||||
|
||||
Questions about zlib should be sent to <zlib@gzip.org>, or to |
||||
Gilles Vollant <info@winimage.com> for the Windows DLL version. |
||||
The zlib home page is http://www.zlib.org or http://www.gzip.org/zlib/ |
||||
Before reporting a problem, please check this site to verify that |
||||
you have the latest version of zlib; otherwise get the latest version and |
||||
check whether the problem still exists or not. |
||||
|
||||
PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html |
||||
before asking for help. |
||||
|
||||
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997 |
||||
issue of Dr. Dobb's Journal; a copy of the article is available in |
||||
http://dogma.net/markn/articles/zlibtool/zlibtool.htm |
||||
|
||||
The changes made in version 1.1.4 are documented in the file ChangeLog. |
||||
The only changes made since 1.1.3 are bug corrections: |
||||
|
||||
- ZFREE was repeated on same allocation on some error conditions. |
||||
This creates a security problem described in |
||||
http://www.zlib.org/advisory-2002-03-11.txt |
||||
- Returned incorrect error (Z_MEM_ERROR) on some invalid data |
||||
- Avoid accesses before window for invalid distances with inflate window |
||||
less than 32K. |
||||
- force windowBits > 8 to avoid a bug in the encoder for a window size |
||||
of 256 bytes. (A complete fix will be available in 1.1.5). |
||||
|
||||
The beta version 1.1.5beta includes many more changes. A new official |
||||
version 1.1.5 will be released as soon as extensive testing has been |
||||
completed on it. |
||||
|
||||
|
||||
Unsupported third party contributions are provided in directory "contrib". |
||||
|
||||
A Java implementation of zlib is available in the Java Development Kit |
||||
http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html |
||||
See the zlib home page http://www.zlib.org for details. |
||||
|
||||
A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk> |
||||
is in the CPAN (Comprehensive Perl Archive Network) sites |
||||
http://www.cpan.org/modules/by-module/Compress/ |
||||
|
||||
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com> |
||||
is available in Python 1.5 and later versions, see |
||||
http://www.python.org/doc/lib/module-zlib.html |
||||
|
||||
A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> |
||||
is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html |
||||
|
||||
An experimental package to read and write files in .zip format, |
||||
written on top of zlib by Gilles Vollant <info@winimage.com>, is |
||||
available at http://www.winimage.com/zLibDll/unzip.html |
||||
and also in the contrib/minizip directory of zlib. |
||||
|
||||
|
||||
Notes for some targets: |
||||
|
||||
- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc |
||||
and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL |
||||
The zlib DLL support was initially done by Alessandro Iacopetti and is |
||||
now maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL |
||||
home page at http://www.winimage.com/zLibDll |
||||
|
||||
From Visual Basic, you can call the DLL functions which do not take |
||||
a structure as argument: compress, uncompress and all gz* functions. |
||||
See contrib/visual-basic.txt for more information, or get |
||||
http://www.tcfb.com/dowseware/cmp-z-it.zip |
||||
|
||||
- For 64-bit Irix, deflate.c must be compiled without any optimization. |
||||
With -O, one libpng test fails. The test works in 32 bit mode (with |
||||
the -n32 compiler flag). The compiler bug has been reported to SGI. |
||||
|
||||
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 |
||||
it works when compiled with cc. |
||||
|
||||
- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 |
||||
is necessary to get gzprintf working correctly. This is done by configure. |
||||
|
||||
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works |
||||
with other compilers. Use "make test" to check your compiler. |
||||
|
||||
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. |
||||
|
||||
- For Turbo C the small model is supported only with reduced performance to |
||||
avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 |
||||
|
||||
- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html |
||||
Per Harald Myrvang <perm@stud.cs.uit.no> |
||||
|
||||
|
||||
Acknowledgments: |
||||
|
||||
The deflate format used by zlib was defined by Phil Katz. The deflate |
||||
and zlib specifications were written by L. Peter Deutsch. Thanks to all the |
||||
people who reported problems and suggested various improvements in zlib; |
||||
they are too numerous to cite here. |
||||
|
||||
Copyright notice: |
||||
|
||||
(C) 1995-2002 Jean-loup Gailly and Mark Adler |
||||
|
||||
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. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Jean-loup Gailly Mark Adler |
||||
jloup@gzip.org madler@alumni.caltech.edu |
||||
|
||||
If you use the zlib library in a product, we would appreciate *not* |
||||
receiving lengthy legal documents to sign. The sources are provided |
||||
for free but without warranty of any kind. The library has been |
||||
entirely written by Jean-loup Gailly and Mark Adler; it does not |
||||
include third-party code. |
||||
|
||||
If you redistribute modified sources, we would appreciate that you include |
||||
in the file ChangeLog history information documenting your changes. |
@ -1,48 +0,0 @@
|
||||
/* adler32.c -- compute the Adler-32 checksum of a data stream
|
||||
* Copyright (C) 1995-2002 Mark Adler |
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/ |
||||
|
||||
/* @(#) $Id$ */ |
||||
|
||||
#include "zlib.h" |
||||
|
||||
#define BASE 65521L /* largest prime smaller than 65536 */ |
||||
#define NMAX 5552 |
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ |
||||
|
||||
#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} |
||||
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); |
||||
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); |
||||
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); |
||||
#define DO16(buf) DO8(buf,0); DO8(buf,8); |
||||
|
||||
/* ========================================================================= */ |
||||
uLong ZEXPORT adler32(adler, buf, len) |
||||
uLong adler; |
||||
const Bytef *buf; |
||||
uInt len; |
||||
{ |
||||
unsigned long s1 = adler & 0xffff; |
||||
unsigned long s2 = (adler >> 16) & 0xffff; |
||||
int k; |
||||
|
||||
if (buf == Z_NULL) return 1L; |
||||
|
||||
while (len > 0) { |
||||
k = len < NMAX ? len : NMAX; |
||||
len -= k; |
||||
while (k >= 16) { |
||||
DO16(buf); |
||||
buf += 16; |
||||
k -= 16; |
||||
} |
||||
if (k != 0) do { |
||||
s1 += *buf++; |
||||
s2 += s1; |
||||
} while (--k); |
||||
s1 %= BASE; |
||||
s2 %= BASE; |
||||
} |
||||
return (s2 << 16) | s1; |
||||
} |
@ -1,213 +0,0 @@
|
||||
1. Compression algorithm (deflate) |
||||
|
||||
The deflation algorithm used by gzip (also zip and zlib) is a variation of |
||||
LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in |
||||
the input data. The second occurrence of a string is replaced by a |
||||
pointer to the previous string, in the form of a pair (distance, |
||||
length). Distances are limited to 32K bytes, and lengths are limited |
||||
to 258 bytes. When a string does not occur anywhere in the previous |
||||
32K bytes, it is emitted as a sequence of literal bytes. (In this |
||||
description, `string' must be taken as an arbitrary sequence of bytes, |
||||
and is not restricted to printable characters.) |
||||
|
||||
Literals or match lengths are compressed with one Huffman tree, and |
||||
match distances are compressed with another tree. The trees are stored |
||||
in a compact form at the start of each block. The blocks can have any |
||||
size (except that the compressed data for one block must fit in |
||||
available memory). A block is terminated when deflate() determines that |
||||
it would be useful to start another block with fresh trees. (This is |
||||
somewhat similar to the behavior of LZW-based _compress_.) |
||||
|
||||
Duplicated strings are found using a hash table. All input strings of |
||||
length 3 are inserted in the hash table. A hash index is computed for |
||||
the next 3 bytes. If the hash chain for this index is not empty, all |
||||
strings in the chain are compared with the current input string, and |
||||
the longest match is selected. |
||||
|
||||
The hash chains are searched starting with the most recent strings, to |
||||
favor small distances and thus take advantage of the Huffman encoding. |
||||
The hash chains are singly linked. There are no deletions from the |
||||
hash chains, the algorithm simply discards matches that are too old. |
||||
|
||||
To avoid a worst-case situation, very long hash chains are arbitrarily |
||||
truncated at a certain length, determined by a runtime option (level |
||||
parameter of deflateInit). So deflate() does not always find the longest |
||||
possible match but generally finds a match which is long enough. |
||||
|
||||
deflate() also defers the selection of matches with a lazy evaluation |
||||
mechanism. After a match of length N has been found, deflate() searches for |
||||
a longer match at the next input byte. If a longer match is found, the |
||||
previous match is truncated to a length of one (thus producing a single |
||||
literal byte) and the process of lazy evaluation begins again. Otherwise, |
||||
the original match is kept, and the next match search is attempted only N |
||||
steps later. |
||||
|
||||
The lazy match evaluation is also subject to a runtime parameter. If |
||||
the current match is long enough, deflate() reduces the search for a longer |
||||
match, thus speeding up the whole process. If compression ratio is more |
||||
important than speed, deflate() attempts a complete second search even if |
||||
the first match is already long enough. |
||||
|
||||
The lazy match evaluation is not performed for the fastest compression |
||||
modes (level parameter 1 to 3). For these fast modes, new strings |
||||
are inserted in the hash table only when no match was found, or |
||||
when the match is not too long. This degrades the compression ratio |
||||
but saves time since there are both fewer insertions and fewer searches. |
||||
|
||||
|
||||
2. Decompression algorithm (inflate) |
||||
|
||||
2.1 Introduction |
||||
|
||||
The real question is, given a Huffman tree, how to decode fast. The most |
||||
important realization is that shorter codes are much more common than |
||||
longer codes, so pay attention to decoding the short codes fast, and let |
||||
the long codes take longer to decode. |
||||
|
||||
inflate() sets up a first level table that covers some number of bits of |
||||
input less than the length of longest code. It gets that many bits from the |
||||
stream, and looks it up in the table. The table will tell if the next |
||||
code is that many bits or less and how many, and if it is, it will tell |
||||
the value, else it will point to the next level table for which inflate() |
||||
grabs more bits and tries to decode a longer code. |
||||
|
||||
How many bits to make the first lookup is a tradeoff between the time it |
||||
takes to decode and the time it takes to build the table. If building the |
||||
table took no time (and if you had infinite memory), then there would only |
||||
be a first level table to cover all the way to the longest code. However, |
||||
building the table ends up taking a lot longer for more bits since short |
||||
codes are replicated many times in such a table. What inflate() does is |
||||
simply to make the number of bits in the first table a variable, and set it |
||||
for the maximum speed. |
||||
|
||||
inflate() sends new trees relatively often, so it is possibly set for a |
||||
smaller first level table than an application that has only one tree for |
||||
all the data. For inflate, which has 286 possible codes for the |
||||
literal/length tree, the size of the first table is nine bits. Also the |
||||
distance trees have 30 possible values, and the size of the first table is |
||||
six bits. Note that for each of those cases, the table ended up one bit |
||||
longer than the ``average'' code length, i.e. the code length of an |
||||
approximately flat code which would be a little more than eight bits for |
||||
286 symbols and a little less than five bits for 30 symbols. It would be |
||||
interesting to see if optimizing the first level table for other |
||||
applications gave values within a bit or two of the flat code size. |
||||
|
||||
|
||||
2.2 More details on the inflate table lookup |
||||
|
||||
Ok, you want to know what this cleverly obfuscated inflate tree actually |
||||
looks like. You are correct that it's not a Huffman tree. It is simply a |
||||
lookup table for the first, let's say, nine bits of a Huffman symbol. The |
||||
symbol could be as short as one bit or as long as 15 bits. If a particular |
||||
symbol is shorter than nine bits, then that symbol's translation is duplicated |
||||
in all those entries that start with that symbol's bits. For example, if the |
||||
symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a |
||||
symbol is nine bits long, it appears in the table once. |
||||
|
||||
If the symbol is longer than nine bits, then that entry in the table points |
||||
to another similar table for the remaining bits. Again, there are duplicated |
||||
entries as needed. The idea is that most of the time the symbol will be short |
||||
and there will only be one table look up. (That's whole idea behind data |
||||
compression in the first place.) For the less frequent long symbols, there |
||||
will be two lookups. If you had a compression method with really long |
||||
symbols, you could have as many levels of lookups as is efficient. For |
||||
inflate, two is enough. |
||||
|
||||
So a table entry either points to another table (in which case nine bits in |
||||
the above example are gobbled), or it contains the translation for the symbol |
||||
and the number of bits to gobble. Then you start again with the next |
||||
ungobbled bit. |
||||
|
||||
You may wonder: why not just have one lookup table for how ever many bits the |
||||
longest symbol is? The reason is that if you do that, you end up spending |
||||
more time filling in duplicate symbol entries than you do actually decoding. |
||||
At least for deflate's output that generates new trees every several 10's of |
||||
kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code |
||||
would take too long if you're only decoding several thousand symbols. At the |
||||
other extreme, you could make a new table for every bit in the code. In fact, |
||||
that's essentially a Huffman tree. But then you spend two much time |
||||
traversing the tree while decoding, even for short symbols. |
||||
|
||||
So the number of bits for the first lookup table is a trade of the time to |
||||
fill out the table vs. the time spent looking at the second level and above of |
||||
the table. |
||||
|
||||
Here is an example, scaled down: |
||||
|
||||
The code being decoded, with 10 symbols, from 1 to 6 bits long: |
||||
|
||||
A: 0 |
||||
B: 10 |
||||
C: 1100 |
||||
D: 11010 |
||||
E: 11011 |
||||
F: 11100 |
||||
G: 11101 |
||||
H: 11110 |
||||
I: 111110 |
||||
J: 111111 |
||||
|
||||
Let's make the first table three bits long (eight entries): |
||||
|
||||
000: A,1 |
||||
001: A,1 |
||||
010: A,1 |
||||
011: A,1 |
||||
100: B,2 |
||||
101: B,2 |
||||
110: -> table X (gobble 3 bits) |
||||
111: -> table Y (gobble 3 bits) |
||||
|
||||
Each entry is what the bits decode to and how many bits that is, i.e. how |
||||
many bits to gobble. Or the entry points to another table, with the number of |
||||
bits to gobble implicit in the size of the table. |
||||
|
||||
Table X is two bits long since the longest code starting with 110 is five bits |
||||
long: |
||||
|
||||
00: C,1 |
||||
01: C,1 |
||||
10: D,2 |
||||
11: E,2 |
||||
|
||||
Table Y is three bits long since the longest code starting with 111 is six |
||||
bits long: |
||||
|
||||
000: F,2 |
||||
001: F,2 |
||||
010: G,2 |
||||
011: G,2 |
||||
100: H,2 |
||||
101: H,2 |
||||
110: I,3 |
||||
111: J,3 |
||||
|
||||
So what we have here are three tables with a total of 20 entries that had to |
||||
be constructed. That's compared to 64 entries for a single table. Or |
||||
compared to 16 entries for a Huffman tree (six two entry tables and one four |
||||
entry table). Assuming that the code ideally represents the probability of |
||||
the symbols, it takes on the average 1.25 lookups per symbol. That's compared |
||||
to one lookup for the single table, or 1.66 lookups per symbol for the |
||||
Huffman tree. |
||||
|
||||
There, I think that gives you a picture of what's going on. For inflate, the |
||||
meaning of a particular symbol is often more than just a letter. It can be a |
||||
byte (a "literal"), or it can be either a length or a distance which |
||||
indicates a base value and a number of bits to fetch after the code that is |
||||
added to the base value. Or it might be the special end-of-block code. The |
||||
data structures created in inftrees.c try to encode all that information |
||||
compactly in the tables. |
||||
|
||||
|
||||
Jean-loup Gailly Mark Adler |
||||
jloup@gzip.org madler@alumni.caltech.edu |
||||
|
||||
|
||||
References: |
||||
|
||||
[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data |
||||
Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3, |
||||
pp. 337-343. |
||||
|
||||
``DEFLATE Compressed Data Format Specification'' available in |
||||
ftp://ds.internic.net/rfc/rfc1951.txt |
@ -1,66 +0,0 @@
|
||||
# Amiga powerUP (TM) Makefile
|
||||
# makefile for libpng and SAS C V6.58/7.00 PPC compiler
|
||||
# Copyright (C) 1998 by Andreas R. Kleinert
|
||||
|
||||
CC = scppc
|
||||
CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
|
||||
OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
|
||||
LIBNAME = libzip.a
|
||||
AR = ppc-amigaos-ar
|
||||
AR_FLAGS = cr
|
||||
RANLIB = ppc-amigaos-ranlib
|
||||
LDFLAGS = -r -o
|
||||
LDLIBS = LIB:scppc.a
|
||||
LN = ppc-amigaos-ld
|
||||
RM = delete quiet
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
||||
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
all: example minigzip |
||||
|
||||
test: all |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
$(LIBNAME): $(OBJS) |
||||
$(AR) $(AR_FLAGS) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
example: example.o $(LIBNAME) |
||||
$(LN) $(LDFLAGS) example LIB:c_ppc.o example.o $(LIBNAME) $(LDLIBS) LIB:end.o
|
||||
|
||||
minigzip: minigzip.o $(LIBNAME) |
||||
$(LN) $(LDFLAGS) minigzip LIB:c_ppc.o minigzip.o $(LIBNAME) $(LDLIBS) LIB:end.o
|
||||
|
||||
clean: |
||||
$(RM) *.o example minigzip $(LIBNAME) foo.gz
|
||||
|
||||
zip: |
||||
zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
|
||||
descrip.mms *.[ch]
|
||||
|
||||
tgz: |
||||
cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
|
||||
zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
adler32.o: zutil.h zlib.h zconf.h |
||||
compress.o: zlib.h zconf.h |
||||
crc32.o: zutil.h zlib.h zconf.h |
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h |
||||
example.o: zlib.h zconf.h |
||||
gzio.o: zutil.h zlib.h zconf.h |
||||
infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h |
||||
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h |
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h |
||||
inflate.o: zutil.h zlib.h zconf.h infblock.h |
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
||||
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h |
||||
minigzip.o: zlib.h zconf.h |
||||
trees.o: deflate.h zutil.h zlib.h zconf.h |
||||
uncompr.o: zlib.h zconf.h |
||||
zutil.o: zutil.h zlib.h zconf.h |
@ -1,64 +0,0 @@
|
||||
# SMakefile for zlib
|
||||
# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
|
||||
# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
|
||||
# Amiga, SAS/C 6.56 & Smake
|
||||
|
||||
CC=sc
|
||||
CFLAGS=OPT
|
||||
#CFLAGS=OPT CPU=68030
|
||||
#CFLAGS=DEBUG=LINE
|
||||
LDFLAGS=LIB z.lib
|
||||
|
||||
SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
|
||||
NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
||||
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
all: SCOPTIONS example minigzip |
||||
|
||||
test: all |
||||
`cd`/example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
install: z.lib |
||||
copy zlib.h zconf.h INCLUDE: clone
|
||||
copy z.lib LIB: clone
|
||||
|
||||
z.lib: $(OBJS) |
||||
oml z.lib r $(OBJS)
|
||||
|
||||
example: example.o z.lib |
||||
$(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
|
||||
|
||||
minigzip: minigzip.o z.lib |
||||
$(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
|
||||
|
||||
clean: |
||||
-delete force quiet *.o example minigzip z.lib foo.gz *.lnk SCOPTIONS
|
||||
|
||||
SCOPTIONS: Smakefile |
||||
copy to $@ <from <
|
||||
$(SCOPTIONS) |
||||
< |
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
adler32.o: zutil.h zlib.h zconf.h |
||||
compress.o: zlib.h zconf.h |
||||
crc32.o: zutil.h zlib.h zconf.h |
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h |
||||
example.o: zlib.h zconf.h |
||||
gzio.o: zutil.h zlib.h zconf.h |
||||
infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h |
||||
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h |
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h |
||||
inflate.o: zutil.h zlib.h zconf.h infblock.h |
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
||||
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h |
||||
minigzip.o: zlib.h zconf.h |
||||
trees.o: deflate.h zutil.h zlib.h zconf.h |
||||
uncompr.o: zlib.h zconf.h |
||||
zutil.o: zutil.h zlib.h zconf.h |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue