--- qt-x11-free-3.3.8b.old/changes-3.3.8 +++ qt-x11-free-3.3.8b/changes-3.3.8 @@ -32,7 +32,7 @@ Third party components ---------------------- -- libpng +- libmodpng14 * Security fix (CVE-2006-3334): Buffer overflow allows context-dependent attackers to cause a denial of service and possibly execute arbitrary --- qt-x11-free-3.3.8b.old/configure +++ qt-x11-free-3.3.8b/configure @@ -2919,8 +2919,8 @@ if [ "$CFG_LIBPNG" = "system" ]; then QMAKE_CONFIG="$QMAKE_CONFIG system-png" if [ "$CFG_PNG" = "yes" ]; then - QMAKE_VARS="$QMAKE_VARS \"QMAKE_LIBS_QT+=-lpng\"" - QMAKE_VARS="$QMAKE_VARS \"QMAKE_LIBS_QT_THREAD+=-lpng\"" + QMAKE_VARS="$QMAKE_VARS \"QMAKE_LIBS_QT+=-lmodpng14\"" + QMAKE_VARS="$QMAKE_VARS \"QMAKE_LIBS_QT_THREAD+=-lmodpng14\"" fi fi if [ "$CFG_PNG" = "no" ]; then --- qt-x11-free-3.3.8b.old/doc/3rdparty.doc +++ qt-x11-free-3.3.8b/doc/3rdparty.doc @@ -86,15 +86,15 @@ See \c 3rdparty/libmng/LICENSE for license details. -\section1 PNG reference library (libpng) +\section1 PNG reference library (libmodpng14) \e{Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs.} -- quoted from \c -3rdparty/libpng/libpng.txt. +3rdparty/libmodpng14/libmodpng14.txt. -See \c 3rdparty/libpng/LICENSE for license details. +See \c 3rdparty/libmodpng14/LICENSE for license details. \section1 Data compression library (zlib) --- qt-x11-free-3.3.8b.old/doc/html/3rdparty.html +++ qt-x11-free-3.3.8b/doc/html/3rdparty.html @@ -43,7 +43,7 @@
  • Multiple-image Network Graphics (MNG) Reference Library (libmng) -
  • PNG reference library (libpng) +
  • PNG reference library (libmodpng14)
  • Data compression library (zlib) @@ -67,10 +67,10 @@

    The libmng library supports decoding, displaying, encoding, and various other manipulations of the Multiple-image Network Graphics (MNG) format image files. It uses the zlib compression library, and optionally the JPEG library by the Independent JPEG Group (IJG) and/or lcms (little cms), a color-management library by Marti Maria Saguer. -- quoted from 3rdparty/libmng/doc/libmng.txt.

    See 3rdparty/libmng/LICENSE for license details. -

    PNG reference library (libpng) +

    PNG reference library (libmodpng14)

    -

    Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -- quoted from 3rdparty/libpng/libpng.txt. -

    See 3rdparty/libpng/LICENSE for license details. +

    Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -- quoted from 3rdparty/libmodpng14/libmodpng14.txt. +

    See 3rdparty/libmodpng14/LICENSE for license details.

    Data compression library (zlib)

    zlib 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 -- quoted from 3rdparty/zlib/README. --- qt-x11-free-3.3.8b.old/doc/html/qimage.html +++ qt-x11-free-3.3.8b/doc/html/qimage.html @@ -934,7 +934,7 @@ Records string s for the keyword key. The key should be a portable keyword recognizable by other software - some suggested -values can be found in the PNG specification. s can be any text. lang +values can be found in the PNG specification. s can be any text. lang should specify the language code (see RFC 1766) or 0. --- qt-x11-free-3.3.8b.old/plugins/src/imageformats/png/main.cpp +++ qt-x11-free-3.3.8b/plugins/src/imageformats/png/main.cpp @@ -43,7 +43,7 @@ io.setFileName( filename ); io.setImage( *image ); - read_png_image( &io ); + read_modpng14_image( &io ); return TRUE; } @@ -57,7 +57,7 @@ io.setFileName( filename ); io.setImage( image ); - write_png_image( &io ); + write_modpng14_image( &io ); return TRUE; } --- qt-x11-free-3.3.8b.old/plugins/src/imageformats/png/png.pro +++ qt-x11-free-3.3.8b/plugins/src/imageformats/png/png.pro @@ -10,28 +10,28 @@ SOURCES += main.cpp system-png { - unix:LIBS += -lpng - win32:LIBS += libpng.lib + unix:LIBS += -lmodpng14 + win32:LIBS += libmodpng14.lib } !system-png { - INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/libpng + INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/libmodpng14 INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib SOURCES += \ - ../../../../src/3rdparty/libpng/png.c \ - ../../../../src/3rdparty/libpng/pngerror.c \ - ../../../../src/3rdparty/libpng/pngget.c \ - ../../../../src/3rdparty/libpng/pngmem.c \ - ../../../../src/3rdparty/libpng/pngpread.c \ - ../../../../src/3rdparty/libpng/pngread.c \ - ../../../../src/3rdparty/libpng/pngrio.c \ - ../../../../src/3rdparty/libpng/pngrtran.c \ - ../../../../src/3rdparty/libpng/pngrutil.c \ - ../../../../src/3rdparty/libpng/pngset.c \ - ../../../../src/3rdparty/libpng/pngtrans.c \ - ../../../../src/3rdparty/libpng/pngwio.c \ - ../../../../src/3rdparty/libpng/pngwrite.c \ - ../../../../src/3rdparty/libpng/pngwtran.c \ - ../../../../src/3rdparty/libpng/pngwutil.c + ../../../../src/3rdparty/libmodpng14/png.c \ + ../../../../src/3rdparty/libmodpng14/pngerror.c \ + ../../../../src/3rdparty/libmodpng14/pngget.c \ + ../../../../src/3rdparty/libmodpng14/pngmem.c \ + ../../../../src/3rdparty/libmodpng14/pngpread.c \ + ../../../../src/3rdparty/libmodpng14/pngread.c \ + ../../../../src/3rdparty/libmodpng14/pngrio.c \ + ../../../../src/3rdparty/libmodpng14/pngrtran.c \ + ../../../../src/3rdparty/libmodpng14/pngrutil.c \ + ../../../../src/3rdparty/libmodpng14/pngset.c \ + ../../../../src/3rdparty/libmodpng14/pngtrans.c \ + ../../../../src/3rdparty/libmodpng14/pngwio.c \ + ../../../../src/3rdparty/libmodpng14/pngwrite.c \ + ../../../../src/3rdparty/libmodpng14/pngwtran.c \ + ../../../../src/3rdparty/libmodpng14/pngwutil.c } !system-zlib:SOURCES += \ --- qt-x11-free-3.3.8b.old/src/3rdparty/Makefile +++ qt-x11-free-3.3.8b/src/3rdparty/Makefile @@ -2,8 +2,8 @@ all: cd zlib; ./configure; make - cd libpng; make -f $(PNGMAK) + cd libmodpng14; make -f $(PNGMAK) clean: -cd zlib; make clean - -cd libpng; make -f $(PNGMAK) clean + -cd libmodpng14; make -f $(PNGMAK) clean --- qt-x11-free-3.3.8b.old/src/3rdparty/README +++ qt-x11-free-3.3.8b/src/3rdparty/README @@ -4,7 +4,7 @@ have been removed: libjpeg - some source files, images, Makefiles, manual pages - libpng/contrib - a collection of examples and test-suite + libmodpng14/contrib - a collection of examples and test-suite zlib/contrib - a collection of non-zlib code zlib/amiga - zlib for a platform not supported by Qt zlib/as400 - zlib for a platform not supported by Qt --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/LICENSE +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/LICENSE @@ -39,9 +39,9 @@ /* * * */ /* ************************************************************************** */ /* * * */ -/* * Parts of this software have been adapted from the libpng package. * */ +/* * Parts of this software have been adapted from the libmodpng14 package. * */ /* * Although this library supports all features from the PNG specification * */ -/* * (as MNG descends from it) it does not require the libpng package. * */ +/* * (as MNG descends from it) it does not require the libmodpng14 package. * */ /* * It does require the zlib library and optionally the IJG jpeg library, * */ /* * and/or the "little-cms" library by Marti Maria (depending on the * */ /* * inclusion of support for JNG and Full-Color-Management respectively. * */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/README +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/README @@ -18,8 +18,8 @@ https://sourceforge.net/project/?group_id=5635 The official MNG homepage: - http://www.libpng.org/pub/mng + http://www.libmodpng14.org/pub/mng The official PNG homepage: - http://www.libpng.org/pub/png + http://www.libmodpng14.org/pub/png --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/doc/libmng.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/doc/libmng.txt @@ -20,10 +20,10 @@ Libmng was written to support and promote the MNG specification. The latest MNG specification (currently 1.0) is available at - http://www.libpng.org/pub/mng + http://www.libmodpng14.org/pub/mng Other information about MNG can be found at the MNG home page at - http://www.libpng.org/pub/mng + http://www.libmodpng14.org/pub/mng The latest version of libmng can be found at its own homepage at http://www.libmng.com @@ -1042,7 +1042,7 @@ http://www.littlecms.com/ MNG specification: - http://www.libpng.org/pub/mng + http://www.libmodpng14.org/pub/mng In the case of any inconsistency between the MNG specification @@ -1092,9 +1092,9 @@ Remarks : -Parts of this software have been adapted from the libpng library. +Parts of this software have been adapted from the libmodpng14 library. Although this library supports all features from the PNG specification -(as MNG descends from it) it does not require the libpng library. +(as MNG descends from it) it does not require the libmodpng14 library. It does require the zlib library and optionally the IJG JPEG library, and/or the "little-cms" library by Marti Maria Saguer (depending on the inclusion of support for JNG and Full-Color-Management respectively. --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/doc/man/jng.5 +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/doc/man/jng.5 @@ -20,7 +20,7 @@ .LP MNG 0.97 draft 70, Februari 2000: .IP -http://www.libpng.org/pub/mng +http://www.libmodpng14.org/pub/mng .SH AUTHORS This man page: Gerard Juyn --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/doc/man/libmng.3 +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/doc/man/libmng.3 @@ -31,10 +31,10 @@ Libmng was written to support and promote the MNG specification. The MNG-1.0 specification should be shortly available at -. +. Other information about MNG can be found at the MNG home page, -. +. The latest version of libmng can be found at its own homepage at . @@ -1047,7 +1047,7 @@ not finished yet .SH "SEE ALSO" -.IR mng(5), jng(5), png(5), libpng(3) +.IR mng(5), jng(5), png(5), libmodpng14(3) .LP libmng : @@ -1077,7 +1077,7 @@ MNG specification: .IP .br -http://www.libpng.org/pub/mng +http://www.libmodpng14.org/pub/mng .LP In the case of any inconsistency between the MNG specification @@ -1131,9 +1131,9 @@ .SH Remarks -Parts of this software have been adapted from the libpng library. +Parts of this software have been adapted from the libmodpng14 library. Although this library supports all features from the PNG specification -(as MNG descends from it) it does not require the libpng library. +(as MNG descends from it) it does not require the libmodpng14 library. It does require the zlib library and optionally the IJG JPEG library, and/or the "little-cms" library by Marti Maria Saguer (depending on the inclusion of support for JNG and Full-Color-Management respectively. --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/doc/man/mng.5 +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/doc/man/mng.5 @@ -20,13 +20,13 @@ compressed (photographic) images. .SH "SEE ALSO" -.IR png(5), jng(5), libmng(3), libpng(3), zlib(3), deflate(5), +.IR png(5), jng(5), libmng(3), libmodpng14(3), zlib(3), deflate(5), .IR zlib(5), jpeg(5) .LP MNG 0.97 draft 70, Februari 2000: .IP .br -http://www.libpng.org/pub/mng +http://www.libmodpng14.org/pub/mng .SH AUTHORS This man page: Gerard Juyn .LP --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng.h +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng.h @@ -39,9 +39,9 @@ /* * * */ /* ************************************************************************** */ /* * * */ -/* * Parts of this software have been adapted from the libpng package. * */ +/* * Parts of this software have been adapted from the libmodpng14 package. * */ /* * Although this library supports all features from the PNG specification * */ -/* * (as MNG descends from it) it does not require the libpng package. * */ +/* * (as MNG descends from it) it does not require the libmodpng14 package. * */ /* * It does require the zlib library and optionally the IJG jpeg library, * */ /* * and/or the "little-cms" library by Marti Maria (depending on the * */ /* * inclusion of support for JNG and Full-Color-Management respectively. * */ @@ -387,9 +387,9 @@ /* * * */ /* ************************************************************************** */ -#define MNG_PNG_VERSION "1.2" -#define MNG_PNG_VERSION_MAJ 1 -#define MNG_PNG_VERSION_MIN 2 +#define MNG_MODPNG14_VERSION "1.2" +#define MNG_MODPNG14_VERSION_MAJ 1 +#define MNG_MODPNG14_VERSION_MIN 2 #define MNG_MNG_VERSION "1.0" #define MNG_MNG_VERSION_MAJ 1 @@ -2207,7 +2207,7 @@ /* ************************************************************************** */ /* * * */ -/* * Chunk names (idea adapted from libpng 1.1.0 - png.h) * */ +/* * Chunk names (idea adapted from libmodpng14 1.1.0 - modpng14.h) * */ /* * * */ /* ************************************************************************** */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng_chunk_io.c +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng_chunk_io.c @@ -239,7 +239,7 @@ /* ************************************************************************** */ /* * * */ /* * Routines for swapping byte-order from and to graphic files * */ -/* * (This code is adapted from the libpng package) * */ +/* * (This code is adapted from the libmodpng14 package) * */ /* * * */ /* ************************************************************************** */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng_chunks.h +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng_chunks.h @@ -52,12 +52,12 @@ /* ************************************************************************** */ #ifdef MNG_SWAP_ENDIAN -#define PNG_SIG 0x474e5089L +#define MODPNG14_SIG 0x474e5089L #define JNG_SIG 0x474e4a8bL #define MNG_SIG 0x474e4d8aL #define POST_SIG 0x0a1a0a0dL #else -#define PNG_SIG 0x89504e47L +#define MODPNG14_SIG 0x89504e47L #define JNG_SIG 0x8b4a4e47L #define MNG_SIG 0x8a4d4e47L #define POST_SIG 0x0d0a1a0aL --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng_data.h +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng_data.h @@ -727,7 +727,7 @@ /* ************************************************************************** */ /* * * */ /* * Routines for swapping byte-order from and to graphic files * */ -/* * (This code is adapted from the libpng package) * */ +/* * (This code is adapted from the libmodpng14 package) * */ /* * * */ /* ************************************************************************** */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng_pixels.c +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng_pixels.c @@ -151,7 +151,7 @@ /* ************************************************************************** */ /* * * */ /* * Alpha composing macros * */ -/* * the code below is slightly modified from the libpng package * */ +/* * the code below is slightly modified from the libmodpng14 package * */ /* * the original was last optimized by Greg Roelofs & Mark Adler * */ /* * * */ /* ************************************************************************** */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng_read.c +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng_read.c @@ -263,7 +263,7 @@ mng_uint32 iBuflen) { /* the table-idea & binary search code was adapted from - libpng 1.1.0 (pngread.c) */ + libmodpng14 1.1.0 (pngread.c) */ /* NOTE1: the table must remain sorted by chunkname, otherwise the binary search will break !!! */ /* NOTE2: the layout must remain equal to the header part of all the @@ -644,7 +644,7 @@ if (iRead != iBuflen) /* full signature received ? */ MNG_ERROR (pData, MNG_UNEXPECTEDEOF); /* is it a valid signature ? */ - if (mng_get_uint32 (pData->pReadbuf) == PNG_SIG) + if (mng_get_uint32 (pData->pReadbuf) == MODPNG14_SIG) pData->eSigtype = mng_it_png; else if (mng_get_uint32 (pData->pReadbuf) == JNG_SIG) --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/libmng_write.c +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/libmng_write.c @@ -77,7 +77,7 @@ MNG_ALLOC (pData, pData->pWritebuf, pData->iWritebufsize+12) /* write the signature */ if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_IHDR) - mng_put_uint32 (pData->pWritebuf, PNG_SIG); + mng_put_uint32 (pData->pWritebuf, MODPNG14_SIG); else if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_JHDR) mng_put_uint32 (pData->pWritebuf, JNG_SIG); --- qt-x11-free-3.3.8b.old/src/3rdparty/libmng/makefiles/makefile.linux +++ qt-x11-free-3.3.8b/src/3rdparty/libmng/makefiles/makefile.linux @@ -4,7 +4,7 @@ # makefile for libmng - THE MNG library # this makefile is suitable for Linux ELF with gcc # -# (this file is heavily copied from makefile.linux in the libpng package) +# (this file is heavily copied from makefile.linux in the libmodpng14 package) # compiler CC=gcc --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/ANNOUNCE +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/ANNOUNCE @@ -1,7 +1,7 @@ Libpng 1.2.5 - October 3, 2002 -This is a public release of libpng, intended for use in production codes. +This is a public release of libmodpng14, intended for use in production codes. Changes since the last public release (1.2.4): @@ -9,19 +9,19 @@ Added code to contrib/gregbook/readpng2.c to ignore unused chunks. Replaced toucan.png in contrib/gregbook (it has been corrupt since 1.0.11) Removed some stray *.o files from contrib/gregbook. - Changed png_error() to png_warning() about "Too much data" in pngpread.c + Changed modpng14_error() to modpng14_warning() about "Too much data" in pngpread.c and about "Extra compressed data" in pngrutil.c. - Prevent png_ptr->pass from exceeding 7 in png_push_finish_row(). + Prevent modpng14_ptr->pass from exceeding 7 in modpng14_push_finish_row(). Updated makefile.hggcc - Updated png.c and pnggccrd.c handling of return from png_mmx_support() - Only issue png_warning() about "Too much data" in pngpread.c when avail_in + Updated png.c and pnggccrd.c handling of return from modpng14_mmx_support() + Only issue modpng14_warning() about "Too much data" in pngpread.c when avail_in is nonzero. - Updated makefiles to install a separate libpng.so.3 with its own rpath. + Updated makefiles to install a separate libmodpng14.so.3 with its own rpath. Revised makefiles to not remove previous minor versions of shared libraries. Revised 13 makefiles to remove "-lz" and "-L$(ZLIBLIB)", etc., from shared library loader directive. - Revised libpng-config script. - Relocated two misplaced PNGAPI lines in pngtest.c + Revised libmodpng14-config script. + Relocated two misplaced MODPNG14API lines in pngtest.c Send comments/corrections/commendations to png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/CHANGES +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/CHANGES @@ -1,8 +1,8 @@ -CHANGES - changes for libpng +CHANGES - changes for libmodpng14 version 0.2 - added reader into png.h + added reader into modpng14.h fixed small problems in stub file version 0.3 added pull reader @@ -16,8 +16,8 @@ added check for 64 KB blocks for 16 bit machines version 0.4 cleaned up code and commented code - simplified time handling into png_time - created png_color_16 and png_color_8 to handle color needs + simplified time handling into modpng14_time + created modpng14_color_16 and modpng14_color_8 to handle color needs cleaned up color type defines fixed various bugs made various names more consistant @@ -29,33 +29,33 @@ fixed many reading and writing bugs saved using 3 spaces instead of tabs version 0.6 - added png_large_malloc() and png_large_free() - added png_size_t + added modpng14_large_malloc() and modpng14_large_free() + added modpng14_size_t cleaned up some compiler warnings - added png_start_read_image() + added modpng14_start_read_image() version 0.7 cleaned up lots of bugs finished dithering and other stuff added test program - changed name from pnglib to libpng + changed name from pnglib to libmodpng14 version 0.71 [June, 1995] changed pngtest.png for zlib 0.93 - fixed error in libpng.txt and example.c + fixed error in libmodpng14.txt and example.c version 0.8 cleaned up some bugs - added png_set_filler() + added modpng14_set_filler() split up pngstub.c into pngmem.c, pngio.c, and pngerror.c added #define's to remove unwanted code - moved png_info_init() to png.c - added old_size into png_realloc() + moved modpng14_info_init() to png.c + added old_size into modpng14_realloc() added functions to manually set filtering and compression info changed compression parameters based on image type optimized filter selection code added version info changed external functions passing floats to doubles (k&r problems?) - put all the configurable stuff in pngconf.h - enabled png_set_shift to work with paletted images on read - added png_read_update_info() - updates info structure with + put all the configurable stuff in modpng14conf.h + enabled modpng14_set_shift to work with paletted images on read + added modpng14_read_update_info() - updates info structure with transformations version 0.81 [August, 1995] incorporated Tim Wegner's medium model code (thanks, Tim) @@ -79,24 +79,24 @@ cleaned up documentation added callbacks for read/write and warning/error functions version 0.89 [July, 1996] - added new initialization API to make libpng work better with shared libs - we now have png_create_read_struct(), png_create_write_struct(), - png_create_info_struct(), png_destroy_read_struct(), and - png_destroy_write_struct() instead of the separate calls to - malloc and png_read_init(), png_info_init(), and png_write_init() + added new initialization API to make libmodpng14 work better with shared libs + we now have modpng14_create_read_struct(), modpng14_create_write_struct(), + modpng14_create_info_struct(), modpng14_destroy_read_struct(), and + modpng14_destroy_write_struct() instead of the separate calls to + malloc and modpng14_read_init(), modpng14_info_init(), and modpng14_write_init() changed warning/error callback functions to fix bug - this means you should use the new initialization API if you were using the old - png_set_message_fn() calls, and that the old API no longer exists + modpng14_set_message_fn() calls, and that the old API no longer exists so that people are aware that they need to change their code changed filter selection API to allow selection of multiple filters - since it didn't work in previous versions of libpng anyways + since it didn't work in previous versions of libmodpng14 anyways optimized filter selection code - fixed png_set_background() to allow using an arbitrary RGB color for + fixed modpng14_set_background() to allow using an arbitrary RGB color for paletted images fixed gamma and background correction for paletted images, so - png_correct_palette is not needed unless you are correcting an - external palette (you will need to #define PNG_CORRECT_PALETTE_SUPPORTED - in pngconf.h) - if nobody uses this, it may disappear in the future. + modpng14_correct_palette is not needed unless you are correcting an + external palette (you will need to #define MODPNG14_CORRECT_PALETTE_SUPPORTED + in modpng14conf.h) - if nobody uses this, it may disappear in the future. fixed bug with Borland 64K memory allocation (Alexander Lehmann) fixed bug in interlace handling (Smarasderagd, I think) added more error checking for writing and image to reduce invalid files @@ -106,16 +106,16 @@ updated documentation to reflect new API version 0.90 [January, 1997] made CRC errors/warnings on critical and ancillary chunks configurable - libpng will use the zlib CRC routines by (compile-time) default + libmodpng14 will use the zlib CRC routines by (compile-time) default changed DOS small/medium model memory support - needs zlib 1.04 (Tim Wegner) - added external C++ wrapper statements to png.h (Gilles Dauphin) + added external C++ wrapper statements to modpng14.h (Gilles Dauphin) allow PNG file to be read when some or all of file signature has already been read from the beginning of the stream. ****This affects the size - of info_struct and invalidates all programs that use a shared libpng**** - fixed png_filler() declarations + of info_struct and invalidates all programs that use a shared libmodpng14**** + fixed modpng14_filler() declarations fixed? background color conversions fixed order of error function pointers to match documentation - current chunk name is now available in png_struct to reduce the number + current chunk name is now available in modpng14_struct to reduce the number of nearly identical error messages (will simplify multi-lingual support when available) try to get ready for unknown-chunk callback functions: @@ -124,14 +124,14 @@ - all chunk handling routines have the same prototypes, so we will be able to handle all chunks via a callback mechanism try to fix Linux "setjmp" buffer size problems - removed png_large_malloc, png_large_free, and png_realloc functions. + removed modpng14_large_malloc, modpng14_large_free, and modpng14_realloc functions. version 0.95 [March, 1997] fixed bug in pngwutil.c allocating "up_row" twice and "avg_row" never fixed bug in PNG file signature compares when start != 0 - changed parameter type of png_set_filler(...filler...) from png_byte - to png_uint_32 + changed parameter type of modpng14_set_filler(...filler...) from modpng14_byte + to modpng14_uint_32 added test for MACOS to ensure that both math.h and fp.h are not #included - added macros for libpng to be compiled as a Windows DLL (Andreas Kupries) + added macros for libmodpng14 to be compiled as a Windows DLL (Andreas Kupries) added "packswap" transformation, which changes the endianness of packed-pixel bytes (Kevin Bracey) added "strip_alpha" transformation, which removes the alpha channel of @@ -139,118 +139,118 @@ added "swap_alpha" transformation, which puts the alpha channel in front of the color bytes instead of after removed all implicit variable tests which assume NULL == 0 (I think) - changed several variables to "png_size_t" to show 16/32-bit limitations + changed several variables to "modpng14_size_t" to show 16/32-bit limitations added new pCAL chunk read/write support added experimental filter selection weighting (Greg Roelofs) - removed old png_set_rgbx() and png_set_xrgb() functions that have been - obsolete for about 2 years now (use png_set_filler() instead) + removed old modpng14_set_rgbx() and modpng14_set_xrgb() functions that have been + obsolete for about 2 years now (use modpng14_set_filler() instead) added macros to read 16- and 32-bit ints directly from buffer, to be used only on those systems that support it (namely PowerPC and 680x0) With some testing, this may become the default for MACOS/PPC systems. only calculate CRC on data if we are going to use it - added macros for zTXt compression type PNG_zTXt_COMPRESSION_??? - added macros for simple libpng debugging output selectable at compile time - removed PNG_READ_END_MODE in progressive reader (Smarasderagd) - more description of info_struct in libpng.txt and png.h + added macros for zTXt compression type MODPNG14_zTXt_COMPRESSION_??? + added macros for simple libmodpng14 debugging output selectable at compile time + removed MODPNG14_READ_END_MODE in progressive reader (Smarasderagd) + more description of info_struct in libmodpng14.txt and modpng14.h more instructions in example.c more chunk types tested in pngtest.c - renamed pngrcb.c to pngset.c, and all png_read_ functions to be - png_set_. We now have corresponding png_get_ + renamed pngrcb.c to pngset.c, and all modpng14_read_ functions to be + modpng14_set_. We now have corresponding modpng14_get_ functions in pngget.c to get infomation in info_ptr. This isolates - the application from the internal organization of png_info_struct + the application from the internal organization of modpng14_info_struct (good for shared library implementations). version 0.96 [May, 1997] fixed serious bug with < 8bpp images introduced in 0.95 fixed 256-color transparency bug (Greg Roelofs) fixed up documentation (Greg Roelofs, Laszlo Nyul) - fixed "error" in pngconf.h for Linux setjmp() behaviour + fixed "error" in modpng14conf.h for Linux setjmp() behaviour fixed DOS medium model support (Tim Wegner) - fixed png_check_keyword() for case with error in static string text + fixed modpng14_check_keyword() for case with error in static string text added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul) added typecasts to quiet compiler errors added more debugging info version 0.97 [January, 1998] - removed PNG_USE_OWN_CRC capability - relocated png_set_crc_action from pngrutil.c to pngrtran.c + removed MODPNG14_USE_OWN_CRC capability + relocated modpng14_set_crc_action from pngrutil.c to pngrtran.c fixed typecasts of "new_key", etc. (Andreas Dilger) added RFC 1152 [sic] date support fixed bug in gamma handling of 4-bit grayscale added 2-bit grayscale gamma handling (Glenn R-P) - added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P) - minor corrections in libpng.txt + added more typecasts. 65536L becomes (modpng14_uint_32)65536L, etc. (Glenn R-P) + minor corrections in libmodpng14.txt added simple sRGB support (Glenn R-P) - easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED; + easier conditional compiling, e.g. define MODPNG14_READ/WRITE_NOT_FULLY_SUPPORTED; all configurable options can be selected from command-line instead - of having to edit pngconf.h (Glenn R-P) + of having to edit modpng14conf.h (Glenn R-P) fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P) - added more conditions for png_do_background, to avoid changing + added more conditions for modpng14_do_background, to avoid changing black pixels to background when a background is supplied and no pixels are transparent - repaired PNG_NO_STDIO behaviour + repaired MODPNG14_NO_STDIO behaviour tested NODIV support and made it default behaviour (Greg Roelofs) added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler) regularized version numbering scheme and bumped shared-library major - version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs) + version number to 2 to avoid problems with libmodpng14 0.89 apps (Greg Roelofs) version 0.98 [January, 1998] - cleaned up some typos in libpng.txt and in code documentation + cleaned up some typos in libmodpng14.txt and in code documentation fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler) cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c changed recommendation about file_gamma for PC images to .51 from .45, - in example.c and libpng.txt, added comments to distinguish between + in example.c and libmodpng14.txt, added comments to distinguish between screen_gamma, viewing_gamma, and display_gamma. changed all references to RFC1152 to read RFC1123 and changed the - PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED - added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent) - changed srgb_intent from png_byte to int to avoid compiler bugs + MODPNG14_TIME_RFC1152_SUPPORTED macro to MODPNG14_TIME_RFC1123_SUPPORTED + added modpng14_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent) + changed srgb_intent from modpng14_byte to int to avoid compiler bugs version 0.99 [January 30, 1998] free info_ptr->text instead of end_info_ptr->text in pngread.c (John Bowler) fixed a longstanding "packswap" bug in pngtrans.c - fixed some inconsistencies in pngconf.h that prevented compiling with - PNG_READ_GAMMA_SUPPORTED and PNG_READ_hIST_SUPPORTED undefined - fixed some typos and made other minor rearrangement of libpng.txt (Andreas) + fixed some inconsistencies in modpng14conf.h that prevented compiling with + MODPNG14_READ_GAMMA_SUPPORTED and MODPNG14_READ_hIST_SUPPORTED undefined + fixed some typos and made other minor rearrangement of libmodpng14.txt (Andreas) changed recommendation about file_gamma for PC images to .50 from .51 in - example.c and libpng.txt, and changed file_gamma for sRGB images to .45 + example.c and libmodpng14.txt, and changed file_gamma for sRGB images to .45 added a number of functions to access information from the png structure - png_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit) + modpng14_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit) added TARGET_MACOS similar to zlib-1.0.8 - define PNG_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined - added type casting to all png_malloc() function calls + define MODPNG14_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined + added type casting to all modpng14_malloc() function calls version 0.99a [January 31, 1998] Added type casts and parentheses to all returns that return a value.(Tim W.) version 0.99b [February 4, 1998] - Added type cast png_uint_32 on malloc function calls where needed. - Changed type of num_hist from png_uint_32 to int (same as num_palette). - Added checks for rowbytes overflow, in case png_size_t is less than 32 bits. + Added type cast modpng14_uint_32 on malloc function calls where needed. + Changed type of num_hist from modpng14_uint_32 to int (same as num_palette). + Added checks for rowbytes overflow, in case modpng14_size_t is less than 32 bits. Renamed makefile.elf to makefile.lnx. version 0.99c [February 7, 1998] More type casting. Removed erroneous overflow test in pngmem.c. - Added png_buffered_memcpy() and png_buffered_memset(), apply them to rowbytes. - Added UNIX manual pages libpng.3 (incorporating libpng.txt) and png.5. + Added modpng14_buffered_memcpy() and modpng14_buffered_memset(), apply them to rowbytes. + Added UNIX manual pages libmodpng14.3 (incorporating libmodpng14.txt) and png.5. version 0.99d [February 11, 1998] - Renamed "far_to_near()" "png_far_to_near()" - Revised libpng.3 + Renamed "far_to_near()" "modpng14_far_to_near()" + Revised libmodpng14.3 Version 99c "buffered" operations didn't work as intended. Replaced them - with png_memcpy_check() and png_memset_check(). - Added many "if (png_ptr == NULL) return" to quell compiler warnings about - unused png_ptr, mostly in pngget.c and pngset.c. + with modpng14_memcpy_check() and modpng14_memset_check(). + Added many "if (modpng14_ptr == NULL) return" to quell compiler warnings about + unused modpng14_ptr, mostly in pngget.c and pngset.c. Check for overlength tRNS chunk present when indexed-color PLTE is read. - Cleaned up spelling errors in libpng.3/libpng.txt - Corrected a problem with png_get_tRNS() which returned undefined trans array + Cleaned up spelling errors in libmodpng14.3/libmodpng14.txt + Corrected a problem with modpng14_get_tRNS() which returned undefined trans array version 0.99e [February 28, 1998] - Corrected png_get_tRNS() again. + Corrected modpng14_get_tRNS() again. Add parentheses for easier reading of pngget.c, fixed "||" should be "&&". Touched up example.c to make more of it compileable, although the entire file still can't be compiled (Willem van Schaik) - Fixed a bug in png_do_shift() (Bryan Tsai) - Added a space in png.h prototype for png_write_chunk_start() + Fixed a bug in modpng14_do_shift() (Bryan Tsai) + Added a space in modpng14.h prototype for modpng14_write_chunk_start() Replaced pngtest.png with one created with zlib 1.1.1 Changed pngtest to report PASS even when file size is different (Jean-loup G.) - Corrected some logic errors in png_do_invert_alpha() (Chris Patterson) + Corrected some logic errors in modpng14_do_invert_alpha() (Chris Patterson) version 0.99f [March 5, 1998] Corrected a bug in pngpread() introduced in version 99c (Kevin Bracey) Moved makefiles into a "scripts" directory, and added INSTALL instruction file Added makefile.os2 and pngos2.def (A. Zabolotny) and makefile.s2x (W. Sebok) - Added pointers to "note on libpng versions" in makefile.lnx and README + Added pointers to "note on libmodpng14 versions" in makefile.lnx and README Added row callback feature when reading and writing nonprogressive rows and added a test of this feature in pngtest.c Added user transform callbacks, with test of the feature in pngtest.c @@ -259,8 +259,8 @@ Removed "beta" language from documentation. version 0.99h [March 6, 1998, evening] Minor changes to previous minor changes to pngtest.c - Changed PNG_READ_NOT_FULLY_SUPPORTED to PNG_READ_TRANSFORMS_NOT_SUPPORTED - and added PNG_PROGRESSIVE_READ_NOT_SUPPORTED macro + Changed MODPNG14_READ_NOT_FULLY_SUPPORTED to MODPNG14_READ_TRANSFORMS_NOT_SUPPORTED + and added MODPNG14_PROGRESSIVE_READ_NOT_SUPPORTED macro Added user transform capability version 1.00 [March 7, 1998] Changed several typedefs in pngrutil.c @@ -277,78 +277,78 @@ version 1.0.0a [March 9, 1998] Fixed three bugs in pngrtran.c to make gamma+background handling consistent (Greg Roelofs) - Changed format of the PNG_LIBPNG_VER integer to xyyzz instead of xyz + Changed format of the MODPNG14_LIBMODPNG14_VER integer to xyyzz instead of xyz for major, minor, and bugfix releases. This is 10001. (Adam Costello, Tom Lane) - Make months range from 1-12 in png_convert_to_rfc1123 + Make months range from 1-12 in modpng14_convert_to_rfc1123 version 1.0.0b [March 13, 1998] Quieted compiler complaints about two empty "for" loops in pngrutil.c Minor changes to makefile.s2x - Removed #ifdef/#endif around a png_free() in pngread.c + Removed #ifdef/#endif around a modpng14_free() in pngread.c version 1.0.1 [March 14, 1998] Changed makefile.s2x to reduce security risk of using a relative pathname Fixed some typos in the documentation (Greg). - Fixed a problem with value of "channels" returned by png_read_update_info() + Fixed a problem with value of "channels" returned by modpng14_read_update_info() version 1.0.1a [April 21, 1998] Optimized Paeth calculations by replacing abs() function calls with intrinsics plus other loop optimizations. Improves avg decoding speed by about 20%. Commented out i386istic "align" compiler flags in makefile.lnx. Reduced the default warning level in some makefiles, to make them consistent. Removed references to IJG and JPEG in the ansi2knr.c copyright statement. - Fixed a bug in png_do_strip_filler with XXRRGGBB => RRGGBB transformation. - Added grayscale and 16-bit capability to png_do_read_filler(). + Fixed a bug in modpng14_do_strip_filler with XXRRGGBB => RRGGBB transformation. + Added grayscale and 16-bit capability to modpng14_do_read_filler(). Fixed a bug in pngset.c, introduced in version 0.99c, that sets rowbytes too large when writing an image with bit_depth < 8 (Bob Dellaca). Corrected some bugs in the experimental weighted filtering heuristics. Moved a misplaced pngrutil code block that truncates tRNS if it has more than num_palette entries -- test was done before num_palette was defined. - Fixed a png_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins). + Fixed a modpng14_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins). Changed compiler flags in makefile.wat for better optimization (Pawel Mrochen). version 1.0.1b [May 2, 1998] - Relocated png_do_gray_to_rgb() within png_do_read_transformations() (Greg). - Relocated the png_composite macros from pngrtran.c to png.h (Greg). + Relocated modpng14_do_gray_to_rgb() within modpng14_do_read_transformations() (Greg). + Relocated the modpng14_composite macros from pngrtran.c to modpng14.h (Greg). Added makefile.sco (contributed by Mike Hopkirk). - Fixed two bugs (missing definitions of "istop") introduced in libpng-1.0.1a. + Fixed two bugs (missing definitions of "istop") introduced in libmodpng14-1.0.1a. Fixed a bug in pngrtran.c that would set channels=5 under some circumstances. More work on the Paeth-filtering, achieving imperceptible speedup (A Kleinert). More work on loop optimization which may help when compiled with C++ compilers. Added warnings when people try to use transforms they've defined out. Collapsed 4 "i" and "c" loops into single "i" loops in pngrtran and pngwtran. - Revised paragraph about png_set_expand() in libpng.txt and libpng.3 (Greg) + Revised paragraph about modpng14_set_expand() in libmodpng14.txt and libmodpng14.3 (Greg) version 1.0.1c [May 11, 1998] - Fixed a bug in pngrtran.c (introduced in libpng-1.0.1a) where the masks for + Fixed a bug in pngrtran.c (introduced in libmodpng14-1.0.1a) where the masks for filler bytes should have been 0xff instead of 0xf. Added max_pixel_depth=32 in pngrutil.c when using FILLER with palette images. - Moved PNG_WRITE_WEIGHTED_FILTER_SUPPORTED and PNG_WRITE_FLUSH_SUPPORTED - out of the PNG_WRITE_TRANSFORMS_NOT_SUPPORTED block of pngconf.h - Added "PNG_NO_WRITE_TRANSFORMS" etc., as alternatives for *_NOT_SUPPORTED, - for consistency, in pngconf.h - Added individual "ifndef PNG_NO_[CAPABILITY]" in pngconf.h to make it easier + Moved MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED and MODPNG14_WRITE_FLUSH_SUPPORTED + out of the MODPNG14_WRITE_TRANSFORMS_NOT_SUPPORTED block of modpng14conf.h + Added "MODPNG14_NO_WRITE_TRANSFORMS" etc., as alternatives for *_NOT_SUPPORTED, + for consistency, in modpng14conf.h + Added individual "ifndef MODPNG14_NO_[CAPABILITY]" in modpng14conf.h to make it easier to remove unwanted capabilities via the compile line Made some corrections to grammar (which, it's) in documentation (Greg). - Corrected example.c, use of row_pointers in png_write_image(). + Corrected example.c, use of row_pointers in modpng14_write_image(). version 1.0.1d [May 24, 1998] Corrected several statements that used side effects illegally in pngrutil.c and pngtrans.c, that were introduced in version 1.0.1b - Revised png_read_rows() to avoid repeated if-testing for NULL (A Kleinert) - More corrections to example.c, use of row_pointers in png_write_image() - and png_read_rows(). + Revised modpng14_read_rows() to avoid repeated if-testing for NULL (A Kleinert) + More corrections to example.c, use of row_pointers in modpng14_write_image() + and modpng14_read_rows(). Added pngdll.mak and pngdef.pas to scripts directory, contributed by Bob Dellaca, to make a png32bd.dll with Borland C++ 4.5 - Fixed error in example.c with png_set_text: num_text is 3, not 2 (Guido V.) + Fixed error in example.c with modpng14_set_text: num_text is 3, not 2 (Guido V.) Changed several loops from count-down to count-up, for consistency. version 1.0.1e [June 6, 1998] - Revised libpng.txt and libpng.3 description of png_set_read|write_fn(), and - added warnings when people try to set png_read_fn and png_write_fn in + Revised libmodpng14.txt and libmodpng14.3 description of modpng14_set_read|write_fn(), and + added warnings when people try to set modpng14_read_fn and modpng14_write_fn in the same structure. - Added a test such that png_do_gamma will be done when num_trans==0 + Added a test such that modpng14_do_gamma will be done when num_trans==0 for truecolor images that have defined a background. This corrects an - error that was introduced in libpng-0.90 that can cause gamma processing + error that was introduced in libmodpng14-0.90 that can cause gamma processing to be skipped. - Added tests in png.h to include "trans" and "trans_values" in structures - when PNG_READ_BACKGROUND_SUPPORTED or PNG_READ_EXPAND_SUPPORTED is defined. - Add png_free(png_ptr->time_buffer) in png_destroy_read_struct() - Moved png_convert_to_rfc_1123() from pngwrite.c to png.c + Added tests in modpng14.h to include "trans" and "trans_values" in structures + when MODPNG14_READ_BACKGROUND_SUPPORTED or MODPNG14_READ_EXPAND_SUPPORTED is defined. + Add modpng14_free(modpng14_ptr->time_buffer) in modpng14_destroy_read_struct() + Moved modpng14_convert_to_rfc_1123() from pngwrite.c to png.c Added capability for user-provided malloc_fn() and free_fn() functions, and revised pngtest.c to demonstrate their use, replacing the PNGTEST_DEBUG_MEM feature. @@ -356,99 +356,99 @@ version 1.0.2 [June 14, 1998] Fixed two bugs in makefile.bor . version 1.0.2a [December 30, 1998] - Replaced and extended code that was removed from png_set_filler() in 1.0.1a. - Fixed a bug in png_do_filler() that made it fail to write filler bytes in + Replaced and extended code that was removed from modpng14_set_filler() in 1.0.1a. + Fixed a bug in modpng14_do_filler() that made it fail to write filler bytes in the left-most pixel of each row (Kevin Bracey). - Changed "static pngcharp tIME_string" to "static char tIME_string[30]" + Changed "static modpng14.harp tIME_string" to "static char tIME_string[30]" in pngtest.c (Duncan Simpson). Fixed a bug in pngtest.c that caused pngtest to try to write a tIME chunk even when no tIME chunk was present in the source file. Fixed a problem in pngrutil.c: gray_to_rgb didn't always work with 16-bit. - Fixed a problem in png_read_push_finish_row(), which would not skip some + Fixed a problem in modpng14_read_push_finish_row(), which would not skip some passes that it should skip, for images that are less than 3 pixels high. - Interchanged the order of calls to png_do_swap() and png_do_shift() + Interchanged the order of calls to modpng14_do_swap() and modpng14_do_shift() in pngwtran.c (John Cromer). - Added #ifdef PNG_DEBUG/#endif surrounding use of PNG_DEBUG in png.h . + Added #ifdef MODPNG14_DEBUG/#endif surrounding use of MODPNG14_DEBUG in modpng14.h . Changed "bad adaptive filter type" from error to warning in pngrutil.c . Fixed a documentation error about default filtering with 8-bit indexed-color. - Separated the PNG_NO_STDIO macro into PNG_NO_STDIO and PNG_NO_CONSOLE_IO + Separated the MODPNG14_NO_STDIO macro into MODPNG14_NO_STDIO and MODPNG14_NO_CONSOLE_IO (L. Peter Deutsch). - Added png_set_rgb_to_gray() and png_get_rgb_to_gray_status() functions. - Added png_get_copyright() and png_get_header_version() functions. - Revised comments on png_set_progressive_read_fn() in libpng.txt and example.c - Added information about debugging in libpng.txt and libpng.3 . + Added modpng14_set_rgb_to_gray() and modpng14_get_rgb_to_gray_status() functions. + Added modpng14_get_copyright() and modpng14_get_header_version() functions. + Revised comments on modpng14_set_progressive_read_fn() in libmodpng14.txt and example.c + Added information about debugging in libmodpng14.txt and libmodpng14.3 . Changed "ln -sf" to "ln -s -f" in makefile.s2x, makefile.lnx, and makefile.sco. Removed lines after Dynamic Dependencies" in makefile.aco . Revised makefile.dec to make a shared library (Jeremie Petit). Removed trailing blanks from all files. version 1.0.2a [January 6, 1999] - Removed misplaced #endif and #ifdef PNG_NO_EXTERN near the end of png.h - Added "if" tests to silence complaints about unused png_ptr in png.h and png.c + Removed misplaced #endif and #ifdef MODPNG14_NO_EXTERN near the end of modpng14.h + Added "if" tests to silence complaints about unused modpng14_ptr in modpng14.h and png.c Changed "check_if_png" function in example.c to return true (nonzero) if PNG. - Changed libpng.txt to demonstrate png_sig_cmp() instead of png_check_sig() + Changed libmodpng14.txt to demonstrate modpng14_sig_cmp() instead of modpng14_check_sig() which is obsolete. version 1.0.3 [January 14, 1999] Added makefile.hux, for Hewlett Packard HPUX 10.20 and 11.00 (Jim Rice) - Added a statement of Y2K compliance in png.h, libpng.3, and Y2KINFO. + Added a statement of Y2K compliance in modpng14.h, libmodpng14.3, and Y2KINFO. version 1.0.3a [August 12, 1999] - Added check for PNG_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning + Added check for MODPNG14_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning if an attempt is made to read an interlaced image when it's not supported. - Added check if png_ptr->trans is defined before freeing it in pngread.c + Added check if modpng14_ptr->trans is defined before freeing it in pngread.c Modified the Y2K statement to include versions back to version 0.71 Fixed a bug in the check for valid IHDR bit_depth/color_types in pngrutil.c Modified makefile.wat (added -zp8 flag, ".symbolic", changed some comments) Replaced leading blanks with tab characters in makefile.hux Changed "dworkin.wustl.edu" to "ccrc.wustl.edu" in various documents. Changed (float)red and (float)green to (double)red, (double)green - in png_set_rgb_to_gray() to avoid "promotion" problems in AIX. - Fixed a bug in pngconf.h that omitted when PNG_DEBUG==0 (K Bracey). - Reformatted libpng.3 and libpngpf.3 with proper fonts (script by J. vanZandt). + in modpng14_set_rgb_to_gray() to avoid "promotion" problems in AIX. + Fixed a bug in modpng14conf.h that omitted when MODPNG14_DEBUG==0 (K Bracey). + Reformatted libmodpng14.3 and libmodpng14pf.3 with proper fonts (script by J. vanZandt). Updated documentation to refer to the PNG-1.2 specification. Removed ansi2knr.c and left pointers to the latest source for ansi2knr.c in makefile.knr, INSTALL, and README (L. Peter Deutsch) Fixed bugs in calculation of the length of rowbytes when adding alpha channels to 16-bit images, in pngrtran.c (Chris Nokleberg) - Added function png_set_user_transform_info() to store user_transform_ptr, - user_depth, and user_channels into the png_struct, and a function - png_get_user_transform_ptr() to retrieve the pointer (Chris Nokleberg) - Added function png_set_empty_plte_permitted() to make libpng useable + Added function modpng14_set_user_transform_info() to store user_transform_ptr, + user_depth, and user_channels into the modpng14_struct, and a function + modpng14_get_user_transform_ptr() to retrieve the pointer (Chris Nokleberg) + Added function modpng14_set_empty_plte_permitted() to make libmodpng14 useable in MNG applications. - Corrected the typedef for png_free_ptr in png.h (Jesse Jones). + Corrected the typedef for modpng14_free_ptr in modpng14.h (Jesse Jones). Correct gamma with srgb is 45455 instead of 45000 in pngrutil.c, to be consistent with PNG-1.2, and allow variance of 500 before complaining. Added assembler code contributed by Intel in file pngvcrd.c and modified makefile.w32 to use it (Nirav Chhatrapati, INTEL Corporation, Gilles Vollant) Changed "ln -s -f" to "ln -f -s" in the makefiles to make Solaris happy. - Added some aliases for png_set_expand() in pngrtran.c, namely - png_set_expand_PLTE(), png_set_expand_depth(), and png_set_expand_tRNS() + Added some aliases for modpng14_set_expand() in pngrtran.c, namely + modpng14_set_expand_PLTE(), modpng14_set_expand_depth(), and modpng14_set_expand_tRNS() (Greg Roelofs, in "PNG: The Definitive Guide"). Added makefile.beo for BEOS on X86, contributed by Sander Stok. version 1.0.3b [August 26, 1999] - Replaced 2147483647L several places with PNG_MAX_UINT macro, defined in png.h + Replaced 2147483647L several places with MODPNG14_MAX_UINT macro, defined in modpng14.h Changed leading blanks to tabs in all makefiles. - Define PNG_USE_PNGVCRD in makefile.w32, to get MMX assembler code. - Made alternate versions of png_set_expand() in pngrtran.c, namely - png_set_gray_1_2_4_to_8, png_set_palette_to_rgb, and png_set_tRNS_to_alpha + Define MODPNG14_USE_PNGVCRD in makefile.w32, to get MMX assembler code. + Made alternate versions of modpng14_set_expand() in pngrtran.c, namely + modpng14_set_gray_1_2_4_to_8, modpng14_set_palette_to_rgb, and modpng14_set_tRNS_to_alpha (Greg Roelofs, in "PNG: The Definitive Guide"). Deleted the 1.0.3a aliases. - Relocated start of 'extern "C"' block in png.h so it doesn't include pngconf.h + Relocated start of 'extern "C"' block in modpng14.h so it doesn't include modpng14conf.h Revised calculation of num_blocks in pngmem.c to avoid a potentially negative shift distance, whose results are undefined in the C language. Added a check in pngset.c to prevent writing multiple tIME chunks. Added a check in pngwrite.c to detect invalid small window_bits sizes. version 1.0.3d [September 4, 1999] Fixed type casting of igamma in pngrutil.c - Added new png_expand functions to scripts/pngdef.pas and pngos2.def + Added new modpng14_expand functions to scripts/pngdef.pas and pngos2.def Added a demo read_user_transform_fn that examines the row filters in pngtest.c version 1.0.4 [September 24, 1999] - Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined - Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h + Define MODPNG14_ALWAYS_EXTERN in modpng14conf.h if __STDC__ is defined + Delete #define MODPNG14_INTERNAL and include "modpng14.h" from pngasmrd.h Made several minor corrections to pngtest.c Renamed the makefiles with longer but more user friendly extensions. Copied the PNG copyright and license to a separate LICENSE file. - Revised documentation, png.h, and example.c to remove reference to + Revised documentation, modpng14.h, and example.c to remove reference to "viewing_gamma" which no longer appears in the PNG specification. Revised pngvcrd.c to use MMX code for interlacing only on the final pass. - Updated pngvcrd.c to use the faster C filter algorithms from libpng-1.0.1a + Updated pngvcrd.c to use the faster C filter algorithms from libmodpng14-1.0.1a Split makefile.win32vc into two versions, makefile.vcawin32 (uses MMX assembler code) and makefile.vcwin32 (doesn't). Added a CPU timing report to pngtest.c (enabled by defining PNGTEST_TIMING) @@ -460,20 +460,20 @@ Added parentheses in line 3732 of pngvcrd.c Added a comment in makefile.linux warning about buggy -O3 in pgcc 2.95.1 version 1.0.4c [October 1, 1999] - Added a "png_check_version" function in png.c and pngtest.c that will generate - a helpful compiler error if an old png.h is found in the search path. - Changed type of png_user_transform_depth|channels from int to png_byte. + Added a "modpng14_check_version" function in png.c and pngtest.c that will generate + a helpful compiler error if an old modpng14.h is found in the search path. + Changed type of modpng14_user_transform_depth|channels from int to modpng14_byte. version 1.0.4d [October 6, 1999] - Changed 0.45 to 0.45455 in png_set_sRGB() + Changed 0.45 to 0.45455 in modpng14_set_sRGB() Removed unused PLTE entries from pngnow.png - Re-enabled some parts of pngvcrd.c (png_combine_row) that work properly. + Re-enabled some parts of pngvcrd.c (modpng14_combine_row) that work properly. version 1.0.4e [October 10, 1999] Fixed sign error in pngvcrd.c (Greg Roelofs) Replaced some instances of memcpy with simple assignments in pngvcrd (GR-P) version 1.0.4f [October 15, 1999] Surrounded example.c code with #if 0 .. #endif to prevent people from inadvertently trying to compile it. - Changed png_get_header_version() from a function to a macro in png.h + Changed modpng14_get_header_version() from a function to a macro in modpng14.h Added type casting mostly in pngrtran.c and pngwtran.c Removed some pointless "ptr = NULL" in pngmem.c Added a "contrib" directory containing the source code from Greg's book. @@ -481,129 +481,129 @@ Minor editing of the INSTALL and README files. version 1.0.5a [October 23, 1999] Added contrib/pngsuite and contrib/pngminus (Willem van Schaik) - Fixed a typo in the png_set_sRGB() function call in example.c (Jan Nijtmans) + Fixed a typo in the modpng14_set_sRGB() function call in example.c (Jan Nijtmans) Further optimization and bugfix of pngvcrd.c Revised pngset.c so that it does not allocate or free memory in the user's text_ptr structure. Instead, it makes its own copy. Created separate write_end_info_struct in pngtest.c for a more severe test. Added code in pngwrite.c to free info_ptr->text[i].key to stop a memory leak. version 1.0.5b [November 23, 1999] - Moved PNG_FLAG_HAVE_CHUNK_HEADER, PNG_FLAG_BACKGROUND_IS_GRAY and - PNG_FLAG_WROTE_tIME from flags to mode. - Added png_write_info_before_PLTE() function. + Moved MODPNG14_FLAG_HAVE_CHUNK_HEADER, MODPNG14_FLAG_BACKGROUND_IS_GRAY and + MODPNG14_FLAG_WROTE_tIME from flags to mode. + Added modpng14_write_info_before_PLTE() function. Fixed some typecasting in contrib/gregbook/*.c Updated scripts/makevms.com and added makevms.com to contrib/gregbook and contrib/pngminus (Martin Zinser) version 1.0.5c [November 26, 1999] - Moved png_get_header_version from png.h to png.c, to accomodate ansi2knr. - Removed all global arrays (according to PNG_NO_GLOBAL_ARRAYS macro), to - accomodate making DLL's: Moved usr_png_ver from global variable to function - png_get_header_ver() in png.c. Moved png_sig to png_sig_bytes in png.c and - eliminated use of png_sig in pngwutil.c. Moved the various png_CHNK arrays - into pngtypes.h. Eliminated use of global png_pass arrays. Declared the - png_CHNK and png_pass arrays to be "const". Made the global arrays - available to applications (although none are used in libpng itself) when - PNG_NO_GLOBAL_ARRAYS is not defined or when PNG_GLOBAL_ARRAYS is defined. + Moved modpng14_get_header_version from modpng14.h to png.c, to accomodate ansi2knr. + Removed all global arrays (according to MODPNG14_NO_GLOBAL_ARRAYS macro), to + accomodate making DLL's: Moved usr_modpng14_ver from global variable to function + modpng14_get_header_ver() in png.c. Moved modpng14_sig to modpng14_sig_bytes in png.c and + eliminated use of modpng14_sig in pngwutil.c. Moved the various modpng14_CHNK arrays + into pngtypes.h. Eliminated use of global modpng14_pass arrays. Declared the + modpng14_CHNK and modpng14_pass arrays to be "const". Made the global arrays + available to applications (although none are used in libmodpng14 itself) when + MODPNG14_NO_GLOBAL_ARRAYS is not defined or when MODPNG14_GLOBAL_ARRAYS is defined. Removed some extraneous "-I" from contrib/pngminus/makefile.std - Changed the PNG_sRGB_INTENT macros in png.h to be consistent with PNG-1.2. - Change PNG_SRGB_INTENT to PNG_sRGB_INTENT in libpng.txt and libpng.3 + Changed the MODPNG14_sRGB_INTENT macros in modpng14.h to be consistent with PNG-1.2. + Change MODPNG14_SRGB_INTENT to MODPNG14_sRGB_INTENT in libmodpng14.txt and libmodpng14.3 version 1.0.5d [November 29, 1999] - Add type cast (png_const_charp) two places in png.c - Eliminated pngtypes.h; use macros instead to declare PNG_CHNK arrays. - Renamed "PNG_GLOBAL_ARRAYS" to "PNG_USE_GLOBAL_ARRAYS" and made available - to applications a macro "PNG_USE_LOCAL_ARRAYS". - #ifdef out all the new declarations when PNG_USE_GLOBAL_ARRAYS is defined. - Added PNG_EXPORT_VAR macro to accommodate making DLL's. + Add type cast (modpng14_const_charp) two places in png.c + Eliminated pngtypes.h; use macros instead to declare MODPNG14_CHNK arrays. + Renamed "MODPNG14_GLOBAL_ARRAYS" to "MODPNG14_USE_GLOBAL_ARRAYS" and made available + to applications a macro "MODPNG14_USE_LOCAL_ARRAYS". + #ifdef out all the new declarations when MODPNG14_USE_GLOBAL_ARRAYS is defined. + Added MODPNG14_EXPORT_VAR macro to accommodate making DLL's. version 1.0.5e [November 30, 1999] - Added iCCP, iTXt, and sPLT support; added "lang" member to the png_text + Added iCCP, iTXt, and sPLT support; added "lang" member to the modpng14_text structure; refactored the inflate/deflate support to make adding new chunks with trailing compressed parts easier in the future, and added new functions - png_free_iCCP, png_free_pCAL, png_free_sPLT, png_free_text, png_get_iCCP, - png_get_spalettes, png_set_iCCP, png_set_spalettes (Eric S. Raymond). - NOTE: Applications that write text chunks MUST define png_text->lang - before calling png_set_text(). It must be set to NULL if you want to + modpng14_free_iCCP, modpng14_free_pCAL, modpng14_free_sPLT, modpng14_free_text, modpng14_get_iCCP, + modpng14_get_spalettes, modpng14_set_iCCP, modpng14_set_spalettes (Eric S. Raymond). + NOTE: Applications that write text chunks MUST define modpng14_text->lang + before calling modpng14_set_text(). It must be set to NULL if you want to write tEXt or zTXt chunks. If you want your application to be able to - run with older versions of libpng, use + run with older versions of libmodpng14, use - #ifdef PNG_iTXt_SUPPORTED - png_text[i].lang = NULL; + #ifdef MODPNG14_iTXt_SUPPORTED + modpng14_text[i].lang = NULL; #endif - Changed png_get_oFFs() and png_set_oFFs() to use signed rather than unsigned + Changed modpng14_get_oFFs() and modpng14_set_oFFs() to use signed rather than unsigned offsets (Eric S. Raymond). - Combined PNG_READ_cHNK_SUPPORTED and PNG_WRITE_cHNK_SUPPORTED macros into - PNG_cHNK_SUPPORTED and combined the three types of PNG_text_SUPPORTED + Combined MODPNG14_READ_cHNK_SUPPORTED and MODPNG14_WRITE_cHNK_SUPPORTED macros into + MODPNG14_cHNK_SUPPORTED and combined the three types of MODPNG14_text_SUPPORTED macros, leaving the separate macros also available. Removed comments on #endifs at the end of many short, non-nested #if-blocks. version 1.0.5f [December 6, 1999] Changed makefile.solaris to issue a warning about potential problems when the ucb "ld" is in the path ahead of the ccs "ld". - Removed "- [date]" from the "synopsis" line in libpng.3 and libpngpf.3. + Removed "- [date]" from the "synopsis" line in libmodpng14.3 and libmodpng14pf.3. Added sCAL chunk support (Eric S. Raymond). version 1.0.5g [December 7, 1999] - Fixed "png_free_spallettes" typo in png.h + Fixed "modpng14_free_spallettes" typo in modpng14.h Added code to handle new chunks in pngpread.c - Moved PNG_CHNK string macro definitions outside of PNG_NO_EXTERN block - Added "translated_key" to png_text structure and png_write_iTXt(). + Moved MODPNG14_CHNK string macro definitions outside of MODPNG14_NO_EXTERN block + Added "translated_key" to modpng14_text structure and modpng14_write_iTXt(). Added code in pngwrite.c to work around a newly discovered zlib bug. version 1.0.5h [December 10, 1999] NOTE: regarding the note for version 1.0.5e, the following must also be included in your code: - png_text[i].translated_key = NULL; + modpng14_text[i].translated_key = NULL; Unknown chunk handling is now supported. Option to eliminate all floating point support was added. Some new - fixed-point functions such as png_set_gAMA_fixed() were added. + fixed-point functions such as modpng14_set_gAMA_fixed() were added. Expanded tabs and removed trailing blanks in source files. version 1.0.5i [December 13, 1999] Added some type casts to silence compiler warnings. - Renamed "png_free_spalette" to "png_free_spalettes" for consistency. + Renamed "modpng14_free_spalette" to "modpng14_free_spalettes" for consistency. Removed leading blanks from a #define in pngvcrd.c - Added some parameters to the new png_set_keep_unknown_chunks() function. + Added some parameters to the new modpng14_set_keep_unknown_chunks() function. Added a test for up->location != 0 in the first instance of writing unknown chunks in pngwrite.c - Changed "num" to "i" in png_free_spalettes() and png_free_unknowns() to + Changed "num" to "i" in modpng14_free_spalettes() and modpng14_free_unknowns() to prevent recursion. - Added png_free_hIST() function. + Added modpng14_free_hIST() function. Various patches to fix bugs in the sCAL and integer cHRM processing, and to add some convenience macros for use with sCAL. version 1.0.5j [December 21, 1999] - Changed "unit" parameter of png_write_sCAL from png_byte to int, to work + Changed "unit" parameter of modpng14_write_sCAL from modpng14_byte to int, to work around buggy compilers. - Added new type "png_fixed_point" for integers that hold float*100000 values + Added new type "modpng14_fixed_point" for integers that hold float*100000 values Restored backward compatibility of tEXt/zTXt chunk processing: - Restored the first four members of png_text to the same order as v.1.0.5d. - Added members "lang_key" and "itxt_length" to png_text struct. Set + Restored the first four members of modpng14_text to the same order as v.1.0.5d. + Added members "lang_key" and "itxt_length" to modpng14_text struct. Set text_length=0 when "text" contains iTXt data. Use the "compression" member to distinguish among tEXt/zTXt/iTXt types. Added - PNG_ITXT_COMPRESSION_NONE (1) and PNG_ITXT_COMPRESSION_zTXt(2) macros. - The "Note" above, about backward incompatibility of libpng-1.0.5e, no + MODPNG14_ITXT_COMPRESSION_NONE (1) and MODPNG14_ITXT_COMPRESSION_zTXt(2) macros. + The "Note" above, about backward incompatibility of libmodpng14-1.0.5e, no longer applies. - Fixed png_read|write_iTXt() to read|write parameters in the right order, + Fixed modpng14_read|write_iTXt() to read|write parameters in the right order, and to write the iTXt chunk after IDAT if it appears in the end_ptr. Added pnggccrd.c, version of pngvcrd.c Intel assembler for gcc (Greg Roelofs) Reversed the order of trying to write floating-point and fixed-point gAMA. version 1.0.5k [December 27, 1999] Added many parentheses, e.g., "if (a && b & c)" becomes "if (a && (b & c))" - Added png_handle_as_unknown() function (Glenn) - Added png_free_chunk_list() function and chunk_list and num_chunk_list members - of png_ptr. + Added modpng14_handle_as_unknown() function (Glenn) + Added modpng14_free_chunk_list() function and chunk_list and num_chunk_list members + of modpng14_ptr. Eliminated erroneous warnings about multiple sPLT chunks and sPLT-after-PLTE. - Fixed a libpng-1.0.5h bug in pngrutil.c that was issuing erroneous warnings + Fixed a libmodpng14-1.0.5h bug in pngrutil.c that was issuing erroneous warnings about ignoring incorrect gAMA with sRGB (gAMA was in fact not ignored) - Added png_free_tRNS(); png_set_tRNS() now malloc's its own trans array (ESR). - Define png_get_int_32 when oFFs chunk is supported as well as when pCAL is. - Changed type of proflen from png_int_32 to png_uint_32 in png_get_iCCP(). + Added modpng14_free_tRNS(); modpng14_set_tRNS() now malloc's its own trans array (ESR). + Define modpng14_get_int_32 when oFFs chunk is supported as well as when pCAL is. + Changed type of proflen from modpng14_int_32 to modpng14_uint_32 in modpng14_get_iCCP(). version 1.0.5l [January 1, 2000] - Added functions png_set_read_user_chunk_fn() and png_get_user_chunk_ptr() + Added functions modpng14_set_read_user_chunk_fn() and modpng14_get_user_chunk_ptr() for setting a callback function to handle unknown chunks and for retrieving the associated user pointer (Glenn). version 1.0.5m [January 7, 2000] - Added high-level functions png_read_png(), png_write_png(), png_free_pixels(). + Added high-level functions modpng14_read_png(), modpng14_write_png(), modpng14_free_pixels(). version 1.0.5n [January 9, 2000] - Added png_free_PLTE() function, and modified png_set_PLTE() to malloc its + Added modpng14_free_PLTE() function, and modified modpng14_set_PLTE() to malloc its own memory for info_ptr->palette. This makes it safe for the calling application to free its copy of the palette any time after it calls - png_set_PLTE(). + modpng14_set_PLTE(). version 1.0.5o [January 20, 2000] Cosmetic changes only (removed some trailing blanks and TABs) version 1.0.5p [January 31, 2000] @@ -613,198 +613,198 @@ Relocated the makefile.solaris warning about PATH problems. Fixed pngvcrd.c bug by pushing/popping registers in mmxsupport (Bruce Oberg) Revised makefile.gcmmx - Added PNG_SETJMP_SUPPORTED, PNG_SETJMP_NOT_SUPPORTED, and PNG_ABORT() macros + Added MODPNG14_SETJMP_SUPPORTED, MODPNG14_SETJMP_NOT_SUPPORTED, and MODPNG14_ABORT() macros version 1.0.5r [February 7, 2000] - Removed superfluous prototype for png_get_itxt from png.h + Removed superfluous prototype for modpng14_get_itxt from modpng14.h Fixed a bug in pngrtran.c that improperly expanded the background color. - Return *num_text=0 from png_get_text() when appropriate, and fix documentation - of png_get_text() in libpng.txt/libpng.3. + Return *num_text=0 from modpng14_get_text() when appropriate, and fix documentation + of modpng14_get_text() in libmodpng14.txt/libmodpng14.3. version 1.0.5s [February 18, 2000] - Added "png_jmp_env()" macro to pngconf.h, to help people migrate to the - new error handler that's planned for the next libpng release, and changed + Added "modpng14_jmp_env()" macro to modpng14conf.h, to help people migrate to the + new error handler that's planned for the next libmodpng14 release, and changed example.c, pngtest.c, and contrib programs to use this macro. - Revised some of the DLL-export macros in pngconf.h (Greg Roelofs) - Fixed a bug in png_read_png() that caused it to fail to expand some images + Revised some of the DLL-export macros in modpng14conf.h (Greg Roelofs) + Fixed a bug in modpng14_read_png() that caused it to fail to expand some images that it should have expanded. Fixed some mistakes in the unused and undocumented INCH_CONVERSIONS functions in pngget.c Changed the allocation of palette, history, and trans arrays back to the version 1.0.5 method (linking instead of copying) which restores backward compatibility with version 1.0.5. Added some remarks about - that in example.c. Added "free_me" member to info_ptr and png_ptr - and added png_free_data() function. + that in example.c. Added "free_me" member to info_ptr and modpng14_ptr + and added modpng14_free_data() function. Updated makefile.linux and makefile.gccmmx to make directories conditionally. Made cosmetic changes to pngasmrd.h - Added png_set_rows() and png_get_rows(), for use with png_read|write_png(). - Modified png_read_png() to allocate info_ptr->row_pointers only if it + Added modpng14_set_rows() and modpng14_get_rows(), for use with modpng14_read|write_png(). + Modified modpng14_read_png() to allocate info_ptr->row_pointers only if it hasn't already been allocated. version 1.0.5t [March 4, 2000] - Changed png_jmp_env() migration aiding macro to png_jmpbuf(). + Changed modpng14_jmp_env() migration aiding macro to modpng14_jmpbuf(). Fixed "interlace" typo (should be "interlaced") in contrib/gregbook/read2-x.c - Fixed bug with use of PNG_BEFORE_IHDR bit in png_ptr->mode, introduced when - PNG_FLAG_HAVE_CHUNK_HEADER was moved into png_ptr->mode in version 1.0.5b - Files in contrib/gregbook were revised to use png_jmpbuf() and to select + Fixed bug with use of MODPNG14_BEFORE_IHDR bit in modpng14_ptr->mode, introduced when + MODPNG14_FLAG_HAVE_CHUNK_HEADER was moved into modpng14_ptr->mode in version 1.0.5b + Files in contrib/gregbook were revised to use modpng14_jmpbuf() and to select a 24-bit visual if one is available, and to allow abbreviated options. - Files in contrib/pngminus were revised to use the png_jmpbuf() macro. + Files in contrib/pngminus were revised to use the modpng14_jmpbuf() macro. Removed spaces in makefile.linux and makefile.gcmmx, introduced in 1.0.5s version 1.0.5u [March 5, 2000] - Simplified the code that detects old png.h in png.c and pngtest.c - Renamed png_spalette (_p, _pp) to png_sPLT_t (_tp, _tpp) + Simplified the code that detects old modpng14.h in png.c and pngtest.c + Renamed modpng14_spalette (_p, _pp) to modpng14_sPLT_t (_tp, _tpp) Increased precision of rgb_to_gray calculations from 8 to 15 bits and - added png_set_rgb_to_gray_fixed() function. + added modpng14_set_rgb_to_gray_fixed() function. Added makefile.bc32 (32-bit Borland C++, C mode) version 1.0.5v [March 11, 2000] - Added some parentheses to the png_jmpbuf macro definition. + Added some parentheses to the modpng14_jmpbuf macro definition. Updated references to the zlib home page, which has moved to freesoftware.com. - Corrected bugs in documentation regarding png_read_row() and png_write_row(). - Updated documentation of png_rgb_to_gray calculations in libpng.3/libpng.txt. + Corrected bugs in documentation regarding modpng14_read_row() and modpng14_write_row(). + Updated documentation of modpng14_rgb_to_gray calculations in libmodpng14.3/libmodpng14.txt. Renamed makefile.borland,turboc3 back to makefile.bor,tc3 as in version 1.0.3, revised borland makefiles; added makefile.ibmvac3 and makefile.gcc (Cosmin) version 1.0.6 [March 20, 2000] - Minor revisions of makefile.bor, libpng.txt, and gregbook/rpng2-win.c + Minor revisions of makefile.bor, libmodpng14.txt, and gregbook/rpng2-win.c Added makefile.sggcc (SGI IRIX with gcc) version 1.0.6d [April 7, 2000] - Changed sprintf() to strcpy() in png_write_sCAL_s() to work without STDIO - Added data_length parameter to png_decompress_chunk() function - Revised documentation to remove reference to abandoned png_free_chnk functions - Fixed an error in png_rgb_to_gray_fixed() - Revised example.c, usage of png_destroy_write_struct(). - Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file - Added a check for info_ptr->free_me&PNG_FREE_TEXT when freeing text in png.c - Simplify png_sig_bytes() function to remove use of non-ISO-C strdup(). + Changed sprintf() to strcpy() in modpng14_write_sCAL_s() to work without STDIO + Added data_length parameter to modpng14_decompress_chunk() function + Revised documentation to remove reference to abandoned modpng14_free_chnk functions + Fixed an error in modpng14_rgb_to_gray_fixed() + Revised example.c, usage of modpng14_destroy_write_struct(). + Renamed makefile.ibmvac3 to makefile.ibmc, added libmodpng14.icc IBM project file + Added a check for info_ptr->free_me&MODPNG14_FREE_TEXT when freeing text in png.c + Simplify modpng14_sig_bytes() function to remove use of non-ISO-C strdup(). version 1.0.6e [April 9, 2000] - Added png_data_freer() function. + Added modpng14_data_freer() function. In the code that checks for over-length tRNS chunks, added check of - info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann) - Minor revisions of libpng.txt/libpng.3. - Check for existing data and free it if the free_me flag is set, in png_set_*() - and png_handle_*(). - Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED + info_ptr->num_trans as well as modpng14_ptr->num_trans (Matthias Benckmann) + Minor revisions of libmodpng14.txt/libmodpng14.3. + Check for existing data and free it if the free_me flag is set, in modpng14_set_*() + and modpng14_handle_*(). + Only define MODPNG14_WEIGHTED_FILTERS_SUPPORTED when MODPNG14_FLOATING_POINT_SUPPORTED is defined. - Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c - and mentioned the purposes of the two macros in libpng.txt/libpng.3. + Changed several instances of MODPNG14_NO_CONSOLE_ID to MODPNG14_NO_STDIO in pngrutil.c + and mentioned the purposes of the two macros in libmodpng14.txt/libmodpng14.3. version 1.0.6f [April 14, 2000] - Revised png_set_iCCP() and png_set_rows() to avoid prematurely freeing data. - Add checks in png_set_text() for NULL members of the input text structure. - Revised libpng.txt/libpng.3. - Removed superfluous prototype for png_set_itxt from png.h - Removed "else" from pngread.c, after png_error(), and changed "0" to "length". - Changed several png_errors about malformed ancillary chunks to png_warnings. + Revised modpng14_set_iCCP() and modpng14_set_rows() to avoid prematurely freeing data. + Add checks in modpng14_set_text() for NULL members of the input text structure. + Revised libmodpng14.txt/libmodpng14.3. + Removed superfluous prototype for modpng14_set_itxt from modpng14.h + Removed "else" from pngread.c, after modpng14_error(), and changed "0" to "length". + Changed several modpng14_errors about malformed ancillary chunks to modpng14_warnings. version 1.0.6g [April 24, 2000] - Added png_pass-* arrays to pnggccrd.c when PNG_USE_LOCAL_ARRAYS is defined. - Relocated paragraph about png_set_background() in libpng.3/libpng.txt + Added modpng14_pass-* arrays to pnggccrd.c when MODPNG14_USE_LOCAL_ARRAYS is defined. + Relocated paragraph about modpng14_set_background() in libmodpng14.3/libmodpng14.txt and other revisions (Matthias Benckmann) - Relocated info_ptr->free_me, png_ptr->free_me, and other info_ptr and - png_ptr members to restore binary compatibility with libpng-1.0.5 - (breaks compatibility with libpng-1.0.6). + Relocated info_ptr->free_me, modpng14_ptr->free_me, and other info_ptr and + modpng14_ptr members to restore binary compatibility with libmodpng14-1.0.5 + (breaks compatibility with libmodpng14-1.0.6). version 1.0.6h [April 24, 2000] Changed shared library so-number pattern from 2.x.y.z to xy.z (this builds - libpng.so.10 & libpng.so.10.6h instead of libpng.so.2 & libpng.so.2.1.0.6h) + libmodpng14.so.10 & libmodpng14.so.10.6h instead of libmodpng14.so.2 & libmodpng14.so.2.1.0.6h) This is a temporary change for test purposes. version 1.0.6i [May 2, 2000] - Rearranged some members at the end of png_info and png_struct, to put - unknown_chunks_num and free_me within the original size of the png_structs - and free_me, png_read_user_fn, and png_free_fn within the original png_info, + Rearranged some members at the end of modpng14_info and modpng14_struct, to put + unknown_chunks_num and free_me within the original size of the modpng14_structs + and free_me, modpng14_read_user_fn, and modpng14_free_fn within the original modpng14_info, because some old applications allocate the structs directly instead of - using png_create_*(). - Added documentation of user memory functions in libpng.txt/libpng.3 - Modified png_read_png so that it will use user_allocated row_pointers + using modpng14_create_*(). + Added documentation of user memory functions in libmodpng14.txt/libmodpng14.3 + Modified modpng14_read_png so that it will use user_allocated row_pointers if present, unless free_me directs that it be freed, and added description - of the use of png_set_rows() and png_get_rows() in libpng.txt/libpng.3. - Added PNG_LEGACY_SUPPORTED macro, and #ifdef out all new (since version - 1.00) members of png_struct and png_info, to regain binary compatibility + of the use of modpng14_set_rows() and modpng14_get_rows() in libmodpng14.txt/libmodpng14.3. + Added MODPNG14_LEGACY_SUPPORTED macro, and #ifdef out all new (since version + 1.00) members of modpng14_struct and modpng14_info, to regain binary compatibility when you define this macro. Capabilities lost in this event are user transforms (new in version 1.0.0),the user transform pointer (new in version 1.0.2), rgb_to_gray (new in 1.0.5), iCCP, sCAL, sPLT, the high-level interface, and unknown chunks support (all new in 1.0.6). This was necessary because of old applications that allocate the structs - directly as authors were instructed to do in libpng-0.88 and earlier, - instead of using png_create_*(). - Added modes PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT which + directly as authors were instructed to do in libmodpng14-0.88 and earlier, + instead of using modpng14_create_*(). + Added modes MODPNG14_CREATED_READ_STRUCT and MODPNG14_CREATED_WRITE_STRUCT which can be used to detect codes that directly allocate the structs, and - code to check these modes in png_read_init() and png_write_init() and - generate a libpng error if the modes aren't set and PNG_LEGACY_SUPPORTED + code to check these modes in modpng14_read_init() and modpng14_write_init() and + generate a libmodpng14 error if the modes aren't set and MODPNG14_LEGACY_SUPPORTED was not defined. Added makefile.intel and updated makefile.watcom (Pawel Mrochen) version 1.0.6j [May 3, 2000] - Overloaded png_read_init() and png_write_init() with macros that convert - calls to png_read_init_2() or png_write_init_2() that check the version + Overloaded modpng14_read_init() and modpng14_write_init() with macros that convert + calls to modpng14_read_init_2() or modpng14_write_init_2() that check the version and structure sizes. version 1.0.7beta11 [May 7, 2000] - Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes + Removed the new MODPNG14_CREATED_READ_STRUCT and MODPNG14_CREATED_WRITE_STRUCT modes which are no longer used. - Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is - defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED + Eliminated the three new members of modpng14_text when MODPNG14_LEGACY_SUPPORTED is + defined or when neither MODPNG14_READ_iTXt_SUPPORTED nor MODPNG14_WRITE_iTXT_SUPPORTED is defined. - Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory + Made MODPNG14_NO_READ|WRITE_iTXt the default setting, to avoid memory overrun when old applications fill the info_ptr->text structure directly. - Added PNGAPI macro, and added it to the definitions of all exported functions. + Added MODPNG14API macro, and added it to the definitions of all exported functions. Relocated version macro definitions ahead of the includes of zlib.h and - pngconf.h in png.h. + modpng14conf.h in modpng14.h. version 1.0.7beta12 [May 12, 2000] - Revised pngset.c to avoid a problem with expanding the png_debug macro. - Deleted some extraneous defines from pngconf.h - Made PNG_NO_CONSOLE_IO the default condition when PNG_BUILD_DLL is defined. + Revised pngset.c to avoid a problem with expanding the modpng14_debug macro. + Deleted some extraneous defines from modpng14conf.h + Made MODPNG14_NO_CONSOLE_IO the default condition when MODPNG14_BUILD_DLL is defined. Use MSC _RPTn debugging instead of fprintf if _MSC_VER is defined. - Added png_access_version_number() function. - Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data(). - Expanded libpng.3/libpng.txt information about png_data_freer(). + Added modpng14_access_version_number() function. + Check for mask&MODPNG14_FREE_CHNK (for TEXT, SCAL, PCAL) in modpng14_free_data(). + Expanded libmodpng14.3/libmodpng14.txt information about modpng14_data_freer(). version 1.0.7beta14 [May 17, 2000] (beta13 was not published) Changed pnggccrd.c and pngvcrd.c to handle bad adaptive filter types as warnings instead of errors, as pngrutil.c does. - Set the PNG_INFO_IDAT valid flag in png_set_rows() so png_write_png() + Set the MODPNG14_INFO_IDAT valid flag in modpng14_set_rows() so modpng14_write_png() will actually write IDATs. - Made the default PNG_USE_LOCAL_ARRAYS depend on PNG_DLL instead of WIN32. - Make png_free_data() ignore its final parameter except when freeing data + Made the default MODPNG14_USE_LOCAL_ARRAYS depend on MODPNG14_DLL instead of WIN32. + Make modpng14_free_data() ignore its final parameter except when freeing data that can have multiple instances (text, sPLT, unknowns). - Fixed a new bug in png_set_rows(). - Removed info_ptr->valid tests from png_free_data(), as in version 1.0.5. - Added png_set_invalid() function. - Fixed incorrect illustrations of png_destroy_write_struct() in example.c. + Fixed a new bug in modpng14_set_rows(). + Removed info_ptr->valid tests from modpng14_free_data(), as in version 1.0.5. + Added modpng14_set_invalid() function. + Fixed incorrect illustrations of modpng14_destroy_write_struct() in example.c. version 1.0.7beta15 [May 30, 2000] - Revised the deliberately erroneous Linux setjmp code in pngconf.h to produce + Revised the deliberately erroneous Linux setjmp code in modpng14conf.h to produce fewer error messages. Rearranged checks for Z_OK to check the most likely path first in pngpread.c and pngwutil.c. - Added checks in pngtest.c for png_create_*() returning NULL, and mentioned - in libpng.txt/libpng.3 the need for applications to check this. - Changed names of png_default_*() functions in pngtest to pngtest_*(). - Changed return type of png_get_x|y_offset_*() from png_uint_32 to png_int_32. - Fixed some bugs in the unused PNG_INCH_CONVERSIONS functions in pngget.c - Set each pointer to NULL after freeing it in png_free_data(). - Worked around a problem in pngconf.h; AIX's strings.h defines an "index" - macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos) + Added checks in pngtest.c for modpng14_create_*() returning NULL, and mentioned + in libmodpng14.txt/libmodpng14.3 the need for applications to check this. + Changed names of modpng14_default_*() functions in pngtest to pngtest_*(). + Changed return type of modpng14_get_x|y_offset_*() from modpng14_uint_32 to modpng14_int_32. + Fixed some bugs in the unused MODPNG14_INCH_CONVERSIONS functions in pngget.c + Set each pointer to NULL after freeing it in modpng14_free_data(). + Worked around a problem in modpng14conf.h; AIX's strings.h defines an "index" + macro that conflicts with libmodpng14's modpng14_color_16.index. (Dimitri Papadapoulos) Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux). version 1.0.7beta16 [June 4, 2000] Revised the workaround of AIX string.h "index" bug. Added a check for overlength PLTE chunk in pngrutil.c. - Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer + Added MODPNG14_NO_POINTER_INDEXING macro to use array-indexing instead of pointer indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler. - Added a warning in png_decompress_chunk() when it runs out of data, e.g. + Added a warning in modpng14_decompress_chunk() when it runs out of data, e.g. when it tries to read an erroneous PhotoShop iCCP chunk. - Added PNG_USE_DLL macro. + Added MODPNG14_USE_DLL macro. Revised the copyright/disclaimer/license notice. Added contrib/msvctest directory version 1.0.7rc1 [June 9, 2000] - Corrected the definition of PNG_TRANSFORM_INVERT_ALPHA (0x0400 not 0x0200) + Corrected the definition of MODPNG14_TRANSFORM_INVERT_ALPHA (0x0400 not 0x0200) Added contrib/visupng directory (Willem van Schaik) version 1.0.7beta18 [June 23, 2000] - Revised PNGAPI definition, and pngvcrd.c to work with __GCC__ - and do not redefine PNGAPI if it is passed in via a compiler directive. + Revised MODPNG14API definition, and pngvcrd.c to work with __GCC__ + and do not redefine MODPNG14API if it is passed in via a compiler directive. Revised visupng/PngFile.c to remove returns from within the Try block. - Removed leading underscores from "_PNG_H" and "_PNG_SAVE_BSD_SOURCE" macros. + Removed leading underscores from "_MODPNG14_H" and "_MODPNG14_SAVE_BSD_SOURCE" macros. Updated contrib/visupng/cexcept.h to version 1.0.0. Fixed bugs in pngwrite.c and pngwutil.c that prevented writing iCCP chunks. version 1.0.7rc2 [June 28, 2000] Updated license to include disclaimers required by UCITA. Fixed "DJBPP" typo in pnggccrd.c introduced in beta18. version 1.0.7 [July 1, 2000] - Revised the definition of "trans_values" in libpng.3/libpng.txt + Revised the definition of "trans_values" in libmodpng14.3/libmodpng14.txt version 1.0.8beta1 [July 8, 2000] - Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks. - Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and + Added modpng14_free(modpng14_ptr, key) two places in pngpread.c to stop memory leaks. + Changed MODPNG14_NO_STDIO to MODPNG14_NO_CONSOLE_IO, several places in pngrutil.c and pngwutil.c. - Changed PNG_EXPORT_VAR to use PNG_IMPEXP, in pngconf.h. + Changed MODPNG14_EXPORT_VAR to use MODPNG14_IMPEXP, in modpng14conf.h. Removed unused "#include " from png.c Added WindowsCE support. Revised pnggccrd.c to work with gcc-2.95.2 and in the Cygwin environment. @@ -812,119 +812,119 @@ Added project files to the wince directory and made further revisions of pngtest.c, pngrio.c, and pngwio.c in support of WindowsCE. version 1.0.8beta3 [July 11, 2000] - Only set the PNG_FLAG_FREE_TRNS or PNG_FREE_TRNS flag in png_handle_tRNS() + Only set the MODPNG14_FLAG_FREE_TRNS or MODPNG14_FREE_TRNS flag in modpng14_handle_tRNS() for indexed-color input files to avoid potential double-freeing trans array under some unusual conditions; problem was introduced in version 1.0.6f. Further revisions to pngtest.c and files in the wince subdirectory. version 1.0.8beta4 [July 14, 2000] Added the files pngbar.png and pngbar.jpg to the distribution. - Added makefile.cygwin, and cygwin support in pngconf.h - Added PNG_NO_ZALLOC_ZERO macro (makes png_zalloc skip zeroing memory) + Added makefile.cygwin, and cygwin support in modpng14conf.h + Added MODPNG14_NO_ZALLOC_ZERO macro (makes modpng14_zalloc skip zeroing memory) version 1.0.8rc1 [July 16, 2000] - Revised png_debug() macros and statements to eliminate compiler warnings. + Revised modpng14_debug() macros and statements to eliminate compiler warnings. version 1.0.8 [July 24, 2000] - Added png_flush() in pngwrite.c, after png_write_IEND(). + Added modpng14_flush() in pngwrite.c, after modpng14_write_IEND(). Updated makefile.hpux to build a shared library. version 1.0.9beta1 [November 10, 2000] Fixed typo in scripts/makefile.hpux Updated makevms.com in scripts and contrib/* and contrib/* (Martin Zinser) Fixed seqence-point bug in contrib/pngminus/png2pnm (Martin Zinser) - Changed "cdrom.com" in documentation to "libpng.org" + Changed "cdrom.com" in documentation to "libmodpng14.org" Revised pnggccrd.c to get it all working, and updated makefile.gcmmx (Greg). - Changed type of "params" from voidp to png_voidp in png_read|write_png(). - Make sure PNGAPI and PNG_IMPEXP are defined in pngconf.h. + Changed type of "params" from voidp to modpng14_voidp in modpng14_read|write_png(). + Make sure MODPNG14API and MODPNG14_IMPEXP are defined in modpng14conf.h. Revised the 3 instances of WRITEFILE in pngtest.c. Relocated "msvc" and "wince" project subdirectories into "dll" subdirectory. Updated png.rc in dll/msvc project Revised makefile.dec to define and use LIBPATH and INCPATH - Increased size of global png_libpng_ver[] array from 12 to 18 chars. - Made global png_libpng_ver[], png_sig[] and png_pass_*[] arrays const. - Removed duplicate png_crc_finish() from png_handle_bKGD() function. - Added a warning when application calls png_read_update_info() multiple times. + Increased size of global modpng14_libmodpng14_ver[] array from 12 to 18 chars. + Made global modpng14_libmodpng14_ver[], modpng14_sig[] and modpng14_pass_*[] arrays const. + Removed duplicate modpng14_crc_finish() from modpng14_handle_bKGD() function. + Added a warning when application calls modpng14_read_update_info() multiple times. Revised makefile.cygwin Fixed bugs in iCCP support in pngrutil.c and pngwutil.c. - Replaced png_set_empty_plte_permitted() with png_permit_mng_features(). + Replaced modpng14_set_empty_plte_permitted() with modpng14_permit_mng_features(). version 1.0.9beta2 [November 19, 2000] Renamed the "dll" subdirectory "projects". Added borland project files to "projects" subdirectory. Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate. - Add error message in png_set_compression_buffer_size() when malloc fails. + Add error message in modpng14_set_compression_buffer_size() when malloc fails. version 1.0.9beta3 [November 23, 2000] - Revised PNG_LIBPNG_BUILD_TYPE macro in png.h, used in the msvc project. - Removed the png_flush() in pngwrite.c that crashes some applications - that don't set png_output_flush_fn. + Revised MODPNG14_LIBMODPNG14_BUILD_TYPE macro in modpng14.h, used in the msvc project. + Removed the modpng14_flush() in pngwrite.c that crashes some applications + that don't set modpng14_output_flush_fn. Added makefile.macosx and makefile.aix to scripts directory. version 1.0.9beta4 [December 1, 2000] - Change png_chunk_warning to png_warning in png_check_keyword(). - Increased the first part of msg buffer from 16 to 18 in png_chunk_error(). + Change modpng14_chunk_warning to modpng14_warning in modpng14_check_keyword(). + Increased the first part of msg buffer from 16 to 18 in modpng14_chunk_error(). version 1.0.9beta5 [December 15, 2000] Added support for filter method 64 (for PNG datastreams embedded in MNG). version 1.0.9beta6 [December 18, 2000] - Revised png_set_filter() to accept filter method 64 when appropriate. - Added new PNG_HAVE_PNG_SIGNATURE bit to png_ptr->mode and use it to + Revised modpng14_set_filter() to accept filter method 64 when appropriate. + Added new MODPNG14_HAVE_MODPNG14_SIGNATURE bit to modpng14_ptr->mode and use it to help prevent applications from using MNG features in PNG datastreams. - Added png_permit_mng_features() function. - Revised libpng.3/libpng.txt. Changed "filter type" to "filter method". + Added modpng14_permit_mng_features() function. + Revised libmodpng14.3/libmodpng14.txt. Changed "filter type" to "filter method". version 1.0.9rc1 [December 23, 2000] - Revised test for PNG_HAVE_PNG_SIGNATURE in pngrutil.c - Fixed error handling of unknown compression type in png_decompress_chunk(). - In pngconf.h, define __cdecl when _MSC_VER is defined. + Revised test for MODPNG14_HAVE_MODPNG14_SIGNATURE in pngrutil.c + Fixed error handling of unknown compression type in modpng14_decompress_chunk(). + In modpng14conf.h, define __cdecl when _MSC_VER is defined. version 1.0.9beta7 [December 28, 2000] - Changed PNG_TEXT_COMPRESSION_zTXt to PNG_COMPRESSION_TYPE_BASE several places. - Revised memory management in png_set_hIST and png_handle_hIST in a backward + Changed MODPNG14_TEXT_COMPRESSION_zTXt to MODPNG14_COMPRESSION_TYPE_BASE several places. + Revised memory management in modpng14_set_hIST and modpng14_handle_hIST in a backward compatible manner. PLTE and tRNS were revised similarly. Revised the iCCP chunk reader to ignore trailing garbage. version 1.0.9beta8 [January 12, 2001] - Moved pngasmrd.h into pngconf.h. + Moved pngasmrd.h into modpng14conf.h. Improved handling of out-of-spec garbage iCCP chunks generated by PhotoShop. version 1.0.9beta9 [January 15, 2001] - Added png_set_invalid, png_permit_mng_features, and png_mmx_supported to + Added modpng14_set_invalid, modpng14_permit_mng_features, and modpng14_mmx_supported to wince and msvc project module definition files. Minor revision of makefile.cygwin. Fixed bug with progressive reading of narrow interlaced images in pngpread.c version 1.0.9beta10 [January 16, 2001] - Do not typedef png_FILE_p in pngconf.h when PNG_NO_STDIO is defined. - Fixed "png_mmx_supported" typo in project definition files. + Do not typedef modpng14_FILE_p in modpng14conf.h when MODPNG14_NO_STDIO is defined. + Fixed "modpng14_mmx_supported" typo in project definition files. version 1.0.9beta11 [January 19, 2001] Updated makefile.sgi to make shared library. - Removed png_mmx_support() function and disabled PNG_MNG_FEATURES_SUPPORTED + Removed modpng14_mmx_support() function and disabled MODPNG14_MNG_FEATURES_SUPPORTED by default, for the benefit of DLL forward compatibility. These will be re-enabled in version 1.2.0. version 1.0.9rc2 [January 22, 2001] Revised cygwin support. version 1.0.9 [January 31, 2001] - Added check of cygwin's ALL_STATIC in pngconf.h + Added check of cygwin's ALL_STATIC in modpng14conf.h Added "-nommx" parameter to contrib/gregbook/rpng2-win and rpng2-x demos. version 1.0.10beta1 [March 14, 2001] Revised makefile.dec, makefile.sgi, and makefile.sggcc; added makefile.hpgcc. - Reformatted libpng.3 to eliminate bad line breaks. + Reformatted libmodpng14.3 to eliminate bad line breaks. Added checks for _mmx_supported in the read_filter_row function of pnggccrd.c - Added prototype for png_mmx_support() near the top of pnggccrd.c - Moved some error checking from png_handle_IHDR to png_set_IHDR. - Added PNG_NO_READ_SUPPORTED and PNG_NO_WRITE_SUPPORTED macros. - Revised png_mmx_support() function in pnggccrd.c - Restored version 1.0.8 PNG_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c + Added prototype for modpng14_mmx_support() near the top of pnggccrd.c + Moved some error checking from modpng14_handle_IHDR to modpng14_set_IHDR. + Added MODPNG14_NO_READ_SUPPORTED and MODPNG14_NO_WRITE_SUPPORTED macros. + Revised modpng14_mmx_support() function in pnggccrd.c + Restored version 1.0.8 MODPNG14_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c Fixed memory leak in contrib/visupng/PngFile.c - Fixed bugs in png_combine_row() in pnggccrd.c and pngvcrd.c (C version) + Fixed bugs in modpng14_combine_row() in pnggccrd.c and pngvcrd.c (C version) Added warnings when retrieving or setting gamma=0. - Increased the first part of msg buffer from 16 to 18 in png_chunk_warning(). + Increased the first part of msg buffer from 16 to 18 in modpng14_chunk_warning(). version 1.0.10rc1 [March 23, 2001] - Changed all instances of memcpy, strcpy, and strlen to png_memcpy, png_strcpy, - and png_strlen. - Revised png_mmx_supported() function in pnggccrd.c to return proper value. + Changed all instances of memcpy, strcpy, and strlen to modpng14_memcpy, modpng14_strcpy, + and modpng14_strlen. + Revised modpng14_mmx_supported() function in pnggccrd.c to return proper value. Fixed bug in progressive reading (pngpread.c) with small images (height < 8). version 1.0.10 [March 30, 2001] Deleted extraneous space (introduced in 1.0.9) from line 42 of makefile.cygwin Added beos project files (Chris Herborth) version 1.0.11beta1 [April 3, 2001] - Added type casts on several png_malloc() calls (Dimitri Papadapoulos). - Removed a no-longer needed AIX work-around from pngconf.h + Added type casts on several modpng14_malloc() calls (Dimitri Papadapoulos). + Removed a no-longer needed AIX work-around from modpng14conf.h Changed several "//" single-line comments to C-style in pnggccrd.c version 1.0.11beta2 [April 11, 2001] - Removed PNGAPI from several functions whose prototypes did not have PNGAPI. + Removed MODPNG14API from several functions whose prototypes did not have MODPNG14API. Updated scripts/pngos2.def version 1.0.11beta3 [April 14, 2001] - Added checking the results of many instances of png_malloc() for NULL + Added checking the results of many instances of modpng14_malloc() for NULL version 1.0.11beta4 [April 20, 2001] Undid the changes from version 1.0.11beta3. Added a check for NULL return from user's malloc_fn(). @@ -933,26 +933,26 @@ version 1.0.11 [April 27, 2001] Revised makefile.netbsd version 1.0.12beta1 [May 14, 2001] - Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot) - Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h + Test for Windows platform in modpng14conf.h when including malloc.h (Emmanuel Blot) + Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in modpng14conf.h Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings. - Eliminated the png_error about apps using png_read|write_init(). Instead, - libpng will reallocate the png_struct and info_struct if they are too small. + Eliminated the modpng14_error about apps using modpng14_read|write_init(). Instead, + libmodpng14 will reallocate the modpng14_struct and info_struct if they are too small. This retains future binary compatibility for old applications written for - libpng-0.88 and earlier. + libmodpng14-0.88 and earlier. version 1.2.0beta1 [May 6, 2001] Bumped DLLNUM to 2. - Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED + Re-enabled MODPNG14_MNG_FEATURES_SUPPORTED and enabled MODPNG14_ASSEMBLER_CODE_SUPPORTED by default. Added runtime selection of MMX features. - Added png_set_strip_error_numbers function and related macros. + Added modpng14_set_strip_error_numbers function and related macros. version 1.2.0beta2 [May 7, 2001] Finished merging 1.2.0beta1 with version 1.0.11 Added a check for attempts to read or write PLTE in grayscale PNG datastreams. version 1.2.0beta3 [May 17, 2001] Enabled user memory function by default. - Modified png_create_struct so it passes user mem_ptr to user memory allocator. - Increased png_mng_features flag from png_byte to png_uint_32. + Modified modpng14_create_struct so it passes user mem_ptr to user memory allocator. + Increased modpng14_mng_features flag from modpng14_byte to modpng14_uint_32. Bumped shared-library (so-number) and dll-number to 3. version 1.2.0beta4 [June 23, 2001] Check for missing profile length field in iCCP chunk and free chunk_data @@ -962,28 +962,28 @@ Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly if user attempts to run it on an 8-bit display. Updated contrib/gregbook - Use png_malloc instead of png_zalloc to allocate palette in pngset.c + Use modpng14_malloc instead of modpng14_zalloc to allocate palette in pngset.c Updated makefile.ibmc Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes - of png_write_oFFS width and height from png_uint_32 to png_int_32. + of modpng14_write_oFFS width and height from modpng14_uint_32 to modpng14_int_32. Updated example.c - Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c + Revised prototypes for modpng14_debug_malloc and modpng14_debug_free in pngtest.c version 1.2.0beta5 [August 8, 2001] Revised contrib/gregbook Revised makefile.gcmmx Revised pnggccrd.c to conditionally compile some thread-unsafe code only - when PNG_THREAD_UNSAFE_OK is defined. + when MODPNG14_THREAD_UNSAFE_OK is defined. Added tests to prevent pngwutil.c from writing a bKGD or tRNS chunk with value exceeding 2^bit_depth-1 Revised makefile.sgi and makefile.sggcc - Replaced calls to fprintf(stderr,...) with png_warning() in pnggccrd.c + Replaced calls to fprintf(stderr,...) with modpng14_warning() in pnggccrd.c Removed restriction that do_invert_mono only operate on 1-bit opaque files version 1.2.0 [September 1, 2001] - Changed a png_warning() to png_debug() in pnggccrd.c + Changed a modpng14_warning() to modpng14_debug() in pnggccrd.c Fixed contrib/gregbook/rpng-x.c, rpng2-x.c to avoid crash with XFreeGC(). version 1.2.1beta1 [October 19, 2001] Revised makefile.std in contrib/pngminus - Include background_1 in png_struct regardless of gamma support. + Include background_1 in modpng14_struct regardless of gamma support. Revised makefile.netbsd and makefile.macosx, added makefile.darwin. Revised example.c to provide more details about using row_callback(). version 1.2.1beta2 [October 25, 2001] @@ -992,17 +992,17 @@ Added makefile.so9. version 1.2.1beta3 [October 27, 2001] Removed type casts from all NULLs. - Simplified png_create_struct_2(). + Simplified modpng14_create_struct_2(). version 1.2.1beta4 [November 7, 2001] - Revised png_create_info_struct() and png_creat_struct_2(). - Added error message if png_write_info() was omitted. + Revised modpng14_create_info_struct() and modpng14_creat_struct_2(). + Added error message if modpng14_write_info() was omitted. Type cast NULLs appearing in function calls when _NO_PROTO or - PNG_TYPECAST_NULL is defined. + MODPNG14_TYPECAST_NULL is defined. version 1.2.1rc1 [November 24, 2001] - Type cast NULLs appearing in function calls except when PNG_NO_TYPECAST_NULL + Type cast NULLs appearing in function calls except when MODPNG14_NO_TYPECAST_NULL is defined. - Changed typecast of "size" argument to png_size_t in pngmem.c calls to - the user malloc_fn, to agree with the prototype in png.h + Changed typecast of "size" argument to modpng14_size_t in pngmem.c calls to + the user malloc_fn, to agree with the prototype in modpng14.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 @@ -1016,25 +1016,25 @@ version 1.2.2beta1 [February 22, 2002] Fixed a bug with reading the length of iCCP profiles (Larry Reeves). Revised makefile.linux, makefile.gcmmx, and makefile.sgi to generate - libpng.a, libpng12.so (not libpng.so.3), and libpng12/png.h + libmodpng14.a, libmodpng1412.so (not libmodpng14.so.3), and libmodpng1412/modpng14.h Revised makefile.darwin to remove "-undefined suppress" option. Added checks for gamma and chromaticity values over 21474.83, which exceed the limit for PNG unsigned 32-bit integers when encoded. - Revised calls to png_create_read_struct() and png_create_write_struct() + Revised calls to modpng14_create_read_struct() and modpng14_create_write_struct() for simpler debugging. - Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK) + Revised modpng14_zalloc() so zlib handles errors (uses MODPNG14_FLAG_MALLOC_NULL_MEM_OK) version 1.2.2beta2 [February 23, 2002] - Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths. - Check for invalid image dimensions in png_get_IHDR. + Check chunk_length and idat_size for invalid (over MODPNG14_MAX_UINT) lengths. + Check for invalid image dimensions in modpng14_get_IHDR. Added missing "fi;" in the install target of the SGI makefiles. Added install-static to all makefiles that make shared libraries. Always do gamma compensation when image is partially transparent. version 1.2.2beta3 [March 7, 2002] Compute background.gray and background_1.gray even when color_type is RGB in case image gets reduced to gray later. - Modified shared-library makefiles to install pkgconfig/libpngNN.pc. - Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown - Removed unused png_write_destroy_info prototype from png.h + Modified shared-library makefiles to install pkgconfig/libmodpng14NN.pc. + Export (with MODPNG14API) modpng14_zalloc, modpng14_zfree, and modpng14_handle_as_unknown + Removed unused modpng14_write_destroy_info prototype from modpng14.h Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case Added install-shared target to all makefiles that make shared libraries. Stopped a double free of palette, hist, and trans when not using free_me. @@ -1043,30 +1043,30 @@ Compute background.gray and background_1.gray even when color_type is RGB in case image gets reduced to gray later (Jason Summers). Relocated a misplaced /bin/rm in the "install-shared" makefile targets - Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library. + Added MODPNG14_1_0_X macro which can be used to build a 1.0.x-compatible library. version 1.2.2beta5 [March 26, 2002] - Added missing PNGAPI to several function definitions. - Check for invalid bit_depth or color_type in png_get_IHDR(), and - check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen). + Added missing MODPNG14API to several function definitions. + Check for invalid bit_depth or color_type in modpng14_get_IHDR(), and + check for missing PLTE or IHDR in modpng14_push_read_chunk() (Matthias Clasen). Revised iTXt support to accept NULL for lang and lang_key. Compute gamma for color components of background even when color_type is gray. - Changed "()" to "{}" in scripts/libpng.pc.in. - Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN - Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so + Changed "()" to "{}" in scripts/libmodpng14.pc.in. + Revised makefiles to put modpng14.h and modpng14conf.h only in $prefix/include/libmodpng14NN + Revised makefiles to make symlink to libmodpng14.so.NN in addition to libmodpng14NN.so version 1.2.2beta6 [March 31, 2002] version 1.0.13beta1 [March 31, 2002] - Prevent png_zalloc() from trying to memset memory that it failed to acquire. - Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate). + Prevent modpng14_zalloc() from trying to memset memory that it failed to acquire. + Add typecasts of MODPNG14_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate). Ensure that the right function (user or default) is used to free the - png_struct after an error in png_create_read_struct_2(). + modpng14_struct after an error in modpng14_create_read_struct_2(). version 1.2.2rc1 [April 7, 2002] version 1.0.13rc1 [April 7, 2002] Save the ebx register in pnggccrd.c (Sami Farin) - Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner). - Updated makefiles to put headers in include/libpng and remove old include/*.h. + Add "mem_ptr = modpng14_ptr->mem_ptr" in modpng14_destroy_write_struct() (Paul Gardner). + Updated makefiles to put headers in include/libmodpng14 and remove old include/*.h. version 1.2.2 [April 15, 2002] version 1.0.13 [April 15, 2002] - Revised description of png_set_filter() in libpng.3/libpng.txt. + Revised description of modpng14_set_filter() in libmodpng14.3/libmodpng14.txt. Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd version 1.0.13patch01 [April 17, 2002] version 1.2.2patch01 [April 17, 2002] @@ -1075,95 +1075,95 @@ Added install: target to makefile.32sunu and makefile.64sunu version 1.0.13patch03 [April 18, 2002] version 1.2.2patch03 [April 18, 2002] - Revised 15 makefiles to link libpng.a to libpngNN.a and the include libpng - subdirectory to libpngNN subdirectory without the full pathname. - Moved generation of libpng.pc from "install" to "all" in 15 makefiles. + Revised 15 makefiles to link libmodpng14.a to libmodpng14NN.a and the include libmodpng14 + subdirectory to libmodpng14NN subdirectory without the full pathname. + Moved generation of libmodpng14.pc from "install" to "all" in 15 makefiles. version 1.2.3rc1 [April 28, 2002] Added install-man target to 15 makefiles (Dimitri Papadopolous-Orfanos). Added $(DESTDIR) feature to 24 makefiles (Tim Mooney) Fixed bug with $prefix, should be $(prefix) in makefile.hpux. - Updated cygwin-specific portion of pngconf.h and revised makefile.cygwin - Added a link from libpngNN.pc to libpng.pc in 15 makefiles. - Added links from include/libpngNN/*.h to include/*.h in 24 makefiles. + Updated cygwin-specific portion of modpng14conf.h and revised makefile.cygwin + Added a link from libmodpng14NN.pc to libmodpng14.pc in 15 makefiles. + Added links from include/libmodpng14NN/*.h to include/*.h in 24 makefiles. Revised makefile.darwin to make relative links without full pathname. - Added setjmp() at the end of png_create_*_struct_2() in case user forgets + Added setjmp() at the end of modpng14_create_*_struct_2() in case user forgets to put one in their application. - Restored png_zalloc() and png_zfree() prototypes to version 1.2.1 and + Restored modpng14_zalloc() and modpng14_zfree() prototypes to version 1.2.1 and removed them from module definition files. version 1.2.3rc2 [May 1, 2002] Fixed bug in reporting number of channels in pngget.c and pngset.c, that was introduced in version 1.2.2beta5. - Exported png_zalloc(), png_zfree(), png_default_read(), png_default_write(), - png_default_flush(), and png_push_fill_buffer() and included them in + Exported modpng14_zalloc(), modpng14_zfree(), modpng14_default_read(), modpng14_default_write(), + modpng14_default_flush(), and modpng14_push_fill_buffer() and included them in module definition files. - Added "libpng.pc" dependency to the "install-shared" target in 15 makefiles. + Added "libmodpng14.pc" dependency to the "install-shared" target in 15 makefiles. version 1.2.3rc3 [May 1, 2002] - Revised prototype for png_default_flush() - Remove old libpng.pc and libpngNN.pc before installing new ones. + Revised prototype for modpng14_default_flush() + Remove old libmodpng14.pc and libmodpng14NN.pc before installing new ones. version 1.2.3rc4 [May 2, 2002] - Typos in *.def files (png_default_read|write -> png_default_read|write_data) - In makefiles, changed rm libpng.NN.pc to rm libpngNN.pc - Added libpng-config and libpngNN-config and modified makefiles to install them. + Typos in *.def files (modpng14_default_read|write -> modpng14_default_read|write_data) + In makefiles, changed rm libmodpng14.NN.pc to rm libmodpng14NN.pc + Added libmodpng14-config and libmodpng14NN-config and modified makefiles to install them. Changed $(MANPATH) to $(DESTDIR)$(MANPATH) in makefiles - Added "Win32 DLL VB" configuration to projects/msvc/libpng.dsp + Added "Win32 DLL VB" configuration to projects/msvc/libmodpng14.dsp version 1.2.3rc5 [May 11, 2002] Changed "error" and "message" in prototypes to "error_message" and "warning_message" to avoid namespace conflict. - Revised 15 makefiles to build libpng-config from libpng-config-*.in - Once more restored png_zalloc and png_zfree to regular nonexported form. - Restored png_default_read|write_data, png_default_flush, png_read_fill_buffer - to nonexported form, but with PNGAPI, and removed them from module def files. + Revised 15 makefiles to build libmodpng14-config from libmodpng14-config-*.in + Once more restored modpng14_zalloc and modpng14_zfree to regular nonexported form. + Restored modpng14_default_read|write_data, modpng14_default_flush, modpng14_read_fill_buffer + to nonexported form, but with MODPNG14API, and removed them from module def files. version 1.2.3rc6 [May 14, 2002] - Removed "PNGAPI" from png_zalloc() and png_zfree() in png.c - Changed "Gz" to "Gd" in projects/msvc/libpng.dsp and zlib.dsp. - Removed leftover libpng-config "sed" script from four makefiles. - Revised libpng-config creating script in 16 makefiles. + Removed "MODPNG14API" from modpng14_zalloc() and modpng14_zfree() in png.c + Changed "Gz" to "Gd" in projects/msvc/libmodpng14.dsp and zlib.dsp. + Removed leftover libmodpng14-config "sed" script from four makefiles. + Revised libmodpng14-config creating script in 16 makefiles. version 1.2.3 [May 22, 2002] - Revised libpng-config target in makefile.cygwin. - Removed description of png_set_mem_fn() from documentation. + Revised libmodpng14-config target in makefile.cygwin. + Removed description of modpng14_set_mem_fn() from documentation. Revised makefile.freebsd. Minor cosmetic changes to 15 makefiles, e.g., $(DI) = $(DESTDIR)/$(INCDIR). Revised projects/msvc/README.txt - Changed -lpng to -lpngNN in LDFLAGS in several makefiles. + Changed -lmodpng14 to -lmodpng14NN in LDFLAGS in several makefiles. version 1.2.4beta1 [May 24, 2002] - Added libpng.pc and libpng-config to "all:" target in 16 makefiles. + Added libmodpng14.pc and libmodpng14-config to "all:" target in 16 makefiles. Fixed bug in 16 makefiles: $(DESTDIR)/$(LIBPATH) to $(DESTDIR)$(LIBPATH) Added missing "\" before closing double quote in makefile.gcmmx. - Plugged various memory leaks; added png_malloc_warn() and png_set_text_2() + Plugged various memory leaks; added modpng14_malloc_warn() and modpng14_set_text_2() functions. version 1.2.4beta2 [June 25, 2002] - Plugged memory leak of png_ptr->current_text (Matt Holgate). + Plugged memory leak of modpng14_ptr->current_text (Matt Holgate). Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison) Added -soname to the loader flags in makefile.dec, makefile.sgi, and makefile.sggcc. Added "test-installed" target to makefile.linux, makefile.gcmmx, makefile.sgi, and makefile.sggcc. version 1.2.4beta3 [June 28, 2002] - Plugged memory leak of row_buf in pngtest.c when there is a png_error(). + Plugged memory leak of row_buf in pngtest.c when there is a modpng14_error(). Detect buffer overflow in pngpread.c when IDAT is corrupted with extra data. Added "test-installed" target to makefile.32sunu, makefile.64sunu, makefile.beos, makefile.darwin, makefile.dec, makefile.macosx, makefile.solaris, makefile.hpux, makefile.hpgcc, and makefile.so9. version 1.2.4rc1 and 1.0.14rc1 [July 2, 2002] Added "test-installed" target to makefile.cygwin and makefile.sco. - Revised pnggccrd.c to be able to back out version 1.0.x via PNG_1_0_X macro. + Revised pnggccrd.c to be able to back out version 1.0.x via MODPNG14_1_0_X macro. version 1.2.4 and 1.0.14 [July 8, 2002] - Changed png_warning() to png_error() when width is too large to process. + Changed modpng14_warning() to modpng14_error() when width is too large to process. version 1.2.4patch01 [July 20, 2002] Revised makefile.cygwin to use DLL number 12 instead of 13. version 1.2.5beta1 [August 6, 2002] Added code to contrib/gregbook/readpng2.c to ignore unused chunks. Replaced toucan.png in contrib/gregbook (it has been corrupt since 1.0.11) Removed some stray *.o files from contrib/gregbook. - Changed png_error() to png_warning() about "Too much data" in pngpread.c + Changed modpng14_error() to modpng14_warning() about "Too much data" in pngpread.c and about "Extra compressed data" in pngrutil.c. - Prevent png_ptr->pass from exceeding 7 in png_push_finish_row(). + Prevent modpng14_ptr->pass from exceeding 7 in modpng14_push_finish_row(). Updated makefile.hpgcc - Updated png.c and pnggccrd.c handling of return from png_mmx_support() + Updated png.c and pnggccrd.c handling of return from modpng14_mmx_support() version 1.2.5beta2 [August 15, 2002] - Only issue png_warning() about "Too much data" in pngpread.c when avail_in + Only issue modpng14_warning() about "Too much data" in pngpread.c when avail_in is nonzero. - Updated makefiles to install a separate libpng.so.3 with its own rpath. + Updated makefiles to install a separate libmodpng14.so.3 with its own rpath. version 1.2.5rc1 and 1.0.15rc1 [August 24, 2002] Revised makefiles to not remove previous minor versions of shared libraries. version 1.2.5rc2 and 1.0.15rc2 [September 16, 2002] @@ -1172,11 +1172,11 @@ Added missing "$OBJSDLL" line to makefile.gcmmx. Added missing "; fi" to makefile.32sunu. version 1.2.5rc3 and 1.0.15rc3 [September 18, 2002] - Revised libpng-config script. + Revised libmodpng14-config script. version 1.2.5 and 1.0.15 [October 3, 2002] Revised makefile.macosx, makefile.darwin, makefile.hpgcc, and makefile.hpux, and makefile.aix. - Relocated two misplaced PNGAPI lines in pngtest.c + Relocated two misplaced MODPNG14API lines in pngtest.c Send comments/corrections/commendations to png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/INSTALL +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/INSTALL @@ -1,22 +1,22 @@ -Installing libpng version 1.2.5 - October 3, 2002 +Installing libmodpng14 version 1.2.5 - October 3, 2002 -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. +Before installing libmodpng14, you must first install zlib. zlib +can usually be found wherever you got libmodpng14. zlib can be +placed in another directory, at the same level as libmodpng14. 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.5" or "lpng109" and "zlib-1.1.4" -or "zlib114") so that you have directories called "zlib" and "libpng". +might be called "libmodpng14-1.2.5" or "lpng109" and "zlib-1.1.4" +or "zlib114") so that you have directories called "zlib" and "libmodpng14". Your directory structure should look like this: .. (the parent directory) - libpng (this directory) + libmodpng14 (this directory) INSTALL (this file) README *.h @@ -35,7 +35,7 @@ wince.txt scripts makefile.* - libpng*.in + libmodpng14*.in pngtest.png etc. zlib @@ -46,16 +46,16 @@ 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 +distribution of libmodpng14. 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 +If you are building libmodpng14 with MSVC, you can enter the libmodpng14\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 +You can build libmodpng14 for WindowsCE by entering the downloading and installing +the libmodpng14\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. +build libmodpng14 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 @@ -64,11 +64,11 @@ 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 libpng12.so.0.1.2.5) - makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.5, + makefile.std => Generic UNIX makefile (cc, creates static libmodpng14.a) + makefile.linux => Linux/ELF makefile (gcc, creates libmodpng1412.so.0.1.2.5) + makefile.gcmmx => Linux/ELF makefile (gcc, creates libmodpng1412.so.0.1.2.5, uses assembler code tuned for Intel MMX platform) - makefile.gcc => Generic makefile (gcc, creates static libpng.a) + makefile.gcc => Generic makefile (gcc, creates static libmodpng14.a) makefile.knr => Archaic UNIX Makefile that converts files with ansi2knr (Requires ansi2knr.c from ftp://ftp.cs.wisc.edu/ghost) @@ -81,16 +81,16 @@ 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 + libmodpng14.icc => Project file for IBM VisualAge/C++ version 4.0 or later makefile.macosx => MACOS X Makefile - makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so. - makefile.ne0bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng0.so + makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libmodpng14.so. + makefile.ne0bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libmodpng140.so makefile.openbsd => OpenBSD makefile makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) - makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.5) + makefile.sggcc => Silicon Graphics (gcc, creates libmodpng1412.so.0.1.2.5) makefile.sunos => Sun makefile - makefile.solaris => Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.5) - makefile.so9 => Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.5) + makefile.solaris => Solaris 2.X makefile (gcc, creates libmodpng1412.so.0.1.2.5) + makefile.so9 => Solaris 9 makefile (gcc, creates libmodpng1412.so.0.1.2.5) makefile.32sunu => Sun Ultra 32-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc @@ -128,10 +128,10 @@ 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 +Then read modpng14conf.h to see if you want to make any configuration changes. -Then just run "make test" which will create the libpng library in +Then just run "make test" which will create the libmodpng14 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 @@ -146,6 +146,6 @@ Some also allow you to run "make test-installed" after you have run "make install". -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. +Further information can be found in the README and libmodpng14.txt +files, in the individual makefiles, in modpng14.h, in the README files in +subdirectories of the LIB directory, and the manual pages libmodpng14.3 and png.5. --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/KNOWNBUG +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/KNOWNBUG @@ -1,11 +1,11 @@ -Known bugs in libpng version 1.2.5 +Known bugs in libmodpng14 version 1.2.5 1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when reading interlaced PNG files, when assembler code is enabled but running on a non-MMX i386 platform. - STATUS: Under investigation. The change to pnggccrd.c in libpng-1.2.1 + STATUS: Under investigation. The change to pnggccrd.c in libmodpng14-1.2.1 fixed a problem under FreeBSD but not the problem with NetBSD, which - still fails as of libpng-1.2.2rc1. + still fails as of libmodpng14-1.2.2rc1. --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/LICENSE +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/LICENSE @@ -1,16 +1,16 @@ -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. +This copy of the libmodpng14 notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file modpng14.h that is +included in the libmodpng14 distribution, the latter shall prevail. COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: -If you modify libpng you may insert additional notices immediately following +If you modify libmodpng14 you may insert additional notices immediately following this sentence. -libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are +libmodpng14 versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are Copyright (c) 2000-2002 Glenn Randers-Pehrson -and are distributed according to the same disclaimer and license as libpng-1.0.6 +and are distributed according to the same disclaimer and license as libmodpng14-1.0.6 with the following individuals added to the list of Contributing Authors Simon-Pierre Cadieux @@ -26,18 +26,18 @@ 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 +libmodpng14 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, +distributed according to the same disclaimer and license as libmodpng14-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 +libmodpng14 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, +Distributed according to the same disclaimer and license as libmodpng14-0.88, with the following individuals added to the list of Contributing Authors: John Bowler @@ -47,7 +47,7 @@ Greg Roelofs Tom Tanner -libpng versions 0.5, May 1995, through 0.88, January 1996, are +libmodpng14 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" @@ -86,10 +86,10 @@ appreciated. -A "png_get_copyright" function is available, for convenient use in "about" +A "modpng14_get_copyright" function is available, for convenient use in "about" boxes and the like: - printf("%s",png_get_copyright(NULL)); + printf("%s",modpng14_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). --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/README +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/README @@ -1,14 +1,14 @@ -README for libpng 1.2.5 - October 3, 2002 (shared library 12.0) -See the note about version numbers near the top of png.h +README for libmodpng14 1.2.5 - October 3, 2002 (shared library 12.0) +See the note about version numbers near the top of modpng14.h -See INSTALL for instructions on how to install libpng. +See INSTALL for instructions on how to install libmodpng14. -Libpng comes in two distribution formats. Get libpng-*.tar.gz if you +Libpng comes in two distribution formats. Get libmodpng14-*.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 +Version 0.89 was the first official release of libmodpng14. Don't let the +fact that it's the first release fool you. The libmodpng14 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 @@ -16,17 +16,17 @@ 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 +Note that some of the changes to the modpng14_info structure render this +version of the library binary incompatible with libmodpng14-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 +"filler" parameter for modpng14_set_filler() has changed from modpng14_byte to +modpng14_uint_32, which will affect shared-library applications that use this function. -To avoid problems with changes to the internals of png_info_struct, +To avoid problems with changes to the internals of modpng14_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_ and -png_get_ functions. These functions should be used when +access to info_ptr. These functions are the modpng14_set_ and +modpng14_get_ 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. @@ -37,7 +37,7 @@ be converted to the new format, to facilitate upgrades in the future. **** -Additions since 0.90 include the ability to compile libpng as a +Additions since 0.90 include the ability to compile libmodpng14 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 @@ -58,11 +58,11 @@ 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 +For a detailed description on using libmodpng14, read libmodpng14.txt. For +examples of libmodpng14 in a program, see example.c and pngtest.c. For usage +information and restrictions (what little they are) on libmodpng14, see +modpng14.h. For a description on using zlib (the compression library used by +libmodpng14) 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. @@ -77,7 +77,7 @@ 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. +zlib should be available at the same place that libmodpng14 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 @@ -92,14 +92,14 @@ 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, +and any modifications you needed to make to get libmodpng14 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 +If you needed to add transformations to libmodpng14, or wish libmodpng14 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 +Finally, if you get any warning messages when compiling libmodpng14 (note: not zlib), and they are easy to fix, I'd appreciate the -fix. Please mention "libpng" somewhere in the subject line. Thanks. +fix. Please mention "libmodpng14" 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. @@ -107,43 +107,43 @@ randeg@alum.rpi.edu png-implement@ccrc.wustl.edu -You can't reach Guy, the original libpng author, at the addresses +You can't reach Guy, the original libmodpng14 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 +time, please do not send libmodpng14 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, +in the PNG specification that is related to using libmodpng14, send it +to me. Send me any questions that start with "I was using libmodpng14, 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 +finished. If you have suggestions for libmodpng14, 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 + CHANGES => Description of changes between libmodpng14 versions KNOWNBUG => List of known bugs and deficiencies - LICENSE => License to use and redistribute libpng + LICENSE => License to use and redistribute libmodpng14 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 + example.c => Example code for using libmodpng14 functions + libmodpng14.3 => manual page for libmodpng14 (includes libmodpng14.txt) + libmodpng14.txt => Description of libmodpng14 and its functions + libmodpng14pf.3 => manual page for libmodpng14'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 + modpng14.h => Library function and interface declarations + modpng14conf.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 @@ -172,26 +172,26 @@ 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 + beos => Contains a Beos workspace for building libmodpng14 + borland => Contains a Borland workspace for building libmodpng14 and zlib msvc => Contains a Microsoft Visual C++ (MSVC) workspace - for building libpng and zlib + for building libmodpng14 and zlib netware.txt => Contains instructions for downloading a set of - project files for building libpng and zlib on + project files for building libmodpng14 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: + building libmodpng14 and zlib on WindowsCE + scripts => Directory containing scripts for building libmodpng14: descrip.mms => VMS makefile for MMS or MMK - makefile.std => Generic UNIX makefile (cc, creates static libpng.a) + makefile.std => Generic UNIX makefile (cc, creates static libmodpng14.a) makefile.linux => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.5) + (gcc, creates libmodpng1412.so.0.1.2.5) makefile.gcmmx => Linux/ELF makefile (gcc, creates - libpng12.so.0.1.2.5, uses assembler code + libmodpng1412.so.0.1.2.5, uses assembler code tuned for Intel MMX platform) - makefile.gcc => Generic makefile (gcc, creates static libpng.a) + makefile.gcc => Generic makefile (gcc, creates static libmodpng14.a) makefile.knr => Archaic UNIX Makefile that converts files with ansi2knr (Requires ansi2knr.c from ftp://ftp.cs.wisc.edu/ghost) @@ -204,18 +204,18 @@ 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 + libmodpng14.icc => Project file, IBM VisualAge/C++ 4.0 or later makefile.macosx => MACOS X Makefile - makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so. - makefile.ne0bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng0.so + makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libmodpng14.so. + makefile.ne0bsd => NetBSD/cc makefile, PNGGCCRD, makes libmodpng140.so makefile.openbsd => OpenBSD makefile makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) - makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.5) + makefile.sggcc => Silicon Graphics (gcc, creates libmodpng1412.so.0.1.2.5) makefile.sunos => Sun makefile makefile.solaris => Solaris 2.X makefile - (gcc, creates libpng12.so.0.1.2.5) + (gcc, creates libmodpng1412.so.0.1.2.5) makefile.so9 => Solaris 9 makefile - (gcc, creates libpng12.so.0.1.2.5) + (gcc, creates libmodpng1412.so.0.1.2.5) makefile.32sunu => Sun Ultra 32-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc @@ -244,16 +244,16 @@ makevms.com => VMS build script pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5 SCOPTIONS.ppc => Used with smakefile.ppc - mangle => Directory containing scripts to build libpng12m.so: - mangle.in => Function-decoration macros added to png.h by the + mangle => Directory containing scripts to build libmodpng1412m.so: + mangle.in => Function-decoration macros added to modpng14.h by the makefiles. makefile.linux => Linux/ELF makefile - (gcc, creates libpng12m.so.0.1.2.5) + (gcc, creates libmodpng1412m.so.0.1.2.5) makefile.gcmmx => Linux/ELF makefile (gcc, creates - libpng12.so.0m.1.2.5, uses assembler code + libmodpng1412.so.0m.1.2.5, uses assembler code tuned for Intel MMX platform) - makefile.sgi => Silicon Graphics (cc, creates libpng12m.so) - makefile.sggcc => Silicon Graphics (gcc, creates libpng12m.so) + makefile.sgi => Silicon Graphics (cc, creates libmodpng1412m.so) + makefile.sggcc => Silicon Graphics (gcc, creates libmodpng1412m.so) Good luck, and happy coding. --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/README.trolltech +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/README.trolltech @@ -2,14 +2,14 @@ The patch is as follows: ---- //depot/qt/3/src/3rdparty/libpng/pngrutil.c#4 Thu Aug 5 15:37:03 CEST 2004 -+++ /home/dev/qt/3/src/3rdparty/libpng/pngrutil.c Thu Aug 5 15:37:03 CEST 2004 +--- //depot/qt/3/src/3rdparty/libmodpng14/pngrutil.c#4 Thu Aug 5 15:37:03 CEST 2004 ++++ /home/dev/qt/3/src/3rdparty/libmodpng14/pngrutil.c Thu Aug 5 15:37:03 CEST 2004 @@ -1241,7 +1241,7 @@ /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Missing PLTE before tRNS"); + modpng14_warning(modpng14_ptr, "Missing PLTE before tRNS"); } -- else if (length > (png_uint_32)png_ptr->num_palette) -+ if (length > (png_uint_32)png_ptr->num_palette) +- else if (length > (modpng14_uint_32)modpng14_ptr->num_palette) ++ if (length > (modpng14_uint_32)modpng14_ptr->num_palette) { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect tRNS chunk length"); + modpng14_crc_finish(modpng14_ptr, length); --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/TODO +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/TODO @@ -1,7 +1,7 @@ -TODO - list of things to do for libpng: +TODO - list of things to do for libmodpng14: Final bug fixes. -Improve API by hiding the png_struct and png_info structs. +Improve API by hiding the modpng14_struct and modpng14_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". --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/Y2KINFO +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/Y2KINFO @@ -1,4 +1,4 @@ - Y2K compliance in libpng: + Y2K compliance in libmodpng14: ========================= October 3, 2002 @@ -6,7 +6,7 @@ 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 + This is your unofficial assurance that libmodpng14 from version 0.71 and upward through 1.2.5 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. @@ -15,41 +15,41 @@ format, and will hold years up to 9999. The integer is - "png_uint_16 year" in png_time_struct. + "modpng14_uint_16 year" in modpng14_time_struct. The strings are - "png_charp time_buffer" in png_struct and + "modpng14_charp time_buffer" in modpng14_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 + modpng14_convert_to_rfc_1123() in png.c + (formerly modpng14_convert_to_rfc_1152() in error) + modpng14_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c + modpng14_convert_from_time_t() in pngwrite.c + modpng14_get_tIME() in pngget.c + modpng14_handle_tIME() in pngrutil.c, called in pngread.c + modpng14_set_tIME() in pngset.c + modpng14_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 + modpng14_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() + libmodpng14 are not passing 4-digit years into the modpng14_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 + instead of "year - 1900" into the modpng14_convert_from_struct_tm() function, + but this is not under our control. The libmodpng14 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 + zlib, upon which libmodpng14 depends, is also Y2K compliant. It contains no date-related code. Glenn Randers-Pehrson - libpng maintainer + libmodpng14 maintainer PNG Development Group --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/example.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/example.c @@ -1,12 +1,12 @@ #if 0 /* in case someone actually tries to compile this */ -/* example.c - an example of using libpng */ +/* example.c - an example of using libmodpng14 */ -/* 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 +/* This is an example of how to use libmodpng14 to read and write PNG files. + * The file libmodpng14.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 + * implementation. This is not officially part of libmodpng14, 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 @@ -16,55 +16,55 @@ * see also the programs in the contrib directory. */ -#include "png.h" +#include "modpng14.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!). + /* The modpng14_jmpbuf() macro, used in error handling, became available in + * libmodpng14 version 1.0.6. If you want to be able to run your code with older + * versions of libmodpng14, you must define the macro yourself (but only if it + * is not already defined by libmodpng14!). */ -#ifndef png_jmpbuf -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#ifndef modpng14_jmpbuf +# define modpng14_jmpbuf(modpng14_ptr) ((modpng14_ptr)->jmpbuf) #endif -/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp() +/* Check to see if a file is a PNG file using modpng14_sig_cmp(). modpng14_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 + * you should call modpng14_set_sig_bytes(modpng14_ptr, MODPNG14_BYTES_TO_CHECK); once + * you have created the modpng14_ptr, so that libmodpng14 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 + * don't call modpng14_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 + * many bytes (your fault), or you are telling libmodpng14 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(). + * to pass the bytes to modpng14_sig_cmp() or even skip that if you know + * you have a PNG file, and call modpng14_set_sig_bytes(). */ -#define PNG_BYTES_TO_CHECK 4 +#define MODPNG14_BYTES_TO_CHECK 4 int check_if_png(char *file_name, FILE **fp) { - char buf[PNG_BYTES_TO_CHECK]; + char buf[MODPNG14_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) + if (fread(buf, 1, MODPNG14_BYTES_TO_CHECK, *fp) != MODPNG14_BYTES_TO_CHECK) return 0; - /* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. + /* Compare the first MODPNG14_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)); + return(!modpng14_sig_cmp(buf, (modpng14_size_t)0, MODPNG14_BYTES_TO_CHECK)); } /* Read a PNG file. You may want to return an error code if the read @@ -76,10 +76,10 @@ #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; + modpng14_structp modpng14_ptr; + modpng14_infop info_ptr; unsigned int sig_read = 0; - png_uint_32 width, height; + modpng14_uint_32 width, height; int bit_depth, color_type, interlace_type; FILE *fp; @@ -88,45 +88,45 @@ #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; + modpng14_structp modpng14_ptr; + modpng14_infop info_ptr; + modpng14_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 + /* Create and initialize the modpng14_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); + modpng14_ptr = modpng14_create_read_struct(MODPNG14_LIBMODPNG14_VER_STRING, + modpng14_voidp user_error_ptr, user_error_fn, user_warning_fn); - if (png_ptr == NULL) + if (modpng14_ptr == NULL) { fclose(fp); return (ERROR); } /* Allocate/initialize the memory for image information. REQUIRED. */ - info_ptr = png_create_info_struct(png_ptr); + info_ptr = modpng14_create_info_struct(modpng14_ptr); if (info_ptr == NULL) { fclose(fp); - png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + modpng14_destroy_read_struct(&modpng14_ptr, modpng14_infopp_NULL, modpng14_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. + * the normal method of doing things with libmodpng14). REQUIRED unless you + * set up your own error handlers in the modpng14_create_read_struct() earlier. */ - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_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); + /* Free all of the memory associated with the modpng14_ptr and info_ptr */ + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, modpng14_infopp_NULL); fclose(fp); /* If we get here, we had a problem reading the file */ return (ERROR); @@ -135,38 +135,38 @@ /* 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); + modpng14_init_io(modpng14_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: + * modpng14_init_io() here you would call: */ - png_set_read_fn(png_ptr, (void *)user_io_ptr, user_read_fn); + modpng14_set_read_fn(modpng14_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); + modpng14_set_sig_bytes(modpng14_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 + * with one of the MODPNG14_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); + modpng14_read_png(modpng14_ptr, info_ptr, modpng14_transforms, modpng14_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 + /* The call to modpng14_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); + modpng14_read_info(modpng14_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + modpng14_get_IHDR(modpng14_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 @@ -175,36 +175,36 @@ * are mutually exclusive. */ - /* tell libpng to strip 16 bit/color files down to 8 bits/color */ - png_set_strip_16(png_ptr); + /* tell libmodpng14 to strip 16 bit/color files down to 8 bits/color */ + modpng14_set_strip_16(modpng14_ptr); /* Strip alpha bytes from the input data without combining with the * background (not recommended). */ - png_set_strip_alpha(png_ptr); + modpng14_set_strip_alpha(modpng14_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); + modpng14_set_packing(modpng14_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); + * (not useful if you are using modpng14_set_packing). */ + modpng14_set_packswap(modpng14_ptr); /* Expand paletted colors into true RGB triplets */ - if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_palette_rgb(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) + modpng14_set_palette_rgb(modpng14_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); + if (color_type == MODPNG14_COLOR_TYPE_GRAY && bit_depth < 8) + modpng14_set_gray_1_2_4_to_8(modpng14_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); + if (modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_tRNS)) + modpng14_set_tRNS_to_alpha(modpng14_ptr); /* Set the background color to draw transparent and alpha images over. * It is possible to set the red, green, and blue components directly @@ -213,14 +213,14 @@ * use it - you should use the (solid) application background if it has one. */ - png_color_16 my_background, *image_background; + modpng14_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); + if (modpng14_get_bKGD(modpng14_ptr, info_ptr, &image_background)) + modpng14_set_background(modpng14_ptr, image_background, + MODPNG14_BACKGROUND_GAMMA_FILE, 1, 1.0); else - png_set_background(png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + modpng14_set_background(modpng14_ptr, &my_background, + MODPNG14_BACKGROUND_GAMMA_SCREEN, 0, 1.0); /* Some suggestions as to how to get a screen gamma value */ @@ -243,7 +243,7 @@ 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 + /* Tell libmodpng14 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. @@ -251,100 +251,100 @@ int intent; - if (png_get_sRGB(png_ptr, info_ptr, &intent)) - png_set_gamma(png_ptr, screen_gamma, 0.45455); + if (modpng14_get_sRGB(modpng14_ptr, info_ptr, &intent)) + modpng14_set_gamma(modpng14_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); + if (modpng14_get_gAMA(modpng14_ptr, info_ptr, &image_gamma)) + modpng14_set_gamma(modpng14_ptr, screen_gamma, image_gamma); else - png_set_gamma(png_ptr, screen_gamma, 0.45455); + modpng14_set_gamma(modpng14_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) + if (color_type & MODPNG14_COLOR_MASK_COLOR) { int num_palette; - png_colorp palette; + modpng14_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]; + modpng14_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); + modpng14_set_dither(modpng14_ptr, std_color_cube, MAX_SCREEN_COLORS, + MAX_SCREEN_COLORS, modpng14_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)) + else if (modpng14_get_PLTE(modpng14_ptr, info_ptr, &palette, &num_palette)) { - png_uint_16p histogram = NULL; + modpng14_uint_16p histogram = NULL; - png_get_hIST(png_ptr, info_ptr, &histogram); + modpng14_get_hIST(modpng14_ptr, info_ptr, &histogram); - png_set_dither(png_ptr, palette, num_palette, + modpng14_set_dither(modpng14_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); + modpng14_set_invert_mono(modpng14_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)) + if (modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_sBIT)) { - png_color_8p sig_bit; + modpng14_color_8p sig_bit; - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - png_set_shift(png_ptr, sig_bit); + modpng14_get_sBIT(modpng14_ptr, info_ptr, &sig_bit); + modpng14_set_shift(modpng14_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); + if (color_type & MODPNG14_COLOR_MASK_COLOR) + modpng14_set_bgr(modpng14_ptr); /* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */ - png_set_swap_alpha(png_ptr); + modpng14_set_swap_alpha(modpng14_ptr); /* swap bytes of 16 bit files to least significant byte first */ - png_set_swap(png_ptr); + modpng14_set_swap(modpng14_ptr); /* Add filler (or alpha) byte (before/after each RGB triplet) */ - png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); + modpng14_set_filler(modpng14_ptr, 0xff, MODPNG14_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: + * modpng14_read_image(). To see how to handle interlacing passes, + * see the modpng14_read_row() method below: */ - number_passes = png_set_interlace_handling(png_ptr); + number_passes = modpng14_set_interlace_handling(modpng14_ptr); /* Optional call to gamma correct and add the background to the palette - * and update info structure. REQUIRED if you are expecting libpng to + * and update info structure. REQUIRED if you are expecting libmodpng14 to * update the palette for you (ie you selected such a transform above). */ - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_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]; + modpng14_bytep row_pointers[height]; for (row = 0; row < height; row++) { - row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, + row_pointers[row] = modpng14_malloc(modpng14_ptr, modpng14_get_rowbytes(modpng14_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); + modpng14_read_image(modpng14_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: */ @@ -354,17 +354,17 @@ #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); + modpng14_read_rows(modpng14_ptr, &row_pointers[y], modpng14_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, + modpng14_read_rows(modpng14_ptr, &row_pointers[y], modpng14_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], + modpng14_read_rows(modpng14_ptr, modpng14_bytepp_NULL, &row_pointers[y], number_of_rows); #endif no_sparkle /* use only one of these two methods */ } @@ -376,13 +376,13 @@ #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); + modpng14_read_end(modpng14_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); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, modpng14_infopp_NULL); /* close the file */ fclose(fp); @@ -394,34 +394,34 @@ /* progressively read a file */ int -initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr) +initialize_modpng14_reader(modpng14_structp *modpng14_ptr, modpng14_infop *info_ptr) { - /* Create and initialize the png_struct with the desired error handler + /* Create and initialize the modpng14_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); + *modpng14_ptr = modpng14_create_read_struct(MODPNG14_LIBMODPNG14_VER_STRING, + modpng14_voidp user_error_ptr, user_error_fn, user_warning_fn); - if (*png_ptr == NULL) + if (*modpng14_ptr == NULL) { *info_ptr = NULL; return (ERROR); } - *info_ptr = png_create_info_struct(png_ptr); + *info_ptr = modpng14_create_info_struct(modpng14_ptr); if (*info_ptr == NULL) { - png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL); + modpng14_destroy_read_struct(modpng14_ptr, info_ptr, modpng14_infopp_NULL); return (ERROR); } - if (setjmp(png_jmpbuf((*png_ptr)))) + if (setjmp(modpng14_jmpbuf((*modpng14_ptr)))) { - png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL); + modpng14_destroy_read_struct(modpng14_ptr, info_ptr, modpng14_infopp_NULL); return (ERROR); } @@ -429,28 +429,28 @@ * 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(). + * you need to call modpng14_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). + * the function modpng14_get_progressive_ptr(modpng14_ptr). */ - png_set_progressive_read_fn(*png_ptr, (void *)stream_data, + modpng14_set_progressive_read_fn(*modpng14_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) +process_data(modpng14_structp *modpng14_ptr, modpng14_infop *info_ptr, + modpng14_bytep buffer, modpng14_uint_32 length) { - if (setjmp(png_jmpbuf((*png_ptr)))) + if (setjmp(modpng14_jmpbuf((*modpng14_ptr)))) { - /* Free the png_ptr and info_ptr memory on error */ - png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL); + /* Free the modpng14_ptr and info_ptr memory on error */ + modpng14_destroy_read_struct(modpng14_ptr, info_ptr, modpng14_infopp_NULL); return (ERROR); } @@ -464,23 +464,23 @@ * 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); + modpng14_process_data(*modpng14_ptr, *info_ptr, buffer, length); return (OK); } -info_callback(png_structp png_ptr, png_infop info) +info_callback(modpng14_structp modpng14_ptr, modpng14_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() + * call either modpng14_start_read_image() or modpng14_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() + * any). You may start getting rows before modpng14_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) +row_callback(modpng14_structp modpng14_ptr, modpng14_bytep new_row, + modpng14_uint_32 row_num, int pass) { /* * This function is called for every row in the image. If the @@ -488,14 +488,14 @@ * 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 + * libmodpng14 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 + * modpng14_progressive_combine_row() to replace the corresponding row as * shown below: */ /* Check if row_num is in bounds. */ @@ -504,13 +504,13 @@ /* Get pointer to corresponding row in our * PNG read buffer. */ - png_bytep old_row = ((png_bytep *)our_data)[row_num]; + modpng14_bytep old_row = ((modpng14_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); + modpng14_progressive_combine_row(modpng14_ptr, old_row, new_row); } /* * The rows and passes are called in order, so you don't really @@ -518,14 +518,14 @@ * 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 + * modpng14_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 + * (it just does the modpng14_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); + modpng14_progressive_combine_row(modpng14_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 @@ -536,7 +536,7 @@ */ } -end_callback(png_structp png_ptr, png_infop info) +end_callback(modpng14_structp modpng14_ptr, modpng14_infop info) { /* this function is called when the whole image has been read, * including any chunks after the image (up to and including @@ -553,58 +553,58 @@ void write_png(char *file_name /* , ... other image information ... */) { FILE *fp; - png_structp png_ptr; - png_infop info_ptr; - png_colorp palette; + modpng14_structp modpng14_ptr; + modpng14_infop info_ptr; + modpng14_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 + /* Create and initialize the modpng14_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); + modpng14_ptr = modpng14_create_write_struct(MODPNG14_LIBMODPNG14_VER_STRING, + modpng14_voidp user_error_ptr, user_error_fn, user_warning_fn); - if (png_ptr == NULL) + if (modpng14_ptr == NULL) { fclose(fp); return (ERROR); } /* Allocate/initialize the image information data. REQUIRED */ - info_ptr = png_create_info_struct(png_ptr); + info_ptr = modpng14_create_info_struct(modpng14_ptr); if (info_ptr == NULL) { fclose(fp); - png_destroy_write_struct(&png_ptr, png_infopp_NULL); + modpng14_destroy_write_struct(&modpng14_ptr, modpng14_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. + * error handling functions in the modpng14_create_write_struct() call. */ - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { /* If we get here, we had a problem reading the file */ fclose(fp); - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_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); + modpng14_init_io(modpng14_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, + * modpng14_init_io() here you would call */ + modpng14_set_write_fn(modpng14_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 */ @@ -612,29 +612,29 @@ #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. + * MODPNG14_TRANSFORM flags into the modpng14_transforms integer here. */ - png_write_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL); + modpng14_write_png(modpng14_ptr, info_ptr, modpng14_transforms, modpng14_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 + * the color_type selected. color_type is one of MODPNG14_COLOR_TYPE_GRAY, + * MODPNG14_COLOR_TYPE_GRAY_ALPHA, MODPNG14_COLOR_TYPE_PALETTE, MODPNG14_COLOR_TYPE_RGB, + * or MODPNG14_COLOR_TYPE_RGB_ALPHA. interlace is either MODPNG14_INTERLACE_NONE or + * MODPNG14_INTERLACE_ADAM7, and the compression_type and filter_type MUST + * currently be MODPNG14_COMPRESSION_TYPE_BASE and MODPNG14_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); + modpng14_set_IHDR(modpng14_ptr, info_ptr, width, height, bit_depth, MODPNG14_COLOR_TYPE_???, + MODPNG14_INTERLACE_????, MODPNG14_COMPRESSION_TYPE_BASE, MODPNG14_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)); + palette = (modpng14_colorp)modpng14_malloc(modpng14_ptr, MODPNG14_MAX_PALETTE_LENGTH + * sizeof (modpng14_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 + modpng14_set_PLTE(modpng14_ptr, info_ptr, palette, MODPNG14_MAX_PALETTE_LENGTH); + /* You must not free palette here, because modpng14_set_PLTE only makes a link to the palette that you malloced. Wait until you are about to destroy the png structure. */ @@ -647,52 +647,52 @@ 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); + modpng14_set_sBIT(modpng14_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); + modpng14_set_gAMA(modpng14_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[0].compression = MODPNG14_TEXT_COMPRESSION_NONE; text_ptr[1].key = "Author"; text_ptr[1].text = "Leonardo DaVinci"; - text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[1].compression = MODPNG14_TEXT_COMPRESSION_NONE; text_ptr[2].key = "Description"; text_ptr[2].text = ""; - text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt; -#ifdef PNG_iTXt_SUPPORTED + text_ptr[2].compression = MODPNG14_TEXT_COMPRESSION_zTXt; +#ifdef MODPNG14_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); + modpng14_set_text(modpng14_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); + modpng14_write_info(modpng14_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); + * modpng14_write_info_before_PLTE(write_ptr, write_info_ptr); * write_my_chunk(); - * png_write_info(png_ptr, info_ptr); + * modpng14_write_info(modpng14_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 + * chunks gets changed to MODPNG14_TEXT_COMPRESSION_NONE_WR or + * MODPNG14_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again * at the end. */ @@ -701,36 +701,36 @@ */ /* invert monochrome pixels */ - png_set_invert_mono(png_ptr); + modpng14_set_invert_mono(modpng14_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); + modpng14_set_shift(modpng14_ptr, &sig_bit); /* pack pixels into bytes */ - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); /* swap location of alpha bytes from ARGB to RGBA */ - png_set_swap_alpha(png_ptr); + modpng14_set_swap_alpha(modpng14_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); + modpng14_set_filler(modpng14_ptr, 0, MODPNG14_FILLER_BEFORE); /* flip BGR pixels to RGB */ - png_set_bgr(png_ptr); + modpng14_set_bgr(modpng14_ptr); /* swap bytes of 16-bit files to most significant byte first */ - png_set_swap(png_ptr); + modpng14_set_swap(modpng14_ptr); /* swap bits of 1, 2, 4 bit packed pixel formats */ - png_set_packswap(png_ptr); + modpng14_set_packswap(modpng14_ptr); - /* turn on interlace handling if you are not using png_write_image() */ + /* turn on interlace handling if you are not using modpng14_write_image() */ if (interlacing) - number_passes = png_set_interlace_handling(png_ptr); + number_passes = modpng14_set_interlace_handling(modpng14_ptr); else number_passes = 1; @@ -738,15 +738,15 @@ * 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]; + modpng14_uint_32 k, height, width; + modpng14_byte image[height][width*bytes_per_pixel]; + modpng14_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); + modpng14_write_image(modpng14_ptr, row_pointers); /* the other way to write the image - deal with interlacing */ @@ -757,42 +757,42 @@ 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); + modpng14_write_rows(modpng14_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); + modpng14_write_rows(modpng14_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 + * chunks are supported and you can use modpng14_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); + modpng14_write_end(modpng14_ptr, info_ptr); #endif hilevel - /* If you png_malloced a palette, free it here (don't free info_ptr->palette, + /* If you modpng14_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); + libmodpng14 mallocs info_ptr->palette, libmodpng14 will free it). If you + allocated it with malloc() instead of modpng14_malloc(), use free() instead + of modpng14_free(). */ + modpng14_free(modpng14_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); + /* Similarly, if you modpng14_malloced any data that you passed in with + modpng14_set_something(), such as a hist or trans array, free it here, + when you can be sure that libmodpng14 is through with it. */ + modpng14_free(modpng14_ptr, trans); trans=NULL; /* clean up after the write, and free any memory allocated */ - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); /* close the file */ fclose(fp); --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/libpng.3 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/libpng.3 @@ -1,845 +1,845 @@ .TH LIBPNG 3 "October 3, 2002" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.2.5 +libmodpng14 \- Portable Network Graphics (PNG) Reference Library 1.2.5 .SH SYNOPSIS \fI\fB -\fB#include \fP +\fB#include \fP \fI\fB -\fBpng_uint_32 png_access_version_number \fI(void\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_access_version_number \fI(void\fP\fB);\fP \fI\fB -\fBint png_check_sig (png_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP +\fBint modpng14_check_sig (modpng14_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP \fI\fB -\fBvoid png_chunk_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP +\fBvoid modpng14_chunk_error (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_const_charp \fIerror\fP\fB);\fP \fI\fB -\fBvoid png_chunk_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP +\fBvoid modpng14_chunk_warning (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_const_charp \fImessage\fP\fB);\fP \fI\fB -\fBvoid png_convert_from_struct_tm (png_timep \fP\fIptime\fP\fB, struct tm FAR * \fIttime\fP\fB);\fP +\fBvoid modpng14_convert_from_struct_tm (modpng14_timep \fP\fIptime\fP\fB, struct tm FAR * \fIttime\fP\fB);\fP \fI\fB -\fBvoid png_convert_from_time_t (png_timep \fP\fIptime\fP\fB, time_t \fIttime\fP\fB);\fP +\fBvoid modpng14_convert_from_time_t (modpng14_timep \fP\fIptime\fP\fB, time_t \fIttime\fP\fB);\fP \fI\fB -\fBpng_charp png_convert_to_rfc1123 (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fIptime\fP\fB);\fP +\fBmodpng14_charp modpng14_convert_to_rfc1123 (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_timep \fIptime\fP\fB);\fP \fI\fB -\fBpng_infop png_create_info_struct (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_infop modpng14_create_info_struct (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_structp png_create_read_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP +\fBmodpng14_structp modpng14_create_read_struct (modpng14_const_charp \fP\fIuser_modpng14_ver\fP\fB, modpng14_voidp \fP\fIerror_ptr\fP\fB, modpng14_error_ptr \fP\fIerror_fn\fP\fB, modpng14_error_ptr \fIwarn_fn\fP\fB);\fP \fI\fB -\fBpng_structp png_create_read_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP +\fBmodpng14_structp modpng14_create_read_struct_2(modpng14_const_charp \fP\fIuser_modpng14_ver\fP\fB, modpng14_voidp \fP\fIerror_ptr\fP\fB, modpng14_error_ptr \fP\fIerror_fn\fP\fB, modpng14_error_ptr \fP\fIwarn_fn\fP\fB, modpng14_voidp \fP\fImem_ptr\fP\fB, modpng14_malloc_ptr \fP\fImalloc_fn\fP\fB, modpng14_free_ptr \fIfree_fn\fP\fB);\fP \fI\fB -\fBpng_structp png_create_write_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP +\fBmodpng14_structp modpng14_create_write_struct (modpng14_const_charp \fP\fIuser_modpng14_ver\fP\fB, modpng14_voidp \fP\fIerror_ptr\fP\fB, modpng14_error_ptr \fP\fIerror_fn\fP\fB, modpng14_error_ptr \fIwarn_fn\fP\fB);\fP \fI\fB -\fBpng_structp png_create_write_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP +\fBmodpng14_structp modpng14_create_write_struct_2(modpng14_const_charp \fP\fIuser_modpng14_ver\fP\fB, modpng14_voidp \fP\fIerror_ptr\fP\fB, modpng14_error_ptr \fP\fIerror_fn\fP\fB, modpng14_error_ptr \fP\fIwarn_fn\fP\fB, modpng14_voidp \fP\fImem_ptr\fP\fB, modpng14_malloc_ptr \fP\fImalloc_fn\fP\fB, modpng14_free_ptr \fIfree_fn\fP\fB);\fP \fI\fB -\fBint png_debug(int \fP\fIlevel\fP\fB, png_const_charp \fImessage\fP\fB);\fP +\fBint modpng14_debug(int \fP\fIlevel\fP\fB, modpng14_const_charp \fImessage\fP\fB);\fP \fI\fB -\fBint png_debug1(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP +\fBint modpng14_debug1(int \fP\fIlevel\fP\fB, modpng14_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP \fI\fB -\fBint png_debug2(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP +\fBint modpng14_debug2(int \fP\fIlevel\fP\fB, modpng14_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP \fI\fB -\fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP +\fBvoid modpng14_destroy_info_struct (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infopp \fIinfo_ptr_ptr\fP\fB);\fP \fI\fB -\fBvoid png_destroy_read_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fP\fIinfo_ptr_ptr\fP\fB, png_infopp \fIend_info_ptr_ptr\fP\fB);\fP +\fBvoid modpng14_destroy_read_struct (modpng14_structpp \fP\fImodpng14_ptr_ptr\fP\fB, modpng14_infopp \fP\fIinfo_ptr_ptr\fP\fB, modpng14_infopp \fIend_info_ptr_ptr\fP\fB);\fP \fI\fB -\fBvoid png_destroy_write_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP +\fBvoid modpng14_destroy_write_struct (modpng14_structpp \fP\fImodpng14_ptr_ptr\fP\fB, modpng14_infopp \fIinfo_ptr_ptr\fP\fB);\fP \fI\fB -\fBvoid png_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP +\fBvoid modpng14_error (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_const_charp \fIerror\fP\fB);\fP \fI\fB -\fBvoid png_free (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP +\fBvoid modpng14_free (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fIptr\fP\fB);\fP \fI\fB -\fBvoid png_free_chunk_list (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_free_chunk_list (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_free_default(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP +\fBvoid modpng14_free_default(modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fIptr\fP\fB);\fP \fI\fB -\fBvoid png_free_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum\fP\fB);\fP +\fBvoid modpng14_free_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fInum\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_asm_flags (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_asm_flags (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_bit_depth (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_bKGD (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_color_16p \fI*background\fP\fB);\fP \fI\fB -\fBpng_byte png_get_channels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_channels (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_cHRM (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_cHRM_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fI*white_x\fP\fB, modpng14_uint_32 \fP\fI*white_y\fP\fB, modpng14_uint_32 \fP\fI*red_x\fP\fB, modpng14_uint_32 \fP\fI*red_y\fP\fB, modpng14_uint_32 \fP\fI*green_x\fP\fB, modpng14_uint_32 \fP\fI*green_y\fP\fB, modpng14_uint_32 \fP\fI*blue_x\fP\fB, modpng14_uint_32 \fI*blue_y\fP\fB);\fP \fI\fB -\fBpng_byte png_get_color_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_color_type (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_compression_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_compression_type (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_copyright (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_copyright (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_error_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_get_error_ptr (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_filter_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_filter_type (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_gAMA (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_gAMA_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fI*int_file_gamma\fP\fB);\fP \fI\fB -\fBpng_byte png_get_header_ver (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_header_ver (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_header_version (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_header_version (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_hIST (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_16p \fI*hist\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_charpp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_iCCP (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, modpng14_charpp \fP\fIprofile\fP\fB, modpng14_uint_32 \fI*proflen\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*width\fP\fB, png_uint_32 \fP\fI*height\fP\fB, int \fP\fI*bit_depth\fP\fB, int \fP\fI*color_type\fP\fB, int \fP\fI*interlace_type\fP\fB, int \fP\fI*compression_type\fP\fB, int \fI*filter_type\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_IHDR (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fI*width\fP\fB, modpng14_uint_32 \fP\fI*height\fP\fB, int \fP\fI*bit_depth\fP\fB, int \fP\fI*color_type\fP\fB, int \fP\fI*interlace_type\fP\fB, int \fP\fI*compression_type\fP\fB, int \fI*filter_type\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_image_height (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_image_height (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_image_width (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_image_width (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_interlace_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_interlace_type (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_io_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_get_io_ptr (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_libpng_ver (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_libmodpng14_ver (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_mem_ptr(png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_get_mem_ptr(modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_mmx_bitdepth_threshold (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_byte modpng14_get_mmx_bitdepth_threshold (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_mmx_flagmask (int \fP\fIflag_select\fP\fB, int \fI*compilerID\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_mmx_flagmask (int \fP\fIflag_select\fP\fB, int \fI*compilerID\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_mmx_rowbytes_threshold (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_mmx_rowbytes_threshold (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_oFFs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fI*offset_x\fP\fB, modpng14_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_pCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_charp \fP\fI*purpose\fP\fB, modpng14_int_32 \fP\fI*X0\fP\fB, modpng14_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, modpng14_charp \fP\fI*units\fP\fB, modpng14_charpp \fI*params\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_pHYs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fI*res_x\fP\fB, modpng14_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP \fI\fB -\fBfloat png_get_pixel_aspect_ratio (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBfloat modpng14_get_pixel_aspect_ratio (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_pixels_per_meter (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_progressive_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_get_progressive_ptr (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_PLTE (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP \fI\fB -\fBpng_byte png_get_rgb_to_gray_status (png_structp \fIpng_ptr) +\fBmodpng14_byte modpng14_get_rgb_to_gray_status (modpng14_structp \fImodpng14_ptr) -\fBpng_uint_32 png_get_rowbytes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_rowbytes (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_bytepp png_get_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_bytepp modpng14_get_rows (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_sBIT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_color_8p \fI*sig_bit\fP\fB);\fP \fI\fB -\fBpng_bytep png_get_signature (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_bytep modpng14_get_signature (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_sPLT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_spalette_p \fI*splt_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_sRGB (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_text (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_tIME (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_timep \fI*mod_time\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_values\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_tRNS (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_bytep \fP\fI*trans\fP\fB, int \fP\fI*num_trans\fP\fB, modpng14_color_16p \fI*trans_values\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_unknown_chunks (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_unknown_chunkpp \fIunknowns\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_user_chunk_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_get_user_chunk_ptr (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_get_user_transform_ptr (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_valid (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIflag\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_int_32 modpng14_get_x_offset_microns (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_int_32 modpng14_get_x_offset_pixels (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_x_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_x_pixels_per_meter (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_int_32 modpng14_get_y_offset_microns (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_int_32 modpng14_get_y_offset_pixels (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_y_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_y_pixels_per_meter (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_compression_buffer_size (png_structp \fIpng_ptr\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_compression_buffer_size (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP +\fBint modpng14_handle_as_unknown (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fIchunk_name\fP\fB);\fP \fI\fB -\fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP +\fBvoid modpng14_init_io (modpng14_structp \fP\fImodpng14_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_info_init (png_infop \fIinfo_ptr\fP\fB);\fP +\fBDEPRECATED: void modpng14_info_init (modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_info_init_2 (png_infopp \fP\fIptr_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP +\fBDEPRECATED: void modpng14_info_init_2 (modpng14_infopp \fP\fIptr_ptr\fP\fB, modpng14_size_t \fImodpng14_info_struct_size\fP\fB);\fP \fI\fB -\fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP +\fBmodpng14_voidp modpng14_malloc (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIsize\fP\fB);\fP \fI\fB -\fBpng_voidp png_malloc_default(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP +\fBmodpng14_voidp modpng14_malloc_default(modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIsize\fP\fB);\fP \fI\fB -\fBpng_voidp png_malloc_warn (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP +\fBmodpng14_voidp modpng14_malloc_warn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIsize\fP\fB);\fP \fI\fB -\fBvoidp png_memcpy (png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_size_t \fIsize\fP\fB);\fP +\fBvoidp modpng14_memcpy (modpng14_voidp \fP\fIs1\fP\fB, modpng14_voidp \fP\fIs2\fP\fB, modpng14_size_t \fIsize\fP\fB);\fP \fI\fB -\fBpng_voidp png_memcpy_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_uint_32 \fIsize\fP\fB);\fP +\fBmodpng14_voidp modpng14_memcpy_check (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIs1\fP\fB, modpng14_voidp \fP\fIs2\fP\fB, modpng14_uint_32 \fIsize\fP\fB);\fP \fI\fB -\fBvoidp png_memset (png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_size_t \fIsize\fP\fB);\fP +\fBvoidp modpng14_memset (modpng14_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, modpng14_size_t \fIsize\fP\fB);\fP \fI\fB -\fBpng_voidp png_memset_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_uint_32 \fIsize\fP\fB);\fP +\fBmodpng14_voidp modpng14_memset_check (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, modpng14_uint_32 \fIsize\fP\fB);\fP \fI\fB -\fBint png_mmx_support \fI(void\fP\fB);\fP +\fBint modpng14_mmx_support \fI(void\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP +\fBDEPRECATED: void modpng14_permit_empty_plte (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP \fI\fB -\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_size\fP\fB);\fP +\fBvoid modpng14_process_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_bytep \fP\fIbuffer\fP\fB, modpng14_size_t \fIbuffer_size\fP\fB);\fP \fI\fB -\fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP +\fBvoid modpng14_progressive_combine_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIold_row\fP\fB, modpng14_bytep \fInew_row\fP\fB);\fP \fI\fB -\fBvoid png_read_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_infop \fIend_info_ptr\fP\fB);\fP +\fBvoid modpng14_read_destroy (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_infop \fIend_info_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_read_end (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP +\fBvoid modpng14_read_image (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytepp \fIimage\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_read_init (png_structp \fIpng_ptr\fP\fB);\fP +\fBDEPRECATED: void modpng14_read_init (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_read_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP +\fBDEPRECATED: void modpng14_read_init_2 (modpng14_structpp \fP\fIptr_ptr\fP\fB, modpng14_const_charp \fP\fIuser_modpng14_ver\fP\fB, modpng14_size_t \fP\fImodpng14_struct_size\fP\fB, modpng14_size_t \fImodpng14_info_size\fP\fB);\fP \fI\fB -\fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_read_info (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP +\fBvoid modpng14_read_png (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, modpng14_voidp \fIparams\fP\fB);\fP \fI\fB -\fBvoid png_read_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fIdisplay_row\fP\fB);\fP +\fBvoid modpng14_read_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_bytep \fIdisplay_row\fP\fB);\fP \fI\fB -\fBvoid png_read_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_bytepp \fP\fIdisplay_row\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP +\fBvoid modpng14_read_rows (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytepp \fP\fIrow\fP\fB, modpng14_bytepp \fP\fIdisplay_row\fP\fB, modpng14_uint_32 \fInum_rows\fP\fB);\fP \fI\fB -\fBvoid png_read_update_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_read_update_info (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_set_asm_flags (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIasm_flags\fP\fB);\fP +\fBmodpng14_set_asm_flags (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIasm_flags\fP\fB);\fP \fI\fB -\fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP +\fBvoid modpng14_set_background (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP \fI\fB -\fBvoid png_set_bgr (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_bgr (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP +\fBvoid modpng14_set_bKGD (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_color_16p \fIbackground\fP\fB);\fP \fI\fB -\fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP +\fBvoid modpng14_set_cHRM (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP \fI\fB -\fBvoid png_set_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP +\fBvoid modpng14_set_cHRM_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fIwhite_x\fP\fB, modpng14_uint_32 \fP\fIwhite_y\fP\fB, modpng14_uint_32 \fP\fIred_x\fP\fB, modpng14_uint_32 \fP\fIred_y\fP\fB, modpng14_uint_32 \fP\fIgreen_x\fP\fB, modpng14_uint_32 \fP\fIgreen_y\fP\fB, modpng14_uint_32 \fP\fIblue_x\fP\fB, modpng14_uint_32 \fIblue_y\fP\fB);\fP \fI\fB -\fBvoid png_set_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP +\fBvoid modpng14_set_compression_level (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fIlevel\fP\fB);\fP \fI\fB -\fBvoid png_set_compression_mem_level (png_structp \fP\fIpng_ptr\fP\fB, int \fImem_level\fP\fB);\fP +\fBvoid modpng14_set_compression_mem_level (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fImem_level\fP\fB);\fP \fI\fB -\fBvoid png_set_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP +\fBvoid modpng14_set_compression_method (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fImethod\fP\fB);\fP \fI\fB -\fBvoid png_set_compression_strategy (png_structp \fP\fIpng_ptr\fP\fB, int \fIstrategy\fP\fB);\fP +\fBvoid modpng14_set_compression_strategy (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fIstrategy\fP\fB);\fP \fI\fB -\fBvoid png_set_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP +\fBvoid modpng14_set_compression_window_bits (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP \fI\fB -\fBvoid png_set_crc_action (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcrit_action\fP\fB, int \fIancil_action\fP\fB);\fP +\fBvoid modpng14_set_crc_action (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fIcrit_action\fP\fB, int \fIancil_action\fP\fB);\fP \fI\fB -\fBvoid png_set_dither (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fP\fInum_palette\fP\fB, int \fP\fImaximum_colors\fP\fB, png_uint_16p \fP\fIhistogram\fP\fB, int \fIfull_dither\fP\fB);\fP +\fBvoid modpng14_set_dither (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_colorp \fP\fIpalette\fP\fB, int \fP\fInum_palette\fP\fB, int \fP\fImaximum_colors\fP\fB, modpng14_uint_16p \fP\fIhistogram\fP\fB, int \fIfull_dither\fP\fB);\fP \fI\fB -\fBvoid png_set_error_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarning_fn\fP\fB);\fP +\fBvoid modpng14_set_error_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIerror_ptr\fP\fB, modpng14_error_ptr \fP\fIerror_fn\fP\fB, modpng14_error_ptr \fIwarning_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_expand (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_expand (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP +\fBvoid modpng14_set_filler (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP \fI\fB -\fBvoid png_set_filter (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP +\fBvoid modpng14_set_filter (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP \fI\fB -\fBvoid png_set_filter_heuristics (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_doublep \fP\fIfilter_weights\fP\fB, png_doublep \fIfilter_costs\fP\fB);\fP +\fBvoid modpng14_set_filter_heuristics (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, modpng14_doublep \fP\fIfilter_weights\fP\fB, modpng14_doublep \fIfilter_costs\fP\fB);\fP \fI\fB -\fBvoid png_set_flush (png_structp \fP\fIpng_ptr\fP\fB, int \fInrows\fP\fB);\fP +\fBvoid modpng14_set_flush (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fInrows\fP\fB);\fP \fI\fB -\fBvoid png_set_gamma (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIscreen_gamma\fP\fB, double \fIdefault_file_gamma\fP\fB);\fP +\fBvoid modpng14_set_gamma (modpng14_structp \fP\fImodpng14_ptr\fP\fB, double \fP\fIscreen_gamma\fP\fB, double \fIdefault_file_gamma\fP\fB);\fP \fI\fB -\fBvoid png_set_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP +\fBvoid modpng14_set_gAMA (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP \fI\fB -\fBvoid png_set_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIfile_gamma\fP\fB);\fP +\fBvoid modpng14_set_gAMA_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIfile_gamma\fP\fB);\fP \fI\fB -\fBvoid png_set_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_gray_1_2_4_to_8(modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_gray_to_rgb (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP +\fBvoid modpng14_set_hIST (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_16p \fIhist\fP\fB);\fP \fI\fB -\fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP +\fBvoid modpng14_set_iCCP (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, modpng14_charp \fP\fIprofile\fP\fB, modpng14_uint_32 \fIproflen\fP\fB);\fP \fI\fB -\fBint png_set_interlace_handling (png_structp \fIpng_ptr\fP\fB);\fP +\fBint modpng14_set_interlace_handling (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_invalid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fImask\fP\fB);\fP +\fBvoid modpng14_set_invalid (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fImask\fP\fB);\fP \fI\fB -\fBvoid png_set_invert_alpha (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_invert_alpha (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_invert_mono (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_invert_mono (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP +\fBvoid modpng14_set_IHDR (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fIwidth\fP\fB, modpng14_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP \fI\fB -\fBvoid png_set_keep_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIkeep\fP\fB, png_bytep \fP\fIchunk_list\fP\fB, int \fInum_chunks\fP\fB);\fP +\fBvoid modpng14_set_keep_unknown_chunks (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fIkeep\fP\fB, modpng14_bytep \fP\fIchunk_list\fP\fB, int \fInum_chunks\fP\fB);\fP \fI\fB -\fBvoid png_set_mem_fn(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP +\fBvoid modpng14_set_mem_fn(modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fImem_ptr\fP\fB, modpng14_malloc_ptr \fP\fImalloc_fn\fP\fB, modpng14_free_ptr \fIfree_fn\fP\fB);\fP \fI\fB -\fBpng_set_mmx_thresholds (png_structp \fP\fIpng_ptr\fP\fB, png_byte \fP\fImmx_bitdepth_threshold\fP\fB, png_uint_32 \fImmx_rowbytes_threshold\fP\fB);\fP +\fBmodpng14_set_mmx_thresholds (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_byte \fP\fImmx_bitdepth_threshold\fP\fB, modpng14_uint_32 \fImmx_rowbytes_threshold\fP\fB);\fP \fI\fB -\fBvoid png_set_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIoffset_x\fP\fB, png_uint_32 \fP\fIoffset_y\fP\fB, int \fIunit_type\fP\fB);\fP +\fBvoid modpng14_set_oFFs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fIoffset_x\fP\fB, modpng14_uint_32 \fP\fIoffset_y\fP\fB, int \fIunit_type\fP\fB);\fP \fI\fB -\fBvoid png_set_packing (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_packing (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_packswap (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_packswap (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_palette_to_rgb(png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_palette_to_rgb(modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP +\fBvoid modpng14_set_pCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_charp \fP\fIpurpose\fP\fB, modpng14_int_32 \fP\fIX0\fP\fB, modpng14_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, modpng14_charp \fP\fIunits\fP\fB, modpng14_charpp \fIparams\fP\fB);\fP \fI\fB -\fBvoid png_set_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIres_x\fP\fB, png_uint_32 \fP\fIres_y\fP\fB, int \fIunit_type\fP\fB);\fP +\fBvoid modpng14_set_pHYs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fP\fIres_x\fP\fB, modpng14_uint_32 \fP\fIres_y\fP\fB, int \fIunit_type\fP\fB);\fP \fI\fB -\fBvoid png_set_progressive_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIprogressive_ptr\fP\fB, png_progressive_info_ptr \fP\fIinfo_fn\fP\fB, png_progressive_row_ptr \fP\fIrow_fn\fP\fB, png_progressive_end_ptr \fIend_fn\fP\fB);\fP +\fBvoid modpng14_set_progressive_read_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIprogressive_ptr\fP\fB, modpng14_progressive_info_ptr \fP\fIinfo_fn\fP\fB, modpng14_progressive_row_ptr \fP\fIrow_fn\fP\fB, modpng14_progressive_end_ptr \fIend_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP +\fBvoid modpng14_set_PLTE (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP \fI\fB -\fBvoid png_set_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fIread_data_fn\fP\fB);\fP +\fBvoid modpng14_set_read_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIio_ptr\fP\fB, modpng14_rw_ptr \fIread_data_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_read_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_read_status_ptr \fIread_row_fn\fP\fB);\fP +\fBvoid modpng14_set_read_status_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_read_status_ptr \fIread_row_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_read_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIread_user_transform_fn\fP\fB);\fP +\fBvoid modpng14_set_read_user_transform_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_user_transform_ptr \fIread_user_transform_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_rgb_to_gray (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIerror_action\fP\fB, double \fP\fIred\fP\fB, double \fIgreen\fP\fB);\fP +\fBvoid modpng14_set_rgb_to_gray (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fIerror_action\fP\fB, double \fP\fIred\fP\fB, double \fIgreen\fP\fB);\fP \fI\fB -\fBvoid png_set_rgb_to_gray_fixed (png_structp \fP\fIpng_ptr\fP\fB, int error_action png_fixed_point \fP\fIred\fP\fB, png_fixed_point \fIgreen\fP\fB);\fP +\fBvoid modpng14_set_rgb_to_gray_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int error_action modpng14_fixed_point \fP\fIred\fP\fB, modpng14_fixed_point \fIgreen\fP\fB);\fP \fI\fB -\fBvoid png_set_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytepp \fIrow_pointers\fP\fB);\fP +\fBvoid modpng14_set_rows (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_bytepp \fIrow_pointers\fP\fB);\fP \fI\fB -\fBvoid png_set_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fIsig_bit\fP\fB);\fP +\fBvoid modpng14_set_sBIT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_color_8p \fIsig_bit\fP\fB);\fP \fI\fB -\fBvoid png_set_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP +\fBvoid modpng14_set_sCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP \fI\fB -\fBvoid png_set_shift (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fItrue_bits\fP\fB);\fP +\fBvoid modpng14_set_shift (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_color_8p \fItrue_bits\fP\fB);\fP \fI\fB -\fBvoid png_set_sig_bytes (png_structp \fP\fIpng_ptr\fP\fB, int \fInum_bytes\fP\fB);\fP +\fBvoid modpng14_set_sig_bytes (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fInum_bytes\fP\fB);\fP \fI\fB -\fBvoid png_set_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP +\fBvoid modpng14_set_sPLT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP \fI\fB -\fBvoid png_set_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP +\fBvoid modpng14_set_sRGB (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP \fI\fB -\fBvoid png_set_sRGB_gAMA_and_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP +\fBvoid modpng14_set_sRGB_gAMA_and_cHRM (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP \fI\fB -\fBvoid png_set_strip_16 (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_strip_16 (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_strip_alpha (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_strip_alpha (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_strip_error_numbers (png_structp \fIpng_ptr, +\fBvoid modpng14_set_strip_error_numbers (modpng14_structp \fImodpng14_ptr, -\fBpng_uint_32 \fIstrip_mode\fP\fB);\fP +\fBmodpng14_uint_32 \fIstrip_mode\fP\fB);\fP \fI\fB -\fBvoid png_set_swap (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_swap (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_swap_alpha (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_swap_alpha (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_set_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP +\fBvoid modpng14_set_text (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP \fI\fB -\fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP +\fBvoid modpng14_set_tIME (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_timep \fImod_time\fP\fB);\fP \fI\fB -\fBvoid png_set_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_values\fP\fB);\fP +\fBvoid modpng14_set_tRNS (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_bytep \fP\fItrans\fP\fB, int \fP\fInum_trans\fP\fB, modpng14_color_16p \fItrans_values\fP\fB);\fP \fI\fB -\fBvoid png_set_tRNS_to_alpha(png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_set_tRNS_to_alpha(modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_set_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkp \fP\fIunknowns\fP\fB, int \fP\fInum\fP\fB, int \fIlocation\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_set_unknown_chunks (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_unknown_chunkp \fP\fIunknowns\fP\fB, int \fP\fInum\fP\fB, int \fIlocation\fP\fB);\fP \fI\fB -\fBvoid png_set_unknown_chunk_location(png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP +\fBvoid modpng14_set_unknown_chunk_location(modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP \fI\fB -\fBvoid png_set_read_user_chunk_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_chunk_ptr\fP\fB, png_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP +\fBvoid modpng14_set_read_user_chunk_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIuser_chunk_ptr\fP\fB, modpng14_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_user_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP +\fBvoid modpng14_set_user_transform_info (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP \fI\fB -\fBvoid png_set_write_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fP\fIwrite_data_fn\fP\fB, png_flush_ptr \fIoutput_flush_fn\fP\fB);\fP +\fBvoid modpng14_set_write_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_voidp \fP\fIio_ptr\fP\fB, modpng14_rw_ptr \fP\fIwrite_data_fn\fP\fB, modpng14_flush_ptr \fIoutput_flush_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_write_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_write_status_ptr \fIwrite_row_fn\fP\fB);\fP +\fBvoid modpng14_set_write_status_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_write_status_ptr \fIwrite_row_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_write_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIwrite_user_transform_fn\fP\fB);\fP +\fBvoid modpng14_set_write_user_transform_fn (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_user_transform_ptr \fIwrite_user_transform_fn\fP\fB);\fP \fI\fB -\fBvoid png_set_compression_buffer_size(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP +\fBvoid modpng14_set_compression_buffer_size(modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIsize\fP\fB);\fP \fI\fB -\fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, png_size_t \fP\fIstart\fP\fB, png_size_t \fInum_to_check\fP\fB);\fP +\fBint modpng14_sig_cmp (modpng14_bytep \fP\fIsig\fP\fB, modpng14_size_t \fP\fIstart\fP\fB, modpng14_size_t \fInum_to_check\fP\fB);\fP \fI\fB -\fBvoid png_start_read_image (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_start_read_image (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP +\fBvoid modpng14_warning (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_const_charp \fImessage\fP\fB);\fP \fI\fB -\fBvoid png_write_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_write_chunk (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIchunk_name\fP\fB, modpng14_bytep \fP\fIdata\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_write_chunk_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_write_chunk_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIdata\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_write_chunk_end (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_chunk_end (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_chunk_start (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_write_chunk_start (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIchunk_name\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_write_destroy (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_destroy (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_write_end (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_flush (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_flush (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP +\fBvoid modpng14_write_image (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytepp \fIimage\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_write_init (png_structp \fIpng_ptr\fP\fB);\fP +\fBDEPRECATED: void modpng14_write_init (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBDEPRECATED: void png_write_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP +\fBDEPRECATED: void modpng14_write_init_2 (modpng14_structpp \fP\fIptr_ptr\fP\fB, modpng14_const_charp \fP\fIuser_modpng14_ver\fP\fB, modpng14_size_t \fP\fImodpng14_struct_size\fP\fB, modpng14_size_t \fImodpng14_info_size\fP\fB);\fP \fI\fB -\fBvoid png_write_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_write_info (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_info_before_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_write_info_before_PLTE (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP +\fBvoid modpng14_write_png (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, modpng14_voidp \fIparams\fP\fB);\fP \fI\fB -\fBvoid png_write_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_write_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_write_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP +\fBvoid modpng14_write_rows (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytepp \fP\fIrow\fP\fB, modpng14_uint_32 \fInum_rows\fP\fB);\fP \fI\fB .SH DESCRIPTION The -.I libpng +.I libmodpng14 library supports encoding, decoding, and various manipulations of the Portable Network Graphics (PNG) format image files. It uses the .IR zlib(3) compression library. -Following is a copy of the libpng.txt file that accompanies libpng. +Following is a copy of the libmodpng14.txt file that accompanies libmodpng14. .SH LIBPNG.TXT -libpng.txt - A description on how to use and modify libpng +libmodpng14.txt - A description on how to use and modify libmodpng14 - libpng version 1.2.5 - October 3, 2002 + libmodpng14 version 1.2.5 - October 3, 2002 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2002 Glenn Randers-Pehrson For conditions of distribution and use, see copyright - notice in png.h. + notice in modpng14.h. based on: - libpng 1.0 beta 6 version 0.96 May 28, 1997 + libmodpng14 1.0 beta 6 version 0.96 May 28, 1997 Updated and distributed by Andreas Dilger Copyright (c) 1996, 1997 Andreas Dilger - libpng 1.0 beta 2 - version 0.88 January 26, 1996 + libmodpng14 1.0 beta 2 - version 0.88 January 26, 1996 For conditions of distribution and use, see copyright - notice in png.h. Copyright (c) 1995, 1996 Guy Eric + notice in modpng14.h. Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. - Updated/rewritten per request in the libpng FAQ + Updated/rewritten per request in the libmodpng14 FAQ Copyright (c) 1995, 1996 Frank J. T. Wojcik December 18, 1995 & January 20, 1996 .SH I. Introduction This file describes how to use and modify the PNG reference library -(known as libpng) for your own use. There are five sections to this +(known as libmodpng14) for your own use. There are five sections to this file: introduction, structures, reading, writing, and modification and configuration notes for various special platforms. In addition to this file, example.c is a good starting point for using the library, as it is heavily commented and should include everything most people -will need. We assume that libpng is already installed; see the -INSTALL file for instructions on how to install libpng. +will need. We assume that libmodpng14 is already installed; see the +INSTALL file for instructions on how to install libmodpng14. Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -The PNG-1.2 specification is available at +The PNG-1.2 specification is available at and at . The PNG-1.0 specification is available as RFC 2083 and as a -W3C Recommendation . Some +W3C Recommendation . Some additional chunks are described in the special-purpose public chunks documents at . Other information -about PNG, and the latest version of libpng, can be found at the PNG home -page, +about PNG, and the latest version of libmodpng14, can be found at the PNG home +page, and at . Most users will not have to modify the library significantly; advanced @@ -848,92 +848,92 @@ Currently, this library only supports C. Support for other languages is being considered. -Libpng has been designed to handle multiple sessions at one time, +Libmodpng14.has been designed to handle multiple sessions at one time, to be easily modifiable, to be portable to the vast majority of machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy -to use. The ultimate goal of libpng is to promote the acceptance of +to use. The ultimate goal of libmodpng14 is to promote the acceptance of the PNG file format in whatever way possible. While there is still -work to be done (see the TODO file), libpng should cover the +work to be done (see the TODO file), libmodpng14 should cover the majority of the needs of its users. Libpng uses zlib for its compression and decompression of PNG files. Further information about zlib, and the latest version of zlib, can be found at the zlib home page, . The zlib compression utility is a general purpose utility that is -useful for more than PNG files, and can be used without libpng. +useful for more than PNG files, and can be used without libmodpng14. See the documentation delivered with zlib for more details. You can usually find the source files for the zlib utility wherever you -find the libpng source files. +find the libmodpng14 source files. Libpng is thread safe, provided the threads are using different instances of the structures. Each thread should have its own -png_struct and png_info instances, and thus its own image. +modpng14_struct and modpng14_info instances, and thus its own image. Libpng does not protect itself against two threads using the same instance of a structure. Note: thread safety may be defeated by use of some of the MMX assembler code in pnggccrd.c, which is only -compiled when the user defines PNG_THREAD_UNSAFE_OK. +compiled when the user defines MODPNG14_THREAD_UNSAFE_OK. .SH II. Structures -There are two main structures that are important to libpng, png_struct -and png_info. The first, png_struct, is an internal structure that +There are two main structures that are important to libmodpng14, modpng14_struct +and modpng14_info. The first, modpng14_struct, is an internal structure that will not, for the most part, be used by a user except as the first -variable passed to every libpng function call. +variable passed to every libmodpng14 function call. -The png_info structure is designed to provide information about the -PNG file. At one time, the fields of png_info were intended to be +The modpng14_info structure is designed to provide information about the +PNG file. At one time, the fields of modpng14_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result -a set of interface functions for png_info (the png_get_*() and png_set_*() -functions) was developed. The fields of png_info are still available for +a set of interface functions for modpng14_info (the modpng14_get_*() and modpng14_set_*() +functions) was developed. The fields of modpng14_info are still available for older applications, but it is suggested that applications use the new interfaces if at all possible. -Applications that do make direct access to the members of png_struct (except -for png_ptr->jmpbuf) must be recompiled whenever the library is updated, -and applications that make direct access to the members of png_info must -be recompiled if they were compiled or loaded with libpng version 1.0.6, +Applications that do make direct access to the members of modpng14_struct (except +for modpng14_ptr->jmpbuf) must be recompiled whenever the library is updated, +and applications that make direct access to the members of modpng14_info must +be recompiled if they were compiled or loaded with libmodpng14 version 1.0.6, in which the members were in a different order. In version 1.0.7, the -members of the png_info structure reverted to the old order, as they were +members of the modpng14_info structure reverted to the old order, as they were in versions 0.97c through 1.0.5. Starting with version 2.0.0, both structures are going to be hidden, and the contents of the structures will -only be accessible through the png_get/png_set functions. +only be accessible through the modpng14_get/modpng14_set functions. -The png.h header file is an invaluable reference for programming with libpng. -And while I'm on the topic, make sure you include the libpng header file: +The modpng14.h header file is an invaluable reference for programming with libmodpng14. +And while I'm on the topic, make sure you include the libmodpng14 header file: -#include +#include .SH III. Reading We'll now walk you through the possible functions to call when reading in a PNG file sequentially, briefly explaining the syntax and purpose -of each one. See example.c and png.h for more detail. While +of each one. See example.c and modpng14.h for more detail. While progressive reading is covered in the next section, you will still need some of the functions discussed in this section to read a PNG file. .SS Setup -You will want to do the I/O initialization(*) before you get into libpng, +You will want to do the I/O initialization(*) before you get into libmodpng14, so if it doesn't work, you don't have much to undo. Of course, you will also want to insure that you are, in fact, dealing with a PNG file. Libpng provides a simple check to see if a file is a PNG file. To use it, pass in the first 1 to 8 bytes of the file to the function -png_sig_cmp(), and it will return 0 if the bytes match the corresponding +modpng14_sig_cmp(), and it will return 0 if the bytes match the corresponding bytes of the PNG signature, or nonzero otherwise. Of course, the more bytes you pass in, the greater the accuracy of the prediction. -If you are intending to keep the file pointer open for use in libpng, +If you are intending to keep the file pointer open for use in libmodpng14, you must ensure you don't read more than 8 bytes from the beginning -of the file, and you also have to make a call to png_set_sig_bytes_read() +of the file, and you also have to make a call to modpng14_set_sig_bytes_read() with the number of bytes you read from the beginning. Libpng will then only check the bytes (if any) that your program didn't read. (*): If you are not using the standard I/O functions, you will need to replace them with custom functions. See the discussion under -Customizing libpng. +Customizing libmodpng14. FILE *fp = fopen(file_name, "rb"); @@ -942,16 +942,16 @@ return (ERROR); } fread(header, 1, number, fp); - is_png = !png_sig_cmp(header, 0, number); + is_png = !modpng14_sig_cmp(header, 0, number); if (!is_png) { return (NOT_PNG); } -Next, png_struct and png_info need to be allocated and initialized. In +Next, modpng14_struct and modpng14_info need to be allocated and initialized. In order to ensure that the size of these structures is correct even with a -dynamically linked libpng, there are functions to initialize and +dynamically linked libmodpng14, there are functions to initialize and allocate the structures. We also pass the library version, optional pointers to error handling functions, and a pointer to a data struct for use by the error functions, if necessary (the pointer and functions can @@ -960,97 +960,97 @@ The structure allocation functions quietly return NULL if they fail to create the structure, so your application should check for that. - png_structp png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + modpng14_structp modpng14_ptr = modpng14_create_read_struct + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if (!png_ptr) + if (!modpng14_ptr) return (ERROR); - png_infop info_ptr = png_create_info_struct(png_ptr); + modpng14_infop info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_read_struct(&png_ptr, - (png_infopp)NULL, (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, + (modpng14_infopp)NULL, (modpng14_infopp)NULL); return (ERROR); } - png_infop end_info = png_create_info_struct(png_ptr); + modpng14_infop end_info = modpng14_create_info_struct(modpng14_ptr); if (!end_info) { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, + (modpng14_infopp)NULL); return (ERROR); } If you want to use your own memory allocation routines, -define PNG_USER_MEM_SUPPORTED and use -png_create_read_struct_2() instead of png_create_read_struct(): +define MODPNG14_USER_MEM_SUPPORTED and use +modpng14_create_read_struct_2() instead of modpng14_create_read_struct(): - png_structp png_ptr = png_create_read_struct_2 - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn, (png_voidp) + modpng14_structp modpng14_ptr = modpng14_create_read_struct_2 + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (modpng14_voidp) user_mem_ptr, user_malloc_fn, user_free_fn); -The error handling routines passed to png_create_read_struct() -and the memory alloc/free routines passed to png_create_struct_2() -are only necessary if you are not using the libpng supplied error +The error handling routines passed to modpng14_create_read_struct() +and the memory alloc/free routines passed to modpng14_create_struct_2() +are only necessary if you are not using the libmodpng14 supplied error handling and memory alloc/free functions. -When libpng encounters an error, it expects to longjmp back +When libmodpng14 encounters an error, it expects to longjmp back to your routine. Therefore, you will need to call setjmp and pass -your png_jmpbuf(png_ptr). If you read the file from different +your modpng14_jmpbuf(modpng14_ptr). If you read the file from different routines, you will need to update the jmpbuf field every time you enter -a new routine that will call a png_*() function. +a new routine that will call a modpng14_*() function. See your documentation of setjmp/longjmp for your compiler for more -information on setjmp/longjmp. See the discussion on libpng error +information on setjmp/longjmp. See the discussion on libmodpng14 error handling in the Customizing Libpng section below for more information -on the libpng error handling. If an error occurs, and libpng longjmp's -back to your setjmp, you will want to call png_destroy_read_struct() to +on the libmodpng14 error handling. If an error occurs, and libmodpng14 longjmp's +back to your setjmp, you will want to call modpng14_destroy_read_struct() to free any memory. - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); fclose(fp); return (ERROR); } If you would rather avoid the complexity of setjmp/longjmp issues, -you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case -errors will result in a call to PNG_ABORT() which defaults to abort(). +you can compile libmodpng14 with MODPNG14_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to MODPNG14_ABORT() which defaults to abort(). -Now you need to set up the input code. The default for libpng is to +Now you need to set up the input code. The default for libmodpng14 is to use the C function fread(). If you use this, you will need to pass a -valid FILE * in the function png_init_io(). Be sure that the file is +valid FILE * in the function modpng14_init_io(). Be sure that the file is opened in binary mode. If you wish to handle reading data in another -way, you need not call the png_init_io() function, but you must then -implement the libpng I/O methods discussed in the Customizing Libpng +way, you need not call the modpng14_init_io() function, but you must then +implement the libmodpng14 I/O methods discussed in the Customizing Libpng section below. - png_init_io(png_ptr, fp); + modpng14_init_io(modpng14_ptr, fp); If you had previously opened the file and read any of the signature from the beginning in order to see if this was a PNG file, you need to let -libpng know that there are some bytes missing from the start of the file. +libmodpng14 know that there are some bytes missing from the start of the file. - png_set_sig_bytes(png_ptr, number); + modpng14_set_sig_bytes(modpng14_ptr, number); .SS Setting up callback code You can set up a callback function to handle any unknown chunks in the input stream. You must supply the function - read_chunk_callback(png_ptr ptr, - png_unknown_chunkp chunk); + read_chunk_callback(modpng14_ptr ptr, + modpng14_unknown_chunkp chunk); { /* The unknown chunk structure contains your chunk data: */ - png_byte name[5]; - png_byte *data; - png_size_t size; - /* Note that libpng has already taken care of + modpng14_byte name[5]; + modpng14_byte *data; + modpng14_size_t size; + /* Note that libmodpng14 has already taken care of the CRC handling */ /* put your code here. Return one of the @@ -1064,22 +1064,22 @@ (You can give your function another name that you like instead of "read_chunk_callback") -To inform libpng about your function, use +To inform libmodpng14 about your function, use - png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr, + modpng14_set_read_user_chunk_fn(modpng14_ptr, user_chunk_ptr, read_chunk_callback); This names not only the callback function, but also a user pointer that you can retrieve with - png_get_user_chunk_ptr(png_ptr); + modpng14_get_user_chunk_ptr(modpng14_ptr); At this point, you can set up a callback function that will be called after each row has been read, which you can use to control a progress meter or the like. It's demonstrated in pngtest.c. You must supply a function - void read_row_callback(png_ptr ptr, png_uint_32 row, + void read_row_callback(modpng14_ptr ptr, modpng14_uint_32 row, int pass); { /* put your code here */ @@ -1087,9 +1087,9 @@ (You can give it another name that you like instead of "read_row_callback") -To inform libpng about your function, use +To inform libmodpng14 about your function, use - png_set_read_status_fn(png_ptr, read_row_callback); + modpng14_set_read_status_fn(modpng14_ptr, read_row_callback); .SS Unknown-chunk handling @@ -1099,7 +1099,7 @@ various info_ptr members; unknown chunks will be discarded. To change this, you can call: - png_set_keep_unknown_chunks(png_ptr, info_ptr, keep, + modpng14_set_keep_unknown_chunks(modpng14_ptr, info_ptr, keep, chunk_list, num_chunks); keep - 0: do not keep 1: keep only if safe-to-copy @@ -1111,10 +1111,10 @@ unknown chunks are affected Unknown chunks declared in this way will be saved as raw data onto a -list of png_unknown_chunk structures. If a chunk that is normally -known to libpng is named in the list, it will be handled as unknown, +list of modpng14_unknown_chunk structures. If a chunk that is normally +known to libmodpng14 is named in the list, it will be handled as unknown, according to the "keep" directive. If a chunk is named in successive -instances of png_set_keep_unknown_chunks(), the final instance will +instances of modpng14_set_keep_unknown_chunks(), the final instance will take precedence. .SS The high-level read interface @@ -1125,74 +1125,74 @@ the entire image into memory, and (b) the input transformations you want to do are limited to the following set: - PNG_TRANSFORM_IDENTITY No transformation - PNG_TRANSFORM_STRIP_16 Strip 16-bit samples to + MODPNG14_TRANSFORM_IDENTITY No transformation + MODPNG14_TRANSFORM_STRIP_16 Strip 16-bit samples to 8 bits - PNG_TRANSFORM_STRIP_ALPHA Discard the alpha channel - PNG_TRANSFORM_PACKING Expand 1, 2 and 4-bit + MODPNG14_TRANSFORM_STRIP_ALPHA Discard the alpha channel + MODPNG14_TRANSFORM_PACKING Expand 1, 2 and 4-bit samples to bytes - PNG_TRANSFORM_PACKSWAP Change order of packed + MODPNG14_TRANSFORM_PACKSWAP Change order of packed pixels to LSB first - PNG_TRANSFORM_EXPAND Perform set_expand() - PNG_TRANSFORM_INVERT_MONO Invert monochrome images - PNG_TRANSFORM_SHIFT Normalize pixels to the + MODPNG14_TRANSFORM_EXPAND Perform set_expand() + MODPNG14_TRANSFORM_INVERT_MONO Invert monochrome images + MODPNG14_TRANSFORM_SHIFT Normalize pixels to the sBIT depth - PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + MODPNG14_TRANSFORM_BGR Flip RGB to BGR, RGBA to BGRA - PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + MODPNG14_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA to AG - PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + MODPNG14_TRANSFORM_INVERT_ALPHA Change alpha from opacity to transparency - PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + MODPNG14_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples (This excludes setting a background color, doing gamma transformation, dithering, and setting filler.) If this is the case, simply do this: - png_read_png(png_ptr, info_ptr, png_transforms, NULL) + modpng14_read_png(modpng14_ptr, info_ptr, modpng14_transforms, NULL) -where png_transforms is an integer containing the logical OR of -some set of transformation flags. This call is equivalent to png_read_info(), +where modpng14_transforms is an integer containing the logical OR of +some set of transformation flags. This call is equivalent to modpng14_read_info(), followed the set of transformations indicated by the transform mask, -then png_read_image(), and finally png_read_end(). +then modpng14_read_image(), and finally modpng14_read_end(). (The final parameter of this call is not yet used. Someday it might point to transformation parameters required by some future input transform.) -After you have called png_read_png(), you can retrieve the image data +After you have called modpng14_read_png(), you can retrieve the image data with - row_pointers = png_get_rows(png_ptr, info_ptr); + row_pointers = modpng14_get_rows(modpng14_ptr, info_ptr); where row_pointers is an array of pointers to the pixel data for each row: - png_bytep row_pointers[height]; + modpng14_bytep row_pointers[height]; If you know your image size and pixel size ahead of time, you can allocate -row_pointers prior to calling png_read_png() with +row_pointers prior to calling modpng14_read_png() with - row_pointers = png_malloc(png_ptr, - height*sizeof(png_bytep)); + row_pointers = modpng14_malloc(modpng14_ptr, + height*sizeof(modpng14_bytep)); for (int i=0; i) and -png_get_(png_ptr, info_ptr, ...) functions return non-zero if the +has been read. The modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_) and +modpng14_get_(modpng14_ptr, info_ptr, ...) functions return non-zero if the data has been read, or zero if it is missing. The parameters to the -png_get_ are set directly if they are simple data types, or a pointer +modpng14_get_ are set directly if they are simple data types, or a pointer into the info_ptr is returned for any complex types. - png_get_PLTE(png_ptr, info_ptr, &palette, + modpng14_get_PLTE(modpng14_ptr, info_ptr, &palette, &num_palette); palette - the palette for the file - (array of png_color) + (array of modpng14_color) num_palette - number of entries in the palette - png_get_gAMA(png_ptr, info_ptr, &gamma); + modpng14_get_gAMA(modpng14_ptr, info_ptr, &gamma); gamma - the gamma the file is written - at (PNG_INFO_gAMA) + at (MODPNG14_INFO_gAMA) - png_get_sRGB(png_ptr, info_ptr, &srgb_intent); - srgb_intent - the rendering intent (PNG_INFO_sRGB) + modpng14_get_sRGB(modpng14_ptr, info_ptr, &srgb_intent); + srgb_intent - the rendering intent (MODPNG14_INFO_sRGB) The presence of the sRGB chunk means that the pixel data is in the sRGB color space. This chunk also implies specific values of gAMA and cHRM. - png_get_iCCP(png_ptr, info_ptr, &name, + modpng14_get_iCCP(modpng14_ptr, info_ptr, &name, &compression_type, &profile, &proflen); name - The profile name. compression - The compression type; always - PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + MODPNG14_COMPRESSION_TYPE_BASE for PNG 1.0. You may give NULL to this argument to ignore it. profile - International Color Consortium color profile data. May contain NULs. proflen - length of profile data in bytes. - png_get_sBIT(png_ptr, info_ptr, &sig_bit); + modpng14_get_sBIT(modpng14_ptr, info_ptr, &sig_bit); sig_bit - the number of significant bits for - (PNG_INFO_sBIT) each of the gray, + (MODPNG14_INFO_sBIT) each of the gray, red, green, and blue channels, whichever are appropriate for the - given color type (png_color_16) + given color type (modpng14_color_16) - png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, + modpng14_get_tRNS(modpng14_ptr, info_ptr, &trans, &num_trans, &trans_values); trans - array of transparent entries for - palette (PNG_INFO_tRNS) + palette (MODPNG14_INFO_tRNS) trans_values - graylevel or color sample values of the single transparent color for - non-paletted images (PNG_INFO_tRNS) + non-paletted images (MODPNG14_INFO_tRNS) num_trans - number of transparent entries - (PNG_INFO_tRNS) + (MODPNG14_INFO_tRNS) - png_get_hIST(png_ptr, info_ptr, &hist); - (PNG_INFO_hIST) + modpng14_get_hIST(modpng14_ptr, info_ptr, &hist); + (MODPNG14_INFO_hIST) hist - histogram of palette (array of - png_uint_16) + modpng14_uint_16) - png_get_tIME(png_ptr, info_ptr, &mod_time); + modpng14_get_tIME(modpng14_ptr, info_ptr, &mod_time); mod_time - time image was last modified - (PNG_VALID_tIME) + (MODPNG14_VALID_tIME) - png_get_bKGD(png_ptr, info_ptr, &background); - background - background color (PNG_VALID_bKGD) + modpng14_get_bKGD(modpng14_ptr, info_ptr, &background); + background - background color (MODPNG14_VALID_bKGD) valid 16-bit red, green and blue values, regardless of color_type - num_comments = png_get_text(png_ptr, info_ptr, + num_comments = modpng14_get_text(modpng14_ptr, info_ptr, &text_ptr, &num_text); num_comments - number of comments - text_ptr - array of png_text holding image + text_ptr - array of modpng14_text holding image comments text_ptr[i].compression - type of compression used - on "text" PNG_TEXT_COMPRESSION_NONE - PNG_TEXT_COMPRESSION_zTXt - PNG_ITXT_COMPRESSION_NONE - PNG_ITXT_COMPRESSION_zTXt + on "text" MODPNG14_TEXT_COMPRESSION_NONE + MODPNG14_TEXT_COMPRESSION_zTXt + MODPNG14_ITXT_COMPRESSION_NONE + MODPNG14_ITXT_COMPRESSION_zTXt text_ptr[i].key - keyword for comment. Must contain 1-79 characters. text_ptr[i].text - text comments for current @@ -1373,53 +1373,53 @@ num_text - number of comments (same as num_comments; you can put NULL here to avoid the duplication) - Note while png_set_text() will accept text, language, + Note while modpng14_set_text() will accept text, language, and translated keywords that can be NULL pointers, the - structure returned by png_get_text will always contain + structure returned by modpng14_get_text will always contain regular zero-terminated C strings. They might be empty strings but they will never be NULL pointers. - num_spalettes = png_get_sPLT(png_ptr, info_ptr, + num_spalettes = modpng14_get_sPLT(modpng14_ptr, info_ptr, &palette_ptr); palette_ptr - array of palette structures holding contents of one or more sPLT chunks read. num_spalettes - number of sPLT chunks read. - png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, + modpng14_get_oFFs(modpng14_ptr, info_ptr, &offset_x, &offset_y, &unit_type); offset_x - positive offset from the left edge of the screen offset_y - positive offset from the top edge of the screen - unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + unit_type - MODPNG14_OFFSET_PIXEL, MODPNG14_OFFSET_MICROMETER - png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, + modpng14_get_pHYs(modpng14_ptr, info_ptr, &res_x, &res_y, &unit_type); res_x - pixels/unit physical resolution in x direction res_y - pixels/unit physical resolution in x direction - unit_type - PNG_RESOLUTION_UNKNOWN, - PNG_RESOLUTION_METER + unit_type - MODPNG14_RESOLUTION_UNKNOWN, + MODPNG14_RESOLUTION_METER - png_get_sCAL(png_ptr, info_ptr, &unit, &width, + modpng14_get_sCAL(modpng14_ptr, info_ptr, &unit, &width, &height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are doubles) - png_get_sCAL_s(png_ptr, info_ptr, &unit, &width, + modpng14_get_sCAL_s(modpng14_ptr, info_ptr, &unit, &width, &height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are strings like "2.54") - num_unknown_chunks = png_get_unknown_chunks(png_ptr, + num_unknown_chunks = modpng14_get_unknown_chunks(modpng14_ptr, info_ptr, &unknowns) - unknowns - array of png_unknown_chunk + unknowns - array of modpng14_unknown_chunk structures holding unknown chunks unknowns[i].name - name of unknown chunk unknowns[i].data - data of unknown chunk @@ -1428,24 +1428,24 @@ The value of "i" corresponds to the order in which the chunks were read from the PNG file or inserted with the - png_set_unknown_chunks() function. + modpng14_set_unknown_chunks() function. The data from the pHYs chunk can be retrieved in several convenient forms: - res_x = png_get_x_pixels_per_meter(png_ptr, + res_x = modpng14_get_x_pixels_per_meter(modpng14_ptr, info_ptr) - res_y = png_get_y_pixels_per_meter(png_ptr, + res_y = modpng14_get_y_pixels_per_meter(modpng14_ptr, info_ptr) - res_x_and_y = png_get_pixels_per_meter(png_ptr, + res_x_and_y = modpng14_get_pixels_per_meter(modpng14_ptr, info_ptr) - res_x = png_get_x_pixels_per_inch(png_ptr, + res_x = modpng14_get_x_pixels_per_inch(modpng14_ptr, info_ptr) - res_y = png_get_y_pixels_per_inch(png_ptr, + res_y = modpng14_get_y_pixels_per_inch(modpng14_ptr, info_ptr) - res_x_and_y = png_get_pixels_per_inch(png_ptr, + res_x_and_y = modpng14_get_pixels_per_inch(modpng14_ptr, info_ptr) - aspect_ratio = png_get_pixel_aspect_ratio(png_ptr, + aspect_ratio = modpng14_get_pixel_aspect_ratio(modpng14_ptr, info_ptr) (Each of these returns 0 [signifying "unknown"] if @@ -1455,20 +1455,20 @@ The data from the oFFs chunk can be retrieved in several convenient forms: - x_offset = png_get_x_offset_microns(png_ptr, info_ptr); - y_offset = png_get_y_offset_microns(png_ptr, info_ptr); - x_offset = png_get_x_offset_inches(png_ptr, info_ptr); - y_offset = png_get_y_offset_inches(png_ptr, info_ptr); + x_offset = modpng14_get_x_offset_microns(modpng14_ptr, info_ptr); + y_offset = modpng14_get_y_offset_microns(modpng14_ptr, info_ptr); + x_offset = modpng14_get_x_offset_inches(modpng14_ptr, info_ptr); + y_offset = modpng14_get_y_offset_inches(modpng14_ptr, info_ptr); (Each of these returns 0 [signifying "unknown" if both x and y are 0] if the data is not present or if the chunk is present but the unit is the pixel) -For more information, see the png_info definition in png.h and the +For more information, see the modpng14_info definition in modpng14.h and the PNG specification for chunk contents. Be careful with trusting rowbytes, as some of the transformations could increase the space needed to hold a row (expand, filler, gray_to_rgb, etc.). -See png_read_update_info(), below. +See modpng14_read_update_info(), below. A quick word about text_ptr and num_text. PNG stores comments in keyword/text pairs, one pair per chunk, with no limit on the number @@ -1482,7 +1482,7 @@ Keywords should be limited to 79 Latin-1 characters without leading or trailing spaces, but non-consecutive spaces are allowed within the keyword. It is possible to have the same keyword any number of times. -The text_ptr is an array of png_text structures, each holding a +The text_ptr is an array of modpng14_text structures, each holding a pointer to a language string, a pointer to a keyword and a pointer to a text string. The text string, language code, and translated keyword may be empty or NULL pointers. The keyword/text @@ -1490,7 +1490,7 @@ However, some or all of the text chunks may be after the image, so, to make sure you have read all the text chunks, don't mess with these until after you read the stuff after the image. This will be -mentioned again below in the discussion that goes with png_read_end(). +mentioned again below in the discussion that goes with modpng14_read_end(). .SS Input transformations @@ -1507,23 +1507,23 @@ The colors used for the background and transparency values should be supplied in the same format/depth as the current image data. They are stored in the same format/depth as the image data in a bKGD or tRNS -chunk, so this is what libpng expects for this data. The colors are +chunk, so this is what libmodpng14 expects for this data. The colors are transformed to keep in sync with the image data when an application -calls the png_read_update_info() routine (see below). +calls the modpng14_read_update_info() routine (see below). Data will be decoded into the supplied row buffers packed into bytes unless the library has been told to transform it into another format. For example, 4 bit/pixel paletted or grayscale data will be returned 2 pixels/byte with the leftmost pixel in the high-order bits of the -byte, unless png_set_packing() is called. 8-bit RGB data will be stored -in RGB RGB RGB format unless png_set_filler() is called to insert filler +byte, unless modpng14_set_packing() is called. 8-bit RGB data will be stored +in RGB RGB RGB format unless modpng14_set_filler() is called to insert filler bytes, either before or after each RGB triplet. 16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant byte of the color -value first, unless png_set_strip_16() is called to transform it to -regular RGB RGB triplets, or png_set_filler() is called to insert +value first, unless modpng14_set_strip_16() is called to transform it to +regular RGB RGB triplets, or modpng14_set_filler() is called to insert filler bytes, either before or after each RRGGBB triplet. Similarly, -8-bit or 16-bit grayscale data can be modified with png_set_filler() -or png_set_strip_16(). +8-bit or 16-bit grayscale data can be modified with modpng14_set_filler() +or modpng14_set_strip_16(). The following code transforms grayscale images of less than 8 to 8 bits, changes paletted images to RGB, and adds a full alpha channel if there is @@ -1531,17 +1531,17 @@ grayscale images with bit depths of 2 or 4 or if there is a multiple-image viewing application that wishes to treat all images in the same way. - if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_palette_to_rgb(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) + modpng14_set_palette_to_rgb(modpng14_ptr); - if (color_type == PNG_COLOR_TYPE_GRAY && - bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_GRAY && + bit_depth < 8) modpng14_set_gray_1_2_4_to_8(modpng14_ptr); - if (png_get_valid(png_ptr, info_ptr, - PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); + if (modpng14_get_valid(modpng14_ptr, info_ptr, + MODPNG14_INFO_tRNS)) modpng14_set_tRNS_to_alpha(modpng14_ptr); -These three functions are actually aliases for png_set_expand(), added -in libpng version 1.0.4, with the function names expanded to improve code +These three functions are actually aliases for modpng14_set_expand(), added +in libmodpng14 version 1.0.4, with the function names expanded to improve code readability. In some future version they may actually do different things. @@ -1549,15 +1549,15 @@ 8 bits per channel, this will strip the pixels down to 8 bit. if (bit_depth == 16) - png_set_strip_16(png_ptr); + modpng14_set_strip_16(modpng14_ptr); If, for some reason, you don't need the alpha channel on an image, and you want to remove it rather than combining it with the background (but the image author certainly had in mind that you *would* combine it with the background, so that's what you should probably do): - if (color_type & PNG_COLOR_MASK_ALPHA) - png_set_strip_alpha(png_ptr); + if (color_type & MODPNG14_COLOR_MASK_ALPHA) + modpng14_set_strip_alpha(modpng14_ptr); In PNG files, the alpha channel in an image is the level of opacity. If you need the alpha channel in an image to @@ -1566,7 +1566,7 @@ fully opaque and 255 (in 8-bit or paletted images) or 65535 (in 16-bit images) is fully transparent, with - png_set_invert_alpha(png_ptr); + modpng14_set_invert_alpha(modpng14_ptr); PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as they can, resulting in, for example, 8 pixels per byte for 1 bit @@ -1574,7 +1574,7 @@ values of the pixels: if (bit_depth < 8) - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels stored in a PNG image have been "scaled" or "shifted" up to the next @@ -1583,50 +1583,50 @@ convert the PNG pixel data back to the original bit depth of the image. This call reduces the pixels back down to the original bit depth: - png_color_8p sig_bit; + modpng14_color_8p sig_bit; - if (png_get_sBIT(png_ptr, info_ptr, &sig_bit)) - png_set_shift(png_ptr, sig_bit); + if (modpng14_get_sBIT(modpng14_ptr, info_ptr, &sig_bit)) + modpng14_set_shift(modpng14_ptr, sig_bit); PNG files store 3-color pixels in red, green, blue order. This code changes the storage of the pixels to blue, green, red: - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_bgr(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) + modpng14_set_bgr(modpng14_ptr); PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them into 4 or 8 bytes for windowing systems that need them in this format: - if (color_type == PNG_COLOR_TYPE_RGB) - png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); + if (color_type == MODPNG14_COLOR_TYPE_RGB) + modpng14_set_filler(modpng14_ptr, filler, MODPNG14_FILLER_BEFORE); where "filler" is the 8 or 16-bit number to fill with, and the location is -either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether +either MODPNG14_FILLER_BEFORE or MODPNG14_FILLER_AFTER, depending upon whether you want the filler before the RGB or after. This transformation does not affect images that already have full alpha channels. To add an -opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which +opaque alpha channel, use filler=0xff or 0xffff and MODPNG14_FILLER_AFTER which will generate RGBA pixels. If you are reading an image with an alpha channel, and you need the data as ARGB instead of the normal PNG format RGBA: - if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_swap_alpha(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) + modpng14_set_swap_alpha(modpng14_ptr); For some uses, you may want a grayscale image to be represented as RGB. This code will do that conversion: - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_GRAY || + color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) + modpng14_set_gray_to_rgb(modpng14_ptr); Conversely, you can convert an RGB or RGBA image to grayscale or grayscale with alpha. - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_rgb_to_gray_fixed(png_ptr, error_action, + if (color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) + modpng14_set_rgb_to_gray_fixed(modpng14_ptr, error_action, int red_weight, int green_weight); error_action = 1: silently do the conversion @@ -1645,8 +1645,8 @@ If you have set error_action = 1 or 2, you can later check whether the image really was gray, after processing -the image rows, with the png_get_rgb_to_gray_status(png_ptr) function. -It will return a png_byte that is zero if the image was gray or +the image rows, with the modpng14_get_rgb_to_gray_status(modpng14_ptr) function. +It will return a modpng14_byte that is zero if the image was gray or 1 if there were any non-gray pixels. bKGD and sBIT data will be silently converted to grayscale, using the green channel data, regardless of the error_action setting. @@ -1676,8 +1676,8 @@ The calculation is done in a linear colorspace, if the image gamma is known. -If you have a grayscale and you are using png_set_expand_depth(), -png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to +If you have a grayscale and you are using modpng14_set_expand_depth(), +modpng14_set_expand(), or modpng14_set_gray_to_rgb to change to truecolor or to a higher bit-depth, you must either supply the background color as a gray value at the original file bit-depth (need_expand = 1) or else supply the background color as an RGB triplet at the final, expanded bit depth @@ -1685,25 +1685,25 @@ must either supply the background color as a palette index (need_expand = 1) or as an RGB triplet that may or may not be in the palette (need_expand = 0). - png_color_16 my_background; - png_color_16p image_background; + modpng14_color_16 my_background; + modpng14_color_16p 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); + if (modpng14_get_bKGD(modpng14_ptr, info_ptr, &image_background)) + modpng14_set_background(modpng14_ptr, image_background, + MODPNG14_BACKGROUND_GAMMA_FILE, 1, 1.0); else - png_set_background(png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + modpng14_set_background(modpng14_ptr, &my_background, + MODPNG14_BACKGROUND_GAMMA_SCREEN, 0, 1.0); -The png_set_background() function tells libpng to composite images +The modpng14_set_background() function tells libmodpng14 to composite images with alpha or simple transparency against the supplied background -color. If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), +color. If the PNG file contains a bKGD chunk (MODPNG14_INFO_bKGD valid), you may use this color, or supply another color more suitable for the current display (e.g., the background color from a web page). You -need to tell libpng whether the color is in the gamma space of the -display (PNG_BACKGROUND_GAMMA_SCREEN for colors you supply), the file -(PNG_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one -that is neither of these gammas (PNG_BACKGROUND_GAMMA_UNIQUE - I don't +need to tell libmodpng14 whether the color is in the gamma space of the +display (MODPNG14_BACKGROUND_GAMMA_SCREEN for colors you supply), the file +(MODPNG14_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one +that is neither of these gammas (MODPNG14_BACKGROUND_GAMMA_UNIQUE - I don't know why anyone would use this, but it's here). To properly display PNG images on any kind of system, the application needs @@ -1744,7 +1744,7 @@ guess for Mac systems */ } -The png_set_gamma() function handles gamma transformations of the data. +The modpng14_set_gamma() function handles gamma transformations of the data. Pass both the file gamma and the current screen_gamma. If the file does not have a gamma value, you can pass one anyway if you have an idea what it is (usually 0.45455 is a good guess for GIF images on PCs). Note @@ -1753,13 +1753,13 @@ gamma is, and why all applications should support it. It is strongly recommended that PNG viewers support gamma correction. - if (png_get_gAMA(png_ptr, info_ptr, &gamma)) - png_set_gamma(png_ptr, screen_gamma, gamma); + if (modpng14_get_gAMA(modpng14_ptr, info_ptr, &gamma)) + modpng14_set_gamma(modpng14_ptr, screen_gamma, gamma); else - png_set_gamma(png_ptr, screen_gamma, 0.45455); + modpng14_set_gamma(modpng14_ptr, screen_gamma, 0.45455); If you need to reduce an RGB file to a paletted file, or if a paletted -file has more entries then will fit on your screen, png_set_dither() +file has more entries then will fit on your screen, modpng14_set_dither() will do that. Note that this is a simple match dither that merely finds the closest color available. This should work fairly well with optimized palettes, and fairly badly with linear color cubes. If you @@ -1769,24 +1769,24 @@ more intelligent choices when reducing the palette. If there is no histogram, it may not do as good a job. - if (color_type & PNG_COLOR_MASK_COLOR) + if (color_type & MODPNG14_COLOR_MASK_COLOR) { - if (png_get_valid(png_ptr, info_ptr, - PNG_INFO_PLTE)) + if (modpng14_get_valid(modpng14_ptr, info_ptr, + MODPNG14_INFO_PLTE)) { - png_uint_16p histogram = NULL; + modpng14_uint_16p histogram = NULL; - png_get_hIST(png_ptr, info_ptr, + modpng14_get_hIST(modpng14_ptr, info_ptr, &histogram); - png_set_dither(png_ptr, palette, num_palette, + modpng14_set_dither(modpng14_ptr, palette, num_palette, max_screen_colors, histogram, 1); } else { - png_color std_color_cube[MAX_SCREEN_COLORS] = + modpng14_color std_color_cube[MAX_SCREEN_COLORS] = { ... colors ... }; - png_set_dither(png_ptr, std_color_cube, + modpng14_set_dither(modpng14_ptr, std_color_cube, MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, NULL,0); } @@ -1796,14 +1796,14 @@ The following code will reverse this (make black be one and white be zero): - if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) - png_set_invert_mono(png_ptr); + if (bit_depth == 1 && color_type == MODPNG14_COLOR_TYPE_GRAY) + modpng14_set_invert_mono(modpng14_ptr); This function can also be used to invert grayscale and gray-alpha images: - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_invert_mono(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_GRAY || + color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) + modpng14_set_invert_mono(modpng14_ptr); PNG files store 16 bit pixels in network byte order (big-endian, ie. most significant bits first). This code changes the storage to the @@ -1811,62 +1811,62 @@ way PCs store them): if (bit_depth == 16) - png_set_swap(png_ptr); + modpng14_set_swap(modpng14_ptr); If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you need to change the order the pixels are packed into bytes, you can use: if (bit_depth < 8) - png_set_packswap(png_ptr); + modpng14_set_packswap(modpng14_ptr); Finally, you can write your own transformation function if none of the existing ones meets your needs. This is done by setting a callback with - png_set_read_user_transform_fn(png_ptr, + modpng14_set_read_user_transform_fn(modpng14_ptr, read_transform_fn); You must supply the function - void read_transform_fn(png_ptr ptr, row_info_ptr - row_info, png_bytep data) + void read_transform_fn(modpng14_ptr ptr, row_info_ptr + row_info, modpng14_bytep data) See pngtest.c for a working example. Your function will be called after all of the other transformations have been processed. You can also set up a pointer to a user structure for use by your -callback function, and you can inform libpng that your transform +callback function, and you can inform libmodpng14 that your transform function will change the number of channels or bit depth with the function - png_set_user_transform_info(png_ptr, user_ptr, + modpng14_set_user_transform_info(modpng14_ptr, user_ptr, user_depth, user_channels); -The user's application, not libpng, is responsible for allocating and +The user's application, not libmodpng14, is responsible for allocating and freeing any memory required for the user structure. You can retrieve the pointer via the function -png_get_user_transform_ptr(). For example: +modpng14_get_user_transform_ptr(). For example: voidp read_user_transform_ptr = - png_get_user_transform_ptr(png_ptr); + modpng14_get_user_transform_ptr(modpng14_ptr); The last thing to handle is interlacing; this is covered in detail below, -but you must call the function here if you want libpng to handle expansion +but you must call the function here if you want libmodpng14 to handle expansion of the interlaced image. - number_of_passes = png_set_interlace_handling(png_ptr); + number_of_passes = modpng14_set_interlace_handling(modpng14_ptr); -After setting the transformations, libpng can update your png_info +After setting the transformations, libmodpng14 can update your modpng14_info structure to reflect any transformations you've requested with this call. This is most useful to update the info structure's rowbytes field so you can use it to allocate your image memory. This function will also update your palette with the correct screen_gamma and background if these have been given with the calls above. - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_ptr, info_ptr); -After you call png_read_update_info(), you can allocate any +After you call modpng14_read_update_info(), you can allocate any memory you need to hold the image. The row data is simply raw byte data for all forms of images. As the actual allocation varies among applications, no example will be given. If you @@ -1879,45 +1879,45 @@ After you've allocated memory, you can read the image data. The simplest way to do this is in one function call. If you are allocating enough memory to hold the whole image, you can just -call png_read_image() and libpng will read in all the image data +call modpng14_read_image() and libmodpng14 will read in all the image data and put it in the memory area supplied. You will need to pass in an array of pointers to each row. This function automatically handles interlacing, so you don't need -to call png_set_interlace_handling() or call this function multiple -times, or any of that other stuff necessary with png_read_rows(). +to call modpng14_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with modpng14_read_rows(). - png_read_image(png_ptr, row_pointers); + modpng14_read_image(modpng14_ptr, row_pointers); where row_pointers is: - png_bytep row_pointers[height]; + modpng14_bytep row_pointers[height]; You can point to void or char or whatever you use for pixels. If you don't want to read in the whole image at once, you can -use png_read_rows() instead. If there is no interlacing (check -interlace_type == PNG_INTERLACE_NONE), this is simple: +use modpng14_read_rows() instead. If there is no interlacing (check +interlace_type == MODPNG14_INTERLACE_NONE), this is simple: - png_read_rows(png_ptr, row_pointers, NULL, + modpng14_read_rows(modpng14_ptr, row_pointers, NULL, number_of_rows); -where row_pointers is the same as in the png_read_image() call. +where row_pointers is the same as in the modpng14_read_image() call. If you are doing this just one row at a time, you can do this with a single row_pointer instead of an array of row_pointers: - png_bytep row_pointer = row; - png_read_row(png_ptr, row_pointer, NULL); + modpng14_bytep row_pointer = row; + modpng14_read_row(modpng14_ptr, row_pointer, NULL); If the file is interlaced (interlace_type != 0 in the IHDR chunk), things get somewhat harder. The only current (PNG Specification version 1.2) -interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7) +interlacing type for PNG is (interlace_type == MODPNG14_INTERLACE_ADAM7) is a somewhat complicated 2D interlace scheme, known as Adam7, that breaks down an image into seven smaller images of varying size, based on an 8x8 grid. -libpng can fill out those images or it can give them to you "as is". +libmodpng14 can fill out those images or it can give them to you "as is". If you want them filled out, there are two ways to do that. The one mentioned in the PNG specification is to expand each pixel to cover those pixels that have not been read yet (the "rectangle" method). @@ -1928,11 +1928,11 @@ before the start of the read. The first method usually looks better, but tends to be slower, as there are more pixels to put in the rows. -If you don't want libpng to handle the interlacing details, just call -png_read_rows() seven times to read in all seven images. Each of the +If you don't want libmodpng14 to handle the interlacing details, just call +modpng14_read_rows() seven times to read in all seven images. Each of the images is a valid image by itself, or they can all be combined on an 8x8 grid to form a single image (although if you intend to combine them -you would be far better off using the libpng interlace handling). +you would be far better off using the libmodpng14 interlace handling). The first pass will return an image 1/8 as wide as the entire image (every 8th column starting in column 0) and 1/8 as high as the original @@ -1948,12 +1948,12 @@ wide as the original, and 1/2 as high, containing all of the odd numbered scanlines. Phew! -If you want libpng to expand the images, call this before calling -png_start_read_image() or png_read_update_info(): +If you want libmodpng14 to expand the images, call this before calling +modpng14_start_read_image() or modpng14_read_update_info(): - if (interlace_type == PNG_INTERLACE_ADAM7) + if (interlace_type == MODPNG14_INTERLACE_ADAM7) number_of_passes - = png_set_interlace_handling(png_ptr); + = modpng14_set_interlace_handling(modpng14_ptr); This will return the number of passes needed. Currently, this is seven, but may change if another interlace type is added. @@ -1967,21 +1967,21 @@ after each pass, the "rectangle" effect is generally considered the better looking one. -If you only want the "sparkle" effect, just call png_read_rows() as +If you only want the "sparkle" effect, just call modpng14_read_rows() as normal, with the third parameter NULL. Make sure you make pass over the image number_of_passes times, and you don't change the data in the rows between calls. You can change the locations of the data, just not the data. Each pass only writes the pixels appropriate for that pass, and assumes the data from previous passes is still valid. - png_read_rows(png_ptr, row_pointers, NULL, + modpng14_read_rows(modpng14_ptr, row_pointers, NULL, number_of_rows); If you only want the first effect (the rectangles), do the same as before except pass the row buffer in the third parameter, and leave the second parameter NULL. - png_read_rows(png_ptr, NULL, row_pointers, + modpng14_read_rows(modpng14_ptr, NULL, row_pointers, number_of_rows); .SS Finishing a sequential read @@ -1989,36 +1989,36 @@ After you are finished reading the image through either the high- or low-level interfaces, you can finish reading the file. If you are interested in comments or time, which may be stored either before or -after the image data, you should pass the separate png_info struct if +after the image data, you should pass the separate modpng14_info struct if you want to keep the comments from before and after the image separate. If you are not interested, you can pass NULL. - png_read_end(png_ptr, end_info); + modpng14_read_end(modpng14_ptr, end_info); -When you are done, you can free all memory allocated by libpng like this: +When you are done, you can free all memory allocated by libmodpng14 like this: - png_destroy_read_struct(&png_ptr, &info_ptr, + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); It is also possible to individually free the info_ptr members that -point to libpng-allocated storage with the following function: +point to libmodpng14-allocated storage with the following function: - png_free_data(png_ptr, info_ptr, mask, seq) + modpng14_free_data(modpng14_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask containing the logical OR of one or more of - PNG_FREE_PLTE, PNG_FREE_TRNS, - PNG_FREE_HIST, PNG_FREE_ICCP, - PNG_FREE_PCAL, PNG_FREE_ROWS, - PNG_FREE_SCAL, PNG_FREE_SPLT, - PNG_FREE_TEXT, PNG_FREE_UNKN, - or simply PNG_FREE_ALL + MODPNG14_FREE_PLTE, MODPNG14_FREE_TRNS, + MODPNG14_FREE_HIST, MODPNG14_FREE_ICCP, + MODPNG14_FREE_PCAL, MODPNG14_FREE_ROWS, + MODPNG14_FREE_SCAL, MODPNG14_FREE_SPLT, + MODPNG14_FREE_TEXT, MODPNG14_FREE_UNKN, + or simply MODPNG14_FREE_ALL seq - sequence number of item to be freed (-1 for all items) This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those +by the user and not by libmodpng14, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not -1, and multiple items are allowed for the data type identified in @@ -2026,99 +2026,99 @@ is freed, where n is "seq". The default behavior is only to free data that was allocated internally -by libpng. This can be changed, so that libpng will not free the data, -or so that it will free data that was allocated by the user with png_malloc() -or png_zalloc() and passed in via a png_set_*() function, with +by libmodpng14. This can be changed, so that libmodpng14 will not free the data, +or so that it will free data that was allocated by the user with modpng14_malloc() +or modpng14_zalloc() and passed in via a modpng14_set_*() function, with - png_data_freer(png_ptr, info_ptr, freer, mask) + modpng14_data_freer(modpng14_ptr, info_ptr, freer, mask) mask - which data elements are affected - same choices as in png_free_data() + same choices as in modpng14_free_data() freer - one of - PNG_DESTROY_WILL_FREE_DATA - PNG_SET_WILL_FREE_DATA - PNG_USER_WILL_FREE_DATA + MODPNG14_DESTROY_WILL_FREE_DATA + MODPNG14_SET_WILL_FREE_DATA + MODPNG14_USER_WILL_FREE_DATA This function only affects data that has already been allocated. You can call this function after reading the PNG data but before calling -any png_set_*() functions, to control whether the user or the png_set_*() +any modpng14_set_*() functions, to control whether the user or the modpng14_set_*() function is responsible for freeing any existing data that might be present, -and again after the png_set_*() functions to control whether the user -or png_destroy_*() is supposed to free the data. When the user assumes -responsibility for libpng-allocated data, the application must use -png_free() to free it, and when the user transfers responsibility to libpng -for data that the user has allocated, the user must have used png_malloc() -or png_zalloc() to allocate it. +and again after the modpng14_set_*() functions to control whether the user +or modpng14_destroy_*() is supposed to free the data. When the user assumes +responsibility for libmodpng14-allocated data, the application must use +modpng14_free() to free it, and when the user transfers responsibility to libmodpng14 +for data that the user has allocated, the user must have used modpng14_malloc() +or modpng14_zalloc() to allocate it. If you allocated your row_pointers in a single block, as suggested above in the description of the high level read interface, you must not transfer -responsibility for freeing it to the png_set_rows or png_read_destroy function, +responsibility for freeing it to the modpng14_set_rows or modpng14_read_destroy function, because they would also try to free the individual row_pointers[i]. If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword -separately, do not transfer responsibility for freeing text_ptr to libpng, -because when libpng fills a png_text structure it combines these members with -the key member, and png_free_data() will free only text_ptr.key. Similarly, -if you transfer responsibility for free'ing text_ptr from libpng to your +separately, do not transfer responsibility for freeing text_ptr to libmodpng14, +because when libmodpng14 fills a modpng14_text structure it combines these members with +the key member, and modpng14_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libmodpng14 to your application, your application must not separately free those members. -The png_free_data() function will turn off the "valid" flag for anything +The modpng14_free_data() function will turn off the "valid" flag for anything it frees. If you need to turn the flag off for a chunk that was freed by your -application instead of by libpng, you can use +application instead of by libmodpng14, you can use - png_set_invalid(png_ptr, info_ptr, mask); + modpng14_set_invalid(modpng14_ptr, info_ptr, mask); mask - identifies the chunks to be made invalid, containing the logical OR of one or more of - PNG_INFO_gAMA, PNG_INFO_sBIT, - PNG_INFO_cHRM, PNG_INFO_PLTE, - PNG_INFO_tRNS, PNG_INFO_bKGD, - PNG_INFO_hIST, PNG_INFO_pHYs, - PNG_INFO_oFFs, PNG_INFO_tIME, - PNG_INFO_pCAL, PNG_INFO_sRGB, - PNG_INFO_iCCP, PNG_INFO_sPLT, - PNG_INFO_sCAL, PNG_INFO_IDAT + MODPNG14_INFO_gAMA, MODPNG14_INFO_sBIT, + MODPNG14_INFO_cHRM, MODPNG14_INFO_PLTE, + MODPNG14_INFO_tRNS, MODPNG14_INFO_bKGD, + MODPNG14_INFO_hIST, MODPNG14_INFO_pHYs, + MODPNG14_INFO_oFFs, MODPNG14_INFO_tIME, + MODPNG14_INFO_pCAL, MODPNG14_INFO_sRGB, + MODPNG14_INFO_iCCP, MODPNG14_INFO_sPLT, + MODPNG14_INFO_sCAL, MODPNG14_INFO_IDAT For a more compact example of reading a PNG image, see the file example.c. .SS Reading PNG files progressively The progressive reader is slightly different then the non-progressive -reader. Instead of calling png_read_info(), png_read_rows(), and -png_read_end(), you make one call to png_process_data(), which calls +reader. Instead of calling modpng14_read_info(), modpng14_read_rows(), and +modpng14_read_end(), you make one call to modpng14_process_data(), which calls callbacks when it has the info, a row, or the end of the image. You -set up these callbacks with png_set_progressive_read_fn(). You don't -have to worry about the input/output functions of libpng, as you are -giving the library the data directly in png_process_data(). I will +set up these callbacks with modpng14_set_progressive_read_fn(). You don't +have to worry about the input/output functions of libmodpng14, as you are +giving the library the data directly in modpng14_process_data(). I will assume that you have read the section on reading PNG files above, so I will only highlight the differences (although I will show all of the code). -png_structp png_ptr; -png_infop info_ptr; +modpng14_structp modpng14_ptr; +modpng14_infop info_ptr; /* An example code fragment of how you would initialize the progressive reader in your application. */ int - initialize_png_reader() + initialize_modpng14_reader() { - png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + modpng14_ptr = modpng14_create_read_struct + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if (!png_ptr) + if (!modpng14_ptr) return (ERROR); - info_ptr = png_create_info_struct(png_ptr); + info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, (modpng14_infopp)NULL, + (modpng14_infopp)NULL); return (ERROR); } - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, + (modpng14_infopp)NULL); return (ERROR); } @@ -2128,17 +2128,17 @@ is finished. 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(). You can use + modpng14_set_progressive_read_fn(). You can use any struct as the user_ptr (cast to a void pointer for the function call), and retrieve the pointer from inside the callbacks using the function - png_get_progressive_ptr(png_ptr); + modpng14_get_progressive_ptr(modpng14_ptr); which will return a void pointer, which you have to cast appropriately. */ - png_set_progressive_read_fn(png_ptr, (void *)user_ptr, + modpng14_set_progressive_read_fn(modpng14_ptr, (void *)user_ptr, info_callback, row_callback, end_callback); return 0; @@ -2147,12 +2147,12 @@ /* A code fragment that you call as you receive blocks of data */ int - process_data(png_bytep buffer, png_uint_32 length) + process_data(modpng14_bytep buffer, modpng14_uint_32 length) { - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, + (modpng14_infopp)NULL); return (ERROR); } @@ -2169,26 +2169,26 @@ in the row callback if you don't already do so there. */ - png_process_data(png_ptr, info_ptr, buffer, length); + modpng14_process_data(modpng14_ptr, info_ptr, buffer, length); return 0; } /* This function is called (as set by - png_set_progressive_read_fn() above) when enough data + modpng14_set_progressive_read_fn() above) when enough data has been supplied so all of the header has been read. */ void - info_callback(png_structp png_ptr, png_infop info) + info_callback(modpng14_structp modpng14_ptr, modpng14_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 + either modpng14_start_read_image() or + modpng14_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 + modpng14_process_data() returns, so this is your last chance to prepare for that. */ } @@ -2196,8 +2196,8 @@ /* This function is called when each row of image data is complete */ void - row_callback(png_structp png_ptr, png_bytep new_row, - png_uint_32 row_num, int pass) + row_callback(modpng14_structp modpng14_ptr, modpng14_bytep new_row, + modpng14_uint_32 row_num, int pass) { /* If the image is interlaced, and you turned on the interlace handler, this function will @@ -2211,7 +2211,7 @@ easier. For the non-NULL rows of interlaced images, - you must call png_progressive_combine_row() + you must call modpng14_progressive_combine_row() passing in the row and the old row. You can call this function for NULL rows (it will just return) and for non-interlaced images (it just @@ -2220,7 +2220,7 @@ all cases: */ - png_progressive_combine_row(png_ptr, old_row, + modpng14_progressive_combine_row(modpng14_ptr, old_row, new_row); /* where old_row is what was displayed for @@ -2235,7 +2235,7 @@ } void - end_callback(png_structp png_ptr, png_infop info) + end_callback(modpng14_structp modpng14_ptr, modpng14_infop info) { /* This function is called after the whole image has been read, including any chunks after the @@ -2259,10 +2259,10 @@ .SS Setup -You will want to do the I/O initialization before you get into libpng, +You will want to do the I/O initialization before you get into libmodpng14, so if it doesn't work, you don't have anything to undo. If you are not using the standard I/O functions, you will need to replace them with -custom writing functions. See the discussion under Customizing libpng. +custom writing functions. See the discussion under Customizing libmodpng14. FILE *fp = fopen(file_name, "wb"); if (!fp) @@ -2270,51 +2270,51 @@ return (ERROR); } -Next, png_struct and png_info need to be allocated and initialized. +Next, modpng14_struct and modpng14_info need to be allocated and initialized. As these can be both relatively large, you may not want to store these on the stack, unless you have stack space to spare. Of course, you will want to check if they return NULL. If you are also reading, you won't want to name your read structure and your write structure -both "png_ptr"; you can call them anything you like, such as +both "modpng14_ptr"; you can call them anything you like, such as "read_ptr" and "write_ptr". Look at pngtest.c, for example. - png_structp png_ptr = png_create_write_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + modpng14_structp modpng14_ptr = modpng14_create_write_struct + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if (!png_ptr) + if (!modpng14_ptr) return (ERROR); - png_infop info_ptr = png_create_info_struct(png_ptr); + modpng14_infop info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_write_struct(&png_ptr, - (png_infopp)NULL); + modpng14_destroy_write_struct(&modpng14_ptr, + (modpng14_infopp)NULL); return (ERROR); } If you want to use your own memory allocation routines, -define PNG_USER_MEM_SUPPORTED and use -png_create_write_struct_2() instead of png_create_write_struct(): +define MODPNG14_USER_MEM_SUPPORTED and use +modpng14_create_write_struct_2() instead of modpng14_create_write_struct(): - png_structp png_ptr = png_create_write_struct_2 - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn, (png_voidp) + modpng14_structp modpng14_ptr = modpng14_create_write_struct_2 + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (modpng14_voidp) user_mem_ptr, user_malloc_fn, user_free_fn); After you have these structures, you will need to set up the -error handling. When libpng encounters an error, it expects to +error handling. When libmodpng14 encounters an error, it expects to longjmp() back to your routine. Therefore, you will need to call -setjmp() and pass the png_jmpbuf(png_ptr). If you +setjmp() and pass the modpng14_jmpbuf(modpng14_ptr). If you write the file from different routines, you will need to update -the png_jmpbuf(png_ptr) every time you enter a new routine that will -call a png_*() function. See your documentation of setjmp/longjmp +the modpng14_jmpbuf(modpng14_ptr) every time you enter a new routine that will +call a modpng14_*() function. See your documentation of setjmp/longjmp for your compiler for more information on setjmp/longjmp. See -the discussion on libpng error handling in the Customizing Libpng -section below for more information on the libpng error handling. +the discussion on libmodpng14 error handling in the Customizing Libpng +section below for more information on the libmodpng14 error handling. - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); fclose(fp); return (ERROR); } @@ -2322,17 +2322,17 @@ return; If you would rather avoid the complexity of setjmp/longjmp issues, -you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case -errors will result in a call to PNG_ABORT() which defaults to abort(). +you can compile libmodpng14 with MODPNG14_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to MODPNG14_ABORT() which defaults to abort(). -Now you need to set up the output code. The default for libpng is to +Now you need to set up the output code. The default for libmodpng14 is to use the C function fwrite(). If you use this, you will need to pass a -valid FILE * in the function png_init_io(). Be sure that the file is +valid FILE * in the function modpng14_init_io(). Be sure that the file is opened in binary mode. Again, if you wish to handle writing data in -another way, see the discussion on libpng I/O handling in the Customizing +another way, see the discussion on libmodpng14 I/O handling in the Customizing Libpng section below. - png_init_io(png_ptr, fp); + modpng14_init_io(modpng14_ptr, fp); .SS Write callbacks @@ -2341,7 +2341,7 @@ a progress meter or the like. It's demonstrated in pngtest.c. You must supply a function - void write_row_callback(png_ptr, png_uint_32 row, + void write_row_callback(modpng14_ptr, modpng14_uint_32 row, int pass); { /* put your code here */ @@ -2349,9 +2349,9 @@ (You can give it another name that you like instead of "write_row_callback") -To inform libpng about your function, use +To inform libmodpng14 about your function, use - png_set_write_status_fn(png_ptr, write_row_callback); + modpng14_set_write_status_fn(modpng14_ptr, write_row_callback); You now have the option of modifying how the compression library will run. The following functions are mainly for testing, but may be useful @@ -2360,7 +2360,7 @@ maximum possible compression at the expense of slower writing. If you have no special needs in this area, let the library do what it wants by not calling this function at all, as it has been tuned to deliver a good -speed/compression ratio. The second parameter to png_set_filter() is +speed/compression ratio. The second parameter to modpng14_set_filter() is the filter method, for which the only valid values are 0 (as of the July 1999 PNG specification, version 1.2) or 64 (if you are writing a PNG datastream that is to be embedded in a MNG datastream). The third @@ -2371,15 +2371,15 @@ /* turn on or off filtering, and/or choose specific filters. You can use either a single - PNG_FILTER_VALUE_NAME or the logical OR of one - or more PNG_FILTER_NAME masks. */ - png_set_filter(png_ptr, 0, - PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | - PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB | - PNG_FILTER_UP | PNG_FILTER_VALUE_UP | - PNG_FILTER_AVE | PNG_FILTER_VALUE_AVE | - PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH| - PNG_ALL_FILTERS); + MODPNG14_FILTER_VALUE_NAME or the logical OR of one + or more MODPNG14_FILTER_NAME masks. */ + modpng14_set_filter(modpng14_ptr, 0, + MODPNG14_FILTER_NONE | MODPNG14_FILTER_VALUE_NONE | + MODPNG14_FILTER_SUB | MODPNG14_FILTER_VALUE_SUB | + MODPNG14_FILTER_UP | MODPNG14_FILTER_VALUE_UP | + MODPNG14_FILTER_AVE | MODPNG14_FILTER_VALUE_AVE | + MODPNG14_FILTER_PAETH | MODPNG14_FILTER_VALUE_PAETH| + MODPNG14_ALL_FILTERS); If an application wants to start and stop using particular filters during compression, @@ -2390,43 +2390,43 @@ If you are writing a PNG datastream that is to be embedded in a MNG datastream, the second parameter can be either 0 or 64. -The png_set_compression_*() functions interface to the zlib compression +The modpng14_set_compression_*() functions interface to the zlib compression library, and should mostly be ignored unless you really know what you are -doing. The only generally useful call is png_set_compression_level() +doing. The only generally useful call is modpng14_set_compression_level() which changes how much time zlib spends on trying to compress the image data. See the Compression Library (zlib.h and algorithm.txt, distributed with zlib) for details on the compression levels. /* set the zlib compression level */ - png_set_compression_level(png_ptr, + modpng14_set_compression_level(modpng14_ptr, Z_BEST_COMPRESSION); /* set other zlib parameters */ - png_set_compression_mem_level(png_ptr, 8); - png_set_compression_strategy(png_ptr, + modpng14_set_compression_mem_level(modpng14_ptr, 8); + modpng14_set_compression_strategy(modpng14_ptr, Z_DEFAULT_STRATEGY); - png_set_compression_window_bits(png_ptr, 15); - png_set_compression_method(png_ptr, 8); - png_set_compression_buffer_size(png_ptr, 8192) + modpng14_set_compression_window_bits(modpng14_ptr, 15); + modpng14_set_compression_method(modpng14_ptr, 8); + modpng14_set_compression_buffer_size(modpng14_ptr, 8192) -extern PNG_EXPORT(void,png_set_zbuf_size) +extern MODPNG14_EXPORT(void,modpng14_set_zbuf_size) .SS Setting the contents of info for output -You now need to fill in the png_info structure with all the data you +You now need to fill in the modpng14_info structure with all the data you wish to write before the actual image. Note that the only thing you are allowed to write after the image is the text chunks and the time -chunk (as of PNG Specification 1.2, anyway). See png_write_end() and +chunk (as of PNG Specification 1.2, anyway). See modpng14_write_end() and the latest PNG specification for more information on that. If you wish to write them before the image, fill them in now, and flag that data as being valid. If you want to wait until after the data, don't -fill them until png_write_end(). For all the fields in png_info and -their data types, see png.h. For explanations of what the fields +fill them until modpng14_write_end(). For all the fields in modpng14_info and +their data types, see modpng14.h. For explanations of what the fields contain, see the PNG specification. -Some of the more important parts of the png_info are: +Some of the more important parts of the modpng14_info are: - png_set_IHDR(png_ptr, info_ptr, width, height, + modpng14_set_IHDR(modpng14_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_method) width - holds the width of the image @@ -2441,44 +2441,44 @@ bits (sBIT) below). color_type - describes which color/alpha channels are present. - PNG_COLOR_TYPE_GRAY + MODPNG14_COLOR_TYPE_GRAY (bit depths 1, 2, 4, 8, 16) - PNG_COLOR_TYPE_GRAY_ALPHA + MODPNG14_COLOR_TYPE_GRAY_ALPHA (bit depths 8, 16) - PNG_COLOR_TYPE_PALETTE + MODPNG14_COLOR_TYPE_PALETTE (bit depths 1, 2, 4, 8) - PNG_COLOR_TYPE_RGB + MODPNG14_COLOR_TYPE_RGB (bit_depths 8, 16) - PNG_COLOR_TYPE_RGB_ALPHA + MODPNG14_COLOR_TYPE_RGB_ALPHA (bit_depths 8, 16) - PNG_COLOR_MASK_PALETTE - PNG_COLOR_MASK_COLOR - PNG_COLOR_MASK_ALPHA + MODPNG14_COLOR_MASK_PALETTE + MODPNG14_COLOR_MASK_COLOR + MODPNG14_COLOR_MASK_ALPHA - interlace_type - PNG_INTERLACE_NONE or - PNG_INTERLACE_ADAM7 + interlace_type - MODPNG14_INTERLACE_NONE or + MODPNG14_INTERLACE_ADAM7 compression_type - (must be - PNG_COMPRESSION_TYPE_DEFAULT) - filter_method - (must be PNG_FILTER_TYPE_DEFAULT + MODPNG14_COMPRESSION_TYPE_DEFAULT) + filter_method - (must be MODPNG14_FILTER_TYPE_DEFAULT or, if you are writing a PNG to be embedded in a MNG datastream, can also be - PNG_INTRAPIXEL_DIFFERENCING) + MODPNG14_INTRAPIXEL_DIFFERENCING) - png_set_PLTE(png_ptr, info_ptr, palette, + modpng14_set_PLTE(modpng14_ptr, info_ptr, palette, num_palette); palette - the palette for the file - (array of png_color) + (array of modpng14_color) num_palette - number of entries in the palette - png_set_gAMA(png_ptr, info_ptr, gamma); + modpng14_set_gAMA(modpng14_ptr, info_ptr, gamma); gamma - the gamma the image was created - at (PNG_INFO_gAMA) + at (MODPNG14_INFO_gAMA) - png_set_sRGB(png_ptr, info_ptr, srgb_intent); + modpng14_set_sRGB(modpng14_ptr, info_ptr, srgb_intent); srgb_intent - the rendering intent - (PNG_INFO_sRGB) The presence of + (MODPNG14_INFO_sRGB) The presence of the sRGB chunk means that the pixel data is in the sRGB color space. This chunk also implies specific @@ -2488,16 +2488,16 @@ Color Consortium (http://www.color.org). It can be one of - PNG_sRGB_INTENT_SATURATION, - PNG_sRGB_INTENT_PERCEPTUAL, - PNG_sRGB_INTENT_ABSOLUTE, or - PNG_sRGB_INTENT_RELATIVE. + MODPNG14_sRGB_INTENT_SATURATION, + MODPNG14_sRGB_INTENT_PERCEPTUAL, + MODPNG14_sRGB_INTENT_ABSOLUTE, or + MODPNG14_sRGB_INTENT_RELATIVE. - png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, + modpng14_set_sRGB_gAMA_and_cHRM(modpng14_ptr, info_ptr, srgb_intent); srgb_intent - the rendering intent - (PNG_INFO_sRGB) The presence of the + (MODPNG14_INFO_sRGB) The presence of the sRGB chunk means that the pixel data is in the sRGB color space. This function also causes gAMA and @@ -2505,54 +2505,54 @@ that are consistent with sRGB to be written. - png_set_iCCP(png_ptr, info_ptr, name, compression_type, + modpng14_set_iCCP(modpng14_ptr, info_ptr, name, compression_type, profile, proflen); name - The profile name. compression - The compression type; always - PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + MODPNG14_COMPRESSION_TYPE_BASE for PNG 1.0. You may give NULL to this argument to ignore it. profile - International Color Consortium color profile data. May contain NULs. proflen - length of profile data in bytes. - png_set_sBIT(png_ptr, info_ptr, sig_bit); + modpng14_set_sBIT(modpng14_ptr, info_ptr, sig_bit); sig_bit - the number of significant bits for - (PNG_INFO_sBIT) each of the gray, red, + (MODPNG14_INFO_sBIT) each of the gray, red, green, and blue channels, whichever are appropriate for the given color type - (png_color_16) + (modpng14_color_16) - png_set_tRNS(png_ptr, info_ptr, trans, num_trans, + modpng14_set_tRNS(modpng14_ptr, info_ptr, trans, num_trans, trans_values); trans - array of transparent entries for - palette (PNG_INFO_tRNS) + palette (MODPNG14_INFO_tRNS) trans_values - graylevel or color sample values of the single transparent color for - non-paletted images (PNG_INFO_tRNS) + non-paletted images (MODPNG14_INFO_tRNS) num_trans - number of transparent entries - (PNG_INFO_tRNS) + (MODPNG14_INFO_tRNS) - png_set_hIST(png_ptr, info_ptr, hist); - (PNG_INFO_hIST) + modpng14_set_hIST(modpng14_ptr, info_ptr, hist); + (MODPNG14_INFO_hIST) hist - histogram of palette (array of - png_uint_16) + modpng14_uint_16) - png_set_tIME(png_ptr, info_ptr, mod_time); + modpng14_set_tIME(modpng14_ptr, info_ptr, mod_time); mod_time - time image was last modified - (PNG_VALID_tIME) + (MODPNG14_VALID_tIME) - png_set_bKGD(png_ptr, info_ptr, background); - background - background color (PNG_VALID_bKGD) + modpng14_set_bKGD(modpng14_ptr, info_ptr, background); + background - background color (MODPNG14_VALID_bKGD) - png_set_text(png_ptr, info_ptr, text_ptr, num_text); - text_ptr - array of png_text holding image + modpng14_set_text(modpng14_ptr, info_ptr, text_ptr, num_text); + text_ptr - array of modpng14_text holding image comments text_ptr[i].compression - type of compression used - on "text" PNG_TEXT_COMPRESSION_NONE - PNG_TEXT_COMPRESSION_zTXt - PNG_ITXT_COMPRESSION_NONE - PNG_ITXT_COMPRESSION_zTXt + on "text" MODPNG14_TEXT_COMPRESSION_NONE + MODPNG14_TEXT_COMPRESSION_zTXt + MODPNG14_ITXT_COMPRESSION_NONE + MODPNG14_ITXT_COMPRESSION_zTXt text_ptr[i].key - keyword for comment. Must contain 1-79 characters. text_ptr[i].text - text comments for current @@ -2567,84 +2567,84 @@ or empty for unknown). num_text - number of comments - png_set_sPLT(png_ptr, info_ptr, &palette_ptr, + modpng14_set_sPLT(modpng14_ptr, info_ptr, &palette_ptr, num_spalettes); - palette_ptr - array of png_sPLT_struct structures + palette_ptr - array of modpng14_sPLT_struct structures to be added to the list of palettes in the info structure. num_spalettes - number of palette structures to be added. - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, + modpng14_set_oFFs(modpng14_ptr, info_ptr, offset_x, offset_y, unit_type); offset_x - positive offset from the left edge of the screen offset_y - positive offset from the top edge of the screen - unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + unit_type - MODPNG14_OFFSET_PIXEL, MODPNG14_OFFSET_MICROMETER - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, + modpng14_set_pHYs(modpng14_ptr, info_ptr, res_x, res_y, unit_type); res_x - pixels/unit physical resolution in x direction res_y - pixels/unit physical resolution in y direction - unit_type - PNG_RESOLUTION_UNKNOWN, - PNG_RESOLUTION_METER + unit_type - MODPNG14_RESOLUTION_UNKNOWN, + MODPNG14_RESOLUTION_METER - png_set_sCAL(png_ptr, info_ptr, unit, width, height) + modpng14_set_sCAL(modpng14_ptr, info_ptr, unit, width, height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are doubles) - png_set_sCAL_s(png_ptr, info_ptr, unit, width, height) + modpng14_set_sCAL_s(modpng14_ptr, info_ptr, unit, width, height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are strings like "2.54") - png_set_unknown_chunks(png_ptr, info_ptr, &unknowns, + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, &unknowns, num_unknowns) - unknowns - array of png_unknown_chunk + unknowns - array of modpng14_unknown_chunk structures holding unknown chunks unknowns[i].name - name of unknown chunk unknowns[i].data - data of unknown chunk unknowns[i].size - size of unknown chunk's data unknowns[i].location - position to write chunk in file 0: do not write chunk - PNG_HAVE_IHDR: before PLTE - PNG_HAVE_PLTE: before IDAT - PNG_AFTER_IDAT: after IDAT + MODPNG14_HAVE_IHDR: before PLTE + MODPNG14_HAVE_PLTE: before IDAT + MODPNG14_AFTER_IDAT: after IDAT The "location" member is set automatically according to what part of the output file has already been written. -You can change its value after calling png_set_unknown_chunks() +You can change its value after calling modpng14_set_unknown_chunks() as demonstrated in pngtest.c. Within each of the "locations", the chunks are sequenced according to their position in the structure (that is, the value of "i", which is the order in which the chunk was either read from the input file or defined with -png_set_unknown_chunks). +modpng14_set_unknown_chunks). -A quick word about text and num_text. text is an array of png_text +A quick word about text and num_text. text is an array of modpng14_text structures. num_text is the number of valid structures in the array. -Each png_text structure holds a language code, a keyword, a text value, +Each modpng14_text structure holds a language code, a keyword, a text value, and a compression type. The compression types have the same valid numbers as the compression types of the image data. Currently, the only valid number is zero. However, you can store text either compressed or uncompressed, unlike images, which always have to be compressed. So if you don't want the -text compressed, set the compression type to PNG_TEXT_COMPRESSION_NONE. +text compressed, set the compression type to MODPNG14_TEXT_COMPRESSION_NONE. Because tEXt and zTXt chunks don't have a language field, if you -specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt +specify MODPNG14_TEXT_COMPRESSION_NONE or MODPNG14_TEXT_COMPRESSION_zTXt any language code or translated keyword will not be written out. Until text gets around 1000 bytes, it is not worth compressing it. After the text has been written out to the file, the compression type -is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, +is set to MODPNG14_TEXT_COMPRESSION_NONE_WR or MODPNG14_TEXT_COMPRESSION_zTXt_WR, so that it isn't written out again at the end (in case you are calling -png_write_end() with the same struct. +modpng14_write_end() with the same struct. The keywords that are given in the PNG Specification are: @@ -2681,11 +2681,11 @@ Compressed pairs must have a text string, as only the text string is compressed anyway, so the compression would be meaningless. -PNG supports modification time via the png_time structure. Two -conversion routines are provided, png_convert_from_time_t() for -time_t and png_convert_from_struct_tm() for struct tm. The +PNG supports modification time via the modpng14_time structure. Two +conversion routines are provided, modpng14_convert_from_time_t() for +time_t and modpng14_convert_from_struct_tm() for struct tm. The time_t routine uses gmtime(). You don't have to use either of -these, but if you wish to fill in the png_time structure directly, +these, but if you wish to fill in the modpng14_time structure directly, you should provide the time in universal time (GMT) if possible instead of your local time. Note that the year number is the full year (e.g. 1998, rather than 98 - PNG is year 2000 compliant!), and @@ -2702,15 +2702,15 @@ although this isn't a requirement. Unlike the tIME chunk, the "Creation Time" tEXt chunk is not expected to be automatically changed by the software. To facilitate the use of RFC 1123 dates, a function -png_convert_to_rfc1123(png_timep) is provided to convert from PNG +modpng14_convert_to_rfc1123(modpng14_timep) is provided to convert from PNG time to an RFC 1123 format string. .SS Writing unknown chunks -You can use the png_set_unknown_chunks function to queue up chunks +You can use the modpng14_set_unknown_chunks function to queue up chunks for writing. You give it a chunk name, raw data, and a size; that's all there is to it. The chunks will be written by the next following -png_write_info_before_PLTE, png_write_info, or png_write_end function. +modpng14_write_info_before_PLTE, modpng14_write_info, or modpng14_write_end function. Any chunks previously read into the info structure's unknown-chunk list will also be written out in a sequence that satisfies the PNG specification's ordering rules. @@ -2723,31 +2723,31 @@ in the info structure. All defined output transformations are permitted, enabled by the following masks. - PNG_TRANSFORM_IDENTITY No transformation - PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples - PNG_TRANSFORM_PACKSWAP Change order of packed + MODPNG14_TRANSFORM_IDENTITY No transformation + MODPNG14_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples + MODPNG14_TRANSFORM_PACKSWAP Change order of packed pixels to LSB first - PNG_TRANSFORM_INVERT_MONO Invert monochrome images - PNG_TRANSFORM_SHIFT Normalize pixels to the + MODPNG14_TRANSFORM_INVERT_MONO Invert monochrome images + MODPNG14_TRANSFORM_SHIFT Normalize pixels to the sBIT depth - PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + MODPNG14_TRANSFORM_BGR Flip RGB to BGR, RGBA to BGRA - PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + MODPNG14_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA to AG - PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + MODPNG14_TRANSFORM_INVERT_ALPHA Change alpha from opacity to transparency - PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples - PNG_TRANSFORM_STRIP_FILLER Strip out filler bytes. + MODPNG14_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + MODPNG14_TRANSFORM_STRIP_FILLER Strip out filler bytes. If you have valid image data in the info structure (you can use -png_set_rows() to put image data in the info structure), simply do this: +modpng14_set_rows() to put image data in the info structure), simply do this: - png_write_png(png_ptr, info_ptr, png_transforms, NULL) + modpng14_write_png(modpng14_ptr, info_ptr, modpng14_transforms, NULL) -where png_transforms is an integer containing the logical OR of some set of -transformation flags. This call is equivalent to png_write_info(), +where modpng14_transforms is an integer containing the logical OR of some set of +transformation flags. This call is equivalent to modpng14_write_info(), followed the set of transformations indicated by the transform mask, -then png_write_image(), and finally png_write_end(). +then modpng14_write_image(), and finally modpng14_write_end(). (The final parameter of this call is not yet used. Someday it might point to transformation parameters required by some future output transform.) @@ -2756,34 +2756,34 @@ If you are going the low-level route instead, you are now ready to write all the file information up to the actual image data. You do -this with a call to png_write_info(). +this with a call to modpng14_write_info(). - png_write_info(png_ptr, info_ptr); + modpng14_write_info(modpng14_ptr, info_ptr); Note that there is one transformation you may need to do before -png_write_info(). In PNG files, the alpha channel in an image is the +modpng14_write_info(). In PNG files, the alpha channel in an image is the level of opacity. If your data is supplied as a level of transparency, you can invert the alpha channel before you write it, so that 0 is fully transparent and 255 (in 8-bit or paletted images) or 65535 (in 16-bit images) is fully opaque, with - png_set_invert_alpha(png_ptr); + modpng14_set_invert_alpha(modpng14_ptr); -This must appear before png_write_info() instead of later with the +This must appear before modpng14_write_info() instead of later with the other transformations because in the case of paletted images the tRNS chunk data has to be inverted before the tRNS chunk is written. If your image is not a paletted image, the tRNS data (which in such cases represents a single color to be rendered as transparent) won't need to be changed, and you can safely do this transformation after your -png_write_info() call. +modpng14_write_info() call. If you need to write a private chunk that you want to appear before the PLTE chunk when PLTE is present, you can write the PNG info in two steps, and insert code to write your own chunk between them: - png_write_info_before_PLTE(png_ptr, info_ptr); - png_set_unknown_chunks(png_ptr, info_ptr, ...); - png_write_info(png_ptr, info_ptr); + modpng14_write_info_before_PLTE(modpng14_ptr, info_ptr); + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, ...); + modpng14_write_info(modpng14_ptr, info_ptr); After you've written the file information, you can set up the library to handle any special transformations of the image data. The various @@ -2800,10 +2800,10 @@ to 3 or 6 bytes (or strip 2 or 4-byte grayscale+filler data to 1 or 2 bytes per pixel). - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + modpng14_set_filler(modpng14_ptr, 0, MODPNG14_FILLER_BEFORE); -where the 0 is unused, and the location is either PNG_FILLER_BEFORE or -PNG_FILLER_AFTER, depending upon whether the filler byte in the pixel +where the 0 is unused, and the location is either MODPNG14_FILLER_BEFORE or +MODPNG14_FILLER_AFTER, depending upon whether the filler byte in the pixel is stored XRGB or RGBX. PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as @@ -2811,14 +2811,14 @@ If the data is supplied at 1 pixel per byte, use this code, which will correctly pack the pixels into a single byte: - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If your data is of another bit depth, you can write an sBIT chunk into the file so that decoders can recover the original data if desired. /* Set the true bit depth of the image data */ - if (color_type & PNG_COLOR_MASK_COLOR) + if (color_type & MODPNG14_COLOR_MASK_COLOR) { sig_bit.red = true_bit_depth; sig_bit.green = true_bit_depth; @@ -2828,19 +2828,19 @@ { sig_bit.gray = true_bit_depth; } - if (color_type & PNG_COLOR_MASK_ALPHA) + if (color_type & MODPNG14_COLOR_MASK_ALPHA) { sig_bit.alpha = true_bit_depth; } - png_set_sBIT(png_ptr, info_ptr, &sig_bit); + modpng14_set_sBIT(modpng14_ptr, info_ptr, &sig_bit); If the data is stored in the row buffer in a bit depth other than one supported by PNG (e.g. 3 bit data in the range 0-7 for a 4-bit PNG), this will scale the values to appear to be the correct bit depth as is required by PNG. - png_set_shift(png_ptr, &sig_bit); + modpng14_set_shift(modpng14_ptr, &sig_bit); PNG files store 16 bit pixels in network byte order (big-endian, ie. most significant bits first). This code would be used if they are @@ -2848,36 +2848,36 @@ first, the way PCs store them): if (bit_depth > 8) - png_set_swap(png_ptr); + modpng14_set_swap(modpng14_ptr); If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you need to change the order the pixels are packed into bytes, you can use: if (bit_depth < 8) - png_set_packswap(png_ptr); + modpng14_set_packswap(modpng14_ptr); PNG files store 3 color pixels in red, green, blue order. This code would be used if they are supplied as blue, green, red: - png_set_bgr(png_ptr); + modpng14_set_bgr(modpng14_ptr); PNG files describe monochrome as black being zero and white being one. This code would be used if the pixels are supplied with this reversed (black being one and white being zero): - png_set_invert_mono(png_ptr); + modpng14_set_invert_mono(modpng14_ptr); Finally, you can write your own transformation function if none of the existing ones meets your needs. This is done by setting a callback with - png_set_write_user_transform_fn(png_ptr, + modpng14_set_write_user_transform_fn(modpng14_ptr, write_transform_fn); You must supply the function - void write_transform_fn(png_ptr ptr, row_info_ptr - row_info, png_bytep data) + void write_transform_fn(modpng14_ptr ptr, row_info_ptr + row_info, modpng14_bytep data) See pngtest.c for a working example. Your function will be called before any of the other transformations are processed. @@ -2885,33 +2885,33 @@ You can also set up a pointer to a user structure for use by your callback function. - png_set_user_transform_info(png_ptr, user_ptr, 0, 0); + modpng14_set_user_transform_info(modpng14_ptr, user_ptr, 0, 0); The user_channels and user_depth parameters of this function are ignored when writing; you can set them to zero as shown. -You can retrieve the pointer via the function png_get_user_transform_ptr(). +You can retrieve the pointer via the function modpng14_get_user_transform_ptr(). For example: voidp write_user_transform_ptr = - png_get_user_transform_ptr(png_ptr); + modpng14_get_user_transform_ptr(modpng14_ptr); -It is possible to have libpng flush any pending output, either manually, +It is possible to have libmodpng14 flush any pending output, either manually, or automatically after a certain number of lines have been written. To flush the output stream a single time call: - png_write_flush(png_ptr); + modpng14_write_flush(modpng14_ptr); -and to have libpng flush the output stream periodically after a certain +and to have libmodpng14 flush the output stream periodically after a certain number of scanlines have been written, call: - png_set_flush(png_ptr, nrows); + modpng14_set_flush(modpng14_ptr, nrows); -Note that the distance between rows is from the last time png_write_flush() +Note that the distance between rows is from the last time modpng14_write_flush() was called, or the first row of the image if it has never been called. -So if you write 50 lines, and then png_set_flush 25, it will flush the +So if you write 50 lines, and then modpng14_set_flush 25, it will flush the output on the next scanline, and every 25 lines thereafter, unless -png_write_flush() is called before 25 more lines have been written. +modpng14_write_flush() is called before 25 more lines have been written. If nrows is too small (less than about 10 lines for a 640 pixel wide RGB image) the image compression may decrease noticeably (although this may be acceptable for real-time applications). Infrequent flushing will @@ -2922,61 +2922,61 @@ That's it for the transformations. Now you can write the image data. The simplest way to do this is in one function call. If you have the -whole image in memory, you can just call png_write_image() and libpng +whole image in memory, you can just call modpng14_write_image() and libmodpng14 will write the image. You will need to pass in an array of pointers to each row. This function automatically handles interlacing, so you don't -need to call png_set_interlace_handling() or call this function multiple -times, or any of that other stuff necessary with png_write_rows(). +need to call modpng14_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with modpng14_write_rows(). - png_write_image(png_ptr, row_pointers); + modpng14_write_image(modpng14_ptr, row_pointers); where row_pointers is: - png_byte *row_pointers[height]; + modpng14_byte *row_pointers[height]; You can point to void or char or whatever you use for pixels. If you don't want to write the whole image at once, you can -use png_write_rows() instead. If the file is not interlaced, +use modpng14_write_rows() instead. If the file is not interlaced, this is simple: - png_write_rows(png_ptr, row_pointers, + modpng14_write_rows(modpng14_ptr, row_pointers, number_of_rows); -row_pointers is the same as in the png_write_image() call. +row_pointers is the same as in the modpng14_write_image() call. If you are just writing one row at a time, you can do this with a single row_pointer instead of an array of row_pointers: - png_bytep row_pointer = row; + modpng14_bytep row_pointer = row; - png_write_row(png_ptr, row_pointer); + modpng14_write_row(modpng14_ptr, row_pointer); When the file is interlaced, things can get a good deal more complicated. The only currently (as of the PNG Specification version 1.2, dated July 1999) defined interlacing scheme for PNG files is the "Adam7" interlace scheme, that breaks down an -image into seven smaller images of varying size. libpng will build +image into seven smaller images of varying size. libmodpng14 will build these images for you, or you can do them yourself. If you want to build them yourself, see the PNG specification for details of which pixels to write when. -If you don't want libpng to handle the interlacing details, just -use png_set_interlace_handling() and call png_write_rows() the +If you don't want libmodpng14 to handle the interlacing details, just +use modpng14_set_interlace_handling() and call modpng14_write_rows() the correct number of times to write all seven sub-images. -If you want libpng to build the sub-images, call this before you start +If you want libmodpng14 to build the sub-images, call this before you start writing any rows: number_of_passes = - png_set_interlace_handling(png_ptr); + modpng14_set_interlace_handling(modpng14_ptr); This will return the number of passes needed. Currently, this is seven, but may change if another interlace type is added. Then write the complete image number_of_passes times. - png_write_rows(png_ptr, row_pointers, + modpng14_write_rows(modpng14_ptr, row_pointers, number_of_rows); As some of these rows are not used, and thus return immediately, @@ -2987,34 +2987,34 @@ After you are finished writing the image, you should finish writing the file. If you are interested in writing comments or time, you should -pass an appropriately filled png_info pointer. If you are not interested, +pass an appropriately filled modpng14_info pointer. If you are not interested, you can pass NULL. - png_write_end(png_ptr, info_ptr); + modpng14_write_end(modpng14_ptr, info_ptr); -When you are done, you can free all memory used by libpng like this: +When you are done, you can free all memory used by libmodpng14 like this: - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); It is also possible to individually free the info_ptr members that -point to libpng-allocated storage with the following function: +point to libmodpng14-allocated storage with the following function: - png_free_data(png_ptr, info_ptr, mask, seq) + modpng14_free_data(modpng14_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask containing the logical OR of one or more of - PNG_FREE_PLTE, PNG_FREE_TRNS, - PNG_FREE_HIST, PNG_FREE_ICCP, - PNG_FREE_PCAL, PNG_FREE_ROWS, - PNG_FREE_SCAL, PNG_FREE_SPLT, - PNG_FREE_TEXT, PNG_FREE_UNKN, - or simply PNG_FREE_ALL + MODPNG14_FREE_PLTE, MODPNG14_FREE_TRNS, + MODPNG14_FREE_HIST, MODPNG14_FREE_ICCP, + MODPNG14_FREE_PCAL, MODPNG14_FREE_ROWS, + MODPNG14_FREE_SCAL, MODPNG14_FREE_SPLT, + MODPNG14_FREE_TEXT, MODPNG14_FREE_UNKN, + or simply MODPNG14_FREE_ALL seq - sequence number of item to be freed (-1 for all items) This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those +by the user and not by libmodpng14, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not -1, and multiple items are allowed for the data type identified in @@ -3022,31 +3022,31 @@ is freed, where n is "seq". If you allocated data such as a palette that you passed -in to libpng with png_set_*, you must not free it until just before the call to -png_destroy_write_struct(). +in to libmodpng14 with modpng14_set_*, you must not free it until just before the call to +modpng14_destroy_write_struct(). The default behavior is only to free data that was allocated internally -by libpng. This can be changed, so that libpng will not free the data, -or so that it will free data that was allocated by the user with png_malloc() -or png_zalloc() and passed in via a png_set_*() function, with +by libmodpng14. This can be changed, so that libmodpng14 will not free the data, +or so that it will free data that was allocated by the user with modpng14_malloc() +or modpng14_zalloc() and passed in via a modpng14_set_*() function, with - png_data_freer(png_ptr, info_ptr, freer, mask) + modpng14_data_freer(modpng14_ptr, info_ptr, freer, mask) mask - which data elements are affected - same choices as in png_free_data() + same choices as in modpng14_free_data() freer - one of - PNG_DESTROY_WILL_FREE_DATA - PNG_SET_WILL_FREE_DATA - PNG_USER_WILL_FREE_DATA + MODPNG14_DESTROY_WILL_FREE_DATA + MODPNG14_SET_WILL_FREE_DATA + MODPNG14_USER_WILL_FREE_DATA For example, to transfer responsibility for some data from a read structure to a write structure, you could use - png_data_freer(read_ptr, read_info_ptr, - PNG_USER_WILL_FREE_DATA, - PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) - png_data_freer(write_ptr, write_info_ptr, - PNG_DESTROY_WILL_FREE_DATA, - PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + modpng14_data_freer(read_ptr, read_info_ptr, + MODPNG14_USER_WILL_FREE_DATA, + MODPNG14_FREE_PLTE|MODPNG14_FREE_tRNS|MODPNG14_FREE_hIST) + modpng14_data_freer(write_ptr, write_info_ptr, + MODPNG14_DESTROY_WILL_FREE_DATA, + MODPNG14_FREE_PLTE|MODPNG14_FREE_tRNS|MODPNG14_FREE_hIST) thereby briefly reassigning responsibility for freeing to the user but immediately afterwards reassigning it once more to the write_destroy @@ -3055,28 +3055,28 @@ structure. This function only affects data that has already been allocated. -You can call this function before calling after the png_set_*() functions -to control whether the user or png_destroy_*() is supposed to free the data. -When the user assumes responsibility for libpng-allocated data, the +You can call this function before calling after the modpng14_set_*() functions +to control whether the user or modpng14_destroy_*() is supposed to free the data. +When the user assumes responsibility for libmodpng14-allocated data, the application must use -png_free() to free it, and when the user transfers responsibility to libpng -for data that the user has allocated, the user must have used png_malloc() -or png_zalloc() to allocate it. +modpng14_free() to free it, and when the user transfers responsibility to libmodpng14 +for data that the user has allocated, the user must have used modpng14_malloc() +or modpng14_zalloc() to allocate it. If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword -separately, do not transfer responsibility for freeing text_ptr to libpng, -because when libpng fills a png_text structure it combines these members with -the key member, and png_free_data() will free only text_ptr.key. Similarly, -if you transfer responsibility for free'ing text_ptr from libpng to your +separately, do not transfer responsibility for freeing text_ptr to libmodpng14, +because when libmodpng14 fills a modpng14_text structure it combines these members with +the key member, and modpng14_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libmodpng14 to your application, your application must not separately free those members. For a more compact example of writing a PNG image, see the file example.c. -.SH V. Modifying/Customizing libpng: +.SH V. Modifying/Customizing libmodpng14: -There are three issues here. The first is changing how libpng does +There are three issues here. The first is changing how libmodpng14 does standard things like memory allocation, input/output, and error handling. The second deals with more complicated things like adding new chunks, -adding new transformations, and generally changing how libpng works. +adding new transformations, and generally changing how libmodpng14 works. Both of those are compile-time issues; that is, they are generally determined at the time the code is written, and there is rarely a need to provide the user with a means of changing them. The third is a @@ -3087,99 +3087,99 @@ Memory allocation, input/output, and error handling -All of the memory allocation, input/output, and error handling in libpng +All of the memory allocation, input/output, and error handling in libmodpng14 goes through callbacks that are user-settable. The default routines are in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change -these functions, call the appropriate png_set_*_fn() function. +these functions, call the appropriate modpng14_set_*_fn() function. -Memory allocation is done through the functions png_malloc() -and png_free(). These currently just call the standard C functions. If +Memory allocation is done through the functions modpng14_malloc() +and modpng14_free(). These currently just call the standard C functions. If your pointers can't access more then 64K at a time, you will want to set MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling memory allocation on a platform will change between applications, these functions must be modified in the library at compile time. If you prefer to use a different method of allocating and freeing data, you can use -png_create_read_struct_2() or png_create_write_struct_2() to register +modpng14_create_read_struct_2() or modpng14_create_write_struct_2() to register your own functions as described above. These functions also provide a void pointer that can be retrieved via - mem_ptr=png_get_mem_ptr(png_ptr); + mem_ptr=modpng14_get_mem_ptr(modpng14_ptr); Your replacement memory functions must have prototypes as follows: - png_voidp malloc_fn(png_structp png_ptr, - png_size_t size); - void free_fn(png_structp png_ptr, png_voidp ptr); + modpng14_voidp malloc_fn(modpng14_structp modpng14_ptr, + modpng14_size_t size); + void free_fn(modpng14_structp modpng14_ptr, modpng14_voidp ptr); -Your malloc_fn() should return NULL in case of failure. The png_malloc() -function will call png_error() if it receives a NULL from the system +Your malloc_fn() should return NULL in case of failure. The modpng14_malloc() +function will call modpng14_error() if it receives a NULL from the system memory allocator or from your replacement malloc_fn(). -Input/Output in libpng is done through png_read() and png_write(), +Input/Output in libmodpng14 is done through modpng14_read() and modpng14_write(), which currently just call fread() and fwrite(). The FILE * is stored in -png_struct and is initialized via png_init_io(). If you wish to change +modpng14_struct and is initialized via modpng14_init_io(). If you wish to change the method of I/O, the library supplies callbacks that you can set -through the function png_set_read_fn() and png_set_write_fn() at run -time, instead of calling the png_init_io() function. These functions +through the function modpng14_set_read_fn() and modpng14_set_write_fn() at run +time, instead of calling the modpng14_init_io() function. These functions also provide a void pointer that can be retrieved via the function -png_get_io_ptr(). For example: +modpng14_get_io_ptr(). For example: - png_set_read_fn(png_structp read_ptr, - voidp read_io_ptr, png_rw_ptr read_data_fn) + modpng14_set_read_fn(modpng14_structp read_ptr, + voidp read_io_ptr, modpng14_rw_ptr read_data_fn) - png_set_write_fn(png_structp write_ptr, - voidp write_io_ptr, png_rw_ptr write_data_fn, - png_flush_ptr output_flush_fn); + modpng14_set_write_fn(modpng14_structp write_ptr, + voidp write_io_ptr, modpng14_rw_ptr write_data_fn, + modpng14_flush_ptr output_flush_fn); - voidp read_io_ptr = png_get_io_ptr(read_ptr); - voidp write_io_ptr = png_get_io_ptr(write_ptr); + voidp read_io_ptr = modpng14_get_io_ptr(read_ptr); + voidp write_io_ptr = modpng14_get_io_ptr(write_ptr); The replacement I/O functions must have prototypes as follows: - void user_read_data(png_structp png_ptr, - png_bytep data, png_size_t length); - void user_write_data(png_structp png_ptr, - png_bytep data, png_size_t length); - void user_flush_data(png_structp png_ptr); + void user_read_data(modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length); + void user_write_data(modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length); + void user_flush_data(modpng14_structp modpng14_ptr); Supplying NULL for the read, write, or flush functions sets them back to using the default C stream functions. It is an error to read from a write stream, and vice versa. -Error handling in libpng is done through png_error() and png_warning(). -Errors handled through png_error() are fatal, meaning that png_error() +Error handling in libmodpng14 is done through modpng14_error() and modpng14_warning(). +Errors handled through modpng14_error() are fatal, meaning that modpng14_error() should never return to its caller. Currently, this is handled via -setjmp() and longjmp() (unless you have compiled libpng with -PNG_SETJMP_NOT_SUPPORTED, in which case it is handled via PNG_ABORT()), +setjmp() and longjmp() (unless you have compiled libmodpng14 with +MODPNG14_SETJMP_NOT_SUPPORTED, in which case it is handled via MODPNG14_ABORT()), but you could change this to do things like exit() if you should wish. -On non-fatal errors, png_warning() is called +On non-fatal errors, modpng14_warning() is called to print a warning message, and then control returns to the calling code. -By default png_error() and png_warning() print a message on stderr via -fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined -(because you don't want the messages) or PNG_NO_STDIO defined (because +By default modpng14_error() and modpng14_warning() print a message on stderr via +fprintf() unless the library is compiled with MODPNG14_NO_CONSOLE_IO defined +(because you don't want the messages) or MODPNG14_NO_STDIO defined (because fprintf() isn't available). If you wish to change the behavior of the error functions, you will need to set up your own message callbacks. These -functions are normally supplied at the time that the png_struct is created. +functions are normally supplied at the time that the modpng14_struct is created. It is also possible to redirect errors and warnings to your own replacement -functions after png_create_*_struct() has been called by calling: +functions after modpng14_create_*_struct() has been called by calling: - png_set_error_fn(png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warning_fn); + modpng14_set_error_fn(modpng14_structp modpng14_ptr, + modpng14_voidp error_ptr, modpng14_error_ptr error_fn, + modpng14_error_ptr warning_fn); - png_voidp error_ptr = png_get_error_ptr(png_ptr); + modpng14_voidp error_ptr = modpng14_get_error_ptr(modpng14_ptr); -If NULL is supplied for either error_fn or warning_fn, then the libpng +If NULL is supplied for either error_fn or warning_fn, then the libmodpng14 default function will be used, calling fprintf() and/or longjmp() if a problem is encountered. The replacement error functions should have parameters as follows: - void user_error_fn(png_structp png_ptr, - png_const_charp error_msg); - void user_warning_fn(png_structp png_ptr, - png_const_charp warning_msg); + void user_error_fn(modpng14_structp modpng14_ptr, + modpng14_const_charp error_msg); + void user_warning_fn(modpng14_structp modpng14_ptr, + modpng14_const_charp warning_msg); The motivation behind using setjmp() and longjmp() is the C++ throw and catch exception handling methods. This makes the code much easier to write, @@ -3193,7 +3193,7 @@ .SS Custom chunks If you need to read or write custom chunks, you may need to get deeper -into the libpng code. The library now has mechanisms for storing +into the libmodpng14 code. The library now has mechanisms for storing and writing chunks of unknown type; you can even declare callbacks for custom chunks. Hoewver, this may not be good enough if the library code itself needs to know about interactions between your @@ -3204,11 +3204,11 @@ understanding of how it works. Pay particular attention to the sections that describe chunk names, and look at how other chunks were designed, so you can do things similarly. Second, check out the -sections of libpng that read and write chunks. Try to find a chunk +sections of libmodpng14 that read and write chunks. Try to find a chunk that is similar to yours and use it as a template. More details can be found in the comments inside the code. It is best to handle unknown chunks in a generic method, via callback functions, instead of by -modifying libpng functions. +modifying libmodpng14 functions. If you wish to write your own transformation for the data, look through the part of the code that does the transformations, and check out some of @@ -3218,43 +3218,43 @@ .SS Configuring for 16 bit platforms -You will want to look into zconf.h to tell zlib (and thus libpng) that +You will want to look into zconf.h to tell zlib (and thus libmodpng14) that it cannot allocate more then 64K at a time. Even if you can, the memory -won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K. +won't be accessible. So limit zlib and libmodpng14 to 64K by defining MAXSEG_64K. .SS Configuring for DOS For DOS users who only have access to the lower 640K, you will -have to limit zlib's memory usage via a png_set_compression_mem_level() +have to limit zlib's memory usage via a modpng14_set_compression_mem_level() call. See zlib.h or zconf.h in the zlib library for more information. .SS Configuring for Medium Model Libpng's support for medium model has been tested on most of the popular compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets -defined, and FAR gets defined to far in pngconf.h, and you should be +defined, and FAR gets defined to far in modpng14conf.h, and you should be all set. Everything in the library (except for zlib's structure) is expecting far data. You must use the typedefs with the p or pp on the end for pointers (or at least look at them and be careful). Make -note that the rows of data are defined as png_bytepp, which is an +note that the rows of data are defined as modpng14_bytepp, which is an unsigned char far * far *. .SS Configuring for gui/windowing platforms: You will need to write new error and warning functions that use the GUI interface, as described previously, and set them to be the error and -warning functions at the time that png_create_*_struct() is called, +warning functions at the time that modpng14_create_*_struct() is called, in order to have them available during the structure initialization. -They can be changed later via png_set_error_fn(). On some compilers, -you may also have to change the memory allocators (png_malloc, etc.). +They can be changed later via modpng14_set_error_fn(). On some compilers, +you may also have to change the memory allocators (modpng14_malloc, etc.). .SS Configuring for compiler xxx: -All includes for libpng are in pngconf.h. If you need to add/change/delete +All includes for libmodpng14 are in modpng14conf.h. If you need to add/change/delete an include, this is the place to do it. The includes that are not -needed outside libpng are protected by the PNG_INTERNAL definition, -which is only defined for those routines inside libpng itself. The -files in libpng proper only include png.h, which includes pngconf.h. +needed outside libmodpng14 are protected by the MODPNG14_INTERNAL definition, +which is only defined for those routines inside libmodpng14 itself. The +files in libmodpng14 proper only include modpng14.h, which includes modpng14conf.h. .SS Configuring zlib: @@ -3270,7 +3270,7 @@ files larger than just storing the raw bitmap. You can specify the compression level by calling: - png_set_compression_level(png_ptr, level); + modpng14_set_compression_level(modpng14_ptr, level); Another useful one is to reduce the memory level used by the library. The memory level defaults to 8, but it can be lowered if you are @@ -3280,22 +3280,22 @@ data being emitted in smaller stored blocks, with a correspondingly larger relative overhead of up to 15% in the worst case. - png_set_compression_mem_level(png_ptr, level); + modpng14_set_compression_mem_level(modpng14_ptr, level); The other functions are for configuring zlib. They are not recommended for normal use and may result in writing an invalid PNG file. See zlib.h for more information on what these mean. - png_set_compression_strategy(png_ptr, + modpng14_set_compression_strategy(modpng14_ptr, strategy); - png_set_compression_window_bits(png_ptr, + modpng14_set_compression_window_bits(modpng14_ptr, window_bits); - png_set_compression_method(png_ptr, method); - png_set_compression_buffer_size(png_ptr, size); + modpng14_set_compression_method(modpng14_ptr, method); + modpng14_set_compression_buffer_size(modpng14_ptr, size); .SS Controlling row filtering -If you want to control whether libpng uses filtering or not, which +If you want to control whether libmodpng14 uses filtering or not, which filters are used, and how it goes about picking row filters, you can call one of these functions. The selection and configuration of row filters can have a significant impact on the size and @@ -3307,48 +3307,48 @@ The 'method' parameter sets the main filtering method, which is currently only '0' in the PNG 1.2 specification. The 'filters' parameter sets which filter(s), if any, should be used for each -scanline. Possible values are PNG_ALL_FILTERS and PNG_NO_FILTERS +scanline. Possible values are MODPNG14_ALL_FILTERS and MODPNG14_NO_FILTERS to turn filtering on and off, respectively. -Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB, -PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise +Individual filter types are MODPNG14_FILTER_NONE, MODPNG14_FILTER_SUB, +MODPNG14_FILTER_UP, MODPNG14_FILTER_AVG, MODPNG14_FILTER_PAETH, which can be bitwise ORed together with '|' to specify one or more filters to use. These filters are described in more detail in the PNG specification. If you intend to change the filter type during the course of writing the image, you should start with flags set for all of the filters -you intend to use so that libpng can initialize its internal +you intend to use so that libmodpng14 can initialize its internal structures appropriately for all of the filter types. (Note that this -means the first row must always be adaptively filtered, because libpng -currently does not allocate the filter buffers until png_write_row() +means the first row must always be adaptively filtered, because libmodpng14 +currently does not allocate the filter buffers until modpng14_write_row() is called for the first time.) - filters = PNG_FILTER_NONE | PNG_FILTER_SUB - PNG_FILTER_UP | PNG_FILTER_AVE | - PNG_FILTER_PAETH | PNG_ALL_FILTERS; + filters = MODPNG14_FILTER_NONE | MODPNG14_FILTER_SUB + MODPNG14_FILTER_UP | MODPNG14_FILTER_AVE | + MODPNG14_FILTER_PAETH | MODPNG14_ALL_FILTERS; - png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, + modpng14_set_filter(modpng14_ptr, MODPNG14_FILTER_TYPE_BASE, filters); The second parameter can also be - PNG_INTRAPIXEL_DIFFERENCING if you are + MODPNG14_INTRAPIXEL_DIFFERENCING if you are writing a PNG to be embedded in a MNG datastream. This parameter must be the same as the value of filter_method used - in png_set_IHDR(). + in modpng14_set_IHDR(). -It is also possible to influence how libpng chooses from among the +It is also possible to influence how libmodpng14 chooses from among the available filters. This is done in one or both of two ways - by telling it how important it is to keep the same filter for successive rows, and by telling it the relative computational costs of the filters. double weights[3] = {1.5, 1.3, 1.1}, - costs[PNG_FILTER_VALUE_LAST] = + costs[MODPNG14_FILTER_VALUE_LAST] = {1.0, 1.3, 1.3, 1.5, 1.7}; - png_set_filter_heuristics(png_ptr, - PNG_FILTER_HEURISTIC_WEIGHTED, 3, + modpng14_set_filter_heuristics(modpng14_ptr, + MODPNG14_FILTER_HEURISTIC_WEIGHTED, 3, weights, costs); -The weights are multiplying factors that indicate to libpng that the +The weights are multiplying factors that indicate to libmodpng14 that the row filter should be the same for successive rows unless another row filter is that many times better than the previous filter. In the above example, if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a @@ -3372,25 +3372,25 @@ .SS Removing unwanted object code -There are a bunch of #define's in pngconf.h that control what parts of -libpng are compiled. All the defines end in _SUPPORTED. If you are +There are a bunch of #define's in modpng14conf.h that control what parts of +libmodpng14 are compiled. All the defines end in _SUPPORTED. If you are never going to use a capability, you can change the #define to #undef -before recompiling libpng and save yourself code and data space, or +before recompiling libmodpng14 and save yourself code and data space, or you can turn off individual capabilities with defines that begin with -PNG_NO_. +MODPNG14_NO_. You can also turn all of the transforms and ancillary chunk capabilities off en masse with compiler directives that define -PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS, +MODPNG14_NO_READ[or WRITE]_TRANSFORMS, or MODPNG14_NO_READ[or WRITE]_ANCILLARY_CHUNKS, or all four, along with directives to turn on any of the capabilities that you do -want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable +want. The MODPNG14_NO_READ[or WRITE]_TRANSFORMS directives disable the extra transformations but still leave the library fully capable of reading and writing PNG files with all known public chunks -Use of the PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive +Use of the MODPNG14_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library that is incapable of reading or writing ancillary chunks. If you are not using the progressive reading capability, you can -turn that off with PNG_NO_PROGRESSIVE_READ (don't confuse +turn that off with MODPNG14_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING capability, which you'll still have). All the reading and writing specific code are in separate files, so the @@ -3410,44 +3410,44 @@ .SS Requesting debug printout -The macro definition PNG_DEBUG can be used to request debugging +The macro definition MODPNG14_DEBUG can be used to request debugging printout. Set it to an integer value in the range 0 to 3. Higher numbers result in increasing amounts of debugging information. The information is printed to the "stderr" file, unless another file -name is specified in the PNG_DEBUG_FILE macro definition. +name is specified in the MODPNG14_DEBUG_FILE macro definition. -When PNG_DEBUG > 0, the following functions (macros) become available: +When MODPNG14_DEBUG > 0, the following functions (macros) become available: - png_debug(level, message) - png_debug1(level, message, p1) - png_debug2(level, message, p1, p2) + modpng14_debug(level, message) + modpng14_debug1(level, message, p1) + modpng14_debug2(level, message, p1, p2) -in which "level" is compared to PNG_DEBUG to decide whether to print +in which "level" is compared to MODPNG14_DEBUG to decide whether to print the message, "message" is the formatted string to be printed, and p1 and p2 are parameters that are to be embedded in the string according to printf-style formatting directives. For example, - png_debug1(2, "foo=%d\n", foo); + modpng14_debug1(2, "foo=%d\n", foo); is expanded to - if(PNG_DEBUG > 2) - fprintf(PNG_DEBUG_FILE, "foo=%d\n", foo); + if(MODPNG14_DEBUG > 2) + fprintf(MODPNG14_DEBUG_FILE, "foo=%d\n", foo); -When PNG_DEBUG is defined but is zero, the macros aren't defined, but you -can still use PNG_DEBUG to control your own debugging: +When MODPNG14_DEBUG is defined but is zero, the macros aren't defined, but you +can still use MODPNG14_DEBUG to control your own debugging: - #ifdef PNG_DEBUG + #ifdef MODPNG14_DEBUG fprintf(stderr, ... #endif -When PNG_DEBUG = 1, the macros are defined, but only png_debug statements +When MODPNG14_DEBUG = 1, the macros are defined, but only modpng14_debug statements having level = 0 will be printed. There aren't any such statements in -this version of libpng, but if you insert some they will be printed. +this version of libmodpng14, but if you insert some they will be printed. .SH VI. Runtime optimization -A new feature in libpng 1.2.0 is the ability to dynamically switch between +A new feature in libmodpng14 1.2.0 is the ability to dynamically switch between standard and optimized versions of some routines. Currently these are limited to three computationally intensive tasks when reading PNG files: decoding row filters, expanding interlacing, and combining interlaced or @@ -3455,45 +3455,45 @@ versions are available only for x86 (Intel, AMD, etc.) platforms with MMX support, though this may change in future versions. (For example, the non-MMX assembler optimizations for zlib might become similarly -runtime-selectable in future releases, in which case libpng could be +runtime-selectable in future releases, in which case libmodpng14 could be extended to support them. Alternatively, the compile-time choice of floating-point versus integer routines for gamma correction might become runtime-selectable.) Because such optimizations tend to be very platform- and compiler-dependent, both in how they are written and in how they perform, the new runtime code -in libpng has been written to allow programs to query, enable, and disable +in libmodpng14 has been written to allow programs to query, enable, and disable either specific optimizations or all such optimizations. For example, to enable all possible optimizations (bearing in mind that some "optimizations" may actually run more slowly in rare cases): - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - png_uint_32 mask, flags; + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + modpng14_uint_32 mask, flags; - flags = png_get_asm_flags(png_ptr); - mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE); - png_set_asm_flags(png_ptr, flags | mask); + flags = modpng14_get_asm_flags(modpng14_ptr); + mask = modpng14_get_asm_flagmask(MODPNG14_SELECT_READ | MODPNG14_SELECT_WRITE); + modpng14_set_asm_flags(modpng14_ptr, flags | mask); #endif -To enable only optimizations relevant to reading PNGs, use PNG_SELECT_READ -by itself when calling png_get_asm_flagmask(); similarly for optimizing +To enable only optimizations relevant to reading PNGs, use MODPNG14_SELECT_READ +by itself when calling modpng14_get_asm_flagmask(); similarly for optimizing only writing. To disable all optimizations: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - flags = png_get_asm_flags(png_ptr); - mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE); - png_set_asm_flags(png_ptr, flags & ~mask); + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + flags = modpng14_get_asm_flags(modpng14_ptr); + mask = modpng14_get_asm_flagmask(MODPNG14_SELECT_READ | MODPNG14_SELECT_WRITE); + modpng14_set_asm_flags(modpng14_ptr, flags & ~mask); #endif -To enable or disable only MMX-related features, use png_get_mmx_flagmask() -in place of png_get_asm_flagmask(). The mmx version takes one additional +To enable or disable only MMX-related features, use modpng14_get_mmx_flagmask() +in place of modpng14_get_asm_flagmask(). The mmx version takes one additional parameter: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - int selection = PNG_SELECT_READ | PNG_SELECT_WRITE; + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + int selection = MODPNG14_SELECT_READ | MODPNG14_SELECT_WRITE; int compilerID; - mask = png_get_mmx_flagmask(selection, &compilerID); + mask = modpng14_get_mmx_flagmask(selection, &compilerID); #endif On return, compilerID will indicate which version of the MMX assembler @@ -3502,85 +3502,85 @@ On non-x86 platforms or on systems compiled without MMX optimizations, a value of -1 is used. -Note that both png_get_asm_flagmask() and png_get_mmx_flagmask() return +Note that both modpng14_get_asm_flagmask() and modpng14_get_mmx_flagmask() return all valid, settable optimization bits for the version of the library that's currently in use. In the case of shared (dynamically linked) libraries, this may include optimizations that did not exist at the time the code was written and compiled. It is also possible, of course, to enable only known, specific optimizations; for example: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - 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 ; - png_set_asm_flags(png_ptr, flags); + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + flags = MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | MODPNG14_ASM_FLAG_MMX_READ_INTERLACE \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH ; + modpng14_set_asm_flags(modpng14_ptr, flags); #endif This method would enable only the MMX read-optimizations available at the -time of libpng 1.2.0's release, regardless of whether a later version of +time of libmodpng14 1.2.0's release, regardless of whether a later version of the DLL were actually being used. (Also note that these functions did not exist in versions older than 1.2.0, so any attempt to run a dynamically linked app on such an older version would fail.) To determine whether the processor supports MMX instructions at all, use -the png_mmx_support() function: +the modpng14_mmx_support() function: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - mmxsupport = png_mmx_support(); + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + mmxsupport = modpng14_mmx_support(); #endif -It returns -1 if MMX support is not compiled into libpng, 0 if MMX code +It returns -1 if MMX support is not compiled into libmodpng14, 0 if MMX code is compiled but MMX is not supported by the processor, or 1 if MMX support -is fully available. Note that png_mmx_support(), png_get_mmx_flagmask(), -and png_get_asm_flagmask() all may be called without allocating and ini- +is fully available. Note that modpng14_mmx_support(), modpng14_get_mmx_flagmask(), +and modpng14_get_asm_flagmask() all may be called without allocating and ini- tializing any PNG structures (for example, as part of a usage screen or "about" box). The following code can be used to prevent an application from using the -thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK +thread_unsafe features, even if libmodpng14 was built with MODPNG14_THREAD_UNSAFE_OK defined: -#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \ - && defined(PNG_THREAD_UNSAFE_OK) +#if defined(MODPNG14_USE_PNGGCCRD) && defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) \ + && defined(MODPNG14_THREAD_UNSAFE_OK) /* Disable thread-unsafe features of pnggccrd */ - if (png_access_version() >= 10200) + if (modpng14_access_version() >= 10200) { - png_uint_32 mmx_disable_mask = 0; - png_uint_32 asm_flags; + modpng14_uint_32 mmx_disable_mask = 0; + modpng14_uint_32 asm_flags; - mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ - | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ - | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ - | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ); - asm_flags = png_get_asm_flags(png_ptr); - png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask); + mmx_disable_mask |= ( MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH ); + asm_flags = modpng14_get_asm_flags(modpng14_ptr); + modpng14_set_asm_flags(modpng14_ptr, asm_flags & ~mmx_disable_mask); } #endif For more extensive examples of runtime querying, enabling and disabling -of optimized features, see contrib/gregbook/readpng2.c in the libpng +of optimized features, see contrib/gregbook/readpng2.c in the libmodpng14 source-code distribution. .SH VII. MNG support -The MNG specification (available at http://www.libpng.org/pub/mng) allows +The MNG specification (available at http://www.libmodpng14.org/pub/mng) allows certain extensions to PNG for PNG images that are embedded in MNG datastreams. Libpng can support some of these extensions. To enable them, use the -png_permit_mng_features() function: +modpng14_permit_mng_features() function: - feature_set = png_permit_mng_features(png_ptr, mask) - mask is a png_uint_32 containing the logical OR of the + feature_set = modpng14_permit_mng_features(modpng14_ptr, mask) + mask is a modpng14_uint_32 containing the logical OR of the features you want to enable. These include - PNG_FLAG_MNG_EMPTY_PLTE - PNG_FLAG_MNG_FILTER_64 - PNG_ALL_MNG_FEATURES - feature_set is a png_32_uint that is the logical AND of + MODPNG14_FLAG_MNG_EMPTY_PLTE + MODPNG14_FLAG_MNG_FILTER_64 + MODPNG14_ALL_MNG_FEATURES + feature_set is a modpng14_32_uint that is the logical AND of your mask with the set of MNG features that is - supported by the version of libpng that you are using. + supported by the version of libmodpng14 that you are using. It is an error to use this function when reading or writing a standalone PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped @@ -3592,61 +3592,61 @@ .SH VIII. Changes to Libpng from version 0.88 -It should be noted that versions of libpng later than 0.96 are not -distributed by the original libpng author, Guy Schalnat, nor by +It should be noted that versions of libmodpng14 later than 0.96 are not +distributed by the original libmodpng14 author, Guy Schalnat, nor by Andreas Dilger, who had taken over from Guy during 1996 and 1997, and distributed versions 0.89 through 0.96, but rather by another member of the original PNG Group, Glenn Randers-Pehrson. Guy and Andreas are still alive and well, but they have moved on to other things. -The old libpng functions png_read_init(), png_write_init(), -png_info_init(), png_read_destroy(), and png_write_destroy() have been -moved to PNG_INTERNAL in version 0.95 to discourage their use. These -functions will be removed from libpng version 2.0.0. - -The preferred method of creating and initializing the libpng structures is -via the png_create_read_struct(), png_create_write_struct(), and -png_create_info_struct() because they isolate the size of the structures +The old libmodpng14 functions modpng14_read_init(), modpng14_write_init(), +modpng14_info_init(), modpng14_read_destroy(), and modpng14_write_destroy() have been +moved to MODPNG14_INTERNAL in version 0.95 to discourage their use. These +functions will be removed from libmodpng14 version 2.0.0. + +The preferred method of creating and initializing the libmodpng14 structures is +via the modpng14_create_read_struct(), modpng14_create_write_struct(), and +modpng14_create_info_struct() because they isolate the size of the structures from the application, allow version error checking, and also allow the use of custom error handling routines during the initialization, which -the old functions do not. The functions png_read_destroy() and -png_write_destroy() do not actually free the memory that libpng +the old functions do not. The functions modpng14_read_destroy() and +modpng14_write_destroy() do not actually free the memory that libmodpng14 allocated for these structs, but just reset the data structures, so they -can be used instead of png_destroy_read_struct() and -png_destroy_write_struct() if you feel there is too much system overhead -allocating and freeing the png_struct for each image read. +can be used instead of modpng14_destroy_read_struct() and +modpng14_destroy_write_struct() if you feel there is too much system overhead +allocating and freeing the modpng14_struct for each image read. -Setting the error callbacks via png_set_message_fn() before -png_read_init() as was suggested in libpng-0.88 is no longer supported +Setting the error callbacks via modpng14_set_message_fn() before +modpng14_read_init() as was suggested in libmodpng14-0.88 is no longer supported because this caused applications that do not use custom error functions -to fail if the png_ptr was not initialized to zero. It is still possible -to set the error callbacks AFTER png_read_init(), or to change them with -png_set_error_fn(), which is essentially the same function, but with a new +to fail if the modpng14_ptr was not initialized to zero. It is still possible +to set the error callbacks AFTER modpng14_read_init(), or to change them with +modpng14_set_error_fn(), which is essentially the same function, but with a new name to force compilation errors with applications that try to use the old method. Starting with version 1.0.7, you can find out which version of the library you are using at run-time: - png_uint_32 libpng_vn = png_access_version_number(); + modpng14_uint_32 libmodpng14_vn = modpng14_access_version_number(); -The number libpng_vn is constructed from the major version, minor +The number libmodpng14_vn is constructed from the major version, minor version with leading zero, and release number with leading zero, -(e.g., libpng_vn for version 1.0.7 is 10007). +(e.g., libmodpng14_vn for version 1.0.7 is 10007). -You can also check which version of png.h you used when compiling your +You can also check which version of modpng14.h you used when compiling your application: - png_uint_32 application_vn = PNG_LIBPNG_VER; + modpng14_uint_32 application_vn = MODPNG14_LIBMODPNG14_VER; -.SH IX. Y2K Compliance in libpng +.SH IX. Y2K Compliance in libmodpng14 October 3, 2002 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. -This is your unofficial assurance that libpng from version 0.71 and +This is your unofficial assurance that libmodpng14 from version 0.71 and upward through 1.2.5 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. @@ -3655,49 +3655,49 @@ format, and will hold years up to 9999. The integer is - "png_uint_16 year" in png_time_struct. + "modpng14_uint_16 year" in modpng14_time_struct. The strings are - "png_charp time_buffer" in png_struct and + "modpng14_charp time_buffer" in modpng14_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 + modpng14_convert_to_rfc_1123() in png.c + (formerly modpng14_convert_to_rfc_1152() in error) + modpng14_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 + modpng14_convert_from_time_t() in pngwrite.c + modpng14_get_tIME() in pngget.c + modpng14_handle_tIME() in pngrutil.c, called in pngread.c + modpng14_set_tIME() in pngset.c + modpng14_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 +modpng14_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() +libmodpng14 are not passing 4-digit years into the modpng14_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 +instead of "year - 1900" into the modpng14_convert_from_struct_tm() function, +but this is not under our control. The libmodpng14 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 +zlib, upon which libmodpng14 depends, is also Y2K compliant. It contains no date-related code. Glenn Randers-Pehrson - libpng maintainer + libmodpng14 maintainer PNG Development Group .SH NOTE -Note about libpng version numbers: +Note about libmodpng14 version numbers: Due to various miscommunications, unforeseen code incompatibilities and occasional factors outside the authors' control, version numbering @@ -3705,7 +3705,7 @@ The following table summarizes matters since version 0.89c, which was the first widely used release: - source png.h png.h shared-lib + source modpng14.h modpng14.h shared-lib version string int version ------- ------ ----- ---------- 0.89c ("beta 3") 0.89 89 1.0.89 @@ -3720,7 +3720,7 @@ 1.00 1.00 100 2.1.0 1.0.0 1.0.0 100 2.1.0 1.0.0 (from here on, the 100 2.1.0 - 1.0.1 png.h string is 10001 2.1.0 + 1.0.1 modpng14.h string is 10001 2.1.0 1.0.1a-e identical to the 10002 from here on, the 1.0.2 source version) 10002 shared library is 2.V 1.0.2a-b 10003 where V is the source @@ -3790,7 +3790,7 @@ Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be used for changes in backward compatibility, as it is intended. The -PNG_PNGLIB_VER macro, which is not used within libpng but is available +MODPNG14_PNGLIB_VER macro, which is not used within libmodpng14 but is available for applications, is an unsigned integer of the form xyyzz corresponding to the source version x.y.z (leading zeros in y and z). Beta versions were given the previous public release number plus a letter, until @@ -3798,18 +3798,18 @@ release number plus "betaNN" or "rcN". .SH "SEE ALSO" -libpngpf(3), png(5) +libmodpng14pf(3), png(5) .LP -.IR libpng : +.IR libmodpng14 : .IP ftp://ftp.uu.net/graphics/png -http://www.libpng.org/pub/png +http://www.libmodpng14.org/pub/png .LP .IR zlib : .IP (generally) at the same location as -.I libpng +.I libmodpng14 or at .br ftp://ftp.uu.net/pub/archiving/zip/zlib @@ -3820,14 +3820,14 @@ .IR PNG specification: RFC 2083 .IP (generally) at the same location as -.I libpng +.I libmodpng14 or at .br ftp://ds.internic.net/rfc/rfc2083.txt .br or (as a W3C Recommendation) at .br -http://www.w3.org/TR/REC-png.html +http://www.w3.org/TR/REC-modpng14.html .LP In the case of any inconsistency between the PNG specification @@ -3853,16 +3853,16 @@ .SH COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: -(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.) +(This copy of the libmodpng14 notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file modpng14.h that is +included in the libmodpng14 distribution, the latter shall prevail.) -If you modify libpng you may insert additional notices immediately following +If you modify libmodpng14 you may insert additional notices immediately following this sentence. -libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are +libmodpng14 versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.0.6 +distributed according to the same disclaimer and license as libmodpng14-1.0.6 with the following individuals added to the list of Contributing Authors Simon-Pierre Cadieux @@ -3879,18 +3879,18 @@ 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 +libmodpng14 versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998, 1999 Glenn Randers-Pehrson -Distributed according to the same disclaimer and license as libpng-0.96, +Distributed according to the same disclaimer and license as libmodpng14-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 +libmodpng14 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, +Distributed according to the same disclaimer and license as libmodpng14-0.88, with the following individuals added to the list of Contributing Authors: John Bowler @@ -3900,7 +3900,7 @@ Greg Roelofs Tom Tanner -libpng versions 0.5, May 1995, through 0.88, January 1996, are +libmodpng14 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" @@ -3939,10 +3939,10 @@ appreciated. -A "png_get_copyright" function is available, for convenient use in "about" +A "modpng14_get_copyright" function is available, for convenient use in "about" boxes and the like: - printf("%s",png_get_copyright(NULL)); + printf("%s",modpng14_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). --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/libpng.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/libpng.txt @@ -1,54 +1,54 @@ -libpng.txt - A description on how to use and modify libpng +libmodpng14.txt - A description on how to use and modify libmodpng14 - libpng version 1.2.5 - October 3, 2002 + libmodpng14 version 1.2.5 - October 3, 2002 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2002 Glenn Randers-Pehrson For conditions of distribution and use, see copyright - notice in png.h. + notice in modpng14.h. based on: - libpng 1.0 beta 6 version 0.96 May 28, 1997 + libmodpng14 1.0 beta 6 version 0.96 May 28, 1997 Updated and distributed by Andreas Dilger Copyright (c) 1996, 1997 Andreas Dilger - libpng 1.0 beta 2 - version 0.88 January 26, 1996 + libmodpng14 1.0 beta 2 - version 0.88 January 26, 1996 For conditions of distribution and use, see copyright - notice in png.h. Copyright (c) 1995, 1996 Guy Eric + notice in modpng14.h. Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. - Updated/rewritten per request in the libpng FAQ + Updated/rewritten per request in the libmodpng14 FAQ Copyright (c) 1995, 1996 Frank J. T. Wojcik December 18, 1995 & January 20, 1996 I. Introduction This file describes how to use and modify the PNG reference library -(known as libpng) for your own use. There are five sections to this +(known as libmodpng14) for your own use. There are five sections to this file: introduction, structures, reading, writing, and modification and configuration notes for various special platforms. In addition to this file, example.c is a good starting point for using the library, as it is heavily commented and should include everything most people -will need. We assume that libpng is already installed; see the -INSTALL file for instructions on how to install libpng. +will need. We assume that libmodpng14 is already installed; see the +INSTALL file for instructions on how to install libmodpng14. Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -The PNG-1.2 specification is available at +The PNG-1.2 specification is available at and at . The PNG-1.0 specification is available as RFC 2083 and as a -W3C Recommendation . Some +W3C Recommendation . Some additional chunks are described in the special-purpose public chunks documents at . Other information -about PNG, and the latest version of libpng, can be found at the PNG home -page, +about PNG, and the latest version of libmodpng14, can be found at the PNG home +page, and at . Most users will not have to modify the library significantly; advanced @@ -57,92 +57,92 @@ Currently, this library only supports C. Support for other languages is being considered. -Libpng has been designed to handle multiple sessions at one time, +Libmodpng14.has been designed to handle multiple sessions at one time, to be easily modifiable, to be portable to the vast majority of machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy -to use. The ultimate goal of libpng is to promote the acceptance of +to use. The ultimate goal of libmodpng14 is to promote the acceptance of the PNG file format in whatever way possible. While there is still -work to be done (see the TODO file), libpng should cover the +work to be done (see the TODO file), libmodpng14 should cover the majority of the needs of its users. Libpng uses zlib for its compression and decompression of PNG files. Further information about zlib, and the latest version of zlib, can be found at the zlib home page, . The zlib compression utility is a general purpose utility that is -useful for more than PNG files, and can be used without libpng. +useful for more than PNG files, and can be used without libmodpng14. See the documentation delivered with zlib for more details. You can usually find the source files for the zlib utility wherever you -find the libpng source files. +find the libmodpng14 source files. Libpng is thread safe, provided the threads are using different instances of the structures. Each thread should have its own -png_struct and png_info instances, and thus its own image. +modpng14_struct and modpng14_info instances, and thus its own image. Libpng does not protect itself against two threads using the same instance of a structure. Note: thread safety may be defeated by use of some of the MMX assembler code in pnggccrd.c, which is only -compiled when the user defines PNG_THREAD_UNSAFE_OK. +compiled when the user defines MODPNG14_THREAD_UNSAFE_OK. II. Structures -There are two main structures that are important to libpng, png_struct -and png_info. The first, png_struct, is an internal structure that +There are two main structures that are important to libmodpng14, modpng14_struct +and modpng14_info. The first, modpng14_struct, is an internal structure that will not, for the most part, be used by a user except as the first -variable passed to every libpng function call. +variable passed to every libmodpng14 function call. -The png_info structure is designed to provide information about the -PNG file. At one time, the fields of png_info were intended to be +The modpng14_info structure is designed to provide information about the +PNG file. At one time, the fields of modpng14_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result -a set of interface functions for png_info (the png_get_*() and png_set_*() -functions) was developed. The fields of png_info are still available for +a set of interface functions for modpng14_info (the modpng14_get_*() and modpng14_set_*() +functions) was developed. The fields of modpng14_info are still available for older applications, but it is suggested that applications use the new interfaces if at all possible. -Applications that do make direct access to the members of png_struct (except -for png_ptr->jmpbuf) must be recompiled whenever the library is updated, -and applications that make direct access to the members of png_info must -be recompiled if they were compiled or loaded with libpng version 1.0.6, +Applications that do make direct access to the members of modpng14_struct (except +for modpng14_ptr->jmpbuf) must be recompiled whenever the library is updated, +and applications that make direct access to the members of modpng14_info must +be recompiled if they were compiled or loaded with libmodpng14 version 1.0.6, in which the members were in a different order. In version 1.0.7, the -members of the png_info structure reverted to the old order, as they were +members of the modpng14_info structure reverted to the old order, as they were in versions 0.97c through 1.0.5. Starting with version 2.0.0, both structures are going to be hidden, and the contents of the structures will -only be accessible through the png_get/png_set functions. +only be accessible through the modpng14_get/modpng14_set functions. -The png.h header file is an invaluable reference for programming with libpng. -And while I'm on the topic, make sure you include the libpng header file: +The modpng14.h header file is an invaluable reference for programming with libmodpng14. +And while I'm on the topic, make sure you include the libmodpng14 header file: -#include +#include III. Reading We'll now walk you through the possible functions to call when reading in a PNG file sequentially, briefly explaining the syntax and purpose -of each one. See example.c and png.h for more detail. While +of each one. See example.c and modpng14.h for more detail. While progressive reading is covered in the next section, you will still need some of the functions discussed in this section to read a PNG file. Setup -You will want to do the I/O initialization(*) before you get into libpng, +You will want to do the I/O initialization(*) before you get into libmodpng14, so if it doesn't work, you don't have much to undo. Of course, you will also want to insure that you are, in fact, dealing with a PNG file. Libpng provides a simple check to see if a file is a PNG file. To use it, pass in the first 1 to 8 bytes of the file to the function -png_sig_cmp(), and it will return 0 if the bytes match the corresponding +modpng14_sig_cmp(), and it will return 0 if the bytes match the corresponding bytes of the PNG signature, or nonzero otherwise. Of course, the more bytes you pass in, the greater the accuracy of the prediction. -If you are intending to keep the file pointer open for use in libpng, +If you are intending to keep the file pointer open for use in libmodpng14, you must ensure you don't read more than 8 bytes from the beginning -of the file, and you also have to make a call to png_set_sig_bytes_read() +of the file, and you also have to make a call to modpng14_set_sig_bytes_read() with the number of bytes you read from the beginning. Libpng will then only check the bytes (if any) that your program didn't read. (*): If you are not using the standard I/O functions, you will need to replace them with custom functions. See the discussion under -Customizing libpng. +Customizing libmodpng14. FILE *fp = fopen(file_name, "rb"); @@ -151,16 +151,16 @@ return (ERROR); } fread(header, 1, number, fp); - is_png = !png_sig_cmp(header, 0, number); + is_png = !modpng14_sig_cmp(header, 0, number); if (!is_png) { return (NOT_PNG); } -Next, png_struct and png_info need to be allocated and initialized. In +Next, modpng14_struct and modpng14_info need to be allocated and initialized. In order to ensure that the size of these structures is correct even with a -dynamically linked libpng, there are functions to initialize and +dynamically linked libmodpng14, there are functions to initialize and allocate the structures. We also pass the library version, optional pointers to error handling functions, and a pointer to a data struct for use by the error functions, if necessary (the pointer and functions can @@ -169,97 +169,97 @@ The structure allocation functions quietly return NULL if they fail to create the structure, so your application should check for that. - png_structp png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + modpng14_structp modpng14_ptr = modpng14_create_read_struct + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if (!png_ptr) + if (!modpng14_ptr) return (ERROR); - png_infop info_ptr = png_create_info_struct(png_ptr); + modpng14_infop info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_read_struct(&png_ptr, - (png_infopp)NULL, (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, + (modpng14_infopp)NULL, (modpng14_infopp)NULL); return (ERROR); } - png_infop end_info = png_create_info_struct(png_ptr); + modpng14_infop end_info = modpng14_create_info_struct(modpng14_ptr); if (!end_info) { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, + (modpng14_infopp)NULL); return (ERROR); } If you want to use your own memory allocation routines, -define PNG_USER_MEM_SUPPORTED and use -png_create_read_struct_2() instead of png_create_read_struct(): +define MODPNG14_USER_MEM_SUPPORTED and use +modpng14_create_read_struct_2() instead of modpng14_create_read_struct(): - png_structp png_ptr = png_create_read_struct_2 - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn, (png_voidp) + modpng14_structp modpng14_ptr = modpng14_create_read_struct_2 + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (modpng14_voidp) user_mem_ptr, user_malloc_fn, user_free_fn); -The error handling routines passed to png_create_read_struct() -and the memory alloc/free routines passed to png_create_struct_2() -are only necessary if you are not using the libpng supplied error +The error handling routines passed to modpng14_create_read_struct() +and the memory alloc/free routines passed to modpng14_create_struct_2() +are only necessary if you are not using the libmodpng14 supplied error handling and memory alloc/free functions. -When libpng encounters an error, it expects to longjmp back +When libmodpng14 encounters an error, it expects to longjmp back to your routine. Therefore, you will need to call setjmp and pass -your png_jmpbuf(png_ptr). If you read the file from different +your modpng14_jmpbuf(modpng14_ptr). If you read the file from different routines, you will need to update the jmpbuf field every time you enter -a new routine that will call a png_*() function. +a new routine that will call a modpng14_*() function. See your documentation of setjmp/longjmp for your compiler for more -information on setjmp/longjmp. See the discussion on libpng error +information on setjmp/longjmp. See the discussion on libmodpng14 error handling in the Customizing Libpng section below for more information -on the libpng error handling. If an error occurs, and libpng longjmp's -back to your setjmp, you will want to call png_destroy_read_struct() to +on the libmodpng14 error handling. If an error occurs, and libmodpng14 longjmp's +back to your setjmp, you will want to call modpng14_destroy_read_struct() to free any memory. - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); fclose(fp); return (ERROR); } If you would rather avoid the complexity of setjmp/longjmp issues, -you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case -errors will result in a call to PNG_ABORT() which defaults to abort(). +you can compile libmodpng14 with MODPNG14_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to MODPNG14_ABORT() which defaults to abort(). -Now you need to set up the input code. The default for libpng is to +Now you need to set up the input code. The default for libmodpng14 is to use the C function fread(). If you use this, you will need to pass a -valid FILE * in the function png_init_io(). Be sure that the file is +valid FILE * in the function modpng14_init_io(). Be sure that the file is opened in binary mode. If you wish to handle reading data in another -way, you need not call the png_init_io() function, but you must then -implement the libpng I/O methods discussed in the Customizing Libpng +way, you need not call the modpng14_init_io() function, but you must then +implement the libmodpng14 I/O methods discussed in the Customizing Libpng section below. - png_init_io(png_ptr, fp); + modpng14_init_io(modpng14_ptr, fp); If you had previously opened the file and read any of the signature from the beginning in order to see if this was a PNG file, you need to let -libpng know that there are some bytes missing from the start of the file. +libmodpng14 know that there are some bytes missing from the start of the file. - png_set_sig_bytes(png_ptr, number); + modpng14_set_sig_bytes(modpng14_ptr, number); Setting up callback code You can set up a callback function to handle any unknown chunks in the input stream. You must supply the function - read_chunk_callback(png_ptr ptr, - png_unknown_chunkp chunk); + read_chunk_callback(modpng14_ptr ptr, + modpng14_unknown_chunkp chunk); { /* The unknown chunk structure contains your chunk data: */ - png_byte name[5]; - png_byte *data; - png_size_t size; - /* Note that libpng has already taken care of + modpng14_byte name[5]; + modpng14_byte *data; + modpng14_size_t size; + /* Note that libmodpng14 has already taken care of the CRC handling */ /* put your code here. Return one of the @@ -273,22 +273,22 @@ (You can give your function another name that you like instead of "read_chunk_callback") -To inform libpng about your function, use +To inform libmodpng14 about your function, use - png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr, + modpng14_set_read_user_chunk_fn(modpng14_ptr, user_chunk_ptr, read_chunk_callback); This names not only the callback function, but also a user pointer that you can retrieve with - png_get_user_chunk_ptr(png_ptr); + modpng14_get_user_chunk_ptr(modpng14_ptr); At this point, you can set up a callback function that will be called after each row has been read, which you can use to control a progress meter or the like. It's demonstrated in pngtest.c. You must supply a function - void read_row_callback(png_ptr ptr, png_uint_32 row, + void read_row_callback(modpng14_ptr ptr, modpng14_uint_32 row, int pass); { /* put your code here */ @@ -296,9 +296,9 @@ (You can give it another name that you like instead of "read_row_callback") -To inform libpng about your function, use +To inform libmodpng14 about your function, use - png_set_read_status_fn(png_ptr, read_row_callback); + modpng14_set_read_status_fn(modpng14_ptr, read_row_callback); Unknown-chunk handling @@ -308,7 +308,7 @@ various info_ptr members; unknown chunks will be discarded. To change this, you can call: - png_set_keep_unknown_chunks(png_ptr, info_ptr, keep, + modpng14_set_keep_unknown_chunks(modpng14_ptr, info_ptr, keep, chunk_list, num_chunks); keep - 0: do not keep 1: keep only if safe-to-copy @@ -320,10 +320,10 @@ unknown chunks are affected Unknown chunks declared in this way will be saved as raw data onto a -list of png_unknown_chunk structures. If a chunk that is normally -known to libpng is named in the list, it will be handled as unknown, +list of modpng14_unknown_chunk structures. If a chunk that is normally +known to libmodpng14 is named in the list, it will be handled as unknown, according to the "keep" directive. If a chunk is named in successive -instances of png_set_keep_unknown_chunks(), the final instance will +instances of modpng14_set_keep_unknown_chunks(), the final instance will take precedence. The high-level read interface @@ -334,74 +334,74 @@ the entire image into memory, and (b) the input transformations you want to do are limited to the following set: - PNG_TRANSFORM_IDENTITY No transformation - PNG_TRANSFORM_STRIP_16 Strip 16-bit samples to + MODPNG14_TRANSFORM_IDENTITY No transformation + MODPNG14_TRANSFORM_STRIP_16 Strip 16-bit samples to 8 bits - PNG_TRANSFORM_STRIP_ALPHA Discard the alpha channel - PNG_TRANSFORM_PACKING Expand 1, 2 and 4-bit + MODPNG14_TRANSFORM_STRIP_ALPHA Discard the alpha channel + MODPNG14_TRANSFORM_PACKING Expand 1, 2 and 4-bit samples to bytes - PNG_TRANSFORM_PACKSWAP Change order of packed + MODPNG14_TRANSFORM_PACKSWAP Change order of packed pixels to LSB first - PNG_TRANSFORM_EXPAND Perform set_expand() - PNG_TRANSFORM_INVERT_MONO Invert monochrome images - PNG_TRANSFORM_SHIFT Normalize pixels to the + MODPNG14_TRANSFORM_EXPAND Perform set_expand() + MODPNG14_TRANSFORM_INVERT_MONO Invert monochrome images + MODPNG14_TRANSFORM_SHIFT Normalize pixels to the sBIT depth - PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + MODPNG14_TRANSFORM_BGR Flip RGB to BGR, RGBA to BGRA - PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + MODPNG14_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA to AG - PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + MODPNG14_TRANSFORM_INVERT_ALPHA Change alpha from opacity to transparency - PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + MODPNG14_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples (This excludes setting a background color, doing gamma transformation, dithering, and setting filler.) If this is the case, simply do this: - png_read_png(png_ptr, info_ptr, png_transforms, NULL) + modpng14_read_png(modpng14_ptr, info_ptr, modpng14_transforms, NULL) -where png_transforms is an integer containing the logical OR of -some set of transformation flags. This call is equivalent to png_read_info(), +where modpng14_transforms is an integer containing the logical OR of +some set of transformation flags. This call is equivalent to modpng14_read_info(), followed the set of transformations indicated by the transform mask, -then png_read_image(), and finally png_read_end(). +then modpng14_read_image(), and finally modpng14_read_end(). (The final parameter of this call is not yet used. Someday it might point to transformation parameters required by some future input transform.) -After you have called png_read_png(), you can retrieve the image data +After you have called modpng14_read_png(), you can retrieve the image data with - row_pointers = png_get_rows(png_ptr, info_ptr); + row_pointers = modpng14_get_rows(modpng14_ptr, info_ptr); where row_pointers is an array of pointers to the pixel data for each row: - png_bytep row_pointers[height]; + modpng14_bytep row_pointers[height]; If you know your image size and pixel size ahead of time, you can allocate -row_pointers prior to calling png_read_png() with +row_pointers prior to calling modpng14_read_png() with - row_pointers = png_malloc(png_ptr, - height*sizeof(png_bytep)); + row_pointers = modpng14_malloc(modpng14_ptr, + height*sizeof(modpng14_bytep)); for (int i=0; i) and -png_get_(png_ptr, info_ptr, ...) functions return non-zero if the +has been read. The modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_) and +modpng14_get_(modpng14_ptr, info_ptr, ...) functions return non-zero if the data has been read, or zero if it is missing. The parameters to the -png_get_ are set directly if they are simple data types, or a pointer +modpng14_get_ are set directly if they are simple data types, or a pointer into the info_ptr is returned for any complex types. - png_get_PLTE(png_ptr, info_ptr, &palette, + modpng14_get_PLTE(modpng14_ptr, info_ptr, &palette, &num_palette); palette - the palette for the file - (array of png_color) + (array of modpng14_color) num_palette - number of entries in the palette - png_get_gAMA(png_ptr, info_ptr, &gamma); + modpng14_get_gAMA(modpng14_ptr, info_ptr, &gamma); gamma - the gamma the file is written - at (PNG_INFO_gAMA) + at (MODPNG14_INFO_gAMA) - png_get_sRGB(png_ptr, info_ptr, &srgb_intent); - srgb_intent - the rendering intent (PNG_INFO_sRGB) + modpng14_get_sRGB(modpng14_ptr, info_ptr, &srgb_intent); + srgb_intent - the rendering intent (MODPNG14_INFO_sRGB) The presence of the sRGB chunk means that the pixel data is in the sRGB color space. This chunk also implies specific values of gAMA and cHRM. - png_get_iCCP(png_ptr, info_ptr, &name, + modpng14_get_iCCP(modpng14_ptr, info_ptr, &name, &compression_type, &profile, &proflen); name - The profile name. compression - The compression type; always - PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + MODPNG14_COMPRESSION_TYPE_BASE for PNG 1.0. You may give NULL to this argument to ignore it. profile - International Color Consortium color profile data. May contain NULs. proflen - length of profile data in bytes. - png_get_sBIT(png_ptr, info_ptr, &sig_bit); + modpng14_get_sBIT(modpng14_ptr, info_ptr, &sig_bit); sig_bit - the number of significant bits for - (PNG_INFO_sBIT) each of the gray, + (MODPNG14_INFO_sBIT) each of the gray, red, green, and blue channels, whichever are appropriate for the - given color type (png_color_16) + given color type (modpng14_color_16) - png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, + modpng14_get_tRNS(modpng14_ptr, info_ptr, &trans, &num_trans, &trans_values); trans - array of transparent entries for - palette (PNG_INFO_tRNS) + palette (MODPNG14_INFO_tRNS) trans_values - graylevel or color sample values of the single transparent color for - non-paletted images (PNG_INFO_tRNS) + non-paletted images (MODPNG14_INFO_tRNS) num_trans - number of transparent entries - (PNG_INFO_tRNS) + (MODPNG14_INFO_tRNS) - png_get_hIST(png_ptr, info_ptr, &hist); - (PNG_INFO_hIST) + modpng14_get_hIST(modpng14_ptr, info_ptr, &hist); + (MODPNG14_INFO_hIST) hist - histogram of palette (array of - png_uint_16) + modpng14_uint_16) - png_get_tIME(png_ptr, info_ptr, &mod_time); + modpng14_get_tIME(modpng14_ptr, info_ptr, &mod_time); mod_time - time image was last modified - (PNG_VALID_tIME) + (MODPNG14_VALID_tIME) - png_get_bKGD(png_ptr, info_ptr, &background); - background - background color (PNG_VALID_bKGD) + modpng14_get_bKGD(modpng14_ptr, info_ptr, &background); + background - background color (MODPNG14_VALID_bKGD) valid 16-bit red, green and blue values, regardless of color_type - num_comments = png_get_text(png_ptr, info_ptr, + num_comments = modpng14_get_text(modpng14_ptr, info_ptr, &text_ptr, &num_text); num_comments - number of comments - text_ptr - array of png_text holding image + text_ptr - array of modpng14_text holding image comments text_ptr[i].compression - type of compression used - on "text" PNG_TEXT_COMPRESSION_NONE - PNG_TEXT_COMPRESSION_zTXt - PNG_ITXT_COMPRESSION_NONE - PNG_ITXT_COMPRESSION_zTXt + on "text" MODPNG14_TEXT_COMPRESSION_NONE + MODPNG14_TEXT_COMPRESSION_zTXt + MODPNG14_ITXT_COMPRESSION_NONE + MODPNG14_ITXT_COMPRESSION_zTXt text_ptr[i].key - keyword for comment. Must contain 1-79 characters. text_ptr[i].text - text comments for current @@ -582,53 +582,53 @@ num_text - number of comments (same as num_comments; you can put NULL here to avoid the duplication) - Note while png_set_text() will accept text, language, + Note while modpng14_set_text() will accept text, language, and translated keywords that can be NULL pointers, the - structure returned by png_get_text will always contain + structure returned by modpng14_get_text will always contain regular zero-terminated C strings. They might be empty strings but they will never be NULL pointers. - num_spalettes = png_get_sPLT(png_ptr, info_ptr, + num_spalettes = modpng14_get_sPLT(modpng14_ptr, info_ptr, &palette_ptr); palette_ptr - array of palette structures holding contents of one or more sPLT chunks read. num_spalettes - number of sPLT chunks read. - png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, + modpng14_get_oFFs(modpng14_ptr, info_ptr, &offset_x, &offset_y, &unit_type); offset_x - positive offset from the left edge of the screen offset_y - positive offset from the top edge of the screen - unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + unit_type - MODPNG14_OFFSET_PIXEL, MODPNG14_OFFSET_MICROMETER - png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, + modpng14_get_pHYs(modpng14_ptr, info_ptr, &res_x, &res_y, &unit_type); res_x - pixels/unit physical resolution in x direction res_y - pixels/unit physical resolution in x direction - unit_type - PNG_RESOLUTION_UNKNOWN, - PNG_RESOLUTION_METER + unit_type - MODPNG14_RESOLUTION_UNKNOWN, + MODPNG14_RESOLUTION_METER - png_get_sCAL(png_ptr, info_ptr, &unit, &width, + modpng14_get_sCAL(modpng14_ptr, info_ptr, &unit, &width, &height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are doubles) - png_get_sCAL_s(png_ptr, info_ptr, &unit, &width, + modpng14_get_sCAL_s(modpng14_ptr, info_ptr, &unit, &width, &height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are strings like "2.54") - num_unknown_chunks = png_get_unknown_chunks(png_ptr, + num_unknown_chunks = modpng14_get_unknown_chunks(modpng14_ptr, info_ptr, &unknowns) - unknowns - array of png_unknown_chunk + unknowns - array of modpng14_unknown_chunk structures holding unknown chunks unknowns[i].name - name of unknown chunk unknowns[i].data - data of unknown chunk @@ -637,24 +637,24 @@ The value of "i" corresponds to the order in which the chunks were read from the PNG file or inserted with the - png_set_unknown_chunks() function. + modpng14_set_unknown_chunks() function. The data from the pHYs chunk can be retrieved in several convenient forms: - res_x = png_get_x_pixels_per_meter(png_ptr, + res_x = modpng14_get_x_pixels_per_meter(modpng14_ptr, info_ptr) - res_y = png_get_y_pixels_per_meter(png_ptr, + res_y = modpng14_get_y_pixels_per_meter(modpng14_ptr, info_ptr) - res_x_and_y = png_get_pixels_per_meter(png_ptr, + res_x_and_y = modpng14_get_pixels_per_meter(modpng14_ptr, info_ptr) - res_x = png_get_x_pixels_per_inch(png_ptr, + res_x = modpng14_get_x_pixels_per_inch(modpng14_ptr, info_ptr) - res_y = png_get_y_pixels_per_inch(png_ptr, + res_y = modpng14_get_y_pixels_per_inch(modpng14_ptr, info_ptr) - res_x_and_y = png_get_pixels_per_inch(png_ptr, + res_x_and_y = modpng14_get_pixels_per_inch(modpng14_ptr, info_ptr) - aspect_ratio = png_get_pixel_aspect_ratio(png_ptr, + aspect_ratio = modpng14_get_pixel_aspect_ratio(modpng14_ptr, info_ptr) (Each of these returns 0 [signifying "unknown"] if @@ -664,20 +664,20 @@ The data from the oFFs chunk can be retrieved in several convenient forms: - x_offset = png_get_x_offset_microns(png_ptr, info_ptr); - y_offset = png_get_y_offset_microns(png_ptr, info_ptr); - x_offset = png_get_x_offset_inches(png_ptr, info_ptr); - y_offset = png_get_y_offset_inches(png_ptr, info_ptr); + x_offset = modpng14_get_x_offset_microns(modpng14_ptr, info_ptr); + y_offset = modpng14_get_y_offset_microns(modpng14_ptr, info_ptr); + x_offset = modpng14_get_x_offset_inches(modpng14_ptr, info_ptr); + y_offset = modpng14_get_y_offset_inches(modpng14_ptr, info_ptr); (Each of these returns 0 [signifying "unknown" if both x and y are 0] if the data is not present or if the chunk is present but the unit is the pixel) -For more information, see the png_info definition in png.h and the +For more information, see the modpng14_info definition in modpng14.h and the PNG specification for chunk contents. Be careful with trusting rowbytes, as some of the transformations could increase the space needed to hold a row (expand, filler, gray_to_rgb, etc.). -See png_read_update_info(), below. +See modpng14_read_update_info(), below. A quick word about text_ptr and num_text. PNG stores comments in keyword/text pairs, one pair per chunk, with no limit on the number @@ -691,7 +691,7 @@ Keywords should be limited to 79 Latin-1 characters without leading or trailing spaces, but non-consecutive spaces are allowed within the keyword. It is possible to have the same keyword any number of times. -The text_ptr is an array of png_text structures, each holding a +The text_ptr is an array of modpng14_text structures, each holding a pointer to a language string, a pointer to a keyword and a pointer to a text string. The text string, language code, and translated keyword may be empty or NULL pointers. The keyword/text @@ -699,7 +699,7 @@ However, some or all of the text chunks may be after the image, so, to make sure you have read all the text chunks, don't mess with these until after you read the stuff after the image. This will be -mentioned again below in the discussion that goes with png_read_end(). +mentioned again below in the discussion that goes with modpng14_read_end(). Input transformations @@ -716,23 +716,23 @@ The colors used for the background and transparency values should be supplied in the same format/depth as the current image data. They are stored in the same format/depth as the image data in a bKGD or tRNS -chunk, so this is what libpng expects for this data. The colors are +chunk, so this is what libmodpng14 expects for this data. The colors are transformed to keep in sync with the image data when an application -calls the png_read_update_info() routine (see below). +calls the modpng14_read_update_info() routine (see below). Data will be decoded into the supplied row buffers packed into bytes unless the library has been told to transform it into another format. For example, 4 bit/pixel paletted or grayscale data will be returned 2 pixels/byte with the leftmost pixel in the high-order bits of the -byte, unless png_set_packing() is called. 8-bit RGB data will be stored -in RGB RGB RGB format unless png_set_filler() is called to insert filler +byte, unless modpng14_set_packing() is called. 8-bit RGB data will be stored +in RGB RGB RGB format unless modpng14_set_filler() is called to insert filler bytes, either before or after each RGB triplet. 16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant byte of the color -value first, unless png_set_strip_16() is called to transform it to -regular RGB RGB triplets, or png_set_filler() is called to insert +value first, unless modpng14_set_strip_16() is called to transform it to +regular RGB RGB triplets, or modpng14_set_filler() is called to insert filler bytes, either before or after each RRGGBB triplet. Similarly, -8-bit or 16-bit grayscale data can be modified with png_set_filler() -or png_set_strip_16(). +8-bit or 16-bit grayscale data can be modified with modpng14_set_filler() +or modpng14_set_strip_16(). The following code transforms grayscale images of less than 8 to 8 bits, changes paletted images to RGB, and adds a full alpha channel if there is @@ -740,17 +740,17 @@ grayscale images with bit depths of 2 or 4 or if there is a multiple-image viewing application that wishes to treat all images in the same way. - if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_palette_to_rgb(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) + modpng14_set_palette_to_rgb(modpng14_ptr); - if (color_type == PNG_COLOR_TYPE_GRAY && - bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_GRAY && + bit_depth < 8) modpng14_set_gray_1_2_4_to_8(modpng14_ptr); - if (png_get_valid(png_ptr, info_ptr, - PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); + if (modpng14_get_valid(modpng14_ptr, info_ptr, + MODPNG14_INFO_tRNS)) modpng14_set_tRNS_to_alpha(modpng14_ptr); -These three functions are actually aliases for png_set_expand(), added -in libpng version 1.0.4, with the function names expanded to improve code +These three functions are actually aliases for modpng14_set_expand(), added +in libmodpng14 version 1.0.4, with the function names expanded to improve code readability. In some future version they may actually do different things. @@ -758,15 +758,15 @@ 8 bits per channel, this will strip the pixels down to 8 bit. if (bit_depth == 16) - png_set_strip_16(png_ptr); + modpng14_set_strip_16(modpng14_ptr); If, for some reason, you don't need the alpha channel on an image, and you want to remove it rather than combining it with the background (but the image author certainly had in mind that you *would* combine it with the background, so that's what you should probably do): - if (color_type & PNG_COLOR_MASK_ALPHA) - png_set_strip_alpha(png_ptr); + if (color_type & MODPNG14_COLOR_MASK_ALPHA) + modpng14_set_strip_alpha(modpng14_ptr); In PNG files, the alpha channel in an image is the level of opacity. If you need the alpha channel in an image to @@ -775,7 +775,7 @@ fully opaque and 255 (in 8-bit or paletted images) or 65535 (in 16-bit images) is fully transparent, with - png_set_invert_alpha(png_ptr); + modpng14_set_invert_alpha(modpng14_ptr); PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as they can, resulting in, for example, 8 pixels per byte for 1 bit @@ -783,7 +783,7 @@ values of the pixels: if (bit_depth < 8) - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels stored in a PNG image have been "scaled" or "shifted" up to the next @@ -792,50 +792,50 @@ convert the PNG pixel data back to the original bit depth of the image. This call reduces the pixels back down to the original bit depth: - png_color_8p sig_bit; + modpng14_color_8p sig_bit; - if (png_get_sBIT(png_ptr, info_ptr, &sig_bit)) - png_set_shift(png_ptr, sig_bit); + if (modpng14_get_sBIT(modpng14_ptr, info_ptr, &sig_bit)) + modpng14_set_shift(modpng14_ptr, sig_bit); PNG files store 3-color pixels in red, green, blue order. This code changes the storage of the pixels to blue, green, red: - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_bgr(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) + modpng14_set_bgr(modpng14_ptr); PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them into 4 or 8 bytes for windowing systems that need them in this format: - if (color_type == PNG_COLOR_TYPE_RGB) - png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); + if (color_type == MODPNG14_COLOR_TYPE_RGB) + modpng14_set_filler(modpng14_ptr, filler, MODPNG14_FILLER_BEFORE); where "filler" is the 8 or 16-bit number to fill with, and the location is -either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether +either MODPNG14_FILLER_BEFORE or MODPNG14_FILLER_AFTER, depending upon whether you want the filler before the RGB or after. This transformation does not affect images that already have full alpha channels. To add an -opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which +opaque alpha channel, use filler=0xff or 0xffff and MODPNG14_FILLER_AFTER which will generate RGBA pixels. If you are reading an image with an alpha channel, and you need the data as ARGB instead of the normal PNG format RGBA: - if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_swap_alpha(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) + modpng14_set_swap_alpha(modpng14_ptr); For some uses, you may want a grayscale image to be represented as RGB. This code will do that conversion: - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_GRAY || + color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) + modpng14_set_gray_to_rgb(modpng14_ptr); Conversely, you can convert an RGB or RGBA image to grayscale or grayscale with alpha. - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_rgb_to_gray_fixed(png_ptr, error_action, + if (color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) + modpng14_set_rgb_to_gray_fixed(modpng14_ptr, error_action, int red_weight, int green_weight); error_action = 1: silently do the conversion @@ -854,8 +854,8 @@ If you have set error_action = 1 or 2, you can later check whether the image really was gray, after processing -the image rows, with the png_get_rgb_to_gray_status(png_ptr) function. -It will return a png_byte that is zero if the image was gray or +the image rows, with the modpng14_get_rgb_to_gray_status(modpng14_ptr) function. +It will return a modpng14_byte that is zero if the image was gray or 1 if there were any non-gray pixels. bKGD and sBIT data will be silently converted to grayscale, using the green channel data, regardless of the error_action setting. @@ -885,8 +885,8 @@ The calculation is done in a linear colorspace, if the image gamma is known. -If you have a grayscale and you are using png_set_expand_depth(), -png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to +If you have a grayscale and you are using modpng14_set_expand_depth(), +modpng14_set_expand(), or modpng14_set_gray_to_rgb to change to truecolor or to a higher bit-depth, you must either supply the background color as a gray value at the original file bit-depth (need_expand = 1) or else supply the background color as an RGB triplet at the final, expanded bit depth @@ -894,25 +894,25 @@ must either supply the background color as a palette index (need_expand = 1) or as an RGB triplet that may or may not be in the palette (need_expand = 0). - png_color_16 my_background; - png_color_16p image_background; + modpng14_color_16 my_background; + modpng14_color_16p 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); + if (modpng14_get_bKGD(modpng14_ptr, info_ptr, &image_background)) + modpng14_set_background(modpng14_ptr, image_background, + MODPNG14_BACKGROUND_GAMMA_FILE, 1, 1.0); else - png_set_background(png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + modpng14_set_background(modpng14_ptr, &my_background, + MODPNG14_BACKGROUND_GAMMA_SCREEN, 0, 1.0); -The png_set_background() function tells libpng to composite images +The modpng14_set_background() function tells libmodpng14 to composite images with alpha or simple transparency against the supplied background -color. If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), +color. If the PNG file contains a bKGD chunk (MODPNG14_INFO_bKGD valid), you may use this color, or supply another color more suitable for the current display (e.g., the background color from a web page). You -need to tell libpng whether the color is in the gamma space of the -display (PNG_BACKGROUND_GAMMA_SCREEN for colors you supply), the file -(PNG_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one -that is neither of these gammas (PNG_BACKGROUND_GAMMA_UNIQUE - I don't +need to tell libmodpng14 whether the color is in the gamma space of the +display (MODPNG14_BACKGROUND_GAMMA_SCREEN for colors you supply), the file +(MODPNG14_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one +that is neither of these gammas (MODPNG14_BACKGROUND_GAMMA_UNIQUE - I don't know why anyone would use this, but it's here). To properly display PNG images on any kind of system, the application needs @@ -953,7 +953,7 @@ guess for Mac systems */ } -The png_set_gamma() function handles gamma transformations of the data. +The modpng14_set_gamma() function handles gamma transformations of the data. Pass both the file gamma and the current screen_gamma. If the file does not have a gamma value, you can pass one anyway if you have an idea what it is (usually 0.45455 is a good guess for GIF images on PCs). Note @@ -962,13 +962,13 @@ gamma is, and why all applications should support it. It is strongly recommended that PNG viewers support gamma correction. - if (png_get_gAMA(png_ptr, info_ptr, &gamma)) - png_set_gamma(png_ptr, screen_gamma, gamma); + if (modpng14_get_gAMA(modpng14_ptr, info_ptr, &gamma)) + modpng14_set_gamma(modpng14_ptr, screen_gamma, gamma); else - png_set_gamma(png_ptr, screen_gamma, 0.45455); + modpng14_set_gamma(modpng14_ptr, screen_gamma, 0.45455); If you need to reduce an RGB file to a paletted file, or if a paletted -file has more entries then will fit on your screen, png_set_dither() +file has more entries then will fit on your screen, modpng14_set_dither() will do that. Note that this is a simple match dither that merely finds the closest color available. This should work fairly well with optimized palettes, and fairly badly with linear color cubes. If you @@ -978,24 +978,24 @@ more intelligent choices when reducing the palette. If there is no histogram, it may not do as good a job. - if (color_type & PNG_COLOR_MASK_COLOR) + if (color_type & MODPNG14_COLOR_MASK_COLOR) { - if (png_get_valid(png_ptr, info_ptr, - PNG_INFO_PLTE)) + if (modpng14_get_valid(modpng14_ptr, info_ptr, + MODPNG14_INFO_PLTE)) { - png_uint_16p histogram = NULL; + modpng14_uint_16p histogram = NULL; - png_get_hIST(png_ptr, info_ptr, + modpng14_get_hIST(modpng14_ptr, info_ptr, &histogram); - png_set_dither(png_ptr, palette, num_palette, + modpng14_set_dither(modpng14_ptr, palette, num_palette, max_screen_colors, histogram, 1); } else { - png_color std_color_cube[MAX_SCREEN_COLORS] = + modpng14_color std_color_cube[MAX_SCREEN_COLORS] = { ... colors ... }; - png_set_dither(png_ptr, std_color_cube, + modpng14_set_dither(modpng14_ptr, std_color_cube, MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, NULL,0); } @@ -1005,14 +1005,14 @@ The following code will reverse this (make black be one and white be zero): - if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) - png_set_invert_mono(png_ptr); + if (bit_depth == 1 && color_type == MODPNG14_COLOR_TYPE_GRAY) + modpng14_set_invert_mono(modpng14_ptr); This function can also be used to invert grayscale and gray-alpha images: - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_invert_mono(png_ptr); + if (color_type == MODPNG14_COLOR_TYPE_GRAY || + color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) + modpng14_set_invert_mono(modpng14_ptr); PNG files store 16 bit pixels in network byte order (big-endian, ie. most significant bits first). This code changes the storage to the @@ -1020,62 +1020,62 @@ way PCs store them): if (bit_depth == 16) - png_set_swap(png_ptr); + modpng14_set_swap(modpng14_ptr); If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you need to change the order the pixels are packed into bytes, you can use: if (bit_depth < 8) - png_set_packswap(png_ptr); + modpng14_set_packswap(modpng14_ptr); Finally, you can write your own transformation function if none of the existing ones meets your needs. This is done by setting a callback with - png_set_read_user_transform_fn(png_ptr, + modpng14_set_read_user_transform_fn(modpng14_ptr, read_transform_fn); You must supply the function - void read_transform_fn(png_ptr ptr, row_info_ptr - row_info, png_bytep data) + void read_transform_fn(modpng14_ptr ptr, row_info_ptr + row_info, modpng14_bytep data) See pngtest.c for a working example. Your function will be called after all of the other transformations have been processed. You can also set up a pointer to a user structure for use by your -callback function, and you can inform libpng that your transform +callback function, and you can inform libmodpng14 that your transform function will change the number of channels or bit depth with the function - png_set_user_transform_info(png_ptr, user_ptr, + modpng14_set_user_transform_info(modpng14_ptr, user_ptr, user_depth, user_channels); -The user's application, not libpng, is responsible for allocating and +The user's application, not libmodpng14, is responsible for allocating and freeing any memory required for the user structure. You can retrieve the pointer via the function -png_get_user_transform_ptr(). For example: +modpng14_get_user_transform_ptr(). For example: voidp read_user_transform_ptr = - png_get_user_transform_ptr(png_ptr); + modpng14_get_user_transform_ptr(modpng14_ptr); The last thing to handle is interlacing; this is covered in detail below, -but you must call the function here if you want libpng to handle expansion +but you must call the function here if you want libmodpng14 to handle expansion of the interlaced image. - number_of_passes = png_set_interlace_handling(png_ptr); + number_of_passes = modpng14_set_interlace_handling(modpng14_ptr); -After setting the transformations, libpng can update your png_info +After setting the transformations, libmodpng14 can update your modpng14_info structure to reflect any transformations you've requested with this call. This is most useful to update the info structure's rowbytes field so you can use it to allocate your image memory. This function will also update your palette with the correct screen_gamma and background if these have been given with the calls above. - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_ptr, info_ptr); -After you call png_read_update_info(), you can allocate any +After you call modpng14_read_update_info(), you can allocate any memory you need to hold the image. The row data is simply raw byte data for all forms of images. As the actual allocation varies among applications, no example will be given. If you @@ -1088,45 +1088,45 @@ After you've allocated memory, you can read the image data. The simplest way to do this is in one function call. If you are allocating enough memory to hold the whole image, you can just -call png_read_image() and libpng will read in all the image data +call modpng14_read_image() and libmodpng14 will read in all the image data and put it in the memory area supplied. You will need to pass in an array of pointers to each row. This function automatically handles interlacing, so you don't need -to call png_set_interlace_handling() or call this function multiple -times, or any of that other stuff necessary with png_read_rows(). +to call modpng14_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with modpng14_read_rows(). - png_read_image(png_ptr, row_pointers); + modpng14_read_image(modpng14_ptr, row_pointers); where row_pointers is: - png_bytep row_pointers[height]; + modpng14_bytep row_pointers[height]; You can point to void or char or whatever you use for pixels. If you don't want to read in the whole image at once, you can -use png_read_rows() instead. If there is no interlacing (check -interlace_type == PNG_INTERLACE_NONE), this is simple: +use modpng14_read_rows() instead. If there is no interlacing (check +interlace_type == MODPNG14_INTERLACE_NONE), this is simple: - png_read_rows(png_ptr, row_pointers, NULL, + modpng14_read_rows(modpng14_ptr, row_pointers, NULL, number_of_rows); -where row_pointers is the same as in the png_read_image() call. +where row_pointers is the same as in the modpng14_read_image() call. If you are doing this just one row at a time, you can do this with a single row_pointer instead of an array of row_pointers: - png_bytep row_pointer = row; - png_read_row(png_ptr, row_pointer, NULL); + modpng14_bytep row_pointer = row; + modpng14_read_row(modpng14_ptr, row_pointer, NULL); If the file is interlaced (interlace_type != 0 in the IHDR chunk), things get somewhat harder. The only current (PNG Specification version 1.2) -interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7) +interlacing type for PNG is (interlace_type == MODPNG14_INTERLACE_ADAM7) is a somewhat complicated 2D interlace scheme, known as Adam7, that breaks down an image into seven smaller images of varying size, based on an 8x8 grid. -libpng can fill out those images or it can give them to you "as is". +libmodpng14 can fill out those images or it can give them to you "as is". If you want them filled out, there are two ways to do that. The one mentioned in the PNG specification is to expand each pixel to cover those pixels that have not been read yet (the "rectangle" method). @@ -1137,11 +1137,11 @@ before the start of the read. The first method usually looks better, but tends to be slower, as there are more pixels to put in the rows. -If you don't want libpng to handle the interlacing details, just call -png_read_rows() seven times to read in all seven images. Each of the +If you don't want libmodpng14 to handle the interlacing details, just call +modpng14_read_rows() seven times to read in all seven images. Each of the images is a valid image by itself, or they can all be combined on an 8x8 grid to form a single image (although if you intend to combine them -you would be far better off using the libpng interlace handling). +you would be far better off using the libmodpng14 interlace handling). The first pass will return an image 1/8 as wide as the entire image (every 8th column starting in column 0) and 1/8 as high as the original @@ -1157,12 +1157,12 @@ wide as the original, and 1/2 as high, containing all of the odd numbered scanlines. Phew! -If you want libpng to expand the images, call this before calling -png_start_read_image() or png_read_update_info(): +If you want libmodpng14 to expand the images, call this before calling +modpng14_start_read_image() or modpng14_read_update_info(): - if (interlace_type == PNG_INTERLACE_ADAM7) + if (interlace_type == MODPNG14_INTERLACE_ADAM7) number_of_passes - = png_set_interlace_handling(png_ptr); + = modpng14_set_interlace_handling(modpng14_ptr); This will return the number of passes needed. Currently, this is seven, but may change if another interlace type is added. @@ -1176,21 +1176,21 @@ after each pass, the "rectangle" effect is generally considered the better looking one. -If you only want the "sparkle" effect, just call png_read_rows() as +If you only want the "sparkle" effect, just call modpng14_read_rows() as normal, with the third parameter NULL. Make sure you make pass over the image number_of_passes times, and you don't change the data in the rows between calls. You can change the locations of the data, just not the data. Each pass only writes the pixels appropriate for that pass, and assumes the data from previous passes is still valid. - png_read_rows(png_ptr, row_pointers, NULL, + modpng14_read_rows(modpng14_ptr, row_pointers, NULL, number_of_rows); If you only want the first effect (the rectangles), do the same as before except pass the row buffer in the third parameter, and leave the second parameter NULL. - png_read_rows(png_ptr, NULL, row_pointers, + modpng14_read_rows(modpng14_ptr, NULL, row_pointers, number_of_rows); Finishing a sequential read @@ -1198,36 +1198,36 @@ After you are finished reading the image through either the high- or low-level interfaces, you can finish reading the file. If you are interested in comments or time, which may be stored either before or -after the image data, you should pass the separate png_info struct if +after the image data, you should pass the separate modpng14_info struct if you want to keep the comments from before and after the image separate. If you are not interested, you can pass NULL. - png_read_end(png_ptr, end_info); + modpng14_read_end(modpng14_ptr, end_info); -When you are done, you can free all memory allocated by libpng like this: +When you are done, you can free all memory allocated by libmodpng14 like this: - png_destroy_read_struct(&png_ptr, &info_ptr, + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); It is also possible to individually free the info_ptr members that -point to libpng-allocated storage with the following function: +point to libmodpng14-allocated storage with the following function: - png_free_data(png_ptr, info_ptr, mask, seq) + modpng14_free_data(modpng14_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask containing the logical OR of one or more of - PNG_FREE_PLTE, PNG_FREE_TRNS, - PNG_FREE_HIST, PNG_FREE_ICCP, - PNG_FREE_PCAL, PNG_FREE_ROWS, - PNG_FREE_SCAL, PNG_FREE_SPLT, - PNG_FREE_TEXT, PNG_FREE_UNKN, - or simply PNG_FREE_ALL + MODPNG14_FREE_PLTE, MODPNG14_FREE_TRNS, + MODPNG14_FREE_HIST, MODPNG14_FREE_ICCP, + MODPNG14_FREE_PCAL, MODPNG14_FREE_ROWS, + MODPNG14_FREE_SCAL, MODPNG14_FREE_SPLT, + MODPNG14_FREE_TEXT, MODPNG14_FREE_UNKN, + or simply MODPNG14_FREE_ALL seq - sequence number of item to be freed (-1 for all items) This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those +by the user and not by libmodpng14, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not -1, and multiple items are allowed for the data type identified in @@ -1235,99 +1235,99 @@ is freed, where n is "seq". The default behavior is only to free data that was allocated internally -by libpng. This can be changed, so that libpng will not free the data, -or so that it will free data that was allocated by the user with png_malloc() -or png_zalloc() and passed in via a png_set_*() function, with +by libmodpng14. This can be changed, so that libmodpng14 will not free the data, +or so that it will free data that was allocated by the user with modpng14_malloc() +or modpng14_zalloc() and passed in via a modpng14_set_*() function, with - png_data_freer(png_ptr, info_ptr, freer, mask) + modpng14_data_freer(modpng14_ptr, info_ptr, freer, mask) mask - which data elements are affected - same choices as in png_free_data() + same choices as in modpng14_free_data() freer - one of - PNG_DESTROY_WILL_FREE_DATA - PNG_SET_WILL_FREE_DATA - PNG_USER_WILL_FREE_DATA + MODPNG14_DESTROY_WILL_FREE_DATA + MODPNG14_SET_WILL_FREE_DATA + MODPNG14_USER_WILL_FREE_DATA This function only affects data that has already been allocated. You can call this function after reading the PNG data but before calling -any png_set_*() functions, to control whether the user or the png_set_*() +any modpng14_set_*() functions, to control whether the user or the modpng14_set_*() function is responsible for freeing any existing data that might be present, -and again after the png_set_*() functions to control whether the user -or png_destroy_*() is supposed to free the data. When the user assumes -responsibility for libpng-allocated data, the application must use -png_free() to free it, and when the user transfers responsibility to libpng -for data that the user has allocated, the user must have used png_malloc() -or png_zalloc() to allocate it. +and again after the modpng14_set_*() functions to control whether the user +or modpng14_destroy_*() is supposed to free the data. When the user assumes +responsibility for libmodpng14-allocated data, the application must use +modpng14_free() to free it, and when the user transfers responsibility to libmodpng14 +for data that the user has allocated, the user must have used modpng14_malloc() +or modpng14_zalloc() to allocate it. If you allocated your row_pointers in a single block, as suggested above in the description of the high level read interface, you must not transfer -responsibility for freeing it to the png_set_rows or png_read_destroy function, +responsibility for freeing it to the modpng14_set_rows or modpng14_read_destroy function, because they would also try to free the individual row_pointers[i]. If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword -separately, do not transfer responsibility for freeing text_ptr to libpng, -because when libpng fills a png_text structure it combines these members with -the key member, and png_free_data() will free only text_ptr.key. Similarly, -if you transfer responsibility for free'ing text_ptr from libpng to your +separately, do not transfer responsibility for freeing text_ptr to libmodpng14, +because when libmodpng14 fills a modpng14_text structure it combines these members with +the key member, and modpng14_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libmodpng14 to your application, your application must not separately free those members. -The png_free_data() function will turn off the "valid" flag for anything +The modpng14_free_data() function will turn off the "valid" flag for anything it frees. If you need to turn the flag off for a chunk that was freed by your -application instead of by libpng, you can use +application instead of by libmodpng14, you can use - png_set_invalid(png_ptr, info_ptr, mask); + modpng14_set_invalid(modpng14_ptr, info_ptr, mask); mask - identifies the chunks to be made invalid, containing the logical OR of one or more of - PNG_INFO_gAMA, PNG_INFO_sBIT, - PNG_INFO_cHRM, PNG_INFO_PLTE, - PNG_INFO_tRNS, PNG_INFO_bKGD, - PNG_INFO_hIST, PNG_INFO_pHYs, - PNG_INFO_oFFs, PNG_INFO_tIME, - PNG_INFO_pCAL, PNG_INFO_sRGB, - PNG_INFO_iCCP, PNG_INFO_sPLT, - PNG_INFO_sCAL, PNG_INFO_IDAT + MODPNG14_INFO_gAMA, MODPNG14_INFO_sBIT, + MODPNG14_INFO_cHRM, MODPNG14_INFO_PLTE, + MODPNG14_INFO_tRNS, MODPNG14_INFO_bKGD, + MODPNG14_INFO_hIST, MODPNG14_INFO_pHYs, + MODPNG14_INFO_oFFs, MODPNG14_INFO_tIME, + MODPNG14_INFO_pCAL, MODPNG14_INFO_sRGB, + MODPNG14_INFO_iCCP, MODPNG14_INFO_sPLT, + MODPNG14_INFO_sCAL, MODPNG14_INFO_IDAT For a more compact example of reading a PNG image, see the file example.c. Reading PNG files progressively The progressive reader is slightly different then the non-progressive -reader. Instead of calling png_read_info(), png_read_rows(), and -png_read_end(), you make one call to png_process_data(), which calls +reader. Instead of calling modpng14_read_info(), modpng14_read_rows(), and +modpng14_read_end(), you make one call to modpng14_process_data(), which calls callbacks when it has the info, a row, or the end of the image. You -set up these callbacks with png_set_progressive_read_fn(). You don't -have to worry about the input/output functions of libpng, as you are -giving the library the data directly in png_process_data(). I will +set up these callbacks with modpng14_set_progressive_read_fn(). You don't +have to worry about the input/output functions of libmodpng14, as you are +giving the library the data directly in modpng14_process_data(). I will assume that you have read the section on reading PNG files above, so I will only highlight the differences (although I will show all of the code). -png_structp png_ptr; -png_infop info_ptr; +modpng14_structp modpng14_ptr; +modpng14_infop info_ptr; /* An example code fragment of how you would initialize the progressive reader in your application. */ int - initialize_png_reader() + initialize_modpng14_reader() { - png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + modpng14_ptr = modpng14_create_read_struct + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if (!png_ptr) + if (!modpng14_ptr) return (ERROR); - info_ptr = png_create_info_struct(png_ptr); + info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, (modpng14_infopp)NULL, + (modpng14_infopp)NULL); return (ERROR); } - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, + (modpng14_infopp)NULL); return (ERROR); } @@ -1337,17 +1337,17 @@ is finished. 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(). You can use + modpng14_set_progressive_read_fn(). You can use any struct as the user_ptr (cast to a void pointer for the function call), and retrieve the pointer from inside the callbacks using the function - png_get_progressive_ptr(png_ptr); + modpng14_get_progressive_ptr(modpng14_ptr); which will return a void pointer, which you have to cast appropriately. */ - png_set_progressive_read_fn(png_ptr, (void *)user_ptr, + modpng14_set_progressive_read_fn(modpng14_ptr, (void *)user_ptr, info_callback, row_callback, end_callback); return 0; @@ -1356,12 +1356,12 @@ /* A code fragment that you call as you receive blocks of data */ int - process_data(png_bytep buffer, png_uint_32 length) + process_data(modpng14_bytep buffer, modpng14_uint_32 length) { - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, + (modpng14_infopp)NULL); return (ERROR); } @@ -1378,26 +1378,26 @@ in the row callback if you don't already do so there. */ - png_process_data(png_ptr, info_ptr, buffer, length); + modpng14_process_data(modpng14_ptr, info_ptr, buffer, length); return 0; } /* This function is called (as set by - png_set_progressive_read_fn() above) when enough data + modpng14_set_progressive_read_fn() above) when enough data has been supplied so all of the header has been read. */ void - info_callback(png_structp png_ptr, png_infop info) + info_callback(modpng14_structp modpng14_ptr, modpng14_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 + either modpng14_start_read_image() or + modpng14_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 + modpng14_process_data() returns, so this is your last chance to prepare for that. */ } @@ -1405,8 +1405,8 @@ /* This function is called when each row of image data is complete */ void - row_callback(png_structp png_ptr, png_bytep new_row, - png_uint_32 row_num, int pass) + row_callback(modpng14_structp modpng14_ptr, modpng14_bytep new_row, + modpng14_uint_32 row_num, int pass) { /* If the image is interlaced, and you turned on the interlace handler, this function will @@ -1420,7 +1420,7 @@ easier. For the non-NULL rows of interlaced images, - you must call png_progressive_combine_row() + you must call modpng14_progressive_combine_row() passing in the row and the old row. You can call this function for NULL rows (it will just return) and for non-interlaced images (it just @@ -1429,7 +1429,7 @@ all cases: */ - png_progressive_combine_row(png_ptr, old_row, + modpng14_progressive_combine_row(modpng14_ptr, old_row, new_row); /* where old_row is what was displayed for @@ -1444,7 +1444,7 @@ } void - end_callback(png_structp png_ptr, png_infop info) + end_callback(modpng14_structp modpng14_ptr, modpng14_infop info) { /* This function is called after the whole image has been read, including any chunks after the @@ -1468,10 +1468,10 @@ Setup -You will want to do the I/O initialization before you get into libpng, +You will want to do the I/O initialization before you get into libmodpng14, so if it doesn't work, you don't have anything to undo. If you are not using the standard I/O functions, you will need to replace them with -custom writing functions. See the discussion under Customizing libpng. +custom writing functions. See the discussion under Customizing libmodpng14. FILE *fp = fopen(file_name, "wb"); if (!fp) @@ -1479,51 +1479,51 @@ return (ERROR); } -Next, png_struct and png_info need to be allocated and initialized. +Next, modpng14_struct and modpng14_info need to be allocated and initialized. As these can be both relatively large, you may not want to store these on the stack, unless you have stack space to spare. Of course, you will want to check if they return NULL. If you are also reading, you won't want to name your read structure and your write structure -both "png_ptr"; you can call them anything you like, such as +both "modpng14_ptr"; you can call them anything you like, such as "read_ptr" and "write_ptr". Look at pngtest.c, for example. - png_structp png_ptr = png_create_write_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + modpng14_structp modpng14_ptr = modpng14_create_write_struct + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if (!png_ptr) + if (!modpng14_ptr) return (ERROR); - png_infop info_ptr = png_create_info_struct(png_ptr); + modpng14_infop info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_write_struct(&png_ptr, - (png_infopp)NULL); + modpng14_destroy_write_struct(&modpng14_ptr, + (modpng14_infopp)NULL); return (ERROR); } If you want to use your own memory allocation routines, -define PNG_USER_MEM_SUPPORTED and use -png_create_write_struct_2() instead of png_create_write_struct(): +define MODPNG14_USER_MEM_SUPPORTED and use +modpng14_create_write_struct_2() instead of modpng14_create_write_struct(): - png_structp png_ptr = png_create_write_struct_2 - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn, (png_voidp) + modpng14_structp modpng14_ptr = modpng14_create_write_struct_2 + (MODPNG14_LIBMODPNG14_VER_STRING, (modpng14_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (modpng14_voidp) user_mem_ptr, user_malloc_fn, user_free_fn); After you have these structures, you will need to set up the -error handling. When libpng encounters an error, it expects to +error handling. When libmodpng14 encounters an error, it expects to longjmp() back to your routine. Therefore, you will need to call -setjmp() and pass the png_jmpbuf(png_ptr). If you +setjmp() and pass the modpng14_jmpbuf(modpng14_ptr). If you write the file from different routines, you will need to update -the png_jmpbuf(png_ptr) every time you enter a new routine that will -call a png_*() function. See your documentation of setjmp/longjmp +the modpng14_jmpbuf(modpng14_ptr) every time you enter a new routine that will +call a modpng14_*() function. See your documentation of setjmp/longjmp for your compiler for more information on setjmp/longjmp. See -the discussion on libpng error handling in the Customizing Libpng -section below for more information on the libpng error handling. +the discussion on libmodpng14 error handling in the Customizing Libpng +section below for more information on the libmodpng14 error handling. - if (setjmp(png_jmpbuf(png_ptr))) + if (setjmp(modpng14_jmpbuf(modpng14_ptr))) { - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); fclose(fp); return (ERROR); } @@ -1531,17 +1531,17 @@ return; If you would rather avoid the complexity of setjmp/longjmp issues, -you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case -errors will result in a call to PNG_ABORT() which defaults to abort(). +you can compile libmodpng14 with MODPNG14_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to MODPNG14_ABORT() which defaults to abort(). -Now you need to set up the output code. The default for libpng is to +Now you need to set up the output code. The default for libmodpng14 is to use the C function fwrite(). If you use this, you will need to pass a -valid FILE * in the function png_init_io(). Be sure that the file is +valid FILE * in the function modpng14_init_io(). Be sure that the file is opened in binary mode. Again, if you wish to handle writing data in -another way, see the discussion on libpng I/O handling in the Customizing +another way, see the discussion on libmodpng14 I/O handling in the Customizing Libpng section below. - png_init_io(png_ptr, fp); + modpng14_init_io(modpng14_ptr, fp); Write callbacks @@ -1550,7 +1550,7 @@ a progress meter or the like. It's demonstrated in pngtest.c. You must supply a function - void write_row_callback(png_ptr, png_uint_32 row, + void write_row_callback(modpng14_ptr, modpng14_uint_32 row, int pass); { /* put your code here */ @@ -1558,9 +1558,9 @@ (You can give it another name that you like instead of "write_row_callback") -To inform libpng about your function, use +To inform libmodpng14 about your function, use - png_set_write_status_fn(png_ptr, write_row_callback); + modpng14_set_write_status_fn(modpng14_ptr, write_row_callback); You now have the option of modifying how the compression library will run. The following functions are mainly for testing, but may be useful @@ -1569,7 +1569,7 @@ maximum possible compression at the expense of slower writing. If you have no special needs in this area, let the library do what it wants by not calling this function at all, as it has been tuned to deliver a good -speed/compression ratio. The second parameter to png_set_filter() is +speed/compression ratio. The second parameter to modpng14_set_filter() is the filter method, for which the only valid values are 0 (as of the July 1999 PNG specification, version 1.2) or 64 (if you are writing a PNG datastream that is to be embedded in a MNG datastream). The third @@ -1580,15 +1580,15 @@ /* turn on or off filtering, and/or choose specific filters. You can use either a single - PNG_FILTER_VALUE_NAME or the logical OR of one - or more PNG_FILTER_NAME masks. */ - png_set_filter(png_ptr, 0, - PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | - PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB | - PNG_FILTER_UP | PNG_FILTER_VALUE_UP | - PNG_FILTER_AVE | PNG_FILTER_VALUE_AVE | - PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH| - PNG_ALL_FILTERS); + MODPNG14_FILTER_VALUE_NAME or the logical OR of one + or more MODPNG14_FILTER_NAME masks. */ + modpng14_set_filter(modpng14_ptr, 0, + MODPNG14_FILTER_NONE | MODPNG14_FILTER_VALUE_NONE | + MODPNG14_FILTER_SUB | MODPNG14_FILTER_VALUE_SUB | + MODPNG14_FILTER_UP | MODPNG14_FILTER_VALUE_UP | + MODPNG14_FILTER_AVE | MODPNG14_FILTER_VALUE_AVE | + MODPNG14_FILTER_PAETH | MODPNG14_FILTER_VALUE_PAETH| + MODPNG14_ALL_FILTERS); If an application wants to start and stop using particular filters during compression, @@ -1599,43 +1599,43 @@ If you are writing a PNG datastream that is to be embedded in a MNG datastream, the second parameter can be either 0 or 64. -The png_set_compression_*() functions interface to the zlib compression +The modpng14_set_compression_*() functions interface to the zlib compression library, and should mostly be ignored unless you really know what you are -doing. The only generally useful call is png_set_compression_level() +doing. The only generally useful call is modpng14_set_compression_level() which changes how much time zlib spends on trying to compress the image data. See the Compression Library (zlib.h and algorithm.txt, distributed with zlib) for details on the compression levels. /* set the zlib compression level */ - png_set_compression_level(png_ptr, + modpng14_set_compression_level(modpng14_ptr, Z_BEST_COMPRESSION); /* set other zlib parameters */ - png_set_compression_mem_level(png_ptr, 8); - png_set_compression_strategy(png_ptr, + modpng14_set_compression_mem_level(modpng14_ptr, 8); + modpng14_set_compression_strategy(modpng14_ptr, Z_DEFAULT_STRATEGY); - png_set_compression_window_bits(png_ptr, 15); - png_set_compression_method(png_ptr, 8); - png_set_compression_buffer_size(png_ptr, 8192) + modpng14_set_compression_window_bits(modpng14_ptr, 15); + modpng14_set_compression_method(modpng14_ptr, 8); + modpng14_set_compression_buffer_size(modpng14_ptr, 8192) -extern PNG_EXPORT(void,png_set_zbuf_size) +extern MODPNG14_EXPORT(void,modpng14_set_zbuf_size) Setting the contents of info for output -You now need to fill in the png_info structure with all the data you +You now need to fill in the modpng14_info structure with all the data you wish to write before the actual image. Note that the only thing you are allowed to write after the image is the text chunks and the time -chunk (as of PNG Specification 1.2, anyway). See png_write_end() and +chunk (as of PNG Specification 1.2, anyway). See modpng14_write_end() and the latest PNG specification for more information on that. If you wish to write them before the image, fill them in now, and flag that data as being valid. If you want to wait until after the data, don't -fill them until png_write_end(). For all the fields in png_info and -their data types, see png.h. For explanations of what the fields +fill them until modpng14_write_end(). For all the fields in modpng14_info and +their data types, see modpng14.h. For explanations of what the fields contain, see the PNG specification. -Some of the more important parts of the png_info are: +Some of the more important parts of the modpng14_info are: - png_set_IHDR(png_ptr, info_ptr, width, height, + modpng14_set_IHDR(modpng14_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_method) width - holds the width of the image @@ -1650,44 +1650,44 @@ bits (sBIT) below). color_type - describes which color/alpha channels are present. - PNG_COLOR_TYPE_GRAY + MODPNG14_COLOR_TYPE_GRAY (bit depths 1, 2, 4, 8, 16) - PNG_COLOR_TYPE_GRAY_ALPHA + MODPNG14_COLOR_TYPE_GRAY_ALPHA (bit depths 8, 16) - PNG_COLOR_TYPE_PALETTE + MODPNG14_COLOR_TYPE_PALETTE (bit depths 1, 2, 4, 8) - PNG_COLOR_TYPE_RGB + MODPNG14_COLOR_TYPE_RGB (bit_depths 8, 16) - PNG_COLOR_TYPE_RGB_ALPHA + MODPNG14_COLOR_TYPE_RGB_ALPHA (bit_depths 8, 16) - PNG_COLOR_MASK_PALETTE - PNG_COLOR_MASK_COLOR - PNG_COLOR_MASK_ALPHA + MODPNG14_COLOR_MASK_PALETTE + MODPNG14_COLOR_MASK_COLOR + MODPNG14_COLOR_MASK_ALPHA - interlace_type - PNG_INTERLACE_NONE or - PNG_INTERLACE_ADAM7 + interlace_type - MODPNG14_INTERLACE_NONE or + MODPNG14_INTERLACE_ADAM7 compression_type - (must be - PNG_COMPRESSION_TYPE_DEFAULT) - filter_method - (must be PNG_FILTER_TYPE_DEFAULT + MODPNG14_COMPRESSION_TYPE_DEFAULT) + filter_method - (must be MODPNG14_FILTER_TYPE_DEFAULT or, if you are writing a PNG to be embedded in a MNG datastream, can also be - PNG_INTRAPIXEL_DIFFERENCING) + MODPNG14_INTRAPIXEL_DIFFERENCING) - png_set_PLTE(png_ptr, info_ptr, palette, + modpng14_set_PLTE(modpng14_ptr, info_ptr, palette, num_palette); palette - the palette for the file - (array of png_color) + (array of modpng14_color) num_palette - number of entries in the palette - png_set_gAMA(png_ptr, info_ptr, gamma); + modpng14_set_gAMA(modpng14_ptr, info_ptr, gamma); gamma - the gamma the image was created - at (PNG_INFO_gAMA) + at (MODPNG14_INFO_gAMA) - png_set_sRGB(png_ptr, info_ptr, srgb_intent); + modpng14_set_sRGB(modpng14_ptr, info_ptr, srgb_intent); srgb_intent - the rendering intent - (PNG_INFO_sRGB) The presence of + (MODPNG14_INFO_sRGB) The presence of the sRGB chunk means that the pixel data is in the sRGB color space. This chunk also implies specific @@ -1697,16 +1697,16 @@ Color Consortium (http://www.color.org). It can be one of - PNG_sRGB_INTENT_SATURATION, - PNG_sRGB_INTENT_PERCEPTUAL, - PNG_sRGB_INTENT_ABSOLUTE, or - PNG_sRGB_INTENT_RELATIVE. + MODPNG14_sRGB_INTENT_SATURATION, + MODPNG14_sRGB_INTENT_PERCEPTUAL, + MODPNG14_sRGB_INTENT_ABSOLUTE, or + MODPNG14_sRGB_INTENT_RELATIVE. - png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, + modpng14_set_sRGB_gAMA_and_cHRM(modpng14_ptr, info_ptr, srgb_intent); srgb_intent - the rendering intent - (PNG_INFO_sRGB) The presence of the + (MODPNG14_INFO_sRGB) The presence of the sRGB chunk means that the pixel data is in the sRGB color space. This function also causes gAMA and @@ -1714,54 +1714,54 @@ that are consistent with sRGB to be written. - png_set_iCCP(png_ptr, info_ptr, name, compression_type, + modpng14_set_iCCP(modpng14_ptr, info_ptr, name, compression_type, profile, proflen); name - The profile name. compression - The compression type; always - PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + MODPNG14_COMPRESSION_TYPE_BASE for PNG 1.0. You may give NULL to this argument to ignore it. profile - International Color Consortium color profile data. May contain NULs. proflen - length of profile data in bytes. - png_set_sBIT(png_ptr, info_ptr, sig_bit); + modpng14_set_sBIT(modpng14_ptr, info_ptr, sig_bit); sig_bit - the number of significant bits for - (PNG_INFO_sBIT) each of the gray, red, + (MODPNG14_INFO_sBIT) each of the gray, red, green, and blue channels, whichever are appropriate for the given color type - (png_color_16) + (modpng14_color_16) - png_set_tRNS(png_ptr, info_ptr, trans, num_trans, + modpng14_set_tRNS(modpng14_ptr, info_ptr, trans, num_trans, trans_values); trans - array of transparent entries for - palette (PNG_INFO_tRNS) + palette (MODPNG14_INFO_tRNS) trans_values - graylevel or color sample values of the single transparent color for - non-paletted images (PNG_INFO_tRNS) + non-paletted images (MODPNG14_INFO_tRNS) num_trans - number of transparent entries - (PNG_INFO_tRNS) + (MODPNG14_INFO_tRNS) - png_set_hIST(png_ptr, info_ptr, hist); - (PNG_INFO_hIST) + modpng14_set_hIST(modpng14_ptr, info_ptr, hist); + (MODPNG14_INFO_hIST) hist - histogram of palette (array of - png_uint_16) + modpng14_uint_16) - png_set_tIME(png_ptr, info_ptr, mod_time); + modpng14_set_tIME(modpng14_ptr, info_ptr, mod_time); mod_time - time image was last modified - (PNG_VALID_tIME) + (MODPNG14_VALID_tIME) - png_set_bKGD(png_ptr, info_ptr, background); - background - background color (PNG_VALID_bKGD) + modpng14_set_bKGD(modpng14_ptr, info_ptr, background); + background - background color (MODPNG14_VALID_bKGD) - png_set_text(png_ptr, info_ptr, text_ptr, num_text); - text_ptr - array of png_text holding image + modpng14_set_text(modpng14_ptr, info_ptr, text_ptr, num_text); + text_ptr - array of modpng14_text holding image comments text_ptr[i].compression - type of compression used - on "text" PNG_TEXT_COMPRESSION_NONE - PNG_TEXT_COMPRESSION_zTXt - PNG_ITXT_COMPRESSION_NONE - PNG_ITXT_COMPRESSION_zTXt + on "text" MODPNG14_TEXT_COMPRESSION_NONE + MODPNG14_TEXT_COMPRESSION_zTXt + MODPNG14_ITXT_COMPRESSION_NONE + MODPNG14_ITXT_COMPRESSION_zTXt text_ptr[i].key - keyword for comment. Must contain 1-79 characters. text_ptr[i].text - text comments for current @@ -1776,84 +1776,84 @@ or empty for unknown). num_text - number of comments - png_set_sPLT(png_ptr, info_ptr, &palette_ptr, + modpng14_set_sPLT(modpng14_ptr, info_ptr, &palette_ptr, num_spalettes); - palette_ptr - array of png_sPLT_struct structures + palette_ptr - array of modpng14_sPLT_struct structures to be added to the list of palettes in the info structure. num_spalettes - number of palette structures to be added. - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, + modpng14_set_oFFs(modpng14_ptr, info_ptr, offset_x, offset_y, unit_type); offset_x - positive offset from the left edge of the screen offset_y - positive offset from the top edge of the screen - unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + unit_type - MODPNG14_OFFSET_PIXEL, MODPNG14_OFFSET_MICROMETER - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, + modpng14_set_pHYs(modpng14_ptr, info_ptr, res_x, res_y, unit_type); res_x - pixels/unit physical resolution in x direction res_y - pixels/unit physical resolution in y direction - unit_type - PNG_RESOLUTION_UNKNOWN, - PNG_RESOLUTION_METER + unit_type - MODPNG14_RESOLUTION_UNKNOWN, + MODPNG14_RESOLUTION_METER - png_set_sCAL(png_ptr, info_ptr, unit, width, height) + modpng14_set_sCAL(modpng14_ptr, info_ptr, unit, width, height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are doubles) - png_set_sCAL_s(png_ptr, info_ptr, unit, width, height) + modpng14_set_sCAL_s(modpng14_ptr, info_ptr, unit, width, height) unit - physical scale units (an integer) width - width of a pixel in physical scale units height - height of a pixel in physical scale units (width and height are strings like "2.54") - png_set_unknown_chunks(png_ptr, info_ptr, &unknowns, + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, &unknowns, num_unknowns) - unknowns - array of png_unknown_chunk + unknowns - array of modpng14_unknown_chunk structures holding unknown chunks unknowns[i].name - name of unknown chunk unknowns[i].data - data of unknown chunk unknowns[i].size - size of unknown chunk's data unknowns[i].location - position to write chunk in file 0: do not write chunk - PNG_HAVE_IHDR: before PLTE - PNG_HAVE_PLTE: before IDAT - PNG_AFTER_IDAT: after IDAT + MODPNG14_HAVE_IHDR: before PLTE + MODPNG14_HAVE_PLTE: before IDAT + MODPNG14_AFTER_IDAT: after IDAT The "location" member is set automatically according to what part of the output file has already been written. -You can change its value after calling png_set_unknown_chunks() +You can change its value after calling modpng14_set_unknown_chunks() as demonstrated in pngtest.c. Within each of the "locations", the chunks are sequenced according to their position in the structure (that is, the value of "i", which is the order in which the chunk was either read from the input file or defined with -png_set_unknown_chunks). +modpng14_set_unknown_chunks). -A quick word about text and num_text. text is an array of png_text +A quick word about text and num_text. text is an array of modpng14_text structures. num_text is the number of valid structures in the array. -Each png_text structure holds a language code, a keyword, a text value, +Each modpng14_text structure holds a language code, a keyword, a text value, and a compression type. The compression types have the same valid numbers as the compression types of the image data. Currently, the only valid number is zero. However, you can store text either compressed or uncompressed, unlike images, which always have to be compressed. So if you don't want the -text compressed, set the compression type to PNG_TEXT_COMPRESSION_NONE. +text compressed, set the compression type to MODPNG14_TEXT_COMPRESSION_NONE. Because tEXt and zTXt chunks don't have a language field, if you -specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt +specify MODPNG14_TEXT_COMPRESSION_NONE or MODPNG14_TEXT_COMPRESSION_zTXt any language code or translated keyword will not be written out. Until text gets around 1000 bytes, it is not worth compressing it. After the text has been written out to the file, the compression type -is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, +is set to MODPNG14_TEXT_COMPRESSION_NONE_WR or MODPNG14_TEXT_COMPRESSION_zTXt_WR, so that it isn't written out again at the end (in case you are calling -png_write_end() with the same struct. +modpng14_write_end() with the same struct. The keywords that are given in the PNG Specification are: @@ -1890,11 +1890,11 @@ Compressed pairs must have a text string, as only the text string is compressed anyway, so the compression would be meaningless. -PNG supports modification time via the png_time structure. Two -conversion routines are provided, png_convert_from_time_t() for -time_t and png_convert_from_struct_tm() for struct tm. The +PNG supports modification time via the modpng14_time structure. Two +conversion routines are provided, modpng14_convert_from_time_t() for +time_t and modpng14_convert_from_struct_tm() for struct tm. The time_t routine uses gmtime(). You don't have to use either of -these, but if you wish to fill in the png_time structure directly, +these, but if you wish to fill in the modpng14_time structure directly, you should provide the time in universal time (GMT) if possible instead of your local time. Note that the year number is the full year (e.g. 1998, rather than 98 - PNG is year 2000 compliant!), and @@ -1911,15 +1911,15 @@ although this isn't a requirement. Unlike the tIME chunk, the "Creation Time" tEXt chunk is not expected to be automatically changed by the software. To facilitate the use of RFC 1123 dates, a function -png_convert_to_rfc1123(png_timep) is provided to convert from PNG +modpng14_convert_to_rfc1123(modpng14_timep) is provided to convert from PNG time to an RFC 1123 format string. Writing unknown chunks -You can use the png_set_unknown_chunks function to queue up chunks +You can use the modpng14_set_unknown_chunks function to queue up chunks for writing. You give it a chunk name, raw data, and a size; that's all there is to it. The chunks will be written by the next following -png_write_info_before_PLTE, png_write_info, or png_write_end function. +modpng14_write_info_before_PLTE, modpng14_write_info, or modpng14_write_end function. Any chunks previously read into the info structure's unknown-chunk list will also be written out in a sequence that satisfies the PNG specification's ordering rules. @@ -1932,31 +1932,31 @@ in the info structure. All defined output transformations are permitted, enabled by the following masks. - PNG_TRANSFORM_IDENTITY No transformation - PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples - PNG_TRANSFORM_PACKSWAP Change order of packed + MODPNG14_TRANSFORM_IDENTITY No transformation + MODPNG14_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples + MODPNG14_TRANSFORM_PACKSWAP Change order of packed pixels to LSB first - PNG_TRANSFORM_INVERT_MONO Invert monochrome images - PNG_TRANSFORM_SHIFT Normalize pixels to the + MODPNG14_TRANSFORM_INVERT_MONO Invert monochrome images + MODPNG14_TRANSFORM_SHIFT Normalize pixels to the sBIT depth - PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + MODPNG14_TRANSFORM_BGR Flip RGB to BGR, RGBA to BGRA - PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + MODPNG14_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA to AG - PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + MODPNG14_TRANSFORM_INVERT_ALPHA Change alpha from opacity to transparency - PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples - PNG_TRANSFORM_STRIP_FILLER Strip out filler bytes. + MODPNG14_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + MODPNG14_TRANSFORM_STRIP_FILLER Strip out filler bytes. If you have valid image data in the info structure (you can use -png_set_rows() to put image data in the info structure), simply do this: +modpng14_set_rows() to put image data in the info structure), simply do this: - png_write_png(png_ptr, info_ptr, png_transforms, NULL) + modpng14_write_png(modpng14_ptr, info_ptr, modpng14_transforms, NULL) -where png_transforms is an integer containing the logical OR of some set of -transformation flags. This call is equivalent to png_write_info(), +where modpng14_transforms is an integer containing the logical OR of some set of +transformation flags. This call is equivalent to modpng14_write_info(), followed the set of transformations indicated by the transform mask, -then png_write_image(), and finally png_write_end(). +then modpng14_write_image(), and finally modpng14_write_end(). (The final parameter of this call is not yet used. Someday it might point to transformation parameters required by some future output transform.) @@ -1965,34 +1965,34 @@ If you are going the low-level route instead, you are now ready to write all the file information up to the actual image data. You do -this with a call to png_write_info(). +this with a call to modpng14_write_info(). - png_write_info(png_ptr, info_ptr); + modpng14_write_info(modpng14_ptr, info_ptr); Note that there is one transformation you may need to do before -png_write_info(). In PNG files, the alpha channel in an image is the +modpng14_write_info(). In PNG files, the alpha channel in an image is the level of opacity. If your data is supplied as a level of transparency, you can invert the alpha channel before you write it, so that 0 is fully transparent and 255 (in 8-bit or paletted images) or 65535 (in 16-bit images) is fully opaque, with - png_set_invert_alpha(png_ptr); + modpng14_set_invert_alpha(modpng14_ptr); -This must appear before png_write_info() instead of later with the +This must appear before modpng14_write_info() instead of later with the other transformations because in the case of paletted images the tRNS chunk data has to be inverted before the tRNS chunk is written. If your image is not a paletted image, the tRNS data (which in such cases represents a single color to be rendered as transparent) won't need to be changed, and you can safely do this transformation after your -png_write_info() call. +modpng14_write_info() call. If you need to write a private chunk that you want to appear before the PLTE chunk when PLTE is present, you can write the PNG info in two steps, and insert code to write your own chunk between them: - png_write_info_before_PLTE(png_ptr, info_ptr); - png_set_unknown_chunks(png_ptr, info_ptr, ...); - png_write_info(png_ptr, info_ptr); + modpng14_write_info_before_PLTE(modpng14_ptr, info_ptr); + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, ...); + modpng14_write_info(modpng14_ptr, info_ptr); After you've written the file information, you can set up the library to handle any special transformations of the image data. The various @@ -2009,10 +2009,10 @@ to 3 or 6 bytes (or strip 2 or 4-byte grayscale+filler data to 1 or 2 bytes per pixel). - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + modpng14_set_filler(modpng14_ptr, 0, MODPNG14_FILLER_BEFORE); -where the 0 is unused, and the location is either PNG_FILLER_BEFORE or -PNG_FILLER_AFTER, depending upon whether the filler byte in the pixel +where the 0 is unused, and the location is either MODPNG14_FILLER_BEFORE or +MODPNG14_FILLER_AFTER, depending upon whether the filler byte in the pixel is stored XRGB or RGBX. PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as @@ -2020,14 +2020,14 @@ If the data is supplied at 1 pixel per byte, use this code, which will correctly pack the pixels into a single byte: - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If your data is of another bit depth, you can write an sBIT chunk into the file so that decoders can recover the original data if desired. /* Set the true bit depth of the image data */ - if (color_type & PNG_COLOR_MASK_COLOR) + if (color_type & MODPNG14_COLOR_MASK_COLOR) { sig_bit.red = true_bit_depth; sig_bit.green = true_bit_depth; @@ -2037,19 +2037,19 @@ { sig_bit.gray = true_bit_depth; } - if (color_type & PNG_COLOR_MASK_ALPHA) + if (color_type & MODPNG14_COLOR_MASK_ALPHA) { sig_bit.alpha = true_bit_depth; } - png_set_sBIT(png_ptr, info_ptr, &sig_bit); + modpng14_set_sBIT(modpng14_ptr, info_ptr, &sig_bit); If the data is stored in the row buffer in a bit depth other than one supported by PNG (e.g. 3 bit data in the range 0-7 for a 4-bit PNG), this will scale the values to appear to be the correct bit depth as is required by PNG. - png_set_shift(png_ptr, &sig_bit); + modpng14_set_shift(modpng14_ptr, &sig_bit); PNG files store 16 bit pixels in network byte order (big-endian, ie. most significant bits first). This code would be used if they are @@ -2057,36 +2057,36 @@ first, the way PCs store them): if (bit_depth > 8) - png_set_swap(png_ptr); + modpng14_set_swap(modpng14_ptr); If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you need to change the order the pixels are packed into bytes, you can use: if (bit_depth < 8) - png_set_packswap(png_ptr); + modpng14_set_packswap(modpng14_ptr); PNG files store 3 color pixels in red, green, blue order. This code would be used if they are supplied as blue, green, red: - png_set_bgr(png_ptr); + modpng14_set_bgr(modpng14_ptr); PNG files describe monochrome as black being zero and white being one. This code would be used if the pixels are supplied with this reversed (black being one and white being zero): - png_set_invert_mono(png_ptr); + modpng14_set_invert_mono(modpng14_ptr); Finally, you can write your own transformation function if none of the existing ones meets your needs. This is done by setting a callback with - png_set_write_user_transform_fn(png_ptr, + modpng14_set_write_user_transform_fn(modpng14_ptr, write_transform_fn); You must supply the function - void write_transform_fn(png_ptr ptr, row_info_ptr - row_info, png_bytep data) + void write_transform_fn(modpng14_ptr ptr, row_info_ptr + row_info, modpng14_bytep data) See pngtest.c for a working example. Your function will be called before any of the other transformations are processed. @@ -2094,33 +2094,33 @@ You can also set up a pointer to a user structure for use by your callback function. - png_set_user_transform_info(png_ptr, user_ptr, 0, 0); + modpng14_set_user_transform_info(modpng14_ptr, user_ptr, 0, 0); The user_channels and user_depth parameters of this function are ignored when writing; you can set them to zero as shown. -You can retrieve the pointer via the function png_get_user_transform_ptr(). +You can retrieve the pointer via the function modpng14_get_user_transform_ptr(). For example: voidp write_user_transform_ptr = - png_get_user_transform_ptr(png_ptr); + modpng14_get_user_transform_ptr(modpng14_ptr); -It is possible to have libpng flush any pending output, either manually, +It is possible to have libmodpng14 flush any pending output, either manually, or automatically after a certain number of lines have been written. To flush the output stream a single time call: - png_write_flush(png_ptr); + modpng14_write_flush(modpng14_ptr); -and to have libpng flush the output stream periodically after a certain +and to have libmodpng14 flush the output stream periodically after a certain number of scanlines have been written, call: - png_set_flush(png_ptr, nrows); + modpng14_set_flush(modpng14_ptr, nrows); -Note that the distance between rows is from the last time png_write_flush() +Note that the distance between rows is from the last time modpng14_write_flush() was called, or the first row of the image if it has never been called. -So if you write 50 lines, and then png_set_flush 25, it will flush the +So if you write 50 lines, and then modpng14_set_flush 25, it will flush the output on the next scanline, and every 25 lines thereafter, unless -png_write_flush() is called before 25 more lines have been written. +modpng14_write_flush() is called before 25 more lines have been written. If nrows is too small (less than about 10 lines for a 640 pixel wide RGB image) the image compression may decrease noticeably (although this may be acceptable for real-time applications). Infrequent flushing will @@ -2131,61 +2131,61 @@ That's it for the transformations. Now you can write the image data. The simplest way to do this is in one function call. If you have the -whole image in memory, you can just call png_write_image() and libpng +whole image in memory, you can just call modpng14_write_image() and libmodpng14 will write the image. You will need to pass in an array of pointers to each row. This function automatically handles interlacing, so you don't -need to call png_set_interlace_handling() or call this function multiple -times, or any of that other stuff necessary with png_write_rows(). +need to call modpng14_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with modpng14_write_rows(). - png_write_image(png_ptr, row_pointers); + modpng14_write_image(modpng14_ptr, row_pointers); where row_pointers is: - png_byte *row_pointers[height]; + modpng14_byte *row_pointers[height]; You can point to void or char or whatever you use for pixels. If you don't want to write the whole image at once, you can -use png_write_rows() instead. If the file is not interlaced, +use modpng14_write_rows() instead. If the file is not interlaced, this is simple: - png_write_rows(png_ptr, row_pointers, + modpng14_write_rows(modpng14_ptr, row_pointers, number_of_rows); -row_pointers is the same as in the png_write_image() call. +row_pointers is the same as in the modpng14_write_image() call. If you are just writing one row at a time, you can do this with a single row_pointer instead of an array of row_pointers: - png_bytep row_pointer = row; + modpng14_bytep row_pointer = row; - png_write_row(png_ptr, row_pointer); + modpng14_write_row(modpng14_ptr, row_pointer); When the file is interlaced, things can get a good deal more complicated. The only currently (as of the PNG Specification version 1.2, dated July 1999) defined interlacing scheme for PNG files is the "Adam7" interlace scheme, that breaks down an -image into seven smaller images of varying size. libpng will build +image into seven smaller images of varying size. libmodpng14 will build these images for you, or you can do them yourself. If you want to build them yourself, see the PNG specification for details of which pixels to write when. -If you don't want libpng to handle the interlacing details, just -use png_set_interlace_handling() and call png_write_rows() the +If you don't want libmodpng14 to handle the interlacing details, just +use modpng14_set_interlace_handling() and call modpng14_write_rows() the correct number of times to write all seven sub-images. -If you want libpng to build the sub-images, call this before you start +If you want libmodpng14 to build the sub-images, call this before you start writing any rows: number_of_passes = - png_set_interlace_handling(png_ptr); + modpng14_set_interlace_handling(modpng14_ptr); This will return the number of passes needed. Currently, this is seven, but may change if another interlace type is added. Then write the complete image number_of_passes times. - png_write_rows(png_ptr, row_pointers, + modpng14_write_rows(modpng14_ptr, row_pointers, number_of_rows); As some of these rows are not used, and thus return immediately, @@ -2196,34 +2196,34 @@ After you are finished writing the image, you should finish writing the file. If you are interested in writing comments or time, you should -pass an appropriately filled png_info pointer. If you are not interested, +pass an appropriately filled modpng14_info pointer. If you are not interested, you can pass NULL. - png_write_end(png_ptr, info_ptr); + modpng14_write_end(modpng14_ptr, info_ptr); -When you are done, you can free all memory used by libpng like this: +When you are done, you can free all memory used by libmodpng14 like this: - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); It is also possible to individually free the info_ptr members that -point to libpng-allocated storage with the following function: +point to libmodpng14-allocated storage with the following function: - png_free_data(png_ptr, info_ptr, mask, seq) + modpng14_free_data(modpng14_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask containing the logical OR of one or more of - PNG_FREE_PLTE, PNG_FREE_TRNS, - PNG_FREE_HIST, PNG_FREE_ICCP, - PNG_FREE_PCAL, PNG_FREE_ROWS, - PNG_FREE_SCAL, PNG_FREE_SPLT, - PNG_FREE_TEXT, PNG_FREE_UNKN, - or simply PNG_FREE_ALL + MODPNG14_FREE_PLTE, MODPNG14_FREE_TRNS, + MODPNG14_FREE_HIST, MODPNG14_FREE_ICCP, + MODPNG14_FREE_PCAL, MODPNG14_FREE_ROWS, + MODPNG14_FREE_SCAL, MODPNG14_FREE_SPLT, + MODPNG14_FREE_TEXT, MODPNG14_FREE_UNKN, + or simply MODPNG14_FREE_ALL seq - sequence number of item to be freed (-1 for all items) This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those +by the user and not by libmodpng14, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not -1, and multiple items are allowed for the data type identified in @@ -2231,31 +2231,31 @@ is freed, where n is "seq". If you allocated data such as a palette that you passed -in to libpng with png_set_*, you must not free it until just before the call to -png_destroy_write_struct(). +in to libmodpng14 with modpng14_set_*, you must not free it until just before the call to +modpng14_destroy_write_struct(). The default behavior is only to free data that was allocated internally -by libpng. This can be changed, so that libpng will not free the data, -or so that it will free data that was allocated by the user with png_malloc() -or png_zalloc() and passed in via a png_set_*() function, with +by libmodpng14. This can be changed, so that libmodpng14 will not free the data, +or so that it will free data that was allocated by the user with modpng14_malloc() +or modpng14_zalloc() and passed in via a modpng14_set_*() function, with - png_data_freer(png_ptr, info_ptr, freer, mask) + modpng14_data_freer(modpng14_ptr, info_ptr, freer, mask) mask - which data elements are affected - same choices as in png_free_data() + same choices as in modpng14_free_data() freer - one of - PNG_DESTROY_WILL_FREE_DATA - PNG_SET_WILL_FREE_DATA - PNG_USER_WILL_FREE_DATA + MODPNG14_DESTROY_WILL_FREE_DATA + MODPNG14_SET_WILL_FREE_DATA + MODPNG14_USER_WILL_FREE_DATA For example, to transfer responsibility for some data from a read structure to a write structure, you could use - png_data_freer(read_ptr, read_info_ptr, - PNG_USER_WILL_FREE_DATA, - PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) - png_data_freer(write_ptr, write_info_ptr, - PNG_DESTROY_WILL_FREE_DATA, - PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + modpng14_data_freer(read_ptr, read_info_ptr, + MODPNG14_USER_WILL_FREE_DATA, + MODPNG14_FREE_PLTE|MODPNG14_FREE_tRNS|MODPNG14_FREE_hIST) + modpng14_data_freer(write_ptr, write_info_ptr, + MODPNG14_DESTROY_WILL_FREE_DATA, + MODPNG14_FREE_PLTE|MODPNG14_FREE_tRNS|MODPNG14_FREE_hIST) thereby briefly reassigning responsibility for freeing to the user but immediately afterwards reassigning it once more to the write_destroy @@ -2264,28 +2264,28 @@ structure. This function only affects data that has already been allocated. -You can call this function before calling after the png_set_*() functions -to control whether the user or png_destroy_*() is supposed to free the data. -When the user assumes responsibility for libpng-allocated data, the +You can call this function before calling after the modpng14_set_*() functions +to control whether the user or modpng14_destroy_*() is supposed to free the data. +When the user assumes responsibility for libmodpng14-allocated data, the application must use -png_free() to free it, and when the user transfers responsibility to libpng -for data that the user has allocated, the user must have used png_malloc() -or png_zalloc() to allocate it. +modpng14_free() to free it, and when the user transfers responsibility to libmodpng14 +for data that the user has allocated, the user must have used modpng14_malloc() +or modpng14_zalloc() to allocate it. If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword -separately, do not transfer responsibility for freeing text_ptr to libpng, -because when libpng fills a png_text structure it combines these members with -the key member, and png_free_data() will free only text_ptr.key. Similarly, -if you transfer responsibility for free'ing text_ptr from libpng to your +separately, do not transfer responsibility for freeing text_ptr to libmodpng14, +because when libmodpng14 fills a modpng14_text structure it combines these members with +the key member, and modpng14_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libmodpng14 to your application, your application must not separately free those members. For a more compact example of writing a PNG image, see the file example.c. -V. Modifying/Customizing libpng: +V. Modifying/Customizing libmodpng14: -There are three issues here. The first is changing how libpng does +There are three issues here. The first is changing how libmodpng14 does standard things like memory allocation, input/output, and error handling. The second deals with more complicated things like adding new chunks, -adding new transformations, and generally changing how libpng works. +adding new transformations, and generally changing how libmodpng14 works. Both of those are compile-time issues; that is, they are generally determined at the time the code is written, and there is rarely a need to provide the user with a means of changing them. The third is a @@ -2296,99 +2296,99 @@ Memory allocation, input/output, and error handling -All of the memory allocation, input/output, and error handling in libpng +All of the memory allocation, input/output, and error handling in libmodpng14 goes through callbacks that are user-settable. The default routines are in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change -these functions, call the appropriate png_set_*_fn() function. +these functions, call the appropriate modpng14_set_*_fn() function. -Memory allocation is done through the functions png_malloc() -and png_free(). These currently just call the standard C functions. If +Memory allocation is done through the functions modpng14_malloc() +and modpng14_free(). These currently just call the standard C functions. If your pointers can't access more then 64K at a time, you will want to set MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling memory allocation on a platform will change between applications, these functions must be modified in the library at compile time. If you prefer to use a different method of allocating and freeing data, you can use -png_create_read_struct_2() or png_create_write_struct_2() to register +modpng14_create_read_struct_2() or modpng14_create_write_struct_2() to register your own functions as described above. These functions also provide a void pointer that can be retrieved via - mem_ptr=png_get_mem_ptr(png_ptr); + mem_ptr=modpng14_get_mem_ptr(modpng14_ptr); Your replacement memory functions must have prototypes as follows: - png_voidp malloc_fn(png_structp png_ptr, - png_size_t size); - void free_fn(png_structp png_ptr, png_voidp ptr); + modpng14_voidp malloc_fn(modpng14_structp modpng14_ptr, + modpng14_size_t size); + void free_fn(modpng14_structp modpng14_ptr, modpng14_voidp ptr); -Your malloc_fn() should return NULL in case of failure. The png_malloc() -function will call png_error() if it receives a NULL from the system +Your malloc_fn() should return NULL in case of failure. The modpng14_malloc() +function will call modpng14_error() if it receives a NULL from the system memory allocator or from your replacement malloc_fn(). -Input/Output in libpng is done through png_read() and png_write(), +Input/Output in libmodpng14 is done through modpng14_read() and modpng14_write(), which currently just call fread() and fwrite(). The FILE * is stored in -png_struct and is initialized via png_init_io(). If you wish to change +modpng14_struct and is initialized via modpng14_init_io(). If you wish to change the method of I/O, the library supplies callbacks that you can set -through the function png_set_read_fn() and png_set_write_fn() at run -time, instead of calling the png_init_io() function. These functions +through the function modpng14_set_read_fn() and modpng14_set_write_fn() at run +time, instead of calling the modpng14_init_io() function. These functions also provide a void pointer that can be retrieved via the function -png_get_io_ptr(). For example: +modpng14_get_io_ptr(). For example: - png_set_read_fn(png_structp read_ptr, - voidp read_io_ptr, png_rw_ptr read_data_fn) + modpng14_set_read_fn(modpng14_structp read_ptr, + voidp read_io_ptr, modpng14_rw_ptr read_data_fn) - png_set_write_fn(png_structp write_ptr, - voidp write_io_ptr, png_rw_ptr write_data_fn, - png_flush_ptr output_flush_fn); + modpng14_set_write_fn(modpng14_structp write_ptr, + voidp write_io_ptr, modpng14_rw_ptr write_data_fn, + modpng14_flush_ptr output_flush_fn); - voidp read_io_ptr = png_get_io_ptr(read_ptr); - voidp write_io_ptr = png_get_io_ptr(write_ptr); + voidp read_io_ptr = modpng14_get_io_ptr(read_ptr); + voidp write_io_ptr = modpng14_get_io_ptr(write_ptr); The replacement I/O functions must have prototypes as follows: - void user_read_data(png_structp png_ptr, - png_bytep data, png_size_t length); - void user_write_data(png_structp png_ptr, - png_bytep data, png_size_t length); - void user_flush_data(png_structp png_ptr); + void user_read_data(modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length); + void user_write_data(modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length); + void user_flush_data(modpng14_structp modpng14_ptr); Supplying NULL for the read, write, or flush functions sets them back to using the default C stream functions. It is an error to read from a write stream, and vice versa. -Error handling in libpng is done through png_error() and png_warning(). -Errors handled through png_error() are fatal, meaning that png_error() +Error handling in libmodpng14 is done through modpng14_error() and modpng14_warning(). +Errors handled through modpng14_error() are fatal, meaning that modpng14_error() should never return to its caller. Currently, this is handled via -setjmp() and longjmp() (unless you have compiled libpng with -PNG_SETJMP_NOT_SUPPORTED, in which case it is handled via PNG_ABORT()), +setjmp() and longjmp() (unless you have compiled libmodpng14 with +MODPNG14_SETJMP_NOT_SUPPORTED, in which case it is handled via MODPNG14_ABORT()), but you could change this to do things like exit() if you should wish. -On non-fatal errors, png_warning() is called +On non-fatal errors, modpng14_warning() is called to print a warning message, and then control returns to the calling code. -By default png_error() and png_warning() print a message on stderr via -fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined -(because you don't want the messages) or PNG_NO_STDIO defined (because +By default modpng14_error() and modpng14_warning() print a message on stderr via +fprintf() unless the library is compiled with MODPNG14_NO_CONSOLE_IO defined +(because you don't want the messages) or MODPNG14_NO_STDIO defined (because fprintf() isn't available). If you wish to change the behavior of the error functions, you will need to set up your own message callbacks. These -functions are normally supplied at the time that the png_struct is created. +functions are normally supplied at the time that the modpng14_struct is created. It is also possible to redirect errors and warnings to your own replacement -functions after png_create_*_struct() has been called by calling: +functions after modpng14_create_*_struct() has been called by calling: - png_set_error_fn(png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warning_fn); + modpng14_set_error_fn(modpng14_structp modpng14_ptr, + modpng14_voidp error_ptr, modpng14_error_ptr error_fn, + modpng14_error_ptr warning_fn); - png_voidp error_ptr = png_get_error_ptr(png_ptr); + modpng14_voidp error_ptr = modpng14_get_error_ptr(modpng14_ptr); -If NULL is supplied for either error_fn or warning_fn, then the libpng +If NULL is supplied for either error_fn or warning_fn, then the libmodpng14 default function will be used, calling fprintf() and/or longjmp() if a problem is encountered. The replacement error functions should have parameters as follows: - void user_error_fn(png_structp png_ptr, - png_const_charp error_msg); - void user_warning_fn(png_structp png_ptr, - png_const_charp warning_msg); + void user_error_fn(modpng14_structp modpng14_ptr, + modpng14_const_charp error_msg); + void user_warning_fn(modpng14_structp modpng14_ptr, + modpng14_const_charp warning_msg); The motivation behind using setjmp() and longjmp() is the C++ throw and catch exception handling methods. This makes the code much easier to write, @@ -2402,7 +2402,7 @@ Custom chunks If you need to read or write custom chunks, you may need to get deeper -into the libpng code. The library now has mechanisms for storing +into the libmodpng14 code. The library now has mechanisms for storing and writing chunks of unknown type; you can even declare callbacks for custom chunks. Hoewver, this may not be good enough if the library code itself needs to know about interactions between your @@ -2413,11 +2413,11 @@ understanding of how it works. Pay particular attention to the sections that describe chunk names, and look at how other chunks were designed, so you can do things similarly. Second, check out the -sections of libpng that read and write chunks. Try to find a chunk +sections of libmodpng14 that read and write chunks. Try to find a chunk that is similar to yours and use it as a template. More details can be found in the comments inside the code. It is best to handle unknown chunks in a generic method, via callback functions, instead of by -modifying libpng functions. +modifying libmodpng14 functions. If you wish to write your own transformation for the data, look through the part of the code that does the transformations, and check out some of @@ -2427,43 +2427,43 @@ Configuring for 16 bit platforms -You will want to look into zconf.h to tell zlib (and thus libpng) that +You will want to look into zconf.h to tell zlib (and thus libmodpng14) that it cannot allocate more then 64K at a time. Even if you can, the memory -won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K. +won't be accessible. So limit zlib and libmodpng14 to 64K by defining MAXSEG_64K. Configuring for DOS For DOS users who only have access to the lower 640K, you will -have to limit zlib's memory usage via a png_set_compression_mem_level() +have to limit zlib's memory usage via a modpng14_set_compression_mem_level() call. See zlib.h or zconf.h in the zlib library for more information. Configuring for Medium Model Libpng's support for medium model has been tested on most of the popular compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets -defined, and FAR gets defined to far in pngconf.h, and you should be +defined, and FAR gets defined to far in modpng14conf.h, and you should be all set. Everything in the library (except for zlib's structure) is expecting far data. You must use the typedefs with the p or pp on the end for pointers (or at least look at them and be careful). Make -note that the rows of data are defined as png_bytepp, which is an +note that the rows of data are defined as modpng14_bytepp, which is an unsigned char far * far *. Configuring for gui/windowing platforms: You will need to write new error and warning functions that use the GUI interface, as described previously, and set them to be the error and -warning functions at the time that png_create_*_struct() is called, +warning functions at the time that modpng14_create_*_struct() is called, in order to have them available during the structure initialization. -They can be changed later via png_set_error_fn(). On some compilers, -you may also have to change the memory allocators (png_malloc, etc.). +They can be changed later via modpng14_set_error_fn(). On some compilers, +you may also have to change the memory allocators (modpng14_malloc, etc.). Configuring for compiler xxx: -All includes for libpng are in pngconf.h. If you need to add/change/delete +All includes for libmodpng14 are in modpng14conf.h. If you need to add/change/delete an include, this is the place to do it. The includes that are not -needed outside libpng are protected by the PNG_INTERNAL definition, -which is only defined for those routines inside libpng itself. The -files in libpng proper only include png.h, which includes pngconf.h. +needed outside libmodpng14 are protected by the MODPNG14_INTERNAL definition, +which is only defined for those routines inside libmodpng14 itself. The +files in libmodpng14 proper only include modpng14.h, which includes modpng14conf.h. Configuring zlib: @@ -2479,7 +2479,7 @@ files larger than just storing the raw bitmap. You can specify the compression level by calling: - png_set_compression_level(png_ptr, level); + modpng14_set_compression_level(modpng14_ptr, level); Another useful one is to reduce the memory level used by the library. The memory level defaults to 8, but it can be lowered if you are @@ -2489,22 +2489,22 @@ data being emitted in smaller stored blocks, with a correspondingly larger relative overhead of up to 15% in the worst case. - png_set_compression_mem_level(png_ptr, level); + modpng14_set_compression_mem_level(modpng14_ptr, level); The other functions are for configuring zlib. They are not recommended for normal use and may result in writing an invalid PNG file. See zlib.h for more information on what these mean. - png_set_compression_strategy(png_ptr, + modpng14_set_compression_strategy(modpng14_ptr, strategy); - png_set_compression_window_bits(png_ptr, + modpng14_set_compression_window_bits(modpng14_ptr, window_bits); - png_set_compression_method(png_ptr, method); - png_set_compression_buffer_size(png_ptr, size); + modpng14_set_compression_method(modpng14_ptr, method); + modpng14_set_compression_buffer_size(modpng14_ptr, size); Controlling row filtering -If you want to control whether libpng uses filtering or not, which +If you want to control whether libmodpng14 uses filtering or not, which filters are used, and how it goes about picking row filters, you can call one of these functions. The selection and configuration of row filters can have a significant impact on the size and @@ -2516,48 +2516,48 @@ The 'method' parameter sets the main filtering method, which is currently only '0' in the PNG 1.2 specification. The 'filters' parameter sets which filter(s), if any, should be used for each -scanline. Possible values are PNG_ALL_FILTERS and PNG_NO_FILTERS +scanline. Possible values are MODPNG14_ALL_FILTERS and MODPNG14_NO_FILTERS to turn filtering on and off, respectively. -Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB, -PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise +Individual filter types are MODPNG14_FILTER_NONE, MODPNG14_FILTER_SUB, +MODPNG14_FILTER_UP, MODPNG14_FILTER_AVG, MODPNG14_FILTER_PAETH, which can be bitwise ORed together with '|' to specify one or more filters to use. These filters are described in more detail in the PNG specification. If you intend to change the filter type during the course of writing the image, you should start with flags set for all of the filters -you intend to use so that libpng can initialize its internal +you intend to use so that libmodpng14 can initialize its internal structures appropriately for all of the filter types. (Note that this -means the first row must always be adaptively filtered, because libpng -currently does not allocate the filter buffers until png_write_row() +means the first row must always be adaptively filtered, because libmodpng14 +currently does not allocate the filter buffers until modpng14_write_row() is called for the first time.) - filters = PNG_FILTER_NONE | PNG_FILTER_SUB - PNG_FILTER_UP | PNG_FILTER_AVE | - PNG_FILTER_PAETH | PNG_ALL_FILTERS; + filters = MODPNG14_FILTER_NONE | MODPNG14_FILTER_SUB + MODPNG14_FILTER_UP | MODPNG14_FILTER_AVE | + MODPNG14_FILTER_PAETH | MODPNG14_ALL_FILTERS; - png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, + modpng14_set_filter(modpng14_ptr, MODPNG14_FILTER_TYPE_BASE, filters); The second parameter can also be - PNG_INTRAPIXEL_DIFFERENCING if you are + MODPNG14_INTRAPIXEL_DIFFERENCING if you are writing a PNG to be embedded in a MNG datastream. This parameter must be the same as the value of filter_method used - in png_set_IHDR(). + in modpng14_set_IHDR(). -It is also possible to influence how libpng chooses from among the +It is also possible to influence how libmodpng14 chooses from among the available filters. This is done in one or both of two ways - by telling it how important it is to keep the same filter for successive rows, and by telling it the relative computational costs of the filters. double weights[3] = {1.5, 1.3, 1.1}, - costs[PNG_FILTER_VALUE_LAST] = + costs[MODPNG14_FILTER_VALUE_LAST] = {1.0, 1.3, 1.3, 1.5, 1.7}; - png_set_filter_heuristics(png_ptr, - PNG_FILTER_HEURISTIC_WEIGHTED, 3, + modpng14_set_filter_heuristics(modpng14_ptr, + MODPNG14_FILTER_HEURISTIC_WEIGHTED, 3, weights, costs); -The weights are multiplying factors that indicate to libpng that the +The weights are multiplying factors that indicate to libmodpng14 that the row filter should be the same for successive rows unless another row filter is that many times better than the previous filter. In the above example, if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a @@ -2581,25 +2581,25 @@ Removing unwanted object code -There are a bunch of #define's in pngconf.h that control what parts of -libpng are compiled. All the defines end in _SUPPORTED. If you are +There are a bunch of #define's in modpng14conf.h that control what parts of +libmodpng14 are compiled. All the defines end in _SUPPORTED. If you are never going to use a capability, you can change the #define to #undef -before recompiling libpng and save yourself code and data space, or +before recompiling libmodpng14 and save yourself code and data space, or you can turn off individual capabilities with defines that begin with -PNG_NO_. +MODPNG14_NO_. You can also turn all of the transforms and ancillary chunk capabilities off en masse with compiler directives that define -PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS, +MODPNG14_NO_READ[or WRITE]_TRANSFORMS, or MODPNG14_NO_READ[or WRITE]_ANCILLARY_CHUNKS, or all four, along with directives to turn on any of the capabilities that you do -want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable +want. The MODPNG14_NO_READ[or WRITE]_TRANSFORMS directives disable the extra transformations but still leave the library fully capable of reading and writing PNG files with all known public chunks -Use of the PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive +Use of the MODPNG14_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library that is incapable of reading or writing ancillary chunks. If you are not using the progressive reading capability, you can -turn that off with PNG_NO_PROGRESSIVE_READ (don't confuse +turn that off with MODPNG14_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING capability, which you'll still have). All the reading and writing specific code are in separate files, so the @@ -2619,44 +2619,44 @@ Requesting debug printout -The macro definition PNG_DEBUG can be used to request debugging +The macro definition MODPNG14_DEBUG can be used to request debugging printout. Set it to an integer value in the range 0 to 3. Higher numbers result in increasing amounts of debugging information. The information is printed to the "stderr" file, unless another file -name is specified in the PNG_DEBUG_FILE macro definition. +name is specified in the MODPNG14_DEBUG_FILE macro definition. -When PNG_DEBUG > 0, the following functions (macros) become available: +When MODPNG14_DEBUG > 0, the following functions (macros) become available: - png_debug(level, message) - png_debug1(level, message, p1) - png_debug2(level, message, p1, p2) + modpng14_debug(level, message) + modpng14_debug1(level, message, p1) + modpng14_debug2(level, message, p1, p2) -in which "level" is compared to PNG_DEBUG to decide whether to print +in which "level" is compared to MODPNG14_DEBUG to decide whether to print the message, "message" is the formatted string to be printed, and p1 and p2 are parameters that are to be embedded in the string according to printf-style formatting directives. For example, - png_debug1(2, "foo=%d\n", foo); + modpng14_debug1(2, "foo=%d\n", foo); is expanded to - if(PNG_DEBUG > 2) - fprintf(PNG_DEBUG_FILE, "foo=%d\n", foo); + if(MODPNG14_DEBUG > 2) + fprintf(MODPNG14_DEBUG_FILE, "foo=%d\n", foo); -When PNG_DEBUG is defined but is zero, the macros aren't defined, but you -can still use PNG_DEBUG to control your own debugging: +When MODPNG14_DEBUG is defined but is zero, the macros aren't defined, but you +can still use MODPNG14_DEBUG to control your own debugging: - #ifdef PNG_DEBUG + #ifdef MODPNG14_DEBUG fprintf(stderr, ... #endif -When PNG_DEBUG = 1, the macros are defined, but only png_debug statements +When MODPNG14_DEBUG = 1, the macros are defined, but only modpng14_debug statements having level = 0 will be printed. There aren't any such statements in -this version of libpng, but if you insert some they will be printed. +this version of libmodpng14, but if you insert some they will be printed. VI. Runtime optimization -A new feature in libpng 1.2.0 is the ability to dynamically switch between +A new feature in libmodpng14 1.2.0 is the ability to dynamically switch between standard and optimized versions of some routines. Currently these are limited to three computationally intensive tasks when reading PNG files: decoding row filters, expanding interlacing, and combining interlaced or @@ -2664,45 +2664,45 @@ versions are available only for x86 (Intel, AMD, etc.) platforms with MMX support, though this may change in future versions. (For example, the non-MMX assembler optimizations for zlib might become similarly -runtime-selectable in future releases, in which case libpng could be +runtime-selectable in future releases, in which case libmodpng14 could be extended to support them. Alternatively, the compile-time choice of floating-point versus integer routines for gamma correction might become runtime-selectable.) Because such optimizations tend to be very platform- and compiler-dependent, both in how they are written and in how they perform, the new runtime code -in libpng has been written to allow programs to query, enable, and disable +in libmodpng14 has been written to allow programs to query, enable, and disable either specific optimizations or all such optimizations. For example, to enable all possible optimizations (bearing in mind that some "optimizations" may actually run more slowly in rare cases): - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - png_uint_32 mask, flags; + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + modpng14_uint_32 mask, flags; - flags = png_get_asm_flags(png_ptr); - mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE); - png_set_asm_flags(png_ptr, flags | mask); + flags = modpng14_get_asm_flags(modpng14_ptr); + mask = modpng14_get_asm_flagmask(MODPNG14_SELECT_READ | MODPNG14_SELECT_WRITE); + modpng14_set_asm_flags(modpng14_ptr, flags | mask); #endif -To enable only optimizations relevant to reading PNGs, use PNG_SELECT_READ -by itself when calling png_get_asm_flagmask(); similarly for optimizing +To enable only optimizations relevant to reading PNGs, use MODPNG14_SELECT_READ +by itself when calling modpng14_get_asm_flagmask(); similarly for optimizing only writing. To disable all optimizations: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - flags = png_get_asm_flags(png_ptr); - mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE); - png_set_asm_flags(png_ptr, flags & ~mask); + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + flags = modpng14_get_asm_flags(modpng14_ptr); + mask = modpng14_get_asm_flagmask(MODPNG14_SELECT_READ | MODPNG14_SELECT_WRITE); + modpng14_set_asm_flags(modpng14_ptr, flags & ~mask); #endif -To enable or disable only MMX-related features, use png_get_mmx_flagmask() -in place of png_get_asm_flagmask(). The mmx version takes one additional +To enable or disable only MMX-related features, use modpng14_get_mmx_flagmask() +in place of modpng14_get_asm_flagmask(). The mmx version takes one additional parameter: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - int selection = PNG_SELECT_READ | PNG_SELECT_WRITE; + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + int selection = MODPNG14_SELECT_READ | MODPNG14_SELECT_WRITE; int compilerID; - mask = png_get_mmx_flagmask(selection, &compilerID); + mask = modpng14_get_mmx_flagmask(selection, &compilerID); #endif On return, compilerID will indicate which version of the MMX assembler @@ -2711,85 +2711,85 @@ On non-x86 platforms or on systems compiled without MMX optimizations, a value of -1 is used. -Note that both png_get_asm_flagmask() and png_get_mmx_flagmask() return +Note that both modpng14_get_asm_flagmask() and modpng14_get_mmx_flagmask() return all valid, settable optimization bits for the version of the library that's currently in use. In the case of shared (dynamically linked) libraries, this may include optimizations that did not exist at the time the code was written and compiled. It is also possible, of course, to enable only known, specific optimizations; for example: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - 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 ; - png_set_asm_flags(png_ptr, flags); + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + flags = MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | MODPNG14_ASM_FLAG_MMX_READ_INTERLACE \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH ; + modpng14_set_asm_flags(modpng14_ptr, flags); #endif This method would enable only the MMX read-optimizations available at the -time of libpng 1.2.0's release, regardless of whether a later version of +time of libmodpng14 1.2.0's release, regardless of whether a later version of the DLL were actually being used. (Also note that these functions did not exist in versions older than 1.2.0, so any attempt to run a dynamically linked app on such an older version would fail.) To determine whether the processor supports MMX instructions at all, use -the png_mmx_support() function: +the modpng14_mmx_support() function: - #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) - mmxsupport = png_mmx_support(); + #if defined(MODPNG14_LIBMODPNG14_VER) && (MODPNG14_LIBMODPNG14_VER >= 10200) + mmxsupport = modpng14_mmx_support(); #endif -It returns -1 if MMX support is not compiled into libpng, 0 if MMX code +It returns -1 if MMX support is not compiled into libmodpng14, 0 if MMX code is compiled but MMX is not supported by the processor, or 1 if MMX support -is fully available. Note that png_mmx_support(), png_get_mmx_flagmask(), -and png_get_asm_flagmask() all may be called without allocating and ini- +is fully available. Note that modpng14_mmx_support(), modpng14_get_mmx_flagmask(), +and modpng14_get_asm_flagmask() all may be called without allocating and ini- tializing any PNG structures (for example, as part of a usage screen or "about" box). The following code can be used to prevent an application from using the -thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK +thread_unsafe features, even if libmodpng14 was built with MODPNG14_THREAD_UNSAFE_OK defined: -#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \ - && defined(PNG_THREAD_UNSAFE_OK) +#if defined(MODPNG14_USE_PNGGCCRD) && defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) \ + && defined(MODPNG14_THREAD_UNSAFE_OK) /* Disable thread-unsafe features of pnggccrd */ - if (png_access_version() >= 10200) + if (modpng14_access_version() >= 10200) { - png_uint_32 mmx_disable_mask = 0; - png_uint_32 asm_flags; + modpng14_uint_32 mmx_disable_mask = 0; + modpng14_uint_32 asm_flags; - mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ - | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ - | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ - | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ); - asm_flags = png_get_asm_flags(png_ptr); - png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask); + mmx_disable_mask |= ( MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH ); + asm_flags = modpng14_get_asm_flags(modpng14_ptr); + modpng14_set_asm_flags(modpng14_ptr, asm_flags & ~mmx_disable_mask); } #endif For more extensive examples of runtime querying, enabling and disabling -of optimized features, see contrib/gregbook/readpng2.c in the libpng +of optimized features, see contrib/gregbook/readpng2.c in the libmodpng14 source-code distribution. VII. MNG support -The MNG specification (available at http://www.libpng.org/pub/mng) allows +The MNG specification (available at http://www.libmodpng14.org/pub/mng) allows certain extensions to PNG for PNG images that are embedded in MNG datastreams. Libpng can support some of these extensions. To enable them, use the -png_permit_mng_features() function: +modpng14_permit_mng_features() function: - feature_set = png_permit_mng_features(png_ptr, mask) - mask is a png_uint_32 containing the logical OR of the + feature_set = modpng14_permit_mng_features(modpng14_ptr, mask) + mask is a modpng14_uint_32 containing the logical OR of the features you want to enable. These include - PNG_FLAG_MNG_EMPTY_PLTE - PNG_FLAG_MNG_FILTER_64 - PNG_ALL_MNG_FEATURES - feature_set is a png_32_uint that is the logical AND of + MODPNG14_FLAG_MNG_EMPTY_PLTE + MODPNG14_FLAG_MNG_FILTER_64 + MODPNG14_ALL_MNG_FEATURES + feature_set is a modpng14_32_uint that is the logical AND of your mask with the set of MNG features that is - supported by the version of libpng that you are using. + supported by the version of libmodpng14 that you are using. It is an error to use this function when reading or writing a standalone PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped @@ -2801,61 +2801,61 @@ VIII. Changes to Libpng from version 0.88 -It should be noted that versions of libpng later than 0.96 are not -distributed by the original libpng author, Guy Schalnat, nor by +It should be noted that versions of libmodpng14 later than 0.96 are not +distributed by the original libmodpng14 author, Guy Schalnat, nor by Andreas Dilger, who had taken over from Guy during 1996 and 1997, and distributed versions 0.89 through 0.96, but rather by another member of the original PNG Group, Glenn Randers-Pehrson. Guy and Andreas are still alive and well, but they have moved on to other things. -The old libpng functions png_read_init(), png_write_init(), -png_info_init(), png_read_destroy(), and png_write_destroy() have been -moved to PNG_INTERNAL in version 0.95 to discourage their use. These -functions will be removed from libpng version 2.0.0. - -The preferred method of creating and initializing the libpng structures is -via the png_create_read_struct(), png_create_write_struct(), and -png_create_info_struct() because they isolate the size of the structures +The old libmodpng14 functions modpng14_read_init(), modpng14_write_init(), +modpng14_info_init(), modpng14_read_destroy(), and modpng14_write_destroy() have been +moved to MODPNG14_INTERNAL in version 0.95 to discourage their use. These +functions will be removed from libmodpng14 version 2.0.0. + +The preferred method of creating and initializing the libmodpng14 structures is +via the modpng14_create_read_struct(), modpng14_create_write_struct(), and +modpng14_create_info_struct() because they isolate the size of the structures from the application, allow version error checking, and also allow the use of custom error handling routines during the initialization, which -the old functions do not. The functions png_read_destroy() and -png_write_destroy() do not actually free the memory that libpng +the old functions do not. The functions modpng14_read_destroy() and +modpng14_write_destroy() do not actually free the memory that libmodpng14 allocated for these structs, but just reset the data structures, so they -can be used instead of png_destroy_read_struct() and -png_destroy_write_struct() if you feel there is too much system overhead -allocating and freeing the png_struct for each image read. +can be used instead of modpng14_destroy_read_struct() and +modpng14_destroy_write_struct() if you feel there is too much system overhead +allocating and freeing the modpng14_struct for each image read. -Setting the error callbacks via png_set_message_fn() before -png_read_init() as was suggested in libpng-0.88 is no longer supported +Setting the error callbacks via modpng14_set_message_fn() before +modpng14_read_init() as was suggested in libmodpng14-0.88 is no longer supported because this caused applications that do not use custom error functions -to fail if the png_ptr was not initialized to zero. It is still possible -to set the error callbacks AFTER png_read_init(), or to change them with -png_set_error_fn(), which is essentially the same function, but with a new +to fail if the modpng14_ptr was not initialized to zero. It is still possible +to set the error callbacks AFTER modpng14_read_init(), or to change them with +modpng14_set_error_fn(), which is essentially the same function, but with a new name to force compilation errors with applications that try to use the old method. Starting with version 1.0.7, you can find out which version of the library you are using at run-time: - png_uint_32 libpng_vn = png_access_version_number(); + modpng14_uint_32 libmodpng14_vn = modpng14_access_version_number(); -The number libpng_vn is constructed from the major version, minor +The number libmodpng14_vn is constructed from the major version, minor version with leading zero, and release number with leading zero, -(e.g., libpng_vn for version 1.0.7 is 10007). +(e.g., libmodpng14_vn for version 1.0.7 is 10007). -You can also check which version of png.h you used when compiling your +You can also check which version of modpng14.h you used when compiling your application: - png_uint_32 application_vn = PNG_LIBPNG_VER; + modpng14_uint_32 application_vn = MODPNG14_LIBMODPNG14_VER; -IX. Y2K Compliance in libpng +IX. Y2K Compliance in libmodpng14 October 3, 2002 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. -This is your unofficial assurance that libpng from version 0.71 and +This is your unofficial assurance that libmodpng14 from version 0.71 and upward through 1.2.5 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. @@ -2864,42 +2864,42 @@ format, and will hold years up to 9999. The integer is - "png_uint_16 year" in png_time_struct. + "modpng14_uint_16 year" in modpng14_time_struct. The strings are - "png_charp time_buffer" in png_struct and + "modpng14_charp time_buffer" in modpng14_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 + modpng14_convert_to_rfc_1123() in png.c + (formerly modpng14_convert_to_rfc_1152() in error) + modpng14_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 + modpng14_convert_from_time_t() in pngwrite.c + modpng14_get_tIME() in pngget.c + modpng14_handle_tIME() in pngrutil.c, called in pngread.c + modpng14_set_tIME() in pngset.c + modpng14_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 +modpng14_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() +libmodpng14 are not passing 4-digit years into the modpng14_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 +instead of "year - 1900" into the modpng14_convert_from_struct_tm() function, +but this is not under our control. The libmodpng14 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 +zlib, upon which libmodpng14 depends, is also Y2K compliant. It contains no date-related code. Glenn Randers-Pehrson - libpng maintainer + libmodpng14 maintainer PNG Development Group --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/libpngpf.3 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/libpngpf.3 @@ -1,552 +1,552 @@ .TH LIBPNGPF 3 "October 3, 2002" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.2.5 +libmodpng14 \- Portable Network Graphics (PNG) Reference Library 1.2.5 (private functions) .SH SYNOPSIS -\fB#include \fP +\fB#include \fP \fI\fB -\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_build_gamma_table (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP +\fBvoid modpng14_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, modpng14_colorp \fIpalette\fP\fB);\fP \fI\fB -\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_calculate_crc (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIptr\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP +\fBvoid modpng14_check_chunk_name (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fIchunk_name\fP\fB);\fP \fI\fB -\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP +\fBmodpng14_size_t modpng14_check_keyword (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIkey\fP\fB, modpng14_charpp \fInew_key\fP\fB);\fP \fI\fB -\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP +\fBvoid modpng14_combine_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP \fI\fB -\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP +\fBvoid modpng14_correct_palette (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP \fI\fB -\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP +\fBint modpng14_crc_error (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP +\fBint modpng14_crc_finish (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIskip\fP\fB);\fP \fI\fB -\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_crc_read (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIbuf\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP +\fBmodpng14_voidp modpng14_create_struct (int \fItype\fP\fB);\fP \fI\fB -\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP +\fBmodpng14_voidp modpng14_create_struct_2 (int \fP\fItype\fP\fB, modpng14_malloc_ptr \fP\fImalloc_fn\fP\fB, modpng14_voidp \fImem_ptr\fP\fB);\fP \fI\fB -\fBpng_charp png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP +\fBmodpng14_charp modpng14_decompress_chunk (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, modpng14_charp \fP\fIchunkdata\fP\fB, modpng14_size_t \fP\fIchunklength\fP\fB, modpng14_size_t \fP\fIprefix_length\fP\fB, modpng14_size_t \fI*data_length\fP\fB);\fP \fI\fB -\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP +\fBvoid modpng14_destroy_struct (modpng14_voidp \fIstruct_ptr\fP\fB);\fP \fI\fB -\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP +\fBvoid modpng14_destroy_struct_2 (modpng14_voidp \fP\fIstruct_ptr\fP\fB, modpng14_free_ptr \fP\fIfree_fn\fP\fB, modpng14_voidp \fImem_ptr\fP\fB);\fP \fI\fB -\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP +\fBvoid modpng14_do_background (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_color_16p \fP\fItrans_values\fP\fB, modpng14_color_16p \fP\fIbackground\fP\fB, modpng14_color_16p \fP\fIbackground_1\fP\fB, modpng14_bytep \fP\fIgamma_table\fP\fB, modpng14_bytep \fP\fIgamma_from_1\fP\fB, modpng14_bytep \fP\fIgamma_to_1\fP\fB, modpng14_uint_16pp \fP\fIgamma_16\fP\fB, modpng14_uint_16pp \fP\fIgamma_16_from_1\fP\fB, modpng14_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP \fI\fB -\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_bgr (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_chop (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_dither (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIdither_lookup\fP\fB);\fP +\fBvoid modpng14_do_dither (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_bytep \fP\fIpalette_lookup\fP\fB, modpng14_bytep \fIdither_lookup\fP\fB);\fP \fI\fB -\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP +\fBvoid modpng14_do_expand (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_color_16p \fItrans_value\fP\fB);\fP \fI\fB -\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP +\fBvoid modpng14_do_expand_palette (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_colorp \fP\fIpalette\fP\fB, modpng14_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP \fI\fB -\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP +\fBvoid modpng14_do_gamma (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_bytep \fP\fIgamma_table\fP\fB, modpng14_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP \fI\fB -\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_gray_to_rgb (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_invert (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP +\fBvoid modpng14_do_pack (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_uint_32 \fIbit_depth\fP\fB);\fP \fI\fB -\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_packswap (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP +\fBvoid modpng14_do_read_filler (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_uint_32 \fP\fIfiller\fP\fB, modpng14_uint_32 \fIflags\fP\fB);\fP \fI\fB -\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP +\fBvoid modpng14_do_read_interlace (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, modpng14_uint_32 \fItransformations\fP\fB);\fP \fI\fB -\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_read_invert_alpha (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_read_swap_alpha (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_do_read_transformations (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBint modpng14_do_rgb_to_gray (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP +\fBvoid modpng14_do_shift (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_color_8p \fIbit_depth\fP\fB);\fP \fI\fB -\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP +\fBvoid modpng14_do_strip_filler (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_uint_32 \fIflags\fP\fB);\fP \fI\fB -\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_swap (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_unpack (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP +\fBvoid modpng14_do_unshift (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_color_8p \fIsig_bits\fP\fB);\fP \fI\fB -\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP +\fBvoid modpng14_do_write_interlace (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP \fI\fB -\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_write_invert_alpha (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_do_write_swap_alpha (modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_do_write_transformations (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP +\fBvoid *modpng14_far_to_near (modpng14_structp modpng14_ptr,modpng14_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP \fI\fB -\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_flush (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_int_32 (png_bytep \fIbuf\fP\fB);\fP +\fBmodpng14_int_32 modpng14_get_int_32 (modpng14_bytep \fIbuf\fP\fB);\fP \fI\fB -\fBpng_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP +\fBmodpng14_uint_16 modpng14_get_uint_16 (modpng14_bytep \fIbuf\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP +\fBmodpng14_uint_32 modpng14_get_uint_32 (modpng14_bytep \fIbuf\fP\fB);\fP \fI\fB -\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_bKGD (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_cHRM (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_gAMA (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_hIST (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_IEND (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_IHDR (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_iCCP (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_iTXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_oFFs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_pCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_pHYs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_PLTE (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_sBIT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_sCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_sPLT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_sRGB (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_tEXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_tIME (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_tRNS (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_unknown (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_handle_zTXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_info_destroy (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_init_mmx_flags (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_init_read_transformations (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP +\fBvoid modpng14_process_IDAT_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIbuffer\fP\fB, modpng14_size_t \fIbuffer_length\fP\fB);\fP \fI\fB -\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_process_some_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_push_check_crc (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_push_crc_finish (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_push_crc_skip (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_push_fill_buffer (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIbuffer\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_push_handle_tEXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_push_handle_unknown (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP +\fBvoid modpng14_push_handle_zTXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_uint_32 \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_have_end (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_have_info (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP +\fBvoid modpng14_push_have_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fIrow\fP\fB);\fP \fI\fB -\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_push_process_row (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_read_chunk (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_read_end (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_push_read_IDAT (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_read_sig (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_read_tEXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_push_read_zTXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP +\fBvoid modpng14_push_restore_buffer (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIbuffer\fP\fB, modpng14_size_t \fIbuffer_length\fP\fB);\fP \fI\fB -\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_push_save_buffer (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_read_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIdata\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP +\fBvoid modpng14_read_filter_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_row_infop \fP\fIrow_info\fP\fB, modpng14_bytep \fP\fIrow\fP\fB, modpng14_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP \fI\fB -\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_read_finish_row (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_read_push_finish_row (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_read_start_row (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBvoid modpng14_read_transform_info (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_reset_crc (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP +\fBvoid modpng14_save_int_32 (modpng14_bytep \fP\fIbuf\fP\fB, modpng14_int_32 \fIi\fP\fB);\fP \fI\fB -\fBvoid png_save_uint_16 (png_bytep \fP\fIbuf\fP\fB, unsigned int \fIi\fP\fB);\fP +\fBvoid modpng14_save_uint_16 (modpng14_bytep \fP\fIbuf\fP\fB, unsigned int \fIi\fP\fB);\fP \fI\fB -\fBvoid png_save_uint_32 (png_bytep \fP\fIbuf\fP\fB, png_uint_32 \fIi\fP\fB);\fP +\fBvoid modpng14_save_uint_32 (modpng14_bytep \fP\fIbuf\fP\fB, modpng14_uint_32 \fIi\fP\fB);\fP \fI\fB -\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text)\fP\fB);\fP +\fBint modpng14_set_text_2 (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_infop \fP\fIinfo_ptr\fP\fB, modpng14_textp \fP\fItext_ptr\fP\fB, int \fInum_text)\fP\fB);\fP \fI\fB -\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP +\fBvoid modpng14_write_cHRM (modpng14_structp \fP\fImodpng14_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP \fI\fB -\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP +\fBvoid modpng14_write_cHRM_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fP\fIwhite_x\fP\fB, modpng14_uint_32 \fP\fIwhite_y\fP\fB, modpng14_uint_32 \fP\fIred_x\fP\fB, modpng14_uint_32 \fP\fIred_y\fP\fB, modpng14_uint_32 \fP\fIgreen_x\fP\fB, modpng14_uint_32 \fP\fIgreen_y\fP\fB, modpng14_uint_32 \fP\fIblue_x\fP\fB, modpng14_uint_32 \fIblue_y\fP\fB);\fP \fI\fB -\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_write_data (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIdata\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP +\fBvoid modpng14_write_filtered_row (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fIfiltered_row\fP\fB);\fP \fI\fB -\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP +\fBvoid modpng14_write_find_filter (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_row_infop \fIrow_info\fP\fB);\fP \fI\fB -\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_finish_row (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP +\fBvoid modpng14_write_gAMA (modpng14_structp \fP\fImodpng14_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP \fI\fB -\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP +\fBvoid modpng14_write_gAMA_fixed (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fIint_file_gamma\fP\fB);\fP \fI\fB -\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP +\fBvoid modpng14_write_hIST (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP \fI\fB -\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP +\fBvoid modpng14_write_iCCP (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, modpng14_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP \fI\fB -\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP +\fBvoid modpng14_write_IDAT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fIdata\fP\fB, modpng14_size_t \fIlength\fP\fB);\fP \fI\fB -\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_IEND (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP +\fBvoid modpng14_write_IHDR (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fP\fIwidth\fP\fB, modpng14_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP \fI\fB -\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext)\fP\fB);\fP +\fBvoid modpng14_write_iTXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fP\fIcompression\fP\fB, modpng14_charp \fP\fIkey\fP\fB, modpng14_charp \fP\fIlang\fP\fB, modpng14_charp \fP\fItranslated_key\fP\fB, modpng14_charp \fItext)\fP\fB);\fP \fI\fB -\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP +\fBvoid modpng14_write_oFFs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fP\fIx_offset\fP\fB, modpng14_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP \fI\fB -\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP +\fBvoid modpng14_write_pCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIpurpose\fP\fB, modpng14_int_32 \fP\fIX0\fP\fB, modpng14_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, modpng14_charp \fP\fIunits\fP\fB, modpng14_charpp \fIparams\fP\fB);\fP \fI\fB -\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP +\fBvoid modpng14_write_pHYs (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_uint_32 \fP\fIx_pixels_per_unit\fP\fB, modpng14_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP \fI\fB -\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP +\fBvoid modpng14_write_PLTE (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_colorp \fP\fIpalette\fP\fB, modpng14_uint_32 \fInum_pal\fP\fB);\fP \fI\fB -\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP +\fBvoid modpng14_write_sBIT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP \fI\fB -\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP +\fBvoid modpng14_write_sCAL (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP \fI\fB -\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP +\fBvoid modpng14_write_sCAL_s (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIunit\fP\fB, modpng14_charp \fP\fIwidth\fP\fB, modpng14_charp \fIheight\fP\fB);\fP \fI\fB -\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_sig (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP +\fBvoid modpng14_write_sRGB (modpng14_structp \fP\fImodpng14_ptr\fP\fB, int \fIintent\fP\fB);\fP \fI\fB -\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP +\fBvoid modpng14_write_sPLT (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_spalette_p \fIpalette\fP\fB);\fP \fI\fB -\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP +\fBvoid modpng14_write_start_row (modpng14_structp \fImodpng14_ptr\fP\fB);\fP \fI\fB -\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP +\fBvoid modpng14_write_tEXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIkey\fP\fB, modpng14_charp \fP\fItext\fP\fB, modpng14_size_t \fItext_len\fP\fB);\fP \fI\fB -\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP +\fBvoid modpng14_write_tIME (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_timep \fImod_time\fP\fB);\fP \fI\fB -\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP +\fBvoid modpng14_write_tRNS (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_bytep \fP\fItrans\fP\fB, modpng14_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP \fI\fB -\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP +\fBvoid modpng14_write_zTXt (modpng14_structp \fP\fImodpng14_ptr\fP\fB, modpng14_charp \fP\fIkey\fP\fB, modpng14_charp \fP\fItext\fP\fB, modpng14_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP \fI\fB -\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP +\fBvoidpf modpng14_zalloc (voidpf \fP\fImodpng14_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP \fI\fB -\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP +\fBvoid modpng14_zfree (voidpf \fP\fImodpng14_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP \fI\fB .SH DESCRIPTION -The functions listed above are used privately by libpng +The functions listed above are used privately by libmodpng14 and are not recommended for use by applications. They are not "exported" to applications using shared libraries. They -are listed alphabetically here as an aid to libpng maintainers. -See png.h for more information on these functions. +are listed alphabetically here as an aid to libmodpng14 maintainers. +See modpng14.h for more information on these functions. .SH SEE ALSO -libpng(3), png(5) +libmodpng14(3), png(5) .SH AUTHOR Glenn Randers-Pehrson --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/png.5 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/png.5 @@ -18,12 +18,12 @@ platforms. .SH "SEE ALSO" -.IR libpng(3), zlib(3), deflate(5), and zlib(5) +.IR libmodpng14(3), zlib(3), deflate(5), and zlib(5) .LP PNG 1.2 specification, July 1999: .IP .br -http://www.libpng.org/pub/png +http://www.libmodpng14.org/pub/png .br or ftp://ftp.uu.net/graphics/png/documents .LP @@ -37,7 +37,7 @@ .br or (as a W3C Recommendation) at .br -http://www.w3.org/TR/REC-png.html +http://www.w3.org/TR/REC-modpng14.html .SH AUTHORS This man page: Glenn Randers-Pehrson .LP --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/png.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/png.c @@ -1,101 +1,101 @@ -/* png.c - location for general purpose libpng functions +/* png.c - location for general purpose libmodpng14 functions * - * libpng version 1.2.5 - October 3, 2002 + * libmodpng14 version 1.2.5 - October 3, 2002 * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * */ -#define PNG_INTERNAL -#define PNG_NO_EXTERN -#include "png.h" +#define MODPNG14_INTERNAL +#define MODPNG14_NO_EXTERN +#include "modpng14.h" -/* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_2_5 Your_png_h_is_not_version_1_2_5; +/* Generate a compiler error if there is an old modpng14.h in the search path. */ +typedef version_1_2_5 Your_modpng14_h_is_not_version_1_2_5; /* Version information for C files. This had better match the version - * string defined in png.h. */ + * string defined in modpng14.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.5"; +#ifdef MODPNG14_USE_GLOBAL_ARRAYS +/* modpng14_libmodpng14_ver was changed to a function in version 1.0.5c */ +const char modpng14_libmodpng14_ver[18] = "1.2.5"; -/* png_sig was changed to a function in version 1.0.5c */ +/* modpng14_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}; +const modpng14_byte FARDATA modpng14_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; +MODPNG14_IHDR; +MODPNG14_IDAT; +MODPNG14_IEND; +MODPNG14_PLTE; +MODPNG14_bKGD; +MODPNG14_cHRM; +MODPNG14_gAMA; +MODPNG14_hIST; +MODPNG14_iCCP; +MODPNG14_iTXt; +MODPNG14_oFFs; +MODPNG14_pCAL; +MODPNG14_sCAL; +MODPNG14_pHYs; +MODPNG14_sBIT; +MODPNG14_sPLT; +MODPNG14_sRGB; +MODPNG14_tEXt; +MODPNG14_tIME; +MODPNG14_tRNS; +MODPNG14_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}; +const int FARDATA modpng14_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}; +const int FARDATA modpng14_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}; +const int FARDATA modpng14_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}; +const int FARDATA modpng14_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}; +#ifdef MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW +const int FARDATA modpng14_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}; + * it, uncomment it here and in modpng14.h +const int FARDATA modpng14_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}; +const int FARDATA modpng14_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[] +const int FARDATA modpng14_pass_dsp_mask[] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; #endif -/* Tells libpng that we have already handled the first "num_bytes" bytes +/* Tells libmodpng14 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 + * stream we can set num_bytes = 8 so that libmodpng14 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) +void MODPNG14API +modpng14_set_sig_bytes(modpng14_structp modpng14_ptr, int num_bytes) { - png_debug(1, "in png_set_sig_bytes\n"); + modpng14_debug(1, "in modpng14_set_sig_bytes\n"); if (num_bytes > 8) - png_error(png_ptr, "Too many bytes for PNG signature."); + modpng14_error(modpng14_ptr, "Too many bytes for PNG signature."); - png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes); + modpng14_ptr->sig_bytes = (modpng14_byte)(num_bytes < 0 ? 0 : num_bytes); } /* Checks whether the supplied bytes match the PNG signature. We allow @@ -106,10 +106,10 @@ * 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) +int MODPNG14API +modpng14_sig_cmp(modpng14_bytep sig, modpng14_size_t start, modpng14_size_t num_to_check) { - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; + modpng14_byte modpng14_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) @@ -121,72 +121,72 @@ if (start + num_to_check > 8) num_to_check = 8 - start; - return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check))); + return ((int)(modpng14_memcmp(&sig[start], &modpng14_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. + * future - use modpng14_sig_cmp(). Returns true (nonzero) if the file is a PNG. */ -int PNGAPI -png_check_sig(png_bytep sig, int num) +int MODPNG14API +modpng14_check_sig(modpng14_bytep sig, int num) { - return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num)); + return ((int)!modpng14_sig_cmp(sig, (modpng14_size_t)0, (modpng14_size_t)num)); } /* Function to allocate memory for zlib and clear it to 0. */ -#ifdef PNG_1_0_X -voidpf PNGAPI +#ifdef MODPNG14_1_0_X +voidpf MODPNG14API #else voidpf /* private */ #endif -png_zalloc(voidpf png_ptr, uInt items, uInt size) +modpng14_zalloc(voidpf modpng14_ptr, uInt items, uInt size) { - png_uint_32 num_bytes = (png_uint_32)items * size; - png_voidp ptr; - png_structp p=(png_structp)png_ptr; - png_uint_32 save_flags=p->flags; + modpng14_uint_32 num_bytes = (modpng14_uint_32)items * size; + modpng14_voidp ptr; + modpng14_structp p=(modpng14_structp)modpng14_ptr; + modpng14_uint_32 save_flags=p->flags; - p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; - ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes); + p->flags|=MODPNG14_FLAG_MALLOC_NULL_MEM_OK; + ptr = (modpng14_voidp)modpng14_malloc((modpng14_structp)modpng14_ptr, num_bytes); p->flags=save_flags; -#ifndef PNG_NO_ZALLOC_ZERO +#ifndef MODPNG14_NO_ZALLOC_ZERO if (ptr == NULL) return ((voidpf)ptr); - if (num_bytes > (png_uint_32)0x8000L) + if (num_bytes > (modpng14_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)); + modpng14_memset(ptr, 0, (modpng14_size_t)0x8000L); + modpng14_memset((modpng14_bytep)ptr + (modpng14_size_t)0x8000L, 0, + (modpng14_size_t)(num_bytes - (modpng14_uint_32)0x8000L)); } else { - png_memset(ptr, 0, (png_size_t)num_bytes); + modpng14_memset(ptr, 0, (modpng14_size_t)num_bytes); } #endif return ((voidpf)ptr); } /* function to free memory for zlib */ -#ifdef PNG_1_0_X -void PNGAPI +#ifdef MODPNG14_1_0_X +void MODPNG14API #else void /* private */ #endif -png_zfree(voidpf png_ptr, voidpf ptr) +modpng14_zfree(voidpf modpng14_ptr, voidpf ptr) { - png_free((png_structp)png_ptr, (png_voidp)ptr); + modpng14_free((modpng14_structp)modpng14_ptr, (modpng14_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) +modpng14_reset_crc(modpng14_structp modpng14_ptr) { - png_ptr->crc = crc32(0, Z_NULL, 0); + modpng14_ptr->crc = crc32(0, Z_NULL, 0); } /* Calculate the CRC over a section of data. We can only pass as @@ -195,148 +195,148 @@ * trouble of calculating it. */ void /* PRIVATE */ -png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length) +modpng14_calculate_crc(modpng14_structp modpng14_ptr, modpng14_bytep ptr, modpng14_size_t length) { int need_crc = 1; - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ + if (modpng14_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)) + if ((modpng14_ptr->flags & MODPNG14_FLAG_CRC_ANCILLARY_MASK) == + (MODPNG14_FLAG_CRC_ANCILLARY_USE | MODPNG14_FLAG_CRC_ANCILLARY_NOWARN)) need_crc = 0; } else /* critical */ { - if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) + if (modpng14_ptr->flags & MODPNG14_FLAG_CRC_CRITICAL_IGNORE) need_crc = 0; } if (need_crc) - png_ptr->crc = crc32(png_ptr->crc, ptr, (uInt)length); + modpng14_ptr->crc = crc32(modpng14_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); + * really need the modpng14_ptr, but it could potentially be useful in the + * future. This should be used in favour of malloc(sizeof(modpng14_info)) + * and modpng14_info_init() so that applications that want to use a shared + * libmodpng14 don't have to be recompiled if modpng14_info changes size. + */ +modpng14_infop MODPNG14API +modpng14_create_info_struct(modpng14_structp modpng14_ptr) +{ + modpng14_infop info_ptr; + + modpng14_debug(1, "in modpng14_create_info_struct\n"); + if(modpng14_ptr == NULL) return (NULL); +#ifdef MODPNG14_USER_MEM_SUPPORTED + info_ptr = (modpng14_infop)modpng14_create_struct_2(MODPNG14_STRUCT_INFO, + modpng14_ptr->malloc_fn, modpng14_ptr->mem_ptr); #else - info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO); + info_ptr = (modpng14_infop)modpng14_create_struct(MODPNG14_STRUCT_INFO); #endif if (info_ptr != NULL) - png_info_init_3(&info_ptr, sizeof(png_info)); + modpng14_info_init_3(&info_ptr, sizeof(modpng14_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 + * Normally, one would use either modpng14_destroy_read_struct() or + * modpng14_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) +void MODPNG14API +modpng14_destroy_info_struct(modpng14_structp modpng14_ptr, modpng14_infopp info_ptr_ptr) { - png_infop info_ptr = NULL; + modpng14_infop info_ptr = NULL; - png_debug(1, "in png_destroy_info_struct\n"); + modpng14_debug(1, "in modpng14_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); + modpng14_info_destroy(modpng14_ptr, info_ptr); -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, png_ptr->free_fn, - png_ptr->mem_ptr); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)info_ptr, modpng14_ptr->free_fn, + modpng14_ptr->mem_ptr); #else - png_destroy_struct((png_voidp)info_ptr); + modpng14_destroy_struct((modpng14_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() + * and applications using it are urged to use modpng14_create_info_struct() * instead. */ -#undef png_info_init -void PNGAPI -png_info_init(png_infop info_ptr) +#undef modpng14_info_init +void MODPNG14API +modpng14_info_init(modpng14_infop info_ptr) { /* We only come here via pre-1.0.12-compiled applications */ - png_info_init_3(&info_ptr, 0); + modpng14_info_init_3(&info_ptr, 0); } -void PNGAPI -png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size) +void MODPNG14API +modpng14_info_init_3(modpng14_infopp ptr_ptr, modpng14_size_t modpng14_info_struct_size) { - png_infop info_ptr = *ptr_ptr; + modpng14_infop info_ptr = *ptr_ptr; - png_debug(1, "in png_info_init_3\n"); + modpng14_debug(1, "in modpng14_info_init_3\n"); - if(sizeof(png_info) > png_info_struct_size) + if(sizeof(modpng14_info) > modpng14_info_struct_size) { - png_destroy_struct(info_ptr); - info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO); + modpng14_destroy_struct(info_ptr); + info_ptr = (modpng14_infop)modpng14_create_struct(MODPNG14_STRUCT_INFO); *ptr_ptr = info_ptr; } /* set everything to 0 */ - png_memset(info_ptr, 0, sizeof (png_info)); + modpng14_memset(info_ptr, 0, sizeof (modpng14_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) +#ifdef MODPNG14_FREE_ME_SUPPORTED +void MODPNG14API +modpng14_data_freer(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + int freer, modpng14_uint_32 mask) { - png_debug(1, "in png_data_freer\n"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug(1, "in modpng14_data_freer\n"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - if(freer == PNG_DESTROY_WILL_FREE_DATA) + if(freer == MODPNG14_DESTROY_WILL_FREE_DATA) info_ptr->free_me |= mask; - else if(freer == PNG_USER_WILL_FREE_DATA) + else if(freer == MODPNG14_USER_WILL_FREE_DATA) info_ptr->free_me &= ~mask; else - png_warning(png_ptr, - "Unknown freer parameter in png_data_freer."); + modpng14_warning(modpng14_ptr, + "Unknown freer parameter in modpng14_data_freer."); } #endif -void PNGAPI -png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, +void MODPNG14API +modpng14_free_data(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 mask, int num) { - png_debug(1, "in png_free_data\n"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug(1, "in modpng14_free_data\n"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; -#if defined(PNG_TEXT_SUPPORTED) +#if defined(MODPNG14_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) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_TEXT) & info_ptr->free_me) #else -if (mask & PNG_FREE_TEXT) +if (mask & MODPNG14_FREE_TEXT) #endif { if (num != -1) { if (info_ptr->text && info_ptr->text[num].key) { - png_free(png_ptr, info_ptr->text[num].key); + modpng14_free(modpng14_ptr, info_ptr->text[num].key); info_ptr->text[num].key = NULL; } } @@ -344,59 +344,59 @@ { 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); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_TEXT, i); + modpng14_free(modpng14_ptr, info_ptr->text); info_ptr->text = NULL; info_ptr->num_text=0; } } #endif -#if defined(PNG_tRNS_SUPPORTED) +#if defined(MODPNG14_tRNS_SUPPORTED) /* free any tRNS entry */ -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_TRNS) & info_ptr->free_me) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_TRNS) & info_ptr->free_me) #else -if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS)) +if ((mask & MODPNG14_FREE_TRNS) && (modpng14_ptr->flags & MODPNG14_FLAG_FREE_TRNS)) #endif { - png_free(png_ptr, info_ptr->trans); - info_ptr->valid &= ~PNG_INFO_tRNS; -#ifndef PNG_FREE_ME_SUPPORTED - png_ptr->flags &= ~PNG_FLAG_FREE_TRNS; + modpng14_free(modpng14_ptr, info_ptr->trans); + info_ptr->valid &= ~MODPNG14_INFO_tRNS; +#ifndef MODPNG14_FREE_ME_SUPPORTED + modpng14_ptr->flags &= ~MODPNG14_FLAG_FREE_TRNS; #endif info_ptr->trans = NULL; } #endif -#if defined(PNG_sCAL_SUPPORTED) +#if defined(MODPNG14_sCAL_SUPPORTED) /* free any sCAL entry */ -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_SCAL) & info_ptr->free_me) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_SCAL) & info_ptr->free_me) #else -if (mask & PNG_FREE_SCAL) +if (mask & MODPNG14_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); +#if defined(MODPNG14_FIXED_POINT_SUPPORTED) && !defined(MODPNG14_FLOATING_POINT_SUPPORTED) + modpng14_free(modpng14_ptr, info_ptr->scal_s_width); + modpng14_free(modpng14_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; + info_ptr->valid &= ~MODPNG14_INFO_sCAL; } #endif -#if defined(PNG_pCAL_SUPPORTED) +#if defined(MODPNG14_pCAL_SUPPORTED) /* free any pCAL entry */ -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_PCAL) & info_ptr->free_me) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_PCAL) & info_ptr->free_me) #else -if (mask & PNG_FREE_PCAL) +if (mask & MODPNG14_FREE_PCAL) #endif { - png_free(png_ptr, info_ptr->pcal_purpose); - png_free(png_ptr, info_ptr->pcal_units); + modpng14_free(modpng14_ptr, info_ptr->pcal_purpose); + modpng14_free(modpng14_ptr, info_ptr->pcal_units); info_ptr->pcal_purpose = NULL; info_ptr->pcal_units = NULL; if (info_ptr->pcal_params != NULL) @@ -404,46 +404,46 @@ int i; for (i = 0; i < (int)info_ptr->pcal_nparams; i++) { - png_free(png_ptr, info_ptr->pcal_params[i]); + modpng14_free(modpng14_ptr, info_ptr->pcal_params[i]); info_ptr->pcal_params[i]=NULL; } - png_free(png_ptr, info_ptr->pcal_params); + modpng14_free(modpng14_ptr, info_ptr->pcal_params); info_ptr->pcal_params = NULL; } - info_ptr->valid &= ~PNG_INFO_pCAL; + info_ptr->valid &= ~MODPNG14_INFO_pCAL; } #endif -#if defined(PNG_iCCP_SUPPORTED) +#if defined(MODPNG14_iCCP_SUPPORTED) /* free any iCCP entry */ -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_ICCP) & info_ptr->free_me) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_ICCP) & info_ptr->free_me) #else -if (mask & PNG_FREE_ICCP) +if (mask & MODPNG14_FREE_ICCP) #endif { - png_free(png_ptr, info_ptr->iccp_name); - png_free(png_ptr, info_ptr->iccp_profile); + modpng14_free(modpng14_ptr, info_ptr->iccp_name); + modpng14_free(modpng14_ptr, info_ptr->iccp_profile); info_ptr->iccp_name = NULL; info_ptr->iccp_profile = NULL; - info_ptr->valid &= ~PNG_INFO_iCCP; + info_ptr->valid &= ~MODPNG14_INFO_iCCP; } #endif -#if defined(PNG_sPLT_SUPPORTED) +#if defined(MODPNG14_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) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_SPLT) & info_ptr->free_me) #else -if (mask & PNG_FREE_SPLT) +if (mask & MODPNG14_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); + modpng14_free(modpng14_ptr, info_ptr->splt_palettes[num].name); + modpng14_free(modpng14_ptr, info_ptr->splt_palettes[num].entries); info_ptr->splt_palettes[num].name = NULL; info_ptr->splt_palettes[num].entries = NULL; } @@ -454,29 +454,29 @@ { int i; for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) - png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_SPLT, i); - png_free(png_ptr, info_ptr->splt_palettes); + modpng14_free(modpng14_ptr, info_ptr->splt_palettes); info_ptr->splt_palettes = NULL; info_ptr->splt_palettes_num = 0; } - info_ptr->valid &= ~PNG_INFO_sPLT; + info_ptr->valid &= ~MODPNG14_INFO_sPLT; } } #endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_UNKN) & info_ptr->free_me) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_UNKN) & info_ptr->free_me) #else -if (mask & PNG_FREE_UNKN) +if (mask & MODPNG14_FREE_UNKN) #endif { if (num != -1) { if(info_ptr->unknown_chunks) { - png_free(png_ptr, info_ptr->unknown_chunks[num].data); + modpng14_free(modpng14_ptr, info_ptr->unknown_chunks[num].data); info_ptr->unknown_chunks[num].data = NULL; } } @@ -487,9 +487,9 @@ 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); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_UNKN, i); - png_free(png_ptr, info_ptr->unknown_chunks); + modpng14_free(modpng14_ptr, info_ptr->unknown_chunks); info_ptr->unknown_chunks = NULL; info_ptr->unknown_chunks_num = 0; } @@ -497,45 +497,45 @@ } #endif -#if defined(PNG_hIST_SUPPORTED) +#if defined(MODPNG14_hIST_SUPPORTED) /* free any hIST entry */ -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_HIST) & info_ptr->free_me) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_HIST) & info_ptr->free_me) #else -if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST)) +if ((mask & MODPNG14_FREE_HIST) && (modpng14_ptr->flags & MODPNG14_FLAG_FREE_HIST)) #endif { - png_free(png_ptr, info_ptr->hist); + modpng14_free(modpng14_ptr, info_ptr->hist); info_ptr->hist = NULL; - info_ptr->valid &= ~PNG_INFO_hIST; -#ifndef PNG_FREE_ME_SUPPORTED - png_ptr->flags &= ~PNG_FLAG_FREE_HIST; + info_ptr->valid &= ~MODPNG14_INFO_hIST; +#ifndef MODPNG14_FREE_ME_SUPPORTED + modpng14_ptr->flags &= ~MODPNG14_FLAG_FREE_HIST; #endif } #endif /* free any PLTE entry that was internally allocated */ -#ifdef PNG_FREE_ME_SUPPORTED -if ((mask & PNG_FREE_PLTE) & info_ptr->free_me) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_PLTE) & info_ptr->free_me) #else -if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE)) +if ((mask & MODPNG14_FREE_PLTE) && (modpng14_ptr->flags & MODPNG14_FLAG_FREE_PLTE)) #endif { - png_zfree(png_ptr, info_ptr->palette); + modpng14_zfree(modpng14_ptr, info_ptr->palette); info_ptr->palette = NULL; - info_ptr->valid &= ~PNG_INFO_PLTE; -#ifndef PNG_FREE_ME_SUPPORTED - png_ptr->flags &= ~PNG_FLAG_FREE_PLTE; + info_ptr->valid &= ~MODPNG14_INFO_PLTE; +#ifndef MODPNG14_FREE_ME_SUPPORTED + modpng14_ptr->flags &= ~MODPNG14_FLAG_FREE_PLTE; #endif info_ptr->num_palette = 0; } -#if defined(PNG_INFO_IMAGE_SUPPORTED) +#if defined(MODPNG14_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) +#ifdef MODPNG14_FREE_ME_SUPPORTED +if ((mask & MODPNG14_FREE_ROWS) & info_ptr->free_me) #else -if (mask & PNG_FREE_ROWS) +if (mask & MODPNG14_FREE_ROWS) #endif { if(info_ptr->row_pointers) @@ -543,86 +543,86 @@ int row; for (row = 0; row < (int)info_ptr->height; row++) { - png_free(png_ptr, info_ptr->row_pointers[row]); + modpng14_free(modpng14_ptr, info_ptr->row_pointers[row]); info_ptr->row_pointers[row]=NULL; } - png_free(png_ptr, info_ptr->row_pointers); + modpng14_free(modpng14_ptr, info_ptr->row_pointers); info_ptr->row_pointers=NULL; } - info_ptr->valid &= ~PNG_INFO_IDAT; + info_ptr->valid &= ~MODPNG14_INFO_IDAT; } #endif -#ifdef PNG_FREE_ME_SUPPORTED +#ifdef MODPNG14_FREE_ME_SUPPORTED if(num == -1) info_ptr->free_me &= ~mask; else - info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL); + info_ptr->free_me &= ~(mask & ~MODPNG14_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. + * that modpng14_free() checks for NULL pointers for us. */ void /* PRIVATE */ -png_info_destroy(png_structp png_ptr, png_infop info_ptr) +modpng14_info_destroy(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_debug(1, "in png_info_destroy\n"); + modpng14_debug(1, "in modpng14_info_destroy\n"); - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_ALL, -1); -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->num_chunk_list) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) + if (modpng14_ptr->num_chunk_list) { - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - png_ptr->num_chunk_list=0; + modpng14_free(modpng14_ptr, modpng14_ptr->chunk_list); + modpng14_ptr->chunk_list=NULL; + modpng14_ptr->num_chunk_list=0; } #endif - png_info_init_3(&info_ptr, sizeof(png_info)); + modpng14_info_init_3(&info_ptr, sizeof(modpng14_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. + * pointer before modpng14_write_destroy() or modpng14_read_destroy() are called. */ -png_voidp PNGAPI -png_get_io_ptr(png_structp png_ptr) +modpng14_voidp MODPNG14API +modpng14_get_io_ptr(modpng14_structp modpng14_ptr) { - return (png_ptr->io_ptr); + return (modpng14_ptr->io_ptr); } -#if !defined(PNG_NO_STDIO) +#if !defined(MODPNG14_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 + * use your own read or write routines, you can call either modpng14_set_read_fn() + * or modpng14_set_write_fn() instead of modpng14_init_io(). If you have defined + * MODPNG14_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) +void MODPNG14API +modpng14_init_io(modpng14_structp modpng14_ptr, modpng14_FILE_p fp) { - png_debug(1, "in png_init_io\n"); - png_ptr->io_ptr = (png_voidp)fp; + modpng14_debug(1, "in modpng14_init_io\n"); + modpng14_ptr->io_ptr = (modpng14_voidp)fp; } #endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) +#if defined(MODPNG14_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) +modpng14_charp MODPNG14API +modpng14_convert_to_rfc1123(modpng14_structp modpng14_ptr, modpng14_timep ptime) { - static PNG_CONST char short_months[12][4] = + static MODPNG14_CONST char short_months[12][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - if (png_ptr->time_buffer == NULL) + if (modpng14_ptr->time_buffer == NULL) { - png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29* + modpng14_ptr->time_buffer = (modpng14_charp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)(29* sizeof(char))); } @@ -633,7 +633,7 @@ 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, + WideCharToMultiByte(CP_ACP, 0, time_buf, -1, modpng14_ptr->time_buffer, 29, NULL, NULL); } #else @@ -644,162 +644,162 @@ 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, + modpng14_memcpy(modpng14_ptr->time_buffer, near_time_buf, 29*sizeof(char)); } #else - sprintf(png_ptr->time_buffer, "%d %s %d %02d:%02d:%02d +0000", + sprintf(modpng14_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); + return ((modpng14_charp)modpng14_ptr->time_buffer); } -#endif /* PNG_TIME_RFC1123_SUPPORTED */ +#endif /* MODPNG14_TIME_RFC1123_SUPPORTED */ #if 0 /* Signature string for a PNG file. */ -png_bytep PNGAPI -png_sig_bytes(void) +modpng14_bytep MODPNG14API +modpng14_sig_bytes(void) { - return ((png_bytep)"\211\120\116\107\015\012\032\012"); + return ((modpng14_bytep)"\211\120\116\107\015\012\032\012"); } #endif -png_charp PNGAPI -png_get_copyright(png_structp png_ptr) +modpng14_charp MODPNG14API +modpng14_get_copyright(modpng14_structp modpng14_ptr) { - if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */ - return ((png_charp) "\n libpng version 1.2.5 - October 3, 2002\n\ + if (modpng14_ptr != NULL || modpng14_ptr == NULL) /* silence compiler warning */ + return ((modpng14_charp) "\n libmodpng14 version 1.2.5 - October 3, 2002\n\ Copyright (c) 1998-2002 Glenn Randers-Pehrson\n\ Copyright (c) 1996-1997 Andreas Dilger\n\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n"); - return ((png_charp) ""); + return ((modpng14_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. + * with your application, print out MODPNG14_LIBMODPNG14_VER_STRING, which is defined + * in modpng14.h. */ -png_charp PNGAPI -png_get_libpng_ver(png_structp png_ptr) +modpng14_charp MODPNG14API +modpng14_get_libmodpng14_ver(modpng14_structp modpng14_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.5"); - return((png_charp) "1.2.5"); + /* Version of *.c files used when building libmodpng14 */ + if(modpng14_ptr != NULL) /* silence compiler warning about unused modpng14_ptr */ + return((modpng14_charp) "1.2.5"); + return((modpng14_charp) "1.2.5"); } -png_charp PNGAPI -png_get_header_ver(png_structp png_ptr) +modpng14_charp MODPNG14API +modpng14_get_header_ver(modpng14_structp modpng14_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); + /* Version of *.h files used when building libmodpng14 */ + if(modpng14_ptr != NULL) /* silence compiler warning about unused modpng14_ptr */ + return((modpng14_charp) MODPNG14_LIBMODPNG14_VER_STRING); + return((modpng14_charp) MODPNG14_LIBMODPNG14_VER_STRING); } -png_charp PNGAPI -png_get_header_version(png_structp png_ptr) +modpng14_charp MODPNG14API +modpng14_get_header_version(modpng14_structp modpng14_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); + if(modpng14_ptr != NULL) /* silence compiler warning about unused modpng14_ptr */ + return((modpng14_charp) MODPNG14_HEADER_VERSION_STRING); + return((modpng14_charp) MODPNG14_HEADER_VERSION_STRING); } -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -int PNGAPI -png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name) +#ifdef MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED +int MODPNG14API +modpng14_handle_as_unknown(modpng14_structp modpng14_ptr, modpng14_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) + modpng14_bytep p; + if((modpng14_ptr == NULL && chunk_name == NULL) || modpng14_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)) + p=modpng14_ptr->chunk_list+modpng14_ptr->num_chunk_list*5-5; + for (i = modpng14_ptr->num_chunk_list; i; i--, p-=5) + if (!modpng14_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) +/* This function, added to libmodpng14-1.0.6g, is untested. */ +int MODPNG14API +modpng14_reset_zstream(modpng14_structp modpng14_ptr) { - return (inflateReset(&png_ptr->zstream)); + return (inflateReset(&modpng14_ptr->zstream)); } -/* This function was added to libpng-1.0.7 */ -png_uint_32 PNGAPI -png_access_version_number(void) +/* This function was added to libmodpng14-1.0.7 */ +modpng14_uint_32 MODPNG14API +modpng14_access_version_number(void) { - /* Version of *.c files used when building libpng */ - return((png_uint_32) 10205L); + /* Version of *.c files used when building libmodpng14 */ + return((modpng14_uint_32) 10205L); } -#if !defined(PNG_1_0_X) -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) - /* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ -/* this INTERNAL function was added to libpng 1.2.0 */ +#if !defined(MODPNG14_1_0_X) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) + /* GRR: could add this: && defined(MODPNG14_MMX_CODE_SUPPORTED) */ +/* this INTERNAL function was added to libmodpng14 1.2.0 */ void /* PRIVATE */ -png_init_mmx_flags (png_structp png_ptr) +modpng14_init_mmx_flags (modpng14_structp modpng14_ptr) { - png_ptr->mmx_rowbytes_threshold = 0; - png_ptr->mmx_bitdepth_threshold = 0; + modpng14_ptr->mmx_rowbytes_threshold = 0; + modpng14_ptr->mmx_bitdepth_threshold = 0; -# if (defined(PNG_USE_PNGVCRD) || defined(PNG_USE_PNGGCCRD)) +# if (defined(MODPNG14_USE_PNGVCRD) || defined(MODPNG14_USE_PNGGCCRD)) - png_ptr->asm_flags |= PNG_ASM_FLAG_MMX_SUPPORT_COMPILED; + modpng14_ptr->asm_flags |= MODPNG14_ASM_FLAG_MMX_SUPPORT_COMPILED; - if (png_mmx_support() > 0) { - png_ptr->asm_flags |= PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU -# ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW - | PNG_ASM_FLAG_MMX_READ_COMBINE_ROW + if (modpng14_mmx_support() > 0) { + modpng14_ptr->asm_flags |= MODPNG14_ASM_FLAG_MMX_SUPPORT_IN_CPU +# ifdef MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW + | MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW # endif -# ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE - | PNG_ASM_FLAG_MMX_READ_INTERLACE +# ifdef MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE + | MODPNG14_ASM_FLAG_MMX_READ_INTERLACE # endif -# ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW +# ifndef MODPNG14_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 ; + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG + | MODPNG14_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; + modpng14_ptr->mmx_rowbytes_threshold = MODPNG14_MMX_ROWBYTES_THRESHOLD_DEFAULT; + modpng14_ptr->mmx_bitdepth_threshold = MODPNG14_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 ); + modpng14_ptr->asm_flags &= ~( MODPNG14_ASM_FLAG_MMX_SUPPORT_IN_CPU + | MODPNG14_MMX_READ_FLAGS + | MODPNG14_MMX_WRITE_FLAGS ); } -# else /* !((PNGVCRD || PNGGCCRD) && PNG_ASSEMBLER_CODE_SUPPORTED)) */ +# else /* !((PNGVCRD || PNGGCCRD) && MODPNG14_ASSEMBLER_CODE_SUPPORTED)) */ /* clear all MMX flags; no support is compiled in */ - png_ptr->asm_flags &= ~( PNG_MMX_FLAGS ); + modpng14_ptr->asm_flags &= ~( MODPNG14_MMX_FLAGS ); # endif /* ?(PNGVCRD || PNGGCCRD) */ } -#endif /* !(PNG_ASSEMBLER_CODE_SUPPORTED) */ +#endif /* !(MODPNG14_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) +/* this function was added to libmodpng14 1.2.0 */ +#if !defined(MODPNG14_USE_PNGGCCRD) && \ + !(defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_USE_PNGVCRD)) +int MODPNG14API +modpng14_mmx_support(void) { return -1; } #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/png.h +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/png.h @@ -1,17 +1,17 @@ -/* png.h - header file for PNG reference library +/* modpng14.h - header file for PNG reference library * - * libpng version 1.2.5 - October 3, 2002 + * libmodpng14 version 1.2.5 - October 3, 2002 * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Authors and maintainers: - * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat - * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.2.5 - October 3, 2002: Glenn + * libmodpng14 versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat + * libmodpng14 versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger + * libmodpng14 versions 0.97, January 1998, through 1.2.5 - October 3, 2002: Glenn * See also "Contributing Authors", below. * - * Note about libpng version numbers: + * Note about libmodpng14 version numbers: * * Due to various miscommunications, unforeseen code incompatibilities * and occasional factors outside the authors' control, version numbering @@ -19,7 +19,7 @@ * The following table summarizes matters since version 0.89c, which was * the first widely used release: * - * source png.h png.h shared-lib + * source modpng14.h modpng14.h shared-lib * version string int version * ------- ------ ----- ---------- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 @@ -33,7 +33,7 @@ * 0.99a-m 0.99 99 2.0.99 * 1.00 1.00 100 2.1.0 [100 should be 10000] * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] - * 1.0.1 png.h string is 10001 2.1.0 + * 1.0.1 modpng14.h string is 10001 2.1.0 * 1.0.1a-e identical to the 10002 from here on, the shared library * 1.0.2 source version) 10002 is 2.V where V is the source code * 1.0.2a-b 10003 version, except as noted. @@ -102,7 +102,7 @@ * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The - * PNG_LIBPNG_VER macro, which is not used within libpng but is available + * MODPNG14_LIBMODPNG14_VER macro, which is not used within libmodpng14 but is available * for applications, is an unsigned integer of the form xyyzz corresponding * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until @@ -110,26 +110,26 @@ * release number plus "betaNN" or "rcN". * * Binary incompatibility exists only when applications make direct access - * to the info_ptr or png_ptr members through png.h, and the compiled + * to the info_ptr or modpng14_ptr members through modpng14.h, and the compiled * application is loaded with a different version of the library. * * DLLNUM will change each time there are forward or backward changes * in binary compatibility (e.g., when a new feature is added). * - * See libpng.txt or libpng.3 for more information. The PNG specification + * See libmodpng14.txt or libmodpng14.3 for more information. The PNG specification * is available as RFC 2083 - * and as a W3C Recommendation + * and as a W3C Recommendation */ /* * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: * - * If you modify libpng you may insert additional notices immediately following + * If you modify libmodpng14 you may insert additional notices immediately following * this sentence. * - * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are + * libmodpng14 versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are - * distributed according to the same disclaimer and license as libpng-1.0.6 + * distributed according to the same disclaimer and license as libmodpng14-1.0.6 * with the following individuals added to the list of Contributing Authors * * Simon-Pierre Cadieux @@ -145,18 +145,18 @@ * 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 + * libmodpng14 versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson - * Distributed according to the same disclaimer and license as libpng-0.96, + * Distributed according to the same disclaimer and license as libmodpng14-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 + * libmodpng14 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, + * Distributed according to the same disclaimer and license as libmodpng14-0.88, * with the following individuals added to the list of Contributing Authors: * * John Bowler @@ -166,7 +166,7 @@ * Greg Roelofs * Tom Tanner * - * libpng versions 0.5, May 1995, through 0.88, January 1996, are + * libmodpng14 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" @@ -206,10 +206,10 @@ */ /* - * A "png_get_copyright" function is available, for convenient use in "about" + * A "modpng14_get_copyright" function is available, for convenient use in "about" * boxes and the like: * - * printf("%s",png_get_copyright(NULL)); + * printf("%s",modpng14_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). @@ -229,7 +229,7 @@ */ /* - * Y2K compliance in libpng: + * Y2K compliance in libmodpng14: * ========================= * * October 3, 2002 @@ -237,7 +237,7 @@ * 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 + * This is your unofficial assurance that libmodpng14 from version 0.71 and * upward through 1.2.5 are Y2K compliant. It is my belief that earlier * versions were also Y2K compliant. * @@ -246,92 +246,92 @@ * format, and will hold years up to 9999. * * The integer is - * "png_uint_16 year" in png_time_struct. + * "modpng14_uint_16 year" in modpng14_time_struct. * * The strings are - * "png_charp time_buffer" in png_struct and + * "modpng14_charp time_buffer" in modpng14_struct and * "near_time_buffer", which is a local character string in png.c. * * There are seven time-related functions: - * png.c: 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 + * png.c: modpng14_convert_to_rfc_1123() in png.c + * (formerly modpng14_convert_to_rfc_1152() in error) + * modpng14_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c + * modpng14_convert_from_time_t() in pngwrite.c + * modpng14_get_tIME() in pngget.c + * modpng14_handle_tIME() in pngrutil.c, called in pngread.c + * modpng14_set_tIME() in pngset.c + * modpng14_write_tIME() in pngwutil.c, called in pngwrite.c * * All handle dates properly in a Y2K environment. The - * png_convert_from_time_t() function calls gmtime() to convert from system + * modpng14_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() + * libmodpng14 are not passing 4-digit years into the modpng14_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 + * instead of "year - 1900" into the modpng14_convert_from_struct_tm() function, + * but this is not under our control. The libmodpng14 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 + * zlib, upon which libmodpng14 depends, is also Y2K compliant. It contains * no date-related code. * * Glenn Randers-Pehrson - * libpng maintainer + * libmodpng14 maintainer * PNG Development Group */ -#ifndef PNG_H -#define PNG_H +#ifndef MODPNG14_H +#define MODPNG14_H -/* This is not the place to learn how to use libpng. The file libpng.txt - * describes how to use libpng, and the file example.c summarizes it +/* This is not the place to learn how to use libmodpng14. The file libmodpng14.txt + * describes how to use libmodpng14, and the file example.c summarizes it * with some code on which to build. This file is useful for looking * at the actual function definitions and structure components. */ -/* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.2.5" +/* Version information for modpng14.h - this should match the version in png.c */ +#define MODPNG14_LIBMODPNG14_VER_STRING "1.2.5" -#define PNG_LIBPNG_VER_SONUM 0 -#define PNG_LIBPNG_VER_DLLNUM %DLLNUM% +#define MODPNG14_LIBMODPNG14_VER_SONUM 0 +#define MODPNG14_LIBMODPNG14_VER_DLLNUM %DLLNUM% -/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ -#define PNG_LIBPNG_VER_MAJOR 1 -#define PNG_LIBPNG_VER_MINOR 2 -#define PNG_LIBPNG_VER_RELEASE 5 +/* These should match the first 3 components of MODPNG14_LIBMODPNG14_VER_STRING: */ +#define MODPNG14_LIBMODPNG14_VER_MAJOR 1 +#define MODPNG14_LIBMODPNG14_VER_MINOR 2 +#define MODPNG14_LIBMODPNG14_VER_RELEASE 5 /* This should match the numeric part of the final component of - * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ + * MODPNG14_LIBMODPNG14_VER_STRING, omitting any leading zero: */ -#define PNG_LIBPNG_VER_BUILD 0 +#define MODPNG14_LIBMODPNG14_VER_BUILD 0 -#define PNG_LIBPNG_BUILD_ALPHA 1 -#define PNG_LIBPNG_BUILD_BETA 2 -#define PNG_LIBPNG_BUILD_RC 3 -#define PNG_LIBPNG_BUILD_STABLE 4 -#define PNG_LIBPNG_BUILD_TYPEMASK 7 -#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */ -#define PNG_LIBPNG_BUILD_TYPE 4 +#define MODPNG14_LIBMODPNG14_BUILD_ALPHA 1 +#define MODPNG14_LIBMODPNG14_BUILD_BETA 2 +#define MODPNG14_LIBMODPNG14_BUILD_RC 3 +#define MODPNG14_LIBMODPNG14_BUILD_STABLE 4 +#define MODPNG14_LIBMODPNG14_BUILD_TYPEMASK 7 +#define MODPNG14_LIBMODPNG14_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */ +#define MODPNG14_LIBMODPNG14_BUILD_TYPE 4 /* Careful here. At one time, Guy wanted to use 082, but that would be octal. * We must not include leading zeros. * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10205 /* 1.2.5 */ +#define MODPNG14_LIBMODPNG14_VER 10205 /* 1.2.5 */ -#ifndef PNG_VERSION_INFO_ONLY +#ifndef MODPNG14_VERSION_INFO_ONLY /* include the compression library's header */ #include "zlib.h" /* include all user configurable info, including optional assembler routines */ -#include "pngconf.h" +#include "modpng14conf.h" -/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ +/* Inhibit C++ name-mangling for libmodpng14 functions but not for system calls. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -342,277 +342,277 @@ * which applications aren't expected to use directly. */ -#ifndef PNG_NO_TYPECAST_NULL +#ifndef MODPNG14_NO_TYPECAST_NULL #define int_p_NULL (int *)NULL -#define png_bytep_NULL (png_bytep)NULL -#define png_bytepp_NULL (png_bytepp)NULL -#define png_doublep_NULL (png_doublep)NULL -#define png_error_ptr_NULL (png_error_ptr)NULL -#define png_flush_ptr_NULL (png_flush_ptr)NULL -#define png_free_ptr_NULL (png_free_ptr)NULL -#define png_infopp_NULL (png_infopp)NULL -#define png_malloc_ptr_NULL (png_malloc_ptr)NULL -#define png_read_status_ptr_NULL (png_read_status_ptr)NULL -#define png_rw_ptr_NULL (png_rw_ptr)NULL -#define png_structp_NULL (png_structp)NULL -#define png_uint_16p_NULL (png_uint_16p)NULL -#define png_voidp_NULL (png_voidp)NULL -#define png_write_status_ptr_NULL (png_write_status_ptr)NULL +#define modpng14_bytep_NULL (modpng14_bytep)NULL +#define modpng14_bytepp_NULL (modpng14_bytepp)NULL +#define modpng14_doublep_NULL (modpng14_doublep)NULL +#define modpng14_error_ptr_NULL (modpng14_error_ptr)NULL +#define modpng14_flush_ptr_NULL (modpng14_flush_ptr)NULL +#define modpng14_free_ptr_NULL (modpng14_free_ptr)NULL +#define modpng14_infopp_NULL (modpng14_infopp)NULL +#define modpng14_malloc_ptr_NULL (modpng14_malloc_ptr)NULL +#define modpng14_read_status_ptr_NULL (modpng14_read_status_ptr)NULL +#define modpng14_rw_ptr_NULL (modpng14_rw_ptr)NULL +#define modpng14_structp_NULL (modpng14_structp)NULL +#define modpng14_uint_16p_NULL (modpng14_uint_16p)NULL +#define modpng14_voidp_NULL (modpng14_voidp)NULL +#define modpng14_write_status_ptr_NULL (modpng14_write_status_ptr)NULL #else #define int_p_NULL NULL -#define png_bytep_NULL NULL -#define png_bytepp_NULL NULL -#define png_doublep_NULL NULL -#define png_error_ptr_NULL NULL -#define png_flush_ptr_NULL NULL -#define png_free_ptr_NULL NULL -#define png_infopp_NULL NULL -#define png_malloc_ptr_NULL NULL -#define png_read_status_ptr_NULL NULL -#define png_rw_ptr_NULL NULL -#define png_structp_NULL NULL -#define png_uint_16p_NULL NULL -#define png_voidp_NULL NULL -#define png_write_status_ptr_NULL NULL +#define modpng14_bytep_NULL NULL +#define modpng14_bytepp_NULL NULL +#define modpng14_doublep_NULL NULL +#define modpng14_error_ptr_NULL NULL +#define modpng14_flush_ptr_NULL NULL +#define modpng14_free_ptr_NULL NULL +#define modpng14_infopp_NULL NULL +#define modpng14_malloc_ptr_NULL NULL +#define modpng14_read_status_ptr_NULL NULL +#define modpng14_rw_ptr_NULL NULL +#define modpng14_structp_NULL NULL +#define modpng14_uint_16p_NULL NULL +#define modpng14_voidp_NULL NULL +#define modpng14_write_status_ptr_NULL NULL #endif -/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ -#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* variables declared in png.c - only it needs to define MODPNG14_NO_EXTERN */ +#if !defined(MODPNG14_NO_EXTERN) || defined(MODPNG14_ALWAYS_EXTERN) /* Version information for C files, stored in png.c. This had better match * the version above. */ -#ifdef PNG_USE_GLOBAL_ARRAYS -PNG_EXPORT_VAR (const char) png_libpng_ver[18]; +#ifdef MODPNG14_USE_GLOBAL_ARRAYS +MODPNG14_EXPORT_VAR (const char) modpng14_libmodpng14_ver[18]; /* need room for 99.99.99beta99z */ #else -#define png_libpng_ver png_get_header_ver(NULL) +#define modpng14_libmodpng14_ver modpng14_get_header_ver(NULL) #endif -#ifdef PNG_USE_GLOBAL_ARRAYS +#ifdef MODPNG14_USE_GLOBAL_ARRAYS /* This was removed in version 1.0.5c */ /* Structures to facilitate easy interlacing. See png.c for more details */ -PNG_EXPORT_VAR (const int FARDATA) png_pass_start[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_inc[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_ystart[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_yinc[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_mask[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_dsp_mask[7]; -#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW -PNG_EXPORT_VAR (const int FARDATA) png_pass_width[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_start[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_inc[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_ystart[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_yinc[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_mask[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_dsp_mask[7]; +#ifdef MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_width[7]; #endif /* This isn't currently used. If you need it, see png.c for more details. -PNG_EXPORT_VAR (const int FARDATA) png_pass_height[7]; +MODPNG14_EXPORT_VAR (const int FARDATA) modpng14_pass_height[7]; */ #endif -#endif /* PNG_NO_EXTERN */ +#endif /* MODPNG14_NO_EXTERN */ /* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to - * be png_byte or png_uint_16 (as defined below). + * be modpng14_byte or modpng14_uint_16 (as defined below). */ -typedef struct png_color_struct +typedef struct modpng14_color_struct { - png_byte red; - png_byte green; - png_byte blue; -} png_color; -typedef png_color FAR * png_colorp; -typedef png_color FAR * FAR * png_colorpp; + modpng14_byte red; + modpng14_byte green; + modpng14_byte blue; +} modpng14_color; +typedef modpng14_color FAR * modpng14_colorp; +typedef modpng14_color FAR * FAR * modpng14_colorpp; -typedef struct png_color_16_struct +typedef struct modpng14_color_16_struct { - png_byte index; /* used for palette files */ - png_uint_16 red; /* for use in red green blue files */ - png_uint_16 green; - png_uint_16 blue; - png_uint_16 gray; /* for use in grayscale files */ -} png_color_16; -typedef png_color_16 FAR * png_color_16p; -typedef png_color_16 FAR * FAR * png_color_16pp; + modpng14_byte index; /* used for palette files */ + modpng14_uint_16 red; /* for use in red green blue files */ + modpng14_uint_16 green; + modpng14_uint_16 blue; + modpng14_uint_16 gray; /* for use in grayscale files */ +} modpng14_color_16; +typedef modpng14_color_16 FAR * modpng14_color_16p; +typedef modpng14_color_16 FAR * FAR * modpng14_color_16pp; -typedef struct png_color_8_struct +typedef struct modpng14_color_8_struct { - png_byte red; /* for use in red green blue files */ - png_byte green; - png_byte blue; - png_byte gray; /* for use in grayscale files */ - png_byte alpha; /* for alpha channel files */ -} png_color_8; -typedef png_color_8 FAR * png_color_8p; -typedef png_color_8 FAR * FAR * png_color_8pp; + modpng14_byte red; /* for use in red green blue files */ + modpng14_byte green; + modpng14_byte blue; + modpng14_byte gray; /* for use in grayscale files */ + modpng14_byte alpha; /* for alpha channel files */ +} modpng14_color_8; +typedef modpng14_color_8 FAR * modpng14_color_8p; +typedef modpng14_color_8 FAR * FAR * modpng14_color_8pp; /* * The following two structures are used for the in-core representation * of sPLT chunks. */ -typedef struct png_sPLT_entry_struct +typedef struct modpng14_sPLT_entry_struct { - png_uint_16 red; - png_uint_16 green; - png_uint_16 blue; - png_uint_16 alpha; - png_uint_16 frequency; -} png_sPLT_entry; -typedef png_sPLT_entry FAR * png_sPLT_entryp; -typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp; + modpng14_uint_16 red; + modpng14_uint_16 green; + modpng14_uint_16 blue; + modpng14_uint_16 alpha; + modpng14_uint_16 frequency; +} modpng14_sPLT_entry; +typedef modpng14_sPLT_entry FAR * modpng14_sPLT_entryp; +typedef modpng14_sPLT_entry FAR * FAR * modpng14_sPLT_entrypp; /* When the depth of the sPLT palette is 8 bits, the color and alpha samples * occupy the LSB of their respective members, and the MSB of each member * is zero-filled. The frequency member always occupies the full 16 bits. */ -typedef struct png_sPLT_struct +typedef struct modpng14_sPLT_struct { - png_charp name; /* palette name */ - png_byte depth; /* depth of palette samples */ - png_sPLT_entryp entries; /* palette entries */ - png_int_32 nentries; /* number of palette entries */ -} png_sPLT_t; -typedef png_sPLT_t FAR * png_sPLT_tp; -typedef png_sPLT_t FAR * FAR * png_sPLT_tpp; + modpng14_charp name; /* palette name */ + modpng14_byte depth; /* depth of palette samples */ + modpng14_sPLT_entryp entries; /* palette entries */ + modpng14_int_32 nentries; /* number of palette entries */ +} modpng14_sPLT_t; +typedef modpng14_sPLT_t FAR * modpng14_sPLT_tp; +typedef modpng14_sPLT_t FAR * FAR * modpng14_sPLT_tpp; -#ifdef PNG_TEXT_SUPPORTED -/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, +#ifdef MODPNG14_TEXT_SUPPORTED +/* modpng14_text holds the contents of a text/ztxt/itxt chunk in a PNG file, * and whether that contents is compressed or not. The "key" field * points to a regular zero-terminated C string. The "text", "lang", and * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. - * However, the * structure returned by png_get_text() will always contain + * However, the * structure returned by modpng14_get_text() will always contain * regular zero-terminated C strings (possibly empty), never NULL pointers, * so they can be safely used in printf() and other string-handling functions. */ -typedef struct png_text_struct +typedef struct modpng14_text_struct { int compression; /* compression value: -1: tEXt, none 0: zTXt, deflate 1: iTXt, none 2: iTXt, deflate */ - png_charp key; /* keyword, 1-79 character description of "text" */ - png_charp text; /* comment, may be an empty string (ie "") + modpng14_charp key; /* keyword, 1-79 character description of "text" */ + modpng14_charp text; /* comment, may be an empty string (ie "") or a NULL pointer */ - png_size_t text_length; /* length of the text string */ -#ifdef PNG_iTXt_SUPPORTED - png_size_t itxt_length; /* length of the itxt string */ - png_charp lang; /* language code, 0-79 characters + modpng14_size_t text_length; /* length of the text string */ +#ifdef MODPNG14_iTXt_SUPPORTED + modpng14_size_t itxt_length; /* length of the itxt string */ + modpng14_charp lang; /* language code, 0-79 characters or a NULL pointer */ - png_charp lang_key; /* keyword translated UTF-8 string, 0 or more + modpng14_charp lang_key; /* keyword translated UTF-8 string, 0 or more chars or a NULL pointer */ #endif -} png_text; -typedef png_text FAR * png_textp; -typedef png_text FAR * FAR * png_textpp; +} modpng14_text; +typedef modpng14_text FAR * modpng14_textp; +typedef modpng14_text FAR * FAR * modpng14_textpp; #endif /* Supported compression types for text in PNG files (tEXt, and zTXt). - * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ -#define PNG_TEXT_COMPRESSION_NONE_WR -3 -#define PNG_TEXT_COMPRESSION_zTXt_WR -2 -#define PNG_TEXT_COMPRESSION_NONE -1 -#define PNG_TEXT_COMPRESSION_zTXt 0 -#define PNG_ITXT_COMPRESSION_NONE 1 -#define PNG_ITXT_COMPRESSION_zTXt 2 -#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ + * The values of the MODPNG14_TEXT_COMPRESSION_ defines should NOT be changed. */ +#define MODPNG14_TEXT_COMPRESSION_NONE_WR -3 +#define MODPNG14_TEXT_COMPRESSION_zTXt_WR -2 +#define MODPNG14_TEXT_COMPRESSION_NONE -1 +#define MODPNG14_TEXT_COMPRESSION_zTXt 0 +#define MODPNG14_ITXT_COMPRESSION_NONE 1 +#define MODPNG14_ITXT_COMPRESSION_zTXt 2 +#define MODPNG14_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ -/* png_time is a way to hold the time in an machine independent way. +/* modpng14_time is a way to hold the time in an machine independent way. * Two conversions are provided, both from time_t and struct tm. There * is no portable way to convert to either of these structures, as far * as I know. If you know of a portable way, send it to me. As a side * note - PNG has always been Year 2000 compliant! */ -typedef struct png_time_struct +typedef struct modpng14_time_struct { - png_uint_16 year; /* full year, as in, 1995 */ - png_byte month; /* month of year, 1 - 12 */ - png_byte day; /* day of month, 1 - 31 */ - png_byte hour; /* hour of day, 0 - 23 */ - png_byte minute; /* minute of hour, 0 - 59 */ - png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ -} png_time; -typedef png_time FAR * png_timep; -typedef png_time FAR * FAR * png_timepp; + modpng14_uint_16 year; /* full year, as in, 1995 */ + modpng14_byte month; /* month of year, 1 - 12 */ + modpng14_byte day; /* day of month, 1 - 31 */ + modpng14_byte hour; /* hour of day, 0 - 23 */ + modpng14_byte minute; /* minute of hour, 0 - 59 */ + modpng14_byte second; /* second of minute, 0 - 60 (for leap seconds) */ +} modpng14_time; +typedef modpng14_time FAR * modpng14_timep; +typedef modpng14_time FAR * FAR * modpng14_timepp; -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -/* png_unknown_chunk is a structure to hold queued chunks for which there is +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) +/* modpng14_unknown_chunk is a structure to hold queued chunks for which there is * no specific support. The idea is that we can use this to queue * up private chunks for output even though the library doesn't actually * know about their semantics. */ -typedef struct png_unknown_chunk_t +typedef struct modpng14_unknown_chunk_t { - png_byte name[5]; - png_byte *data; - png_size_t size; + modpng14_byte name[5]; + modpng14_byte *data; + modpng14_size_t size; - /* libpng-using applications should NOT directly modify this byte. */ - png_byte location; /* mode of operation at read time */ + /* libmodpng14-using applications should NOT directly modify this byte. */ + modpng14_byte location; /* mode of operation at read time */ } -png_unknown_chunk; -typedef png_unknown_chunk FAR * png_unknown_chunkp; -typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp; +modpng14_unknown_chunk; +typedef modpng14_unknown_chunk FAR * modpng14_unknown_chunkp; +typedef modpng14_unknown_chunk FAR * FAR * modpng14_unknown_chunkpp; #endif -/* png_info is a structure that holds the information in a PNG file so +/* modpng14_info is a structure that holds the information in a PNG file so * that the application can find out the characteristics of the image. * If you are reading the file, this structure will tell you what is * in the PNG file. If you are writing the file, fill in the information - * you want to put into the PNG file, then call png_write_info(). + * you want to put into the PNG file, then call modpng14_write_info(). * The names chosen should be very close to the PNG specification, so * consult that document for information about the meaning of each field. * - * With libpng < 0.95, it was only possible to directly set and read the - * the values in the png_info_struct, which meant that the contents and - * order of the values had to remain fixed. With libpng 0.95 and later, + * With libmodpng14 < 0.95, it was only possible to directly set and read the + * the values in the modpng14_info_struct, which meant that the contents and + * order of the values had to remain fixed. With libmodpng14 0.95 and later, * however, there are now functions that abstract the contents of - * png_info_struct from the application, so this makes it easier to use - * libpng with dynamic libraries, and even makes it possible to use - * libraries that don't have all of the libpng ancillary chunk-handing + * modpng14_info_struct from the application, so this makes it easier to use + * libmodpng14 with dynamic libraries, and even makes it possible to use + * libraries that don't have all of the libmodpng14 ancillary chunk-handing * functionality. * - * In any case, the order of the parameters in png_info_struct should NOT + * In any case, the order of the parameters in modpng14_info_struct should NOT * be changed for as long as possible to keep compatibility with applications - * that use the old direct-access method with png_info_struct. + * that use the old direct-access method with modpng14_info_struct. * * The following members may have allocated storage attached that should be * cleaned up before the structure is discarded: palette, trans, text, * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these * are automatically freed when the info structure is deallocated, if they were - * allocated internally by libpng. This behavior can be changed by means - * of the png_data_freer() function. + * allocated internally by libmodpng14. This behavior can be changed by means + * of the modpng14_data_freer() function. * * More allocation details: all the chunk-reading functions that - * change these members go through the corresponding png_set_* + * change these members go through the corresponding modpng14_set_* * functions. A function to clear these members is available: see - * png_free_data(). The png_set_* functions do not depend on being + * modpng14_free_data(). The modpng14_set_* functions do not depend on being * able to point info structure members to any of the storage they are - * passed (they make their own copies), EXCEPT that the png_set_text + * passed (they make their own copies), EXCEPT that the modpng14_set_text * functions use the same storage passed to them in the text_ptr or - * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns + * itxt_ptr structure argument, and the modpng14_set_rows and modpng14_set_unknowns * functions do not make their own copies. */ -typedef struct png_info_struct +typedef struct modpng14_info_struct { /* the following are necessary for every PNG file */ - png_uint_32 width; /* width of image in pixels (from IHDR) */ - png_uint_32 height; /* height of image in pixels (from IHDR) */ - png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ - png_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ - png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ - png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ - png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ - png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ - png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ + modpng14_uint_32 width; /* width of image in pixels (from IHDR) */ + modpng14_uint_32 height; /* height of image in pixels (from IHDR) */ + modpng14_uint_32 valid; /* valid chunk data (see MODPNG14_INFO_ below) */ + modpng14_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ + modpng14_colorp palette; /* array of color values (valid & MODPNG14_INFO_PLTE) */ + modpng14_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ + modpng14_uint_16 num_trans; /* number of transparent palette color (tRNS) */ + modpng14_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ + modpng14_byte color_type; /* see MODPNG14_COLOR_TYPE_ below (from IHDR) */ /* The following three should have been named *_method not *_type */ - png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ - png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ - png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + modpng14_byte compression_type; /* must be MODPNG14_COMPRESSION_TYPE_BASE (IHDR) */ + modpng14_byte filter_type; /* must be MODPNG14_FILTER_TYPE_BASE (from IHDR) */ + modpng14_byte interlace_type; /* One of MODPNG14_INTERLACE_NONE, MODPNG14_INTERLACE_ADAM7 */ /* The following is informational only on read, and not used on writes. */ - png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte spare_byte; /* to align the data, and for future use */ - png_byte signature[8]; /* magic bytes read by libpng from start of file */ + modpng14_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ + modpng14_byte pixel_depth; /* number of bits per pixel */ + modpng14_byte spare_byte; /* to align the data, and for future use */ + modpng14_byte signature[8]; /* magic bytes read by libmodpng14 from start of file */ /* The rest of the data is optional. If you are reading, check the * valid field to see if the information in these are valid. If you @@ -620,21 +620,21 @@ * and initialize the appropriate fields below. */ -#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_gAMA_SUPPORTED) && defined(MODPNG14_FLOATING_POINT_SUPPORTED) /* The gAMA chunk describes the gamma characteristics of the system * on which the image was created, normally in the range [1.0, 2.5]. - * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. + * Data is valid if (valid & MODPNG14_INFO_gAMA) is non-zero. */ - float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */ + float gamma; /* gamma value of image, if (valid & MODPNG14_INFO_gAMA) */ #endif -#if defined(PNG_sRGB_SUPPORTED) +#if defined(MODPNG14_sRGB_SUPPORTED) /* GR-P, 0.96a */ - /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ - png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ + /* Data valid if (valid & MODPNG14_INFO_sRGB) non-zero. */ + modpng14_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ #endif -#if defined(PNG_TEXT_SUPPORTED) +#if defined(MODPNG14_TEXT_SUPPORTED) /* The tEXt, and zTXt chunks contain human-readable textual data in * uncompressed, compressed, and optionally compressed forms, respectively. * The data in "text" is an array of pointers to uncompressed, @@ -645,28 +645,28 @@ */ int num_text; /* number of comments read/to write */ int max_text; /* current size of text array */ - png_textp text; /* array of comments read/to write */ -#endif /* PNG_TEXT_SUPPORTED */ + modpng14_textp text; /* array of comments read/to write */ +#endif /* MODPNG14_TEXT_SUPPORTED */ -#if defined(PNG_tIME_SUPPORTED) +#if defined(MODPNG14_tIME_SUPPORTED) /* The tIME chunk holds the last time the displayed image data was - * modified. See the png_time struct for the contents of this struct. + * modified. See the modpng14_time struct for the contents of this struct. */ - png_time mod_time; + modpng14_time mod_time; #endif -#if defined(PNG_sBIT_SUPPORTED) +#if defined(MODPNG14_sBIT_SUPPORTED) /* The sBIT chunk specifies the number of significant high-order bits * in the pixel data. Values are in the range [1, bit_depth], and are * only specified for the channels in the pixel data. The contents of * the low-order bits is not specified. Data is valid if - * (valid & PNG_INFO_sBIT) is non-zero. + * (valid & MODPNG14_INFO_sBIT) is non-zero. */ - png_color_8 sig_bit; /* significant bits in color channels */ + modpng14_color_8 sig_bit; /* significant bits in color channels */ #endif -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ -defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_tRNS_SUPPORTED) || defined(MODPNG14_READ_EXPAND_SUPPORTED) || \ +defined(MODPNG14_READ_BACKGROUND_SUPPORTED) /* The tRNS chunk supplies transparency data for paletted images and * other image types that don't need a full alpha channel. There are * "num_trans" transparency values for a paletted image, stored in the @@ -674,61 +674,61 @@ * for the data are in the range [0, 255], ranging from fully transparent * to fully opaque, respectively. For non-paletted images, there is a * single color specified that should be treated as fully transparent. - * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. + * Data is valid if (valid & MODPNG14_INFO_tRNS) is non-zero. */ - png_bytep trans; /* transparent values for paletted image */ - png_color_16 trans_values; /* transparent color for non-palette image */ + modpng14_bytep trans; /* transparent values for paletted image */ + modpng14_color_16 trans_values; /* transparent color for non-palette image */ #endif -#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_bKGD_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) /* The bKGD chunk gives the suggested image background color if the * display program does not have its own background color and the image * is needs to composited onto a background before display. The colors * in "background" are normally in the same color space/depth as the - * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. + * pixel data. Data is valid if (valid & MODPNG14_INFO_bKGD) is non-zero. */ - png_color_16 background; + modpng14_color_16 background; #endif -#if defined(PNG_oFFs_SUPPORTED) +#if defined(MODPNG14_oFFs_SUPPORTED) /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards * and downwards from the top-left corner of the display, page, or other - * application-specific co-ordinate space. See the PNG_OFFSET_ defines - * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. + * application-specific co-ordinate space. See the MODPNG14_OFFSET_ defines + * below for the unit types. Valid if (valid & MODPNG14_INFO_oFFs) non-zero. */ - png_int_32 x_offset; /* x offset on page */ - png_int_32 y_offset; /* y offset on page */ - png_byte offset_unit_type; /* offset units type */ + modpng14_int_32 x_offset; /* x offset on page */ + modpng14_int_32 y_offset; /* y offset on page */ + modpng14_byte offset_unit_type; /* offset units type */ #endif -#if defined(PNG_pHYs_SUPPORTED) +#if defined(MODPNG14_pHYs_SUPPORTED) /* The pHYs chunk gives the physical pixel density of the image for - * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ - * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. + * display or printing in "phys_unit_type" units (see MODPNG14_RESOLUTION_ + * defines below). Data is valid if (valid & MODPNG14_INFO_pHYs) is non-zero. */ - png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ - png_uint_32 y_pixels_per_unit; /* vertical pixel density */ - png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ + modpng14_uint_32 x_pixels_per_unit; /* horizontal pixel density */ + modpng14_uint_32 y_pixels_per_unit; /* vertical pixel density */ + modpng14_byte phys_unit_type; /* resolution type (see MODPNG14_RESOLUTION_ below) */ #endif -#if defined(PNG_hIST_SUPPORTED) +#if defined(MODPNG14_hIST_SUPPORTED) /* The hIST chunk contains the relative frequency or importance of the * various palette entries, so that a viewer can intelligently select a * reduced-color palette, if required. Data is an array of "num_palette" - * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) + * values in the range [0,65535]. Data valid if (valid & MODPNG14_INFO_hIST) * is non-zero. */ - png_uint_16p hist; + modpng14_uint_16p hist; #endif -#ifdef PNG_cHRM_SUPPORTED +#ifdef MODPNG14_cHRM_SUPPORTED /* The cHRM chunk describes the CIE color characteristics of the monitor * on which the PNG was created. This data allows the viewer to do gamut * mapping of the input image to ensure that the viewer sees the same * colors in the image as the creator. Values are in the range - * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. + * [0.0, 0.8]. Data valid if (valid & MODPNG14_INFO_cHRM) non-zero. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED float x_white; float y_white; float x_red; @@ -740,270 +740,270 @@ #endif #endif -#if defined(PNG_pCAL_SUPPORTED) +#if defined(MODPNG14_pCAL_SUPPORTED) /* The pCAL chunk describes a transformation between the stored pixel * values and original physical data values used to create the image. * The integer range [0, 2^bit_depth - 1] maps to the floating-point * range given by [pcal_X0, pcal_X1], and are further transformed by a * (possibly non-linear) transformation function given by "pcal_type" - * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ + * and "pcal_params" into "pcal_units". Please see the MODPNG14_EQUATION_ * defines below, and the PNG-Group's PNG extensions document for a * complete description of the transformations and how they should be * implemented, and for a description of the ASCII parameter strings. - * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. + * Data values are valid if (valid & MODPNG14_INFO_pCAL) non-zero. */ - png_charp pcal_purpose; /* pCAL chunk description string */ - png_int_32 pcal_X0; /* minimum value */ - png_int_32 pcal_X1; /* maximum value */ - png_charp pcal_units; /* Latin-1 string giving physical units */ - png_charpp pcal_params; /* ASCII strings containing parameter values */ - png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ - png_byte pcal_nparams; /* number of parameters given in pcal_params */ + modpng14_charp pcal_purpose; /* pCAL chunk description string */ + modpng14_int_32 pcal_X0; /* minimum value */ + modpng14_int_32 pcal_X1; /* maximum value */ + modpng14_charp pcal_units; /* Latin-1 string giving physical units */ + modpng14_charpp pcal_params; /* ASCII strings containing parameter values */ + modpng14_byte pcal_type; /* equation type (see MODPNG14_EQUATION_ below) */ + modpng14_byte pcal_nparams; /* number of parameters given in pcal_params */ #endif -/* New members added in libpng-1.0.6 */ -#ifdef PNG_FREE_ME_SUPPORTED - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +/* New members added in libmodpng14-1.0.6 */ +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_uint_32 free_me; /* flags items libmodpng14 is responsible for freeing */ #endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) /* storage for unknown chunks that the library doesn't recognize. */ - png_unknown_chunkp unknown_chunks; - png_size_t unknown_chunks_num; + modpng14_unknown_chunkp unknown_chunks; + modpng14_size_t unknown_chunks_num; #endif -#if defined(PNG_iCCP_SUPPORTED) +#if defined(MODPNG14_iCCP_SUPPORTED) /* iCCP chunk data. */ - png_charp iccp_name; /* profile name */ - png_charp iccp_profile; /* International Color Consortium profile data */ - /* Note to maintainer: should be png_bytep */ - png_uint_32 iccp_proflen; /* ICC profile data length */ - png_byte iccp_compression; /* Always zero */ + modpng14_charp iccp_name; /* profile name */ + modpng14_charp iccp_profile; /* International Color Consortium profile data */ + /* Note to maintainer: should be modpng14_bytep */ + modpng14_uint_32 iccp_proflen; /* ICC profile data length */ + modpng14_byte iccp_compression; /* Always zero */ #endif -#if defined(PNG_sPLT_SUPPORTED) +#if defined(MODPNG14_sPLT_SUPPORTED) /* data on sPLT chunks (there may be more than one). */ - png_sPLT_tp splt_palettes; - png_uint_32 splt_palettes_num; + modpng14_sPLT_tp splt_palettes; + modpng14_uint_32 splt_palettes_num; #endif -#if defined(PNG_sCAL_SUPPORTED) +#if defined(MODPNG14_sCAL_SUPPORTED) /* The sCAL chunk describes the actual physical dimensions of the * subject matter of the graphic. The chunk contains a unit specification * a byte value, and two ASCII strings representing floating-point * values. The values are width and height corresponsing to one pixel * in the image. This external representation is converted to double - * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. + * here. Data values are valid if (valid & MODPNG14_INFO_sCAL) is non-zero. */ - png_byte scal_unit; /* unit of physical scale */ -#ifdef PNG_FLOATING_POINT_SUPPORTED + modpng14_byte scal_unit; /* unit of physical scale */ +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED double scal_pixel_width; /* width of one pixel */ double scal_pixel_height; /* height of one pixel */ #endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_charp scal_s_width; /* string containing height */ - png_charp scal_s_height; /* string containing width */ +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_charp scal_s_width; /* string containing height */ + modpng14_charp scal_s_height; /* string containing width */ #endif #endif -#if defined(PNG_INFO_IMAGE_SUPPORTED) - /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ - /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ - png_bytepp row_pointers; /* the image bits */ +#if defined(MODPNG14_INFO_IMAGE_SUPPORTED) + /* Memory has been allocated if (valid & MODPNG14_ALLOCATED_INFO_ROWS) non-zero */ + /* Data valid if (valid & MODPNG14_INFO_IDAT) non-zero */ + modpng14_bytepp row_pointers; /* the image bits */ #endif -#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) - png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */ +#if defined(MODPNG14_FIXED_POINT_SUPPORTED) && defined(MODPNG14_gAMA_SUPPORTED) + modpng14_fixed_point int_gamma; /* gamma of image, if (valid & MODPNG14_INFO_gAMA) */ #endif -#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) - png_fixed_point int_x_white; - png_fixed_point int_y_white; - png_fixed_point int_x_red; - png_fixed_point int_y_red; - png_fixed_point int_x_green; - png_fixed_point int_y_green; - png_fixed_point int_x_blue; - png_fixed_point int_y_blue; +#if defined(MODPNG14_cHRM_SUPPORTED) && defined(MODPNG14_FIXED_POINT_SUPPORTED) + modpng14_fixed_point int_x_white; + modpng14_fixed_point int_y_white; + modpng14_fixed_point int_x_red; + modpng14_fixed_point int_y_red; + modpng14_fixed_point int_x_green; + modpng14_fixed_point int_y_green; + modpng14_fixed_point int_x_blue; + modpng14_fixed_point int_y_blue; #endif -} png_info; +} modpng14_info; -typedef png_info FAR * png_infop; -typedef png_info FAR * FAR * png_infopp; +typedef modpng14_info FAR * modpng14_infop; +typedef modpng14_info FAR * FAR * modpng14_infopp; /* Maximum positive integer used in PNG is (2^31)-1 */ -#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) -#define PNG_UINT_32_MAX (~((png_uint_32)0)) -#define PNG_SIZE_MAX (~((png_size_t)0)) -/* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */ -#define PNG_MAX_UINT PNG_UINT_31_MAX +#define MODPNG14_UINT_31_MAX ((modpng14_uint_32)0x7fffffffL) +#define MODPNG14_UINT_32_MAX (~((modpng14_uint_32)0)) +#define MODPNG14_SIZE_MAX (~((modpng14_size_t)0)) +/* MODPNG14_MAX_UINT is deprecated; use MODPNG14_UINT_31_MAX instead. */ +#define MODPNG14_MAX_UINT MODPNG14_UINT_31_MAX -/* These describe the color_type field in png_info. */ +/* These describe the color_type field in modpng14_info. */ /* color type masks */ -#define PNG_COLOR_MASK_PALETTE 1 -#define PNG_COLOR_MASK_COLOR 2 -#define PNG_COLOR_MASK_ALPHA 4 +#define MODPNG14_COLOR_MASK_PALETTE 1 +#define MODPNG14_COLOR_MASK_COLOR 2 +#define MODPNG14_COLOR_MASK_ALPHA 4 /* color types. Note that not all combinations are legal */ -#define PNG_COLOR_TYPE_GRAY 0 -#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) -#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) -#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) -#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) +#define MODPNG14_COLOR_TYPE_GRAY 0 +#define MODPNG14_COLOR_TYPE_PALETTE (MODPNG14_COLOR_MASK_COLOR | MODPNG14_COLOR_MASK_PALETTE) +#define MODPNG14_COLOR_TYPE_RGB (MODPNG14_COLOR_MASK_COLOR) +#define MODPNG14_COLOR_TYPE_RGB_ALPHA (MODPNG14_COLOR_MASK_COLOR | MODPNG14_COLOR_MASK_ALPHA) +#define MODPNG14_COLOR_TYPE_GRAY_ALPHA (MODPNG14_COLOR_MASK_ALPHA) /* aliases */ -#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA -#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA +#define MODPNG14_COLOR_TYPE_RGBA MODPNG14_COLOR_TYPE_RGB_ALPHA +#define MODPNG14_COLOR_TYPE_GA MODPNG14_COLOR_TYPE_GRAY_ALPHA /* This is for compression type. PNG 1.0-1.2 only define the single type. */ -#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ -#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE +#define MODPNG14_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ +#define MODPNG14_COMPRESSION_TYPE_DEFAULT MODPNG14_COMPRESSION_TYPE_BASE /* This is for filter type. PNG 1.0-1.2 only define the single type. */ -#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ -#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ -#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE +#define MODPNG14_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ +#define MODPNG14_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ +#define MODPNG14_FILTER_TYPE_DEFAULT MODPNG14_FILTER_TYPE_BASE /* These are for the interlacing type. These values should NOT be changed. */ -#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ -#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ -#define PNG_INTERLACE_LAST 2 /* Not a valid value */ +#define MODPNG14_INTERLACE_NONE 0 /* Non-interlaced image */ +#define MODPNG14_INTERLACE_ADAM7 1 /* Adam7 interlacing */ +#define MODPNG14_INTERLACE_LAST 2 /* Not a valid value */ /* These are for the oFFs chunk. These values should NOT be changed. */ -#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ -#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ -#define PNG_OFFSET_LAST 2 /* Not a valid value */ +#define MODPNG14_OFFSET_PIXEL 0 /* Offset in pixels */ +#define MODPNG14_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ +#define MODPNG14_OFFSET_LAST 2 /* Not a valid value */ /* These are for the pCAL chunk. These values should NOT be changed. */ -#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ -#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ -#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ -#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ -#define PNG_EQUATION_LAST 4 /* Not a valid value */ +#define MODPNG14_EQUATION_LINEAR 0 /* Linear transformation */ +#define MODPNG14_EQUATION_BASE_E 1 /* Exponential base e transform */ +#define MODPNG14_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ +#define MODPNG14_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ +#define MODPNG14_EQUATION_LAST 4 /* Not a valid value */ /* These are for the sCAL chunk. These values should NOT be changed. */ -#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ -#define PNG_SCALE_METER 1 /* meters per pixel */ -#define PNG_SCALE_RADIAN 2 /* radians per pixel */ -#define PNG_SCALE_LAST 3 /* Not a valid value */ +#define MODPNG14_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ +#define MODPNG14_SCALE_METER 1 /* meters per pixel */ +#define MODPNG14_SCALE_RADIAN 2 /* radians per pixel */ +#define MODPNG14_SCALE_LAST 3 /* Not a valid value */ /* These are for the pHYs chunk. These values should NOT be changed. */ -#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ -#define PNG_RESOLUTION_METER 1 /* pixels/meter */ -#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ +#define MODPNG14_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ +#define MODPNG14_RESOLUTION_METER 1 /* pixels/meter */ +#define MODPNG14_RESOLUTION_LAST 2 /* Not a valid value */ /* These are for the sRGB chunk. These values should NOT be changed. */ -#define PNG_sRGB_INTENT_PERCEPTUAL 0 -#define PNG_sRGB_INTENT_RELATIVE 1 -#define PNG_sRGB_INTENT_SATURATION 2 -#define PNG_sRGB_INTENT_ABSOLUTE 3 -#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ +#define MODPNG14_sRGB_INTENT_PERCEPTUAL 0 +#define MODPNG14_sRGB_INTENT_RELATIVE 1 +#define MODPNG14_sRGB_INTENT_SATURATION 2 +#define MODPNG14_sRGB_INTENT_ABSOLUTE 3 +#define MODPNG14_sRGB_INTENT_LAST 4 /* Not a valid value */ /* This is for text chunks */ -#define PNG_KEYWORD_MAX_LENGTH 79 +#define MODPNG14_KEYWORD_MAX_LENGTH 79 /* Maximum number of entries in PLTE/sPLT/tRNS arrays */ -#define PNG_MAX_PALETTE_LENGTH 256 +#define MODPNG14_MAX_PALETTE_LENGTH 256 /* These determine if an ancillary chunk's data has been successfully read * from the PNG header, or if the application has filled in the corresponding * data in the info_struct to be written into the output file. The values - * of the PNG_INFO_ defines should NOT be changed. + * of the MODPNG14_INFO_ defines should NOT be changed. */ -#define PNG_INFO_gAMA 0x0001 -#define PNG_INFO_sBIT 0x0002 -#define PNG_INFO_cHRM 0x0004 -#define PNG_INFO_PLTE 0x0008 -#define PNG_INFO_tRNS 0x0010 -#define PNG_INFO_bKGD 0x0020 -#define PNG_INFO_hIST 0x0040 -#define PNG_INFO_pHYs 0x0080 -#define PNG_INFO_oFFs 0x0100 -#define PNG_INFO_tIME 0x0200 -#define PNG_INFO_pCAL 0x0400 -#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ -#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ -#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ -#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ -#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ +#define MODPNG14_INFO_gAMA 0x0001 +#define MODPNG14_INFO_sBIT 0x0002 +#define MODPNG14_INFO_cHRM 0x0004 +#define MODPNG14_INFO_PLTE 0x0008 +#define MODPNG14_INFO_tRNS 0x0010 +#define MODPNG14_INFO_bKGD 0x0020 +#define MODPNG14_INFO_hIST 0x0040 +#define MODPNG14_INFO_pHYs 0x0080 +#define MODPNG14_INFO_oFFs 0x0100 +#define MODPNG14_INFO_tIME 0x0200 +#define MODPNG14_INFO_pCAL 0x0400 +#define MODPNG14_INFO_sRGB 0x0800 /* GR-P, 0.96a */ +#define MODPNG14_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ +#define MODPNG14_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ +#define MODPNG14_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ +#define MODPNG14_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */ -typedef struct png_row_info_struct +typedef struct modpng14_row_info_struct { - png_uint_32 width; /* width of row */ - png_uint_32 rowbytes; /* number of bytes in row */ - png_byte color_type; /* color type of row */ - png_byte bit_depth; /* bit depth of row */ - png_byte channels; /* number of channels (1, 2, 3, or 4) */ - png_byte pixel_depth; /* bits per pixel (depth * channels) */ -} png_row_info; + modpng14_uint_32 width; /* width of row */ + modpng14_uint_32 rowbytes; /* number of bytes in row */ + modpng14_byte color_type; /* color type of row */ + modpng14_byte bit_depth; /* bit depth of row */ + modpng14_byte channels; /* number of channels (1, 2, 3, or 4) */ + modpng14_byte pixel_depth; /* bits per pixel (depth * channels) */ +} modpng14_row_info; -typedef png_row_info FAR * png_row_infop; -typedef png_row_info FAR * FAR * png_row_infopp; +typedef modpng14_row_info FAR * modpng14_row_infop; +typedef modpng14_row_info FAR * FAR * modpng14_row_infopp; /* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her - * own. The png_error_ptr type should match that of user-supplied warning - * and error functions, while the png_rw_ptr type should match that of the + * own. The modpng14_error_ptr type should match that of user-supplied warning + * and error functions, while the modpng14_rw_ptr type should match that of the * user read/write data functions. */ -typedef struct png_struct_def png_struct; -typedef png_struct FAR * png_structp; +typedef struct modpng14_struct_def modpng14_struct; +typedef modpng14_struct FAR * modpng14_structp; -typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); -typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); -typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); -typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, +typedef void (MODPNG14API *modpng14_error_ptr) PNGARG((modpng14_structp, modpng14_const_charp)); +typedef void (MODPNG14API *modpng14_rw_ptr) PNGARG((modpng14_structp, modpng14_bytep, modpng14_size_t)); +typedef void (MODPNG14API *modpng14_flush_ptr) PNGARG((modpng14_structp)); +typedef void (MODPNG14API *modpng14_read_status_ptr) PNGARG((modpng14_structp, modpng14_uint_32, int)); -typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, +typedef void (MODPNG14API *modpng14_write_status_ptr) PNGARG((modpng14_structp, modpng14_uint_32, int)); -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, - png_uint_32, int)); +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED +typedef void (MODPNG14API *modpng14_progressive_info_ptr) PNGARG((modpng14_structp, modpng14_infop)); +typedef void (MODPNG14API *modpng14_progressive_end_ptr) PNGARG((modpng14_structp, modpng14_infop)); +typedef void (MODPNG14API *modpng14_progressive_row_ptr) PNGARG((modpng14_structp, modpng14_bytep, + modpng14_uint_32, int)); #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, - png_row_infop, png_bytep)); +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_LEGACY_SUPPORTED) +typedef void (MODPNG14API *modpng14_user_transform_ptr) PNGARG((modpng14_structp, + modpng14_row_infop, modpng14_bytep)); #endif -#if defined(PNG_USER_CHUNKS_SUPPORTED) -typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); +#if defined(MODPNG14_USER_CHUNKS_SUPPORTED) +typedef int (MODPNG14API *modpng14_user_chunk_ptr) PNGARG((modpng14_structp, modpng14_unknown_chunkp)); #endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) +typedef void (MODPNG14API *modpng14_unknown_chunk_ptr) PNGARG((modpng14_structp)); #endif /* Transform masks for the high-level interface */ -#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ -#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ -#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ -#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ -#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ -#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ -#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ -#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ -#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ -#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ -#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ -#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ -#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only */ +#define MODPNG14_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define MODPNG14_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define MODPNG14_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define MODPNG14_TRANSFORM_PACKING 0x0004 /* read and write */ +#define MODPNG14_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define MODPNG14_TRANSFORM_EXPAND 0x0010 /* read only */ +#define MODPNG14_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define MODPNG14_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define MODPNG14_TRANSFORM_BGR 0x0080 /* read and write */ +#define MODPNG14_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define MODPNG14_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define MODPNG14_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define MODPNG14_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only */ /* Flags for MNG supported features */ -#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 -#define PNG_FLAG_MNG_FILTER_64 0x04 -#define PNG_ALL_MNG_FEATURES 0x05 +#define MODPNG14_FLAG_MNG_EMPTY_PLTE 0x01 +#define MODPNG14_FLAG_MNG_FILTER_64 0x04 +#define MODPNG14_ALL_MNG_FEATURES 0x05 -typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); -typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); +typedef modpng14_voidp (*modpng14_malloc_ptr) PNGARG((modpng14_structp, modpng14_size_t)); +typedef void (*modpng14_free_ptr) PNGARG((modpng14_structp, modpng14_voidp)); /* The structure that holds the information to read and write PNG files. * The only people who need to care about what is inside of this are the @@ -1012,301 +1012,301 @@ * the jmp_buf. */ -struct png_struct_def +struct modpng14_struct_def { -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf jmpbuf; /* used in png_error */ +#ifdef MODPNG14_SETJMP_SUPPORTED + jmp_buf jmpbuf; /* used in modpng14_error */ #endif - png_error_ptr error_fn; /* function for printing errors and aborting */ - png_error_ptr warning_fn; /* function for printing warnings */ - png_voidp error_ptr; /* user supplied struct for error functions */ - png_rw_ptr write_data_fn; /* function for writing output data */ - png_rw_ptr read_data_fn; /* function for reading input data */ - png_voidp io_ptr; /* ptr to application struct for I/O functions */ + modpng14_error_ptr error_fn; /* function for printing errors and aborting */ + modpng14_error_ptr warning_fn; /* function for printing warnings */ + modpng14_voidp error_ptr; /* user supplied struct for error functions */ + modpng14_rw_ptr write_data_fn; /* function for writing output data */ + modpng14_rw_ptr read_data_fn; /* function for reading input data */ + modpng14_voidp io_ptr; /* ptr to application struct for I/O functions */ -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - png_user_transform_ptr read_user_transform_fn; /* user read transform */ +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) + modpng14_user_transform_ptr read_user_transform_fn; /* user read transform */ #endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_user_transform_ptr write_user_transform_fn; /* user write transform */ +#if defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) + modpng14_user_transform_ptr write_user_transform_fn; /* user write transform */ #endif -/* These were added in libpng-1.0.2 */ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_voidp user_transform_ptr; /* user supplied struct for user transform */ - png_byte user_transform_depth; /* bit depth of user transformed pixels */ - png_byte user_transform_channels; /* channels in user transformed pixels */ +/* These were added in libmodpng14-1.0.2 */ +#if defined(MODPNG14_USER_TRANSFORM_PTR_SUPPORTED) +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) + modpng14_voidp user_transform_ptr; /* user supplied struct for user transform */ + modpng14_byte user_transform_depth; /* bit depth of user transformed pixels */ + modpng14_byte user_transform_channels; /* channels in user transformed pixels */ #endif #endif - png_uint_32 mode; /* tells us where we are in the PNG file */ - png_uint_32 flags; /* flags indicating various things to libpng */ - png_uint_32 transformations; /* which transformations to perform */ + modpng14_uint_32 mode; /* tells us where we are in the PNG file */ + modpng14_uint_32 flags; /* flags indicating various things to libmodpng14 */ + modpng14_uint_32 transformations; /* which transformations to perform */ z_stream zstream; /* pointer to decompression structure (below) */ - png_bytep zbuf; /* buffer for zlib */ - png_size_t zbuf_size; /* size of zbuf */ + modpng14_bytep zbuf; /* buffer for zlib */ + modpng14_size_t zbuf_size; /* size of zbuf */ int zlib_level; /* holds zlib compression level */ int zlib_method; /* holds zlib compression method */ int zlib_window_bits; /* holds zlib compression window bits */ int zlib_mem_level; /* holds zlib compression memory level */ int zlib_strategy; /* holds zlib compression strategy */ - png_uint_32 width; /* width of image in pixels */ - png_uint_32 height; /* height of image in pixels */ - png_uint_32 num_rows; /* number of rows in current pass */ - png_uint_32 usr_width; /* width of row at start of write */ - png_uint_32 rowbytes; /* size of row in bytes */ - png_uint_32 irowbytes; /* size of current interlaced row in bytes */ - png_uint_32 iwidth; /* width of current interlaced row in pixels */ - png_uint_32 row_number; /* current row in interlace pass */ - png_bytep prev_row; /* buffer to save previous (unfiltered) row */ - png_bytep row_buf; /* buffer to save current (unfiltered) row */ - png_bytep sub_row; /* buffer to save "sub" row when filtering */ - png_bytep up_row; /* buffer to save "up" row when filtering */ - png_bytep avg_row; /* buffer to save "avg" row when filtering */ - png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ - png_row_info row_info; /* used for transformation routines */ - - png_uint_32 idat_size; /* current IDAT size for read */ - png_uint_32 crc; /* current chunk CRC value */ - png_colorp palette; /* palette from the input file */ - png_uint_16 num_palette; /* number of color entries in palette */ - png_uint_16 num_trans; /* number of transparency values */ - png_byte chunk_name[5]; /* null-terminated name of current chunk */ - png_byte compression; /* file compression type (always 0) */ - png_byte filter; /* file filter type (always 0) */ - png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ - png_byte pass; /* current interlace pass (0 - 6) */ - png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ - png_byte color_type; /* color type of file */ - png_byte bit_depth; /* bit depth of file */ - png_byte usr_bit_depth; /* bit depth of users row */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte channels; /* number of channels in file */ - png_byte usr_channels; /* channels at start of write */ - png_byte sig_bytes; /* magic bytes read/written from start of file */ - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -#ifdef PNG_LEGACY_SUPPORTED - png_byte filler; /* filler byte for pixel expansion */ + modpng14_uint_32 width; /* width of image in pixels */ + modpng14_uint_32 height; /* height of image in pixels */ + modpng14_uint_32 num_rows; /* number of rows in current pass */ + modpng14_uint_32 usr_width; /* width of row at start of write */ + modpng14_uint_32 rowbytes; /* size of row in bytes */ + modpng14_uint_32 irowbytes; /* size of current interlaced row in bytes */ + modpng14_uint_32 iwidth; /* width of current interlaced row in pixels */ + modpng14_uint_32 row_number; /* current row in interlace pass */ + modpng14_bytep prev_row; /* buffer to save previous (unfiltered) row */ + modpng14_bytep row_buf; /* buffer to save current (unfiltered) row */ + modpng14_bytep sub_row; /* buffer to save "sub" row when filtering */ + modpng14_bytep up_row; /* buffer to save "up" row when filtering */ + modpng14_bytep avg_row; /* buffer to save "avg" row when filtering */ + modpng14_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ + modpng14_row_info row_info; /* used for transformation routines */ + + modpng14_uint_32 idat_size; /* current IDAT size for read */ + modpng14_uint_32 crc; /* current chunk CRC value */ + modpng14_colorp palette; /* palette from the input file */ + modpng14_uint_16 num_palette; /* number of color entries in palette */ + modpng14_uint_16 num_trans; /* number of transparency values */ + modpng14_byte chunk_name[5]; /* null-terminated name of current chunk */ + modpng14_byte compression; /* file compression type (always 0) */ + modpng14_byte filter; /* file filter type (always 0) */ + modpng14_byte interlaced; /* MODPNG14_INTERLACE_NONE, MODPNG14_INTERLACE_ADAM7 */ + modpng14_byte pass; /* current interlace pass (0 - 6) */ + modpng14_byte do_filter; /* row filter flags (see MODPNG14_FILTER_ below ) */ + modpng14_byte color_type; /* color type of file */ + modpng14_byte bit_depth; /* bit depth of file */ + modpng14_byte usr_bit_depth; /* bit depth of users row */ + modpng14_byte pixel_depth; /* number of bits per pixel */ + modpng14_byte channels; /* number of channels in file */ + modpng14_byte usr_channels; /* channels at start of write */ + modpng14_byte sig_bytes; /* magic bytes read/written from start of file */ + +#if defined(MODPNG14_READ_FILLER_SUPPORTED) || defined(MODPNG14_WRITE_FILLER_SUPPORTED) +#ifdef MODPNG14_LEGACY_SUPPORTED + modpng14_byte filler; /* filler byte for pixel expansion */ #else - png_uint_16 filler; /* filler bytes for pixel expansion */ + modpng14_uint_16 filler; /* filler bytes for pixel expansion */ #endif #endif -#if defined(PNG_bKGD_SUPPORTED) - png_byte background_gamma_type; -# ifdef PNG_FLOATING_POINT_SUPPORTED +#if defined(MODPNG14_bKGD_SUPPORTED) + modpng14_byte background_gamma_type; +# ifdef MODPNG14_FLOATING_POINT_SUPPORTED float background_gamma; # endif - png_color_16 background; /* background color in screen gamma space */ -#if defined(PNG_READ_GAMMA_SUPPORTED) - png_color_16 background_1; /* background normalized to gamma 1.0 */ + modpng14_color_16 background; /* background color in screen gamma space */ +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + modpng14_color_16 background_1; /* background normalized to gamma 1.0 */ #endif -#endif /* PNG_bKGD_SUPPORTED */ +#endif /* MODPNG14_bKGD_SUPPORTED */ -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_flush_ptr output_flush_fn;/* Function for flushing output */ - png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ - png_uint_32 flush_rows; /* number of rows written since last flush */ +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) + modpng14_flush_ptr output_flush_fn;/* Function for flushing output */ + modpng14_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ + modpng14_uint_32 flush_rows; /* number of rows written since last flush */ #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) int gamma_shift; /* number of "insignificant" bits 16-bit gamma */ -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED float gamma; /* file gamma value */ float screen_gamma; /* screen gamma value (display_exponent) */ #endif #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep gamma_table; /* gamma table for 8-bit depth files */ - png_bytep gamma_from_1; /* converts from 1.0 to screen */ - png_bytep gamma_to_1; /* converts from file to 1.0 */ - png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ - png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ - png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) - png_color_8 sig_bit; /* significant bits in each available channel */ -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) - png_color_8 shift; /* shift for significant bit tranformation */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ - || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep trans; /* transparency values for paletted files */ - png_color_16 trans_values; /* transparency values for non-paletted files */ -#endif - - png_read_status_ptr read_row_fn; /* called after each row is decoded */ - png_write_status_ptr write_row_fn; /* called after each row is encoded */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_progressive_info_ptr info_fn; /* called after header data fully read */ - png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ - png_progressive_end_ptr end_fn; /* called after image is complete */ - png_bytep save_buffer_ptr; /* current location in save_buffer */ - png_bytep save_buffer; /* buffer for previously read data */ - png_bytep current_buffer_ptr; /* current location in current_buffer */ - png_bytep current_buffer; /* buffer for recently used data */ - png_uint_32 push_length; /* size of current input chunk */ - png_uint_32 skip_length; /* bytes to skip in input data */ - png_size_t save_buffer_size; /* amount of data now in save_buffer */ - png_size_t save_buffer_max; /* total size of save_buffer */ - png_size_t buffer_size; /* total amount of available input data */ - png_size_t current_buffer_size; /* amount of data now in current_buffer */ +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + modpng14_bytep gamma_table; /* gamma table for 8-bit depth files */ + modpng14_bytep gamma_from_1; /* converts from 1.0 to screen */ + modpng14_bytep gamma_to_1; /* converts from file to 1.0 */ + modpng14_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ + modpng14_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ + modpng14_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ +#endif + +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_sBIT_SUPPORTED) + modpng14_color_8 sig_bit; /* significant bits in each available channel */ +#endif + +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) || defined(MODPNG14_WRITE_SHIFT_SUPPORTED) + modpng14_color_8 shift; /* shift for significant bit tranformation */ +#endif + +#if defined(MODPNG14_tRNS_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) \ + || defined(MODPNG14_READ_EXPAND_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + modpng14_bytep trans; /* transparency values for paletted files */ + modpng14_color_16 trans_values; /* transparency values for non-paletted files */ +#endif + + modpng14_read_status_ptr read_row_fn; /* called after each row is decoded */ + modpng14_write_status_ptr write_row_fn; /* called after each row is encoded */ +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED + modpng14_progressive_info_ptr info_fn; /* called after header data fully read */ + modpng14_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ + modpng14_progressive_end_ptr end_fn; /* called after image is complete */ + modpng14_bytep save_buffer_ptr; /* current location in save_buffer */ + modpng14_bytep save_buffer; /* buffer for previously read data */ + modpng14_bytep current_buffer_ptr; /* current location in current_buffer */ + modpng14_bytep current_buffer; /* buffer for recently used data */ + modpng14_uint_32 push_length; /* size of current input chunk */ + modpng14_uint_32 skip_length; /* bytes to skip in input data */ + modpng14_size_t save_buffer_size; /* amount of data now in save_buffer */ + modpng14_size_t save_buffer_max; /* total size of save_buffer */ + modpng14_size_t buffer_size; /* total amount of available input data */ + modpng14_size_t current_buffer_size; /* amount of data now in current_buffer */ int process_mode; /* what push library is currently doing */ int cur_palette; /* current push library palette index */ -# if defined(PNG_TEXT_SUPPORTED) - png_size_t current_text_size; /* current size of text input data */ - png_size_t current_text_left; /* how much text left to read in input */ - png_charp current_text; /* current text chunk buffer */ - png_charp current_text_ptr; /* current location in current_text */ -# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ +# if defined(MODPNG14_TEXT_SUPPORTED) + modpng14_size_t current_text_size; /* current size of text input data */ + modpng14_size_t current_text_left; /* how much text left to read in input */ + modpng14_charp current_text; /* current text chunk buffer */ + modpng14_charp current_text_ptr; /* current location in current_text */ +# endif /* MODPNG14_PROGRESSIVE_READ_SUPPORTED && MODPNG14_TEXT_SUPPORTED */ -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ +#endif /* MODPNG14_PROGRESSIVE_READ_SUPPORTED */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* for the Borland special 64K segment handler */ - png_bytepp offset_table_ptr; - png_bytep offset_table; - png_uint_16 offset_table_number; - png_uint_16 offset_table_count; - png_uint_16 offset_table_count_free; + modpng14_bytepp offset_table_ptr; + modpng14_bytep offset_table; + modpng14_uint_16 offset_table_number; + modpng14_uint_16 offset_table_count; + modpng14_uint_16 offset_table_count_free; #endif -#if defined(PNG_READ_DITHER_SUPPORTED) - png_bytep palette_lookup; /* lookup table for dithering */ - png_bytep dither_index; /* index translation for palette files */ +#if defined(MODPNG14_READ_DITHER_SUPPORTED) + modpng14_bytep palette_lookup; /* lookup table for dithering */ + modpng14_bytep dither_index; /* index translation for palette files */ #endif -#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) - png_uint_16p hist; /* histogram */ +#if defined(MODPNG14_READ_DITHER_SUPPORTED) || defined(MODPNG14_hIST_SUPPORTED) + modpng14_uint_16p hist; /* histogram */ #endif -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_byte heuristic_method; /* heuristic for row filter selection */ - png_byte num_prev_filters; /* number of weights for previous rows */ - png_bytep prev_filters; /* filter type(s) of previous row(s) */ - png_uint_16p filter_weights; /* weight(s) for previous line(s) */ - png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ - png_uint_16p filter_costs; /* relative filter calculation cost */ - png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + modpng14_byte heuristic_method; /* heuristic for row filter selection */ + modpng14_byte num_prev_filters; /* number of weights for previous rows */ + modpng14_bytep prev_filters; /* filter type(s) of previous row(s) */ + modpng14_uint_16p filter_weights; /* weight(s) for previous line(s) */ + modpng14_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ + modpng14_uint_16p filter_costs; /* relative filter calculation cost */ + modpng14_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ #endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_charp time_buffer; /* String to hold RFC 1123 time text */ +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) + modpng14_charp time_buffer; /* String to hold RFC 1123 time text */ #endif -/* New members added in libpng-1.0.6 */ +/* New members added in libmodpng14-1.0.6 */ -#ifdef PNG_FREE_ME_SUPPORTED - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_uint_32 free_me; /* flags items libmodpng14 is responsible for freeing */ #endif -#if defined(PNG_USER_CHUNKS_SUPPORTED) - png_voidp user_chunk_ptr; - png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ +#if defined(MODPNG14_USER_CHUNKS_SUPPORTED) + modpng14_voidp user_chunk_ptr; + modpng14_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ #endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) int num_chunk_list; - png_bytep chunk_list; + modpng14_bytep chunk_list; #endif -/* New members added in libpng-1.0.3 */ -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - png_byte rgb_to_gray_status; - /* These were changed from png_byte in libpng-1.0.6 */ - png_uint_16 rgb_to_gray_red_coeff; - png_uint_16 rgb_to_gray_green_coeff; - png_uint_16 rgb_to_gray_blue_coeff; -#endif - -/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ - defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -/* changed from png_byte to png_uint_32 at version 1.2.0 */ -#ifdef PNG_1_0_X - png_byte mng_features_permitted; +/* New members added in libmodpng14-1.0.3 */ +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) + modpng14_byte rgb_to_gray_status; + /* These were changed from modpng14_byte in libmodpng14-1.0.6 */ + modpng14_uint_16 rgb_to_gray_red_coeff; + modpng14_uint_16 rgb_to_gray_green_coeff; + modpng14_uint_16 rgb_to_gray_blue_coeff; +#endif + +/* New member added in libmodpng14-1.0.4 (renamed in 1.0.9) */ +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) || \ + defined(MODPNG14_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(MODPNG14_WRITE_EMPTY_PLTE_SUPPORTED) +/* changed from modpng14_byte to modpng14_uint_32 at version 1.2.0 */ +#ifdef MODPNG14_1_0_X + modpng14_byte mng_features_permitted; #else - png_uint_32 mng_features_permitted; -#endif /* PNG_1_0_X */ + modpng14_uint_32 mng_features_permitted; +#endif /* MODPNG14_1_0_X */ #endif -/* New member added in libpng-1.0.7 */ -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_fixed_point int_gamma; +/* New member added in libmodpng14-1.0.7 */ +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + modpng14_fixed_point int_gamma; #endif -/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_byte filter_type; +/* New member added in libmodpng14-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + modpng14_byte filter_type; #endif -#if defined(PNG_1_0_X) || (defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD)) -/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ - png_uint_32 row_buf_size; +#if defined(MODPNG14_1_0_X) || (defined(MODPNG14_DEBUG) && defined(MODPNG14_USE_PNGGCCRD)) +/* New member added in libmodpng14-1.0.10, ifdef'ed out in 1.2.0 */ + modpng14_uint_32 row_buf_size; #endif -/* New members added in libpng-1.2.0 */ -#if !defined(PNG_1_0_X) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) - png_byte mmx_bitdepth_threshold; - png_uint_32 mmx_rowbytes_threshold; - png_uint_32 asm_flags; +/* New members added in libmodpng14-1.2.0 */ +#if !defined(MODPNG14_1_0_X) && defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) + modpng14_byte mmx_bitdepth_threshold; + modpng14_uint_32 mmx_rowbytes_threshold; + modpng14_uint_32 asm_flags; #endif -/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -#ifdef PNG_USER_MEM_SUPPORTED - png_voidp mem_ptr; /* user supplied struct for mem functions */ - png_malloc_ptr malloc_fn; /* function for allocating memory */ - png_free_ptr free_fn; /* function for freeing memory */ +/* New members added in libmodpng14-1.0.2 but first enabled by default in 1.2.0 */ +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_voidp mem_ptr; /* user supplied struct for mem functions */ + modpng14_malloc_ptr malloc_fn; /* function for allocating memory */ + modpng14_free_ptr free_fn; /* function for freeing memory */ #endif -/* New member added in libpng-1.0.13 and 1.2.0 */ - png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ +/* New member added in libmodpng14-1.0.13 and 1.2.0 */ + modpng14_bytep big_row_buf; /* buffer to save current (unfiltered) row */ -#if defined(PNG_READ_DITHER_SUPPORTED) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) /* The following three members were added at version 1.0.14 and 1.2.4 */ - png_bytep dither_sort; /* working sort array */ - png_bytep index_to_palette; /* where the original index currently is */ + modpng14_bytep dither_sort; /* working sort array */ + modpng14_bytep index_to_palette; /* where the original index currently is */ /* in the palette */ - png_bytep palette_to_index; /* which original index points to this */ + modpng14_bytep palette_to_index; /* which original index points to this */ /* palette color */ #endif }; -/* This prevents a compiler error in png.c if png.c and png.h are both at +/* This prevents a compiler error in png.c if png.c and modpng14.h are both at version 1.2.5 */ -typedef png_structp version_1_2_5; +typedef modpng14_structp version_1_2_5; -typedef png_struct FAR * FAR * png_structpp; +typedef modpng14_struct FAR * FAR * modpng14_structpp; /* Here are the function definitions most commonly used. This is not - * the place to find out how to use libpng. See libpng.txt for the + * the place to find out how to use libmodpng14. See libmodpng14.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. */ /* Returns the version number of the library */ -extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_access_version_number) PNGARG((void)); /* Tell lib we have already handled the first magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ -extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, +extern MODPNG14_EXPORT(void,modpng14_set_sig_bytes) PNGARG((modpng14_structp modpng14_ptr, int num_bytes)); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a @@ -1314,299 +1314,299 @@ * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ -extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, - png_size_t num_to_check)); +extern MODPNG14_EXPORT(int,modpng14_sig_cmp) PNGARG((modpng14_bytep sig, modpng14_size_t start, + modpng14_size_t num_to_check)); /* Simple signature checking function. This is the same as calling - * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). + * modpng14_check_sig(sig, n) := !modpng14_sig_cmp(sig, 0, n). */ -extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)); +extern MODPNG14_EXPORT(int,modpng14_check_sig) PNGARG((modpng14_bytep sig, int num)); -/* Allocate and initialize png_ptr struct for reading, and any other memory. */ -extern PNG_EXPORT(png_structp,png_create_read_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)); +/* Allocate and initialize modpng14_ptr struct for reading, and any other memory. */ +extern MODPNG14_EXPORT(modpng14_structp,modpng14_create_read_struct) + PNGARG((modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn)); -/* Allocate and initialize png_ptr struct for writing, and any other memory */ -extern PNG_EXPORT(png_structp,png_create_write_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)); +/* Allocate and initialize modpng14_ptr struct for writing, and any other memory */ +extern MODPNG14_EXPORT(modpng14_structp,modpng14_create_write_struct) + PNGARG((modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn)); -extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_compression_buffer_size) + PNGARG((modpng14_structp modpng14_ptr)); -extern PNG_EXPORT(void,png_set_compression_buffer_size) - PNGARG((png_structp png_ptr, png_uint_32 size)); +extern MODPNG14_EXPORT(void,modpng14_set_compression_buffer_size) + PNGARG((modpng14_structp modpng14_ptr, modpng14_uint_32 size)); /* Reset the compression stream */ -extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(int,modpng14_reset_zstream) PNGARG((modpng14_structp modpng14_ptr)); -/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ -#ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_structp,png_create_read_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -extern PNG_EXPORT(png_structp,png_create_write_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* New functions added in libmodpng14-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef MODPNG14_USER_MEM_SUPPORTED +extern MODPNG14_EXPORT(modpng14_structp,modpng14_create_read_struct_2) + PNGARG((modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn, modpng14_voidp mem_ptr, + modpng14_malloc_ptr malloc_fn, modpng14_free_ptr free_fn)); +extern MODPNG14_EXPORT(modpng14_structp,modpng14_create_write_struct_2) + PNGARG((modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn, modpng14_voidp mem_ptr, + modpng14_malloc_ptr malloc_fn, modpng14_free_ptr free_fn)); #endif /* Write a PNG chunk - size, type, (optional) data, CRC. */ -extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_bytep data, png_size_t length)); +extern MODPNG14_EXPORT(void,modpng14_write_chunk) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep chunk_name, modpng14_bytep data, modpng14_size_t length)); /* Write the start of a PNG chunk - length and chunk name. */ -extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_uint_32 length)); +extern MODPNG14_EXPORT(void,modpng14_write_chunk_start) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep chunk_name, modpng14_uint_32 length)); -/* Write the data of a PNG chunk started with png_write_chunk_start(). */ -extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); +/* Write the data of a PNG chunk started with modpng14_write_chunk_start(). */ +extern MODPNG14_EXPORT(void,modpng14_write_chunk_data) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length)); -/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ -extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); +/* Finish a chunk started with modpng14_write_chunk_start() (includes CRC). */ +extern MODPNG14_EXPORT(void,modpng14_write_chunk_end) PNGARG((modpng14_structp modpng14_ptr)); /* Allocate and initialize the info structure */ -extern PNG_EXPORT(png_infop,png_create_info_struct) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_infop,modpng14_create_info_struct) + PNGARG((modpng14_structp modpng14_ptr)); /* Initialize the info structure (old interface - DEPRECATED) */ -extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); -#undef png_info_init -#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info)); -extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, - png_size_t png_info_struct_size)); +extern MODPNG14_EXPORT(void,modpng14_info_init) PNGARG((modpng14_infop info_ptr)); +#undef modpng14_info_init +#define modpng14_info_init(info_ptr) modpng14_info_init_3(&info_ptr, sizeof(modpng14_info)); +extern MODPNG14_EXPORT(void,modpng14_info_init_3) PNGARG((modpng14_infopp info_ptr, + modpng14_size_t modpng14_info_struct_size)); /* Writes all the PNG information before the image. */ -extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern MODPNG14_EXPORT(void,modpng14_write_info_before_PLTE) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +extern MODPNG14_EXPORT(void,modpng14_write_info) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); /* read the information before the actual image data. */ -extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern MODPNG14_EXPORT(void,modpng14_read_info) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); -#if defined(PNG_TIME_RFC1123_SUPPORTED) -extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) - PNGARG((png_structp png_ptr, png_timep ptime)); +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_charp,modpng14_convert_to_rfc1123) + PNGARG((modpng14_structp modpng14_ptr, modpng14_timep ptime)); #endif #if !defined(_WIN32_WCE) /* "time.h" functions are not supported on WindowsCE */ -#if defined(PNG_WRITE_tIME_SUPPORTED) -/* convert from a struct tm to png_time */ -extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, +#if defined(MODPNG14_WRITE_tIME_SUPPORTED) +/* convert from a struct tm to modpng14_time */ +extern MODPNG14_EXPORT(void,modpng14_convert_from_struct_tm) PNGARG((modpng14_timep ptime, struct tm FAR * ttime)); -/* convert from time_t to png_time. Uses gmtime() */ -extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, +/* convert from time_t to modpng14_time. Uses gmtime() */ +extern MODPNG14_EXPORT(void,modpng14_convert_from_time_t) PNGARG((modpng14_timep ptime, time_t ttime)); -#endif /* PNG_WRITE_tIME_SUPPORTED */ +#endif /* MODPNG14_WRITE_tIME_SUPPORTED */ #endif /* _WIN32_WCE */ -#if defined(PNG_READ_EXPAND_SUPPORTED) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ -extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_expand) PNGARG((modpng14_structp modpng14_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_gray_1_2_4_to_8) PNGARG((modpng14_structp modpng14_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_palette_to_rgb) PNGARG((modpng14_structp modpng14_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_tRNS_to_alpha) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +#if defined(MODPNG14_READ_BGR_SUPPORTED) || defined(MODPNG14_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ -extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_bgr) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) /* Expand the grayscale to 24-bit RGB if necessary. */ -extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_gray_to_rgb) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) /* Reduce RGB to grayscale. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_rgb_to_gray) PNGARG((modpng14_structp modpng14_ptr, int error_action, double red, double green )); #endif -extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, - int error_action, png_fixed_point red, png_fixed_point green )); -extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp - png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_rgb_to_gray_fixed) PNGARG((modpng14_structp modpng14_ptr, + int error_action, modpng14_fixed_point red, modpng14_fixed_point green )); +extern MODPNG14_EXPORT(modpng14_byte,modpng14_get_rgb_to_gray_status) PNGARG((modpng14_structp + modpng14_ptr)); #endif -extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, - png_colorp palette)); +extern MODPNG14_EXPORT(void,modpng14_build_grayscale_palette) PNGARG((int bit_depth, + modpng14_colorp palette)); -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); +#if defined(MODPNG14_READ_STRIP_ALPHA_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_strip_alpha) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); +#if defined(MODPNG14_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_swap_alpha) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_invert_alpha) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +#if defined(MODPNG14_READ_FILLER_SUPPORTED) || defined(MODPNG14_WRITE_FILLER_SUPPORTED) /* Add a filler byte to 24-bit RGB images. */ -extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, - png_uint_32 filler, int flags)); -/* The values of the PNG_FILLER_ defines should NOT be changed */ -#define PNG_FILLER_BEFORE 0 -#define PNG_FILLER_AFTER 1 -#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ +extern MODPNG14_EXPORT(void,modpng14_set_filler) PNGARG((modpng14_structp modpng14_ptr, + modpng14_uint_32 filler, int flags)); +/* The values of the MODPNG14_FILLER_ defines should NOT be changed */ +#define MODPNG14_FILLER_BEFORE 0 +#define MODPNG14_FILLER_AFTER 1 +#endif /* MODPNG14_READ_FILLER_SUPPORTED || MODPNG14_WRITE_FILLER_SUPPORTED */ -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +#if defined(MODPNG14_READ_SWAP_SUPPORTED) || defined(MODPNG14_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ -extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_swap) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +#if defined(MODPNG14_READ_PACK_SUPPORTED) || defined(MODPNG14_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ -extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_packing) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) || defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ -extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_packswap) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) || defined(MODPNG14_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ -extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, - png_color_8p true_bits)); +extern MODPNG14_EXPORT(void,modpng14_set_shift) PNGARG((modpng14_structp modpng14_ptr, + modpng14_color_8p true_bits)); #endif -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) || \ + defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. */ -extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(int,modpng14_set_interlace_handling) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +#if defined(MODPNG14_READ_INVERT_SUPPORTED) || defined(MODPNG14_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ -extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_invert_mono) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) /* Handle alpha and tRNS by replacing with a background color. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, - png_color_16p background_color, int background_gamma_code, +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_background) PNGARG((modpng14_structp modpng14_ptr, + modpng14_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)); #endif -#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 -#define PNG_BACKGROUND_GAMMA_SCREEN 1 -#define PNG_BACKGROUND_GAMMA_FILE 2 -#define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#define MODPNG14_BACKGROUND_GAMMA_UNKNOWN 0 +#define MODPNG14_BACKGROUND_GAMMA_SCREEN 1 +#define MODPNG14_BACKGROUND_GAMMA_FILE 2 +#define MODPNG14_BACKGROUND_GAMMA_UNIQUE 3 #endif -#if defined(PNG_READ_16_TO_8_SUPPORTED) +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) /* strip the second byte of information from a 16-bit depth file. */ -extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_set_strip_16) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_DITHER_SUPPORTED) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) /* Turn on dithering, and reduce the palette to the number of colors available. */ -extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, - png_colorp palette, int num_palette, int maximum_colors, - png_uint_16p histogram, int full_dither)); +extern MODPNG14_EXPORT(void,modpng14_set_dither) PNGARG((modpng14_structp modpng14_ptr, + modpng14_colorp palette, int num_palette, int maximum_colors, + modpng14_uint_16p histogram, int full_dither)); #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) /* Handle gamma correction. Screen_gamma=(display_exponent) */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_gamma) PNGARG((modpng14_structp modpng14_ptr, double screen_gamma, double default_file_gamma)); #endif #endif -#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +#if defined(MODPNG14_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(MODPNG14_WRITE_EMPTY_PLTE_SUPPORTED) /* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ -/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ -extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, +/* Deprecated and will be removed. Use modpng14_permit_mng_features() instead. */ +extern MODPNG14_EXPORT(void,modpng14_permit_empty_plte) PNGARG((modpng14_structp modpng14_ptr, int empty_plte_permitted)); #endif -#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) /* Set how many lines between output flushes - 0 for no flushing */ -extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); +extern MODPNG14_EXPORT(void,modpng14_set_flush) PNGARG((modpng14_structp modpng14_ptr, int nrows)); /* Flush the current PNG output buffer */ -extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_write_flush) PNGARG((modpng14_structp modpng14_ptr)); #endif /* optional update palette with requested transformations */ -extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(void,modpng14_start_read_image) PNGARG((modpng14_structp modpng14_ptr)); /* optional call to update the users info structure */ -extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern MODPNG14_EXPORT(void,modpng14_read_update_info) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); /* read one or more rows of image data. */ -extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); +extern MODPNG14_EXPORT(void,modpng14_read_rows) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytepp row, modpng14_bytepp display_row, modpng14_uint_32 num_rows)); /* read a row of data. */ -extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, - png_bytep row, - png_bytep display_row)); +extern MODPNG14_EXPORT(void,modpng14_read_row) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep row, + modpng14_bytep display_row)); /* read the whole image into memory at once. */ -extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, - png_bytepp image)); +extern MODPNG14_EXPORT(void,modpng14_read_image) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytepp image)); /* write a row of image data */ -extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, - png_bytep row)); +extern MODPNG14_EXPORT(void,modpng14_write_row) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep row)); /* write a few rows of image data */ -extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_uint_32 num_rows)); +extern MODPNG14_EXPORT(void,modpng14_write_rows) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytepp row, modpng14_uint_32 num_rows)); /* write the image data */ -extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, - png_bytepp image)); +extern MODPNG14_EXPORT(void,modpng14_write_image) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytepp image)); /* writes the end of the PNG file. */ -extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern MODPNG14_EXPORT(void,modpng14_write_end) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); /* read the end of the PNG file. */ -extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern MODPNG14_EXPORT(void,modpng14_read_end) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); -/* free any memory associated with the png_info_struct */ -extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, - png_infopp info_ptr_ptr)); - -/* free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp - png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); +/* free any memory associated with the modpng14_info_struct */ +extern MODPNG14_EXPORT(void,modpng14_destroy_info_struct) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infopp info_ptr_ptr)); + +/* free any memory associated with the modpng14_struct and the modpng14_info_structs */ +extern MODPNG14_EXPORT(void,modpng14_destroy_read_struct) PNGARG((modpng14_structpp + modpng14_ptr_ptr, modpng14_infopp info_ptr_ptr, modpng14_infopp end_info_ptr_ptr)); /* free all memory used by the read (old method - NOT DLL EXPORTED) */ -extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, - png_infop end_info_ptr)); +extern void modpng14_read_destroy PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_infop end_info_ptr)); -/* free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_write_struct) - PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); +/* free any memory associated with the modpng14_struct and the modpng14_info_structs */ +extern MODPNG14_EXPORT(void,modpng14_destroy_write_struct) + PNGARG((modpng14_structpp modpng14_ptr_ptr, modpng14_infopp info_ptr_ptr)); -/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ -extern void png_write_destroy PNGARG((png_structp png_ptr)); +/* free any memory used in modpng14_ptr struct (old method - NOT DLL EXPORTED) */ +extern void modpng14_write_destroy PNGARG((modpng14_structp modpng14_ptr)); -/* set the libpng method of handling chunk CRC errors */ -extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, +/* set the libmodpng14 method of handling chunk CRC errors */ +extern MODPNG14_EXPORT(void,modpng14_set_crc_action) PNGARG((modpng14_structp modpng14_ptr, int crit_action, int ancil_action)); -/* Values for png_set_crc_action() to say how to handle CRC errors in +/* Values for modpng14_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, @@ -1615,53 +1615,53 @@ * * value action:critical action:ancillary */ -#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ -#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ -#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ -#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ -#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ -#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ +#define MODPNG14_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define MODPNG14_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define MODPNG14_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define MODPNG14_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define MODPNG14_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define MODPNG14_CRC_NO_CHANGE 5 /* use current value use current value */ /* These functions give the user control over the scan-line filtering in - * libpng and the compression methods used by zlib. These functions are + * libmodpng14 and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. * Those users who are tight on memory or want faster performance at the * expense of compression can modify them. See the compression library * header file (zlib.h) for an explination of the compression functions. */ -/* set the filtering method(s) used by libpng. Currently, the only valid +/* set the filtering method(s) used by libmodpng14. Currently, the only valid * value for "method" is 0. */ -extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, +extern MODPNG14_EXPORT(void,modpng14_set_filter) PNGARG((modpng14_structp modpng14_ptr, int method, int filters)); -/* Flags for png_set_filter() to say which filters to use. The flags +/* Flags for modpng14_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. */ -#define PNG_NO_FILTERS 0x00 -#define PNG_FILTER_NONE 0x08 -#define PNG_FILTER_SUB 0x10 -#define PNG_FILTER_UP 0x20 -#define PNG_FILTER_AVG 0x40 -#define PNG_FILTER_PAETH 0x80 -#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ - PNG_FILTER_AVG | PNG_FILTER_PAETH) +#define MODPNG14_NO_FILTERS 0x00 +#define MODPNG14_FILTER_NONE 0x08 +#define MODPNG14_FILTER_SUB 0x10 +#define MODPNG14_FILTER_UP 0x20 +#define MODPNG14_FILTER_AVG 0x40 +#define MODPNG14_FILTER_PAETH 0x80 +#define MODPNG14_ALL_FILTERS (MODPNG14_FILTER_NONE | MODPNG14_FILTER_SUB | MODPNG14_FILTER_UP | \ + MODPNG14_FILTER_AVG | MODPNG14_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. */ -#define PNG_FILTER_VALUE_NONE 0 -#define PNG_FILTER_VALUE_SUB 1 -#define PNG_FILTER_VALUE_UP 2 -#define PNG_FILTER_VALUE_AVG 3 -#define PNG_FILTER_VALUE_PAETH 4 -#define PNG_FILTER_VALUE_LAST 5 +#define MODPNG14_FILTER_VALUE_NONE 0 +#define MODPNG14_FILTER_VALUE_SUB 1 +#define MODPNG14_FILTER_VALUE_UP 2 +#define MODPNG14_FILTER_VALUE_AVG 3 +#define MODPNG14_FILTER_VALUE_PAETH 4 +#define MODPNG14_FILTER_VALUE_LAST 5 -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ -/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ +/* The "heuristic_method" is given by one of the MODPNG14_FILTER_HEURISTIC_ * defines, either the default (minimum-sum-of-absolute-differences), or * the experimental method (weighted-minimum-sum-of-absolute-differences). * @@ -1678,7 +1678,7 @@ * filter type. Higher costs indicate more decoding expense, and are * therefore less likely to be selected over a filter with lower computational * costs. There needs to be a value in "filter_costs" for each valid filter - * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't + * type (given by MODPNG14_FILTER_VALUE_LAST), or it can be NULL if you aren't * setting the costs. Costs try to improve the speed of decompression without * unduly increasing the compressed image size. * @@ -1689,20 +1689,20 @@ * the weights and costs are set to 1.0, this degenerates the WEIGHTED method * to the UNWEIGHTED method, but with added encoding time/computation. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, - int heuristic_method, int num_weights, png_doublep filter_weights, - png_doublep filter_costs)); +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_filter_heuristics) PNGARG((modpng14_structp modpng14_ptr, + int heuristic_method, int num_weights, modpng14_doublep filter_weights, + modpng14_doublep filter_costs)); #endif -#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ +#endif /* MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. */ -#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ -#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ -#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ -#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ +#define MODPNG14_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define MODPNG14_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libmodpng14 < 0.95 */ +#define MODPNG14_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define MODPNG14_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 @@ -1711,19 +1711,19 @@ * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ -extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, +extern MODPNG14_EXPORT(void,modpng14_set_compression_level) PNGARG((modpng14_structp modpng14_ptr, int level)); -extern PNG_EXPORT(void,png_set_compression_mem_level) - PNGARG((png_structp png_ptr, int mem_level)); +extern MODPNG14_EXPORT(void,modpng14_set_compression_mem_level) + PNGARG((modpng14_structp modpng14_ptr, int mem_level)); -extern PNG_EXPORT(void,png_set_compression_strategy) - PNGARG((png_structp png_ptr, int strategy)); +extern MODPNG14_EXPORT(void,modpng14_set_compression_strategy) + PNGARG((modpng14_structp modpng14_ptr, int strategy)); -extern PNG_EXPORT(void,png_set_compression_window_bits) - PNGARG((png_structp png_ptr, int window_bits)); +extern MODPNG14_EXPORT(void,modpng14_set_compression_window_bits) + PNGARG((modpng14_structp modpng14_ptr, int window_bits)); -extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, +extern MODPNG14_EXPORT(void,modpng14_set_compression_method) PNGARG((modpng14_structp modpng14_ptr, int method)); /* These next functions are called for input/output, memory, and error @@ -1731,13 +1731,13 @@ * and call standard C I/O routines such as fread(), fwrite(), and * fprintf(). These functions can be made to use other I/O routines * at run time for those applications that need to handle I/O in a - * different manner by calling png_set_???_fn(). See libpng.txt for + * different manner by calling modpng14_set_???_fn(). See libmodpng14.txt for * more information. */ -#if !defined(PNG_NO_STDIO) +#if !defined(MODPNG14_NO_STDIO) /* Initialize the input/output for the PNG file to the default functions. */ -extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); +extern MODPNG14_EXPORT(void,modpng14_init_io) PNGARG((modpng14_structp modpng14_ptr, modpng14_FILE_p fp)); #endif /* Replace the (error and abort), and warning functions with user @@ -1748,507 +1748,507 @@ * default function will be used. */ -extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_error_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp error_ptr, modpng14_error_ptr error_fn, modpng14_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ -extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_get_error_ptr) PNGARG((modpng14_structp modpng14_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. - * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * If MODPNG14_WRITE_FLUSH_SUPPORTED is not defined at libmodpng14 compile time * output_flush_fn will be ignored (and thus can be NULL). */ -extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_write_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp io_ptr, modpng14_rw_ptr write_data_fn, modpng14_flush_ptr output_flush_fn)); /* Replace the default data input function with a user supplied one. */ -extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr read_data_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_read_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp io_ptr, modpng14_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ -extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_get_io_ptr) PNGARG((modpng14_structp modpng14_ptr)); -extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, - png_read_status_ptr read_row_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_read_status_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_read_status_ptr read_row_fn)); -extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, - png_write_status_ptr write_row_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_write_status_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_write_status_ptr write_row_fn)); -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ -extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, - png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_mem_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp mem_ptr, modpng14_malloc_ptr malloc_fn, modpng14_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ -extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_get_mem_ptr) PNGARG((modpng14_structp modpng14_ptr)); #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr read_user_transform_fn)); +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_LEGACY_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_read_user_transform_fn) PNGARG((modpng14_structp + modpng14_ptr, modpng14_user_transform_ptr read_user_transform_fn)); #endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr write_user_transform_fn)); +#if defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_LEGACY_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_write_user_transform_fn) PNGARG((modpng14_structp + modpng14_ptr, modpng14_user_transform_ptr write_user_transform_fn)); #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp - png_ptr, png_voidp user_transform_ptr, int user_transform_depth, +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_LEGACY_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_user_transform_info) PNGARG((modpng14_structp + modpng14_ptr, modpng14_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ -extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_get_user_transform_ptr) + PNGARG((modpng14_structp modpng14_ptr)); #endif -#ifdef PNG_USER_CHUNKS_SUPPORTED -extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, - png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); -extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp - png_ptr)); +#ifdef MODPNG14_USER_CHUNKS_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_read_user_chunk_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp user_chunk_ptr, modpng14_user_chunk_ptr read_user_chunk_fn)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_get_user_chunk_ptr) PNGARG((modpng14_structp + modpng14_ptr)); #endif -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ -extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, - png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn)); +extern MODPNG14_EXPORT(void,modpng14_set_progressive_read_fn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp progressive_ptr, + modpng14_progressive_info_ptr info_fn, modpng14_progressive_row_ptr row_fn, + modpng14_progressive_end_ptr end_fn)); /* returns the user pointer associated with the push read functions */ -extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_get_progressive_ptr) + PNGARG((modpng14_structp modpng14_ptr)); /* function to be called when data becomes available */ -extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); +extern MODPNG14_EXPORT(void,modpng14_process_data) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_bytep buffer, modpng14_size_t buffer_size)); /* function that combines rows. Not very much different than the - * png_combine_row() call. Is this even used????? + * modpng14_combine_row() call. Is this even used????? */ -extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, - png_bytep old_row, png_bytep new_row)); -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ +extern MODPNG14_EXPORT(void,modpng14_progressive_combine_row) PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep old_row, modpng14_bytep new_row)); +#endif /* MODPNG14_PROGRESSIVE_READ_SUPPORTED */ -extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, - png_uint_32 size)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_malloc) PNGARG((modpng14_structp modpng14_ptr, + modpng14_uint_32 size)); -#if defined(PNG_1_0_X) -# define png_malloc_warn png_malloc +#if defined(MODPNG14_1_0_X) +# define modpng14_malloc_warn modpng14_malloc #else -/* Added at libpng version 1.2.4 */ -extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, - png_uint_32 size)); +/* Added at libmodpng14 version 1.2.4 */ +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_malloc_warn) PNGARG((modpng14_structp modpng14_ptr, + modpng14_uint_32 size)); #endif -/* frees a pointer allocated by png_malloc() */ -extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); +/* frees a pointer allocated by modpng14_malloc() */ +extern MODPNG14_EXPORT(void,modpng14_free) PNGARG((modpng14_structp modpng14_ptr, modpng14_voidp ptr)); -#if defined(PNG_1_0_X) +#if defined(MODPNG14_1_0_X) /* Function to allocate memory for zlib. */ -extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, +extern MODPNG14_EXPORT(voidpf,modpng14_zalloc) PNGARG((voidpf modpng14_ptr, uInt items, uInt size)); /* Function to free memory for zlib */ -extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); +extern MODPNG14_EXPORT(void,modpng14_zfree) PNGARG((voidpf modpng14_ptr, voidpf ptr)); #endif /* Free data that was allocated internally */ -extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 free_me, int num)); -#ifdef PNG_FREE_ME_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_free_data) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 free_me, int num)); +#ifdef MODPNG14_FREE_ME_SUPPORTED /* Reassign responsibility for freeing existing data, whether allocated - * by libpng or by the application */ -extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, - png_infop info_ptr, int freer, png_uint_32 mask)); -#endif -/* assignments for png_data_freer */ -#define PNG_DESTROY_WILL_FREE_DATA 1 -#define PNG_SET_WILL_FREE_DATA 1 -#define PNG_USER_WILL_FREE_DATA 2 -/* Flags for png_ptr->free_me and info_ptr->free_me */ -#define PNG_FREE_HIST 0x0008 -#define PNG_FREE_ICCP 0x0010 -#define PNG_FREE_SPLT 0x0020 -#define PNG_FREE_ROWS 0x0040 -#define PNG_FREE_PCAL 0x0080 -#define PNG_FREE_SCAL 0x0100 -#define PNG_FREE_UNKN 0x0200 -#define PNG_FREE_LIST 0x0400 -#define PNG_FREE_PLTE 0x1000 -#define PNG_FREE_TRNS 0x2000 -#define PNG_FREE_TEXT 0x4000 -#define PNG_FREE_ALL 0x7fff -#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ - -#ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, - png_uint_32 size)); -extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, - png_voidp ptr)); + * by libmodpng14 or by the application */ +extern MODPNG14_EXPORT(void,modpng14_data_freer) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int freer, modpng14_uint_32 mask)); +#endif +/* assignments for modpng14_data_freer */ +#define MODPNG14_DESTROY_WILL_FREE_DATA 1 +#define MODPNG14_SET_WILL_FREE_DATA 1 +#define MODPNG14_USER_WILL_FREE_DATA 2 +/* Flags for modpng14_ptr->free_me and info_ptr->free_me */ +#define MODPNG14_FREE_HIST 0x0008 +#define MODPNG14_FREE_ICCP 0x0010 +#define MODPNG14_FREE_SPLT 0x0020 +#define MODPNG14_FREE_ROWS 0x0040 +#define MODPNG14_FREE_PCAL 0x0080 +#define MODPNG14_FREE_SCAL 0x0100 +#define MODPNG14_FREE_UNKN 0x0200 +#define MODPNG14_FREE_LIST 0x0400 +#define MODPNG14_FREE_PLTE 0x1000 +#define MODPNG14_FREE_TRNS 0x2000 +#define MODPNG14_FREE_TEXT 0x4000 +#define MODPNG14_FREE_ALL 0x7fff +#define MODPNG14_FREE_MUL 0x4220 /* MODPNG14_FREE_SPLT|MODPNG14_FREE_TEXT|MODPNG14_FREE_UNKN */ + +#ifdef MODPNG14_USER_MEM_SUPPORTED +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_malloc_default) PNGARG((modpng14_structp modpng14_ptr, + modpng14_uint_32 size)); +extern MODPNG14_EXPORT(void,modpng14_free_default) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp ptr)); #endif -extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, - png_voidp s1, png_voidp s2, png_uint_32 size)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_memcpy_check) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp s1, modpng14_voidp s2, modpng14_uint_32 size)); -extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, - png_voidp s1, int value, png_uint_32 size)); +extern MODPNG14_EXPORT(modpng14_voidp,modpng14_memset_check) PNGARG((modpng14_structp modpng14_ptr, + modpng14_voidp s1, int value, modpng14_uint_32 size)); #if defined(USE_FAR_KEYWORD) /* memory model conversion function */ -extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, +extern void *modpng14_far_to_near PNGARG((modpng14_structp modpng14_ptr,modpng14_voidp ptr, int check)); #endif /* USE_FAR_KEYWORD */ -/* Fatal error in PNG image of libpng - can't continue */ -extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, - png_const_charp error_message)); +/* Fatal error in PNG image of libmodpng14 - can't continue */ +extern MODPNG14_EXPORT(void,modpng14_error) PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp error_message)); /* The same, but the chunk name is prepended to the error string. */ -extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, - png_const_charp error_message)); +extern MODPNG14_EXPORT(void,modpng14_chunk_error) PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp error_message)); -/* Non-fatal error in libpng. Can continue, but may have a problem. */ -extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); - -/* Non-fatal error in libpng, chunk name is prepended to message. */ -extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); - -/* The png_set_ functions are for storing values in the png_info_struct. - * Similarly, the png_get_ calls are used to read values from the - * png_info_struct, either storing the parameters in the passed variables, or - * setting pointers into the png_info_struct where the data is stored. The - * png_get_ functions return a non-zero value if the data was available +/* Non-fatal error in libmodpng14. Can continue, but may have a problem. */ +extern MODPNG14_EXPORT(void,modpng14_warning) PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp warning_message)); + +/* Non-fatal error in libmodpng14, chunk name is prepended to message. */ +extern MODPNG14_EXPORT(void,modpng14_chunk_warning) PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp warning_message)); + +/* The modpng14_set_ functions are for storing values in the modpng14_info_struct. + * Similarly, the modpng14_get_ calls are used to read values from the + * modpng14_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the modpng14_info_struct where the data is stored. The + * modpng14_get_ functions return a non-zero value if the data was available * in info_ptr, or return zero and do not change any of the parameters if the * data was not available. * - * These functions should be used instead of directly accessing png_info + * These functions should be used instead of directly accessing modpng14_info * to avoid problems with future changes in the size and internal layout of - * png_info_struct. + * modpng14_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ -extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 flag)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_valid) PNGARG((modpng14_structp modpng14_ptr, +modpng14_infop info_ptr, modpng14_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ -extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_rowbytes) PNGARG((modpng14_structp modpng14_ptr, +modpng14_infop info_ptr)); -#if defined(PNG_INFO_IMAGE_SUPPORTED) +#if defined(MODPNG14_INFO_IMAGE_SUPPORTED) /* Returns row_pointers, which is an array of pointers to scanlines that was -returned from png_read_png(). */ -extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +returned from modpng14_read_png(). */ +extern MODPNG14_EXPORT(modpng14_bytepp,modpng14_get_rows) PNGARG((modpng14_structp modpng14_ptr, +modpng14_infop info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use -by png_write_png(). */ -extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytepp row_pointers)); +by modpng14_write_png(). */ +extern MODPNG14_EXPORT(void,modpng14_set_rows) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_bytepp row_pointers)); #endif /* Returns number of color channels in image. */ -extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_byte,modpng14_get_channels) PNGARG((modpng14_structp modpng14_ptr, +modpng14_infop info_ptr)); -#ifdef PNG_EASY_ACCESS_SUPPORTED +#ifdef MODPNG14_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32, modpng14_get_image_width) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image height in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32, modpng14_get_image_height) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image bit_depth. */ -extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_byte, modpng14_get_bit_depth) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image color_type. */ -extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_byte, modpng14_get_color_type) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image filter_type. */ -extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_byte, modpng14_get_filter_type) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image interlace_type. */ -extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_byte, modpng14_get_interlace_type) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image compression_type. */ -extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_byte, modpng14_get_compression_type) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ -extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32, modpng14_get_pixels_per_meter) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32, modpng14_get_x_pixels_per_meter) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32, modpng14_get_y_pixels_per_meter) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(float, modpng14_get_pixel_aspect_ratio) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); #endif /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ -extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_int_32, modpng14_get_x_offset_pixels) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_int_32, modpng14_get_y_offset_pixels) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_int_32, modpng14_get_x_offset_microns) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_int_32, modpng14_get_y_offset_microns) PNGARG((modpng14_structp +modpng14_ptr, modpng14_infop info_ptr)); -#endif /* PNG_EASY_ACCESS_SUPPORTED */ +#endif /* MODPNG14_EASY_ACCESS_SUPPORTED */ /* Returns pointer to signature string read from PNG header */ -extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern MODPNG14_EXPORT(modpng14_bytep,modpng14_get_signature) PNGARG((modpng14_structp modpng14_ptr, +modpng14_infop info_ptr)); -#if defined(PNG_bKGD_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p *background)); +#if defined(MODPNG14_bKGD_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_bKGD) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_color_16p *background)); #endif -#if defined(PNG_bKGD_SUPPORTED) -extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p background)); +#if defined(MODPNG14_bKGD_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_bKGD) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_color_16p background)); #endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *white_x, double *white_y, double *red_x, +#if defined(MODPNG14_cHRM_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_cHRM) PNGARG((modpng14_structp modpng14_ptr, + modpng14_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)); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point - *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, - png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point - *int_blue_x, png_fixed_point *int_blue_y)); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_cHRM_fixed) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_fixed_point *int_white_x, modpng14_fixed_point + *int_white_y, modpng14_fixed_point *int_red_x, modpng14_fixed_point *int_red_y, + modpng14_fixed_point *int_green_x, modpng14_fixed_point *int_green_y, modpng14_fixed_point + *int_blue_x, modpng14_fixed_point *int_blue_y)); #endif #endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double white_x, double white_y, double red_x, +#if defined(MODPNG14_cHRM_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_cHRM) PNGARG((modpng14_structp modpng14_ptr, + modpng14_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)); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_cHRM_fixed) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_fixed_point int_white_x, modpng14_fixed_point int_white_y, + modpng14_fixed_point int_red_x, modpng14_fixed_point int_red_y, modpng14_fixed_point + int_green_x, modpng14_fixed_point int_green_y, modpng14_fixed_point int_blue_x, + modpng14_fixed_point int_blue_y)); #endif #endif -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *file_gamma)); +#if defined(MODPNG14_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_gAMA) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, double *file_gamma)); #endif -extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_file_gamma)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_gAMA_fixed) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_fixed_point *int_file_gamma)); #endif -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double file_gamma)); +#if defined(MODPNG14_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_gAMA) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, double file_gamma)); #endif -extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_file_gamma)); +extern MODPNG14_EXPORT(void,modpng14_set_gAMA_fixed) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_fixed_point int_file_gamma)); #endif -#if defined(PNG_hIST_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p *hist)); +#if defined(MODPNG14_hIST_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_hIST) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_16p *hist)); #endif -#if defined(PNG_hIST_SUPPORTED) -extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p hist)); +#if defined(MODPNG14_hIST_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_hIST) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_16p hist)); #endif -extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_IHDR) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 *width, modpng14_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)); -extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, +extern MODPNG14_EXPORT(void,modpng14_set_IHDR) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 width, modpng14_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)); -#if defined(PNG_oFFs_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, +#if defined(MODPNG14_oFFs_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_oFFs) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_int_32 *offset_x, modpng14_int_32 *offset_y, int *unit_type)); #endif -#if defined(PNG_oFFs_SUPPORTED) -extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, +#if defined(MODPNG14_oFFs_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_oFFs) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_int_32 offset_x, modpng14_int_32 offset_y, int unit_type)); #endif -#if defined(PNG_pCAL_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((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 defined(MODPNG14_pCAL_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_pCAL) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_charp *purpose, modpng14_int_32 *X0, modpng14_int_32 *X1, + int *type, int *nparams, modpng14_charp *units, modpng14_charpp *params)); #endif -#if defined(PNG_pCAL_SUPPORTED) -extern PNG_EXPORT(void,png_set_pCAL) PNGARG((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 defined(MODPNG14_pCAL_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_pCAL) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_charp purpose, modpng14_int_32 X0, modpng14_int_32 X1, + int type, int nparams, modpng14_charp units, modpng14_charpp params)); #endif -#if defined(PNG_pHYs_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#if defined(MODPNG14_pHYs_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_pHYs) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 *res_x, modpng14_uint_32 *res_y, int *unit_type)); #endif -#if defined(PNG_pHYs_SUPPORTED) -extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#if defined(MODPNG14_pHYs_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_pHYs) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 res_x, modpng14_uint_32 res_y, int unit_type)); #endif -extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp *palette, int *num_palette)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_PLTE) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_colorp *palette, int *num_palette)); -extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp palette, int num_palette)); +extern MODPNG14_EXPORT(void,modpng14_set_PLTE) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_colorp palette, int num_palette)); -#if defined(PNG_sBIT_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p *sig_bit)); +#if defined(MODPNG14_sBIT_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_sBIT) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_color_8p *sig_bit)); #endif -#if defined(PNG_sBIT_SUPPORTED) -extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p sig_bit)); +#if defined(MODPNG14_sBIT_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_sBIT) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_color_8p sig_bit)); #endif -#if defined(PNG_sRGB_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *intent)); +#if defined(MODPNG14_sRGB_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_sRGB) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int *intent)); #endif -#if defined(PNG_sRGB_SUPPORTED) -extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); -extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); +#if defined(MODPNG14_sRGB_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_sRGB) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int intent)); +extern MODPNG14_EXPORT(void,modpng14_set_sRGB_gAMA_and_cHRM) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int intent)); #endif -#if defined(PNG_iCCP_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charpp name, int *compression_type, - png_charpp profile, png_uint_32 *proflen)); - /* Note to maintainer: profile should be png_bytepp */ +#if defined(MODPNG14_iCCP_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_iCCP) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_charpp name, int *compression_type, + modpng14_charpp profile, modpng14_uint_32 *proflen)); + /* Note to maintainer: profile should be modpng14_bytepp */ #endif -#if defined(PNG_iCCP_SUPPORTED) -extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen)); - /* Note to maintainer: profile should be png_bytep */ +#if defined(MODPNG14_iCCP_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_iCCP) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_charp name, int compression_type, + modpng14_charp profile, modpng14_uint_32 proflen)); + /* Note to maintainer: profile should be modpng14_bytep */ #endif -#if defined(PNG_sPLT_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tpp entries)); +#if defined(MODPNG14_sPLT_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_sPLT) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_sPLT_tpp entries)); #endif -#if defined(PNG_sPLT_SUPPORTED) -extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries)); +#if defined(MODPNG14_sPLT_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_sPLT) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_sPLT_tp entries, int nentries)); #endif -#if defined(PNG_TEXT_SUPPORTED) -/* png_get_text also returns the number of text chunks in *num_text */ -extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp *text_ptr, int *num_text)); +#if defined(MODPNG14_TEXT_SUPPORTED) +/* modpng14_get_text also returns the number of text chunks in *num_text */ +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_text) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_textp *text_ptr, int *num_text)); #endif /* - * Note while png_set_text() will accept a structure whose text, + * Note while modpng14_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure - * returned by png_get_text will always contain regular + * returned by modpng14_get_text will always contain regular * zero-terminated C strings. They might be empty strings but * they will never be NULL pointers. */ -#if defined(PNG_TEXT_SUPPORTED) -extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); +#if defined(MODPNG14_TEXT_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_text) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_textp text_ptr, int num_text)); #endif -#if defined(PNG_tIME_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep *mod_time)); +#if defined(MODPNG14_tIME_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_tIME) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_timep *mod_time)); #endif -#if defined(PNG_tIME_SUPPORTED) -extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep mod_time)); +#if defined(MODPNG14_tIME_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_tIME) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_timep mod_time)); #endif -#if defined(PNG_tRNS_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep *trans, int *num_trans, - png_color_16p *trans_values)); +#if defined(MODPNG14_tRNS_SUPPORTED) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_tRNS) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_bytep *trans, int *num_trans, + modpng14_color_16p *trans_values)); #endif -#if defined(PNG_tRNS_SUPPORTED) -extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep trans, int num_trans, - png_color_16p trans_values)); +#if defined(MODPNG14_tRNS_SUPPORTED) +extern MODPNG14_EXPORT(void,modpng14_set_tRNS) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_bytep trans, int num_trans, + modpng14_color_16p trans_values)); #endif -#if defined(PNG_tRNS_SUPPORTED) +#if defined(MODPNG14_tRNS_SUPPORTED) #endif -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, double *width, double *height)); +#if defined(MODPNG14_sCAL_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_sCAL) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int *unit, double *width, double *height)); #else -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_sCAL_s) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int *unit, modpng14_charpp swidth, modpng14_charpp sheight)); #endif #endif -#endif /* PNG_sCAL_SUPPORTED */ +#endif /* MODPNG14_sCAL_SUPPORTED */ -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, double width, double height)); +#if defined(MODPNG14_sCAL_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_sCAL) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int unit, double width, double height)); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_sCAL_s) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int unit, modpng14_charp swidth, modpng14_charp sheight)); #endif -#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ +#endif /* MODPNG14_sCAL_SUPPORTED || MODPNG14_WRITE_sCAL_SUPPORTED */ -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) /* provide a list of chunks and how they are to be handled, if the built-in handling or default unknown chunk handling is not desired. Any chunks not listed will be handled in the default manner. The IHDR and IEND chunks @@ -2258,181 +2258,181 @@ = 2: keep only if safe-to-copy = 3: keep even if unsafe-to-copy */ -extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp - png_ptr, int keep, png_bytep chunk_list, int num_chunks)); -extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); -extern PNG_EXPORT(void, png_set_unknown_chunk_location) - PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); -extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp - png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +extern MODPNG14_EXPORT(void, modpng14_set_keep_unknown_chunks) PNGARG((modpng14_structp + modpng14_ptr, int keep, modpng14_bytep chunk_list, int num_chunks)); +extern MODPNG14_EXPORT(void, modpng14_set_unknown_chunks) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_unknown_chunkp unknowns, int num_unknowns)); +extern MODPNG14_EXPORT(void, modpng14_set_unknown_chunk_location) + PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int chunk, int location)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_unknown_chunks) PNGARG((modpng14_structp + modpng14_ptr, modpng14_infop info_ptr, modpng14_unknown_chunkpp entries)); #endif -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep +#ifdef MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED +MODPNG14_EXPORT(int,modpng14_handle_as_unknown) PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep chunk_name)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. If you need to turn it off for a chunk that your application has freed, - you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ -extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, - png_infop info_ptr, int mask)); + you can use modpng14_set_invalid(modpng14_ptr, info_ptr, MODPNG14_INFO_CHNK); */ +extern MODPNG14_EXPORT(void, modpng14_set_invalid) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int mask)); -#if defined(PNG_INFO_IMAGE_SUPPORTED) +#if defined(MODPNG14_INFO_IMAGE_SUPPORTED) /* The "params" pointer is currently not used and is for future expansion. */ -extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, +extern MODPNG14_EXPORT(void, modpng14_read_png) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int transforms, - png_voidp params)); -extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, + modpng14_voidp params)); +extern MODPNG14_EXPORT(void, modpng14_write_png) PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, int transforms, - png_voidp params)); + modpng14_voidp params)); #endif -/* Define PNG_DEBUG at compile time for debugging information. Higher - * numbers for PNG_DEBUG mean more debugging information. This has +/* Define MODPNG14_DEBUG at compile time for debugging information. Higher + * numbers for MODPNG14_DEBUG mean more debugging information. This has * only been added since version 0.95 so it is not implemented throughout - * libpng yet, but more support will be added as needed. + * libmodpng14 yet, but more support will be added as needed. */ -#ifdef PNG_DEBUG -#if (PNG_DEBUG > 0) -#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) +#ifdef MODPNG14_DEBUG +#if (MODPNG14_DEBUG > 0) +#if !defined(MODPNG14_DEBUG_FILE) && defined(_MSC_VER) #include -#if (PNG_DEBUG > 1) -#define png_debug(l,m) _RPT0(_CRT_WARN,m) -#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1) -#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2) -#endif -#else /* PNG_DEBUG_FILE || !_MSC_VER */ -#ifndef PNG_DEBUG_FILE -#define PNG_DEBUG_FILE stderr -#endif /* PNG_DEBUG_FILE */ -#if (PNG_DEBUG > 1) -#define png_debug(l,m) \ +#if (MODPNG14_DEBUG > 1) +#define modpng14_debug(l,m) _RPT0(_CRT_WARN,m) +#define modpng14_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1) +#define modpng14_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2) +#endif +#else /* MODPNG14_DEBUG_FILE || !_MSC_VER */ +#ifndef MODPNG14_DEBUG_FILE +#define MODPNG14_DEBUG_FILE stderr +#endif /* MODPNG14_DEBUG_FILE */ +#if (MODPNG14_DEBUG > 1) +#define modpng14_debug(l,m) \ { \ int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ + fprintf(MODPNG14_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ } -#define png_debug1(l,m,p1) \ +#define modpng14_debug1(l,m,p1) \ { \ int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ + fprintf(MODPNG14_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ } -#define png_debug2(l,m,p1,p2) \ +#define modpng14_debug2(l,m,p1,p2) \ { \ int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ + fprintf(MODPNG14_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ } -#endif /* (PNG_DEBUG > 1) */ +#endif /* (MODPNG14_DEBUG > 1) */ #endif /* _MSC_VER */ -#endif /* (PNG_DEBUG > 0) */ -#endif /* PNG_DEBUG */ -#ifndef png_debug -#define png_debug(l, m) +#endif /* (MODPNG14_DEBUG > 0) */ +#endif /* MODPNG14_DEBUG */ +#ifndef modpng14_debug +#define modpng14_debug(l, m) #endif -#ifndef png_debug1 -#define png_debug1(l, m, p1) +#ifndef modpng14_debug1 +#define modpng14_debug1(l, m, p1) #endif -#ifndef png_debug2 -#define png_debug2(l, m, p1, p2) +#ifndef modpng14_debug2 +#define modpng14_debug2(l, m, p1, p2) #endif -extern PNG_EXPORT(png_bytep,png_sig_bytes) PNGARG((void)); +extern MODPNG14_EXPORT(modpng14_bytep,modpng14_sig_bytes) PNGARG((void)); -extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_charp,modpng14_get_copyright) PNGARG((modpng14_structp modpng14_ptr)); +extern MODPNG14_EXPORT(modpng14_charp,modpng14_get_header_ver) PNGARG((modpng14_structp modpng14_ptr)); +extern MODPNG14_EXPORT(modpng14_charp,modpng14_get_header_version) PNGARG((modpng14_structp modpng14_ptr)); +extern MODPNG14_EXPORT(modpng14_charp,modpng14_get_libmodpng14_ver) PNGARG((modpng14_structp modpng14_ptr)); -#ifdef PNG_MNG_FEATURES_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp - png_ptr, png_uint_32 mng_features_permitted)); +#ifdef MODPNG14_MNG_FEATURES_SUPPORTED +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_permit_mng_features) PNGARG((modpng14_structp + modpng14_ptr, modpng14_uint_32 mng_features_permitted)); #endif /* Added to version 1.2.0 */ -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ -#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ -#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 -#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 -#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 -#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 -#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 -#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 -#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ - -#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ - | PNG_ASM_FLAG_MMX_READ_INTERLACE \ - | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ - | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ - | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ - | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) -#define PNG_MMX_WRITE_FLAGS ( 0 ) - -#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ - | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ - | PNG_MMX_READ_FLAGS \ - | PNG_MMX_WRITE_FLAGS ) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) +#define MODPNG14_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ +#define MODPNG14_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ +#define MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 +#define MODPNG14_ASM_FLAG_MMX_READ_INTERLACE 0x08 +#define MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 +#define MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP 0x20 +#define MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 +#define MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 +#define MODPNG14_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ + +#define MODPNG14_MMX_READ_FLAGS ( MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | MODPNG14_ASM_FLAG_MMX_READ_INTERLACE \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG \ + | MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH ) +#define MODPNG14_MMX_WRITE_FLAGS ( 0 ) + +#define MODPNG14_MMX_FLAGS ( MODPNG14_ASM_FLAG_MMX_SUPPORT_COMPILED \ + | MODPNG14_ASM_FLAG_MMX_SUPPORT_IN_CPU \ + | MODPNG14_MMX_READ_FLAGS \ + | MODPNG14_MMX_WRITE_FLAGS ) -#define PNG_SELECT_READ 1 -#define PNG_SELECT_WRITE 2 +#define MODPNG14_SELECT_READ 1 +#define MODPNG14_SELECT_WRITE 2 -#if !defined(PNG_1_0_X) +#if !defined(MODPNG14_1_0_X) /* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_mmx_flagmask) PNGARG((int flag_select, int *compilerID)); /* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_asm_flagmask) PNGARG((int flag_select)); /* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_asm_flags) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_asm_flags) + PNGARG((modpng14_structp modpng14_ptr)); /* pngget.c */ -extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_byte,modpng14_get_mmx_bitdepth_threshold) + PNGARG((modpng14_structp modpng14_ptr)); /* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) - PNGARG((png_structp png_ptr)); +extern MODPNG14_EXPORT(modpng14_uint_32,modpng14_get_mmx_rowbytes_threshold) + PNGARG((modpng14_structp modpng14_ptr)); /* pngset.c */ -extern PNG_EXPORT(void,png_set_asm_flags) - PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); +extern MODPNG14_EXPORT(void,modpng14_set_asm_flags) + PNGARG((modpng14_structp modpng14_ptr, modpng14_uint_32 asm_flags)); /* pngset.c */ -extern PNG_EXPORT(void,png_set_mmx_thresholds) - PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold)); +extern MODPNG14_EXPORT(void,modpng14_set_mmx_thresholds) + PNGARG((modpng14_structp modpng14_ptr, modpng14_byte mmx_bitdepth_threshold, + modpng14_uint_32 mmx_rowbytes_threshold)); -#endif /* PNG_1_0_X */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_1_0_X */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ -#if !defined(PNG_1_0_X) +#if !defined(MODPNG14_1_0_X) /* png.c, pnggccrd.c, or pngvcrd.c */ -extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); +extern MODPNG14_EXPORT(int,modpng14_mmx_support) PNGARG((void)); /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp - png_ptr, png_uint_32 strip_mode)); +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED +extern MODPNG14_EXPORT(void,modpng14_set_strip_error_numbers) PNGARG((modpng14_structp + modpng14_ptr, modpng14_uint_32 strip_mode)); #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ -/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */ +/* Maintainer: Put new public prototypes here ^, in libmodpng14.3, and project defs */ -#define PNG_HEADER_VERSION_STRING \ - " libpng version 1.2.5 - October 3, 2002 (header)\n" +#define MODPNG14_HEADER_VERSION_STRING \ + " libmodpng14 version 1.2.5 - October 3, 2002 (header)\n" -#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +#ifdef MODPNG14_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on * most machines. However, it does take more operations than the corresponding * divide method, so it may be slower on a few RISC systems. There are two @@ -2447,333 +2447,333 @@ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ -# define png_composite(composite, fg, alpha, bg) \ - { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ - + (png_uint_16)(bg)*(png_uint_16)(255 - \ - (png_uint_16)(alpha)) + (png_uint_16)128); \ - (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } - -# define png_composite_16(composite, fg, alpha, bg) \ - { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ - + (png_uint_32)(bg)*(png_uint_32)(65535L - \ - (png_uint_32)(alpha)) + (png_uint_32)32768L); \ - (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } +# define modpng14_composite(composite, fg, alpha, bg) \ + { modpng14_uint_16 temp = (modpng14_uint_16)((modpng14_uint_16)(fg) * (modpng14_uint_16)(alpha) \ + + (modpng14_uint_16)(bg)*(modpng14_uint_16)(255 - \ + (modpng14_uint_16)(alpha)) + (modpng14_uint_16)128); \ + (composite) = (modpng14_byte)((temp + (temp >> 8)) >> 8); } + +# define modpng14_composite_16(composite, fg, alpha, bg) \ + { modpng14_uint_32 temp = (modpng14_uint_32)((modpng14_uint_32)(fg) * (modpng14_uint_32)(alpha) \ + + (modpng14_uint_32)(bg)*(modpng14_uint_32)(65535L - \ + (modpng14_uint_32)(alpha)) + (modpng14_uint_32)32768L); \ + (composite) = (modpng14_uint_16)((temp + (temp >> 16)) >> 16); } #else /* standard method using integer division */ -# define png_composite(composite, fg, alpha, bg) \ - (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ - (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - (png_uint_16)127) / 255) - -# define png_composite_16(composite, fg, alpha, bg) \ - (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ - (png_uint_32)32767) / (png_uint_32)65535L) +# define modpng14_composite(composite, fg, alpha, bg) \ + (composite) = (modpng14_byte)(((modpng14_uint_16)(fg) * (modpng14_uint_16)(alpha) + \ + (modpng14_uint_16)(bg) * (modpng14_uint_16)(255 - (modpng14_uint_16)(alpha)) + \ + (modpng14_uint_16)127) / 255) + +# define modpng14_composite_16(composite, fg, alpha, bg) \ + (composite) = (modpng14_uint_16)(((modpng14_uint_32)(fg) * (modpng14_uint_32)(alpha) + \ + (modpng14_uint_32)(bg)*(modpng14_uint_32)(65535L - (modpng14_uint_32)(alpha)) + \ + (modpng14_uint_32)32767) / (modpng14_uint_32)65535L) -#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ +#endif /* MODPNG14_READ_COMPOSITE_NODIV_SUPPORTED */ /* These next functions are used internally in the code. They generally * shouldn't be used unless you are writing code to add or replace some - * functionality in libpng. More information about most functions can + * functionality in libmodpng14. More information about most functions can * be found in the files where the functions are located. */ -#if defined(PNG_INTERNAL) +#if defined(MODPNG14_INTERNAL) /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. */ -#define PNG_HAVE_IHDR 0x01 -#define PNG_HAVE_PLTE 0x02 -#define PNG_HAVE_IDAT 0x04 -#define PNG_AFTER_IDAT 0x08 -#define PNG_HAVE_IEND 0x10 -#define PNG_HAVE_gAMA 0x20 -#define PNG_HAVE_cHRM 0x40 -#define PNG_HAVE_sRGB 0x80 -#define PNG_HAVE_CHUNK_HEADER 0x100 -#define PNG_WROTE_tIME 0x200 -#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 -#define PNG_BACKGROUND_IS_GRAY 0x800 -#define PNG_HAVE_PNG_SIGNATURE 0x1000 +#define MODPNG14_HAVE_IHDR 0x01 +#define MODPNG14_HAVE_PLTE 0x02 +#define MODPNG14_HAVE_IDAT 0x04 +#define MODPNG14_AFTER_IDAT 0x08 +#define MODPNG14_HAVE_IEND 0x10 +#define MODPNG14_HAVE_gAMA 0x20 +#define MODPNG14_HAVE_cHRM 0x40 +#define MODPNG14_HAVE_sRGB 0x80 +#define MODPNG14_HAVE_CHUNK_HEADER 0x100 +#define MODPNG14_WROTE_tIME 0x200 +#define MODPNG14_WROTE_INFO_BEFORE_PLTE 0x400 +#define MODPNG14_BACKGROUND_IS_GRAY 0x800 +#define MODPNG14_HAVE_MODPNG14_SIGNATURE 0x1000 /* flags for the transformations the PNG library does on the image data */ -#define PNG_BGR 0x0001 -#define PNG_INTERLACE 0x0002 -#define PNG_PACK 0x0004 -#define PNG_SHIFT 0x0008 -#define PNG_SWAP_BYTES 0x0010 -#define PNG_INVERT_MONO 0x0020 -#define PNG_DITHER 0x0040 -#define PNG_BACKGROUND 0x0080 -#define PNG_BACKGROUND_EXPAND 0x0100 +#define MODPNG14_BGR 0x0001 +#define MODPNG14_INTERLACE 0x0002 +#define MODPNG14_PACK 0x0004 +#define MODPNG14_SHIFT 0x0008 +#define MODPNG14_SWAP_BYTES 0x0010 +#define MODPNG14_INVERT_MONO 0x0020 +#define MODPNG14_DITHER 0x0040 +#define MODPNG14_BACKGROUND 0x0080 +#define MODPNG14_BACKGROUND_EXPAND 0x0100 /* 0x0200 unused */ -#define PNG_16_TO_8 0x0400 -#define PNG_RGBA 0x0800 -#define PNG_EXPAND 0x1000 -#define PNG_GAMMA 0x2000 -#define PNG_GRAY_TO_RGB 0x4000 -#define PNG_FILLER 0x8000L -#define PNG_PACKSWAP 0x10000L -#define PNG_SWAP_ALPHA 0x20000L -#define PNG_STRIP_ALPHA 0x40000L -#define PNG_INVERT_ALPHA 0x80000L -#define PNG_USER_TRANSFORM 0x100000L -#define PNG_RGB_TO_GRAY_ERR 0x200000L -#define PNG_RGB_TO_GRAY_WARN 0x400000L -#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ - -/* flags for png_create_struct */ -#define PNG_STRUCT_PNG 0x0001 -#define PNG_STRUCT_INFO 0x0002 +#define MODPNG14_16_TO_8 0x0400 +#define MODPNG14_RGBA 0x0800 +#define MODPNG14_EXPAND 0x1000 +#define MODPNG14_GAMMA 0x2000 +#define MODPNG14_GRAY_TO_RGB 0x4000 +#define MODPNG14_FILLER 0x8000L +#define MODPNG14_PACKSWAP 0x10000L +#define MODPNG14_SWAP_ALPHA 0x20000L +#define MODPNG14_STRIP_ALPHA 0x40000L +#define MODPNG14_INVERT_ALPHA 0x80000L +#define MODPNG14_USER_TRANSFORM 0x100000L +#define MODPNG14_RGB_TO_GRAY_ERR 0x200000L +#define MODPNG14_RGB_TO_GRAY_WARN 0x400000L +#define MODPNG14_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ + +/* flags for modpng14_create_struct */ +#define MODPNG14_STRUCT_PNG 0x0001 +#define MODPNG14_STRUCT_INFO 0x0002 /* Scaling factor for filter heuristic weighting calculations */ -#define PNG_WEIGHT_SHIFT 8 -#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) -#define PNG_COST_SHIFT 3 -#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) - -/* flags for the png_ptr->flags rather than declaring a byte for each one */ -#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 -#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 -#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 -#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 -#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 -#define PNG_FLAG_ZLIB_FINISHED 0x0020 -#define PNG_FLAG_ROW_INIT 0x0040 -#define PNG_FLAG_FILLER_AFTER 0x0080 -#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 -#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 -#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 -#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 -#define PNG_FLAG_FREE_PLTE 0x1000 -#define PNG_FLAG_FREE_TRNS 0x2000 -#define PNG_FLAG_FREE_HIST 0x4000 -#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L -#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L -#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L -#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L -#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L -#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L +#define MODPNG14_WEIGHT_SHIFT 8 +#define MODPNG14_WEIGHT_FACTOR (1<<(MODPNG14_WEIGHT_SHIFT)) +#define MODPNG14_COST_SHIFT 3 +#define MODPNG14_COST_FACTOR (1<<(MODPNG14_COST_SHIFT)) + +/* flags for the modpng14_ptr->flags rather than declaring a byte for each one */ +#define MODPNG14_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 +#define MODPNG14_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 +#define MODPNG14_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 +#define MODPNG14_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 +#define MODPNG14_FLAG_ZLIB_CUSTOM_METHOD 0x0010 +#define MODPNG14_FLAG_ZLIB_FINISHED 0x0020 +#define MODPNG14_FLAG_ROW_INIT 0x0040 +#define MODPNG14_FLAG_FILLER_AFTER 0x0080 +#define MODPNG14_FLAG_CRC_ANCILLARY_USE 0x0100 +#define MODPNG14_FLAG_CRC_ANCILLARY_NOWARN 0x0200 +#define MODPNG14_FLAG_CRC_CRITICAL_USE 0x0400 +#define MODPNG14_FLAG_CRC_CRITICAL_IGNORE 0x0800 +#define MODPNG14_FLAG_FREE_PLTE 0x1000 +#define MODPNG14_FLAG_FREE_TRNS 0x2000 +#define MODPNG14_FLAG_FREE_HIST 0x4000 +#define MODPNG14_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L +#define MODPNG14_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L +#define MODPNG14_FLAG_LIBRARY_MISMATCH 0x20000L +#define MODPNG14_FLAG_STRIP_ERROR_NUMBERS 0x40000L +#define MODPNG14_FLAG_STRIP_ERROR_TEXT 0x80000L +#define MODPNG14_FLAG_MALLOC_NULL_MEM_OK 0x100000L -/* For use in png_set_keep_unknown, png_handle_as_unknown */ +/* For use in modpng14_set_keep_unknown, modpng14_handle_as_unknown */ #define HANDLE_CHUNK_AS_DEFAULT 0 #define HANDLE_CHUNK_NEVER 1 #define HANDLE_CHUNK_IF_SAFE 2 #define HANDLE_CHUNK_ALWAYS 3 -#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ - PNG_FLAG_CRC_ANCILLARY_NOWARN) +#define MODPNG14_FLAG_CRC_ANCILLARY_MASK (MODPNG14_FLAG_CRC_ANCILLARY_USE | \ + MODPNG14_FLAG_CRC_ANCILLARY_NOWARN) -#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ - PNG_FLAG_CRC_CRITICAL_IGNORE) +#define MODPNG14_FLAG_CRC_CRITICAL_MASK (MODPNG14_FLAG_CRC_CRITICAL_USE | \ + MODPNG14_FLAG_CRC_CRITICAL_IGNORE) -#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ - PNG_FLAG_CRC_CRITICAL_MASK) +#define MODPNG14_FLAG_CRC_MASK (MODPNG14_FLAG_CRC_ANCILLARY_MASK | \ + MODPNG14_FLAG_CRC_CRITICAL_MASK) /* save typing and make code easier to understand */ -#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ +#define MODPNG14_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ abs((int)((c1).green) - (int)((c2).green)) + \ abs((int)((c1).blue) - (int)((c2).blue))) -/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ -#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* variables declared in png.c - only it needs to define MODPNG14_NO_EXTERN */ +#if !defined(MODPNG14_NO_EXTERN) || defined(MODPNG14_ALWAYS_EXTERN) /* place to hold the signature string for a PNG file. */ -#ifdef PNG_USE_GLOBAL_ARRAYS - PNG_EXPORT_VAR (const png_byte FARDATA) png_sig[8]; +#ifdef MODPNG14_USE_GLOBAL_ARRAYS + MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_sig[8]; #else -#define png_sig png_sig_bytes(NULL) +#define modpng14_sig modpng14_sig_bytes(NULL) #endif -#endif /* PNG_NO_EXTERN */ +#endif /* MODPNG14_NO_EXTERN */ /* Constant strings for known chunk types. If you need to add a chunk, * define the name here, and add an invocation of the macro in png.c and * wherever it's needed. */ -#define PNG_IHDR const png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} -#define PNG_IDAT const png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} -#define PNG_IEND const png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} -#define PNG_PLTE const png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} -#define PNG_bKGD const png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} -#define PNG_cHRM const png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} -#define PNG_gAMA const png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} -#define PNG_hIST const png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} -#define PNG_iCCP const png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} -#define PNG_iTXt const png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} -#define PNG_oFFs const png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} -#define PNG_pCAL const png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} -#define PNG_sCAL const png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} -#define PNG_pHYs const png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} -#define PNG_sBIT const png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} -#define PNG_sPLT const png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} -#define PNG_sRGB const png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} -#define PNG_tEXt const png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} -#define PNG_tIME const png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} -#define PNG_tRNS const png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} -#define PNG_zTXt const png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} - -#ifdef PNG_USE_GLOBAL_ARRAYS -PNG_EXPORT_VAR (const png_byte FARDATA) png_IHDR[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_IDAT[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_IEND[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_PLTE[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_bKGD[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_cHRM[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_gAMA[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_hIST[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_iCCP[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_iTXt[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_oFFs[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_pCAL[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sCAL[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_pHYs[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sBIT[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sPLT[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sRGB[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_tEXt[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_tIME[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_tRNS[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_zTXt[5]; -#endif /* PNG_USE_GLOBAL_ARRAYS */ +#define MODPNG14_IHDR const modpng14_byte modpng14_IHDR[5] = { 73, 72, 68, 82, '\0'} +#define MODPNG14_IDAT const modpng14_byte modpng14_IDAT[5] = { 73, 68, 65, 84, '\0'} +#define MODPNG14_IEND const modpng14_byte modpng14_IEND[5] = { 73, 69, 78, 68, '\0'} +#define MODPNG14_PLTE const modpng14_byte modpng14_PLTE[5] = { 80, 76, 84, 69, '\0'} +#define MODPNG14_bKGD const modpng14_byte modpng14_bKGD[5] = { 98, 75, 71, 68, '\0'} +#define MODPNG14_cHRM const modpng14_byte modpng14_cHRM[5] = { 99, 72, 82, 77, '\0'} +#define MODPNG14_gAMA const modpng14_byte modpng14_gAMA[5] = {103, 65, 77, 65, '\0'} +#define MODPNG14_hIST const modpng14_byte modpng14_hIST[5] = {104, 73, 83, 84, '\0'} +#define MODPNG14_iCCP const modpng14_byte modpng14_iCCP[5] = {105, 67, 67, 80, '\0'} +#define MODPNG14_iTXt const modpng14_byte modpng14_iTXt[5] = {105, 84, 88, 116, '\0'} +#define MODPNG14_oFFs const modpng14_byte modpng14_oFFs[5] = {111, 70, 70, 115, '\0'} +#define MODPNG14_pCAL const modpng14_byte modpng14_pCAL[5] = {112, 67, 65, 76, '\0'} +#define MODPNG14_sCAL const modpng14_byte modpng14_sCAL[5] = {115, 67, 65, 76, '\0'} +#define MODPNG14_pHYs const modpng14_byte modpng14_pHYs[5] = {112, 72, 89, 115, '\0'} +#define MODPNG14_sBIT const modpng14_byte modpng14_sBIT[5] = {115, 66, 73, 84, '\0'} +#define MODPNG14_sPLT const modpng14_byte modpng14_sPLT[5] = {115, 80, 76, 84, '\0'} +#define MODPNG14_sRGB const modpng14_byte modpng14_sRGB[5] = {115, 82, 71, 66, '\0'} +#define MODPNG14_tEXt const modpng14_byte modpng14_tEXt[5] = {116, 69, 88, 116, '\0'} +#define MODPNG14_tIME const modpng14_byte modpng14_tIME[5] = {116, 73, 77, 69, '\0'} +#define MODPNG14_tRNS const modpng14_byte modpng14_tRNS[5] = {116, 82, 78, 83, '\0'} +#define MODPNG14_zTXt const modpng14_byte modpng14_zTXt[5] = {122, 84, 88, 116, '\0'} + +#ifdef MODPNG14_USE_GLOBAL_ARRAYS +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_IHDR[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_IDAT[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_IEND[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_PLTE[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_bKGD[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_cHRM[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_gAMA[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_hIST[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_iCCP[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_iTXt[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_oFFs[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_pCAL[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_sCAL[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_pHYs[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_sBIT[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_sPLT[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_sRGB[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_tEXt[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_tIME[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_tRNS[5]; +MODPNG14_EXPORT_VAR (const modpng14_byte FARDATA) modpng14_zTXt[5]; +#endif /* MODPNG14_USE_GLOBAL_ARRAYS */ /* Inline macros to do direct reads of bytes from the input buffer. These * require that you are using an architecture that uses PNG byte ordering * (MSB first) and supports unaligned data storage. I think that PowerPC * in big-endian mode and 680x0 are the only ones that will support this. - * The x86 line of processors definitely do not. The png_get_int_32() + * The x86 line of processors definitely do not. The modpng14_get_int_32() * routine also assumes we are using two's complement format for negative * values, which is almost certainly true. */ -#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) -# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) -# define png_get_int_32(buf) ( *((png_int_32p) (buf))) +#if defined(MODPNG14_READ_BIG_ENDIAN_SUPPORTED) +# if defined(MODPNG14_pCAL_SUPPORTED) || defined(MODPNG14_oFFs_SUPPORTED) +# define modpng14_get_int_32(buf) ( *((modpng14_int_32p) (buf))) # endif -# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) -# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) +# define modpng14_get_uint_32(buf) ( *((modpng14_uint_32p) (buf))) +# define modpng14_get_uint_16(buf) ( *((modpng14_uint_16p) (buf))) #else -# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) -PNG_EXTERN png_int_32 png_get_int_32 PNGARG((png_bytep buf)); +# if defined(MODPNG14_pCAL_SUPPORTED) || defined(MODPNG14_oFFs_SUPPORTED) +MODPNG14_EXTERN modpng14_int_32 modpng14_get_int_32 PNGARG((modpng14_bytep buf)); # endif -PNG_EXTERN png_uint_32 png_get_uint_32 PNGARG((png_bytep buf)); -PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf)); -#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ -PNG_EXTERN png_uint_32 png_get_uint_31 PNGARG((png_structp png_ptr, - png_bytep buf)); - -/* Initialize png_ptr struct for reading, and allocate any other memory. - * (old interface - DEPRECATED - use png_create_read_struct instead). - */ -extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); -#undef png_read_init -#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ - PNG_LIBPNG_VER_STRING, sizeof(png_struct)); -extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size)); -extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t - png_info_size)); - -/* Initialize png_ptr struct for writing, and allocate any other memory. - * (old interface - DEPRECATED - use png_create_write_struct instead). - */ -extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); -#undef png_write_init -#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ - PNG_LIBPNG_VER_STRING, sizeof(png_struct)); -extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size)); -extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t - png_info_size)); - -/* Allocate memory for an internal libpng struct */ -PNG_EXTERN png_voidp png_create_struct PNGARG((int type)); - -/* Free memory from internal libpng struct */ -PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)); - -PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr - malloc_fn, png_voidp mem_ptr)); -PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, - png_free_ptr free_fn, png_voidp mem_ptr)); +MODPNG14_EXTERN modpng14_uint_32 modpng14_get_uint_32 PNGARG((modpng14_bytep buf)); +MODPNG14_EXTERN modpng14_uint_16 modpng14_get_uint_16 PNGARG((modpng14_bytep buf)); +#endif /* !MODPNG14_READ_BIG_ENDIAN_SUPPORTED */ +MODPNG14_EXTERN modpng14_uint_32 modpng14_get_uint_31 PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep buf)); + +/* Initialize modpng14_ptr struct for reading, and allocate any other memory. + * (old interface - DEPRECATED - use modpng14_create_read_struct instead). + */ +extern MODPNG14_EXPORT(void,modpng14_read_init) PNGARG((modpng14_structp modpng14_ptr)); +#undef modpng14_read_init +#define modpng14_read_init(modpng14_ptr) modpng14_read_init_3(&modpng14_ptr, \ + MODPNG14_LIBMODPNG14_VER_STRING, sizeof(modpng14_struct)); +extern MODPNG14_EXPORT(void,modpng14_read_init_3) PNGARG((modpng14_structpp ptr_ptr, + modpng14_const_charp user_modpng14_ver, modpng14_size_t modpng14_struct_size)); +extern MODPNG14_EXPORT(void,modpng14_read_init_2) PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp user_modpng14_ver, modpng14_size_t modpng14_struct_size, modpng14_size_t + modpng14_info_size)); + +/* Initialize modpng14_ptr struct for writing, and allocate any other memory. + * (old interface - DEPRECATED - use modpng14_create_write_struct instead). + */ +extern MODPNG14_EXPORT(void,modpng14_write_init) PNGARG((modpng14_structp modpng14_ptr)); +#undef modpng14_write_init +#define modpng14_write_init(modpng14_ptr) modpng14_write_init_3(&modpng14_ptr, \ + MODPNG14_LIBMODPNG14_VER_STRING, sizeof(modpng14_struct)); +extern MODPNG14_EXPORT(void,modpng14_write_init_3) PNGARG((modpng14_structpp ptr_ptr, + modpng14_const_charp user_modpng14_ver, modpng14_size_t modpng14_struct_size)); +extern MODPNG14_EXPORT(void,modpng14_write_init_2) PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp user_modpng14_ver, modpng14_size_t modpng14_struct_size, modpng14_size_t + modpng14_info_size)); + +/* Allocate memory for an internal libmodpng14 struct */ +MODPNG14_EXTERN modpng14_voidp modpng14_create_struct PNGARG((int type)); + +/* Free memory from internal libmodpng14 struct */ +MODPNG14_EXTERN void modpng14_destroy_struct PNGARG((modpng14_voidp struct_ptr)); + +MODPNG14_EXTERN modpng14_voidp modpng14_create_struct_2 PNGARG((int type, modpng14_malloc_ptr + malloc_fn, modpng14_voidp mem_ptr)); +MODPNG14_EXTERN void modpng14_destroy_struct_2 PNGARG((modpng14_voidp struct_ptr, + modpng14_free_ptr free_fn, modpng14_voidp mem_ptr)); /* Free any memory that info_ptr points to and reset struct. */ -PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, - png_infop info_ptr)); +MODPNG14_EXTERN void modpng14_info_destroy PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); -#ifndef PNG_1_0_X +#ifndef MODPNG14_1_0_X /* Function to allocate memory for zlib. */ -PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size)); +MODPNG14_EXTERN voidpf modpng14_zalloc PNGARG((voidpf modpng14_ptr, uInt items, uInt size)); /* Function to free memory for zlib */ -PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); +MODPNG14_EXTERN void modpng14_zfree PNGARG((voidpf modpng14_ptr, voidpf ptr)); -/* Next four functions are used internally as callbacks. PNGAPI is required - * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ +/* Next four functions are used internally as callbacks. MODPNG14API is required + * but not MODPNG14_EXPORT. MODPNG14API added at libmodpng14 version 1.2.3. */ -PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); +MODPNG14_EXTERN void MODPNG14API modpng14_default_read_data PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length)); -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t length)); +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED +MODPNG14_EXTERN void MODPNG14API modpng14_push_fill_buffer PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep buffer, modpng14_size_t length)); #endif -PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); +MODPNG14_EXTERN void MODPNG14API modpng14_default_write_data PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_size_t length)); -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -#if !defined(PNG_NO_STDIO) -PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) +#if !defined(MODPNG14_NO_STDIO) +MODPNG14_EXTERN void MODPNG14API modpng14_default_flush PNGARG((modpng14_structp modpng14_ptr)); #endif #endif -#else /* PNG_1_0_X */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t length)); +#else /* MODPNG14_1_0_X */ +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED +MODPNG14_EXTERN void modpng14_push_fill_buffer PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep buffer, modpng14_size_t length)); #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ /* Reset the CRC variable */ -PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_reset_crc PNGARG((modpng14_structp modpng14_ptr)); /* Write the "data" buffer to whatever output you are using. */ -PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); +MODPNG14_EXTERN void modpng14_write_data PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep data, + modpng14_size_t length)); /* Read data from whatever input you are using into the "data" buffer */ -PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); +MODPNG14_EXTERN void modpng14_read_data PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep data, + modpng14_size_t length)); -/* Read bytes into buf, and update png_ptr->crc */ -PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, - png_size_t length)); +/* Read bytes into buf, and update modpng14_ptr->crc */ +MODPNG14_EXTERN void modpng14_crc_read PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep buf, + modpng14_size_t length)); /* Decompress data in a chunk that uses compression */ -#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ - defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) -PNG_EXTERN png_charp png_decompress_chunk PNGARG((png_structp png_ptr, - int comp_type, png_charp chunkdata, png_size_t chunklength, - png_size_t prefix_length, png_size_t *data_length)); +#if defined(MODPNG14_zTXt_SUPPORTED) || defined(MODPNG14_iTXt_SUPPORTED) || \ + defined(MODPNG14_iCCP_SUPPORTED) || defined(MODPNG14_sPLT_SUPPORTED) +MODPNG14_EXTERN modpng14_charp modpng14_decompress_chunk PNGARG((modpng14_structp modpng14_ptr, + int comp_type, modpng14_charp chunkdata, modpng14_size_t chunklength, + modpng14_size_t prefix_length, modpng14_size_t *data_length)); #endif -/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ -PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)); +/* Read "skip" bytes, read the file crc, and (optionally) verify modpng14_ptr->crc */ +MODPNG14_EXTERN int modpng14_crc_finish PNGARG((modpng14_structp modpng14_ptr, modpng14_uint_32 skip)); -/* Read the CRC from the file and compare it to the libpng calculated CRC */ -PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)); +/* Read the CRC from the file and compare it to the libmodpng14 calculated CRC */ +MODPNG14_EXTERN int modpng14_crc_error PNGARG((modpng14_structp modpng14_ptr)); /* Calculate the CRC over a section of data. Note that we are only * passing a maximum of 64K on systems that have this as a memory limit, * since this is the maximum buffer size we can specify. */ -PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, - png_size_t length)); +MODPNG14_EXTERN void modpng14_calculate_crc PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep ptr, + modpng14_size_t length)); -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) +MODPNG14_EXTERN void modpng14_flush PNGARG((modpng14_structp modpng14_ptr)); #endif @@ -2781,330 +2781,330 @@ * The only currently known PNG chunks that use signed numbers are * the ancillary extension chunks, oFFs and pCAL. */ -PNG_EXTERN void png_save_uint_32 PNGARG((png_bytep buf, png_uint_32 i)); +MODPNG14_EXTERN void modpng14_save_uint_32 PNGARG((modpng14_bytep buf, modpng14_uint_32 i)); -#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) -PNG_EXTERN void png_save_int_32 PNGARG((png_bytep buf, png_int_32 i)); +#if defined(MODPNG14_WRITE_pCAL_SUPPORTED) || defined(MODPNG14_WRITE_oFFs_SUPPORTED) +MODPNG14_EXTERN void modpng14_save_int_32 PNGARG((modpng14_bytep buf, modpng14_int_32 i)); #endif /* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, + * The parameter is declared unsigned int, not modpng14_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ -PNG_EXTERN void png_save_uint_16 PNGARG((png_bytep buf, unsigned int i)); +MODPNG14_EXTERN void modpng14_save_uint_16 PNGARG((modpng14_bytep buf, unsigned int i)); /* simple function to write the signature */ -PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_write_sig PNGARG((modpng14_structp modpng14_ptr)); /* write various chunks */ -/* Write the IHDR chunk, and update the png_struct with the necessary +/* Write the IHDR chunk, and update the modpng14_struct with the necessary * information. */ -PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, - png_uint_32 height, +MODPNG14_EXTERN void modpng14_write_IHDR PNGARG((modpng14_structp modpng14_ptr, modpng14_uint_32 width, + modpng14_uint_32 height, int bit_depth, int color_type, int compression_method, int filter_method, int interlace_method)); -PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, - png_uint_32 num_pal)); +MODPNG14_EXTERN void modpng14_write_PLTE PNGARG((modpng14_structp modpng14_ptr, modpng14_colorp palette, + modpng14_uint_32 num_pal)); -PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); +MODPNG14_EXTERN void modpng14_write_IDAT PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep data, + modpng14_size_t length)); -PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_write_IEND PNGARG((modpng14_structp modpng14_ptr)); -#if defined(PNG_WRITE_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)); +#if defined(MODPNG14_WRITE_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +MODPNG14_EXTERN void modpng14_write_gAMA PNGARG((modpng14_structp modpng14_ptr, double file_gamma)); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +MODPNG14_EXTERN void modpng14_write_gAMA_fixed PNGARG((modpng14_structp modpng14_ptr, modpng14_fixed_point file_gamma)); #endif #endif -#if defined(PNG_WRITE_sBIT_SUPPORTED) -PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, +#if defined(MODPNG14_WRITE_sBIT_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_sBIT PNGARG((modpng14_structp modpng14_ptr, modpng14_color_8p sbit, int color_type)); #endif -#if defined(PNG_WRITE_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, +#if defined(MODPNG14_WRITE_cHRM_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +MODPNG14_EXTERN void modpng14_write_cHRM PNGARG((modpng14_structp modpng14_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)); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, - png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +MODPNG14_EXTERN void modpng14_write_cHRM_fixed PNGARG((modpng14_structp modpng14_ptr, + modpng14_fixed_point int_white_x, modpng14_fixed_point int_white_y, + modpng14_fixed_point int_red_x, modpng14_fixed_point int_red_y, modpng14_fixed_point + int_green_x, modpng14_fixed_point int_green_y, modpng14_fixed_point int_blue_x, + modpng14_fixed_point int_blue_y)); #endif #endif -#if defined(PNG_WRITE_sRGB_SUPPORTED) -PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, +#if defined(MODPNG14_WRITE_sRGB_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_sRGB PNGARG((modpng14_structp modpng14_ptr, int intent)); #endif -#if defined(PNG_WRITE_iCCP_SUPPORTED) -PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, - png_charp name, int compression_type, - png_charp profile, int proflen)); - /* Note to maintainer: profile should be png_bytep */ +#if defined(MODPNG14_WRITE_iCCP_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_iCCP PNGARG((modpng14_structp modpng14_ptr, + modpng14_charp name, int compression_type, + modpng14_charp profile, int proflen)); + /* Note to maintainer: profile should be modpng14_bytep */ #endif -#if defined(PNG_WRITE_sPLT_SUPPORTED) -PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, - png_sPLT_tp palette)); +#if defined(MODPNG14_WRITE_sPLT_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_sPLT PNGARG((modpng14_structp modpng14_ptr, + modpng14_sPLT_tp palette)); #endif -#if defined(PNG_WRITE_tRNS_SUPPORTED) -PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, - png_color_16p values, int number, int color_type)); +#if defined(MODPNG14_WRITE_tRNS_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_tRNS PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep trans, + modpng14_color_16p values, int number, int color_type)); #endif -#if defined(PNG_WRITE_bKGD_SUPPORTED) -PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, - png_color_16p values, int color_type)); +#if defined(MODPNG14_WRITE_bKGD_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_bKGD PNGARG((modpng14_structp modpng14_ptr, + modpng14_color_16p values, int color_type)); #endif -#if defined(PNG_WRITE_hIST_SUPPORTED) -PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, +#if defined(MODPNG14_WRITE_hIST_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_hIST PNGARG((modpng14_structp modpng14_ptr, modpng14_uint_16p hist, int num_hist)); #endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) -PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, - png_charp key, png_charpp new_key)); +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) || defined(MODPNG14_WRITE_pCAL_SUPPORTED) || \ + defined(MODPNG14_WRITE_iCCP_SUPPORTED) || defined(MODPNG14_WRITE_sPLT_SUPPORTED) +MODPNG14_EXTERN modpng14_size_t modpng14_check_keyword PNGARG((modpng14_structp modpng14_ptr, + modpng14_charp key, modpng14_charpp new_key)); #endif -#if defined(PNG_WRITE_tEXt_SUPPORTED) -PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, - png_charp text, png_size_t text_len)); +#if defined(MODPNG14_WRITE_tEXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_tEXt PNGARG((modpng14_structp modpng14_ptr, modpng14_charp key, + modpng14_charp text, modpng14_size_t text_len)); #endif -#if defined(PNG_WRITE_zTXt_SUPPORTED) -PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, - png_charp text, png_size_t text_len, int compression)); +#if defined(MODPNG14_WRITE_zTXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_zTXt PNGARG((modpng14_structp modpng14_ptr, modpng14_charp key, + modpng14_charp text, modpng14_size_t text_len, int compression)); #endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) -PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, - int compression, png_charp key, png_charp lang, png_charp lang_key, - png_charp text)); +#if defined(MODPNG14_WRITE_iTXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_iTXt PNGARG((modpng14_structp modpng14_ptr, + int compression, modpng14_charp key, modpng14_charp lang, modpng14_charp lang_key, + modpng14_charp text)); #endif -#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ -PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); +#if defined(MODPNG14_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ +MODPNG14_EXTERN int modpng14_set_text_2 PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_textp text_ptr, int num_text)); #endif -#if defined(PNG_WRITE_oFFs_SUPPORTED) -PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, - png_int_32 x_offset, png_int_32 y_offset, int unit_type)); +#if defined(MODPNG14_WRITE_oFFs_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_oFFs PNGARG((modpng14_structp modpng14_ptr, + modpng14_int_32 x_offset, modpng14_int_32 y_offset, int unit_type)); #endif -#if defined(PNG_WRITE_pCAL_SUPPORTED) -PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, - png_int_32 X0, png_int_32 X1, int type, int nparams, - png_charp units, png_charpp params)); +#if defined(MODPNG14_WRITE_pCAL_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_pCAL PNGARG((modpng14_structp modpng14_ptr, modpng14_charp purpose, + modpng14_int_32 X0, modpng14_int_32 X1, int type, int nparams, + modpng14_charp units, modpng14_charpp params)); #endif -#if defined(PNG_WRITE_pHYs_SUPPORTED) -PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, - png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, +#if defined(MODPNG14_WRITE_pHYs_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_pHYs PNGARG((modpng14_structp modpng14_ptr, + modpng14_uint_32 x_pixels_per_unit, modpng14_uint_32 y_pixels_per_unit, int unit_type)); #endif -#if defined(PNG_WRITE_tIME_SUPPORTED) -PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, - png_timep mod_time)); +#if defined(MODPNG14_WRITE_tIME_SUPPORTED) +MODPNG14_EXTERN void modpng14_write_tIME PNGARG((modpng14_structp modpng14_ptr, + modpng14_timep mod_time)); #endif -#if defined(PNG_WRITE_sCAL_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) -PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, +#if defined(MODPNG14_WRITE_sCAL_SUPPORTED) +#if defined(MODPNG14_FLOATING_POINT_SUPPORTED) && !defined(MODPNG14_NO_STDIO) +MODPNG14_EXTERN void modpng14_write_sCAL PNGARG((modpng14_structp modpng14_ptr, int unit, double width, double height)); #else -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, - int unit, png_charp width, png_charp height)); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +MODPNG14_EXTERN void modpng14_write_sCAL_s PNGARG((modpng14_structp modpng14_ptr, + int unit, modpng14_charp width, modpng14_charp height)); #endif #endif #endif /* Called when finished processing a row of data */ -PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_write_finish_row PNGARG((modpng14_structp modpng14_ptr)); /* Internal use only. Called before first row of data */ -PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_write_start_row PNGARG((modpng14_structp modpng14_ptr)); -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) +MODPNG14_EXTERN void modpng14_build_gamma_table PNGARG((modpng14_structp modpng14_ptr)); #endif /* combine a row of data, dealing with alpha, etc. if requested */ -PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, +MODPNG14_EXTERN void modpng14_combine_row PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep row, int mask)); -#if defined(PNG_READ_INTERLACING_SUPPORTED) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) /* expand an interlaced row */ /* OLD pre-1.0.9 interface: -PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, - png_bytep row, int pass, png_uint_32 transformations)); +MODPNG14_EXTERN void modpng14_do_read_interlace PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, int pass, modpng14_uint_32 transformations)); */ -PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_do_read_interlace PNGARG((modpng14_structp modpng14_ptr)); #endif /* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) /* grab pixels out of a row for an interlaced pass */ -PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, - png_bytep row, int pass)); +MODPNG14_EXTERN void modpng14_do_write_interlace PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, int pass)); #endif /* unfilter a row */ -PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, - png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); +MODPNG14_EXTERN void modpng14_read_filter_row PNGARG((modpng14_structp modpng14_ptr, + modpng14_row_infop row_info, modpng14_bytep row, modpng14_bytep prev_row, int filter)); /* Choose the best filter to use and filter the row data */ -PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, - png_row_infop row_info)); +MODPNG14_EXTERN void modpng14_write_find_filter PNGARG((modpng14_structp modpng14_ptr, + modpng14_row_infop row_info)); /* Write out the filtered row. */ -PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, - png_bytep filtered_row)); +MODPNG14_EXTERN void modpng14_write_filtered_row PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep filtered_row)); /* finish a row while reading, dealing with interlacing passes, etc. */ -PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_read_finish_row PNGARG((modpng14_structp modpng14_ptr)); /* initialize the row buffers, etc. */ -PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_read_start_row PNGARG((modpng14_structp modpng14_ptr)); /* optional call to update the users info structure */ -PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); +MODPNG14_EXTERN void modpng14_read_transform_info PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); /* these are the functions that do the transformations */ -#if defined(PNG_READ_FILLER_SUPPORTED) -PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 filler, png_uint_32 flags)); +#if defined(MODPNG14_READ_FILLER_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_read_filler PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, modpng14_uint_32 filler, modpng14_uint_32 flags)); #endif -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, - png_bytep row)); +#if defined(MODPNG14_READ_SWAP_ALPHA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_read_swap_alpha PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); #endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, - png_bytep row)); +#if defined(MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_write_swap_alpha PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); #endif -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, - png_bytep row)); +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_read_invert_alpha PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); #endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, - png_bytep row)); +#if defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_write_invert_alpha PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); #endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 flags)); +#if defined(MODPNG14_WRITE_FILLER_SUPPORTED) || \ + defined(MODPNG14_READ_STRIP_ALPHA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_strip_filler PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, modpng14_uint_32 flags)); #endif -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); +#if defined(MODPNG14_READ_SWAP_SUPPORTED) || defined(MODPNG14_WRITE_SWAP_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_swap PNGARG((modpng14_row_infop row_info, modpng14_bytep row)); #endif -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) -PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row)); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) || defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_packswap PNGARG((modpng14_row_infop row_info, modpng14_bytep row)); #endif -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop - row_info, png_bytep row)); +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) +MODPNG14_EXTERN int modpng14_do_rgb_to_gray PNGARG((modpng14_structp modpng14_ptr, modpng14_row_infop + row_info, modpng14_bytep row)); #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, - png_bytep row)); +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_gray_to_rgb PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); #endif -#if defined(PNG_READ_PACK_SUPPORTED) -PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row)); +#if defined(MODPNG14_READ_PACK_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_unpack PNGARG((modpng14_row_infop row_info, modpng14_bytep row)); #endif -#if defined(PNG_READ_SHIFT_SUPPORTED) -PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, - png_color_8p sig_bits)); +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_unshift PNGARG((modpng14_row_infop row_info, modpng14_bytep row, + modpng14_color_8p sig_bits)); #endif -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row)); +#if defined(MODPNG14_READ_INVERT_SUPPORTED) || defined(MODPNG14_WRITE_INVERT_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_invert PNGARG((modpng14_row_infop row_info, modpng14_bytep row)); #endif -#if defined(PNG_READ_16_TO_8_SUPPORTED) -PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_chop PNGARG((modpng14_row_infop row_info, modpng14_bytep row)); #endif -#if defined(PNG_READ_DITHER_SUPPORTED) -PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, - png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); +#if defined(MODPNG14_READ_DITHER_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_dither PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, modpng14_bytep palette_lookup, modpng14_bytep dither_lookup)); -# if defined(PNG_CORRECT_PALETTE_SUPPORTED) -PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, - png_colorp palette, int num_palette)); +# if defined(MODPNG14_CORRECT_PALETTE_SUPPORTED) +MODPNG14_EXTERN void modpng14_correct_palette PNGARG((modpng14_structp modpng14_ptr, + modpng14_colorp palette, int num_palette)); # endif #endif -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row)); +#if defined(MODPNG14_READ_BGR_SUPPORTED) || defined(MODPNG14_WRITE_BGR_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_bgr PNGARG((modpng14_row_infop row_info, modpng14_bytep row)); #endif -#if defined(PNG_WRITE_PACK_SUPPORTED) -PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 bit_depth)); +#if defined(MODPNG14_WRITE_PACK_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_pack PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, modpng14_uint_32 bit_depth)); #endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) -PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, - png_color_8p bit_depth)); +#if defined(MODPNG14_WRITE_SHIFT_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_shift PNGARG((modpng14_row_infop row_info, modpng14_bytep row, + modpng14_color_8p bit_depth)); #endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background, - png_color_16p background_1, - png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, - png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, - png_uint_16pp gamma_16_to_1, int gamma_shift)); +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_background PNGARG((modpng14_row_infop row_info, modpng14_bytep row, + modpng14_color_16p trans_values, modpng14_color_16p background, + modpng14_color_16p background_1, + modpng14_bytep gamma_table, modpng14_bytep gamma_from_1, modpng14_bytep gamma_to_1, + modpng14_uint_16pp gamma_16, modpng14_uint_16pp gamma_16_from_1, + modpng14_uint_16pp gamma_16_to_1, int gamma_shift)); #else -PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background)); +MODPNG14_EXTERN void modpng14_do_background PNGARG((modpng14_row_infop row_info, modpng14_bytep row, + modpng14_color_16p trans_values, modpng14_color_16p background)); #endif #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, - png_bytep gamma_table, png_uint_16pp gamma_16_table, +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_gamma PNGARG((modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep gamma_table, modpng14_uint_16pp gamma_16_table, int gamma_shift)); #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) -PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, - png_bytep row, png_colorp palette, png_bytep trans, int num_trans)); -PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, - png_bytep row, png_color_16p trans_value)); +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) +MODPNG14_EXTERN void modpng14_do_expand_palette PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, modpng14_colorp palette, modpng14_bytep trans, int num_trans)); +MODPNG14_EXTERN void modpng14_do_expand PNGARG((modpng14_row_infop row_info, + modpng14_bytep row, modpng14_color_16p trans_value)); #endif /* The following decodes the appropriate chunks, and does error correction, @@ -3112,178 +3112,178 @@ */ /* decode the IHDR chunk */ -PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +MODPNG14_EXTERN void modpng14_handle_IHDR PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_handle_PLTE PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_handle_IEND PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); -#if defined(PNG_READ_bKGD_SUPPORTED) -PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_bKGD_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_bKGD PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_cHRM_SUPPORTED) -PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_cHRM_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_cHRM PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_gAMA_SUPPORTED) -PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_gAMA_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_gAMA PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_hIST_SUPPORTED) -PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_hIST_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_hIST PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_iCCP_SUPPORTED) -extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif /* PNG_READ_iCCP_SUPPORTED */ +#if defined(MODPNG14_READ_iCCP_SUPPORTED) +extern void modpng14_handle_iCCP PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); +#endif /* MODPNG14_READ_iCCP_SUPPORTED */ -#if defined(PNG_READ_iTXt_SUPPORTED) -PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_iTXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_iTXt PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_oFFs_SUPPORTED) -PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_oFFs_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_oFFs PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_pCAL_SUPPORTED) -PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_pCAL_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_pCAL PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_pHYs_SUPPORTED) -PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_pHYs_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_pHYs PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_sBIT_SUPPORTED) -PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_sBIT_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_sBIT PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_sCAL_SUPPORTED) -PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_sCAL_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_sCAL PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_sPLT_SUPPORTED) -extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif /* PNG_READ_sPLT_SUPPORTED */ +#if defined(MODPNG14_READ_sPLT_SUPPORTED) +extern void modpng14_handle_sPLT PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); +#endif /* MODPNG14_READ_sPLT_SUPPORTED */ -#if defined(PNG_READ_sRGB_SUPPORTED) -PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_sRGB_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_sRGB PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_tEXt_SUPPORTED) -PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_tEXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_tEXt PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_tIME_SUPPORTED) -PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_tIME_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_tIME PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_tRNS_SUPPORTED) -PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_tRNS_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_tRNS PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -#if defined(PNG_READ_zTXt_SUPPORTED) -PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); +#if defined(MODPNG14_READ_zTXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_handle_zTXt PNGARG((modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 length)); #endif -PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); +MODPNG14_EXTERN void modpng14_handle_unknown PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 length)); -PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, - png_bytep chunk_name)); +MODPNG14_EXTERN void modpng14_check_chunk_name PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep chunk_name)); /* handle the transformations for reading and writing */ -PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_do_read_transformations PNGARG((modpng14_structp modpng14_ptr)); +MODPNG14_EXTERN void modpng14_do_write_transformations PNGARG((modpng14_structp modpng14_ptr)); -PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_init_read_transformations PNGARG((modpng14_structp modpng14_ptr)); -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, - png_uint_32 length)); -PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t buffer_length)); -PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t buffer_length)); -PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row)); -PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr)); -#if defined(PNG_READ_tEXt_SUPPORTED) -PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) -PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) -PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif - -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -#ifdef PNG_MNG_FEATURES_SUPPORTED -PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, - png_bytep row)); -PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, - png_bytep row)); +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED +MODPNG14_EXTERN void modpng14_push_read_chunk PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +MODPNG14_EXTERN void modpng14_push_read_sig PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +MODPNG14_EXTERN void modpng14_push_check_crc PNGARG((modpng14_structp modpng14_ptr)); +MODPNG14_EXTERN void modpng14_push_crc_skip PNGARG((modpng14_structp modpng14_ptr, + modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_push_crc_finish PNGARG((modpng14_structp modpng14_ptr)); +MODPNG14_EXTERN void modpng14_push_save_buffer PNGARG((modpng14_structp modpng14_ptr)); +MODPNG14_EXTERN void modpng14_push_restore_buffer PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep buffer, modpng14_size_t buffer_length)); +MODPNG14_EXTERN void modpng14_push_read_IDAT PNGARG((modpng14_structp modpng14_ptr)); +MODPNG14_EXTERN void modpng14_process_IDAT_data PNGARG((modpng14_structp modpng14_ptr, + modpng14_bytep buffer, modpng14_size_t buffer_length)); +MODPNG14_EXTERN void modpng14_push_process_row PNGARG((modpng14_structp modpng14_ptr)); +MODPNG14_EXTERN void modpng14_push_handle_unknown PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_push_have_info PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +MODPNG14_EXTERN void modpng14_push_have_end PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +MODPNG14_EXTERN void modpng14_push_have_row PNGARG((modpng14_structp modpng14_ptr, modpng14_bytep row)); +MODPNG14_EXTERN void modpng14_push_read_end PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +MODPNG14_EXTERN void modpng14_process_some_data PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +MODPNG14_EXTERN void modpng14_read_push_finish_row PNGARG((modpng14_structp modpng14_ptr)); +#if defined(MODPNG14_READ_tEXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_push_handle_tEXt PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_push_read_tEXt PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +#endif +#if defined(MODPNG14_READ_zTXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_push_handle_zTXt PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_push_read_zTXt PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +#endif +#if defined(MODPNG14_READ_iTXt_SUPPORTED) +MODPNG14_EXTERN void modpng14_push_handle_iTXt PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_uint_32 length)); +MODPNG14_EXTERN void modpng14_push_read_iTXt PNGARG((modpng14_structp modpng14_ptr, + modpng14_infop info_ptr)); +#endif + +#endif /* MODPNG14_PROGRESSIVE_READ_SUPPORTED */ + +#ifdef MODPNG14_MNG_FEATURES_SUPPORTED +MODPNG14_EXTERN void modpng14_do_read_intrapixel PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); +MODPNG14_EXTERN void modpng14_do_write_intrapixel PNGARG((modpng14_row_infop row_info, + modpng14_bytep row)); #endif -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) /* png.c */ /* PRIVATE */ -PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); +MODPNG14_EXTERN void modpng14_init_mmx_flags PNGARG((modpng14_structp modpng14_ptr)); #endif -/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ +/* Maintainer: Put new private prototypes here ^ and in libmodpng14pf.3 */ -#endif /* PNG_INTERNAL */ +#endif /* MODPNG14_INTERNAL */ #ifdef __cplusplus } #endif -#endif /* PNG_VERSION_INFO_ONLY */ +#endif /* MODPNG14_VERSION_INFO_ONLY */ /* do not put anything past this line */ -#endif /* PNG_H */ +#endif /* MODPNG14_H */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngasmrd.h +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngasmrd.h @@ -1,11 +1,11 @@ /* pngasmrd.h - assembler version of utilities to read a PNG file * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 2002 Glenn Randers-Pehrson * */ -/* This file is obsolete in libpng-1.0.9 and later; its contents now appear - * at the end of pngconf.h. +/* This file is obsolete in libmodpng14-1.0.9 and later; its contents now appear + * at the end of modpng14conf.h. */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngconf.h +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngconf.h @@ -1,28 +1,28 @@ -/* pngconf.h - machine configurable file for libpng +/* modpng14conf.h - machine configurable file for libmodpng14 * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ /* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. + * are configuring libmodpng14 for a machine, you may want to read the section + * starting here down to where it starts to typedef modpng14_color, modpng14_text, + * and modpng14_info. */ #ifndef PNGCONF_H #define PNGCONF_H #ifndef __i386__ /* change this if MMX/SSE become supported on x86_64! */ -#define PNG_NO_ASSEMBLER_CODE +#define MODPNG14_NO_ASSEMBLER_CODE #endif /* This is the size of the compression buffer, and thus the size of * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this + * machine. One of these will be allocated per modpng14_struct. When this * is full, it writes the data to the disk, and does some other * calculations. Making this an extremely small size will slow * the library down, but you may want to experiment to determine @@ -33,120 +33,120 @@ * it should not make much difference how big this is. */ -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 +#ifndef MODPNG14_ZBUF_SIZE +# define MODPNG14_ZBUF_SIZE 8192 #endif -/* Enable if you want a write-only libpng */ +/* Enable if you want a write-only libmodpng14 */ -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED +#ifndef MODPNG14_NO_READ_SUPPORTED +# define MODPNG14_READ_SUPPORTED #endif -/* Enable if you want a read-only libpng */ +/* Enable if you want a read-only libmodpng14 */ -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED +#ifndef MODPNG14_NO_WRITE_SUPPORTED +# define MODPNG14_WRITE_SUPPORTED #endif /* Enabled by default in 1.2.0. You can disable this if you don't need to support PNGs that are embedded in MNG datastreams */ -#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED +#if !defined(MODPNG14_1_0_X) && !defined(MODPNG14_NO_MNG_FEATURES) +# ifndef MODPNG14_MNG_FEATURES_SUPPORTED +# define MODPNG14_MNG_FEATURES_SUPPORTED # endif #endif -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED +#ifndef MODPNG14_NO_FLOATING_POINT_SUPPORTED +# ifndef MODPNG14_FLOATING_POINT_SUPPORTED +# define MODPNG14_FLOATING_POINT_SUPPORTED # endif #endif /* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not + * than 64K of memory at once, uncomment this. While libmodpng14 will not * normally need that much memory in a chunk (unless you load up a very * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it + * libmodpng14 thus makes sure to check any memory allocation to verify it * will fit into memory. -#define PNG_MAX_MALLOC_64K +#define MODPNG14_MAX_MALLOC_64K */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K +#if defined(MAXSEG_64K) && !defined(MODPNG14_MAX_MALLOC_64K) +# define MODPNG14_MAX_MALLOC_64K #endif /* Special munging to support doing things the 'cygwin' way: * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll + * MODPNG14_BUILD_DLL -- building dll + * MODPNG14_USE_DLL -- building an application, linking to dll * (no define) -- building static library, or building an * application and linking to the static lib * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll + * MODPNG14_BUILD_DLL -- (ignored) building the dll * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an + * MODPNG14_STATIC -- (ignored) building the static lib, or building an * application that links to the static lib. * ALL_STATIC -- (ignored) building various static libs, or building an * application that links to the static libs. * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and + * a cygwin user should define either MODPNG14_BUILD_DLL or MODPNG14_STATIC, and * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but + * that. If a cygwin user *wants* to define 'MODPNG14_USE_DLL' that's okay, but * unnecessary. * * Also, the precedence order is: * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL + * MODPNG14_BUILD_DLL + * MODPNG14_STATIC + * (nothing) == MODPNG14_USE_DLL * * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent * of auto-import in binutils, we no longer need to worry about * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes + * we don't need to worry about MODPNG14_STATIC or ALL_STATIC when it comes * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults + * MODPNG14_BUILD_DLL and MODPNG14_STATIC because those change some defaults * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. */ #if defined(__CYGWIN__) # if defined(ALL_STATIC) -# if defined(PNG_BUILD_DLL) -# undef PNG_BUILD_DLL +# if defined(MODPNG14_BUILD_DLL) +# undef MODPNG14_BUILD_DLL # endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL +# if defined(MODPNG14_USE_DLL) +# undef MODPNG14_USE_DLL # endif -# if defined(PNG_DLL) -# undef PNG_DLL +# if defined(MODPNG14_DLL) +# undef MODPNG14_DLL # endif -# if !defined(PNG_STATIC) -# define PNG_STATIC +# if !defined(MODPNG14_STATIC) +# define MODPNG14_STATIC # endif # else -# if defined (PNG_BUILD_DLL) -# if defined(PNG_STATIC) -# undef PNG_STATIC +# if defined (MODPNG14_BUILD_DLL) +# if defined(MODPNG14_STATIC) +# undef MODPNG14_STATIC # endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL +# if defined(MODPNG14_USE_DLL) +# undef MODPNG14_USE_DLL # endif -# if !defined(PNG_DLL) -# define PNG_DLL +# if !defined(MODPNG14_DLL) +# define MODPNG14_DLL # endif # else -# if defined(PNG_STATIC) -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL +# if defined(MODPNG14_STATIC) +# if defined(MODPNG14_USE_DLL) +# undef MODPNG14_USE_DLL # endif -# if defined(PNG_DLL) -# undef PNG_DLL +# if defined(MODPNG14_DLL) +# undef MODPNG14_DLL # endif # else -# if !defined(PNG_USE_DLL) -# define PNG_USE_DLL +# if !defined(MODPNG14_USE_DLL) +# define MODPNG14_USE_DLL # endif -# if !defined(PNG_DLL) -# define PNG_DLL +# if !defined(MODPNG14_DLL) +# define MODPNG14_DLL # endif # endif # endif @@ -156,39 +156,39 @@ /* This protects us against compilers that run on a windowing system * and thus don't have or would rather us not use the stdio types: * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO + * in modpng14_error() and modpng14_warning(). #defining MODPNG14_NO_CONSOLE_IO will + * prevent these from being compiled and used. #defining MODPNG14_NO_STDIO * will also prevent these, plus will prevent the entire set of stdio * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. + * unless (MODPNG14_DEBUG > 0) has been #defined. * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO + * #define MODPNG14_NO_CONSOLE_IO + * #define MODPNG14_NO_STDIO */ #if defined(_WIN32_WCE) # include /* Console I/O functions are not supported on WindowsCE */ -# define PNG_NO_CONSOLE_IO -# ifdef PNG_DEBUG -# undef PNG_DEBUG +# define MODPNG14_NO_CONSOLE_IO +# ifdef MODPNG14_DEBUG +# undef MODPNG14_DEBUG # endif #endif -#ifdef PNG_BUILD_DLL -# ifndef PNG_CONSOLE_IO_SUPPORTED -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO +#ifdef MODPNG14_BUILD_DLL +# ifndef MODPNG14_CONSOLE_IO_SUPPORTED +# ifndef MODPNG14_NO_CONSOLE_IO +# define MODPNG14_NO_CONSOLE_IO # endif # endif #endif -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO +# ifdef MODPNG14_NO_STDIO +# ifndef MODPNG14_NO_CONSOLE_IO +# define MODPNG14_NO_CONSOLE_IO # endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) +# ifdef MODPNG14_DEBUG +# if (MODPNG14_DEBUG > 0) # include # endif # endif @@ -214,8 +214,8 @@ #ifdef _NO_PROTO # define PNGARG(arglist) () -# ifndef PNG_TYPECAST_NULL -# define PNG_TYPECAST_NULL +# ifndef MODPNG14_TYPECAST_NULL +# define MODPNG14_TYPECAST_NULL # endif #else # define PNGARG(arglist) arglist @@ -241,22 +241,22 @@ # include #endif -#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED +#if !defined(MODPNG14_SETJMP_NOT_SUPPORTED) && !defined(MODPNG14_NO_SETJMP_SUPPORTED) +# define MODPNG14_SETJMP_SUPPORTED #endif -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* This is an attempt to force a single setjmp behaviour on Linux. If * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. */ # ifdef __linux__ # ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE +# define MODPNG14_SAVE_BSD_SOURCE # undef _BSD_SOURCE # endif # ifdef _SETJMP_H - __png.h__ already includes setjmp.h; + __modpng14.h__ already includes setjmp.h; __dont__ include it again.; # endif # endif /* __linux__ */ @@ -265,12 +265,12 @@ # include # ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE +# ifdef MODPNG14_SAVE_BSD_SOURCE # define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE +# undef MODPNG14_SAVE_BSD_SOURCE # endif # endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ +#endif /* MODPNG14_SETJMP_SUPPORTED */ #ifdef BSD # include @@ -279,24 +279,24 @@ #endif /* Other defines for things like memory and the like can go here. */ -#ifdef PNG_INTERNAL +#ifdef MODPNG14_INTERNAL #include -/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which +/* The functions exported by MODPNG14_EXTERN are MODPNG14_INTERNAL functions, which * aren't usually used outside the library (as far as I know), so it is * debatable if they should be exported at all. In the future, when it is * possible to have run-time registry of chunk-handling functions, some of * these will be made available again. -#define PNG_EXTERN extern +#define MODPNG14_EXTERN extern */ -#define PNG_EXTERN +#define MODPNG14_EXTERN /* Other defines specific to compilers can go here. Try to keep * them inside an appropriate ifdef/endif pair for portability. */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_FLOATING_POINT_SUPPORTED) # if defined(MACOS) /* We need to check that hasn't already been included earlier * as it seems it doesn't agree with , yet we should really use @@ -318,7 +318,7 @@ /* Codewarrior on NT has linking problems without this. */ #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN +# define MODPNG14_ALWAYS_EXTERN #endif /* For some reason, Borland C++ defines memcmp, etc. in mem.h, not @@ -338,14 +338,14 @@ * a largish chunk of memory (32K), those who are not as concerned * with dithering quality can decrease some or all of these. */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 +#ifndef MODPNG14_DITHER_RED_BITS +# define MODPNG14_DITHER_RED_BITS 5 #endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 +#ifndef MODPNG14_DITHER_GREEN_BITS +# define MODPNG14_DITHER_GREEN_BITS 5 #endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 +#ifndef MODPNG14_DITHER_BLUE_BITS +# define MODPNG14_DITHER_BLUE_BITS 5 #endif /* This controls how fine the gamma correction becomes when you @@ -355,28 +355,28 @@ * less then 8, and even that may not work (I haven't tested it). */ -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 +#ifndef MODPNG14_MAX_GAMMA_8 +# define MODPNG14_MAX_GAMMA_8 11 #endif /* This controls how much a difference in gamma we can tolerate before * we actually start doing gamma conversion. */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 +#ifndef MODPNG14_GAMMA_THRESHOLD +# define MODPNG14_GAMMA_THRESHOLD 0.05 #endif -#endif /* PNG_INTERNAL */ +#endif /* MODPNG14_INTERNAL */ /* The following uses const char * instead of char * for error * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. + * If you do not want to use const, define MODPNG14_NO_CONST here. */ -#ifndef PNG_NO_CONST -# define PNG_CONST const +#ifndef MODPNG14_NO_CONST +# define MODPNG14_CONST const #else -# define PNG_CONST +# define MODPNG14_CONST #endif /* The following defines give you the ability to remove code from the @@ -396,294 +396,294 @@ /* Any features you will not be using can be undef'ed here */ /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS + * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *MODPNG14_NO_*_TRANSFORMS * on the compile line, then pick and choose which ones to define without * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED * if you only want to have a png-compliant reader/writer but don't need * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version + * typical installation of the library. (MODPNG14_NO_* form added in version * 1.0.1c, for consistency) */ -/* The size of the png_text structure changed in libpng-1.0.6 when +/* The size of the modpng14_text structure changed in libmodpng14-1.0.6 when * iTXt is supported. It is turned off by default, to support old apps - * that malloc the png_text structure instead of calling png_set_text() - * and letting libpng malloc it. It will be turned on by default in - * libpng-1.3.0. + * that malloc the modpng14_text structure instead of calling modpng14_set_text() + * and letting libmodpng14 malloc it. It will be turned on by default in + * libmodpng14-1.3.0. */ -#ifndef PNG_iTXt_SUPPORTED -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) -# define PNG_NO_READ_iTXt +#ifndef MODPNG14_iTXt_SUPPORTED +# if !defined(MODPNG14_READ_iTXt_SUPPORTED) && !defined(MODPNG14_NO_READ_iTXt) +# define MODPNG14_NO_READ_iTXt # endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) -# define PNG_NO_WRITE_iTXt +# if !defined(MODPNG14_WRITE_iTXt_SUPPORTED) && !defined(MODPNG14_NO_WRITE_iTXt) +# define MODPNG14_NO_WRITE_iTXt # endif #endif /* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info + * masse by defining MODPNG14_LEGACY_SUPPORTED in case you need binary compatibility + * with old applications that require the length of modpng14_struct and modpng14_info * to remain unchanged. */ -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_LEGACY_SUPPORTED +# define MODPNG14_NO_FREE_ME +# define MODPNG14_NO_READ_UNKNOWN_CHUNKS +# define MODPNG14_NO_WRITE_UNKNOWN_CHUNKS +# define MODPNG14_NO_READ_USER_CHUNKS +# define MODPNG14_NO_READ_iCCP +# define MODPNG14_NO_WRITE_iCCP +# define MODPNG14_NO_READ_iTXt +# define MODPNG14_NO_WRITE_iTXt +# define MODPNG14_NO_READ_sCAL +# define MODPNG14_NO_WRITE_sCAL +# define MODPNG14_NO_READ_sPLT +# define MODPNG14_NO_WRITE_sPLT +# define MODPNG14_NO_INFO_IMAGE +# define MODPNG14_NO_READ_RGB_TO_GRAY +# define MODPNG14_NO_READ_USER_TRANSFORM +# define MODPNG14_NO_WRITE_USER_TRANSFORM +# define MODPNG14_NO_USER_MEM +# define MODPNG14_NO_READ_EMPTY_PLTE +# define MODPNG14_NO_MNG_FEATURES +# define MODPNG14_NO_FIXED_POINT_SUPPORTED #endif /* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED +#if !defined(MODPNG14_FLOATING_POINT_SUPPORTED) || \ + !defined(MODPNG14_NO_FIXED_POINT_SUPPORTED) +# define MODPNG14_FIXED_POINT_SUPPORTED #endif -#ifndef PNG_NO_FREE_ME -# define PNG_FREE_ME_SUPPORTED +#ifndef MODPNG14_NO_FREE_ME +# define MODPNG14_FREE_ME_SUPPORTED #endif -#if defined(PNG_READ_SUPPORTED) +#if defined(MODPNG14_READ_SUPPORTED) -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED +#if !defined(MODPNG14_READ_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(MODPNG14_NO_READ_TRANSFORMS) +# define MODPNG14_READ_TRANSFORMS_SUPPORTED #endif -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED +#ifdef MODPNG14_READ_TRANSFORMS_SUPPORTED +# ifndef MODPNG14_NO_READ_EXPAND +# define MODPNG14_READ_EXPAND_SUPPORTED # endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED +# ifndef MODPNG14_NO_READ_SHIFT +# define MODPNG14_READ_SHIFT_SUPPORTED # endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED +# ifndef MODPNG14_NO_READ_PACK +# define MODPNG14_READ_PACK_SUPPORTED # endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED +# ifndef MODPNG14_NO_READ_BGR +# define MODPNG14_READ_BGR_SUPPORTED # endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED +# ifndef MODPNG14_NO_READ_SWAP +# define MODPNG14_READ_SWAP_SUPPORTED # endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED +# ifndef MODPNG14_NO_READ_PACKSWAP +# define MODPNG14_READ_PACKSWAP_SUPPORTED # endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED +# ifndef MODPNG14_NO_READ_INVERT +# define MODPNG14_READ_INVERT_SUPPORTED # endif -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED +# ifndef MODPNG14_NO_READ_DITHER +# define MODPNG14_READ_DITHER_SUPPORTED # endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED +# ifndef MODPNG14_NO_READ_BACKGROUND +# define MODPNG14_READ_BACKGROUND_SUPPORTED # endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED +# ifndef MODPNG14_NO_READ_16_TO_8 +# define MODPNG14_READ_16_TO_8_SUPPORTED # endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED +# ifndef MODPNG14_NO_READ_FILLER +# define MODPNG14_READ_FILLER_SUPPORTED # endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED +# ifndef MODPNG14_NO_READ_GAMMA +# define MODPNG14_READ_GAMMA_SUPPORTED # endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED +# ifndef MODPNG14_NO_READ_GRAY_TO_RGB +# define MODPNG14_READ_GRAY_TO_RGB_SUPPORTED # endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED +# ifndef MODPNG14_NO_READ_SWAP_ALPHA +# define MODPNG14_READ_SWAP_ALPHA_SUPPORTED # endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED +# ifndef MODPNG14_NO_READ_INVERT_ALPHA +# define MODPNG14_READ_INVERT_ALPHA_SUPPORTED # endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED +# ifndef MODPNG14_NO_READ_STRIP_ALPHA +# define MODPNG14_READ_STRIP_ALPHA_SUPPORTED # endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED +# ifndef MODPNG14_NO_READ_USER_TRANSFORM +# define MODPNG14_READ_USER_TRANSFORM_SUPPORTED # endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED +# ifndef MODPNG14_NO_READ_RGB_TO_GRAY +# define MODPNG14_READ_RGB_TO_GRAY_SUPPORTED # endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ +#endif /* MODPNG14_READ_TRANSFORMS_SUPPORTED */ -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ +#if !defined(MODPNG14_NO_PROGRESSIVE_READ) && \ + !defined(MODPNG14_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ +# define MODPNG14_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ #endif /* about interlacing capability! You'll */ /* still have interlacing unless you change the following line: */ -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ +#define MODPNG14_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ +#ifndef MODPNG14_NO_READ_COMPOSITE_NODIV +# ifndef MODPNG14_NO_READ_COMPOSITED_NODIV /* libmodpng14-1.0.x misspelling */ +# define MODPNG14_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ # endif #endif /* Deprecated, will be removed from version 2.0.0. - Use PNG_MNG_FEATURES_SUPPORTED instead. */ -#ifndef PNG_NO_READ_EMPTY_PLTE -# define PNG_READ_EMPTY_PLTE_SUPPORTED + Use MODPNG14_MNG_FEATURES_SUPPORTED instead. */ +#ifndef MODPNG14_NO_READ_EMPTY_PLTE +# define MODPNG14_READ_EMPTY_PLTE_SUPPORTED #endif -#endif /* PNG_READ_SUPPORTED */ +#endif /* MODPNG14_READ_SUPPORTED */ -#if defined(PNG_WRITE_SUPPORTED) +#if defined(MODPNG14_WRITE_SUPPORTED) -# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED +# if !defined(MODPNG14_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(MODPNG14_NO_WRITE_TRANSFORMS) +# define MODPNG14_WRITE_TRANSFORMS_SUPPORTED #endif -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED +#ifdef MODPNG14_WRITE_TRANSFORMS_SUPPORTED +# ifndef MODPNG14_NO_WRITE_SHIFT +# define MODPNG14_WRITE_SHIFT_SUPPORTED # endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED +# ifndef MODPNG14_NO_WRITE_PACK +# define MODPNG14_WRITE_PACK_SUPPORTED # endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED +# ifndef MODPNG14_NO_WRITE_BGR +# define MODPNG14_WRITE_BGR_SUPPORTED # endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED +# ifndef MODPNG14_NO_WRITE_SWAP +# define MODPNG14_WRITE_SWAP_SUPPORTED # endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED +# ifndef MODPNG14_NO_WRITE_PACKSWAP +# define MODPNG14_WRITE_PACKSWAP_SUPPORTED # endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED +# ifndef MODPNG14_NO_WRITE_INVERT +# define MODPNG14_WRITE_INVERT_SUPPORTED # endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ +# ifndef MODPNG14_NO_WRITE_FILLER +# define MODPNG14_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ # endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +# ifndef MODPNG14_NO_WRITE_SWAP_ALPHA +# define MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED # endif -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED +# ifndef MODPNG14_NO_WRITE_INVERT_ALPHA +# define MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED # endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED +# ifndef MODPNG14_NO_WRITE_USER_TRANSFORM +# define MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED # endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ +#endif /* MODPNG14_WRITE_TRANSFORMS_SUPPORTED */ -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) +# ifndef MODPNG14_NO_USER_TRANSFORM_PTR +# define MODPNG14_USER_TRANSFORM_PTR_SUPPORTED # endif #endif -#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant +#define MODPNG14_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant encoders, but can cause trouble if left undefined */ -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#if !defined(MODPNG14_NO_WRITE_WEIGHTED_FILTER) && \ + defined(MODPNG14_FLOATING_POINT_SUPPORTED) +# define MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED #endif -#ifndef PNG_1_0_X -#ifndef PNG_NO_ERROR_NUMBERS -#define PNG_ERROR_NUMBERS_SUPPORTED +#ifndef MODPNG14_1_0_X +#ifndef MODPNG14_NO_ERROR_NUMBERS +#define MODPNG14_ERROR_NUMBERS_SUPPORTED #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED +#ifndef MODPNG14_NO_WRITE_FLUSH +# define MODPNG14_WRITE_FLUSH_SUPPORTED #endif -/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ -#ifndef PNG_NO_WRITE_EMPTY_PLTE -# define PNG_WRITE_EMPTY_PLTE_SUPPORTED +/* Deprecated, see MODPNG14_MNG_FEATURES_SUPPORTED, above */ +#ifndef MODPNG14_NO_WRITE_EMPTY_PLTE +# define MODPNG14_WRITE_EMPTY_PLTE_SUPPORTED #endif -#endif /* PNG_WRITE_SUPPORTED */ +#endif /* MODPNG14_WRITE_SUPPORTED */ -#ifndef PNG_NO_STDIO -# define PNG_TIME_RFC1123_SUPPORTED +#ifndef MODPNG14_NO_STDIO +# define MODPNG14_TIME_RFC1123_SUPPORTED #endif /* This adds extra functions in pngget.c for accessing data from the * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 - even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */ -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) -# ifndef PNG_ASSEMBLER_CODE_SUPPORTED -# define PNG_ASSEMBLER_CODE_SUPPORTED + * modpng14_get_image_width() + * modpng14_get_image_height() + * modpng14_get_bit_depth() + * modpng14_get_color_type() + * modpng14_get_compression_type() + * modpng14_get_filter_type() + * modpng14_get_interlace_type() + * modpng14_get_pixel_aspect_ratio() + * modpng14_get_pixels_per_meter() + * modpng14_get_x_offset_pixels() + * modpng14_get_y_offset_pixels() + * modpng14_get_x_offset_microns() + * modpng14_get_y_offset_microns() + */ +#if !defined(MODPNG14_NO_EASY_ACCESS) && !defined(MODPNG14_EASY_ACCESS_SUPPORTED) +# define MODPNG14_EASY_ACCESS_SUPPORTED +#endif + +/* MODPNG14_ASSEMBLER_CODE was enabled by default in version 1.2.0 + even when MODPNG14_USE_PNGVCRD or MODPNG14_USE_PNGGCCRD is not defined */ +#if defined(MODPNG14_READ_SUPPORTED) && !defined(MODPNG14_NO_ASSEMBLER_CODE) +# ifndef MODPNG14_ASSEMBLER_CODE_SUPPORTED +# define MODPNG14_ASSEMBLER_CODE_SUPPORTED # endif -# if defined(XP_MACOSX) && !defined(PNG_NO_MMX_CODE) +# if defined(XP_MACOSX) && !defined(MODPNG14_NO_MMX_CODE) /* work around Intel-Mac compiler bug */ -# define PNG_NO_MMX_CODE +# define MODPNG14_NO_MMX_CODE # endif -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_MMX_CODE_SUPPORTED +# if !defined(MODPNG14_MMX_CODE_SUPPORTED) && !defined(MODPNG14_NO_MMX_CODE) +# define MODPNG14_MMX_CODE_SUPPORTED # endif #endif /* If you are sure that you don't need thread safety and you are compiling - with PNG_USE_PNGCCRD for an MMX application, you can define this for + with MODPNG14_USE_PNGCCRD for an MMX application, you can define this for faster execution. See pnggccrd.c. -#define PNG_THREAD_UNSAFE_OK +#define MODPNG14_THREAD_UNSAFE_OK */ -#if !defined(PNG_1_0_X) -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED +#if !defined(MODPNG14_1_0_X) +#if !defined(MODPNG14_NO_USER_MEM) && !defined(MODPNG14_USER_MEM_SUPPORTED) +# define MODPNG14_USER_MEM_SUPPORTED #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L +#ifndef MODPNG14_USER_WIDTH_MAX +# define MODPNG14_USER_WIDTH_MAX 1000000L #endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L +#ifndef MODPNG14_USER_HEIGHT_MAX +# define MODPNG14_USER_HEIGHT_MAX 1000000L #endif /* These are currently experimental features, define them if you want */ /* very little testing */ /* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +#ifdef MODPNG14_READ_SUPPORTED +# ifndef MODPNG14_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# define MODPNG14_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED # endif #endif */ @@ -691,294 +691,294 @@ /* This is only for PowerPC big-endian and 680x0 systems */ /* some testing */ /* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED +#ifdef MODPNG14_READ_SUPPORTED +# ifndef MODPNG14_MODPNG14_READ_BIG_ENDIAN_SUPPORTED +# define MODPNG14_READ_BIG_ENDIAN_SUPPORTED # endif #endif */ /* Buggy compilers (e.g., gcc 2.7.2.2) need this */ /* -#define PNG_NO_POINTER_INDEXING +#define MODPNG14_NO_POINTER_INDEXING */ /* These functions are turned off by default, as they will be phased out. */ /* -#define PNG_USELESS_TESTS_SUPPORTED -#define PNG_CORRECT_PALETTE_SUPPORTED +#define MODPNG14_USELESS_TESTS_SUPPORTED +#define MODPNG14_CORRECT_PALETTE_SUPPORTED */ /* Any chunks you are not interested in, you can undef here. The * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info + * tEXt, zTXt, tRNS, pCAL). Others will just save time and make modpng14_info * a bit smaller. */ -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#if defined(MODPNG14_READ_SUPPORTED) && \ + !defined(MODPNG14_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(MODPNG14_NO_READ_ANCILLARY_CHUNKS) +# define MODPNG14_READ_ANCILLARY_CHUNKS_SUPPORTED #endif -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#if defined(MODPNG14_WRITE_SUPPORTED) && \ + !defined(MODPNG14_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(MODPNG14_NO_WRITE_ANCILLARY_CHUNKS) +# define MODPNG14_WRITE_ANCILLARY_CHUNKS_SUPPORTED #endif -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#ifdef MODPNG14_READ_ANCILLARY_CHUNKS_SUPPORTED -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt +#ifdef MODPNG14_NO_READ_TEXT +# define MODPNG14_NO_READ_iTXt +# define MODPNG14_NO_READ_tEXt +# define MODPNG14_NO_READ_zTXt #endif -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED +#ifndef MODPNG14_NO_READ_bKGD +# define MODPNG14_READ_bKGD_SUPPORTED +# define MODPNG14_bKGD_SUPPORTED #endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED +#ifndef MODPNG14_NO_READ_cHRM +# define MODPNG14_READ_cHRM_SUPPORTED +# define MODPNG14_cHRM_SUPPORTED #endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED +#ifndef MODPNG14_NO_READ_gAMA +# define MODPNG14_READ_gAMA_SUPPORTED +# define MODPNG14_gAMA_SUPPORTED #endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED +#ifndef MODPNG14_NO_READ_hIST +# define MODPNG14_READ_hIST_SUPPORTED +# define MODPNG14_hIST_SUPPORTED #endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED +#ifndef MODPNG14_NO_READ_iCCP +# define MODPNG14_READ_iCCP_SUPPORTED +# define MODPNG14_iCCP_SUPPORTED #endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED +#ifndef MODPNG14_NO_READ_iTXt +# ifndef MODPNG14_READ_iTXt_SUPPORTED +# define MODPNG14_READ_iTXt_SUPPORTED # endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED +# ifndef MODPNG14_iTXt_SUPPORTED +# define MODPNG14_iTXt_SUPPORTED # endif #endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED +#ifndef MODPNG14_NO_READ_oFFs +# define MODPNG14_READ_oFFs_SUPPORTED +# define MODPNG14_oFFs_SUPPORTED #endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED +#ifndef MODPNG14_NO_READ_pCAL +# define MODPNG14_READ_pCAL_SUPPORTED +# define MODPNG14_pCAL_SUPPORTED #endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED +#ifndef MODPNG14_NO_READ_sCAL +# define MODPNG14_READ_sCAL_SUPPORTED +# define MODPNG14_sCAL_SUPPORTED #endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED +#ifndef MODPNG14_NO_READ_pHYs +# define MODPNG14_READ_pHYs_SUPPORTED +# define MODPNG14_pHYs_SUPPORTED #endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED +#ifndef MODPNG14_NO_READ_sBIT +# define MODPNG14_READ_sBIT_SUPPORTED +# define MODPNG14_sBIT_SUPPORTED #endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED +#ifndef MODPNG14_NO_READ_sPLT +# define MODPNG14_READ_sPLT_SUPPORTED +# define MODPNG14_sPLT_SUPPORTED #endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED +#ifndef MODPNG14_NO_READ_sRGB +# define MODPNG14_READ_sRGB_SUPPORTED +# define MODPNG14_sRGB_SUPPORTED #endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED +#ifndef MODPNG14_NO_READ_tEXt +# define MODPNG14_READ_tEXt_SUPPORTED +# define MODPNG14_tEXt_SUPPORTED #endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED +#ifndef MODPNG14_NO_READ_tIME +# define MODPNG14_READ_tIME_SUPPORTED +# define MODPNG14_tIME_SUPPORTED #endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED +#ifndef MODPNG14_NO_READ_tRNS +# define MODPNG14_READ_tRNS_SUPPORTED +# define MODPNG14_tRNS_SUPPORTED #endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED +#ifndef MODPNG14_NO_READ_zTXt +# define MODPNG14_READ_zTXt_SUPPORTED +# define MODPNG14_zTXt_SUPPORTED #endif -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED +#ifndef MODPNG14_NO_READ_UNKNOWN_CHUNKS +# define MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED +# ifndef MODPNG14_UNKNOWN_CHUNKS_SUPPORTED +# define MODPNG14_UNKNOWN_CHUNKS_SUPPORTED # endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# ifndef MODPNG14_NO_HANDLE_AS_UNKNOWN +# define MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED # endif #endif -#if !defined(PNG_NO_READ_USER_CHUNKS) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# define PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# ifdef PNG_NO_READ_UNKNOWN_CHUNKS -# undef PNG_NO_READ_UNKNOWN_CHUNKS +#if !defined(MODPNG14_NO_READ_USER_CHUNKS) && \ + defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) +# define MODPNG14_READ_USER_CHUNKS_SUPPORTED +# define MODPNG14_USER_CHUNKS_SUPPORTED +# ifdef MODPNG14_NO_READ_UNKNOWN_CHUNKS +# undef MODPNG14_NO_READ_UNKNOWN_CHUNKS # endif -# ifdef PNG_NO_HANDLE_AS_UNKNOWN -# undef PNG_NO_HANDLE_AS_UNKNOWN +# ifdef MODPNG14_NO_HANDLE_AS_UNKNOWN +# undef MODPNG14_NO_HANDLE_AS_UNKNOWN # endif #endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ +#ifndef MODPNG14_NO_READ_OPT_PLTE +# define MODPNG14_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ #endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED +#if defined(MODPNG14_READ_iTXt_SUPPORTED) || defined(MODPNG14_READ_tEXt_SUPPORTED) || \ + defined(MODPNG14_READ_zTXt_SUPPORTED) +# define MODPNG14_READ_TEXT_SUPPORTED +# define MODPNG14_TEXT_SUPPORTED #endif -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ +#endif /* MODPNG14_READ_ANCILLARY_CHUNKS_SUPPORTED */ -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#ifdef MODPNG14_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt +#ifdef MODPNG14_NO_WRITE_TEXT +# define MODPNG14_NO_WRITE_iTXt +# define MODPNG14_NO_WRITE_tEXt +# define MODPNG14_NO_WRITE_zTXt #endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED +#ifndef MODPNG14_NO_WRITE_bKGD +# define MODPNG14_WRITE_bKGD_SUPPORTED +# ifndef MODPNG14_bKGD_SUPPORTED +# define MODPNG14_bKGD_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED +#ifndef MODPNG14_NO_WRITE_cHRM +# define MODPNG14_WRITE_cHRM_SUPPORTED +# ifndef MODPNG14_cHRM_SUPPORTED +# define MODPNG14_cHRM_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED +#ifndef MODPNG14_NO_WRITE_gAMA +# define MODPNG14_WRITE_gAMA_SUPPORTED +# ifndef MODPNG14_gAMA_SUPPORTED +# define MODPNG14_gAMA_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED +#ifndef MODPNG14_NO_WRITE_hIST +# define MODPNG14_WRITE_hIST_SUPPORTED +# ifndef MODPNG14_hIST_SUPPORTED +# define MODPNG14_hIST_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED +#ifndef MODPNG14_NO_WRITE_iCCP +# define MODPNG14_WRITE_iCCP_SUPPORTED +# ifndef MODPNG14_iCCP_SUPPORTED +# define MODPNG14_iCCP_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED +#ifndef MODPNG14_NO_WRITE_iTXt +# ifndef MODPNG14_WRITE_iTXt_SUPPORTED +# define MODPNG14_WRITE_iTXt_SUPPORTED # endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED +# ifndef MODPNG14_iTXt_SUPPORTED +# define MODPNG14_iTXt_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED +#ifndef MODPNG14_NO_WRITE_oFFs +# define MODPNG14_WRITE_oFFs_SUPPORTED +# ifndef MODPNG14_oFFs_SUPPORTED +# define MODPNG14_oFFs_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED +#ifndef MODPNG14_NO_WRITE_pCAL +# define MODPNG14_WRITE_pCAL_SUPPORTED +# ifndef MODPNG14_pCAL_SUPPORTED +# define MODPNG14_pCAL_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED +#ifndef MODPNG14_NO_WRITE_sCAL +# define MODPNG14_WRITE_sCAL_SUPPORTED +# ifndef MODPNG14_sCAL_SUPPORTED +# define MODPNG14_sCAL_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED +#ifndef MODPNG14_NO_WRITE_pHYs +# define MODPNG14_WRITE_pHYs_SUPPORTED +# ifndef MODPNG14_pHYs_SUPPORTED +# define MODPNG14_pHYs_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED +#ifndef MODPNG14_NO_WRITE_sBIT +# define MODPNG14_WRITE_sBIT_SUPPORTED +# ifndef MODPNG14_sBIT_SUPPORTED +# define MODPNG14_sBIT_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED +#ifndef MODPNG14_NO_WRITE_sPLT +# define MODPNG14_WRITE_sPLT_SUPPORTED +# ifndef MODPNG14_sPLT_SUPPORTED +# define MODPNG14_sPLT_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED +#ifndef MODPNG14_NO_WRITE_sRGB +# define MODPNG14_WRITE_sRGB_SUPPORTED +# ifndef MODPNG14_sRGB_SUPPORTED +# define MODPNG14_sRGB_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED +#ifndef MODPNG14_NO_WRITE_tEXt +# define MODPNG14_WRITE_tEXt_SUPPORTED +# ifndef MODPNG14_tEXt_SUPPORTED +# define MODPNG14_tEXt_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED +#ifndef MODPNG14_NO_WRITE_tIME +# define MODPNG14_WRITE_tIME_SUPPORTED +# ifndef MODPNG14_tIME_SUPPORTED +# define MODPNG14_tIME_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED +#ifndef MODPNG14_NO_WRITE_tRNS +# define MODPNG14_WRITE_tRNS_SUPPORTED +# ifndef MODPNG14_tRNS_SUPPORTED +# define MODPNG14_tRNS_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED +#ifndef MODPNG14_NO_WRITE_zTXt +# define MODPNG14_WRITE_zTXt_SUPPORTED +# ifndef MODPNG14_zTXt_SUPPORTED +# define MODPNG14_zTXt_SUPPORTED # endif #endif -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED +#ifndef MODPNG14_NO_WRITE_UNKNOWN_CHUNKS +# define MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED +# ifndef MODPNG14_UNKNOWN_CHUNKS_SUPPORTED +# define MODPNG14_UNKNOWN_CHUNKS_SUPPORTED # endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# ifndef MODPNG14_NO_HANDLE_AS_UNKNOWN +# ifndef MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED +# define MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED # endif # endif #endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED +#if defined(MODPNG14_WRITE_iTXt_SUPPORTED) || defined(MODPNG14_WRITE_tEXt_SUPPORTED) || \ + defined(MODPNG14_WRITE_zTXt_SUPPORTED) +# define MODPNG14_WRITE_TEXT_SUPPORTED +# ifndef MODPNG14_TEXT_SUPPORTED +# define MODPNG14_TEXT_SUPPORTED # endif #endif -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ +#endif /* MODPNG14_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member +/* Turn this off to disable modpng14_read_png() and + * modpng14_write_png() and leave the row_pointers member * out of the info structure. */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED +#ifndef MODPNG14_NO_INFO_IMAGE +# define MODPNG14_INFO_IMAGE_SUPPORTED #endif /* need the time information for reading tIME chunks */ -#if defined(PNG_tIME_SUPPORTED) +#if defined(MODPNG14_tIME_SUPPORTED) # if !defined(_WIN32_WCE) /* "time.h" functions are not supported on WindowsCE */ # include @@ -987,25 +987,25 @@ /* Some typedefs to get us started. These should be safe on most of the * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they + * numbers suggest (a modpng14_uint_32 must be at least 32 bits long), but they * don't have to be exactly that size. Some compilers dislike passing * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may - * want to have unsigned int for png_uint_32 instead of unsigned long. + * unsigned int for modpng14_uint_16. Likewise, for 64-bit systems, you may + * want to have unsigned int for modpng14_uint_32 instead of unsigned long. */ -typedef unsigned long png_uint_32; -typedef long png_int_32; -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; +typedef unsigned long modpng14_uint_32; +typedef long modpng14_int_32; +typedef unsigned short modpng14_uint_16; +typedef short modpng14_int_16; +typedef unsigned char modpng14_byte; /* This is usually size_t. It is typedef'ed just in case you need it to change (I'm not sure if you will or not, so I thought I'd be safe) */ -typedef size_t png_size_t; +typedef size_t modpng14_size_t; /* The following is needed for medium model support. It cannot be in the - * PNG_INTERNAL section. Needs modification for other compilers besides + * MODPNG14_INTERNAL section. Needs modification for other compilers besides * MSC. Model independent support declares all arrays and pointers to be * large using the far keyword. The zlib version used must also support * model independent data. As of version zlib 1.0.4, the necessary changes @@ -1023,7 +1023,7 @@ # endif /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K +# define MODPNG14_MAX_MALLOC_64K # if (LDATA != 1) # ifndef FAR # define FAR __far @@ -1065,300 +1065,300 @@ /* Typedef for floating-point numbers that are converted to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; +typedef modpng14_int_32 modpng14_fixed_point; /* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; +typedef void FAR * modpng14_voidp; +typedef modpng14_byte FAR * modpng14_bytep; +typedef modpng14_uint_32 FAR * modpng14_uint_32p; +typedef modpng14_int_32 FAR * modpng14_int_32p; +typedef modpng14_uint_16 FAR * modpng14_uint_16p; +typedef modpng14_int_16 FAR * modpng14_int_16p; +typedef MODPNG14_CONST char FAR * modpng14_const_charp; +typedef char FAR * modpng14_charp; +typedef modpng14_fixed_point FAR * modpng14_fixed_point_p; -#ifndef PNG_NO_STDIO +#ifndef MODPNG14_NO_STDIO #if defined(_WIN32_WCE) -typedef HANDLE png_FILE_p; +typedef HANDLE modpng14_FILE_p; #else -typedef FILE * png_FILE_p; +typedef FILE * modpng14_FILE_p; #endif #endif -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +typedef double FAR * modpng14_doublep; #endif /* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; +typedef modpng14_byte FAR * FAR * modpng14_bytepp; +typedef modpng14_uint_32 FAR * FAR * modpng14_uint_32pp; +typedef modpng14_int_32 FAR * FAR * modpng14_int_32pp; +typedef modpng14_uint_16 FAR * FAR * modpng14_uint_16pp; +typedef modpng14_int_16 FAR * FAR * modpng14_int_16pp; +typedef MODPNG14_CONST char FAR * FAR * modpng14_const_charpp; +typedef char FAR * FAR * modpng14_charpp; +typedef modpng14_fixed_point FAR * FAR * modpng14_fixed_point_pp; +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +typedef double FAR * FAR * modpng14_doublepp; #endif /* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; +typedef char FAR * FAR * FAR * modpng14_charppp; -/* libpng typedefs for types in zlib. If zlib changes +/* libmodpng14 typedefs for types in zlib. If zlib changes * or another compression library is used, then change these. * Eliminates need to change all the source files. */ -typedef charf * png_zcharp; -typedef charf * FAR * png_zcharpp; -typedef z_stream FAR * png_zstreamp; +typedef charf * modpng14_zcharp; +typedef charf * FAR * modpng14_zcharpp; +typedef z_stream FAR * modpng14_zstreamp; /* - * Define PNG_BUILD_DLL if the module being built is a Windows + * Define MODPNG14_BUILD_DLL if the module being built is a Windows * LIBPNG DLL. * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. + * Define MODPNG14_USE_DLL if you want to *link* to the Windows LIBPNG DLL. * It is equivalent to Microsoft predefined macro _DLL that is * automatically defined when you compile using the share * version of the CRT (C Run-Time library) * * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, + * Define MODPNG14_BUILD_DLL if you are building a dll for use with cygwin + * Define MODPNG14_STATIC if you are building a static library for use with cygwin, * -or- if you are building an application that you want to link to the * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of + * MODPNG14_USE_DLL is defined by default (no user action needed) unless one of * the other flags is defined. */ -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL +#if !defined(MODPNG14_DLL) && (defined(MODPNG14_BUILD_DLL) || defined(MODPNG14_USE_DLL)) +# define MODPNG14_DLL #endif /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. * When building a static lib, default to no GLOBAL ARRAYS, but allow * command-line override */ #if defined(__CYGWIN__) -# if !defined(PNG_STATIC) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS +# if !defined(MODPNG14_STATIC) +# if defined(MODPNG14_USE_GLOBAL_ARRAYS) +# undef MODPNG14_USE_GLOBAL_ARRAYS # endif -# if !defined(PNG_USE_LOCAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS +# if !defined(MODPNG14_USE_LOCAL_ARRAYS) +# define MODPNG14_USE_LOCAL_ARRAYS # endif # else -# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS +# if defined(MODPNG14_USE_LOCAL_ARRAYS) || defined(MODPNG14_NO_GLOBAL_ARRAYS) +# if defined(MODPNG14_USE_GLOBAL_ARRAYS) +# undef MODPNG14_USE_GLOBAL_ARRAYS # endif # endif # endif -# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS +# if !defined(MODPNG14_USE_LOCAL_ARRAYS) && !defined(MODPNG14_USE_GLOBAL_ARRAYS) +# define MODPNG14_USE_LOCAL_ARRAYS # endif #endif /* Do not use global arrays (helps with building DLL's) - * They are no longer used in libpng itself, since version 1.0.5c, + * They are no longer used in libmodpng14 itself, since version 1.0.5c, * but might be required for some pre-1.0.5c applications. */ -#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL)) -# define PNG_USE_LOCAL_ARRAYS +#if !defined(MODPNG14_USE_LOCAL_ARRAYS) && !defined(MODPNG14_USE_GLOBAL_ARRAYS) +# if defined(MODPNG14_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(MODPNG14_DLL)) +# define MODPNG14_USE_LOCAL_ARRAYS # else -# define PNG_USE_GLOBAL_ARRAYS +# define MODPNG14_USE_GLOBAL_ARRAYS # endif #endif #if defined(__CYGWIN__) -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP +# undef MODPNG14API +# define MODPNG14API __cdecl +# undef MODPNG14_IMPEXP +# define MODPNG14_IMPEXP #endif -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. +/* If you define MODPNG14API, e.g., with compiler option "-DMODPNG14API=__stdcall", + * you may get warnings regarding the linkage of modpng14_zalloc and modpng14_zfree. * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. + * convention in your compiler to match your MODPNG14API, and you must build + * zlib and your applications the same way you build libmodpng14. */ -#ifndef PNGAPI +#ifndef MODPNG14API -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF +#if defined(__MINGW32__) && !defined(MODPNG14_MODULEDEF) +# ifndef MODPNG14_NO_MODULEDEF +# define MODPNG14_NO_MODULEDEF # endif #endif -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP +#if !defined(MODPNG14_IMPEXP) && defined(MODPNG14_BUILD_DLL) && !defined(MODPNG14_NO_MODULEDEF) +# define MODPNG14_IMPEXP #endif -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ +#if defined(MODPNG14_DLL) || defined(_DLL) || defined(__DLL__ ) || \ (( defined(_Windows) || defined(_WINDOWS) || \ defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl +# define MODPNG14API __cdecl # else -# define PNGAPI _cdecl +# define MODPNG14API _cdecl # endif -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ +# if !defined(MODPNG14_IMPEXP) && (!defined(MODPNG14_DLL) || \ 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP +# define MODPNG14_IMPEXP # endif -# if !defined(PNG_IMPEXP) +# if !defined(MODPNG14_IMPEXP) -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol +# define MODPNG14_EXPORT_TYPE1(type,symbol) MODPNG14_IMPEXP type MODPNG14API symbol +# define MODPNG14_EXPORT_TYPE2(type,symbol) type MODPNG14_IMPEXP MODPNG14API symbol /* Borland/Microsoft */ # if defined(_MSC_VER) || defined(__BORLANDC__) # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 +# define MODPNG14_EXPORT MODPNG14_EXPORT_TYPE1 # else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __export +# define MODPNG14_EXPORT MODPNG14_EXPORT_TYPE2 +# if defined(MODPNG14_BUILD_DLL) +# define MODPNG14_IMPEXP __export # else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in +# define MODPNG14_IMPEXP /*__import */ /* doesn't exist AFAIK in VC++ */ # endif /* Exists in Borland C++ for C++ classes (== huge) */ # endif # endif -# if !defined(PNG_IMPEXP) -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __declspec(dllexport) +# if !defined(MODPNG14_IMPEXP) +# if defined(MODPNG14_BUILD_DLL) +# define MODPNG14_IMPEXP __declspec(dllexport) # else -# define PNG_IMPEXP __declspec(dllimport) +# define MODPNG14_IMPEXP __declspec(dllimport) # endif # endif -# endif /* PNG_IMPEXP */ +# endif /* MODPNG14_IMPEXP */ #else /* !(DLL || non-cygwin WINDOWS) */ # if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__) -# define PNGAPI _System -# define PNG_IMPEXP +# define MODPNG14API _System +# define MODPNG14_IMPEXP # else # if 0 /* ... other platforms, with other meanings */ # else -# define PNGAPI -# define PNG_IMPEXP +# define MODPNG14API +# define MODPNG14_IMPEXP # endif # endif #endif #endif -#ifndef PNGAPI -# define PNGAPI +#ifndef MODPNG14API +# define MODPNG14API #endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP +#ifndef MODPNG14_IMPEXP +# define MODPNG14_IMPEXP #endif -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol +#ifndef MODPNG14_EXPORT +# define MODPNG14_EXPORT(type,symbol) MODPNG14_IMPEXP type MODPNG14API symbol #endif -#ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type +#ifdef MODPNG14_USE_GLOBAL_ARRAYS +# ifndef MODPNG14_EXPORT_VAR +# define MODPNG14_EXPORT_VAR(type) extern MODPNG14_IMPEXP type # endif #endif -/* User may want to use these so they are not in PNG_INTERNAL. Any library +/* User may want to use these so they are not in MODPNG14_INTERNAL. Any library * functions that are passed far data must be model independent. */ -#ifndef PNG_ABORT -# define PNG_ABORT() abort() +#ifndef MODPNG14_ABORT +# define MODPNG14_ABORT() abort() #endif -#ifdef PNG_SETJMP_SUPPORTED -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#ifdef MODPNG14_SETJMP_SUPPORTED +# define modpng14_jmpbuf(modpng14_ptr) ((modpng14_ptr)->jmpbuf) #else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) +# define modpng14_jmpbuf(modpng14_ptr) \ + (LIBMODPNG14_WAS_COMPILED_WITH__MODPNG14_SETJMP_NOT_SUPPORTED) #endif #if defined(USE_FAR_KEYWORD) /* memory model independent fns */ /* use this to make far-to-near assignments */ # define CHECK 1 # define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_strcpy _fstrcpy -# define png_strncpy _fstrncpy /* Added to v 1.2.6 */ -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset +# define CVT_PTR(ptr) (modpng14_far_to_near(modpng14_ptr,ptr,CHECK)) +# define CVT_PTR_NOCHECK(ptr) (modpng14_far_to_near(modpng14_ptr,ptr,NOCHECK)) +# define modpng14_strcpy _fstrcpy +# define modpng14_strncpy _fstrncpy /* Added to v 1.2.6 */ +# define modpng14_strlen _fstrlen +# define modpng14_memcmp _fmemcmp /* SJT: added */ +# define modpng14_memcpy _fmemcpy +# define modpng14_memset _fmemset #else /* use the usual functions */ # define CVT_PTR(ptr) (ptr) # define CVT_PTR_NOCHECK(ptr) (ptr) -# define png_strcpy strcpy -# define png_strncpy strncpy /* Added to v 1.2.6 */ -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset +# define modpng14_strcpy strcpy +# define modpng14_strncpy strncpy /* Added to v 1.2.6 */ +# define modpng14_strlen strlen +# define modpng14_memcmp memcmp /* SJT: added */ +# define modpng14_memcpy memcpy +# define modpng14_memset memset #endif /* End of memory model independent support */ /* Just a little check that someone hasn't tried to define something * contradictory. */ -#if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536 +#if (MODPNG14_ZBUF_SIZE > 65536) && defined(MODPNG14_MAX_MALLOC_64K) +# undef MODPNG14_ZBUF_SIZE +# define MODPNG14_ZBUF_SIZE 65536 #endif -#ifdef PNG_READ_SUPPORTED -/* Prior to libpng-1.0.9, this block was in pngasmrd.h */ -#if defined(PNG_INTERNAL) +#ifdef MODPNG14_READ_SUPPORTED +/* Prior to libmodpng14-1.0.9, this block was in pngasmrd.h */ +#if defined(MODPNG14_INTERNAL) /* These are the default thresholds before the MMX code kicks in; if either * rowbytes or bitdepth is below the threshold, plain C code is used. These - * can be overridden at runtime via the png_set_mmx_thresholds() call in - * libpng 1.2.0 and later. The values below were chosen by Intel. + * can be overridden at runtime via the modpng14_set_mmx_thresholds() call in + * libmodpng14 1.2.0 and later. The values below were chosen by Intel. */ -#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT -# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */ +#ifndef MODPNG14_MMX_ROWBYTES_THRESHOLD_DEFAULT +# define MODPNG14_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */ #endif -#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT -# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */ +#ifndef MODPNG14_MMX_BITDEPTH_THRESHOLD_DEFAULT +# define MODPNG14_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */ #endif /* Set this in the makefile for VC++ on Pentium, not here. */ /* Platform must be Pentium. Makefile must assemble and load pngvcrd.c . * MMX will be detected at run time and used if present. */ -#ifdef PNG_USE_PNGVCRD -# define PNG_HAVE_ASSEMBLER_COMBINE_ROW -# define PNG_HAVE_ASSEMBLER_READ_INTERLACE -# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW +#ifdef MODPNG14_USE_PNGVCRD +# define MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW +# define MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE +# define MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW #endif /* Set this in the makefile for gcc/as on Pentium, not here. */ /* Platform must be Pentium. Makefile must assemble and load pnggccrd.c . * MMX will be detected at run time and used if present. */ -#ifdef PNG_USE_PNGGCCRD -# define PNG_HAVE_ASSEMBLER_COMBINE_ROW -# define PNG_HAVE_ASSEMBLER_READ_INTERLACE -# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW +#ifdef MODPNG14_USE_PNGGCCRD +# define MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW +# define MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE +# define MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW #endif /* - see pnggccrd.c for info about what is currently enabled */ -#endif /* PNG_INTERNAL */ -#endif /* PNG_READ_SUPPORTED */ +#endif /* MODPNG14_INTERNAL */ +#endif /* MODPNG14_READ_SUPPORTED */ #endif /* PNGCONF_H */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngerror.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngerror.c @@ -1,39 +1,39 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * 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 + * and use modpng14_set_error_fn() to use those functions. See the instructions * at each function. */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" static void /* PRIVATE */ -png_default_error PNGARG((png_structp png_ptr, - png_const_charp error_message)); +modpng14_default_error PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp error_message)); static void /* PRIVATE */ -png_default_warning PNGARG((png_structp png_ptr, - png_const_charp warning_message)); +modpng14_default_warning PNGARG((modpng14_structp modpng14_ptr, + modpng14_const_charp warning_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() + * you should supply a replacement error function and use modpng14_set_error_fn() * to replace the error function at run-time. */ -void PNGAPI -png_error(png_structp png_ptr, png_const_charp error_message) +void MODPNG14API +modpng14_error(modpng14_structp modpng14_ptr, modpng14_const_charp error_message) { -#ifdef PNG_ERROR_NUMBERS_SUPPORTED +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED char msg[16]; - if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) + if (modpng14_ptr->flags&(MODPNG14_FLAG_STRIP_ERROR_NUMBERS|MODPNG14_FLAG_STRIP_ERROR_TEXT)) { int offset = 0; if (*error_message == '#') @@ -41,7 +41,7 @@ for (offset=1; offset<15; offset++) if (*(error_message+offset) == ' ') break; - if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) + if (modpng14_ptr->flags&MODPNG14_FLAG_STRIP_ERROR_TEXT) { int i; for (i=0; iflags&PNG_FLAG_STRIP_ERROR_TEXT) + if (modpng14_ptr->flags&MODPNG14_FLAG_STRIP_ERROR_TEXT) { msg[0]='0'; msg[1]='\0'; @@ -63,25 +63,25 @@ } } #endif - if (png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_ptr, error_message); + if (modpng14_ptr->error_fn != NULL) + (*(modpng14_ptr->error_fn))(modpng14_ptr, error_message); /* if the following returns or doesn't exist, use the default function, which will not return */ - png_default_error(png_ptr, error_message); + modpng14_default_error(modpng14_ptr, error_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. + * modpng14_set_error_fn() to replace the warning function at run-time. */ -void PNGAPI -png_warning(png_structp png_ptr, png_const_charp warning_message) +void MODPNG14API +modpng14_warning(modpng14_structp modpng14_ptr, modpng14_const_charp warning_message) { int offset = 0; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + if (modpng14_ptr->flags&(MODPNG14_FLAG_STRIP_ERROR_NUMBERS|MODPNG14_FLAG_STRIP_ERROR_TEXT)) #endif { if (*warning_message == '#') @@ -91,43 +91,43 @@ break; } } - if (png_ptr->warning_fn != NULL) - (*(png_ptr->warning_fn))(png_ptr, - (png_const_charp)(warning_message+offset)); + if (modpng14_ptr->warning_fn != NULL) + (*(modpng14_ptr->warning_fn))(modpng14_ptr, + (modpng14_const_charp)(warning_message+offset)); else - png_default_warning(png_ptr, (png_const_charp)(warning_message+offset)); + modpng14_default_warning(modpng14_ptr, (modpng14_const_charp)(warning_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, + * to the current chunk. The chunk name comes from modpng14_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] = { +static MODPNG14_CONST char modpng14_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 +modpng14_format_buffer(modpng14_structp modpng14_ptr, modpng14_charp buffer, modpng14_const_charp error_message) { int iout = 0, iin = 0; while (iin < 4) { - int c = png_ptr->chunk_name[iin++]; + int c = modpng14_ptr->chunk_name[iin++]; if (isnonalpha(c)) { buffer[iout++] = '['; - buffer[iout++] = png_digit[(c & 0xf0) >> 4]; - buffer[iout++] = png_digit[c & 0x0f]; + buffer[iout++] = modpng14_digit[(c & 0xf0) >> 4]; + buffer[iout++] = modpng14_digit[c & 0x0f]; buffer[iout++] = ']'; } else { - buffer[iout++] = (png_byte)c; + buffer[iout++] = (modpng14_byte)c; } } @@ -137,47 +137,47 @@ { buffer[iout++] = ':'; buffer[iout++] = ' '; - png_strncpy(buffer+iout, error_message, 63); + modpng14_strncpy(buffer+iout, error_message, 63); buffer[iout+63] = 0; } } -void PNGAPI -png_chunk_error(png_structp png_ptr, png_const_charp error_message) +void MODPNG14API +modpng14_chunk_error(modpng14_structp modpng14_ptr, modpng14_const_charp error_message) { char msg[18+64]; - if (png_ptr == NULL) - png_error(png_ptr, error_message); + if (modpng14_ptr == NULL) + modpng14_error(modpng14_ptr, error_message); else { - png_format_buffer(png_ptr, msg, error_message); - png_error(png_ptr, msg); + modpng14_format_buffer(modpng14_ptr, msg, error_message); + modpng14_error(modpng14_ptr, msg); } } -void PNGAPI -png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) +void MODPNG14API +modpng14_chunk_warning(modpng14_structp modpng14_ptr, modpng14_const_charp warning_message) { char msg[18+64]; - if (png_ptr == NULL) - png_warning(png_ptr, warning_message); + if (modpng14_ptr == NULL) + modpng14_warning(modpng14_ptr, warning_message); else { - png_format_buffer(png_ptr, msg, warning_message); - png_warning(png_ptr, msg); + modpng14_format_buffer(modpng14_ptr, msg, warning_message); + modpng14_warning(modpng14_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(). + * error function pointer in modpng14_set_error_fn(). */ static void /* PRIVATE */ -png_default_error(png_structp png_ptr, png_const_charp error_message) +modpng14_default_error(modpng14_structp modpng14_ptr, modpng14_const_charp error_message) { -#ifndef PNG_NO_CONSOLE_IO -#ifdef PNG_ERROR_NUMBERS_SUPPORTED +#ifndef MODPNG14_NO_CONSOLE_IO +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED if (*error_message == '#') { int offset; @@ -191,47 +191,47 @@ if((offset > 1) && (offset < 15)) { error_number[offset-1]='\0'; - fprintf(stderr, "libpng error no. %s: %s\n", error_number, + fprintf(stderr, "libmodpng14 error no. %s: %s\n", error_number, error_message+offset); } else - fprintf(stderr, "libpng error: %s, offset=%d\n", error_message,offset); + fprintf(stderr, "libmodpng14 error: %s, offset=%d\n", error_message,offset); } else #endif - fprintf(stderr, "libpng error: %s\n", error_message); + fprintf(stderr, "libmodpng14 error: %s\n", error_message); #else if (error_message) /* make compiler happy */ ; #endif -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED # ifdef USE_FAR_KEYWORD { jmp_buf jmpbuf; - png_memcpy(jmpbuf,png_ptr->jmpbuf,sizeof(jmp_buf)); + modpng14_memcpy(jmpbuf,modpng14_ptr->jmpbuf,sizeof(jmp_buf)); longjmp(jmpbuf, 1); } # else - longjmp(png_ptr->jmpbuf, 1); + longjmp(modpng14_ptr->jmpbuf, 1); # endif #else - if (png_ptr) + if (modpng14_ptr) /* make compiler happy */ ; - PNG_ABORT(); + MODPNG14_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 + * here if you don't want them to. In the default configuration, modpng14_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 warning_message) +modpng14_default_warning(modpng14_structp modpng14_ptr, modpng14_const_charp warning_message) { -#ifndef PNG_NO_CONSOLE_IO -# ifdef PNG_ERROR_NUMBERS_SUPPORTED +#ifndef MODPNG14_NO_CONSOLE_IO +# ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED if (*warning_message == '#') { int offset; @@ -245,57 +245,57 @@ if((offset > 1) && (offset < 15)) { warning_number[offset-1]='\0'; - fprintf(stderr, "libpng warning no. %s: %s\n", warning_number, + fprintf(stderr, "libmodpng14 warning no. %s: %s\n", warning_number, warning_message+offset); } else - fprintf(stderr, "libpng warning: %s\n", warning_message); + fprintf(stderr, "libmodpng14 warning: %s\n", warning_message); } else # endif - fprintf(stderr, "libpng warning: %s\n", warning_message); + fprintf(stderr, "libmodpng14 warning: %s\n", warning_message); #else if (warning_message) /* appease compiler */ ; #endif - if (png_ptr) + if (modpng14_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) + * method used in the default routine calls longjmp(modpng14_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) +void MODPNG14API +modpng14_set_error_fn(modpng14_structp modpng14_ptr, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warning_fn) { - png_ptr->error_ptr = error_ptr; - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; + modpng14_ptr->error_ptr = error_ptr; + modpng14_ptr->error_fn = error_fn; + modpng14_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. + * pointer before modpng14_write_destroy and modpng14_read_destroy are called. */ -png_voidp PNGAPI -png_get_error_ptr(png_structp png_ptr) +modpng14_voidp MODPNG14API +modpng14_get_error_ptr(modpng14_structp modpng14_ptr) { - return ((png_voidp)png_ptr->error_ptr); + return ((modpng14_voidp)modpng14_ptr->error_ptr); } -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -void PNGAPI -png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED +void MODPNG14API +modpng14_set_strip_error_numbers(modpng14_structp modpng14_ptr, modpng14_uint_32 strip_mode) { - if(png_ptr != NULL) + if(modpng14_ptr != NULL) { - png_ptr->flags &= - ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); + modpng14_ptr->flags &= + ((~(MODPNG14_FLAG_STRIP_ERROR_NUMBERS|MODPNG14_FLAG_STRIP_ERROR_TEXT))&strip_mode); } } #endif --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pnggccrd.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pnggccrd.c @@ -6,13 +6,13 @@ * and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm * for Intel's performance analysis of the MMX vs. non-MMX code. * - * libpng version 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 version 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * Copyright (c) 1998, Intel Corporation * * Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998. - * Interface to libpng contributed by Gilles Vollant, 1999. + * Interface to libmodpng14 contributed by Gilles Vollant, 1999. * GNU C port by Greg Roelofs, 1999-2001. * * Lines 2350-4300 converted in place with intel2gas 1.3.1: @@ -88,18 +88,18 @@ * static and truly global (multi-module) variables work fine. * * 19991023: - * - fixed png_combine_row() non-MMX replication bug (odd passes only?) + * - fixed modpng14_combine_row() non-MMX replication bug (odd passes only?) * - switched from string-concatenation-with-macros to cleaner method of * renaming global variables for djgpp--i.e., always use prefixes in * inlined assembler code (== strings) and conditionally rename the * variables, not the other way around. Hence _const4, _mask8_0, etc. * * 19991024: - * - fixed mmxsupport()/png_do_read_interlace() first-row bug + * - fixed mmxsupport()/modpng14_do_read_interlace() first-row bug * This one was severely weird: even though mmxsupport() doesn't touch * ebx (where "row" pointer was stored), it nevertheless managed to zero * the register (even in static/non-fPIC code--see below), which in turn - * caused png_do_read_interlace() to return prematurely on the first row of + * caused modpng14_do_read_interlace() to return prematurely on the first row of * interlaced images (i.e., without expanding the interlaced pixels). * Inspection of the generated assembly code didn't turn up any clues, * although it did point at a minor optimization (i.e., get rid of @@ -108,7 +108,7 @@ * - "info gcc" was next to useless, so compared fPIC and non-fPIC assembly * listings... Apparently register spillage has to do with ebx, since * it's used to index the global offset table. Commenting it out of the - * input-reg lists in png_combine_row() eliminated compiler barfage, so + * input-reg lists in modpng14_combine_row() eliminated compiler barfage, so * ifdef'd with __PIC__ macro: if defined, use a global for unmask * * 19991107: @@ -126,7 +126,7 @@ * - when compiling with gcc, be sure to use -fomit-frame-pointer * * 20000319: - * - fixed a register-name typo in png_do_read_interlace(), default (MMX) case, + * - fixed a register-name typo in modpng14_do_read_interlace(), default (MMX) case, * pass == 4 or 5, that caused visible corruption of interlaced images * * 20000623: @@ -139,7 +139,7 @@ * * 20000706: * - Chuck Wilson passed along these remaining gcc 2.95.2 errors: - * pnggccrd.c: In function `png_combine_row': + * pnggccrd.c: In function `modpng14_combine_row': * pnggccrd.c:525: more than 10 operands in `asm' * pnggccrd.c:669: more than 10 operands in `asm' * pnggccrd.c:828: more than 10 operands in `asm' @@ -151,8 +151,8 @@ * 10 operands; they just don't report it. Much strangeness ensues, etc. * * 20000729: - * - enabled png_read_filter_row_mmx_up() (shortest remaining unconverted - * MMX routine); began converting png_read_filter_row_mmx_sub() + * - enabled modpng14_read_filter_row_mmx_up() (shortest remaining unconverted + * MMX routine); began converting modpng14_read_filter_row_mmx_sub() * - to finish remaining sections: * - clean up indentation and comments * - preload local variables @@ -162,10 +162,10 @@ * - remove "$" from addressing of Shift and Mask variables [20000823] * * 20000731: - * - global union vars causing segfaults in png_read_filter_row_mmx_sub()? + * - global union vars causing segfaults in modpng14_read_filter_row_mmx_sub()? * * 20000822: - * - ARGH, stupid png_read_filter_row_mmx_sub() segfault only happens with + * - ARGH, stupid modpng14_read_filter_row_mmx_sub() segfault only happens with * shared-library (-fPIC) version! Code works just fine as part of static * library. Damn damn damn damn damn, should have tested that sooner. * ebx is getting clobbered again (explicitly this time); need to save it @@ -179,11 +179,11 @@ * 20000826: * - added visual separators to help navigate microscopic printed copies * (http://pobox.com/~newt/code/gpr-latest.zip, mode 10); started working - * on png_read_filter_row_mmx_avg() + * on modpng14_read_filter_row_mmx_avg() * * 20000828: - * - finished png_read_filter_row_mmx_avg(): only Paeth left! (930 lines...) - * What the hell, did png_read_filter_row_mmx_paeth(), too. Comments not + * - finished modpng14_read_filter_row_mmx_avg(): only Paeth left! (930 lines...) + * What the hell, did modpng14_read_filter_row_mmx_paeth(), too. Comments not * cleaned up/shortened in either routine, but functionality is complete * and seems to be working fine. * @@ -194,37 +194,37 @@ * is simple enough... * * 20000914: - * - bug in png_read_filter_row_mmx_avg(): 16-bit grayscale not handled + * - bug in modpng14_read_filter_row_mmx_avg(): 16-bit grayscale not handled * correctly (but 48-bit RGB just fine) * * 20000916: - * - fixed bug in png_read_filter_row_mmx_avg(), bpp == 2 case; three errors: + * - fixed bug in modpng14_read_filter_row_mmx_avg(), bpp == 2 case; three errors: * - "_ShiftBpp.use = 24;" should have been "_ShiftBpp.use = 16;" * - "_ShiftRem.use = 40;" should have been "_ShiftRem.use = 48;" * - "psllq _ShiftRem, %%mm2" should have been "psrlq _ShiftRem, %%mm2" * * 20010101: - * - added new png_init_mmx_flags() function (here only because it needs to - * call mmxsupport(), which should probably become global png_mmxsupport()); - * modified other MMX routines to run conditionally (png_ptr->asm_flags) + * - added new modpng14_init_mmx_flags() function (here only because it needs to + * call mmxsupport(), which should probably become global modpng14_mmxsupport()); + * modified other MMX routines to run conditionally (modpng14_ptr->asm_flags) * * 20010103: - * - renamed mmxsupport() to png_mmx_support(), with auto-set of mmx_supported, - * and made it public; moved png_init_mmx_flags() to png.c as internal func + * - renamed mmxsupport() to modpng14_mmx_support(), with auto-set of mmx_supported, + * and made it public; moved modpng14_init_mmx_flags() to png.c as internal func * * 20010104: - * - removed dependency on png_read_filter_row_c() (C code already duplicated - * within MMX version of png_read_filter_row()) so no longer necessary to + * - removed dependency on modpng14_read_filter_row_c() (C code already duplicated + * within MMX version of modpng14_read_filter_row()) so no longer necessary to * compile it into pngrutil.o * * 20010310: - * - fixed buffer-overrun bug in png_combine_row() C code (non-MMX) + * - fixed buffer-overrun bug in modpng14_combine_row() C code (non-MMX) * * 20020304: * - eliminated incorrect use of width_mmx in pixel_bytes == 8 case * * STILL TO DO: - * - test png_do_read_interlace() 64-bit case (pixel_bytes == 8) + * - test modpng14_do_read_interlace() 64-bit case (pixel_bytes == 8) * - write MMX code for 48-bit case (pixel_bytes == 6) * - figure out what's up with 24-bit case (pixel_bytes == 3): * why subtract 8 from width_mmx in the pass 4/5 case? @@ -233,24 +233,24 @@ * of the row buffer, not the end (see 19991007 for details) * x pick one version of mmxsupport() and get rid of the other * - add error messages to any remaining bogus default cases - * - enable pixel_depth == 8 cases in png_read_filter_row()? (test speed) + * - enable pixel_depth == 8 cases in modpng14_read_filter_row()? (test speed) * x add support for runtime enable/disable/query of various MMX routines */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" -#if defined(PNG_USE_PNGGCCRD) +#if defined(MODPNG14_USE_PNGGCCRD) -int PNGAPI png_mmx_support(void); +int MODPNG14API modpng14_mmx_support(void); -#ifdef PNG_USE_LOCAL_ARRAYS -static const int FARDATA png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; -static const int FARDATA png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1}; +#ifdef MODPNG14_USE_LOCAL_ARRAYS +static const int FARDATA modpng14_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; +static const int FARDATA modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; +static const int FARDATA modpng14_pass_width[7] = {8, 4, 4, 2, 2, 1, 1}; #endif -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) /* djgpp, Win32, and Cygwin add their own underscores to global variables, * so define them without: */ #if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__) @@ -280,7 +280,7 @@ # define _ActiveMaskEnd ActiveMaskEnd # define _ShiftBpp ShiftBpp # define _ShiftRem ShiftRem -#ifdef PNG_THREAD_UNSAFE_OK +#ifdef MODPNG14_THREAD_UNSAFE_OK # define _unmask unmask # define _FullLength FullLength # define _MMXLength MMXLength @@ -301,7 +301,7 @@ * "more than 10 operands in `asm'" errors when %ebx is used to preload unmask * in the non-PIC case, so we'll just use the global unconditionally now. */ -#ifdef PNG_THREAD_UNSAFE_OK +#ifdef MODPNG14_THREAD_UNSAFE_OK static int _unmask; #endif @@ -332,11 +332,11 @@ // These are used in the row-filter routines and should/would be local // variables if not for gcc addressing limitations. -// WARNING: Their presence probably defeats the thread safety of libpng. +// WARNING: Their presence probably defeats the thread safety of libmodpng14. -#ifdef PNG_THREAD_UNSAFE_OK -static png_uint_32 _FullLength; -static png_uint_32 _MMXLength; +#ifdef MODPNG14_THREAD_UNSAFE_OK +static modpng14_uint_32 _FullLength; +static modpng14_uint_32 _MMXLength; static int _dif; static int _patemp; // temp variables for Paeth routine static int _pbtemp; @@ -344,9 +344,9 @@ #endif void /* PRIVATE */ -png_squelch_warnings(void) +modpng14_squelch_warnings(void) { -#ifdef PNG_THREAD_UNSAFE_OK +#ifdef MODPNG14_THREAD_UNSAFE_OK _dif = _dif; _patemp = _patemp; _pbtemp = _pbtemp; @@ -372,7 +372,7 @@ _mask48_1 = _mask48_1; _mask48_0 = _mask48_0; } -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ static int _mmx_supported = 2; @@ -383,7 +383,7 @@ /* */ /*===========================================================================*/ -#if defined(PNG_HAVE_ASSEMBLER_COMBINE_ROW) +#if defined(MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW) #define BPP2 2 #define BPP3 3 /* bytes per pixel (a.k.a. pixel_bytes) */ @@ -406,42 +406,42 @@ if the machine supports MMX. */ void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) +modpng14_combine_row(modpng14_structp modpng14_ptr, modpng14_bytep row, int mask) { - png_debug(1, "in png_combine_row (pnggccrd.c)\n"); + modpng14_debug(1, "in modpng14_combine_row (pnggccrd.c)\n"); -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) if (_mmx_supported == 2) { - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); - png_mmx_support(); + /* this should have happened in modpng14_init_mmx_flags() already */ + modpng14_warning(modpng14_ptr, "asm_flags may not have been initialized"); + modpng14_mmx_support(); } #endif if (mask == 0xff) { - png_debug(2,"mask == 0xff: doing single png_memcpy()\n"); - png_memcpy(row, png_ptr->row_buf + 1, - (png_size_t)((png_ptr->width * png_ptr->row_info.pixel_depth + 7) >> 3)); + modpng14_debug(2,"mask == 0xff: doing single modpng14_memcpy()\n"); + modpng14_memcpy(row, modpng14_ptr->row_buf + 1, + (modpng14_size_t)((modpng14_ptr->width * modpng14_ptr->row_info.pixel_depth + 7) >> 3)); } - else /* (png_combine_row() is never called with mask == 0) */ + else /* (modpng14_combine_row() is never called with mask == 0) */ { - switch (png_ptr->row_info.pixel_depth) + switch (modpng14_ptr->row_info.pixel_depth) { - case 1: /* png_ptr->row_info.pixel_depth */ + case 1: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int s_inc, s_start, s_end; int m; int shift; - png_uint_32 i; + modpng14_uint_32 i; - sp = png_ptr->row_buf + 1; + sp = modpng14_ptr->row_buf + 1; dp = row; m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 7; @@ -457,15 +457,15 @@ shift = s_start; - for (i = 0; i < png_ptr->width; i++) + for (i = 0; i < modpng14_ptr->width; i++) { if (m & mask) { int value; value = (*sp >> shift) & 0x1; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0x7f7f >> (7 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -485,21 +485,21 @@ break; } - case 2: /* png_ptr->row_info.pixel_depth */ + case 2: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int s_start, s_end, s_inc; int m; int shift; - png_uint_32 i; + modpng14_uint_32 i; int value; - sp = png_ptr->row_buf + 1; + sp = modpng14_ptr->row_buf + 1; dp = row; m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 6; @@ -515,13 +515,13 @@ shift = s_start; - for (i = 0; i < png_ptr->width; i++) + for (i = 0; i < modpng14_ptr->width; i++) { if (m & mask) { value = (*sp >> shift) & 0x3; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0x3f3f >> (6 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -540,21 +540,21 @@ break; } - case 4: /* png_ptr->row_info.pixel_depth */ + case 4: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int s_start, s_end, s_inc; int m; int shift; - png_uint_32 i; + modpng14_uint_32 i; int value; - sp = png_ptr->row_buf + 1; + sp = modpng14_ptr->row_buf + 1; dp = row; m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 4; @@ -569,13 +569,13 @@ } shift = s_start; - for (i = 0; i < png_ptr->width; i++) + for (i = 0; i < modpng14_ptr->width; i++) { if (m & mask) { value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0xf0f >> (4 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -594,20 +594,20 @@ break; } - case 8: /* png_ptr->row_info.pixel_depth */ + case 8: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep srcptr; - png_bytep dstptr; + modpng14_bytep srcptr; + modpng14_bytep dstptr; -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && _mmx_supported */ ) #else if (_mmx_supported) #endif { - png_uint_32 len; + modpng14_uint_32 len; int diff; int dummy_value_a; // fix 'forbidden register spilled' error int dummy_value_d; @@ -615,10 +615,10 @@ int dummy_value_S; int dummy_value_D; _unmask = ~mask; // global variable for -fPIC version - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; - len = png_ptr->width &~7; // reduce to multiple of 8 - diff = (int) (png_ptr->width & 7); // amount lost + len = modpng14_ptr->width &~7; // reduce to multiple of 8 + diff = (int) (modpng14_ptr->width & 7); // amount lost __asm__ __volatile__ ( "movd _unmask, %%mm7 \n\t" // load bit pattern @@ -692,25 +692,25 @@ ); } else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - register png_uint_32 i; - png_uint_32 initial_val = png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = len; /* GRR bugfix */ + register modpng14_uint_32 i; + modpng14_uint_32 initial_val = modpng14_pass_start[modpng14_ptr->pass]; + /* png.c: modpng14_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ + register int stride = modpng14_pass_inc[modpng14_ptr->pass]; + /* png.c: modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ + register int rep_bytes = modpng14_pass_width[modpng14_ptr->pass]; + /* png.c: modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ + modpng14_uint_32 len = modpng14_ptr->width &~7; /* reduce to mult. of 8 */ + int diff = (int) (modpng14_ptr->width & 7); /* amount lost */ + register modpng14_uint_32 final_val = len; /* GRR bugfix */ - srcptr = png_ptr->row_buf + 1 + initial_val; + srcptr = modpng14_ptr->row_buf + 1 + initial_val; dstptr = row + initial_val; for (i = initial_val; i < final_val; i += stride) { - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -721,7 +721,7 @@ { if (rep_bytes > (int)(final_val-i)) rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -732,20 +732,20 @@ break; } /* end 8 bpp */ - case 16: /* png_ptr->row_info.pixel_depth */ + case 16: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep srcptr; - png_bytep dstptr; + modpng14_bytep srcptr; + modpng14_bytep dstptr; -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && _mmx_supported */ ) #else if (_mmx_supported) #endif { - png_uint_32 len; + modpng14_uint_32 len; int diff; int dummy_value_a; // fix 'forbidden register spilled' error int dummy_value_d; @@ -753,10 +753,10 @@ int dummy_value_S; int dummy_value_D; _unmask = ~mask; // global variable for -fPIC version - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; - len = png_ptr->width &~7; // reduce to multiple of 8 - diff = (int) (png_ptr->width & 7); // amount lost // + len = modpng14_ptr->width &~7; // reduce to multiple of 8 + diff = (int) (modpng14_ptr->width & 7); // amount lost // __asm__ __volatile__ ( "movd _unmask, %%mm7 \n\t" // load bit pattern @@ -846,25 +846,25 @@ ); } else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - register png_uint_32 i; - png_uint_32 initial_val = BPP2 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP2 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP2 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP2 * len; /* GRR bugfix */ + register modpng14_uint_32 i; + modpng14_uint_32 initial_val = BPP2 * modpng14_pass_start[modpng14_ptr->pass]; + /* png.c: modpng14_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ + register int stride = BPP2 * modpng14_pass_inc[modpng14_ptr->pass]; + /* png.c: modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ + register int rep_bytes = BPP2 * modpng14_pass_width[modpng14_ptr->pass]; + /* png.c: modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ + modpng14_uint_32 len = modpng14_ptr->width &~7; /* reduce to mult. of 8 */ + int diff = (int) (modpng14_ptr->width & 7); /* amount lost */ + register modpng14_uint_32 final_val = BPP2 * len; /* GRR bugfix */ - srcptr = png_ptr->row_buf + 1 + initial_val; + srcptr = modpng14_ptr->row_buf + 1 + initial_val; dstptr = row + initial_val; for (i = initial_val; i < final_val; i += stride) { - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -875,7 +875,7 @@ { if (rep_bytes > (int)(final_val-i)) rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -885,20 +885,20 @@ break; } /* end 16 bpp */ - case 24: /* png_ptr->row_info.pixel_depth */ + case 24: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep srcptr; - png_bytep dstptr; + modpng14_bytep srcptr; + modpng14_bytep dstptr; -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && _mmx_supported */ ) #else if (_mmx_supported) #endif { - png_uint_32 len; + modpng14_uint_32 len; int diff; int dummy_value_a; // fix 'forbidden register spilled' error int dummy_value_d; @@ -906,10 +906,10 @@ int dummy_value_S; int dummy_value_D; _unmask = ~mask; // global variable for -fPIC version - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; - len = png_ptr->width &~7; // reduce to multiple of 8 - diff = (int) (png_ptr->width & 7); // amount lost // + len = modpng14_ptr->width &~7; // reduce to multiple of 8 + diff = (int) (modpng14_ptr->width & 7); // amount lost // __asm__ __volatile__ ( "movd _unmask, %%mm7 \n\t" // load bit pattern @@ -1014,25 +1014,25 @@ ); } else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - register png_uint_32 i; - png_uint_32 initial_val = BPP3 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP3 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP3 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP3 * len; /* GRR bugfix */ + register modpng14_uint_32 i; + modpng14_uint_32 initial_val = BPP3 * modpng14_pass_start[modpng14_ptr->pass]; + /* png.c: modpng14_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ + register int stride = BPP3 * modpng14_pass_inc[modpng14_ptr->pass]; + /* png.c: modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ + register int rep_bytes = BPP3 * modpng14_pass_width[modpng14_ptr->pass]; + /* png.c: modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ + modpng14_uint_32 len = modpng14_ptr->width &~7; /* reduce to mult. of 8 */ + int diff = (int) (modpng14_ptr->width & 7); /* amount lost */ + register modpng14_uint_32 final_val = BPP3 * len; /* GRR bugfix */ - srcptr = png_ptr->row_buf + 1 + initial_val; + srcptr = modpng14_ptr->row_buf + 1 + initial_val; dstptr = row + initial_val; for (i = initial_val; i < final_val; i += stride) { - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1043,7 +1043,7 @@ { if (rep_bytes > (int)(final_val-i)) rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1053,20 +1053,20 @@ break; } /* end 24 bpp */ - case 32: /* png_ptr->row_info.pixel_depth */ + case 32: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep srcptr; - png_bytep dstptr; + modpng14_bytep srcptr; + modpng14_bytep dstptr; -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && _mmx_supported */ ) #else if (_mmx_supported) #endif { - png_uint_32 len; + modpng14_uint_32 len; int diff; int dummy_value_a; // fix 'forbidden register spilled' error int dummy_value_d; @@ -1074,10 +1074,10 @@ int dummy_value_S; int dummy_value_D; _unmask = ~mask; // global variable for -fPIC version - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; - len = png_ptr->width &~7; // reduce to multiple of 8 - diff = (int) (png_ptr->width & 7); // amount lost // + len = modpng14_ptr->width &~7; // reduce to multiple of 8 + diff = (int) (modpng14_ptr->width & 7); // amount lost // __asm__ __volatile__ ( "movd _unmask, %%mm7 \n\t" // load bit pattern @@ -1189,25 +1189,25 @@ ); } else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - register png_uint_32 i; - png_uint_32 initial_val = BPP4 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP4 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP4 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP4 * len; /* GRR bugfix */ + register modpng14_uint_32 i; + modpng14_uint_32 initial_val = BPP4 * modpng14_pass_start[modpng14_ptr->pass]; + /* png.c: modpng14_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ + register int stride = BPP4 * modpng14_pass_inc[modpng14_ptr->pass]; + /* png.c: modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ + register int rep_bytes = BPP4 * modpng14_pass_width[modpng14_ptr->pass]; + /* png.c: modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ + modpng14_uint_32 len = modpng14_ptr->width &~7; /* reduce to mult. of 8 */ + int diff = (int) (modpng14_ptr->width & 7); /* amount lost */ + register modpng14_uint_32 final_val = BPP4 * len; /* GRR bugfix */ - srcptr = png_ptr->row_buf + 1 + initial_val; + srcptr = modpng14_ptr->row_buf + 1 + initial_val; dstptr = row + initial_val; for (i = initial_val; i < final_val; i += stride) { - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1218,7 +1218,7 @@ { if (rep_bytes > (int)(final_val-i)) rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1228,20 +1228,20 @@ break; } /* end 32 bpp */ - case 48: /* png_ptr->row_info.pixel_depth */ + case 48: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep srcptr; - png_bytep dstptr; + modpng14_bytep srcptr; + modpng14_bytep dstptr; -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && _mmx_supported */ ) #else if (_mmx_supported) #endif { - png_uint_32 len; + modpng14_uint_32 len; int diff; int dummy_value_a; // fix 'forbidden register spilled' error int dummy_value_d; @@ -1249,10 +1249,10 @@ int dummy_value_S; int dummy_value_D; _unmask = ~mask; // global variable for -fPIC version - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; - len = png_ptr->width &~7; // reduce to multiple of 8 - diff = (int) (png_ptr->width & 7); // amount lost // + len = modpng14_ptr->width &~7; // reduce to multiple of 8 + diff = (int) (modpng14_ptr->width & 7); // amount lost // __asm__ __volatile__ ( "movd _unmask, %%mm7 \n\t" // load bit pattern @@ -1381,25 +1381,25 @@ ); } else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - register png_uint_32 i; - png_uint_32 initial_val = BPP6 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP6 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP6 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP6 * len; /* GRR bugfix */ + register modpng14_uint_32 i; + modpng14_uint_32 initial_val = BPP6 * modpng14_pass_start[modpng14_ptr->pass]; + /* png.c: modpng14_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ + register int stride = BPP6 * modpng14_pass_inc[modpng14_ptr->pass]; + /* png.c: modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ + register int rep_bytes = BPP6 * modpng14_pass_width[modpng14_ptr->pass]; + /* png.c: modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ + modpng14_uint_32 len = modpng14_ptr->width &~7; /* reduce to mult. of 8 */ + int diff = (int) (modpng14_ptr->width & 7); /* amount lost */ + register modpng14_uint_32 final_val = BPP6 * len; /* GRR bugfix */ - srcptr = png_ptr->row_buf + 1 + initial_val; + srcptr = modpng14_ptr->row_buf + 1 + initial_val; dstptr = row + initial_val; for (i = initial_val; i < final_val; i += stride) { - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1410,7 +1410,7 @@ { if (rep_bytes > (int)(final_val-i)) rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1420,27 +1420,27 @@ break; } /* end 48 bpp */ - case 64: /* png_ptr->row_info.pixel_depth */ + case 64: /* modpng14_ptr->row_info.pixel_depth */ { - png_bytep srcptr; - png_bytep dstptr; - register png_uint_32 i; - png_uint_32 initial_val = BPP8 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP8 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP8 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP8 * len; /* GRR bugfix */ + modpng14_bytep srcptr; + modpng14_bytep dstptr; + register modpng14_uint_32 i; + modpng14_uint_32 initial_val = BPP8 * modpng14_pass_start[modpng14_ptr->pass]; + /* png.c: modpng14_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ + register int stride = BPP8 * modpng14_pass_inc[modpng14_ptr->pass]; + /* png.c: modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ + register int rep_bytes = BPP8 * modpng14_pass_width[modpng14_ptr->pass]; + /* png.c: modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ + modpng14_uint_32 len = modpng14_ptr->width &~7; /* reduce to mult. of 8 */ + int diff = (int) (modpng14_ptr->width & 7); /* amount lost */ + register modpng14_uint_32 final_val = BPP8 * len; /* GRR bugfix */ - srcptr = png_ptr->row_buf + 1 + initial_val; + srcptr = modpng14_ptr->row_buf + 1 + initial_val; dstptr = row + initial_val; for (i = initial_val; i < final_val; i += stride) { - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1451,7 +1451,7 @@ { if (rep_bytes > (int)(final_val-i)) rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); + modpng14_memcpy(dstptr, srcptr, rep_bytes); srcptr += stride; dstptr += stride; } @@ -1460,19 +1460,19 @@ break; } /* end 64 bpp */ - default: /* png_ptr->row_info.pixel_depth != 1,2,4,8,16,24,32,48,64 */ + default: /* modpng14_ptr->row_info.pixel_depth != 1,2,4,8,16,24,32,48,64 */ { /* this should never happen */ - png_warning(png_ptr, "Invalid row_info.pixel_depth in pnggccrd"); + modpng14_warning(modpng14_ptr, "Invalid row_info.pixel_depth in pnggccrd"); break; } - } /* end switch (png_ptr->row_info.pixel_depth) */ + } /* end switch (modpng14_ptr->row_info.pixel_depth) */ } /* end if (non-trivial mask) */ -} /* end png_combine_row() */ +} /* end modpng14_combine_row() */ -#endif /* PNG_HAVE_ASSEMBLER_COMBINE_ROW */ +#endif /* MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW */ @@ -1483,56 +1483,56 @@ /* */ /*===========================================================================*/ -#if defined(PNG_READ_INTERLACING_SUPPORTED) -#if defined(PNG_HAVE_ASSEMBLER_READ_INTERLACE) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) +#if defined(MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE) -/* png_do_read_interlace() is called after any 16-bit to 8-bit conversion +/* modpng14_do_read_interlace() is called after any 16-bit to 8-bit conversion * has taken place. [GRR: what other steps come before and/or after?] */ void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) +modpng14_do_read_interlace(modpng14_structp modpng14_ptr) { - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - png_uint_32 transformations = png_ptr->transformations; + modpng14_row_infop row_info = &(modpng14_ptr->row_info); + modpng14_bytep row = modpng14_ptr->row_buf + 1; + int pass = modpng14_ptr->pass; +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + modpng14_uint_32 transformations = modpng14_ptr->transformations; #endif - png_debug(1, "in png_do_read_interlace (pnggccrd.c)\n"); + modpng14_debug(1, "in modpng14_do_read_interlace (pnggccrd.c)\n"); -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) if (_mmx_supported == 2) { -#if !defined(PNG_1_0_X) - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); +#if !defined(MODPNG14_1_0_X) + /* this should have happened in modpng14_init_mmx_flags() already */ + modpng14_warning(modpng14_ptr, "asm_flags may not have been initialized"); #endif - png_mmx_support(); + modpng14_mmx_support(); } #endif if (row != NULL && row_info != NULL) { - png_uint_32 final_width; + modpng14_uint_32 final_width; - final_width = row_info->width * png_pass_inc[pass]; + final_width = row_info->width * modpng14_pass_inc[pass]; switch (row_info->pixel_depth) { case 1: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int sshift, dshift; int s_start, s_end, s_inc; - png_byte v; - png_uint_32 i; + modpng14_byte v; + modpng14_uint_32 i; int j; - sp = row + (png_size_t)((row_info->width - 1) >> 3); - dp = row + (png_size_t)((final_width - 1) >> 3); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) + sp = row + (modpng14_size_t)((row_info->width - 1) >> 3); + dp = row + (modpng14_size_t)((final_width - 1) >> 3); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { sshift = (int)((row_info->width + 7) & 7); dshift = (int)((final_width + 7) & 7); @@ -1552,11 +1552,11 @@ for (i = row_info->width; i; i--) { - v = (png_byte)((*sp >> sshift) & 0x1); - for (j = 0; j < png_pass_inc[pass]; j++) + v = (modpng14_byte)((*sp >> sshift) & 0x1); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0x7f7f >> (7 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -1578,18 +1578,18 @@ case 2: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int sshift, dshift; int s_start, s_end, s_inc; - png_uint_32 i; + modpng14_uint_32 i; - sp = row + (png_size_t)((row_info->width - 1) >> 2); - dp = row + (png_size_t)((final_width - 1) >> 2); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) + sp = row + (modpng14_size_t)((row_info->width - 1) >> 2); + dp = row + (modpng14_size_t)((final_width - 1) >> 2); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { - sshift = (png_size_t)(((row_info->width + 3) & 3) << 1); - dshift = (png_size_t)(((final_width + 3) & 3) << 1); + sshift = (modpng14_size_t)(((row_info->width + 3) & 3) << 1); + dshift = (modpng14_size_t)(((final_width + 3) & 3) << 1); s_start = 6; s_end = 0; s_inc = -2; @@ -1597,8 +1597,8 @@ else #endif { - sshift = (png_size_t)((3 - ((row_info->width + 3) & 3)) << 1); - dshift = (png_size_t)((3 - ((final_width + 3) & 3)) << 1); + sshift = (modpng14_size_t)((3 - ((row_info->width + 3) & 3)) << 1); + dshift = (modpng14_size_t)((3 - ((final_width + 3) & 3)) << 1); s_start = 0; s_end = 6; s_inc = 2; @@ -1606,14 +1606,14 @@ for (i = row_info->width; i; i--) { - png_byte v; + modpng14_byte v; int j; - v = (png_byte)((*sp >> sshift) & 0x3); - for (j = 0; j < png_pass_inc[pass]; j++) + v = (modpng14_byte)((*sp >> sshift) & 0x3); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0x3f3f >> (6 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -1635,18 +1635,18 @@ case 4: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int sshift, dshift; int s_start, s_end, s_inc; - png_uint_32 i; + modpng14_uint_32 i; - sp = row + (png_size_t)((row_info->width - 1) >> 1); - dp = row + (png_size_t)((final_width - 1) >> 1); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) + sp = row + (modpng14_size_t)((row_info->width - 1) >> 1); + dp = row + (modpng14_size_t)((final_width - 1) >> 1); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { - sshift = (png_size_t)(((row_info->width + 1) & 1) << 2); - dshift = (png_size_t)(((final_width + 1) & 1) << 2); + sshift = (modpng14_size_t)(((row_info->width + 1) & 1) << 2); + dshift = (modpng14_size_t)(((final_width + 1) & 1) << 2); s_start = 4; s_end = 0; s_inc = -4; @@ -1654,8 +1654,8 @@ else #endif { - sshift = (png_size_t)((1 - ((row_info->width + 1) & 1)) << 2); - dshift = (png_size_t)((1 - ((final_width + 1) & 1)) << 2); + sshift = (modpng14_size_t)((1 - ((row_info->width + 1) & 1)) << 2); + dshift = (modpng14_size_t)((1 - ((final_width + 1) & 1)) << 2); s_start = 0; s_end = 4; s_inc = 4; @@ -1663,14 +1663,14 @@ for (i = row_info->width; i; i--) { - png_byte v; + modpng14_byte v; int j; - v = (png_byte)((*sp >> sshift) & 0xf); - for (j = 0; j < png_pass_inc[pass]; j++) + v = (modpng14_byte)((*sp >> sshift) & 0xf); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0xf0f >> (4 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -1700,9 +1700,9 @@ // unsigned long long _const4 = 0x0000000000FFFFFFLL; no good // unsigned long long const4 = 0x0000000000FFFFFFLL; no good #endif - png_bytep sptr, dp; - png_uint_32 i; - png_size_t pixel_bytes; + modpng14_bytep sptr, dp; + modpng14_uint_32 i; + modpng14_size_t pixel_bytes; int width = (int)row_info->width; pixel_bytes = (row_info->pixel_depth >> 3); @@ -1715,9 +1715,9 @@ /* New code by Nirav Chhatrapati - Intel Corporation */ -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_INTERLACE) /* && _mmx_supported */ ) #else if (_mmx_supported) @@ -1734,7 +1734,7 @@ __asm__ __volatile__ ( "subl $21, %%edi \n\t" - // (png_pass_inc[pass] - 1)*pixel_bytes + // (modpng14_pass_inc[pass] - 1)*pixel_bytes ".loop3_pass0: \n\t" "movd (%%esi), %%mm0 \n\t" // x x x x x 2 1 0 @@ -1784,7 +1784,7 @@ __asm__ __volatile__ ( "subl $9, %%edi \n\t" - // (png_pass_inc[pass] - 1)*pixel_bytes + // (modpng14_pass_inc[pass] - 1)*pixel_bytes ".loop3_pass2: \n\t" "movd (%%esi), %%mm0 \n\t" // x x x x x 2 1 0 @@ -1826,7 +1826,7 @@ width -= width_mmx; // 8 or 9 pix, 24 or 27 bytes if (width_mmx) { - // png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; + // modpng14_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; // sptr points at last pixel in pre-expanded row // dp points at last pixel position in expanded row int dummy_value_c; // fix 'forbidden register spilled' @@ -1836,7 +1836,7 @@ __asm__ __volatile__ ( "subl $3, %%esi \n\t" "subl $9, %%edi \n\t" - // (png_pass_inc[pass] + 1)*pixel_bytes + // (modpng14_pass_inc[pass] + 1)*pixel_bytes ".loop3_pass4: \n\t" "movq (%%esi), %%mm0 \n\t" // x x 5 4 3 2 1 0 @@ -1878,13 +1878,13 @@ dp -= width_mmx*6; for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 3); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 3); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 3); + modpng14_memcpy(dp, v, 3); dp -= 3; } sptr -= 3; @@ -1959,11 +1959,11 @@ * * Original code: * - * png_byte v[8]; - * png_memcpy(v, sptr, pixel_bytes); - * for (j = 0; j < png_pass_inc[pass]; j++) + * modpng14_byte v[8]; + * modpng14_memcpy(v, sptr, pixel_bytes); + * for (j = 0; j < modpng14_pass_inc[pass]; j++) * { - * png_memcpy(dp, v, pixel_bytes); + * modpng14_memcpy(dp, v, pixel_bytes); * dp -= pixel_bytes; * } * sptr -= pixel_bytes; @@ -1971,7 +1971,7 @@ * Replacement code is in the next three lines: */ - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) { *dp-- = *sptr; } @@ -2026,7 +2026,7 @@ { int j; - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) { *dp-- = *sptr; } @@ -2080,7 +2080,7 @@ { int j; - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) { *dp-- = *sptr; } @@ -2140,14 +2140,14 @@ dp -= (width_mmx*16 - 2); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 2; - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); } } } @@ -2197,14 +2197,14 @@ dp -= (width_mmx*8 - 2); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 2; - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); } } } @@ -2250,14 +2250,14 @@ dp -= (width_mmx*4 - 2); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 2; - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); } } } @@ -2317,14 +2317,14 @@ dp -= (width_mmx*32 - 4); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 4; - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); } } } @@ -2375,14 +2375,14 @@ dp -= (width_mmx*16 - 4); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 4; - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); } } } @@ -2431,14 +2431,14 @@ dp -= (width_mmx*8 - 4); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 4; - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); } } } @@ -2573,12 +2573,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 6); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 6); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 6); + modpng14_memcpy(dp, v, 6); dp -= 6; } sptr -= 6; @@ -2590,12 +2590,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr-= pixel_bytes; @@ -2604,18 +2604,18 @@ } // end of _mmx_supported ======================================== else /* MMX not supported: use modified C code - takes advantage - * of inlining of png_memcpy for a constant */ + * of inlining of modpng14_memcpy for a constant */ /* GRR 19991007: does it? or should pixel_bytes in each * block be replaced with immediate value (e.g., 1)? */ /* GRR 19991017: replaced with constants in each case */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { if (pixel_bytes == 1) { for (i = width; i; i--) { int j; - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) { *dp-- = *sptr; } @@ -2626,12 +2626,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 3); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 3); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 3); + modpng14_memcpy(dp, v, 3); dp -= 3; } sptr -= 3; @@ -2641,12 +2641,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); dp -= 2; } sptr -= 2; @@ -2656,20 +2656,20 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { -#ifdef PNG_DEBUG - if (dp < row || dp+3 > row+png_ptr->row_buf_size) +#ifdef MODPNG14_DEBUG + if (dp < row || dp+3 > row+modpng14_ptr->row_buf_size) { printf("dp out of bounds: row=%d, dp=%d, rp=%d\n", - row, dp, row+png_ptr->row_buf_size); - printf("row_buf=%d\n",png_ptr->row_buf_size); + row, dp, row+modpng14_ptr->row_buf_size); + printf("row_buf=%d\n",modpng14_ptr->row_buf_size); } #endif - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); dp -= 4; } sptr -= 4; @@ -2679,12 +2679,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 6); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 6); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 6); + modpng14_memcpy(dp, v, 6); dp -= 6; } sptr -= 6; @@ -2694,12 +2694,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 8); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 8); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 8); + modpng14_memcpy(dp, v, 8); dp -= 8; } sptr -= 8; @@ -2709,12 +2709,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr -= pixel_bytes; @@ -2728,18 +2728,18 @@ row_info->width = final_width; row_info->rowbytes = ((final_width * - (png_uint_32)row_info->pixel_depth + 7) >> 3); + (modpng14_uint_32)row_info->pixel_depth + 7) >> 3); } -} /* end png_do_read_interlace() */ +} /* end modpng14_do_read_interlace() */ -#endif /* PNG_HAVE_ASSEMBLER_READ_INTERLACE */ -#endif /* PNG_READ_INTERLACING_SUPPORTED */ +#endif /* MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE */ +#endif /* MODPNG14_READ_INTERLACING_SUPPORTED */ -#if defined(PNG_HAVE_ASSEMBLER_READ_FILTER_ROW) -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) // These variables are utilized in the functions below. They are declared // globally here to ensure alignment on 8-byte boundaries. @@ -2751,7 +2751,7 @@ _HBClearMask = {0x7f7f7f7f7f7f7f7fLL}, _ActiveMask, _ActiveMask2, _ActiveMaskEnd, _ShiftBpp, _ShiftRem; -#ifdef PNG_THREAD_UNSAFE_OK +#ifdef MODPNG14_THREAD_UNSAFE_OK //===========================================================================// // // // P N G _ R E A D _ F I L T E R _ R O W _ M M X _ A V G // @@ -2761,8 +2761,8 @@ // Optimized code for PNG Average filter decoder static void /* PRIVATE */ -png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row, - png_bytep prev_row) +modpng14_read_filter_row_mmx_avg(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep prev_row) { int bpp; int dummy_value_c; // fix 'forbidden register 2 (cx) was spilled' error @@ -3309,10 +3309,10 @@ default: // bpp greater than 8 (!= 1,2,3,4,[5],6,[7],8) { -#ifdef PNG_DEBUG +#ifdef MODPNG14_DEBUG // GRR: PRINT ERROR HERE: SHOULD NEVER BE REACHED - png_debug(1, - "Internal logic error in pnggccrd (png_read_filter_row_mmx_avg())\n"); + modpng14_debug(1, + "Internal logic error in pnggccrd (modpng14_read_filter_row_mmx_avg())\n"); #endif #if 0 @@ -3414,12 +3414,12 @@ #endif ); -} /* end png_read_filter_row_mmx_avg() */ +} /* end modpng14_read_filter_row_mmx_avg() */ #endif -#ifdef PNG_THREAD_UNSAFE_OK +#ifdef MODPNG14_THREAD_UNSAFE_OK //===========================================================================// // // // P N G _ R E A D _ F I L T E R _ R O W _ M M X _ P A E T H // @@ -3429,8 +3429,8 @@ // Optimized code for PNG Paeth filter decoder static void /* PRIVATE */ -png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row, - png_bytep prev_row) +modpng14_read_filter_row_mmx_paeth(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep prev_row) { int bpp; int dummy_value_c; // fix 'forbidden register 2 (cx) was spilled' error @@ -4468,13 +4468,13 @@ #endif ); -} /* end png_read_filter_row_mmx_paeth() */ +} /* end modpng14_read_filter_row_mmx_paeth() */ #endif -#ifdef PNG_THREAD_UNSAFE_OK +#ifdef MODPNG14_THREAD_UNSAFE_OK //===========================================================================// // // // P N G _ R E A D _ F I L T E R _ R O W _ M M X _ S U B // @@ -4484,7 +4484,7 @@ // Optimized code for PNG Sub filter decoder static void /* PRIVATE */ -png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row) +modpng14_read_filter_row_mmx_sub(modpng14_row_infop row_info, modpng14_bytep row) { int bpp; int dummy_value_a; @@ -4892,7 +4892,7 @@ : "%edx", "%esi" // clobber list ); -} // end of png_read_filter_row_mmx_sub() +} // end of modpng14_read_filter_row_mmx_sub() #endif @@ -4907,10 +4907,10 @@ // Optimized code for PNG Up filter decoder static void /* PRIVATE */ -png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row, - png_bytep prev_row) +modpng14_read_filter_row_mmx_up(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep prev_row) { - png_uint_32 len; + modpng14_uint_32 len; int dummy_value_d; // fix 'forbidden register 3 (dx) was spilled' error int dummy_value_S; int dummy_value_D; @@ -5042,9 +5042,9 @@ #endif ); -} // end of png_read_filter_row_mmx_up() +} // end of modpng14_read_filter_row_mmx_up() -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ @@ -5056,66 +5056,66 @@ /*===========================================================================*/ -/* Optimized png_read_filter_row routines */ +/* Optimized modpng14_read_filter_row routines */ void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep - row, png_bytep prev_row, int filter) +modpng14_read_filter_row(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep + row, modpng14_bytep prev_row, int filter) { -#ifdef PNG_DEBUG +#ifdef MODPNG14_DEBUG char filnm[10]; #endif -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -/* GRR: these are superseded by png_ptr->asm_flags: */ +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) +/* GRR: these are superseded by modpng14_ptr->asm_flags: */ #define UseMMX_sub 1 // GRR: converted 20000730 #define UseMMX_up 1 // GRR: converted 20000729 #define UseMMX_avg 1 // GRR: converted 20000828 (+ 16-bit bugfix 20000916) #define UseMMX_paeth 1 // GRR: converted 20000828 if (_mmx_supported == 2) { - /* this should have happened in png_init_mmx_flags() already */ -#if !defined(PNG_1_0_X) - png_warning(png_ptr, "asm_flags may not have been initialized"); + /* this should have happened in modpng14_init_mmx_flags() already */ +#if !defined(MODPNG14_1_0_X) + modpng14_warning(modpng14_ptr, "asm_flags may not have been initialized"); #endif - png_mmx_support(); + modpng14_mmx_support(); } -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ -#ifdef PNG_DEBUG - png_debug(1, "in png_read_filter_row (pnggccrd.c)\n"); +#ifdef MODPNG14_DEBUG + modpng14_debug(1, "in modpng14_read_filter_row (pnggccrd.c)\n"); switch (filter) { case 0: sprintf(filnm, "none"); break; case 1: sprintf(filnm, "sub-%s", -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : #endif #endif "x86"); break; case 2: sprintf(filnm, "up-%s", -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED +#if !defined(MODPNG14_1_0_X) + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : #endif #endif "x86"); break; case 3: sprintf(filnm, "avg-%s", -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : #endif #endif "x86"); break; case 4: sprintf(filnm, "Paeth-%s", -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX": +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX": #endif #endif "x86"); @@ -5123,139 +5123,139 @@ default: sprintf(filnm, "unknw"); break; } - png_debug2(0, "row_number=%5ld, %5s, ", png_ptr->row_number, filnm); - png_debug1(0, "row=0x%08lx, ", (unsigned long)row); - png_debug2(0, "pixdepth=%2d, bytes=%d, ", (int)row_info->pixel_depth, + modpng14_debug2(0, "row_number=%5ld, %5s, ", modpng14_ptr->row_number, filnm); + modpng14_debug1(0, "row=0x%08lx, ", (unsigned long)row); + modpng14_debug2(0, "pixdepth=%2d, bytes=%d, ", (int)row_info->pixel_depth, (int)((row_info->pixel_depth + 7) >> 3)); - png_debug1(0,"rowbytes=%8ld\n", row_info->rowbytes); -#endif /* PNG_DEBUG */ + modpng14_debug1(0,"rowbytes=%8ld\n", row_info->rowbytes); +#endif /* MODPNG14_DEBUG */ switch (filter) { - case PNG_FILTER_VALUE_NONE: + case MODPNG14_FILTER_VALUE_NONE: break; - case PNG_FILTER_VALUE_SUB: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + case MODPNG14_FILTER_VALUE_SUB: +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) #else if (_mmx_supported) #endif { - png_read_filter_row_mmx_sub(row_info, row); + modpng14_read_filter_row_mmx_sub(row_info, row); } else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_bytep rp = row + bpp; + modpng14_bytep lp = row; for (i = bpp; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); rp++; } } /* end !UseMMX_sub */ break; - case PNG_FILTER_VALUE_UP: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + case MODPNG14_FILTER_VALUE_UP: +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) #else if (_mmx_supported) #endif { - png_read_filter_row_mmx_up(row_info, row, prev_row); + modpng14_read_filter_row_mmx_up(row_info, row, prev_row); } else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; for (i = 0; i < istop; ++i) { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); rp++; } } /* end !UseMMX_up */ break; - case PNG_FILTER_VALUE_AVG: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + case MODPNG14_FILTER_VALUE_AVG: +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) #else if (_mmx_supported) #endif { - png_read_filter_row_mmx_avg(row_info, row, prev_row); + modpng14_read_filter_row_mmx_avg(row_info, row, prev_row); } else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; + modpng14_uint_32 i; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; + modpng14_bytep lp = row; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_uint_32 istop = row_info->rowbytes - bpp; for (i = 0; i < bpp; i++) { - *rp = (png_byte)(((int)(*rp) + + *rp = (modpng14_byte)(((int)(*rp) + ((int)(*pp++) >> 1)) & 0xff); rp++; } for (i = 0; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + + *rp = (modpng14_byte)(((int)(*rp) + ((int)(*pp++ + *lp++) >> 1)) & 0xff); rp++; } } /* end !UseMMX_avg */ break; - case PNG_FILTER_VALUE_PAETH: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + case MODPNG14_FILTER_VALUE_PAETH: +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_THREAD_UNSAFE_OK) +#if !defined(MODPNG14_1_0_X) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) #else if (_mmx_supported) #endif { - png_read_filter_row_mmx_paeth(row_info, row, prev_row); + modpng14_read_filter_row_mmx_paeth(row_info, row, prev_row); } else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; + modpng14_uint_32 i; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; + modpng14_bytep lp = row; + modpng14_bytep cp = prev_row; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_uint_32 istop = row_info->rowbytes - bpp; for (i = 0; i < bpp; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); rp++; } @@ -5270,7 +5270,7 @@ p = b - c; pc = a - c; -#ifdef PNG_USE_ABS +#ifdef MODPNG14_USE_ABS pa = abs(p); pb = abs(pc); pc = abs(p + pc); @@ -5291,20 +5291,20 @@ p = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c; - *rp = (png_byte)(((int)(*rp) + p) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + p) & 0xff); rp++; } } /* end !UseMMX_paeth */ break; default: - png_warning(png_ptr, "Ignoring bad row-filter type"); + modpng14_warning(modpng14_ptr, "Ignoring bad row-filter type"); *row=0; break; } } -#endif /* PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */ +#endif /* MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW */ /*===========================================================================*/ @@ -5324,10 +5324,10 @@ * maybe if don't use leading "." in label name? (nope...sigh)] */ -int PNGAPI -png_mmx_support(void) +int MODPNG14API +modpng14_mmx_support(void) { -#if defined(PNG_MMX_CODE_SUPPORTED) +#if defined(MODPNG14_MMX_CODE_SUPPORTED) __asm__ __volatile__ ( "pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction "pushl %%ecx \n\t" // so does ecx... @@ -5388,10 +5388,10 @@ ); #else _mmx_supported = 0; -#endif /* PNG_MMX_CODE_SUPPORTED */ +#endif /* MODPNG14_MMX_CODE_SUPPORTED */ return _mmx_supported; } -#endif /* PNG_USE_PNGGCCRD */ +#endif /* MODPNG14_USE_PNGGCCRD */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngget.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngget.c @@ -1,126 +1,126 @@ /* pngget.c - retrieval of values from info struct * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" -png_uint_32 PNGAPI -png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) +modpng14_uint_32 MODPNG14API +modpng14_get_valid(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 flag) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_uint_32 MODPNG14API +modpng14_get_rowbytes(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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 defined(MODPNG14_INFO_IMAGE_SUPPORTED) +modpng14_bytepp MODPNG14API +modpng14_get_rows(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +#ifdef MODPNG14_EASY_ACCESS_SUPPORTED +/* easy access to info, added in libmodpng14-0.99 */ +modpng14_uint_32 MODPNG14API +modpng14_get_image_width(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_uint_32 MODPNG14API +modpng14_get_image_height(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_byte MODPNG14API +modpng14_get_bit_depth(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_byte MODPNG14API +modpng14_get_color_type(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_byte MODPNG14API +modpng14_get_filter_type(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_byte MODPNG14API +modpng14_get_interlace_type(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_byte MODPNG14API +modpng14_get_compression_type(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_uint_32 MODPNG14API +modpng14_get_x_pixels_per_meter(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_pHYs_SUPPORTED) + if (info_ptr->valid & MODPNG14_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) + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_x_pixels_per_meter"); + if(info_ptr->phys_unit_type != MODPNG14_RESOLUTION_METER) return (0); else return (info_ptr->x_pixels_per_unit); } @@ -130,15 +130,15 @@ return (0); } -png_uint_32 PNGAPI -png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) +modpng14_uint_32 MODPNG14API +modpng14_get_y_pixels_per_meter(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_pHYs_SUPPORTED) + if (info_ptr->valid & MODPNG14_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) + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_y_pixels_per_meter"); + if(info_ptr->phys_unit_type != MODPNG14_RESOLUTION_METER) return (0); else return (info_ptr->y_pixels_per_unit); } @@ -148,15 +148,15 @@ return (0); } -png_uint_32 PNGAPI -png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) +modpng14_uint_32 MODPNG14API +modpng14_get_pixels_per_meter(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_pHYs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_pHYs) { - png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter"); - if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER || + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_pixels_per_meter"); + if(info_ptr->phys_unit_type != MODPNG14_RESOLUTION_METER || info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) return (0); else return (info_ptr->x_pixels_per_unit); @@ -167,15 +167,15 @@ 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) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +float MODPNG14API +modpng14_get_pixel_aspect_ratio(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) + { + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_pHYs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_pHYs) { - png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio"); + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_aspect_ratio"); if (info_ptr->x_pixels_per_unit == 0) return ((float)0.0); else @@ -189,15 +189,15 @@ } #endif -png_int_32 PNGAPI -png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr) +modpng14_int_32 MODPNG14API +modpng14_get_x_offset_microns(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_oFFs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_oFFs) { - png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_x_offset_microns"); + if(info_ptr->offset_unit_type != MODPNG14_OFFSET_MICROMETER) return (0); else return (info_ptr->x_offset); } @@ -207,15 +207,15 @@ return (0); } -png_int_32 PNGAPI -png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr) +modpng14_int_32 MODPNG14API +modpng14_get_y_offset_microns(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_oFFs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_oFFs) { - png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_y_offset_microns"); + if(info_ptr->offset_unit_type != MODPNG14_OFFSET_MICROMETER) return (0); else return (info_ptr->y_offset); } @@ -225,15 +225,15 @@ return (0); } -png_int_32 PNGAPI -png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr) +modpng14_int_32 MODPNG14API +modpng14_get_x_offset_pixels(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_oFFs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_oFFs) { - png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_x_offset_microns"); + if(info_ptr->offset_unit_type != MODPNG14_OFFSET_PIXEL) return (0); else return (info_ptr->x_offset); } @@ -243,15 +243,15 @@ return (0); } -png_int_32 PNGAPI -png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr) +modpng14_int_32 MODPNG14API +modpng14_get_y_offset_pixels(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) + if (modpng14_ptr != NULL && info_ptr != NULL) +#if defined(MODPNG14_oFFs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_oFFs) { - png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) + modpng14_debug1(1, "in %s retrieval function\n", "modpng14_get_y_offset_microns"); + if(info_ptr->offset_unit_type != MODPNG14_OFFSET_PIXEL) return (0); else return (info_ptr->y_offset); } @@ -261,126 +261,126 @@ 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) +#if defined(MODPNG14_INCH_CONVERSIONS) && defined(MODPNG14_FLOATING_POINT_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_pixels_per_inch(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr) + return ((modpng14_uint_32)((float)modpng14_get_pixels_per_meter(modpng14_ptr, info_ptr) *.0254 +.5)); } -png_uint_32 PNGAPI -png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) +modpng14_uint_32 MODPNG14API +modpng14_get_x_pixels_per_inch(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr) + return ((modpng14_uint_32)((float)modpng14_get_x_pixels_per_meter(modpng14_ptr, info_ptr) *.0254 +.5)); } -png_uint_32 PNGAPI -png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) +modpng14_uint_32 MODPNG14API +modpng14_get_y_pixels_per_inch(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr) + return ((modpng14_uint_32)((float)modpng14_get_y_pixels_per_meter(modpng14_ptr, info_ptr) *.0254 +.5)); } -float PNGAPI -png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr) +float MODPNG14API +modpng14_get_x_offset_inches(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - return ((float)png_get_x_offset_microns(png_ptr, info_ptr) + return ((float)modpng14_get_x_offset_microns(modpng14_ptr, info_ptr) *.00003937); } -float PNGAPI -png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr) +float MODPNG14API +modpng14_get_y_offset_inches(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - return ((float)png_get_y_offset_microns(png_ptr, info_ptr) + return ((float)modpng14_get_y_offset_microns(modpng14_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) +#if defined(MODPNG14_pHYs_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_pHYs_dpi(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 *res_x, modpng14_uint_32 *res_y, int *unit_type) { - png_uint_32 retval = 0; + modpng14_uint_32 retval = 0; - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_pHYs)) { - png_debug1(1, "in %s retrieval function\n", "pHYs"); + modpng14_debug1(1, "in %s retrieval function\n", "pHYs"); if (res_x != NULL) { *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; + retval |= MODPNG14_INFO_pHYs; } if (res_y != NULL) { *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; + retval |= MODPNG14_INFO_pHYs; } if (unit_type != NULL) { *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; + retval |= MODPNG14_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); + if (res_x != NULL) *res_x = (modpng14_uint_32)(*res_x * .0254 + .50); + if (res_y != NULL) *res_y = (modpng14_uint_32)(*res_y * .0254 + .50); } } } return (retval); } -#endif /* PNG_pHYs_SUPPORTED */ -#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ +#endif /* MODPNG14_pHYs_SUPPORTED */ +#endif /* MODPNG14_INCH_CONVERSIONS && MODPNG14_FLOATING_POINT_SUPPORTED */ -/* png_get_channels really belongs in here, too, but it's been around longer */ +/* modpng14_get_channels really belongs in here, too, but it's been around longer */ -#endif /* PNG_EASY_ACCESS_SUPPORTED */ +#endif /* MODPNG14_EASY_ACCESS_SUPPORTED */ -png_byte PNGAPI -png_get_channels(png_structp png_ptr, png_infop info_ptr) +modpng14_byte MODPNG14API +modpng14_get_channels(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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) +modpng14_bytep MODPNG14API +modpng14_get_signature(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr != NULL && info_ptr != NULL) + if (modpng14_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 defined(MODPNG14_bKGD_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_bKGD(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_color_16p *background) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_bKGD) && background != NULL) { - png_debug1(1, "in %s retrieval function\n", "bKGD"); + modpng14_debug1(1, "in %s retrieval function\n", "bKGD"); *background = &(info_ptr->background); - return (PNG_INFO_bKGD); + return (MODPNG14_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, +#if defined(MODPNG14_cHRM_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +modpng14_uint_32 MODPNG14API +modpng14_get_cHRM(modpng14_structp modpng14_ptr, modpng14_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)) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_cHRM)) { - png_debug1(1, "in %s retrieval function\n", "cHRM"); + modpng14_debug1(1, "in %s retrieval function\n", "cHRM"); if (white_x != NULL) *white_x = (double)info_ptr->x_white; if (white_y != NULL) @@ -397,21 +397,21 @@ *blue_x = (double)info_ptr->x_blue; if (blue_y != NULL) *blue_y = (double)info_ptr->y_blue; - return (PNG_INFO_cHRM); + return (MODPNG14_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) +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +modpng14_uint_32 MODPNG14API +modpng14_get_cHRM_fixed(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_fixed_point *white_x, modpng14_fixed_point *white_y, modpng14_fixed_point *red_x, + modpng14_fixed_point *red_y, modpng14_fixed_point *green_x, modpng14_fixed_point *green_y, + modpng14_fixed_point *blue_x, modpng14_fixed_point *blue_y) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_cHRM)) { - png_debug1(1, "in %s retrieval function\n", "cHRM"); + modpng14_debug1(1, "in %s retrieval function\n", "cHRM"); if (white_x != NULL) *white_x = info_ptr->int_x_white; if (white_y != NULL) @@ -428,130 +428,130 @@ *blue_x = info_ptr->int_x_blue; if (blue_y != NULL) *blue_y = info_ptr->int_y_blue; - return (PNG_INFO_cHRM); + return (MODPNG14_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 defined(MODPNG14_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +modpng14_uint_32 MODPNG14API +modpng14_get_gAMA(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, double *file_gamma) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_gAMA) && file_gamma != NULL) { - png_debug1(1, "in %s retrieval function\n", "gAMA"); + modpng14_debug1(1, "in %s retrieval function\n", "gAMA"); *file_gamma = (double)info_ptr->gamma; - return (PNG_INFO_gAMA); + return (MODPNG14_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) +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +modpng14_uint_32 MODPNG14API +modpng14_get_gAMA_fixed(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_fixed_point *int_file_gamma) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_gAMA) && int_file_gamma != NULL) { - png_debug1(1, "in %s retrieval function\n", "gAMA"); + modpng14_debug1(1, "in %s retrieval function\n", "gAMA"); *int_file_gamma = info_ptr->int_gamma; - return (PNG_INFO_gAMA); + return (MODPNG14_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 defined(MODPNG14_sRGB_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_sRGB(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int *file_srgb_intent) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_sRGB) && file_srgb_intent != NULL) { - png_debug1(1, "in %s retrieval function\n", "sRGB"); + modpng14_debug1(1, "in %s retrieval function\n", "sRGB"); *file_srgb_intent = (int)info_ptr->srgb_intent; - return (PNG_INFO_sRGB); + return (MODPNG14_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 defined(MODPNG14_iCCP_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_iCCP(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_charpp name, int *compression_type, + modpng14_charpp profile, modpng14_uint_32 *proflen) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_iCCP) && name != NULL && profile != NULL && proflen != NULL) { - png_debug1(1, "in %s retrieval function\n", "iCCP"); + modpng14_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 (MODPNG14_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 defined(MODPNG14_sPLT_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_sPLT(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_sPLT_tpp spalettes) { - if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) + if (modpng14_ptr != NULL && info_ptr != NULL && spalettes != NULL) *spalettes = info_ptr->splt_palettes; - return ((png_uint_32)info_ptr->splt_palettes_num); + return ((modpng14_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 defined(MODPNG14_hIST_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_hIST(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_16p *hist) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_hIST) && hist != NULL) { - png_debug1(1, "in %s retrieval function\n", "hIST"); + modpng14_debug1(1, "in %s retrieval function\n", "hIST"); *hist = info_ptr->hist; - return (PNG_INFO_hIST); + return (MODPNG14_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, +modpng14_uint_32 MODPNG14API +modpng14_get_IHDR(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 *width, modpng14_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 && + if (modpng14_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; + modpng14_uint_32 rowbytes_per_pixel; - png_debug1(1, "in %s retrieval function\n", "IHDR"); + modpng14_debug1(1, "in %s retrieval function\n", "IHDR"); *width = info_ptr->width; *height = info_ptr->height; *bit_depth = info_ptr->bit_depth; if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16) - png_error(png_ptr, "Invalid bit depth"); + modpng14_error(modpng14_ptr, "Invalid bit depth"); *color_type = info_ptr->color_type; if (info_ptr->color_type > 6) - png_error(png_ptr, "Invalid color type"); + modpng14_error(modpng14_ptr, "Invalid color type"); if (compression_type != NULL) *compression_type = info_ptr->compression_type; if (filter_type != NULL) @@ -560,59 +560,59 @@ *interlace_type = info_ptr->interlace_type; /* check for potential overflow of rowbytes */ - if (*color_type == PNG_COLOR_TYPE_PALETTE) + if (*color_type == MODPNG14_COLOR_TYPE_PALETTE) channels = 1; - else if (*color_type & PNG_COLOR_MASK_COLOR) + else if (*color_type & MODPNG14_COLOR_MASK_COLOR) channels = 3; else channels = 1; - if (*color_type & PNG_COLOR_MASK_ALPHA) + if (*color_type & MODPNG14_COLOR_MASK_ALPHA) channels++; pixel_depth = *bit_depth * channels; rowbytes_per_pixel = (pixel_depth + 7) >> 3; - if (width == 0 || *width > PNG_MAX_UINT) - png_error(png_ptr, "Invalid image width"); - if (height == 0 || *height > PNG_MAX_UINT) - png_error(png_ptr, "Invalid image height"); - if (*width > PNG_MAX_UINT/rowbytes_per_pixel - 64) + if (width == 0 || *width > MODPNG14_MAX_UINT) + modpng14_error(modpng14_ptr, "Invalid image width"); + if (height == 0 || *height > MODPNG14_MAX_UINT) + modpng14_error(modpng14_ptr, "Invalid image height"); + if (*width > MODPNG14_MAX_UINT/rowbytes_per_pixel - 64) { - png_error(png_ptr, - "Width too large for libpng to process image data."); + modpng14_error(modpng14_ptr, + "Width too large for libmodpng14 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 defined(MODPNG14_oFFs_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_oFFs(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_int_32 *offset_x, modpng14_int_32 *offset_y, int *unit_type) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_oFFs) && offset_x != NULL && offset_y != NULL && unit_type != NULL) { - png_debug1(1, "in %s retrieval function\n", "oFFs"); + modpng14_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 (MODPNG14_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 defined(MODPNG14_pCAL_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_pCAL(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_charp *purpose, modpng14_int_32 *X0, modpng14_int_32 *X1, int *type, int *nparams, + modpng14_charp *units, modpng14_charpp *params) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_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"); + modpng14_debug1(1, "in %s retrieval function\n", "pCAL"); *purpose = info_ptr->pcal_purpose; *X0 = info_ptr->pcal_X0; *X1 = info_ptr->pcal_X1; @@ -620,41 +620,41 @@ *nparams = (int)info_ptr->pcal_nparams; *units = info_ptr->pcal_units; *params = info_ptr->pcal_params; - return (PNG_INFO_pCAL); + return (MODPNG14_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, +#if defined(MODPNG14_sCAL_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +modpng14_uint_32 MODPNG14API +modpng14_get_sCAL(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int *unit, double *width, double *height) { - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL)) + if (modpng14_ptr != NULL && info_ptr != NULL && + (info_ptr->valid & MODPNG14_INFO_sCAL)) { *unit = info_ptr->scal_unit; *width = info_ptr->scal_pixel_width; *height = info_ptr->scal_pixel_height; - return (PNG_INFO_sCAL); + return (MODPNG14_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) +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +modpng14_uint_32 MODPNG14API +modpng14_get_sCAL_s(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + int *unit, modpng14_charpp width, modpng14_charpp height) { - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL)) + if (modpng14_ptr != NULL && info_ptr != NULL && + (info_ptr->valid & MODPNG14_INFO_sCAL)) { *unit = info_ptr->scal_unit; *width = info_ptr->scal_s_width; *height = info_ptr->scal_s_height; - return (PNG_INFO_sCAL); + return (MODPNG14_INFO_sCAL); } return(0); } @@ -662,83 +662,83 @@ #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) +#if defined(MODPNG14_pHYs_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_pHYs(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 *res_x, modpng14_uint_32 *res_y, int *unit_type) { - png_uint_32 retval = 0; + modpng14_uint_32 retval = 0; - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs)) + if (modpng14_ptr != NULL && info_ptr != NULL && + (info_ptr->valid & MODPNG14_INFO_pHYs)) { - png_debug1(1, "in %s retrieval function\n", "pHYs"); + modpng14_debug1(1, "in %s retrieval function\n", "pHYs"); if (res_x != NULL) { *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; + retval |= MODPNG14_INFO_pHYs; } if (res_y != NULL) { *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; + retval |= MODPNG14_INFO_pHYs; } if (unit_type != NULL) { *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; + retval |= MODPNG14_INFO_pHYs; } } return (retval); } #endif -png_uint_32 PNGAPI -png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, +modpng14_uint_32 MODPNG14API +modpng14_get_PLTE(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_colorp *palette, int *num_palette) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_PLTE) && palette != NULL) { - png_debug1(1, "in %s retrieval function\n", "PLTE"); + modpng14_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); + modpng14_debug1(3, "num_palette = %d\n", *num_palette); + return (MODPNG14_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 defined(MODPNG14_sBIT_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_sBIT(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_color_8p *sig_bit) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_sBIT) && sig_bit != NULL) { - png_debug1(1, "in %s retrieval function\n", "sBIT"); + modpng14_debug1(1, "in %s retrieval function\n", "sBIT"); *sig_bit = &(info_ptr->sig_bit); - return (PNG_INFO_sBIT); + return (MODPNG14_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, +#if defined(MODPNG14_TEXT_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_text(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_textp *text_ptr, int *num_text) { - if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) + if (modpng14_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)); + modpng14_debug1(1, "in %s retrieval function\n", + (modpng14_ptr->chunk_name[0] == '\0' ? "text" + : (modpng14_const_charp)modpng14_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); + return ((modpng14_uint_32)info_ptr->num_text); } if (num_text != NULL) *num_text = 0; @@ -746,46 +746,46 @@ } #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 defined(MODPNG14_tIME_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_tIME(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_timep *mod_time) { - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_tIME) && mod_time != NULL) { - png_debug1(1, "in %s retrieval function\n", "tIME"); + modpng14_debug1(1, "in %s retrieval function\n", "tIME"); *mod_time = &(info_ptr->mod_time); - return (PNG_INFO_tIME); + return (MODPNG14_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) +#if defined(MODPNG14_tRNS_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_tRNS(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_bytep *trans, int *num_trans, modpng14_color_16p *trans_values) { - png_uint_32 retval = 0; - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) + modpng14_uint_32 retval = 0; + if (modpng14_ptr != NULL && info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_tRNS)) { - png_debug1(1, "in %s retrieval function\n", "tRNS"); - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + modpng14_debug1(1, "in %s retrieval function\n", "tRNS"); + if (info_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { if (trans != NULL) { *trans = info_ptr->trans; - retval |= PNG_INFO_tRNS; + retval |= MODPNG14_INFO_tRNS; } if (trans_values != NULL) *trans_values = &(info_ptr->trans_values); } - else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ + else /* if (info_ptr->color_type != MODPNG14_COLOR_TYPE_PALETTE) */ { if (trans_values != NULL) { *trans_values = &(info_ptr->trans_values); - retval |= PNG_INFO_tRNS; + retval |= MODPNG14_INFO_tRNS; } if(trans != NULL) *trans = NULL; @@ -793,113 +793,113 @@ if(num_trans != NULL) { *num_trans = info_ptr->num_trans; - retval |= PNG_INFO_tRNS; + retval |= MODPNG14_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 defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_get_unknown_chunks(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_unknown_chunkpp unknowns) { - if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) + if (modpng14_ptr != NULL && info_ptr != NULL && unknowns != NULL) *unknowns = info_ptr->unknown_chunks; - return ((png_uint_32)info_ptr->unknown_chunks_num); + return ((modpng14_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) +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) +modpng14_byte MODPNG14API +modpng14_get_rgb_to_gray_status (modpng14_structp modpng14_ptr) { - return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0); + return (modpng14_byte)(modpng14_ptr? modpng14_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) +#if defined(MODPNG14_USER_CHUNKS_SUPPORTED) +modpng14_voidp MODPNG14API +modpng14_get_user_chunk_ptr(modpng14_structp modpng14_ptr) { - return (png_ptr? png_ptr->user_chunk_ptr : NULL); + return (modpng14_ptr? modpng14_ptr->user_chunk_ptr : NULL); } #endif -png_uint_32 PNGAPI -png_get_compression_buffer_size(png_structp png_ptr) +modpng14_uint_32 MODPNG14API +modpng14_get_compression_buffer_size(modpng14_structp modpng14_ptr) { - return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L); + return (modpng14_uint_32)(modpng14_ptr? modpng14_ptr->zbuf_size : 0L); } -#ifndef PNG_1_0_X -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* this function was added to libpng 1.2.0 and should exist by default */ -png_uint_32 PNGAPI -png_get_asm_flags (png_structp png_ptr) +#ifndef MODPNG14_1_0_X +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED +/* this function was added to libmodpng14 1.2.0 and should exist by default */ +modpng14_uint_32 MODPNG14API +modpng14_get_asm_flags (modpng14_structp modpng14_ptr) { - return (png_uint_32)(png_ptr? png_ptr->asm_flags : 0L); + return (modpng14_uint_32)(modpng14_ptr? modpng14_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) +/* this function was added to libmodpng14 1.2.0 and should exist by default */ +modpng14_uint_32 MODPNG14API +modpng14_get_asm_flagmask (int flag_select) { - png_uint_32 settable_asm_flags = 0; + modpng14_uint_32 settable_asm_flags = 0; - if (flag_select & PNG_SELECT_READ) + if (flag_select & MODPNG14_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 ; + MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW | + MODPNG14_ASM_FLAG_MMX_READ_INTERLACE | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG | + MODPNG14_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) + if (flag_select & MODPNG14_SELECT_WRITE) settable_asm_flags |= - PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; + MODPNG14_ASM_FLAG_MMX_WRITE_ [whatever] ; #endif /* 0 */ return settable_asm_flags; /* _theoretically_ settable capabilities only */ } -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_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) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) + /* GRR: could add this: && defined(MODPNG14_MMX_CODE_SUPPORTED) */ +/* this function was added to libmodpng14 1.2.0 */ +modpng14_uint_32 MODPNG14API +modpng14_get_mmx_flagmask (int flag_select, int *compilerID) { - png_uint_32 settable_mmx_flags = 0; + modpng14_uint_32 settable_mmx_flags = 0; - if (flag_select & PNG_SELECT_READ) + if (flag_select & MODPNG14_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 ; + MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW | + MODPNG14_ASM_FLAG_MMX_READ_INTERLACE | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH ; #if 0 /* GRR: no MMX write support yet, but someday... */ - if (flag_select & PNG_SELECT_WRITE) + if (flag_select & MODPNG14_SELECT_WRITE) settable_mmx_flags |= - PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; + MODPNG14_ASM_FLAG_MMX_WRITE_ [whatever] ; #endif /* 0 */ if (compilerID != NULL) { -#ifdef PNG_USE_PNGVCRD +#ifdef MODPNG14_USE_PNGVCRD *compilerID = 1; /* MSVC */ #else -#ifdef PNG_USE_PNGGCCRD +#ifdef MODPNG14_USE_PNGGCCRD *compilerID = 2; /* gcc/gas */ #else *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ @@ -910,18 +910,18 @@ 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) +/* this function was added to libmodpng14 1.2.0 */ +modpng14_byte MODPNG14API +modpng14_get_mmx_bitdepth_threshold (modpng14_structp modpng14_ptr) { - return (png_byte)(png_ptr? png_ptr->mmx_bitdepth_threshold : 0); + return (modpng14_byte)(modpng14_ptr? modpng14_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) +/* this function was added to libmodpng14 1.2.0 */ +modpng14_uint_32 MODPNG14API +modpng14_get_mmx_rowbytes_threshold (modpng14_structp modpng14_ptr) { - return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L); + return (modpng14_uint_32)(modpng14_ptr? modpng14_ptr->mmx_rowbytes_threshold : 0L); } -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED */ +#endif /* MODPNG14_1_0_X */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngmem.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngmem.c @@ -1,99 +1,99 @@ /* pngmem.c - stub functions for memory allocation * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * 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 + * functions for modpng14_malloc() and modpng14_free(), and to use + * modpng14_create_read_struct_2() and modpng14_create_write_struct_2() to * identify the replacement functions. */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.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 */ +/* if you change this, be sure to change the one in modpng14.h also */ -/* Allocate memory for a png_struct. The malloc and memset can be replaced +/* Allocate memory for a modpng14_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) +modpng14_voidp /* PRIVATE */ +modpng14_create_struct(int type) { -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL)); +#ifdef MODPNG14_USER_MEM_SUPPORTED + return (modpng14_create_struct_2(type, modpng14_malloc_ptr_NULL, modpng14_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) +/* Alternate version of modpng14_create_struct, for use with user-defined malloc. */ +modpng14_voidp /* PRIVATE */ +modpng14_create_struct_2(int type, modpng14_malloc_ptr malloc_fn, modpng14_voidp mem_ptr) { -#endif /* PNG_USER_MEM_SUPPORTED */ - png_size_t size; - png_voidp struct_ptr; +#endif /* MODPNG14_USER_MEM_SUPPORTED */ + modpng14_size_t size; + modpng14_voidp struct_ptr; - if (type == PNG_STRUCT_INFO) - size = sizeof(png_info); - else if (type == PNG_STRUCT_PNG) - size = sizeof(png_struct); + if (type == MODPNG14_STRUCT_INFO) + size = sizeof(modpng14_info); + else if (type == MODPNG14_STRUCT_PNG) + size = sizeof(modpng14_struct); else - return (png_get_copyright()); + return (modpng14_get_copyright()); -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_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); + modpng14_struct dummy_struct; + modpng14_structp modpng14_ptr = &dummy_struct; + modpng14_ptr->mem_ptr=mem_ptr; + struct_ptr = (*(malloc_fn))(modpng14_ptr, (modpng14_uint_32)size); } else -#endif /* PNG_USER_MEM_SUPPORTED */ - struct_ptr = (png_voidp)farmalloc(size)); +#endif /* MODPNG14_USER_MEM_SUPPORTED */ + struct_ptr = (modpng14_voidp)farmalloc(size)); if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); + modpng14_memset(struct_ptr, 0, size); return (struct_ptr); } -/* Free memory allocated by a png_create_struct() call */ +/* Free memory allocated by a modpng14_create_struct() call */ void /* PRIVATE */ -png_destroy_struct(png_voidp struct_ptr) +modpng14_destroy_struct(modpng14_voidp struct_ptr) { -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2(struct_ptr, modpng14_free_ptr_NULL, modpng14_voidp_NULL); } -/* Free memory allocated by a png_create_struct() call */ +/* Free memory allocated by a modpng14_create_struct() call */ void /* PRIVATE */ -png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, - png_voidp mem_ptr) +modpng14_destroy_struct_2(modpng14_voidp struct_ptr, modpng14_free_ptr free_fn, + modpng14_voidp mem_ptr) { #endif if (struct_ptr != NULL) { -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_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); + modpng14_struct dummy_struct; + modpng14_structp modpng14_ptr = &dummy_struct; + modpng14_ptr->mem_ptr=mem_ptr; + (*(free_fn))(modpng14_ptr, struct_ptr); return; } -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_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 + * it not to. See zconf.h and modpng14.h for more information. zlib does * need to allocate exactly 64K, so whatever you call here must * have the ability to do that. * @@ -105,56 +105,56 @@ * 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 + * Note that we can't use modpng14_size_t for the "size" declaration, + * since on some systems a modpng14_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) +modpng14_voidp MODPNG14API +modpng14_malloc(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - png_voidp ret; + modpng14_voidp ret; - if (png_ptr == NULL || size == 0) + if (modpng14_ptr == NULL || size == 0) return (NULL); -#ifdef PNG_USER_MEM_SUPPORTED - if(png_ptr->malloc_fn != NULL) +#ifdef MODPNG14_USER_MEM_SUPPORTED + if(modpng14_ptr->malloc_fn != NULL) { - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of memory!"); + ret = ((modpng14_voidp)(*(modpng14_ptr->malloc_fn))(modpng14_ptr, (modpng14_size_t)size)); + if (ret == NULL && (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out of memory!"); return (ret); } else - return png_malloc_default(png_ptr, size); + return modpng14_malloc_default(modpng14_ptr, size); } -png_voidp PNGAPI -png_malloc_default(png_structp png_ptr, png_uint_32 size) +modpng14_voidp MODPNG14API +modpng14_malloc_default(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - png_voidp ret; -#endif /* PNG_USER_MEM_SUPPORTED */ + modpng14_voidp ret; +#endif /* MODPNG14_USER_MEM_SUPPORTED */ -#ifdef PNG_MAX_MALLOC_64K - if (size > (png_uint_32)65536L) - png_error(png_ptr, "Cannot Allocate > 64K"); +#ifdef MODPNG14_MAX_MALLOC_64K + if (size > (modpng14_uint_32)65536L) + modpng14_error(modpng14_ptr, "Cannot Allocate > 64K"); #endif - if (size == (png_uint_32)65536L) + if (size == (modpng14_uint_32)65536L) { - if (png_ptr->offset_table == NULL) + if (modpng14_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)) + if (ret == NULL || ((modpng14_size_t)ret & 0xffff)) { int num_blocks; - png_uint_32 total_size; - png_bytep table; + modpng14_uint_32 total_size; + modpng14_bytep table; int i; - png_byte huge * hptr; + modpng14_byte huge * hptr; if (ret != NULL) { @@ -162,137 +162,137 @@ ret = NULL; } - if(png_ptr->zlib_window_bits > 14) - num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14)); + if(modpng14_ptr->zlib_window_bits > 14) + num_blocks = (int)(1 << (modpng14_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)); + if (modpng14_ptr->zlib_mem_level >= 7) + num_blocks += (int)(1 << (modpng14_ptr->zlib_mem_level - 7)); else num_blocks++; - total_size = ((png_uint_32)65536L) * (png_uint_32)num_blocks+16; + total_size = ((modpng14_uint_32)65536L) * (modpng14_uint_32)num_blocks+16; table = farmalloc(total_size); if (table == NULL) { - if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */ + if (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out Of Memory."); /* Note "O" and "M" */ else - png_warning(png_ptr, "Out Of Memory."); + modpng14_warning(modpng14_ptr, "Out Of Memory."); return (NULL); } - if ((png_size_t)table & 0xfff0) + if ((modpng14_size_t)table & 0xfff0) { - if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, + if (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Farmalloc didn't return normalized pointer"); else - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Farmalloc didn't return normalized pointer"); return (NULL); } - png_ptr->offset_table = table; - png_ptr->offset_table_ptr = farmalloc(num_blocks * - sizeof (png_bytep)); + modpng14_ptr->offset_table = table; + modpng14_ptr->offset_table_ptr = farmalloc(num_blocks * + sizeof (modpng14_bytep)); - if (png_ptr->offset_table_ptr == NULL) + if (modpng14_ptr->offset_table_ptr == NULL) { - if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */ + if (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out Of memory."); /* Note "O" and "M" */ else - png_warning(png_ptr, "Out Of memory."); + modpng14_warning(modpng14_ptr, "Out Of memory."); return (NULL); } - hptr = (png_byte huge *)table; - if ((png_size_t)hptr & 0xf) + hptr = (modpng14_byte huge *)table; + if ((modpng14_size_t)hptr & 0xf) { - hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L); + hptr = (modpng14_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 */ + modpng14_ptr->offset_table_ptr[i] = (modpng14_bytep)hptr; + hptr = hptr + (modpng14_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; + modpng14_ptr->offset_table_number = num_blocks; + modpng14_ptr->offset_table_count = 0; + modpng14_ptr->offset_table_count_free = 0; } } - if (png_ptr->offset_table_count >= png_ptr->offset_table_number) + if (modpng14_ptr->offset_table_count >= modpng14_ptr->offset_table_number) { - if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory."); /* Note "o" and "M" */ + if (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out of Memory."); /* Note "o" and "M" */ else - png_warning(png_ptr, "Out of Memory."); + modpng14_warning(modpng14_ptr, "Out of Memory."); return (NULL); } - ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++]; + ret = modpng14_ptr->offset_table_ptr[modpng14_ptr->offset_table_count++]; } else ret = farmalloc(size); if (ret == NULL) { - if (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */ + if (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out of memory."); /* Note "o" and "m" */ else - png_warning(png_ptr, "Out of memory."); /* Note "o" and "m" */ + modpng14_warning(modpng14_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 +/* free a pointer allocated by modpng14_malloc(). In the default + configuration, modpng14_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) +void MODPNG14API +modpng14_free(modpng14_structp modpng14_ptr, modpng14_voidp ptr) { - if (png_ptr == NULL || ptr == NULL) + if (modpng14_ptr == NULL || ptr == NULL) return; -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) +#ifdef MODPNG14_USER_MEM_SUPPORTED + if (modpng14_ptr->free_fn != NULL) { - (*(png_ptr->free_fn))(png_ptr, ptr); + (*(modpng14_ptr->free_fn))(modpng14_ptr, ptr); return; } - else png_free_default(png_ptr, ptr); + else modpng14_free_default(modpng14_ptr, ptr); } -void PNGAPI -png_free_default(png_structp png_ptr, png_voidp ptr) +void MODPNG14API +modpng14_free_default(modpng14_structp modpng14_ptr, modpng14_voidp ptr) { -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ - if (png_ptr->offset_table != NULL) + if (modpng14_ptr->offset_table != NULL) { int i; - for (i = 0; i < png_ptr->offset_table_count; i++) + for (i = 0; i < modpng14_ptr->offset_table_count; i++) { - if (ptr == png_ptr->offset_table_ptr[i]) + if (ptr == modpng14_ptr->offset_table_ptr[i]) { ptr = NULL; - png_ptr->offset_table_count_free++; + modpng14_ptr->offset_table_count_free++; break; } } - if (png_ptr->offset_table_count_free == png_ptr->offset_table_count) + if (modpng14_ptr->offset_table_count_free == modpng14_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; + farfree(modpng14_ptr->offset_table); + farfree(modpng14_ptr->offset_table_ptr); + modpng14_ptr->offset_table = NULL; + modpng14_ptr->offset_table_ptr = NULL; } } @@ -304,89 +304,89 @@ #else /* Not the Borland DOS special memory handler */ -/* Allocate memory for a png_struct or a png_info. The malloc and +/* Allocate memory for a modpng14_struct or a modpng14_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) +modpng14_voidp /* PRIVATE */ +modpng14_create_struct(int type) { -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL)); +#ifdef MODPNG14_USER_MEM_SUPPORTED + return (modpng14_create_struct_2(type, modpng14_malloc_ptr_NULL, modpng14_voidp_NULL)); } -/* Allocate memory for a png_struct or a png_info. The malloc and +/* Allocate memory for a modpng14_struct or a modpng14_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) +modpng14_voidp /* PRIVATE */ +modpng14_create_struct_2(int type, modpng14_malloc_ptr malloc_fn, modpng14_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); +#endif /* MODPNG14_USER_MEM_SUPPORTED */ + modpng14_size_t size; + modpng14_voidp struct_ptr; + + if (type == MODPNG14_STRUCT_INFO) + size = sizeof(modpng14_info); + else if (type == MODPNG14_STRUCT_PNG) + size = sizeof(modpng14_struct); else return (NULL); -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_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); + modpng14_struct dummy_struct; + modpng14_structp modpng14_ptr = &dummy_struct; + modpng14_ptr->mem_ptr=mem_ptr; + struct_ptr = (*(malloc_fn))(modpng14_ptr, size); if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); + modpng14_memset(struct_ptr, 0, size); return (struct_ptr); } -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ #if defined(__TURBOC__) && !defined(__FLAT__) - if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL) + if ((struct_ptr = (modpng14_voidp)farmalloc(size)) != NULL) #else # if defined(_MSC_VER) && defined(MAXSEG_64K) - if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL) + if ((struct_ptr = (modpng14_voidp)halloc(size,1)) != NULL) # else - if ((struct_ptr = (png_voidp)malloc(size)) != NULL) + if ((struct_ptr = (modpng14_voidp)malloc(size)) != NULL) # endif #endif { - png_memset(struct_ptr, 0, size); + modpng14_memset(struct_ptr, 0, size); } return (struct_ptr); } -/* Free memory allocated by a png_create_struct() call */ +/* Free memory allocated by a modpng14_create_struct() call */ void /* PRIVATE */ -png_destroy_struct(png_voidp struct_ptr) +modpng14_destroy_struct(modpng14_voidp struct_ptr) { -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2(struct_ptr, modpng14_free_ptr_NULL, modpng14_voidp_NULL); } -/* Free memory allocated by a png_create_struct() call */ +/* Free memory allocated by a modpng14_create_struct() call */ void /* PRIVATE */ -png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, - png_voidp mem_ptr) +modpng14_destroy_struct_2(modpng14_voidp struct_ptr, modpng14_free_ptr free_fn, + modpng14_voidp mem_ptr) { -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ if (struct_ptr != NULL) { -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_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); + modpng14_struct dummy_struct; + modpng14_structp modpng14_ptr = &dummy_struct; + modpng14_ptr->mem_ptr=mem_ptr; + (*(free_fn))(modpng14_ptr, struct_ptr); return; } -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ #if defined(__TURBOC__) && !defined(__FLAT__) farfree(struct_ptr); #else @@ -401,41 +401,41 @@ /* 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 + it not to. See zconf.h and modpng14.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) +modpng14_voidp MODPNG14API +modpng14_malloc(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - png_voidp ret; + modpng14_voidp ret; - if (png_ptr == NULL || size == 0) + if (modpng14_ptr == NULL || size == 0) return (NULL); -#ifdef PNG_USER_MEM_SUPPORTED - if(png_ptr->malloc_fn != NULL) +#ifdef MODPNG14_USER_MEM_SUPPORTED + if(modpng14_ptr->malloc_fn != NULL) { - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory!"); + ret = ((modpng14_voidp)(*(modpng14_ptr->malloc_fn))(modpng14_ptr, (modpng14_size_t)size)); + if (ret == NULL && (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out of Memory!"); return (ret); } else - return (png_malloc_default(png_ptr, size)); + return (modpng14_malloc_default(modpng14_ptr, size)); } -png_voidp PNGAPI -png_malloc_default(png_structp png_ptr, png_uint_32 size) +modpng14_voidp MODPNG14API +modpng14_malloc_default(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - png_voidp ret; -#endif /* PNG_USER_MEM_SUPPORTED */ + modpng14_voidp ret; +#endif /* MODPNG14_USER_MEM_SUPPORTED */ -#ifdef PNG_MAX_MALLOC_64K - if (size > (png_uint_32)65536L) +#ifdef MODPNG14_MAX_MALLOC_64K + if (size > (modpng14_uint_32)65536L) { - if(png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Cannot Allocate > 64K"); + if(modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Cannot Allocate > 64K"); else return NULL; } @@ -451,35 +451,35 @@ # endif #endif - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory"); + if (ret == NULL && (modpng14_ptr->flags&MODPNG14_FLAG_MALLOC_NULL_MEM_OK) == 0) + modpng14_error(modpng14_ptr, "Out of Memory"); return (ret); } -/* Free a pointer allocated by png_malloc(). If ptr is NULL, return +/* Free a pointer allocated by modpng14_malloc(). If ptr is NULL, return without taking any action. */ -void PNGAPI -png_free(png_structp png_ptr, png_voidp ptr) +void MODPNG14API +modpng14_free(modpng14_structp modpng14_ptr, modpng14_voidp ptr) { - if (png_ptr == NULL || ptr == NULL) + if (modpng14_ptr == NULL || ptr == NULL) return; -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) +#ifdef MODPNG14_USER_MEM_SUPPORTED + if (modpng14_ptr->free_fn != NULL) { - (*(png_ptr->free_fn))(png_ptr, ptr); + (*(modpng14_ptr->free_fn))(modpng14_ptr, ptr); return; } - else png_free_default(png_ptr, ptr); + else modpng14_free_default(modpng14_ptr, ptr); } -void PNGAPI -png_free_default(png_structp png_ptr, png_voidp ptr) +void MODPNG14API +modpng14_free_default(modpng14_structp modpng14_ptr, modpng14_voidp ptr) { - if (png_ptr == NULL || ptr == NULL) + if (modpng14_ptr == NULL || ptr == NULL) return; -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ #if defined(__TURBOC__) && !defined(__FLAT__) farfree(ptr); @@ -494,73 +494,73 @@ #endif /* Not Borland DOS special memory handler */ -#if defined(PNG_1_0_X) -# define png_malloc_warn png_malloc +#if defined(MODPNG14_1_0_X) +# define modpng14_malloc_warn modpng14_malloc #else -/* This function was added at libpng version 1.2.3. The png_malloc_warn() - * function will issue a png_warning and return NULL instead of issuing a - * png_error, if it fails to allocate the requested memory. +/* This function was added at libmodpng14 version 1.2.3. The modpng14_malloc_warn() + * function will issue a modpng14_warning and return NULL instead of issuing a + * modpng14_error, if it fails to allocate the requested memory. */ -png_voidp PNGAPI -png_malloc_warn(png_structp png_ptr, png_uint_32 size) +modpng14_voidp MODPNG14API +modpng14_malloc_warn(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - png_voidp ptr; - png_uint_32 save_flags=png_ptr->flags; + modpng14_voidp ptr; + modpng14_uint_32 save_flags=modpng14_ptr->flags; - png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; - ptr = (png_voidp)png_malloc((png_structp)png_ptr, size); - png_ptr->flags=save_flags; + modpng14_ptr->flags|=MODPNG14_FLAG_MALLOC_NULL_MEM_OK; + ptr = (modpng14_voidp)modpng14_malloc((modpng14_structp)modpng14_ptr, size); + modpng14_ptr->flags=save_flags; return(ptr); } #endif -png_voidp PNGAPI -png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2, - png_uint_32 length) +modpng14_voidp MODPNG14API +modpng14_memcpy_check (modpng14_structp modpng14_ptr, modpng14_voidp s1, modpng14_voidp s2, + modpng14_uint_32 length) { - png_size_t size; + modpng14_size_t size; - size = (png_size_t)length; - if ((png_uint_32)size != length) - png_error(png_ptr,"Overflow in png_memcpy_check."); + size = (modpng14_size_t)length; + if ((modpng14_uint_32)size != length) + modpng14_error(modpng14_ptr,"Overflow in modpng14_memcpy_check."); - return(png_memcpy (s1, s2, size)); + return(modpng14_memcpy (s1, s2, size)); } -png_voidp PNGAPI -png_memset_check (png_structp png_ptr, png_voidp s1, int value, - png_uint_32 length) +modpng14_voidp MODPNG14API +modpng14_memset_check (modpng14_structp modpng14_ptr, modpng14_voidp s1, int value, + modpng14_uint_32 length) { - png_size_t size; + modpng14_size_t size; - size = (png_size_t)length; - if ((png_uint_32)size != length) - png_error(png_ptr,"Overflow in png_memset_check."); + size = (modpng14_size_t)length; + if ((modpng14_uint_32)size != length) + modpng14_error(modpng14_ptr,"Overflow in modpng14_memset_check."); - return (png_memset (s1, value, size)); + return (modpng14_memset (s1, value, size)); } -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_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; +void MODPNG14API +modpng14_set_mem_fn(modpng14_structp modpng14_ptr, modpng14_voidp mem_ptr, modpng14_malloc_ptr + malloc_fn, modpng14_free_ptr free_fn) +{ + modpng14_ptr->mem_ptr = mem_ptr; + modpng14_ptr->malloc_fn = malloc_fn; + modpng14_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. + * pointer before modpng14_write_destroy and modpng14_read_destroy are called. */ -png_voidp PNGAPI -png_get_mem_ptr(png_structp png_ptr) +modpng14_voidp MODPNG14API +modpng14_get_mem_ptr(modpng14_structp modpng14_ptr) { - return ((png_voidp)png_ptr->mem_ptr); + return ((modpng14_voidp)modpng14_ptr->mem_ptr); } -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngpread.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngpread.c @@ -1,38 +1,38 @@ /* pngpread.c - read a png file in push mode * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED /* push model modes */ -#define PNG_READ_SIG_MODE 0 -#define PNG_READ_CHUNK_MODE 1 -#define PNG_READ_IDAT_MODE 2 -#define PNG_SKIP_MODE 3 -#define PNG_READ_tEXt_MODE 4 -#define PNG_READ_zTXt_MODE 5 -#define PNG_READ_DONE_MODE 6 -#define PNG_READ_iTXt_MODE 7 -#define PNG_ERROR_MODE 8 - -void PNGAPI -png_process_data(png_structp png_ptr, png_infop info_ptr, - png_bytep buffer, png_size_t buffer_size) +#define MODPNG14_READ_SIG_MODE 0 +#define MODPNG14_READ_CHUNK_MODE 1 +#define MODPNG14_READ_IDAT_MODE 2 +#define MODPNG14_SKIP_MODE 3 +#define MODPNG14_READ_tEXt_MODE 4 +#define MODPNG14_READ_zTXt_MODE 5 +#define MODPNG14_READ_DONE_MODE 6 +#define MODPNG14_READ_iTXt_MODE 7 +#define MODPNG14_ERROR_MODE 8 + +void MODPNG14API +modpng14_process_data(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_bytep buffer, modpng14_size_t buffer_size) { - png_push_restore_buffer(png_ptr, buffer, buffer_size); + modpng14_push_restore_buffer(modpng14_ptr, buffer, buffer_size); - while (png_ptr->buffer_size) + while (modpng14_ptr->buffer_size) { - png_process_some_data(png_ptr, info_ptr); + modpng14_process_some_data(modpng14_ptr, info_ptr); } } @@ -40,54 +40,54 @@ * doing before we ran out of data... */ void /* PRIVATE */ -png_process_some_data(png_structp png_ptr, png_infop info_ptr) +modpng14_process_some_data(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - switch (png_ptr->process_mode) + switch (modpng14_ptr->process_mode) { - case PNG_READ_SIG_MODE: + case MODPNG14_READ_SIG_MODE: { - png_push_read_sig(png_ptr, info_ptr); + modpng14_push_read_sig(modpng14_ptr, info_ptr); break; } - case PNG_READ_CHUNK_MODE: + case MODPNG14_READ_CHUNK_MODE: { - png_push_read_chunk(png_ptr, info_ptr); + modpng14_push_read_chunk(modpng14_ptr, info_ptr); break; } - case PNG_READ_IDAT_MODE: + case MODPNG14_READ_IDAT_MODE: { - png_push_read_IDAT(png_ptr); + modpng14_push_read_IDAT(modpng14_ptr); break; } -#if defined(PNG_READ_tEXt_SUPPORTED) - case PNG_READ_tEXt_MODE: +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + case MODPNG14_READ_tEXt_MODE: { - png_push_read_tEXt(png_ptr, info_ptr); + modpng14_push_read_tEXt(modpng14_ptr, info_ptr); break; } #endif -#if defined(PNG_READ_zTXt_SUPPORTED) - case PNG_READ_zTXt_MODE: +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + case MODPNG14_READ_zTXt_MODE: { - png_push_read_zTXt(png_ptr, info_ptr); + modpng14_push_read_zTXt(modpng14_ptr, info_ptr); break; } #endif -#if defined(PNG_READ_iTXt_SUPPORTED) - case PNG_READ_iTXt_MODE: +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + case MODPNG14_READ_iTXt_MODE: { - png_push_read_iTXt(png_ptr, info_ptr); + modpng14_push_read_iTXt(modpng14_ptr, info_ptr); break; } #endif - case PNG_SKIP_MODE: + case MODPNG14_SKIP_MODE: { - png_push_crc_finish(png_ptr); + modpng14_push_crc_finish(modpng14_ptr); break; } default: { - png_ptr->buffer_size = 0; + modpng14_ptr->buffer_size = 0; break; } } @@ -100,673 +100,673 @@ * routine. */ void /* PRIVATE */ -png_push_read_sig(png_structp png_ptr, png_infop info_ptr) +modpng14_push_read_sig(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_size_t num_checked = png_ptr->sig_bytes, + modpng14_size_t num_checked = modpng14_ptr->sig_bytes, num_to_check = 8 - num_checked; - if (png_ptr->buffer_size < num_to_check) + if (modpng14_ptr->buffer_size < num_to_check) { - num_to_check = png_ptr->buffer_size; + num_to_check = modpng14_ptr->buffer_size; } - png_push_fill_buffer(png_ptr, &(info_ptr->signature[num_checked]), + modpng14_push_fill_buffer(modpng14_ptr, &(info_ptr->signature[num_checked]), num_to_check); - png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes+num_to_check); + modpng14_ptr->sig_bytes = (modpng14_byte)(modpng14_ptr->sig_bytes+num_to_check); - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) + if (modpng14_sig_cmp(info_ptr->signature, num_checked, num_to_check)) { if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); + modpng14_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) + modpng14_error(modpng14_ptr, "Not a PNG file"); else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); + modpng14_error(modpng14_ptr, "PNG file corrupted by ASCII conversion"); } else { - if (png_ptr->sig_bytes >= 8) + if (modpng14_ptr->sig_bytes >= 8) { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; + modpng14_ptr->process_mode = MODPNG14_READ_CHUNK_MODE; } } } void /* PRIVATE */ -png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) +modpng14_push_read_chunk(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_bKGD; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IHDR; + MODPNG14_IDAT; + MODPNG14_IEND; + MODPNG14_PLTE; +#if defined(MODPNG14_READ_bKGD_SUPPORTED) + MODPNG14_bKGD; #endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_cHRM; +#if defined(MODPNG14_READ_cHRM_SUPPORTED) + MODPNG14_cHRM; #endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_gAMA; +#if defined(MODPNG14_READ_gAMA_SUPPORTED) + MODPNG14_gAMA; #endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_hIST; +#if defined(MODPNG14_READ_hIST_SUPPORTED) + MODPNG14_hIST; #endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_iCCP; +#if defined(MODPNG14_READ_iCCP_SUPPORTED) + MODPNG14_iCCP; #endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_iTXt; +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + MODPNG14_iTXt; #endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_oFFs; +#if defined(MODPNG14_READ_oFFs_SUPPORTED) + MODPNG14_oFFs; #endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_pCAL; +#if defined(MODPNG14_READ_pCAL_SUPPORTED) + MODPNG14_pCAL; #endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_pHYs; +#if defined(MODPNG14_READ_pHYs_SUPPORTED) + MODPNG14_pHYs; #endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_sBIT; +#if defined(MODPNG14_READ_sBIT_SUPPORTED) + MODPNG14_sBIT; #endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_sCAL; +#if defined(MODPNG14_READ_sCAL_SUPPORTED) + MODPNG14_sCAL; #endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_sRGB; +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + MODPNG14_sRGB; #endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_sPLT; +#if defined(MODPNG14_READ_sPLT_SUPPORTED) + MODPNG14_sPLT; #endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_tEXt; +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + MODPNG14_tEXt; #endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_tIME; +#if defined(MODPNG14_READ_tIME_SUPPORTED) + MODPNG14_tIME; #endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_tRNS; +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + MODPNG14_tRNS; #endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_zTXt; +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + MODPNG14_zTXt; #endif -#endif /* PNG_USE_LOCAL_ARRAYS */ +#endif /* MODPNG14_USE_LOCAL_ARRAYS */ /* First we make sure we have enough data for the 4 byte chunk name * and the 4 byte chunk length before proceeding with decoding the * chunk data. To fully decode each of these chunks, we also make * sure we have enough data in the buffer for the 4 byte CRC at the * end of every chunk (except IDAT, which is handled separately). */ - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_CHUNK_HEADER)) { - png_byte chunk_length[4]; + modpng14_byte chunk_length[4]; - if (png_ptr->buffer_size < 8) + if (modpng14_ptr->buffer_size < 8) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; + modpng14_push_fill_buffer(modpng14_ptr, chunk_length, 4); + modpng14_ptr->push_length = modpng14_get_uint_31(modpng14_ptr,chunk_length); + modpng14_reset_crc(modpng14_ptr); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->chunk_name, 4); + modpng14_ptr->mode |= MODPNG14_HAVE_CHUNK_HEADER; } - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IHDR, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_IHDR(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_PLTE, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_PLTE(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } - else if (!png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, (modpng14_bytep)modpng14_IDAT, 4)) { /* If we reach an IDAT chunk, this means we have read all of the * header chunks, and we can start reading the image (or if this * is called after the image has been read - we have an error). */ - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before IDAT"); + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE && + !(modpng14_ptr->mode & MODPNG14_HAVE_PLTE)) + modpng14_error(modpng14_ptr, "Missing PLTE before IDAT"); - if (png_ptr->mode & PNG_HAVE_IDAT) + if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - if (png_ptr->push_length == 0) + if (modpng14_ptr->push_length == 0) return; - if (png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); + if (modpng14_ptr->mode & MODPNG14_AFTER_IDAT) + modpng14_error(modpng14_ptr, "Too many IDAT's found"); } - png_ptr->idat_size = png_ptr->push_length; - png_ptr->mode |= PNG_HAVE_IDAT; - png_ptr->process_mode = PNG_READ_IDAT_MODE; - png_push_have_info(png_ptr, info_ptr); - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - png_ptr->zstream.next_out = png_ptr->row_buf; + modpng14_ptr->idat_size = modpng14_ptr->push_length; + modpng14_ptr->mode |= MODPNG14_HAVE_IDAT; + modpng14_ptr->process_mode = MODPNG14_READ_IDAT_MODE; + modpng14_push_have_info(modpng14_ptr, info_ptr); + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->irowbytes; + modpng14_ptr->zstream.next_out = modpng14_ptr->row_buf; return; } - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IEND, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_IEND(modpng14_ptr, info_ptr, modpng14_ptr->push_length); - png_ptr->process_mode = PNG_READ_DONE_MODE; - png_push_have_end(png_ptr, info_ptr); + modpng14_ptr->process_mode = MODPNG14_READ_DONE_MODE; + modpng14_push_have_end(modpng14_ptr, info_ptr); } -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) +#if defined(MODPNG14_READ_gAMA_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_gAMA, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_gAMA(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) +#if defined(MODPNG14_READ_sBIT_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sBIT, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_sBIT(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) +#if defined(MODPNG14_READ_cHRM_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_cHRM, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_cHRM(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sRGB, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_sRGB(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) +#if defined(MODPNG14_READ_iCCP_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_iCCP, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_iCCP(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) +#if defined(MODPNG14_READ_sPLT_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sPLT, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_sPLT(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tRNS, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_tRNS(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) +#if defined(MODPNG14_READ_bKGD_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_bKGD, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_bKGD(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) +#if defined(MODPNG14_READ_hIST_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_hIST, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_hIST(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) +#if defined(MODPNG14_READ_pHYs_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_pHYs, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_pHYs(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) +#if defined(MODPNG14_READ_oFFs_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_oFFs, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_oFFs(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) +#if defined(MODPNG14_READ_pCAL_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_pCAL, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_pCAL(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) +#if defined(MODPNG14_READ_sCAL_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sCAL, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_sCAL(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) +#if defined(MODPNG14_READ_tIME_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tIME, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length); + modpng14_handle_tIME(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tEXt, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); + modpng14_push_handle_tEXt(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_zTXt, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); + modpng14_push_handle_zTXt(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_iTXt, 4)) { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); + modpng14_push_handle_iTXt(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } #endif else { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) + if (modpng14_ptr->push_length + 4 > modpng14_ptr->buffer_size) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); + modpng14_push_handle_unknown(modpng14_ptr, info_ptr, modpng14_ptr->push_length); } - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; + modpng14_ptr->mode &= ~MODPNG14_HAVE_CHUNK_HEADER; } void /* PRIVATE */ -png_push_crc_skip(png_structp png_ptr, png_uint_32 skip) +modpng14_push_crc_skip(modpng14_structp modpng14_ptr, modpng14_uint_32 skip) { - png_ptr->process_mode = PNG_SKIP_MODE; - png_ptr->skip_length = skip; + modpng14_ptr->process_mode = MODPNG14_SKIP_MODE; + modpng14_ptr->skip_length = skip; } void /* PRIVATE */ -png_push_crc_finish(png_structp png_ptr) +modpng14_push_crc_finish(modpng14_structp modpng14_ptr) { - if (png_ptr->skip_length && png_ptr->save_buffer_size) + if (modpng14_ptr->skip_length && modpng14_ptr->save_buffer_size) { - png_size_t save_size; + modpng14_size_t save_size; - if (png_ptr->skip_length < (png_uint_32)png_ptr->save_buffer_size) - save_size = (png_size_t)png_ptr->skip_length; + if (modpng14_ptr->skip_length < (modpng14_uint_32)modpng14_ptr->save_buffer_size) + save_size = (modpng14_size_t)modpng14_ptr->skip_length; else - save_size = png_ptr->save_buffer_size; + save_size = modpng14_ptr->save_buffer_size; - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); + modpng14_calculate_crc(modpng14_ptr, modpng14_ptr->save_buffer_ptr, save_size); - png_ptr->skip_length -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; + modpng14_ptr->skip_length -= save_size; + modpng14_ptr->buffer_size -= save_size; + modpng14_ptr->save_buffer_size -= save_size; + modpng14_ptr->save_buffer_ptr += save_size; } - if (png_ptr->skip_length && png_ptr->current_buffer_size) + if (modpng14_ptr->skip_length && modpng14_ptr->current_buffer_size) { - png_size_t save_size; + modpng14_size_t save_size; - if (png_ptr->skip_length < (png_uint_32)png_ptr->current_buffer_size) - save_size = (png_size_t)png_ptr->skip_length; + if (modpng14_ptr->skip_length < (modpng14_uint_32)modpng14_ptr->current_buffer_size) + save_size = (modpng14_size_t)modpng14_ptr->skip_length; else - save_size = png_ptr->current_buffer_size; + save_size = modpng14_ptr->current_buffer_size; - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); + modpng14_calculate_crc(modpng14_ptr, modpng14_ptr->current_buffer_ptr, save_size); - png_ptr->skip_length -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; + modpng14_ptr->skip_length -= save_size; + modpng14_ptr->buffer_size -= save_size; + modpng14_ptr->current_buffer_size -= save_size; + modpng14_ptr->current_buffer_ptr += save_size; } - if (!png_ptr->skip_length) + if (!modpng14_ptr->skip_length) { - if (png_ptr->buffer_size < 4) + if (modpng14_ptr->buffer_size < 4) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_crc_finish(png_ptr, 0); - png_ptr->process_mode = PNG_READ_CHUNK_MODE; + modpng14_crc_finish(modpng14_ptr, 0); + modpng14_ptr->process_mode = MODPNG14_READ_CHUNK_MODE; } } -void PNGAPI -png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) +void MODPNG14API +modpng14_push_fill_buffer(modpng14_structp modpng14_ptr, modpng14_bytep buffer, modpng14_size_t length) { - png_bytep ptr; + modpng14_bytep ptr; ptr = buffer; - if (png_ptr->save_buffer_size) + if (modpng14_ptr->save_buffer_size) { - png_size_t save_size; + modpng14_size_t save_size; - if (length < png_ptr->save_buffer_size) + if (length < modpng14_ptr->save_buffer_size) save_size = length; else - save_size = png_ptr->save_buffer_size; + save_size = modpng14_ptr->save_buffer_size; - png_memcpy(ptr, png_ptr->save_buffer_ptr, save_size); + modpng14_memcpy(ptr, modpng14_ptr->save_buffer_ptr, save_size); length -= save_size; ptr += save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; + modpng14_ptr->buffer_size -= save_size; + modpng14_ptr->save_buffer_size -= save_size; + modpng14_ptr->save_buffer_ptr += save_size; } - if (length && png_ptr->current_buffer_size) + if (length && modpng14_ptr->current_buffer_size) { - png_size_t save_size; + modpng14_size_t save_size; - if (length < png_ptr->current_buffer_size) + if (length < modpng14_ptr->current_buffer_size) save_size = length; else - save_size = png_ptr->current_buffer_size; + save_size = modpng14_ptr->current_buffer_size; - png_memcpy(ptr, png_ptr->current_buffer_ptr, save_size); - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; + modpng14_memcpy(ptr, modpng14_ptr->current_buffer_ptr, save_size); + modpng14_ptr->buffer_size -= save_size; + modpng14_ptr->current_buffer_size -= save_size; + modpng14_ptr->current_buffer_ptr += save_size; } } void /* PRIVATE */ -png_push_save_buffer(png_structp png_ptr) +modpng14_push_save_buffer(modpng14_structp modpng14_ptr) { - if (png_ptr->save_buffer_size) + if (modpng14_ptr->save_buffer_size) { - if (png_ptr->save_buffer_ptr != png_ptr->save_buffer) + if (modpng14_ptr->save_buffer_ptr != modpng14_ptr->save_buffer) { - png_size_t i,istop; - png_bytep sp; - png_bytep dp; + modpng14_size_t i,istop; + modpng14_bytep sp; + modpng14_bytep dp; - istop = png_ptr->save_buffer_size; - for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer; + istop = modpng14_ptr->save_buffer_size; + for (i = 0, sp = modpng14_ptr->save_buffer_ptr, dp = modpng14_ptr->save_buffer; i < istop; i++, sp++, dp++) { *dp = *sp; } } } - if (png_ptr->save_buffer_size + png_ptr->current_buffer_size > - png_ptr->save_buffer_max) + if (modpng14_ptr->save_buffer_size + modpng14_ptr->current_buffer_size > + modpng14_ptr->save_buffer_max) { - png_size_t new_max; - png_bytep old_buffer; + modpng14_size_t new_max; + modpng14_bytep old_buffer; - if (png_ptr->save_buffer_size > PNG_SIZE_MAX - - (png_ptr->current_buffer_size + 256)) + if (modpng14_ptr->save_buffer_size > MODPNG14_SIZE_MAX - + (modpng14_ptr->current_buffer_size + 256)) { - png_error(png_ptr, "Potential overflow of save_buffer"); + modpng14_error(modpng14_ptr, "Potential overflow of save_buffer"); } - new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256; - old_buffer = png_ptr->save_buffer; - png_ptr->save_buffer = (png_bytep)png_malloc(png_ptr, - (png_uint_32)new_max); - png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); - png_free(png_ptr, old_buffer); - png_ptr->save_buffer_max = new_max; + new_max = modpng14_ptr->save_buffer_size + modpng14_ptr->current_buffer_size + 256; + old_buffer = modpng14_ptr->save_buffer; + modpng14_ptr->save_buffer = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)new_max); + modpng14_memcpy(modpng14_ptr->save_buffer, old_buffer, modpng14_ptr->save_buffer_size); + modpng14_free(modpng14_ptr, old_buffer); + modpng14_ptr->save_buffer_max = new_max; } - if (png_ptr->current_buffer_size) + if (modpng14_ptr->current_buffer_size) { - png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size, - png_ptr->current_buffer_ptr, png_ptr->current_buffer_size); - png_ptr->save_buffer_size += png_ptr->current_buffer_size; - png_ptr->current_buffer_size = 0; + modpng14_memcpy(modpng14_ptr->save_buffer + modpng14_ptr->save_buffer_size, + modpng14_ptr->current_buffer_ptr, modpng14_ptr->current_buffer_size); + modpng14_ptr->save_buffer_size += modpng14_ptr->current_buffer_size; + modpng14_ptr->current_buffer_size = 0; } - png_ptr->save_buffer_ptr = png_ptr->save_buffer; - png_ptr->buffer_size = 0; + modpng14_ptr->save_buffer_ptr = modpng14_ptr->save_buffer; + modpng14_ptr->buffer_size = 0; } void /* PRIVATE */ -png_push_restore_buffer(png_structp png_ptr, png_bytep buffer, - png_size_t buffer_length) +modpng14_push_restore_buffer(modpng14_structp modpng14_ptr, modpng14_bytep buffer, + modpng14_size_t buffer_length) { - png_ptr->current_buffer = buffer; - png_ptr->current_buffer_size = buffer_length; - png_ptr->buffer_size = buffer_length + png_ptr->save_buffer_size; - png_ptr->current_buffer_ptr = png_ptr->current_buffer; + modpng14_ptr->current_buffer = buffer; + modpng14_ptr->current_buffer_size = buffer_length; + modpng14_ptr->buffer_size = buffer_length + modpng14_ptr->save_buffer_size; + modpng14_ptr->current_buffer_ptr = modpng14_ptr->current_buffer; } void /* PRIVATE */ -png_push_read_IDAT(png_structp png_ptr) +modpng14_push_read_IDAT(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IDAT; #endif - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_CHUNK_HEADER)) { - png_byte chunk_length[4]; + modpng14_byte chunk_length[4]; - if (png_ptr->buffer_size < 8) + if (modpng14_ptr->buffer_size < 8) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; + modpng14_push_fill_buffer(modpng14_ptr, chunk_length, 4); + modpng14_ptr->push_length = modpng14_get_uint_31(modpng14_ptr,chunk_length); + modpng14_reset_crc(modpng14_ptr); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->chunk_name, 4); + modpng14_ptr->mode |= MODPNG14_HAVE_CHUNK_HEADER; - if (png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) + if (modpng14_memcmp(modpng14_ptr->chunk_name, (modpng14_bytep)modpng14_IDAT, 4)) { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_error(png_ptr, "Not enough compressed data"); + modpng14_ptr->process_mode = MODPNG14_READ_CHUNK_MODE; + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_FINISHED)) + modpng14_error(modpng14_ptr, "Not enough compressed data"); return; } - png_ptr->idat_size = png_ptr->push_length; + modpng14_ptr->idat_size = modpng14_ptr->push_length; } - if (png_ptr->idat_size && png_ptr->save_buffer_size) + if (modpng14_ptr->idat_size && modpng14_ptr->save_buffer_size) { - png_size_t save_size; + modpng14_size_t save_size; - if (png_ptr->idat_size < (png_uint_32)png_ptr->save_buffer_size) + if (modpng14_ptr->idat_size < (modpng14_uint_32)modpng14_ptr->save_buffer_size) { - save_size = (png_size_t)png_ptr->idat_size; + save_size = (modpng14_size_t)modpng14_ptr->idat_size; /* check for overflow */ - if((png_uint_32)save_size != png_ptr->idat_size) - png_error(png_ptr, "save_size overflowed in pngpread"); + if((modpng14_uint_32)save_size != modpng14_ptr->idat_size) + modpng14_error(modpng14_ptr, "save_size overflowed in pngpread"); } else - save_size = png_ptr->save_buffer_size; + save_size = modpng14_ptr->save_buffer_size; - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size); - png_ptr->idat_size -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; + modpng14_calculate_crc(modpng14_ptr, modpng14_ptr->save_buffer_ptr, save_size); + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_FINISHED)) + modpng14_process_IDAT_data(modpng14_ptr, modpng14_ptr->save_buffer_ptr, save_size); + modpng14_ptr->idat_size -= save_size; + modpng14_ptr->buffer_size -= save_size; + modpng14_ptr->save_buffer_size -= save_size; + modpng14_ptr->save_buffer_ptr += save_size; } - if (png_ptr->idat_size && png_ptr->current_buffer_size) + if (modpng14_ptr->idat_size && modpng14_ptr->current_buffer_size) { - png_size_t save_size; + modpng14_size_t save_size; - if (png_ptr->idat_size < (png_uint_32)png_ptr->current_buffer_size) + if (modpng14_ptr->idat_size < (modpng14_uint_32)modpng14_ptr->current_buffer_size) { - save_size = (png_size_t)png_ptr->idat_size; + save_size = (modpng14_size_t)modpng14_ptr->idat_size; /* check for overflow */ - if((png_uint_32)save_size != png_ptr->idat_size) - png_error(png_ptr, "save_size overflowed in pngpread"); + if((modpng14_uint_32)save_size != modpng14_ptr->idat_size) + modpng14_error(modpng14_ptr, "save_size overflowed in pngpread"); } else - save_size = png_ptr->current_buffer_size; + save_size = modpng14_ptr->current_buffer_size; - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size); + modpng14_calculate_crc(modpng14_ptr, modpng14_ptr->current_buffer_ptr, save_size); + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_FINISHED)) + modpng14_process_IDAT_data(modpng14_ptr, modpng14_ptr->current_buffer_ptr, save_size); - png_ptr->idat_size -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; + modpng14_ptr->idat_size -= save_size; + modpng14_ptr->buffer_size -= save_size; + modpng14_ptr->current_buffer_size -= save_size; + modpng14_ptr->current_buffer_ptr += save_size; } - if (!png_ptr->idat_size) + if (!modpng14_ptr->idat_size) { - if (png_ptr->buffer_size < 4) + if (modpng14_ptr->buffer_size < 4) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_crc_finish(png_ptr, 0); - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; - png_ptr->mode |= PNG_AFTER_IDAT; + modpng14_crc_finish(modpng14_ptr, 0); + modpng14_ptr->mode &= ~MODPNG14_HAVE_CHUNK_HEADER; + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; } } void /* PRIVATE */ -png_process_IDAT_data(png_structp png_ptr, png_bytep buffer, - png_size_t buffer_length) +modpng14_process_IDAT_data(modpng14_structp modpng14_ptr, modpng14_bytep buffer, + modpng14_size_t buffer_length) { int ret; - if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length) - png_error(png_ptr, "Extra compression data"); + if ((modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_FINISHED) && buffer_length) + modpng14_error(modpng14_ptr, "Extra compression data"); - png_ptr->zstream.next_in = buffer; - png_ptr->zstream.avail_in = (uInt)buffer_length; + modpng14_ptr->zstream.next_in = buffer; + modpng14_ptr->zstream.avail_in = (uInt)buffer_length; for(;;) { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); + ret = inflate(&modpng14_ptr->zstream, Z_PARTIAL_FLUSH); if (ret != Z_OK) { if (ret == Z_STREAM_END) { - if (png_ptr->zstream.avail_in) - png_error(png_ptr, "Extra compressed data"); - if (!(png_ptr->zstream.avail_out)) + if (modpng14_ptr->zstream.avail_in) + modpng14_error(modpng14_ptr, "Extra compressed data"); + if (!(modpng14_ptr->zstream.avail_out)) { - png_push_process_row(png_ptr); + modpng14_push_process_row(modpng14_ptr); } - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_FINISHED; break; } else if (ret == Z_BUF_ERROR) break; else - png_error(png_ptr, "Decompression Error"); + modpng14_error(modpng14_ptr, "Decompression Error"); } - if (!(png_ptr->zstream.avail_out)) + if (!(modpng14_ptr->zstream.avail_out)) { if (( -#if defined(PNG_READ_INTERLACING_SUPPORTED) - png_ptr->interlaced && png_ptr->pass > 6) || - (!png_ptr->interlaced && +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) + modpng14_ptr->interlaced && modpng14_ptr->pass > 6) || + (!modpng14_ptr->interlaced && #endif - png_ptr->row_number == png_ptr->num_rows-1)) + modpng14_ptr->row_number == modpng14_ptr->num_rows-1)) { - if (png_ptr->zstream.avail_in) - png_warning(png_ptr, "Too much data in IDAT chunks"); - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; + if (modpng14_ptr->zstream.avail_in) + modpng14_warning(modpng14_ptr, "Too much data in IDAT chunks"); + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_FINISHED; break; } - png_push_process_row(png_ptr); - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - png_ptr->zstream.next_out = png_ptr->row_buf; + modpng14_push_process_row(modpng14_ptr); + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->irowbytes; + modpng14_ptr->zstream.next_out = modpng14_ptr->row_buf; } else break; @@ -774,85 +774,85 @@ } void /* PRIVATE */ -png_push_process_row(png_structp png_ptr) +modpng14_push_process_row(modpng14_structp modpng14_ptr) { - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; + modpng14_ptr->row_info.color_type = modpng14_ptr->color_type; + modpng14_ptr->row_info.width = modpng14_ptr->iwidth; + modpng14_ptr->row_info.channels = modpng14_ptr->channels; + modpng14_ptr->row_info.bit_depth = modpng14_ptr->bit_depth; + modpng14_ptr->row_info.pixel_depth = modpng14_ptr->pixel_depth; - png_ptr->row_info.rowbytes = ((png_ptr->row_info.width * - (png_uint_32)png_ptr->row_info.pixel_depth + 7) >> 3); + modpng14_ptr->row_info.rowbytes = ((modpng14_ptr->row_info.width * + (modpng14_uint_32)modpng14_ptr->row_info.pixel_depth + 7) >> 3); - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); + modpng14_read_filter_row(modpng14_ptr, &(modpng14_ptr->row_info), + modpng14_ptr->row_buf + 1, modpng14_ptr->prev_row + 1, + (int)(modpng14_ptr->row_buf[0])); - png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, - png_ptr->rowbytes + 1); + modpng14_memcpy_check(modpng14_ptr, modpng14_ptr->prev_row, modpng14_ptr->row_buf, + modpng14_ptr->rowbytes + 1); - if (png_ptr->transformations) - png_do_read_transformations(png_ptr); + if (modpng14_ptr->transformations) + modpng14_do_read_transformations(modpng14_ptr); -#if defined(PNG_READ_INTERLACING_SUPPORTED) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) /* blow up interlaced rows to full size */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) + if (modpng14_ptr->interlaced && (modpng14_ptr->transformations & MODPNG14_INTERLACE)) { - if (png_ptr->pass < 6) + if (modpng14_ptr->pass < 6) /* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); + modpng14_do_read_interlace(&(modpng14_ptr->row_info), + modpng14_ptr->row_buf + 1, modpng14_ptr->pass, modpng14_ptr->transformations); */ - png_do_read_interlace(png_ptr); + modpng14_do_read_interlace(modpng14_ptr); - switch (png_ptr->pass) + switch (modpng14_ptr->pass) { case 0: { int i; - for (i = 0; i < 8 && png_ptr->pass == 0; i++) + for (i = 0; i < 8 && modpng14_ptr->pass == 0; i++) { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); /* updates png_ptr->pass */ + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); /* updates modpng14_ptr->pass */ } - if (png_ptr->pass == 2) /* pass 1 might be empty */ + if (modpng14_ptr->pass == 2) /* pass 1 might be empty */ { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) + for (i = 0; i < 4 && modpng14_ptr->pass == 2; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } } - if (png_ptr->pass == 4 && png_ptr->height <= 4) + if (modpng14_ptr->pass == 4 && modpng14_ptr->height <= 4) { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) + for (i = 0; i < 2 && modpng14_ptr->pass == 4; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } } - if (png_ptr->pass == 6 && png_ptr->height <= 4) + if (modpng14_ptr->pass == 6 && modpng14_ptr->height <= 4) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } break; } case 1: { int i; - for (i = 0; i < 8 && png_ptr->pass == 1; i++) + for (i = 0; i < 8 && modpng14_ptr->pass == 1; i++) { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); } - if (png_ptr->pass == 2) /* skip top 4 generated rows */ + if (modpng14_ptr->pass == 2) /* skip top 4 generated rows */ { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) + for (i = 0; i < 4 && modpng14_ptr->pass == 2; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } } break; @@ -860,22 +860,22 @@ case 2: { int i; - for (i = 0; i < 4 && png_ptr->pass == 2; i++) + for (i = 0; i < 4 && modpng14_ptr->pass == 2; i++) { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); } - for (i = 0; i < 4 && png_ptr->pass == 2; i++) + for (i = 0; i < 4 && modpng14_ptr->pass == 2; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } - if (png_ptr->pass == 4) /* pass 3 might be empty */ + if (modpng14_ptr->pass == 4) /* pass 3 might be empty */ { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) + for (i = 0; i < 2 && modpng14_ptr->pass == 4; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } } break; @@ -883,17 +883,17 @@ case 3: { int i; - for (i = 0; i < 4 && png_ptr->pass == 3; i++) + for (i = 0; i < 4 && modpng14_ptr->pass == 3; i++) { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); } - if (png_ptr->pass == 4) /* skip top two generated rows */ + if (modpng14_ptr->pass == 4) /* skip top two generated rows */ { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) + for (i = 0; i < 2 && modpng14_ptr->pass == 4; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } } break; @@ -901,369 +901,369 @@ case 4: { int i; - for (i = 0; i < 2 && png_ptr->pass == 4; i++) + for (i = 0; i < 2 && modpng14_ptr->pass == 4; i++) { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); } - for (i = 0; i < 2 && png_ptr->pass == 4; i++) + for (i = 0; i < 2 && modpng14_ptr->pass == 4; i++) { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } - if (png_ptr->pass == 6) /* pass 5 might be empty */ + if (modpng14_ptr->pass == 6) /* pass 5 might be empty */ { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } break; } case 5: { int i; - for (i = 0; i < 2 && png_ptr->pass == 5; i++) + for (i = 0; i < 2 && modpng14_ptr->pass == 5; i++) { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); } - if (png_ptr->pass == 6) /* skip top generated row */ + if (modpng14_ptr->pass == 6) /* skip top generated row */ { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } break; } case 6: { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - if (png_ptr->pass != 6) + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); + if (modpng14_ptr->pass != 6) break; - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_bytep_NULL); + modpng14_read_push_finish_row(modpng14_ptr); } } } else #endif { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); + modpng14_push_have_row(modpng14_ptr, modpng14_ptr->row_buf + 1); + modpng14_read_push_finish_row(modpng14_ptr); } } void /* PRIVATE */ -png_read_push_finish_row(png_structp png_ptr) +modpng14_read_push_finish_row(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* 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}; + const int FARDATA modpng14_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}; + const int FARDATA modpng14_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}; + const int FARDATA modpng14_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}; + const int FARDATA modpng14_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; /* Width of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h - const int FARDATA png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; + * it, uncomment it here and in modpng14.h + const int FARDATA modpng14_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ /* 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}; + * it, uncomment it here and in modpng14.h + const int FARDATA modpng14_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; */ #endif - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) + modpng14_ptr->row_number++; + if (modpng14_ptr->row_number < modpng14_ptr->num_rows) return; - if (png_ptr->interlaced) + if (modpng14_ptr->interlaced) { - png_ptr->row_number = 0; - png_memset_check(png_ptr, png_ptr->prev_row, 0, - png_ptr->rowbytes + 1); + modpng14_ptr->row_number = 0; + modpng14_memset_check(modpng14_ptr, modpng14_ptr->prev_row, 0, + modpng14_ptr->rowbytes + 1); do { - png_ptr->pass++; - if ((png_ptr->pass == 1 && png_ptr->width < 5) || - (png_ptr->pass == 3 && png_ptr->width < 3) || - (png_ptr->pass == 5 && png_ptr->width < 2)) - png_ptr->pass++; - - if (png_ptr->pass > 7) - png_ptr->pass--; - if (png_ptr->pass >= 7) + modpng14_ptr->pass++; + if ((modpng14_ptr->pass == 1 && modpng14_ptr->width < 5) || + (modpng14_ptr->pass == 3 && modpng14_ptr->width < 3) || + (modpng14_ptr->pass == 5 && modpng14_ptr->width < 2)) + modpng14_ptr->pass++; + + if (modpng14_ptr->pass > 7) + modpng14_ptr->pass--; + if (modpng14_ptr->pass >= 7) break; - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; + modpng14_ptr->iwidth = (modpng14_ptr->width + + modpng14_pass_inc[modpng14_ptr->pass] - 1 - + modpng14_pass_start[modpng14_ptr->pass]) / + modpng14_pass_inc[modpng14_ptr->pass]; - png_ptr->irowbytes = ((png_ptr->iwidth * - png_ptr->pixel_depth + 7) >> 3) + 1; + modpng14_ptr->irowbytes = ((modpng14_ptr->iwidth * + modpng14_ptr->pixel_depth + 7) >> 3) + 1; - if (png_ptr->transformations & PNG_INTERLACE) + if (modpng14_ptr->transformations & MODPNG14_INTERLACE) break; - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; + modpng14_ptr->num_rows = (modpng14_ptr->height + + modpng14_pass_yinc[modpng14_ptr->pass] - 1 - + modpng14_pass_ystart[modpng14_ptr->pass]) / + modpng14_pass_yinc[modpng14_ptr->pass]; - } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0); + } while (modpng14_ptr->iwidth == 0 || modpng14_ptr->num_rows == 0); } } -#if defined(PNG_READ_tEXt_SUPPORTED) +#if defined(MODPNG14_READ_tEXt_SUPPORTED) void /* PRIVATE */ -png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 +modpng14_push_handle_tEXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR) || (modpng14_ptr->mode & MODPNG14_HAVE_IEND)) { - png_error(png_ptr, "Out of place tEXt"); + modpng14_error(modpng14_ptr, "Out of place tEXt"); /* to quiet some compiler warnings */ if(info_ptr == NULL) return; } -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ +#ifdef MODPNG14_MAX_MALLOC_64K + modpng14_ptr->skip_length = 0; /* This may not be necessary */ - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ + if (length > (modpng14_uint_32)65535L) /* Can't hold entire string in memory */ { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "tEXt chunk too large to fit in memory"); + modpng14_ptr->skip_length = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length+1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_tEXt_MODE; + modpng14_ptr->current_text = (modpng14_charp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(length+1)); + modpng14_ptr->current_text[length] = '\0'; + modpng14_ptr->current_text_ptr = modpng14_ptr->current_text; + modpng14_ptr->current_text_size = (modpng14_size_t)length; + modpng14_ptr->current_text_left = (modpng14_size_t)length; + modpng14_ptr->process_mode = MODPNG14_READ_tEXt_MODE; } void /* PRIVATE */ -png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr) +modpng14_push_read_tEXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr->buffer_size && png_ptr->current_text_left) + if (modpng14_ptr->buffer_size && modpng14_ptr->current_text_left) { - png_size_t text_size; + modpng14_size_t text_size; - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; + if (modpng14_ptr->buffer_size < modpng14_ptr->current_text_left) + text_size = modpng14_ptr->buffer_size; else - text_size = png_ptr->current_text_left; - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; + text_size = modpng14_ptr->current_text_left; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)modpng14_ptr->current_text_ptr, text_size); + modpng14_ptr->current_text_left -= text_size; + modpng14_ptr->current_text_ptr += text_size; + } + if (!(modpng14_ptr->current_text_left)) + { + modpng14_textp text_ptr; + modpng14_charp text; + modpng14_charp key; int ret; - if (png_ptr->buffer_size < 4) + if (modpng14_ptr->buffer_size < 4) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_crc_finish(png_ptr); + modpng14_push_crc_finish(modpng14_ptr); -#if defined(PNG_MAX_MALLOC_64K) - if (png_ptr->skip_length) +#if defined(MODPNG14_MAX_MALLOC_64K) + if (modpng14_ptr->skip_length) return; #endif - key = png_ptr->current_text; + key = modpng14_ptr->current_text; for (text = key; *text; text++) /* empty loop */ ; - if (text != key + png_ptr->current_text_size) + if (text != key + modpng14_ptr->current_text_size) text++; - text_ptr = (png_textp)png_malloc(png_ptr, (png_uint_32)sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr = (modpng14_textp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)sizeof(modpng14_text)); + text_ptr->compression = MODPNG14_TEXT_COMPRESSION_NONE; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; #endif text_ptr->text = text; - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); + ret = modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, 1); - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - png_ptr->current_text = NULL; + modpng14_free(modpng14_ptr, key); + modpng14_free(modpng14_ptr, text_ptr); + modpng14_ptr->current_text = NULL; if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk."); + modpng14_warning(modpng14_ptr, "Insufficient memory to store text chunk."); } } #endif -#if defined(PNG_READ_zTXt_SUPPORTED) +#if defined(MODPNG14_READ_zTXt_SUPPORTED) void /* PRIVATE */ -png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 +modpng14_push_handle_zTXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR) || (modpng14_ptr->mode & MODPNG14_HAVE_IEND)) { - png_error(png_ptr, "Out of place zTXt"); + modpng14_error(modpng14_ptr, "Out of place zTXt"); /* to quiet some compiler warnings */ if(info_ptr == NULL) return; } -#ifdef PNG_MAX_MALLOC_64K +#ifdef MODPNG14_MAX_MALLOC_64K /* We can't handle zTXt chunks > 64K, since we don't have enough space * to be able to store the uncompressed data. Actually, the threshold * is probably around 32K, but it isn't as definite as 64K is. */ - if (length > (png_uint_32)65535L) + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr, "zTXt chunk too large to fit in memory"); - png_push_crc_skip(png_ptr, length); + modpng14_warning(modpng14_ptr, "zTXt chunk too large to fit in memory"); + modpng14_push_crc_skip(modpng14_ptr, length); return; } #endif - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length+1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_zTXt_MODE; + modpng14_ptr->current_text = (modpng14_charp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(length+1)); + modpng14_ptr->current_text[length] = '\0'; + modpng14_ptr->current_text_ptr = modpng14_ptr->current_text; + modpng14_ptr->current_text_size = (modpng14_size_t)length; + modpng14_ptr->current_text_left = (modpng14_size_t)length; + modpng14_ptr->process_mode = MODPNG14_READ_zTXt_MODE; } void /* PRIVATE */ -png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr) +modpng14_push_read_zTXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr->buffer_size && png_ptr->current_text_left) + if (modpng14_ptr->buffer_size && modpng14_ptr->current_text_left) { - png_size_t text_size; + modpng14_size_t text_size; - if (png_ptr->buffer_size < (png_uint_32)png_ptr->current_text_left) - text_size = png_ptr->buffer_size; + if (modpng14_ptr->buffer_size < (modpng14_uint_32)modpng14_ptr->current_text_left) + text_size = modpng14_ptr->buffer_size; else - text_size = png_ptr->current_text_left; - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; + text_size = modpng14_ptr->current_text_left; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)modpng14_ptr->current_text_ptr, text_size); + modpng14_ptr->current_text_left -= text_size; + modpng14_ptr->current_text_ptr += text_size; + } + if (!(modpng14_ptr->current_text_left)) + { + modpng14_textp text_ptr; + modpng14_charp text; + modpng14_charp key; int ret; - png_size_t text_size, key_size; + modpng14_size_t text_size, key_size; - if (png_ptr->buffer_size < 4) + if (modpng14_ptr->buffer_size < 4) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_crc_finish(png_ptr); + modpng14_push_crc_finish(modpng14_ptr); - key = png_ptr->current_text; + key = modpng14_ptr->current_text; for (text = key; *text; text++) /* empty loop */ ; /* zTXt can't have zero text */ - if (text == key + png_ptr->current_text_size) + if (text == key + modpng14_ptr->current_text_size) { - png_ptr->current_text = NULL; - png_free(png_ptr, key); + modpng14_ptr->current_text = NULL; + modpng14_free(modpng14_ptr, key); return; } text++; - if (*text != PNG_TEXT_COMPRESSION_zTXt) /* check compression byte */ + if (*text != MODPNG14_TEXT_COMPRESSION_zTXt) /* check compression byte */ { - png_ptr->current_text = NULL; - png_free(png_ptr, key); + modpng14_ptr->current_text = NULL; + modpng14_free(modpng14_ptr, key); return; } text++; - png_ptr->zstream.next_in = (png_bytep )text; - png_ptr->zstream.avail_in = (uInt)(png_ptr->current_text_size - + modpng14_ptr->zstream.next_in = (modpng14_bytep )text; + modpng14_ptr->zstream.avail_in = (uInt)(modpng14_ptr->current_text_size - (text - key)); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; key_size = text - key; text_size = 0; text = NULL; ret = Z_STREAM_END; - while (png_ptr->zstream.avail_in) + while (modpng14_ptr->zstream.avail_in) { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); + ret = inflate(&modpng14_ptr->zstream, Z_PARTIAL_FLUSH); if (ret != Z_OK && ret != Z_STREAM_END) { - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); + inflateReset(&modpng14_ptr->zstream); + modpng14_ptr->zstream.avail_in = 0; + modpng14_ptr->current_text = NULL; + modpng14_free(modpng14_ptr, key); + modpng14_free(modpng14_ptr, text); return; } - if (!(png_ptr->zstream.avail_out) || ret == Z_STREAM_END) + if (!(modpng14_ptr->zstream.avail_out) || ret == Z_STREAM_END) { if (text == NULL) { - text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(png_ptr->zbuf_size - png_ptr->zstream.avail_out + text = (modpng14_charp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out + key_size + 1)); - png_memcpy(text + key_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - png_memcpy(text, key, key_size); - text_size = key_size + png_ptr->zbuf_size - - png_ptr->zstream.avail_out; + modpng14_memcpy(text + key_size, modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out); + modpng14_memcpy(text, key, key_size); + text_size = key_size + modpng14_ptr->zbuf_size - + modpng14_ptr->zstream.avail_out; *(text + text_size) = '\0'; } else { - png_charp tmp; + modpng14_charp tmp; tmp = text; - text = (png_charp)png_malloc(png_ptr, text_size + - (png_uint_32)(png_ptr->zbuf_size - png_ptr->zstream.avail_out + text = (modpng14_charp)modpng14_malloc(modpng14_ptr, text_size + + (modpng14_uint_32)(modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out + 1)); - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - png_memcpy(text + text_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; + modpng14_memcpy(text, tmp, text_size); + modpng14_free(modpng14_ptr, tmp); + modpng14_memcpy(text + text_size, modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out); + text_size += modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out; *(text + text_size) = '\0'; } if (ret != Z_STREAM_END) { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; } } else @@ -1275,119 +1275,119 @@ break; } - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; + inflateReset(&modpng14_ptr->zstream); + modpng14_ptr->zstream.avail_in = 0; if (ret != Z_STREAM_END) { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); + modpng14_ptr->current_text = NULL; + modpng14_free(modpng14_ptr, key); + modpng14_free(modpng14_ptr, text); return; } - png_ptr->current_text = NULL; - png_free(png_ptr, key); + modpng14_ptr->current_text = NULL; + modpng14_free(modpng14_ptr, key); key = text; text += key_size; - text_ptr = (png_textp)png_malloc(png_ptr, (png_uint_32)sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt; + text_ptr = (modpng14_textp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)sizeof(modpng14_text)); + text_ptr->compression = MODPNG14_TEXT_COMPRESSION_zTXt; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; #endif text_ptr->text = text; - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); + ret = modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, 1); - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); + modpng14_free(modpng14_ptr, key); + modpng14_free(modpng14_ptr, text_ptr); if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk."); + modpng14_warning(modpng14_ptr, "Insufficient memory to store text chunk."); } } #endif -#if defined(PNG_READ_iTXt_SUPPORTED) +#if defined(MODPNG14_READ_iTXt_SUPPORTED) void /* PRIVATE */ -png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 +modpng14_push_handle_iTXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR) || (modpng14_ptr->mode & MODPNG14_HAVE_IEND)) { - png_error(png_ptr, "Out of place iTXt"); + modpng14_error(modpng14_ptr, "Out of place iTXt"); /* to quiet some compiler warnings */ if(info_ptr == NULL) return; } -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ +#ifdef MODPNG14_MAX_MALLOC_64K + modpng14_ptr->skip_length = 0; /* This may not be necessary */ - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ + if (length > (modpng14_uint_32)65535L) /* Can't hold entire string in memory */ { - png_warning(png_ptr, "iTXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "iTXt chunk too large to fit in memory"); + modpng14_ptr->skip_length = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length+1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_iTXt_MODE; + modpng14_ptr->current_text = (modpng14_charp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(length+1)); + modpng14_ptr->current_text[length] = '\0'; + modpng14_ptr->current_text_ptr = modpng14_ptr->current_text; + modpng14_ptr->current_text_size = (modpng14_size_t)length; + modpng14_ptr->current_text_left = (modpng14_size_t)length; + modpng14_ptr->process_mode = MODPNG14_READ_iTXt_MODE; } void /* PRIVATE */ -png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr) +modpng14_push_read_iTXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr->buffer_size && png_ptr->current_text_left) + if (modpng14_ptr->buffer_size && modpng14_ptr->current_text_left) { - png_size_t text_size; + modpng14_size_t text_size; - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; + if (modpng14_ptr->buffer_size < modpng14_ptr->current_text_left) + text_size = modpng14_ptr->buffer_size; else - text_size = png_ptr->current_text_left; - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; + text_size = modpng14_ptr->current_text_left; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)modpng14_ptr->current_text_ptr, text_size); + modpng14_ptr->current_text_left -= text_size; + modpng14_ptr->current_text_ptr += text_size; } - if (!(png_ptr->current_text_left)) + if (!(modpng14_ptr->current_text_left)) { - png_textp text_ptr; - png_charp key; + modpng14_textp text_ptr; + modpng14_charp key; int comp_flag; - png_charp lang; - png_charp lang_key; - png_charp text; + modpng14_charp lang; + modpng14_charp lang_key; + modpng14_charp text; int ret; - if (png_ptr->buffer_size < 4) + if (modpng14_ptr->buffer_size < 4) { - png_push_save_buffer(png_ptr); + modpng14_push_save_buffer(modpng14_ptr); return; } - png_push_crc_finish(png_ptr); + modpng14_push_crc_finish(modpng14_ptr); -#if defined(PNG_MAX_MALLOC_64K) - if (png_ptr->skip_length) +#if defined(MODPNG14_MAX_MALLOC_64K) + if (modpng14_ptr->skip_length) return; #endif - key = png_ptr->current_text; + key = modpng14_ptr->current_text; for (lang = key; *lang; lang++) /* empty loop */ ; - if (lang != key + png_ptr->current_text_size) + if (lang != key + modpng14_ptr->current_text_size) lang++; comp_flag = *lang++; @@ -1400,25 +1400,25 @@ for (text = lang_key; *text; text++) /* empty loop */ ; - if (text != key + png_ptr->current_text_size) + if (text != key + modpng14_ptr->current_text_size) text++; - text_ptr = (png_textp)png_malloc(png_ptr, (png_uint_32)sizeof(png_text)); + text_ptr = (modpng14_textp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)sizeof(modpng14_text)); text_ptr->compression = comp_flag + 2; text_ptr->key = key; text_ptr->lang = lang; text_ptr->lang_key = lang_key; text_ptr->text = text; text_ptr->text_length = 0; - text_ptr->itxt_length = png_strlen(text); + text_ptr->itxt_length = modpng14_strlen(text); - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); + ret = modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, 1); - png_ptr->current_text = NULL; + modpng14_ptr->current_text = NULL; - png_free(png_ptr, text_ptr); + modpng14_free(modpng14_ptr, text_ptr); if (ret) - png_warning(png_ptr, "Insufficient memory to store iTXt chunk."); + modpng14_warning(modpng14_ptr, "Insufficient memory to store iTXt chunk."); } } #endif @@ -1428,120 +1428,120 @@ * name or a critical chunk), the chunk is (currently) silently ignored. */ void /* PRIVATE */ -png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 +modpng14_push_handle_unknown(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_uint_32 skip=0; - png_check_chunk_name(png_ptr, png_ptr->chunk_name); + modpng14_uint_32 skip=0; + modpng14_check_chunk_name(modpng14_ptr, modpng14_ptr->chunk_name); - if (!(png_ptr->chunk_name[0] & 0x20)) + if (!(modpng14_ptr->chunk_name[0] & 0x20)) { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != +#if defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) + if(modpng14_handle_as_unknown(modpng14_ptr, modpng14_ptr->chunk_name) != HANDLE_CHUNK_ALWAYS -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - && png_ptr->read_user_chunk_fn == NULL +#if defined(MODPNG14_READ_USER_CHUNKS_SUPPORTED) + && modpng14_ptr->read_user_chunk_fn == NULL #endif ) #endif - png_chunk_error(png_ptr, "unknown critical chunk"); + modpng14_chunk_error(modpng14_ptr, "unknown critical chunk"); /* to quiet compiler warnings about unused info_ptr */ if (info_ptr == NULL) return; } -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) +#if defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) + if (modpng14_ptr->flags & MODPNG14_FLAG_KEEP_UNKNOWN_CHUNKS) { - png_unknown_chunk chunk; + modpng14_unknown_chunk chunk; -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) +#ifdef MODPNG14_MAX_MALLOC_64K + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "unknown chunk too large to fit in memory"); + skip = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - png_strcpy((png_charp)chunk.name, (png_charp)png_ptr->chunk_name); - chunk.data = (png_bytep)png_malloc(png_ptr, length); - png_crc_read(png_ptr, chunk.data, length); + modpng14_strcpy((modpng14_charp)chunk.name, (modpng14_charp)modpng14_ptr->chunk_name); + chunk.data = (modpng14_bytep)modpng14_malloc(modpng14_ptr, length); + modpng14_crc_read(modpng14_ptr, chunk.data, length); chunk.size = length; -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if(png_ptr->read_user_chunk_fn != NULL) +#if defined(MODPNG14_READ_USER_CHUNKS_SUPPORTED) + if(modpng14_ptr->read_user_chunk_fn != NULL) { /* callback to user unknown chunk handler */ - if ((*(png_ptr->read_user_chunk_fn)) (png_ptr, &chunk) <= 0) + if ((*(modpng14_ptr->read_user_chunk_fn)) (modpng14_ptr, &chunk) <= 0) { - if (!(png_ptr->chunk_name[0] & 0x20)) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != + if (!(modpng14_ptr->chunk_name[0] & 0x20)) + if(modpng14_handle_as_unknown(modpng14_ptr, modpng14_ptr->chunk_name) != HANDLE_CHUNK_ALWAYS) - png_chunk_error(png_ptr, "unknown critical chunk"); + modpng14_chunk_error(modpng14_ptr, "unknown critical chunk"); } - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, &chunk, 1); } else #endif - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); - png_free(png_ptr, chunk.data); + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, &chunk, 1); + modpng14_free(modpng14_ptr, chunk.data); } else #endif skip=length; - png_push_crc_skip(png_ptr, skip); + modpng14_push_crc_skip(modpng14_ptr, skip); } void /* PRIVATE */ -png_push_have_info(png_structp png_ptr, png_infop info_ptr) +modpng14_push_have_info(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr->info_fn != NULL) - (*(png_ptr->info_fn))(png_ptr, info_ptr); + if (modpng14_ptr->info_fn != NULL) + (*(modpng14_ptr->info_fn))(modpng14_ptr, info_ptr); } void /* PRIVATE */ -png_push_have_end(png_structp png_ptr, png_infop info_ptr) +modpng14_push_have_end(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - if (png_ptr->end_fn != NULL) - (*(png_ptr->end_fn))(png_ptr, info_ptr); + if (modpng14_ptr->end_fn != NULL) + (*(modpng14_ptr->end_fn))(modpng14_ptr, info_ptr); } void /* PRIVATE */ -png_push_have_row(png_structp png_ptr, png_bytep row) +modpng14_push_have_row(modpng14_structp modpng14_ptr, modpng14_bytep row) { - if (png_ptr->row_fn != NULL) - (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number, - (int)png_ptr->pass); + if (modpng14_ptr->row_fn != NULL) + (*(modpng14_ptr->row_fn))(modpng14_ptr, row, modpng14_ptr->row_number, + (int)modpng14_ptr->pass); } -void PNGAPI -png_progressive_combine_row (png_structp png_ptr, - png_bytep old_row, png_bytep new_row) +void MODPNG14API +modpng14_progressive_combine_row (modpng14_structp modpng14_ptr, + modpng14_bytep old_row, modpng14_bytep new_row) { -#ifdef PNG_USE_LOCAL_ARRAYS - const int FARDATA png_pass_dsp_mask[7] = +#ifdef MODPNG14_USE_LOCAL_ARRAYS + const int FARDATA modpng14_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; #endif - if (new_row != NULL) /* new_row must == png_ptr->row_buf here. */ - png_combine_row(png_ptr, old_row, png_pass_dsp_mask[png_ptr->pass]); + if (new_row != NULL) /* new_row must == modpng14_ptr->row_buf here. */ + modpng14_combine_row(modpng14_ptr, old_row, modpng14_pass_dsp_mask[modpng14_ptr->pass]); } -void PNGAPI -png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn) +void MODPNG14API +modpng14_set_progressive_read_fn(modpng14_structp modpng14_ptr, modpng14_voidp progressive_ptr, + modpng14_progressive_info_ptr info_fn, modpng14_progressive_row_ptr row_fn, + modpng14_progressive_end_ptr end_fn) { - png_ptr->info_fn = info_fn; - png_ptr->row_fn = row_fn; - png_ptr->end_fn = end_fn; + modpng14_ptr->info_fn = info_fn; + modpng14_ptr->row_fn = row_fn; + modpng14_ptr->end_fn = end_fn; - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); + modpng14_set_read_fn(modpng14_ptr, progressive_ptr, modpng14_push_fill_buffer); } -png_voidp PNGAPI -png_get_progressive_ptr(png_structp png_ptr) +modpng14_voidp MODPNG14API +modpng14_get_progressive_ptr(modpng14_structp modpng14_ptr) { - return png_ptr->io_ptr; + return modpng14_ptr->io_ptr; } -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ +#endif /* MODPNG14_PROGRESSIVE_READ_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngread.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngread.c @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -11,31 +11,31 @@ * read a PNG file or stream. */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" /* Create a PNG structure for reading, and allocate any memory needed. */ -png_structp PNGAPI -png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn) +modpng14_structp MODPNG14API +modpng14_create_read_struct(modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn) { -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL)); +#ifdef MODPNG14_USER_MEM_SUPPORTED + return (modpng14_create_read_struct_2(user_modpng14_ver, error_ptr, error_fn, + warn_fn, modpng14_voidp_NULL, modpng14_malloc_ptr_NULL, modpng14_free_ptr_NULL)); } /* Alternate create PNG structure for reading, and allocate any memory needed. */ -png_structp PNGAPI -png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn) +modpng14_structp MODPNG14API +modpng14_create_read_struct_2(modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn, modpng14_voidp mem_ptr, + modpng14_malloc_ptr malloc_fn, modpng14_free_ptr free_fn) { -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ - png_structp png_ptr; + modpng14_structp modpng14_ptr; -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD jmp_buf jmpbuf; #endif @@ -43,479 +43,479 @@ int i; - png_debug(1, "in png_create_read_struct\n"); -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, - (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); + modpng14_debug(1, "in modpng14_create_read_struct\n"); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_ptr = (modpng14_structp)modpng14_create_struct_2(MODPNG14_STRUCT_PNG, + (modpng14_malloc_ptr)malloc_fn, (modpng14_voidp)mem_ptr); #else - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); + modpng14_ptr = (modpng14_structp)modpng14_create_struct(MODPNG14_STRUCT_PNG); #endif - if (png_ptr == NULL) + if (modpng14_ptr == NULL) return (NULL); -#if !defined(PNG_1_0_X) -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED - png_init_mmx_flags(png_ptr); /* 1.2.0 addition */ +#if !defined(MODPNG14_1_0_X) +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED + modpng14_init_mmx_flags(modpng14_ptr); /* 1.2.0 addition */ #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD if (setjmp(jmpbuf)) #else - if (setjmp(png_ptr->jmpbuf)) + if (setjmp(modpng14_ptr->jmpbuf)) #endif { - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf=NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, - (png_free_ptr)free_fn, (png_voidp)mem_ptr); + modpng14_free(modpng14_ptr, modpng14_ptr->zbuf); + modpng14_ptr->zbuf=NULL; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)modpng14_ptr, + (modpng14_free_ptr)free_fn, (modpng14_voidp)mem_ptr); #else - png_destroy_struct((png_voidp)png_ptr); + modpng14_destroy_struct((modpng14_voidp)modpng14_ptr); #endif return (NULL); } #ifdef USE_FAR_KEYWORD - png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); + modpng14_memcpy(modpng14_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); #endif #endif -#ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_set_mem_fn(modpng14_ptr, mem_ptr, malloc_fn, free_fn); #endif - png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); + modpng14_set_error_fn(modpng14_ptr, error_ptr, error_fn, warn_fn); i=0; do { - if(user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); + if(user_modpng14_ver[i] != modpng14_libmodpng14_ver[i]) + modpng14_ptr->flags |= MODPNG14_FLAG_LIBRARY_MISMATCH; + } while (modpng14_libmodpng14_ver[i++]); - if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) + if (modpng14_ptr->flags & MODPNG14_FLAG_LIBRARY_MISMATCH) { - /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so + /* Libpng 0.90 and later are binary incompatible with libmodpng14 0.89, so * we must recompile any applications that use any older library version. - * For versions after libpng 1.0, we will be compatible, so we need + * For versions after libmodpng14 1.0, we will be compatible, so we need * only check the first digit. */ - if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || - (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || - (user_png_ver[0] == '0' && user_png_ver[2] < '9')) + if (user_modpng14_ver == NULL || user_modpng14_ver[0] != modpng14_libmodpng14_ver[0] || + (user_modpng14_ver[0] == '1' && user_modpng14_ver[2] != modpng14_libmodpng14_ver[2]) || + (user_modpng14_ver[0] == '0' && user_modpng14_ver[2] < '9')) { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char msg[80]; - if (user_png_ver) + if (user_modpng14_ver) { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application was compiled with modpng14.h from libmodpng14-%.20s", + user_modpng14_ver); + modpng14_warning(modpng14_ptr, msg); } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application is running with png.c from libmodpng14-%.20s", + modpng14_libmodpng14_ver); + modpng14_warning(modpng14_ptr, msg); #endif -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + modpng14_ptr->flags=0; #endif - png_error(png_ptr, - "Incompatible libpng version in application and library"); + modpng14_error(modpng14_ptr, + "Incompatible libmodpng14 version in application and library"); } } /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; + modpng14_ptr->zbuf_size = MODPNG14_ZBUF_SIZE; + modpng14_ptr->zbuf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)modpng14_ptr->zbuf_size); + modpng14_ptr->zstream.zalloc = modpng14_zalloc; + modpng14_ptr->zstream.zfree = modpng14_zfree; + modpng14_ptr->zstream.opaque = (voidpf)modpng14_ptr; - switch (inflateInit(&png_ptr->zstream)) + switch (inflateInit(&modpng14_ptr->zstream)) { case Z_OK: /* Do nothing */ break; case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break; - case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error"); break; - default: png_error(png_ptr, "Unknown zlib error"); + case Z_STREAM_ERROR: modpng14_error(modpng14_ptr, "zlib memory error"); break; + case Z_VERSION_ERROR: modpng14_error(modpng14_ptr, "zlib version error"); break; + default: modpng14_error(modpng14_ptr, "Unknown zlib error"); } - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; - png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL); + modpng14_set_read_fn(modpng14_ptr, modpng14_voidp_NULL, modpng14_rw_ptr_NULL); -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* Applications that neglect to set up their own setjmp() and then encounter - a png_error() will longjmp here. Since the jmpbuf is then meaningless we + a modpng14_error() will longjmp here. Since the jmpbuf is then meaningless we abort instead of returning. */ #ifdef USE_FAR_KEYWORD if (setjmp(jmpbuf)) - PNG_ABORT(); - png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); + MODPNG14_ABORT(); + modpng14_memcpy(modpng14_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); #else - if (setjmp(png_ptr->jmpbuf)) - PNG_ABORT(); + if (setjmp(modpng14_ptr->jmpbuf)) + MODPNG14_ABORT(); #endif #endif - return (png_ptr); + return (modpng14_ptr); } /* Initialize PNG structure for reading, and allocate any memory needed. - This interface is deprecated in favour of the png_create_read_struct(), + This interface is deprecated in favour of the modpng14_create_read_struct(), and it will eventually disappear. */ -#undef png_read_init -void PNGAPI -png_read_init(png_structp png_ptr) +#undef modpng14_read_init +void MODPNG14API +modpng14_read_init(modpng14_structp modpng14_ptr) { /* We only come here via pre-1.0.7-compiled applications */ - png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0); + modpng14_read_init_2(modpng14_ptr, "1.0.6 or earlier", 0, 0); } -void PNGAPI -png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size, png_size_t png_info_size) +void MODPNG14API +modpng14_read_init_2(modpng14_structp modpng14_ptr, modpng14_const_charp user_modpng14_ver, + modpng14_size_t modpng14_struct_size, modpng14_size_t modpng14_info_size) { /* We only come here via pre-1.0.12-compiled applications */ -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if(sizeof(png_struct) > png_struct_size || sizeof(png_info) > png_info_size) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) + if(sizeof(modpng14_struct) > modpng14_struct_size || sizeof(modpng14_info) > modpng14_info_size) { char msg[80]; - png_ptr->warning_fn=NULL; - if (user_png_ver) + modpng14_ptr->warning_fn=NULL; + if (user_modpng14_ver) { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application was compiled with modpng14.h from libmodpng14-%.20s", + user_modpng14_ver); + modpng14_warning(modpng14_ptr, msg); } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application is running with png.c from libmodpng14-%.20s", + modpng14_libmodpng14_ver); + modpng14_warning(modpng14_ptr, msg); } #endif - if(sizeof(png_struct) > png_struct_size) + if(sizeof(modpng14_struct) > modpng14_struct_size) { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; + modpng14_ptr->error_fn=NULL; +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + modpng14_ptr->flags=0; #endif - png_error(png_ptr, + modpng14_error(modpng14_ptr, "The png struct allocated by the application for reading is too small."); } - if(sizeof(png_info) > png_info_size) + if(sizeof(modpng14_info) > modpng14_info_size) { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; + modpng14_ptr->error_fn=NULL; +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + modpng14_ptr->flags=0; #endif - png_error(png_ptr, + modpng14_error(modpng14_ptr, "The info struct allocated by application for reading is too small."); } - png_read_init_3(&png_ptr, user_png_ver, png_struct_size); + modpng14_read_init_3(&modpng14_ptr, user_modpng14_ver, modpng14_struct_size); } -void PNGAPI -png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size) +void MODPNG14API +modpng14_read_init_3(modpng14_structpp ptr_ptr, modpng14_const_charp user_modpng14_ver, + modpng14_size_t modpng14_struct_size) { -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to save current jump buffer */ #endif int i=0; - png_structp png_ptr=*ptr_ptr; + modpng14_structp modpng14_ptr=*ptr_ptr; do { - if(user_png_ver[i] != png_libpng_ver[i]) + if(user_modpng14_ver[i] != modpng14_libmodpng14_ver[i]) { -#ifdef PNG_LEGACY_SUPPORTED - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; +#ifdef MODPNG14_LEGACY_SUPPORTED + modpng14_ptr->flags |= MODPNG14_FLAG_LIBRARY_MISMATCH; #else - png_ptr->warning_fn=NULL; - png_warning(png_ptr, - "Application uses deprecated png_read_init() and should be recompiled."); + modpng14_ptr->warning_fn=NULL; + modpng14_warning(modpng14_ptr, + "Application uses deprecated modpng14_read_init() and should be recompiled."); break; #endif } - } while (png_libpng_ver[i++]); + } while (modpng14_libmodpng14_ver[i++]); - png_debug(1, "in png_read_init_3\n"); + modpng14_debug(1, "in modpng14_read_init_3\n"); -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* save jump buffer and error functions */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, sizeof (jmp_buf)); + modpng14_memcpy(tmp_jmp, modpng14_ptr->jmpbuf, sizeof (jmp_buf)); #endif - if(sizeof(png_struct) > png_struct_size) + if(sizeof(modpng14_struct) > modpng14_struct_size) { - png_destroy_struct(png_ptr); - *ptr_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); - png_ptr = *ptr_ptr; + modpng14_destroy_struct(modpng14_ptr); + *ptr_ptr = (modpng14_structp)modpng14_create_struct(MODPNG14_STRUCT_PNG); + modpng14_ptr = *ptr_ptr; } /* reset all variables to 0 */ - png_memset(png_ptr, 0, sizeof (png_struct)); + modpng14_memset(modpng14_ptr, 0, sizeof (modpng14_struct)); -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* restore jump buffer */ - png_memcpy(png_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); + modpng14_memcpy(modpng14_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); #endif /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; + modpng14_ptr->zbuf_size = MODPNG14_ZBUF_SIZE; + modpng14_ptr->zbuf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)modpng14_ptr->zbuf_size); + modpng14_ptr->zstream.zalloc = modpng14_zalloc; + modpng14_ptr->zstream.zfree = modpng14_zfree; + modpng14_ptr->zstream.opaque = (voidpf)modpng14_ptr; - switch (inflateInit(&png_ptr->zstream)) + switch (inflateInit(&modpng14_ptr->zstream)) { case Z_OK: /* Do nothing */ break; case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory"); break; - case Z_VERSION_ERROR: png_error(png_ptr, "zlib version"); break; - default: png_error(png_ptr, "Unknown zlib error"); + case Z_STREAM_ERROR: modpng14_error(modpng14_ptr, "zlib memory"); break; + case Z_VERSION_ERROR: modpng14_error(modpng14_ptr, "zlib version"); break; + default: modpng14_error(modpng14_ptr, "Unknown zlib error"); } - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; - png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL); + modpng14_set_read_fn(modpng14_ptr, modpng14_voidp_NULL, modpng14_rw_ptr_NULL); } /* Read the information before the actual image data. This has been * changed in v0.90 to allow reading a file that already has the magic - * bytes read from the stream. You can tell libpng how many bytes have + * bytes read from the stream. You can tell libmodpng14 how many bytes have * been read from the beginning of the stream (up to the maximum of 8) - * via png_set_sig_bytes(), and we will only check the remaining bytes + * via modpng14_set_sig_bytes(), and we will only check the remaining bytes * here. The application can then have access to the signature bytes we * read if it is determined that this isn't a valid PNG file. */ -void PNGAPI -png_read_info(png_structp png_ptr, png_infop info_ptr) +void MODPNG14API +modpng14_read_info(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_debug(1, "in png_read_info\n"); + modpng14_debug(1, "in modpng14_read_info\n"); /* If we haven't checked all of the PNG signature bytes, do so now. */ - if (png_ptr->sig_bytes < 8) + if (modpng14_ptr->sig_bytes < 8) { - png_size_t num_checked = png_ptr->sig_bytes, + modpng14_size_t num_checked = modpng14_ptr->sig_bytes, num_to_check = 8 - num_checked; - png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check); - png_ptr->sig_bytes = 8; + modpng14_read_data(modpng14_ptr, &(info_ptr->signature[num_checked]), num_to_check); + modpng14_ptr->sig_bytes = 8; - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) + if (modpng14_sig_cmp(info_ptr->signature, num_checked, num_to_check)) { if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); + modpng14_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) + modpng14_error(modpng14_ptr, "Not a PNG file"); else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); + modpng14_error(modpng14_ptr, "PNG file corrupted by ASCII conversion"); } if (num_checked < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; + modpng14_ptr->mode |= MODPNG14_HAVE_MODPNG14_SIGNATURE; } for(;;) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_bKGD; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IHDR; + MODPNG14_IDAT; + MODPNG14_IEND; + MODPNG14_PLTE; +#if defined(MODPNG14_READ_bKGD_SUPPORTED) + MODPNG14_bKGD; #endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_cHRM; +#if defined(MODPNG14_READ_cHRM_SUPPORTED) + MODPNG14_cHRM; #endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_gAMA; +#if defined(MODPNG14_READ_gAMA_SUPPORTED) + MODPNG14_gAMA; #endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_hIST; +#if defined(MODPNG14_READ_hIST_SUPPORTED) + MODPNG14_hIST; #endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_iCCP; +#if defined(MODPNG14_READ_iCCP_SUPPORTED) + MODPNG14_iCCP; #endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_iTXt; +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + MODPNG14_iTXt; #endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_oFFs; +#if defined(MODPNG14_READ_oFFs_SUPPORTED) + MODPNG14_oFFs; #endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_pCAL; +#if defined(MODPNG14_READ_pCAL_SUPPORTED) + MODPNG14_pCAL; #endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_pHYs; +#if defined(MODPNG14_READ_pHYs_SUPPORTED) + MODPNG14_pHYs; #endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_sBIT; +#if defined(MODPNG14_READ_sBIT_SUPPORTED) + MODPNG14_sBIT; #endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_sCAL; +#if defined(MODPNG14_READ_sCAL_SUPPORTED) + MODPNG14_sCAL; #endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_sPLT; +#if defined(MODPNG14_READ_sPLT_SUPPORTED) + MODPNG14_sPLT; #endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_sRGB; +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + MODPNG14_sRGB; #endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_tEXt; +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + MODPNG14_tEXt; #endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_tIME; +#if defined(MODPNG14_READ_tIME_SUPPORTED) + MODPNG14_tIME; #endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_tRNS; +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + MODPNG14_tRNS; #endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_zTXt; +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + MODPNG14_zTXt; #endif -#endif /* PNG_GLOBAL_ARRAYS */ - png_byte chunk_length[4]; - png_uint_32 length; +#endif /* MODPNG14_GLOBAL_ARRAYS */ + modpng14_byte chunk_length[4]; + modpng14_uint_32 length; - png_read_data(png_ptr, chunk_length, 4); - length = png_get_uint_31(png_ptr,chunk_length); + modpng14_read_data(modpng14_ptr, chunk_length, 4); + length = modpng14_get_uint_31(modpng14_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); + modpng14_reset_crc(modpng14_ptr); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->chunk_name, 4); - png_debug2(0, "Reading %s chunk, length=%lu.\n", png_ptr->chunk_name, + modpng14_debug2(0, "Reading %s chunk, length=%lu.\n", modpng14_ptr->chunk_name, length); /* This should be a binary subdivision search or a hash for * matching the chunk name rather than a linear search. */ - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) - png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) - png_handle_IEND(png_ptr, info_ptr, length); -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IHDR, 4)) + modpng14_handle_IHDR(modpng14_ptr, info_ptr, length); + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IEND, 4)) + modpng14_handle_IEND(modpng14_ptr, info_ptr, length); +#ifdef MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED + else if (modpng14_handle_as_unknown(modpng14_ptr, modpng14_ptr->chunk_name)) { - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_ptr->mode |= PNG_HAVE_IDAT; - png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) + modpng14_ptr->mode |= MODPNG14_HAVE_IDAT; + modpng14_handle_unknown(modpng14_ptr, info_ptr, length); + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_PLTE, 4)) + modpng14_ptr->mode |= MODPNG14_HAVE_PLTE; + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before IDAT"); + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE && + !(modpng14_ptr->mode & MODPNG14_HAVE_PLTE)) + modpng14_error(modpng14_ptr, "Missing PLTE before IDAT"); break; } } #endif - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_handle_PLTE(png_ptr, info_ptr, length); - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_PLTE, 4)) + modpng14_handle_PLTE(modpng14_ptr, info_ptr, length); + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before IDAT"); + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE && + !(modpng14_ptr->mode & MODPNG14_HAVE_PLTE)) + modpng14_error(modpng14_ptr, "Missing PLTE before IDAT"); - png_ptr->idat_size = length; - png_ptr->mode |= PNG_HAVE_IDAT; + modpng14_ptr->idat_size = length; + modpng14_ptr->mode |= MODPNG14_HAVE_IDAT; break; } -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) - png_handle_hIST(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) - png_handle_tIME(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); +#if defined(MODPNG14_READ_bKGD_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_bKGD, 4)) + modpng14_handle_bKGD(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_cHRM_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_cHRM, 4)) + modpng14_handle_cHRM(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_gAMA_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_gAMA, 4)) + modpng14_handle_gAMA(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_hIST_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_hIST, 4)) + modpng14_handle_hIST(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_oFFs_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_oFFs, 4)) + modpng14_handle_oFFs(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_pCAL_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_pCAL, 4)) + modpng14_handle_pCAL(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sCAL_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sCAL, 4)) + modpng14_handle_sCAL(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_pHYs_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_pHYs, 4)) + modpng14_handle_pHYs(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sBIT_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sBIT, 4)) + modpng14_handle_sBIT(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sRGB, 4)) + modpng14_handle_sRGB(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_iCCP_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_iCCP, 4)) + modpng14_handle_iCCP(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sPLT_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sPLT, 4)) + modpng14_handle_sPLT(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tEXt, 4)) + modpng14_handle_tEXt(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_tIME_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tIME, 4)) + modpng14_handle_tIME(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tRNS, 4)) + modpng14_handle_tRNS(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_zTXt, 4)) + modpng14_handle_zTXt(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_iTXt, 4)) + modpng14_handle_iTXt(modpng14_ptr, info_ptr, length); #endif else - png_handle_unknown(png_ptr, info_ptr, length); + modpng14_handle_unknown(modpng14_ptr, info_ptr, length); } } /* optional call to update the users info_ptr structure */ -void PNGAPI -png_read_update_info(png_structp png_ptr, png_infop info_ptr) +void MODPNG14API +modpng14_read_update_info(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_debug(1, "in png_read_update_info\n"); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); + modpng14_debug(1, "in modpng14_read_update_info\n"); + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ROW_INIT)) + modpng14_read_start_row(modpng14_ptr); else - png_warning(png_ptr, - "Ignoring extra png_read_update_info() call; row buffer not reallocated"); - png_read_transform_info(png_ptr, info_ptr); + modpng14_warning(modpng14_ptr, + "Ignoring extra modpng14_read_update_info() call; row buffer not reallocated"); + modpng14_read_transform_info(modpng14_ptr, info_ptr); } /* Initialize palette, background, etc, after transformations @@ -523,130 +523,130 @@ * the user to obtain a gamma-corrected palette, for example. * If the user doesn't call this, we will do it ourselves. */ -void PNGAPI -png_start_read_image(png_structp png_ptr) +void MODPNG14API +modpng14_start_read_image(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_start_read_image\n"); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); + modpng14_debug(1, "in modpng14_start_read_image\n"); + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ROW_INIT)) + modpng14_read_start_row(modpng14_ptr); } -void PNGAPI -png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) +void MODPNG14API +modpng14_read_row(modpng14_structp modpng14_ptr, modpng14_bytep row, modpng14_bytep dsp_row) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; - const int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; - const int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IDAT; + const int modpng14_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; + const int modpng14_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; #endif int ret; - png_debug2(1, "in png_read_row (row %lu, pass %d)\n", - png_ptr->row_number, png_ptr->pass); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - if (png_ptr->row_number == 0 && png_ptr->pass == 0) + modpng14_debug2(1, "in modpng14_read_row (row %lu, pass %d)\n", + modpng14_ptr->row_number, modpng14_ptr->pass); + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ROW_INIT)) + modpng14_read_start_row(modpng14_ptr); + if (modpng14_ptr->row_number == 0 && modpng14_ptr->pass == 0) { /* check for transforms that have been set but were defined out */ -#if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_INVERT_SUPPORTED) && !defined(MODPNG14_READ_INVERT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_MONO) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_INVERT_SUPPORTED is not defined."); #endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_FILLER_SUPPORTED) && !defined(MODPNG14_READ_FILLER_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_FILLER) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_FILLER_SUPPORTED is not defined."); #endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) && !defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_PACKSWAP_SUPPORTED is not defined."); #endif -#if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_PACK_SUPPORTED) && !defined(MODPNG14_READ_PACK_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACK) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_PACK_SUPPORTED is not defined."); #endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_SHIFT_SUPPORTED) && !defined(MODPNG14_READ_SHIFT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SHIFT) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_SHIFT_SUPPORTED is not defined."); #endif -#if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_BGR_SUPPORTED) && !defined(MODPNG14_READ_BGR_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BGR) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_BGR_SUPPORTED is not defined."); #endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined."); +#if defined(MODPNG14_WRITE_SWAP_SUPPORTED) && !defined(MODPNG14_READ_SWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SWAP_BYTES) + modpng14_warning(modpng14_ptr, "MODPNG14_READ_SWAP_SUPPORTED is not defined."); #endif } -#if defined(PNG_READ_INTERLACING_SUPPORTED) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) /* if interlaced and we do not need a new row, combine row and return */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) + if (modpng14_ptr->interlaced && (modpng14_ptr->transformations & MODPNG14_INTERLACE)) { - switch (png_ptr->pass) + switch (modpng14_ptr->pass) { case 0: - if (png_ptr->row_number & 0x07) + if (modpng14_ptr->row_number & 0x07) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); + modpng14_read_finish_row(modpng14_ptr); return; } break; case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) + if ((modpng14_ptr->row_number & 0x07) || modpng14_ptr->width < 5) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); + modpng14_read_finish_row(modpng14_ptr); return; } break; case 2: - if ((png_ptr->row_number & 0x07) != 4) + if ((modpng14_ptr->row_number & 0x07) != 4) { - if (dsp_row != NULL && (png_ptr->row_number & 4)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); + if (dsp_row != NULL && (modpng14_ptr->row_number & 4)) + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); + modpng14_read_finish_row(modpng14_ptr); return; } break; case 3: - if ((png_ptr->row_number & 3) || png_ptr->width < 3) + if ((modpng14_ptr->row_number & 3) || modpng14_ptr->width < 3) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); + modpng14_read_finish_row(modpng14_ptr); return; } break; case 4: - if ((png_ptr->row_number & 3) != 2) + if ((modpng14_ptr->row_number & 3) != 2) { - if (dsp_row != NULL && (png_ptr->row_number & 2)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); + if (dsp_row != NULL && (modpng14_ptr->row_number & 2)) + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); + modpng14_read_finish_row(modpng14_ptr); return; } break; case 5: - if ((png_ptr->row_number & 1) || png_ptr->width < 2) + if ((modpng14_ptr->row_number & 1) || modpng14_ptr->width < 2) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); + modpng14_read_finish_row(modpng14_ptr); return; } break; case 6: - if (!(png_ptr->row_number & 1)) + if (!(modpng14_ptr->row_number & 1)) { - png_read_finish_row(png_ptr); + modpng14_read_finish_row(modpng14_ptr); return; } break; @@ -654,118 +654,118 @@ } #endif - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "Invalid attempt to read row data"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IDAT)) + modpng14_error(modpng14_ptr, "Invalid attempt to read row data"); - png_ptr->zstream.next_out = png_ptr->row_buf; - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; + modpng14_ptr->zstream.next_out = modpng14_ptr->row_buf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->irowbytes; do { - if (!(png_ptr->zstream.avail_in)) + if (!(modpng14_ptr->zstream.avail_in)) { - while (!png_ptr->idat_size) + while (!modpng14_ptr->idat_size) { - png_byte chunk_length[4]; + modpng14_byte chunk_length[4]; - png_crc_finish(png_ptr, 0); + modpng14_crc_finish(modpng14_ptr, 0); - png_read_data(png_ptr, chunk_length, 4); - png_ptr->idat_size = png_get_uint_31(png_ptr,chunk_length); + modpng14_read_data(modpng14_ptr, chunk_length, 4); + modpng14_ptr->idat_size = modpng14_get_uint_31(modpng14_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); + modpng14_reset_crc(modpng14_ptr); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->chunk_name, 4); + if (modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) + modpng14_error(modpng14_ptr, "Not enough image data"); } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) - png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size; - png_crc_read(png_ptr, png_ptr->zbuf, - (png_size_t)png_ptr->zstream.avail_in); - png_ptr->idat_size -= png_ptr->zstream.avail_in; + modpng14_ptr->zstream.avail_in = (uInt)modpng14_ptr->zbuf_size; + modpng14_ptr->zstream.next_in = modpng14_ptr->zbuf; + if (modpng14_ptr->zbuf_size > modpng14_ptr->idat_size) + modpng14_ptr->zstream.avail_in = (uInt)modpng14_ptr->idat_size; + modpng14_crc_read(modpng14_ptr, modpng14_ptr->zbuf, + (modpng14_size_t)modpng14_ptr->zstream.avail_in); + modpng14_ptr->idat_size -= modpng14_ptr->zstream.avail_in; } - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); + ret = inflate(&modpng14_ptr->zstream, Z_PARTIAL_FLUSH); if (ret == Z_STREAM_END) { - if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in || - png_ptr->idat_size) - png_error(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; + if (modpng14_ptr->zstream.avail_out || modpng14_ptr->zstream.avail_in || + modpng14_ptr->idat_size) + modpng14_error(modpng14_ptr, "Extra compressed data"); + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_FINISHED; break; } if (ret != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg : + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg ? modpng14_ptr->zstream.msg : "Decompression error"); - } while (png_ptr->zstream.avail_out); + } while (modpng14_ptr->zstream.avail_out); - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - png_ptr->row_info.rowbytes = ((png_ptr->row_info.width * - (png_uint_32)png_ptr->row_info.pixel_depth + 7) >> 3); - - if(png_ptr->row_buf[0]) - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); + modpng14_ptr->row_info.color_type = modpng14_ptr->color_type; + modpng14_ptr->row_info.width = modpng14_ptr->iwidth; + modpng14_ptr->row_info.channels = modpng14_ptr->channels; + modpng14_ptr->row_info.bit_depth = modpng14_ptr->bit_depth; + modpng14_ptr->row_info.pixel_depth = modpng14_ptr->pixel_depth; + modpng14_ptr->row_info.rowbytes = ((modpng14_ptr->row_info.width * + (modpng14_uint_32)modpng14_ptr->row_info.pixel_depth + 7) >> 3); + + if(modpng14_ptr->row_buf[0]) + modpng14_read_filter_row(modpng14_ptr, &(modpng14_ptr->row_info), + modpng14_ptr->row_buf + 1, modpng14_ptr->prev_row + 1, + (int)(modpng14_ptr->row_buf[0])); - png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, - png_ptr->rowbytes + 1); + modpng14_memcpy_check(modpng14_ptr, modpng14_ptr->prev_row, modpng14_ptr->row_buf, + modpng14_ptr->rowbytes + 1); -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + if((modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_FILTER_64) && + (modpng14_ptr->filter_type == MODPNG14_INTRAPIXEL_DIFFERENCING)) { /* Intrapixel differencing */ - png_do_read_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); + modpng14_do_read_intrapixel(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); } #endif - if (png_ptr->transformations) - png_do_read_transformations(png_ptr); + if (modpng14_ptr->transformations) + modpng14_do_read_transformations(modpng14_ptr); -#if defined(PNG_READ_INTERLACING_SUPPORTED) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) /* blow up interlaced rows to full size */ - if (png_ptr->interlaced && - (png_ptr->transformations & PNG_INTERLACE)) + if (modpng14_ptr->interlaced && + (modpng14_ptr->transformations & MODPNG14_INTERLACE)) { - if (png_ptr->pass < 6) + if (modpng14_ptr->pass < 6) /* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); + modpng14_do_read_interlace(&(modpng14_ptr->row_info), + modpng14_ptr->row_buf + 1, modpng14_ptr->pass, modpng14_ptr->transformations); */ - png_do_read_interlace(png_ptr); + modpng14_do_read_interlace(modpng14_ptr); if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + modpng14_combine_row(modpng14_ptr, dsp_row, + modpng14_pass_dsp_mask[modpng14_ptr->pass]); if (row != NULL) - png_combine_row(png_ptr, row, - png_pass_mask[png_ptr->pass]); + modpng14_combine_row(modpng14_ptr, row, + modpng14_pass_mask[modpng14_ptr->pass]); } else #endif { if (row != NULL) - png_combine_row(png_ptr, row, 0xff); + modpng14_combine_row(modpng14_ptr, row, 0xff); if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 0xff); + modpng14_combine_row(modpng14_ptr, dsp_row, 0xff); } - png_read_finish_row(png_ptr); + modpng14_read_finish_row(modpng14_ptr); - if (png_ptr->read_row_fn != NULL) - (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); + if (modpng14_ptr->read_row_fn != NULL) + (*(modpng14_ptr->read_row_fn))(modpng14_ptr, modpng14_ptr->row_number, modpng14_ptr->pass); } /* Read one or more rows of image data. If the image is interlaced, - * and png_set_interlace_handling() has been called, the rows need to + * and modpng14_set_interlace_handling() has been called, the rows need to * contain the contents of the rows from the previous pass. If the - * image has alpha or transparency, and png_handle_alpha()[*] has been + * image has alpha or transparency, and modpng14_handle_alpha()[*] has been * called, the rows contents must be initialized to the contents of the * screen. * @@ -775,92 +775,92 @@ * "chunky" progressive image, with finer detail added as it becomes * available. If you do not want this "chunky" display, you may pass * NULL for display_row. If you do not want the sparkle display, and - * you have not called png_handle_alpha(), you may pass NULL for rows. - * If you have called png_handle_alpha(), and the image has either an + * you have not called modpng14_handle_alpha(), you may pass NULL for rows. + * If you have called modpng14_handle_alpha(), and the image has either an * alpha channel or a transparency chunk, you must provide a buffer for * rows. In this case, you do not have to provide a display_row buffer * also, but you may. If the image is not interlaced, or if you have - * not called png_set_interlace_handling(), the display_row buffer will + * not called modpng14_set_interlace_handling(), the display_row buffer will * be ignored, so pass NULL to it. * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.5 + * [*] modpng14_handle_alpha() does not exist yet, as of libmodpng14 version 1.2.5 */ -void PNGAPI -png_read_rows(png_structp png_ptr, png_bytepp row, - png_bytepp display_row, png_uint_32 num_rows) +void MODPNG14API +modpng14_read_rows(modpng14_structp modpng14_ptr, modpng14_bytepp row, + modpng14_bytepp display_row, modpng14_uint_32 num_rows) { - png_uint_32 i; - png_bytepp rp; - png_bytepp dp; + modpng14_uint_32 i; + modpng14_bytepp rp; + modpng14_bytepp dp; - png_debug(1, "in png_read_rows\n"); + modpng14_debug(1, "in modpng14_read_rows\n"); rp = row; dp = display_row; if (rp != NULL && dp != NULL) for (i = 0; i < num_rows; i++) { - png_bytep rptr = *rp++; - png_bytep dptr = *dp++; + modpng14_bytep rptr = *rp++; + modpng14_bytep dptr = *dp++; - png_read_row(png_ptr, rptr, dptr); + modpng14_read_row(modpng14_ptr, rptr, dptr); } else if(rp != NULL) for (i = 0; i < num_rows; i++) { - png_bytep rptr = *rp; - png_read_row(png_ptr, rptr, png_bytep_NULL); + modpng14_bytep rptr = *rp; + modpng14_read_row(modpng14_ptr, rptr, modpng14_bytep_NULL); rp++; } else if(dp != NULL) for (i = 0; i < num_rows; i++) { - png_bytep dptr = *dp; - png_read_row(png_ptr, png_bytep_NULL, dptr); + modpng14_bytep dptr = *dp; + modpng14_read_row(modpng14_ptr, modpng14_bytep_NULL, dptr); dp++; } } /* Read the entire image. If the image has an alpha channel or a tRNS - * chunk, and you have called png_handle_alpha()[*], you will need to + * chunk, and you have called modpng14_handle_alpha()[*], you will need to * initialize the image to the current image that PNG will be overlaying. * We set the num_rows again here, in case it was incorrectly set in - * png_read_start_row() by a call to png_read_update_info() or - * png_start_read_image() if png_set_interlace_handling() wasn't called + * modpng14_read_start_row() by a call to modpng14_read_update_info() or + * modpng14_start_read_image() if modpng14_set_interlace_handling() wasn't called * prior to either of these functions like it should have been. You can * only call this function once. If you desire to have an image for - * each pass of a interlaced image, use png_read_rows() instead. + * each pass of a interlaced image, use modpng14_read_rows() instead. * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.5 + * [*] modpng14_handle_alpha() does not exist yet, as of libmodpng14 version 1.2.5 */ -void PNGAPI -png_read_image(png_structp png_ptr, png_bytepp image) +void MODPNG14API +modpng14_read_image(modpng14_structp modpng14_ptr, modpng14_bytepp image) { - png_uint_32 i,image_height; + modpng14_uint_32 i,image_height; int pass, j; - png_bytepp rp; + modpng14_bytepp rp; - png_debug(1, "in png_read_image\n"); + modpng14_debug(1, "in modpng14_read_image\n"); -#ifdef PNG_READ_INTERLACING_SUPPORTED - pass = png_set_interlace_handling(png_ptr); +#ifdef MODPNG14_READ_INTERLACING_SUPPORTED + pass = modpng14_set_interlace_handling(modpng14_ptr); #else - if (png_ptr->interlaced) - png_error(png_ptr, + if (modpng14_ptr->interlaced) + modpng14_error(modpng14_ptr, "Cannot read interlaced image -- interlace handler disabled."); pass = 1; #endif - image_height=png_ptr->height; - png_ptr->num_rows = image_height; /* Make sure this is set correctly */ + image_height=modpng14_ptr->height; + modpng14_ptr->num_rows = image_height; /* Make sure this is set correctly */ for (j = 0; j < pass; j++) { rp = image; for (i = 0; i < image_height; i++) { - png_read_row(png_ptr, *rp, png_bytep_NULL); + modpng14_read_row(modpng14_ptr, *rp, modpng14_bytep_NULL); rp++; } } @@ -870,201 +870,201 @@ * file, will verify the end is accurate, and will read any comments * or time information at the end of the file, if info is not NULL. */ -void PNGAPI -png_read_end(png_structp png_ptr, png_infop info_ptr) +void MODPNG14API +modpng14_read_end(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_byte chunk_length[4]; - png_uint_32 length; + modpng14_byte chunk_length[4]; + modpng14_uint_32 length; - png_debug(1, "in png_read_end\n"); - png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ + modpng14_debug(1, "in modpng14_read_end\n"); + modpng14_crc_finish(modpng14_ptr, 0); /* Finish off CRC from last IDAT chunk */ do { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_bKGD; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IHDR; + MODPNG14_IDAT; + MODPNG14_IEND; + MODPNG14_PLTE; +#if defined(MODPNG14_READ_bKGD_SUPPORTED) + MODPNG14_bKGD; #endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_cHRM; +#if defined(MODPNG14_READ_cHRM_SUPPORTED) + MODPNG14_cHRM; #endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_gAMA; +#if defined(MODPNG14_READ_gAMA_SUPPORTED) + MODPNG14_gAMA; #endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_hIST; +#if defined(MODPNG14_READ_hIST_SUPPORTED) + MODPNG14_hIST; #endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_iCCP; +#if defined(MODPNG14_READ_iCCP_SUPPORTED) + MODPNG14_iCCP; #endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_iTXt; +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + MODPNG14_iTXt; #endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_oFFs; +#if defined(MODPNG14_READ_oFFs_SUPPORTED) + MODPNG14_oFFs; #endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_pCAL; +#if defined(MODPNG14_READ_pCAL_SUPPORTED) + MODPNG14_pCAL; #endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_pHYs; +#if defined(MODPNG14_READ_pHYs_SUPPORTED) + MODPNG14_pHYs; #endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_sBIT; +#if defined(MODPNG14_READ_sBIT_SUPPORTED) + MODPNG14_sBIT; #endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_sCAL; +#if defined(MODPNG14_READ_sCAL_SUPPORTED) + MODPNG14_sCAL; #endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_sPLT; +#if defined(MODPNG14_READ_sPLT_SUPPORTED) + MODPNG14_sPLT; #endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_sRGB; +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + MODPNG14_sRGB; #endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_tEXt; +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + MODPNG14_tEXt; #endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_tIME; +#if defined(MODPNG14_READ_tIME_SUPPORTED) + MODPNG14_tIME; #endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_tRNS; +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + MODPNG14_tRNS; #endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_zTXt; +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + MODPNG14_zTXt; #endif -#endif /* PNG_GLOBAL_ARRAYS */ +#endif /* MODPNG14_GLOBAL_ARRAYS */ - png_read_data(png_ptr, chunk_length, 4); - length = png_get_uint_31(png_ptr,chunk_length); + modpng14_read_data(modpng14_ptr, chunk_length, 4); + length = modpng14_get_uint_31(modpng14_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); + modpng14_reset_crc(modpng14_ptr); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->chunk_name, 4); - png_debug1(0, "Reading %s chunk.\n", png_ptr->chunk_name); + modpng14_debug1(0, "Reading %s chunk.\n", modpng14_ptr->chunk_name); - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) - png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) - png_handle_IEND(png_ptr, info_ptr, length); -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IHDR, 4)) + modpng14_handle_IHDR(modpng14_ptr, info_ptr, length); + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IEND, 4)) + modpng14_handle_IEND(modpng14_ptr, info_ptr, length); +#ifdef MODPNG14_HANDLE_AS_UNKNOWN_SUPPORTED + else if (modpng14_handle_as_unknown(modpng14_ptr, modpng14_ptr->chunk_name)) { - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) { - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); + if (length > 0 || modpng14_ptr->mode & MODPNG14_AFTER_IDAT) + modpng14_error(modpng14_ptr, "Too many IDAT's found"); } else - png_ptr->mode |= PNG_AFTER_IDAT; - png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; + modpng14_handle_unknown(modpng14_ptr, info_ptr, length); + if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_PLTE, 4)) + modpng14_ptr->mode |= MODPNG14_HAVE_PLTE; } #endif - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) { /* Zero length IDATs are legal after the last IDAT has been * read, but not after other chunks have been read. */ - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); - png_crc_finish(png_ptr, length); + if (length > 0 || modpng14_ptr->mode & MODPNG14_AFTER_IDAT) + modpng14_error(modpng14_ptr, "Too many IDAT's found"); + modpng14_crc_finish(modpng14_ptr, length); } - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_handle_PLTE(png_ptr, info_ptr, length); -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) - png_handle_hIST(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) - png_handle_tIME(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_PLTE, 4)) + modpng14_handle_PLTE(modpng14_ptr, info_ptr, length); +#if defined(MODPNG14_READ_bKGD_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_bKGD, 4)) + modpng14_handle_bKGD(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_cHRM_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_cHRM, 4)) + modpng14_handle_cHRM(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_gAMA_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_gAMA, 4)) + modpng14_handle_gAMA(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_hIST_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_hIST, 4)) + modpng14_handle_hIST(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_oFFs_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_oFFs, 4)) + modpng14_handle_oFFs(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_pCAL_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_pCAL, 4)) + modpng14_handle_pCAL(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sCAL_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sCAL, 4)) + modpng14_handle_sCAL(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_pHYs_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_pHYs, 4)) + modpng14_handle_pHYs(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sBIT_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sBIT, 4)) + modpng14_handle_sBIT(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sRGB, 4)) + modpng14_handle_sRGB(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_iCCP_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_iCCP, 4)) + modpng14_handle_iCCP(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_sPLT_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_sPLT, 4)) + modpng14_handle_sPLT(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_tEXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tEXt, 4)) + modpng14_handle_tEXt(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_tIME_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tIME, 4)) + modpng14_handle_tIME(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_tRNS, 4)) + modpng14_handle_tRNS(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_zTXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_zTXt, 4)) + modpng14_handle_zTXt(modpng14_ptr, info_ptr, length); +#endif +#if defined(MODPNG14_READ_iTXt_SUPPORTED) + else if (!modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_iTXt, 4)) + modpng14_handle_iTXt(modpng14_ptr, info_ptr, length); #endif else - png_handle_unknown(png_ptr, info_ptr, length); - } while (!(png_ptr->mode & PNG_HAVE_IEND)); + modpng14_handle_unknown(modpng14_ptr, info_ptr, length); + } while (!(modpng14_ptr->mode & MODPNG14_HAVE_IEND)); } /* free all memory used by the read */ -void PNGAPI -png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, - png_infopp end_info_ptr_ptr) +void MODPNG14API +modpng14_destroy_read_struct(modpng14_structpp modpng14_ptr_ptr, modpng14_infopp info_ptr_ptr, + modpng14_infopp end_info_ptr_ptr) { - png_structp png_ptr = NULL; - png_infop info_ptr = NULL, end_info_ptr = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn = NULL; - png_voidp mem_ptr = NULL; + modpng14_structp modpng14_ptr = NULL; + modpng14_infop info_ptr = NULL, end_info_ptr = NULL; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_free_ptr free_fn = NULL; + modpng14_voidp mem_ptr = NULL; #endif - png_debug(1, "in png_destroy_read_struct\n"); - if (png_ptr_ptr != NULL) - png_ptr = *png_ptr_ptr; + modpng14_debug(1, "in modpng14_destroy_read_struct\n"); + if (modpng14_ptr_ptr != NULL) + modpng14_ptr = *modpng14_ptr_ptr; if (info_ptr_ptr != NULL) info_ptr = *info_ptr_ptr; @@ -1072,344 +1072,344 @@ if (end_info_ptr_ptr != NULL) end_info_ptr = *end_info_ptr_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + free_fn = modpng14_ptr->free_fn; + mem_ptr = modpng14_ptr->mem_ptr; #endif - png_read_destroy(png_ptr, info_ptr, end_info_ptr); + modpng14_read_destroy(modpng14_ptr, info_ptr, end_info_ptr); if (info_ptr != NULL) { -#if defined(PNG_TEXT_SUPPORTED) - png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, -1); +#if defined(MODPNG14_TEXT_SUPPORTED) + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_TEXT, -1); #endif -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)info_ptr, (modpng14_free_ptr)free_fn, + (modpng14_voidp)mem_ptr); #else - png_destroy_struct((png_voidp)info_ptr); + modpng14_destroy_struct((modpng14_voidp)info_ptr); #endif *info_ptr_ptr = NULL; } if (end_info_ptr != NULL) { -#if defined(PNG_READ_TEXT_SUPPORTED) - png_free_data(png_ptr, end_info_ptr, PNG_FREE_TEXT, -1); +#if defined(MODPNG14_READ_TEXT_SUPPORTED) + modpng14_free_data(modpng14_ptr, end_info_ptr, MODPNG14_FREE_TEXT, -1); #endif -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)end_info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)end_info_ptr, (modpng14_free_ptr)free_fn, + (modpng14_voidp)mem_ptr); #else - png_destroy_struct((png_voidp)end_info_ptr); + modpng14_destroy_struct((modpng14_voidp)end_info_ptr); #endif *end_info_ptr_ptr = NULL; } - if (png_ptr != NULL) + if (modpng14_ptr != NULL) { -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)modpng14_ptr, (modpng14_free_ptr)free_fn, + (modpng14_voidp)mem_ptr); #else - png_destroy_struct((png_voidp)png_ptr); + modpng14_destroy_struct((modpng14_voidp)modpng14_ptr); #endif - *png_ptr_ptr = NULL; + *modpng14_ptr_ptr = NULL; } } /* free all memory used by the read (old method) */ void /* PRIVATE */ -png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr) +modpng14_read_destroy(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_infop end_info_ptr) { -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED jmp_buf tmp_jmp; #endif - png_error_ptr error_fn; - png_error_ptr warning_fn; - png_voidp error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; + modpng14_error_ptr error_fn; + modpng14_error_ptr warning_fn; + modpng14_voidp error_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_free_ptr free_fn; #endif - png_debug(1, "in png_read_destroy\n"); + modpng14_debug(1, "in modpng14_read_destroy\n"); if (info_ptr != NULL) - png_info_destroy(png_ptr, info_ptr); + modpng14_info_destroy(modpng14_ptr, info_ptr); if (end_info_ptr != NULL) - png_info_destroy(png_ptr, end_info_ptr); + modpng14_info_destroy(modpng14_ptr, end_info_ptr); - png_free(png_ptr, png_ptr->zbuf); - png_free(png_ptr, png_ptr->big_row_buf); - png_free(png_ptr, png_ptr->prev_row); -#if defined(PNG_READ_DITHER_SUPPORTED) - png_free(png_ptr, png_ptr->palette_lookup); - png_free(png_ptr, png_ptr->dither_index); -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_table); -#endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_from_1); - png_free(png_ptr, png_ptr->gamma_to_1); -#endif -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_PLTE) - png_zfree(png_ptr, png_ptr->palette); - png_ptr->free_me &= ~PNG_FREE_PLTE; + modpng14_free(modpng14_ptr, modpng14_ptr->zbuf); + modpng14_free(modpng14_ptr, modpng14_ptr->big_row_buf); + modpng14_free(modpng14_ptr, modpng14_ptr->prev_row); +#if defined(MODPNG14_READ_DITHER_SUPPORTED) + modpng14_free(modpng14_ptr, modpng14_ptr->palette_lookup); + modpng14_free(modpng14_ptr, modpng14_ptr->dither_index); +#endif +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_table); +#endif +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_from_1); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_to_1); +#endif +#ifdef MODPNG14_FREE_ME_SUPPORTED + if (modpng14_ptr->free_me & MODPNG14_FREE_PLTE) + modpng14_zfree(modpng14_ptr, modpng14_ptr->palette); + modpng14_ptr->free_me &= ~MODPNG14_FREE_PLTE; #else - if (png_ptr->flags & PNG_FLAG_FREE_PLTE) - png_zfree(png_ptr, png_ptr->palette); - png_ptr->flags &= ~PNG_FLAG_FREE_PLTE; -#endif -#if defined(PNG_tRNS_SUPPORTED) || \ - defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_TRNS) - png_free(png_ptr, png_ptr->trans); - png_ptr->free_me &= ~PNG_FREE_TRNS; + if (modpng14_ptr->flags & MODPNG14_FLAG_FREE_PLTE) + modpng14_zfree(modpng14_ptr, modpng14_ptr->palette); + modpng14_ptr->flags &= ~MODPNG14_FLAG_FREE_PLTE; +#endif +#if defined(MODPNG14_tRNS_SUPPORTED) || \ + defined(MODPNG14_READ_EXPAND_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) +#ifdef MODPNG14_FREE_ME_SUPPORTED + if (modpng14_ptr->free_me & MODPNG14_FREE_TRNS) + modpng14_free(modpng14_ptr, modpng14_ptr->trans); + modpng14_ptr->free_me &= ~MODPNG14_FREE_TRNS; #else - if (png_ptr->flags & PNG_FLAG_FREE_TRNS) - png_free(png_ptr, png_ptr->trans); - png_ptr->flags &= ~PNG_FLAG_FREE_TRNS; + if (modpng14_ptr->flags & MODPNG14_FLAG_FREE_TRNS) + modpng14_free(modpng14_ptr, modpng14_ptr->trans); + modpng14_ptr->flags &= ~MODPNG14_FLAG_FREE_TRNS; #endif #endif -#if defined(PNG_READ_hIST_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_HIST) - png_free(png_ptr, png_ptr->hist); - png_ptr->free_me &= ~PNG_FREE_HIST; +#if defined(MODPNG14_READ_hIST_SUPPORTED) +#ifdef MODPNG14_FREE_ME_SUPPORTED + if (modpng14_ptr->free_me & MODPNG14_FREE_HIST) + modpng14_free(modpng14_ptr, modpng14_ptr->hist); + modpng14_ptr->free_me &= ~MODPNG14_FREE_HIST; #else - if (png_ptr->flags & PNG_FLAG_FREE_HIST) - png_free(png_ptr, png_ptr->hist); - png_ptr->flags &= ~PNG_FLAG_FREE_HIST; + if (modpng14_ptr->flags & MODPNG14_FLAG_FREE_HIST) + modpng14_free(modpng14_ptr, modpng14_ptr->hist); + modpng14_ptr->flags &= ~MODPNG14_FLAG_FREE_HIST; #endif #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->gamma_16_table != NULL) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + if (modpng14_ptr->gamma_16_table != NULL) { int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); + int istop = (1 << (8 - modpng14_ptr->gamma_shift)); for (i = 0; i < istop; i++) { - png_free(png_ptr, png_ptr->gamma_16_table[i]); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_16_table[i]); } - png_free(png_ptr, png_ptr->gamma_16_table); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_16_table); } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_from_1 != NULL) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->gamma_16_from_1 != NULL) { int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); + int istop = (1 << (8 - modpng14_ptr->gamma_shift)); for (i = 0; i < istop; i++) { - png_free(png_ptr, png_ptr->gamma_16_from_1[i]); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_16_from_1[i]); } - png_free(png_ptr, png_ptr->gamma_16_from_1); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_16_from_1); } - if (png_ptr->gamma_16_to_1 != NULL) + if (modpng14_ptr->gamma_16_to_1 != NULL) { int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); + int istop = (1 << (8 - modpng14_ptr->gamma_shift)); for (i = 0; i < istop; i++) { - png_free(png_ptr, png_ptr->gamma_16_to_1[i]); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_16_to_1[i]); } - png_free(png_ptr, png_ptr->gamma_16_to_1); + modpng14_free(modpng14_ptr, modpng14_ptr->gamma_16_to_1); } #endif #endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_free(png_ptr, png_ptr->time_buffer); +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) + modpng14_free(modpng14_ptr, modpng14_ptr->time_buffer); #endif - inflateEnd(&png_ptr->zstream); -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_free(png_ptr, png_ptr->save_buffer); + inflateEnd(&modpng14_ptr->zstream); +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED + modpng14_free(modpng14_ptr, modpng14_ptr->save_buffer); #endif -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -#ifdef PNG_TEXT_SUPPORTED - png_free(png_ptr, png_ptr->current_text); -#endif /* PNG_TEXT_SUPPORTED */ -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ +#ifdef MODPNG14_PROGRESSIVE_READ_SUPPORTED +#ifdef MODPNG14_TEXT_SUPPORTED + modpng14_free(modpng14_ptr, modpng14_ptr->current_text); +#endif /* MODPNG14_TEXT_SUPPORTED */ +#endif /* MODPNG14_PROGRESSIVE_READ_SUPPORTED */ - /* Save the important info out of the png_struct, in case it is + /* Save the important info out of the modpng14_struct, in case it is * being used again. */ -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(tmp_jmp, png_ptr->jmpbuf, sizeof (jmp_buf)); +#ifdef MODPNG14_SETJMP_SUPPORTED + modpng14_memcpy(tmp_jmp, modpng14_ptr->jmpbuf, sizeof (jmp_buf)); #endif - error_fn = png_ptr->error_fn; - warning_fn = png_ptr->warning_fn; - error_ptr = png_ptr->error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; + error_fn = modpng14_ptr->error_fn; + warning_fn = modpng14_ptr->warning_fn; + error_ptr = modpng14_ptr->error_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + free_fn = modpng14_ptr->free_fn; #endif - png_memset(png_ptr, 0, sizeof (png_struct)); + modpng14_memset(modpng14_ptr, 0, sizeof (modpng14_struct)); - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; - png_ptr->error_ptr = error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr->free_fn = free_fn; + modpng14_ptr->error_fn = error_fn; + modpng14_ptr->warning_fn = warning_fn; + modpng14_ptr->error_ptr = error_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_ptr->free_fn = free_fn; #endif -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); +#ifdef MODPNG14_SETJMP_SUPPORTED + modpng14_memcpy(modpng14_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); #endif } -void PNGAPI -png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn) +void MODPNG14API +modpng14_set_read_status_fn(modpng14_structp modpng14_ptr, modpng14_read_status_ptr read_row_fn) { - png_ptr->read_row_fn = read_row_fn; + modpng14_ptr->read_row_fn = read_row_fn; } -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_read_png(png_structp png_ptr, png_infop info_ptr, +#if defined(MODPNG14_INFO_IMAGE_SUPPORTED) +void MODPNG14API +modpng14_read_png(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int transforms, voidp params) { int row; -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) /* invert the alpha channel from opacity to transparency */ - if (transforms & PNG_TRANSFORM_INVERT_ALPHA) - png_set_invert_alpha(png_ptr); + if (transforms & MODPNG14_TRANSFORM_INVERT_ALPHA) + modpng14_set_invert_alpha(modpng14_ptr); #endif - /* The call to png_read_info() gives us all of the information from the + /* The call to modpng14_read_info() gives us all of the information from the * PNG file before the first IDAT (image data chunk). */ - png_read_info(png_ptr, info_ptr); + modpng14_read_info(modpng14_ptr, info_ptr); - if (info_ptr->height > PNG_UINT_32_MAX/sizeof(png_bytep)) - png_error(png_ptr,"Image is too high to process with png_read_png()"); + if (info_ptr->height > MODPNG14_UINT_32_MAX/sizeof(modpng14_bytep)) + modpng14_error(modpng14_ptr,"Image is too high to process with modpng14_read_png()"); /* -------------- image transformations start here ------------------- */ -#if defined(PNG_READ_16_TO_8_SUPPORTED) - /* tell libpng to strip 16 bit/color files down to 8 bits/color */ - if (transforms & PNG_TRANSFORM_STRIP_16) - png_set_strip_16(png_ptr); +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) + /* tell libmodpng14 to strip 16 bit/color files down to 8 bits/color */ + if (transforms & MODPNG14_TRANSFORM_STRIP_16) + modpng14_set_strip_16(modpng14_ptr); #endif -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +#if defined(MODPNG14_READ_STRIP_ALPHA_SUPPORTED) /* Strip alpha bytes from the input data without combining with the * background (not recommended). */ - if (transforms & PNG_TRANSFORM_STRIP_ALPHA) - png_set_strip_alpha(png_ptr); + if (transforms & MODPNG14_TRANSFORM_STRIP_ALPHA) + modpng14_set_strip_alpha(modpng14_ptr); #endif -#if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED) +#if defined(MODPNG14_READ_PACK_SUPPORTED) && !defined(MODPNG14_READ_EXPAND_SUPPORTED) /* Extract multiple pixels with bit depths of 1, 2, and 4 from a single * byte into separate bytes (useful for paletted and grayscale images). */ - if (transforms & PNG_TRANSFORM_PACKING) - png_set_packing(png_ptr); + if (transforms & MODPNG14_TRANSFORM_PACKING) + modpng14_set_packing(modpng14_ptr); #endif -#if defined(PNG_READ_PACKSWAP_SUPPORTED) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) /* Change the order of packed pixels to least significant bit first - * (not useful if you are using png_set_packing). */ - if (transforms & PNG_TRANSFORM_PACKSWAP) - png_set_packswap(png_ptr); + * (not useful if you are using modpng14_set_packing). */ + if (transforms & MODPNG14_TRANSFORM_PACKSWAP) + modpng14_set_packswap(modpng14_ptr); #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) /* Expand paletted colors into true RGB triplets * Expand grayscale images to full 8 bits from 1, 2, or 4 bits/pixel * Expand paletted or RGB images with transparency to full alpha * channels so the data will be available as RGBA quartets. */ - if (transforms & PNG_TRANSFORM_EXPAND) - if ((png_ptr->bit_depth < 8) || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || - (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) - png_set_expand(png_ptr); + if (transforms & MODPNG14_TRANSFORM_EXPAND) + if ((modpng14_ptr->bit_depth < 8) || + (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) || + (modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_tRNS))) + modpng14_set_expand(modpng14_ptr); #endif /* We don't handle background color or gamma transformation or dithering. */ -#if defined(PNG_READ_INVERT_SUPPORTED) +#if defined(MODPNG14_READ_INVERT_SUPPORTED) /* invert monochrome files to have 0 as white and 1 as black */ - if (transforms & PNG_TRANSFORM_INVERT_MONO) - png_set_invert_mono(png_ptr); + if (transforms & MODPNG14_TRANSFORM_INVERT_MONO) + modpng14_set_invert_mono(modpng14_ptr); #endif -#if defined(PNG_READ_SHIFT_SUPPORTED) +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) /* 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 ((transforms & PNG_TRANSFORM_SHIFT) - && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) + if ((transforms & MODPNG14_TRANSFORM_SHIFT) + && modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_sBIT)) { - png_color_8p sig_bit; + modpng14_color_8p sig_bit; - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - png_set_shift(png_ptr, sig_bit); + modpng14_get_sBIT(modpng14_ptr, info_ptr, &sig_bit); + modpng14_set_shift(modpng14_ptr, sig_bit); } #endif -#if defined(PNG_READ_BGR_SUPPORTED) +#if defined(MODPNG14_READ_BGR_SUPPORTED) /* flip the RGB pixels to BGR (or RGBA to BGRA) */ - if (transforms & PNG_TRANSFORM_BGR) - png_set_bgr(png_ptr); + if (transforms & MODPNG14_TRANSFORM_BGR) + modpng14_set_bgr(modpng14_ptr); #endif -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) +#if defined(MODPNG14_READ_SWAP_ALPHA_SUPPORTED) /* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */ - if (transforms & PNG_TRANSFORM_SWAP_ALPHA) - png_set_swap_alpha(png_ptr); + if (transforms & MODPNG14_TRANSFORM_SWAP_ALPHA) + modpng14_set_swap_alpha(modpng14_ptr); #endif -#if defined(PNG_READ_SWAP_SUPPORTED) +#if defined(MODPNG14_READ_SWAP_SUPPORTED) /* swap bytes of 16 bit files to least significant byte first */ - if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) - png_set_swap(png_ptr); + if (transforms & MODPNG14_TRANSFORM_SWAP_ENDIAN) + modpng14_set_swap(modpng14_ptr); #endif /* We don't handle adding filler bytes */ /* Optional call to gamma correct and add the background to the palette - * and update info structure. REQUIRED if you are expecting libpng to + * and update info structure. REQUIRED if you are expecting libmodpng14 to * update the palette for you (i.e., you selected such a transform above). */ - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_ptr, info_ptr); /* -------------- image transformations end here ------------------- */ -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_ROWS, 0); #endif if(info_ptr->row_pointers == NULL) { - info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, - info_ptr->height * sizeof(png_bytep)); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_ROWS; + info_ptr->row_pointers = (modpng14_bytepp)modpng14_malloc(modpng14_ptr, + info_ptr->height * sizeof(modpng14_bytep)); +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_ROWS; #endif for (row = 0; row < (int)info_ptr->height; row++) { - info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, - png_get_rowbytes(png_ptr, info_ptr)); + info_ptr->row_pointers[row] = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + modpng14_get_rowbytes(modpng14_ptr, info_ptr)); } } - png_read_image(png_ptr, info_ptr->row_pointers); - info_ptr->valid |= PNG_INFO_IDAT; + modpng14_read_image(modpng14_ptr, info_ptr->row_pointers); + info_ptr->valid |= MODPNG14_INFO_IDAT; /* read rest of file, and get additional chunks in info_ptr - REQUIRED */ - png_read_end(png_ptr, info_ptr); + modpng14_read_end(modpng14_ptr, info_ptr); if(transforms == 0 || params == NULL) /* quiet compiler warnings */ return; --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngrio.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngrio.c @@ -1,8 +1,8 @@ /* pngrio.c - functions for data input * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -12,11 +12,11 @@ * 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(...). + * libmodpng14 use it at run time with modpng14_set_read_fn(...). */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.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 @@ -24,39 +24,39 @@ 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) +modpng14_read_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_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); + modpng14_debug1(4,"reading %d bytes\n", (int)length); + if (modpng14_ptr->read_data_fn != NULL) + (*(modpng14_ptr->read_data_fn))(modpng14_ptr, data, length); else - png_error(png_ptr, "Call to NULL read function"); + modpng14_error(modpng14_ptr, "Call to NULL read function"); } -#if !defined(PNG_NO_STDIO) +#if !defined(MODPNG14_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 + read_data function and use it at run time with modpng14_set_read_fn(), rather than changing the library. */ #ifndef USE_FAR_KEYWORD -void PNGAPI -png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) +void MODPNG14API +modpng14_default_read_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - png_size_t check; + modpng14_size_t check; - /* fread() returns 0 on error, so it is OK to store this in a png_size_t + /* fread() returns 0 on error, so it is OK to store this in a modpng14_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) ) + if ( !ReadFile((HANDLE)(modpng14_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); + check = (modpng14_size_t)fread(data, (modpng14_size_t)1, length, + (modpng14_FILE_p)modpng14_ptr->io_ptr); #endif if (check != length) - png_error(png_ptr, "Read Error"); + modpng14_error(modpng14_ptr, "Read Error"); } #else /* this is the model-independent version. Since the standard I/O library @@ -68,19 +68,19 @@ #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) +modpng14_default_read_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { int check; - png_byte *n_data; - png_FILE_p io_ptr; + modpng14_byte *n_data; + modpng14_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) + n_data = (modpng14_byte *)CVT_PTR_NOCHECK(data); + io_ptr = (modpng14_FILE_p)CVT_PTR(modpng14_ptr->io_ptr); + if ((modpng14_bytep)n_data == data) { #if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) + if ( !ReadFile((HANDLE)(modpng14_ptr->io_ptr), data, length, &check, NULL) ) check = 0; #else check = fread(n_data, 1, length, io_ptr); @@ -88,8 +88,8 @@ } else { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t read, remaining, err; + modpng14_byte buf[NEAR_BUF_SIZE]; + modpng14_size_t read, remaining, err; check = 0; remaining = length; do @@ -99,9 +99,9 @@ if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) ) err = 0; #else - err = fread(buf, (png_size_t)1, read, io_ptr); + err = fread(buf, (modpng14_size_t)1, read, io_ptr); #endif - png_memcpy(data, buf, read); /* copy far buffer to near buffer */ + modpng14_memcpy(data, buf, read); /* copy far buffer to near buffer */ if(err != read) break; else @@ -111,51 +111,51 @@ } while (remaining != 0); } - if ((png_uint_32)check != (png_uint_32)length) - png_error(png_ptr, "read Error"); + if ((modpng14_uint_32)check != (modpng14_uint_32)length) + modpng14_error(modpng14_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. + for libmodpng14 if standard C streams aren't being used. This function takes as its arguments: - png_ptr - pointer to a png input data structure + modpng14_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 + arguments a pointer to a modpng14_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) + function should call modpng14_error(modpng14_ptr, "Error msg"). */ +void MODPNG14API +modpng14_set_read_fn(modpng14_structp modpng14_ptr, modpng14_voidp io_ptr, + modpng14_rw_ptr read_data_fn) { - png_ptr->io_ptr = io_ptr; + modpng14_ptr->io_ptr = io_ptr; -#if !defined(PNG_NO_STDIO) +#if !defined(MODPNG14_NO_STDIO) if (read_data_fn != NULL) - png_ptr->read_data_fn = read_data_fn; + modpng14_ptr->read_data_fn = read_data_fn; else - png_ptr->read_data_fn = png_default_read_data; + modpng14_ptr->read_data_fn = modpng14_default_read_data; #else - png_ptr->read_data_fn = read_data_fn; + modpng14_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) + if (modpng14_ptr->write_data_fn != NULL) { - png_ptr->write_data_fn = NULL; - png_warning(png_ptr, + modpng14_ptr->write_data_fn = NULL; + modpng14_warning(modpng14_ptr, "It's an error to set both read_data_fn and write_data_fn in the "); - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "same structure. Resetting write_data_fn to NULL."); } -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_ptr->output_flush_fn = NULL; +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) + modpng14_ptr->output_flush_fn = NULL; #endif } --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngrtran.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngrtran.c @@ -1,128 +1,128 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This file contains functions optionally called by an application - * in order to tell libpng how to handle data when reading a PNG. + * in order to tell libmodpng14 how to handle data when reading a PNG. * Transformations that are used in both reading and writing are * in pngtrans.c. */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" /* Set the action on getting a CRC error for an ancillary or critical chunk. */ -void PNGAPI -png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) +void MODPNG14API +modpng14_set_crc_action(modpng14_structp modpng14_ptr, int crit_action, int ancil_action) { - png_debug(1, "in png_set_crc_action\n"); - /* Tell libpng how we react to CRC errors in critical chunks */ + modpng14_debug(1, "in modpng14_set_crc_action\n"); + /* Tell libmodpng14 how we react to CRC errors in critical chunks */ switch (crit_action) { - case PNG_CRC_NO_CHANGE: /* leave setting as is */ + case MODPNG14_CRC_NO_CHANGE: /* leave setting as is */ break; - case PNG_CRC_WARN_USE: /* warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE; + case MODPNG14_CRC_WARN_USE: /* warn/use data */ + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_CRITICAL_MASK; + modpng14_ptr->flags |= MODPNG14_FLAG_CRC_CRITICAL_USE; break; - case PNG_CRC_QUIET_USE: /* quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE | - PNG_FLAG_CRC_CRITICAL_IGNORE; + case MODPNG14_CRC_QUIET_USE: /* quiet/use data */ + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_CRITICAL_MASK; + modpng14_ptr->flags |= MODPNG14_FLAG_CRC_CRITICAL_USE | + MODPNG14_FLAG_CRC_CRITICAL_IGNORE; break; - case PNG_CRC_WARN_DISCARD: /* not a valid action for critical data */ - png_warning(png_ptr, "Can't discard critical data on CRC error."); - case PNG_CRC_ERROR_QUIT: /* error/quit */ - case PNG_CRC_DEFAULT: + case MODPNG14_CRC_WARN_DISCARD: /* not a valid action for critical data */ + modpng14_warning(modpng14_ptr, "Can't discard critical data on CRC error."); + case MODPNG14_CRC_ERROR_QUIT: /* error/quit */ + case MODPNG14_CRC_DEFAULT: default: - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_CRITICAL_MASK; break; } switch (ancil_action) { - case PNG_CRC_NO_CHANGE: /* leave setting as is */ + case MODPNG14_CRC_NO_CHANGE: /* leave setting as is */ break; - case PNG_CRC_WARN_USE: /* warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE; + case MODPNG14_CRC_WARN_USE: /* warn/use data */ + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_ANCILLARY_MASK; + modpng14_ptr->flags |= MODPNG14_FLAG_CRC_ANCILLARY_USE; break; - case PNG_CRC_QUIET_USE: /* quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE | - PNG_FLAG_CRC_ANCILLARY_NOWARN; + case MODPNG14_CRC_QUIET_USE: /* quiet/use data */ + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_ANCILLARY_MASK; + modpng14_ptr->flags |= MODPNG14_FLAG_CRC_ANCILLARY_USE | + MODPNG14_FLAG_CRC_ANCILLARY_NOWARN; break; - case PNG_CRC_ERROR_QUIT: /* error/quit */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN; + case MODPNG14_CRC_ERROR_QUIT: /* error/quit */ + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_ANCILLARY_MASK; + modpng14_ptr->flags |= MODPNG14_FLAG_CRC_ANCILLARY_NOWARN; break; - case PNG_CRC_WARN_DISCARD: /* warn/discard data */ - case PNG_CRC_DEFAULT: + case MODPNG14_CRC_WARN_DISCARD: /* warn/discard data */ + case MODPNG14_CRC_DEFAULT: default: - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; + modpng14_ptr->flags &= ~MODPNG14_FLAG_CRC_ANCILLARY_MASK; break; } } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) && \ + defined(MODPNG14_FLOATING_POINT_SUPPORTED) /* handle alpha and tRNS via a background color */ -void PNGAPI -png_set_background(png_structp png_ptr, - png_color_16p background_color, int background_gamma_code, +void MODPNG14API +modpng14_set_background(modpng14_structp modpng14_ptr, + modpng14_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma) { - png_debug(1, "in png_set_background\n"); - if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) + modpng14_debug(1, "in modpng14_set_background\n"); + if (background_gamma_code == MODPNG14_BACKGROUND_GAMMA_UNKNOWN) { - png_warning(png_ptr, "Application must supply a known background gamma"); + modpng14_warning(modpng14_ptr, "Application must supply a known background gamma"); return; } - png_ptr->transformations |= PNG_BACKGROUND; - png_memcpy(&(png_ptr->background), background_color, sizeof(png_color_16)); - png_ptr->background_gamma = (float)background_gamma; - png_ptr->background_gamma_type = (png_byte)(background_gamma_code); - png_ptr->transformations |= (need_expand ? PNG_BACKGROUND_EXPAND : 0); + modpng14_ptr->transformations |= MODPNG14_BACKGROUND; + modpng14_memcpy(&(modpng14_ptr->background), background_color, sizeof(modpng14_color_16)); + modpng14_ptr->background_gamma = (float)background_gamma; + modpng14_ptr->background_gamma_type = (modpng14_byte)(background_gamma_code); + modpng14_ptr->transformations |= (need_expand ? MODPNG14_BACKGROUND_EXPAND : 0); /* Note: if need_expand is set and color_type is either RGB or RGB_ALPHA * (in which case need_expand is superfluous anyway), the background color * might actually be gray yet not be flagged as such. This is not a problem - * for the current code, which uses PNG_BACKGROUND_IS_GRAY only to - * decide when to do the png_do_gray_to_rgb() transformation. + * for the current code, which uses MODPNG14_BACKGROUND_IS_GRAY only to + * decide when to do the modpng14_do_gray_to_rgb() transformation. */ - if ((need_expand && !(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) || + if ((need_expand && !(modpng14_ptr->color_type & MODPNG14_COLOR_MASK_COLOR)) || (!need_expand && background_color->red == background_color->green && background_color->red == background_color->blue)) - png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; + modpng14_ptr->mode |= MODPNG14_BACKGROUND_IS_GRAY; } #endif -#if defined(PNG_READ_16_TO_8_SUPPORTED) +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) /* strip 16 bit depth files to 8 bit depth */ -void PNGAPI -png_set_strip_16(png_structp png_ptr) +void MODPNG14API +modpng14_set_strip_16(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_strip_16\n"); - png_ptr->transformations |= PNG_16_TO_8; + modpng14_debug(1, "in modpng14_set_strip_16\n"); + modpng14_ptr->transformations |= MODPNG14_16_TO_8; } #endif -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -void PNGAPI -png_set_strip_alpha(png_structp png_ptr) +#if defined(MODPNG14_READ_STRIP_ALPHA_SUPPORTED) +void MODPNG14API +modpng14_set_strip_alpha(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_strip_alpha\n"); - png_ptr->transformations |= PNG_STRIP_ALPHA; + modpng14_debug(1, "in modpng14_set_strip_alpha\n"); + modpng14_ptr->transformations |= MODPNG14_STRIP_ALPHA; } #endif -#if defined(PNG_READ_DITHER_SUPPORTED) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) /* Dither file to 8 bit. Supply a palette, the current number * of elements in the palette, the maximum number of elements * allowed, and a histogram if possible. If the current number @@ -132,31 +132,31 @@ * simply are reducing the number of colors in a paletted image. */ -typedef struct png_dsort_struct +typedef struct modpng14_dsort_struct { - struct png_dsort_struct FAR * next; - png_byte left; - png_byte right; -} png_dsort; -typedef png_dsort FAR * png_dsortp; -typedef png_dsort FAR * FAR * png_dsortpp; - -void PNGAPI -png_set_dither(png_structp png_ptr, png_colorp palette, - int num_palette, int maximum_colors, png_uint_16p histogram, + struct modpng14_dsort_struct FAR * next; + modpng14_byte left; + modpng14_byte right; +} modpng14_dsort; +typedef modpng14_dsort FAR * modpng14_dsortp; +typedef modpng14_dsort FAR * FAR * modpng14_dsortpp; + +void MODPNG14API +modpng14_set_dither(modpng14_structp modpng14_ptr, modpng14_colorp palette, + int num_palette, int maximum_colors, modpng14_uint_16p histogram, int full_dither) { - png_debug(1, "in png_set_dither\n"); - png_ptr->transformations |= PNG_DITHER; + modpng14_debug(1, "in modpng14_set_dither\n"); + modpng14_ptr->transformations |= MODPNG14_DITHER; if (!full_dither) { int i; - png_ptr->dither_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * sizeof (png_byte))); + modpng14_ptr->dither_index = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num_palette * sizeof (modpng14_byte))); for (i = 0; i < num_palette; i++) - png_ptr->dither_index[i] = (png_byte)i; + modpng14_ptr->dither_index[i] = (modpng14_byte)i; } if (num_palette > maximum_colors) @@ -169,12 +169,12 @@ int i; /* initialize an array to sort colors */ - png_ptr->dither_sort = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * sizeof (png_byte))); + modpng14_ptr->dither_sort = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num_palette * sizeof (modpng14_byte))); /* initialize the dither_sort array */ for (i = 0; i < num_palette; i++) - png_ptr->dither_sort[i] = (png_byte)i; + modpng14_ptr->dither_sort[i] = (modpng14_byte)i; /* Find the least used palette entries by starting a bubble sort, and running it until we have sorted @@ -190,14 +190,14 @@ done = 1; for (j = 0; j < i; j++) { - if (histogram[png_ptr->dither_sort[j]] - < histogram[png_ptr->dither_sort[j + 1]]) + if (histogram[modpng14_ptr->dither_sort[j]] + < histogram[modpng14_ptr->dither_sort[j + 1]]) { - png_byte t; + modpng14_byte t; - t = png_ptr->dither_sort[j]; - png_ptr->dither_sort[j] = png_ptr->dither_sort[j + 1]; - png_ptr->dither_sort[j + 1] = t; + t = modpng14_ptr->dither_sort[j]; + modpng14_ptr->dither_sort[j] = modpng14_ptr->dither_sort[j + 1]; + modpng14_ptr->dither_sort[j + 1] = t; done = 0; } } @@ -214,11 +214,11 @@ move the others */ for (i = 0; i < maximum_colors; i++) { - if ((int)png_ptr->dither_sort[i] >= maximum_colors) + if ((int)modpng14_ptr->dither_sort[i] >= maximum_colors) { do j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); + while ((int)modpng14_ptr->dither_sort[j] >= maximum_colors); palette[i] = palette[j]; } } @@ -232,38 +232,38 @@ for (i = 0; i < maximum_colors; i++) { /* only move the colors we need to */ - if ((int)png_ptr->dither_sort[i] >= maximum_colors) + if ((int)modpng14_ptr->dither_sort[i] >= maximum_colors) { - png_color tmp_color; + modpng14_color tmp_color; do j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); + while ((int)modpng14_ptr->dither_sort[j] >= maximum_colors); tmp_color = palette[j]; palette[j] = palette[i]; palette[i] = tmp_color; /* indicate where the color went */ - png_ptr->dither_index[j] = (png_byte)i; - png_ptr->dither_index[i] = (png_byte)j; + modpng14_ptr->dither_index[j] = (modpng14_byte)i; + modpng14_ptr->dither_index[i] = (modpng14_byte)j; } } /* find closest color for those colors we are not using */ for (i = 0; i < num_palette; i++) { - if ((int)png_ptr->dither_index[i] >= maximum_colors) + if ((int)modpng14_ptr->dither_index[i] >= maximum_colors) { int min_d, k, min_k, d_index; /* find the closest color to one we threw out */ - d_index = png_ptr->dither_index[i]; - min_d = PNG_COLOR_DIST(palette[d_index], palette[0]); + d_index = modpng14_ptr->dither_index[i]; + min_d = MODPNG14_COLOR_DIST(palette[d_index], palette[0]); for (k = 1, min_k = 0; k < maximum_colors; k++) { int d; - d = PNG_COLOR_DIST(palette[d_index], palette[k]); + d = MODPNG14_COLOR_DIST(palette[d_index], palette[k]); if (d < min_d) { @@ -272,12 +272,12 @@ } } /* point to closest color */ - png_ptr->dither_index[i] = (png_byte)min_k; + modpng14_ptr->dither_index[i] = (modpng14_byte)min_k; } } } - png_free(png_ptr, png_ptr->dither_sort); - png_ptr->dither_sort=NULL; + modpng14_free(modpng14_ptr, modpng14_ptr->dither_sort); + modpng14_ptr->dither_sort=NULL; } else { @@ -292,29 +292,29 @@ int i; int max_d; int num_new_palette; - png_dsortp t; - png_dsortpp hash; + modpng14_dsortp t; + modpng14_dsortpp hash; t=NULL; /* initialize palette index arrays */ - png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * sizeof (png_byte))); - png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * sizeof (png_byte))); + modpng14_ptr->index_to_palette = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num_palette * sizeof (modpng14_byte))); + modpng14_ptr->palette_to_index = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num_palette * sizeof (modpng14_byte))); /* initialize the sort array */ for (i = 0; i < num_palette; i++) { - png_ptr->index_to_palette[i] = (png_byte)i; - png_ptr->palette_to_index[i] = (png_byte)i; + modpng14_ptr->index_to_palette[i] = (modpng14_byte)i; + modpng14_ptr->palette_to_index[i] = (modpng14_byte)i; } - hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 * - sizeof (png_dsortp))); + hash = (modpng14_dsortpp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)(769 * + sizeof (modpng14_dsortp))); for (i = 0; i < 769; i++) hash[i] = NULL; -/* png_memset(hash, 0, 769 * sizeof (png_dsortp)); */ +/* modpng14_memset(hash, 0, 769 * sizeof (modpng14_dsortp)); */ num_new_palette = num_palette; @@ -338,18 +338,18 @@ { int d; - d = PNG_COLOR_DIST(palette[i], palette[j]); + d = MODPNG14_COLOR_DIST(palette[i], palette[j]); if (d <= max_d) { - t = (png_dsortp)png_malloc_warn(png_ptr, - (png_uint_32)(sizeof(png_dsort))); + t = (modpng14_dsortp)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)(sizeof(modpng14_dsort))); if (t == NULL) break; t->next = hash[d]; - t->left = (png_byte)i; - t->right = (png_byte)j; + t->left = (modpng14_byte)i; + t->right = (modpng14_byte)j; hash[d] = t; } } @@ -362,13 +362,13 @@ { if (hash[i] != NULL) { - png_dsortp p; + modpng14_dsortp p; for (p = hash[i]; p; p = p->next) { - if ((int)png_ptr->index_to_palette[p->left] + if ((int)modpng14_ptr->index_to_palette[p->left] < num_new_palette && - (int)png_ptr->index_to_palette[p->right] + (int)modpng14_ptr->index_to_palette[p->right] < num_new_palette) { int j, next_j; @@ -385,7 +385,7 @@ } num_new_palette--; - palette[png_ptr->index_to_palette[j]] + palette[modpng14_ptr->index_to_palette[j]] = palette[num_new_palette]; if (!full_dither) { @@ -393,24 +393,24 @@ for (k = 0; k < num_palette; k++) { - if (png_ptr->dither_index[k] == - png_ptr->index_to_palette[j]) - png_ptr->dither_index[k] = - png_ptr->index_to_palette[next_j]; - if ((int)png_ptr->dither_index[k] == + if (modpng14_ptr->dither_index[k] == + modpng14_ptr->index_to_palette[j]) + modpng14_ptr->dither_index[k] = + modpng14_ptr->index_to_palette[next_j]; + if ((int)modpng14_ptr->dither_index[k] == num_new_palette) - png_ptr->dither_index[k] = - png_ptr->index_to_palette[j]; + modpng14_ptr->dither_index[k] = + modpng14_ptr->index_to_palette[j]; } } - png_ptr->index_to_palette[png_ptr->palette_to_index - [num_new_palette]] = png_ptr->index_to_palette[j]; - png_ptr->palette_to_index[png_ptr->index_to_palette[j]] - = png_ptr->palette_to_index[num_new_palette]; + modpng14_ptr->index_to_palette[modpng14_ptr->palette_to_index + [num_new_palette]] = modpng14_ptr->index_to_palette[j]; + modpng14_ptr->palette_to_index[modpng14_ptr->index_to_palette[j]] + = modpng14_ptr->palette_to_index[num_new_palette]; - png_ptr->index_to_palette[j] = (png_byte)num_new_palette; - png_ptr->palette_to_index[num_new_palette] = (png_byte)j; + modpng14_ptr->index_to_palette[j] = (modpng14_byte)num_new_palette; + modpng14_ptr->palette_to_index[num_new_palette] = (modpng14_byte)j; } if (num_new_palette <= maximum_colors) break; @@ -424,11 +424,11 @@ { if (hash[i] != NULL) { - png_dsortp p = hash[i]; + modpng14_dsortp p = hash[i]; while (p) { t = p->next; - png_free(png_ptr, p); + modpng14_free(modpng14_ptr, p); p = t; } } @@ -436,59 +436,59 @@ } max_d += 96; } - png_free(png_ptr, hash); - png_free(png_ptr, png_ptr->palette_to_index); - png_free(png_ptr, png_ptr->index_to_palette); - png_ptr->palette_to_index=NULL; - png_ptr->index_to_palette=NULL; + modpng14_free(modpng14_ptr, hash); + modpng14_free(modpng14_ptr, modpng14_ptr->palette_to_index); + modpng14_free(modpng14_ptr, modpng14_ptr->index_to_palette); + modpng14_ptr->palette_to_index=NULL; + modpng14_ptr->index_to_palette=NULL; } num_palette = maximum_colors; } - if (png_ptr->palette == NULL) + if (modpng14_ptr->palette == NULL) { - png_ptr->palette = palette; + modpng14_ptr->palette = palette; } - png_ptr->num_palette = (png_uint_16)num_palette; + modpng14_ptr->num_palette = (modpng14_uint_16)num_palette; if (full_dither) { int i; - png_bytep distance; - int total_bits = PNG_DITHER_RED_BITS + PNG_DITHER_GREEN_BITS + - PNG_DITHER_BLUE_BITS; - int num_red = (1 << PNG_DITHER_RED_BITS); - int num_green = (1 << PNG_DITHER_GREEN_BITS); - int num_blue = (1 << PNG_DITHER_BLUE_BITS); - png_size_t num_entries = ((png_size_t)1 << total_bits); - - png_ptr->palette_lookup = (png_bytep )png_malloc(png_ptr, - (png_uint_32)(num_entries * sizeof (png_byte))); + modpng14_bytep distance; + int total_bits = MODPNG14_DITHER_RED_BITS + MODPNG14_DITHER_GREEN_BITS + + MODPNG14_DITHER_BLUE_BITS; + int num_red = (1 << MODPNG14_DITHER_RED_BITS); + int num_green = (1 << MODPNG14_DITHER_GREEN_BITS); + int num_blue = (1 << MODPNG14_DITHER_BLUE_BITS); + modpng14_size_t num_entries = ((modpng14_size_t)1 << total_bits); + + modpng14_ptr->palette_lookup = (modpng14_bytep )modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num_entries * sizeof (modpng14_byte))); - png_memset(png_ptr->palette_lookup, 0, num_entries * sizeof (png_byte)); + modpng14_memset(modpng14_ptr->palette_lookup, 0, num_entries * sizeof (modpng14_byte)); - distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries * - sizeof(png_byte))); + distance = (modpng14_bytep)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)(num_entries * + sizeof(modpng14_byte))); - png_memset(distance, 0xff, num_entries * sizeof(png_byte)); + modpng14_memset(distance, 0xff, num_entries * sizeof(modpng14_byte)); for (i = 0; i < num_palette; i++) { int ir, ig, ib; - int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS)); - int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS)); - int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS)); + int r = (palette[i].red >> (8 - MODPNG14_DITHER_RED_BITS)); + int g = (palette[i].green >> (8 - MODPNG14_DITHER_GREEN_BITS)); + int b = (palette[i].blue >> (8 - MODPNG14_DITHER_BLUE_BITS)); for (ir = 0; ir < num_red; ir++) { int dr = abs(ir - r); - int index_r = (ir << (PNG_DITHER_BLUE_BITS + PNG_DITHER_GREEN_BITS)); + int index_r = (ir << (MODPNG14_DITHER_BLUE_BITS + MODPNG14_DITHER_GREEN_BITS)); for (ig = 0; ig < num_green; ig++) { int dg = abs(ig - g); int dt = dr + dg; int dm = ((dr > dg) ? dr : dg); - int index_g = index_r | (ig << PNG_DITHER_BLUE_BITS); + int index_g = index_r | (ig << MODPNG14_DITHER_BLUE_BITS); for (ib = 0; ib < num_blue; ib++) { @@ -499,20 +499,20 @@ if (d < (int)distance[d_index]) { - distance[d_index] = (png_byte)d; - png_ptr->palette_lookup[d_index] = (png_byte)i; + distance[d_index] = (modpng14_byte)d; + modpng14_ptr->palette_lookup[d_index] = (modpng14_byte)i; } } } } } - png_free(png_ptr, distance); + modpng14_free(modpng14_ptr, distance); } } #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) && defined(MODPNG14_FLOATING_POINT_SUPPORTED) /* Transform the image from the file_gamma to the screen_gamma. We * only do transformations on images where the file_gamma and screen_gamma * are not close reciprocals, otherwise it slows things down slightly, and @@ -522,33 +522,33 @@ * are present in the tRNS array for palette images. We can't do it here * because we don't necessarily have the tRNS chunk yet. */ -void PNGAPI -png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) +void MODPNG14API +modpng14_set_gamma(modpng14_structp modpng14_ptr, double scrn_gamma, double file_gamma) { - png_debug(1, "in png_set_gamma\n"); - if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) - png_ptr->transformations |= PNG_GAMMA; - png_ptr->gamma = (float)file_gamma; - png_ptr->screen_gamma = (float)scrn_gamma; + modpng14_debug(1, "in modpng14_set_gamma\n"); + if ((fabs(scrn_gamma * file_gamma - 1.0) > MODPNG14_GAMMA_THRESHOLD) || + (modpng14_ptr->color_type & MODPNG14_COLOR_MASK_ALPHA) || + (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE)) + modpng14_ptr->transformations |= MODPNG14_GAMMA; + modpng14_ptr->gamma = (float)file_gamma; + modpng14_ptr->screen_gamma = (float)scrn_gamma; } #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) /* Expand paletted images to RGB, expand grayscale images of * less than 8-bit depth to 8-bit depth, and expand tRNS chunks * to alpha channels. */ -void PNGAPI -png_set_expand(png_structp png_ptr) +void MODPNG14API +modpng14_set_expand(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + modpng14_debug(1, "in modpng14_set_expand\n"); + modpng14_ptr->transformations |= MODPNG14_EXPAND; } /* GRR 19990627: the following three functions currently are identical - * to png_set_expand(). However, it is entirely reasonable that someone + * to modpng14_set_expand(). However, it is entirely reasonable that someone * might wish to expand an indexed image to RGB but *not* expand a single, * fully transparent palette entry to a full alpha channel--perhaps instead * convert tRNS to the grayscale/RGB format (16-bit RGB value), or replace @@ -557,84 +557,84 @@ * a bit more fine-grained, with separate bits for each of these three * functions. * - * More to the point, these functions make it obvious what libpng will be + * More to the point, these functions make it obvious what libmodpng14 will be * doing, whereas "expand" can (and does) mean any number of things. */ /* Expand paletted images to RGB. */ -void PNGAPI -png_set_palette_to_rgb(png_structp png_ptr) +void MODPNG14API +modpng14_set_palette_to_rgb(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + modpng14_debug(1, "in modpng14_set_expand\n"); + modpng14_ptr->transformations |= MODPNG14_EXPAND; } /* Expand grayscale images of less than 8-bit depth to 8 bits. */ -void PNGAPI -png_set_gray_1_2_4_to_8(png_structp png_ptr) +void MODPNG14API +modpng14_set_gray_1_2_4_to_8(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + modpng14_debug(1, "in modpng14_set_expand\n"); + modpng14_ptr->transformations |= MODPNG14_EXPAND; } /* Expand tRNS chunks to alpha channels. */ -void PNGAPI -png_set_tRNS_to_alpha(png_structp png_ptr) +void MODPNG14API +modpng14_set_tRNS_to_alpha(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + modpng14_debug(1, "in modpng14_set_expand\n"); + modpng14_ptr->transformations |= MODPNG14_EXPAND; } -#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */ +#endif /* defined(MODPNG14_READ_EXPAND_SUPPORTED) */ -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -void PNGAPI -png_set_gray_to_rgb(png_structp png_ptr) +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) +void MODPNG14API +modpng14_set_gray_to_rgb(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_gray_to_rgb\n"); - png_ptr->transformations |= PNG_GRAY_TO_RGB; + modpng14_debug(1, "in modpng14_set_gray_to_rgb\n"); + modpng14_ptr->transformations |= MODPNG14_GRAY_TO_RGB; } #endif -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) +#if defined(MODPNG14_FLOATING_POINT_SUPPORTED) /* Convert a RGB image to a grayscale of the same width. This allows us, * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image. */ -void PNGAPI -png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red, +void MODPNG14API +modpng14_set_rgb_to_gray(modpng14_structp modpng14_ptr, int error_action, double red, double green) { int red_fixed = (int)((float)red*100000.0 + 0.5); int green_fixed = (int)((float)green*100000.0 + 0.5); - png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed); + modpng14_set_rgb_to_gray_fixed(modpng14_ptr, error_action, red_fixed, green_fixed); } #endif -void PNGAPI -png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, - png_fixed_point red, png_fixed_point green) +void MODPNG14API +modpng14_set_rgb_to_gray_fixed(modpng14_structp modpng14_ptr, int error_action, + modpng14_fixed_point red, modpng14_fixed_point green) { - png_debug(1, "in png_set_rgb_to_gray\n"); + modpng14_debug(1, "in modpng14_set_rgb_to_gray\n"); switch(error_action) { - case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY; + case 1: modpng14_ptr->transformations |= MODPNG14_RGB_TO_GRAY; break; - case 2: png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; + case 2: modpng14_ptr->transformations |= MODPNG14_RGB_TO_GRAY_WARN; break; - case 3: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; + case 3: modpng14_ptr->transformations |= MODPNG14_RGB_TO_GRAY_ERR; } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#if defined(PNG_READ_EXPAND_SUPPORTED) - png_ptr->transformations |= PNG_EXPAND; + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) + modpng14_ptr->transformations |= MODPNG14_EXPAND; #else { - png_warning(png_ptr, "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED."); - png_ptr->transformations &= ~PNG_RGB_TO_GRAY; + modpng14_warning(modpng14_ptr, "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED."); + modpng14_ptr->transformations &= ~MODPNG14_RGB_TO_GRAY; } #endif { - png_uint_16 red_int, green_int; + modpng14_uint_16 red_int, green_int; if(red < 0 || green < 0) { red_int = 6968; /* .212671 * 32768 + .5 */ @@ -642,38 +642,38 @@ } else if(red + green < 100000L) { - red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L); - green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L); + red_int = (modpng14_uint_16)(((modpng14_uint_32)red*32768L)/100000L); + green_int = (modpng14_uint_16)(((modpng14_uint_32)green*32768L)/100000L); } else { - png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients"); + modpng14_warning(modpng14_ptr, "ignoring out of range rgb_to_gray coefficients"); red_int = 6968; green_int = 23434; } - png_ptr->rgb_to_gray_red_coeff = red_int; - png_ptr->rgb_to_gray_green_coeff = green_int; - png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768-red_int-green_int); + modpng14_ptr->rgb_to_gray_red_coeff = red_int; + modpng14_ptr->rgb_to_gray_green_coeff = green_int; + modpng14_ptr->rgb_to_gray_blue_coeff = (modpng14_uint_16)(32768-red_int-green_int); } } #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -void PNGAPI -png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_LEGACY_SUPPORTED) +void MODPNG14API +modpng14_set_read_user_transform_fn(modpng14_structp modpng14_ptr, modpng14_user_transform_ptr read_user_transform_fn) { - png_debug(1, "in png_set_read_user_transform_fn\n"); -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->read_user_transform_fn = read_user_transform_fn; + modpng14_debug(1, "in modpng14_set_read_user_transform_fn\n"); +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) + modpng14_ptr->transformations |= MODPNG14_USER_TRANSFORM; + modpng14_ptr->read_user_transform_fn = read_user_transform_fn; #endif -#ifdef PNG_LEGACY_SUPPORTED +#ifdef MODPNG14_LEGACY_SUPPORTED if(read_user_transform_fn) - png_warning(png_ptr, - "This version of libpng does not support user transforms"); + modpng14_warning(modpng14_ptr, + "This version of libmodpng14 does not support user transforms"); #endif } #endif @@ -682,71 +682,71 @@ * the palette. */ void /* PRIVATE */ -png_init_read_transformations(png_structp png_ptr) +modpng14_init_read_transformations(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_init_read_transformations\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if(png_ptr != NULL) + modpng14_debug(1, "in modpng14_init_read_transformations\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) + if(modpng14_ptr != NULL) #endif { -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \ - || defined(PNG_READ_GAMMA_SUPPORTED) - int color_type = png_ptr->color_type; +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) || defined(MODPNG14_READ_SHIFT_SUPPORTED) \ + || defined(MODPNG14_READ_GAMMA_SUPPORTED) + int color_type = modpng14_ptr->color_type; #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED) - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) && - (png_ptr->transformations & PNG_EXPAND)) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) && defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_BACKGROUND_EXPAND) && + (modpng14_ptr->transformations & MODPNG14_EXPAND)) { - if (!(color_type & PNG_COLOR_MASK_COLOR)) /* i.e., GRAY or GRAY_ALPHA */ + if (!(color_type & MODPNG14_COLOR_MASK_COLOR)) /* i.e., GRAY or GRAY_ALPHA */ { /* expand background chunk. */ - switch (png_ptr->bit_depth) + switch (modpng14_ptr->bit_depth) { case 1: - png_ptr->background.gray *= (png_uint_16)0xff; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; + modpng14_ptr->background.gray *= (modpng14_uint_16)0xff; + modpng14_ptr->background.red = modpng14_ptr->background.green + = modpng14_ptr->background.blue = modpng14_ptr->background.gray; break; case 2: - png_ptr->background.gray *= (png_uint_16)0x55; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; + modpng14_ptr->background.gray *= (modpng14_uint_16)0x55; + modpng14_ptr->background.red = modpng14_ptr->background.green + = modpng14_ptr->background.blue = modpng14_ptr->background.gray; break; case 4: - png_ptr->background.gray *= (png_uint_16)0x11; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; + modpng14_ptr->background.gray *= (modpng14_uint_16)0x11; + modpng14_ptr->background.red = modpng14_ptr->background.green + = modpng14_ptr->background.blue = modpng14_ptr->background.gray; break; case 8: case 16: - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; + modpng14_ptr->background.red = modpng14_ptr->background.green + = modpng14_ptr->background.blue = modpng14_ptr->background.gray; break; } } - else if (color_type == PNG_COLOR_TYPE_PALETTE) + else if (color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_ptr->background.red = - png_ptr->palette[png_ptr->background.index].red; - png_ptr->background.green = - png_ptr->palette[png_ptr->background.index].green; - png_ptr->background.blue = - png_ptr->palette[png_ptr->background.index].blue; + modpng14_ptr->background.red = + modpng14_ptr->palette[modpng14_ptr->background.index].red; + modpng14_ptr->background.green = + modpng14_ptr->palette[modpng14_ptr->background.index].green; + modpng14_ptr->background.blue = + modpng14_ptr->palette[modpng14_ptr->background.index].blue; -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_ALPHA) { -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (!(png_ptr->transformations & PNG_EXPAND)) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) + if (!(modpng14_ptr->transformations & MODPNG14_EXPAND)) #endif { /* invert the alpha channel (in tRNS) unless the pixels are going to be expanded, in which case leave it for later */ int i,istop; - istop=(int)png_ptr->num_trans; + istop=(int)modpng14_ptr->num_trans; for (i=0; itrans[i] = (png_byte)(255 - png_ptr->trans[i]); + modpng14_ptr->trans[i] = (modpng14_byte)(255 - modpng14_ptr->trans[i]); } } #endif @@ -755,252 +755,252 @@ } #endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - png_ptr->background_1 = png_ptr->background; +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) && defined(MODPNG14_READ_GAMMA_SUPPORTED) + modpng14_ptr->background_1 = modpng14_ptr->background; #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) && defined(MODPNG14_FLOATING_POINT_SUPPORTED) - if ((color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_trans != 0) - && (fabs(png_ptr->screen_gamma * png_ptr->gamma - 1.0) - < PNG_GAMMA_THRESHOLD)) + if ((color_type == MODPNG14_COLOR_TYPE_PALETTE && modpng14_ptr->num_trans != 0) + && (fabs(modpng14_ptr->screen_gamma * modpng14_ptr->gamma - 1.0) + < MODPNG14_GAMMA_THRESHOLD)) { int i,k; k=0; - for (i=0; inum_trans; i++) + for (i=0; inum_trans; i++) { - if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff) + if (modpng14_ptr->trans[i] != 0 && modpng14_ptr->trans[i] != 0xff) k=1; /* partial transparency is present */ } if (k == 0) - png_ptr->transformations &= (~PNG_GAMMA); + modpng14_ptr->transformations &= (~MODPNG14_GAMMA); } - if (png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) + if (modpng14_ptr->transformations & (MODPNG14_GAMMA | MODPNG14_RGB_TO_GRAY)) { - png_build_gamma_table(png_ptr); -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) + modpng14_build_gamma_table(modpng14_ptr); +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BACKGROUND) { - if (color_type == PNG_COLOR_TYPE_PALETTE) + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) { /* could skip if no transparency and */ - png_color back, back_1; - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; + modpng14_color back, back_1; + modpng14_colorp palette = modpng14_ptr->palette; + int num_palette = modpng14_ptr->num_palette; int i; - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) + if (modpng14_ptr->background_gamma_type == MODPNG14_BACKGROUND_GAMMA_FILE) { - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; + back.red = modpng14_ptr->gamma_table[modpng14_ptr->background.red]; + back.green = modpng14_ptr->gamma_table[modpng14_ptr->background.green]; + back.blue = modpng14_ptr->gamma_table[modpng14_ptr->background.blue]; + + back_1.red = modpng14_ptr->gamma_to_1[modpng14_ptr->background.red]; + back_1.green = modpng14_ptr->gamma_to_1[modpng14_ptr->background.green]; + back_1.blue = modpng14_ptr->gamma_to_1[modpng14_ptr->background.blue]; } else { double g, gs; - switch (png_ptr->background_gamma_type) + switch (modpng14_ptr->background_gamma_type) { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); + case MODPNG14_BACKGROUND_GAMMA_SCREEN: + g = (modpng14_ptr->screen_gamma); gs = 1.0; break; - case PNG_BACKGROUND_GAMMA_FILE: - g = 1.0 / (png_ptr->gamma); - gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); + case MODPNG14_BACKGROUND_GAMMA_FILE: + g = 1.0 / (modpng14_ptr->gamma); + gs = 1.0 / (modpng14_ptr->gamma * modpng14_ptr->screen_gamma); break; - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = 1.0 / (png_ptr->background_gamma); - gs = 1.0 / (png_ptr->background_gamma * - png_ptr->screen_gamma); + case MODPNG14_BACKGROUND_GAMMA_UNIQUE: + g = 1.0 / (modpng14_ptr->background_gamma); + gs = 1.0 / (modpng14_ptr->background_gamma * + modpng14_ptr->screen_gamma); break; default: g = 1.0; /* back_1 */ gs = 1.0; /* back */ } - if ( fabs(gs - 1.0) < PNG_GAMMA_THRESHOLD) + if ( fabs(gs - 1.0) < MODPNG14_GAMMA_THRESHOLD) { - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; + back.red = (modpng14_byte)modpng14_ptr->background.red; + back.green = (modpng14_byte)modpng14_ptr->background.green; + back.blue = (modpng14_byte)modpng14_ptr->background.blue; } else { - back.red = (png_byte)(pow( - (double)png_ptr->background.red/255, gs) * 255.0 + .5); - back.green = (png_byte)(pow( - (double)png_ptr->background.green/255, gs) * 255.0 + .5); - back.blue = (png_byte)(pow( - (double)png_ptr->background.blue/255, gs) * 255.0 + .5); + back.red = (modpng14_byte)(pow( + (double)modpng14_ptr->background.red/255, gs) * 255.0 + .5); + back.green = (modpng14_byte)(pow( + (double)modpng14_ptr->background.green/255, gs) * 255.0 + .5); + back.blue = (modpng14_byte)(pow( + (double)modpng14_ptr->background.blue/255, gs) * 255.0 + .5); } - back_1.red = (png_byte)(pow( - (double)png_ptr->background.red/255, g) * 255.0 + .5); - back_1.green = (png_byte)(pow( - (double)png_ptr->background.green/255, g) * 255.0 + .5); - back_1.blue = (png_byte)(pow( - (double)png_ptr->background.blue/255, g) * 255.0 + .5); + back_1.red = (modpng14_byte)(pow( + (double)modpng14_ptr->background.red/255, g) * 255.0 + .5); + back_1.green = (modpng14_byte)(pow( + (double)modpng14_ptr->background.green/255, g) * 255.0 + .5); + back_1.blue = (modpng14_byte)(pow( + (double)modpng14_ptr->background.blue/255, g) * 255.0 + .5); } for (i = 0; i < num_palette; i++) { - if (i < (int)png_ptr->num_trans && png_ptr->trans[i] != 0xff) + if (i < (int)modpng14_ptr->num_trans && modpng14_ptr->trans[i] != 0xff) { - if (png_ptr->trans[i] == 0) + if (modpng14_ptr->trans[i] == 0) { palette[i] = back; } - else /* if (png_ptr->trans[i] != 0xff) */ + else /* if (modpng14_ptr->trans[i] != 0xff) */ { - png_byte v, w; + modpng14_byte v, w; - v = png_ptr->gamma_to_1[palette[i].red]; - png_composite(w, v, png_ptr->trans[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].green]; - png_composite(w, v, png_ptr->trans[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].blue]; - png_composite(w, v, png_ptr->trans[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; + v = modpng14_ptr->gamma_to_1[palette[i].red]; + modpng14_composite(w, v, modpng14_ptr->trans[i], back_1.red); + palette[i].red = modpng14_ptr->gamma_from_1[w]; + + v = modpng14_ptr->gamma_to_1[palette[i].green]; + modpng14_composite(w, v, modpng14_ptr->trans[i], back_1.green); + palette[i].green = modpng14_ptr->gamma_from_1[w]; + + v = modpng14_ptr->gamma_to_1[palette[i].blue]; + modpng14_composite(w, v, modpng14_ptr->trans[i], back_1.blue); + palette[i].blue = modpng14_ptr->gamma_from_1[w]; } } else { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; + palette[i].red = modpng14_ptr->gamma_table[palette[i].red]; + palette[i].green = modpng14_ptr->gamma_table[palette[i].green]; + palette[i].blue = modpng14_ptr->gamma_table[palette[i].blue]; } } } - /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */ + /* if (modpng14_ptr->background_gamma_type!=MODPNG14_BACKGROUND_GAMMA_UNKNOWN) */ else - /* color_type != PNG_COLOR_TYPE_PALETTE */ + /* color_type != MODPNG14_COLOR_TYPE_PALETTE */ { - double m = (double)(((png_uint_32)1 << png_ptr->bit_depth) - 1); + double m = (double)(((modpng14_uint_32)1 << modpng14_ptr->bit_depth) - 1); double g = 1.0; double gs = 1.0; - switch (png_ptr->background_gamma_type) + switch (modpng14_ptr->background_gamma_type) { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); + case MODPNG14_BACKGROUND_GAMMA_SCREEN: + g = (modpng14_ptr->screen_gamma); gs = 1.0; break; - case PNG_BACKGROUND_GAMMA_FILE: - g = 1.0 / (png_ptr->gamma); - gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); + case MODPNG14_BACKGROUND_GAMMA_FILE: + g = 1.0 / (modpng14_ptr->gamma); + gs = 1.0 / (modpng14_ptr->gamma * modpng14_ptr->screen_gamma); break; - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = 1.0 / (png_ptr->background_gamma); - gs = 1.0 / (png_ptr->background_gamma * - png_ptr->screen_gamma); + case MODPNG14_BACKGROUND_GAMMA_UNIQUE: + g = 1.0 / (modpng14_ptr->background_gamma); + gs = 1.0 / (modpng14_ptr->background_gamma * + modpng14_ptr->screen_gamma); break; } - png_ptr->background_1.gray = (png_uint_16)(pow( - (double)png_ptr->background.gray / m, g) * m + .5); - png_ptr->background.gray = (png_uint_16)(pow( - (double)png_ptr->background.gray / m, gs) * m + .5); - - if ((png_ptr->background.red != png_ptr->background.green) || - (png_ptr->background.red != png_ptr->background.blue) || - (png_ptr->background.red != png_ptr->background.gray)) + modpng14_ptr->background_1.gray = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.gray / m, g) * m + .5); + modpng14_ptr->background.gray = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.gray / m, gs) * m + .5); + + if ((modpng14_ptr->background.red != modpng14_ptr->background.green) || + (modpng14_ptr->background.red != modpng14_ptr->background.blue) || + (modpng14_ptr->background.red != modpng14_ptr->background.gray)) { /* RGB or RGBA with color background */ - png_ptr->background_1.red = (png_uint_16)(pow( - (double)png_ptr->background.red / m, g) * m + .5); - png_ptr->background_1.green = (png_uint_16)(pow( - (double)png_ptr->background.green / m, g) * m + .5); - png_ptr->background_1.blue = (png_uint_16)(pow( - (double)png_ptr->background.blue / m, g) * m + .5); - png_ptr->background.red = (png_uint_16)(pow( - (double)png_ptr->background.red / m, gs) * m + .5); - png_ptr->background.green = (png_uint_16)(pow( - (double)png_ptr->background.green / m, gs) * m + .5); - png_ptr->background.blue = (png_uint_16)(pow( - (double)png_ptr->background.blue / m, gs) * m + .5); + modpng14_ptr->background_1.red = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.red / m, g) * m + .5); + modpng14_ptr->background_1.green = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.green / m, g) * m + .5); + modpng14_ptr->background_1.blue = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.blue / m, g) * m + .5); + modpng14_ptr->background.red = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.red / m, gs) * m + .5); + modpng14_ptr->background.green = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.green / m, gs) * m + .5); + modpng14_ptr->background.blue = (modpng14_uint_16)(pow( + (double)modpng14_ptr->background.blue / m, gs) * m + .5); } else { /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */ - png_ptr->background_1.red = png_ptr->background_1.green - = png_ptr->background_1.blue = png_ptr->background_1.gray; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; + modpng14_ptr->background_1.red = modpng14_ptr->background_1.green + = modpng14_ptr->background_1.blue = modpng14_ptr->background_1.gray; + modpng14_ptr->background.red = modpng14_ptr->background.green + = modpng14_ptr->background.blue = modpng14_ptr->background.gray; } } } else - /* transformation does not include PNG_BACKGROUND */ -#endif /* PNG_READ_BACKGROUND_SUPPORTED */ - if (color_type == PNG_COLOR_TYPE_PALETTE) + /* transformation does not include MODPNG14_BACKGROUND */ +#endif /* MODPNG14_READ_BACKGROUND_SUPPORTED */ + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; + modpng14_colorp palette = modpng14_ptr->palette; + int num_palette = modpng14_ptr->num_palette; int i; for (i = 0; i < num_palette; i++) { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; + palette[i].red = modpng14_ptr->gamma_table[palette[i].red]; + palette[i].green = modpng14_ptr->gamma_table[palette[i].green]; + palette[i].blue = modpng14_ptr->gamma_table[palette[i].blue]; } } } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) else #endif -#endif /* PNG_READ_GAMMA_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */ -#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#endif /* MODPNG14_READ_GAMMA_SUPPORTED && MODPNG14_FLOATING_POINT_SUPPORTED */ +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) /* No GAMMA transformation */ - if ((png_ptr->transformations & PNG_BACKGROUND) && - (color_type == PNG_COLOR_TYPE_PALETTE)) + if ((modpng14_ptr->transformations & MODPNG14_BACKGROUND) && + (color_type == MODPNG14_COLOR_TYPE_PALETTE)) { int i; - int istop = (int)png_ptr->num_trans; - png_color back; - png_colorp palette = png_ptr->palette; - - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; + int istop = (int)modpng14_ptr->num_trans; + modpng14_color back; + modpng14_colorp palette = modpng14_ptr->palette; + + back.red = (modpng14_byte)modpng14_ptr->background.red; + back.green = (modpng14_byte)modpng14_ptr->background.green; + back.blue = (modpng14_byte)modpng14_ptr->background.blue; for (i = 0; i < istop; i++) { - if (png_ptr->trans[i] == 0) + if (modpng14_ptr->trans[i] == 0) { palette[i] = back; } - else if (png_ptr->trans[i] != 0xff) + else if (modpng14_ptr->trans[i] != 0xff) { - /* The png_composite() macro is defined in png.h */ - png_composite(palette[i].red, palette[i].red, - png_ptr->trans[i], back.red); - png_composite(palette[i].green, palette[i].green, - png_ptr->trans[i], back.green); - png_composite(palette[i].blue, palette[i].blue, - png_ptr->trans[i], back.blue); + /* The modpng14_composite() macro is defined in modpng14.h */ + modpng14_composite(palette[i].red, palette[i].red, + modpng14_ptr->trans[i], back.red); + modpng14_composite(palette[i].green, palette[i].green, + modpng14_ptr->trans[i], back.green); + modpng14_composite(palette[i].blue, palette[i].blue, + modpng14_ptr->trans[i], back.blue); } } } -#endif /* PNG_READ_BACKGROUND_SUPPORTED */ +#endif /* MODPNG14_READ_BACKGROUND_SUPPORTED */ -#if defined(PNG_READ_SHIFT_SUPPORTED) - if ((png_ptr->transformations & PNG_SHIFT) && - (color_type == PNG_COLOR_TYPE_PALETTE)) +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_SHIFT) && + (color_type == MODPNG14_COLOR_TYPE_PALETTE)) { - png_uint_16 i; - png_uint_16 istop = png_ptr->num_palette; - int sr = 8 - png_ptr->sig_bit.red; - int sg = 8 - png_ptr->sig_bit.green; - int sb = 8 - png_ptr->sig_bit.blue; + modpng14_uint_16 i; + modpng14_uint_16 istop = modpng14_ptr->num_palette; + int sr = 8 - modpng14_ptr->sig_bit.red; + int sg = 8 - modpng14_ptr->sig_bit.green; + int sb = 8 - modpng14_ptr->sig_bit.blue; if (sr < 0 || sr > 8) sr = 0; @@ -1010,16 +1010,16 @@ sb = 0; for (i = 0; i < istop; i++) { - png_ptr->palette[i].red >>= sr; - png_ptr->palette[i].green >>= sg; - png_ptr->palette[i].blue >>= sb; + modpng14_ptr->palette[i].red >>= sr; + modpng14_ptr->palette[i].green >>= sg; + modpng14_ptr->palette[i].blue >>= sb; } } -#endif /* PNG_READ_SHIFT_SUPPORTED */ +#endif /* MODPNG14_READ_SHIFT_SUPPORTED */ } -#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \ - && !defined(PNG_READ_BACKGROUND_SUPPORTED) - if(png_ptr) +#if !defined(MODPNG14_READ_GAMMA_SUPPORTED) && !defined(MODPNG14_READ_SHIFT_SUPPORTED) \ + && !defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if(modpng14_ptr) return; #endif } @@ -1029,25 +1029,25 @@ * assuming the transformations result in valid PNG data. */ void /* PRIVATE */ -png_read_transform_info(png_structp png_ptr, png_infop info_ptr) +modpng14_read_transform_info(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_debug(1, "in png_read_transform_info\n"); -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) + modpng14_debug(1, "in modpng14_read_transform_info\n"); +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_EXPAND) { - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (info_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - if (png_ptr->num_trans) - info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; + if (modpng14_ptr->num_trans) + info_ptr->color_type = MODPNG14_COLOR_TYPE_RGB_ALPHA; else - info_ptr->color_type = PNG_COLOR_TYPE_RGB; + info_ptr->color_type = MODPNG14_COLOR_TYPE_RGB; info_ptr->bit_depth = 8; info_ptr->num_trans = 0; } else { - if (png_ptr->num_trans) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; + if (modpng14_ptr->num_trans) + info_ptr->color_type |= MODPNG14_COLOR_MASK_ALPHA; if (info_ptr->bit_depth < 8) info_ptr->bit_depth = 8; info_ptr->num_trans = 0; @@ -1055,104 +1055,104 @@ } #endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BACKGROUND) { - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; + info_ptr->color_type &= ~MODPNG14_COLOR_MASK_ALPHA; info_ptr->num_trans = 0; - info_ptr->background = png_ptr->background; + info_ptr->background = modpng14_ptr->background; } #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->transformations & PNG_GAMMA) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_GAMMA) { -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->gamma = png_ptr->gamma; +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED + info_ptr->gamma = modpng14_ptr->gamma; #endif -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = png_ptr->int_gamma; +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + info_ptr->int_gamma = modpng14_ptr->int_gamma; #endif } #endif -#if defined(PNG_READ_16_TO_8_SUPPORTED) - if ((png_ptr->transformations & PNG_16_TO_8) && (info_ptr->bit_depth == 16)) +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_16_TO_8) && (info_ptr->bit_depth == 16)) info_ptr->bit_depth = 8; #endif -#if defined(PNG_READ_DITHER_SUPPORTED) - if (png_ptr->transformations & PNG_DITHER) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_DITHER) { - if (((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)) && - png_ptr->palette_lookup && info_ptr->bit_depth == 8) + if (((info_ptr->color_type == MODPNG14_COLOR_TYPE_RGB) || + (info_ptr->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA)) && + modpng14_ptr->palette_lookup && info_ptr->bit_depth == 8) { - info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; + info_ptr->color_type = MODPNG14_COLOR_TYPE_PALETTE; } } #endif -#if defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) && (info_ptr->bit_depth < 8)) +#if defined(MODPNG14_READ_PACK_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_PACK) && (info_ptr->bit_depth < 8)) info_ptr->bit_depth = 8; #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) - info_ptr->color_type |= PNG_COLOR_MASK_COLOR; +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_GRAY_TO_RGB) + info_ptr->color_type |= MODPNG14_COLOR_MASK_COLOR; #endif -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) - info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_RGB_TO_GRAY) + info_ptr->color_type &= ~MODPNG14_COLOR_MASK_COLOR; #endif - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (info_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) info_ptr->channels = 1; - else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) + else if (info_ptr->color_type & MODPNG14_COLOR_MASK_COLOR) info_ptr->channels = 3; else info_ptr->channels = 1; -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_STRIP_ALPHA) - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; +#if defined(MODPNG14_READ_STRIP_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_STRIP_ALPHA) + info_ptr->color_type &= ~MODPNG14_COLOR_MASK_ALPHA; #endif - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) + if (info_ptr->color_type & MODPNG14_COLOR_MASK_ALPHA) info_ptr->channels++; -#if defined(PNG_READ_FILLER_SUPPORTED) +#if defined(MODPNG14_READ_FILLER_SUPPORTED) /* STRIP_ALPHA and FILLER allowed: MASK_ALPHA bit stripped above */ - if ((png_ptr->transformations & PNG_FILLER) && - ((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_GRAY))) + if ((modpng14_ptr->transformations & MODPNG14_FILLER) && + ((info_ptr->color_type == MODPNG14_COLOR_TYPE_RGB) || + (info_ptr->color_type == MODPNG14_COLOR_TYPE_GRAY))) { info_ptr->channels++; #if 0 /* if adding a true alpha channel not just filler */ - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; + info_ptr->color_type |= MODPNG14_COLOR_MASK_ALPHA; #endif } #endif -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) && \ -defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if(png_ptr->transformations & PNG_USER_TRANSFORM) +#if defined(MODPNG14_USER_TRANSFORM_PTR_SUPPORTED) && \ +defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) + if(modpng14_ptr->transformations & MODPNG14_USER_TRANSFORM) { - if(info_ptr->bit_depth < png_ptr->user_transform_depth) - info_ptr->bit_depth = png_ptr->user_transform_depth; - if(info_ptr->channels < png_ptr->user_transform_channels) - info_ptr->channels = png_ptr->user_transform_channels; + if(info_ptr->bit_depth < modpng14_ptr->user_transform_depth) + info_ptr->bit_depth = modpng14_ptr->user_transform_depth; + if(info_ptr->channels < modpng14_ptr->user_transform_channels) + info_ptr->channels = modpng14_ptr->user_transform_channels; } #endif - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * + info_ptr->pixel_depth = (modpng14_byte)(info_ptr->channels * info_ptr->bit_depth); info_ptr->rowbytes = ((info_ptr->width * info_ptr->pixel_depth + 7) >> 3); -#if !defined(PNG_READ_EXPAND_SUPPORTED) - if(png_ptr) +#if !defined(MODPNG14_READ_EXPAND_SUPPORTED) + if(modpng14_ptr) return; #endif } @@ -1162,62 +1162,62 @@ * decide how it fits in with the other transformations here. */ void /* PRIVATE */ -png_do_read_transformations(png_structp png_ptr) +modpng14_do_read_transformations(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_do_read_transformations\n"); -#if !defined(PNG_USELESS_TESTS_SUPPORTED) - if (png_ptr->row_buf == NULL) + modpng14_debug(1, "in modpng14_do_read_transformations\n"); +#if !defined(MODPNG14_USELESS_TESTS_SUPPORTED) + if (modpng14_ptr->row_buf == NULL) { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char msg[50]; - sprintf(msg, "NULL row buffer for row %ld, pass %d", png_ptr->row_number, - png_ptr->pass); - png_error(png_ptr, msg); + sprintf(msg, "NULL row buffer for row %ld, pass %d", modpng14_ptr->row_number, + modpng14_ptr->pass); + modpng14_error(modpng14_ptr, msg); #else - png_error(png_ptr, "NULL row buffer"); + modpng14_error(modpng14_ptr, "NULL row buffer"); #endif } #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_EXPAND) { - if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->row_info.color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette, png_ptr->trans, png_ptr->num_trans); + modpng14_do_expand_palette(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + modpng14_ptr->palette, modpng14_ptr->trans, modpng14_ptr->num_trans); } else { - if (png_ptr->num_trans) - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->trans_values)); + if (modpng14_ptr->num_trans) + modpng14_do_expand(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + &(modpng14_ptr->trans_values)); else - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, + modpng14_do_expand(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, NULL); } } #endif -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_STRIP_ALPHA) - png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - PNG_FLAG_FILLER_AFTER); +#if defined(MODPNG14_READ_STRIP_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_STRIP_ALPHA) + modpng14_do_strip_filler(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + MODPNG14_FLAG_FILLER_AFTER); #endif -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_RGB_TO_GRAY) { int rgb_error = - png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), png_ptr->row_buf + 1); + modpng14_do_rgb_to_gray(modpng14_ptr, &(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); if(rgb_error) { - png_ptr->rgb_to_gray_status=1; - if(png_ptr->transformations == PNG_RGB_TO_GRAY_WARN) - png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - if(png_ptr->transformations == PNG_RGB_TO_GRAY_ERR) - png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel"); + modpng14_ptr->rgb_to_gray_status=1; + if(modpng14_ptr->transformations == MODPNG14_RGB_TO_GRAY_WARN) + modpng14_warning(modpng14_ptr, "modpng14_do_rgb_to_gray found nongray pixel"); + if(modpng14_ptr->transformations == MODPNG14_RGB_TO_GRAY_ERR) + modpng14_error(modpng14_ptr, "modpng14_do_rgb_to_gray found nongray pixel"); } } #endif @@ -1252,171 +1252,171 @@ transform appropriately, then it would save a lot of work/time. */ -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) /* if gray -> RGB, do so now only if background is non-gray; else do later * for performance reasons */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && - !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if ((png_ptr->transformations & PNG_BACKGROUND) && - ((png_ptr->num_trans != 0 ) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) - png_do_background(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->trans_values), &(png_ptr->background) -#if defined(PNG_READ_GAMMA_SUPPORTED) - , &(png_ptr->background_1), - png_ptr->gamma_table, png_ptr->gamma_from_1, - png_ptr->gamma_to_1, png_ptr->gamma_16_table, - png_ptr->gamma_16_from_1, png_ptr->gamma_16_to_1, - png_ptr->gamma_shift + if ((modpng14_ptr->transformations & MODPNG14_GRAY_TO_RGB) && + !(modpng14_ptr->mode & MODPNG14_BACKGROUND_IS_GRAY)) + modpng14_do_gray_to_rgb(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); +#endif + +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_BACKGROUND) && + ((modpng14_ptr->num_trans != 0 ) || + (modpng14_ptr->color_type & MODPNG14_COLOR_MASK_ALPHA))) + modpng14_do_background(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + &(modpng14_ptr->trans_values), &(modpng14_ptr->background) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + , &(modpng14_ptr->background_1), + modpng14_ptr->gamma_table, modpng14_ptr->gamma_from_1, + modpng14_ptr->gamma_to_1, modpng14_ptr->gamma_16_table, + modpng14_ptr->gamma_16_from_1, modpng14_ptr->gamma_16_to_1, + modpng14_ptr->gamma_shift #endif ); #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if ((png_ptr->transformations & PNG_GAMMA) && -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - !((png_ptr->transformations & PNG_BACKGROUND) && - ((png_ptr->num_trans != 0) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) && +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_GAMMA) && +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + !((modpng14_ptr->transformations & MODPNG14_BACKGROUND) && + ((modpng14_ptr->num_trans != 0) || + (modpng14_ptr->color_type & MODPNG14_COLOR_MASK_ALPHA))) && #endif - (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)) - png_do_gamma(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->gamma_table, png_ptr->gamma_16_table, - png_ptr->gamma_shift); + (modpng14_ptr->color_type != MODPNG14_COLOR_TYPE_PALETTE)) + modpng14_do_gamma(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + modpng14_ptr->gamma_table, modpng14_ptr->gamma_16_table, + modpng14_ptr->gamma_shift); #endif -#if defined(PNG_READ_16_TO_8_SUPPORTED) - if (png_ptr->transformations & PNG_16_TO_8) - png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_16_TO_8) + modpng14_do_chop(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_DITHER_SUPPORTED) - if (png_ptr->transformations & PNG_DITHER) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_DITHER) { - png_do_dither((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette_lookup, png_ptr->dither_index); - if(png_ptr->row_info.rowbytes == (png_uint_32)0) - png_error(png_ptr, "png_do_dither returned rowbytes=0"); + modpng14_do_dither((modpng14_row_infop)&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + modpng14_ptr->palette_lookup, modpng14_ptr->dither_index); + if(modpng14_ptr->row_info.rowbytes == (modpng14_uint_32)0) + modpng14_error(modpng14_ptr, "modpng14_do_dither returned rowbytes=0"); } #endif -#if defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_INVERT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_MONO) + modpng14_do_invert(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_do_unshift(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->shift)); +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SHIFT) + modpng14_do_unshift(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + &(modpng14_ptr->shift)); #endif -#if defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_do_unpack(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_PACK_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACK) + modpng14_do_unpack(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_BGR_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BGR) + modpng14_do_bgr(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) + modpng14_do_packswap(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) /* if gray -> RGB, do so now only if we did not do so above */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && - (png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); + if ((modpng14_ptr->transformations & MODPNG14_GRAY_TO_RGB) && + (modpng14_ptr->mode & MODPNG14_BACKGROUND_IS_GRAY)) + modpng14_do_gray_to_rgb(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_do_read_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - (png_uint_32)png_ptr->filler, png_ptr->flags); +#if defined(MODPNG14_READ_FILLER_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_FILLER) + modpng14_do_read_filler(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + (modpng14_uint_32)modpng14_ptr->filler, modpng14_ptr->flags); #endif -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_read_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_ALPHA) + modpng14_do_read_invert_alpha(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_ALPHA) - png_do_read_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_SWAP_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SWAP_ALPHA) + modpng14_do_read_swap_alpha(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); +#if defined(MODPNG14_READ_SWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SWAP_BYTES) + modpng14_do_swap(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_USER_TRANSFORM) { - if(png_ptr->read_user_transform_fn != NULL) - (*(png_ptr->read_user_transform_fn)) /* user read 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 */ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if(png_ptr->user_transform_depth) - png_ptr->row_info.bit_depth = png_ptr->user_transform_depth; - if(png_ptr->user_transform_channels) - png_ptr->row_info.channels = png_ptr->user_transform_channels; -#endif - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - png_ptr->row_info.rowbytes = (png_ptr->row_info.width * - png_ptr->row_info.pixel_depth+7)>>3; + if(modpng14_ptr->read_user_transform_fn != NULL) + (*(modpng14_ptr->read_user_transform_fn)) /* user read transform function */ + (modpng14_ptr, /* modpng14_ptr */ + &(modpng14_ptr->row_info), /* row_info: */ + /* modpng14_uint_32 width; width of row */ + /* modpng14_uint_32 rowbytes; number of bytes in row */ + /* modpng14_byte color_type; color type of pixels */ + /* modpng14_byte bit_depth; bit depth of samples */ + /* modpng14_byte channels; number of channels (1-4) */ + /* modpng14_byte pixel_depth; bits per pixel (depth*channels) */ + modpng14_ptr->row_buf + 1); /* start of pixel data for row */ +#if defined(MODPNG14_USER_TRANSFORM_PTR_SUPPORTED) + if(modpng14_ptr->user_transform_depth) + modpng14_ptr->row_info.bit_depth = modpng14_ptr->user_transform_depth; + if(modpng14_ptr->user_transform_channels) + modpng14_ptr->row_info.channels = modpng14_ptr->user_transform_channels; +#endif + modpng14_ptr->row_info.pixel_depth = (modpng14_byte)(modpng14_ptr->row_info.bit_depth * + modpng14_ptr->row_info.channels); + modpng14_ptr->row_info.rowbytes = (modpng14_ptr->row_info.width * + modpng14_ptr->row_info.pixel_depth+7)>>3; } #endif } -#if defined(PNG_READ_PACK_SUPPORTED) +#if defined(MODPNG14_READ_PACK_SUPPORTED) /* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel, * without changing the actual values. Thus, if you had a row with * a bit depth of 1, you would end up with bytes that only contained * the numbers 0 or 1. If you would rather they contain 0 and 255, use - * png_do_shift() after this. + * modpng14_do_shift() after this. */ void /* PRIVATE */ -png_do_unpack(png_row_infop row_info, png_bytep row) +modpng14_do_unpack(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_unpack\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_unpack\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && row_info->bit_depth < 8) #else if (row_info->bit_depth < 8) #endif { - png_uint_32 i; - png_uint_32 row_width=row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width=row_info->width; switch (row_info->bit_depth) { case 1: { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 3); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = 7 - (int)((row_width + 7) & 0x07); + modpng14_bytep sp = row + (modpng14_size_t)((row_width - 1) >> 3); + modpng14_bytep dp = row + (modpng14_size_t)row_width - 1; + modpng14_uint_32 shift = 7 - (int)((row_width + 7) & 0x07); for (i = 0; i < row_width; i++) { - *dp = (png_byte)((*sp >> shift) & 0x01); + *dp = (modpng14_byte)((*sp >> shift) & 0x01); if (shift == 7) { shift = 0; @@ -1432,12 +1432,12 @@ case 2: { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 2); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); + modpng14_bytep sp = row + (modpng14_size_t)((row_width - 1) >> 2); + modpng14_bytep dp = row + (modpng14_size_t)row_width - 1; + modpng14_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); for (i = 0; i < row_width; i++) { - *dp = (png_byte)((*sp >> shift) & 0x03); + *dp = (modpng14_byte)((*sp >> shift) & 0x03); if (shift == 6) { shift = 0; @@ -1452,12 +1452,12 @@ } case 4: { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 1); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); + modpng14_bytep sp = row + (modpng14_size_t)((row_width - 1) >> 1); + modpng14_bytep dp = row + (modpng14_size_t)row_width - 1; + modpng14_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); for (i = 0; i < row_width; i++) { - *dp = (png_byte)((*sp >> shift) & 0x0f); + *dp = (modpng14_byte)((*sp >> shift) & 0x0f); if (shift == 4) { shift = 0; @@ -1472,35 +1472,35 @@ } } row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); + row_info->pixel_depth = (modpng14_byte)(8 * row_info->channels); row_info->rowbytes = row_width * row_info->channels; } } #endif -#if defined(PNG_READ_SHIFT_SUPPORTED) -/* Reverse the effects of png_do_shift. This routine merely shifts the +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) +/* Reverse the effects of modpng14_do_shift. This routine merely shifts the * pixels back to their significant bits values. Thus, if you have * a row of bit depth 8, but only 5 are significant, this will shift * the values back to 0 through 31. */ void /* PRIVATE */ -png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits) +modpng14_do_unshift(modpng14_row_infop row_info, modpng14_bytep row, modpng14_color_8p sig_bits) { - png_debug(1, "in png_do_unshift\n"); + modpng14_debug(1, "in modpng14_do_unshift\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && sig_bits != NULL && #endif - row_info->color_type != PNG_COLOR_TYPE_PALETTE) + row_info->color_type != MODPNG14_COLOR_TYPE_PALETTE) { int shift[4]; int channels = 0; int c; - png_uint_16 value = 0; - png_uint_32 row_width = row_info->width; + modpng14_uint_16 value = 0; + modpng14_uint_32 row_width = row_info->width; - if (row_info->color_type & PNG_COLOR_MASK_COLOR) + if (row_info->color_type & MODPNG14_COLOR_MASK_COLOR) { shift[channels++] = row_info->bit_depth - sig_bits->red; shift[channels++] = row_info->bit_depth - sig_bits->green; @@ -1510,7 +1510,7 @@ { shift[channels++] = row_info->bit_depth - sig_bits->gray; } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) + if (row_info->color_type & MODPNG14_COLOR_MASK_ALPHA) { shift[channels++] = row_info->bit_depth - sig_bits->alpha; } @@ -1530,9 +1530,9 @@ { case 2: { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; + modpng14_bytep bp; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; for (bp = row, i = 0; i < istop; i++) { @@ -1543,11 +1543,11 @@ } case 4: { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_byte mask = (png_byte)((((int)0xf0 >> shift[0]) & (int)0xf0) | - (png_byte)((int)0xf >> shift[0])); + modpng14_bytep bp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_byte mask = (modpng14_byte)((((int)0xf0 >> shift[0]) & (int)0xf0) | + (modpng14_byte)((int)0xf >> shift[0])); for (i = 0; i < istop; i++) { @@ -1558,9 +1558,9 @@ } case 8: { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_width * channels; + modpng14_bytep bp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_width * channels; for (i = 0; i < istop; i++) { @@ -1570,16 +1570,16 @@ } case 16: { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_width; + modpng14_bytep bp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = channels * row_width; for (i = 0; i < istop; i++) { - value = (png_uint_16)((*bp << 8) + *(bp + 1)); + value = (modpng14_uint_16)((*bp << 8) + *(bp + 1)); value >>= shift[i%channels]; - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); + *bp++ = (modpng14_byte)(value >> 8); + *bp++ = (modpng14_byte)(value & 0xff); } break; } @@ -1588,44 +1588,44 @@ } #endif -#if defined(PNG_READ_16_TO_8_SUPPORTED) +#if defined(MODPNG14_READ_16_TO_8_SUPPORTED) /* chop rows of bit depth 16 down to 8 */ void /* PRIVATE */ -png_do_chop(png_row_infop row_info, png_bytep row) +modpng14_do_chop(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_chop\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_chop\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && row_info->bit_depth == 16) #else if (row_info->bit_depth == 16) #endif { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - png_uint_32 istop = row_info->width * row_info->channels; + modpng14_bytep sp = row; + modpng14_bytep dp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->width * row_info->channels; for (i = 0; i> 8)) >> 8; * * Approximate calculation with shift/add instead of multiply/divide: - * *dp = ((((png_uint_32)(*sp) << 8) | - * (png_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8; + * *dp = ((((modpng14_uint_32)(*sp) << 8) | + * (modpng14_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8; * * What we actually do to avoid extra shifting and conversion: */ @@ -1637,31 +1637,31 @@ #endif } row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); + row_info->pixel_depth = (modpng14_byte)(8 * row_info->channels); row_info->rowbytes = row_info->width * row_info->channels; } } #endif -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) +#if defined(MODPNG14_READ_SWAP_ALPHA_SUPPORTED) void /* PRIVATE */ -png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) +modpng14_do_read_swap_alpha(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_read_swap_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_read_swap_alpha\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + modpng14_uint_32 row_width = row_info->width; + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) { /* This converts from RGBA to ARGB */ if (row_info->bit_depth == 8) { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_byte save; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { @@ -1675,10 +1675,10 @@ /* This converts from RRGGBBAA to AARRGGBB */ else { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_byte save[2]; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { @@ -1695,15 +1695,15 @@ } } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) { /* This converts from GA to AG */ if (row_info->bit_depth == 8) { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_byte save; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { @@ -1715,10 +1715,10 @@ /* This converts from GGAA to AAGG */ else { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_byte save[2]; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { @@ -1735,28 +1735,28 @@ } #endif -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) void /* PRIVATE */ -png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) +modpng14_do_read_invert_alpha(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_read_invert_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_read_invert_alpha\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + modpng14_uint_32 row_width = row_info->width; + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) { /* This inverts the alpha channel in RGBA */ if (row_info->bit_depth == 8) { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { - *(--dp) = (png_byte)(255 - *(--sp)); + *(--dp) = (modpng14_byte)(255 - *(--sp)); /* This does nothing: *(--dp) = *(--sp); @@ -1771,14 +1771,14 @@ /* This inverts the alpha channel in RRGGBBAA */ else { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); + *(--dp) = (modpng14_byte)(255 - *(--sp)); + *(--dp) = (modpng14_byte)(255 - *(--sp)); /* This does nothing: *(--dp) = *(--sp); @@ -1794,32 +1794,32 @@ } } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) { /* This inverts the alpha channel in GA */ if (row_info->bit_depth == 8) { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { - *(--dp) = (png_byte)(255 - *(--sp)); + *(--dp) = (modpng14_byte)(255 - *(--sp)); *(--dp) = *(--sp); } } /* This inverts the alpha channel in GGAA */ else { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; + modpng14_bytep sp = row + row_info->rowbytes; + modpng14_bytep dp = sp; + modpng14_uint_32 i; for (i = 0; i < row_width; i++) { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); + *(--dp) = (modpng14_byte)(255 - *(--sp)); + *(--dp) = (modpng14_byte)(255 - *(--sp)); /* *(--dp) = *(--sp); *(--dp) = *(--sp); @@ -1833,32 +1833,32 @@ } #endif -#if defined(PNG_READ_FILLER_SUPPORTED) +#if defined(MODPNG14_READ_FILLER_SUPPORTED) /* Add filler channel if we have RGB color */ void /* PRIVATE */ -png_do_read_filler(png_row_infop row_info, png_bytep row, - png_uint_32 filler, png_uint_32 flags) +modpng14_do_read_filler(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_uint_32 filler, modpng14_uint_32 flags) { - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; - png_byte hi_filler = (png_byte)((filler>>8) & 0xff); - png_byte lo_filler = (png_byte)(filler & 0xff); + modpng14_byte hi_filler = (modpng14_byte)((filler>>8) & 0xff); + modpng14_byte lo_filler = (modpng14_byte)(filler & 0xff); - png_debug(1, "in png_do_read_filler\n"); + modpng14_debug(1, "in modpng14_do_read_filler\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - row_info->color_type == PNG_COLOR_TYPE_GRAY) + row_info->color_type == MODPNG14_COLOR_TYPE_GRAY) { if(row_info->bit_depth == 8) { /* This changes the data from G to GX */ - if (flags & PNG_FLAG_FILLER_AFTER) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; + modpng14_bytep sp = row + (modpng14_size_t)row_width; + modpng14_bytep dp = sp + (modpng14_size_t)row_width; for (i = 1; i < row_width; i++) { *(--dp) = lo_filler; @@ -1872,8 +1872,8 @@ /* This changes the data from G to XG */ else { - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; + modpng14_bytep sp = row + (modpng14_size_t)row_width; + modpng14_bytep dp = sp + (modpng14_size_t)row_width; for (i = 0; i < row_width; i++) { *(--dp) = *(--sp); @@ -1887,10 +1887,10 @@ else if(row_info->bit_depth == 16) { /* This changes the data from GG to GGXX */ - if (flags & PNG_FLAG_FILLER_AFTER) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 2; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 2; for (i = 1; i < row_width; i++) { *(--dp) = hi_filler; @@ -1907,8 +1907,8 @@ /* This changes the data from GG to XXGG */ else { - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 2; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(--dp) = *(--sp); @@ -1922,15 +1922,15 @@ } } } /* COLOR_TYPE == GRAY */ - else if (row_info->color_type == PNG_COLOR_TYPE_RGB) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) { if(row_info->bit_depth == 8) { /* This changes the data from RGB to RGBX */ - if (flags & PNG_FLAG_FILLER_AFTER) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 3; + modpng14_bytep dp = sp + (modpng14_size_t)row_width; for (i = 1; i < row_width; i++) { *(--dp) = lo_filler; @@ -1946,8 +1946,8 @@ /* This changes the data from RGB to XRGB */ else { - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 3; + modpng14_bytep dp = sp + (modpng14_size_t)row_width; for (i = 0; i < row_width; i++) { *(--dp) = *(--sp); @@ -1963,10 +1963,10 @@ else if(row_info->bit_depth == 16) { /* This changes the data from RRGGBB to RRGGBBXX */ - if (flags & PNG_FLAG_FILLER_AFTER) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 6; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 2; for (i = 1; i < row_width; i++) { *(--dp) = hi_filler; @@ -1987,8 +1987,8 @@ /* This changes the data from RRGGBB to XXRRGGBB */ else { - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 6; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(--dp) = *(--sp); @@ -2009,27 +2009,27 @@ } #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) /* expand grayscale files to RGB, with or without alpha */ void /* PRIVATE */ -png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) +modpng14_do_gray_to_rgb(modpng14_row_infop row_info, modpng14_bytep row) { - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; - png_debug(1, "in png_do_gray_to_rgb\n"); + modpng14_debug(1, "in modpng14_do_gray_to_rgb\n"); if (row_info->bit_depth >= 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - !(row_info->color_type & PNG_COLOR_MASK_COLOR)) + !(row_info->color_type & MODPNG14_COLOR_MASK_COLOR)) { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) + if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY) { if (row_info->bit_depth == 8) { - png_bytep sp = row + (png_size_t)row_width - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; + modpng14_bytep sp = row + (modpng14_size_t)row_width - 1; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(dp--) = *sp; @@ -2039,8 +2039,8 @@ } else { - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 2 - 1; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 4; for (i = 0; i < row_width; i++) { *(dp--) = *sp; @@ -2052,12 +2052,12 @@ } } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) { if (row_info->bit_depth == 8) { - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 2 - 1; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(dp--) = *(sp--); @@ -2068,8 +2068,8 @@ } else { - png_bytep sp = row + (png_size_t)row_width * 4 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; + modpng14_bytep sp = row + (modpng14_size_t)row_width * 4 - 1; + modpng14_bytep dp = sp + (modpng14_size_t)row_width * 4; for (i = 0; i < row_width; i++) { *(dp--) = *(sp--); @@ -2083,9 +2083,9 @@ } } } - row_info->channels += (png_byte)2; - row_info->color_type |= PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * + row_info->channels += (modpng14_byte)2; + row_info->color_type |= MODPNG14_COLOR_MASK_COLOR; + row_info->pixel_depth = (modpng14_byte)(row_info->channels * row_info->bit_depth); row_info->rowbytes = ((row_width * row_info->pixel_depth + 7) >> 3); @@ -2093,7 +2093,7 @@ } #endif -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +#if defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) /* reduce RGB files to grayscale, with or without alpha * using the equation given in Poynton's ColorFAQ at * @@ -2111,47 +2111,47 @@ * * The calculation is to be done in a linear colorspace. * - * Other integer coefficents can be used via png_set_rgb_to_gray(). + * Other integer coefficents can be used via modpng14_set_rgb_to_gray(). */ int /* PRIVATE */ -png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) +modpng14_do_rgb_to_gray(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep row) { - png_uint_32 i; + modpng14_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 row_width = row_info->width; int rgb_error = 0; - png_debug(1, "in png_do_rgb_to_gray\n"); + modpng14_debug(1, "in modpng14_do_rgb_to_gray\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) + (row_info->color_type & MODPNG14_COLOR_MASK_COLOR)) { - png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; - png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; - png_uint_32 bc = png_ptr->rgb_to_gray_blue_coeff; + modpng14_uint_32 rc = modpng14_ptr->rgb_to_gray_red_coeff; + modpng14_uint_32 gc = modpng14_ptr->rgb_to_gray_green_coeff; + modpng14_uint_32 bc = modpng14_ptr->rgb_to_gray_blue_coeff; - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) { if (row_info->bit_depth == 8) { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->gamma_from_1 != NULL && modpng14_ptr->gamma_to_1 != NULL) { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; + modpng14_byte red = modpng14_ptr->gamma_to_1[*(sp++)]; + modpng14_byte green = modpng14_ptr->gamma_to_1[*(sp++)]; + modpng14_byte blue = modpng14_ptr->gamma_to_1[*(sp++)]; if(red != green || red != blue) { rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1[ + *(dp++) = modpng14_ptr->gamma_from_1[ (rc*red+gc*green+bc*blue)>>15]; } else @@ -2161,17 +2161,17 @@ else #endif { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); + modpng14_byte red = *(sp++); + modpng14_byte green = *(sp++); + modpng14_byte blue = *(sp++); if(red != green || red != blue) { rgb_error |= 1; - *(dp++) = (png_byte)((rc*red+gc*green+bc*blue)>>15); + *(dp++) = (modpng14_byte)((rc*red+gc*green+bc*blue)>>15); } else *(dp++) = *(sp-1); @@ -2181,80 +2181,80 @@ else /* RGB bit_depth == 16 */ { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->gamma_16_to_1 != NULL && + modpng14_ptr->gamma_16_from_1 != NULL) { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_uint_16 red, green, blue, w; + modpng14_uint_16 red, green, blue, w; - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + red = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + green = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + blue = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; if(red == green && red == blue) w = red; else { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 + modpng14_uint_16 red_1 = modpng14_ptr->gamma_16_to_1[(red&0xff) >> + modpng14_ptr->gamma_shift][red>>8]; + modpng14_uint_16 green_1 = modpng14_ptr->gamma_16_to_1[(green&0xff) >> + modpng14_ptr->gamma_shift][green>>8]; + modpng14_uint_16 blue_1 = modpng14_ptr->gamma_16_to_1[(blue&0xff) >> + modpng14_ptr->gamma_shift][blue>>8]; + modpng14_uint_16 gray16 = (modpng14_uint_16)((rc*red_1 + gc*green_1 + bc*blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; + w = modpng14_ptr->gamma_16_from_1[(gray16&0xff) >> + modpng14_ptr->gamma_shift][gray16 >> 8]; rgb_error |= 1; } - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); + *(dp++) = (modpng14_byte)((w>>8) & 0xff); + *(dp++) = (modpng14_byte)(w & 0xff); } } else #endif { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_uint_16 red, green, blue, gray16; + modpng14_uint_16 red, green, blue, gray16; - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + red = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + green = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + blue = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; if(red != green || red != blue) rgb_error |= 1; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); + gray16 = (modpng14_uint_16)((rc*red + gc*green + bc*blue)>>15); + *(dp++) = (modpng14_byte)((gray16>>8) & 0xff); + *(dp++) = (modpng14_byte)(gray16 & 0xff); } } } } - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) { if (row_info->bit_depth == 8) { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->gamma_from_1 != NULL && modpng14_ptr->gamma_to_1 != NULL) { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; + modpng14_byte red = modpng14_ptr->gamma_to_1[*(sp++)]; + modpng14_byte green = modpng14_ptr->gamma_to_1[*(sp++)]; + modpng14_byte blue = modpng14_ptr->gamma_to_1[*(sp++)]; if(red != green || red != blue) rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1 + *(dp++) = modpng14_ptr->gamma_from_1 [(rc*red + gc*green + bc*blue)>>15]; *(dp++) = *(sp++); /* alpha */ } @@ -2262,55 +2262,55 @@ else #endif { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); + modpng14_byte red = *(sp++); + modpng14_byte green = *(sp++); + modpng14_byte blue = *(sp++); if(red != green || red != blue) rgb_error |= 1; - *(dp++) = (png_byte)((gc*red + gc*green + bc*blue)>>8); + *(dp++) = (modpng14_byte)((gc*red + gc*green + bc*blue)>>8); *(dp++) = *(sp++); /* alpha */ } } } else /* RGBA bit_depth == 16 */ { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) || defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->gamma_16_to_1 != NULL && + modpng14_ptr->gamma_16_from_1 != NULL) { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_uint_16 red, green, blue, w; + modpng14_uint_16 red, green, blue, w; - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + red = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + green = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; + blue = (modpng14_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; if(red == green && red == blue) w = red; else { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc * red_1 + modpng14_uint_16 red_1 = modpng14_ptr->gamma_16_to_1[(red&0xff) >> + modpng14_ptr->gamma_shift][red>>8]; + modpng14_uint_16 green_1 = modpng14_ptr->gamma_16_to_1[(green&0xff) >> + modpng14_ptr->gamma_shift][green>>8]; + modpng14_uint_16 blue_1 = modpng14_ptr->gamma_16_to_1[(blue&0xff) >> + modpng14_ptr->gamma_shift][blue>>8]; + modpng14_uint_16 gray16 = (modpng14_uint_16)((rc * red_1 + gc * green_1 + bc * blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; + w = modpng14_ptr->gamma_16_from_1[(gray16&0xff) >> + modpng14_ptr->gamma_shift][gray16 >> 8]; rgb_error |= 1; } - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); + *(dp++) = (modpng14_byte)((w>>8) & 0xff); + *(dp++) = (modpng14_byte)(w & 0xff); *(dp++) = *(sp++); /* alpha */ *(dp++) = *(sp++); } @@ -2318,28 +2318,28 @@ else #endif { - png_bytep sp = row; - png_bytep dp = row; + modpng14_bytep sp = row; + modpng14_bytep dp = row; for (i = 0; i < row_width; i++) { - png_uint_16 red, green, blue, gray16; - red = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; + modpng14_uint_16 red, green, blue, gray16; + red = (modpng14_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; + green = (modpng14_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; + blue = (modpng14_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; if(red != green || red != blue) rgb_error |= 1; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); + gray16 = (modpng14_uint_16)((rc*red + gc*green + bc*blue)>>15); + *(dp++) = (modpng14_byte)((gray16>>8) & 0xff); + *(dp++) = (modpng14_byte)(gray16 & 0xff); *(dp++) = *(sp++); /* alpha */ *(dp++) = *(sp++); } } } } - row_info->channels -= (png_byte)2; - row_info->color_type &= ~PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * + row_info->channels -= (modpng14_byte)2; + row_info->color_type &= ~MODPNG14_COLOR_MASK_COLOR; + row_info->pixel_depth = (modpng14_byte)(row_info->channels * row_info->bit_depth); row_info->rowbytes = ((row_width * row_info->pixel_depth + 7) >> 3); @@ -2349,19 +2349,19 @@ #endif /* Build a grayscale palette. Palette is assumed to be 1 << bit_depth - * large of png_color. This lets grayscale images be treated as + * large of modpng14_color. This lets grayscale images be treated as * paletted. Most useful for gamma correction and simplification * of code. */ -void PNGAPI -png_build_grayscale_palette(int bit_depth, png_colorp palette) +void MODPNG14API +modpng14_build_grayscale_palette(int bit_depth, modpng14_colorp palette) { int num_palette; int color_inc; int i; int v; - png_debug(1, "in png_do_build_grayscale_palette\n"); + modpng14_debug(1, "in modpng14_do_build_grayscale_palette\n"); if (palette == NULL) return; @@ -2391,105 +2391,105 @@ for (i = 0, v = 0; i < num_palette; i++, v += color_inc) { - palette[i].red = (png_byte)v; - palette[i].green = (png_byte)v; - palette[i].blue = (png_byte)v; + palette[i].red = (modpng14_byte)v; + palette[i].green = (modpng14_byte)v; + palette[i].blue = (modpng14_byte)v; } } /* This function is currently unused. Do we really need it? */ -#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) && defined(MODPNG14_CORRECT_PALETTE_SUPPORTED) void /* PRIVATE */ -png_correct_palette(png_structp png_ptr, png_colorp palette, +modpng14_correct_palette(modpng14_structp modpng14_ptr, modpng14_colorp palette, int num_palette) { - png_debug(1, "in png_correct_palette\n"); -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND)) - { - png_color back, back_1; - - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) - { - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; + modpng14_debug(1, "in modpng14_correct_palette\n"); +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) && \ + defined(MODPNG14_READ_GAMMA_SUPPORTED) && defined(MODPNG14_FLOATING_POINT_SUPPORTED) + if (modpng14_ptr->transformations & (MODPNG14_GAMMA | MODPNG14_BACKGROUND)) + { + modpng14_color back, back_1; + + if (modpng14_ptr->background_gamma_type == MODPNG14_BACKGROUND_GAMMA_FILE) + { + back.red = modpng14_ptr->gamma_table[modpng14_ptr->background.red]; + back.green = modpng14_ptr->gamma_table[modpng14_ptr->background.green]; + back.blue = modpng14_ptr->gamma_table[modpng14_ptr->background.blue]; + + back_1.red = modpng14_ptr->gamma_to_1[modpng14_ptr->background.red]; + back_1.green = modpng14_ptr->gamma_to_1[modpng14_ptr->background.green]; + back_1.blue = modpng14_ptr->gamma_to_1[modpng14_ptr->background.blue]; } else { double g; - g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma); + g = 1.0 / (modpng14_ptr->background_gamma * modpng14_ptr->screen_gamma); - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN || - fabs(g - 1.0) < PNG_GAMMA_THRESHOLD) + if (modpng14_ptr->background_gamma_type == MODPNG14_BACKGROUND_GAMMA_SCREEN || + fabs(g - 1.0) < MODPNG14_GAMMA_THRESHOLD) { - back.red = png_ptr->background.red; - back.green = png_ptr->background.green; - back.blue = png_ptr->background.blue; + back.red = modpng14_ptr->background.red; + back.green = modpng14_ptr->background.green; + back.blue = modpng14_ptr->background.blue; } else { back.red = - (png_byte)(pow((double)png_ptr->background.red/255, g) * + (modpng14_byte)(pow((double)modpng14_ptr->background.red/255, g) * 255.0 + 0.5); back.green = - (png_byte)(pow((double)png_ptr->background.green/255, g) * + (modpng14_byte)(pow((double)modpng14_ptr->background.green/255, g) * 255.0 + 0.5); back.blue = - (png_byte)(pow((double)png_ptr->background.blue/255, g) * + (modpng14_byte)(pow((double)modpng14_ptr->background.blue/255, g) * 255.0 + 0.5); } - g = 1.0 / png_ptr->background_gamma; + g = 1.0 / modpng14_ptr->background_gamma; back_1.red = - (png_byte)(pow((double)png_ptr->background.red/255, g) * + (modpng14_byte)(pow((double)modpng14_ptr->background.red/255, g) * 255.0 + 0.5); back_1.green = - (png_byte)(pow((double)png_ptr->background.green/255, g) * + (modpng14_byte)(pow((double)modpng14_ptr->background.green/255, g) * 255.0 + 0.5); back_1.blue = - (png_byte)(pow((double)png_ptr->background.blue/255, g) * + (modpng14_byte)(pow((double)modpng14_ptr->background.blue/255, g) * 255.0 + 0.5); } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_uint_32 i; + modpng14_uint_32 i; - for (i = 0; i < (png_uint_32)num_palette; i++) + for (i = 0; i < (modpng14_uint_32)num_palette; i++) { - if (i < png_ptr->num_trans && png_ptr->trans[i] == 0) + if (i < modpng14_ptr->num_trans && modpng14_ptr->trans[i] == 0) { palette[i] = back; } - else if (i < png_ptr->num_trans && png_ptr->trans[i] != 0xff) + else if (i < modpng14_ptr->num_trans && modpng14_ptr->trans[i] != 0xff) { - png_byte v, w; + modpng14_byte v, w; - v = png_ptr->gamma_to_1[png_ptr->palette[i].red]; - png_composite(w, v, png_ptr->trans[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; + v = modpng14_ptr->gamma_to_1[modpng14_ptr->palette[i].red]; + modpng14_composite(w, v, modpng14_ptr->trans[i], back_1.red); + palette[i].red = modpng14_ptr->gamma_from_1[w]; - v = png_ptr->gamma_to_1[png_ptr->palette[i].green]; - png_composite(w, v, png_ptr->trans[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; + v = modpng14_ptr->gamma_to_1[modpng14_ptr->palette[i].green]; + modpng14_composite(w, v, modpng14_ptr->trans[i], back_1.green); + palette[i].green = modpng14_ptr->gamma_from_1[w]; - v = png_ptr->gamma_to_1[png_ptr->palette[i].blue]; - png_composite(w, v, png_ptr->trans[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; + v = modpng14_ptr->gamma_to_1[modpng14_ptr->palette[i].blue]; + modpng14_composite(w, v, modpng14_ptr->trans[i], back_1.blue); + palette[i].blue = modpng14_ptr->gamma_from_1[w]; } else { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; + palette[i].red = modpng14_ptr->gamma_table[palette[i].red]; + palette[i].green = modpng14_ptr->gamma_table[palette[i].green]; + palette[i].blue = modpng14_ptr->gamma_table[palette[i].blue]; } } } @@ -2499,64 +2499,64 @@ for (i = 0; i < num_palette; i++) { - if (palette[i].red == (png_byte)png_ptr->trans_values.gray) + if (palette[i].red == (modpng14_byte)modpng14_ptr->trans_values.gray) { palette[i] = back; } else { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; + palette[i].red = modpng14_ptr->gamma_table[palette[i].red]; + palette[i].green = modpng14_ptr->gamma_table[palette[i].green]; + palette[i].blue = modpng14_ptr->gamma_table[palette[i].blue]; } } } } else #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->transformations & PNG_GAMMA) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_GAMMA) { int i; for (i = 0; i < num_palette; i++) { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; + palette[i].red = modpng14_ptr->gamma_table[palette[i].red]; + palette[i].green = modpng14_ptr->gamma_table[palette[i].green]; + palette[i].blue = modpng14_ptr->gamma_table[palette[i].blue]; } } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) else #endif #endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BACKGROUND) { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_color back; + modpng14_color back; - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; + back.red = (modpng14_byte)modpng14_ptr->background.red; + back.green = (modpng14_byte)modpng14_ptr->background.green; + back.blue = (modpng14_byte)modpng14_ptr->background.blue; - for (i = 0; i < (int)png_ptr->num_trans; i++) + for (i = 0; i < (int)modpng14_ptr->num_trans; i++) { - if (png_ptr->trans[i] == 0) + if (modpng14_ptr->trans[i] == 0) { palette[i].red = back.red; palette[i].green = back.green; palette[i].blue = back.blue; } - else if (png_ptr->trans[i] != 0xff) + else if (modpng14_ptr->trans[i] != 0xff) { - png_composite(palette[i].red, png_ptr->palette[i].red, - png_ptr->trans[i], back.red); - png_composite(palette[i].green, png_ptr->palette[i].green, - png_ptr->trans[i], back.green); - png_composite(palette[i].blue, png_ptr->palette[i].blue, - png_ptr->trans[i], back.blue); + modpng14_composite(palette[i].red, modpng14_ptr->palette[i].red, + modpng14_ptr->trans[i], back.red); + modpng14_composite(palette[i].green, modpng14_ptr->palette[i].green, + modpng14_ptr->trans[i], back.green); + modpng14_composite(palette[i].blue, modpng14_ptr->palette[i].blue, + modpng14_ptr->trans[i], back.blue); } } } @@ -2566,11 +2566,11 @@ for (i = 0; i < num_palette; i++) { - if (i == (png_byte)png_ptr->trans_values.gray) + if (i == (modpng14_byte)modpng14_ptr->trans_values.gray) { - palette[i].red = (png_byte)png_ptr->background.red; - palette[i].green = (png_byte)png_ptr->background.green; - palette[i].blue = (png_byte)png_ptr->background.blue; + palette[i].red = (modpng14_byte)modpng14_ptr->background.red; + palette[i].green = (modpng14_byte)modpng14_ptr->background.green; + palette[i].blue = (modpng14_byte)modpng14_ptr->background.blue; } } } @@ -2579,38 +2579,38 @@ } #endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) /* Replace any alpha or transparency with the supplied background color. * "background" is already in the screen gamma, while "background_1" is * at a gamma of 1.0. Paletted files have already been taken care of. */ void /* PRIVATE */ -png_do_background(png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background -#if defined(PNG_READ_GAMMA_SUPPORTED) - , png_color_16p background_1, - png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, - png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, - png_uint_16pp gamma_16_to_1, int gamma_shift +modpng14_do_background(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_color_16p trans_values, modpng14_color_16p background +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) + , modpng14_color_16p background_1, + modpng14_bytep gamma_table, modpng14_bytep gamma_from_1, modpng14_bytep gamma_to_1, + modpng14_uint_16pp gamma_16, modpng14_uint_16pp gamma_16_from_1, + modpng14_uint_16pp gamma_16_to_1, int gamma_shift #endif ) { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width=row_info->width; int shift; - png_debug(1, "in png_do_background\n"); + modpng14_debug(1, "in modpng14_do_background\n"); if (background != NULL && -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - (!(row_info->color_type & PNG_COLOR_MASK_ALPHA) || - (row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_values))) + (!(row_info->color_type & MODPNG14_COLOR_MASK_ALPHA) || + (row_info->color_type != MODPNG14_COLOR_TYPE_PALETTE && trans_values))) { switch (row_info->color_type) { - case PNG_COLOR_TYPE_GRAY: + case MODPNG14_COLOR_TYPE_GRAY: { switch (row_info->bit_depth) { @@ -2620,11 +2620,11 @@ shift = 7; for (i = 0; i < row_width; i++) { - if ((png_uint_16)((*sp >> shift) & 0x01) + if ((modpng14_uint_16)((*sp >> shift) & 0x01) == trans_values->gray) { - *sp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); + *sp &= (modpng14_byte)((0x7f7f >> (7 - shift)) & 0xff); + *sp |= (modpng14_byte)(background->gray << shift); } if (!shift) { @@ -2638,26 +2638,26 @@ } case 2: { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_table != NULL) { sp = row; shift = 6; for (i = 0; i < row_width; i++) { - if ((png_uint_16)((*sp >> shift) & 0x03) + if ((modpng14_uint_16)((*sp >> shift) & 0x03) == trans_values->gray) { - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); + *sp &= (modpng14_byte)((0x3f3f >> (6 - shift)) & 0xff); + *sp |= (modpng14_byte)(background->gray << shift); } else { - png_byte p = (png_byte)((*sp >> shift) & 0x03); - png_byte g = (png_byte)((gamma_table [p | (p << 2) | + modpng14_byte p = (modpng14_byte)((*sp >> shift) & 0x03); + modpng14_byte g = (modpng14_byte)((gamma_table [p | (p << 2) | (p << 4) | (p << 6)] >> 6) & 0x03); - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(g << shift); + *sp &= (modpng14_byte)((0x3f3f >> (6 - shift)) & 0xff); + *sp |= (modpng14_byte)(g << shift); } if (!shift) { @@ -2675,11 +2675,11 @@ shift = 6; for (i = 0; i < row_width; i++) { - if ((png_uint_16)((*sp >> shift) & 0x03) + if ((modpng14_uint_16)((*sp >> shift) & 0x03) == trans_values->gray) { - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); + *sp &= (modpng14_byte)((0x3f3f >> (6 - shift)) & 0xff); + *sp |= (modpng14_byte)(background->gray << shift); } if (!shift) { @@ -2694,26 +2694,26 @@ } case 4: { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_table != NULL) { sp = row; shift = 4; for (i = 0; i < row_width; i++) { - if ((png_uint_16)((*sp >> shift) & 0x0f) + if ((modpng14_uint_16)((*sp >> shift) & 0x0f) == trans_values->gray) { - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); + *sp &= (modpng14_byte)((0xf0f >> (4 - shift)) & 0xff); + *sp |= (modpng14_byte)(background->gray << shift); } else { - png_byte p = (png_byte)((*sp >> shift) & 0x0f); - png_byte g = (png_byte)((gamma_table[p | + modpng14_byte p = (modpng14_byte)((*sp >> shift) & 0x0f); + modpng14_byte g = (modpng14_byte)((gamma_table[p | (p << 4)] >> 4) & 0x0f); - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(g << shift); + *sp &= (modpng14_byte)((0xf0f >> (4 - shift)) & 0xff); + *sp |= (modpng14_byte)(g << shift); } if (!shift) { @@ -2731,11 +2731,11 @@ shift = 4; for (i = 0; i < row_width; i++) { - if ((png_uint_16)((*sp >> shift) & 0x0f) + if ((modpng14_uint_16)((*sp >> shift) & 0x0f) == trans_values->gray) { - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); + *sp &= (modpng14_byte)((0xf0f >> (4 - shift)) & 0xff); + *sp |= (modpng14_byte)(background->gray << shift); } if (!shift) { @@ -2750,7 +2750,7 @@ } case 8: { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_table != NULL) { sp = row; @@ -2758,7 +2758,7 @@ { if (*sp == trans_values->gray) { - *sp = (png_byte)background->gray; + *sp = (modpng14_byte)background->gray; } else { @@ -2774,7 +2774,7 @@ { if (*sp == trans_values->gray) { - *sp = (png_byte)background->gray; + *sp = (modpng14_byte)background->gray; } } } @@ -2782,26 +2782,26 @@ } case 16: { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_16 != NULL) { sp = row; for (i = 0; i < row_width; i++, sp += 2) { - png_uint_16 v; + modpng14_uint_16 v; - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); + v = (modpng14_uint_16)(((*sp) << 8) + *(sp + 1)); if (v == trans_values->gray) { /* background is already in screen gamma */ - *sp = (png_byte)((background->gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->gray & 0xff); + *sp = (modpng14_byte)((background->gray >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(background->gray & 0xff); } else { v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); } } } @@ -2811,13 +2811,13 @@ sp = row; for (i = 0; i < row_width; i++, sp += 2) { - png_uint_16 v; + modpng14_uint_16 v; - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); + v = (modpng14_uint_16)(((*sp) << 8) + *(sp + 1)); if (v == trans_values->gray) { - *sp = (png_byte)((background->gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->gray & 0xff); + *sp = (modpng14_byte)((background->gray >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(background->gray & 0xff); } } } @@ -2826,11 +2826,11 @@ } break; } - case PNG_COLOR_TYPE_RGB: + case MODPNG14_COLOR_TYPE_RGB: { if (row_info->bit_depth == 8) { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_table != NULL) { sp = row; @@ -2840,9 +2840,9 @@ *(sp + 1) == trans_values->green && *(sp + 2) == trans_values->blue) { - *sp = (png_byte)background->red; - *(sp + 1) = (png_byte)background->green; - *(sp + 2) = (png_byte)background->blue; + *sp = (modpng14_byte)background->red; + *(sp + 1) = (modpng14_byte)background->green; + *(sp + 2) = (modpng14_byte)background->blue; } else { @@ -2862,46 +2862,46 @@ *(sp + 1) == trans_values->green && *(sp + 2) == trans_values->blue) { - *sp = (png_byte)background->red; - *(sp + 1) = (png_byte)background->green; - *(sp + 2) = (png_byte)background->blue; + *sp = (modpng14_byte)background->red; + *(sp + 1) = (modpng14_byte)background->green; + *(sp + 2) = (modpng14_byte)background->blue; } } } } else /* if (row_info->bit_depth == 16) */ { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_16 != NULL) { sp = row; for (i = 0; i < row_width; i++, sp += 6) { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); + modpng14_uint_16 r = (modpng14_uint_16)(((*sp) << 8) + *(sp + 1)); + modpng14_uint_16 g = (modpng14_uint_16)(((*(sp+2)) << 8) + *(sp+3)); + modpng14_uint_16 b = (modpng14_uint_16)(((*(sp+4)) << 8) + *(sp+5)); if (r == trans_values->red && g == trans_values->green && b == trans_values->blue) { /* background is already in screen gamma */ - *sp = (png_byte)((background->red >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->red & 0xff); - *(sp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(sp + 3) = (png_byte)(background->green & 0xff); - *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(sp + 5) = (png_byte)(background->blue & 0xff); + *sp = (modpng14_byte)((background->red >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(background->red & 0xff); + *(sp + 2) = (modpng14_byte)((background->green >> 8) & 0xff); + *(sp + 3) = (modpng14_byte)(background->green & 0xff); + *(sp + 4) = (modpng14_byte)((background->blue >> 8) & 0xff); + *(sp + 5) = (modpng14_byte)(background->blue & 0xff); } else { - png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + modpng14_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(sp + 2) = (png_byte)((v >> 8) & 0xff); - *(sp + 3) = (png_byte)(v & 0xff); + *(sp + 2) = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 3) = (modpng14_byte)(v & 0xff); v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(sp + 4) = (png_byte)((v >> 8) & 0xff); - *(sp + 5) = (png_byte)(v & 0xff); + *(sp + 4) = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 5) = (modpng14_byte)(v & 0xff); } } } @@ -2911,30 +2911,30 @@ sp = row; for (i = 0; i < row_width; i++, sp += 6) { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp+1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); + modpng14_uint_16 r = (modpng14_uint_16)(((*sp) << 8) + *(sp+1)); + modpng14_uint_16 g = (modpng14_uint_16)(((*(sp+2)) << 8) + *(sp+3)); + modpng14_uint_16 b = (modpng14_uint_16)(((*(sp+4)) << 8) + *(sp+5)); if (r == trans_values->red && g == trans_values->green && b == trans_values->blue) { - *sp = (png_byte)((background->red >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->red & 0xff); - *(sp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(sp + 3) = (png_byte)(background->green & 0xff); - *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(sp + 5) = (png_byte)(background->blue & 0xff); + *sp = (modpng14_byte)((background->red >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(background->red & 0xff); + *(sp + 2) = (modpng14_byte)((background->green >> 8) & 0xff); + *(sp + 3) = (modpng14_byte)(background->green & 0xff); + *(sp + 4) = (modpng14_byte)((background->blue >> 8) & 0xff); + *(sp + 5) = (modpng14_byte)(background->blue & 0xff); } } } } break; } - case PNG_COLOR_TYPE_GRAY_ALPHA: + case MODPNG14_COLOR_TYPE_GRAY_ALPHA: { if (row_info->bit_depth == 8) { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_to_1 != NULL && gamma_from_1 != NULL && gamma_table != NULL) { @@ -2942,7 +2942,7 @@ dp = row; for (i = 0; i < row_width; i++, sp += 2, dp++) { - png_uint_16 a = *(sp + 1); + modpng14_uint_16 a = *(sp + 1); if (a == 0xff) { @@ -2951,14 +2951,14 @@ else if (a == 0) { /* background is already in screen gamma */ - *dp = (png_byte)background->gray; + *dp = (modpng14_byte)background->gray; } else { - png_byte v, w; + modpng14_byte v, w; v = gamma_to_1[*sp]; - png_composite(w, v, a, background_1->gray); + modpng14_composite(w, v, a, background_1->gray); *dp = gamma_from_1[w]; } } @@ -2970,30 +2970,30 @@ dp = row; for (i = 0; i < row_width; i++, sp += 2, dp++) { - png_byte a = *(sp + 1); + modpng14_byte a = *(sp + 1); if (a == 0xff) { *dp = *sp; } -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) else if (a == 0) { - *dp = (png_byte)background->gray; + *dp = (modpng14_byte)background->gray; } else { - png_composite(*dp, *sp, a, background_1->gray); + modpng14_composite(*dp, *sp, a, background_1->gray); } #else - *dp = (png_byte)background->gray; + *dp = (modpng14_byte)background->gray; #endif } } } - else /* if (png_ptr->bit_depth == 16) */ + else /* if (modpng14_ptr->bit_depth == 16) */ { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_16 != NULL && gamma_16_from_1 != NULL && gamma_16_to_1 != NULL) { @@ -3001,36 +3001,36 @@ dp = row; for (i = 0; i < row_width; i++, sp += 4, dp += 2) { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); + modpng14_uint_16 a = (modpng14_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - if (a == (png_uint_16)0xffff) + if (a == (modpng14_uint_16)0xffff) { - png_uint_16 v; + modpng14_uint_16 v; v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); + *dp = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(v & 0xff); } -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) else if (a == 0) #else else #endif { /* background is already in screen gamma */ - *dp = (png_byte)((background->gray >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->gray & 0xff); + *dp = (modpng14_byte)((background->gray >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(background->gray & 0xff); } -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) else { - png_uint_16 g, v, w; + modpng14_uint_16 g, v, w; g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(v, g, a, background_1->gray); + modpng14_composite_16(v, g, a, background_1->gray); w = gamma_16_from_1[(v&0xff) >> gamma_shift][v >> 8]; - *dp = (png_byte)((w >> 8) & 0xff); - *(dp + 1) = (png_byte)(w & 0xff); + *dp = (modpng14_byte)((w >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(w & 0xff); } #endif } @@ -3042,29 +3042,29 @@ dp = row; for (i = 0; i < row_width; i++, sp += 4, dp += 2) { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - if (a == (png_uint_16)0xffff) + modpng14_uint_16 a = (modpng14_uint_16)(((*(sp+2)) << 8) + *(sp+3)); + if (a == (modpng14_uint_16)0xffff) { - png_memcpy(dp, sp, 2); + modpng14_memcpy(dp, sp, 2); } -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) else if (a == 0) #else else #endif { - *dp = (png_byte)((background->gray >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->gray & 0xff); + *dp = (modpng14_byte)((background->gray >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(background->gray & 0xff); } -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) else { - png_uint_16 g, v; + modpng14_uint_16 g, v; - g = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_composite_16(v, g, a, background_1->gray); - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); + g = (modpng14_uint_16)(((*sp) << 8) + *(sp + 1)); + modpng14_composite_16(v, g, a, background_1->gray); + *dp = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(v & 0xff); } #endif } @@ -3072,11 +3072,11 @@ } break; } - case PNG_COLOR_TYPE_RGB_ALPHA: + case MODPNG14_COLOR_TYPE_RGB_ALPHA: { if (row_info->bit_depth == 8) { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_to_1 != NULL && gamma_from_1 != NULL && gamma_table != NULL) { @@ -3084,7 +3084,7 @@ dp = row; for (i = 0; i < row_width; i++, sp += 4, dp += 3) { - png_byte a = *(sp + 3); + modpng14_byte a = *(sp + 3); if (a == 0xff) { @@ -3095,22 +3095,22 @@ else if (a == 0) { /* background is already in screen gamma */ - *dp = (png_byte)background->red; - *(dp + 1) = (png_byte)background->green; - *(dp + 2) = (png_byte)background->blue; + *dp = (modpng14_byte)background->red; + *(dp + 1) = (modpng14_byte)background->green; + *(dp + 2) = (modpng14_byte)background->blue; } else { - png_byte v, w; + modpng14_byte v, w; v = gamma_to_1[*sp]; - png_composite(w, v, a, background_1->red); + modpng14_composite(w, v, a, background_1->red); *dp = gamma_from_1[w]; v = gamma_to_1[*(sp + 1)]; - png_composite(w, v, a, background_1->green); + modpng14_composite(w, v, a, background_1->green); *(dp + 1) = gamma_from_1[w]; v = gamma_to_1[*(sp + 2)]; - png_composite(w, v, a, background_1->blue); + modpng14_composite(w, v, a, background_1->blue); *(dp + 2) = gamma_from_1[w]; } } @@ -3122,7 +3122,7 @@ dp = row; for (i = 0; i < row_width; i++, sp += 4, dp += 3) { - png_byte a = *(sp + 3); + modpng14_byte a = *(sp + 3); if (a == 0xff) { @@ -3132,16 +3132,16 @@ } else if (a == 0) { - *dp = (png_byte)background->red; - *(dp + 1) = (png_byte)background->green; - *(dp + 2) = (png_byte)background->blue; + *dp = (modpng14_byte)background->red; + *(dp + 1) = (modpng14_byte)background->green; + *(dp + 2) = (modpng14_byte)background->blue; } else { - png_composite(*dp, *sp, a, background->red); - png_composite(*(dp + 1), *(sp + 1), a, + modpng14_composite(*dp, *sp, a, background->red); + modpng14_composite(*(dp + 1), *(sp + 1), a, background->green); - png_composite(*(dp + 2), *(sp + 2), a, + modpng14_composite(*(dp + 2), *(sp + 2), a, background->blue); } } @@ -3149,7 +3149,7 @@ } else /* if (row_info->bit_depth == 16) */ { -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) if (gamma_16 != NULL && gamma_16_from_1 != NULL && gamma_16_to_1 != NULL) { @@ -3157,51 +3157,51 @@ dp = row; for (i = 0; i < row_width; i++, sp += 8, dp += 6) { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - if (a == (png_uint_16)0xffff) + modpng14_uint_16 a = (modpng14_uint_16)(((modpng14_uint_16)(*(sp + 6)) + << 8) + (modpng14_uint_16)(*(sp + 7))); + if (a == (modpng14_uint_16)0xffff) { - png_uint_16 v; + modpng14_uint_16 v; v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); + *dp = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(v & 0xff); v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(dp + 2) = (png_byte)((v >> 8) & 0xff); - *(dp + 3) = (png_byte)(v & 0xff); + *(dp + 2) = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 3) = (modpng14_byte)(v & 0xff); v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(dp + 4) = (png_byte)((v >> 8) & 0xff); - *(dp + 5) = (png_byte)(v & 0xff); + *(dp + 4) = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 5) = (modpng14_byte)(v & 0xff); } else if (a == 0) { /* background is already in screen gamma */ - *dp = (png_byte)((background->red >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->red & 0xff); - *(dp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(dp + 3) = (png_byte)(background->green & 0xff); - *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(dp + 5) = (png_byte)(background->blue & 0xff); + *dp = (modpng14_byte)((background->red >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(background->red & 0xff); + *(dp + 2) = (modpng14_byte)((background->green >> 8) & 0xff); + *(dp + 3) = (modpng14_byte)(background->green & 0xff); + *(dp + 4) = (modpng14_byte)((background->blue >> 8) & 0xff); + *(dp + 5) = (modpng14_byte)(background->blue & 0xff); } else { - png_uint_16 v, w, x; + modpng14_uint_16 v, w, x; v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(w, v, a, background_1->red); + modpng14_composite_16(w, v, a, background_1->red); x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; - *dp = (png_byte)((x >> 8) & 0xff); - *(dp + 1) = (png_byte)(x & 0xff); + *dp = (modpng14_byte)((x >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(x & 0xff); v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)]; - png_composite_16(w, v, a, background_1->green); + modpng14_composite_16(w, v, a, background_1->green); x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; - *(dp + 2) = (png_byte)((x >> 8) & 0xff); - *(dp + 3) = (png_byte)(x & 0xff); + *(dp + 2) = (modpng14_byte)((x >> 8) & 0xff); + *(dp + 3) = (modpng14_byte)(x & 0xff); v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)]; - png_composite_16(w, v, a, background_1->blue); + modpng14_composite_16(w, v, a, background_1->blue); x = gamma_16_from_1[(w & 0xff) >> gamma_shift][w >> 8]; - *(dp + 4) = (png_byte)((x >> 8) & 0xff); - *(dp + 5) = (png_byte)(x & 0xff); + *(dp + 4) = (modpng14_byte)((x >> 8) & 0xff); + *(dp + 5) = (modpng14_byte)(x & 0xff); } } } @@ -3212,40 +3212,40 @@ dp = row; for (i = 0; i < row_width; i++, sp += 8, dp += 6) { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - if (a == (png_uint_16)0xffff) + modpng14_uint_16 a = (modpng14_uint_16)(((modpng14_uint_16)(*(sp + 6)) + << 8) + (modpng14_uint_16)(*(sp + 7))); + if (a == (modpng14_uint_16)0xffff) { - png_memcpy(dp, sp, 6); + modpng14_memcpy(dp, sp, 6); } else if (a == 0) { - *dp = (png_byte)((background->red >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->red & 0xff); - *(dp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(dp + 3) = (png_byte)(background->green & 0xff); - *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(dp + 5) = (png_byte)(background->blue & 0xff); + *dp = (modpng14_byte)((background->red >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(background->red & 0xff); + *(dp + 2) = (modpng14_byte)((background->green >> 8) & 0xff); + *(dp + 3) = (modpng14_byte)(background->green & 0xff); + *(dp + 4) = (modpng14_byte)((background->blue >> 8) & 0xff); + *(dp + 5) = (modpng14_byte)(background->blue & 0xff); } else { - png_uint_16 v; + modpng14_uint_16 v; - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) + modpng14_uint_16 r = (modpng14_uint_16)(((*sp) << 8) + *(sp + 1)); + modpng14_uint_16 g = (modpng14_uint_16)(((*(sp + 2)) << 8) + *(sp + 3)); - png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) + modpng14_uint_16 b = (modpng14_uint_16)(((*(sp + 4)) << 8) + *(sp + 5)); - png_composite_16(v, r, a, background->red); - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - png_composite_16(v, g, a, background->green); - *(dp + 2) = (png_byte)((v >> 8) & 0xff); - *(dp + 3) = (png_byte)(v & 0xff); - png_composite_16(v, b, a, background->blue); - *(dp + 4) = (png_byte)((v >> 8) & 0xff); - *(dp + 5) = (png_byte)(v & 0xff); + modpng14_composite_16(v, r, a, background->red); + *dp = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 1) = (modpng14_byte)(v & 0xff); + modpng14_composite_16(v, g, a, background->green); + *(dp + 2) = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 3) = (modpng14_byte)(v & 0xff); + modpng14_composite_16(v, b, a, background->blue); + *(dp + 4) = (modpng14_byte)((v >> 8) & 0xff); + *(dp + 5) = (modpng14_byte)(v & 0xff); } } } @@ -3254,11 +3254,11 @@ } } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) + if (row_info->color_type & MODPNG14_COLOR_MASK_ALPHA) { - row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; + row_info->color_type &= ~MODPNG14_COLOR_MASK_ALPHA; row_info->channels--; - row_info->pixel_depth = (png_byte)(row_info->channels * + row_info->pixel_depth = (modpng14_byte)(row_info->channels * row_info->bit_depth); row_info->rowbytes = ((row_width * row_info->pixel_depth + 7) >> 3); @@ -3267,7 +3267,7 @@ } #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) /* Gamma correct the image, avoiding the alpha channel. Make sure * you do this after you deal with the transparency issue on grayscale * or RGB images. If your bit depth is 8, use gamma_table, if it @@ -3275,17 +3275,17 @@ * build_gamma_table(). */ void /* PRIVATE */ -png_do_gamma(png_row_infop row_info, png_bytep row, - png_bytep gamma_table, png_uint_16pp gamma_16_table, +modpng14_do_gamma(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep gamma_table, modpng14_uint_16pp gamma_16_table, int gamma_shift) { - png_bytep sp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; + modpng14_bytep sp; + modpng14_uint_32 i; + modpng14_uint_32 row_width=row_info->width; - png_debug(1, "in png_do_gamma\n"); + modpng14_debug(1, "in modpng14_do_gamma\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif ((row_info->bit_depth <= 8 && gamma_table != NULL) || @@ -3293,7 +3293,7 @@ { switch (row_info->color_type) { - case PNG_COLOR_TYPE_RGB: + case MODPNG14_COLOR_TYPE_RGB: { if (row_info->bit_depth == 8) { @@ -3313,25 +3313,25 @@ sp = row; for (i = 0; i < row_width; i++) { - png_uint_16 v; + modpng14_uint_16 v; v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 2; v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 2; v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 2; } } break; } - case PNG_COLOR_TYPE_RGB_ALPHA: + case MODPNG14_COLOR_TYPE_RGB_ALPHA: { if (row_info->bit_depth == 8) { @@ -3352,23 +3352,23 @@ sp = row; for (i = 0; i < row_width; i++) { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + modpng14_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 2; v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 2; v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 4; } } break; } - case PNG_COLOR_TYPE_GRAY_ALPHA: + case MODPNG14_COLOR_TYPE_GRAY_ALPHA: { if (row_info->bit_depth == 8) { @@ -3384,15 +3384,15 @@ sp = row; for (i = 0; i < row_width; i++) { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + modpng14_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 4; } } break; } - case PNG_COLOR_TYPE_GRAY: + case MODPNG14_COLOR_TYPE_GRAY: { if (row_info->bit_depth == 2) { @@ -3404,7 +3404,7 @@ int c = *sp & 0x0c; int d = *sp & 0x03; - *sp = (png_byte)( + *sp = (modpng14_byte)( ((((int)gamma_table[a|(a>>2)|(a>>4)|(a>>6)]) ) & 0xc0)| ((((int)gamma_table[(b<<2)|b|(b>>2)|(b>>4)])>>2) & 0x30)| ((((int)gamma_table[(c<<4)|(c<<2)|c|(c>>2)])>>4) & 0x0c)| @@ -3420,7 +3420,7 @@ int msb = *sp & 0xf0; int lsb = *sp & 0x0f; - *sp = (png_byte)((((int)gamma_table[msb | (msb >> 4)]) & 0xf0) + *sp = (modpng14_byte)((((int)gamma_table[msb | (msb >> 4)]) & 0xf0) | (((int)gamma_table[(lsb << 4) | lsb]) >> 4)); sp++; } @@ -3439,9 +3439,9 @@ sp = row; for (i = 0; i < row_width; i++) { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); + modpng14_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; + *sp = (modpng14_byte)((v >> 8) & 0xff); + *(sp + 1) = (modpng14_byte)(v & 0xff); sp += 2; } } @@ -3452,25 +3452,25 @@ } #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) /* Expands a palette row to an RGB or RGBA row depending * upon whether you supply trans and num_trans. */ void /* PRIVATE */ -png_do_expand_palette(png_row_infop row_info, png_bytep row, - png_colorp palette, png_bytep trans, int num_trans) +modpng14_do_expand_palette(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_colorp palette, modpng14_bytep trans, int num_trans) { int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width=row_info->width; - png_debug(1, "in png_do_expand_palette\n"); + modpng14_debug(1, "in modpng14_do_expand_palette\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - row_info->color_type == PNG_COLOR_TYPE_PALETTE) + row_info->color_type == MODPNG14_COLOR_TYPE_PALETTE) { if (row_info->bit_depth < 8) { @@ -3478,8 +3478,8 @@ { case 1: { - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; + sp = row + (modpng14_size_t)((row_width - 1) >> 3); + dp = row + (modpng14_size_t)row_width - 1; shift = 7 - (int)((row_width + 7) & 0x07); for (i = 0; i < row_width; i++) { @@ -3501,13 +3501,13 @@ } case 2: { - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; + sp = row + (modpng14_size_t)((row_width - 1) >> 2); + dp = row + (modpng14_size_t)row_width - 1; shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); for (i = 0; i < row_width; i++) { value = (*sp >> shift) & 0x03; - *dp = (png_byte)value; + *dp = (modpng14_byte)value; if (shift == 6) { shift = 0; @@ -3522,13 +3522,13 @@ } case 4: { - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; + sp = row + (modpng14_size_t)((row_width - 1) >> 1); + dp = row + (modpng14_size_t)row_width - 1; shift = (int)((row_width & 0x01) << 2); for (i = 0; i < row_width; i++) { value = (*sp >> shift) & 0x0f; - *dp = (png_byte)value; + *dp = (modpng14_byte)value; if (shift == 4) { shift = 0; @@ -3552,8 +3552,8 @@ { if (trans != NULL) { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 2) - 1; + sp = row + (modpng14_size_t)row_width - 1; + dp = row + (modpng14_size_t)(row_width << 2) - 1; for (i = 0; i < row_width; i++) { @@ -3574,8 +3574,8 @@ } else { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width * 3) - 1; + sp = row + (modpng14_size_t)row_width - 1; + dp = row + (modpng14_size_t)(row_width * 3) - 1; for (i = 0; i < row_width; i++) { @@ -3600,22 +3600,22 @@ * transparency value is supplied, an alpha channel is built. */ void /* PRIVATE */ -png_do_expand(png_row_infop row_info, png_bytep row, - png_color_16p trans_value) +modpng14_do_expand(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_color_16p trans_value) { int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width=row_info->width; - png_debug(1, "in png_do_expand\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_expand\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) + if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY) { - png_uint_16 gray = (png_uint_16)(trans_value ? trans_value->gray : 0); + modpng14_uint_16 gray = (modpng14_uint_16)(trans_value ? trans_value->gray : 0); if (row_info->bit_depth < 8) { @@ -3623,9 +3623,9 @@ { case 1: { - gray = (png_uint_16)(gray*0xff); - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; + gray = (modpng14_uint_16)(gray*0xff); + sp = row + (modpng14_size_t)((row_width - 1) >> 3); + dp = row + (modpng14_size_t)row_width - 1; shift = 7 - (int)((row_width + 7) & 0x07); for (i = 0; i < row_width; i++) { @@ -3647,14 +3647,14 @@ } case 2: { - gray = (png_uint_16)(gray*0x55); - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; + gray = (modpng14_uint_16)(gray*0x55); + sp = row + (modpng14_size_t)((row_width - 1) >> 2); + dp = row + (modpng14_size_t)row_width - 1; shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); for (i = 0; i < row_width; i++) { value = (*sp >> shift) & 0x03; - *dp = (png_byte)(value | (value << 2) | (value << 4) | + *dp = (modpng14_byte)(value | (value << 2) | (value << 4) | (value << 6)); if (shift == 6) { @@ -3670,14 +3670,14 @@ } case 4: { - gray = (png_uint_16)(gray*0x11); - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; + gray = (modpng14_uint_16)(gray*0x11); + sp = row + (modpng14_size_t)((row_width - 1) >> 1); + dp = row + (modpng14_size_t)row_width - 1; shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); for (i = 0; i < row_width; i++) { value = (*sp >> shift) & 0x0f; - *dp = (png_byte)(value | (value << 4)); + *dp = (modpng14_byte)(value | (value << 4)); if (shift == 4) { shift = 0; @@ -3700,8 +3700,8 @@ { if (row_info->bit_depth == 8) { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 1) - 1; + sp = row + (modpng14_size_t)row_width - 1; + dp = row + (modpng14_size_t)(row_width << 1) - 1; for (i = 0; i < row_width; i++) { if (*sp == gray) @@ -3717,8 +3717,8 @@ dp = row + (row_info->rowbytes << 1) - 1; for (i = 0; i < row_width; i++) { - if (((png_uint_16)*(sp) | - ((png_uint_16)*(sp - 1) << 8)) == gray) + if (((modpng14_uint_16)*(sp) | + ((modpng14_uint_16)*(sp - 1) << 8)) == gray) { *dp-- = 0; *dp-- = 0; @@ -3732,19 +3732,19 @@ *dp-- = *sp--; } } - row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA; + row_info->color_type = MODPNG14_COLOR_TYPE_GRAY_ALPHA; row_info->channels = 2; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1); + row_info->pixel_depth = (modpng14_byte)(row_info->bit_depth << 1); row_info->rowbytes = ((row_width * row_info->pixel_depth) >> 3); } } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB && trans_value) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB && trans_value) { if (row_info->bit_depth == 8) { - sp = row + (png_size_t)row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 2) - 1; + sp = row + (modpng14_size_t)row_info->rowbytes - 1; + dp = row + (modpng14_size_t)(row_width << 2) - 1; for (i = 0; i < row_width; i++) { if (*(sp - 2) == trans_value->red && @@ -3761,15 +3761,15 @@ else if (row_info->bit_depth == 16) { sp = row + row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 3) - 1; + dp = row + (modpng14_size_t)(row_width << 3) - 1; for (i = 0; i < row_width; i++) { - if ((((png_uint_16)*(sp - 4) | - ((png_uint_16)*(sp - 5) << 8)) == trans_value->red) && - (((png_uint_16)*(sp - 2) | - ((png_uint_16)*(sp - 3) << 8)) == trans_value->green) && - (((png_uint_16)*(sp - 0) | - ((png_uint_16)*(sp - 1) << 8)) == trans_value->blue)) + if ((((modpng14_uint_16)*(sp - 4) | + ((modpng14_uint_16)*(sp - 5) << 8)) == trans_value->red) && + (((modpng14_uint_16)*(sp - 2) | + ((modpng14_uint_16)*(sp - 3) << 8)) == trans_value->green) && + (((modpng14_uint_16)*(sp - 0) | + ((modpng14_uint_16)*(sp - 1) << 8)) == trans_value->blue)) { *dp-- = 0; *dp-- = 0; @@ -3787,9 +3787,9 @@ *dp-- = *sp--; } } - row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA; + row_info->color_type = MODPNG14_COLOR_TYPE_RGB_ALPHA; row_info->channels = 4; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2); + row_info->pixel_depth = (modpng14_byte)(row_info->bit_depth << 2); row_info->rowbytes = ((row_width * row_info->pixel_depth) >> 3); } @@ -3797,21 +3797,21 @@ } #endif -#if defined(PNG_READ_DITHER_SUPPORTED) +#if defined(MODPNG14_READ_DITHER_SUPPORTED) void /* PRIVATE */ -png_do_dither(png_row_infop row_info, png_bytep row, - png_bytep palette_lookup, png_bytep dither_lookup) +modpng14_do_dither(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep palette_lookup, modpng14_bytep dither_lookup) { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width=row_info->width; - png_debug(1, "in png_do_dither\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_dither\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif { - if (row_info->color_type == PNG_COLOR_TYPE_RGB && + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB && palette_lookup && row_info->bit_depth == 8) { int r, g, b, p; @@ -3830,24 +3830,24 @@ (((g >> 3) & 0x1f) << 5) | ((b >> 3) & 0x1f); */ - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); + p = (((r >> (8 - MODPNG14_DITHER_RED_BITS)) & + ((1 << MODPNG14_DITHER_RED_BITS) - 1)) << + (MODPNG14_DITHER_GREEN_BITS + MODPNG14_DITHER_BLUE_BITS)) | + (((g >> (8 - MODPNG14_DITHER_GREEN_BITS)) & + ((1 << MODPNG14_DITHER_GREEN_BITS) - 1)) << + (MODPNG14_DITHER_BLUE_BITS)) | + ((b >> (8 - MODPNG14_DITHER_BLUE_BITS)) & + ((1 << MODPNG14_DITHER_BLUE_BITS) - 1)); *dp++ = palette_lookup[p]; } - row_info->color_type = PNG_COLOR_TYPE_PALETTE; + row_info->color_type = MODPNG14_COLOR_TYPE_PALETTE; row_info->channels = 1; row_info->pixel_depth = row_info->bit_depth; row_info->rowbytes = ((row_width * row_info->pixel_depth + 7) >> 3); } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA && palette_lookup != NULL && row_info->bit_depth == 8) { int r, g, b, p; @@ -3860,24 +3860,24 @@ b = *sp++; sp++; - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); + p = (((r >> (8 - MODPNG14_DITHER_RED_BITS)) & + ((1 << MODPNG14_DITHER_RED_BITS) - 1)) << + (MODPNG14_DITHER_GREEN_BITS + MODPNG14_DITHER_BLUE_BITS)) | + (((g >> (8 - MODPNG14_DITHER_GREEN_BITS)) & + ((1 << MODPNG14_DITHER_GREEN_BITS) - 1)) << + (MODPNG14_DITHER_BLUE_BITS)) | + ((b >> (8 - MODPNG14_DITHER_BLUE_BITS)) & + ((1 << MODPNG14_DITHER_BLUE_BITS) - 1)); *dp++ = palette_lookup[p]; } - row_info->color_type = PNG_COLOR_TYPE_PALETTE; + row_info->color_type = MODPNG14_COLOR_TYPE_PALETTE; row_info->channels = 1; row_info->pixel_depth = row_info->bit_depth; row_info->rowbytes = ((row_width * row_info->pixel_depth + 7) >> 3); } - else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && + else if (row_info->color_type == MODPNG14_COLOR_TYPE_PALETTE && dither_lookup && row_info->bit_depth == 8) { sp = row; @@ -3890,9 +3890,9 @@ } #endif -#ifdef PNG_FLOATING_POINT_SUPPORTED -#if defined(PNG_READ_GAMMA_SUPPORTED) -static int png_gamma_shift[] = +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +#if defined(MODPNG14_READ_GAMMA_SUPPORTED) +static int modpng14_gamma_shift[] = {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0}; /* We build the 8- or 16-bit gamma tables here. Note that for 16-bit @@ -3901,82 +3901,82 @@ * we don't need to allocate > 64K chunks for a full 16-bit table. */ void /* PRIVATE */ -png_build_gamma_table(png_structp png_ptr) +modpng14_build_gamma_table(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_build_gamma_table\n"); - if(png_ptr->gamma != 0.0) + modpng14_debug(1, "in modpng14_build_gamma_table\n"); + if(modpng14_ptr->gamma != 0.0) { - if (png_ptr->bit_depth <= 8) + if (modpng14_ptr->bit_depth <= 8) { int i; double g; - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); + if (modpng14_ptr->screen_gamma > .000001) + g = 1.0 / (modpng14_ptr->gamma * modpng14_ptr->screen_gamma); else g = 1.0; - png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); + modpng14_ptr->gamma_table = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)256); for (i = 0; i < 256; i++) { - png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0, + modpng14_ptr->gamma_table[i] = (modpng14_byte)(pow((double)i / 255.0, g) * 255.0 + .5); } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY)) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) || \ + defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) + if (modpng14_ptr->transformations & ((MODPNG14_BACKGROUND) | MODPNG14_RGB_TO_GRAY)) { - g = 1.0 / (png_ptr->gamma); + g = 1.0 / (modpng14_ptr->gamma); - png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); + modpng14_ptr->gamma_to_1 = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)256); for (i = 0; i < 256; i++) { - png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0, + modpng14_ptr->gamma_to_1[i] = (modpng14_byte)(pow((double)i / 255.0, g) * 255.0 + .5); } - png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); + modpng14_ptr->gamma_from_1 = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)256); - if(png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; + if(modpng14_ptr->screen_gamma > 0.000001) + g = 1.0 / modpng14_ptr->screen_gamma; else - g = png_ptr->gamma; /* probably doing rgb_to_gray */ + g = modpng14_ptr->gamma; /* probably doing rgb_to_gray */ for (i = 0; i < 256; i++) { - png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0, + modpng14_ptr->gamma_from_1[i] = (modpng14_byte)(pow((double)i / 255.0, g) * 255.0 + .5); } } -#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ +#endif /* MODPNG14_READ_BACKGROUND_SUPPORTED || MODPNG14_RGB_TO_GRAY_SUPPORTED */ } else { double g; int i, j, shift, num; int sig_bit; - png_uint_32 ig; + modpng14_uint_32 ig; - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) + if (modpng14_ptr->color_type & MODPNG14_COLOR_MASK_COLOR) { - sig_bit = (int)png_ptr->sig_bit.red; - if ((int)png_ptr->sig_bit.green > sig_bit) - sig_bit = png_ptr->sig_bit.green; - if ((int)png_ptr->sig_bit.blue > sig_bit) - sig_bit = png_ptr->sig_bit.blue; + sig_bit = (int)modpng14_ptr->sig_bit.red; + if ((int)modpng14_ptr->sig_bit.green > sig_bit) + sig_bit = modpng14_ptr->sig_bit.green; + if ((int)modpng14_ptr->sig_bit.blue > sig_bit) + sig_bit = modpng14_ptr->sig_bit.blue; } else { - sig_bit = (int)png_ptr->sig_bit.gray; + sig_bit = (int)modpng14_ptr->sig_bit.gray; } if (sig_bit > 0) @@ -3984,10 +3984,10 @@ else shift = 0; - if (png_ptr->transformations & PNG_16_TO_8) + if (modpng14_ptr->transformations & MODPNG14_16_TO_8) { - if (shift < (16 - PNG_MAX_GAMMA_8)) - shift = (16 - PNG_MAX_GAMMA_8); + if (shift < (16 - MODPNG14_MAX_GAMMA_8)) + shift = (16 - MODPNG14_MAX_GAMMA_8); } if (shift > 8) @@ -3995,27 +3995,27 @@ if (shift < 0) shift = 0; - png_ptr->gamma_shift = (png_byte)shift; + modpng14_ptr->gamma_shift = (modpng14_byte)shift; num = (1 << (8 - shift)); - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); + if (modpng14_ptr->screen_gamma > .000001) + g = 1.0 / (modpng14_ptr->gamma * modpng14_ptr->screen_gamma); else g = 1.0; - png_ptr->gamma_16_table = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * sizeof (png_uint_16p))); + modpng14_ptr->gamma_16_table = (modpng14_uint_16pp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num * sizeof (modpng14_uint_16p))); - if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND)) + if (modpng14_ptr->transformations & (MODPNG14_16_TO_8 | MODPNG14_BACKGROUND)) { double fin, fout; - png_uint_32 last, max; + modpng14_uint_32 last, max; for (i = 0; i < num; i++) { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * sizeof (png_uint_16))); + modpng14_ptr->gamma_16_table[i] = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(256 * sizeof (modpng14_uint_16))); } g = 1.0 / g; @@ -4024,19 +4024,19 @@ { fout = ((double)i + 0.5) / 256.0; fin = pow(fout, g); - max = (png_uint_32)(fin * (double)((png_uint_32)num << 8)); + max = (modpng14_uint_32)(fin * (double)((modpng14_uint_32)num << 8)); while (last <= max) { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)( - (png_uint_16)i | ((png_uint_16)i << 8)); + modpng14_ptr->gamma_16_table[(int)(last & (0xff >> shift))] + [(int)(last >> (8 - shift))] = (modpng14_uint_16)( + (modpng14_uint_16)i | ((modpng14_uint_16)i << 8)); last++; } } - while (last < ((png_uint_32)num << 8)) + while (last < ((modpng14_uint_32)num << 8)) { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)65535L; + modpng14_ptr->gamma_16_table[(int)(last & (0xff >> shift))] + [(int)(last >> (8 - shift))] = (modpng14_uint_16)65535L; last++; } } @@ -4044,132 +4044,132 @@ { for (i = 0; i < num; i++) { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * sizeof (png_uint_16))); + modpng14_ptr->gamma_16_table[i] = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(256 * sizeof (modpng14_uint_16))); - ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4); + ig = (((modpng14_uint_32)i * (modpng14_uint_32)modpng14_gamma_shift[shift]) >> 4); for (j = 0; j < 256; j++) { - png_ptr->gamma_16_table[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / + modpng14_ptr->gamma_16_table[i][j] = + (modpng14_uint_16)(pow((double)(ig + ((modpng14_uint_32)j << 8)) / 65535.0, g) * 65535.0 + .5); } } } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY)) +#if defined(MODPNG14_READ_BACKGROUND_SUPPORTED) || \ + defined(MODPNG14_READ_RGB_TO_GRAY_SUPPORTED) + if (modpng14_ptr->transformations & (MODPNG14_BACKGROUND | MODPNG14_RGB_TO_GRAY)) { - g = 1.0 / (png_ptr->gamma); + g = 1.0 / (modpng14_ptr->gamma); - png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * sizeof (png_uint_16p ))); + modpng14_ptr->gamma_16_to_1 = (modpng14_uint_16pp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num * sizeof (modpng14_uint_16p ))); for (i = 0; i < num; i++) { - png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * sizeof (png_uint_16))); + modpng14_ptr->gamma_16_to_1[i] = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(256 * sizeof (modpng14_uint_16))); - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); + ig = (((modpng14_uint_32)i * + (modpng14_uint_32)modpng14_gamma_shift[shift]) >> 4); for (j = 0; j < 256; j++) { - png_ptr->gamma_16_to_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / + modpng14_ptr->gamma_16_to_1[i][j] = + (modpng14_uint_16)(pow((double)(ig + ((modpng14_uint_32)j << 8)) / 65535.0, g) * 65535.0 + .5); } } - if(png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; + if(modpng14_ptr->screen_gamma > 0.000001) + g = 1.0 / modpng14_ptr->screen_gamma; else - g = png_ptr->gamma; /* probably doing rgb_to_gray */ + g = modpng14_ptr->gamma; /* probably doing rgb_to_gray */ - png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * sizeof (png_uint_16p))); + modpng14_ptr->gamma_16_from_1 = (modpng14_uint_16pp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(num * sizeof (modpng14_uint_16p))); for (i = 0; i < num; i++) { - png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * sizeof (png_uint_16))); + modpng14_ptr->gamma_16_from_1[i] = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(256 * sizeof (modpng14_uint_16))); - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); + ig = (((modpng14_uint_32)i * + (modpng14_uint_32)modpng14_gamma_shift[shift]) >> 4); for (j = 0; j < 256; j++) { - png_ptr->gamma_16_from_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / + modpng14_ptr->gamma_16_from_1[i][j] = + (modpng14_uint_16)(pow((double)(ig + ((modpng14_uint_32)j << 8)) / 65535.0, g) * 65535.0 + .5); } } } -#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ +#endif /* MODPNG14_READ_BACKGROUND_SUPPORTED || MODPNG14_RGB_TO_GRAY_SUPPORTED */ } } } #endif -/* To do: install integer version of png_build_gamma_table here */ +/* To do: install integer version of modpng14_build_gamma_table here */ #endif -#if defined(PNG_MNG_FEATURES_SUPPORTED) +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) /* undoes intrapixel differencing */ void /* PRIVATE */ -png_do_read_intrapixel(png_row_infop row_info, png_bytep row) +modpng14_do_read_intrapixel(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_read_intrapixel\n"); + modpng14_debug(1, "in modpng14_do_read_intrapixel\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) + (row_info->color_type & MODPNG14_COLOR_MASK_COLOR)) { int bytes_per_pixel; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 row_width = row_info->width; if (row_info->bit_depth == 8) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) bytes_per_pixel = 3; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) bytes_per_pixel = 4; else return; for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) { - *(rp) = (png_byte)((256 + *rp + *(rp+1))&0xff); - *(rp+2) = (png_byte)((256 + *(rp+2) + *(rp+1))&0xff); + *(rp) = (modpng14_byte)((256 + *rp + *(rp+1))&0xff); + *(rp+2) = (modpng14_byte)((256 + *(rp+2) + *(rp+1))&0xff); } } else if (row_info->bit_depth == 16) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) bytes_per_pixel = 6; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) bytes_per_pixel = 8; else return; for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) { - png_uint_32 s0=*(rp )<<8 | *(rp+1); - png_uint_32 s1=*(rp+2)<<8 | *(rp+3); - png_uint_32 s2=*(rp+4)<<8 | *(rp+5); - png_uint_32 red=(65536+s0+s1)&0xffff; - png_uint_32 blue=(65536+s2+s1)&0xffff; - *(rp ) = (png_byte)((red>>8)&0xff); - *(rp+1) = (png_byte)(red&0xff); - *(rp+4) = (png_byte)((blue>>8)&0xff); - *(rp+5) = (png_byte)(blue&0xff); + modpng14_uint_32 s0=*(rp )<<8 | *(rp+1); + modpng14_uint_32 s1=*(rp+2)<<8 | *(rp+3); + modpng14_uint_32 s2=*(rp+4)<<8 | *(rp+5); + modpng14_uint_32 red=(65536+s0+s1)&0xffff; + modpng14_uint_32 blue=(65536+s2+s1)&0xffff; + *(rp ) = (modpng14_byte)((red>>8)&0xff); + *(rp+1) = (modpng14_byte)(red&0xff); + *(rp+4) = (modpng14_byte)((blue>>8)&0xff); + *(rp+5) = (modpng14_byte)(blue&0xff); } } } } -#endif /* PNG_MNG_FEATURES_SUPPORTED */ +#endif /* MODPNG14_MNG_FEATURES_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngrutil.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngrutil.c @@ -1,22 +1,22 @@ /* pngrutil.c - utilities to read a PNG file * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This file contains routines that are only called from within - * libpng itself during the course of reading an image. + * libmodpng14 itself during the course of reading an image. */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" #if 0 && defined(_WIN32_WCE) /* strtod() function is not supported on WindowsCE */ -# ifdef PNG_FLOATING_POINT_SUPPORTED +# ifdef MODPNG14_FLOATING_POINT_SUPPORTED __inline double strtod(const char *nptr, char **endptr) { double result = 0; @@ -30,7 +30,7 @@ MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len); result = wcstod(str, &end); len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL); - *endptr = (char *)nptr + (png_strlen(nptr) - len + 1); + *endptr = (char *)nptr + (modpng14_strlen(nptr) - len + 1); free(str); } return result; @@ -38,60 +38,60 @@ # endif #endif -png_uint_32 /* PRIVATE */ -png_get_uint_31(png_structp png_ptr, png_bytep buf) +modpng14_uint_32 /* PRIVATE */ +modpng14_get_uint_31(modpng14_structp modpng14_ptr, modpng14_bytep buf) { - png_uint_32 i = png_get_uint_32(buf); - if (i > PNG_UINT_31_MAX) - png_error(png_ptr, "PNG unsigned integer out of range.\n"); + modpng14_uint_32 i = modpng14_get_uint_32(buf); + if (i > MODPNG14_UINT_31_MAX) + modpng14_error(modpng14_ptr, "PNG unsigned integer out of range.\n"); return (i); } -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED +#ifndef MODPNG14_READ_BIG_ENDIAN_SUPPORTED /* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ -png_uint_32 /* PRIVATE */ -png_get_uint_32(png_bytep buf) +modpng14_uint_32 /* PRIVATE */ +modpng14_get_uint_32(modpng14_bytep buf) { - png_uint_32 i = ((png_uint_32)(*buf) << 24) + - ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); + modpng14_uint_32 i = ((modpng14_uint_32)(*buf) << 24) + + ((modpng14_uint_32)(*(buf + 1)) << 16) + + ((modpng14_uint_32)(*(buf + 2)) << 8) + + (modpng14_uint_32)(*(buf + 3)); return (i); } -#if defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_oFFs_SUPPORTED) +#if defined(MODPNG14_READ_pCAL_SUPPORTED) || defined(MODPNG14_READ_oFFs_SUPPORTED) /* Grab a signed 32-bit integer from a buffer in big-endian format. The * data is stored in the PNG file in two's complement format, and it is * assumed that the machine format for signed integers is the same. */ -png_int_32 /* PRIVATE */ -png_get_int_32(png_bytep buf) +modpng14_int_32 /* PRIVATE */ +modpng14_get_int_32(modpng14_bytep buf) { - png_int_32 i = ((png_int_32)(*buf) << 24) + - ((png_int_32)(*(buf + 1)) << 16) + - ((png_int_32)(*(buf + 2)) << 8) + - (png_int_32)(*(buf + 3)); + modpng14_int_32 i = ((modpng14_int_32)(*buf) << 24) + + ((modpng14_int_32)(*(buf + 1)) << 16) + + ((modpng14_int_32)(*(buf + 2)) << 8) + + (modpng14_int_32)(*(buf + 3)); return (i); } -#endif /* PNG_READ_pCAL_SUPPORTED */ +#endif /* MODPNG14_READ_pCAL_SUPPORTED */ /* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ -png_uint_16 /* PRIVATE */ -png_get_uint_16(png_bytep buf) +modpng14_uint_16 /* PRIVATE */ +modpng14_get_uint_16(modpng14_bytep buf) { - png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + - (png_uint_16)(*(buf + 1))); + modpng14_uint_16 i = (modpng14_uint_16)(((modpng14_uint_16)(*buf) << 8) + + (modpng14_uint_16)(*(buf + 1))); return (i); } -#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */ +#endif /* MODPNG14_READ_BIG_ENDIAN_SUPPORTED */ /* Read data, and (optionally) run it through the CRC. */ void /* PRIVATE */ -png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length) +modpng14_crc_read(modpng14_structp modpng14_ptr, modpng14_bytep buf, modpng14_size_t length) { - png_read_data(png_ptr, buf, length); - png_calculate_crc(png_ptr, buf, length); + modpng14_read_data(modpng14_ptr, buf, length); + modpng14_calculate_crc(modpng14_ptr, buf, length); } /* Optionally skip data and then check the CRC. Depending on whether we @@ -99,32 +99,32 @@ things up, we may calculate the CRC on the data and print a message. Returns '1' if there was a CRC error, '0' otherwise. */ int /* PRIVATE */ -png_crc_finish(png_structp png_ptr, png_uint_32 skip) +modpng14_crc_finish(modpng14_structp modpng14_ptr, modpng14_uint_32 skip) { - png_size_t i; - png_size_t istop = png_ptr->zbuf_size; + modpng14_size_t i; + modpng14_size_t istop = modpng14_ptr->zbuf_size; - for (i = (png_size_t)skip; i > istop; i -= istop) + for (i = (modpng14_size_t)skip; i > istop; i -= istop) { - png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->zbuf, modpng14_ptr->zbuf_size); } if (i) { - png_crc_read(png_ptr, png_ptr->zbuf, i); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->zbuf, i); } - if (png_crc_error(png_ptr)) + if (modpng14_crc_error(modpng14_ptr)) { - if (((png_ptr->chunk_name[0] & 0x20) && /* Ancillary */ - !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) || - (!(png_ptr->chunk_name[0] & 0x20) && /* Critical */ - (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE))) + if (((modpng14_ptr->chunk_name[0] & 0x20) && /* Ancillary */ + !(modpng14_ptr->flags & MODPNG14_FLAG_CRC_ANCILLARY_NOWARN)) || + (!(modpng14_ptr->chunk_name[0] & 0x20) && /* Critical */ + (modpng14_ptr->flags & MODPNG14_FLAG_CRC_CRITICAL_USE))) { - png_chunk_warning(png_ptr, "CRC error"); + modpng14_chunk_warning(modpng14_ptr, "CRC error"); } else { - png_chunk_error(png_ptr, "CRC error"); + modpng14_chunk_error(modpng14_ptr, "CRC error"); } return (1); } @@ -132,40 +132,40 @@ return (0); } -/* Compare the CRC stored in the PNG file with that calculated by libpng from +/* Compare the CRC stored in the PNG file with that calculated by libmodpng14 from the data it has read thus far. */ int /* PRIVATE */ -png_crc_error(png_structp png_ptr) +modpng14_crc_error(modpng14_structp modpng14_ptr) { - png_byte crc_bytes[4]; - png_uint_32 crc; + modpng14_byte crc_bytes[4]; + modpng14_uint_32 crc; int need_crc = 1; - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ + if (modpng14_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)) + if ((modpng14_ptr->flags & MODPNG14_FLAG_CRC_ANCILLARY_MASK) == + (MODPNG14_FLAG_CRC_ANCILLARY_USE | MODPNG14_FLAG_CRC_ANCILLARY_NOWARN)) need_crc = 0; } else /* critical */ { - if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) + if (modpng14_ptr->flags & MODPNG14_FLAG_CRC_CRITICAL_IGNORE) need_crc = 0; } - png_read_data(png_ptr, crc_bytes, 4); + modpng14_read_data(modpng14_ptr, crc_bytes, 4); if (need_crc) { - crc = png_get_uint_32(crc_bytes); - return ((int)(crc != png_ptr->crc)); + crc = modpng14_get_uint_32(crc_bytes); + return ((int)(crc != modpng14_ptr->crc)); } else return (0); } -#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \ - defined(PNG_READ_iCCP_SUPPORTED) +#if defined(MODPNG14_READ_zTXt_SUPPORTED) || defined(MODPNG14_READ_iTXt_SUPPORTED) || \ + defined(MODPNG14_READ_iCCP_SUPPORTED) /* * Decompress trailing data in a chunk. The assumption is that chunkdata * points at an allocated area holding the contents of a chunk with a @@ -173,154 +173,154 @@ * holding the original prefix part and an uncompressed version of the * trailing part (the malloc area passed in is freed). */ -png_charp /* PRIVATE */ -png_decompress_chunk(png_structp png_ptr, int comp_type, - png_charp chunkdata, png_size_t chunklength, - png_size_t prefix_size, png_size_t *newlength) +modpng14_charp /* PRIVATE */ +modpng14_decompress_chunk(modpng14_structp modpng14_ptr, int comp_type, + modpng14_charp chunkdata, modpng14_size_t chunklength, + modpng14_size_t prefix_size, modpng14_size_t *newlength) { static char msg[] = "Error decoding compressed text"; - png_charp text = NULL; - png_size_t text_size; + modpng14_charp text = NULL; + modpng14_size_t text_size; - if (comp_type == PNG_COMPRESSION_TYPE_BASE) + if (comp_type == MODPNG14_COMPRESSION_TYPE_BASE) { int ret = Z_OK; - png_ptr->zstream.next_in = (png_bytep)(chunkdata + prefix_size); - png_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_ptr->zstream.next_in = (modpng14_bytep)(chunkdata + prefix_size); + modpng14_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; text_size = 0; text = NULL; - while (png_ptr->zstream.avail_in) + while (modpng14_ptr->zstream.avail_in) { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); + ret = inflate(&modpng14_ptr->zstream, Z_PARTIAL_FLUSH); if (ret != Z_OK && ret != Z_STREAM_END) { - if (png_ptr->zstream.msg != NULL) - png_warning(png_ptr, png_ptr->zstream.msg); + if (modpng14_ptr->zstream.msg != NULL) + modpng14_warning(modpng14_ptr, modpng14_ptr->zstream.msg); else - png_warning(png_ptr, msg); - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; + modpng14_warning(modpng14_ptr, msg); + inflateReset(&modpng14_ptr->zstream); + modpng14_ptr->zstream.avail_in = 0; if (text == NULL) { text_size = prefix_size + sizeof(msg) + 1; - text = (png_charp)png_malloc_warn(png_ptr, text_size); + text = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, text_size); if (text == NULL) { - png_free(png_ptr,chunkdata); - png_error(png_ptr,"Not enough memory to decompress chunk"); + modpng14_free(modpng14_ptr,chunkdata); + modpng14_error(modpng14_ptr,"Not enough memory to decompress chunk"); } - png_memcpy(text, chunkdata, prefix_size); + modpng14_memcpy(text, chunkdata, prefix_size); } text[text_size - 1] = 0x00; /* Copy what we can of the error message into the text chunk */ - text_size = (png_size_t)(chunklength - (text - chunkdata) - 1); + text_size = (modpng14_size_t)(chunklength - (text - chunkdata) - 1); text_size = sizeof(msg) > text_size ? text_size : sizeof(msg); - png_memcpy(text + prefix_size, msg, text_size + 1); + modpng14_memcpy(text + prefix_size, msg, text_size + 1); break; } - if (!png_ptr->zstream.avail_out || ret == Z_STREAM_END) + if (!modpng14_ptr->zstream.avail_out || ret == Z_STREAM_END) { if (text == NULL) { text_size = prefix_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out; - text = (png_charp)png_malloc_warn(png_ptr, text_size + 1); + modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out; + text = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, text_size + 1); if (text == NULL) { - png_free(png_ptr,chunkdata); - png_error(png_ptr,"Not enough memory to decompress chunk."); + modpng14_free(modpng14_ptr,chunkdata); + modpng14_error(modpng14_ptr,"Not enough memory to decompress chunk."); } - png_memcpy(text + prefix_size, png_ptr->zbuf, + modpng14_memcpy(text + prefix_size, modpng14_ptr->zbuf, text_size - prefix_size); - png_memcpy(text, chunkdata, prefix_size); + modpng14_memcpy(text, chunkdata, prefix_size); *(text + text_size) = 0x00; } else { - png_charp tmp; + modpng14_charp tmp; tmp = text; - text = (png_charp)png_malloc_warn(png_ptr, - (png_uint_32)(text_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1)); + text = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)(text_size + + modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out + 1)); if (text == NULL) { - png_free(png_ptr, tmp); - png_free(png_ptr, chunkdata); - png_error(png_ptr,"Not enough memory to decompress chunk.."); + modpng14_free(modpng14_ptr, tmp); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_error(modpng14_ptr,"Not enough memory to decompress chunk.."); } - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - png_memcpy(text + text_size, png_ptr->zbuf, - (png_ptr->zbuf_size - png_ptr->zstream.avail_out)); - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; + modpng14_memcpy(text, tmp, text_size); + modpng14_free(modpng14_ptr, tmp); + modpng14_memcpy(text + text_size, modpng14_ptr->zbuf, + (modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out)); + text_size += modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out; *(text + text_size) = 0x00; } if (ret == Z_STREAM_END) break; else { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; } } } if (ret != Z_STREAM_END) { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char umsg[52]; if (ret == Z_BUF_ERROR) sprintf(umsg,"Buffer error in compressed datastream in %s chunk", - png_ptr->chunk_name); + modpng14_ptr->chunk_name); else if (ret == Z_DATA_ERROR) sprintf(umsg,"Data error in compressed datastream in %s chunk", - png_ptr->chunk_name); + modpng14_ptr->chunk_name); else sprintf(umsg,"Incomplete compressed datastream in %s chunk", - png_ptr->chunk_name); - png_warning(png_ptr, umsg); + modpng14_ptr->chunk_name); + modpng14_warning(modpng14_ptr, umsg); #else - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Incomplete compressed datastream in chunk other than IDAT"); #endif text_size=prefix_size; if (text == NULL) { - text = (png_charp)png_malloc_warn(png_ptr, text_size+1); + text = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, text_size+1); if (text == NULL) { - png_free(png_ptr, chunkdata); - png_error(png_ptr,"Not enough memory for text."); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_error(modpng14_ptr,"Not enough memory for text."); } - png_memcpy(text, chunkdata, prefix_size); + modpng14_memcpy(text, chunkdata, prefix_size); } *(text + text_size) = 0x00; } - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; + inflateReset(&modpng14_ptr->zstream); + modpng14_ptr->zstream.avail_in = 0; - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, chunkdata); chunkdata = text; *newlength=text_size; } - else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */ + else /* if (comp_type != MODPNG14_COMPRESSION_TYPE_BASE) */ { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char umsg[50]; sprintf(umsg, "Unknown zTXt compression type %d", comp_type); - png_warning(png_ptr, umsg); + modpng14_warning(modpng14_ptr, umsg); #else - png_warning(png_ptr, "Unknown zTXt compression type"); + modpng14_warning(modpng14_ptr, "Unknown zTXt compression type"); #endif *(chunkdata + prefix_size) = 0x00; @@ -333,29 +333,29 @@ /* read and check the IDHR chunk */ void /* PRIVATE */ -png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_IHDR(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_byte buf[13]; - png_uint_32 width, height; + modpng14_byte buf[13]; + modpng14_uint_32 width, height; int bit_depth, color_type, compression_type, filter_type; int interlace_type; - png_debug(1, "in png_handle_IHDR\n"); + modpng14_debug(1, "in modpng14_handle_IHDR\n"); - if (png_ptr->mode & PNG_HAVE_IHDR) - png_error(png_ptr, "Out of place IHDR"); + if (modpng14_ptr->mode & MODPNG14_HAVE_IHDR) + modpng14_error(modpng14_ptr, "Out of place IHDR"); /* check the length */ if (length != 13) - png_error(png_ptr, "Invalid IHDR chunk"); + modpng14_error(modpng14_ptr, "Invalid IHDR chunk"); - png_ptr->mode |= PNG_HAVE_IHDR; + modpng14_ptr->mode |= MODPNG14_HAVE_IHDR; - png_crc_read(png_ptr, buf, 13); - png_crc_finish(png_ptr, 0); + modpng14_crc_read(modpng14_ptr, buf, 13); + modpng14_crc_finish(modpng14_ptr, 0); - width = png_get_uint_32(buf); - height = png_get_uint_32(buf + 4); + width = modpng14_get_uint_32(buf); + height = modpng14_get_uint_32(buf + 4); bit_depth = buf[8]; color_type = buf[9]; compression_type = buf[10]; @@ -364,107 +364,107 @@ /* set internal variables */ - png_ptr->width = width; - png_ptr->height = height; - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->interlaced = (png_byte)interlace_type; - png_ptr->color_type = (png_byte)color_type; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_ptr->filter_type = (png_byte)filter_type; + modpng14_ptr->width = width; + modpng14_ptr->height = height; + modpng14_ptr->bit_depth = (modpng14_byte)bit_depth; + modpng14_ptr->interlaced = (modpng14_byte)interlace_type; + modpng14_ptr->color_type = (modpng14_byte)color_type; +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + modpng14_ptr->filter_type = (modpng14_byte)filter_type; #endif /* find number of channels */ - switch (png_ptr->color_type) + switch (modpng14_ptr->color_type) { - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_PALETTE: - png_ptr->channels = 1; + case MODPNG14_COLOR_TYPE_GRAY: + case MODPNG14_COLOR_TYPE_PALETTE: + modpng14_ptr->channels = 1; break; - case PNG_COLOR_TYPE_RGB: - png_ptr->channels = 3; + case MODPNG14_COLOR_TYPE_RGB: + modpng14_ptr->channels = 3; break; - case PNG_COLOR_TYPE_GRAY_ALPHA: - png_ptr->channels = 2; + case MODPNG14_COLOR_TYPE_GRAY_ALPHA: + modpng14_ptr->channels = 2; break; - case PNG_COLOR_TYPE_RGB_ALPHA: - png_ptr->channels = 4; + case MODPNG14_COLOR_TYPE_RGB_ALPHA: + modpng14_ptr->channels = 4; break; } /* set up other useful info */ - png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth * - png_ptr->channels); - png_ptr->rowbytes = ((png_ptr->width * - (png_uint_32)png_ptr->pixel_depth + 7) >> 3); - png_debug1(3,"bit_depth = %d\n", png_ptr->bit_depth); - png_debug1(3,"channels = %d\n", png_ptr->channels); - png_debug1(3,"rowbytes = %lu\n", png_ptr->rowbytes); - png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, + modpng14_ptr->pixel_depth = (modpng14_byte)(modpng14_ptr->bit_depth * + modpng14_ptr->channels); + modpng14_ptr->rowbytes = ((modpng14_ptr->width * + (modpng14_uint_32)modpng14_ptr->pixel_depth + 7) >> 3); + modpng14_debug1(3,"bit_depth = %d\n", modpng14_ptr->bit_depth); + modpng14_debug1(3,"channels = %d\n", modpng14_ptr->channels); + modpng14_debug1(3,"rowbytes = %lu\n", modpng14_ptr->rowbytes); + modpng14_set_IHDR(modpng14_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_type); } /* read and check the palette */ void /* PRIVATE */ -png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_PLTE(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_color palette[PNG_MAX_PALETTE_LENGTH]; + modpng14_color palette[MODPNG14_MAX_PALETTE_LENGTH]; int num, i; -#ifndef PNG_NO_POINTER_INDEXING - png_colorp pal_ptr; +#ifndef MODPNG14_NO_POINTER_INDEXING + modpng14_colorp pal_ptr; #endif - png_debug(1, "in png_handle_PLTE\n"); + modpng14_debug(1, "in modpng14_handle_PLTE\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before PLTE"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before PLTE"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid PLTE after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid PLTE after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->mode & PNG_HAVE_PLTE) - png_error(png_ptr, "Duplicate PLTE chunk"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_PLTE) + modpng14_error(modpng14_ptr, "Duplicate PLTE chunk"); - png_ptr->mode |= PNG_HAVE_PLTE; + modpng14_ptr->mode |= MODPNG14_HAVE_PLTE; - if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR)) + if (!(modpng14_ptr->color_type&MODPNG14_COLOR_MASK_COLOR)) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring PLTE chunk in grayscale PNG"); - png_crc_finish(png_ptr, length); + modpng14_crc_finish(modpng14_ptr, length); return; } -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) +#if !defined(MODPNG14_READ_OPT_PLTE_SUPPORTED) + if (modpng14_ptr->color_type != MODPNG14_COLOR_TYPE_PALETTE) { - png_crc_finish(png_ptr, length); + modpng14_crc_finish(modpng14_ptr, length); return; } #endif - if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3) + if (length > 3*MODPNG14_MAX_PALETTE_LENGTH || length % 3) { - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type != MODPNG14_COLOR_TYPE_PALETTE) { - png_warning(png_ptr, "Invalid palette chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid palette chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } else { - png_error(png_ptr, "Invalid palette chunk"); + modpng14_error(modpng14_ptr, "Invalid palette chunk"); } } num = (int)length / 3; -#ifndef PNG_NO_POINTER_INDEXING +#ifndef MODPNG14_NO_POINTER_INDEXING for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++) { - png_byte buf[3]; + modpng14_byte buf[3]; - png_crc_read(png_ptr, buf, 3); + modpng14_crc_read(modpng14_ptr, buf, 3); pal_ptr->red = buf[0]; pal_ptr->green = buf[1]; pal_ptr->blue = buf[2]; @@ -472,10 +472,10 @@ #else for (i = 0; i < num; i++) { - png_byte buf[3]; + modpng14_byte buf[3]; - png_crc_read(png_ptr, buf, 3); - /* don't depend upon png_color being any order */ + modpng14_crc_read(modpng14_ptr, buf, 3); + /* don't depend upon modpng14_color being any order */ palette[i].red = buf[0]; palette[i].green = buf[1]; palette[i].blue = buf[2]; @@ -486,55 +486,55 @@ whatever the normal CRC configuration tells us. However, if we have an RGB image, the PLTE can be considered ancillary, so we will act as though it is. */ -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) +#if !defined(MODPNG14_READ_OPT_PLTE_SUPPORTED) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) #endif { - png_crc_finish(png_ptr, 0); + modpng14_crc_finish(modpng14_ptr, 0); } -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - else if (png_crc_error(png_ptr)) /* Only if we have a CRC error */ +#if !defined(MODPNG14_READ_OPT_PLTE_SUPPORTED) + else if (modpng14_crc_error(modpng14_ptr)) /* Only if we have a CRC error */ { /* If we don't want to use the data from an ancillary chunk, we have two options: an error abort, or a warning and we ignore the data in this chunk (which should be OK, since it's considered ancillary for a RGB or RGBA image). */ - if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE)) + if (!(modpng14_ptr->flags & MODPNG14_FLAG_CRC_ANCILLARY_USE)) { - if (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) + if (modpng14_ptr->flags & MODPNG14_FLAG_CRC_ANCILLARY_NOWARN) { - png_chunk_error(png_ptr, "CRC error"); + modpng14_chunk_error(modpng14_ptr, "CRC error"); } else { - png_chunk_warning(png_ptr, "CRC error"); + modpng14_chunk_warning(modpng14_ptr, "CRC error"); return; } } /* Otherwise, we (optionally) emit a warning and use the chunk. */ - else if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) + else if (!(modpng14_ptr->flags & MODPNG14_FLAG_CRC_ANCILLARY_NOWARN)) { - png_chunk_warning(png_ptr, "CRC error"); + modpng14_chunk_warning(modpng14_ptr, "CRC error"); } } #endif - png_set_PLTE(png_ptr, info_ptr, palette, num); + modpng14_set_PLTE(modpng14_ptr, info_ptr, palette, num); -#if defined(PNG_READ_tRNS_SUPPORTED) - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) +#if defined(MODPNG14_READ_tRNS_SUPPORTED) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) + if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_tRNS)) { - if (png_ptr->num_trans > (png_uint_16)num) + if (modpng14_ptr->num_trans > (modpng14_uint_16)num) { - png_warning(png_ptr, "Truncating incorrect tRNS chunk length"); - png_ptr->num_trans = (png_uint_16)num; + modpng14_warning(modpng14_ptr, "Truncating incorrect tRNS chunk length"); + modpng14_ptr->num_trans = (modpng14_uint_16)num; } - if (info_ptr->num_trans > (png_uint_16)num) + if (info_ptr->num_trans > (modpng14_uint_16)num) { - png_warning(png_ptr, "Truncating incorrect info tRNS chunk length"); - info_ptr->num_trans = (png_uint_16)num; + modpng14_warning(modpng14_ptr, "Truncating incorrect info tRNS chunk length"); + info_ptr->num_trans = (modpng14_uint_16)num; } } } @@ -543,283 +543,283 @@ } void /* PRIVATE */ -png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_IEND(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_debug(1, "in png_handle_IEND\n"); + modpng14_debug(1, "in modpng14_handle_IEND\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR) || !(modpng14_ptr->mode & MODPNG14_HAVE_IDAT)) { - png_error(png_ptr, "No image in file"); + modpng14_error(modpng14_ptr, "No image in file"); info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */ } - png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND); + modpng14_ptr->mode |= (MODPNG14_AFTER_IDAT | MODPNG14_HAVE_IEND); if (length != 0) { - png_warning(png_ptr, "Incorrect IEND chunk length"); + modpng14_warning(modpng14_ptr, "Incorrect IEND chunk length"); } - png_crc_finish(png_ptr, length); + modpng14_crc_finish(modpng14_ptr, length); } -#if defined(PNG_READ_gAMA_SUPPORTED) +#if defined(MODPNG14_READ_gAMA_SUPPORTED) void /* PRIVATE */ -png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_gAMA(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_fixed_point igamma; -#ifdef PNG_FLOATING_POINT_SUPPORTED + modpng14_fixed_point igamma; +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED float file_gamma; #endif - png_byte buf[4]; + modpng14_byte buf[4]; - png_debug(1, "in png_handle_gAMA\n"); + modpng14_debug(1, "in modpng14_handle_gAMA\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before gAMA"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before gAMA"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid gAMA after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid gAMA after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->mode & PNG_HAVE_PLTE) + else if (modpng14_ptr->mode & MODPNG14_HAVE_PLTE) /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place gAMA chunk"); + modpng14_warning(modpng14_ptr, "Out of place gAMA chunk"); - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) -#if defined(PNG_READ_sRGB_SUPPORTED) - && !(info_ptr->valid & PNG_INFO_sRGB) + if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_gAMA) +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + && !(info_ptr->valid & MODPNG14_INFO_sRGB) #endif ) { - png_warning(png_ptr, "Duplicate gAMA chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate gAMA chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } if (length != 4) { - png_warning(png_ptr, "Incorrect gAMA chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect gAMA chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 4); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, 4); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; - igamma = (png_fixed_point)png_get_uint_32(buf); + igamma = (modpng14_fixed_point)modpng14_get_uint_32(buf); /* check for zero gamma */ if (igamma == 0) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring gAMA chunk with gamma=0"); return; } -#if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_sRGB) if(igamma < 45000L || igamma > 46000L) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring incorrect gAMA value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO +#ifndef MODPNG14_NO_CONSOLE_IO fprintf(stderr, "gamma = (%d/100000)\n", (int)igamma); #endif return; } -#endif /* PNG_READ_sRGB_SUPPORTED */ +#endif /* MODPNG14_READ_sRGB_SUPPORTED */ -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED file_gamma = (float)igamma / (float)100000.0; -# ifdef PNG_READ_GAMMA_SUPPORTED - png_ptr->gamma = file_gamma; +# ifdef MODPNG14_READ_GAMMA_SUPPORTED + modpng14_ptr->gamma = file_gamma; # endif - png_set_gAMA(png_ptr, info_ptr, file_gamma); + modpng14_set_gAMA(modpng14_ptr, info_ptr, file_gamma); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_gAMA_fixed(png_ptr, info_ptr, igamma); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_set_gAMA_fixed(modpng14_ptr, info_ptr, igamma); #endif } #endif -#if defined(PNG_READ_sBIT_SUPPORTED) +#if defined(MODPNG14_READ_sBIT_SUPPORTED) void /* PRIVATE */ -png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_sBIT(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_size_t truelen; - png_byte buf[4]; + modpng14_size_t truelen; + modpng14_byte buf[4]; - png_debug(1, "in png_handle_sBIT\n"); + modpng14_debug(1, "in modpng14_handle_sBIT\n"); buf[0] = buf[1] = buf[2] = buf[3] = 0; - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sBIT"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before sBIT"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid sBIT after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid sBIT after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->mode & PNG_HAVE_PLTE) + else if (modpng14_ptr->mode & MODPNG14_HAVE_PLTE) { /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place sBIT chunk"); + modpng14_warning(modpng14_ptr, "Out of place sBIT chunk"); } - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)) + if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_sBIT)) { - png_warning(png_ptr, "Duplicate sBIT chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate sBIT chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) truelen = 3; else - truelen = (png_size_t)png_ptr->channels; + truelen = (modpng14_size_t)modpng14_ptr->channels; if (length != truelen) { - png_warning(png_ptr, "Incorrect sBIT chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect sBIT chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, truelen); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, truelen); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) + if (modpng14_ptr->color_type & MODPNG14_COLOR_MASK_COLOR) { - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[1]; - png_ptr->sig_bit.blue = buf[2]; - png_ptr->sig_bit.alpha = buf[3]; + modpng14_ptr->sig_bit.red = buf[0]; + modpng14_ptr->sig_bit.green = buf[1]; + modpng14_ptr->sig_bit.blue = buf[2]; + modpng14_ptr->sig_bit.alpha = buf[3]; } else { - png_ptr->sig_bit.gray = buf[0]; - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[0]; - png_ptr->sig_bit.blue = buf[0]; - png_ptr->sig_bit.alpha = buf[1]; + modpng14_ptr->sig_bit.gray = buf[0]; + modpng14_ptr->sig_bit.red = buf[0]; + modpng14_ptr->sig_bit.green = buf[0]; + modpng14_ptr->sig_bit.blue = buf[0]; + modpng14_ptr->sig_bit.alpha = buf[1]; } - png_set_sBIT(png_ptr, info_ptr, &(png_ptr->sig_bit)); + modpng14_set_sBIT(modpng14_ptr, info_ptr, &(modpng14_ptr->sig_bit)); } #endif -#if defined(PNG_READ_cHRM_SUPPORTED) +#if defined(MODPNG14_READ_cHRM_SUPPORTED) void /* PRIVATE */ -png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_cHRM(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_byte buf[4]; -#ifdef PNG_FLOATING_POINT_SUPPORTED + modpng14_byte buf[4]; +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; #endif - png_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, + modpng14_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, int_y_green, int_x_blue, int_y_blue; - png_uint_32 uint_x, uint_y; + modpng14_uint_32 uint_x, uint_y; - png_debug(1, "in png_handle_cHRM\n"); + modpng14_debug(1, "in modpng14_handle_cHRM\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before cHRM"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before cHRM"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid cHRM after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid cHRM after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->mode & PNG_HAVE_PLTE) + else if (modpng14_ptr->mode & MODPNG14_HAVE_PLTE) /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Missing PLTE before cHRM"); + modpng14_warning(modpng14_ptr, "Missing PLTE before cHRM"); - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM) -#if defined(PNG_READ_sRGB_SUPPORTED) - && !(info_ptr->valid & PNG_INFO_sRGB) + if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_cHRM) +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + && !(info_ptr->valid & MODPNG14_INFO_sRGB) #endif ) { - png_warning(png_ptr, "Duplicate cHRM chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate cHRM chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } if (length != 32) { - png_warning(png_ptr, "Incorrect cHRM chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect cHRM chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_x = modpng14_get_uint_32(buf); - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_y = modpng14_get_uint_32(buf); if (uint_x > 80000L || uint_y > 80000L || uint_x + uint_y > 100000L) { - png_warning(png_ptr, "Invalid cHRM white point"); - png_crc_finish(png_ptr, 24); + modpng14_warning(modpng14_ptr, "Invalid cHRM white point"); + modpng14_crc_finish(modpng14_ptr, 24); return; } - int_x_white = (png_fixed_point)uint_x; - int_y_white = (png_fixed_point)uint_y; + int_x_white = (modpng14_fixed_point)uint_x; + int_y_white = (modpng14_fixed_point)uint_y; - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_x = modpng14_get_uint_32(buf); - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_y = modpng14_get_uint_32(buf); if (uint_x > 80000L || uint_y > 80000L || uint_x + uint_y > 100000L) { - png_warning(png_ptr, "Invalid cHRM red point"); - png_crc_finish(png_ptr, 16); + modpng14_warning(modpng14_ptr, "Invalid cHRM red point"); + modpng14_crc_finish(modpng14_ptr, 16); return; } - int_x_red = (png_fixed_point)uint_x; - int_y_red = (png_fixed_point)uint_y; + int_x_red = (modpng14_fixed_point)uint_x; + int_y_red = (modpng14_fixed_point)uint_y; - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_x = modpng14_get_uint_32(buf); - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_y = modpng14_get_uint_32(buf); if (uint_x > 80000L || uint_y > 80000L || uint_x + uint_y > 100000L) { - png_warning(png_ptr, "Invalid cHRM green point"); - png_crc_finish(png_ptr, 8); + modpng14_warning(modpng14_ptr, "Invalid cHRM green point"); + modpng14_crc_finish(modpng14_ptr, 8); return; } - int_x_green = (png_fixed_point)uint_x; - int_y_green = (png_fixed_point)uint_y; + int_x_green = (modpng14_fixed_point)uint_x; + int_y_green = (modpng14_fixed_point)uint_y; - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_x = modpng14_get_uint_32(buf); - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); + modpng14_crc_read(modpng14_ptr, buf, 4); + uint_y = modpng14_get_uint_32(buf); if (uint_x > 80000L || uint_y > 80000L || uint_x + uint_y > 100000L) { - png_warning(png_ptr, "Invalid cHRM blue point"); - png_crc_finish(png_ptr, 0); + modpng14_warning(modpng14_ptr, "Invalid cHRM blue point"); + modpng14_crc_finish(modpng14_ptr, 0); return; } - int_x_blue = (png_fixed_point)uint_x; - int_y_blue = (png_fixed_point)uint_y; + int_x_blue = (modpng14_fixed_point)uint_x; + int_y_blue = (modpng14_fixed_point)uint_y; -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED white_x = (float)int_x_white / (float)100000.0; white_y = (float)int_y_white / (float)100000.0; red_x = (float)int_x_red / (float)100000.0; @@ -830,8 +830,8 @@ blue_y = (float)int_y_blue / (float)100000.0; #endif -#if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) +#if defined(MODPNG14_READ_sRGB_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_sRGB) { if (abs(int_x_white - 31270L) > 1000 || abs(int_y_white - 32900L) > 1000 || @@ -843,10 +843,10 @@ abs(int_y_blue - 6000L) > 1000) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring incorrect cHRM value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifndef MODPNG14_NO_CONSOLE_IO +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED fprintf(stderr,"wx=%f, wy=%f, rx=%f, ry=%f\n", white_x, white_y, red_x, red_y); fprintf(stderr,"gx=%f, gy=%f, bx=%f, by=%f\n", @@ -857,105 +857,105 @@ fprintf(stderr,"gx=%ld, gy=%ld, bx=%ld, by=%ld\n", int_x_green, int_y_green, int_x_blue, int_y_blue); #endif -#endif /* PNG_NO_CONSOLE_IO */ +#endif /* MODPNG14_NO_CONSOLE_IO */ } - png_crc_finish(png_ptr, 0); + modpng14_crc_finish(modpng14_ptr, 0); return; } -#endif /* PNG_READ_sRGB_SUPPORTED */ +#endif /* MODPNG14_READ_sRGB_SUPPORTED */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_cHRM(png_ptr, info_ptr, +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED + modpng14_set_cHRM(modpng14_ptr, info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_cHRM_fixed(png_ptr, info_ptr, +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_set_cHRM_fixed(modpng14_ptr, info_ptr, int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, int_y_green, int_x_blue, int_y_blue); #endif - if (png_crc_finish(png_ptr, 0)) + if (modpng14_crc_finish(modpng14_ptr, 0)) return; } #endif -#if defined(PNG_READ_sRGB_SUPPORTED) +#if defined(MODPNG14_READ_sRGB_SUPPORTED) void /* PRIVATE */ -png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_sRGB(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { int intent; - png_byte buf[1]; + modpng14_byte buf[1]; - png_debug(1, "in png_handle_sRGB\n"); + modpng14_debug(1, "in modpng14_handle_sRGB\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sRGB"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before sRGB"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid sRGB after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid sRGB after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->mode & PNG_HAVE_PLTE) + else if (modpng14_ptr->mode & MODPNG14_HAVE_PLTE) /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place sRGB chunk"); + modpng14_warning(modpng14_ptr, "Out of place sRGB chunk"); - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)) + if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_sRGB)) { - png_warning(png_ptr, "Duplicate sRGB chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate sRGB chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } if (length != 1) { - png_warning(png_ptr, "Incorrect sRGB chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect sRGB chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 1); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, 1); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; intent = buf[0]; /* check for bad intent */ - if (intent >= PNG_sRGB_INTENT_LAST) + if (intent >= MODPNG14_sRGB_INTENT_LAST) { - png_warning(png_ptr, "Unknown sRGB intent"); + modpng14_warning(modpng14_ptr, "Unknown sRGB intent"); return; } -#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - if ((info_ptr->valid & PNG_INFO_gAMA)) +#if defined(MODPNG14_READ_gAMA_SUPPORTED) && defined(MODPNG14_READ_GAMMA_SUPPORTED) + if ((info_ptr->valid & MODPNG14_INFO_gAMA)) { int igamma; -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED igamma=(int)info_ptr->int_gamma; #else -# ifdef PNG_FLOATING_POINT_SUPPORTED +# ifdef MODPNG14_FLOATING_POINT_SUPPORTED igamma=(int)(info_ptr->gamma * 100000.); # endif #endif if(igamma < 45000L || igamma > 46000L) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring incorrect gAMA value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO -# ifdef PNG_FIXED_POINT_SUPPORTED - fprintf(stderr,"incorrect gamma=(%d/100000)\n",(int)png_ptr->int_gamma); +#ifndef MODPNG14_NO_CONSOLE_IO +# ifdef MODPNG14_FIXED_POINT_SUPPORTED + fprintf(stderr,"incorrect gamma=(%d/100000)\n",(int)modpng14_ptr->int_gamma); # else -# ifdef PNG_FLOATING_POINT_SUPPORTED - fprintf(stderr,"incorrect gamma=%f\n",png_ptr->gamma); +# ifdef MODPNG14_FLOATING_POINT_SUPPORTED + fprintf(stderr,"incorrect gamma=%f\n",modpng14_ptr->gamma); # endif # endif #endif } } -#endif /* PNG_READ_gAMA_SUPPORTED */ +#endif /* MODPNG14_READ_gAMA_SUPPORTED */ -#ifdef PNG_READ_cHRM_SUPPORTED -#ifdef PNG_FIXED_POINT_SUPPORTED - if (info_ptr->valid & PNG_INFO_cHRM) +#ifdef MODPNG14_READ_cHRM_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + if (info_ptr->valid & MODPNG14_INFO_cHRM) if (abs(info_ptr->int_x_white - 31270L) > 1000 || abs(info_ptr->int_y_white - 32900L) > 1000 || abs(info_ptr->int_x_red - 64000L) > 1000 || @@ -965,66 +965,66 @@ abs(info_ptr->int_x_blue - 15000L) > 1000 || abs(info_ptr->int_y_blue - 6000L) > 1000) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring incorrect cHRM value when sRGB is also present"); } -#endif /* PNG_FIXED_POINT_SUPPORTED */ -#endif /* PNG_READ_cHRM_SUPPORTED */ +#endif /* MODPNG14_FIXED_POINT_SUPPORTED */ +#endif /* MODPNG14_READ_cHRM_SUPPORTED */ - png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, intent); + modpng14_set_sRGB_gAMA_and_cHRM(modpng14_ptr, info_ptr, intent); } -#endif /* PNG_READ_sRGB_SUPPORTED */ +#endif /* MODPNG14_READ_sRGB_SUPPORTED */ -#if defined(PNG_READ_iCCP_SUPPORTED) +#if defined(MODPNG14_READ_iCCP_SUPPORTED) void /* PRIVATE */ -png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_iCCP(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) /* Note: this does not properly handle chunks that are > 64K under DOS */ { - png_charp chunkdata; - png_byte compression_type; - png_bytep pC; - png_charp profile; - png_uint_32 skip = 0; - png_uint_32 profile_size, profile_length; - png_size_t slength, prefix_length, data_length; + modpng14_charp chunkdata; + modpng14_byte compression_type; + modpng14_bytep pC; + modpng14_charp profile; + modpng14_uint_32 skip = 0; + modpng14_uint_32 profile_size, profile_length; + modpng14_size_t slength, prefix_length, data_length; - png_debug(1, "in png_handle_iCCP\n"); + modpng14_debug(1, "in modpng14_handle_iCCP\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before iCCP"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before iCCP"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid iCCP after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid iCCP after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->mode & PNG_HAVE_PLTE) + else if (modpng14_ptr->mode & MODPNG14_HAVE_PLTE) /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place iCCP chunk"); + modpng14_warning(modpng14_ptr, "Out of place iCCP chunk"); - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)) + if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_iCCP)) { - png_warning(png_ptr, "Duplicate iCCP chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate iCCP chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) +#ifdef MODPNG14_MAX_MALLOC_64K + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr, "iCCP chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "iCCP chunk too large to fit in memory"); + skip = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - chunkdata = (png_charp)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); + chunkdata = (modpng14_charp)modpng14_malloc(modpng14_ptr, length + 1); + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)chunkdata, slength); - if (png_crc_finish(png_ptr, skip)) + if (modpng14_crc_finish(modpng14_ptr, skip)) { - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, chunkdata); return; } @@ -1039,8 +1039,8 @@ following the separator, and we should be on it */ if ( profile >= chunkdata + slength) { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Malformed iCCP chunk"); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_warning(modpng14_ptr, "Malformed iCCP chunk"); return; } @@ -1048,26 +1048,26 @@ compression_type = *profile++; if (compression_type) { - png_warning(png_ptr, "Ignoring nonzero compression type in iCCP chunk"); - compression_type=0x00; /* Reset it to zero (libpng-1.0.6 through 1.0.8 + modpng14_warning(modpng14_ptr, "Ignoring nonzero compression type in iCCP chunk"); + compression_type=0x00; /* Reset it to zero (libmodpng14-1.0.6 through 1.0.8 wrote nonzero) */ } prefix_length = profile - chunkdata; - chunkdata = png_decompress_chunk(png_ptr, compression_type, chunkdata, + chunkdata = modpng14_decompress_chunk(modpng14_ptr, compression_type, chunkdata, slength, prefix_length, &data_length); profile_length = data_length - prefix_length; if ( prefix_length > data_length || profile_length < 4) { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Profile size field missing from iCCP chunk"); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_warning(modpng14_ptr, "Profile size field missing from iCCP chunk"); return; } /* Check the profile_size recorded in the first 32 bits of the ICC profile */ - pC = (png_bytep)(chunkdata+prefix_length); + pC = (modpng14_bytep)(chunkdata+prefix_length); profile_size = ((*(pC ))<<24) | ((*(pC+1))<<16) | ((*(pC+2))<< 8) | @@ -1078,59 +1078,59 @@ if(profile_size > profile_length) { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Ignoring truncated iCCP profile.\n"); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_warning(modpng14_ptr, "Ignoring truncated iCCP profile.\n"); return; } - png_set_iCCP(png_ptr, info_ptr, chunkdata, compression_type, + modpng14_set_iCCP(modpng14_ptr, info_ptr, chunkdata, compression_type, chunkdata + prefix_length, profile_length); - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, chunkdata); } -#endif /* PNG_READ_iCCP_SUPPORTED */ +#endif /* MODPNG14_READ_iCCP_SUPPORTED */ -#if defined(PNG_READ_sPLT_SUPPORTED) +#if defined(MODPNG14_READ_sPLT_SUPPORTED) void /* PRIVATE */ -png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_sPLT(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) /* Note: this does not properly handle chunks that are > 64K under DOS */ { - png_bytep chunkdata; - png_bytep entry_start; - png_sPLT_t new_palette; -#ifdef PNG_NO_POINTER_INDEXING - png_sPLT_entryp pp; + modpng14_bytep chunkdata; + modpng14_bytep entry_start; + modpng14_sPLT_t new_palette; +#ifdef MODPNG14_NO_POINTER_INDEXING + modpng14_sPLT_entryp pp; #endif int data_length, entry_size, i; - png_uint_32 skip = 0; - png_size_t slength; + modpng14_uint_32 skip = 0; + modpng14_size_t slength; - png_debug(1, "in png_handle_sPLT\n"); + modpng14_debug(1, "in modpng14_handle_sPLT\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sPLT"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before sPLT"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid sPLT after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid sPLT after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) +#ifdef MODPNG14_MAX_MALLOC_64K + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr, "sPLT chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "sPLT chunk too large to fit in memory"); + skip = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - chunkdata = (png_bytep)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); + chunkdata = (modpng14_bytep)modpng14_malloc(modpng14_ptr, length + 1); + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)chunkdata, slength); - if (png_crc_finish(png_ptr, skip)) + if (modpng14_crc_finish(modpng14_ptr, skip)) { - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, chunkdata); return; } @@ -1143,8 +1143,8 @@ /* a sample depth should follow the separator, and we should be on it */ if (entry_start > chunkdata + slength) { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "malformed sPLT chunk"); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_warning(modpng14_ptr, "malformed sPLT chunk"); return; } @@ -1155,29 +1155,29 @@ /* integrity-check the data length */ if (data_length % entry_size) { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "sPLT chunk has bad length"); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_warning(modpng14_ptr, "sPLT chunk has bad length"); return; } new_palette.nentries = data_length / entry_size; - if (new_palette.nentries > PNG_SIZE_MAX / sizeof(png_sPLT_entry)) + if (new_palette.nentries > MODPNG14_SIZE_MAX / sizeof(modpng14_sPLT_entry)) { - png_warning(png_ptr, "sPLT chunk too long"); + modpng14_warning(modpng14_ptr, "sPLT chunk too long"); return; } - new_palette.entries = (png_sPLT_entryp)png_malloc_warn( - png_ptr, new_palette.nentries * sizeof(png_sPLT_entry)); + new_palette.entries = (modpng14_sPLT_entryp)modpng14_malloc_warn( + modpng14_ptr, new_palette.nentries * sizeof(modpng14_sPLT_entry)); if (new_palette.entries == NULL) { - png_warning(png_ptr, "sPLT chunk requires too much memory"); + modpng14_warning(modpng14_ptr, "sPLT chunk requires too much memory"); return; } -#ifndef PNG_NO_POINTER_INDEXING +#ifndef MODPNG14_NO_POINTER_INDEXING for (i = 0; i < new_palette.nentries; i++) { - png_sPLT_entryp pp = new_palette.entries + i; + modpng14_sPLT_entryp pp = new_palette.entries + i; if (new_palette.depth == 8) { @@ -1188,12 +1188,12 @@ } else { - pp->red = png_get_uint_16(entry_start); entry_start += 2; - pp->green = png_get_uint_16(entry_start); entry_start += 2; - pp->blue = png_get_uint_16(entry_start); entry_start += 2; - pp->alpha = png_get_uint_16(entry_start); entry_start += 2; + pp->red = modpng14_get_uint_16(entry_start); entry_start += 2; + pp->green = modpng14_get_uint_16(entry_start); entry_start += 2; + pp->blue = modpng14_get_uint_16(entry_start); entry_start += 2; + pp->alpha = modpng14_get_uint_16(entry_start); entry_start += 2; } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; + pp->frequency = modpng14_get_uint_16(entry_start); entry_start += 2; } #else pp = new_palette.entries; @@ -1209,397 +1209,397 @@ } else { - pp[i].red = png_get_uint_16(entry_start); entry_start += 2; - pp[i].green = png_get_uint_16(entry_start); entry_start += 2; - pp[i].blue = png_get_uint_16(entry_start); entry_start += 2; - pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2; + pp[i].red = modpng14_get_uint_16(entry_start); entry_start += 2; + pp[i].green = modpng14_get_uint_16(entry_start); entry_start += 2; + pp[i].blue = modpng14_get_uint_16(entry_start); entry_start += 2; + pp[i].alpha = modpng14_get_uint_16(entry_start); entry_start += 2; } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; + pp->frequency = modpng14_get_uint_16(entry_start); entry_start += 2; } #endif /* discard all chunk data except the name and stash that */ - new_palette.name = (png_charp)chunkdata; + new_palette.name = (modpng14_charp)chunkdata; - png_set_sPLT(png_ptr, info_ptr, &new_palette, 1); + modpng14_set_sPLT(modpng14_ptr, info_ptr, &new_palette, 1); - png_free(png_ptr, chunkdata); - png_free(png_ptr, new_palette.entries); + modpng14_free(modpng14_ptr, chunkdata); + modpng14_free(modpng14_ptr, new_palette.entries); } -#endif /* PNG_READ_sPLT_SUPPORTED */ +#endif /* MODPNG14_READ_sPLT_SUPPORTED */ -#if defined(PNG_READ_tRNS_SUPPORTED) +#if defined(MODPNG14_READ_tRNS_SUPPORTED) void /* PRIVATE */ -png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_tRNS(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_byte readbuf[PNG_MAX_PALETTE_LENGTH]; + modpng14_byte readbuf[MODPNG14_MAX_PALETTE_LENGTH]; - png_debug(1, "in png_handle_tRNS\n"); + modpng14_debug(1, "in modpng14_handle_tRNS\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before tRNS"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before tRNS"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid tRNS after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid tRNS after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_tRNS)) { - png_warning(png_ptr, "Duplicate tRNS chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate tRNS chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - if (!(png_ptr->mode & PNG_HAVE_PLTE)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_PLTE)) { /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Missing PLTE before tRNS"); + modpng14_warning(modpng14_ptr, "Missing PLTE before tRNS"); } - if (length > (png_uint_32)png_ptr->num_palette || - length > PNG_MAX_PALETTE_LENGTH) + if (length > (modpng14_uint_32)modpng14_ptr->num_palette || + length > MODPNG14_MAX_PALETTE_LENGTH) { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect tRNS chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } if (length == 0) { - png_warning(png_ptr, "Zero length tRNS chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Zero length tRNS chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, readbuf, (png_size_t)length); - png_ptr->num_trans = (png_uint_16)length; + modpng14_crc_read(modpng14_ptr, readbuf, (modpng14_size_t)length); + modpng14_ptr->num_trans = (modpng14_uint_16)length; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_RGB) { - png_byte buf[6]; + modpng14_byte buf[6]; if (length != 6) { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect tRNS chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, (png_size_t)length); - png_ptr->num_trans = 1; - png_ptr->trans_values.red = png_get_uint_16(buf); - png_ptr->trans_values.green = png_get_uint_16(buf + 2); - png_ptr->trans_values.blue = png_get_uint_16(buf + 4); + modpng14_crc_read(modpng14_ptr, buf, (modpng14_size_t)length); + modpng14_ptr->num_trans = 1; + modpng14_ptr->trans_values.red = modpng14_get_uint_16(buf); + modpng14_ptr->trans_values.green = modpng14_get_uint_16(buf + 2); + modpng14_ptr->trans_values.blue = modpng14_get_uint_16(buf + 4); } - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_GRAY) { - png_byte buf[6]; + modpng14_byte buf[6]; if (length != 2) { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect tRNS chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 2); - png_ptr->num_trans = 1; - png_ptr->trans_values.gray = png_get_uint_16(buf); + modpng14_crc_read(modpng14_ptr, buf, 2); + modpng14_ptr->num_trans = 1; + modpng14_ptr->trans_values.gray = modpng14_get_uint_16(buf); } else { - png_warning(png_ptr, "tRNS chunk not allowed with alpha channel"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "tRNS chunk not allowed with alpha channel"); + modpng14_crc_finish(modpng14_ptr, length); return; } - if (png_crc_finish(png_ptr, 0)) + if (modpng14_crc_finish(modpng14_ptr, 0)) return; - png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans, - &(png_ptr->trans_values)); + modpng14_set_tRNS(modpng14_ptr, info_ptr, readbuf, modpng14_ptr->num_trans, + &(modpng14_ptr->trans_values)); } #endif -#if defined(PNG_READ_bKGD_SUPPORTED) +#if defined(MODPNG14_READ_bKGD_SUPPORTED) void /* PRIVATE */ -png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_bKGD(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_size_t truelen; - png_byte buf[6]; + modpng14_size_t truelen; + modpng14_byte buf[6]; - png_debug(1, "in png_handle_bKGD\n"); + modpng14_debug(1, "in modpng14_handle_bKGD\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before bKGD"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before bKGD"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid bKGD after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid bKGD after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE && + !(modpng14_ptr->mode & MODPNG14_HAVE_PLTE)) { - png_warning(png_ptr, "Missing PLTE before bKGD"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Missing PLTE before bKGD"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_bKGD)) { - png_warning(png_ptr, "Duplicate bKGD chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate bKGD chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) truelen = 1; - else if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) + else if (modpng14_ptr->color_type & MODPNG14_COLOR_MASK_COLOR) truelen = 6; else truelen = 2; if (length != truelen) { - png_warning(png_ptr, "Incorrect bKGD chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect bKGD chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, truelen); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, truelen); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; /* We convert the index value into RGB components so that we can allow * arbitrary RGB values for background when we have transparency, and * so it is easy to determine the RGB values of the background color * from the info_ptr struct. */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_ptr->background.index = buf[0]; + modpng14_ptr->background.index = buf[0]; if(info_ptr->num_palette) { if(buf[0] > info_ptr->num_palette) { - png_warning(png_ptr, "Incorrect bKGD chunk index value"); + modpng14_warning(modpng14_ptr, "Incorrect bKGD chunk index value"); return; } - png_ptr->background.red = - (png_uint_16)png_ptr->palette[buf[0]].red; - png_ptr->background.green = - (png_uint_16)png_ptr->palette[buf[0]].green; - png_ptr->background.blue = - (png_uint_16)png_ptr->palette[buf[0]].blue; + modpng14_ptr->background.red = + (modpng14_uint_16)modpng14_ptr->palette[buf[0]].red; + modpng14_ptr->background.green = + (modpng14_uint_16)modpng14_ptr->palette[buf[0]].green; + modpng14_ptr->background.blue = + (modpng14_uint_16)modpng14_ptr->palette[buf[0]].blue; } } - else if (!(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) /* GRAY */ - { - png_ptr->background.red = - png_ptr->background.green = - png_ptr->background.blue = - png_ptr->background.gray = png_get_uint_16(buf); + else if (!(modpng14_ptr->color_type & MODPNG14_COLOR_MASK_COLOR)) /* GRAY */ + { + modpng14_ptr->background.red = + modpng14_ptr->background.green = + modpng14_ptr->background.blue = + modpng14_ptr->background.gray = modpng14_get_uint_16(buf); } else { - png_ptr->background.red = png_get_uint_16(buf); - png_ptr->background.green = png_get_uint_16(buf + 2); - png_ptr->background.blue = png_get_uint_16(buf + 4); + modpng14_ptr->background.red = modpng14_get_uint_16(buf); + modpng14_ptr->background.green = modpng14_get_uint_16(buf + 2); + modpng14_ptr->background.blue = modpng14_get_uint_16(buf + 4); } - png_set_bKGD(png_ptr, info_ptr, &(png_ptr->background)); + modpng14_set_bKGD(modpng14_ptr, info_ptr, &(modpng14_ptr->background)); } #endif -#if defined(PNG_READ_hIST_SUPPORTED) +#if defined(MODPNG14_READ_hIST_SUPPORTED) void /* PRIVATE */ -png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_hIST(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { int num, i; - png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH]; + modpng14_uint_16 readbuf[MODPNG14_MAX_PALETTE_LENGTH]; - png_debug(1, "in png_handle_hIST\n"); + modpng14_debug(1, "in modpng14_handle_hIST\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before hIST"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before hIST"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid hIST after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid hIST after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (!(png_ptr->mode & PNG_HAVE_PLTE)) + else if (!(modpng14_ptr->mode & MODPNG14_HAVE_PLTE)) { - png_warning(png_ptr, "Missing PLTE before hIST"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Missing PLTE before hIST"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_hIST)) { - png_warning(png_ptr, "Duplicate hIST chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate hIST chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } num = (int)length / 2 ; - if (num != png_ptr->num_palette) + if (num != modpng14_ptr->num_palette) { - png_warning(png_ptr, "Incorrect hIST chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect hIST chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } for (i = 0; i < num; i++) { - png_byte buf[2]; + modpng14_byte buf[2]; - png_crc_read(png_ptr, buf, 2); - readbuf[i] = png_get_uint_16(buf); + modpng14_crc_read(modpng14_ptr, buf, 2); + readbuf[i] = modpng14_get_uint_16(buf); } - if (png_crc_finish(png_ptr, 0)) + if (modpng14_crc_finish(modpng14_ptr, 0)) return; - png_set_hIST(png_ptr, info_ptr, readbuf); + modpng14_set_hIST(modpng14_ptr, info_ptr, readbuf); } #endif -#if defined(PNG_READ_pHYs_SUPPORTED) +#if defined(MODPNG14_READ_pHYs_SUPPORTED) void /* PRIVATE */ -png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_pHYs(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_byte buf[9]; - png_uint_32 res_x, res_y; + modpng14_byte buf[9]; + modpng14_uint_32 res_x, res_y; int unit_type; - png_debug(1, "in png_handle_pHYs\n"); + modpng14_debug(1, "in modpng14_handle_pHYs\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before pHYs"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before pHYs"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid pHYs after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid pHYs after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_pHYs)) { - png_warning(png_ptr, "Duplicate pHYs chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate pHYs chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } if (length != 9) { - png_warning(png_ptr, "Incorrect pHYs chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect pHYs chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 9); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, 9); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; - res_x = png_get_uint_32(buf); - res_y = png_get_uint_32(buf + 4); + res_x = modpng14_get_uint_32(buf); + res_y = modpng14_get_uint_32(buf + 4); unit_type = buf[8]; - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type); + modpng14_set_pHYs(modpng14_ptr, info_ptr, res_x, res_y, unit_type); } #endif -#if defined(PNG_READ_oFFs_SUPPORTED) +#if defined(MODPNG14_READ_oFFs_SUPPORTED) void /* PRIVATE */ -png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_oFFs(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_byte buf[9]; - png_int_32 offset_x, offset_y; + modpng14_byte buf[9]; + modpng14_int_32 offset_x, offset_y; int unit_type; - png_debug(1, "in png_handle_oFFs\n"); + modpng14_debug(1, "in modpng14_handle_oFFs\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before oFFs"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before oFFs"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid oFFs after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid oFFs after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_oFFs)) { - png_warning(png_ptr, "Duplicate oFFs chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate oFFs chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } if (length != 9) { - png_warning(png_ptr, "Incorrect oFFs chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect oFFs chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 9); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, 9); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; - offset_x = png_get_int_32(buf); - offset_y = png_get_int_32(buf + 4); + offset_x = modpng14_get_int_32(buf); + offset_y = modpng14_get_int_32(buf + 4); unit_type = buf[8]; - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type); + modpng14_set_oFFs(modpng14_ptr, info_ptr, offset_x, offset_y, unit_type); } #endif -#if defined(PNG_READ_pCAL_SUPPORTED) +#if defined(MODPNG14_READ_pCAL_SUPPORTED) /* read the pCAL chunk (described in the PNG Extensions document) */ void /* PRIVATE */ -png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_pCAL(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_charp purpose; - png_int_32 X0, X1; - png_byte type, nparams; - png_charp buf, units, endptr; - png_charpp params; - png_size_t slength; + modpng14_charp purpose; + modpng14_int_32 X0, X1; + modpng14_byte type, nparams; + modpng14_charp buf, units, endptr; + modpng14_charpp params; + modpng14_size_t slength; int i; - png_debug(1, "in png_handle_pCAL\n"); + modpng14_debug(1, "in modpng14_handle_pCAL\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before pCAL"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before pCAL"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid pCAL after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid pCAL after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_pCAL)) { - png_warning(png_ptr, "Duplicate pCAL chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate pCAL chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n", + modpng14_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n", length + 1); - purpose = (png_charp)png_malloc_warn(png_ptr, length + 1); + purpose = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length + 1); if (purpose == NULL) { - png_warning(png_ptr, "No memory for pCAL purpose."); + modpng14_warning(modpng14_ptr, "No memory for pCAL purpose."); return; } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)purpose, slength); + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)purpose, slength); - if (png_crc_finish(png_ptr, 0)) + if (modpng14_crc_finish(modpng14_ptr, 0)) { - png_free(png_ptr, purpose); + modpng14_free(modpng14_ptr, purpose); return; } purpose[slength] = 0x00; /* null terminate the last string */ - png_debug(3, "Finding end of pCAL purpose string\n"); + modpng14_debug(3, "Finding end of pCAL purpose string\n"); for (buf = purpose; *buf; buf++) /* empty loop */ ; @@ -1609,45 +1609,45 @@ in order to get the parameter information. */ if (endptr <= buf + 12) { - png_warning(png_ptr, "Invalid pCAL data"); - png_free(png_ptr, purpose); + modpng14_warning(modpng14_ptr, "Invalid pCAL data"); + modpng14_free(modpng14_ptr, purpose); return; } - png_debug(3, "Reading pCAL X0, X1, type, nparams, and units\n"); - X0 = png_get_int_32((png_bytep)buf+1); - X1 = png_get_int_32((png_bytep)buf+5); + modpng14_debug(3, "Reading pCAL X0, X1, type, nparams, and units\n"); + X0 = modpng14_get_int_32((modpng14_bytep)buf+1); + X1 = modpng14_get_int_32((modpng14_bytep)buf+5); type = buf[9]; nparams = buf[10]; units = buf + 11; - png_debug(3, "Checking pCAL equation type and number of parameters\n"); + modpng14_debug(3, "Checking pCAL equation type and number of parameters\n"); /* Check that we have the right number of parameters for known equation types. */ - if ((type == PNG_EQUATION_LINEAR && nparams != 2) || - (type == PNG_EQUATION_BASE_E && nparams != 3) || - (type == PNG_EQUATION_ARBITRARY && nparams != 3) || - (type == PNG_EQUATION_HYPERBOLIC && nparams != 4)) + if ((type == MODPNG14_EQUATION_LINEAR && nparams != 2) || + (type == MODPNG14_EQUATION_BASE_E && nparams != 3) || + (type == MODPNG14_EQUATION_ARBITRARY && nparams != 3) || + (type == MODPNG14_EQUATION_HYPERBOLIC && nparams != 4)) { - png_warning(png_ptr, "Invalid pCAL parameters for equation type"); - png_free(png_ptr, purpose); + modpng14_warning(modpng14_ptr, "Invalid pCAL parameters for equation type"); + modpng14_free(modpng14_ptr, purpose); return; } - else if (type >= PNG_EQUATION_LAST) + else if (type >= MODPNG14_EQUATION_LAST) { - png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); + modpng14_warning(modpng14_ptr, "Unrecognized equation type for pCAL chunk"); } for (buf = units; *buf; buf++) /* Empty loop to move past the units string. */ ; - png_debug(3, "Allocating pCAL parameters array\n"); - params = (png_charpp)png_malloc_warn(png_ptr, (png_uint_32)(nparams - *sizeof(png_charp))) ; + modpng14_debug(3, "Allocating pCAL parameters array\n"); + params = (modpng14_charpp)modpng14_malloc_warn(modpng14_ptr, (modpng14_uint_32)(nparams + *sizeof(modpng14_charp))) ; if (params == NULL) { - png_free(png_ptr, purpose); - png_warning(png_ptr, "No memory for pCAL params."); + modpng14_free(modpng14_ptr, purpose); + modpng14_warning(modpng14_ptr, "No memory for pCAL params."); return; } @@ -1656,75 +1656,75 @@ { buf++; /* Skip the null string terminator from previous parameter. */ - png_debug1(3, "Reading pCAL parameter %d\n", i); + modpng14_debug1(3, "Reading pCAL parameter %d\n", i); for (params[i] = buf; *buf != 0x00 && buf <= endptr; buf++) /* Empty loop to move past each parameter string */ ; /* Make sure we haven't run out of data yet */ if (buf > endptr) { - png_warning(png_ptr, "Invalid pCAL data"); - png_free(png_ptr, purpose); - png_free(png_ptr, params); + modpng14_warning(modpng14_ptr, "Invalid pCAL data"); + modpng14_free(modpng14_ptr, purpose); + modpng14_free(modpng14_ptr, params); return; } } - png_set_pCAL(png_ptr, info_ptr, purpose, X0, X1, type, nparams, + modpng14_set_pCAL(modpng14_ptr, info_ptr, purpose, X0, X1, type, nparams, units, params); - png_free(png_ptr, purpose); - png_free(png_ptr, params); + modpng14_free(modpng14_ptr, purpose); + modpng14_free(modpng14_ptr, params); } #endif -#if defined(PNG_READ_sCAL_SUPPORTED) +#if defined(MODPNG14_READ_sCAL_SUPPORTED) /* read the sCAL chunk */ void /* PRIVATE */ -png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_sCAL(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_charp buffer, ep; -#ifdef PNG_FLOATING_POINT_SUPPORTED + modpng14_charp buffer, ep; +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED double width, height; - png_charp vp; + modpng14_charp vp; #else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_charp swidth, sheight; +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_charp swidth, sheight; #endif #endif - png_size_t slength; + modpng14_size_t slength; - png_debug(1, "in png_handle_sCAL\n"); + modpng14_debug(1, "in modpng14_handle_sCAL\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sCAL"); - else if (png_ptr->mode & PNG_HAVE_IDAT) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before sCAL"); + else if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { - png_warning(png_ptr, "Invalid sCAL after IDAT"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Invalid sCAL after IDAT"); + modpng14_crc_finish(modpng14_ptr, length); return; } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL)) + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_sCAL)) { - png_warning(png_ptr, "Duplicate sCAL chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate sCAL chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n", + modpng14_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n", length + 1); - buffer = (png_charp)png_malloc_warn(png_ptr, length + 1); + buffer = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length + 1); if (buffer == NULL) { - png_warning(png_ptr, "Out of memory while processing sCAL chunk"); + modpng14_warning(modpng14_ptr, "Out of memory while processing sCAL chunk"); return; } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)buffer, slength); + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)buffer, slength); - if (png_crc_finish(png_ptr, 0)) + if (modpng14_crc_finish(modpng14_ptr, 0)) { - png_free(png_ptr, buffer); + modpng14_free(modpng14_ptr, buffer); return; } @@ -1732,22 +1732,22 @@ ep = buffer + 1; /* skip unit byte */ -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED width = strtod(ep, &vp); if (*vp) { - png_warning(png_ptr, "malformed width string in sCAL chunk"); + modpng14_warning(modpng14_ptr, "malformed width string in sCAL chunk"); return; } #else -#ifdef PNG_FIXED_POINT_SUPPORTED - swidth = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + swidth = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, modpng14_strlen(ep) + 1); if (swidth == NULL) { - png_warning(png_ptr, "Out of memory while processing sCAL chunk width"); + modpng14_warning(modpng14_ptr, "Out of memory while processing sCAL chunk width"); return; } - png_memcpy(swidth, ep, (png_size_t)png_strlen(ep)); + modpng14_memcpy(swidth, ep, (modpng14_size_t)modpng14_strlen(ep)); #endif #endif @@ -1755,87 +1755,87 @@ /* empty loop */ ; ep++; -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED height = strtod(ep, &vp); if (*vp) { - png_warning(png_ptr, "malformed height string in sCAL chunk"); + modpng14_warning(modpng14_ptr, "malformed height string in sCAL chunk"); return; } #else -#ifdef PNG_FIXED_POINT_SUPPORTED - sheight = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + sheight = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, modpng14_strlen(ep) + 1); if (swidth == NULL) { - png_warning(png_ptr, "Out of memory while processing sCAL chunk height"); + modpng14_warning(modpng14_ptr, "Out of memory while processing sCAL chunk height"); return; } - png_memcpy(sheight, ep, (png_size_t)png_strlen(ep)); + modpng14_memcpy(sheight, ep, (modpng14_size_t)modpng14_strlen(ep)); #endif #endif if (buffer + slength < ep -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED || width <= 0. || height <= 0. #endif ) { - png_warning(png_ptr, "Invalid sCAL data"); - png_free(png_ptr, buffer); -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); - png_free(png_ptr, sheight); + modpng14_warning(modpng14_ptr, "Invalid sCAL data"); + modpng14_free(modpng14_ptr, buffer); +#if defined(MODPNG14_FIXED_POINT_SUPPORTED) && !defined(MODPNG14_FLOATING_POINT_SUPPORTED) + modpng14_free(modpng14_ptr, swidth); + modpng14_free(modpng14_ptr, sheight); #endif return; } -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_sCAL(png_ptr, info_ptr, buffer[0], width, height); +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED + modpng14_set_sCAL(modpng14_ptr, info_ptr, buffer[0], width, height); #else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_sCAL_s(png_ptr, info_ptr, buffer[0], swidth, sheight); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_set_sCAL_s(modpng14_ptr, info_ptr, buffer[0], swidth, sheight); #endif #endif - png_free(png_ptr, buffer); -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); - png_free(png_ptr, sheight); + modpng14_free(modpng14_ptr, buffer); +#if defined(MODPNG14_FIXED_POINT_SUPPORTED) && !defined(MODPNG14_FLOATING_POINT_SUPPORTED) + modpng14_free(modpng14_ptr, swidth); + modpng14_free(modpng14_ptr, sheight); #endif } #endif -#if defined(PNG_READ_tIME_SUPPORTED) +#if defined(MODPNG14_READ_tIME_SUPPORTED) void /* PRIVATE */ -png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_tIME(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_byte buf[7]; - png_time mod_time; + modpng14_byte buf[7]; + modpng14_time mod_time; - png_debug(1, "in png_handle_tIME\n"); + modpng14_debug(1, "in modpng14_handle_tIME\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Out of place tIME chunk"); - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)) + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Out of place tIME chunk"); + else if (info_ptr != NULL && (info_ptr->valid & MODPNG14_INFO_tIME)) { - png_warning(png_ptr, "Duplicate tIME chunk"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Duplicate tIME chunk"); + modpng14_crc_finish(modpng14_ptr, length); return; } - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; + if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; if (length != 7) { - png_warning(png_ptr, "Incorrect tIME chunk length"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr, "Incorrect tIME chunk length"); + modpng14_crc_finish(modpng14_ptr, length); return; } - png_crc_read(png_ptr, buf, 7); - if (png_crc_finish(png_ptr, 0)) + modpng14_crc_read(modpng14_ptr, buf, 7); + if (modpng14_crc_finish(modpng14_ptr, 0)) return; mod_time.second = buf[6]; @@ -1843,53 +1843,53 @@ mod_time.hour = buf[4]; mod_time.day = buf[3]; mod_time.month = buf[2]; - mod_time.year = png_get_uint_16(buf); + mod_time.year = modpng14_get_uint_16(buf); - png_set_tIME(png_ptr, info_ptr, &mod_time); + modpng14_set_tIME(modpng14_ptr, info_ptr, &mod_time); } #endif -#if defined(PNG_READ_tEXt_SUPPORTED) +#if defined(MODPNG14_READ_tEXt_SUPPORTED) /* Note: this does not properly handle chunks that are > 64K under DOS */ void /* PRIVATE */ -png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_tEXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_textp text_ptr; - png_charp key; - png_charp text; - png_uint_32 skip = 0; - png_size_t slength; + modpng14_textp text_ptr; + modpng14_charp key; + modpng14_charp text; + modpng14_uint_32 skip = 0; + modpng14_size_t slength; int ret; - png_debug(1, "in png_handle_tEXt\n"); + modpng14_debug(1, "in modpng14_handle_tEXt\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before tEXt"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before tEXt"); - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; + if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) +#ifdef MODPNG14_MAX_MALLOC_64K + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "tEXt chunk too large to fit in memory"); + skip = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - key = (png_charp)png_malloc_warn(png_ptr, length + 1); + key = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length + 1); if (key == NULL) { - png_warning(png_ptr, "No memory to process text chunk."); + modpng14_warning(modpng14_ptr, "No memory to process text chunk."); return; } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)key, slength); + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)key, slength); - if (png_crc_finish(png_ptr, skip)) + if (modpng14_crc_finish(modpng14_ptr, skip)) { - png_free(png_ptr, key); + modpng14_free(modpng14_ptr, key); return; } @@ -1901,73 +1901,73 @@ if (text != key + slength) text++; - text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)sizeof(png_text)); + text_ptr = (modpng14_textp)modpng14_malloc_warn(modpng14_ptr, (modpng14_uint_32)sizeof(modpng14_text)); if (text_ptr == NULL) { - png_warning(png_ptr, "Not enough memory to process text chunk."); - png_free(png_ptr, key); + modpng14_warning(modpng14_ptr, "Not enough memory to process text chunk."); + modpng14_free(modpng14_ptr, key); return; } - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr->compression = MODPNG14_TEXT_COMPRESSION_NONE; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; text_ptr->itxt_length = 0; #endif text_ptr->text = text; - text_ptr->text_length = png_strlen(text); + text_ptr->text_length = modpng14_strlen(text); - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1); + ret=modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, 1); - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); + modpng14_free(modpng14_ptr, key); + modpng14_free(modpng14_ptr, text_ptr); if (ret) - png_warning(png_ptr, "Insufficient memory to process text chunk."); + modpng14_warning(modpng14_ptr, "Insufficient memory to process text chunk."); } #endif -#if defined(PNG_READ_zTXt_SUPPORTED) +#if defined(MODPNG14_READ_zTXt_SUPPORTED) /* note: this does not correctly handle chunks that are > 64K under DOS */ void /* PRIVATE */ -png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_zTXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_textp text_ptr; - png_charp chunkdata; - png_charp text; + modpng14_textp text_ptr; + modpng14_charp chunkdata; + modpng14_charp text; int comp_type; int ret; - png_size_t slength, prefix_len, data_len; + modpng14_size_t slength, prefix_len, data_len; - png_debug(1, "in png_handle_zTXt\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before zTXt"); + modpng14_debug(1, "in modpng14_handle_zTXt\n"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before zTXt"); - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; + if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; -#ifdef PNG_MAX_MALLOC_64K +#ifdef MODPNG14_MAX_MALLOC_64K /* We will no doubt have problems with chunks even half this size, but there is no hard and fast rule to tell us where to stop. */ - if (length > (png_uint_32)65535L) + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr,"zTXt chunk too large to fit in memory"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr,"zTXt chunk too large to fit in memory"); + modpng14_crc_finish(modpng14_ptr, length); return; } #endif - chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); + chunkdata = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length + 1); if (chunkdata == NULL) { - png_warning(png_ptr,"Out of memory processing zTXt chunk."); + modpng14_warning(modpng14_ptr,"Out of memory processing zTXt chunk."); return; } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); - if (png_crc_finish(png_ptr, 0)) + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)chunkdata, slength); + if (modpng14_crc_finish(modpng14_ptr, 0)) { - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, chunkdata); return; } @@ -1979,34 +1979,34 @@ /* zTXt must have some text after the chunkdataword */ if (text == chunkdata + slength) { - comp_type = PNG_TEXT_COMPRESSION_NONE; - png_warning(png_ptr, "Zero length zTXt chunk"); + comp_type = MODPNG14_TEXT_COMPRESSION_NONE; + modpng14_warning(modpng14_ptr, "Zero length zTXt chunk"); } else { comp_type = *(++text); - if (comp_type != PNG_TEXT_COMPRESSION_zTXt) + if (comp_type != MODPNG14_TEXT_COMPRESSION_zTXt) { - png_warning(png_ptr, "Unknown compression type in zTXt chunk"); - comp_type = PNG_TEXT_COMPRESSION_zTXt; + modpng14_warning(modpng14_ptr, "Unknown compression type in zTXt chunk"); + comp_type = MODPNG14_TEXT_COMPRESSION_zTXt; } text++; /* skip the compression_method byte */ } prefix_len = text - chunkdata; - chunkdata = (png_charp)png_decompress_chunk(png_ptr, comp_type, chunkdata, - (png_size_t)length, prefix_len, &data_len); + chunkdata = (modpng14_charp)modpng14_decompress_chunk(modpng14_ptr, comp_type, chunkdata, + (modpng14_size_t)length, prefix_len, &data_len); - text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)sizeof(png_text)); + text_ptr = (modpng14_textp)modpng14_malloc_warn(modpng14_ptr, (modpng14_uint_32)sizeof(modpng14_text)); if (text_ptr == NULL) { - png_warning(png_ptr,"Not enough memory to process zTXt chunk."); - png_free(png_ptr, chunkdata); + modpng14_warning(modpng14_ptr,"Not enough memory to process zTXt chunk."); + modpng14_free(modpng14_ptr, chunkdata); return; } text_ptr->compression = comp_type; text_ptr->key = chunkdata; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; text_ptr->itxt_length = 0; @@ -2014,58 +2014,58 @@ text_ptr->text = chunkdata + prefix_len; text_ptr->text_length = data_len; - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1); + ret=modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, 1); - png_free(png_ptr, text_ptr); - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, text_ptr); + modpng14_free(modpng14_ptr, chunkdata); if (ret) - png_error(png_ptr, "Insufficient memory to store zTXt chunk."); + modpng14_error(modpng14_ptr, "Insufficient memory to store zTXt chunk."); } #endif -#if defined(PNG_READ_iTXt_SUPPORTED) +#if defined(MODPNG14_READ_iTXt_SUPPORTED) /* note: this does not correctly handle chunks that are > 64K under DOS */ void /* PRIVATE */ -png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_iTXt(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_textp text_ptr; - png_charp chunkdata; - png_charp key, lang, text, lang_key; + modpng14_textp text_ptr; + modpng14_charp chunkdata; + modpng14_charp key, lang, text, lang_key; int comp_flag; int comp_type = 0; int ret; - png_size_t slength, prefix_len, data_len; + modpng14_size_t slength, prefix_len, data_len; - png_debug(1, "in png_handle_iTXt\n"); + modpng14_debug(1, "in modpng14_handle_iTXt\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before iTXt"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IHDR)) + modpng14_error(modpng14_ptr, "Missing IHDR before iTXt"); - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; + if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; -#ifdef PNG_MAX_MALLOC_64K +#ifdef MODPNG14_MAX_MALLOC_64K /* We will no doubt have problems with chunks even half this size, but there is no hard and fast rule to tell us where to stop. */ - if (length > (png_uint_32)65535L) + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr,"iTXt chunk too large to fit in memory"); - png_crc_finish(png_ptr, length); + modpng14_warning(modpng14_ptr,"iTXt chunk too large to fit in memory"); + modpng14_crc_finish(modpng14_ptr, length); return; } #endif - chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); + chunkdata = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length + 1); if (chunkdata == NULL) { - png_warning(png_ptr, "No memory to process iTXt chunk."); + modpng14_warning(modpng14_ptr, "No memory to process iTXt chunk."); return; } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); - if (png_crc_finish(png_ptr, 0)) + slength = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)chunkdata, slength); + if (modpng14_crc_finish(modpng14_ptr, 0)) { - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, chunkdata); return; } @@ -2081,8 +2081,8 @@ if (lang >= chunkdata + slength) { - comp_flag = PNG_TEXT_COMPRESSION_NONE; - png_warning(png_ptr, "Zero length iTXt chunk"); + comp_flag = MODPNG14_TEXT_COMPRESSION_NONE; + modpng14_warning(modpng14_ptr, "Zero length iTXt chunk"); } else { @@ -2102,15 +2102,15 @@ key=chunkdata; if (comp_flag) - chunkdata = png_decompress_chunk(png_ptr, comp_type, chunkdata, + chunkdata = modpng14_decompress_chunk(modpng14_ptr, comp_type, chunkdata, (size_t)length, prefix_len, &data_len); else - data_len=png_strlen(chunkdata + prefix_len); - text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)sizeof(png_text)); + data_len=modpng14_strlen(chunkdata + prefix_len); + text_ptr = (modpng14_textp)modpng14_malloc_warn(modpng14_ptr, (modpng14_uint_32)sizeof(modpng14_text)); if (text_ptr == NULL) { - png_warning(png_ptr,"Not enough memory to process iTXt chunk."); - png_free(png_ptr, chunkdata); + modpng14_warning(modpng14_ptr,"Not enough memory to process iTXt chunk."); + modpng14_free(modpng14_ptr, chunkdata); return; } text_ptr->compression = (int)comp_flag + 1; @@ -2121,96 +2121,96 @@ text_ptr->key = chunkdata; text_ptr->text = chunkdata + prefix_len; - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1); + ret=modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, 1); - png_free(png_ptr, text_ptr); - png_free(png_ptr, chunkdata); + modpng14_free(modpng14_ptr, text_ptr); + modpng14_free(modpng14_ptr, chunkdata); if (ret) - png_error(png_ptr, "Insufficient memory to store iTXt chunk."); + modpng14_error(modpng14_ptr, "Insufficient memory to store iTXt chunk."); } #endif /* This function is called when we haven't found a handler for a chunk. If there isn't a problem with the chunk itself (ie bad chunk name, CRC, or a critical chunk), the chunk is silently ignored - -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which + -- unless the MODPNG14_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which case it will be saved away to be written out later. */ void /* PRIVATE */ -png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) +modpng14_handle_unknown(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_32 length) { - png_uint_32 skip = 0; + modpng14_uint_32 skip = 0; - png_debug(1, "in png_handle_unknown\n"); + modpng14_debug(1, "in modpng14_handle_unknown\n"); - if (png_ptr->mode & PNG_HAVE_IDAT) + if (modpng14_ptr->mode & MODPNG14_HAVE_IDAT) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IDAT; #endif - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) /* not an IDAT */ - png_ptr->mode |= PNG_AFTER_IDAT; + if (modpng14_memcmp(modpng14_ptr->chunk_name, modpng14_IDAT, 4)) /* not an IDAT */ + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; } - png_check_chunk_name(png_ptr, png_ptr->chunk_name); + modpng14_check_chunk_name(modpng14_ptr, modpng14_ptr->chunk_name); - if (!(png_ptr->chunk_name[0] & 0x20)) + if (!(modpng14_ptr->chunk_name[0] & 0x20)) { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != +#if defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) + if(modpng14_handle_as_unknown(modpng14_ptr, modpng14_ptr->chunk_name) != HANDLE_CHUNK_ALWAYS -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - && png_ptr->read_user_chunk_fn == NULL +#if defined(MODPNG14_READ_USER_CHUNKS_SUPPORTED) + && modpng14_ptr->read_user_chunk_fn == NULL #endif ) #endif - png_chunk_error(png_ptr, "unknown critical chunk"); + modpng14_chunk_error(modpng14_ptr, "unknown critical chunk"); } -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) +#if defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) + if (modpng14_ptr->flags & MODPNG14_FLAG_KEEP_UNKNOWN_CHUNKS) { - png_unknown_chunk chunk; + modpng14_unknown_chunk chunk; -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) +#ifdef MODPNG14_MAX_MALLOC_64K + if (length > (modpng14_uint_32)65535L) { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + modpng14_warning(modpng14_ptr, "unknown chunk too large to fit in memory"); + skip = length - (modpng14_uint_32)65535L; + length = (modpng14_uint_32)65535L; } #endif - png_strcpy((png_charp)chunk.name, (png_charp)png_ptr->chunk_name); - chunk.data = (png_bytep)png_malloc(png_ptr, length); - chunk.size = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunk.data, length); -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if(png_ptr->read_user_chunk_fn != NULL) + modpng14_strcpy((modpng14_charp)chunk.name, (modpng14_charp)modpng14_ptr->chunk_name); + chunk.data = (modpng14_bytep)modpng14_malloc(modpng14_ptr, length); + chunk.size = (modpng14_size_t)length; + modpng14_crc_read(modpng14_ptr, (modpng14_bytep)chunk.data, length); +#if defined(MODPNG14_READ_USER_CHUNKS_SUPPORTED) + if(modpng14_ptr->read_user_chunk_fn != NULL) { /* callback to user unknown chunk handler */ - if ((*(png_ptr->read_user_chunk_fn)) (png_ptr, &chunk) <= 0) + if ((*(modpng14_ptr->read_user_chunk_fn)) (modpng14_ptr, &chunk) <= 0) { - if (!(png_ptr->chunk_name[0] & 0x20)) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != + if (!(modpng14_ptr->chunk_name[0] & 0x20)) + if(modpng14_handle_as_unknown(modpng14_ptr, modpng14_ptr->chunk_name) != HANDLE_CHUNK_ALWAYS) { - png_free(png_ptr, chunk.data); - png_chunk_error(png_ptr, "unknown critical chunk"); + modpng14_free(modpng14_ptr, chunk.data); + modpng14_chunk_error(modpng14_ptr, "unknown critical chunk"); } - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, &chunk, 1); } } else #endif - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); - png_free(png_ptr, chunk.data); + modpng14_set_unknown_chunks(modpng14_ptr, info_ptr, &chunk, 1); + modpng14_free(modpng14_ptr, chunk.data); } else #endif skip = length; - png_crc_finish(png_ptr, skip); + modpng14_crc_finish(modpng14_ptr, skip); -#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED) +#if !defined(MODPNG14_READ_USER_CHUNKS_SUPPORTED) info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */ #endif } @@ -2224,13 +2224,13 @@ #define isnonalpha(c) ((c) < 41 || (c) > 122 || ((c) > 90 && (c) < 97)) void /* PRIVATE */ -png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name) +modpng14_check_chunk_name(modpng14_structp modpng14_ptr, modpng14_bytep chunk_name) { - png_debug(1, "in png_check_chunk_name\n"); + modpng14_debug(1, "in modpng14_check_chunk_name\n"); if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) || isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3])) { - png_chunk_error(png_ptr, "invalid chunk type"); + modpng14_chunk_error(modpng14_ptr, "invalid chunk type"); } } @@ -2244,33 +2244,33 @@ a zero indicates the pixel is to be skipped. This is in addition to any alpha or transparency value associated with the pixel. If you want all pixels to be combined, pass 0xff (255) in mask. */ -#ifndef PNG_HAVE_ASSEMBLER_COMBINE_ROW +#ifndef MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) +modpng14_combine_row(modpng14_structp modpng14_ptr, modpng14_bytep row, int mask) { - png_debug(1,"in png_combine_row\n"); + modpng14_debug(1,"in modpng14_combine_row\n"); if (mask == 0xff) { - png_memcpy(row, png_ptr->row_buf + 1, - (png_size_t)((png_ptr->width * - png_ptr->row_info.pixel_depth + 7) >> 3)); + modpng14_memcpy(row, modpng14_ptr->row_buf + 1, + (modpng14_size_t)((modpng14_ptr->width * + modpng14_ptr->row_info.pixel_depth + 7) >> 3)); } else { - switch (png_ptr->row_info.pixel_depth) + switch (modpng14_ptr->row_info.pixel_depth) { case 1: { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; + modpng14_bytep sp = modpng14_ptr->row_buf + 1; + modpng14_bytep dp = row; int s_inc, s_start, s_end; int m = 0x80; int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = modpng14_ptr->width; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 7; @@ -2293,8 +2293,8 @@ int value; value = (*sp >> shift) & 0x01; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0x7f7f >> (7 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -2315,17 +2315,17 @@ } case 2: { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; + modpng14_bytep sp = modpng14_ptr->row_buf + 1; + modpng14_bytep dp = row; int s_start, s_end, s_inc; int m = 0x80; int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = modpng14_ptr->width; int value; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 6; @@ -2346,8 +2346,8 @@ if (m & mask) { value = (*sp >> shift) & 0x03; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0x3f3f >> (6 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -2367,17 +2367,17 @@ } case 4: { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; + modpng14_bytep sp = modpng14_ptr->row_buf + 1; + modpng14_bytep dp = row; int s_start, s_end, s_inc; int m = 0x80; int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = modpng14_ptr->width; int value; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 4; @@ -2397,8 +2397,8 @@ if (m & mask) { value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0xf0f >> (4 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -2418,19 +2418,19 @@ } default: { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - png_size_t pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - png_byte m = 0x80; + modpng14_bytep sp = modpng14_ptr->row_buf + 1; + modpng14_bytep dp = row; + modpng14_size_t pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + modpng14_uint_32 i; + modpng14_uint_32 row_width = modpng14_ptr->width; + modpng14_byte m = 0x80; for (i = 0; i < row_width; i++) { if (m & mask) { - png_memcpy(dp, sp, pixel_bytes); + modpng14_memcpy(dp, sp, pixel_bytes); } sp += pixel_bytes; @@ -2446,49 +2446,49 @@ } } } -#endif /* !PNG_HAVE_ASSEMBLER_COMBINE_ROW */ +#endif /* !MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW */ -#ifdef PNG_READ_INTERLACING_SUPPORTED -#ifndef PNG_HAVE_ASSEMBLER_READ_INTERLACE /* else in pngvcrd.c, pnggccrd.c */ +#ifdef MODPNG14_READ_INTERLACING_SUPPORTED +#ifndef MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE /* else in pngvcrd.c, pnggccrd.c */ /* OLD pre-1.0.9 interface: -void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, - png_uint_32 transformations) +void modpng14_do_read_interlace(modpng14_row_infop row_info, modpng14_bytep row, int pass, + modpng14_uint_32 transformations) */ void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) +modpng14_do_read_interlace(modpng14_structp modpng14_ptr) { - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; - png_uint_32 transformations = png_ptr->transformations; -#ifdef PNG_USE_LOCAL_ARRAYS + modpng14_row_infop row_info = &(modpng14_ptr->row_info); + modpng14_bytep row = modpng14_ptr->row_buf + 1; + int pass = modpng14_ptr->pass; + modpng14_uint_32 transformations = modpng14_ptr->transformations; +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* offset to next interlace block */ - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + const int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif - png_debug(1,"in png_do_read_interlace (stock C version)\n"); + modpng14_debug(1,"in modpng14_do_read_interlace (stock C version)\n"); if (row != NULL && row_info != NULL) { - png_uint_32 final_width; + modpng14_uint_32 final_width; - final_width = row_info->width * png_pass_inc[pass]; + final_width = row_info->width * modpng14_pass_inc[pass]; switch (row_info->pixel_depth) { case 1: { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 3); + modpng14_bytep sp = row + (modpng14_size_t)((row_info->width - 1) >> 3); + modpng14_bytep dp = row + (modpng14_size_t)((final_width - 1) >> 3); int sshift, dshift; int s_start, s_end, s_inc; - int jstop = png_pass_inc[pass]; - png_byte v; - png_uint_32 i; + int jstop = modpng14_pass_inc[pass]; + modpng14_byte v; + modpng14_uint_32 i; int j; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { sshift = (int)((row_info->width + 7) & 0x07); dshift = (int)((final_width + 7) & 0x07); @@ -2508,11 +2508,11 @@ for (i = 0; i < row_info->width; i++) { - v = (png_byte)((*sp >> sshift) & 0x01); + v = (modpng14_byte)((*sp >> sshift) & 0x01); for (j = 0; j < jstop; j++) { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0x7f7f >> (7 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -2533,15 +2533,15 @@ } case 2: { - png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2); - png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2); + modpng14_bytep sp = row + (modpng14_uint_32)((row_info->width - 1) >> 2); + modpng14_bytep dp = row + (modpng14_uint_32)((final_width - 1) >> 2); int sshift, dshift; int s_start, s_end, s_inc; - int jstop = png_pass_inc[pass]; - png_uint_32 i; + int jstop = modpng14_pass_inc[pass]; + modpng14_uint_32 i; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { sshift = (int)(((row_info->width + 3) & 0x03) << 1); dshift = (int)(((final_width + 3) & 0x03) << 1); @@ -2561,14 +2561,14 @@ for (i = 0; i < row_info->width; i++) { - png_byte v; + modpng14_byte v; int j; - v = (png_byte)((*sp >> sshift) & 0x03); + v = (modpng14_byte)((*sp >> sshift) & 0x03); for (j = 0; j < jstop; j++) { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0x3f3f >> (6 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -2589,15 +2589,15 @@ } case 4: { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 1); + modpng14_bytep sp = row + (modpng14_size_t)((row_info->width - 1) >> 1); + modpng14_bytep dp = row + (modpng14_size_t)((final_width - 1) >> 1); int sshift, dshift; int s_start, s_end, s_inc; - png_uint_32 i; - int jstop = png_pass_inc[pass]; + modpng14_uint_32 i; + int jstop = modpng14_pass_inc[pass]; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { sshift = (int)(((row_info->width + 1) & 0x01) << 2); dshift = (int)(((final_width + 1) & 0x01) << 2); @@ -2617,13 +2617,13 @@ for (i = 0; i < row_info->width; i++) { - png_byte v = (png_byte)((*sp >> sshift) & 0xf); + modpng14_byte v = (modpng14_byte)((*sp >> sshift) & 0xf); int j; for (j = 0; j < jstop; j++) { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0xf0f >> (4 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -2644,22 +2644,22 @@ } default: { - png_size_t pixel_bytes = (row_info->pixel_depth >> 3); - png_bytep sp = row + (png_size_t)(row_info->width - 1) * pixel_bytes; - png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes; + modpng14_size_t pixel_bytes = (row_info->pixel_depth >> 3); + modpng14_bytep sp = row + (modpng14_size_t)(row_info->width - 1) * pixel_bytes; + modpng14_bytep dp = row + (modpng14_size_t)(final_width - 1) * pixel_bytes; - int jstop = png_pass_inc[pass]; - png_uint_32 i; + int jstop = modpng14_pass_inc[pass]; + modpng14_uint_32 i; for (i = 0; i < row_info->width; i++) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sp, pixel_bytes); + modpng14_memcpy(v, sp, pixel_bytes); for (j = 0; j < jstop; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sp -= pixel_bytes; @@ -2669,92 +2669,92 @@ } row_info->width = final_width; row_info->rowbytes = ((final_width * - (png_uint_32)row_info->pixel_depth + 7) >> 3); + (modpng14_uint_32)row_info->pixel_depth + 7) >> 3); } -#if !defined(PNG_READ_PACKSWAP_SUPPORTED) +#if !defined(MODPNG14_READ_PACKSWAP_SUPPORTED) transformations = transformations; /* silence compiler warning */ #endif } -#endif /* !PNG_HAVE_ASSEMBLER_READ_INTERLACE */ -#endif /* PNG_READ_INTERLACING_SUPPORTED */ +#endif /* !MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE */ +#endif /* MODPNG14_READ_INTERLACING_SUPPORTED */ -#ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW +#ifndef MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, - png_bytep prev_row, int filter) +modpng14_read_filter_row(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep prev_row, int filter) { - png_debug(1, "in png_read_filter_row\n"); - png_debug2(2,"row = %lu, filter = %d\n", png_ptr->row_number, filter); + modpng14_debug(1, "in modpng14_read_filter_row\n"); + modpng14_debug2(2,"row = %lu, filter = %d\n", modpng14_ptr->row_number, filter); switch (filter) { - case PNG_FILTER_VALUE_NONE: + case MODPNG14_FILTER_VALUE_NONE: break; - case PNG_FILTER_VALUE_SUB: + case MODPNG14_FILTER_VALUE_SUB: { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_bytep rp = row + bpp; + modpng14_bytep lp = row; for (i = bpp; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); rp++; } break; } - case PNG_FILTER_VALUE_UP: + case MODPNG14_FILTER_VALUE_UP: { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; for (i = 0; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); rp++; } break; } - case PNG_FILTER_VALUE_AVG: + case MODPNG14_FILTER_VALUE_AVG: { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; + modpng14_uint_32 i; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; + modpng14_bytep lp = row; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_uint_32 istop = row_info->rowbytes - bpp; for (i = 0; i < bpp; i++) { - *rp = (png_byte)(((int)(*rp) + + *rp = (modpng14_byte)(((int)(*rp) + ((int)(*pp++) / 2 )) & 0xff); rp++; } for (i = 0; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++ + *lp++) / 2 ) & 0xff); rp++; } break; } - case PNG_FILTER_VALUE_PAETH: + case MODPNG14_FILTER_VALUE_PAETH: { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop=row_info->rowbytes - bpp; + modpng14_uint_32 i; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; + modpng14_bytep lp = row; + modpng14_bytep cp = prev_row; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_uint_32 istop=row_info->rowbytes - bpp; for (i = 0; i < bpp; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); rp++; } @@ -2769,7 +2769,7 @@ p = b - c; pc = a - c; -#ifdef PNG_USE_ABS +#ifdef MODPNG14_USE_ABS pa = abs(p); pb = abs(pc); pc = abs(p + pc); @@ -2790,223 +2790,223 @@ p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - *rp = (png_byte)(((int)(*rp) + p) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + p) & 0xff); rp++; } break; } default: - png_warning(png_ptr, "Ignoring bad adaptive filter type"); + modpng14_warning(modpng14_ptr, "Ignoring bad adaptive filter type"); *row=0; break; } } -#endif /* !PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */ +#endif /* !MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW */ void /* PRIVATE */ -png_read_finish_row(png_structp png_ptr) +modpng14_read_finish_row(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* start of interlace block */ - const int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + const int modpng14_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* offset to next interlace block */ - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + const int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* start of interlace block in the y direction */ - const int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + const int modpng14_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* offset to next interlace block in the y direction */ - const int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + const int modpng14_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif - png_debug(1, "in png_read_finish_row\n"); - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) + modpng14_debug(1, "in modpng14_read_finish_row\n"); + modpng14_ptr->row_number++; + if (modpng14_ptr->row_number < modpng14_ptr->num_rows) return; - if (png_ptr->interlaced) + if (modpng14_ptr->interlaced) { - png_ptr->row_number = 0; - png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1); + modpng14_ptr->row_number = 0; + modpng14_memset_check(modpng14_ptr, modpng14_ptr->prev_row, 0, modpng14_ptr->rowbytes + 1); do { - png_ptr->pass++; - if (png_ptr->pass >= 7) + modpng14_ptr->pass++; + if (modpng14_ptr->pass >= 7) break; - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - png_ptr->irowbytes = ((png_ptr->iwidth * - (png_uint_32)png_ptr->pixel_depth + 7) >> 3) +1; - - if (!(png_ptr->transformations & PNG_INTERLACE)) - { - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - if (!(png_ptr->num_rows)) + modpng14_ptr->iwidth = (modpng14_ptr->width + + modpng14_pass_inc[modpng14_ptr->pass] - 1 - + modpng14_pass_start[modpng14_ptr->pass]) / + modpng14_pass_inc[modpng14_ptr->pass]; + modpng14_ptr->irowbytes = ((modpng14_ptr->iwidth * + (modpng14_uint_32)modpng14_ptr->pixel_depth + 7) >> 3) +1; + + if (!(modpng14_ptr->transformations & MODPNG14_INTERLACE)) + { + modpng14_ptr->num_rows = (modpng14_ptr->height + + modpng14_pass_yinc[modpng14_ptr->pass] - 1 - + modpng14_pass_ystart[modpng14_ptr->pass]) / + modpng14_pass_yinc[modpng14_ptr->pass]; + if (!(modpng14_ptr->num_rows)) continue; } - else /* if (png_ptr->transformations & PNG_INTERLACE) */ + else /* if (modpng14_ptr->transformations & MODPNG14_INTERLACE) */ break; - } while (png_ptr->iwidth == 0); + } while (modpng14_ptr->iwidth == 0); - if (png_ptr->pass < 7) + if (modpng14_ptr->pass < 7) return; } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_FINISHED)) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IDAT; #endif char extra; int ret; - png_ptr->zstream.next_out = (Byte *)&extra; - png_ptr->zstream.avail_out = (uInt)1; + modpng14_ptr->zstream.next_out = (Byte *)&extra; + modpng14_ptr->zstream.avail_out = (uInt)1; for(;;) { - if (!(png_ptr->zstream.avail_in)) + if (!(modpng14_ptr->zstream.avail_in)) { - while (!png_ptr->idat_size) + while (!modpng14_ptr->idat_size) { - png_byte chunk_length[4]; + modpng14_byte chunk_length[4]; - png_crc_finish(png_ptr, 0); + modpng14_crc_finish(modpng14_ptr, 0); - png_read_data(png_ptr, chunk_length, 4); - png_ptr->idat_size = png_get_uint_32(chunk_length); + modpng14_read_data(modpng14_ptr, chunk_length, 4); + modpng14_ptr->idat_size = modpng14_get_uint_32(chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - if (png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); + modpng14_reset_crc(modpng14_ptr); + modpng14_crc_read(modpng14_ptr, modpng14_ptr->chunk_name, 4); + if (modpng14_memcmp(modpng14_ptr->chunk_name, (modpng14_bytep)modpng14_IDAT, 4)) + modpng14_error(modpng14_ptr, "Not enough image data"); } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) - png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size; - png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zstream.avail_in); - png_ptr->idat_size -= png_ptr->zstream.avail_in; + modpng14_ptr->zstream.avail_in = (uInt)modpng14_ptr->zbuf_size; + modpng14_ptr->zstream.next_in = modpng14_ptr->zbuf; + if (modpng14_ptr->zbuf_size > modpng14_ptr->idat_size) + modpng14_ptr->zstream.avail_in = (uInt)modpng14_ptr->idat_size; + modpng14_crc_read(modpng14_ptr, modpng14_ptr->zbuf, modpng14_ptr->zstream.avail_in); + modpng14_ptr->idat_size -= modpng14_ptr->zstream.avail_in; } - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); + ret = inflate(&modpng14_ptr->zstream, Z_PARTIAL_FLUSH); if (ret == Z_STREAM_END) { - if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in || - png_ptr->idat_size) - png_warning(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; + if (!(modpng14_ptr->zstream.avail_out) || modpng14_ptr->zstream.avail_in || + modpng14_ptr->idat_size) + modpng14_warning(modpng14_ptr, "Extra compressed data"); + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_FINISHED; break; } if (ret != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg : + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg ? modpng14_ptr->zstream.msg : "Decompression Error"); - if (!(png_ptr->zstream.avail_out)) + if (!(modpng14_ptr->zstream.avail_out)) { - png_warning(png_ptr, "Extra compressed data."); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; + modpng14_warning(modpng14_ptr, "Extra compressed data."); + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_FINISHED; break; } } - png_ptr->zstream.avail_out = 0; + modpng14_ptr->zstream.avail_out = 0; } - if (png_ptr->idat_size || png_ptr->zstream.avail_in) - png_warning(png_ptr, "Extra compression data"); + if (modpng14_ptr->idat_size || modpng14_ptr->zstream.avail_in) + modpng14_warning(modpng14_ptr, "Extra compression data"); - inflateReset(&png_ptr->zstream); + inflateReset(&modpng14_ptr->zstream); - png_ptr->mode |= PNG_AFTER_IDAT; + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; } void /* PRIVATE */ -png_read_start_row(png_structp png_ptr) +modpng14_read_start_row(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* start of interlace block */ - const int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + const int modpng14_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* offset to next interlace block */ - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + const int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* start of interlace block in the y direction */ - const int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + const int modpng14_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* offset to next interlace block in the y direction */ - const int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + const int modpng14_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif int max_pixel_depth; - png_uint_32 row_bytes; + modpng14_uint_32 row_bytes; - png_debug(1, "in png_read_start_row\n"); - png_ptr->zstream.avail_in = 0; - png_init_read_transformations(png_ptr); - if (png_ptr->interlaced) - { - if (!(png_ptr->transformations & PNG_INTERLACE)) - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; + modpng14_debug(1, "in modpng14_read_start_row\n"); + modpng14_ptr->zstream.avail_in = 0; + modpng14_init_read_transformations(modpng14_ptr); + if (modpng14_ptr->interlaced) + { + if (!(modpng14_ptr->transformations & MODPNG14_INTERLACE)) + modpng14_ptr->num_rows = (modpng14_ptr->height + modpng14_pass_yinc[0] - 1 - + modpng14_pass_ystart[0]) / modpng14_pass_yinc[0]; else - png_ptr->num_rows = png_ptr->height; + modpng14_ptr->num_rows = modpng14_ptr->height; - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - row_bytes = ((png_ptr->iwidth * - (png_uint_32)png_ptr->pixel_depth + 7) >> 3) +1; - png_ptr->irowbytes = (png_size_t)row_bytes; - if((png_uint_32)png_ptr->irowbytes != row_bytes) - png_error(png_ptr, "Rowbytes overflow in png_read_start_row"); + modpng14_ptr->iwidth = (modpng14_ptr->width + + modpng14_pass_inc[modpng14_ptr->pass] - 1 - + modpng14_pass_start[modpng14_ptr->pass]) / + modpng14_pass_inc[modpng14_ptr->pass]; + + row_bytes = ((modpng14_ptr->iwidth * + (modpng14_uint_32)modpng14_ptr->pixel_depth + 7) >> 3) +1; + modpng14_ptr->irowbytes = (modpng14_size_t)row_bytes; + if((modpng14_uint_32)modpng14_ptr->irowbytes != row_bytes) + modpng14_error(modpng14_ptr, "Rowbytes overflow in modpng14_read_start_row"); } else { - png_ptr->num_rows = png_ptr->height; - png_ptr->iwidth = png_ptr->width; - png_ptr->irowbytes = png_ptr->rowbytes + 1; + modpng14_ptr->num_rows = modpng14_ptr->height; + modpng14_ptr->iwidth = modpng14_ptr->width; + modpng14_ptr->irowbytes = modpng14_ptr->rowbytes + 1; } - max_pixel_depth = png_ptr->pixel_depth; + max_pixel_depth = modpng14_ptr->pixel_depth; -#if defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) && png_ptr->bit_depth < 8) +#if defined(MODPNG14_READ_PACK_SUPPORTED) + if ((modpng14_ptr->transformations & MODPNG14_PACK) && modpng14_ptr->bit_depth < 8) max_pixel_depth = 8; #endif -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_EXPAND) { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - if (png_ptr->num_trans) + if (modpng14_ptr->num_trans) max_pixel_depth = 32; else max_pixel_depth = 24; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_GRAY) { if (max_pixel_depth < 8) max_pixel_depth = 8; - if (png_ptr->num_trans) + if (modpng14_ptr->num_trans) max_pixel_depth *= 2; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_RGB) { - if (png_ptr->num_trans) + if (modpng14_ptr->num_trans) { max_pixel_depth *= 4; max_pixel_depth /= 3; @@ -3015,19 +3015,19 @@ } #endif -#if defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & (PNG_FILLER)) +#if defined(MODPNG14_READ_FILLER_SUPPORTED) + if (modpng14_ptr->transformations & (MODPNG14_FILLER)) { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) max_pixel_depth = 32; - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_GRAY) { if (max_pixel_depth <= 8) max_pixel_depth = 16; else max_pixel_depth = 32; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_RGB) { if (max_pixel_depth <= 32) max_pixel_depth = 32; @@ -3037,17 +3037,17 @@ } #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) +#if defined(MODPNG14_READ_GRAY_TO_RGB_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_GRAY_TO_RGB) { if ( -#if defined(PNG_READ_EXPAND_SUPPORTED) - (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND)) || +#if defined(MODPNG14_READ_EXPAND_SUPPORTED) + (modpng14_ptr->num_trans && (modpng14_ptr->transformations & MODPNG14_EXPAND)) || #endif -#if defined(PNG_READ_FILLER_SUPPORTED) - (png_ptr->transformations & (PNG_FILLER)) || +#if defined(MODPNG14_READ_FILLER_SUPPORTED) + (modpng14_ptr->transformations & (MODPNG14_FILLER)) || #endif - png_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA) { if (max_pixel_depth <= 16) max_pixel_depth = 32; @@ -3058,12 +3058,12 @@ { if (max_pixel_depth <= 8) { - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) max_pixel_depth = 32; else max_pixel_depth = 24; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) max_pixel_depth = 64; else max_pixel_depth = 48; @@ -3071,12 +3071,12 @@ } #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \ -defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if(png_ptr->transformations & PNG_USER_TRANSFORM) +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) && \ +defined(MODPNG14_USER_TRANSFORM_PTR_SUPPORTED) + if(modpng14_ptr->transformations & MODPNG14_USER_TRANSFORM) { - int user_pixel_depth=png_ptr->user_transform_depth* - png_ptr->user_transform_channels; + int user_pixel_depth=modpng14_ptr->user_transform_depth* + modpng14_ptr->user_transform_channels; if(user_pixel_depth > max_pixel_depth) max_pixel_depth=user_pixel_depth; } @@ -3084,36 +3084,36 @@ /* align the width on the next larger 8 pixels. Mainly used for interlacing */ - row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7)); + row_bytes = ((modpng14_ptr->width + 7) & ~((modpng14_uint_32)7)); /* calculate the maximum bytes needed, adding a byte and a pixel for safety's sake */ - row_bytes = ((row_bytes * (png_uint_32)max_pixel_depth + 7) >> 3) + + row_bytes = ((row_bytes * (modpng14_uint_32)max_pixel_depth + 7) >> 3) + 1 + ((max_pixel_depth + 7) >> 3); -#ifdef PNG_MAX_MALLOC_64K - if (row_bytes > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); +#ifdef MODPNG14_MAX_MALLOC_64K + if (row_bytes > (modpng14_uint_32)65536L) + modpng14_error(modpng14_ptr, "This image requires a row greater than 64KB"); #endif - png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64); - png_ptr->row_buf = png_ptr->big_row_buf+32; -#if defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD) - png_ptr->row_buf_size = row_bytes; + modpng14_ptr->big_row_buf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, row_bytes+64); + modpng14_ptr->row_buf = modpng14_ptr->big_row_buf+32; +#if defined(MODPNG14_DEBUG) && defined(MODPNG14_USE_PNGGCCRD) + modpng14_ptr->row_buf_size = row_bytes; #endif -#ifdef PNG_MAX_MALLOC_64K - if ((png_uint_32)png_ptr->rowbytes + 1 > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); +#ifdef MODPNG14_MAX_MALLOC_64K + if ((modpng14_uint_32)modpng14_ptr->rowbytes + 1 > (modpng14_uint_32)65536L) + modpng14_error(modpng14_ptr, "This image requires a row greater than 64KB"); #endif - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)( - png_ptr->rowbytes + 1)); + modpng14_ptr->prev_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)( + modpng14_ptr->rowbytes + 1)); - png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1); + modpng14_memset_check(modpng14_ptr, modpng14_ptr->prev_row, 0, modpng14_ptr->rowbytes + 1); - png_debug1(3, "width = %lu,\n", png_ptr->width); - png_debug1(3, "height = %lu,\n", png_ptr->height); - png_debug1(3, "iwidth = %lu,\n", png_ptr->iwidth); - png_debug1(3, "num_rows = %lu\n", png_ptr->num_rows); - png_debug1(3, "rowbytes = %lu,\n", png_ptr->rowbytes); - png_debug1(3, "irowbytes = %lu,\n", png_ptr->irowbytes); + modpng14_debug1(3, "width = %lu,\n", modpng14_ptr->width); + modpng14_debug1(3, "height = %lu,\n", modpng14_ptr->height); + modpng14_debug1(3, "iwidth = %lu,\n", modpng14_ptr->iwidth); + modpng14_debug1(3, "num_rows = %lu\n", modpng14_ptr->num_rows); + modpng14_debug1(3, "rowbytes = %lu,\n", modpng14_ptr->rowbytes); + modpng14_debug1(3, "irowbytes = %lu,\n", modpng14_ptr->irowbytes); - png_ptr->flags |= PNG_FLAG_ROW_INIT; + modpng14_ptr->flags |= MODPNG14_FLAG_ROW_INIT; } --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngset.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngset.c @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -13,31 +13,31 @@ * info struct and allows us to change the structure in the future. */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" -#if defined(PNG_bKGD_SUPPORTED) -void PNGAPI -png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) +#if defined(MODPNG14_bKGD_SUPPORTED) +void MODPNG14API +modpng14_set_bKGD(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_color_16p background) { - png_debug1(1, "in %s storage function\n", "bKGD"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "bKGD"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - png_memcpy(&(info_ptr->background), background, sizeof(png_color_16)); - info_ptr->valid |= PNG_INFO_bKGD; + modpng14_memcpy(&(info_ptr->background), background, sizeof(modpng14_color_16)); + info_ptr->valid |= MODPNG14_INFO_bKGD; } #endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_cHRM(png_structp png_ptr, png_infop info_ptr, +#if defined(MODPNG14_cHRM_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +void MODPNG14API +modpng14_set_cHRM(modpng14_structp modpng14_ptr, modpng14_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) { - png_debug1(1, "in %s storage function\n", "cHRM"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "cHRM"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; if (white_x < 0.0 || white_y < 0.0 || @@ -45,7 +45,7 @@ green_x < 0.0 || green_y < 0.0 || blue_x < 0.0 || blue_y < 0.0) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to set negative chromaticity value"); return; } @@ -54,7 +54,7 @@ green_x > 21474.83 || green_y > 21474.83 || blue_x > 21474.83 || blue_y > 21474.83) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to set chromaticity value exceeding 21474.83"); return; } @@ -67,28 +67,28 @@ info_ptr->y_green = (float)green_y; info_ptr->x_blue = (float)blue_x; info_ptr->y_blue = (float)blue_y; -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5); - info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5); - info_ptr->int_x_red = (png_fixed_point)( red_x*100000.+0.5); - info_ptr->int_y_red = (png_fixed_point)( red_y*100000.+0.5); - info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5); - info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5); - info_ptr->int_x_blue = (png_fixed_point)( blue_x*100000.+0.5); - info_ptr->int_y_blue = (png_fixed_point)( blue_y*100000.+0.5); -#endif - info_ptr->valid |= PNG_INFO_cHRM; -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_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) +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + info_ptr->int_x_white = (modpng14_fixed_point)(white_x*100000.+0.5); + info_ptr->int_y_white = (modpng14_fixed_point)(white_y*100000.+0.5); + info_ptr->int_x_red = (modpng14_fixed_point)( red_x*100000.+0.5); + info_ptr->int_y_red = (modpng14_fixed_point)( red_y*100000.+0.5); + info_ptr->int_x_green = (modpng14_fixed_point)(green_x*100000.+0.5); + info_ptr->int_y_green = (modpng14_fixed_point)(green_y*100000.+0.5); + info_ptr->int_x_blue = (modpng14_fixed_point)( blue_x*100000.+0.5); + info_ptr->int_y_blue = (modpng14_fixed_point)( blue_y*100000.+0.5); +#endif + info_ptr->valid |= MODPNG14_INFO_cHRM; +} +#endif +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +void MODPNG14API +modpng14_set_cHRM_fixed(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_fixed_point white_x, modpng14_fixed_point white_y, modpng14_fixed_point red_x, + modpng14_fixed_point red_y, modpng14_fixed_point green_x, modpng14_fixed_point green_y, + modpng14_fixed_point blue_x, modpng14_fixed_point blue_y) { - png_debug1(1, "in %s storage function\n", "cHRM"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "cHRM"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; if (white_x < 0 || white_y < 0 || @@ -96,16 +96,16 @@ green_x < 0 || green_y < 0 || blue_x < 0 || blue_y < 0) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to set negative chromaticity value"); return; } - if (white_x > (double) PNG_MAX_UINT || white_y > (double) PNG_MAX_UINT || - red_x > (double) PNG_MAX_UINT || red_y > (double) PNG_MAX_UINT || - green_x > (double) PNG_MAX_UINT || green_y > (double) PNG_MAX_UINT || - blue_x > (double) PNG_MAX_UINT || blue_y > (double) PNG_MAX_UINT) + if (white_x > (double) MODPNG14_MAX_UINT || white_y > (double) MODPNG14_MAX_UINT || + red_x > (double) MODPNG14_MAX_UINT || red_y > (double) MODPNG14_MAX_UINT || + green_x > (double) MODPNG14_MAX_UINT || green_y > (double) MODPNG14_MAX_UINT || + blue_x > (double) MODPNG14_MAX_UINT || blue_y > (double) MODPNG14_MAX_UINT) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to set chromaticity value exceeding 21474.83"); return; } @@ -117,7 +117,7 @@ info_ptr->int_y_green = green_y; info_ptr->int_x_blue = blue_x; info_ptr->int_y_blue = blue_y; -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED info_ptr->x_white = (float)(white_x/100000.); info_ptr->y_white = (float)(white_y/100000.); info_ptr->x_red = (float)( red_x/100000.); @@ -127,273 +127,273 @@ info_ptr->x_blue = (float)( blue_x/100000.); info_ptr->y_blue = (float)( blue_y/100000.); #endif - info_ptr->valid |= PNG_INFO_cHRM; + info_ptr->valid |= MODPNG14_INFO_cHRM; } #endif #endif -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) +#if defined(MODPNG14_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +void MODPNG14API +modpng14_set_gAMA(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, double file_gamma) { double gamma; - png_debug1(1, "in %s storage function\n", "gAMA"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "gAMA"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; /* Check for overflow */ if (file_gamma > 21474.83) { - png_warning(png_ptr, "Limiting gamma to 21474.83"); + modpng14_warning(modpng14_ptr, "Limiting gamma to 21474.83"); gamma=21474.83; } else gamma=file_gamma; info_ptr->gamma = (float)gamma; -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED info_ptr->int_gamma = (int)(gamma*100000.+.5); #endif - info_ptr->valid |= PNG_INFO_gAMA; + info_ptr->valid |= MODPNG14_INFO_gAMA; if(gamma == 0.0) - png_warning(png_ptr, "Setting gamma=0"); + modpng14_warning(modpng14_ptr, "Setting gamma=0"); } #endif -void PNGAPI -png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point +void MODPNG14API +modpng14_set_gAMA_fixed(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_fixed_point int_gamma) { - png_fixed_point gamma; + modpng14_fixed_point gamma; - png_debug1(1, "in %s storage function\n", "gAMA"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "gAMA"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - if (int_gamma > (png_fixed_point) PNG_MAX_UINT) + if (int_gamma > (modpng14_fixed_point) MODPNG14_MAX_UINT) { - png_warning(png_ptr, "Limiting gamma to 21474.83"); - gamma=PNG_MAX_UINT; + modpng14_warning(modpng14_ptr, "Limiting gamma to 21474.83"); + gamma=MODPNG14_MAX_UINT; } else { if (int_gamma < 0) { - png_warning(png_ptr, "Setting negative gamma to zero"); + modpng14_warning(modpng14_ptr, "Setting negative gamma to zero"); gamma=0; } else gamma=int_gamma; } -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED info_ptr->gamma = (float)(gamma/100000.); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED info_ptr->int_gamma = gamma; #endif - info_ptr->valid |= PNG_INFO_gAMA; + info_ptr->valid |= MODPNG14_INFO_gAMA; if(gamma == 0) - png_warning(png_ptr, "Setting gamma=0"); + modpng14_warning(modpng14_ptr, "Setting gamma=0"); } #endif -#if defined(PNG_hIST_SUPPORTED) -void PNGAPI -png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist) +#if defined(MODPNG14_hIST_SUPPORTED) +void MODPNG14API +modpng14_set_hIST(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_uint_16p hist) { int i; - png_debug1(1, "in %s storage function\n", "hIST"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "hIST"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; if (info_ptr->num_palette == 0) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Palette size 0, hIST allocation skipped."); return; } -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0); +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_HIST, 0); #endif /* Changed from info->num_palette to 256 in version 1.2.1 */ - png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr, - (png_uint_32)(256 * sizeof (png_uint_16))); - if (png_ptr->hist == NULL) + modpng14_ptr->hist = (modpng14_uint_16p)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)(256 * sizeof (modpng14_uint_16))); + if (modpng14_ptr->hist == NULL) { - png_warning(png_ptr, "Insufficient memory for hIST chunk data."); + modpng14_warning(modpng14_ptr, "Insufficient memory for hIST chunk data."); return; } for (i = 0; i < info_ptr->num_palette; i++) - png_ptr->hist[i] = hist[i]; - info_ptr->hist = png_ptr->hist; - info_ptr->valid |= PNG_INFO_hIST; + modpng14_ptr->hist[i] = hist[i]; + info_ptr->hist = modpng14_ptr->hist; + info_ptr->valid |= MODPNG14_INFO_hIST; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_HIST; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_HIST; #else - png_ptr->flags |= PNG_FLAG_FREE_HIST; + modpng14_ptr->flags |= MODPNG14_FLAG_FREE_HIST; #endif } #endif -void PNGAPI -png_set_IHDR(png_structp png_ptr, png_infop info_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, +void MODPNG14API +modpng14_set_IHDR(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 width, modpng14_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type) { int rowbytes_per_pixel; - png_debug1(1, "in %s storage function\n", "IHDR"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "IHDR"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; /* check for width and height valid values */ if (width == 0 || height == 0) - png_error(png_ptr, "Image width or height is zero in IHDR"); - if (width > PNG_MAX_UINT || height > PNG_MAX_UINT) - png_error(png_ptr, "Invalid image size in IHDR"); - if (width > PNG_USER_WIDTH_MAX || height > PNG_USER_HEIGHT_MAX) - png_error(png_ptr, "image size exceeds user limits in IHDR"); + modpng14_error(modpng14_ptr, "Image width or height is zero in IHDR"); + if (width > MODPNG14_MAX_UINT || height > MODPNG14_MAX_UINT) + modpng14_error(modpng14_ptr, "Invalid image size in IHDR"); + if (width > MODPNG14_USER_WIDTH_MAX || height > MODPNG14_USER_HEIGHT_MAX) + modpng14_error(modpng14_ptr, "image size exceeds user limits in IHDR"); /* check other values */ if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 && bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth in IHDR"); + modpng14_error(modpng14_ptr, "Invalid bit depth in IHDR"); if (color_type < 0 || color_type == 1 || color_type == 5 || color_type > 6) - png_error(png_ptr, "Invalid color type in IHDR"); + modpng14_error(modpng14_ptr, "Invalid color type in IHDR"); - if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) || - ((color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8)) - png_error(png_ptr, "Invalid color type/bit depth combination in IHDR"); + if (((color_type == MODPNG14_COLOR_TYPE_PALETTE) && bit_depth > 8) || + ((color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8)) + modpng14_error(modpng14_ptr, "Invalid color type/bit depth combination in IHDR"); - if (interlace_type >= PNG_INTERLACE_LAST) - png_error(png_ptr, "Unknown interlace method in IHDR"); + if (interlace_type >= MODPNG14_INTERLACE_LAST) + modpng14_error(modpng14_ptr, "Unknown interlace method in IHDR"); - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_error(png_ptr, "Unknown compression method in IHDR"); + if (compression_type != MODPNG14_COMPRESSION_TYPE_BASE) + modpng14_error(modpng14_ptr, "Unknown compression method in IHDR"); -#if defined(PNG_MNG_FEATURES_SUPPORTED) +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) /* Accept filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and + * 1. Libpng was compiled with MODPNG14_MNG_FEATURES_SUPPORTED and * 2. Libpng did not read a PNG signature (this filter_method is only * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and + * 3. The application called modpng14_permit_mng_features with a mask that + * included MODPNG14_FLAG_MNG_FILTER_64 and * 4. The filter_method is 64 and * 5. The color_type is RGB or RGBA */ - if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted) - png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n"); - if(filter_type != PNG_FILTER_TYPE_BASE) + if((modpng14_ptr->mode&MODPNG14_HAVE_MODPNG14_SIGNATURE)&&modpng14_ptr->mng_features_permitted) + modpng14_warning(modpng14_ptr,"MNG features are not allowed in a PNG datastream\n"); + if(filter_type != MODPNG14_FILTER_TYPE_BASE) { - if(!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING) && - ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA))) - png_error(png_ptr, "Unknown filter method in IHDR"); - if(png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) - png_warning(png_ptr, "Invalid filter method in IHDR"); + if(!((modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_FILTER_64) && + (filter_type == MODPNG14_INTRAPIXEL_DIFFERENCING) && + ((modpng14_ptr->mode&MODPNG14_HAVE_MODPNG14_SIGNATURE) == 0) && + (color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA))) + modpng14_error(modpng14_ptr, "Unknown filter method in IHDR"); + if(modpng14_ptr->mode&MODPNG14_HAVE_MODPNG14_SIGNATURE) + modpng14_warning(modpng14_ptr, "Invalid filter method in IHDR"); } #else - if(filter_type != PNG_FILTER_TYPE_BASE) - png_error(png_ptr, "Unknown filter method in IHDR"); + if(filter_type != MODPNG14_FILTER_TYPE_BASE) + modpng14_error(modpng14_ptr, "Unknown filter method in IHDR"); #endif info_ptr->width = width; info_ptr->height = height; - info_ptr->bit_depth = (png_byte)bit_depth; - info_ptr->color_type =(png_byte) color_type; - info_ptr->compression_type = (png_byte)compression_type; - info_ptr->filter_type = (png_byte)filter_type; - info_ptr->interlace_type = (png_byte)interlace_type; - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + info_ptr->bit_depth = (modpng14_byte)bit_depth; + info_ptr->color_type =(modpng14_byte) color_type; + info_ptr->compression_type = (modpng14_byte)compression_type; + info_ptr->filter_type = (modpng14_byte)filter_type; + info_ptr->interlace_type = (modpng14_byte)interlace_type; + if (info_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) info_ptr->channels = 1; - else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) + else if (info_ptr->color_type & MODPNG14_COLOR_MASK_COLOR) info_ptr->channels = 3; else info_ptr->channels = 1; - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) + if (info_ptr->color_type & MODPNG14_COLOR_MASK_ALPHA) info_ptr->channels++; - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); + info_ptr->pixel_depth = (modpng14_byte)(info_ptr->channels * info_ptr->bit_depth); /* check for overflow */ rowbytes_per_pixel = (info_ptr->pixel_depth + 7) >> 3; - if ( width > PNG_MAX_UINT/rowbytes_per_pixel - 64) + if ( width > MODPNG14_MAX_UINT/rowbytes_per_pixel - 64) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Width too large to process image data; rowbytes will overflow."); - info_ptr->rowbytes = (png_size_t)0; + info_ptr->rowbytes = (modpng14_size_t)0; } else info_ptr->rowbytes = (info_ptr->width * info_ptr->pixel_depth + 7) >> 3; } -#if defined(PNG_oFFs_SUPPORTED) -void PNGAPI -png_set_oFFs(png_structp png_ptr, png_infop info_ptr, - png_int_32 offset_x, png_int_32 offset_y, int unit_type) +#if defined(MODPNG14_oFFs_SUPPORTED) +void MODPNG14API +modpng14_set_oFFs(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_int_32 offset_x, modpng14_int_32 offset_y, int unit_type) { - png_debug1(1, "in %s storage function\n", "oFFs"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "oFFs"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; info_ptr->x_offset = offset_x; info_ptr->y_offset = offset_y; - info_ptr->offset_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_oFFs; + info_ptr->offset_unit_type = (modpng14_byte)unit_type; + info_ptr->valid |= MODPNG14_INFO_oFFs; } #endif -#if defined(PNG_pCAL_SUPPORTED) -void PNGAPI -png_set_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 defined(MODPNG14_pCAL_SUPPORTED) +void MODPNG14API +modpng14_set_pCAL(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_charp purpose, modpng14_int_32 X0, modpng14_int_32 X1, int type, int nparams, + modpng14_charp units, modpng14_charpp params) { - png_uint_32 length; + modpng14_uint_32 length; int i; - png_debug1(1, "in %s storage function\n", "pCAL"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "pCAL"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - length = png_strlen(purpose) + 1; - png_debug1(3, "allocating purpose for info (%lu bytes)\n", length); - info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length); + length = modpng14_strlen(purpose) + 1; + modpng14_debug1(3, "allocating purpose for info (%lu bytes)\n", length); + info_ptr->pcal_purpose = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length); if (info_ptr->pcal_purpose == NULL) { - png_warning(png_ptr, "Insufficient memory for pCAL purpose."); + modpng14_warning(modpng14_ptr, "Insufficient memory for pCAL purpose."); return; } - png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length); + modpng14_memcpy(info_ptr->pcal_purpose, purpose, (modpng14_size_t)length); - png_debug(3, "storing X0, X1, type, and nparams in info\n"); + modpng14_debug(3, "storing X0, X1, type, and nparams in info\n"); info_ptr->pcal_X0 = X0; info_ptr->pcal_X1 = X1; - info_ptr->pcal_type = (png_byte)type; - info_ptr->pcal_nparams = (png_byte)nparams; + info_ptr->pcal_type = (modpng14_byte)type; + info_ptr->pcal_nparams = (modpng14_byte)nparams; - length = png_strlen(units) + 1; - png_debug1(3, "allocating units for info (%lu bytes)\n", length); - info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length); + length = modpng14_strlen(units) + 1; + modpng14_debug1(3, "allocating units for info (%lu bytes)\n", length); + info_ptr->pcal_units = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length); if (info_ptr->pcal_units == NULL) { - png_warning(png_ptr, "Insufficient memory for pCAL units."); + modpng14_warning(modpng14_ptr, "Insufficient memory for pCAL units."); return; } - png_memcpy(info_ptr->pcal_units, units, (png_size_t)length); + modpng14_memcpy(info_ptr->pcal_units, units, (modpng14_size_t)length); - info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr, - (png_uint_32)((nparams + 1) * sizeof(png_charp))); + info_ptr->pcal_params = (modpng14_charpp)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)((nparams + 1) * sizeof(modpng14_charp))); if (info_ptr->pcal_params == NULL) { - png_warning(png_ptr, "Insufficient memory for pCAL params."); + modpng14_warning(modpng14_ptr, "Insufficient memory for pCAL params."); return; } @@ -401,191 +401,191 @@ for (i = 0; i < nparams; i++) { - length = png_strlen(params[i]) + 1; - png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length); - info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); + length = modpng14_strlen(params[i]) + 1; + modpng14_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length); + info_ptr->pcal_params[i] = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, length); if (info_ptr->pcal_params[i] == NULL) { - png_warning(png_ptr, "Insufficient memory for pCAL parameter."); + modpng14_warning(modpng14_ptr, "Insufficient memory for pCAL parameter."); return; } - png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length); + modpng14_memcpy(info_ptr->pcal_params[i], params[i], (modpng14_size_t)length); } - info_ptr->valid |= PNG_INFO_pCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PCAL; + info_ptr->valid |= MODPNG14_INFO_pCAL; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_PCAL; #endif } #endif -#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_sCAL(png_structp png_ptr, png_infop info_ptr, +#if defined(MODPNG14_READ_sCAL_SUPPORTED) || defined(MODPNG14_WRITE_sCAL_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED +void MODPNG14API +modpng14_set_sCAL(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int unit, double width, double height) { - png_debug1(1, "in %s storage function\n", "sCAL"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "sCAL"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - info_ptr->scal_unit = (png_byte)unit; + info_ptr->scal_unit = (modpng14_byte)unit; info_ptr->scal_pixel_width = width; info_ptr->scal_pixel_height = height; - info_ptr->valid |= PNG_INFO_sCAL; + info_ptr->valid |= MODPNG14_INFO_sCAL; } #else -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, - int unit, png_charp swidth, png_charp sheight) +#ifdef MODPNG14_FIXED_POINT_SUPPORTED +void MODPNG14API +modpng14_set_sCAL_s(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + int unit, modpng14_charp swidth, modpng14_charp sheight) { - png_uint_32 length; + modpng14_uint_32 length; - png_debug1(1, "in %s storage function\n", "sCAL"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "sCAL"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - info_ptr->scal_unit = (png_byte)unit; + info_ptr->scal_unit = (modpng14_byte)unit; - length = png_strlen(swidth) + 1; - png_debug1(3, "allocating unit for info (%d bytes)\n", length); - info_ptr->scal_s_width = (png_charp)png_malloc(png_ptr, length); - png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length); + length = modpng14_strlen(swidth) + 1; + modpng14_debug1(3, "allocating unit for info (%d bytes)\n", length); + info_ptr->scal_s_width = (modpng14_charp)modpng14_malloc(modpng14_ptr, length); + modpng14_memcpy(info_ptr->scal_s_width, swidth, (modpng14_size_t)length); - length = png_strlen(sheight) + 1; - png_debug1(3, "allocating unit for info (%d bytes)\n", length); - info_ptr->scal_s_height = (png_charp)png_malloc(png_ptr, length); - png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length); + length = modpng14_strlen(sheight) + 1; + modpng14_debug1(3, "allocating unit for info (%d bytes)\n", length); + info_ptr->scal_s_height = (modpng14_charp)modpng14_malloc(modpng14_ptr, length); + modpng14_memcpy(info_ptr->scal_s_height, sheight, (modpng14_size_t)length); - info_ptr->valid |= PNG_INFO_sCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_SCAL; + info_ptr->valid |= MODPNG14_INFO_sCAL; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_SCAL; #endif } #endif #endif #endif -#if defined(PNG_pHYs_SUPPORTED) -void PNGAPI -png_set_pHYs(png_structp png_ptr, png_infop info_ptr, - png_uint_32 res_x, png_uint_32 res_y, int unit_type) +#if defined(MODPNG14_pHYs_SUPPORTED) +void MODPNG14API +modpng14_set_pHYs(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_uint_32 res_x, modpng14_uint_32 res_y, int unit_type) { - png_debug1(1, "in %s storage function\n", "pHYs"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "pHYs"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; info_ptr->x_pixels_per_unit = res_x; info_ptr->y_pixels_per_unit = res_y; - info_ptr->phys_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_pHYs; + info_ptr->phys_unit_type = (modpng14_byte)unit_type; + info_ptr->valid |= MODPNG14_INFO_pHYs; } #endif -void PNGAPI -png_set_PLTE(png_structp png_ptr, png_infop info_ptr, - png_colorp palette, int num_palette) +void MODPNG14API +modpng14_set_PLTE(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_colorp palette, int num_palette) { - png_debug1(1, "in %s storage function\n", "PLTE"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "PLTE"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; /* - * It may not actually be necessary to set png_ptr->palette here; - * we do it for backward compatibility with the way the png_handle_tRNS + * It may not actually be necessary to set modpng14_ptr->palette here; + * we do it for backward compatibility with the way the modpng14_handle_tRNS * function used to do the allocation. */ -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0); +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_PLTE, 0); #endif - /* Changed in libpng-1.2.1 to allocate 256 instead of num_palette entries, + /* Changed in libmodpng14-1.2.1 to allocate 256 instead of num_palette entries, in case of an invalid PNG file that has too-large sample values. */ - png_ptr->palette = (png_colorp)png_zalloc(png_ptr, (uInt)256, - sizeof (png_color)); - if (png_ptr->palette == NULL) - png_error(png_ptr, "Unable to malloc palette"); - png_memcpy(png_ptr->palette, palette, num_palette * sizeof (png_color)); - info_ptr->palette = png_ptr->palette; - info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette; + modpng14_ptr->palette = (modpng14_colorp)modpng14_zalloc(modpng14_ptr, (uInt)256, + sizeof (modpng14_color)); + if (modpng14_ptr->palette == NULL) + modpng14_error(modpng14_ptr, "Unable to malloc palette"); + modpng14_memcpy(modpng14_ptr->palette, palette, num_palette * sizeof (modpng14_color)); + info_ptr->palette = modpng14_ptr->palette; + info_ptr->num_palette = modpng14_ptr->num_palette = (modpng14_uint_16)num_palette; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PLTE; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_PLTE; #else - png_ptr->flags |= PNG_FLAG_FREE_PLTE; + modpng14_ptr->flags |= MODPNG14_FLAG_FREE_PLTE; #endif - info_ptr->valid |= PNG_INFO_PLTE; + info_ptr->valid |= MODPNG14_INFO_PLTE; } -#if defined(PNG_sBIT_SUPPORTED) -void PNGAPI -png_set_sBIT(png_structp png_ptr, png_infop info_ptr, - png_color_8p sig_bit) +#if defined(MODPNG14_sBIT_SUPPORTED) +void MODPNG14API +modpng14_set_sBIT(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_color_8p sig_bit) { - png_debug1(1, "in %s storage function\n", "sBIT"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "sBIT"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - png_memcpy(&(info_ptr->sig_bit), sig_bit, sizeof (png_color_8)); - info_ptr->valid |= PNG_INFO_sBIT; + modpng14_memcpy(&(info_ptr->sig_bit), sig_bit, sizeof (modpng14_color_8)); + info_ptr->valid |= MODPNG14_INFO_sBIT; } #endif -#if defined(PNG_sRGB_SUPPORTED) -void PNGAPI -png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) +#if defined(MODPNG14_sRGB_SUPPORTED) +void MODPNG14API +modpng14_set_sRGB(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int intent) { - png_debug1(1, "in %s storage function\n", "sRGB"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "sRGB"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - info_ptr->srgb_intent = (png_byte)intent; - info_ptr->valid |= PNG_INFO_sRGB; + info_ptr->srgb_intent = (modpng14_byte)intent; + info_ptr->valid |= MODPNG14_INFO_sRGB; } -void PNGAPI -png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, +void MODPNG14API +modpng14_set_sRGB_gAMA_and_cHRM(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int intent) { -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED +#if defined(MODPNG14_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED float file_gamma; #endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_fixed_point int_file_gamma; +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_fixed_point int_file_gamma; #endif #endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED +#if defined(MODPNG14_cHRM_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; #endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y; #endif #endif - png_debug1(1, "in %s storage function\n", "sRGB_gAMA_and_cHRM"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "sRGB_gAMA_and_cHRM"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; - png_set_sRGB(png_ptr, info_ptr, intent); + modpng14_set_sRGB(modpng14_ptr, info_ptr, intent); -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED +#if defined(MODPNG14_gAMA_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED file_gamma = (float).45455; - png_set_gAMA(png_ptr, info_ptr, file_gamma); + modpng14_set_gAMA(modpng14_ptr, info_ptr, file_gamma); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED int_file_gamma = 45455L; - png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma); + modpng14_set_gAMA_fixed(modpng14_ptr, info_ptr, int_file_gamma); #endif #endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FIXED_POINT_SUPPORTED +#if defined(MODPNG14_cHRM_SUPPORTED) +#ifdef MODPNG14_FIXED_POINT_SUPPORTED int_white_x = 31270L; int_white_y = 32900L; int_red_x = 64000L; @@ -595,11 +595,11 @@ int_blue_x = 15000L; int_blue_y = 6000L; - png_set_cHRM_fixed(png_ptr, info_ptr, + modpng14_set_cHRM_fixed(modpng14_ptr, info_ptr, int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y); #endif -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED white_x = (float).3127; white_y = (float).3290; red_x = (float).64; @@ -609,7 +609,7 @@ blue_x = (float).15; blue_y = (float).06; - png_set_cHRM(png_ptr, info_ptr, + modpng14_set_cHRM(modpng14_ptr, info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); #endif #endif @@ -617,60 +617,60 @@ #endif -#if defined(PNG_iCCP_SUPPORTED) -void PNGAPI -png_set_iCCP(png_structp png_ptr, png_infop info_ptr, - png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen) +#if defined(MODPNG14_iCCP_SUPPORTED) +void MODPNG14API +modpng14_set_iCCP(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_charp name, int compression_type, + modpng14_charp profile, modpng14_uint_32 proflen) { - png_charp new_iccp_name; - png_charp new_iccp_profile; + modpng14_charp new_iccp_name; + modpng14_charp new_iccp_profile; - png_debug1(1, "in %s storage function\n", "iCCP"); - if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) + modpng14_debug1(1, "in %s storage function\n", "iCCP"); + if (modpng14_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) return; - new_iccp_name = (png_charp)png_malloc(png_ptr, png_strlen(name)+1); - png_strcpy(new_iccp_name, name); - new_iccp_profile = (png_charp)png_malloc(png_ptr, proflen); - png_memcpy(new_iccp_profile, profile, (png_size_t)proflen); + new_iccp_name = (modpng14_charp)modpng14_malloc(modpng14_ptr, modpng14_strlen(name)+1); + modpng14_strcpy(new_iccp_name, name); + new_iccp_profile = (modpng14_charp)modpng14_malloc(modpng14_ptr, proflen); + modpng14_memcpy(new_iccp_profile, profile, (modpng14_size_t)proflen); - png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_ICCP, 0); info_ptr->iccp_proflen = proflen; info_ptr->iccp_name = new_iccp_name; info_ptr->iccp_profile = new_iccp_profile; /* Compression is always zero but is here so the API and info structure * does not have to change if we introduce multiple compression types */ - info_ptr->iccp_compression = (png_byte)compression_type; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_ICCP; + info_ptr->iccp_compression = (modpng14_byte)compression_type; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_ICCP; #endif - info_ptr->valid |= PNG_INFO_iCCP; + info_ptr->valid |= MODPNG14_INFO_iCCP; } #endif -#if defined(PNG_TEXT_SUPPORTED) -void PNGAPI -png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, +#if defined(MODPNG14_TEXT_SUPPORTED) +void MODPNG14API +modpng14_set_text(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_textp text_ptr, int num_text) { int ret; - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, num_text); + ret=modpng14_set_text_2(modpng14_ptr, info_ptr, text_ptr, num_text); if (ret) - png_error(png_ptr, "Insufficient memory to store text"); + modpng14_error(modpng14_ptr, "Insufficient memory to store text"); } int /* PRIVATE */ -png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, +modpng14_set_text_2(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_textp text_ptr, int num_text) { int i; - png_debug1(1, "in %s storage function\n", (png_ptr->chunk_name[0] == '\0' ? - "text" : (png_const_charp)png_ptr->chunk_name)); + modpng14_debug1(1, "in %s storage function\n", (modpng14_ptr->chunk_name[0] == '\0' ? + "text" : (modpng14_const_charp)modpng14_ptr->chunk_name)); - if (png_ptr == NULL || info_ptr == NULL || num_text == 0) + if (modpng14_ptr == NULL || info_ptr == NULL || num_text == 0) return(0); /* Make sure we have enough space in the "text" array in info_struct @@ -680,48 +680,48 @@ { if (info_ptr->text != NULL) { - png_textp old_text; + modpng14_textp old_text; int old_max; old_max = info_ptr->max_text; info_ptr->max_text = info_ptr->num_text + num_text + 8; old_text = info_ptr->text; - info_ptr->text = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)(info_ptr->max_text * sizeof (png_text))); + info_ptr->text = (modpng14_textp)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)(info_ptr->max_text * sizeof (modpng14_text))); if (info_ptr->text == NULL) { - png_free(png_ptr, old_text); + modpng14_free(modpng14_ptr, old_text); return(1); } - png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max * - sizeof(png_text))); - png_free(png_ptr, old_text); + modpng14_memcpy(info_ptr->text, old_text, (modpng14_size_t)(old_max * + sizeof(modpng14_text))); + modpng14_free(modpng14_ptr, old_text); } else { info_ptr->max_text = num_text + 8; info_ptr->num_text = 0; - info_ptr->text = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)(info_ptr->max_text * sizeof (png_text))); + info_ptr->text = (modpng14_textp)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)(info_ptr->max_text * sizeof (modpng14_text))); if (info_ptr->text == NULL) return(1); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_TEXT; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_TEXT; #endif } - png_debug1(3, "allocated %d entries for info_ptr->text\n", + modpng14_debug1(3, "allocated %d entries for info_ptr->text\n", info_ptr->max_text); } for (i = 0; i < num_text; i++) { - png_size_t text_length,key_len; - png_size_t lang_len,lang_key_len; - png_textp textp = &(info_ptr->text[info_ptr->num_text]); + modpng14_size_t text_length,key_len; + modpng14_size_t lang_len,lang_key_len; + modpng14_textp textp = &(info_ptr->text[info_ptr->num_text]); if (text_ptr[i].key == NULL) continue; - key_len = png_strlen(text_ptr[i].key); + key_len = modpng14_strlen(text_ptr[i].key); if(text_ptr[i].compression <= 0) { @@ -729,21 +729,21 @@ lang_key_len = 0; } else -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED { /* set iTXt data */ if (text_ptr[i].lang != NULL) - lang_len = png_strlen(text_ptr[i].lang); + lang_len = modpng14_strlen(text_ptr[i].lang); else lang_len = 0; if (text_ptr[i].lang_key != NULL) - lang_key_len = png_strlen(text_ptr[i].lang_key); + lang_key_len = modpng14_strlen(text_ptr[i].lang_key); else lang_key_len = 0; } #else { - png_warning(png_ptr, "iTXt chunk not supported."); + modpng14_warning(modpng14_ptr, "iTXt chunk not supported."); continue; } #endif @@ -751,56 +751,56 @@ if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0') { text_length = 0; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED if(text_ptr[i].compression > 0) - textp->compression = PNG_ITXT_COMPRESSION_NONE; + textp->compression = MODPNG14_ITXT_COMPRESSION_NONE; else #endif - textp->compression = PNG_TEXT_COMPRESSION_NONE; + textp->compression = MODPNG14_TEXT_COMPRESSION_NONE; } else { - text_length = png_strlen(text_ptr[i].text); + text_length = modpng14_strlen(text_ptr[i].text); textp->compression = text_ptr[i].compression; } - textp->key = (png_charp)png_malloc_warn(png_ptr, - (png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4)); + textp->key = (modpng14_charp)modpng14_malloc_warn(modpng14_ptr, + (modpng14_uint_32)(key_len + text_length + lang_len + lang_key_len + 4)); if (textp->key == NULL) return(1); - png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n", - (png_uint_32)(key_len + lang_len + lang_key_len + text_length + 4), + modpng14_debug2(2, "Allocated %lu bytes at %x in modpng14_set_text\n", + (modpng14_uint_32)(key_len + lang_len + lang_key_len + text_length + 4), (int)textp->key); - png_memcpy(textp->key, text_ptr[i].key, - (png_size_t)(key_len)); + modpng14_memcpy(textp->key, text_ptr[i].key, + (modpng14_size_t)(key_len)); *(textp->key+key_len) = '\0'; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED if (text_ptr[i].compression > 0) { textp->lang=textp->key + key_len + 1; - png_memcpy(textp->lang, text_ptr[i].lang, lang_len); + modpng14_memcpy(textp->lang, text_ptr[i].lang, lang_len); *(textp->lang+lang_len) = '\0'; textp->lang_key=textp->lang + lang_len + 1; - png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); + modpng14_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); *(textp->lang_key+lang_key_len) = '\0'; textp->text=textp->lang_key + lang_key_len + 1; } else #endif { -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED textp->lang=NULL; textp->lang_key=NULL; #endif textp->text=textp->key + key_len + 1; } if(text_length) - png_memcpy(textp->text, text_ptr[i].text, - (png_size_t)(text_length)); + modpng14_memcpy(textp->text, text_ptr[i].text, + (modpng14_size_t)(text_length)); *(textp->text+text_length) = '\0'; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED if(textp->compression > 0) { textp->text_length = 0; @@ -810,353 +810,353 @@ #endif { textp->text_length = text_length; -#ifdef PNG_iTXt_SUPPORTED +#ifdef MODPNG14_iTXt_SUPPORTED textp->itxt_length = 0; #endif } info_ptr->text[info_ptr->num_text]= *textp; info_ptr->num_text++; - png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text); + modpng14_debug1(3, "transferred text chunk %d\n", info_ptr->num_text); } return(0); } #endif -#if defined(PNG_tIME_SUPPORTED) -void PNGAPI -png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) +#if defined(MODPNG14_tIME_SUPPORTED) +void MODPNG14API +modpng14_set_tIME(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_timep mod_time) { - png_debug1(1, "in %s storage function\n", "tIME"); - if (png_ptr == NULL || info_ptr == NULL || - (png_ptr->mode & PNG_WROTE_tIME)) + modpng14_debug1(1, "in %s storage function\n", "tIME"); + if (modpng14_ptr == NULL || info_ptr == NULL || + (modpng14_ptr->mode & MODPNG14_WROTE_tIME)) return; - png_memcpy(&(info_ptr->mod_time), mod_time, sizeof (png_time)); - info_ptr->valid |= PNG_INFO_tIME; + modpng14_memcpy(&(info_ptr->mod_time), mod_time, sizeof (modpng14_time)); + info_ptr->valid |= MODPNG14_INFO_tIME; } #endif -#if defined(PNG_tRNS_SUPPORTED) -void PNGAPI -png_set_tRNS(png_structp png_ptr, png_infop info_ptr, - png_bytep trans, int num_trans, png_color_16p trans_values) +#if defined(MODPNG14_tRNS_SUPPORTED) +void MODPNG14API +modpng14_set_tRNS(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, + modpng14_bytep trans, int num_trans, modpng14_color_16p trans_values) { - png_debug1(1, "in %s storage function\n", "tRNS"); - if (png_ptr == NULL || info_ptr == NULL) + modpng14_debug1(1, "in %s storage function\n", "tRNS"); + if (modpng14_ptr == NULL || info_ptr == NULL) return; if (trans != NULL) { /* - * It may not actually be necessary to set png_ptr->trans here; - * we do it for backward compatibility with the way the png_handle_tRNS + * It may not actually be necessary to set modpng14_ptr->trans here; + * we do it for backward compatibility with the way the modpng14_handle_tRNS * function used to do the allocation. */ -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0); +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_TRNS, 0); #endif /* Changed from num_trans to 256 in version 1.2.1 */ - png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_TRNS; + modpng14_ptr->trans = info_ptr->trans = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)256); + modpng14_memcpy(info_ptr->trans, trans, (modpng14_size_t)num_trans); +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_TRNS; #else - png_ptr->flags |= PNG_FLAG_FREE_TRNS; + modpng14_ptr->flags |= MODPNG14_FLAG_FREE_TRNS; #endif } if (trans_values != NULL) { - png_memcpy(&(info_ptr->trans_values), trans_values, - sizeof(png_color_16)); + modpng14_memcpy(&(info_ptr->trans_values), trans_values, + sizeof(modpng14_color_16)); if (num_trans == 0) num_trans = 1; } - info_ptr->num_trans = (png_uint_16)num_trans; - info_ptr->valid |= PNG_INFO_tRNS; + info_ptr->num_trans = (modpng14_uint_16)num_trans; + info_ptr->valid |= MODPNG14_INFO_tRNS; } #endif -#if defined(PNG_sPLT_SUPPORTED) -void PNGAPI -png_set_sPLT(png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries) +#if defined(MODPNG14_sPLT_SUPPORTED) +void MODPNG14API +modpng14_set_sPLT(modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_sPLT_tp entries, int nentries) { - png_sPLT_tp np; + modpng14_sPLT_tp np; int i; - np = (png_sPLT_tp)png_malloc_warn(png_ptr, - (info_ptr->splt_palettes_num + nentries) * sizeof(png_sPLT_t)); + np = (modpng14_sPLT_tp)modpng14_malloc_warn(modpng14_ptr, + (info_ptr->splt_palettes_num + nentries) * sizeof(modpng14_sPLT_t)); if (np == NULL) { - png_warning(png_ptr, "No memory for sPLT palettes."); + modpng14_warning(modpng14_ptr, "No memory for sPLT palettes."); return; } - png_memcpy(np, info_ptr->splt_palettes, - info_ptr->splt_palettes_num * sizeof(png_sPLT_t)); - png_free(png_ptr, info_ptr->splt_palettes); + modpng14_memcpy(np, info_ptr->splt_palettes, + info_ptr->splt_palettes_num * sizeof(modpng14_sPLT_t)); + modpng14_free(modpng14_ptr, info_ptr->splt_palettes); info_ptr->splt_palettes=NULL; for (i = 0; i < nentries; i++) { - png_sPLT_tp to = np + info_ptr->splt_palettes_num + i; - png_sPLT_tp from = entries + i; + modpng14_sPLT_tp to = np + info_ptr->splt_palettes_num + i; + modpng14_sPLT_tp from = entries + i; - to->name = (png_charp)png_malloc(png_ptr, - png_strlen(from->name) + 1); - png_strcpy(to->name, from->name); - to->entries = (png_sPLT_entryp)png_malloc(png_ptr, - from->nentries * sizeof(png_sPLT_entry)); - png_memcpy(to->entries, from->entries, - from->nentries * sizeof(png_sPLT_entry)); + to->name = (modpng14_charp)modpng14_malloc(modpng14_ptr, + modpng14_strlen(from->name) + 1); + modpng14_strcpy(to->name, from->name); + to->entries = (modpng14_sPLT_entryp)modpng14_malloc(modpng14_ptr, + from->nentries * sizeof(modpng14_sPLT_entry)); + modpng14_memcpy(to->entries, from->entries, + from->nentries * sizeof(modpng14_sPLT_entry)); to->nentries = from->nentries; to->depth = from->depth; } info_ptr->splt_palettes = np; info_ptr->splt_palettes_num += nentries; - info_ptr->valid |= PNG_INFO_sPLT; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_SPLT; + info_ptr->valid |= MODPNG14_INFO_sPLT; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_SPLT; #endif } -#endif /* PNG_sPLT_SUPPORTED */ +#endif /* MODPNG14_sPLT_SUPPORTED */ -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -void PNGAPI -png_set_unknown_chunks(png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) +void MODPNG14API +modpng14_set_unknown_chunks(modpng14_structp modpng14_ptr, + modpng14_infop info_ptr, modpng14_unknown_chunkp unknowns, int num_unknowns) { - png_unknown_chunkp np; + modpng14_unknown_chunkp np; int i; - if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0) + if (modpng14_ptr == NULL || info_ptr == NULL || num_unknowns == 0) return; - np = (png_unknown_chunkp)png_malloc_warn(png_ptr, + np = (modpng14_unknown_chunkp)modpng14_malloc_warn(modpng14_ptr, (info_ptr->unknown_chunks_num + num_unknowns) * - sizeof(png_unknown_chunk)); + sizeof(modpng14_unknown_chunk)); if (np == NULL) { - png_warning(png_ptr, "Out of memory while processing unknown chunk."); + modpng14_warning(modpng14_ptr, "Out of memory while processing unknown chunk."); return; } - png_memcpy(np, info_ptr->unknown_chunks, - info_ptr->unknown_chunks_num * sizeof(png_unknown_chunk)); - png_free(png_ptr, info_ptr->unknown_chunks); + modpng14_memcpy(np, info_ptr->unknown_chunks, + info_ptr->unknown_chunks_num * sizeof(modpng14_unknown_chunk)); + modpng14_free(modpng14_ptr, info_ptr->unknown_chunks); info_ptr->unknown_chunks=NULL; for (i = 0; i < num_unknowns; i++) { - png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i; - png_unknown_chunkp from = unknowns + i; + modpng14_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i; + modpng14_unknown_chunkp from = unknowns + i; - png_strcpy((png_charp)to->name, (png_charp)from->name); - to->data = (png_bytep)png_malloc(png_ptr, from->size); + modpng14_strcpy((modpng14_charp)to->name, (modpng14_charp)from->name); + to->data = (modpng14_bytep)modpng14_malloc(modpng14_ptr, from->size); if (to->data == NULL) - png_warning(png_ptr, "Out of memory while processing unknown chunk."); + modpng14_warning(modpng14_ptr, "Out of memory while processing unknown chunk."); else { - png_memcpy(to->data, from->data, from->size); + modpng14_memcpy(to->data, from->data, from->size); to->size = from->size; /* note our location in the read or write sequence */ - to->location = (png_byte)(png_ptr->mode & 0xff); + to->location = (modpng14_byte)(modpng14_ptr->mode & 0xff); } } info_ptr->unknown_chunks = np; info_ptr->unknown_chunks_num += num_unknowns; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_UNKN; +#ifdef MODPNG14_FREE_ME_SUPPORTED + info_ptr->free_me |= MODPNG14_FREE_UNKN; #endif } -void PNGAPI -png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr, +void MODPNG14API +modpng14_set_unknown_chunk_location(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int chunk, int location) { - if(png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk < + if(modpng14_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk < (int)info_ptr->unknown_chunks_num) - info_ptr->unknown_chunks[chunk].location = (png_byte)location; + info_ptr->unknown_chunks[chunk].location = (modpng14_byte)location; } #endif -#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -void PNGAPI -png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted) +#if defined(MODPNG14_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(MODPNG14_WRITE_EMPTY_PLTE_SUPPORTED) +void MODPNG14API +modpng14_permit_empty_plte (modpng14_structp modpng14_ptr, int empty_plte_permitted) { - /* This function is deprecated in favor of png_permit_mng_features() - and will be removed from libpng-2.0.0 */ - png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n"); - if (png_ptr == NULL) + /* This function is deprecated in favor of modpng14_permit_mng_features() + and will be removed from libmodpng14-2.0.0 */ + modpng14_debug(1, "in modpng14_permit_empty_plte, DEPRECATED.\n"); + if (modpng14_ptr == NULL) return; - png_ptr->mng_features_permitted = (png_byte) - ((png_ptr->mng_features_permitted & (~(PNG_FLAG_MNG_EMPTY_PLTE))) | - ((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE))); + modpng14_ptr->mng_features_permitted = (modpng14_byte) + ((modpng14_ptr->mng_features_permitted & (~(MODPNG14_FLAG_MNG_EMPTY_PLTE))) | + ((empty_plte_permitted & MODPNG14_FLAG_MNG_EMPTY_PLTE))); } #endif -#if defined(PNG_MNG_FEATURES_SUPPORTED) -png_uint_32 PNGAPI -png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) +modpng14_uint_32 MODPNG14API +modpng14_permit_mng_features (modpng14_structp modpng14_ptr, modpng14_uint_32 mng_features) { - png_debug(1, "in png_permit_mng_features\n"); - if (png_ptr == NULL) - return (png_uint_32)0; - png_ptr->mng_features_permitted = - (png_byte)(mng_features & PNG_ALL_MNG_FEATURES); - return (png_uint_32)png_ptr->mng_features_permitted; + modpng14_debug(1, "in modpng14_permit_mng_features\n"); + if (modpng14_ptr == NULL) + return (modpng14_uint_32)0; + modpng14_ptr->mng_features_permitted = + (modpng14_byte)(mng_features & MODPNG14_ALL_MNG_FEATURES); + return (modpng14_uint_32)modpng14_ptr->mng_features_permitted; } #endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -void PNGAPI -png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) +void MODPNG14API +modpng14_set_keep_unknown_chunks(modpng14_structp modpng14_ptr, int keep, modpng14_bytep chunk_list, int num_chunks) { - png_bytep new_list, p; + modpng14_bytep new_list, p; int i, old_num_chunks; if (num_chunks == 0) { if(keep == HANDLE_CHUNK_ALWAYS || keep == HANDLE_CHUNK_IF_SAFE) - png_ptr->flags |= PNG_FLAG_KEEP_UNKNOWN_CHUNKS; + modpng14_ptr->flags |= MODPNG14_FLAG_KEEP_UNKNOWN_CHUNKS; else - png_ptr->flags &= ~PNG_FLAG_KEEP_UNKNOWN_CHUNKS; + modpng14_ptr->flags &= ~MODPNG14_FLAG_KEEP_UNKNOWN_CHUNKS; if(keep == HANDLE_CHUNK_ALWAYS) - png_ptr->flags |= PNG_FLAG_KEEP_UNSAFE_CHUNKS; + modpng14_ptr->flags |= MODPNG14_FLAG_KEEP_UNSAFE_CHUNKS; else - png_ptr->flags &= ~PNG_FLAG_KEEP_UNSAFE_CHUNKS; + modpng14_ptr->flags &= ~MODPNG14_FLAG_KEEP_UNSAFE_CHUNKS; return; } if (chunk_list == NULL) return; - old_num_chunks=png_ptr->num_chunk_list; - new_list=(png_bytep)png_malloc(png_ptr, - (png_uint_32)(5*(num_chunks+old_num_chunks))); - if(png_ptr->chunk_list != NULL) + old_num_chunks=modpng14_ptr->num_chunk_list; + new_list=(modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(5*(num_chunks+old_num_chunks))); + if(modpng14_ptr->chunk_list != NULL) { - png_memcpy(new_list, png_ptr->chunk_list, - (png_size_t)(5*old_num_chunks)); - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; + modpng14_memcpy(new_list, modpng14_ptr->chunk_list, + (modpng14_size_t)(5*old_num_chunks)); + modpng14_free(modpng14_ptr, modpng14_ptr->chunk_list); + modpng14_ptr->chunk_list=NULL; } - png_memcpy(new_list+5*old_num_chunks, chunk_list, - (png_size_t)(5*num_chunks)); + modpng14_memcpy(new_list+5*old_num_chunks, chunk_list, + (modpng14_size_t)(5*num_chunks)); for (p=new_list+5*old_num_chunks+4, i=0; inum_chunk_list=old_num_chunks+num_chunks; - png_ptr->chunk_list=new_list; -#ifdef PNG_FREE_ME_SUPPORTED - png_ptr->free_me |= PNG_FREE_LIST; + *p=(modpng14_byte)keep; + modpng14_ptr->num_chunk_list=old_num_chunks+num_chunks; + modpng14_ptr->chunk_list=new_list; +#ifdef MODPNG14_FREE_ME_SUPPORTED + modpng14_ptr->free_me |= MODPNG14_FREE_LIST; #endif } #endif -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) -void PNGAPI -png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, - png_user_chunk_ptr read_user_chunk_fn) +#if defined(MODPNG14_READ_USER_CHUNKS_SUPPORTED) +void MODPNG14API +modpng14_set_read_user_chunk_fn(modpng14_structp modpng14_ptr, modpng14_voidp user_chunk_ptr, + modpng14_user_chunk_ptr read_user_chunk_fn) { - png_debug(1, "in png_set_read_user_chunk_fn\n"); - png_ptr->read_user_chunk_fn = read_user_chunk_fn; - png_ptr->user_chunk_ptr = user_chunk_ptr; + modpng14_debug(1, "in modpng14_set_read_user_chunk_fn\n"); + modpng14_ptr->read_user_chunk_fn = read_user_chunk_fn; + modpng14_ptr->user_chunk_ptr = user_chunk_ptr; } #endif -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) +#if defined(MODPNG14_INFO_IMAGE_SUPPORTED) +void MODPNG14API +modpng14_set_rows(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, modpng14_bytepp row_pointers) { - png_debug1(1, "in %s storage function\n", "rows"); + modpng14_debug1(1, "in %s storage function\n", "rows"); - if (png_ptr == NULL || info_ptr == NULL) + if (modpng14_ptr == NULL || info_ptr == NULL) return; if(info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers)) - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_ROWS, 0); info_ptr->row_pointers = row_pointers; if(row_pointers) - info_ptr->valid |= PNG_INFO_IDAT; + info_ptr->valid |= MODPNG14_INFO_IDAT; } #endif -void PNGAPI -png_set_compression_buffer_size(png_structp png_ptr, png_uint_32 size) +void MODPNG14API +modpng14_set_compression_buffer_size(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - if(png_ptr->zbuf) - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf_size = (png_size_t)size; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + if(modpng14_ptr->zbuf) + modpng14_free(modpng14_ptr, modpng14_ptr->zbuf); + modpng14_ptr->zbuf_size = (modpng14_size_t)size; + modpng14_ptr->zbuf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, size); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; } -void PNGAPI -png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask) +void MODPNG14API +modpng14_set_invalid(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int mask) { - if (png_ptr && info_ptr) + if (modpng14_ptr && info_ptr) info_ptr->valid &= ~(mask); } -#ifndef PNG_1_0_X -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* this function was added to libpng 1.2.0 and should always exist by default */ -void PNGAPI -png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) +#ifndef MODPNG14_1_0_X +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED +/* this function was added to libmodpng14 1.2.0 and should always exist by default */ +void MODPNG14API +modpng14_set_asm_flags (modpng14_structp modpng14_ptr, modpng14_uint_32 asm_flags) { - png_uint_32 settable_asm_flags; - png_uint_32 settable_mmx_flags; + modpng14_uint_32 settable_asm_flags; + modpng14_uint_32 settable_mmx_flags; settable_mmx_flags = -#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | +#ifdef MODPNG14_HAVE_ASSEMBLER_COMBINE_ROW + MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW | #endif -#ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE - PNG_ASM_FLAG_MMX_READ_INTERLACE | +#ifdef MODPNG14_HAVE_ASSEMBLER_READ_INTERLACE + MODPNG14_ASM_FLAG_MMX_READ_INTERLACE | #endif -#ifdef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW - 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 | +#ifdef MODPNG14_HAVE_ASSEMBLER_READ_FILTER_ROW + MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG | + MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH | #endif 0; /* could be some non-MMX ones in the future, but not currently: */ settable_asm_flags = settable_mmx_flags; - if (!(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_COMPILED) || - !(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU)) + if (!(modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_SUPPORT_COMPILED) || + !(modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_SUPPORT_IN_CPU)) { /* clear all MMX flags if MMX isn't supported */ settable_asm_flags &= ~settable_mmx_flags; - png_ptr->asm_flags &= ~settable_mmx_flags; + modpng14_ptr->asm_flags &= ~settable_mmx_flags; } /* we're replacing the settable bits with those passed in by the user, * so first zero them out of the master copy, then logical-OR in the * allowed subset that was requested */ - png_ptr->asm_flags &= ~settable_asm_flags; /* zero them */ - png_ptr->asm_flags |= (asm_flags & settable_asm_flags); /* set them */ + modpng14_ptr->asm_flags &= ~settable_asm_flags; /* zero them */ + modpng14_ptr->asm_flags |= (asm_flags & settable_asm_flags); /* set them */ } -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* ?MODPNG14_ASSEMBLER_CODE_SUPPORTED */ -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* this function was added to libpng 1.2.0 */ -void PNGAPI -png_set_mmx_thresholds (png_structp png_ptr, - png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold) +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED +/* this function was added to libmodpng14 1.2.0 */ +void MODPNG14API +modpng14_set_mmx_thresholds (modpng14_structp modpng14_ptr, + modpng14_byte mmx_bitdepth_threshold, + modpng14_uint_32 mmx_rowbytes_threshold) { - png_ptr->mmx_bitdepth_threshold = mmx_bitdepth_threshold; - png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold; + modpng14_ptr->mmx_bitdepth_threshold = mmx_bitdepth_threshold; + modpng14_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold; } -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ -#endif /* ?PNG_1_0_X */ +#endif /* ?MODPNG14_ASSEMBLER_CODE_SUPPORTED */ +#endif /* ?MODPNG14_1_0_X */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngtest.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngtest.c @@ -1,8 +1,8 @@ -/* pngtest.c - a simple test program to test libpng +/* pngtest.c - a simple test program to test libmodpng14 * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -15,11 +15,11 @@ * * The program will report "FAIL" in certain legitimate cases: * 1) when the compression level or filter selection method is changed. - * 2) when the maximum IDAT size (PNG_ZBUF_SIZE in pngconf.h) is not 8192. + * 2) when the maximum IDAT size (MODPNG14_ZBUF_SIZE in modpng14conf.h) is not 8192. * 3) unknown unsafe-to-copy ancillary chunks or unknown critical chunks * exist in the input file. * 4) others not listed here... - * In these cases, it is best to check with another tool such as "pngcheck" + * In these cases, it is best to check with another tool such as "modpng14.heck" * to see what the differences between the two files are. * * If a filename is given on the command-line, then this file is used @@ -44,26 +44,26 @@ # include # include # define READFILE(file, data, length, check) \ - check=(png_size_t)fread(data,(png_size_t)1,length,file) + check=(modpng14_size_t)fread(data,(modpng14_size_t)1,length,file) # define WRITEFILE(file, data, length, check) \ - check=(png_size_t)fwrite(data,(png_size_t)1, length, file) + check=(modpng14_size_t)fwrite(data,(modpng14_size_t)1, length, file) # define FCLOSE(file) fclose(file) #endif -#if defined(PNG_NO_STDIO) +#if defined(MODPNG14_NO_STDIO) # if defined(_WIN32_WCE) - typedef HANDLE png_FILE_p; + typedef HANDLE modpng14_FILE_p; # else - typedef FILE * png_FILE_p; + typedef FILE * modpng14_FILE_p; # endif #endif -/* Makes pngtest verbose so we can find problems (needs to be before png.h) */ -#ifndef PNG_DEBUG -# define PNG_DEBUG 0 +/* Makes pngtest verbose so we can find problems (needs to be before modpng14.h) */ +#ifndef MODPNG14_DEBUG +# define MODPNG14_DEBUG 0 #endif -#if !PNG_DEBUG +#if !MODPNG14_DEBUG # define SINGLE_ROWBUF_ALLOC /* makes buffer overruns easier to nail */ #endif @@ -71,7 +71,7 @@ #define PNGTEST_TIMING */ -#ifdef PNG_NO_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_NO_FLOATING_POINT_SUPPORTED #undef PNGTEST_TIMING #endif @@ -80,28 +80,28 @@ #include #endif -#include "png.h" +#include "modpng14.h" -/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */ -#ifndef png_jmpbuf -# define png_jmpbuf(png_ptr) png_ptr->jmpbuf +/* Define modpng14_jmpbuf() in case we are using a pre-1.0.6 version of libmodpng14 */ +#ifndef modpng14_jmpbuf +# define modpng14_jmpbuf(modpng14_ptr) modpng14_ptr->jmpbuf #endif #ifdef PNGTEST_TIMING static float t_start, t_stop, t_decode, t_encode, t_misc; -#if !defined(PNG_tIME_SUPPORTED) +#if !defined(MODPNG14_tIME_SUPPORTED) #include #endif #endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) static int tIME_chunk_present=0; static char tIME_string[30] = "no tIME chunk present in file"; #endif static int verbose = 0; -int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname)); +int test_one_file PNGARG((MODPNG14_CONST char *inname, MODPNG14_CONST char *outname)); #ifdef __TURBOC__ #include @@ -117,17 +117,17 @@ static int status_dots=1; void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); +read_row_callback(modpng14_structp modpng14_ptr, modpng14_uint_32 row_number, int pass); void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) +read_row_callback(modpng14_structp modpng14_ptr, modpng14_uint_32 row_number, int pass) { - if(png_ptr == NULL || row_number > PNG_MAX_UINT) return; + if(modpng14_ptr == NULL || row_number > MODPNG14_MAX_UINT) return; if(status_pass != pass) { fprintf(stdout,"\n Pass %d: ",pass); @@ -144,69 +144,69 @@ } void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); +write_row_callback(modpng14_structp modpng14_ptr, modpng14_uint_32 row_number, int pass); void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) +write_row_callback(modpng14_structp modpng14_ptr, modpng14_uint_32 row_number, int pass) { - if(png_ptr == NULL || row_number > PNG_MAX_UINT || pass > 7) return; + if(modpng14_ptr == NULL || row_number > MODPNG14_MAX_UINT || pass > 7) return; fprintf(stdout, "w"); } -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) /* Example of using user transform callback (we don't transform anything, but merely examine the row filters. We set this to 256 rather than 5 in case illegal filter values are present.) */ -static png_uint_32 filters_used[256]; +static modpng14_uint_32 filters_used[256]; void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data); +count_filters(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep data); void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data) +count_filters(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep data) { - if(png_ptr != NULL && row_info != NULL) + if(modpng14_ptr != NULL && row_info != NULL) ++filters_used[*(data-1)]; } #endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +#if defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) /* example of using user transform callback (we don't transform anything, but merely count the zero samples) */ -static png_uint_32 zero_samples; +static modpng14_uint_32 zero_samples; void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data); +count_zero_samples(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep data); void -#ifdef PNG_1_0_X -PNGAPI +#ifdef MODPNG14_1_0_X +MODPNG14API #endif -count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data) +count_zero_samples(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep data) { - png_bytep dp = data; - if(png_ptr == NULL)return; + modpng14_bytep dp = data; + if(modpng14_ptr == NULL)return; /* contents of 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) + * modpng14_uint_32 width width of row + * modpng14_uint_32 rowbytes number of bytes in row + * modpng14_byte color_type color type of pixels + * modpng14_byte bit_depth bit depth of samples + * modpng14_byte channels number of channels (1-4) + * modpng14_byte pixel_depth bits per pixel (depth*channels) */ @@ -215,7 +215,7 @@ if(row_info->color_type == 0 || row_info->color_type == 3) { int pos=0; - png_uint_32 n, nstop; + modpng14_uint_32 n, nstop; for (n=0, nstop=row_info->width; nbit_depth == 1) @@ -256,7 +256,7 @@ } else /* other color types */ { - png_uint_32 n, nstop; + modpng14_uint_32 n, nstop; int channel; int color_channels = row_info->channels; if(row_info->color_type > 3)color_channels--; @@ -281,33 +281,33 @@ } } } -#endif /* PNG_WRITE_USER_TRANSFORM_SUPPORTED */ +#endif /* MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED */ static int wrote_question = 0; -#if defined(PNG_NO_STDIO) +#if defined(MODPNG14_NO_STDIO) /* START of code to validate stdio-free compilation */ /* These copies of the default read/write functions come from pngrio.c and */ /* pngwio.c. They allow "don't include stdio" testing of the library. */ /* 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 + read_data function and use it at run time with modpng14_set_read_fn(), rather than changing the library. */ #ifndef USE_FAR_KEYWORD static void -pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) +pngtest_read_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - png_size_t check; + modpng14_size_t check; - /* fread() returns 0 on error, so it is OK to store this in a png_size_t + /* fread() returns 0 on error, so it is OK to store this in a modpng14_size_t * instead of an int, which is what fread() actually returns. */ - READFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); + READFILE((modpng14_FILE_p)modpng14_ptr->io_ptr, data, length, check); if (check != length) { - png_error(png_ptr, "Read Error!"); + modpng14_error(modpng14_ptr, "Read Error!"); } } #else @@ -320,30 +320,30 @@ #define MIN(a,b) (a <= b ? a : b) static void -pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) +pngtest_read_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { int check; - png_byte *n_data; - png_FILE_p io_ptr; + modpng14_byte *n_data; + modpng14_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) + n_data = (modpng14_byte *)CVT_PTR_NOCHECK(data); + io_ptr = (modpng14_FILE_p)CVT_PTR(modpng14_ptr->io_ptr); + if ((modpng14_bytep)n_data == data) { READFILE(io_ptr, n_data, length, check); } else { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t read, remaining, err; + modpng14_byte buf[NEAR_BUF_SIZE]; + modpng14_size_t read, remaining, err; check = 0; remaining = length; do { read = MIN(NEAR_BUF_SIZE, remaining); READFILE(io_ptr, buf, 1, err); - png_memcpy(data, buf, read); /* copy far buffer to near buffer */ + modpng14_memcpy(data, buf, read); /* copy far buffer to near buffer */ if(err != read) break; else @@ -355,18 +355,18 @@ } if (check != length) { - png_error(png_ptr, "read Error"); + modpng14_error(modpng14_ptr, "read Error"); } } #endif /* USE_FAR_KEYWORD */ -#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) static void -pngtest_flush(png_structp png_ptr) +pngtest_flush(modpng14_structp modpng14_ptr) { #if !defined(_WIN32_WCE) - png_FILE_p io_ptr; - io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); + modpng14_FILE_p io_ptr; + io_ptr = (modpng14_FILE_p)CVT_PTR((modpng14_ptr->io_ptr)); if (io_ptr != NULL) fflush(io_ptr); #endif @@ -375,18 +375,18 @@ /* 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 + write_data function and use it at run time with modpng14_set_write_fn(), rather than changing the library. */ #ifndef USE_FAR_KEYWORD static void -pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) +pngtest_write_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - png_uint_32 check; + modpng14_uint_32 check; - WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); + WRITEFILE((modpng14_FILE_p)modpng14_ptr->io_ptr, data, length, check); if (check != length) { - png_error(png_ptr, "Write Error"); + modpng14_error(modpng14_ptr, "Write Error"); } } #else @@ -399,29 +399,29 @@ #define MIN(a,b) (a <= b ? a : b) static void -pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) +pngtest_write_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_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; + modpng14_uint_32 check; + modpng14_byte *near_data; /* Needs to be "modpng14_byte *" instead of "modpng14_bytep" */ + modpng14_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) + near_data = (modpng14_byte *)CVT_PTR_NOCHECK(data); + io_ptr = (modpng14_FILE_p)CVT_PTR(modpng14_ptr->io_ptr); + if ((modpng14_bytep)near_data == data) { WRITEFILE(io_ptr, near_data, length, check); } else { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t written, remaining, err; + modpng14_byte buf[NEAR_BUF_SIZE]; + modpng14_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 */ + modpng14_memcpy(buf, data, written); /* copy far buffer to near buffer */ WRITEFILE(io_ptr, buf, written, err); if (err != written) break; @@ -434,7 +434,7 @@ } if (check != length) { - png_error(png_ptr, "Write Error"); + modpng14_error(modpng14_ptr, "Write Error"); } } @@ -442,48 +442,48 @@ /* 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 to. In the default configuration, png_ptr is + * here if you don't want to. In the default configuration, modpng14_ptr is * not used, but it is passed in case it may be useful. */ static void -pngtest_warning(png_structp png_ptr, png_const_charp message) +pngtest_warning(modpng14_structp modpng14_ptr, modpng14_const_charp message) { - PNG_CONST char *name = "UNKNOWN (ERROR!)"; - if (png_ptr != NULL && png_ptr->error_ptr != NULL) - name = png_ptr->error_ptr; - fprintf(STDERR, "%s: libpng warning: %s\n", name, message); + MODPNG14_CONST char *name = "UNKNOWN (ERROR!)"; + if (modpng14_ptr != NULL && modpng14_ptr->error_ptr != NULL) + name = modpng14_ptr->error_ptr; + fprintf(STDERR, "%s: libmodpng14 warning: %s\n", name, message); } /* 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(). + * error function pointer in modpng14_set_error_fn(). */ static void -pngtest_error(png_structp png_ptr, png_const_charp message) +pngtest_error(modpng14_structp modpng14_ptr, modpng14_const_charp message) { - pngtest_warning(png_ptr, message); - /* We can return because png_error calls the default handler, which is + pngtest_warning(modpng14_ptr, message); + /* We can return because modpng14_error calls the default handler, which is * actually OK in this case. */ } -#endif /* PNG_NO_STDIO */ +#endif /* MODPNG14_NO_STDIO */ /* END of code to validate stdio-free compilation */ /* START of code to validate memory allocation and deallocation */ -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_USER_MEM_SUPPORTED /* 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 + it not to. See zconf.h and modpng14.h for more information. zlib does need to allocate exactly 64K, so whatever you call here must have the ability to do that. This piece of code can be compiled to validate max 64K allocations - by setting MAXSEG_64K in zlib zconf.h *or* PNG_MAX_MALLOC_64K. */ + by setting MAXSEG_64K in zlib zconf.h *or* MODPNG14_MAX_MALLOC_64K. */ typedef struct memory_information { - png_uint_32 size; - png_voidp pointer; + modpng14_uint_32 size; + modpng14_voidp pointer; struct memory_information FAR *next; } memory_information; typedef memory_information FAR *memory_infop; @@ -494,15 +494,15 @@ static int total_allocation = 0; static int num_allocations = 0; -png_voidp png_debug_malloc PNGARG((png_structp png_ptr, png_uint_32 size)); -void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); +modpng14_voidp modpng14_debug_malloc PNGARG((modpng14_structp modpng14_ptr, modpng14_uint_32 size)); +void modpng14_debug_free PNGARG((modpng14_structp modpng14_ptr, modpng14_voidp ptr)); -png_voidp -png_debug_malloc(png_structp png_ptr, png_uint_32 size) +modpng14_voidp +modpng14_debug_malloc(modpng14_structp modpng14_ptr, modpng14_uint_32 size) { - /* png_malloc has already tested for NULL; png_create_struct calls - png_debug_malloc directly, with png_ptr == NULL which is OK */ + /* modpng14_malloc has already tested for NULL; modpng14_create_struct calls + modpng14_debug_malloc directly, with modpng14_ptr == NULL which is OK */ if (size == 0) return (NULL); @@ -510,34 +510,34 @@ /* This calls the library allocator twice, once to get the requested buffer and once to get a new free list entry. */ { - memory_infop pinfo = (memory_infop)png_malloc_default(png_ptr, - (png_uint_32)sizeof *pinfo); + memory_infop pinfo = (memory_infop)modpng14_malloc_default(modpng14_ptr, + (modpng14_uint_32)sizeof *pinfo); pinfo->size = size; current_allocation += size; total_allocation += size; num_allocations ++; if (current_allocation > maximum_allocation) maximum_allocation = current_allocation; - pinfo->pointer = (png_voidp)png_malloc_default(png_ptr, size); + pinfo->pointer = (modpng14_voidp)modpng14_malloc_default(modpng14_ptr, size); pinfo->next = pinformation; pinformation = pinfo; /* Make sure the caller isn't assuming zeroed memory. */ - png_memset(pinfo->pointer, 0xdd, pinfo->size); -#if PNG_DEBUG + modpng14_memset(pinfo->pointer, 0xdd, pinfo->size); +#if MODPNG14_DEBUG if(verbose) - printf("png_malloc %lu bytes at %x\n",size,pinfo->pointer); + printf("modpng14_malloc %lu bytes at %x\n",size,pinfo->pointer); #endif assert(pinfo->size != 12345678); - return (png_voidp)(pinfo->pointer); + return (modpng14_voidp)(pinfo->pointer); } } /* Free a pointer. It is removed from the list at the same time. */ void -png_debug_free(png_structp png_ptr, png_voidp ptr) +modpng14_debug_free(modpng14_structp modpng14_ptr, modpng14_voidp ptr) { - if (png_ptr == NULL) - fprintf(STDERR, "NULL pointer to png_debug_free.\n"); + if (modpng14_ptr == NULL) + fprintf(STDERR, "NULL pointer to modpng14_debug_free.\n"); if (ptr == 0) { #if 0 /* This happens all the time. */ @@ -560,8 +560,8 @@ fprintf(STDERR, "Duplicate free of memory\n"); /* We must free the list element too, but first kill the memory that is to be freed. */ - png_memset(ptr, 0x55, pinfo->size); - png_free_default(png_ptr, pinfo); + modpng14_memset(ptr, 0x55, pinfo->size); + modpng14_free_default(modpng14_ptr, pinfo); pinfo=NULL; break; } @@ -575,39 +575,39 @@ } /* Finally free the data. */ -#if PNG_DEBUG +#if MODPNG14_DEBUG if(verbose) printf("Freeing %x\n",ptr); #endif - png_free_default(png_ptr, ptr); + modpng14_free_default(modpng14_ptr, ptr); ptr=NULL; } -#endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* MODPNG14_USER_MEM_SUPPORTED */ /* END of code to test memory allocation/deallocation */ /* Test one file */ int -test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) +test_one_file(MODPNG14_CONST char *inname, MODPNG14_CONST char *outname) { - static png_FILE_p fpin; - static png_FILE_p fpout; /* "static" prevents setjmp corruption */ - png_structp read_ptr; - png_infop read_info_ptr, end_info_ptr; -#ifdef PNG_WRITE_SUPPORTED - png_structp write_ptr; - png_infop write_info_ptr; - png_infop write_end_info_ptr; + static modpng14_FILE_p fpin; + static modpng14_FILE_p fpout; /* "static" prevents setjmp corruption */ + modpng14_structp read_ptr; + modpng14_infop read_info_ptr, end_info_ptr; +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_structp write_ptr; + modpng14_infop write_info_ptr; + modpng14_infop write_end_info_ptr; #else - png_structp write_ptr = NULL; - png_infop write_info_ptr = NULL; - png_infop write_end_info_ptr = NULL; -#endif - png_bytep row_buf; - png_uint_32 y; - png_uint_32 width, height; + modpng14_structp write_ptr = NULL; + modpng14_infop write_info_ptr = NULL; + modpng14_infop write_end_info_ptr = NULL; +#endif + modpng14_bytep row_buf; + modpng14_uint_32 y; + modpng14_uint_32 width, height; int num_pass, pass; int bit_depth, color_type; -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD jmp_buf jmpbuf; #endif @@ -643,100 +643,100 @@ return (1); } - png_debug(0, "Allocating read and write structures\n"); -#ifdef PNG_USER_MEM_SUPPORTED - read_ptr = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); + modpng14_debug(0, "Allocating read and write structures\n"); +#ifdef MODPNG14_USER_MEM_SUPPORTED + read_ptr = modpng14_create_read_struct_2(MODPNG14_LIBMODPNG14_VER_STRING, modpng14_voidp_NULL, + modpng14_error_ptr_NULL, modpng14_error_ptr_NULL, modpng14_voidp_NULL, + (modpng14_malloc_ptr)modpng14_debug_malloc, (modpng14_free_ptr)modpng14_debug_free); #else - read_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL); + read_ptr = modpng14_create_read_struct(MODPNG14_LIBMODPNG14_VER_STRING, modpng14_voidp_NULL, + modpng14_error_ptr_NULL, modpng14_error_ptr_NULL); #endif -#if defined(PNG_NO_STDIO) - png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error, +#if defined(MODPNG14_NO_STDIO) + modpng14_set_error_fn(read_ptr, (modpng14_voidp)inname, pngtest_error, pngtest_warning); #endif -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_USER_MEM_SUPPORTED - write_ptr = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); +#ifdef MODPNG14_WRITE_SUPPORTED +#ifdef MODPNG14_USER_MEM_SUPPORTED + write_ptr = modpng14_create_write_struct_2(MODPNG14_LIBMODPNG14_VER_STRING, modpng14_voidp_NULL, + modpng14_error_ptr_NULL, modpng14_error_ptr_NULL, modpng14_voidp_NULL, + (modpng14_malloc_ptr)modpng14_debug_malloc, (modpng14_free_ptr)modpng14_debug_free); #else - write_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL); + write_ptr = modpng14_create_write_struct(MODPNG14_LIBMODPNG14_VER_STRING, modpng14_voidp_NULL, + modpng14_error_ptr_NULL, modpng14_error_ptr_NULL); #endif -#if defined(PNG_NO_STDIO) - png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error, +#if defined(MODPNG14_NO_STDIO) + modpng14_set_error_fn(write_ptr, (modpng14_voidp)inname, pngtest_error, pngtest_warning); #endif #endif - png_debug(0, "Allocating read_info, write_info and end_info structures\n"); - read_info_ptr = png_create_info_struct(read_ptr); - end_info_ptr = png_create_info_struct(read_ptr); -#ifdef PNG_WRITE_SUPPORTED - write_info_ptr = png_create_info_struct(write_ptr); - write_end_info_ptr = png_create_info_struct(write_ptr); + modpng14_debug(0, "Allocating read_info, write_info and end_info structures\n"); + read_info_ptr = modpng14_create_info_struct(read_ptr); + end_info_ptr = modpng14_create_info_struct(read_ptr); +#ifdef MODPNG14_WRITE_SUPPORTED + write_info_ptr = modpng14_create_info_struct(write_ptr); + write_end_info_ptr = modpng14_create_info_struct(write_ptr); #endif -#ifdef PNG_SETJMP_SUPPORTED - png_debug(0, "Setting jmpbuf for read struct\n"); +#ifdef MODPNG14_SETJMP_SUPPORTED + modpng14_debug(0, "Setting jmpbuf for read struct\n"); #ifdef USE_FAR_KEYWORD if (setjmp(jmpbuf)) #else - if (setjmp(png_jmpbuf(read_ptr))) + if (setjmp(modpng14_jmpbuf(read_ptr))) #endif { - fprintf(STDERR, "%s -> %s: libpng read error\n", inname, outname); + fprintf(STDERR, "%s -> %s: libmodpng14 read error\n", inname, outname); if (row_buf) - png_free(read_ptr, row_buf); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_destroy_write_struct(&write_ptr, &write_info_ptr); + modpng14_free(read_ptr, row_buf); + modpng14_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_destroy_info_struct(write_ptr, &write_end_info_ptr); + modpng14_destroy_write_struct(&write_ptr, &write_info_ptr); #endif FCLOSE(fpin); FCLOSE(fpout); return (1); } #ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(read_ptr),jmpbuf,sizeof(jmp_buf)); + modpng14_memcpy(modpng14_jmpbuf(read_ptr),jmpbuf,sizeof(jmp_buf)); #endif -#ifdef PNG_WRITE_SUPPORTED - png_debug(0, "Setting jmpbuf for write struct\n"); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_debug(0, "Setting jmpbuf for write struct\n"); #ifdef USE_FAR_KEYWORD if (setjmp(jmpbuf)) #else - if (setjmp(png_jmpbuf(write_ptr))) + if (setjmp(modpng14_jmpbuf(write_ptr))) #endif { - fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); - png_destroy_info_struct(write_ptr, &write_end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_destroy_write_struct(&write_ptr, &write_info_ptr); + fprintf(STDERR, "%s -> %s: libmodpng14 write error\n", inname, outname); + modpng14_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); + modpng14_destroy_info_struct(write_ptr, &write_end_info_ptr); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_destroy_write_struct(&write_ptr, &write_info_ptr); #endif FCLOSE(fpin); FCLOSE(fpout); return (1); } #ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(write_ptr),jmpbuf,sizeof(jmp_buf)); + modpng14_memcpy(modpng14_jmpbuf(write_ptr),jmpbuf,sizeof(jmp_buf)); #endif #endif #endif - png_debug(0, "Initializing input and output streams\n"); -#if !defined(PNG_NO_STDIO) - png_init_io(read_ptr, fpin); -# ifdef PNG_WRITE_SUPPORTED - png_init_io(write_ptr, fpout); + modpng14_debug(0, "Initializing input and output streams\n"); +#if !defined(MODPNG14_NO_STDIO) + modpng14_init_io(read_ptr, fpin); +# ifdef MODPNG14_WRITE_SUPPORTED + modpng14_init_io(write_ptr, fpout); # endif #else - png_set_read_fn(read_ptr, (png_voidp)fpin, pngtest_read_data); -# ifdef PNG_WRITE_SUPPORTED - png_set_write_fn(write_ptr, (png_voidp)fpout, pngtest_write_data, -# if defined(PNG_WRITE_FLUSH_SUPPORTED) + modpng14_set_read_fn(read_ptr, (modpng14_voidp)fpin, pngtest_read_data); +# ifdef MODPNG14_WRITE_SUPPORTED + modpng14_set_write_fn(write_ptr, (modpng14_voidp)fpout, pngtest_write_data, +# if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) pngtest_flush); # else NULL); @@ -745,323 +745,323 @@ #endif if(status_dots_requested == 1) { -#ifdef PNG_WRITE_SUPPORTED - png_set_write_status_fn(write_ptr, write_row_callback); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_set_write_status_fn(write_ptr, write_row_callback); #endif - png_set_read_status_fn(read_ptr, read_row_callback); + modpng14_set_read_status_fn(read_ptr, read_row_callback); } else { -#ifdef PNG_WRITE_SUPPORTED - png_set_write_status_fn(write_ptr, png_write_status_ptr_NULL); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_set_write_status_fn(write_ptr, modpng14_write_status_ptr_NULL); #endif - png_set_read_status_fn(read_ptr, png_read_status_ptr_NULL); + modpng14_set_read_status_fn(read_ptr, modpng14_read_status_ptr_NULL); } -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) { int i; for(i=0; i<256; i++) filters_used[i]=0; - png_set_read_user_transform_fn(read_ptr, count_filters); + modpng14_set_read_user_transform_fn(read_ptr, count_filters); } #endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +#if defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) zero_samples=0; - png_set_write_user_transform_fn(write_ptr, count_zero_samples); + modpng14_set_write_user_transform_fn(write_ptr, count_zero_samples); #endif #define HANDLE_CHUNK_IF_SAFE 2 #define HANDLE_CHUNK_ALWAYS 3 -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - png_set_keep_unknown_chunks(read_ptr, HANDLE_CHUNK_ALWAYS, - png_bytep_NULL, 0); +#if defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) + modpng14_set_keep_unknown_chunks(read_ptr, HANDLE_CHUNK_ALWAYS, + modpng14_bytep_NULL, 0); #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - png_set_keep_unknown_chunks(write_ptr, HANDLE_CHUNK_IF_SAFE, - png_bytep_NULL, 0); +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) + modpng14_set_keep_unknown_chunks(write_ptr, HANDLE_CHUNK_IF_SAFE, + modpng14_bytep_NULL, 0); #endif - png_debug(0, "Reading info struct\n"); - png_read_info(read_ptr, read_info_ptr); + modpng14_debug(0, "Reading info struct\n"); + modpng14_read_info(read_ptr, read_info_ptr); - png_debug(0, "Transferring info struct\n"); + modpng14_debug(0, "Transferring info struct\n"); { int interlace_type, compression_type, filter_type; - if (png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth, + if (modpng14_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, &compression_type, &filter_type)) { - png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth, -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) + modpng14_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth, +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) color_type, interlace_type, compression_type, filter_type); #else - color_type, PNG_INTERLACE_NONE, compression_type, filter_type); + color_type, MODPNG14_INTERLACE_NONE, compression_type, filter_type); #endif } } -#if defined(PNG_FIXED_POINT_SUPPORTED) -#if defined(PNG_cHRM_SUPPORTED) +#if defined(MODPNG14_FIXED_POINT_SUPPORTED) +#if defined(MODPNG14_cHRM_SUPPORTED) { - png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x, + modpng14_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; - if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, + if (modpng14_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y)) { - png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x, + modpng14_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); } } #endif -#if defined(PNG_gAMA_SUPPORTED) +#if defined(MODPNG14_gAMA_SUPPORTED) { - png_fixed_point gamma; + modpng14_fixed_point gamma; - if (png_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma)) + if (modpng14_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma)) { - png_set_gAMA_fixed(write_ptr, write_info_ptr, gamma); + modpng14_set_gAMA_fixed(write_ptr, write_info_ptr, gamma); } } #endif #else /* Use floating point versions */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) -#if defined(PNG_cHRM_SUPPORTED) +#if defined(MODPNG14_FLOATING_POINT_SUPPORTED) +#if defined(MODPNG14_cHRM_SUPPORTED) { double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; - if (png_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, + if (modpng14_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y)) { - png_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x, + modpng14_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); } } #endif -#if defined(PNG_gAMA_SUPPORTED) +#if defined(MODPNG14_gAMA_SUPPORTED) { double gamma; - if (png_get_gAMA(read_ptr, read_info_ptr, &gamma)) + if (modpng14_get_gAMA(read_ptr, read_info_ptr, &gamma)) { - png_set_gAMA(write_ptr, write_info_ptr, gamma); + modpng14_set_gAMA(write_ptr, write_info_ptr, gamma); } } #endif #endif /* floating point */ #endif /* fixed point */ -#if defined(PNG_iCCP_SUPPORTED) +#if defined(MODPNG14_iCCP_SUPPORTED) { - png_charp name; - png_charp profile; - png_uint_32 proflen; + modpng14_charp name; + modpng14_charp profile; + modpng14_uint_32 proflen; int compression_type; - if (png_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type, + if (modpng14_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type, &profile, &proflen)) { - png_set_iCCP(write_ptr, write_info_ptr, name, compression_type, + modpng14_set_iCCP(write_ptr, write_info_ptr, name, compression_type, profile, proflen); } } #endif -#if defined(PNG_sRGB_SUPPORTED) +#if defined(MODPNG14_sRGB_SUPPORTED) { int intent; - if (png_get_sRGB(read_ptr, read_info_ptr, &intent)) + if (modpng14_get_sRGB(read_ptr, read_info_ptr, &intent)) { - png_set_sRGB(write_ptr, write_info_ptr, intent); + modpng14_set_sRGB(write_ptr, write_info_ptr, intent); } } #endif { - png_colorp palette; + modpng14_colorp palette; int num_palette; - if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette)) + if (modpng14_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette)) { - png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette); + modpng14_set_PLTE(write_ptr, write_info_ptr, palette, num_palette); } } -#if defined(PNG_bKGD_SUPPORTED) +#if defined(MODPNG14_bKGD_SUPPORTED) { - png_color_16p background; + modpng14_color_16p background; - if (png_get_bKGD(read_ptr, read_info_ptr, &background)) + if (modpng14_get_bKGD(read_ptr, read_info_ptr, &background)) { - png_set_bKGD(write_ptr, write_info_ptr, background); + modpng14_set_bKGD(write_ptr, write_info_ptr, background); } } #endif -#if defined(PNG_hIST_SUPPORTED) +#if defined(MODPNG14_hIST_SUPPORTED) { - png_uint_16p hist; + modpng14_uint_16p hist; - if (png_get_hIST(read_ptr, read_info_ptr, &hist)) + if (modpng14_get_hIST(read_ptr, read_info_ptr, &hist)) { - png_set_hIST(write_ptr, write_info_ptr, hist); + modpng14_set_hIST(write_ptr, write_info_ptr, hist); } } #endif -#if defined(PNG_oFFs_SUPPORTED) +#if defined(MODPNG14_oFFs_SUPPORTED) { - png_int_32 offset_x, offset_y; + modpng14_int_32 offset_x, offset_y; int unit_type; - if (png_get_oFFs(read_ptr, read_info_ptr,&offset_x,&offset_y,&unit_type)) + if (modpng14_get_oFFs(read_ptr, read_info_ptr,&offset_x,&offset_y,&unit_type)) { - png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type); + modpng14_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type); } } #endif -#if defined(PNG_pCAL_SUPPORTED) +#if defined(MODPNG14_pCAL_SUPPORTED) { - png_charp purpose, units; - png_charpp params; - png_int_32 X0, X1; + modpng14_charp purpose, units; + modpng14_charpp params; + modpng14_int_32 X0, X1; int type, nparams; - if (png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, + if (modpng14_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, &nparams, &units, ¶ms)) { - png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type, + modpng14_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type, nparams, units, params); } } #endif -#if defined(PNG_pHYs_SUPPORTED) +#if defined(MODPNG14_pHYs_SUPPORTED) { - png_uint_32 res_x, res_y; + modpng14_uint_32 res_x, res_y; int unit_type; - if (png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y, &unit_type)) + if (modpng14_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y, &unit_type)) { - png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type); + modpng14_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type); } } #endif -#if defined(PNG_sBIT_SUPPORTED) +#if defined(MODPNG14_sBIT_SUPPORTED) { - png_color_8p sig_bit; + modpng14_color_8p sig_bit; - if (png_get_sBIT(read_ptr, read_info_ptr, &sig_bit)) + if (modpng14_get_sBIT(read_ptr, read_info_ptr, &sig_bit)) { - png_set_sBIT(write_ptr, write_info_ptr, sig_bit); + modpng14_set_sBIT(write_ptr, write_info_ptr, sig_bit); } } #endif -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED +#if defined(MODPNG14_sCAL_SUPPORTED) +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED { int unit; double scal_width, scal_height; - if (png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width, + if (modpng14_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width, &scal_height)) { - png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height); + modpng14_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height); } } #else -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED { int unit; - png_charp scal_width, scal_height; + modpng14_charp scal_width, scal_height; - if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width, + if (modpng14_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width, &scal_height)) { - png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width, scal_height); + modpng14_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width, scal_height); } } #endif #endif #endif -#if defined(PNG_TEXT_SUPPORTED) +#if defined(MODPNG14_TEXT_SUPPORTED) { - png_textp text_ptr; + modpng14_textp text_ptr; int num_text; - if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) + if (modpng14_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); - png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); + modpng14_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); + modpng14_set_text(write_ptr, write_info_ptr, text_ptr, num_text); } } #endif -#if defined(PNG_tIME_SUPPORTED) +#if defined(MODPNG14_tIME_SUPPORTED) { - png_timep mod_time; + modpng14_timep mod_time; - if (png_get_tIME(read_ptr, read_info_ptr, &mod_time)) + if (modpng14_get_tIME(read_ptr, read_info_ptr, &mod_time)) { - png_set_tIME(write_ptr, write_info_ptr, mod_time); -#if defined(PNG_TIME_RFC1123_SUPPORTED) - /* we have to use png_strcpy instead of "=" because the string - pointed to by png_convert_to_rfc1123() gets free'ed before + modpng14_set_tIME(write_ptr, write_info_ptr, mod_time); +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) + /* we have to use modpng14_strcpy instead of "=" because the string + pointed to by modpng14_convert_to_rfc1123() gets free'ed before we use it */ - png_strcpy(tIME_string,png_convert_to_rfc1123(read_ptr, mod_time)); + modpng14_strcpy(tIME_string,modpng14_convert_to_rfc1123(read_ptr, mod_time)); tIME_chunk_present++; -#endif /* PNG_TIME_RFC1123_SUPPORTED */ +#endif /* MODPNG14_TIME_RFC1123_SUPPORTED */ } } #endif -#if defined(PNG_tRNS_SUPPORTED) +#if defined(MODPNG14_tRNS_SUPPORTED) { - png_bytep trans; + modpng14_bytep trans; int num_trans; - png_color_16p trans_values; + modpng14_color_16p trans_values; - if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans, + if (modpng14_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans, &trans_values)) { - png_set_tRNS(write_ptr, write_info_ptr, trans, num_trans, + modpng14_set_tRNS(write_ptr, write_info_ptr, trans, num_trans, trans_values); } } #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) { - png_unknown_chunkp unknowns; - int num_unknowns = (int)png_get_unknown_chunks(read_ptr, read_info_ptr, + modpng14_unknown_chunkp unknowns; + int num_unknowns = (int)modpng14_get_unknown_chunks(read_ptr, read_info_ptr, &unknowns); if (num_unknowns) { - png_size_t i; - png_set_unknown_chunks(write_ptr, write_info_ptr, unknowns, + modpng14_size_t i; + modpng14_set_unknown_chunks(write_ptr, write_info_ptr, unknowns, num_unknowns); /* copy the locations from the read_info_ptr. The automatically generated locations in write_info_ptr are wrong because we haven't written anything yet */ - for (i = 0; i < (png_size_t)num_unknowns; i++) - png_set_unknown_chunk_location(write_ptr, write_info_ptr, i, + for (i = 0; i < (modpng14_size_t)num_unknowns; i++) + modpng14_set_unknown_chunk_location(write_ptr, write_info_ptr, i, unknowns[i].location); } } #endif -#ifdef PNG_WRITE_SUPPORTED - png_debug(0, "\nWriting info struct\n"); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_debug(0, "\nWriting info struct\n"); /* If we wanted, we could write info in two steps: - png_write_info_before_PLTE(write_ptr, write_info_ptr); + modpng14_write_info_before_PLTE(write_ptr, write_info_ptr); */ - png_write_info(write_ptr, write_info_ptr); + modpng14_write_info(write_ptr, write_info_ptr); #endif #ifdef SINGLE_ROWBUF_ALLOC - png_debug(0, "\nAllocating row buffer..."); - row_buf = (png_bytep)png_malloc(read_ptr, - png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug1(0, "0x%08lx\n\n", (unsigned long)row_buf); + modpng14_debug(0, "\nAllocating row buffer..."); + row_buf = (modpng14_bytep)modpng14_malloc(read_ptr, + modpng14_get_rowbytes(read_ptr, read_info_ptr)); + modpng14_debug1(0, "0x%08lx\n\n", (unsigned long)row_buf); #endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(0, "Writing row data\n"); + modpng14_debug(0, "Writing row data\n"); -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) - num_pass = png_set_interlace_handling(read_ptr); -# ifdef PNG_WRITE_SUPPORTED - png_set_interlace_handling(write_ptr); +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) || \ + defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) + num_pass = modpng14_set_interlace_handling(read_ptr); +# ifdef MODPNG14_WRITE_SUPPORTED + modpng14_set_interlace_handling(write_ptr); # endif #else num_pass=1; @@ -1074,133 +1074,133 @@ #endif for (pass = 0; pass < num_pass; pass++) { - png_debug1(0, "Writing row data for pass %d\n",pass); + modpng14_debug1(0, "Writing row data for pass %d\n",pass); for (y = 0; y < height; y++) { #ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass,y); - row_buf = (png_bytep)png_malloc(read_ptr, - png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug2(0, "0x%08lx (%ld bytes)\n", (unsigned long)row_buf, - png_get_rowbytes(read_ptr, read_info_ptr)); + modpng14_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass,y); + row_buf = (modpng14_bytep)modpng14_malloc(read_ptr, + modpng14_get_rowbytes(read_ptr, read_info_ptr)); + modpng14_debug2(0, "0x%08lx (%ld bytes)\n", (unsigned long)row_buf, + modpng14_get_rowbytes(read_ptr, read_info_ptr)); #endif /* !SINGLE_ROWBUF_ALLOC */ - png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1); + modpng14_read_rows(read_ptr, (modpng14_bytepp)&row_buf, modpng14_bytepp_NULL, 1); -#ifdef PNG_WRITE_SUPPORTED +#ifdef MODPNG14_WRITE_SUPPORTED #ifdef PNGTEST_TIMING t_stop = (float)clock(); t_decode += (t_stop - t_start); t_start = t_stop; #endif - png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); + modpng14_write_rows(write_ptr, (modpng14_bytepp)&row_buf, 1); #ifdef PNGTEST_TIMING t_stop = (float)clock(); t_encode += (t_stop - t_start); t_start = t_stop; #endif -#endif /* PNG_WRITE_SUPPORTED */ +#endif /* MODPNG14_WRITE_SUPPORTED */ #ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "Freeing row buffer (pass %d, y = %ld)\n\n", pass, y); - png_free(read_ptr, row_buf); + modpng14_debug2(0, "Freeing row buffer (pass %d, y = %ld)\n\n", pass, y); + modpng14_free(read_ptr, row_buf); #endif /* !SINGLE_ROWBUF_ALLOC */ } } -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - png_free_data(read_ptr, read_info_ptr, PNG_FREE_UNKN, -1); +#if defined(MODPNG14_READ_UNKNOWN_CHUNKS_SUPPORTED) + modpng14_free_data(read_ptr, read_info_ptr, MODPNG14_FREE_UNKN, -1); #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1); +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) + modpng14_free_data(write_ptr, write_info_ptr, MODPNG14_FREE_UNKN, -1); #endif - png_debug(0, "Reading and writing end_info data\n"); + modpng14_debug(0, "Reading and writing end_info data\n"); - png_read_end(read_ptr, end_info_ptr); -#if defined(PNG_TEXT_SUPPORTED) + modpng14_read_end(read_ptr, end_info_ptr); +#if defined(MODPNG14_TEXT_SUPPORTED) { - png_textp text_ptr; + modpng14_textp text_ptr; int num_text; - if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) + if (modpng14_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); - png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); + modpng14_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); + modpng14_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); } } #endif -#if defined(PNG_tIME_SUPPORTED) +#if defined(MODPNG14_tIME_SUPPORTED) { - png_timep mod_time; + modpng14_timep mod_time; - if (png_get_tIME(read_ptr, end_info_ptr, &mod_time)) + if (modpng14_get_tIME(read_ptr, end_info_ptr, &mod_time)) { - png_set_tIME(write_ptr, write_end_info_ptr, mod_time); -#if defined(PNG_TIME_RFC1123_SUPPORTED) - /* we have to use png_strcpy instead of "=" because the string - pointed to by png_convert_to_rfc1123() gets free'ed before + modpng14_set_tIME(write_ptr, write_end_info_ptr, mod_time); +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) + /* we have to use modpng14_strcpy instead of "=" because the string + pointed to by modpng14_convert_to_rfc1123() gets free'ed before we use it */ - png_strcpy(tIME_string,png_convert_to_rfc1123(read_ptr, mod_time)); + modpng14_strcpy(tIME_string,modpng14_convert_to_rfc1123(read_ptr, mod_time)); tIME_chunk_present++; -#endif /* PNG_TIME_RFC1123_SUPPORTED */ +#endif /* MODPNG14_TIME_RFC1123_SUPPORTED */ } } #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) { - png_unknown_chunkp unknowns; + modpng14_unknown_chunkp unknowns; int num_unknowns; - num_unknowns = (int)png_get_unknown_chunks(read_ptr, end_info_ptr, + num_unknowns = (int)modpng14_get_unknown_chunks(read_ptr, end_info_ptr, &unknowns); if (num_unknowns) { - png_size_t i; - png_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns, + modpng14_size_t i; + modpng14_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns, num_unknowns); /* copy the locations from the read_info_ptr. The automatically generated locations in write_end_info_ptr are wrong because we haven't written the end_info yet */ - for (i = 0; i < (png_size_t)num_unknowns; i++) - png_set_unknown_chunk_location(write_ptr, write_end_info_ptr, i, + for (i = 0; i < (modpng14_size_t)num_unknowns; i++) + modpng14_set_unknown_chunk_location(write_ptr, write_end_info_ptr, i, unknowns[i].location); } } #endif -#ifdef PNG_WRITE_SUPPORTED - png_write_end(write_ptr, write_end_info_ptr); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_write_end(write_ptr, write_end_info_ptr); #endif -#ifdef PNG_EASY_ACCESS_SUPPORTED +#ifdef MODPNG14_EASY_ACCESS_SUPPORTED if(verbose) { - png_uint_32 iwidth, iheight; - iwidth = png_get_image_width(write_ptr, write_info_ptr); - iheight = png_get_image_height(write_ptr, write_info_ptr); + modpng14_uint_32 iwidth, iheight; + iwidth = modpng14_get_image_width(write_ptr, write_info_ptr); + iheight = modpng14_get_image_height(write_ptr, write_info_ptr); fprintf(STDERR, "Image width = %lu, height = %lu\n", iwidth, iheight); } #endif - png_debug(0, "Destroying data structs\n"); + modpng14_debug(0, "Destroying data structs\n"); #ifdef SINGLE_ROWBUF_ALLOC - png_debug(1, "destroying row_buf for read_ptr\n"); - png_free(read_ptr, row_buf); + modpng14_debug(1, "destroying row_buf for read_ptr\n"); + modpng14_free(read_ptr, row_buf); row_buf=NULL; #endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr\n"); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_debug(1, "destroying write_end_info_ptr\n"); - png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_debug(1, "destroying write_ptr, write_info_ptr\n"); - png_destroy_write_struct(&write_ptr, &write_info_ptr); + modpng14_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr\n"); + modpng14_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); +#ifdef MODPNG14_WRITE_SUPPORTED + modpng14_debug(1, "destroying write_end_info_ptr\n"); + modpng14_destroy_info_struct(write_ptr, &write_end_info_ptr); + modpng14_debug(1, "destroying write_ptr, write_info_ptr\n"); + modpng14_destroy_write_struct(&write_ptr, &write_info_ptr); #endif - png_debug(0, "Destruction complete.\n"); + modpng14_debug(0, "Destruction complete.\n"); FCLOSE(fpin); FCLOSE(fpout); - png_debug(0, "Opening files for comparison\n"); + modpng14_debug(0, "Opening files for comparison\n"); #if defined(_WIN32_WCE) MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) @@ -1226,7 +1226,7 @@ for(;;) { - png_size_t num_in, num_out; + modpng14_size_t num_in, num_out; READFILE(fpin, inbuf, 1, num_in); READFILE(fpout, outbuf, 1, num_out); @@ -1239,9 +1239,9 @@ { fprintf(STDERR, " Was %s written with the same maximum IDAT chunk size (%d bytes),", - inname,PNG_ZBUF_SIZE); + inname,MODPNG14_ZBUF_SIZE); fprintf(STDERR, - "\n filtering heuristic (libpng default), compression"); + "\n filtering heuristic (libmodpng14 default), compression"); fprintf(STDERR, " level (zlib default),\n and zlib version (%s)?\n\n", ZLIB_VERSION); @@ -1255,16 +1255,16 @@ if (!num_in) break; - if (png_memcmp(inbuf, outbuf, num_in)) + if (modpng14_memcmp(inbuf, outbuf, num_in)) { fprintf(STDERR, "\nFiles %s and %s are different\n", inname, outname); if(wrote_question == 0) { fprintf(STDERR, " Was %s written with the same maximum IDAT chunk size (%d bytes),", - inname,PNG_ZBUF_SIZE); + inname,MODPNG14_ZBUF_SIZE); fprintf(STDERR, - "\n filtering heuristic (libpng default), compression"); + "\n filtering heuristic (libmodpng14 default), compression"); fprintf(STDERR, " level (zlib default),\n and zlib version (%s)?\n\n", ZLIB_VERSION); @@ -1284,11 +1284,11 @@ /* input and output filenames */ #ifdef RISCOS -static PNG_CONST char *inname = "pngtest/png"; -static PNG_CONST char *outname = "pngout/png"; +static MODPNG14_CONST char *inname = "pngtest/png"; +static MODPNG14_CONST char *outname = "pngout/png"; #else -static PNG_CONST char *inname = "pngtest.png"; -static PNG_CONST char *outname = "pngout.png"; +static MODPNG14_CONST char *inname = "pngtest.png"; +static MODPNG14_CONST char *outname = "pngout.png"; #endif int @@ -1297,36 +1297,36 @@ int multiple = 0; int ierror = 0; - fprintf(STDERR, "Testing libpng version %s\n", PNG_LIBPNG_VER_STRING); + fprintf(STDERR, "Testing libmodpng14 version %s\n", MODPNG14_LIBMODPNG14_VER_STRING); fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION); - fprintf(STDERR,"%s",png_get_copyright(NULL)); - /* Show the version of libpng used in building the library */ - fprintf(STDERR," library (%lu):%s", png_access_version_number(), - png_get_header_version(NULL)); - /* Show the version of libpng used in building the application */ - fprintf(STDERR," pngtest (%lu):%s", (unsigned long)PNG_LIBPNG_VER, - PNG_HEADER_VERSION_STRING); - fprintf(STDERR," sizeof(png_struct)=%ld, sizeof(png_info)=%ld\n", - (long)sizeof(png_struct), (long)sizeof(png_info)); + fprintf(STDERR,"%s",modpng14_get_copyright(NULL)); + /* Show the version of libmodpng14 used in building the library */ + fprintf(STDERR," library (%lu):%s", modpng14_access_version_number(), + modpng14_get_header_version(NULL)); + /* Show the version of libmodpng14 used in building the application */ + fprintf(STDERR," pngtest (%lu):%s", (unsigned long)MODPNG14_LIBMODPNG14_VER, + MODPNG14_HEADER_VERSION_STRING); + fprintf(STDERR," sizeof(modpng14_struct)=%ld, sizeof(modpng14_info)=%ld\n", + (long)sizeof(modpng14_struct), (long)sizeof(modpng14_info)); /* Do some consistency checking on the memory allocation settings, I'm not sure this matters, but it is nice to know, the first of these tests should be impossible because of the way the macros are set - in pngconf.h */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) - fprintf(STDERR, " NOTE: Zlib compiled for max 64k, libpng not\n"); + in modpng14conf.h */ +#if defined(MAXSEG_64K) && !defined(MODPNG14_MAX_MALLOC_64K) + fprintf(STDERR, " NOTE: Zlib compiled for max 64k, libmodpng14 not\n"); #endif /* I think the following can happen. */ -#if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K) - fprintf(STDERR, " NOTE: libpng compiled for max 64k, zlib not\n"); +#if !defined(MAXSEG_64K) && defined(MODPNG14_MAX_MALLOC_64K) + fprintf(STDERR, " NOTE: libmodpng14 compiled for max 64k, zlib not\n"); #endif - if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING)) + if (strcmp(modpng14_libmodpng14_ver, MODPNG14_LIBMODPNG14_VER_STRING)) { fprintf(STDERR, - "Warning: versions are different between png.h and png.c\n"); - fprintf(STDERR, " png.h version: %s\n", PNG_LIBPNG_VER_STRING); - fprintf(STDERR, " png.c version: %s\n\n", png_libpng_ver); + "Warning: versions are different between modpng14.h and png.c\n"); + fprintf(STDERR, " modpng14.h version: %s\n", MODPNG14_LIBMODPNG14_VER_STRING); + fprintf(STDERR, " png.c version: %s\n\n", modpng14_libmodpng14_ver); ++ierror; } @@ -1375,12 +1375,12 @@ if (multiple) { int i; -#ifdef PNG_USER_MEM_SUPPORTED +#ifdef MODPNG14_USER_MEM_SUPPORTED int allocation_now = current_allocation; #endif for (i=2; itransformations |= PNG_BGR; + modpng14_debug(1, "in modpng14_set_bgr\n"); + modpng14_ptr->transformations |= MODPNG14_BGR; } #endif -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +#if defined(MODPNG14_READ_SWAP_SUPPORTED) || defined(MODPNG14_WRITE_SWAP_SUPPORTED) /* turn on 16 bit byte swapping */ -void PNGAPI -png_set_swap(png_structp png_ptr) +void MODPNG14API +modpng14_set_swap(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_swap\n"); - if (png_ptr->bit_depth == 16) - png_ptr->transformations |= PNG_SWAP_BYTES; + modpng14_debug(1, "in modpng14_set_swap\n"); + if (modpng14_ptr->bit_depth == 16) + modpng14_ptr->transformations |= MODPNG14_SWAP_BYTES; } #endif -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +#if defined(MODPNG14_READ_PACK_SUPPORTED) || defined(MODPNG14_WRITE_PACK_SUPPORTED) /* turn on pixel packing */ -void PNGAPI -png_set_packing(png_structp png_ptr) +void MODPNG14API +modpng14_set_packing(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_packing\n"); - if (png_ptr->bit_depth < 8) + modpng14_debug(1, "in modpng14_set_packing\n"); + if (modpng14_ptr->bit_depth < 8) { - png_ptr->transformations |= PNG_PACK; - png_ptr->usr_bit_depth = 8; + modpng14_ptr->transformations |= MODPNG14_PACK; + modpng14_ptr->usr_bit_depth = 8; } } #endif -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED)||defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) /* turn on packed pixel swapping */ -void PNGAPI -png_set_packswap(png_structp png_ptr) +void MODPNG14API +modpng14_set_packswap(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_packswap\n"); - if (png_ptr->bit_depth < 8) - png_ptr->transformations |= PNG_PACKSWAP; + modpng14_debug(1, "in modpng14_set_packswap\n"); + if (modpng14_ptr->bit_depth < 8) + modpng14_ptr->transformations |= MODPNG14_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) +#if defined(MODPNG14_READ_SHIFT_SUPPORTED) || defined(MODPNG14_WRITE_SHIFT_SUPPORTED) +void MODPNG14API +modpng14_set_shift(modpng14_structp modpng14_ptr, modpng14_color_8p true_bits) { - png_debug(1, "in png_set_shift\n"); - png_ptr->transformations |= PNG_SHIFT; - png_ptr->shift = *true_bits; + modpng14_debug(1, "in modpng14_set_shift\n"); + modpng14_ptr->transformations |= MODPNG14_SHIFT; + modpng14_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) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) || \ + defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) +int MODPNG14API +modpng14_set_interlace_handling(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_interlace handling\n"); - if (png_ptr->interlaced) + modpng14_debug(1, "in modpng14_set_interlace handling\n"); + if (modpng14_ptr->interlaced) { - png_ptr->transformations |= PNG_INTERLACE; + modpng14_ptr->transformations |= MODPNG14_INTERLACE; return (7); } @@ -83,144 +83,144 @@ } #endif -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +#if defined(MODPNG14_READ_FILLER_SUPPORTED) || defined(MODPNG14_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) +void MODPNG14API +modpng14_set_filler(modpng14_structp modpng14_ptr, modpng14_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; + modpng14_debug(1, "in modpng14_set_filler\n"); + modpng14_ptr->transformations |= MODPNG14_FILLER; + modpng14_ptr->filler = (modpng14_byte)filler; + if (filler_loc == MODPNG14_FILLER_AFTER) + modpng14_ptr->flags |= MODPNG14_FLAG_FILLER_AFTER; else - png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER; + modpng14_ptr->flags &= ~MODPNG14_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 + * I attempted to do that in libmodpng14-1.0.1a but that caused problems + * so I restored it in libmodpng14-1.0.2a */ - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_RGB) { - png_ptr->usr_channels = 4; + modpng14_ptr->usr_channels = 4; } - /* Also I added this in libpng-1.0.2a (what happens when we expand + /* Also I added this in libmodpng14-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) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_GRAY && modpng14_ptr->bit_depth >= 8) { - png_ptr->usr_channels = 2; + modpng14_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) +#if defined(MODPNG14_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED) +void MODPNG14API +modpng14_set_swap_alpha(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_swap_alpha\n"); - png_ptr->transformations |= PNG_SWAP_ALPHA; + modpng14_debug(1, "in modpng14_set_swap_alpha\n"); + modpng14_ptr->transformations |= MODPNG14_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) +#if defined(MODPNG14_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) +void MODPNG14API +modpng14_set_invert_alpha(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_invert_alpha\n"); - png_ptr->transformations |= PNG_INVERT_ALPHA; + modpng14_debug(1, "in modpng14_set_invert_alpha\n"); + modpng14_ptr->transformations |= MODPNG14_INVERT_ALPHA; } #endif -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -void PNGAPI -png_set_invert_mono(png_structp png_ptr) +#if defined(MODPNG14_READ_INVERT_SUPPORTED) || defined(MODPNG14_WRITE_INVERT_SUPPORTED) +void MODPNG14API +modpng14_set_invert_mono(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_set_invert_mono\n"); - png_ptr->transformations |= PNG_INVERT_MONO; + modpng14_debug(1, "in modpng14_set_invert_mono\n"); + modpng14_ptr->transformations |= MODPNG14_INVERT_MONO; } /* invert monochrome grayscale data */ void /* PRIVATE */ -png_do_invert(png_row_infop row_info, png_bytep row) +modpng14_do_invert(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_invert\n"); - /* This test removed from libpng version 1.0.13 and 1.2.0: + modpng14_debug(1, "in modpng14_do_invert\n"); + /* This test removed from libmodpng14 version 1.0.13 and 1.2.0: * if (row_info->bit_depth == 1 && */ -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row == NULL || row_info == NULL) return; #endif - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) + if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY) { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; + modpng14_bytep rp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; for (i = 0; i < istop; i++) { - *rp = (png_byte)(~(*rp)); + *rp = (modpng14_byte)(~(*rp)); rp++; } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && + else if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA && row_info->bit_depth == 8) { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; + modpng14_bytep rp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; for (i = 0; i < istop; i+=2) { - *rp = (png_byte)(~(*rp)); + *rp = (modpng14_byte)(~(*rp)); rp+=2; } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && + else if (row_info->color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA && row_info->bit_depth == 16) { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; + modpng14_bytep rp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; for (i = 0; i < istop; i+=4) { - *rp = (png_byte)(~(*rp)); - *(rp+1) = (png_byte)(~(*(rp+1))); + *rp = (modpng14_byte)(~(*rp)); + *(rp+1) = (modpng14_byte)(~(*(rp+1))); rp+=4; } } } #endif -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +#if defined(MODPNG14_READ_SWAP_SUPPORTED) || defined(MODPNG14_WRITE_SWAP_SUPPORTED) /* swaps byte order on 16 bit depth images */ void /* PRIVATE */ -png_do_swap(png_row_infop row_info, png_bytep row) +modpng14_do_swap(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_swap\n"); + modpng14_debug(1, "in modpng14_do_swap\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_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; + modpng14_bytep rp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop= row_info->width * row_info->channels; for (i = 0; i < istop; i++, rp += 2) { - png_byte t = *rp; + modpng14_byte t = *rp; *rp = *(rp + 1); *(rp + 1) = t; } @@ -228,8 +228,8 @@ } #endif -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -static png_byte onebppswaptable[256] = { +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED)||defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) +static modpng14_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, @@ -264,7 +264,7 @@ 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF }; -static png_byte twobppswaptable[256] = { +static modpng14_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, @@ -299,7 +299,7 @@ 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF }; -static png_byte fourbppswaptable[256] = { +static modpng14_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, @@ -336,16 +336,16 @@ /* swaps pixel packing order within bytes */ void /* PRIVATE */ -png_do_packswap(png_row_infop row_info, png_bytep row) +modpng14_do_packswap(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_packswap\n"); + modpng14_debug(1, "in modpng14_do_packswap\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif row_info->bit_depth < 8) { - png_bytep rp, end, table; + modpng14_bytep rp, end, table; end = row + row_info->rowbytes; @@ -362,34 +362,34 @@ *rp = table[*rp]; } } -#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */ +#endif /* MODPNG14_READ_PACKSWAP_SUPPORTED or MODPNG14_WRITE_PACKSWAP_SUPPORTED */ -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +#if defined(MODPNG14_WRITE_FILLER_SUPPORTED) || \ + defined(MODPNG14_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) +modpng14_do_strip_filler(modpng14_row_infop row_info, modpng14_bytep row, modpng14_uint_32 flags) { - png_debug(1, "in png_do_strip_filler\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_strip_filler\n"); +#if defined(MODPNG14_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) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB || + row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) */ - png_bytep sp=row; - png_bytep dp=row; - png_uint_32 row_width=row_info->width; - png_uint_32 i; + modpng14_bytep sp=row; + modpng14_bytep dp=row; + modpng14_uint_32 row_width=row_info->width; + modpng14_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) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { dp+=3; sp+=4; for (i = 1; i < row_width; i++) @@ -416,14 +416,14 @@ } else /* if (row_info->bit_depth == 16) */ { - if (flags & PNG_FLAG_FILLER_AFTER) + if (flags & MODPNG14_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); + /* This could be (although modpng14_memcpy is probably slower): + modpng14_memcpy(dp, sp, 6); sp += 8; dp += 6; */ @@ -442,8 +442,8 @@ /* 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); + /* This could be (although modpng14_memcpy is probably slower): + modpng14_memcpy(dp, sp, 6); sp += 8; dp += 6; */ @@ -461,18 +461,18 @@ row_info->rowbytes = row_width * 6; } row_info->channels = 3; - row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; + row_info->color_type &= ~MODPNG14_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->color_type == MODPNG14_COLOR_TYPE_GRAY || + row_info->color_type == MODPNG14_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) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { for (i = 0; i < row_width; i++) { @@ -494,7 +494,7 @@ } else /* if (row_info->bit_depth == 16) */ { - if (flags & PNG_FLAG_FILLER_AFTER) + if (flags & MODPNG14_FLAG_FILLER_AFTER) { /* This converts from GGXX or GGAA to GG */ sp += 4; dp += 2; @@ -519,47 +519,47 @@ row_info->rowbytes = row_width * 2; } row_info->channels = 1; - row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; + row_info->color_type &= ~MODPNG14_COLOR_MASK_ALPHA; } } } #endif -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +#if defined(MODPNG14_READ_BGR_SUPPORTED) || defined(MODPNG14_WRITE_BGR_SUPPORTED) /* swaps red and blue bytes within a pixel */ void /* PRIVATE */ -png_do_bgr(png_row_infop row_info, png_bytep row) +modpng14_do_bgr(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_bgr\n"); + modpng14_debug(1, "in modpng14_do_bgr\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) + (row_info->color_type & MODPNG14_COLOR_MASK_COLOR)) { - png_uint_32 row_width = row_info->width; + modpng14_uint_32 row_width = row_info->width; if (row_info->bit_depth == 8) { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; for (i = 0, rp = row; i < row_width; i++, rp += 3) { - png_byte save = *rp; + modpng14_byte save = *rp; *rp = *(rp + 2); *(rp + 2) = save; } } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; for (i = 0, rp = row; i < row_width; i++, rp += 4) { - png_byte save = *rp; + modpng14_byte save = *rp; *rp = *(rp + 2); *(rp + 2) = save; } @@ -567,14 +567,14 @@ } else if (row_info->bit_depth == 16) { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; for (i = 0, rp = row; i < row_width; i++, rp += 6) { - png_byte save = *rp; + modpng14_byte save = *rp; *rp = *(rp + 4); *(rp + 4) = save; save = *(rp + 1); @@ -582,14 +582,14 @@ *(rp + 5) = save; } } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; for (i = 0, rp = row; i < row_width; i++, rp += 8) { - png_byte save = *rp; + modpng14_byte save = *rp; *rp = *(rp + 4); *(rp + 4) = save; save = *(rp + 1); @@ -600,40 +600,40 @@ } } } -#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */ +#endif /* MODPNG14_READ_BGR_SUPPORTED or MODPNG14_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 +#if defined(MODPNG14_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(MODPNG14_LEGACY_SUPPORTED) +void MODPNG14API +modpng14_set_user_transform_info(modpng14_structp modpng14_ptr, modpng14_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; + modpng14_debug(1, "in modpng14_set_user_transform_info\n"); +#if defined(MODPNG14_USER_TRANSFORM_PTR_SUPPORTED) + modpng14_ptr->user_transform_ptr = user_transform_ptr; + modpng14_ptr->user_transform_depth = (modpng14_byte)user_transform_depth; + modpng14_ptr->user_transform_channels = (modpng14_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"); + modpng14_warning(modpng14_ptr, + "This version of libmodpng14 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 + * associated with this pointer before modpng14_write_destroy and modpng14_read_destroy * are called. */ -png_voidp PNGAPI -png_get_user_transform_ptr(png_structp png_ptr) +modpng14_voidp MODPNG14API +modpng14_get_user_transform_ptr(modpng14_structp modpng14_ptr) { -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - return ((png_voidp)png_ptr->user_transform_ptr); +#if defined(MODPNG14_USER_TRANSFORM_PTR_SUPPORTED) + return ((modpng14_voidp)modpng14_ptr->user_transform_ptr); #else - if(png_ptr) + if(modpng14_ptr) return (NULL); return (NULL); #endif --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngvcrd.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngvcrd.c @@ -2,37 +2,37 @@ * * For Intel x86 CPU and Microsoft Visual C++ compiler * - * libpng version 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 version 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * Copyright (c) 1998, Intel Corporation * * Contributed by Nirav Chhatrapati, Intel Corporation, 1998 - * Interface to libpng contributed by Gilles Vollant, 1999 + * Interface to libmodpng14 contributed by Gilles Vollant, 1999 * * - * In png_do_read_interlace() in libpng versions 1.0.3a through 1.0.4d, + * In modpng14_do_read_interlace() in libmodpng14 versions 1.0.3a through 1.0.4d, * a sign error in the post-MMX cleanup code for each pixel_depth resulted * in bad pixels at the beginning of some rows of some images, and also * (due to out-of-range memory reads and writes) caused heap corruption * when compiled with MSVC 6.0. The error was fixed in version 1.0.4e. * - * [png_read_filter_row_mmx_avg() bpp == 2 bugfix, GRR 20000916] + * [modpng14_read_filter_row_mmx_avg() bpp == 2 bugfix, GRR 20000916] * * [runtime MMX configuration, GRR 20010102] * */ -#define PNG_INTERNAL -#include "png.h" +#define MODPNG14_INTERNAL +#include "modpng14.h" -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD) +#if defined(MODPNG14_ASSEMBLER_CODE_SUPPORTED) && defined(MODPNG14_USE_PNGVCRD) static int mmx_supported=2; -int PNGAPI -png_mmx_support(void) +int MODPNG14API +modpng14_mmx_support(void) { int mmx_supported_local = 0; _asm { @@ -106,45 +106,45 @@ supports MMX */ void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) +modpng14_combine_row(modpng14_structp modpng14_ptr, modpng14_bytep row, int mask) { -#ifdef PNG_USE_LOCAL_ARRAYS - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + const int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif - png_debug(1,"in png_combine_row_asm\n"); + modpng14_debug(1,"in modpng14_combine_row_asm\n"); if (mmx_supported == 2) { - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); - png_mmx_support(); + /* this should have happened in modpng14_init_mmx_flags() already */ + modpng14_warning(modpng14_ptr, "asm_flags may not have been initialized"); + modpng14_mmx_support(); } if (mask == 0xff) { - png_memcpy(row, png_ptr->row_buf + 1, - (png_size_t)((png_ptr->width * png_ptr->row_info.pixel_depth + 7) >> 3)); + modpng14_memcpy(row, modpng14_ptr->row_buf + 1, + (modpng14_size_t)((modpng14_ptr->width * modpng14_ptr->row_info.pixel_depth + 7) >> 3)); } /* GRR: add "else if (mask == 0)" case? - * or does png_combine_row() not even get called in that case? */ + * or does modpng14_combine_row() not even get called in that case? */ else { - switch (png_ptr->row_info.pixel_depth) + switch (modpng14_ptr->row_info.pixel_depth) { case 1: { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int s_inc, s_start, s_end; int m; int shift; - png_uint_32 i; + modpng14_uint_32 i; - sp = png_ptr->row_buf + 1; + sp = modpng14_ptr->row_buf + 1; dp = row; m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 7; @@ -160,15 +160,15 @@ shift = s_start; - for (i = 0; i < png_ptr->width; i++) + for (i = 0; i < modpng14_ptr->width; i++) { if (m & mask) { int value; value = (*sp >> shift) & 0x1; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0x7f7f >> (7 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -190,19 +190,19 @@ case 2: { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int s_start, s_end, s_inc; int m; int shift; - png_uint_32 i; + modpng14_uint_32 i; int value; - sp = png_ptr->row_buf + 1; + sp = modpng14_ptr->row_buf + 1; dp = row; m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 6; @@ -218,13 +218,13 @@ shift = s_start; - for (i = 0; i < png_ptr->width; i++) + for (i = 0; i < modpng14_ptr->width; i++) { if (m & mask) { value = (*sp >> shift) & 0x3; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0x3f3f >> (6 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -245,19 +245,19 @@ case 4: { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int s_start, s_end, s_inc; int m; int shift; - png_uint_32 i; + modpng14_uint_32 i; int value; - sp = png_ptr->row_buf + 1; + sp = modpng14_ptr->row_buf + 1; dp = row; m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) { s_start = 0; s_end = 4; @@ -272,13 +272,13 @@ } shift = s_start; - for (i = 0; i < png_ptr->width; i++) + for (i = 0; i < modpng14_ptr->width; i++) { if (m & mask) { value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp &= (modpng14_byte)((0xf0f >> (4 - shift)) & 0xff); + *dp |= (modpng14_byte)(value << shift); } if (shift == s_end) @@ -299,23 +299,23 @@ case 8: { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; + modpng14_bytep srcptr; + modpng14_bytep dstptr; + modpng14_uint_32 len; int m; int diff, unmask; __int64 mask0=0x0102040810204080; - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && mmx_supported */ ) { - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; m = 0x80; unmask = ~mask; - len = png_ptr->width &~7; //reduce to multiple of 8 - diff = png_ptr->width & 7; //amount lost + len = modpng14_ptr->width &~7; //reduce to multiple of 8 + diff = modpng14_ptr->width & 7; //amount lost _asm { @@ -376,21 +376,21 @@ else /* mmx not supported - use modified C routine */ { register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; + modpng14_size_t pixel_bytes; + modpng14_uint_32 i; + register int disp = modpng14_pass_inc[modpng14_ptr->pass]; int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* + pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + srcptr = modpng14_ptr->row_buf + 1 + offset_table[modpng14_ptr->pass]* pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; + dstptr = row + offset_table[modpng14_ptr->pass]*pixel_bytes; + initial_val = offset_table[modpng14_ptr->pass]*pixel_bytes; + final_val = modpng14_ptr->width*pixel_bytes; incr1 = (disp)*pixel_bytes; for (i = initial_val; i < final_val; i += incr1) { - png_memcpy(dstptr, srcptr, pixel_bytes); + modpng14_memcpy(dstptr, srcptr, pixel_bytes); srcptr += incr1; dstptr += incr1; } @@ -401,22 +401,22 @@ case 16: { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; + modpng14_bytep srcptr; + modpng14_bytep dstptr; + modpng14_uint_32 len; int unmask, diff; __int64 mask1=0x0101020204040808, mask0=0x1010202040408080; - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && mmx_supported */ ) { - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; + len = (modpng14_ptr->width)&~7; + diff = (modpng14_ptr->width)&7; _asm { movd mm7, unmask //load bit pattern @@ -488,21 +488,21 @@ else /* mmx not supported - use modified C routine */ { register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; + modpng14_size_t pixel_bytes; + modpng14_uint_32 i; + register int disp = modpng14_pass_inc[modpng14_ptr->pass]; int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* + pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + srcptr = modpng14_ptr->row_buf + 1 + offset_table[modpng14_ptr->pass]* pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; + dstptr = row + offset_table[modpng14_ptr->pass]*pixel_bytes; + initial_val = offset_table[modpng14_ptr->pass]*pixel_bytes; + final_val = modpng14_ptr->width*pixel_bytes; incr1 = (disp)*pixel_bytes; for (i = initial_val; i < final_val; i += incr1) { - png_memcpy(dstptr, srcptr, pixel_bytes); + modpng14_memcpy(dstptr, srcptr, pixel_bytes); srcptr += incr1; dstptr += incr1; } @@ -513,23 +513,23 @@ case 24: { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; + modpng14_bytep srcptr; + modpng14_bytep dstptr; + modpng14_uint_32 len; int unmask, diff; __int64 mask2=0x0101010202020404, //24bpp mask1=0x0408080810101020, mask0=0x2020404040808080; - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; + len = (modpng14_ptr->width)&~7; + diff = (modpng14_ptr->width)&7; - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && mmx_supported */ ) { _asm @@ -619,21 +619,21 @@ else /* mmx not supported - use modified C routine */ { register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; + modpng14_size_t pixel_bytes; + modpng14_uint_32 i; + register int disp = modpng14_pass_inc[modpng14_ptr->pass]; int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* + pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + srcptr = modpng14_ptr->row_buf + 1 + offset_table[modpng14_ptr->pass]* pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; + dstptr = row + offset_table[modpng14_ptr->pass]*pixel_bytes; + initial_val = offset_table[modpng14_ptr->pass]*pixel_bytes; + final_val = modpng14_ptr->width*pixel_bytes; incr1 = (disp)*pixel_bytes; for (i = initial_val; i < final_val; i += incr1) { - png_memcpy(dstptr, srcptr, pixel_bytes); + modpng14_memcpy(dstptr, srcptr, pixel_bytes); srcptr += incr1; dstptr += incr1; } @@ -644,9 +644,9 @@ case 32: { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; + modpng14_bytep srcptr; + modpng14_bytep dstptr; + modpng14_uint_32 len; int unmask, diff; __int64 mask3=0x0101010102020202, //32bpp @@ -654,14 +654,14 @@ mask1=0x1010101020202020, mask0=0x4040404080808080; - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; + len = (modpng14_ptr->width)&~7; + diff = (modpng14_ptr->width)&7; - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && mmx_supported */ ) { _asm @@ -759,21 +759,21 @@ else /* mmx _not supported - Use modified C routine */ { register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; + modpng14_size_t pixel_bytes; + modpng14_uint_32 i; + register int disp = modpng14_pass_inc[modpng14_ptr->pass]; int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* + pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + srcptr = modpng14_ptr->row_buf + 1 + offset_table[modpng14_ptr->pass]* pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; + dstptr = row + offset_table[modpng14_ptr->pass]*pixel_bytes; + initial_val = offset_table[modpng14_ptr->pass]*pixel_bytes; + final_val = modpng14_ptr->width*pixel_bytes; incr1 = (disp)*pixel_bytes; for (i = initial_val; i < final_val; i += incr1) { - png_memcpy(dstptr, srcptr, pixel_bytes); + modpng14_memcpy(dstptr, srcptr, pixel_bytes); srcptr += incr1; dstptr += incr1; } @@ -784,9 +784,9 @@ case 48: { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; + modpng14_bytep srcptr; + modpng14_bytep dstptr; + modpng14_uint_32 len; int unmask, diff; __int64 mask5=0x0101010101010202, @@ -796,15 +796,15 @@ mask1=0x2020202040404040, mask0=0x4040808080808080; - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_COMBINE_ROW) /* && mmx_supported */ ) { - srcptr = png_ptr->row_buf + 1; + srcptr = modpng14_ptr->row_buf + 1; dstptr = row; unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; + len = (modpng14_ptr->width)&~7; + diff = (modpng14_ptr->width)&7; _asm { movd mm7, unmask //load bit pattern @@ -917,21 +917,21 @@ else /* mmx _not supported - Use modified C routine */ { register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; + modpng14_size_t pixel_bytes; + modpng14_uint_32 i; + register int disp = modpng14_pass_inc[modpng14_ptr->pass]; int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* + pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + srcptr = modpng14_ptr->row_buf + 1 + offset_table[modpng14_ptr->pass]* pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; + dstptr = row + offset_table[modpng14_ptr->pass]*pixel_bytes; + initial_val = offset_table[modpng14_ptr->pass]*pixel_bytes; + final_val = modpng14_ptr->width*pixel_bytes; incr1 = (disp)*pixel_bytes; for (i = initial_val; i < final_val; i += incr1) { - png_memcpy(dstptr, srcptr, pixel_bytes); + modpng14_memcpy(dstptr, srcptr, pixel_bytes); srcptr += incr1; dstptr += incr1; } @@ -942,77 +942,77 @@ default: { - png_bytep sptr; - png_bytep dp; - png_size_t pixel_bytes; + modpng14_bytep sptr; + modpng14_bytep dp; + modpng14_size_t pixel_bytes; int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; unsigned int i; - register int disp = png_pass_inc[png_ptr->pass]; // get the offset + register int disp = modpng14_pass_inc[modpng14_ptr->pass]; // get the offset register unsigned int incr1, initial_val, final_val; - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - sptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* + pixel_bytes = (modpng14_ptr->row_info.pixel_depth >> 3); + sptr = modpng14_ptr->row_buf + 1 + offset_table[modpng14_ptr->pass]* pixel_bytes; - dp = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; + dp = row + offset_table[modpng14_ptr->pass]*pixel_bytes; + initial_val = offset_table[modpng14_ptr->pass]*pixel_bytes; + final_val = modpng14_ptr->width*pixel_bytes; incr1 = (disp)*pixel_bytes; for (i = initial_val; i < final_val; i += incr1) { - png_memcpy(dp, sptr, pixel_bytes); + modpng14_memcpy(dp, sptr, pixel_bytes); sptr += incr1; dp += incr1; } break; } - } /* end switch (png_ptr->row_info.pixel_depth) */ + } /* end switch (modpng14_ptr->row_info.pixel_depth) */ } /* end if (non-trivial mask) */ -} /* end png_combine_row() */ +} /* end modpng14_combine_row() */ -#if defined(PNG_READ_INTERLACING_SUPPORTED) +#if defined(MODPNG14_READ_INTERLACING_SUPPORTED) void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) +modpng14_do_read_interlace(modpng14_structp modpng14_ptr) { - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; - png_uint_32 transformations = png_ptr->transformations; -#ifdef PNG_USE_LOCAL_ARRAYS - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + modpng14_row_infop row_info = &(modpng14_ptr->row_info); + modpng14_bytep row = modpng14_ptr->row_buf + 1; + int pass = modpng14_ptr->pass; + modpng14_uint_32 transformations = modpng14_ptr->transformations; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + const int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif - png_debug(1,"in png_do_read_interlace\n"); + modpng14_debug(1,"in modpng14_do_read_interlace\n"); if (mmx_supported == 2) { - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); - png_mmx_support(); + /* this should have happened in modpng14_init_mmx_flags() already */ + modpng14_warning(modpng14_ptr, "asm_flags may not have been initialized"); + modpng14_mmx_support(); } if (row != NULL && row_info != NULL) { - png_uint_32 final_width; + modpng14_uint_32 final_width; - final_width = row_info->width * png_pass_inc[pass]; + final_width = row_info->width * modpng14_pass_inc[pass]; switch (row_info->pixel_depth) { case 1: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int sshift, dshift; int s_start, s_end, s_inc; - png_byte v; - png_uint_32 i; + modpng14_byte v; + modpng14_uint_32 i; int j; - sp = row + (png_size_t)((row_info->width - 1) >> 3); - dp = row + (png_size_t)((final_width - 1) >> 3); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) + sp = row + (modpng14_size_t)((row_info->width - 1) >> 3); + dp = row + (modpng14_size_t)((final_width - 1) >> 3); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { sshift = (int)((row_info->width + 7) & 7); dshift = (int)((final_width + 7) & 7); @@ -1032,11 +1032,11 @@ for (i = row_info->width; i; i--) { - v = (png_byte)((*sp >> sshift) & 0x1); - for (j = 0; j < png_pass_inc[pass]; j++) + v = (modpng14_byte)((*sp >> sshift) & 0x1); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0x7f7f >> (7 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -1058,18 +1058,18 @@ case 2: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int sshift, dshift; int s_start, s_end, s_inc; - png_uint_32 i; + modpng14_uint_32 i; - sp = row + (png_size_t)((row_info->width - 1) >> 2); - dp = row + (png_size_t)((final_width - 1) >> 2); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) + sp = row + (modpng14_size_t)((row_info->width - 1) >> 2); + dp = row + (modpng14_size_t)((final_width - 1) >> 2); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { - sshift = (png_size_t)(((row_info->width + 3) & 3) << 1); - dshift = (png_size_t)(((final_width + 3) & 3) << 1); + sshift = (modpng14_size_t)(((row_info->width + 3) & 3) << 1); + dshift = (modpng14_size_t)(((final_width + 3) & 3) << 1); s_start = 6; s_end = 0; s_inc = -2; @@ -1077,8 +1077,8 @@ else #endif { - sshift = (png_size_t)((3 - ((row_info->width + 3) & 3)) << 1); - dshift = (png_size_t)((3 - ((final_width + 3) & 3)) << 1); + sshift = (modpng14_size_t)((3 - ((row_info->width + 3) & 3)) << 1); + dshift = (modpng14_size_t)((3 - ((final_width + 3) & 3)) << 1); s_start = 0; s_end = 6; s_inc = 2; @@ -1086,14 +1086,14 @@ for (i = row_info->width; i; i--) { - png_byte v; + modpng14_byte v; int j; - v = (png_byte)((*sp >> sshift) & 0x3); - for (j = 0; j < png_pass_inc[pass]; j++) + v = (modpng14_byte)((*sp >> sshift) & 0x3); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0x3f3f >> (6 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -1115,18 +1115,18 @@ case 4: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int sshift, dshift; int s_start, s_end, s_inc; - png_uint_32 i; + modpng14_uint_32 i; - sp = row + (png_size_t)((row_info->width - 1) >> 1); - dp = row + (png_size_t)((final_width - 1) >> 1); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) + sp = row + (modpng14_size_t)((row_info->width - 1) >> 1); + dp = row + (modpng14_size_t)((final_width - 1) >> 1); +#if defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (transformations & MODPNG14_PACKSWAP) { - sshift = (png_size_t)(((row_info->width + 1) & 1) << 2); - dshift = (png_size_t)(((final_width + 1) & 1) << 2); + sshift = (modpng14_size_t)(((row_info->width + 1) & 1) << 2); + dshift = (modpng14_size_t)(((final_width + 1) & 1) << 2); s_start = 4; s_end = 0; s_inc = -4; @@ -1134,8 +1134,8 @@ else #endif { - sshift = (png_size_t)((1 - ((row_info->width + 1) & 1)) << 2); - dshift = (png_size_t)((1 - ((final_width + 1) & 1)) << 2); + sshift = (modpng14_size_t)((1 - ((row_info->width + 1) & 1)) << 2); + dshift = (modpng14_size_t)((1 - ((final_width + 1) & 1)) << 2); s_start = 0; s_end = 4; s_inc = 4; @@ -1143,14 +1143,14 @@ for (i = row_info->width; i; i--) { - png_byte v; + modpng14_byte v; int j; - v = (png_byte)((*sp >> sshift) & 0xf); - for (j = 0; j < png_pass_inc[pass]; j++) + v = (modpng14_byte)((*sp >> sshift) & 0xf); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); + *dp &= (modpng14_byte)((0xf0f >> (4 - dshift)) & 0xff); + *dp |= (modpng14_byte)(v << dshift); if (dshift == s_end) { dshift = s_start; @@ -1175,9 +1175,9 @@ __int64 const4 = 0x0000000000FFFFFF; // __int64 const5 = 0x000000FFFFFF0000; // unused... __int64 const6 = 0x00000000000000FF; - png_bytep sptr, dp; - png_uint_32 i; - png_size_t pixel_bytes; + modpng14_bytep sptr, dp; + modpng14_uint_32 i; + modpng14_size_t pixel_bytes; int width = row_info->width; pixel_bytes = (row_info->pixel_depth >> 3); @@ -1189,7 +1189,7 @@ // NOTE: there is NO MMX code for 48-bit and 64-bit images // use MMX routine if machine supports it - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_INTERLACE) /* && mmx_supported */ ) { if (pixel_bytes == 3) @@ -1201,7 +1201,7 @@ mov esi, sptr mov edi, dp mov ecx, width - sub edi, 21 // (png_pass_inc[pass] - 1)*pixel_bytes + sub edi, 21 // (modpng14_pass_inc[pass] - 1)*pixel_bytes loop_pass0: movd mm0, [esi] ; X X X X X v2 v1 v0 pand mm0, const4 ; 0 0 0 0 0 v2 v1 v0 @@ -1236,7 +1236,7 @@ mov esi, sptr mov edi, dp mov ecx, width - sub edi, 9 // (png_pass_inc[pass] - 1)*pixel_bytes + sub edi, 9 // (modpng14_pass_inc[pass] - 1)*pixel_bytes loop_pass2: movd mm0, [esi] ; X X X X X v2 v1 v0 pand mm0, const4 ; 0 0 0 0 0 v2 v1 v0 @@ -1299,13 +1299,13 @@ dp -= width_mmx*6; for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 3); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 3); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 3); + modpng14_memcpy(dp, v, 3); dp -= 3; } sptr -= 3; @@ -1365,11 +1365,11 @@ * * Original code: * - * png_byte v[8]; - * png_memcpy(v, sptr, pixel_bytes); - * for (j = 0; j < png_pass_inc[pass]; j++) + * modpng14_byte v[8]; + * modpng14_memcpy(v, sptr, pixel_bytes); + * for (j = 0; j < modpng14_pass_inc[pass]; j++) * { - * png_memcpy(dp, v, pixel_bytes); + * modpng14_memcpy(dp, v, pixel_bytes); * dp -= pixel_bytes; * } * sptr -= pixel_bytes; @@ -1377,7 +1377,7 @@ * Replacement code is in the next three lines: */ - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) *dp-- = *sptr; sptr--; } @@ -1417,7 +1417,7 @@ { int j; - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) { *dp-- = *sptr; } @@ -1460,7 +1460,7 @@ { int j; - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) { *dp-- = *sptr; } @@ -1506,14 +1506,14 @@ dp -= (width_mmx*16 - 2); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 2; - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); } } } @@ -1551,14 +1551,14 @@ dp -= (width_mmx*8 - 2); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 2; - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); } } } @@ -1591,14 +1591,14 @@ dp -= (width_mmx*4 - 2); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 2); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 2; - png_memcpy(dp, v, 2); + modpng14_memcpy(dp, v, 2); } } } @@ -1644,14 +1644,14 @@ dp -= (width_mmx*32 - 4); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 4; - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); } } } @@ -1689,14 +1689,14 @@ dp -= (width_mmx*16 - 4); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 4; - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); } } } @@ -1732,14 +1732,14 @@ dp -= (width_mmx*8 - 4); // sign fixed for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 4); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { dp -= 4; - png_memcpy(dp, v, 4); + modpng14_memcpy(dp, v, 4); } } } @@ -1750,12 +1750,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, 6); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, 6); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, 6); + modpng14_memcpy(dp, v, 6); dp -= 6; } sptr -= 6; @@ -1766,12 +1766,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr-= pixel_bytes; @@ -1787,7 +1787,7 @@ for (i = width; i; i--) { int j; - for (j = 0; j < png_pass_inc[pass]; j++) + for (j = 0; j < modpng14_pass_inc[pass]; j++) *dp-- = *sptr; sptr--; } @@ -1796,12 +1796,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr -= pixel_bytes; @@ -1811,12 +1811,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr -= pixel_bytes; @@ -1826,12 +1826,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr -= pixel_bytes; @@ -1841,12 +1841,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr -= pixel_bytes; @@ -1856,12 +1856,12 @@ { for (i = width; i; i--) { - png_byte v[8]; + modpng14_byte v[8]; int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) + modpng14_memcpy(v, sptr, pixel_bytes); + for (j = 0; j < modpng14_pass_inc[pass]; j++) { - png_memcpy(dp, v, pixel_bytes); + modpng14_memcpy(dp, v, pixel_bytes); dp -= pixel_bytes; } sptr -= pixel_bytes; @@ -1875,12 +1875,12 @@ row_info->width = final_width; row_info->rowbytes = ((final_width * - (png_uint_32)row_info->pixel_depth + 7) >> 3); + (modpng14_uint_32)row_info->pixel_depth + 7) >> 3); } } -#endif /* PNG_READ_INTERLACING_SUPPORTED */ +#endif /* MODPNG14_READ_INTERLACING_SUPPORTED */ // These variables are utilized in the functions below. They are declared @@ -1896,13 +1896,13 @@ // Optimized code for PNG Average filter decoder void /* PRIVATE */ -png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row - , png_bytep prev_row) +modpng14_read_filter_row_mmx_avg(modpng14_row_infop row_info, modpng14_bytep row + , modpng14_bytep prev_row) { int bpp; - png_uint_32 FullLength; - png_uint_32 MMXLength; - //png_uint_32 len; + modpng14_uint_32 FullLength; + modpng14_uint_32 MMXLength; + //modpng14_uint_32 len; int diff; bpp = (row_info->pixel_depth + 7) >> 3; // Get # bytes per pixel @@ -2329,12 +2329,12 @@ // Optimized code for PNG Paeth filter decoder void /* PRIVATE */ -png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row, - png_bytep prev_row) +modpng14_read_filter_row_mmx_paeth(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep prev_row) { - png_uint_32 FullLength; - png_uint_32 MMXLength; - //png_uint_32 len; + modpng14_uint_32 FullLength; + modpng14_uint_32 MMXLength; + //modpng14_uint_32 len; int bpp; int diff; //int ptemp; @@ -3225,12 +3225,12 @@ // Optimized code for PNG Sub filter decoder void /* PRIVATE */ -png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row) +modpng14_read_filter_row_mmx_sub(modpng14_row_infop row_info, modpng14_bytep row) { //int test; int bpp; - png_uint_32 FullLength; - png_uint_32 MMXLength; + modpng14_uint_32 FullLength; + modpng14_uint_32 MMXLength; int diff; bpp = (row_info->pixel_depth + 7) >> 3; // Get # bytes per pixel @@ -3313,16 +3313,16 @@ case 1: { // Placed here just in case this is a duplicate of the - // non-MMX code for the SUB filter in png_read_filter_row below + // non-MMX code for the SUB filter in modpng14_read_filter_row below // - // png_bytep rp; - // png_bytep lp; - // png_uint_32 i; + // modpng14_bytep rp; + // modpng14_bytep lp; + // modpng14_uint_32 i; // bpp = (row_info->pixel_depth + 7) >> 3; - // for (i = (png_uint_32)bpp, rp = row + bpp, lp = row; + // for (i = (modpng14_uint_32)bpp, rp = row + bpp, lp = row; // i < row_info->rowbytes; i++, rp++, lp++) // { - // *rp = (png_byte)(((int)(*rp) + (int)(*lp)) & 0xff); + // *rp = (modpng14_byte)(((int)(*rp) + (int)(*lp)) & 0xff); // } _asm { mov ebx, diff @@ -3529,10 +3529,10 @@ // Optimized code for PNG Up filter decoder void /* PRIVATE */ -png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row, - png_bytep prev_row) +modpng14_read_filter_row_mmx_up(modpng14_row_infop row_info, modpng14_bytep row, + modpng14_bytep prev_row) { - png_uint_32 len; + modpng14_uint_32 len; len = row_info->rowbytes; // # of bytes to filter _asm { mov edi, row @@ -3642,129 +3642,129 @@ } -// Optimized png_read_filter_row routines +// Optimized modpng14_read_filter_row routines void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep - row, png_bytep prev_row, int filter) +modpng14_read_filter_row(modpng14_structp modpng14_ptr, modpng14_row_infop row_info, modpng14_bytep + row, modpng14_bytep prev_row, int filter) { -#ifdef PNG_DEBUG +#ifdef MODPNG14_DEBUG char filnm[10]; #endif if (mmx_supported == 2) { - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); - png_mmx_support(); + /* this should have happened in modpng14_init_mmx_flags() already */ + modpng14_warning(modpng14_ptr, "asm_flags may not have been initialized"); + modpng14_mmx_support(); } -#ifdef PNG_DEBUG - png_debug(1, "in png_read_filter_row\n"); +#ifdef MODPNG14_DEBUG + modpng14_debug(1, "in modpng14_read_filter_row\n"); switch (filter) { case 0: sprintf(filnm, "none"); break; case 1: sprintf(filnm, "sub-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : "x86"); + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : "x86"); break; case 2: sprintf(filnm, "up-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : "x86"); + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : "x86"); break; case 3: sprintf(filnm, "avg-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : "x86"); + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : "x86"); break; case 4: sprintf(filnm, "Paeth-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":"x86"); + (modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":"x86"); break; default: sprintf(filnm, "unknw"); break; } - png_debug2(0,"row=%5d, %s, ", png_ptr->row_number, filnm); - png_debug2(0, "pd=%2d, b=%d, ", (int)row_info->pixel_depth, + modpng14_debug2(0,"row=%5d, %s, ", modpng14_ptr->row_number, filnm); + modpng14_debug2(0, "pd=%2d, b=%d, ", (int)row_info->pixel_depth, (int)((row_info->pixel_depth + 7) >> 3)); - png_debug1(0,"len=%8d, ", row_info->rowbytes); -#endif /* PNG_DEBUG */ + modpng14_debug1(0,"len=%8d, ", row_info->rowbytes); +#endif /* MODPNG14_DEBUG */ switch (filter) { - case PNG_FILTER_VALUE_NONE: + case MODPNG14_FILTER_VALUE_NONE: break; - case PNG_FILTER_VALUE_SUB: + case MODPNG14_FILTER_VALUE_SUB: { - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_SUB) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) { - png_read_filter_row_mmx_sub(row_info, row); + modpng14_read_filter_row_mmx_sub(row_info, row); } else { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_bytep rp = row + bpp; + modpng14_bytep lp = row; for (i = bpp; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); rp++; } } break; } - case PNG_FILTER_VALUE_UP: + case MODPNG14_FILTER_VALUE_UP: { - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_UP) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) { - png_read_filter_row_mmx_up(row_info, row, prev_row); + modpng14_read_filter_row_mmx_up(row_info, row, prev_row); } else { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; + modpng14_uint_32 i; + modpng14_uint_32 istop = row_info->rowbytes; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; for (i = 0; i < istop; ++i) { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); rp++; } } break; } - case PNG_FILTER_VALUE_AVG: + case MODPNG14_FILTER_VALUE_AVG: { - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_AVG) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) { - png_read_filter_row_mmx_avg(row_info, row, prev_row); + modpng14_read_filter_row_mmx_avg(row_info, row, prev_row); } else { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; + modpng14_uint_32 i; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; + modpng14_bytep lp = row; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_uint_32 istop = row_info->rowbytes - bpp; for (i = 0; i < bpp; i++) { - *rp = (png_byte)(((int)(*rp) + + *rp = (modpng14_byte)(((int)(*rp) + ((int)(*pp++) >> 1)) & 0xff); rp++; } for (i = 0; i < istop; i++) { - *rp = (png_byte)(((int)(*rp) + + *rp = (modpng14_byte)(((int)(*rp) + ((int)(*pp++ + *lp++) >> 1)) & 0xff); rp++; } @@ -3772,27 +3772,27 @@ break; } - case PNG_FILTER_VALUE_PAETH: + case MODPNG14_FILTER_VALUE_PAETH: { - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) + if ((modpng14_ptr->asm_flags & MODPNG14_ASM_FLAG_MMX_READ_FILTER_PAETH) && + (row_info->pixel_depth >= modpng14_ptr->mmx_bitdepth_threshold) && + (row_info->rowbytes >= modpng14_ptr->mmx_rowbytes_threshold)) { - png_read_filter_row_mmx_paeth(row_info, row, prev_row); + modpng14_read_filter_row_mmx_paeth(row_info, row, prev_row); } else { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop=row_info->rowbytes - bpp; + modpng14_uint_32 i; + modpng14_bytep rp = row; + modpng14_bytep pp = prev_row; + modpng14_bytep lp = row; + modpng14_bytep cp = prev_row; + modpng14_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; + modpng14_uint_32 istop=row_info->rowbytes - bpp; for (i = 0; i < bpp; i++) { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); rp++; } @@ -3807,7 +3807,7 @@ p = b - c; pc = a - c; -#ifdef PNG_USE_ABS +#ifdef MODPNG14_USE_ABS pa = abs(p); pb = abs(pc); pc = abs(p + pc); @@ -3828,7 +3828,7 @@ p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - *rp = (png_byte)(((int)(*rp) + p) & 0xff); + *rp = (modpng14_byte)(((int)(*rp) + p) & 0xff); rp++; } } @@ -3836,10 +3836,10 @@ } default: - png_warning(png_ptr, "Ignoring bad row filter type"); + modpng14_warning(modpng14_ptr, "Ignoring bad row filter type"); *row=0; break; } } -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGVCRD */ +#endif /* MODPNG14_ASSEMBLER_CODE_SUPPORTED && MODPNG14_USE_PNGVCRD */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngwio.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngwio.c @@ -1,8 +1,8 @@ /* pngwio.c - functions for data output * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -12,12 +12,12 @@ * 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(...). + * them at run time with modpng14_set_write_fn(...). */ -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED +#define MODPNG14_INTERNAL +#include "modpng14.h" +#ifdef MODPNG14_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 @@ -26,33 +26,33 @@ 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) +modpng14_write_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - if (png_ptr->write_data_fn != NULL ) - (*(png_ptr->write_data_fn))(png_ptr, data, length); + if (modpng14_ptr->write_data_fn != NULL ) + (*(modpng14_ptr->write_data_fn))(modpng14_ptr, data, length); else - png_error(png_ptr, "Call to NULL write function"); + modpng14_error(modpng14_ptr, "Call to NULL write function"); } -#if !defined(PNG_NO_STDIO) +#if !defined(MODPNG14_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 + write_data function and use it at run time with modpng14_set_write_fn(), rather than changing the library. */ #ifndef USE_FAR_KEYWORD -void PNGAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) +void MODPNG14API +modpng14_default_write_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - png_uint_32 check; + modpng14_uint_32 check; #if defined(_WIN32_WCE) - if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) + if ( !WriteFile((HANDLE)(modpng14_ptr->io_ptr), data, length, &check, NULL) ) check = 0; #else - check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); + check = fwrite(data, 1, length, (modpng14_FILE_p)(modpng14_ptr->io_ptr)); #endif if (check != length) - png_error(png_ptr, "Write Error"); + modpng14_error(modpng14_ptr, "Write Error"); } #else /* this is the model-independent version. Since the standard I/O library @@ -63,17 +63,17 @@ #define NEAR_BUF_SIZE 1024 #define MIN(a,b) (a <= b ? a : b) -void PNGAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) +void MODPNG14API +modpng14_default_write_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_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; + modpng14_uint_32 check; + modpng14_byte *near_data; /* Needs to be "modpng14_byte *" instead of "modpng14_bytep" */ + modpng14_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) + near_data = (modpng14_byte *)CVT_PTR_NOCHECK(data); + io_ptr = (modpng14_FILE_p)CVT_PTR(modpng14_ptr->io_ptr); + if ((modpng14_bytep)near_data == data) { #if defined(_WIN32_WCE) if ( !WriteFile(io_ptr, near_data, length, &check, NULL) ) @@ -84,14 +84,14 @@ } else { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t written, remaining, err; + modpng14_byte buf[NEAR_BUF_SIZE]; + modpng14_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 */ + modpng14_memcpy(buf, data, written); /* copy far buffer to near buffer */ #if defined(_WIN32_WCE) if ( !WriteFile(io_ptr, buf, written, &err, NULL) ) err = 0; @@ -108,30 +108,30 @@ while (remaining != 0); } if (check != length) - png_error(png_ptr, "Write Error"); + modpng14_error(modpng14_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 + to disk). After modpng14_flush is called, there should be no data pending writing in any buffers. */ -#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) void /* PRIVATE */ -png_flush(png_structp png_ptr) +modpng14_flush(modpng14_structp modpng14_ptr) { - if (png_ptr->output_flush_fn != NULL) - (*(png_ptr->output_flush_fn))(png_ptr); + if (modpng14_ptr->output_flush_fn != NULL) + (*(modpng14_ptr->output_flush_fn))(modpng14_ptr); } -#if !defined(PNG_NO_STDIO) -void PNGAPI -png_default_flush(png_structp png_ptr) +#if !defined(MODPNG14_NO_STDIO) +void MODPNG14API +modpng14_default_flush(modpng14_structp modpng14_ptr) { #if !defined(_WIN32_WCE) - png_FILE_p io_ptr; - io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); + modpng14_FILE_p io_ptr; + io_ptr = (modpng14_FILE_p)CVT_PTR((modpng14_ptr->io_ptr)); if (io_ptr != NULL) fflush(io_ptr); #endif @@ -140,67 +140,67 @@ #endif /* This function allows the application to supply new output functions for - libpng if standard C streams aren't being used. + libmodpng14 if standard C streams aren't being used. This function takes as its arguments: - png_ptr - pointer to a png output data structure + modpng14_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 + arguments a pointer to a modpng14_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") + function should call modpng14_error(modpng14_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 + arguments a pointer to a modpng14_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 + MODPNG14_WRITE_FLUSH_SUPPORTED is not defined at libmodpng14 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) +void MODPNG14API +modpng14_set_write_fn(modpng14_structp modpng14_ptr, modpng14_voidp io_ptr, + modpng14_rw_ptr write_data_fn, modpng14_flush_ptr output_flush_fn) { - png_ptr->io_ptr = io_ptr; + modpng14_ptr->io_ptr = io_ptr; -#if !defined(PNG_NO_STDIO) +#if !defined(MODPNG14_NO_STDIO) if (write_data_fn != NULL) - png_ptr->write_data_fn = write_data_fn; + modpng14_ptr->write_data_fn = write_data_fn; else - png_ptr->write_data_fn = png_default_write_data; + modpng14_ptr->write_data_fn = modpng14_default_write_data; #else - png_ptr->write_data_fn = write_data_fn; + modpng14_ptr->write_data_fn = write_data_fn; #endif -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -#if !defined(PNG_NO_STDIO) +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) +#if !defined(MODPNG14_NO_STDIO) if (output_flush_fn != NULL) - png_ptr->output_flush_fn = output_flush_fn; + modpng14_ptr->output_flush_fn = output_flush_fn; else - png_ptr->output_flush_fn = png_default_flush; + modpng14_ptr->output_flush_fn = modpng14_default_flush; #else - png_ptr->output_flush_fn = output_flush_fn; + modpng14_ptr->output_flush_fn = output_flush_fn; #endif -#endif /* PNG_WRITE_FLUSH_SUPPORTED */ +#endif /* MODPNG14_WRITE_FLUSH_SUPPORTED */ /* It is an error to read while writing a png file */ - if (png_ptr->read_data_fn != NULL) + if (modpng14_ptr->read_data_fn != NULL) { - png_ptr->read_data_fn = NULL; - png_warning(png_ptr, + modpng14_ptr->read_data_fn = NULL; + modpng14_warning(modpng14_ptr, "Attempted to set both read_data_fn and write_data_fn in"); - png_warning(png_ptr, + modpng14_warning(modpng14_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 *modpng14_far_to_near(modpng14_structp modpng14_ptr,modpng14_voidp ptr, int check) { void *near_ptr; void FAR *far_ptr; @@ -208,11 +208,11 @@ 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"); + modpng14_error(modpng14_ptr,"segment lost in conversion"); return(near_ptr); } # else -void *png_far_to_near(png_structp png_ptr,png_voidp ptr, int check) +void *modpng14_far_to_near(modpng14_structp modpng14_ptr,modpng14_voidp ptr, int check) { void *near_ptr; void FAR *far_ptr; @@ -220,9 +220,9 @@ far_ptr = (void FAR *)near_ptr; if(check != 0) if(far_ptr != ptr) - png_error(png_ptr,"segment lost in conversion"); + modpng14_error(modpng14_ptr,"segment lost in conversion"); return(near_ptr); } # endif # endif -#endif /* PNG_WRITE_SUPPORTED */ +#endif /* MODPNG14_WRITE_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngwrite.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngwrite.c @@ -1,89 +1,89 @@ /* pngwrite.c - general routines to write a PNG file * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ -/* get internal access to png.h */ -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED +/* get internal access to modpng14.h */ +#define MODPNG14_INTERNAL +#include "modpng14.h" +#ifdef MODPNG14_WRITE_SUPPORTED /* Writes all the PNG information. This is the suggested way to use the * library. If you have a new chunk to add, make a function to write it, * and put it in the correct location here. If you want the chunk written - * after the image data, put it in png_write_end(). I strongly encourage - * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing + * after the image data, put it in modpng14_write_end(). I strongly encourage + * you to supply a MODPNG14_INFO_ flag, and check info_ptr->valid before writing * the chunk, as that will keep the code from breaking if you want to just * write a plain PNG file. If you have long comments, I suggest writing - * them in png_write_end(), and compressing them. + * them in modpng14_write_end(), and compressing them. */ -void PNGAPI -png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) +void MODPNG14API +modpng14_write_info_before_PLTE(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_debug(1, "in png_write_info_before_PLTE\n"); - if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) + modpng14_debug(1, "in modpng14_write_info_before_PLTE\n"); + if (!(modpng14_ptr->mode & MODPNG14_WROTE_INFO_BEFORE_PLTE)) { - png_write_sig(png_ptr); /* write PNG signature */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted)) + modpng14_write_sig(modpng14_ptr); /* write PNG signature */ +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + if((modpng14_ptr->mode&MODPNG14_HAVE_MODPNG14_SIGNATURE)&&(modpng14_ptr->mng_features_permitted)) { - png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n"); - png_ptr->mng_features_permitted=0; + modpng14_warning(modpng14_ptr,"MNG features are not allowed in a PNG datastream\n"); + modpng14_ptr->mng_features_permitted=0; } #endif /* write IHDR information. */ - png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, + modpng14_write_IHDR(modpng14_ptr, info_ptr->width, info_ptr->height, info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type, info_ptr->filter_type, -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) info_ptr->interlace_type); #else 0); #endif /* the rest of these check to see if the valid field has the appropriate flag set, and if it does, writes the chunk. */ -#if defined(PNG_WRITE_gAMA_SUPPORTED) - if (info_ptr->valid & PNG_INFO_gAMA) +#if defined(MODPNG14_WRITE_gAMA_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_gAMA) { -# ifdef PNG_FLOATING_POINT_SUPPORTED - png_write_gAMA(png_ptr, info_ptr->gamma); +# ifdef MODPNG14_FLOATING_POINT_SUPPORTED + modpng14_write_gAMA(modpng14_ptr, info_ptr->gamma); #else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_write_gAMA_fixed(png_ptr, info_ptr->int_gamma); +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_write_gAMA_fixed(modpng14_ptr, info_ptr->int_gamma); # endif #endif } #endif -#if defined(PNG_WRITE_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) - png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent); -#endif -#if defined(PNG_WRITE_iCCP_SUPPORTED) - if (info_ptr->valid & PNG_INFO_iCCP) - png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE, +#if defined(MODPNG14_WRITE_sRGB_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_sRGB) + modpng14_write_sRGB(modpng14_ptr, (int)info_ptr->srgb_intent); +#endif +#if defined(MODPNG14_WRITE_iCCP_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_iCCP) + modpng14_write_iCCP(modpng14_ptr, info_ptr->iccp_name, MODPNG14_COMPRESSION_TYPE_BASE, info_ptr->iccp_profile, (int)info_ptr->iccp_proflen); #endif -#if defined(PNG_WRITE_sBIT_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sBIT) - png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); +#if defined(MODPNG14_WRITE_sBIT_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_sBIT) + modpng14_write_sBIT(modpng14_ptr, &(info_ptr->sig_bit), info_ptr->color_type); #endif -#if defined(PNG_WRITE_cHRM_SUPPORTED) - if (info_ptr->valid & PNG_INFO_cHRM) +#if defined(MODPNG14_WRITE_cHRM_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_cHRM) { -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_write_cHRM(png_ptr, +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED + modpng14_write_cHRM(modpng14_ptr, info_ptr->x_white, info_ptr->y_white, info_ptr->x_red, info_ptr->y_red, info_ptr->x_green, info_ptr->y_green, info_ptr->x_blue, info_ptr->y_blue); #else -# ifdef PNG_FIXED_POINT_SUPPORTED - png_write_cHRM_fixed(png_ptr, +# ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_write_cHRM_fixed(modpng14_ptr, info_ptr->int_x_white, info_ptr->int_y_white, info_ptr->int_x_red, info_ptr->int_y_red, info_ptr->int_x_green, info_ptr->int_y_green, @@ -92,188 +92,188 @@ #endif } #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) if (info_ptr->unknown_chunks_num) { - png_unknown_chunk *up; + modpng14_unknown_chunk *up; - png_debug(5, "writing extra chunks\n"); + modpng14_debug(5, "writing extra chunks\n"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; up++) { - int keep=png_handle_as_unknown(png_ptr, up->name); + int keep=modpng14_handle_as_unknown(modpng14_ptr, up->name); if (keep != HANDLE_CHUNK_NEVER && - up->location && (!(up->location & PNG_HAVE_PLTE)) && + up->location && (!(up->location & MODPNG14_HAVE_PLTE)) && ((up->name[3] & 0x20) || keep == HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) + (modpng14_ptr->flags & MODPNG14_FLAG_KEEP_UNSAFE_CHUNKS))) { - png_write_chunk(png_ptr, up->name, up->data, up->size); + modpng14_write_chunk(modpng14_ptr, up->name, up->data, up->size); } } } #endif - png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; + modpng14_ptr->mode |= MODPNG14_WROTE_INFO_BEFORE_PLTE; } } -void PNGAPI -png_write_info(png_structp png_ptr, png_infop info_ptr) +void MODPNG14API +modpng14_write_info(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) || defined(MODPNG14_WRITE_sPLT_SUPPORTED) int i; #endif - png_debug(1, "in png_write_info\n"); + modpng14_debug(1, "in modpng14_write_info\n"); - png_write_info_before_PLTE(png_ptr, info_ptr); + modpng14_write_info_before_PLTE(modpng14_ptr, info_ptr); - if (info_ptr->valid & PNG_INFO_PLTE) - png_write_PLTE(png_ptr, info_ptr->palette, - (png_uint_32)info_ptr->num_palette); - else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Valid palette required for paletted images\n"); + if (info_ptr->valid & MODPNG14_INFO_PLTE) + modpng14_write_PLTE(modpng14_ptr, info_ptr->palette, + (modpng14_uint_32)info_ptr->num_palette); + else if (info_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) + modpng14_error(modpng14_ptr, "Valid palette required for paletted images\n"); -#if defined(PNG_WRITE_tRNS_SUPPORTED) - if (info_ptr->valid & PNG_INFO_tRNS) +#if defined(MODPNG14_WRITE_tRNS_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_tRNS) { -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +#if defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) /* invert the alpha channel (in tRNS) */ - if ((png_ptr->transformations & PNG_INVERT_ALPHA) && - info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if ((modpng14_ptr->transformations & MODPNG14_INVERT_ALPHA) && + info_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { int j; for (j=0; j<(int)info_ptr->num_trans; j++) - info_ptr->trans[j] = (png_byte)(255 - info_ptr->trans[j]); + info_ptr->trans[j] = (modpng14_byte)(255 - info_ptr->trans[j]); } #endif - png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values), + modpng14_write_tRNS(modpng14_ptr, info_ptr->trans, &(info_ptr->trans_values), info_ptr->num_trans, info_ptr->color_type); } #endif -#if defined(PNG_WRITE_bKGD_SUPPORTED) - if (info_ptr->valid & PNG_INFO_bKGD) - png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type); -#endif -#if defined(PNG_WRITE_hIST_SUPPORTED) - if (info_ptr->valid & PNG_INFO_hIST) - png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette); -#endif -#if defined(PNG_WRITE_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset, +#if defined(MODPNG14_WRITE_bKGD_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_bKGD) + modpng14_write_bKGD(modpng14_ptr, &(info_ptr->background), info_ptr->color_type); +#endif +#if defined(MODPNG14_WRITE_hIST_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_hIST) + modpng14_write_hIST(modpng14_ptr, info_ptr->hist, info_ptr->num_palette); +#endif +#if defined(MODPNG14_WRITE_oFFs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_oFFs) + modpng14_write_oFFs(modpng14_ptr, info_ptr->x_offset, info_ptr->y_offset, info_ptr->offset_unit_type); #endif -#if defined(PNG_WRITE_pCAL_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pCAL) - png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0, +#if defined(MODPNG14_WRITE_pCAL_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_pCAL) + modpng14_write_pCAL(modpng14_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0, info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams, info_ptr->pcal_units, info_ptr->pcal_params); #endif -#if defined(PNG_WRITE_sCAL_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sCAL) -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) - png_write_sCAL(png_ptr, (int)info_ptr->scal_unit, +#if defined(MODPNG14_WRITE_sCAL_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_sCAL) +#if defined(MODPNG14_FLOATING_POINT_SUPPORTED) && !defined(MODPNG14_NO_STDIO) + modpng14_write_sCAL(modpng14_ptr, (int)info_ptr->scal_unit, info_ptr->scal_pixel_width, info_ptr->scal_pixel_height); #else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit, +#ifdef MODPNG14_FIXED_POINT_SUPPORTED + modpng14_write_sCAL_s(modpng14_ptr, (int)info_ptr->scal_unit, info_ptr->scal_s_width, info_ptr->scal_s_height); #else - png_warning(png_ptr, - "png_write_sCAL not supported; sCAL chunk not written.\n"); + modpng14_warning(modpng14_ptr, + "modpng14_write_sCAL not supported; sCAL chunk not written.\n"); #endif #endif #endif -#if defined(PNG_WRITE_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit, +#if defined(MODPNG14_WRITE_pHYs_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_pHYs) + modpng14_write_pHYs(modpng14_ptr, info_ptr->x_pixels_per_unit, info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type); #endif -#if defined(PNG_WRITE_tIME_SUPPORTED) - if (info_ptr->valid & PNG_INFO_tIME) +#if defined(MODPNG14_WRITE_tIME_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_tIME) { - png_write_tIME(png_ptr, &(info_ptr->mod_time)); - png_ptr->mode |= PNG_WROTE_tIME; + modpng14_write_tIME(modpng14_ptr, &(info_ptr->mod_time)); + modpng14_ptr->mode |= MODPNG14_WROTE_tIME; } #endif -#if defined(PNG_WRITE_sPLT_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sPLT) +#if defined(MODPNG14_WRITE_sPLT_SUPPORTED) + if (info_ptr->valid & MODPNG14_INFO_sPLT) for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) - png_write_sPLT(png_ptr, info_ptr->splt_palettes + i); + modpng14_write_sPLT(modpng14_ptr, info_ptr->splt_palettes + i); #endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) /* Check to see if we need to write text chunks */ for (i = 0; i < info_ptr->num_text; i++) { - png_debug2(2, "Writing header text chunk %d, type %d\n", i, + modpng14_debug2(2, "Writing header text chunk %d, type %d\n", i, info_ptr->text[i].compression); /* an internationalized chunk? */ if (info_ptr->text[i].compression > 0) { -#if defined(PNG_WRITE_iTXt_SUPPORTED) +#if defined(MODPNG14_WRITE_iTXt_SUPPORTED) /* write international chunk */ - png_write_iTXt(png_ptr, + modpng14_write_iTXt(modpng14_ptr, info_ptr->text[i].compression, info_ptr->text[i].key, info_ptr->text[i].lang, info_ptr->text[i].lang_key, info_ptr->text[i].text); #else - png_warning(png_ptr, "Unable to write international text\n"); + modpng14_warning(modpng14_ptr, "Unable to write international text\n"); #endif /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; + info_ptr->text[i].compression = MODPNG14_TEXT_COMPRESSION_NONE_WR; } /* If we want a compressed text chunk */ - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_zTXt) + else if (info_ptr->text[i].compression == MODPNG14_TEXT_COMPRESSION_zTXt) { -#if defined(PNG_WRITE_zTXt_SUPPORTED) +#if defined(MODPNG14_WRITE_zTXt_SUPPORTED) /* write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, + modpng14_write_zTXt(modpng14_ptr, info_ptr->text[i].key, info_ptr->text[i].text, 0, info_ptr->text[i].compression); #else - png_warning(png_ptr, "Unable to write compressed text\n"); + modpng14_warning(modpng14_ptr, "Unable to write compressed text\n"); #endif /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; + info_ptr->text[i].compression = MODPNG14_TEXT_COMPRESSION_zTXt_WR; } - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) + else if (info_ptr->text[i].compression == MODPNG14_TEXT_COMPRESSION_NONE) { -#if defined(PNG_WRITE_tEXt_SUPPORTED) +#if defined(MODPNG14_WRITE_tEXt_SUPPORTED) /* write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, + modpng14_write_tEXt(modpng14_ptr, info_ptr->text[i].key, info_ptr->text[i].text, 0); #else - png_warning(png_ptr, "Unable to write uncompressed text\n"); + modpng14_warning(modpng14_ptr, "Unable to write uncompressed text\n"); #endif /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; + info_ptr->text[i].compression = MODPNG14_TEXT_COMPRESSION_NONE_WR; } } #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) if (info_ptr->unknown_chunks_num) { - png_unknown_chunk *up; + modpng14_unknown_chunk *up; - png_debug(5, "writing extra chunks\n"); + modpng14_debug(5, "writing extra chunks\n"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; up++) { - int keep=png_handle_as_unknown(png_ptr, up->name); + int keep=modpng14_handle_as_unknown(modpng14_ptr, up->name); if (keep != HANDLE_CHUNK_NEVER && - up->location && (up->location & PNG_HAVE_PLTE) && - !(up->location & PNG_HAVE_IDAT) && + up->location && (up->location & MODPNG14_HAVE_PLTE) && + !(up->location & MODPNG14_HAVE_IDAT) && ((up->name[3] & 0x20) || keep == HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) + (modpng14_ptr->flags & MODPNG14_FLAG_KEEP_UNSAFE_CHUNKS))) { - png_write_chunk(png_ptr, up->name, up->data, up->size); + modpng14_write_chunk(modpng14_ptr, up->name, up->data, up->size); } } } @@ -282,423 +282,423 @@ /* Writes the end of the PNG file. If you don't want to write comments or * time information, you can pass NULL for info. If you already wrote these - * in png_write_info(), do not write them again here. If you have long + * in modpng14_write_info(), do not write them again here. If you have long * comments, I suggest writing them here, and compressing them. */ -void PNGAPI -png_write_end(png_structp png_ptr, png_infop info_ptr) +void MODPNG14API +modpng14_write_end(modpng14_structp modpng14_ptr, modpng14_infop info_ptr) { - png_debug(1, "in png_write_end\n"); - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "No IDATs written into file"); + modpng14_debug(1, "in modpng14_write_end\n"); + if (!(modpng14_ptr->mode & MODPNG14_HAVE_IDAT)) + modpng14_error(modpng14_ptr, "No IDATs written into file"); /* see if user wants us to write information chunks */ if (info_ptr != NULL) { -#if defined(PNG_WRITE_TEXT_SUPPORTED) +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) int i; /* local index variable */ #endif -#if defined(PNG_WRITE_tIME_SUPPORTED) +#if defined(MODPNG14_WRITE_tIME_SUPPORTED) /* check to see if user has supplied a time chunk */ - if ((info_ptr->valid & PNG_INFO_tIME) && - !(png_ptr->mode & PNG_WROTE_tIME)) - png_write_tIME(png_ptr, &(info_ptr->mod_time)); + if ((info_ptr->valid & MODPNG14_INFO_tIME) && + !(modpng14_ptr->mode & MODPNG14_WROTE_tIME)) + modpng14_write_tIME(modpng14_ptr, &(info_ptr->mod_time)); #endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) /* loop through comment chunks */ for (i = 0; i < info_ptr->num_text; i++) { - png_debug2(2, "Writing trailer text chunk %d, type %d\n", i, + modpng14_debug2(2, "Writing trailer text chunk %d, type %d\n", i, info_ptr->text[i].compression); /* an internationalized chunk? */ if (info_ptr->text[i].compression > 0) { -#if defined(PNG_WRITE_iTXt_SUPPORTED) +#if defined(MODPNG14_WRITE_iTXt_SUPPORTED) /* write international chunk */ - png_write_iTXt(png_ptr, + modpng14_write_iTXt(modpng14_ptr, info_ptr->text[i].compression, info_ptr->text[i].key, info_ptr->text[i].lang, info_ptr->text[i].lang_key, info_ptr->text[i].text); #else - png_warning(png_ptr, "Unable to write international text\n"); + modpng14_warning(modpng14_ptr, "Unable to write international text\n"); #endif /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; + info_ptr->text[i].compression = MODPNG14_TEXT_COMPRESSION_NONE_WR; } - else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt) + else if (info_ptr->text[i].compression >= MODPNG14_TEXT_COMPRESSION_zTXt) { -#if defined(PNG_WRITE_zTXt_SUPPORTED) +#if defined(MODPNG14_WRITE_zTXt_SUPPORTED) /* write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, + modpng14_write_zTXt(modpng14_ptr, info_ptr->text[i].key, info_ptr->text[i].text, 0, info_ptr->text[i].compression); #else - png_warning(png_ptr, "Unable to write compressed text\n"); + modpng14_warning(modpng14_ptr, "Unable to write compressed text\n"); #endif /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; + info_ptr->text[i].compression = MODPNG14_TEXT_COMPRESSION_zTXt_WR; } - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) + else if (info_ptr->text[i].compression == MODPNG14_TEXT_COMPRESSION_NONE) { -#if defined(PNG_WRITE_tEXt_SUPPORTED) +#if defined(MODPNG14_WRITE_tEXt_SUPPORTED) /* write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, + modpng14_write_tEXt(modpng14_ptr, info_ptr->text[i].key, info_ptr->text[i].text, 0); #else - png_warning(png_ptr, "Unable to write uncompressed text\n"); + modpng14_warning(modpng14_ptr, "Unable to write uncompressed text\n"); #endif /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; + info_ptr->text[i].compression = MODPNG14_TEXT_COMPRESSION_NONE_WR; } } #endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(MODPNG14_WRITE_UNKNOWN_CHUNKS_SUPPORTED) if (info_ptr->unknown_chunks_num) { - png_unknown_chunk *up; + modpng14_unknown_chunk *up; - png_debug(5, "writing extra chunks\n"); + modpng14_debug(5, "writing extra chunks\n"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; up++) { - int keep=png_handle_as_unknown(png_ptr, up->name); + int keep=modpng14_handle_as_unknown(modpng14_ptr, up->name); if (keep != HANDLE_CHUNK_NEVER && - up->location && (up->location & PNG_AFTER_IDAT) && + up->location && (up->location & MODPNG14_AFTER_IDAT) && ((up->name[3] & 0x20) || keep == HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) + (modpng14_ptr->flags & MODPNG14_FLAG_KEEP_UNSAFE_CHUNKS))) { - png_write_chunk(png_ptr, up->name, up->data, up->size); + modpng14_write_chunk(modpng14_ptr, up->name, up->data, up->size); } } } #endif } - png_ptr->mode |= PNG_AFTER_IDAT; + modpng14_ptr->mode |= MODPNG14_AFTER_IDAT; /* write end of PNG file */ - png_write_IEND(png_ptr); + modpng14_write_IEND(modpng14_ptr); #if 0 -/* This flush, added in libpng-1.0.8, causes some applications to crash - because they do not set png_ptr->output_flush_fn */ - png_flush(png_ptr); +/* This flush, added in libmodpng14-1.0.8, causes some applications to crash + because they do not set modpng14_ptr->output_flush_fn */ + modpng14_flush(modpng14_ptr); #endif } -#if defined(PNG_WRITE_tIME_SUPPORTED) +#if defined(MODPNG14_WRITE_tIME_SUPPORTED) #if !defined(_WIN32_WCE) /* "time.h" functions are not supported on WindowsCE */ -void PNGAPI -png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime) +void MODPNG14API +modpng14_convert_from_struct_tm(modpng14_timep ptime, struct tm FAR * ttime) { - png_debug(1, "in png_convert_from_struct_tm\n"); - ptime->year = (png_uint_16)(1900 + ttime->tm_year); - ptime->month = (png_byte)(ttime->tm_mon + 1); - ptime->day = (png_byte)ttime->tm_mday; - ptime->hour = (png_byte)ttime->tm_hour; - ptime->minute = (png_byte)ttime->tm_min; - ptime->second = (png_byte)ttime->tm_sec; + modpng14_debug(1, "in modpng14_convert_from_struct_tm\n"); + ptime->year = (modpng14_uint_16)(1900 + ttime->tm_year); + ptime->month = (modpng14_byte)(ttime->tm_mon + 1); + ptime->day = (modpng14_byte)ttime->tm_mday; + ptime->hour = (modpng14_byte)ttime->tm_hour; + ptime->minute = (modpng14_byte)ttime->tm_min; + ptime->second = (modpng14_byte)ttime->tm_sec; } -void PNGAPI -png_convert_from_time_t(png_timep ptime, time_t ttime) +void MODPNG14API +modpng14_convert_from_time_t(modpng14_timep ptime, time_t ttime) { struct tm *tbuf; - png_debug(1, "in png_convert_from_time_t\n"); + modpng14_debug(1, "in modpng14_convert_from_time_t\n"); tbuf = gmtime(&ttime); - png_convert_from_struct_tm(ptime, tbuf); + modpng14_convert_from_struct_tm(ptime, tbuf); } #endif #endif -/* Initialize png_ptr structure, and allocate any memory needed */ -png_structp PNGAPI -png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn) +/* Initialize modpng14_ptr structure, and allocate any memory needed */ +modpng14_structp MODPNG14API +modpng14_create_write_struct(modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn) { -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL)); +#ifdef MODPNG14_USER_MEM_SUPPORTED + return (modpng14_create_write_struct_2(user_modpng14_ver, error_ptr, error_fn, + warn_fn, modpng14_voidp_NULL, modpng14_malloc_ptr_NULL, modpng14_free_ptr_NULL)); } -/* Alternate initialize png_ptr structure, and allocate any memory needed */ -png_structp PNGAPI -png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn) +/* Alternate initialize modpng14_ptr structure, and allocate any memory needed */ +modpng14_structp MODPNG14API +modpng14_create_write_struct_2(modpng14_const_charp user_modpng14_ver, modpng14_voidp error_ptr, + modpng14_error_ptr error_fn, modpng14_error_ptr warn_fn, modpng14_voidp mem_ptr, + modpng14_malloc_ptr malloc_fn, modpng14_free_ptr free_fn) { -#endif /* PNG_USER_MEM_SUPPORTED */ - png_structp png_ptr; -#ifdef PNG_SETJMP_SUPPORTED +#endif /* MODPNG14_USER_MEM_SUPPORTED */ + modpng14_structp modpng14_ptr; +#ifdef MODPNG14_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD jmp_buf jmpbuf; #endif #endif int i; - png_debug(1, "in png_create_write_struct\n"); -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, - (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); + modpng14_debug(1, "in modpng14_create_write_struct\n"); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_ptr = (modpng14_structp)modpng14_create_struct_2(MODPNG14_STRUCT_PNG, + (modpng14_malloc_ptr)malloc_fn, (modpng14_voidp)mem_ptr); #else - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); -#endif /* PNG_USER_MEM_SUPPORTED */ - if (png_ptr == NULL) + modpng14_ptr = (modpng14_structp)modpng14_create_struct(MODPNG14_STRUCT_PNG); +#endif /* MODPNG14_USER_MEM_SUPPORTED */ + if (modpng14_ptr == NULL) return (NULL); -#if !defined(PNG_1_0_X) -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED - png_init_mmx_flags(png_ptr); /* 1.2.0 addition */ +#if !defined(MODPNG14_1_0_X) +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED + modpng14_init_mmx_flags(modpng14_ptr); /* 1.2.0 addition */ #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD if (setjmp(jmpbuf)) #else - if (setjmp(png_ptr->jmpbuf)) + if (setjmp(modpng14_ptr->jmpbuf)) #endif { - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf=NULL; - png_destroy_struct(png_ptr); + modpng14_free(modpng14_ptr, modpng14_ptr->zbuf); + modpng14_ptr->zbuf=NULL; + modpng14_destroy_struct(modpng14_ptr); return (NULL); } #ifdef USE_FAR_KEYWORD - png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); + modpng14_memcpy(modpng14_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); #endif #endif -#ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn); -#endif /* PNG_USER_MEM_SUPPORTED */ - png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_set_mem_fn(modpng14_ptr, mem_ptr, malloc_fn, free_fn); +#endif /* MODPNG14_USER_MEM_SUPPORTED */ + modpng14_set_error_fn(modpng14_ptr, error_ptr, error_fn, warn_fn); i=0; do { - if(user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); + if(user_modpng14_ver[i] != modpng14_libmodpng14_ver[i]) + modpng14_ptr->flags |= MODPNG14_FLAG_LIBRARY_MISMATCH; + } while (modpng14_libmodpng14_ver[i++]); - if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) + if (modpng14_ptr->flags & MODPNG14_FLAG_LIBRARY_MISMATCH) { - /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so + /* Libpng 0.90 and later are binary incompatible with libmodpng14 0.89, so * we must recompile any applications that use any older library version. - * For versions after libpng 1.0, we will be compatible, so we need + * For versions after libmodpng14 1.0, we will be compatible, so we need * only check the first digit. */ - if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || - (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || - (user_png_ver[0] == '0' && user_png_ver[2] < '9')) + if (user_modpng14_ver == NULL || user_modpng14_ver[0] != modpng14_libmodpng14_ver[0] || + (user_modpng14_ver[0] == '1' && user_modpng14_ver[2] != modpng14_libmodpng14_ver[2]) || + (user_modpng14_ver[0] == '0' && user_modpng14_ver[2] < '9')) { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char msg[80]; - if (user_png_ver) + if (user_modpng14_ver) { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application was compiled with modpng14.h from libmodpng14-%.20s", + user_modpng14_ver); + modpng14_warning(modpng14_ptr, msg); } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application is running with png.c from libmodpng14-%.20s", + modpng14_libmodpng14_ver); + modpng14_warning(modpng14_ptr, msg); #endif -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + modpng14_ptr->flags=0; #endif - png_error(png_ptr, - "Incompatible libpng version in application and library"); + modpng14_error(modpng14_ptr, + "Incompatible libmodpng14 version in application and library"); } } /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); + modpng14_ptr->zbuf_size = MODPNG14_ZBUF_SIZE; + modpng14_ptr->zbuf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)modpng14_ptr->zbuf_size); - png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL, - png_flush_ptr_NULL); + modpng14_set_write_fn(modpng14_ptr, modpng14_voidp_NULL, modpng14_rw_ptr_NULL, + modpng14_flush_ptr_NULL); -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT, - 1, png_doublep_NULL, png_doublep_NULL); +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + modpng14_set_filter_heuristics(modpng14_ptr, MODPNG14_FILTER_HEURISTIC_DEFAULT, + 1, modpng14_doublep_NULL, modpng14_doublep_NULL); #endif -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* Applications that neglect to set up their own setjmp() and then encounter - a png_error() will longjmp here. Since the jmpbuf is then meaningless we + a modpng14_error() will longjmp here. Since the jmpbuf is then meaningless we abort instead of returning. */ #ifdef USE_FAR_KEYWORD if (setjmp(jmpbuf)) - PNG_ABORT(); - png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); + MODPNG14_ABORT(); + modpng14_memcpy(modpng14_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf)); #else - if (setjmp(png_ptr->jmpbuf)) - PNG_ABORT(); + if (setjmp(modpng14_ptr->jmpbuf)) + MODPNG14_ABORT(); #endif #endif - return (png_ptr); + return (modpng14_ptr); } -/* Initialize png_ptr structure, and allocate any memory needed */ -#undef png_write_init -void PNGAPI -png_write_init(png_structp png_ptr) +/* Initialize modpng14_ptr structure, and allocate any memory needed */ +#undef modpng14_write_init +void MODPNG14API +modpng14_write_init(modpng14_structp modpng14_ptr) { /* We only come here via pre-1.0.7-compiled applications */ - png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0); + modpng14_write_init_2(modpng14_ptr, "1.0.6 or earlier", 0, 0); } -void PNGAPI -png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size, png_size_t png_info_size) +void MODPNG14API +modpng14_write_init_2(modpng14_structp modpng14_ptr, modpng14_const_charp user_modpng14_ver, + modpng14_size_t modpng14_struct_size, modpng14_size_t modpng14_info_size) { /* We only come here via pre-1.0.12-compiled applications */ -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if(sizeof(png_struct) > png_struct_size || sizeof(png_info) > png_info_size) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) + if(sizeof(modpng14_struct) > modpng14_struct_size || sizeof(modpng14_info) > modpng14_info_size) { char msg[80]; - png_ptr->warning_fn=NULL; - if (user_png_ver) + modpng14_ptr->warning_fn=NULL; + if (user_modpng14_ver) { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application was compiled with modpng14.h from libmodpng14-%.20s", + user_modpng14_ver); + modpng14_warning(modpng14_ptr, msg); } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); + sprintf(msg, "Application is running with png.c from libmodpng14-%.20s", + modpng14_libmodpng14_ver); + modpng14_warning(modpng14_ptr, msg); } #endif - if(sizeof(png_struct) > png_struct_size) + if(sizeof(modpng14_struct) > modpng14_struct_size) { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; + modpng14_ptr->error_fn=NULL; +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + modpng14_ptr->flags=0; #endif - png_error(png_ptr, + modpng14_error(modpng14_ptr, "The png struct allocated by the application for writing is too small."); } - if(sizeof(png_info) > png_info_size) + if(sizeof(modpng14_info) > modpng14_info_size) { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; + modpng14_ptr->error_fn=NULL; +#ifdef MODPNG14_ERROR_NUMBERS_SUPPORTED + modpng14_ptr->flags=0; #endif - png_error(png_ptr, + modpng14_error(modpng14_ptr, "The info struct allocated by the application for writing is too small."); } - png_write_init_3(&png_ptr, user_png_ver, png_struct_size); + modpng14_write_init_3(&modpng14_ptr, user_modpng14_ver, modpng14_struct_size); } -void PNGAPI -png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size) +void MODPNG14API +modpng14_write_init_3(modpng14_structpp ptr_ptr, modpng14_const_charp user_modpng14_ver, + modpng14_size_t modpng14_struct_size) { - png_structp png_ptr=*ptr_ptr; -#ifdef PNG_SETJMP_SUPPORTED + modpng14_structp modpng14_ptr=*ptr_ptr; +#ifdef MODPNG14_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to save current jump buffer */ #endif int i = 0; do { - if (user_png_ver[i] != png_libpng_ver[i]) + if (user_modpng14_ver[i] != modpng14_libmodpng14_ver[i]) { -#ifdef PNG_LEGACY_SUPPORTED - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; +#ifdef MODPNG14_LEGACY_SUPPORTED + modpng14_ptr->flags |= MODPNG14_FLAG_LIBRARY_MISMATCH; #else - png_ptr->warning_fn=NULL; - png_warning(png_ptr, - "Application uses deprecated png_write_init() and should be recompiled."); + modpng14_ptr->warning_fn=NULL; + modpng14_warning(modpng14_ptr, + "Application uses deprecated modpng14_write_init() and should be recompiled."); break; #endif } - } while (png_libpng_ver[i++]); + } while (modpng14_libmodpng14_ver[i++]); - png_debug(1, "in png_write_init_3\n"); + modpng14_debug(1, "in modpng14_write_init_3\n"); -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* save jump buffer and error functions */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, sizeof (jmp_buf)); + modpng14_memcpy(tmp_jmp, modpng14_ptr->jmpbuf, sizeof (jmp_buf)); #endif - if (sizeof(png_struct) > png_struct_size) + if (sizeof(modpng14_struct) > modpng14_struct_size) { - png_destroy_struct(png_ptr); - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); - *ptr_ptr = png_ptr; + modpng14_destroy_struct(modpng14_ptr); + modpng14_ptr = (modpng14_structp)modpng14_create_struct(MODPNG14_STRUCT_PNG); + *ptr_ptr = modpng14_ptr; } /* reset all variables to 0 */ - png_memset(png_ptr, 0, sizeof (png_struct)); + modpng14_memset(modpng14_ptr, 0, sizeof (modpng14_struct)); -#if !defined(PNG_1_0_X) -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED - png_init_mmx_flags(png_ptr); /* 1.2.0 addition */ +#if !defined(MODPNG14_1_0_X) +#ifdef MODPNG14_ASSEMBLER_CODE_SUPPORTED + modpng14_init_mmx_flags(modpng14_ptr); /* 1.2.0 addition */ #endif -#endif /* PNG_1_0_X */ +#endif /* MODPNG14_1_0_X */ -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* restore jump buffer */ - png_memcpy(png_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); + modpng14_memcpy(modpng14_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); #endif - png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL, - png_flush_ptr_NULL); + modpng14_set_write_fn(modpng14_ptr, modpng14_voidp_NULL, modpng14_rw_ptr_NULL, + modpng14_flush_ptr_NULL); /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT, - 1, png_doublep_NULL, png_doublep_NULL); + modpng14_ptr->zbuf_size = MODPNG14_ZBUF_SIZE; + modpng14_ptr->zbuf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)modpng14_ptr->zbuf_size); + +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + modpng14_set_filter_heuristics(modpng14_ptr, MODPNG14_FILTER_HEURISTIC_DEFAULT, + 1, modpng14_doublep_NULL, modpng14_doublep_NULL); #endif } /* Write a few rows of image data. If the image is interlaced, * either you will have to write the 7 sub images, or, if you - * have called png_set_interlace_handling(), you will have to + * have called modpng14_set_interlace_handling(), you will have to * "write" the image seven times. */ -void PNGAPI -png_write_rows(png_structp png_ptr, png_bytepp row, - png_uint_32 num_rows) +void MODPNG14API +modpng14_write_rows(modpng14_structp modpng14_ptr, modpng14_bytepp row, + modpng14_uint_32 num_rows) { - png_uint_32 i; /* row counter */ - png_bytepp rp; /* row pointer */ + modpng14_uint_32 i; /* row counter */ + modpng14_bytepp rp; /* row pointer */ - png_debug(1, "in png_write_rows\n"); + modpng14_debug(1, "in modpng14_write_rows\n"); /* loop through the rows */ for (i = 0, rp = row; i < num_rows; i++, rp++) { - png_write_row(png_ptr, *rp); + modpng14_write_row(modpng14_ptr, *rp); } } /* Write the image. You only need to call this function once, even * if you are writing an interlaced image. */ -void PNGAPI -png_write_image(png_structp png_ptr, png_bytepp image) +void MODPNG14API +modpng14_write_image(modpng14_structp modpng14_ptr, modpng14_bytepp image) { - png_uint_32 i; /* row index */ + modpng14_uint_32 i; /* row index */ int pass, num_pass; /* pass variables */ - png_bytepp rp; /* points to current row */ + modpng14_bytepp rp; /* points to current row */ - png_debug(1, "in png_write_image\n"); -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) + modpng14_debug(1, "in modpng14_write_image\n"); +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) /* intialize interlace handling. If image is not interlaced, this will set pass to 1 */ - num_pass = png_set_interlace_handling(png_ptr); + num_pass = modpng14_set_interlace_handling(modpng14_ptr); #else num_pass = 1; #endif @@ -706,112 +706,112 @@ for (pass = 0; pass < num_pass; pass++) { /* loop through image */ - for (i = 0, rp = image; i < png_ptr->height; i++, rp++) + for (i = 0, rp = image; i < modpng14_ptr->height; i++, rp++) { - png_write_row(png_ptr, *rp); + modpng14_write_row(modpng14_ptr, *rp); } } } /* called by user to write a row of image data */ -void PNGAPI -png_write_row(png_structp png_ptr, png_bytep row) +void MODPNG14API +modpng14_write_row(modpng14_structp modpng14_ptr, modpng14_bytep row) { - png_debug2(1, "in png_write_row (row %ld, pass %d)\n", - png_ptr->row_number, png_ptr->pass); + modpng14_debug2(1, "in modpng14_write_row (row %ld, pass %d)\n", + modpng14_ptr->row_number, modpng14_ptr->pass); /* initialize transformations and other stuff if first time */ - if (png_ptr->row_number == 0 && png_ptr->pass == 0) + if (modpng14_ptr->row_number == 0 && modpng14_ptr->pass == 0) { /* make sure we wrote the header info */ - if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) - png_error(png_ptr, - "png_write_info was never called before png_write_row."); + if (!(modpng14_ptr->mode & MODPNG14_WROTE_INFO_BEFORE_PLTE)) + modpng14_error(modpng14_ptr, + "modpng14_write_info was never called before modpng14_write_row."); /* check for transforms that have been set but were defined out */ -#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_INVERT_SUPPORTED) && defined(MODPNG14_READ_INVERT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_MONO) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_INVERT_SUPPORTED is not defined."); #endif -#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_FILLER_SUPPORTED) && defined(MODPNG14_READ_FILLER_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_FILLER) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_FILLER_SUPPORTED is not defined."); #endif -#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) && defined(MODPNG14_READ_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_PACKSWAP_SUPPORTED is not defined."); #endif -#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_PACK_SUPPORTED) && defined(MODPNG14_READ_PACK_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACK) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_PACK_SUPPORTED is not defined."); #endif -#if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_SHIFT_SUPPORTED) && defined(MODPNG14_READ_SHIFT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SHIFT) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_SHIFT_SUPPORTED is not defined."); #endif -#if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_BGR_SUPPORTED) && defined(MODPNG14_READ_BGR_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BGR) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_BGR_SUPPORTED is not defined."); #endif -#if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined."); +#if !defined(MODPNG14_WRITE_SWAP_SUPPORTED) && defined(MODPNG14_READ_SWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SWAP_BYTES) + modpng14_warning(modpng14_ptr, "MODPNG14_WRITE_SWAP_SUPPORTED is not defined."); #endif - png_write_start_row(png_ptr); + modpng14_write_start_row(modpng14_ptr); } -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) /* if interlaced and not interested in row, return */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) + if (modpng14_ptr->interlaced && (modpng14_ptr->transformations & MODPNG14_INTERLACE)) { - switch (png_ptr->pass) + switch (modpng14_ptr->pass) { case 0: - if (png_ptr->row_number & 0x07) + if (modpng14_ptr->row_number & 0x07) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) + if ((modpng14_ptr->row_number & 0x07) || modpng14_ptr->width < 5) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; case 2: - if ((png_ptr->row_number & 0x07) != 4) + if ((modpng14_ptr->row_number & 0x07) != 4) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; case 3: - if ((png_ptr->row_number & 0x03) || png_ptr->width < 3) + if ((modpng14_ptr->row_number & 0x03) || modpng14_ptr->width < 3) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; case 4: - if ((png_ptr->row_number & 0x03) != 2) + if ((modpng14_ptr->row_number & 0x03) != 2) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; case 5: - if ((png_ptr->row_number & 0x01) || png_ptr->width < 2) + if ((modpng14_ptr->row_number & 0x01) || modpng14_ptr->width < 2) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; case 6: - if (!(png_ptr->row_number & 0x01)) + if (!(modpng14_ptr->row_number & 0x01)) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } break; @@ -820,90 +820,90 @@ #endif /* set up row info for transformations */ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->usr_width; - png_ptr->row_info.channels = png_ptr->usr_channels; - png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth; - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - - png_ptr->row_info.rowbytes = ((png_ptr->row_info.width * - (png_uint_32)png_ptr->row_info.pixel_depth + 7) >> 3); - - png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type); - png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width); - png_debug1(3, "row_info->channels = %d\n", png_ptr->row_info.channels); - png_debug1(3, "row_info->bit_depth = %d\n", png_ptr->row_info.bit_depth); - png_debug1(3, "row_info->pixel_depth = %d\n", png_ptr->row_info.pixel_depth); - png_debug1(3, "row_info->rowbytes = %lu\n", png_ptr->row_info.rowbytes); + modpng14_ptr->row_info.color_type = modpng14_ptr->color_type; + modpng14_ptr->row_info.width = modpng14_ptr->usr_width; + modpng14_ptr->row_info.channels = modpng14_ptr->usr_channels; + modpng14_ptr->row_info.bit_depth = modpng14_ptr->usr_bit_depth; + modpng14_ptr->row_info.pixel_depth = (modpng14_byte)(modpng14_ptr->row_info.bit_depth * + modpng14_ptr->row_info.channels); + + modpng14_ptr->row_info.rowbytes = ((modpng14_ptr->row_info.width * + (modpng14_uint_32)modpng14_ptr->row_info.pixel_depth + 7) >> 3); + + modpng14_debug1(3, "row_info->color_type = %d\n", modpng14_ptr->row_info.color_type); + modpng14_debug1(3, "row_info->width = %lu\n", modpng14_ptr->row_info.width); + modpng14_debug1(3, "row_info->channels = %d\n", modpng14_ptr->row_info.channels); + modpng14_debug1(3, "row_info->bit_depth = %d\n", modpng14_ptr->row_info.bit_depth); + modpng14_debug1(3, "row_info->pixel_depth = %d\n", modpng14_ptr->row_info.pixel_depth); + modpng14_debug1(3, "row_info->rowbytes = %lu\n", modpng14_ptr->row_info.rowbytes); /* Copy user's row into buffer, leaving room for filter byte. */ - png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row, - png_ptr->row_info.rowbytes); + modpng14_memcpy_check(modpng14_ptr, modpng14_ptr->row_buf + 1, row, + modpng14_ptr->row_info.rowbytes); -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) /* handle interlacing */ - if (png_ptr->interlaced && png_ptr->pass < 6 && - (png_ptr->transformations & PNG_INTERLACE)) + if (modpng14_ptr->interlaced && modpng14_ptr->pass < 6 && + (modpng14_ptr->transformations & MODPNG14_INTERLACE)) { - png_do_write_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass); + modpng14_do_write_interlace(&(modpng14_ptr->row_info), + modpng14_ptr->row_buf + 1, modpng14_ptr->pass); /* this should always get caught above, but still ... */ - if (!(png_ptr->row_info.width)) + if (!(modpng14_ptr->row_info.width)) { - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); return; } } #endif /* handle other transformations */ - if (png_ptr->transformations) - png_do_write_transformations(png_ptr); + if (modpng14_ptr->transformations) + modpng14_do_write_transformations(modpng14_ptr); -#if defined(PNG_MNG_FEATURES_SUPPORTED) +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and + * 1. Libpng was compiled with MODPNG14_MNG_FEATURES_SUPPORTED and * 2. Libpng did not write a PNG signature (this filter_method is only * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and + * 3. The application called modpng14_permit_mng_features with a mask that + * included MODPNG14_FLAG_MNG_FILTER_64 and * 4. The filter_method is 64 and * 5. The color_type is RGB or RGBA */ - if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) + if((modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_FILTER_64) && + (modpng14_ptr->filter_type == MODPNG14_INTRAPIXEL_DIFFERENCING)) { /* Intrapixel differencing */ - png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); + modpng14_do_write_intrapixel(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); } #endif /* Find a filter if necessary, filter the row and write it out. */ - png_write_find_filter(png_ptr, &(png_ptr->row_info)); + modpng14_write_find_filter(modpng14_ptr, &(modpng14_ptr->row_info)); - if (png_ptr->write_row_fn != NULL) - (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); + if (modpng14_ptr->write_row_fn != NULL) + (*(modpng14_ptr->write_row_fn))(modpng14_ptr, modpng14_ptr->row_number, modpng14_ptr->pass); } -#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) /* Set the automatic flush interval or 0 to turn flushing off */ -void PNGAPI -png_set_flush(png_structp png_ptr, int nrows) +void MODPNG14API +modpng14_set_flush(modpng14_structp modpng14_ptr, int nrows) { - png_debug(1, "in png_set_flush\n"); - png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); + modpng14_debug(1, "in modpng14_set_flush\n"); + modpng14_ptr->flush_dist = (nrows < 0 ? 0 : nrows); } /* flush the current output buffers now */ -void PNGAPI -png_write_flush(png_structp png_ptr) +void MODPNG14API +modpng14_write_flush(modpng14_structp modpng14_ptr) { int wrote_IDAT; - png_debug(1, "in png_write_flush\n"); + modpng14_debug(1, "in modpng14_write_flush\n"); /* We have already written out all of the data */ - if (png_ptr->row_number >= png_ptr->num_rows) + if (modpng14_ptr->row_number >= modpng14_ptr->num_rows) return; do @@ -911,61 +911,61 @@ int ret; /* compress the data */ - ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH); + ret = deflate(&modpng14_ptr->zstream, Z_SYNC_FLUSH); wrote_IDAT = 0; /* check for compression errors */ if (ret != Z_OK) { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); + if (modpng14_ptr->zstream.msg != NULL) + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg); else - png_error(png_ptr, "zlib error"); + modpng14_error(modpng14_ptr, "zlib error"); } - if (!(png_ptr->zstream.avail_out)) + if (!(modpng14_ptr->zstream.avail_out)) { /* write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_write_IDAT(modpng14_ptr, modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; wrote_IDAT = 1; } } while(wrote_IDAT == 1); /* If there is any data left to be output, write it into a new IDAT */ - if (png_ptr->zbuf_size != png_ptr->zstream.avail_out) + if (modpng14_ptr->zbuf_size != modpng14_ptr->zstream.avail_out) { /* write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_write_IDAT(modpng14_ptr, modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; } - png_ptr->flush_rows = 0; - png_flush(png_ptr); + modpng14_ptr->flush_rows = 0; + modpng14_flush(modpng14_ptr); } -#endif /* PNG_WRITE_FLUSH_SUPPORTED */ +#endif /* MODPNG14_WRITE_FLUSH_SUPPORTED */ /* free all memory used by the write */ -void PNGAPI -png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) +void MODPNG14API +modpng14_destroy_write_struct(modpng14_structpp modpng14_ptr_ptr, modpng14_infopp info_ptr_ptr) { - png_structp png_ptr = NULL; - png_infop info_ptr = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn = NULL; - png_voidp mem_ptr = NULL; -#endif - - png_debug(1, "in png_destroy_write_struct\n"); - if (png_ptr_ptr != NULL) - { - png_ptr = *png_ptr_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; + modpng14_structp modpng14_ptr = NULL; + modpng14_infop info_ptr = NULL; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_free_ptr free_fn = NULL; + modpng14_voidp mem_ptr = NULL; +#endif + + modpng14_debug(1, "in modpng14_destroy_write_struct\n"); + if (modpng14_ptr_ptr != NULL) + { + modpng14_ptr = *modpng14_ptr_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + free_fn = modpng14_ptr->free_fn; + mem_ptr = modpng14_ptr->mem_ptr; #endif } @@ -974,128 +974,128 @@ if (info_ptr != NULL) { - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); + modpng14_free_data(modpng14_ptr, info_ptr, MODPNG14_FREE_ALL, -1); -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->num_chunk_list) +#if defined(MODPNG14_UNKNOWN_CHUNKS_SUPPORTED) + if (modpng14_ptr->num_chunk_list) { - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - png_ptr->num_chunk_list=0; + modpng14_free(modpng14_ptr, modpng14_ptr->chunk_list); + modpng14_ptr->chunk_list=NULL; + modpng14_ptr->num_chunk_list=0; } #endif -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)info_ptr, (modpng14_free_ptr)free_fn, + (modpng14_voidp)mem_ptr); #else - png_destroy_struct((png_voidp)info_ptr); + modpng14_destroy_struct((modpng14_voidp)info_ptr); #endif *info_ptr_ptr = NULL; } - if (png_ptr != NULL) + if (modpng14_ptr != NULL) { - png_write_destroy(png_ptr); -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); + modpng14_write_destroy(modpng14_ptr); +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2((modpng14_voidp)modpng14_ptr, (modpng14_free_ptr)free_fn, + (modpng14_voidp)mem_ptr); #else - png_destroy_struct((png_voidp)png_ptr); + modpng14_destroy_struct((modpng14_voidp)modpng14_ptr); #endif - *png_ptr_ptr = NULL; + *modpng14_ptr_ptr = NULL; } } -/* Free any memory used in png_ptr struct (old method) */ +/* Free any memory used in modpng14_ptr struct (old method) */ void /* PRIVATE */ -png_write_destroy(png_structp png_ptr) +modpng14_write_destroy(modpng14_structp modpng14_ptr) { -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* save jump buffer */ #endif - png_error_ptr error_fn; - png_error_ptr warning_fn; - png_voidp error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; + modpng14_error_ptr error_fn; + modpng14_error_ptr warning_fn; + modpng14_voidp error_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_free_ptr free_fn; #endif - png_debug(1, "in png_write_destroy\n"); + modpng14_debug(1, "in modpng14_write_destroy\n"); /* free any memory zlib uses */ - deflateEnd(&png_ptr->zstream); + deflateEnd(&modpng14_ptr->zstream); - /* free our memory. png_free checks NULL for us. */ - png_free(png_ptr, png_ptr->zbuf); - png_free(png_ptr, png_ptr->row_buf); - png_free(png_ptr, png_ptr->prev_row); - png_free(png_ptr, png_ptr->sub_row); - png_free(png_ptr, png_ptr->up_row); - png_free(png_ptr, png_ptr->avg_row); - png_free(png_ptr, png_ptr->paeth_row); - -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_free(png_ptr, png_ptr->time_buffer); -#endif - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_free(png_ptr, png_ptr->prev_filters); - png_free(png_ptr, png_ptr->filter_weights); - png_free(png_ptr, png_ptr->inv_filter_weights); - png_free(png_ptr, png_ptr->filter_costs); - png_free(png_ptr, png_ptr->inv_filter_costs); + /* free our memory. modpng14_free checks NULL for us. */ + modpng14_free(modpng14_ptr, modpng14_ptr->zbuf); + modpng14_free(modpng14_ptr, modpng14_ptr->row_buf); + modpng14_free(modpng14_ptr, modpng14_ptr->prev_row); + modpng14_free(modpng14_ptr, modpng14_ptr->sub_row); + modpng14_free(modpng14_ptr, modpng14_ptr->up_row); + modpng14_free(modpng14_ptr, modpng14_ptr->avg_row); + modpng14_free(modpng14_ptr, modpng14_ptr->paeth_row); + +#if defined(MODPNG14_TIME_RFC1123_SUPPORTED) + modpng14_free(modpng14_ptr, modpng14_ptr->time_buffer); +#endif + +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + modpng14_free(modpng14_ptr, modpng14_ptr->prev_filters); + modpng14_free(modpng14_ptr, modpng14_ptr->filter_weights); + modpng14_free(modpng14_ptr, modpng14_ptr->inv_filter_weights); + modpng14_free(modpng14_ptr, modpng14_ptr->filter_costs); + modpng14_free(modpng14_ptr, modpng14_ptr->inv_filter_costs); #endif -#ifdef PNG_SETJMP_SUPPORTED +#ifdef MODPNG14_SETJMP_SUPPORTED /* reset structure */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, sizeof (jmp_buf)); + modpng14_memcpy(tmp_jmp, modpng14_ptr->jmpbuf, sizeof (jmp_buf)); #endif - error_fn = png_ptr->error_fn; - warning_fn = png_ptr->warning_fn; - error_ptr = png_ptr->error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; + error_fn = modpng14_ptr->error_fn; + warning_fn = modpng14_ptr->warning_fn; + error_ptr = modpng14_ptr->error_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + free_fn = modpng14_ptr->free_fn; #endif - png_memset(png_ptr, 0, sizeof (png_struct)); + modpng14_memset(modpng14_ptr, 0, sizeof (modpng14_struct)); - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; - png_ptr->error_ptr = error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr->free_fn = free_fn; + modpng14_ptr->error_fn = error_fn; + modpng14_ptr->warning_fn = warning_fn; + modpng14_ptr->error_ptr = error_ptr; +#ifdef MODPNG14_USER_MEM_SUPPORTED + modpng14_ptr->free_fn = free_fn; #endif -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); +#ifdef MODPNG14_SETJMP_SUPPORTED + modpng14_memcpy(modpng14_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf)); #endif } /* Allow the application to select one or more row filters to use. */ -void PNGAPI -png_set_filter(png_structp png_ptr, int method, int filters) +void MODPNG14API +modpng14_set_filter(modpng14_structp modpng14_ptr, int method, int filters) { - png_debug(1, "in png_set_filter\n"); -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (method == PNG_INTRAPIXEL_DIFFERENCING)) - method = PNG_FILTER_TYPE_BASE; + modpng14_debug(1, "in modpng14_set_filter\n"); +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + if((modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_FILTER_64) && + (method == MODPNG14_INTRAPIXEL_DIFFERENCING)) + method = MODPNG14_FILTER_TYPE_BASE; #endif - if (method == PNG_FILTER_TYPE_BASE) + if (method == MODPNG14_FILTER_TYPE_BASE) { - switch (filters & (PNG_ALL_FILTERS | 0x07)) + switch (filters & (MODPNG14_ALL_FILTERS | 0x07)) { case 5: case 6: - case 7: png_warning(png_ptr, "Unknown row filter for method 0"); - case PNG_FILTER_VALUE_NONE: png_ptr->do_filter=PNG_FILTER_NONE; break; - case PNG_FILTER_VALUE_SUB: png_ptr->do_filter=PNG_FILTER_SUB; break; - case PNG_FILTER_VALUE_UP: png_ptr->do_filter=PNG_FILTER_UP; break; - case PNG_FILTER_VALUE_AVG: png_ptr->do_filter=PNG_FILTER_AVG; break; - case PNG_FILTER_VALUE_PAETH: png_ptr->do_filter=PNG_FILTER_PAETH;break; - default: png_ptr->do_filter = (png_byte)filters; break; + case 7: modpng14_warning(modpng14_ptr, "Unknown row filter for method 0"); + case MODPNG14_FILTER_VALUE_NONE: modpng14_ptr->do_filter=MODPNG14_FILTER_NONE; break; + case MODPNG14_FILTER_VALUE_SUB: modpng14_ptr->do_filter=MODPNG14_FILTER_SUB; break; + case MODPNG14_FILTER_VALUE_UP: modpng14_ptr->do_filter=MODPNG14_FILTER_UP; break; + case MODPNG14_FILTER_VALUE_AVG: modpng14_ptr->do_filter=MODPNG14_FILTER_AVG; break; + case MODPNG14_FILTER_VALUE_PAETH: modpng14_ptr->do_filter=MODPNG14_FILTER_PAETH;break; + default: modpng14_ptr->do_filter = (modpng14_byte)filters; break; } /* If we have allocated the row_buf, this means we have already started @@ -1107,130 +1107,130 @@ * it should start out with all of the filters, and then add and * remove them after the start of compression. */ - if (png_ptr->row_buf != NULL) + if (modpng14_ptr->row_buf != NULL) { - if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL) + if ((modpng14_ptr->do_filter & MODPNG14_FILTER_SUB) && modpng14_ptr->sub_row == NULL) { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; + modpng14_ptr->sub_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->sub_row[0] = MODPNG14_FILTER_VALUE_SUB; } - if ((png_ptr->do_filter & PNG_FILTER_UP) && png_ptr->up_row == NULL) + if ((modpng14_ptr->do_filter & MODPNG14_FILTER_UP) && modpng14_ptr->up_row == NULL) { - if (png_ptr->prev_row == NULL) + if (modpng14_ptr->prev_row == NULL) { - png_warning(png_ptr, "Can't add Up filter after starting"); - png_ptr->do_filter &= ~PNG_FILTER_UP; + modpng14_warning(modpng14_ptr, "Can't add Up filter after starting"); + modpng14_ptr->do_filter &= ~MODPNG14_FILTER_UP; } else { - png_ptr->up_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; + modpng14_ptr->up_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->up_row[0] = MODPNG14_FILTER_VALUE_UP; } } - if ((png_ptr->do_filter & PNG_FILTER_AVG) && png_ptr->avg_row == NULL) + if ((modpng14_ptr->do_filter & MODPNG14_FILTER_AVG) && modpng14_ptr->avg_row == NULL) { - if (png_ptr->prev_row == NULL) + if (modpng14_ptr->prev_row == NULL) { - png_warning(png_ptr, "Can't add Average filter after starting"); - png_ptr->do_filter &= ~PNG_FILTER_AVG; + modpng14_warning(modpng14_ptr, "Can't add Average filter after starting"); + modpng14_ptr->do_filter &= ~MODPNG14_FILTER_AVG; } else { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; + modpng14_ptr->avg_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->avg_row[0] = MODPNG14_FILTER_VALUE_AVG; } } - if ((png_ptr->do_filter & PNG_FILTER_PAETH) && - png_ptr->paeth_row == NULL) + if ((modpng14_ptr->do_filter & MODPNG14_FILTER_PAETH) && + modpng14_ptr->paeth_row == NULL) { - if (png_ptr->prev_row == NULL) + if (modpng14_ptr->prev_row == NULL) { - png_warning(png_ptr, "Can't add Paeth filter after starting"); - png_ptr->do_filter &= (png_byte)(~PNG_FILTER_PAETH); + modpng14_warning(modpng14_ptr, "Can't add Paeth filter after starting"); + modpng14_ptr->do_filter &= (modpng14_byte)(~MODPNG14_FILTER_PAETH); } else { - png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; + modpng14_ptr->paeth_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->paeth_row[0] = MODPNG14_FILTER_VALUE_PAETH; } } - if (png_ptr->do_filter == PNG_NO_FILTERS) - png_ptr->do_filter = PNG_FILTER_NONE; + if (modpng14_ptr->do_filter == MODPNG14_NO_FILTERS) + modpng14_ptr->do_filter = MODPNG14_FILTER_NONE; } } else - png_error(png_ptr, "Unknown custom filter method"); + modpng14_error(modpng14_ptr, "Unknown custom filter method"); } -/* This allows us to influence the way in which libpng chooses the "best" +/* This allows us to influence the way in which libmodpng14 chooses the "best" * filter for the current scanline. While the "minimum-sum-of-absolute- * differences metric is relatively fast and effective, there is some * question as to whether it can be improved upon by trying to keep the * filtered data going to zlib more consistent, hopefully resulting in * better compression. */ -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* GRR 970116 */ -void PNGAPI -png_set_filter_heuristics(png_structp png_ptr, int heuristic_method, - int num_weights, png_doublep filter_weights, - png_doublep filter_costs) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) /* GRR 970116 */ +void MODPNG14API +modpng14_set_filter_heuristics(modpng14_structp modpng14_ptr, int heuristic_method, + int num_weights, modpng14_doublep filter_weights, + modpng14_doublep filter_costs) { int i; - png_debug(1, "in png_set_filter_heuristics\n"); - if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) + modpng14_debug(1, "in modpng14_set_filter_heuristics\n"); + if (heuristic_method >= MODPNG14_FILTER_HEURISTIC_LAST) { - png_warning(png_ptr, "Unknown filter heuristic method"); + modpng14_warning(modpng14_ptr, "Unknown filter heuristic method"); return; } - if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT) + if (heuristic_method == MODPNG14_FILTER_HEURISTIC_DEFAULT) { - heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED; + heuristic_method = MODPNG14_FILTER_HEURISTIC_UNWEIGHTED; } if (num_weights < 0 || filter_weights == NULL || - heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED) + heuristic_method == MODPNG14_FILTER_HEURISTIC_UNWEIGHTED) { num_weights = 0; } - png_ptr->num_prev_filters = (png_byte)num_weights; - png_ptr->heuristic_method = (png_byte)heuristic_method; + modpng14_ptr->num_prev_filters = (modpng14_byte)num_weights; + modpng14_ptr->heuristic_method = (modpng14_byte)heuristic_method; if (num_weights > 0) { - if (png_ptr->prev_filters == NULL) + if (modpng14_ptr->prev_filters == NULL) { - png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(sizeof(png_byte) * num_weights)); + modpng14_ptr->prev_filters = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(sizeof(modpng14_byte) * num_weights)); /* To make sure that the weighting starts out fairly */ for (i = 0; i < num_weights; i++) { - png_ptr->prev_filters[i] = 255; + modpng14_ptr->prev_filters[i] = 255; } } - if (png_ptr->filter_weights == NULL) + if (modpng14_ptr->filter_weights == NULL) { - png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(sizeof(png_uint_16) * num_weights)); + modpng14_ptr->filter_weights = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(sizeof(modpng14_uint_16) * num_weights)); - png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(sizeof(png_uint_16) * num_weights)); + modpng14_ptr->inv_filter_weights = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(sizeof(modpng14_uint_16) * num_weights)); for (i = 0; i < num_weights; i++) { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; + modpng14_ptr->inv_filter_weights[i] = + modpng14_ptr->filter_weights[i] = MODPNG14_WEIGHT_FACTOR; } } @@ -1238,34 +1238,34 @@ { if (filter_weights[i] < 0.0) { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; + modpng14_ptr->inv_filter_weights[i] = + modpng14_ptr->filter_weights[i] = MODPNG14_WEIGHT_FACTOR; } else { - png_ptr->inv_filter_weights[i] = - (png_uint_16)((double)PNG_WEIGHT_FACTOR*filter_weights[i]+0.5); - png_ptr->filter_weights[i] = - (png_uint_16)((double)PNG_WEIGHT_FACTOR/filter_weights[i]+0.5); + modpng14_ptr->inv_filter_weights[i] = + (modpng14_uint_16)((double)MODPNG14_WEIGHT_FACTOR*filter_weights[i]+0.5); + modpng14_ptr->filter_weights[i] = + (modpng14_uint_16)((double)MODPNG14_WEIGHT_FACTOR/filter_weights[i]+0.5); } } } /* If, in the future, there are other filter methods, this would - * need to be based on png_ptr->filter. + * need to be based on modpng14_ptr->filter. */ - if (png_ptr->filter_costs == NULL) + if (modpng14_ptr->filter_costs == NULL) { - png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); + modpng14_ptr->filter_costs = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(sizeof(modpng14_uint_16) * MODPNG14_FILTER_VALUE_LAST)); - png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); + modpng14_ptr->inv_filter_costs = (modpng14_uint_16p)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(sizeof(modpng14_uint_16) * MODPNG14_FILTER_VALUE_LAST)); - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) + for (i = 0; i < MODPNG14_FILTER_VALUE_LAST; i++) { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; + modpng14_ptr->inv_filter_costs[i] = + modpng14_ptr->filter_costs[i] = MODPNG14_COST_FACTOR; } } @@ -1276,175 +1276,175 @@ * compression settings. The filter types are in order of increasing * relative cost, so it would be possible to do this with an algorithm. */ - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) + for (i = 0; i < MODPNG14_FILTER_VALUE_LAST; i++) { if (filter_costs == NULL || filter_costs[i] < 0.0) { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; + modpng14_ptr->inv_filter_costs[i] = + modpng14_ptr->filter_costs[i] = MODPNG14_COST_FACTOR; } else if (filter_costs[i] >= 1.0) { - png_ptr->inv_filter_costs[i] = - (png_uint_16)((double)PNG_COST_FACTOR / filter_costs[i] + 0.5); - png_ptr->filter_costs[i] = - (png_uint_16)((double)PNG_COST_FACTOR * filter_costs[i] + 0.5); + modpng14_ptr->inv_filter_costs[i] = + (modpng14_uint_16)((double)MODPNG14_COST_FACTOR / filter_costs[i] + 0.5); + modpng14_ptr->filter_costs[i] = + (modpng14_uint_16)((double)MODPNG14_COST_FACTOR * filter_costs[i] + 0.5); } } } -#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ +#endif /* MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED */ -void PNGAPI -png_set_compression_level(png_structp png_ptr, int level) +void MODPNG14API +modpng14_set_compression_level(modpng14_structp modpng14_ptr, int level) { - png_debug(1, "in png_set_compression_level\n"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; - png_ptr->zlib_level = level; + modpng14_debug(1, "in modpng14_set_compression_level\n"); + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_CUSTOM_LEVEL; + modpng14_ptr->zlib_level = level; } -void PNGAPI -png_set_compression_mem_level(png_structp png_ptr, int mem_level) +void MODPNG14API +modpng14_set_compression_mem_level(modpng14_structp modpng14_ptr, int mem_level) { - png_debug(1, "in png_set_compression_mem_level\n"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; - png_ptr->zlib_mem_level = mem_level; + modpng14_debug(1, "in modpng14_set_compression_mem_level\n"); + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_CUSTOM_MEM_LEVEL; + modpng14_ptr->zlib_mem_level = mem_level; } -void PNGAPI -png_set_compression_strategy(png_structp png_ptr, int strategy) +void MODPNG14API +modpng14_set_compression_strategy(modpng14_structp modpng14_ptr, int strategy) { - png_debug(1, "in png_set_compression_strategy\n"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; - png_ptr->zlib_strategy = strategy; + modpng14_debug(1, "in modpng14_set_compression_strategy\n"); + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_CUSTOM_STRATEGY; + modpng14_ptr->zlib_strategy = strategy; } -void PNGAPI -png_set_compression_window_bits(png_structp png_ptr, int window_bits) +void MODPNG14API +modpng14_set_compression_window_bits(modpng14_structp modpng14_ptr, int window_bits) { if (window_bits > 15) - png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); + modpng14_warning(modpng14_ptr, "Only compression windows <= 32k supported by PNG"); else if (window_bits < 8) - png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); + modpng14_warning(modpng14_ptr, "Only compression windows >= 256 supported by PNG"); #ifndef WBITS_8_OK - /* avoid libpng bug with 256-byte windows */ + /* avoid libmodpng14 bug with 256-byte windows */ if (window_bits == 8) { - png_warning(png_ptr, "Compression window is being reset to 512"); + modpng14_warning(modpng14_ptr, "Compression window is being reset to 512"); window_bits=9; } #endif - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS; - png_ptr->zlib_window_bits = window_bits; + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_CUSTOM_WINDOW_BITS; + modpng14_ptr->zlib_window_bits = window_bits; } -void PNGAPI -png_set_compression_method(png_structp png_ptr, int method) +void MODPNG14API +modpng14_set_compression_method(modpng14_structp modpng14_ptr, int method) { - png_debug(1, "in png_set_compression_method\n"); + modpng14_debug(1, "in modpng14_set_compression_method\n"); if (method != 8) - png_warning(png_ptr, "Only compression method 8 is supported by PNG"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD; - png_ptr->zlib_method = method; + modpng14_warning(modpng14_ptr, "Only compression method 8 is supported by PNG"); + modpng14_ptr->flags |= MODPNG14_FLAG_ZLIB_CUSTOM_METHOD; + modpng14_ptr->zlib_method = method; } -void PNGAPI -png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn) +void MODPNG14API +modpng14_set_write_status_fn(modpng14_structp modpng14_ptr, modpng14_write_status_ptr write_row_fn) { - png_ptr->write_row_fn = write_row_fn; + modpng14_ptr->write_row_fn = write_row_fn; } -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -void PNGAPI -png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr +#if defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) +void MODPNG14API +modpng14_set_write_user_transform_fn(modpng14_structp modpng14_ptr, modpng14_user_transform_ptr write_user_transform_fn) { - png_debug(1, "in png_set_write_user_transform_fn\n"); - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->write_user_transform_fn = write_user_transform_fn; + modpng14_debug(1, "in modpng14_set_write_user_transform_fn\n"); + modpng14_ptr->transformations |= MODPNG14_USER_TRANSFORM; + modpng14_ptr->write_user_transform_fn = write_user_transform_fn; } #endif -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_write_png(png_structp png_ptr, png_infop info_ptr, +#if defined(MODPNG14_INFO_IMAGE_SUPPORTED) +void MODPNG14API +modpng14_write_png(modpng14_structp modpng14_ptr, modpng14_infop info_ptr, int transforms, voidp params) { -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +#if defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) /* invert the alpha channel from opacity to transparency */ - if (transforms & PNG_TRANSFORM_INVERT_ALPHA) - png_set_invert_alpha(png_ptr); + if (transforms & MODPNG14_TRANSFORM_INVERT_ALPHA) + modpng14_set_invert_alpha(modpng14_ptr); #endif /* Write the file header information. */ - png_write_info(png_ptr, info_ptr); + modpng14_write_info(modpng14_ptr, info_ptr); /* ------ these transformations don't touch the info structure ------- */ -#if defined(PNG_WRITE_INVERT_SUPPORTED) +#if defined(MODPNG14_WRITE_INVERT_SUPPORTED) /* invert monochrome pixels */ - if (transforms & PNG_TRANSFORM_INVERT_MONO) - png_set_invert_mono(png_ptr); + if (transforms & MODPNG14_TRANSFORM_INVERT_MONO) + modpng14_set_invert_mono(modpng14_ptr); #endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) +#if defined(MODPNG14_WRITE_SHIFT_SUPPORTED) /* Shift the pixels up to a legal bit depth and fill in * as appropriate to correctly scale the image. */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && (info_ptr->valid & PNG_INFO_sBIT)) - png_set_shift(png_ptr, &info_ptr->sig_bit); + if ((transforms & MODPNG14_TRANSFORM_SHIFT) + && (info_ptr->valid & MODPNG14_INFO_sBIT)) + modpng14_set_shift(modpng14_ptr, &info_ptr->sig_bit); #endif -#if defined(PNG_WRITE_PACK_SUPPORTED) +#if defined(MODPNG14_WRITE_PACK_SUPPORTED) /* pack pixels into bytes */ - if (transforms & PNG_TRANSFORM_PACKING) - png_set_packing(png_ptr); + if (transforms & MODPNG14_TRANSFORM_PACKING) + modpng14_set_packing(modpng14_ptr); #endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +#if defined(MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED) /* swap location of alpha bytes from ARGB to RGBA */ - if (transforms & PNG_TRANSFORM_SWAP_ALPHA) - png_set_swap_alpha(png_ptr); + if (transforms & MODPNG14_TRANSFORM_SWAP_ALPHA) + modpng14_set_swap_alpha(modpng14_ptr); #endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) +#if defined(MODPNG14_WRITE_FILLER_SUPPORTED) /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into * RGB (4 channels -> 3 channels). The second parameter is not used. */ - if (transforms & PNG_TRANSFORM_STRIP_FILLER) - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + if (transforms & MODPNG14_TRANSFORM_STRIP_FILLER) + modpng14_set_filler(modpng14_ptr, 0, MODPNG14_FILLER_BEFORE); #endif -#if defined(PNG_WRITE_BGR_SUPPORTED) +#if defined(MODPNG14_WRITE_BGR_SUPPORTED) /* flip BGR pixels to RGB */ - if (transforms & PNG_TRANSFORM_BGR) - png_set_bgr(png_ptr); + if (transforms & MODPNG14_TRANSFORM_BGR) + modpng14_set_bgr(modpng14_ptr); #endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) +#if defined(MODPNG14_WRITE_SWAP_SUPPORTED) /* swap bytes of 16-bit files to most significant byte first */ - if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) - png_set_swap(png_ptr); + if (transforms & MODPNG14_TRANSFORM_SWAP_ENDIAN) + modpng14_set_swap(modpng14_ptr); #endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) +#if defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) /* swap bits of 1, 2, 4 bit packed pixel formats */ - if (transforms & PNG_TRANSFORM_PACKSWAP) - png_set_packswap(png_ptr); + if (transforms & MODPNG14_TRANSFORM_PACKSWAP) + modpng14_set_packswap(modpng14_ptr); #endif /* ----------------------- end of transformations ------------------- */ /* write the bits */ - if (info_ptr->valid & PNG_INFO_IDAT) - png_write_image(png_ptr, info_ptr->row_pointers); + if (info_ptr->valid & MODPNG14_INFO_IDAT) + modpng14_write_image(modpng14_ptr, info_ptr->row_pointers); /* It is REQUIRED to call this to finish writing the rest of the file */ - png_write_end(png_ptr, info_ptr); + modpng14_write_end(modpng14_ptr, info_ptr); if(transforms == 0 || params == NULL) /* quiet compiler warnings */ return; } #endif -#endif /* PNG_WRITE_SUPPORTED */ +#endif /* MODPNG14_WRITE_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngwtran.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngwtran.c @@ -1,94 +1,94 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED +#define MODPNG14_INTERNAL +#include "modpng14.h" +#ifdef MODPNG14_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) +modpng14_do_write_transformations(modpng14_structp modpng14_ptr) { - png_debug(1, "in png_do_write_transformations\n"); + modpng14_debug(1, "in modpng14_do_write_transformations\n"); - if (png_ptr == NULL) + if (modpng14_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); +#if defined(MODPNG14_WRITE_USER_TRANSFORM_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_USER_TRANSFORM) + if(modpng14_ptr->write_user_transform_fn != NULL) + (*(modpng14_ptr->write_user_transform_fn)) /* user write transform function */ + (modpng14_ptr, /* modpng14_ptr */ + &(modpng14_ptr->row_info), /* row_info: */ + /* modpng14_uint_32 width; width of row */ + /* modpng14_uint_32 rowbytes; number of bytes in row */ + /* modpng14_byte color_type; color type of pixels */ + /* modpng14_byte bit_depth; bit depth of samples */ + /* modpng14_byte channels; number of channels (1-4) */ + /* modpng14_byte pixel_depth; bits per pixel (depth*channels) */ + modpng14_ptr->row_buf + 1); /* start of pixel data for row */ +#endif +#if defined(MODPNG14_WRITE_FILLER_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_FILLER) + modpng14_do_strip_filler(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + modpng14_ptr->flags); +#endif +#if defined(MODPNG14_WRITE_PACKSWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACKSWAP) + modpng14_do_packswap(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); +#endif +#if defined(MODPNG14_WRITE_PACK_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_PACK) + modpng14_do_pack(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + (modpng14_uint_32)modpng14_ptr->bit_depth); +#endif +#if defined(MODPNG14_WRITE_SWAP_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SWAP_BYTES) + modpng14_do_swap(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); +#endif +#if defined(MODPNG14_WRITE_SHIFT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SHIFT) + modpng14_do_shift(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1, + &(modpng14_ptr->shift)); +#endif +#if defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_ALPHA) + modpng14_do_write_invert_alpha(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); +#endif +#if defined(MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_SWAP_ALPHA) + modpng14_do_write_swap_alpha(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); +#endif +#if defined(MODPNG14_WRITE_BGR_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_BGR) + modpng14_do_bgr(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); +#endif +#if defined(MODPNG14_WRITE_INVERT_SUPPORTED) + if (modpng14_ptr->transformations & MODPNG14_INVERT_MONO) + modpng14_do_invert(&(modpng14_ptr->row_info), modpng14_ptr->row_buf + 1); #endif } -#if defined(PNG_WRITE_PACK_SUPPORTED) +#if defined(MODPNG14_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) +modpng14_do_pack(modpng14_row_infop row_info, modpng14_bytep row, modpng14_uint_32 bit_depth) { - png_debug(1, "in png_do_pack\n"); + modpng14_debug(1, "in modpng14_do_pack\n"); if (row_info->bit_depth == 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif row_info->channels == 1) @@ -97,10 +97,10 @@ { case 1: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int mask, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; sp = row; dp = row; @@ -117,21 +117,21 @@ else { mask = 0x80; - *dp = (png_byte)v; + *dp = (modpng14_byte)v; dp++; v = 0; } } if (mask != 0x80) - *dp = (png_byte)v; + *dp = (modpng14_byte)v; break; } case 2: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int shift, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; sp = row; dp = row; @@ -139,14 +139,14 @@ v = 0; for (i = 0; i < row_width; i++) { - png_byte value; + modpng14_byte value; - value = (png_byte)(*sp & 0x03); + value = (modpng14_byte)(*sp & 0x03); v |= (value << shift); if (shift == 0) { shift = 6; - *dp = (png_byte)v; + *dp = (modpng14_byte)v; dp++; v = 0; } @@ -155,15 +155,15 @@ sp++; } if (shift != 6) - *dp = (png_byte)v; + *dp = (modpng14_byte)v; break; } case 4: { - png_bytep sp, dp; + modpng14_bytep sp, dp; int shift, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; sp = row; dp = row; @@ -171,15 +171,15 @@ v = 0; for (i = 0; i < row_width; i++) { - png_byte value; + modpng14_byte value; - value = (png_byte)(*sp & 0x0f); + value = (modpng14_byte)(*sp & 0x0f); v |= (value << shift); if (shift == 0) { shift = 4; - *dp = (png_byte)v; + *dp = (modpng14_byte)v; dp++; v = 0; } @@ -189,19 +189,19 @@ sp++; } if (shift != 4) - *dp = (png_byte)v; + *dp = (modpng14_byte)v; break; } } - row_info->bit_depth = (png_byte)bit_depth; - row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels); + row_info->bit_depth = (modpng14_byte)bit_depth; + row_info->pixel_depth = (modpng14_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) +#if defined(MODPNG14_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 @@ -210,20 +210,20 @@ * data to 0 to 15. */ void /* PRIVATE */ -png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) +modpng14_do_shift(modpng14_row_infop row_info, modpng14_bytep row, modpng14_color_8p bit_depth) { - png_debug(1, "in png_do_shift\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_shift\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && #else if ( #endif - row_info->color_type != PNG_COLOR_TYPE_PALETTE) + row_info->color_type != MODPNG14_COLOR_TYPE_PALETTE) { int shift_start[4], shift_dec[4]; int channels = 0; - if (row_info->color_type & PNG_COLOR_MASK_COLOR) + if (row_info->color_type & MODPNG14_COLOR_MASK_COLOR) { shift_start[channels] = row_info->bit_depth - bit_depth->red; shift_dec[channels] = bit_depth->red; @@ -241,7 +241,7 @@ shift_dec[channels] = bit_depth->gray; channels++; } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) + if (row_info->color_type & MODPNG14_COLOR_MASK_ALPHA) { shift_start[channels] = row_info->bit_depth - bit_depth->alpha; shift_dec[channels] = bit_depth->alpha; @@ -251,10 +251,10 @@ /* 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; + modpng14_bytep bp = row; + modpng14_uint_32 i; + modpng14_byte mask; + modpng14_uint_32 row_bytes = row_info->rowbytes; if (bit_depth->gray == 1 && row_info->bit_depth == 2) mask = 0x55; @@ -265,7 +265,7 @@ for (i = 0; i < row_bytes; i++, bp++) { - png_uint_16 v; + modpng14_uint_16 v; int j; v = *bp; @@ -273,22 +273,22 @@ for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0]) { if (j > 0) - *bp |= (png_byte)((v << j) & 0xff); + *bp |= (modpng14_byte)((v << j) & 0xff); else - *bp |= (png_byte)((v >> (-j)) & mask); + *bp |= (modpng14_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; + modpng14_bytep bp = row; + modpng14_uint_32 i; + modpng14_uint_32 istop = channels * row_info->width; for (i = 0; i < istop; i++, bp++) { - png_uint_16 v; + modpng14_uint_16 v; int j; int c = (int)(i%channels); @@ -297,61 +297,61 @@ for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) { if (j > 0) - *bp |= (png_byte)((v << j) & 0xff); + *bp |= (modpng14_byte)((v << j) & 0xff); else - *bp |= (png_byte)((v >> (-j)) & 0xff); + *bp |= (modpng14_byte)((v >> (-j)) & 0xff); } } } else { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; + modpng14_bytep bp; + modpng14_uint_32 i; + modpng14_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; + modpng14_uint_16 value, v; int j; - v = (png_uint_16)(((png_uint_16)(*bp) << 8) + *(bp + 1)); + v = (modpng14_uint_16)(((modpng14_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); + value |= (modpng14_uint_16)((v << j) & (modpng14_uint_16)0xffff); else - value |= (png_uint_16)((v >> (-j)) & (png_uint_16)0xffff); + value |= (modpng14_uint_16)((v >> (-j)) & (modpng14_uint_16)0xffff); } - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); + *bp++ = (modpng14_byte)(value >> 8); + *bp++ = (modpng14_byte)(value & 0xff); } } } } #endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +#if defined(MODPNG14_WRITE_SWAP_ALPHA_SUPPORTED) void /* PRIVATE */ -png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) +modpng14_do_write_swap_alpha(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_write_swap_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_write_swap_alpha\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (row_info->color_type == MODPNG14_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; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { - png_byte save = *(sp++); + modpng14_byte save = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); @@ -361,13 +361,13 @@ /* This converts from AARRGGBB to RRGGBBAA */ else { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { - png_byte save[2]; + modpng14_byte save[2]; save[0] = *(sp++); save[1] = *(sp++); *(dp++) = *(sp++); @@ -381,18 +381,18 @@ } } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + else if (row_info->color_type == MODPNG14_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; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { - png_byte save = *(sp++); + modpng14_byte save = *(sp++); *(dp++) = *(sp++); *(dp++) = save; } @@ -400,13 +400,13 @@ /* This converts from AAGG to GGAA */ else { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { - png_byte save[2]; + modpng14_byte save[2]; save[0] = *(sp++); save[1] = *(sp++); *(dp++) = *(sp++); @@ -420,37 +420,37 @@ } #endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +#if defined(MODPNG14_WRITE_INVERT_ALPHA_SUPPORTED) void /* PRIVATE */ -png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) +modpng14_do_write_invert_alpha(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_write_invert_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + modpng14_debug(1, "in modpng14_do_write_invert_alpha\n"); +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (row_info->color_type == MODPNG14_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; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_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++)); + *(dp++) = (modpng14_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; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { @@ -460,39 +460,39 @@ *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); + *(dp++) = (modpng14_byte)(255 - *(sp++)); + *(dp++) = (modpng14_byte)(255 - *(sp++)); } } } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + else if (row_info->color_type == MODPNG14_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; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); + *(dp++) = (modpng14_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; + modpng14_bytep sp, dp; + modpng14_uint_32 i; + modpng14_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++)); + *(dp++) = (modpng14_byte)(255 - *(sp++)); + *(dp++) = (modpng14_byte)(255 - *(sp++)); } } } @@ -500,64 +500,64 @@ } #endif -#if defined(PNG_MNG_FEATURES_SUPPORTED) +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) /* undoes intrapixel differencing */ void /* PRIVATE */ -png_do_write_intrapixel(png_row_infop row_info, png_bytep row) +modpng14_do_write_intrapixel(modpng14_row_infop row_info, modpng14_bytep row) { - png_debug(1, "in png_do_write_intrapixel\n"); + modpng14_debug(1, "in modpng14_do_write_intrapixel\n"); if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && #endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) + (row_info->color_type & MODPNG14_COLOR_MASK_COLOR)) { int bytes_per_pixel; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 row_width = row_info->width; if (row_info->bit_depth == 8) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) bytes_per_pixel = 3; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (row_info->color_type == MODPNG14_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); + *(rp) = (modpng14_byte)((*rp - *(rp+1))&0xff); + *(rp+2) = (modpng14_byte)((*(rp+2) - *(rp+1))&0xff); } } else if (row_info->bit_depth == 16) { - png_bytep rp; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 i; - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->color_type == MODPNG14_COLOR_TYPE_RGB) bytes_per_pixel = 6; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + else if (row_info->color_type == MODPNG14_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); + modpng14_uint_32 s0=*(rp )<<8 | *(rp+1); + modpng14_uint_32 s1=*(rp+2)<<8 | *(rp+3); + modpng14_uint_32 s2=*(rp+4)<<8 | *(rp+5); + modpng14_uint_32 red=(s0-s1)&0xffff; + modpng14_uint_32 blue=(s2-s1)&0xffff; + *(rp ) = (modpng14_byte)((red>>8)&0xff); + *(rp+1) = (modpng14_byte)(red&0xff); + *(rp+4) = (modpng14_byte)((blue>>8)&0xff); + *(rp+5) = (modpng14_byte)(blue&0xff); } } } } -#endif /* PNG_MNG_FEATURES_SUPPORTED */ -#endif /* PNG_WRITE_SUPPORTED */ +#endif /* MODPNG14_MNG_FEATURES_SUPPORTED */ +#endif /* MODPNG14_WRITE_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/pngwutil.c +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/pngwutil.c @@ -1,54 +1,54 @@ /* pngwutil.c - utilities to write a PNG file * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h + * libmodpng14 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in modpng14.h * Copyright (c) 1998-2002 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED +#define MODPNG14_INTERNAL +#include "modpng14.h" +#ifdef MODPNG14_WRITE_SUPPORTED /* Place a 32-bit number into a buffer in PNG byte order. We work * with unsigned numbers for convenience, although one supported * ancillary chunk uses signed (two's complement) numbers. */ void /* PRIVATE */ -png_save_uint_32(png_bytep buf, png_uint_32 i) +modpng14_save_uint_32(modpng14_bytep buf, modpng14_uint_32 i) { - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); + buf[0] = (modpng14_byte)((i >> 24) & 0xff); + buf[1] = (modpng14_byte)((i >> 16) & 0xff); + buf[2] = (modpng14_byte)((i >> 8) & 0xff); + buf[3] = (modpng14_byte)(i & 0xff); } -#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) -/* The png_save_int_32 function assumes integers are stored in two's +#if defined(MODPNG14_WRITE_pCAL_SUPPORTED) || defined(MODPNG14_WRITE_oFFs_SUPPORTED) +/* The modpng14_save_int_32 function assumes integers are stored in two's * complement format. If this isn't the case, then this routine needs to * be modified to write data in two's complement format. */ void /* PRIVATE */ -png_save_int_32(png_bytep buf, png_int_32 i) +modpng14_save_int_32(modpng14_bytep buf, modpng14_int_32 i) { - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); + buf[0] = (modpng14_byte)((i >> 24) & 0xff); + buf[1] = (modpng14_byte)((i >> 16) & 0xff); + buf[2] = (modpng14_byte)((i >> 8) & 0xff); + buf[3] = (modpng14_byte)(i & 0xff); } #endif /* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, + * The parameter is declared unsigned int, not modpng14_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ void /* PRIVATE */ -png_save_uint_16(png_bytep buf, unsigned int i) +modpng14_save_uint_16(modpng14_bytep buf, unsigned int i) { - buf[0] = (png_byte)((i >> 8) & 0xff); - buf[1] = (png_byte)(i & 0xff); + buf[0] = (modpng14_byte)((i >> 8) & 0xff); + buf[1] = (modpng14_byte)(i & 0xff); } /* Write a PNG chunk all at once. The type is an array of ASCII characters @@ -57,86 +57,86 @@ * pre-defined chunk names here, and if you need a new one, define it * where the others are defined. The length is the length of the data. * All the data must be present. If that is not possible, use the - * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end() + * modpng14_write_chunk_start(), modpng14_write_chunk_data(), and modpng14_write_chunk_end() * functions instead. */ -void PNGAPI -png_write_chunk(png_structp png_ptr, png_bytep chunk_name, - png_bytep data, png_size_t length) -{ - png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length); - png_write_chunk_data(png_ptr, data, length); - png_write_chunk_end(png_ptr); +void MODPNG14API +modpng14_write_chunk(modpng14_structp modpng14_ptr, modpng14_bytep chunk_name, + modpng14_bytep data, modpng14_size_t length) +{ + modpng14_write_chunk_start(modpng14_ptr, chunk_name, (modpng14_uint_32)length); + modpng14_write_chunk_data(modpng14_ptr, data, length); + modpng14_write_chunk_end(modpng14_ptr); } /* Write the start of a PNG chunk. The type is the chunk type. * The total_length is the sum of the lengths of all the data you will be - * passing in png_write_chunk_data(). + * passing in modpng14_write_chunk_data(). */ -void PNGAPI -png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name, - png_uint_32 length) +void MODPNG14API +modpng14_write_chunk_start(modpng14_structp modpng14_ptr, modpng14_bytep chunk_name, + modpng14_uint_32 length) { - png_byte buf[4]; - png_debug2(0, "Writing %s chunk (%lu bytes)\n", chunk_name, length); + modpng14_byte buf[4]; + modpng14_debug2(0, "Writing %s chunk (%lu bytes)\n", chunk_name, length); /* write the length */ - png_save_uint_32(buf, length); - png_write_data(png_ptr, buf, (png_size_t)4); + modpng14_save_uint_32(buf, length); + modpng14_write_data(modpng14_ptr, buf, (modpng14_size_t)4); /* write the chunk name */ - png_write_data(png_ptr, chunk_name, (png_size_t)4); + modpng14_write_data(modpng14_ptr, chunk_name, (modpng14_size_t)4); /* reset the crc and run it over the chunk name */ - png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, chunk_name, (png_size_t)4); + modpng14_reset_crc(modpng14_ptr); + modpng14_calculate_crc(modpng14_ptr, chunk_name, (modpng14_size_t)4); } -/* Write the data of a PNG chunk started with png_write_chunk_start(). +/* Write the data of a PNG chunk started with modpng14_write_chunk_start(). * Note that multiple calls to this function are allowed, and that the * sum of the lengths from these calls *must* add up to the total_length - * given to png_write_chunk_start(). + * given to modpng14_write_chunk_start(). */ -void PNGAPI -png_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length) +void MODPNG14API +modpng14_write_chunk_data(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { /* write the data, and run the CRC over it */ if (data != NULL && length > 0) { - png_calculate_crc(png_ptr, data, length); - png_write_data(png_ptr, data, length); + modpng14_calculate_crc(modpng14_ptr, data, length); + modpng14_write_data(modpng14_ptr, data, length); } } -/* Finish a chunk started with png_write_chunk_start(). */ -void PNGAPI -png_write_chunk_end(png_structp png_ptr) +/* Finish a chunk started with modpng14_write_chunk_start(). */ +void MODPNG14API +modpng14_write_chunk_end(modpng14_structp modpng14_ptr) { - png_byte buf[4]; + modpng14_byte buf[4]; /* write the crc */ - png_save_uint_32(buf, png_ptr->crc); + modpng14_save_uint_32(buf, modpng14_ptr->crc); - png_write_data(png_ptr, buf, (png_size_t)4); + modpng14_write_data(modpng14_ptr, buf, (modpng14_size_t)4); } /* Simple function to write the signature. If we have already written * the magic bytes of the signature, or more likely, the PNG stream is * being embedded into another stream and doesn't need its own signature, - * we should call png_set_sig_bytes() to tell libpng how many of the + * we should call modpng14_set_sig_bytes() to tell libmodpng14 how many of the * bytes have already been written. */ void /* PRIVATE */ -png_write_sig(png_structp png_ptr) +modpng14_write_sig(modpng14_structp modpng14_ptr) { - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; + modpng14_byte modpng14_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; /* write the rest of the 8 byte signature */ - png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes], - (png_size_t)8 - png_ptr->sig_bytes); - if(png_ptr->sig_bytes < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; + modpng14_write_data(modpng14_ptr, &modpng14_signature[modpng14_ptr->sig_bytes], + (modpng14_size_t)8 - modpng14_ptr->sig_bytes); + if(modpng14_ptr->sig_bytes < 3) + modpng14_ptr->mode |= MODPNG14_HAVE_MODPNG14_SIGNATURE; } -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED) +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) || defined(MODPNG14_WRITE_iCCP_SUPPORTED) /* * This pair of functions encapsulates the operation of (a) compressing a * text string, and (b) issuing it later as a series of chunk data writes. @@ -150,13 +150,13 @@ int input_len; /* its length */ int num_output_ptr; /* number of output pointers used */ int max_output_ptr; /* size of output_ptr */ - png_charpp output_ptr; /* array of pointers to output */ + modpng14_charpp output_ptr; /* array of pointers to output */ } compression_state; -/* compress given text into storage in the png_ptr structure */ +/* compress given text into storage in the modpng14_ptr structure */ static int /* PRIVATE */ -png_text_compress(png_structp png_ptr, - png_charp text, png_size_t text_len, int compression, +modpng14_text_compress(modpng14_structp modpng14_ptr, + modpng14_charp text, modpng14_size_t text_len, int compression, compression_state *comp) { int ret; @@ -166,21 +166,21 @@ comp->input = NULL; /* we may just want to pass the text right through */ - if (compression == PNG_TEXT_COMPRESSION_NONE) + if (compression == MODPNG14_TEXT_COMPRESSION_NONE) { comp->input = text; comp->input_len = text_len; return((int)text_len); } - if (compression >= PNG_TEXT_COMPRESSION_LAST) + if (compression >= MODPNG14_TEXT_COMPRESSION_LAST) { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char msg[50]; sprintf(msg, "Unknown compression type %d", compression); - png_warning(png_ptr, msg); + modpng14_warning(modpng14_ptr, msg); #else - png_warning(png_ptr, "Unknown compression type"); + modpng14_warning(modpng14_ptr, "Unknown compression type"); #endif } @@ -200,26 +200,26 @@ */ /* set up the compression buffers */ - png_ptr->zstream.avail_in = (uInt)text_len; - png_ptr->zstream.next_in = (Bytef *)text; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = (Bytef *)png_ptr->zbuf; + modpng14_ptr->zstream.avail_in = (uInt)text_len; + modpng14_ptr->zstream.next_in = (Bytef *)text; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = (Bytef *)modpng14_ptr->zbuf; - /* this is the same compression loop as in png_write_row() */ + /* this is the same compression loop as in modpng14_write_row() */ do { /* compress the data */ - ret = deflate(&png_ptr->zstream, Z_NO_FLUSH); + ret = deflate(&modpng14_ptr->zstream, Z_NO_FLUSH); if (ret != Z_OK) { /* error */ - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); + if (modpng14_ptr->zstream.msg != NULL) + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg); else - png_error(png_ptr, "zlib error"); + modpng14_error(modpng14_ptr, "zlib error"); } /* check to see if we need more room */ - if (!png_ptr->zstream.avail_out && png_ptr->zstream.avail_in) + if (!modpng14_ptr->zstream.avail_out && modpng14_ptr->zstream.avail_in) { /* make sure the output array has room */ if (comp->num_output_ptr >= comp->max_output_ptr) @@ -230,44 +230,44 @@ comp->max_output_ptr = comp->num_output_ptr + 4; if (comp->output_ptr != NULL) { - png_charpp old_ptr; + modpng14_charpp old_ptr; old_ptr = comp->output_ptr; - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * sizeof (png_charpp))); - png_memcpy(comp->output_ptr, old_ptr, old_max - * sizeof (png_charp)); - png_free(png_ptr, old_ptr); + comp->output_ptr = (modpng14_charpp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(comp->max_output_ptr * sizeof (modpng14_charpp))); + modpng14_memcpy(comp->output_ptr, old_ptr, old_max + * sizeof (modpng14_charp)); + modpng14_free(modpng14_ptr, old_ptr); } else - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * sizeof (png_charp))); + comp->output_ptr = (modpng14_charpp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(comp->max_output_ptr * sizeof (modpng14_charp))); } /* save the data */ - comp->output_ptr[comp->num_output_ptr] = (png_charp)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, - png_ptr->zbuf_size); + comp->output_ptr[comp->num_output_ptr] = (modpng14_charp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)modpng14_ptr->zbuf_size); + modpng14_memcpy(comp->output_ptr[comp->num_output_ptr], modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size); comp->num_output_ptr++; /* and reset the buffer */ - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; } /* continue until we don't have any more to compress */ - } while (png_ptr->zstream.avail_in); + } while (modpng14_ptr->zstream.avail_in); /* finish the compression */ do { /* tell zlib we are finished */ - ret = deflate(&png_ptr->zstream, Z_FINISH); + ret = deflate(&modpng14_ptr->zstream, Z_FINISH); if (ret == Z_OK) { /* check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) + if (!(modpng14_ptr->zstream.avail_out)) { /* check to make sure our output array has room */ if (comp->num_output_ptr >= comp->max_output_ptr) @@ -278,300 +278,300 @@ comp->max_output_ptr = comp->num_output_ptr + 4; if (comp->output_ptr != NULL) { - png_charpp old_ptr; + modpng14_charpp old_ptr; old_ptr = comp->output_ptr; /* This could be optimized to realloc() */ - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * sizeof (png_charpp))); - png_memcpy(comp->output_ptr, old_ptr, - old_max * sizeof (png_charp)); - png_free(png_ptr, old_ptr); + comp->output_ptr = (modpng14_charpp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(comp->max_output_ptr * sizeof (modpng14_charpp))); + modpng14_memcpy(comp->output_ptr, old_ptr, + old_max * sizeof (modpng14_charp)); + modpng14_free(modpng14_ptr, old_ptr); } else - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * sizeof (png_charp))); + comp->output_ptr = (modpng14_charpp)modpng14_malloc(modpng14_ptr, + (modpng14_uint_32)(comp->max_output_ptr * sizeof (modpng14_charp))); } /* save off the data */ comp->output_ptr[comp->num_output_ptr] = - (png_charp)png_malloc(png_ptr, (png_uint_32)png_ptr->zbuf_size); - png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, - png_ptr->zbuf_size); + (modpng14_charp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)modpng14_ptr->zbuf_size); + modpng14_memcpy(comp->output_ptr[comp->num_output_ptr], modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size); comp->num_output_ptr++; /* and reset the buffer pointers */ - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; } } else if (ret != Z_STREAM_END) { /* we got an error */ - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); + if (modpng14_ptr->zstream.msg != NULL) + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg); else - png_error(png_ptr, "zlib error"); + modpng14_error(modpng14_ptr, "zlib error"); } } while (ret != Z_STREAM_END); /* text length is number of buffers plus last buffer */ - text_len = png_ptr->zbuf_size * comp->num_output_ptr; - if (png_ptr->zstream.avail_out < png_ptr->zbuf_size) - text_len += png_ptr->zbuf_size - (png_size_t)png_ptr->zstream.avail_out; + text_len = modpng14_ptr->zbuf_size * comp->num_output_ptr; + if (modpng14_ptr->zstream.avail_out < modpng14_ptr->zbuf_size) + text_len += modpng14_ptr->zbuf_size - (modpng14_size_t)modpng14_ptr->zstream.avail_out; return((int)text_len); } /* ship the compressed text out via chunk writes */ static void /* PRIVATE */ -png_write_compressed_data_out(png_structp png_ptr, compression_state *comp) +modpng14_write_compressed_data_out(modpng14_structp modpng14_ptr, compression_state *comp) { int i; /* handle the no-compression case */ if (comp->input) { - png_write_chunk_data(png_ptr, (png_bytep)comp->input, - (png_size_t)comp->input_len); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)comp->input, + (modpng14_size_t)comp->input_len); return; } /* write saved output buffers, if any */ for (i = 0; i < comp->num_output_ptr; i++) { - png_write_chunk_data(png_ptr,(png_bytep)comp->output_ptr[i], - png_ptr->zbuf_size); - png_free(png_ptr, comp->output_ptr[i]); + modpng14_write_chunk_data(modpng14_ptr,(modpng14_bytep)comp->output_ptr[i], + modpng14_ptr->zbuf_size); + modpng14_free(modpng14_ptr, comp->output_ptr[i]); comp->output_ptr[i]=NULL; } if (comp->max_output_ptr != 0) - png_free(png_ptr, comp->output_ptr); + modpng14_free(modpng14_ptr, comp->output_ptr); comp->output_ptr=NULL; /* write anything left in zbuf */ - if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size) - png_write_chunk_data(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); + if (modpng14_ptr->zstream.avail_out < (modpng14_uint_32)modpng14_ptr->zbuf_size) + modpng14_write_chunk_data(modpng14_ptr, modpng14_ptr->zbuf, + modpng14_ptr->zbuf_size - modpng14_ptr->zstream.avail_out); /* reset zlib for another zTXt/iTXt or the image data */ - deflateReset(&png_ptr->zstream); + deflateReset(&modpng14_ptr->zstream); } #endif -/* Write the IHDR chunk, and update the png_struct with the necessary +/* Write the IHDR chunk, and update the modpng14_struct with the necessary * information. Note that the rest of this code depends upon this * information being correct. */ void /* PRIVATE */ -png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, +modpng14_write_IHDR(modpng14_structp modpng14_ptr, modpng14_uint_32 width, modpng14_uint_32 height, int bit_depth, int color_type, int compression_type, int filter_type, int interlace_type) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IHDR; #endif - png_byte buf[13]; /* buffer to store the IHDR info */ + modpng14_byte buf[13]; /* buffer to store the IHDR info */ - png_debug(1, "in png_write_IHDR\n"); + modpng14_debug(1, "in modpng14_write_IHDR\n"); /* Check that we have valid input data from the application info */ switch (color_type) { - case PNG_COLOR_TYPE_GRAY: + case MODPNG14_COLOR_TYPE_GRAY: switch (bit_depth) { case 1: case 2: case 4: case 8: - case 16: png_ptr->channels = 1; break; - default: png_error(png_ptr,"Invalid bit depth for grayscale image"); + case 16: modpng14_ptr->channels = 1; break; + default: modpng14_error(modpng14_ptr,"Invalid bit depth for grayscale image"); } break; - case PNG_COLOR_TYPE_RGB: + case MODPNG14_COLOR_TYPE_RGB: if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for RGB image"); - png_ptr->channels = 3; + modpng14_error(modpng14_ptr, "Invalid bit depth for RGB image"); + modpng14_ptr->channels = 3; break; - case PNG_COLOR_TYPE_PALETTE: + case MODPNG14_COLOR_TYPE_PALETTE: switch (bit_depth) { case 1: case 2: case 4: - case 8: png_ptr->channels = 1; break; - default: png_error(png_ptr, "Invalid bit depth for paletted image"); + case 8: modpng14_ptr->channels = 1; break; + default: modpng14_error(modpng14_ptr, "Invalid bit depth for paletted image"); } break; - case PNG_COLOR_TYPE_GRAY_ALPHA: + case MODPNG14_COLOR_TYPE_GRAY_ALPHA: if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for grayscale+alpha image"); - png_ptr->channels = 2; + modpng14_error(modpng14_ptr, "Invalid bit depth for grayscale+alpha image"); + modpng14_ptr->channels = 2; break; - case PNG_COLOR_TYPE_RGB_ALPHA: + case MODPNG14_COLOR_TYPE_RGB_ALPHA: if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for RGBA image"); - png_ptr->channels = 4; + modpng14_error(modpng14_ptr, "Invalid bit depth for RGBA image"); + modpng14_ptr->channels = 4; break; default: - png_error(png_ptr, "Invalid image color type specified"); + modpng14_error(modpng14_ptr, "Invalid image color type specified"); } - if (compression_type != PNG_COMPRESSION_TYPE_BASE) + if (compression_type != MODPNG14_COMPRESSION_TYPE_BASE) { - png_warning(png_ptr, "Invalid compression type specified"); - compression_type = PNG_COMPRESSION_TYPE_BASE; + modpng14_warning(modpng14_ptr, "Invalid compression type specified"); + compression_type = MODPNG14_COMPRESSION_TYPE_BASE; } /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and + * 1. Libpng was compiled with MODPNG14_MNG_FEATURES_SUPPORTED and * 2. Libpng did not write a PNG signature (this filter_method is only * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and + * 3. The application called modpng14_permit_mng_features with a mask that + * included MODPNG14_FLAG_MNG_FILTER_64 and * 4. The filter_method is 64 and * 5. The color_type is RGB or RGBA */ if ( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - !((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING)) && +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + !((modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_FILTER_64) && + ((modpng14_ptr->mode&MODPNG14_HAVE_MODPNG14_SIGNATURE) == 0) && + (color_type == MODPNG14_COLOR_TYPE_RGB || + color_type == MODPNG14_COLOR_TYPE_RGB_ALPHA) && + (filter_type == MODPNG14_INTRAPIXEL_DIFFERENCING)) && #endif - filter_type != PNG_FILTER_TYPE_BASE) + filter_type != MODPNG14_FILTER_TYPE_BASE) { - png_warning(png_ptr, "Invalid filter type specified"); - filter_type = PNG_FILTER_TYPE_BASE; + modpng14_warning(modpng14_ptr, "Invalid filter type specified"); + filter_type = MODPNG14_FILTER_TYPE_BASE; } -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - if (interlace_type != PNG_INTERLACE_NONE && - interlace_type != PNG_INTERLACE_ADAM7) +#ifdef MODPNG14_WRITE_INTERLACING_SUPPORTED + if (interlace_type != MODPNG14_INTERLACE_NONE && + interlace_type != MODPNG14_INTERLACE_ADAM7) { - png_warning(png_ptr, "Invalid interlace type specified"); - interlace_type = PNG_INTERLACE_ADAM7; + modpng14_warning(modpng14_ptr, "Invalid interlace type specified"); + interlace_type = MODPNG14_INTERLACE_ADAM7; } #else - interlace_type=PNG_INTERLACE_NONE; + interlace_type=MODPNG14_INTERLACE_NONE; #endif /* save off the relevent information */ - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->color_type = (png_byte)color_type; - png_ptr->interlaced = (png_byte)interlace_type; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_ptr->filter_type = (png_byte)filter_type; + modpng14_ptr->bit_depth = (modpng14_byte)bit_depth; + modpng14_ptr->color_type = (modpng14_byte)color_type; + modpng14_ptr->interlaced = (modpng14_byte)interlace_type; +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + modpng14_ptr->filter_type = (modpng14_byte)filter_type; #endif - png_ptr->width = width; - png_ptr->height = height; + modpng14_ptr->width = width; + modpng14_ptr->height = height; - png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels); - png_ptr->rowbytes = ((width * (png_size_t)png_ptr->pixel_depth + 7) >> 3); + modpng14_ptr->pixel_depth = (modpng14_byte)(bit_depth * modpng14_ptr->channels); + modpng14_ptr->rowbytes = ((width * (modpng14_size_t)modpng14_ptr->pixel_depth + 7) >> 3); /* set the usr info, so any transformations can modify it */ - png_ptr->usr_width = png_ptr->width; - png_ptr->usr_bit_depth = png_ptr->bit_depth; - png_ptr->usr_channels = png_ptr->channels; + modpng14_ptr->usr_width = modpng14_ptr->width; + modpng14_ptr->usr_bit_depth = modpng14_ptr->bit_depth; + modpng14_ptr->usr_channels = modpng14_ptr->channels; /* pack the header information into the buffer */ - png_save_uint_32(buf, width); - png_save_uint_32(buf + 4, height); - buf[8] = (png_byte)bit_depth; - buf[9] = (png_byte)color_type; - buf[10] = (png_byte)compression_type; - buf[11] = (png_byte)filter_type; - buf[12] = (png_byte)interlace_type; + modpng14_save_uint_32(buf, width); + modpng14_save_uint_32(buf + 4, height); + buf[8] = (modpng14_byte)bit_depth; + buf[9] = (modpng14_byte)color_type; + buf[10] = (modpng14_byte)compression_type; + buf[11] = (modpng14_byte)filter_type; + buf[12] = (modpng14_byte)interlace_type; /* write the chunk */ - png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_IHDR, buf, (modpng14_size_t)13); /* initialize zlib with PNG info */ - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - if (!(png_ptr->do_filter)) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || - png_ptr->bit_depth < 8) - png_ptr->do_filter = PNG_FILTER_NONE; + modpng14_ptr->zstream.zalloc = modpng14_zalloc; + modpng14_ptr->zstream.zfree = modpng14_zfree; + modpng14_ptr->zstream.opaque = (voidpf)modpng14_ptr; + if (!(modpng14_ptr->do_filter)) + { + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE || + modpng14_ptr->bit_depth < 8) + modpng14_ptr->do_filter = MODPNG14_FILTER_NONE; else - png_ptr->do_filter = PNG_ALL_FILTERS; + modpng14_ptr->do_filter = MODPNG14_ALL_FILTERS; } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY)) + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_CUSTOM_STRATEGY)) { - if (png_ptr->do_filter != PNG_FILTER_NONE) - png_ptr->zlib_strategy = Z_FILTERED; + if (modpng14_ptr->do_filter != MODPNG14_FILTER_NONE) + modpng14_ptr->zlib_strategy = Z_FILTERED; else - png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY; + modpng14_ptr->zlib_strategy = Z_DEFAULT_STRATEGY; } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL)) - png_ptr->zlib_level = Z_DEFAULT_COMPRESSION; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL)) - png_ptr->zlib_mem_level = 8; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS)) - png_ptr->zlib_window_bits = 15; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD)) - png_ptr->zlib_method = 8; - deflateInit2(&png_ptr->zstream, png_ptr->zlib_level, - png_ptr->zlib_method, png_ptr->zlib_window_bits, - png_ptr->zlib_mem_level, png_ptr->zlib_strategy); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_CUSTOM_LEVEL)) + modpng14_ptr->zlib_level = Z_DEFAULT_COMPRESSION; + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_CUSTOM_MEM_LEVEL)) + modpng14_ptr->zlib_mem_level = 8; + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_CUSTOM_WINDOW_BITS)) + modpng14_ptr->zlib_window_bits = 15; + if (!(modpng14_ptr->flags & MODPNG14_FLAG_ZLIB_CUSTOM_METHOD)) + modpng14_ptr->zlib_method = 8; + deflateInit2(&modpng14_ptr->zstream, modpng14_ptr->zlib_level, + modpng14_ptr->zlib_method, modpng14_ptr->zlib_window_bits, + modpng14_ptr->zlib_mem_level, modpng14_ptr->zlib_strategy); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; - png_ptr->mode = PNG_HAVE_IHDR; + modpng14_ptr->mode = MODPNG14_HAVE_IHDR; } -/* write the palette. We are careful not to trust png_color to be in the +/* write the palette. We are careful not to trust modpng14_color to be in the * correct order for PNG, so people can redefine it to any convenient * structure. */ void /* PRIVATE */ -png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal) +modpng14_write_PLTE(modpng14_structp modpng14_ptr, modpng14_colorp palette, modpng14_uint_32 num_pal) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_PLTE; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_PLTE; #endif - png_uint_32 i; - png_colorp pal_ptr; - png_byte buf[3]; + modpng14_uint_32 i; + modpng14_colorp pal_ptr; + modpng14_byte buf[3]; - png_debug(1, "in png_write_PLTE\n"); + modpng14_debug(1, "in modpng14_write_PLTE\n"); if (( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) && +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + !(modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_EMPTY_PLTE) && #endif num_pal == 0) || num_pal > 256) { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (modpng14_ptr->color_type == MODPNG14_COLOR_TYPE_PALETTE) { - png_error(png_ptr, "Invalid number of colors in palette"); + modpng14_error(modpng14_ptr, "Invalid number of colors in palette"); } else { - png_warning(png_ptr, "Invalid number of colors in palette"); + modpng14_warning(modpng14_ptr, "Invalid number of colors in palette"); return; } } - if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR)) + if (!(modpng14_ptr->color_type&MODPNG14_COLOR_MASK_COLOR)) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring request to write a PLTE chunk in grayscale PNG"); return; } - png_ptr->num_palette = (png_uint_16)num_pal; - png_debug1(3, "num_palette = %d\n", png_ptr->num_palette); + modpng14_ptr->num_palette = (modpng14_uint_16)num_pal; + modpng14_debug1(3, "num_palette = %d\n", modpng14_ptr->num_palette); - png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, num_pal * 3); -#ifndef PNG_NO_POINTER_INDEXING + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_PLTE, num_pal * 3); +#ifndef MODPNG14_NO_POINTER_INDEXING for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++) { buf[0] = pal_ptr->red; buf[1] = pal_ptr->green; buf[2] = pal_ptr->blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); + modpng14_write_chunk_data(modpng14_ptr, buf, (modpng14_size_t)3); } #else /* This is a little slower but some buggy compilers need to do this instead */ @@ -581,117 +581,117 @@ buf[0] = pal_ptr[i].red; buf[1] = pal_ptr[i].green; buf[2] = pal_ptr[i].blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); + modpng14_write_chunk_data(modpng14_ptr, buf, (modpng14_size_t)3); } #endif - png_write_chunk_end(png_ptr); - png_ptr->mode |= PNG_HAVE_PLTE; + modpng14_write_chunk_end(modpng14_ptr); + modpng14_ptr->mode |= MODPNG14_HAVE_PLTE; } /* write an IDAT chunk */ void /* PRIVATE */ -png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length) +modpng14_write_IDAT(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IDAT; #endif - png_debug(1, "in png_write_IDAT\n"); - png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length); - png_ptr->mode |= PNG_HAVE_IDAT; + modpng14_debug(1, "in modpng14_write_IDAT\n"); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_IDAT, data, length); + modpng14_ptr->mode |= MODPNG14_HAVE_IDAT; } /* write an IEND chunk */ void /* PRIVATE */ -png_write_IEND(png_structp png_ptr) +modpng14_write_IEND(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IEND; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_IEND; #endif - png_debug(1, "in png_write_IEND\n"); - png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, - (png_size_t)0); - png_ptr->mode |= PNG_HAVE_IEND; + modpng14_debug(1, "in modpng14_write_IEND\n"); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_IEND, modpng14_bytep_NULL, + (modpng14_size_t)0); + modpng14_ptr->mode |= MODPNG14_HAVE_IEND; } -#if defined(PNG_WRITE_gAMA_SUPPORTED) +#if defined(MODPNG14_WRITE_gAMA_SUPPORTED) /* write a gAMA chunk */ -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED void /* PRIVATE */ -png_write_gAMA(png_structp png_ptr, double file_gamma) +modpng14_write_gAMA(modpng14_structp modpng14_ptr, double file_gamma) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_gAMA; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_gAMA; #endif - png_uint_32 igamma; - png_byte buf[4]; + modpng14_uint_32 igamma; + modpng14_byte buf[4]; - png_debug(1, "in png_write_gAMA\n"); + modpng14_debug(1, "in modpng14_write_gAMA\n"); /* file_gamma is saved in 1/100,000ths */ - igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5); - png_save_uint_32(buf, igamma); - png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); + igamma = (modpng14_uint_32)(file_gamma * 100000.0 + 0.5); + modpng14_save_uint_32(buf, igamma); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_gAMA, buf, (modpng14_size_t)4); } #endif -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED void /* PRIVATE */ -png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma) +modpng14_write_gAMA_fixed(modpng14_structp modpng14_ptr, modpng14_fixed_point file_gamma) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_gAMA; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_gAMA; #endif - png_byte buf[4]; + modpng14_byte buf[4]; - png_debug(1, "in png_write_gAMA\n"); + modpng14_debug(1, "in modpng14_write_gAMA\n"); /* file_gamma is saved in 1/100,000ths */ - png_save_uint_32(buf, (png_uint_32)file_gamma); - png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); + modpng14_save_uint_32(buf, (modpng14_uint_32)file_gamma); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_gAMA, buf, (modpng14_size_t)4); } #endif #endif -#if defined(PNG_WRITE_sRGB_SUPPORTED) +#if defined(MODPNG14_WRITE_sRGB_SUPPORTED) /* write a sRGB chunk */ void /* PRIVATE */ -png_write_sRGB(png_structp png_ptr, int srgb_intent) +modpng14_write_sRGB(modpng14_structp modpng14_ptr, int srgb_intent) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sRGB; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_sRGB; #endif - png_byte buf[1]; + modpng14_byte buf[1]; - png_debug(1, "in png_write_sRGB\n"); - if(srgb_intent >= PNG_sRGB_INTENT_LAST) - png_warning(png_ptr, + modpng14_debug(1, "in modpng14_write_sRGB\n"); + if(srgb_intent >= MODPNG14_sRGB_INTENT_LAST) + modpng14_warning(modpng14_ptr, "Invalid sRGB rendering intent specified"); - buf[0]=(png_byte)srgb_intent; - png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1); + buf[0]=(modpng14_byte)srgb_intent; + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_sRGB, buf, (modpng14_size_t)1); } #endif -#if defined(PNG_WRITE_iCCP_SUPPORTED) +#if defined(MODPNG14_WRITE_iCCP_SUPPORTED) /* write an iCCP chunk */ void /* PRIVATE */ -png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type, - png_charp profile, int profile_len) +modpng14_write_iCCP(modpng14_structp modpng14_ptr, modpng14_charp name, int compression_type, + modpng14_charp profile, int profile_len) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_iCCP; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_iCCP; #endif - png_size_t name_len; - png_charp new_name; + modpng14_size_t name_len; + modpng14_charp new_name; compression_state comp; int embedded_profile_len = 0; - png_debug(1, "in png_write_iCCP\n"); - if (name == NULL || (name_len = png_check_keyword(png_ptr, name, + modpng14_debug(1, "in modpng14_write_iCCP\n"); + if (name == NULL || (name_len = modpng14_check_keyword(modpng14_ptr, name, &new_name)) == 0) { - png_warning(png_ptr, "Empty keyword in iCCP chunk"); + modpng14_warning(modpng14_ptr, "Empty keyword in iCCP chunk"); return; } - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_warning(png_ptr, "Unknown compression type in iCCP chunk"); + if (compression_type != MODPNG14_COMPRESSION_TYPE_BASE) + modpng14_warning(modpng14_ptr, "Unknown compression type in iCCP chunk"); if (profile == NULL) profile_len = 0; @@ -702,89 +702,89 @@ if (profile_len < embedded_profile_len) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Embedded profile length too large in iCCP chunk"); return; } if (profile_len > embedded_profile_len) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Truncating profile to actual length in iCCP chunk"); profile_len = embedded_profile_len; } if (profile_len) - profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len, - PNG_COMPRESSION_TYPE_BASE, &comp); + profile_len = modpng14_text_compress(modpng14_ptr, profile, (modpng14_size_t)profile_len, + MODPNG14_COMPRESSION_TYPE_BASE, &comp); /* make sure we include the NULL after the name and the compression type */ - png_write_chunk_start(png_ptr, (png_bytep)png_iCCP, - (png_uint_32)name_len+profile_len+2); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_iCCP, + (modpng14_uint_32)name_len+profile_len+2); new_name[name_len+1]=0x00; - png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 2); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)new_name, name_len + 2); if (profile_len) - png_write_compressed_data_out(png_ptr, &comp); + modpng14_write_compressed_data_out(modpng14_ptr, &comp); - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_name); + modpng14_write_chunk_end(modpng14_ptr); + modpng14_free(modpng14_ptr, new_name); } #endif -#if defined(PNG_WRITE_sPLT_SUPPORTED) +#if defined(MODPNG14_WRITE_sPLT_SUPPORTED) /* write a sPLT chunk */ void /* PRIVATE */ -png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette) +modpng14_write_sPLT(modpng14_structp modpng14_ptr, modpng14_sPLT_tp spalette) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sPLT; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_sPLT; #endif - png_size_t name_len; - png_charp new_name; - png_byte entrybuf[10]; + modpng14_size_t name_len; + modpng14_charp new_name; + modpng14_byte entrybuf[10]; int entry_size = (spalette->depth == 8 ? 6 : 10); int palette_size = entry_size * spalette->nentries; - png_sPLT_entryp ep; -#ifdef PNG_NO_POINTER_INDEXING + modpng14_sPLT_entryp ep; +#ifdef MODPNG14_NO_POINTER_INDEXING int i; #endif - png_debug(1, "in png_write_sPLT\n"); - if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr, + modpng14_debug(1, "in modpng14_write_sPLT\n"); + if (spalette->name == NULL || (name_len = modpng14_check_keyword(modpng14_ptr, spalette->name, &new_name))==0) { - png_warning(png_ptr, "Empty keyword in sPLT chunk"); + modpng14_warning(modpng14_ptr, "Empty keyword in sPLT chunk"); return; } /* make sure we include the NULL after the name */ - png_write_chunk_start(png_ptr, (png_bytep)png_sPLT, - (png_uint_32)(name_len + 2 + palette_size)); - png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 1); - png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, 1); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_sPLT, + (modpng14_uint_32)(name_len + 2 + palette_size)); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)new_name, name_len + 1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)&spalette->depth, 1); /* loop through each palette entry, writing appropriately */ -#ifndef PNG_NO_POINTER_INDEXING +#ifndef MODPNG14_NO_POINTER_INDEXING for (ep = spalette->entries; epentries+spalette->nentries; ep++) { if (spalette->depth == 8) { - entrybuf[0] = (png_byte)ep->red; - entrybuf[1] = (png_byte)ep->green; - entrybuf[2] = (png_byte)ep->blue; - entrybuf[3] = (png_byte)ep->alpha; - png_save_uint_16(entrybuf + 4, ep->frequency); + entrybuf[0] = (modpng14_byte)ep->red; + entrybuf[1] = (modpng14_byte)ep->green; + entrybuf[2] = (modpng14_byte)ep->blue; + entrybuf[3] = (modpng14_byte)ep->alpha; + modpng14_save_uint_16(entrybuf + 4, ep->frequency); } else { - png_save_uint_16(entrybuf + 0, ep->red); - png_save_uint_16(entrybuf + 2, ep->green); - png_save_uint_16(entrybuf + 4, ep->blue); - png_save_uint_16(entrybuf + 6, ep->alpha); - png_save_uint_16(entrybuf + 8, ep->frequency); + modpng14_save_uint_16(entrybuf + 0, ep->red); + modpng14_save_uint_16(entrybuf + 2, ep->green); + modpng14_save_uint_16(entrybuf + 4, ep->blue); + modpng14_save_uint_16(entrybuf + 6, ep->alpha); + modpng14_save_uint_16(entrybuf + 8, ep->frequency); } - png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size); + modpng14_write_chunk_data(modpng14_ptr, entrybuf, (modpng14_size_t)entry_size); } #else ep=spalette->entries; @@ -792,53 +792,53 @@ { if (spalette->depth == 8) { - entrybuf[0] = (png_byte)ep[i].red; - entrybuf[1] = (png_byte)ep[i].green; - entrybuf[2] = (png_byte)ep[i].blue; - entrybuf[3] = (png_byte)ep[i].alpha; - png_save_uint_16(entrybuf + 4, ep[i].frequency); + entrybuf[0] = (modpng14_byte)ep[i].red; + entrybuf[1] = (modpng14_byte)ep[i].green; + entrybuf[2] = (modpng14_byte)ep[i].blue; + entrybuf[3] = (modpng14_byte)ep[i].alpha; + modpng14_save_uint_16(entrybuf + 4, ep[i].frequency); } else { - png_save_uint_16(entrybuf + 0, ep[i].red); - png_save_uint_16(entrybuf + 2, ep[i].green); - png_save_uint_16(entrybuf + 4, ep[i].blue); - png_save_uint_16(entrybuf + 6, ep[i].alpha); - png_save_uint_16(entrybuf + 8, ep[i].frequency); + modpng14_save_uint_16(entrybuf + 0, ep[i].red); + modpng14_save_uint_16(entrybuf + 2, ep[i].green); + modpng14_save_uint_16(entrybuf + 4, ep[i].blue); + modpng14_save_uint_16(entrybuf + 6, ep[i].alpha); + modpng14_save_uint_16(entrybuf + 8, ep[i].frequency); } - png_write_chunk_data(png_ptr, entrybuf, entry_size); + modpng14_write_chunk_data(modpng14_ptr, entrybuf, entry_size); } #endif - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_name); + modpng14_write_chunk_end(modpng14_ptr); + modpng14_free(modpng14_ptr, new_name); } #endif -#if defined(PNG_WRITE_sBIT_SUPPORTED) +#if defined(MODPNG14_WRITE_sBIT_SUPPORTED) /* write the sBIT chunk */ void /* PRIVATE */ -png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type) +modpng14_write_sBIT(modpng14_structp modpng14_ptr, modpng14_color_8p sbit, int color_type) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sBIT; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_sBIT; #endif - png_byte buf[4]; - png_size_t size; + modpng14_byte buf[4]; + modpng14_size_t size; - png_debug(1, "in png_write_sBIT\n"); - /* make sure we don't depend upon the order of PNG_COLOR_8 */ - if (color_type & PNG_COLOR_MASK_COLOR) + modpng14_debug(1, "in modpng14_write_sBIT\n"); + /* make sure we don't depend upon the order of MODPNG14_COLOR_8 */ + if (color_type & MODPNG14_COLOR_MASK_COLOR) { - png_byte maxbits; + modpng14_byte maxbits; - maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 : - png_ptr->usr_bit_depth); + maxbits = (modpng14_byte)(color_type==MODPNG14_COLOR_TYPE_PALETTE ? 8 : + modpng14_ptr->usr_bit_depth); if (sbit->red == 0 || sbit->red > maxbits || sbit->green == 0 || sbit->green > maxbits || sbit->blue == 0 || sbit->blue > maxbits) { - png_warning(png_ptr, "Invalid sBIT depth specified"); + modpng14_warning(modpng14_ptr, "Invalid sBIT depth specified"); return; } buf[0] = sbit->red; @@ -848,289 +848,289 @@ } else { - if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth) + if (sbit->gray == 0 || sbit->gray > modpng14_ptr->usr_bit_depth) { - png_warning(png_ptr, "Invalid sBIT depth specified"); + modpng14_warning(modpng14_ptr, "Invalid sBIT depth specified"); return; } buf[0] = sbit->gray; size = 1; } - if (color_type & PNG_COLOR_MASK_ALPHA) + if (color_type & MODPNG14_COLOR_MASK_ALPHA) { - if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth) + if (sbit->alpha == 0 || sbit->alpha > modpng14_ptr->usr_bit_depth) { - png_warning(png_ptr, "Invalid sBIT depth specified"); + modpng14_warning(modpng14_ptr, "Invalid sBIT depth specified"); return; } buf[size++] = sbit->alpha; } - png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_sBIT, buf, size); } #endif -#if defined(PNG_WRITE_cHRM_SUPPORTED) +#if defined(MODPNG14_WRITE_cHRM_SUPPORTED) /* write the cHRM chunk */ -#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef MODPNG14_FLOATING_POINT_SUPPORTED void /* PRIVATE */ -png_write_cHRM(png_structp png_ptr, double white_x, double white_y, +modpng14_write_cHRM(modpng14_structp modpng14_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) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_cHRM; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_cHRM; #endif - png_byte buf[32]; - png_uint_32 itemp; + modpng14_byte buf[32]; + modpng14_uint_32 itemp; - png_debug(1, "in png_write_cHRM\n"); + modpng14_debug(1, "in modpng14_write_cHRM\n"); /* each value is saved in 1/100,000ths */ if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 || white_x + white_y > 1.0) { - png_warning(png_ptr, "Invalid cHRM white point specified"); -#if !defined(PNG_NO_CONSOLE_IO) + modpng14_warning(modpng14_ptr, "Invalid cHRM white point specified"); +#if !defined(MODPNG14_NO_CONSOLE_IO) fprintf(stderr,"white_x=%f, white_y=%f\n",white_x, white_y); #endif return; } - itemp = (png_uint_32)(white_x * 100000.0 + 0.5); - png_save_uint_32(buf, itemp); - itemp = (png_uint_32)(white_y * 100000.0 + 0.5); - png_save_uint_32(buf + 4, itemp); + itemp = (modpng14_uint_32)(white_x * 100000.0 + 0.5); + modpng14_save_uint_32(buf, itemp); + itemp = (modpng14_uint_32)(white_y * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 4, itemp); if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 || red_x + red_y > 1.0) { - png_warning(png_ptr, "Invalid cHRM red point specified"); + modpng14_warning(modpng14_ptr, "Invalid cHRM red point specified"); return; } - itemp = (png_uint_32)(red_x * 100000.0 + 0.5); - png_save_uint_32(buf + 8, itemp); - itemp = (png_uint_32)(red_y * 100000.0 + 0.5); - png_save_uint_32(buf + 12, itemp); + itemp = (modpng14_uint_32)(red_x * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 8, itemp); + itemp = (modpng14_uint_32)(red_y * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 12, itemp); if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 || green_x + green_y > 1.0) { - png_warning(png_ptr, "Invalid cHRM green point specified"); + modpng14_warning(modpng14_ptr, "Invalid cHRM green point specified"); return; } - itemp = (png_uint_32)(green_x * 100000.0 + 0.5); - png_save_uint_32(buf + 16, itemp); - itemp = (png_uint_32)(green_y * 100000.0 + 0.5); - png_save_uint_32(buf + 20, itemp); + itemp = (modpng14_uint_32)(green_x * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 16, itemp); + itemp = (modpng14_uint_32)(green_y * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 20, itemp); if (blue_x < 0 || blue_x > 0.8 || blue_y < 0 || blue_y > 0.8 || blue_x + blue_y > 1.0) { - png_warning(png_ptr, "Invalid cHRM blue point specified"); + modpng14_warning(modpng14_ptr, "Invalid cHRM blue point specified"); return; } - itemp = (png_uint_32)(blue_x * 100000.0 + 0.5); - png_save_uint_32(buf + 24, itemp); - itemp = (png_uint_32)(blue_y * 100000.0 + 0.5); - png_save_uint_32(buf + 28, itemp); + itemp = (modpng14_uint_32)(blue_x * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 24, itemp); + itemp = (modpng14_uint_32)(blue_y * 100000.0 + 0.5); + modpng14_save_uint_32(buf + 28, itemp); - png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_cHRM, buf, (modpng14_size_t)32); } #endif -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED void /* PRIVATE */ -png_write_cHRM_fixed(png_structp png_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) +modpng14_write_cHRM_fixed(modpng14_structp modpng14_ptr, modpng14_fixed_point white_x, + modpng14_fixed_point white_y, modpng14_fixed_point red_x, modpng14_fixed_point red_y, + modpng14_fixed_point green_x, modpng14_fixed_point green_y, modpng14_fixed_point blue_x, + modpng14_fixed_point blue_y) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_cHRM; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_cHRM; #endif - png_byte buf[32]; + modpng14_byte buf[32]; - png_debug(1, "in png_write_cHRM\n"); + modpng14_debug(1, "in modpng14_write_cHRM\n"); /* each value is saved in 1/100,000ths */ if (white_x > 80000L || white_y > 80000L || white_x + white_y > 100000L) { - png_warning(png_ptr, "Invalid fixed cHRM white point specified"); -#if !defined(PNG_NO_CONSOLE_IO) + modpng14_warning(modpng14_ptr, "Invalid fixed cHRM white point specified"); +#if !defined(MODPNG14_NO_CONSOLE_IO) fprintf(stderr,"white_x=%ld, white_y=%ld\n",white_x, white_y); #endif return; } - png_save_uint_32(buf, (png_uint_32)white_x); - png_save_uint_32(buf + 4, (png_uint_32)white_y); + modpng14_save_uint_32(buf, (modpng14_uint_32)white_x); + modpng14_save_uint_32(buf + 4, (modpng14_uint_32)white_y); if (red_x > 80000L || red_y > 80000L || red_x + red_y > 100000L) { - png_warning(png_ptr, "Invalid cHRM fixed red point specified"); + modpng14_warning(modpng14_ptr, "Invalid cHRM fixed red point specified"); return; } - png_save_uint_32(buf + 8, (png_uint_32)red_x); - png_save_uint_32(buf + 12, (png_uint_32)red_y); + modpng14_save_uint_32(buf + 8, (modpng14_uint_32)red_x); + modpng14_save_uint_32(buf + 12, (modpng14_uint_32)red_y); if (green_x > 80000L || green_y > 80000L || green_x + green_y > 100000L) { - png_warning(png_ptr, "Invalid fixed cHRM green point specified"); + modpng14_warning(modpng14_ptr, "Invalid fixed cHRM green point specified"); return; } - png_save_uint_32(buf + 16, (png_uint_32)green_x); - png_save_uint_32(buf + 20, (png_uint_32)green_y); + modpng14_save_uint_32(buf + 16, (modpng14_uint_32)green_x); + modpng14_save_uint_32(buf + 20, (modpng14_uint_32)green_y); if (blue_x > 80000L || blue_y > 80000L || blue_x + blue_y > 100000L) { - png_warning(png_ptr, "Invalid fixed cHRM blue point specified"); + modpng14_warning(modpng14_ptr, "Invalid fixed cHRM blue point specified"); return; } - png_save_uint_32(buf + 24, (png_uint_32)blue_x); - png_save_uint_32(buf + 28, (png_uint_32)blue_y); + modpng14_save_uint_32(buf + 24, (modpng14_uint_32)blue_x); + modpng14_save_uint_32(buf + 28, (modpng14_uint_32)blue_y); - png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_cHRM, buf, (modpng14_size_t)32); } #endif #endif -#if defined(PNG_WRITE_tRNS_SUPPORTED) +#if defined(MODPNG14_WRITE_tRNS_SUPPORTED) /* write the tRNS chunk */ void /* PRIVATE */ -png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran, +modpng14_write_tRNS(modpng14_structp modpng14_ptr, modpng14_bytep trans, modpng14_color_16p tran, int num_trans, int color_type) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tRNS; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_tRNS; #endif - png_byte buf[6]; + modpng14_byte buf[6]; - png_debug(1, "in png_write_tRNS\n"); - if (color_type == PNG_COLOR_TYPE_PALETTE) + modpng14_debug(1, "in modpng14_write_tRNS\n"); + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) { - if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) + if (num_trans <= 0 || num_trans > (int)modpng14_ptr->num_palette) { - png_warning(png_ptr,"Invalid number of transparent colors specified"); + modpng14_warning(modpng14_ptr,"Invalid number of transparent colors specified"); return; } /* write the chunk out as it is */ - png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans, (png_size_t)num_trans); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_tRNS, trans, (modpng14_size_t)num_trans); } - else if (color_type == PNG_COLOR_TYPE_GRAY) + else if (color_type == MODPNG14_COLOR_TYPE_GRAY) { /* one 16 bit value */ - if(tran->gray >= (1 << png_ptr->bit_depth)) + if(tran->gray >= (1 << modpng14_ptr->bit_depth)) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to write tRNS chunk out-of-range for bit_depth"); return; } - png_save_uint_16(buf, tran->gray); - png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2); + modpng14_save_uint_16(buf, tran->gray); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_tRNS, buf, (modpng14_size_t)2); } - else if (color_type == PNG_COLOR_TYPE_RGB) + else if (color_type == MODPNG14_COLOR_TYPE_RGB) { /* three 16 bit values */ - png_save_uint_16(buf, tran->red); - png_save_uint_16(buf + 2, tran->green); - png_save_uint_16(buf + 4, tran->blue); - if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) + modpng14_save_uint_16(buf, tran->red); + modpng14_save_uint_16(buf + 2, tran->green); + modpng14_save_uint_16(buf + 4, tran->blue); + if(modpng14_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); return; } - png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_tRNS, buf, (modpng14_size_t)6); } else { - png_warning(png_ptr, "Can't write tRNS with an alpha channel"); + modpng14_warning(modpng14_ptr, "Can't write tRNS with an alpha channel"); } } #endif -#if defined(PNG_WRITE_bKGD_SUPPORTED) +#if defined(MODPNG14_WRITE_bKGD_SUPPORTED) /* write the background chunk */ void /* PRIVATE */ -png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type) +modpng14_write_bKGD(modpng14_structp modpng14_ptr, modpng14_color_16p back, int color_type) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_bKGD; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_bKGD; #endif - png_byte buf[6]; + modpng14_byte buf[6]; - png_debug(1, "in png_write_bKGD\n"); - if (color_type == PNG_COLOR_TYPE_PALETTE) + modpng14_debug(1, "in modpng14_write_bKGD\n"); + if (color_type == MODPNG14_COLOR_TYPE_PALETTE) { if ( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - (png_ptr->num_palette || - (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) && +#if defined(MODPNG14_MNG_FEATURES_SUPPORTED) + (modpng14_ptr->num_palette || + (!(modpng14_ptr->mng_features_permitted & MODPNG14_FLAG_MNG_EMPTY_PLTE))) && #endif - back->index > png_ptr->num_palette) + back->index > modpng14_ptr->num_palette) { - png_warning(png_ptr, "Invalid background palette index"); + modpng14_warning(modpng14_ptr, "Invalid background palette index"); return; } buf[0] = back->index; - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_bKGD, buf, (modpng14_size_t)1); } - else if (color_type & PNG_COLOR_MASK_COLOR) + else if (color_type & MODPNG14_COLOR_MASK_COLOR) { - png_save_uint_16(buf, back->red); - png_save_uint_16(buf + 2, back->green); - png_save_uint_16(buf + 4, back->blue); - if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) + modpng14_save_uint_16(buf, back->red); + modpng14_save_uint_16(buf + 2, back->green); + modpng14_save_uint_16(buf + 4, back->blue); + if(modpng14_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8"); return; } - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_bKGD, buf, (modpng14_size_t)6); } else { - if(back->gray >= (1 << png_ptr->bit_depth)) + if(back->gray >= (1 << modpng14_ptr->bit_depth)) { - png_warning(png_ptr, + modpng14_warning(modpng14_ptr, "Ignoring attempt to write bKGD chunk out-of-range for bit_depth"); return; } - png_save_uint_16(buf, back->gray); - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2); + modpng14_save_uint_16(buf, back->gray); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_bKGD, buf, (modpng14_size_t)2); } } #endif -#if defined(PNG_WRITE_hIST_SUPPORTED) +#if defined(MODPNG14_WRITE_hIST_SUPPORTED) /* write the histogram */ void /* PRIVATE */ -png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist) +modpng14_write_hIST(modpng14_structp modpng14_ptr, modpng14_uint_16p hist, int num_hist) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_hIST; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_hIST; #endif int i; - png_byte buf[3]; + modpng14_byte buf[3]; - png_debug(1, "in png_write_hIST\n"); - if (num_hist > (int)png_ptr->num_palette) + modpng14_debug(1, "in modpng14_write_hIST\n"); + if (num_hist > (int)modpng14_ptr->num_palette) { - png_debug2(3, "num_hist = %d, num_palette = %d\n", num_hist, - png_ptr->num_palette); - png_warning(png_ptr, "Invalid number of histogram entries specified"); + modpng14_debug2(3, "num_hist = %d, num_palette = %d\n", num_hist, + modpng14_ptr->num_palette); + modpng14_warning(modpng14_ptr, "Invalid number of histogram entries specified"); return; } - png_write_chunk_start(png_ptr, (png_bytep)png_hIST, (png_uint_32)(num_hist * 2)); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_hIST, (modpng14_uint_32)(num_hist * 2)); for (i = 0; i < num_hist; i++) { - png_save_uint_16(buf, hist[i]); - png_write_chunk_data(png_ptr, buf, (png_size_t)2); + modpng14_save_uint_16(buf, hist[i]); + modpng14_write_chunk_data(modpng14_ptr, buf, (modpng14_size_t)2); } - png_write_chunk_end(png_ptr); + modpng14_write_chunk_end(modpng14_ptr); } #endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) +#if defined(MODPNG14_WRITE_TEXT_SUPPORTED) || defined(MODPNG14_WRITE_pCAL_SUPPORTED) || \ + defined(MODPNG14_WRITE_iCCP_SUPPORTED) || defined(MODPNG14_WRITE_sPLT_SUPPORTED) /* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification, * and if invalid, correct the keyword rather than discarding the entire * chunk. The PNG 1.0 specification requires keywords 1-79 characters in @@ -1141,39 +1141,39 @@ * by the calling routine. This avoids problems with trying to write to * static keywords without having to have duplicate copies of the strings. */ -png_size_t /* PRIVATE */ -png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key) +modpng14_size_t /* PRIVATE */ +modpng14_check_keyword(modpng14_structp modpng14_ptr, modpng14_charp key, modpng14_charpp new_key) { - png_size_t key_len; - png_charp kp, dp; + modpng14_size_t key_len; + modpng14_charp kp, dp; int kflag; int kwarn=0; - png_debug(1, "in png_check_keyword\n"); + modpng14_debug(1, "in modpng14_check_keyword\n"); *new_key = NULL; - if (key == NULL || (key_len = png_strlen(key)) == 0) + if (key == NULL || (key_len = modpng14_strlen(key)) == 0) { - png_warning(png_ptr, "zero length keyword"); - return ((png_size_t)0); + modpng14_warning(modpng14_ptr, "zero length keyword"); + return ((modpng14_size_t)0); } - png_debug1(2, "Keyword to be checked is '%s'\n", key); + modpng14_debug1(2, "Keyword to be checked is '%s'\n", key); - *new_key = (png_charp)png_malloc(png_ptr, (png_uint_32)(key_len + 2)); + *new_key = (modpng14_charp)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)(key_len + 2)); /* Replace non-printing characters with a blank and print a warning */ for (kp = key, dp = *new_key; *kp != '\0'; kp++, dp++) { - if (*kp < 0x20 || (*kp > 0x7E && (png_byte)*kp < 0xA1)) + if (*kp < 0x20 || (*kp > 0x7E && (modpng14_byte)*kp < 0xA1)) { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) +#if !defined(MODPNG14_NO_STDIO) && !defined(_WIN32_WCE) char msg[40]; sprintf(msg, "invalid keyword character 0x%02X", *kp); - png_warning(png_ptr, msg); + modpng14_warning(modpng14_ptr, msg); #else - png_warning(png_ptr, "invalid character in keyword"); + modpng14_warning(modpng14_ptr, "invalid character in keyword"); #endif *dp = ' '; } @@ -1188,7 +1188,7 @@ kp = *new_key + key_len - 1; if (*kp == ' ') { - png_warning(png_ptr, "trailing spaces removed from keyword"); + modpng14_warning(modpng14_ptr, "trailing spaces removed from keyword"); while (*kp == ' ') { @@ -1201,7 +1201,7 @@ kp = *new_key; if (*kp == ' ') { - png_warning(png_ptr, "leading spaces removed from keyword"); + modpng14_warning(modpng14_ptr, "leading spaces removed from keyword"); while (*kp == ' ') { @@ -1210,7 +1210,7 @@ } } - png_debug1(2, "Checking for multiple internal spaces in '%s'\n", kp); + modpng14_debug1(2, "Checking for multiple internal spaces in '%s'\n", kp); /* Remove multiple internal spaces. */ for (kflag = 0, dp = *new_key; *kp != '\0'; kp++) @@ -1233,18 +1233,18 @@ } *dp = '\0'; if(kwarn) - png_warning(png_ptr, "extra interior spaces removed from keyword"); + modpng14_warning(modpng14_ptr, "extra interior spaces removed from keyword"); if (key_len == 0) { - png_free(png_ptr, *new_key); + modpng14_free(modpng14_ptr, *new_key); *new_key=NULL; - png_warning(png_ptr, "Zero length keyword"); + modpng14_warning(modpng14_ptr, "Zero length keyword"); } if (key_len > 79) { - png_warning(png_ptr, "keyword length must be 1 - 79 characters"); + modpng14_warning(modpng14_ptr, "keyword length must be 1 - 79 characters"); new_key[79] = '\0'; key_len = 79; } @@ -1253,124 +1253,124 @@ } #endif -#if defined(PNG_WRITE_tEXt_SUPPORTED) +#if defined(MODPNG14_WRITE_tEXt_SUPPORTED) /* write a tEXt chunk */ void /* PRIVATE */ -png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text, - png_size_t text_len) +modpng14_write_tEXt(modpng14_structp modpng14_ptr, modpng14_charp key, modpng14_charp text, + modpng14_size_t text_len) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tEXt; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_tEXt; #endif - png_size_t key_len; - png_charp new_key; + modpng14_size_t key_len; + modpng14_charp new_key; - png_debug(1, "in png_write_tEXt\n"); - if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) + modpng14_debug(1, "in modpng14_write_tEXt\n"); + if (key == NULL || (key_len = modpng14_check_keyword(modpng14_ptr, key, &new_key))==0) { - png_warning(png_ptr, "Empty keyword in tEXt chunk"); + modpng14_warning(modpng14_ptr, "Empty keyword in tEXt chunk"); return; } if (text == NULL || *text == '\0') text_len = 0; else - text_len = png_strlen(text); + text_len = modpng14_strlen(text); /* make sure we include the 0 after the key */ - png_write_chunk_start(png_ptr, (png_bytep)png_tEXt, (png_uint_32)key_len+text_len+1); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_tEXt, (modpng14_uint_32)key_len+text_len+1); /* * We leave it to the application to meet PNG-1.0 requirements on the * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)new_key, key_len + 1); if (text_len) - png_write_chunk_data(png_ptr, (png_bytep)text, text_len); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)text, text_len); - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_key); + modpng14_write_chunk_end(modpng14_ptr); + modpng14_free(modpng14_ptr, new_key); } #endif -#if defined(PNG_WRITE_zTXt_SUPPORTED) +#if defined(MODPNG14_WRITE_zTXt_SUPPORTED) /* write a compressed text chunk */ void /* PRIVATE */ -png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text, - png_size_t text_len, int compression) +modpng14_write_zTXt(modpng14_structp modpng14_ptr, modpng14_charp key, modpng14_charp text, + modpng14_size_t text_len, int compression) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_zTXt; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_zTXt; #endif - png_size_t key_len; + modpng14_size_t key_len; char buf[1]; - png_charp new_key; + modpng14_charp new_key; compression_state comp; - png_debug(1, "in png_write_zTXt\n"); + modpng14_debug(1, "in modpng14_write_zTXt\n"); - if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) + if (key == NULL || (key_len = modpng14_check_keyword(modpng14_ptr, key, &new_key))==0) { - png_warning(png_ptr, "Empty keyword in zTXt chunk"); + modpng14_warning(modpng14_ptr, "Empty keyword in zTXt chunk"); return; } - if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE) + if (text == NULL || *text == '\0' || compression==MODPNG14_TEXT_COMPRESSION_NONE) { - png_write_tEXt(png_ptr, new_key, text, (png_size_t)0); - png_free(png_ptr, new_key); + modpng14_write_tEXt(modpng14_ptr, new_key, text, (modpng14_size_t)0); + modpng14_free(modpng14_ptr, new_key); return; } - text_len = png_strlen(text); + text_len = modpng14_strlen(text); - png_free(png_ptr, new_key); + modpng14_free(modpng14_ptr, new_key); /* compute the compressed data; do it now for the length */ - text_len = png_text_compress(png_ptr, text, text_len, compression, + text_len = modpng14_text_compress(modpng14_ptr, text, text_len, compression, &comp); /* write start of chunk */ - png_write_chunk_start(png_ptr, (png_bytep)png_zTXt, (png_uint_32) + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_zTXt, (modpng14_uint_32) (key_len+text_len+2)); /* write key */ - png_write_chunk_data(png_ptr, (png_bytep)key, key_len + 1); - buf[0] = (png_byte)compression; + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)key, key_len + 1); + buf[0] = (modpng14_byte)compression; /* write compression */ - png_write_chunk_data(png_ptr, (png_bytep)buf, (png_size_t)1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)buf, (modpng14_size_t)1); /* write the compressed data */ - png_write_compressed_data_out(png_ptr, &comp); + modpng14_write_compressed_data_out(modpng14_ptr, &comp); /* close the chunk */ - png_write_chunk_end(png_ptr); + modpng14_write_chunk_end(modpng14_ptr); } #endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) +#if defined(MODPNG14_WRITE_iTXt_SUPPORTED) /* write an iTXt chunk */ void /* PRIVATE */ -png_write_iTXt(png_structp png_ptr, int compression, png_charp key, - png_charp lang, png_charp lang_key, png_charp text) +modpng14_write_iTXt(modpng14_structp modpng14_ptr, int compression, modpng14_charp key, + modpng14_charp lang, modpng14_charp lang_key, modpng14_charp text) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_iTXt; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_iTXt; #endif - png_size_t lang_len, key_len, lang_key_len, text_len; - png_charp new_lang, new_key; - png_byte cbuf[2]; + modpng14_size_t lang_len, key_len, lang_key_len, text_len; + modpng14_charp new_lang, new_key; + modpng14_byte cbuf[2]; compression_state comp; - png_debug(1, "in png_write_iTXt\n"); + modpng14_debug(1, "in modpng14_write_iTXt\n"); - if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) + if (key == NULL || (key_len = modpng14_check_keyword(modpng14_ptr, key, &new_key))==0) { - png_warning(png_ptr, "Empty keyword in iTXt chunk"); + modpng14_warning(modpng14_ptr, "Empty keyword in iTXt chunk"); return; } - if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0) + if (lang == NULL || (lang_len = modpng14_check_keyword(modpng14_ptr, lang, &new_lang))==0) { - png_warning(png_ptr, "Empty language field in iTXt chunk"); + modpng14_warning(modpng14_ptr, "Empty language field in iTXt chunk"); new_lang = NULL; lang_len = 0; } @@ -1378,23 +1378,23 @@ if (lang_key == NULL) lang_key_len = 0; else - lang_key_len = png_strlen(lang_key); + lang_key_len = modpng14_strlen(lang_key); if (text == NULL) text_len = 0; else - text_len = png_strlen(text); + text_len = modpng14_strlen(text); /* compute the compressed data; do it now for the length */ - text_len = png_text_compress(png_ptr, text, text_len, compression-2, + text_len = modpng14_text_compress(modpng14_ptr, text, text_len, compression-2, &comp); /* make sure we include the compression flag, the compression byte, * and the NULs after the key, lang, and lang_key parts */ - png_write_chunk_start(png_ptr, (png_bytep)png_iTXt, - (png_uint_32)( + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_iTXt, + (modpng14_uint_32)( 5 /* comp byte, comp flag, terminators for key, lang and lang_key */ + key_len + lang_len @@ -1407,126 +1407,126 @@ * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)new_key, key_len + 1); /* set the compression flag */ - if (compression == PNG_ITXT_COMPRESSION_NONE || \ - compression == PNG_TEXT_COMPRESSION_NONE) + if (compression == MODPNG14_ITXT_COMPRESSION_NONE || \ + compression == MODPNG14_TEXT_COMPRESSION_NONE) cbuf[0] = 0; - else /* compression == PNG_ITXT_COMPRESSION_zTXt */ + else /* compression == MODPNG14_ITXT_COMPRESSION_zTXt */ cbuf[0] = 1; /* set the compression method */ cbuf[1] = 0; - png_write_chunk_data(png_ptr, cbuf, 2); + modpng14_write_chunk_data(modpng14_ptr, cbuf, 2); cbuf[0] = 0; - png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), lang_len + 1); - png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf), lang_key_len + 1); - png_write_compressed_data_out(png_ptr, &comp); + modpng14_write_chunk_data(modpng14_ptr, (new_lang ? (modpng14_bytep)new_lang : cbuf), lang_len + 1); + modpng14_write_chunk_data(modpng14_ptr, (lang_key ? (modpng14_bytep)lang_key : cbuf), lang_key_len + 1); + modpng14_write_compressed_data_out(modpng14_ptr, &comp); - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_key); + modpng14_write_chunk_end(modpng14_ptr); + modpng14_free(modpng14_ptr, new_key); if (new_lang) - png_free(png_ptr, new_lang); + modpng14_free(modpng14_ptr, new_lang); } #endif -#if defined(PNG_WRITE_oFFs_SUPPORTED) +#if defined(MODPNG14_WRITE_oFFs_SUPPORTED) /* write the oFFs chunk */ void /* PRIVATE */ -png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, +modpng14_write_oFFs(modpng14_structp modpng14_ptr, modpng14_int_32 x_offset, modpng14_int_32 y_offset, int unit_type) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_oFFs; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_oFFs; #endif - png_byte buf[9]; + modpng14_byte buf[9]; - png_debug(1, "in png_write_oFFs\n"); - if (unit_type >= PNG_OFFSET_LAST) - png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); + modpng14_debug(1, "in modpng14_write_oFFs\n"); + if (unit_type >= MODPNG14_OFFSET_LAST) + modpng14_warning(modpng14_ptr, "Unrecognized unit type for oFFs chunk"); - png_save_int_32(buf, x_offset); - png_save_int_32(buf + 4, y_offset); - buf[8] = (png_byte)unit_type; + modpng14_save_int_32(buf, x_offset); + modpng14_save_int_32(buf + 4, y_offset); + buf[8] = (modpng14_byte)unit_type; - png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_oFFs, buf, (modpng14_size_t)9); } #endif -#if defined(PNG_WRITE_pCAL_SUPPORTED) +#if defined(MODPNG14_WRITE_pCAL_SUPPORTED) /* write the pCAL chunk (described in the PNG extensions document) */ void /* PRIVATE */ -png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, - png_int_32 X1, int type, int nparams, png_charp units, png_charpp params) +modpng14_write_pCAL(modpng14_structp modpng14_ptr, modpng14_charp purpose, modpng14_int_32 X0, + modpng14_int_32 X1, int type, int nparams, modpng14_charp units, modpng14_charpp params) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_pCAL; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_pCAL; #endif - png_size_t purpose_len, units_len, total_len; - png_uint_32p params_len; - png_byte buf[10]; - png_charp new_purpose; + modpng14_size_t purpose_len, units_len, total_len; + modpng14_uint_32p params_len; + modpng14_byte buf[10]; + modpng14_charp new_purpose; int i; - png_debug1(1, "in png_write_pCAL (%d parameters)\n", nparams); - if (type >= PNG_EQUATION_LAST) - png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); - - purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1; - png_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len); - units_len = png_strlen(units) + (nparams == 0 ? 0 : 1); - png_debug1(3, "pCAL units length = %d\n", (int)units_len); + modpng14_debug1(1, "in modpng14_write_pCAL (%d parameters)\n", nparams); + if (type >= MODPNG14_EQUATION_LAST) + modpng14_warning(modpng14_ptr, "Unrecognized equation type for pCAL chunk"); + + purpose_len = modpng14_check_keyword(modpng14_ptr, purpose, &new_purpose) + 1; + modpng14_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len); + units_len = modpng14_strlen(units) + (nparams == 0 ? 0 : 1); + modpng14_debug1(3, "pCAL units length = %d\n", (int)units_len); total_len = purpose_len + units_len + 10; - params_len = (png_uint_32p)png_malloc(png_ptr, (png_uint_32)(nparams - *sizeof(png_uint_32))); + params_len = (modpng14_uint_32p)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)(nparams + *sizeof(modpng14_uint_32))); /* Find the length of each parameter, making sure we don't count the null terminator for the last parameter. */ for (i = 0; i < nparams; i++) { - params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); - png_debug2(3, "pCAL parameter %d length = %lu\n", i, params_len[i]); - total_len += (png_size_t)params_len[i]; - } - - png_debug1(3, "pCAL total length = %d\n", (int)total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)new_purpose, purpose_len); - png_save_int_32(buf, X0); - png_save_int_32(buf + 4, X1); - buf[8] = (png_byte)type; - buf[9] = (png_byte)nparams; - png_write_chunk_data(png_ptr, buf, (png_size_t)10); - png_write_chunk_data(png_ptr, (png_bytep)units, (png_size_t)units_len); + params_len[i] = modpng14_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); + modpng14_debug2(3, "pCAL parameter %d length = %lu\n", i, params_len[i]); + total_len += (modpng14_size_t)params_len[i]; + } + + modpng14_debug1(3, "pCAL total length = %d\n", (int)total_len); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_pCAL, (modpng14_uint_32)total_len); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)new_purpose, purpose_len); + modpng14_save_int_32(buf, X0); + modpng14_save_int_32(buf + 4, X1); + buf[8] = (modpng14_byte)type; + buf[9] = (modpng14_byte)nparams; + modpng14_write_chunk_data(modpng14_ptr, buf, (modpng14_size_t)10); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)units, (modpng14_size_t)units_len); - png_free(png_ptr, new_purpose); + modpng14_free(modpng14_ptr, new_purpose); for (i = 0; i < nparams; i++) { - png_write_chunk_data(png_ptr, (png_bytep)params[i], - (png_size_t)params_len[i]); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)params[i], + (modpng14_size_t)params_len[i]); } - png_free(png_ptr, params_len); - png_write_chunk_end(png_ptr); + modpng14_free(modpng14_ptr, params_len); + modpng14_write_chunk_end(modpng14_ptr); } #endif -#if defined(PNG_WRITE_sCAL_SUPPORTED) +#if defined(MODPNG14_WRITE_sCAL_SUPPORTED) /* write the sCAL chunk */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) +#if defined(MODPNG14_FLOATING_POINT_SUPPORTED) && !defined(MODPNG14_NO_STDIO) void /* PRIVATE */ -png_write_sCAL(png_structp png_ptr, int unit, double width,double height) +modpng14_write_sCAL(modpng14_structp modpng14_ptr, int unit, double width,double height) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sCAL; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_sCAL; #endif - png_size_t total_len; + modpng14_size_t total_len; char wbuf[32], hbuf[32]; - png_debug(1, "in png_write_sCAL\n"); + modpng14_debug(1, "in modpng14_write_sCAL\n"); #if defined(_WIN32_WCE) /* sprintf() function is not supported on WindowsCE */ @@ -1541,265 +1541,265 @@ sprintf(wbuf, "%12.12e", width); sprintf(hbuf, "%12.12e", height); #endif - total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf); + total_len = 1 + modpng14_strlen(wbuf)+1 + modpng14_strlen(hbuf); - png_debug1(3, "sCAL total length = %d\n", (int)total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)&unit, 1); - png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1); - png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf)); + modpng14_debug1(3, "sCAL total length = %d\n", (int)total_len); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_sCAL, (modpng14_uint_32)total_len); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)&unit, 1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)wbuf, modpng14_strlen(wbuf)+1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)hbuf, modpng14_strlen(hbuf)); - png_write_chunk_end(png_ptr); + modpng14_write_chunk_end(modpng14_ptr); } #else -#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef MODPNG14_FIXED_POINT_SUPPORTED void /* PRIVATE */ -png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width, - png_charp height) +modpng14_write_sCAL_s(modpng14_structp modpng14_ptr, int unit, modpng14_charp width, + modpng14_charp height) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sCAL; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_sCAL; #endif - png_size_t total_len; + modpng14_size_t total_len; char wbuf[32], hbuf[32]; - png_debug(1, "in png_write_sCAL_s\n"); + modpng14_debug(1, "in modpng14_write_sCAL_s\n"); - png_strcpy(wbuf,(const char *)width); - png_strcpy(hbuf,(const char *)height); - total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf); + modpng14_strcpy(wbuf,(const char *)width); + modpng14_strcpy(hbuf,(const char *)height); + total_len = 1 + modpng14_strlen(wbuf)+1 + modpng14_strlen(hbuf); - png_debug1(3, "sCAL total length = %d\n", total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)&unit, 1); - png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1); - png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf)); + modpng14_debug1(3, "sCAL total length = %d\n", total_len); + modpng14_write_chunk_start(modpng14_ptr, (modpng14_bytep)modpng14_sCAL, (modpng14_uint_32)total_len); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)&unit, 1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)wbuf, modpng14_strlen(wbuf)+1); + modpng14_write_chunk_data(modpng14_ptr, (modpng14_bytep)hbuf, modpng14_strlen(hbuf)); - png_write_chunk_end(png_ptr); + modpng14_write_chunk_end(modpng14_ptr); } #endif #endif #endif -#if defined(PNG_WRITE_pHYs_SUPPORTED) +#if defined(MODPNG14_WRITE_pHYs_SUPPORTED) /* write the pHYs chunk */ void /* PRIVATE */ -png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, - png_uint_32 y_pixels_per_unit, +modpng14_write_pHYs(modpng14_structp modpng14_ptr, modpng14_uint_32 x_pixels_per_unit, + modpng14_uint_32 y_pixels_per_unit, int unit_type) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_pHYs; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_pHYs; #endif - png_byte buf[9]; + modpng14_byte buf[9]; - png_debug(1, "in png_write_pHYs\n"); - if (unit_type >= PNG_RESOLUTION_LAST) - png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); + modpng14_debug(1, "in modpng14_write_pHYs\n"); + if (unit_type >= MODPNG14_RESOLUTION_LAST) + modpng14_warning(modpng14_ptr, "Unrecognized unit type for pHYs chunk"); - png_save_uint_32(buf, x_pixels_per_unit); - png_save_uint_32(buf + 4, y_pixels_per_unit); - buf[8] = (png_byte)unit_type; + modpng14_save_uint_32(buf, x_pixels_per_unit); + modpng14_save_uint_32(buf + 4, y_pixels_per_unit); + buf[8] = (modpng14_byte)unit_type; - png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_pHYs, buf, (modpng14_size_t)9); } #endif -#if defined(PNG_WRITE_tIME_SUPPORTED) -/* Write the tIME chunk. Use either png_convert_from_struct_tm() - * or png_convert_from_time_t(), or fill in the structure yourself. +#if defined(MODPNG14_WRITE_tIME_SUPPORTED) +/* Write the tIME chunk. Use either modpng14_convert_from_struct_tm() + * or modpng14_convert_from_time_t(), or fill in the structure yourself. */ void /* PRIVATE */ -png_write_tIME(png_structp png_ptr, png_timep mod_time) +modpng14_write_tIME(modpng14_structp modpng14_ptr, modpng14_timep mod_time) { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tIME; +#ifdef MODPNG14_USE_LOCAL_ARRAYS + MODPNG14_tIME; #endif - png_byte buf[7]; + modpng14_byte buf[7]; - png_debug(1, "in png_write_tIME\n"); + modpng14_debug(1, "in modpng14_write_tIME\n"); if (mod_time->month > 12 || mod_time->month < 1 || mod_time->day > 31 || mod_time->day < 1 || mod_time->hour > 23 || mod_time->second > 60) { - png_warning(png_ptr, "Invalid time specified for tIME chunk"); + modpng14_warning(modpng14_ptr, "Invalid time specified for tIME chunk"); return; } - png_save_uint_16(buf, mod_time->year); + modpng14_save_uint_16(buf, mod_time->year); buf[2] = mod_time->month; buf[3] = mod_time->day; buf[4] = mod_time->hour; buf[5] = mod_time->minute; buf[6] = mod_time->second; - png_write_chunk(png_ptr, (png_bytep)png_tIME, buf, (png_size_t)7); + modpng14_write_chunk(modpng14_ptr, (modpng14_bytep)modpng14_tIME, buf, (modpng14_size_t)7); } #endif -/* initializes the row writing capability of libpng */ +/* initializes the row writing capability of libmodpng14 */ void /* PRIVATE */ -png_write_start_row(png_structp png_ptr) +modpng14_write_start_row(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + int modpng14_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + int modpng14_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + int modpng14_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif - png_size_t buf_size; + modpng14_size_t buf_size; - png_debug(1, "in png_write_start_row\n"); - buf_size = (png_size_t)(((png_ptr->width * png_ptr->usr_channels * - png_ptr->usr_bit_depth + 7) >> 3) + 1); + modpng14_debug(1, "in modpng14_write_start_row\n"); + buf_size = (modpng14_size_t)(((modpng14_ptr->width * modpng14_ptr->usr_channels * + modpng14_ptr->usr_bit_depth + 7) >> 3) + 1); /* set up row buffer */ - png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size); - png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE; + modpng14_ptr->row_buf = (modpng14_bytep)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)buf_size); + modpng14_ptr->row_buf[0] = MODPNG14_FILTER_VALUE_NONE; /* set up filtering buffer, if using this filter */ - if (png_ptr->do_filter & PNG_FILTER_SUB) + if (modpng14_ptr->do_filter & MODPNG14_FILTER_SUB) { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; + modpng14_ptr->sub_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->sub_row[0] = MODPNG14_FILTER_VALUE_SUB; } /* We only need to keep the previous row if we are using one of these. */ - if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) + if (modpng14_ptr->do_filter & (MODPNG14_FILTER_AVG | MODPNG14_FILTER_UP | MODPNG14_FILTER_PAETH)) { /* set up previous row buffer */ - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size); - png_memset(png_ptr->prev_row, 0, buf_size); + modpng14_ptr->prev_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, (modpng14_uint_32)buf_size); + modpng14_memset(modpng14_ptr->prev_row, 0, buf_size); - if (png_ptr->do_filter & PNG_FILTER_UP) + if (modpng14_ptr->do_filter & MODPNG14_FILTER_UP) { - png_ptr->up_row = (png_bytep )png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; + modpng14_ptr->up_row = (modpng14_bytep )modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->up_row[0] = MODPNG14_FILTER_VALUE_UP; } - if (png_ptr->do_filter & PNG_FILTER_AVG) + if (modpng14_ptr->do_filter & MODPNG14_FILTER_AVG) { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; + modpng14_ptr->avg_row = (modpng14_bytep)modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->avg_row[0] = MODPNG14_FILTER_VALUE_AVG; } - if (png_ptr->do_filter & PNG_FILTER_PAETH) + if (modpng14_ptr->do_filter & MODPNG14_FILTER_PAETH) { - png_ptr->paeth_row = (png_bytep )png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; + modpng14_ptr->paeth_row = (modpng14_bytep )modpng14_malloc(modpng14_ptr, + (modpng14_ptr->rowbytes + 1)); + modpng14_ptr->paeth_row[0] = MODPNG14_FILTER_VALUE_PAETH; } } -#ifdef PNG_WRITE_INTERLACING_SUPPORTED +#ifdef MODPNG14_WRITE_INTERLACING_SUPPORTED /* if interlaced, we need to set up width and height of pass */ - if (png_ptr->interlaced) + if (modpng14_ptr->interlaced) { - if (!(png_ptr->transformations & PNG_INTERLACE)) + if (!(modpng14_ptr->transformations & MODPNG14_INTERLACE)) { - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - png_ptr->usr_width = (png_ptr->width + png_pass_inc[0] - 1 - - png_pass_start[0]) / png_pass_inc[0]; + modpng14_ptr->num_rows = (modpng14_ptr->height + modpng14_pass_yinc[0] - 1 - + modpng14_pass_ystart[0]) / modpng14_pass_yinc[0]; + modpng14_ptr->usr_width = (modpng14_ptr->width + modpng14_pass_inc[0] - 1 - + modpng14_pass_start[0]) / modpng14_pass_inc[0]; } else { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; + modpng14_ptr->num_rows = modpng14_ptr->height; + modpng14_ptr->usr_width = modpng14_ptr->width; } } else #endif { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; + modpng14_ptr->num_rows = modpng14_ptr->height; + modpng14_ptr->usr_width = modpng14_ptr->width; } - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; } /* Internal use only. Called when finished processing a row of data. */ void /* PRIVATE */ -png_write_finish_row(png_structp png_ptr) +modpng14_write_finish_row(modpng14_structp modpng14_ptr) { -#ifdef PNG_USE_LOCAL_ARRAYS +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + int modpng14_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + int modpng14_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + int modpng14_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif int ret; - png_debug(1, "in png_write_finish_row\n"); + modpng14_debug(1, "in modpng14_write_finish_row\n"); /* next row */ - png_ptr->row_number++; + modpng14_ptr->row_number++; /* see if we are done */ - if (png_ptr->row_number < png_ptr->num_rows) + if (modpng14_ptr->row_number < modpng14_ptr->num_rows) return; -#ifdef PNG_WRITE_INTERLACING_SUPPORTED +#ifdef MODPNG14_WRITE_INTERLACING_SUPPORTED /* if interlaced, go to next pass */ - if (png_ptr->interlaced) + if (modpng14_ptr->interlaced) { - png_ptr->row_number = 0; - if (png_ptr->transformations & PNG_INTERLACE) + modpng14_ptr->row_number = 0; + if (modpng14_ptr->transformations & MODPNG14_INTERLACE) { - png_ptr->pass++; + modpng14_ptr->pass++; } else { /* loop until we find a non-zero width or height pass */ do { - png_ptr->pass++; - if (png_ptr->pass >= 7) + modpng14_ptr->pass++; + if (modpng14_ptr->pass >= 7) break; - png_ptr->usr_width = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - if (png_ptr->transformations & PNG_INTERLACE) + modpng14_ptr->usr_width = (modpng14_ptr->width + + modpng14_pass_inc[modpng14_ptr->pass] - 1 - + modpng14_pass_start[modpng14_ptr->pass]) / + modpng14_pass_inc[modpng14_ptr->pass]; + modpng14_ptr->num_rows = (modpng14_ptr->height + + modpng14_pass_yinc[modpng14_ptr->pass] - 1 - + modpng14_pass_ystart[modpng14_ptr->pass]) / + modpng14_pass_yinc[modpng14_ptr->pass]; + if (modpng14_ptr->transformations & MODPNG14_INTERLACE) break; - } while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0); + } while (modpng14_ptr->usr_width == 0 || modpng14_ptr->num_rows == 0); } /* reset the row above the image for the next pass */ - if (png_ptr->pass < 7) + if (modpng14_ptr->pass < 7) { - if (png_ptr->prev_row != NULL) - png_memset(png_ptr->prev_row, 0, - (png_size_t) (((png_uint_32)png_ptr->usr_channels * - (png_uint_32)png_ptr->usr_bit_depth * - png_ptr->width + 7) >> 3) + 1); + if (modpng14_ptr->prev_row != NULL) + modpng14_memset(modpng14_ptr->prev_row, 0, + (modpng14_size_t) (((modpng14_uint_32)modpng14_ptr->usr_channels * + (modpng14_uint_32)modpng14_ptr->usr_bit_depth * + modpng14_ptr->width + 7) >> 3) + 1); return; } } @@ -1810,38 +1810,38 @@ do { /* tell the compressor we are done */ - ret = deflate(&png_ptr->zstream, Z_FINISH); + ret = deflate(&modpng14_ptr->zstream, Z_FINISH); /* check for an error */ if (ret == Z_OK) { /* check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) + if (!(modpng14_ptr->zstream.avail_out)) { - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_write_IDAT(modpng14_ptr, modpng14_ptr->zbuf, modpng14_ptr->zbuf_size); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; } } else if (ret != Z_STREAM_END) { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); + if (modpng14_ptr->zstream.msg != NULL) + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg); else - png_error(png_ptr, "zlib error"); + modpng14_error(modpng14_ptr, "zlib error"); } } while (ret != Z_STREAM_END); /* write any extra space */ - if (png_ptr->zstream.avail_out < png_ptr->zbuf_size) + if (modpng14_ptr->zstream.avail_out < modpng14_ptr->zbuf_size) { - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size - - png_ptr->zstream.avail_out); + modpng14_write_IDAT(modpng14_ptr, modpng14_ptr->zbuf, modpng14_ptr->zbuf_size - + modpng14_ptr->zstream.avail_out); } - deflateReset(&png_ptr->zstream); + deflateReset(&modpng14_ptr->zstream); } -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +#if defined(MODPNG14_WRITE_INTERLACING_SUPPORTED) /* Pick out the correct pixels for the interlace pass. * The basic idea here is to go through the row with a source * pointer and a destination pointer (sp and dp), and copy the @@ -1850,21 +1850,21 @@ * See the default: case for the easiest code to understand. */ void /* PRIVATE */ -png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) +modpng14_do_write_interlace(modpng14_row_infop row_info, modpng14_bytep row, int pass) { -#ifdef PNG_USE_LOCAL_ARRAYS +#ifdef MODPNG14_USE_LOCAL_ARRAYS /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + int modpng14_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + int modpng14_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif - png_debug(1, "in png_do_write_interlace\n"); + modpng14_debug(1, "in modpng14_do_write_interlace\n"); /* we don't have to do anything on the last pass (6) */ -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#if defined(MODPNG14_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && pass < 6) #else if (pass < 6) @@ -1875,28 +1875,28 @@ { case 1: { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int shift; int d; int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; dp = row; d = 0; shift = 7; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) + for (i = modpng14_pass_start[pass]; i < row_width; + i += modpng14_pass_inc[pass]) { - sp = row + (png_size_t)(i >> 3); + sp = row + (modpng14_size_t)(i >> 3); value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01; d |= (value << shift); if (shift == 0) { shift = 7; - *dp++ = (png_byte)d; + *dp++ = (modpng14_byte)d; d = 0; } else @@ -1904,82 +1904,82 @@ } if (shift != 7) - *dp = (png_byte)d; + *dp = (modpng14_byte)d; break; } case 2: { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int shift; int d; int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; dp = row; shift = 6; d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) + for (i = modpng14_pass_start[pass]; i < row_width; + i += modpng14_pass_inc[pass]) { - sp = row + (png_size_t)(i >> 2); + sp = row + (modpng14_size_t)(i >> 2); value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03; d |= (value << shift); if (shift == 0) { shift = 6; - *dp++ = (png_byte)d; + *dp++ = (modpng14_byte)d; d = 0; } else shift -= 2; } if (shift != 6) - *dp = (png_byte)d; + *dp = (modpng14_byte)d; break; } case 4: { - png_bytep sp; - png_bytep dp; + modpng14_bytep sp; + modpng14_bytep dp; int shift; int d; int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; dp = row; shift = 4; d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) + for (i = modpng14_pass_start[pass]; i < row_width; + i += modpng14_pass_inc[pass]) { - sp = row + (png_size_t)(i >> 1); + sp = row + (modpng14_size_t)(i >> 1); value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f; d |= (value << shift); if (shift == 0) { shift = 4; - *dp++ = (png_byte)d; + *dp++ = (modpng14_byte)d; d = 0; } else shift -= 4; } if (shift != 4) - *dp = (png_byte)d; + *dp = (modpng14_byte)d; break; } default: { - png_bytep sp; - png_bytep dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - png_size_t pixel_bytes; + modpng14_bytep sp; + modpng14_bytep dp; + modpng14_uint_32 i; + modpng14_uint_32 row_width = row_info->width; + modpng14_size_t pixel_bytes; /* start at the beginning */ dp = row; @@ -1987,14 +1987,14 @@ pixel_bytes = (row_info->pixel_depth >> 3); /* loop through the row, only looking at the pixels that matter */ - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) + for (i = modpng14_pass_start[pass]; i < row_width; + i += modpng14_pass_inc[pass]) { /* find out where the original pixel is */ - sp = row + (png_size_t)i * pixel_bytes; + sp = row + (modpng14_size_t)i * pixel_bytes; /* move the pixel */ if (dp != sp) - png_memcpy(dp, sp, pixel_bytes); + modpng14_memcpy(dp, sp, pixel_bytes); /* next pixel */ dp += pixel_bytes; } @@ -2003,9 +2003,9 @@ } /* set new row width */ row_info->width = (row_info->width + - png_pass_inc[pass] - 1 - - png_pass_start[pass]) / - png_pass_inc[pass]; + modpng14_pass_inc[pass] - 1 - + modpng14_pass_start[pass]) / + modpng14_pass_inc[pass]; row_info->rowbytes = ((row_info->width * row_info->pixel_depth + 7) >> 3); } @@ -2016,28 +2016,28 @@ * been specified by the application, and then writes the row out with the * chosen filter. */ -#define PNG_MAXSUM (~((png_uint_32)0) >> 1) -#define PNG_HISHIFT 10 -#define PNG_LOMASK ((png_uint_32)0xffffL) -#define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT)) -void /* PRIVATE */ -png_write_find_filter(png_structp png_ptr, png_row_infop row_info) -{ - png_bytep prev_row, best_row, row_buf; - png_uint_32 mins, bpp; - png_byte filter_to_do = png_ptr->do_filter; - png_uint_32 row_bytes = row_info->rowbytes; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - int num_p_filters = (int)png_ptr->num_prev_filters; +#define MODPNG14_MAXSUM (~((modpng14_uint_32)0) >> 1) +#define MODPNG14_HISHIFT 10 +#define MODPNG14_LOMASK ((modpng14_uint_32)0xffffL) +#define MODPNG14_HIMASK ((modpng14_uint_32)(~MODPNG14_LOMASK >> MODPNG14_HISHIFT)) +void /* PRIVATE */ +modpng14_write_find_filter(modpng14_structp modpng14_ptr, modpng14_row_infop row_info) +{ + modpng14_bytep prev_row, best_row, row_buf; + modpng14_uint_32 mins, bpp; + modpng14_byte filter_to_do = modpng14_ptr->do_filter; + modpng14_uint_32 row_bytes = row_info->rowbytes; +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + int num_p_filters = (int)modpng14_ptr->num_prev_filters; #endif - png_debug(1, "in png_write_find_filter\n"); + modpng14_debug(1, "in modpng14_write_find_filter\n"); /* find out how many bytes offset each pixel is */ bpp = (row_info->pixel_depth + 7) / 8; - prev_row = png_ptr->prev_row; - best_row = row_buf = png_ptr->row_buf; - mins = PNG_MAXSUM; + prev_row = modpng14_ptr->prev_row; + best_row = row_buf = modpng14_ptr->row_buf; + mins = MODPNG14_MAXSUM; /* The prediction method we use is to find which method provides the * smallest value when summing the absolute values of the distances @@ -2064,12 +2064,12 @@ /* We don't need to test the 'no filter' case if this is the only filter * that has been chosen, as it doesn't actually do anything to the data. */ - if ((filter_to_do & PNG_FILTER_NONE) && - filter_to_do != PNG_FILTER_NONE) + if ((filter_to_do & MODPNG14_FILTER_NONE) && + filter_to_do != MODPNG14_FILTER_NONE) { - png_bytep rp; - png_uint_32 sum = 0; - png_uint_32 i; + modpng14_bytep rp; + modpng14_uint_32 sum = 0; + modpng14_uint_32 i; int v; for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) @@ -2078,23 +2078,23 @@ sum += (v < 128) ? v : 256 - v; } -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { - png_uint_32 sumhi, sumlo; + modpng14_uint_32 sumhi, sumlo; int j; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */ + sumlo = sum & MODPNG14_LOMASK; + sumhi = (sum >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; /* Gives us some footroom */ /* Reduce the sum if we match any of the previous rows */ for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_NONE) { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } @@ -2102,27 +2102,27 @@ * but it makes no sense to have a "cost" for the NONE filter, as * it has the minimum possible computational cost - none). */ - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_NONE]) >> + MODPNG14_COST_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_NONE]) >> + MODPNG14_COST_SHIFT; - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; + if (sumhi > MODPNG14_HIMASK) + sum = MODPNG14_MAXSUM; else - sum = (sumhi << PNG_HISHIFT) + sumlo; + sum = (sumhi << MODPNG14_HISHIFT) + sumlo; } #endif mins = sum; } /* sub filter */ - if (filter_to_do == PNG_FILTER_SUB) + if (filter_to_do == MODPNG14_FILTER_SUB) /* it's the only filter so no testing is needed */ { - png_bytep rp, lp, dp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; + modpng14_bytep rp, lp, dp; + modpng14_uint_32 i; + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->sub_row + 1; i < bpp; i++, rp++, dp++) { *dp = *rp; @@ -2130,54 +2130,54 @@ for (lp = row_buf + 1; i < row_bytes; i++, rp++, lp++, dp++) { - *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); + *dp = (modpng14_byte)(((int)*rp - (int)*lp) & 0xff); } - best_row = png_ptr->sub_row; + best_row = modpng14_ptr->sub_row; } - else if (filter_to_do & PNG_FILTER_SUB) + else if (filter_to_do & MODPNG14_FILTER_SUB) { - png_bytep rp, dp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; + modpng14_bytep rp, dp, lp; + modpng14_uint_32 sum = 0, lmins = mins; + modpng14_uint_32 i; int v; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) /* We temporarily increase the "minimum sum" by the factor we * would reduce the sum of this filter, so that we can do the * early exit comparison without scaling the sum each time. */ - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 lmhi, lmlo; + lmlo = lmins & MODPNG14_LOMASK; + lmhi = (lmins >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_SUB) { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_SUB]) >> + MODPNG14_COST_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_SUB]) >> + MODPNG14_COST_SHIFT; - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; + if (lmhi > MODPNG14_HIMASK) + lmins = MODPNG14_MAXSUM; else - lmins = (lmhi << PNG_HISHIFT) + lmlo; + lmins = (lmhi << MODPNG14_HISHIFT) + lmlo; } #endif - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->sub_row + 1; i < bpp; i++, rp++, dp++) { v = *dp = *rp; @@ -2187,7 +2187,7 @@ for (lp = row_buf + 1; i < row_info->rowbytes; i++, rp++, lp++, dp++) { - v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); + v = *dp = (modpng14_byte)(((int)*rp - (int)*lp) & 0xff); sum += (v < 128) ? v : 256 - v; @@ -2195,102 +2195,102 @@ break; } -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 sumhi, sumlo; + sumlo = sum & MODPNG14_LOMASK; + sumhi = (sum >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_SUB) { - sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + sumlo = (sumlo * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + sumhi = (sumhi * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; + sumlo = (sumlo * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_SUB]) >> + MODPNG14_COST_SHIFT; + sumhi = (sumhi * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_SUB]) >> + MODPNG14_COST_SHIFT; - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; + if (sumhi > MODPNG14_HIMASK) + sum = MODPNG14_MAXSUM; else - sum = (sumhi << PNG_HISHIFT) + sumlo; + sum = (sumhi << MODPNG14_HISHIFT) + sumlo; } #endif if (sum < mins) { mins = sum; - best_row = png_ptr->sub_row; + best_row = modpng14_ptr->sub_row; } } /* up filter */ - if (filter_to_do == PNG_FILTER_UP) + if (filter_to_do == MODPNG14_FILTER_UP) { - png_bytep rp, dp, pp; - png_uint_32 i; + modpng14_bytep rp, dp, pp; + modpng14_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->up_row + 1, pp = prev_row + 1; i < row_bytes; i++, rp++, pp++, dp++) { - *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); + *dp = (modpng14_byte)(((int)*rp - (int)*pp) & 0xff); } - best_row = png_ptr->up_row; + best_row = modpng14_ptr->up_row; } - else if (filter_to_do & PNG_FILTER_UP) + else if (filter_to_do & MODPNG14_FILTER_UP) { - png_bytep rp, dp, pp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; + modpng14_bytep rp, dp, pp; + modpng14_uint_32 sum = 0, lmins = mins; + modpng14_uint_32 i; int v; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 lmhi, lmlo; + lmlo = lmins & MODPNG14_LOMASK; + lmhi = (lmins >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_UP) { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_UP]) >> + MODPNG14_COST_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_UP]) >> + MODPNG14_COST_SHIFT; - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; + if (lmhi > MODPNG14_HIMASK) + lmins = MODPNG14_MAXSUM; else - lmins = (lmhi << PNG_HISHIFT) + lmlo; + lmins = (lmhi << MODPNG14_HISHIFT) + lmlo; } #endif - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->up_row + 1, pp = prev_row + 1; i < row_bytes; i++) { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); + v = *dp++ = (modpng14_byte)(((int)*rp++ - (int)*pp++) & 0xff); sum += (v < 128) ? v : 256 - v; @@ -2298,111 +2298,111 @@ break; } -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 sumhi, sumlo; + sumlo = sum & MODPNG14_LOMASK; + sumhi = (sum >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_UP) { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_UP]) >> + MODPNG14_COST_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_UP]) >> + MODPNG14_COST_SHIFT; - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; + if (sumhi > MODPNG14_HIMASK) + sum = MODPNG14_MAXSUM; else - sum = (sumhi << PNG_HISHIFT) + sumlo; + sum = (sumhi << MODPNG14_HISHIFT) + sumlo; } #endif if (sum < mins) { mins = sum; - best_row = png_ptr->up_row; + best_row = modpng14_ptr->up_row; } } /* avg filter */ - if (filter_to_do == PNG_FILTER_AVG) + if (filter_to_do == MODPNG14_FILTER_AVG) { - png_bytep rp, dp, pp, lp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, + modpng14_bytep rp, dp, pp, lp; + modpng14_uint_32 i; + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->avg_row + 1, pp = prev_row + 1; i < bpp; i++) { - *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); + *dp++ = (modpng14_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); } for (lp = row_buf + 1; i < row_bytes; i++) { - *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) + *dp++ = (modpng14_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); } - best_row = png_ptr->avg_row; + best_row = modpng14_ptr->avg_row; } - else if (filter_to_do & PNG_FILTER_AVG) + else if (filter_to_do & MODPNG14_FILTER_AVG) { - png_bytep rp, dp, pp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; + modpng14_bytep rp, dp, pp, lp; + modpng14_uint_32 sum = 0, lmins = mins; + modpng14_uint_32 i; int v; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 lmhi, lmlo; + lmlo = lmins & MODPNG14_LOMASK; + lmhi = (lmins >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_AVG) { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_AVG]) >> + MODPNG14_COST_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_AVG]) >> + MODPNG14_COST_SHIFT; - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; + if (lmhi > MODPNG14_HIMASK) + lmins = MODPNG14_MAXSUM; else - lmins = (lmhi << PNG_HISHIFT) + lmlo; + lmins = (lmhi << MODPNG14_HISHIFT) + lmlo; } #endif - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->avg_row + 1, pp = prev_row + 1; i < bpp; i++) { - v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); + v = *dp++ = (modpng14_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); sum += (v < 128) ? v : 256 - v; } for (lp = row_buf + 1; i < row_bytes; i++) { v = *dp++ = - (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); + (modpng14_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); sum += (v < 128) ? v : 256 - v; @@ -2410,53 +2410,53 @@ break; } -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 sumhi, sumlo; + sumlo = sum & MODPNG14_LOMASK; + sumhi = (sum >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_NONE) { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_AVG]) >> + MODPNG14_COST_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_AVG]) >> + MODPNG14_COST_SHIFT; - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; + if (sumhi > MODPNG14_HIMASK) + sum = MODPNG14_MAXSUM; else - sum = (sumhi << PNG_HISHIFT) + sumlo; + sum = (sumhi << MODPNG14_HISHIFT) + sumlo; } #endif if (sum < mins) { mins = sum; - best_row = png_ptr->avg_row; + best_row = modpng14_ptr->avg_row; } } /* Paeth filter */ - if (filter_to_do == PNG_FILTER_PAETH) + if (filter_to_do == MODPNG14_FILTER_PAETH) { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, + modpng14_bytep rp, dp, pp, cp, lp; + modpng14_uint_32 i; + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->paeth_row + 1, pp = prev_row + 1; i < bpp; i++) { - *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); + *dp++ = (modpng14_byte)(((int)*rp++ - (int)*pp++) & 0xff); } for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) @@ -2470,7 +2470,7 @@ p = b - c; pc = a - c; -#ifdef PNG_USE_ABS +#ifdef MODPNG14_USE_ABS pa = abs(p); pb = abs(pc); pc = abs(p + pc); @@ -2482,53 +2482,53 @@ p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); + *dp++ = (modpng14_byte)(((int)*rp++ - p) & 0xff); } - best_row = png_ptr->paeth_row; + best_row = modpng14_ptr->paeth_row; } - else if (filter_to_do & PNG_FILTER_PAETH) + else if (filter_to_do & MODPNG14_FILTER_PAETH) { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; + modpng14_bytep rp, dp, pp, cp, lp; + modpng14_uint_32 sum = 0, lmins = mins; + modpng14_uint_32 i; int v; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 lmhi, lmlo; + lmlo = lmins & MODPNG14_LOMASK; + lmhi = (lmins >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_PAETH) { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; + lmlo = (lmlo * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_PAETH]) >> + MODPNG14_COST_SHIFT; + lmhi = (lmhi * modpng14_ptr->inv_filter_costs[MODPNG14_FILTER_VALUE_PAETH]) >> + MODPNG14_COST_SHIFT; - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; + if (lmhi > MODPNG14_HIMASK) + lmins = MODPNG14_MAXSUM; else - lmins = (lmhi << PNG_HISHIFT) + lmlo; + lmins = (lmhi << MODPNG14_HISHIFT) + lmlo; } #endif - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, + for (i = 0, rp = row_buf + 1, dp = modpng14_ptr->paeth_row + 1, pp = prev_row + 1; i < bpp; i++) { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); + v = *dp++ = (modpng14_byte)(((int)*rp++ - (int)*pp++) & 0xff); sum += (v < 128) ? v : 256 - v; } @@ -2541,10 +2541,10 @@ c = *cp++; a = *lp++; -#ifndef PNG_SLOW_PAETH +#ifndef MODPNG14_SLOW_PAETH p = b - c; pc = a - c; -#ifdef PNG_USE_ABS +#ifdef MODPNG14_USE_ABS pa = abs(p); pb = abs(pc); pc = abs(p + pc); @@ -2554,7 +2554,7 @@ pc = (p + pc) < 0 ? -(p + pc) : p + pc; #endif p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; -#else /* PNG_SLOW_PAETH */ +#else /* MODPNG14_SLOW_PAETH */ p = a + b - c; pa = abs(p - a); pb = abs(p - b); @@ -2565,9 +2565,9 @@ p = b; else p = c; -#endif /* PNG_SLOW_PAETH */ +#endif /* MODPNG14_SLOW_PAETH */ - v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); + v = *dp++ = (modpng14_byte)(((int)*rp++ - p) & 0xff); sum += (v < 128) ? v : 256 - v; @@ -2575,57 +2575,57 @@ break; } -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) + if (modpng14_ptr->heuristic_method == MODPNG14_FILTER_HEURISTIC_WEIGHTED) { int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; + modpng14_uint_32 sumhi, sumlo; + sumlo = sum & MODPNG14_LOMASK; + sumhi = (sum >> MODPNG14_HISHIFT) & MODPNG14_HIMASK; for (j = 0; j < num_p_filters; j++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) + if (modpng14_ptr->prev_filters[j] == MODPNG14_FILTER_VALUE_PAETH) { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_weights[j]) >> + MODPNG14_WEIGHT_SHIFT; } } - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; + sumlo = (sumlo * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_PAETH]) >> + MODPNG14_COST_SHIFT; + sumhi = (sumhi * modpng14_ptr->filter_costs[MODPNG14_FILTER_VALUE_PAETH]) >> + MODPNG14_COST_SHIFT; - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; + if (sumhi > MODPNG14_HIMASK) + sum = MODPNG14_MAXSUM; else - sum = (sumhi << PNG_HISHIFT) + sumlo; + sum = (sumhi << MODPNG14_HISHIFT) + sumlo; } #endif if (sum < mins) { - best_row = png_ptr->paeth_row; + best_row = modpng14_ptr->paeth_row; } } /* Do the actual writing of the filtered row data from the chosen filter. */ - png_write_filtered_row(png_ptr, best_row); + modpng14_write_filtered_row(modpng14_ptr, best_row); -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) +#if defined(MODPNG14_WRITE_WEIGHTED_FILTER_SUPPORTED) /* Save the type of filter we picked this time for future calculations */ - if (png_ptr->num_prev_filters > 0) + if (modpng14_ptr->num_prev_filters > 0) { int j; for (j = 1; j < num_p_filters; j++) { - png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1]; + modpng14_ptr->prev_filters[j] = modpng14_ptr->prev_filters[j - 1]; } - png_ptr->prev_filters[j] = best_row[0]; + modpng14_ptr->prev_filters[j] = best_row[0]; } #endif } @@ -2633,62 +2633,62 @@ /* Do the actual writing of a previously filtered row. */ void /* PRIVATE */ -png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) +modpng14_write_filtered_row(modpng14_structp modpng14_ptr, modpng14_bytep filtered_row) { - png_debug(1, "in png_write_filtered_row\n"); - png_debug1(2, "filter = %d\n", filtered_row[0]); + modpng14_debug(1, "in modpng14_write_filtered_row\n"); + modpng14_debug1(2, "filter = %d\n", filtered_row[0]); /* set up the zlib input buffer */ - png_ptr->zstream.next_in = filtered_row; - png_ptr->zstream.avail_in = (uInt)png_ptr->row_info.rowbytes + 1; + modpng14_ptr->zstream.next_in = filtered_row; + modpng14_ptr->zstream.avail_in = (uInt)modpng14_ptr->row_info.rowbytes + 1; /* repeat until we have compressed all the data */ do { int ret; /* return of zlib */ /* compress the data */ - ret = deflate(&png_ptr->zstream, Z_NO_FLUSH); + ret = deflate(&modpng14_ptr->zstream, Z_NO_FLUSH); /* check for compression errors */ if (ret != Z_OK) { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); + if (modpng14_ptr->zstream.msg != NULL) + modpng14_error(modpng14_ptr, modpng14_ptr->zstream.msg); else - png_error(png_ptr, "zlib error"); + modpng14_error(modpng14_ptr, "zlib error"); } /* see if it is time to write another IDAT */ - if (!(png_ptr->zstream.avail_out)) + if (!(modpng14_ptr->zstream.avail_out)) { /* write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; + modpng14_write_IDAT(modpng14_ptr, modpng14_ptr->zbuf, modpng14_ptr->zbuf_size); + modpng14_ptr->zstream.next_out = modpng14_ptr->zbuf; + modpng14_ptr->zstream.avail_out = (uInt)modpng14_ptr->zbuf_size; } /* repeat until all data has been compressed */ - } while (png_ptr->zstream.avail_in); + } while (modpng14_ptr->zstream.avail_in); /* swap the current and previous rows */ - if (png_ptr->prev_row != NULL) + if (modpng14_ptr->prev_row != NULL) { - png_bytep tptr; + modpng14_bytep tptr; - tptr = png_ptr->prev_row; - png_ptr->prev_row = png_ptr->row_buf; - png_ptr->row_buf = tptr; + tptr = modpng14_ptr->prev_row; + modpng14_ptr->prev_row = modpng14_ptr->row_buf; + modpng14_ptr->row_buf = tptr; } /* finish row - updates counters and flushes zlib if last row */ - png_write_finish_row(png_ptr); + modpng14_write_finish_row(modpng14_ptr); -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_ptr->flush_rows++; +#if defined(MODPNG14_WRITE_FLUSH_SUPPORTED) + modpng14_ptr->flush_rows++; - if (png_ptr->flush_dist > 0 && - png_ptr->flush_rows >= png_ptr->flush_dist) + if (modpng14_ptr->flush_dist > 0 && + modpng14_ptr->flush_rows >= modpng14_ptr->flush_dist) { - png_write_flush(png_ptr); + modpng14_write_flush(modpng14_ptr); } #endif } -#endif /* PNG_WRITE_SUPPORTED */ +#endif /* MODPNG14_WRITE_SUPPORTED */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/beos/x86-shared.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/beos/x86-shared.txt @@ -1,6 +1,6 @@ -This project builds a shared library version of libpng on x86 BeOS. +This project builds a shared library version of libmodpng14 on x86 BeOS. -It defines PNG_USE_PNGGCCRD, which activates the assembly code in +It defines MODPNG14_USE_PNGGCCRD, which activates the assembly code in pnggccrd.c; this hasn't been extensively tested on BeOS. To install: @@ -11,12 +11,12 @@ you compile pnggccrd.c. As far as I know, these are harmless, but it would be better if someone fixed them. -2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which +2) copy and modpng14.h, modpng14conf.h somewhere; /boot/home/config/include (which you'll have to make) is a good choice -3) copy libpng.so to /boot/home/config/lib +3) copy libmodpng14.so to /boot/home/config/lib -4) build your libpng.so applications (remember to include libz.a as +4) build your libmodpng14.so applications (remember to include libz.a as well when you link) - Chris Herborth, March 27, 2001 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/beos/x86-static.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/beos/x86-static.txt @@ -1,6 +1,6 @@ -This project builds a static library version of libpng on x86 BeOS. +This project builds a static library version of libmodpng14 on x86 BeOS. -It defines PNG_USE_PNGGCCRD, which activates the assembly code in +It defines MODPNG14_USE_PNGGCCRD, which activates the assembly code in pnggccrd.c; this hasn't been extensively tested on BeOS. To install: @@ -11,12 +11,12 @@ you compile pnggccrd.c. As far as I know, these are harmless, but it would be better if someone fixed them. -2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which +2) copy and modpng14.h, modpng14conf.h somewhere; /boot/home/config/include (which you'll have to make) is a good choice -3) copy libpng.a to /boot/home/config/lib +3) copy libmodpng14.a to /boot/home/config/lib -4) build your libpng.a applications (remember to include libz.a as +4) build your libmodpng14.a applications (remember to include libz.a as well when you link) - Chris Herborth, March 27, 2001 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/borland/libpng.bpf +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/borland/libpng.bpf @@ -1,4 +1,4 @@ -USEUNIT("libpng.cpp"); +USEUNIT("libmodpng14.cpp"); USEUNIT("..\..\pngwutil.c"); USEUNIT("..\..\pngerror.c"); USEUNIT("..\..\pngget.c"); --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/borland/libpng.bpg +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/borland/libpng.bpg @@ -9,16 +9,16 @@ DCC = $(ROOT)\bin\dcc32.exe $** BRCC = $(ROOT)\bin\brcc32.exe $** #------------------------------------------------------------------------------ -PROJECTS = libpngstat.lib libpng.dll +PROJECTS = libmodpng14stat.lib libmodpng14.dll #------------------------------------------------------------------------------ default: $(PROJECTS) #------------------------------------------------------------------------------ -libpngstat.lib: libpngstat.bpr +libmodpng14stat.lib: libmodpng14stat.bpr $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak -libpng.dll: libpng.bpr +libmodpng14.dll: libmodpng14.bpr $(ROOT)\bin\bpr2mak $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/borland/libpng.bpr +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/borland/libpng.bpr @@ -3,8 +3,8 @@ - - + @@ -25,9 +25,9 @@ - + - + - + - + --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/borland/zlib+libpng.bpg +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/borland/zlib+libpng.bpg @@ -9,12 +9,12 @@ DCC = $(ROOT)\bin\dcc32.exe $** BRCC = $(ROOT)\bin\brcc32.exe $** #------------------------------------------------------------------------------ -PROJECTS = zlibstat.lib libpngstat.lib zlib.dll libpng.dll +PROJECTS = zlibstat.lib libmodpng14stat.lib zlib.dll libmodpng14.dll #------------------------------------------------------------------------------ default: $(PROJECTS) #------------------------------------------------------------------------------ -libpng.dll: libpng.bpr +libmodpng14.dll: libmodpng14.bpr $(ROOT)\bin\bpr2mak $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak @@ -26,7 +26,7 @@ $(ROOT)\bin\bpr2mak $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak -libpngstat.lib: libpngstat.bpr +libmodpng14stat.lib: libmodpng14stat.bpr $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/msvc/README.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/msvc/README.txt @@ -1,19 +1,19 @@ Microsoft Developer Studio Build File, Format Version 6.00 for -libpng 1.2.5 (October 3, 2002) and zlib +libmodpng14 1.2.5 (October 3, 2002) and zlib Copyright (C) 2000 Simon-Pierre Cadieux -For conditions of distribution and use, see copyright notice in png.h +For conditions of distribution and use, see copyright notice in modpng14.h -Assumes that libpng sources are in ..\.. +Assumes that libmodpng14 sources are in ..\.. Assumes that zlib sources have been copied to ..\..\..\zlib To build: 0) On the main menu, select "File | Open Workspace" and then - select "libpng.dsw". + select "libmodpng14.dsw". 1) On the main menu Select "Build | Set Active configuration". - Among the configurations beginning with "libpng" select the + Among the configurations beginning with "libmodpng14" select the one you wish to build (the corresponding "zlib" configuration will be built automatically). @@ -24,23 +24,23 @@ alloc.h). 4) Look in the appropriate "win32" subdirectories for both "zlib" - and "libpng" binaries. + and "libmodpng14" binaries. This project will build the PNG Development Group's "official" versions of -libpng and zlib libraries: +libmodpng14 and zlib libraries: - libpng13.dll (default version, currently C code only) - libpng13a.dll (C + Assembler version) - libpng13b.dll (C + Assembler debug version) - libpng13d.dll (C code debug version) - libpng13vb.dll (version for VB, uses "stdcall" protocol) - libpng13[c,e-m].dll (reserved for official versions) - libpng13[n-z].dll (available for private versions) + libmodpng1413.dll (default version, currently C code only) + libmodpng1413a.dll (C + Assembler version) + libmodpng1413b.dll (C + Assembler debug version) + libmodpng1413d.dll (C code debug version) + libmodpng1413vb.dll (version for VB, uses "stdcall" protocol) + libmodpng1413[c,e-m].dll (reserved for official versions) + libmodpng1413[n-z].dll (available for private versions) zlib.dll (default version, currently C code only) zlibd.dll (debug version) zlibvb.dll (version for Visual Basic, uses "stdcall" protocol) -If you change anything in libpng, or select different compiler settings, +If you change anything in libmodpng14, or select different compiler settings, please change the library name to an unreserved name, and define DLLFNAME_POSTFIX and (PRIVATEBUILD or SPECIALBUILD) accordingly. DLLFNAME_POSTFIX should correspond to a string in the range of "N" to "Z" depending on the letter --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/msvc/libpng.dsp +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/msvc/libpng.dsp @@ -1,30 +1,30 @@ -# Microsoft Developer Studio Project File - Name="libpng" - Package Owner=<4> +# Microsoft Developer Studio Project File - Name="libmodpng14" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=libpng - Win32 DLL +CFG=libmodpng14 - Win32 DLL !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 NMAKE /f "libmodpng14.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 DLL" +!MESSAGE NMAKE /f "libmodpng14.mak" CFG="libmodpng14 - Win32 DLL" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "libpng - Win32 DLL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL ASM" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL Debug ASM" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 LIB" (based on "Win32 (x86) Static Library") -!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "libpng - Win32 DLL VB" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmodpng14 - Win32 DLL" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmodpng14 - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmodpng14 - Win32 DLL ASM" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmodpng14 - Win32 DLL Debug ASM" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmodpng14 - Win32 LIB" (based on "Win32 (x86) Static Library") +!MESSAGE "libmodpng14 - Win32 LIB Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "libmodpng14 - Win32 DLL VB" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -32,7 +32,7 @@ # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -!IF "$(CFG)" == "libpng - Win32 DLL" +!IF "$(CFG)" == "libmodpng14 - Win32 DLL" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -41,13 +41,13 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\win32\libpng\dll" -# PROP Intermediate_Dir ".\win32\libpng\dll" +# PROP Output_Dir ".\win32\libmodpng14\dll" +# PROP Intermediate_Dir ".\win32\libmodpng14\dll" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c -# ADD CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c +# ADD CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "MODPNG14_BUILD_DLL" /D "ZLIB_DLL" /Yu"modpng14.h" /FD /c MTL=midl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -57,10 +57,10 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng13.dll" +# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libmodpng14\dll\libmodpng1413.dll" # SUBTRACT LINK32 /pdb:none -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -69,25 +69,25 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\win32\libpng\dll_dbg" -# PROP Intermediate_Dir ".\win32\libpng\dll_dbg" +# PROP Output_Dir ".\win32\libmodpng14\dll_dbg" +# PROP Intermediate_Dir ".\win32\libmodpng14\dll_dbg" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "_DEBUG" /D MODPNG14_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "MODPNG14_BUILD_DLL" /D "ZLIB_DLL" /Yu"modpng14.h" /FD /GZ /c MTL=midl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 +# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d MODPNG14_DEBUG=1 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng13d.dll" +# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libmodpng14\dll_dbg\libmodpng1413d.dll" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL ASM" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -96,26 +96,26 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\win32\libpng\dll_asm" -# PROP Intermediate_Dir ".\win32\libpng\dll_asm" +# PROP Output_Dir ".\win32\libmodpng14\dll_asm" +# PROP Intermediate_Dir ".\win32\libmodpng14\dll_asm" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c -# ADD CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c +# ADD CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "MODPNG14_USE_PNGVCRD" /D "MODPNG14_BUILD_DLL" /D "ZLIB_DLL" /Yu"modpng14.h" /FD /c MTL=midl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" /d "PNG_USE_PNGVCRD" +# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" /d "MODPNG14_USE_PNGVCRD" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_asm\libpng13a.dll" +# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libmodpng14\dll_asm\libmodpng1413a.dll" # SUBTRACT LINK32 /pdb:none -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug ASM" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -124,25 +124,25 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\win32\libpng\dll_dbga" -# PROP Intermediate_Dir ".\win32\libpng\dll_dbga" +# PROP Output_Dir ".\win32\libmodpng14\dll_dbga" +# PROP Intermediate_Dir ".\win32\libmodpng14\dll_dbga" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "_DEBUG" /D MODPNG14_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "MODPNG14_USE_PNGVCRD" /D "MODPNG14_BUILD_DLL" /D "ZLIB_DLL" /Yu"modpng14.h" /FD /GZ /c MTL=midl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 /d "PNG_USE_PNGVCRD" +# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d MODPNG14_DEBUG=1 /d "MODPNG14_USE_PNGVCRD" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbga\libpng13b.dll" +# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libmodpng14\dll_dbga\libmodpng1413b.dll" -!ELSEIF "$(CFG)" == "libpng - Win32 LIB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -151,13 +151,13 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\win32\libpng\lib" -# PROP Intermediate_Dir ".\win32\libpng\lib" +# PROP Output_Dir ".\win32\libmodpng14\lib" +# PROP Intermediate_Dir ".\win32\libmodpng14\lib" # PROP Target_Dir "" MTL=midl.exe CPP=cl.exe # ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c -# ADD CPP /nologo /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /Yu"png.h" /FD /c +# ADD CPP /nologo /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /Yu"modpng14.h" /FD /c RSC=rc.exe # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" @@ -168,7 +168,7 @@ # ADD BASE LIB32 /nologo # ADD LIB32 /nologo -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -177,13 +177,13 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\win32\libpng\lib_dbg" -# PROP Intermediate_Dir ".\win32\libpng\lib_dbg" +# PROP Output_Dir ".\win32\libmodpng14\lib_dbg" +# PROP Intermediate_Dir ".\win32\libmodpng14\lib_dbg" # PROP Target_Dir "" MTL=midl.exe CPP=cl.exe # ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_LIB" /FD /GZ /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /Yu"png.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Zi /Od /I "..\.." /I "..\..\..\zlib" /D "DEBUG" /D "_DEBUG" /D MODPNG14_DEBUG=1 /D "WIN32" /Yu"modpng14.h" /FD /GZ /c RSC=rc.exe # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -194,23 +194,23 @@ # ADD BASE LIB32 /nologo # ADD LIB32 /nologo -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL VB" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_DLL_VB" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_VB" +# PROP BASE Output_Dir "libmodpng14___Win32_DLL_VB" +# PROP BASE Intermediate_Dir "libmodpng14___Win32_DLL_VB" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\win32\libpng\dll_vb" -# PROP Intermediate_Dir ".\win32\libpng\dll_vb" +# PROP Output_Dir ".\win32\libmodpng14\dll_vb" +# PROP Intermediate_Dir ".\win32\libmodpng14\dll_vb" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c -# ADD CPP /nologo /Gd /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D PNGAPI=__stdcall /Yu"png.h" /FD /c +# ADD BASE CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "MODPNG14_BUILD_DLL" /D "ZLIB_DLL" /Yu"modpng14.h" /FD /c +# ADD CPP /nologo /Gd /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "MODPNG14_BUILD_DLL" /D "ZLIB_DLL" /D MODPNG14API=__stdcall /Yu"modpng14.h" /FD /c MTL=midl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 /i "..\.." /d "NDEBUG" @@ -219,22 +219,22 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng13.dll" +# ADD BASE LINK32 /nologo /dll /machine:I386 /out:".\win32\libmodpng14\dll\libmodpng1413.dll" # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_vb\libpngvb13.dll" +# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libmodpng14\dll_vb\libmodpng14vb13.dll" # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target -# Name "libpng - Win32 DLL" -# Name "libpng - Win32 DLL Debug" -# Name "libpng - Win32 DLL ASM" -# Name "libpng - Win32 DLL Debug ASM" -# Name "libpng - Win32 LIB" -# Name "libpng - Win32 LIB Debug" -# Name "libpng - Win32 DLL VB" +# Name "libmodpng14 - Win32 DLL" +# Name "libmodpng14 - Win32 DLL Debug" +# Name "libmodpng14 - Win32 DLL ASM" +# Name "libmodpng14 - Win32 DLL Debug ASM" +# Name "libmodpng14 - Win32 LIB" +# Name "libmodpng14 - Win32 LIB Debug" +# Name "libmodpng14 - Win32 DLL VB" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" @@ -247,23 +247,23 @@ SOURCE=.\png.rc -!IF "$(CFG)" == "libpng - Win32 DLL" +!IF "$(CFG)" == "libmodpng14 - Win32 DLL" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL ASM" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug ASM" -!ELSEIF "$(CFG)" == "libpng - Win32 LIB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB Debug" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL VB" !ENDIF @@ -272,23 +272,23 @@ SOURCE=.\png32ms.def -!IF "$(CFG)" == "libpng - Win32 DLL" +!IF "$(CFG)" == "libmodpng14 - Win32 DLL" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL ASM" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug ASM" -!ELSEIF "$(CFG)" == "libpng - Win32 LIB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB Debug" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL VB" !ENDIF @@ -296,7 +296,7 @@ # Begin Source File SOURCE=..\..\pngerror.c -# ADD CPP /Yc"png.h" +# ADD CPP /Yc"modpng14.h" # End Source File # Begin Source File @@ -338,27 +338,27 @@ SOURCE=..\..\pngvcrd.c -!IF "$(CFG)" == "libpng - Win32 DLL" +!IF "$(CFG)" == "libmodpng14 - Win32 DLL" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL ASM" -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug ASM" -!ELSEIF "$(CFG)" == "libpng - Win32 LIB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB Debug" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL VB" # PROP BASE Exclude_From_Build 1 # PROP Exclude_From_Build 1 @@ -388,11 +388,11 @@ # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File -SOURCE=..\..\png.h +SOURCE=..\..\modpng14.h # End Source File # Begin Source File -SOURCE=..\..\pngconf.h +SOURCE=..\..\modpng14conf.h # End Source File # End Group # Begin Group "Resource Files" @@ -403,31 +403,31 @@ SOURCE=.\readme.txt -!IF "$(CFG)" == "libpng - Win32 DLL" +!IF "$(CFG)" == "libmodpng14 - Win32 DLL" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL ASM" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL Debug ASM" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 LIB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 LIB Debug" # PROP Exclude_From_Build 1 -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" +!ELSEIF "$(CFG)" == "libmodpng14 - Win32 DLL VB" # PROP BASE Exclude_From_Build 1 # PROP Exclude_From_Build 1 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/msvc/libpng.dsw +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/msvc/libpng.dsw @@ -3,7 +3,7 @@ ############################################################################### -Project: "libpng"=.\libpng.dsp - Package Owner=<4> +Project: "libmodpng14"=.\libmodpng14.dsp - Package Owner=<4> Package=<5> {{{ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/msvc/png.rc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/msvc/png.rc @@ -1,19 +1,19 @@ -#define PNG_VERSION_INFO_ONLY +#define MODPNG14_VERSION_INFO_ONLY #include -#include "png.h" +#include "modpng14.h" #define _QUOTE(x) # x #define QUOTE(x) _QUOTE(x) -#define PNG_LIBPNG_DLLFNAME "LIBPNG" +#define MODPNG14_LIBMODPNG14_DLLFNAME "LIBPNG" #if defined(DLLFNAME_POSTFIX) && !defined(PRIVATEBUILD) && !defined(SPECIALBUILD) # error PRIVATEBUILD or SPECIALBUILD must be defined as a string describing the type of change brought to the standard library #endif /* defined(DLLFNAME_POSTFIX)... */ -#if !defined(DLLFNAME_POSTFIX) && defined(PNG_USE_PNGVCRD) -# if defined(PNG_DEBUG) && (PNG_DEBUG > 0) +#if !defined(DLLFNAME_POSTFIX) && defined(MODPNG14_USE_PNGVCRD) +# if defined(MODPNG14_DEBUG) && (MODPNG14_DEBUG > 0) # define DLLFNAME_POSTFIX "B" # else # define DLLFNAME_POSTFIX "A" @@ -23,13 +23,13 @@ # endif /* SPECIALBUILD */ #endif -#if defined(PNG_DEBUG) && (PNG_DEBUG > 0) +#if defined(MODPNG14_DEBUG) && (MODPNG14_DEBUG > 0) # define VS_DEBUG VS_FF_DEBUG # ifndef DLLFNAME_POSTFIX # define DLLFNAME_POSTFIX "D" # endif /* DLLFNAME_POSTFIX */ # ifndef COMMENTS -# define COMMENTS "PNG_DEBUG=" QUOTE(PNG_DEBUG) +# define COMMENTS "MODPNG14_DEBUG=" QUOTE(MODPNG14_DEBUG) # endif /* COMMENTS */ #else # define VS_DEBUG 0 @@ -50,13 +50,13 @@ # define VS_SPECIALBUILD 0 #endif /* SPECIALBUILD */ -#if ((PNG_LIBPNG_BUILD_TYPE & PNG_LIBPNG_BUILD_TYPEMASK) != \ - PNG_LIBPNG_BUILD_STABLE) +#if ((MODPNG14_LIBMODPNG14_BUILD_TYPE & MODPNG14_LIBMODPNG14_BUILD_TYPEMASK) != \ + MODPNG14_LIBMODPNG14_BUILD_STABLE) # define VS_PRERELEASE VS_FF_PRERELEASE # define VS_PATCHED 0 #else # define VS_PRERELEASE 0 -# if (PNG_LIBPNG_BUILD_TYPE & PNG_LIBPNG_BUILD_PATCHED) +# if (MODPNG14_LIBMODPNG14_BUILD_TYPE & MODPNG14_LIBMODPNG14_BUILD_PATCHED) # define VS_PATCHED VS_FF_PATCHED # else # define VS_PATCHED 0 @@ -64,8 +64,8 @@ #endif VS_VERSION_INFO VERSIONINFO -FILEVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD -PRODUCTVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD +FILEVERSION MODPNG14_LIBMODPNG14_VER_MAJOR, MODPNG14_LIBMODPNG14_VER_MINOR, MODPNG14_LIBMODPNG14_VER_RELEASE, MODPNG14_LIBMODPNG14_VER_BUILD +PRODUCTVERSION MODPNG14_LIBMODPNG14_VER_MAJOR, MODPNG14_LIBMODPNG14_VER_MINOR, MODPNG14_LIBMODPNG14_VER_RELEASE, MODPNG14_LIBMODPNG14_VER_BUILD FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS VS_DEBUG | VS_PRIVATEBUILD | VS_SPECIALBUILD | VS_PRERELEASE | VS_PATCHED FILEOS VOS__WINDOWS32 @@ -79,10 +79,10 @@ VALUE "Comments", COMMENTS "\000" #endif /* COMMENTS */ VALUE "FileDescription", "PNG image compression library\000" - VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000" - VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DLLFNAME_POSTFIX " (Windows 32 bit)\000" + VALUE "FileVersion", MODPNG14_LIBMODPNG14_VER_STRING "\000" + VALUE "InternalName", MODPNG14_LIBMODPNG14_DLLFNAME QUOTE(MODPNG14_LIBMODPNG14_VER_MAJOR) DLLFNAME_POSTFIX " (Windows 32 bit)\000" VALUE "LegalCopyright", "\251 1998-2002 Glenn Randers-Pehrson\000" - VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DLLFNAME_POSTFIX ".DLL\000" + VALUE "OriginalFilename", MODPNG14_LIBMODPNG14_DLLFNAME QUOTE(MODPNG14_LIBMODPNG14_VER_MAJOR) DLLFNAME_POSTFIX ".DLL\000" #ifdef PRIVATEBUILD VALUE "PrivateBuild", PRIVATEBUILD #endif /* PRIVATEBUILD */ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/msvc/png32ms.def +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/msvc/png32ms.def @@ -7,214 +7,214 @@ EXPORTS ;Version 1.2.5 - png_build_grayscale_palette @1 - png_check_sig @2 - png_chunk_error @3 - png_chunk_warning @4 - png_convert_from_struct_tm @5 - png_convert_from_time_t @6 - png_create_info_struct @7 - png_create_read_struct @8 - png_create_write_struct @9 - png_data_freer @10 - png_destroy_info_struct @11 - png_destroy_read_struct @12 - png_destroy_write_struct @13 - png_error @14 - png_free @15 - png_free_data @16 - png_get_IHDR @17 - png_get_PLTE @18 - png_get_bKGD @19 - png_get_bit_depth @20 - png_get_cHRM @21 - png_get_cHRM_fixed @22 - png_get_channels @23 - png_get_color_type @24 - png_get_compression_buffer_size @25 - png_get_compression_type @26 - png_get_copyright @27 - png_get_error_ptr @28 - png_get_filter_type @29 - png_get_gAMA @30 - png_get_gAMA_fixed @31 - png_get_hIST @32 - png_get_header_ver @33 - png_get_header_version @34 - png_get_iCCP @35 - png_get_image_height @36 - png_get_image_width @37 - png_get_interlace_type @38 - png_get_io_ptr @39 - png_get_libpng_ver @40 - png_get_oFFs @41 - png_get_pCAL @42 - png_get_pHYs @43 - png_get_pixel_aspect_ratio @44 - png_get_pixels_per_meter @45 - png_get_progressive_ptr @46 - png_get_rgb_to_gray_status @47 - png_get_rowbytes @48 - png_get_rows @49 - png_get_sBIT @50 - png_get_sCAL @51 - png_get_sPLT @52 - png_get_sRGB @53 - png_get_signature @54 - png_get_tIME @55 - png_get_tRNS @56 - png_get_text @57 - png_get_unknown_chunks @58 - png_get_user_chunk_ptr @59 - png_get_user_transform_ptr @60 - png_get_valid @61 - png_get_x_offset_microns @62 - png_get_x_offset_pixels @63 - png_get_x_pixels_per_meter @64 - png_get_y_offset_microns @65 - png_get_y_offset_pixels @66 - png_get_y_pixels_per_meter @67 - png_malloc @68 - png_memcpy_check @69 - png_memset_check @70 -; png_permit_empty_plte is deprecated - png_permit_empty_plte @71 - png_process_data @72 - png_progressive_combine_row @73 - png_read_end @74 - png_read_image @75 - png_read_info @76 -; png_read_init is deprecated - png_read_init @77 - png_read_png @78 - png_read_row @79 - png_read_rows @80 - png_read_update_info @81 - png_reset_zstream @82 - png_set_IHDR @83 - png_set_PLTE @84 - png_set_bKGD @85 - png_set_background @86 - png_set_bgr @87 - png_set_cHRM @88 - png_set_cHRM_fixed @89 - png_set_compression_buffer_size @90 - png_set_compression_level @91 - png_set_compression_mem_level @92 - png_set_compression_method @93 - png_set_compression_strategy @94 - png_set_compression_window_bits @95 - png_set_crc_action @96 - png_set_dither @97 - png_set_error_fn @98 - png_set_expand @99 - png_set_filler @100 - png_set_filter @101 - png_set_filter_heuristics @102 - png_set_flush @103 - png_set_gAMA @104 - png_set_gAMA_fixed @105 - png_set_gamma @106 - png_set_gray_1_2_4_to_8 @107 - png_set_gray_to_rgb @108 - png_set_hIST @109 - png_set_iCCP @110 - png_set_interlace_handling @111 - png_set_invert_alpha @112 - png_set_invert_mono @113 - png_set_keep_unknown_chunks @114 - png_set_oFFs @115 - png_set_pCAL @116 - png_set_pHYs @117 - png_set_packing @118 - png_set_packswap @119 - png_set_palette_to_rgb @120 - png_set_progressive_read_fn @121 - png_set_read_fn @122 - png_set_read_status_fn @123 - png_set_read_user_chunk_fn @124 - png_set_read_user_transform_fn @125 - png_set_rgb_to_gray @126 - png_set_rgb_to_gray_fixed @127 - png_set_rows @128 - png_set_sBIT @129 - png_set_sCAL @130 - png_set_sPLT @131 - png_set_sRGB @132 - png_set_sRGB_gAMA_and_cHRM @133 - png_set_shift @134 - png_set_sig_bytes @135 - png_set_strip_16 @136 - png_set_strip_alpha @137 - png_set_swap @138 - png_set_swap_alpha @139 - png_set_tIME @140 - png_set_tRNS @141 - png_set_tRNS_to_alpha @142 - png_set_text @143 - png_set_unknown_chunk_location @144 - png_set_unknown_chunks @145 - png_set_user_transform_info @146 - png_set_write_fn @147 - png_set_write_status_fn @148 - png_set_write_user_transform_fn @149 - png_sig_cmp @150 - png_start_read_image @151 - png_warning @152 - png_write_chunk @153 - png_write_chunk_data @154 - png_write_chunk_end @155 - png_write_chunk_start @156 - png_write_end @157 - png_write_flush @158 - png_write_image @159 - png_write_info @160 - png_write_info_before_PLTE @161 -; png_write_init is deprecated - png_write_init @162 - png_write_png @163 - png_write_row @164 - png_write_rows @165 -; png_read_init_2 and png_write_init_2 are deprecated. - png_read_init_2 @166 - png_write_init_2 @167 - png_access_version_number @168 -; png_sig_bytes @169 -; png_libpng_ver @170 - png_init_io @171 - png_convert_to_rfc1123 @172 - png_set_invalid @173 + modpng14_build_grayscale_palette @1 + modpng14_check_sig @2 + modpng14_chunk_error @3 + modpng14_chunk_warning @4 + modpng14_convert_from_struct_tm @5 + modpng14_convert_from_time_t @6 + modpng14_create_info_struct @7 + modpng14_create_read_struct @8 + modpng14_create_write_struct @9 + modpng14_data_freer @10 + modpng14_destroy_info_struct @11 + modpng14_destroy_read_struct @12 + modpng14_destroy_write_struct @13 + modpng14_error @14 + modpng14_free @15 + modpng14_free_data @16 + modpng14_get_IHDR @17 + modpng14_get_PLTE @18 + modpng14_get_bKGD @19 + modpng14_get_bit_depth @20 + modpng14_get_cHRM @21 + modpng14_get_cHRM_fixed @22 + modpng14_get_channels @23 + modpng14_get_color_type @24 + modpng14_get_compression_buffer_size @25 + modpng14_get_compression_type @26 + modpng14_get_copyright @27 + modpng14_get_error_ptr @28 + modpng14_get_filter_type @29 + modpng14_get_gAMA @30 + modpng14_get_gAMA_fixed @31 + modpng14_get_hIST @32 + modpng14_get_header_ver @33 + modpng14_get_header_version @34 + modpng14_get_iCCP @35 + modpng14_get_image_height @36 + modpng14_get_image_width @37 + modpng14_get_interlace_type @38 + modpng14_get_io_ptr @39 + modpng14_get_libmodpng14_ver @40 + modpng14_get_oFFs @41 + modpng14_get_pCAL @42 + modpng14_get_pHYs @43 + modpng14_get_pixel_aspect_ratio @44 + modpng14_get_pixels_per_meter @45 + modpng14_get_progressive_ptr @46 + modpng14_get_rgb_to_gray_status @47 + modpng14_get_rowbytes @48 + modpng14_get_rows @49 + modpng14_get_sBIT @50 + modpng14_get_sCAL @51 + modpng14_get_sPLT @52 + modpng14_get_sRGB @53 + modpng14_get_signature @54 + modpng14_get_tIME @55 + modpng14_get_tRNS @56 + modpng14_get_text @57 + modpng14_get_unknown_chunks @58 + modpng14_get_user_chunk_ptr @59 + modpng14_get_user_transform_ptr @60 + modpng14_get_valid @61 + modpng14_get_x_offset_microns @62 + modpng14_get_x_offset_pixels @63 + modpng14_get_x_pixels_per_meter @64 + modpng14_get_y_offset_microns @65 + modpng14_get_y_offset_pixels @66 + modpng14_get_y_pixels_per_meter @67 + modpng14_malloc @68 + modpng14_memcpy_check @69 + modpng14_memset_check @70 +; modpng14_permit_empty_plte is deprecated + modpng14_permit_empty_plte @71 + modpng14_process_data @72 + modpng14_progressive_combine_row @73 + modpng14_read_end @74 + modpng14_read_image @75 + modpng14_read_info @76 +; modpng14_read_init is deprecated + modpng14_read_init @77 + modpng14_read_png @78 + modpng14_read_row @79 + modpng14_read_rows @80 + modpng14_read_update_info @81 + modpng14_reset_zstream @82 + modpng14_set_IHDR @83 + modpng14_set_PLTE @84 + modpng14_set_bKGD @85 + modpng14_set_background @86 + modpng14_set_bgr @87 + modpng14_set_cHRM @88 + modpng14_set_cHRM_fixed @89 + modpng14_set_compression_buffer_size @90 + modpng14_set_compression_level @91 + modpng14_set_compression_mem_level @92 + modpng14_set_compression_method @93 + modpng14_set_compression_strategy @94 + modpng14_set_compression_window_bits @95 + modpng14_set_crc_action @96 + modpng14_set_dither @97 + modpng14_set_error_fn @98 + modpng14_set_expand @99 + modpng14_set_filler @100 + modpng14_set_filter @101 + modpng14_set_filter_heuristics @102 + modpng14_set_flush @103 + modpng14_set_gAMA @104 + modpng14_set_gAMA_fixed @105 + modpng14_set_gamma @106 + modpng14_set_gray_1_2_4_to_8 @107 + modpng14_set_gray_to_rgb @108 + modpng14_set_hIST @109 + modpng14_set_iCCP @110 + modpng14_set_interlace_handling @111 + modpng14_set_invert_alpha @112 + modpng14_set_invert_mono @113 + modpng14_set_keep_unknown_chunks @114 + modpng14_set_oFFs @115 + modpng14_set_pCAL @116 + modpng14_set_pHYs @117 + modpng14_set_packing @118 + modpng14_set_packswap @119 + modpng14_set_palette_to_rgb @120 + modpng14_set_progressive_read_fn @121 + modpng14_set_read_fn @122 + modpng14_set_read_status_fn @123 + modpng14_set_read_user_chunk_fn @124 + modpng14_set_read_user_transform_fn @125 + modpng14_set_rgb_to_gray @126 + modpng14_set_rgb_to_gray_fixed @127 + modpng14_set_rows @128 + modpng14_set_sBIT @129 + modpng14_set_sCAL @130 + modpng14_set_sPLT @131 + modpng14_set_sRGB @132 + modpng14_set_sRGB_gAMA_and_cHRM @133 + modpng14_set_shift @134 + modpng14_set_sig_bytes @135 + modpng14_set_strip_16 @136 + modpng14_set_strip_alpha @137 + modpng14_set_swap @138 + modpng14_set_swap_alpha @139 + modpng14_set_tIME @140 + modpng14_set_tRNS @141 + modpng14_set_tRNS_to_alpha @142 + modpng14_set_text @143 + modpng14_set_unknown_chunk_location @144 + modpng14_set_unknown_chunks @145 + modpng14_set_user_transform_info @146 + modpng14_set_write_fn @147 + modpng14_set_write_status_fn @148 + modpng14_set_write_user_transform_fn @149 + modpng14_sig_cmp @150 + modpng14_start_read_image @151 + modpng14_warning @152 + modpng14_write_chunk @153 + modpng14_write_chunk_data @154 + modpng14_write_chunk_end @155 + modpng14_write_chunk_start @156 + modpng14_write_end @157 + modpng14_write_flush @158 + modpng14_write_image @159 + modpng14_write_info @160 + modpng14_write_info_before_PLTE @161 +; modpng14_write_init is deprecated + modpng14_write_init @162 + modpng14_write_png @163 + modpng14_write_row @164 + modpng14_write_rows @165 +; modpng14_read_init_2 and modpng14_write_init_2 are deprecated. + modpng14_read_init_2 @166 + modpng14_write_init_2 @167 + modpng14_access_version_number @168 +; modpng14_sig_bytes @169 +; modpng14_libmodpng14_ver @170 + modpng14_init_io @171 + modpng14_convert_to_rfc1123 @172 + modpng14_set_invalid @173 ; Added at version 1.0.12 ; For compatiblity with 1.0.7-1.0.11 - png_info_init @174 - png_read_init_3 @175 - png_write_init_3 @176 - png_info_init_3 @177 - png_destroy_struct @178 + modpng14_info_init @174 + modpng14_read_init_3 @175 + modpng14_write_init_3 @176 + modpng14_info_init_3 @177 + modpng14_destroy_struct @178 ; Added at version 1.2.0 -; For use with PNG_USER_MEM_SUPPORTED - png_destroy_struct_2 @179 - png_create_read_struct_2 @180 - png_create_write_struct_2 @181 - png_malloc_default @182 - png_free_default @183 +; For use with MODPNG14_USER_MEM_SUPPORTED + modpng14_destroy_struct_2 @179 + modpng14_create_read_struct_2 @180 + modpng14_create_write_struct_2 @181 + modpng14_malloc_default @182 + modpng14_free_default @183 ; MNG features - png_permit_mng_features @184 + modpng14_permit_mng_features @184 ; MMX support - png_mmx_support @185 - png_get_mmx_flagmask @186 - png_get_asm_flagmask @187 - png_get_asm_flags @188 - png_get_mmx_bitdepth_threshold @189 - png_get_mmx_rowbytes_threshold @190 - png_set_asm_flags @191 - png_init_mmx_flags @192 + modpng14_mmx_support @185 + modpng14_get_mmx_flagmask @186 + modpng14_get_asm_flagmask @187 + modpng14_get_asm_flags @188 + modpng14_get_mmx_bitdepth_threshold @189 + modpng14_get_mmx_rowbytes_threshold @190 + modpng14_set_asm_flags @191 + modpng14_init_mmx_flags @192 ; Strip error numbers - png_set_strip_error_numbers @193 + modpng14_set_strip_error_numbers @193 ; Added at version 1.2.2 - png_handle_as_unknown @194 + modpng14_handle_as_unknown @194 ; Added at version 1.2.2 and deleted from 1.2.3 -; png_zalloc @195 -; png_zfree @196 +; modpng14_zalloc @195 +; modpng14_zfree @196 ; Added at version 1.2.4 - png_malloc_warn @195 + modpng14_malloc_warn @195 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/netware.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/netware.txt @@ -1,6 +1,6 @@ A set of project files is available for Netware. Get -libpng-1.2.5-project-netware.zip from a libpng distribution -site such as http://libpng.sourceforge.net +libmodpng14-1.2.5-project-netware.zip from a libmodpng14 distribution +site such as http://libmodpng14.sourceforge.net Put the zip file in this directory (projects) and then run -"unzip -a libpng-1.2.5-project-netware.zip" +"unzip -a libmodpng14-1.2.5-project-netware.zip" --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/projects/wince.txt +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/projects/wince.txt @@ -1,6 +1,6 @@ A set of project files is available for WinCE. Get -libpng-1.2.5-project-wince.zip from a libpng distribution -site such as http://libpng.sourceforge.net +libmodpng14-1.2.5-project-wince.zip from a libmodpng14 distribution +site such as http://libmodpng14.sourceforge.net Put the zip file in this directory (projects) and then run -"unzip -a libpng-1.2.5-project-wince.zip" +"unzip -a libmodpng14-1.2.5-project-wince.zip" --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/descrip.mms +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/descrip.mms @@ -15,15 +15,15 @@ CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) -all : pngtest.exe libpng.olb +all : pngtest.exe libmodpng14.olb @ write sys$output " pngtest available" -libpng.olb : libpng.olb($(OBJS)) +libmodpng14.olb : libmodpng14.olb($(OBJS)) @ write sys$output " Libpng available" -pngtest.exe : pngtest.obj libpng.olb - link pngtest,libpng.olb/lib,$(ZLIBSRC)libz.olb/lib +pngtest.exe : pngtest.obj libmodpng14.olb + link pngtest,libmodpng14.olb/lib,$(ZLIBSRC)libz.olb/lib test : pngtest.exe run pngtest @@ -33,20 +33,20 @@ # 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 +png.obj : modpng14.h, modpng14conf.h +pngpread.obj : modpng14.h, modpng14conf.h +pngset.obj : modpng14.h, modpng14conf.h +pngget.obj : modpng14.h, modpng14conf.h +pngread.obj : modpng14.h, modpng14conf.h +pngrtran.obj : modpng14.h, modpng14conf.h +pngrutil.obj : modpng14.h, modpng14conf.h +pngerror.obj : modpng14.h, modpng14conf.h +pngmem.obj : modpng14.h, modpng14conf.h +pngrio.obj : modpng14.h, modpng14conf.h +pngwio.obj : modpng14.h, modpng14conf.h +pngtest.obj : modpng14.h, modpng14conf.h +pngtrans.obj : modpng14.h, modpng14conf.h +pngwrite.obj : modpng14.h, modpng14conf.h +pngwtran.obj : modpng14.h, modpng14conf.h +pngwutil.obj : modpng14.h, modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/libpng-config-body.in +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/libpng-config-body.in @@ -2,11 +2,11 @@ usage() { cat < libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo libdir=\"$(LIBPATH)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ @@ -85,9 +85,9 @@ echo R_opts=\"-R$(LIBPATH)\"; \ echo ccopts=\"-xtarget=ultra\"; \ echo ldopts=\"-xtarget=ultra\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -111,9 +111,9 @@ $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \ -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJS) - $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) +libmodpng14.so.3.$(PNGMIN): $(OBJS) + $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libmodpng14.so.3 \ + -o libmodpng14.so.3.$(PNGMIN) $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) @@ -121,63 +121,63 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm $(DI)/libmodpng14 + (cd $(DI); ln -f -s $(LIBNAME) libmodpng14; ln -f -s $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -f -s $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3 +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGVER)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGVER)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ + ln -f -s libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -f -s libmodpng14.so.3 libmodpng14.so; \ ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/libpng12.pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/libpng12.pc - chmod 644 $(DL)/pkgconfig/libpng12.pc - (cd $(DL)/pkgconfig; ln -f -s libpng12.pc libpng.pc) + -@/bin/rm -f $(DL)/pkgconfig/libmodpng1412.pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/libmodpng1412.pc + chmod 644 $(DL)/pkgconfig/libmodpng1412.pc + (cd $(DL)/pkgconfig; ln -f -s libmodpng1412.pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/libpng12-config - cp libpng-config $(DB)/libpng12-config - chmod 755 $(DB)/libpng12-config - (cd $(DB); ln -sf libpng12-config libpng-config) + -@/bin/rm -f $(DB)/libmodpng14-config + -@/bin/rm -f $(DB)/libmodpng1412-config + cp libmodpng14-config $(DB)/libmodpng1412-config + chmod 755 $(DB)/libmodpng1412-config + (cd $(DB); ln -sf libmodpng1412-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -188,16 +188,16 @@ echo echo Testing installed dynamic shared library. $(CC) $(SUN_CC_FLAGS) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` \ $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -205,20 +205,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.64sunu +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.64sunu @@ -1,15 +1,15 @@ -# makefile for libpng on Solaris 2.x with cc +# makefile for libmodpng14 on Solaris 2.x with cc # Contributed by William L. Sebok, based on makefile.linux # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1998 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h CC=cc SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9 SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9 -# where make install puts libpng.a, libpng12.so and libpng12/png.h +# where make install puts libmodpng14.a, libmodpng1412.so and libmodpng1412/modpng14.h prefix=/a # Where the zlib library and include files are located @@ -25,13 +25,13 @@ -Wmissing-declarations -Wtraditional -Wcast-align \ -Wstrict-prototypes -Wmissing-prototypes #-Wconversion CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \ - # $(WARNMORE) -g -DPNG_DEBUG=5 -LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm + # $(WARNMORE) -g -DMODPNG14_DEBUG=5 +LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lmodpng1412 -lz -lm #RANLIB=ranlib RANLIB=echo -LIBNAME=libpng12 +LIBNAME=libmodpng1412 PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) @@ -44,7 +44,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -67,17 +67,17 @@ .c.pic.o: $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).so pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo libdir=\"$(LIBPATH)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ @@ -85,9 +85,9 @@ echo R_opts=\"-R$(LIBPATH)\"; \ echo ccopts=\"-xtarget=ultra -xarch=v9\"; \ echo ldopts=\"-xtarget=ultra -xarch=v9\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -111,9 +111,9 @@ $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \ -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) +libmodpng14.so.3.$(PNGMIN): $(OBJSDLL) + $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libmodpng14.so.3 \ + -o libmodpng14.so.3.$(PNGMIN) $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) @@ -121,63 +121,63 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm $(DI)/libmodpng14 + (cd $(DI); ln -f -s $(LIBNAME) libmodpng14; ln -f -s $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -f -s $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ).$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGVER)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGVER)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ + ln -f -s libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -f -s libmodpng14.so.3 libmodpng14.so; \ ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -188,16 +188,16 @@ echo echo Testing installed dynamic shared library. $(CC) $(SUN_CC_FLAGS) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags ` \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags ` \ $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -205,20 +205,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.acorn +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.acorn @@ -1,4 +1,4 @@ -# Project: libpng +# Project: libmodpng14 # Toolflags: @@ -12,13 +12,13 @@ # Final targets: -@.libpng-lib: @.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \ +@.libmodpng14-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-libmodpng14-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 \ @@ -34,8 +34,8 @@ @remove .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 +@.pngtest: @.o.pngtest @.libmodpng14-lib C:o.Stubs Zlib:zlib_lib + Link $(Linkflags) @.o.pngtest @.libmodpng14-lib C:o.Stubs Zlib:zlib_lib .SUFFIXES: .o .mm .c --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.aix +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.aix @@ -1,9 +1,9 @@ -# makefile for libpng using gcc (generic, static library) +# makefile for libmodpng14 using gcc (generic, static library) # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 2000 Cosmin Truta # Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc) # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # Location of the zlib library and include files ZLIBINC = ../zlib @@ -16,7 +16,7 @@ RANLIB = ranlib RM = rm -f -LIBNAME=libpng12 +LIBNAME=libmodpng1412 PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) @@ -28,7 +28,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -38,13 +38,13 @@ DI=$(DESTDIR)/$(INCPATH) DL=$(DESTDIR)/$(LIBPATH) -CDEBUG = -g -DPNG_DEBUG=5 +CDEBUG = -g -DMODPNG14_DEBUG=5 LDDEBUG = CRELEASE = -O2 LDRELEASE = -s WARNMORE=-Wall CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE) -LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE) +LDFLAGS = -L. -L$(ZLIBLIB) -lmodpng14 -lz -lm $(LDRELEASE) # File extensions O=.o @@ -57,7 +57,7 @@ pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) # Targets -all: libpng$(A) pngtest$(E) +all: libmodpng14$(A) pngtest$(E) $(LIBNAME)$(A): $(OBJS) $(AR) $@ $(OBJS) @@ -71,34 +71,34 @@ install: $(LIBNAME)$(A) -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/libpng ]; then mkdir $(DI)/libpng; fi + -@if [ ! -d $(DI)/libmodpng14 ]; then mkdir $(DI)/libmodpng14; fi -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@rm $(DI)/png.h - -@rm $(DI)/pngconf.h - cp png.h pngconf.h $(DI)/libpng - chmod 644 $(DI)/libpng/png.h \ + -@rm $(DI)/modpng14.h + -@rm $(DI)/modpng14conf.h + cp modpng14.h modpng14conf.h $(DI)/libmodpng14 + chmod 644 $(DI)/libmodpng14/modpng14.h \ cp $(LIBNAME)$(A) $(DL) - (cd $(DL); ln -f -s $(LIBNAME)$(A) libpng$(A)) - $(DI)/libpng/pngconf.h - (cd $(DI); ln -f -s libpng/* .;) + (cd $(DL); ln -f -s $(LIBNAME)$(A) libmodpng14$(A)) + $(DI)/libmodpng14/modpng14conf.h + (cd $(DI); ln -f -s libmodpng14/* .;) clean: /bin/rm -f *.o $(LIBNAME)$(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 +png$(O): modpng14.h modpng14conf.h +pngerror$(O): modpng14.h modpng14conf.h +pngget$(O): modpng14.h modpng14conf.h +pngmem$(O): modpng14.h modpng14conf.h +pngpread$(O): modpng14.h modpng14conf.h +pngread$(O): modpng14.h modpng14conf.h +pngrio$(O): modpng14.h modpng14conf.h +pngrtran$(O): modpng14.h modpng14conf.h +pngrutil$(O): modpng14.h modpng14conf.h +pngset$(O): modpng14.h modpng14conf.h +pngtest$(O): modpng14.h modpng14conf.h +pngtrans$(O): modpng14.h modpng14conf.h +pngwio$(O): modpng14.h modpng14conf.h +pngwrite$(O): modpng14.h modpng14conf.h +pngwtran$(O): modpng14.h modpng14conf.h +pngwutil$(O): modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.amiga +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.amiga @@ -1,9 +1,9 @@ # Commodore Amiga Makefile -# makefile for libpng and SAS C V6.5x compiler +# makefile for libmodpng14 and SAS C V6.5x compiler # Copyright (C) 1995-2000 Wolf Faust -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # -# Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h +# Note: Use #define MODPNG14_READ_BIG_ENDIAN_SUPPORTED in modpng14conf.h # # Location/path of zlib include files ZLIB=/zlib @@ -14,11 +14,11 @@ # 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 + DEFINE=MODPNG14_INTERNAL #linker flags LDFLAGS= SD ND BATCH #link libs -LDLIBS= libpng.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib +LDLIBS= libmodpng14.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib # linker LN= slink # file deletion command @@ -32,13 +32,13 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.lib pngtest +all: libmodpng14.lib pngtest -libpng.lib: $(OBJS) --$(RM) libpng.lib -$(AR) libpng.lib r $(OBJS) +libmodpng14.lib: $(OBJS) +-$(RM) libmodpng14.lib +$(AR) libmodpng14.lib r $(OBJS) -pngtest: pngtest.o libpng.lib +pngtest: pngtest.o libmodpng14.lib $(LN) libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -93,73 +93,73 @@ $(CC) -nostart -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) -o \ $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -nostart -Wl,-soname,libpng.so.3 -o \ - libpng.so.3.$(PNGMIN) $(OBJSDLL) +libmodpng14.so.3.$(PNGMIN): $(OBJSDLL) + $(CC) -nostart -Wl,-soname,libmodpng14.so.3 -o \ + libmodpng14.so.3.$(PNGMIN) $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so - $(CC) -L$(ZLIBLIB) -lz -lpng12 -o pngtest pngtest.o + $(CC) -L$(ZLIBLIB) -lz -lmodpng1412 -o pngtest pngtest.o test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ + ln -sf libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -sf libmodpng14.so.3 libmodpng14.so; \ ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -168,32 +168,32 @@ test-installed: $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ + /bin/rm -f *.o libmodpng14.a pngtest pngout.png libmodpng14-config \ $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.bor +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.bor @@ -1,4 +1,4 @@ -# Makefile for libpng +# Makefile for libmodpng14 # 16-bit Borland C++ (Note: All modules are compiled in C mode) # To build the library, do: # "make -fmakefile.bor -DMODEL=c" @@ -93,7 +93,7 @@ +pngwtran.obj \ +pngwutil.obj -LIBNAME=libpng$(MODEL).lib +LIBNAME=libmodpng14$(MODEL).lib ## Implicit rules @@ -107,9 +107,9 @@ ## Major targets -all: libpng pngtest +all: libmodpng14 pngtest -libpng: $(LIBNAME) +libmodpng14: $(LIBNAME) pngtest: pngtest$(MODEL).exe @@ -139,7 +139,7 @@ $(LIBNAME): $(OBJS) -del $(LIBNAME) $(LIB) $(LIBNAME) @&&| -$(LIBOBJS), libpng$(MODEL) +$(LIBOBJS), libmodpng14$(MODEL) | @@ -159,4 +159,4 @@ -del *.map -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.cygwin +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.cygwin @@ -7,7 +7,7 @@ # 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 +# For conditions of distribution and use, see copyright notice in modpng14.h # This makefile intends to support building outside the src directory # if desired. When invoking it, specify an argument to SRCDIR on the @@ -23,7 +23,7 @@ # Override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -31,7 +31,7 @@ DESTDIR= -# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to +# To enable assembler optimizations, add '-DMODPNG14_USE_PNGGCCRD' to # $CFLAGS, and include pnggccrd.o in $OBJS, below, and in the dependency # list at the bottom of this makefile. @@ -41,7 +41,7 @@ MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw endif -# Where "make install" puts libpng*.a, *png*.dll, png.h, and pngconf.h +# Where "make install" puts libmodpng14*.a, *png*.dll, modpng14.h, and modpng14conf.h ifndef prefix prefix=/usr $(warning You haven't specified a 'prefix=' location. Defaulting to "/usr") @@ -64,32 +64,32 @@ ### if you use the asm, add pnggccrd.o to the OBJS list ### ### if you don't need thread safety, but want the asm accel -#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD \ +#CFLAGS= $(strip $(MINGW_CCFLAGS) -DMODPNG14_THREAD_UNSAFE_OK -DMODPNG14_USE_PNGGCCRD \ # $(addprefix -I,$(ZLIBINC)) -Wall -O3 $(ALIGN) -funroll-loops \ -# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 +# -fomit-frame-pointer) # $(WARNMORE) -g -DMODPNG14_DEBUG=5 ### if you need thread safety and want (minimal) asm accel -#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_USE_PNGGCCRD $(addprefix -I,$(ZLIBINC)) \ +#CFLAGS= $(strip $(MINGW_CCFLAGS) -DMODPNG14_USE_PNGGCCRD $(addprefix -I,$(ZLIBINC)) \ # -Wall -O3 $(ALIGN) -funroll-loops \ -# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 +# -fomit-frame-pointer) # $(WARNMORE) -g -DMODPNG14_DEBUG=5 ### Normal (non-asm) compilation CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \ -Wall -O3 $(ALIGN) -funroll-loops \ - -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 + -fomit-frame-pointer) # $(WARNMORE) -g -DMODPNG14_DEBUG=5 -LIBNAME = libpng12 +LIBNAME = libmodpng1412 PNGMAJ = 0 CYGDLL = 12 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) SHAREDLIB=cygpng$(CYGDLL).dll -STATLIB=libpng.a -IMPLIB=libpng.dll.a -SHAREDDEF=libpng.def +STATLIB=libmodpng14.a +IMPLIB=libmodpng14.dll.a +SHAREDDEF=libmodpng14.def LIBS=$(SHAREDLIB) $(STATLIB) EXE=.exe -LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB)) -lz) +LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lmodpng14 $(addprefix -L,$(ZLIBLIB)) -lz) LDSFLAGS=$(strip -shared -L. $(MINGW_LDFLAGS) -Wl,--export-all) LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) -lz @@ -122,11 +122,11 @@ %.o : %.c $(CC) -c $(CFLAGS) -o $@ $< -%.pic.o : CFLAGS += -DPNG_BUILD_DLL +%.pic.o : CFLAGS += -DMODPNG14_BUILD_DLL %.pic.o : %.c $(CC) -c $(CFLAGS) -o $@ $< -all: all-static all-shared libpng.pc libpng-config libpng.pc libpng-config +all: all-static all-shared libmodpng14.pc libmodpng14-config libmodpng14.pc libmodpng14-config # Make this to verify that "make [...] install" will do what you want. buildsetup-tell: @@ -136,41 +136,41 @@ $(addprefix $(D),$(INCPATH)'\n' $(LIBPATH)'\n' $(BINPATH)'\n' \ $(MANPATH)'\n' $(MAN3PATH)'\n' $(MAN5PATH)'\n')'\n' -libpng.pc: scripts/libpng.pc.in - @echo -e Making pkg-config file for this libpng installation..'\n' \ +libmodpng14.pc: scripts/libmodpng14.pc.in + @echo -e Making pkg-config file for this libmodpng14 installation..'\n' \ using PREFIX=\"$(prefix)\"'\n' - cat $(S)/scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc + cat $(S)/scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ + sed -e s/-lm// > libmodpng14.pc -libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in - @echo -e Making $(LIBNAME) libpng-config file for this libpng \ +libmodpng14-config: scripts/libmodpng14-config-head.in scripts/libmodpng14-config-body.in + @echo -e Making $(LIBNAME) libmodpng14-config file for this libmodpng14 \ installation..'\n' using PREFIX=\"$(prefix)\"'\n' - ( cat $(S)/scripts/libpng-config-head.in; \ + ( cat $(S)/scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng$(CYGDLL) -lz\"; \ - cat $(S)/scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng14$(CYGDLL) -lz\"; \ + cat $(S)/scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config static: all-static shared: all-shared all-static: $(STATLIB) pngtest-stat$(EXE) all-shared: $(SHAREDLIB) pngtest$(EXE) -pnggccrd.o: pnggccrd.c png.h pngconf.h +pnggccrd.o: pnggccrd.c modpng14.h modpng14conf.h @echo "" @echo ' You can ignore the "control reaches end of non-void function"' @echo ' warning and " defined but not used" warnings:' @echo "" $(CC) -c $(CFLAGS) -o $@ $< -pnggccrd.pic.o: pnggccrd.c png.h pngconf.h +pnggccrd.pic.o: pnggccrd.c modpng14.h modpng14conf.h @echo "" @echo ' You can ignore the "control reaches end of non-void function"' @echo ' warning and " defined but not used" warnings:' @echo "" - $(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $< + $(CC) -c $(CFLAGS) -DMODPNG14_BUILD_DLL -o $@ $< $(STATLIB): $(OBJS) ar rc $@ $(OBJS) @@ -209,51 +209,51 @@ -@rm -f $(DL)/$(STATLIB) (cd $(DL); ln -sf $(LIBNAME).a $(STATLIB)) -install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man +install-shared: $(SHAREDLIB) libmodpng14.pc libmodpng14-config install-headers install-man -@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi -@if [ ! -d $(DB) ]; then $(MKDIR) $(DB); fi -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR) $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc install -m 644 $(IMPLIB) $(DL)/$(LIBNAME).dll.a -@rm -f $(DL)/$(IMPLIB) (cd $(DL); ln -sf $(LIBNAME).dll.a $(IMPLIB)) install -s -m 755 $(SHAREDLIB) $(DB) - install -m 644 libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + install -m 644 libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) install-headers: -@if [ ! -d $(DI) ]; then $(MKDIR) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR) $(DI)/$(LIBNAME); fi - -@rm -f $(DI)/png.h - -@rm -f $(DI)/pngconf.h - install -m 644 $(S)/png.h $(S)/pngconf.h $(DI)/$(LIBNAME) - -@rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + -@rm -f $(DI)/modpng14.h + -@rm -f $(DI)/modpng14conf.h + install -m 644 $(S)/modpng14.h $(S)/modpng14conf.h $(DI)/$(LIBNAME) + -@rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) install-man: -@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR) $(D)$(MAN3PATH); fi -@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR) $(D)$(MAN5PATH); fi - install -m 644 $(S)/libpngpf.3 $(S)/libpng.3 $(D)$(MAN3PATH) + install -m 644 $(S)/libmodpng14pf.3 $(S)/libmodpng14.3 $(D)$(MAN3PATH) install -m 644 $(S)/png.5 $(D)$(MAN5PATH) -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) # Run this to verify that a future `configure' run will pick up the settings # you want. test-config-install: SHELL=/bin/bash -test-config-install: $(DB)/libpng-config - @echo -e Testing libpng-config functions...'\n' +test-config-install: $(DB)/libmodpng14-config + @echo -e Testing libmodpng14-config functions...'\n' @ for TYRA in LDFLAGS CPPFLAGS CFLAGS LIBS VERSION; \ do \ printf "(%d)\t %10s =%s\n" $$(($$gytiu + 1)) $$TYRA \ - "$$($(DB)/libpng-config `echo --$$TYRA |tr '[:upper:]' '[:lower:]'`)"; \ + "$$($(DB)/libmodpng14-config `echo --$$TYRA |tr '[:upper:]' '[:lower:]'`)"; \ gytiu=$$(( $$gytiu + 1 )); \ done @@ -264,42 +264,42 @@ test-installed: $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) \ - -o pngtesti$(EXE) `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti$(EXE) `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti$(EXE) pngtest.png clean: /bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \ pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF) \ - libpng-config libpng.pc pngtesti$(EXE) + libmodpng14-config libmodpng14.pc pngtesti$(EXE) DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* -.PHONY: buildsetup-tell libpng.pc libpng-config test-config-install clean +.PHONY: buildsetup-tell libmodpng14.pc libmodpng14-config test-config-install clean # 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 +png.o png.pic.o: modpng14.h modpng14conf.h png.c +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h pngerror.c +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h pngrio.c +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h pngwio.c +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h pngmem.c +pngset.o pngset.pic.o: modpng14.h modpng14conf.h pngset.c +pngget.o pngget.pic.o: modpng14.h modpng14conf.h pngget.c +pngread.o pngread.pic.o: modpng14.h modpng14conf.h pngread.c +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h pngrtran.c +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h pngrutil.c +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h pngtrans.c +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h pngwrite.c +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h pngwtran.c +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h pngwutil.c +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h pngpread.c -pngtest.o: png.h pngconf.h pngtest.c -pngtest-stat.o: png.h pngconf.h pngtest.c +pngtest.o: modpng14.h modpng14conf.h pngtest.c +pngtest-stat.o: modpng14.h modpng14conf.h pngtest.c --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.darwin +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.darwin @@ -1,12 +1,12 @@ -# makefile for libpng on Darwin / Mac OS X +# makefile for libmodpng14 on Darwin / Mac OS X # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 2001 Christoph Pfisterer # derived from makefile.linux: # Copyright (C) 1998, 1999 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h +# where "make install" puts libmodpng14.a, libmodpng1412.dylib, modpng14.h and modpng14conf.h prefix=/usr/local # Where the zlib library and include files are located @@ -17,7 +17,7 @@ CC=cc CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops -LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng1412 -lz #RANLIB=echo RANLIB=ranlib @@ -25,7 +25,7 @@ PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -35,7 +35,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -58,24 +58,24 @@ .c.pic.o: $(CC) -c $(CFLAGS) -fno-common -o $@ $*.c -all: libpng.a $(LIBNAME).dylib pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).dylib pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ + sed -e s/-lm// > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).dylib: $(LIBNAME).$(PNGMAJ).dylib ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib @@ -90,12 +90,12 @@ -o $(LIBNAME).$(PNGVER).dylib \ $(OBJSDLL) -libpng.3.$(PNGMIN).dylib: $(OBJSDLL) +libmodpng14.3.$(PNGMIN).dylib: $(OBJSDLL) $(CC) -dynamiclib \ - -install_name $(DL)/libpng.3.dylib \ + -install_name $(DL)/libmodpng14.3.dylib \ -current_version 3 -compatibility_version 3 \ -flat_namespace -undefined suppress \ - -o libpng.3.$(PNGMIN).dylib \ + -o libmodpng14.3.$(PNGMIN).dylib \ $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).dylib @@ -104,64 +104,64 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).dylib libpng.pc \ - libpng.3.$(PNGMIN).dylib +install-shared: install-headers $(LIBNAME).dylib libmodpng14.pc \ + libmodpng14.3.$(PNGMIN).dylib -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGVER)*.dylib -@/bin/rm -f $(DL)/$(LIBNAME).dylib - -@/bin/rm -f $(DL)/libpng.dylib - -@/bin/rm -f $(DL)/libpng.3.dylib - -@/bin/rm -f $(DL)/libpng.3.$(PNGMIN)*.dylib + -@/bin/rm -f $(DL)/libmodpng14.dylib + -@/bin/rm -f $(DL)/libmodpng14.3.dylib + -@/bin/rm -f $(DL)/libmodpng14.3.$(PNGMIN)*.dylib cp $(LIBNAME).$(PNGVER).dylib $(DL) - cp libpng.3.$(PNGMIN).dylib $(DL) + cp libmodpng14.3.$(PNGMIN).dylib $(DL) chmod 755 $(DL)/$(LIBNAME).$(PNGVER).dylib - chmod 755 $(DL)/libpng.3.$(PNGMIN).dylib + chmod 755 $(DL)/libmodpng14.3.$(PNGMIN).dylib (cd $(DL); \ - ln -sf libpng.3.$(PNGMIN).dylib libpng.3.dylib; \ - ln -sf libpng.3.dylib libpng.dylib; \ + ln -sf libmodpng14.3.$(PNGMIN).dylib libmodpng14.3.dylib; \ + ln -sf libmodpng14.3.dylib libmodpng14.dylib; \ ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \ ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -170,15 +170,15 @@ test-installed: $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - rm -f *.o libpng.a pngtest pngout.png libpng-config \ - libpng.3.$(PNGMIN).dylib \ - libpng.pc $(LIBNAME).*dylib pngtesti + rm -f *.o libmodpng14.a pngtest pngout.png libmodpng14-config \ + libmodpng14.3.$(PNGMIN).dylib \ + libmodpng14.pc $(LIBNAME).*dylib pngtesti DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -186,20 +186,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.dec +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.dec @@ -1,9 +1,9 @@ -# makefile for libpng on DEC Alpha Unix +# makefile for libmodpng14 on DEC Alpha Unix # Copyright (C) 2000-2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where make install puts libpng.a and png.h +# where make install puts libmodpng14.a and modpng14.h prefix=/usr/local INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -13,7 +13,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -34,11 +34,11 @@ PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 CC=cc -CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm +CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DMODPNG14_DEBUG=1 +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng14 -lz -lm #RANLIB=echo RANLIB=ranlib @@ -47,24 +47,24 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: $(LIBNAME).so libpng.a pngtest libpng.pc libpng-config +all: $(LIBNAME).so libmodpng14.a pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo ccopts=\"-std\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -76,73 +76,73 @@ $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) -soname $(LIBNAME).so.$(PNGMAJ) -libpng.so.3.$(PNGMIN): $(OBJS) +libmodpng14.so.3.$(PNGMIN): $(OBJS) $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) - -soname libpng.so.3 + -soname libmodpng14.so.3 -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ + ln -f -s libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -f -s libmodpng14.so.3 libmodpng14.so; \ ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -153,33 +153,33 @@ echo echo Testing installed dynamic shared library. $(CC) -w1 -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) -R$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.dj2 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.dj2 @@ -1,9 +1,9 @@ -# DJGPP (DOS gcc) makefile for libpng +# DJGPP (DOS gcc) makefile for libmodpng14 # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where make install will put libpng.a and png.h +# where make install will put libmodpng14.a and modpng14.h #prefix=/usr/local prefix=. INCPATH=$(prefix)/include @@ -11,7 +11,7 @@ CC=gcc CFLAGS=-I../zlib -O -LDFLAGS=-L. -L../zlib/ -lpng -lz -lm +LDFLAGS=-L. -L../zlib/ -lmodpng14 -lz -lm RANLIB=ranlib @@ -19,37 +19,37 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o pngwtran.o \ pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest +all: libmodpng14.a pngtest -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) coff2exe pngtest test: pngtest ./pngtest clean: - rm -f *.o libpng.a pngtest pngout.png + rm -f *.o libmodpng14.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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.freebsd +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.freebsd @@ -1,6 +1,6 @@ -# makefile for libpng under FreeBSD +# makefile for libmodpng14 under FreeBSD # Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h PREFIX?= /usr/local SHLIB_VER?= 5 @@ -11,30 +11,30 @@ NOPROFILE= YES NOOBJ= YES -# where make install puts libpng.a and png.h +# where make install puts libmodpng14.a and modpng14.h DESTDIR= ${PREFIX} LIBDIR= /lib -INCS= png.h pngconf.h -INCSDIR= /include/libpng +INCS= modpng14.h modpng14conf.h +INCSDIR= /include/libmodpng14 INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk -MAN= libpng.3 libpngpf.3 png.5 +MAN= libmodpng14.3 libmodpng14pf.3 png.5 MANDIR= /man/man -SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \ - libpng/pngconf.h ${INCSDIR}/../pngconf.h +SYMLINKS= libmodpng14/modpng14.h ${INCSDIR}/../modpng14.h \ + libmodpng14/modpng14conf.h ${INCSDIR}/../modpng14conf.h LDADD+= -lm -lz DPADD+= ${LIBM} ${LIBZ} -CFLAGS+= -I. -DPNG_USE_PNGGCCRD +CFLAGS+= -I. -DMODPNG14_USE_PNGGCCRD .if (${MACHINE_ARCH} != "i386") -CFLAGS+= -DPNG_NO_ASSEMBLER_CODE +CFLAGS+= -DMODPNG14_NO_ASSEMBLER_CODE .endif SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c -pngtest: pngtest.o libpng.a - ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm +pngtest: pngtest.o libmodpng14.a + ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lmodpng14 -lz -lm CLEANFILES= pngtest pngtest.o pngout.png --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.gcc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.gcc @@ -1,7 +1,7 @@ -# makefile for libpng using gcc (generic, static library) +# makefile for libmodpng14 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 +# For conditions of distribution and use, see copyright notice in modpng14.h # Location of the zlib library and include files ZLIBINC = ../zlib @@ -14,12 +14,12 @@ RANLIB = ranlib RM = rm -f -CDEBUG = -g -DPNG_DEBUG=5 +CDEBUG = -g -DMODPNG14_DEBUG=5 LDDEBUG = CRELEASE = -O2 LDRELEASE = -s CFLAGS = -I$(ZLIBINC) -Wall $(CRELEASE) -LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE) +LDFLAGS = -L. -L$(ZLIBLIB) -lmodpng14 -lz -lm $(LDRELEASE) # File extensions O=.o @@ -32,35 +32,35 @@ pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) # Targets -all: libpng$(A) pngtest$(E) +all: libmodpng14$(A) pngtest$(E) -libpng$(A): $(OBJS) +libmodpng14$(A): $(OBJS) $(AR) $@ $(OBJS) $(RANLIB) $@ test: pngtest$(E) ./pngtest$(E) -pngtest$(E): pngtest$(O) libpng$(A) +pngtest$(E): pngtest$(O) libmodpng14$(A) $(LD) -o $@ pngtest$(O) $(LDFLAGS) clean: - $(RM) *$(O) libpng$(A) pngtest$(E) pngout.png + $(RM) *$(O) libmodpng14$(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 +png$(O): modpng14.h modpng14conf.h +pngerror$(O): modpng14.h modpng14conf.h +pngget$(O): modpng14.h modpng14conf.h +pngmem$(O): modpng14.h modpng14conf.h +pngpread$(O): modpng14.h modpng14conf.h +pngread$(O): modpng14.h modpng14conf.h +pngrio$(O): modpng14.h modpng14conf.h +pngrtran$(O): modpng14.h modpng14conf.h +pngrutil$(O): modpng14.h modpng14conf.h +pngset$(O): modpng14.h modpng14conf.h +pngtest$(O): modpng14.h modpng14conf.h +pngtrans$(O): modpng14.h modpng14conf.h +pngwio$(O): modpng14.h modpng14conf.h +pngwrite$(O): modpng14.h modpng14conf.h +pngwtran$(O): modpng14.h modpng14conf.h +pngwutil$(O): modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.gcmmx +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.gcmmx @@ -1,9 +1,9 @@ -# makefile for libpng.a and libpng12.so on Linux ELF with gcc using MMX +# makefile for libmodpng14.a and libmodpng1412.so on Linux ELF with gcc using MMX # assembler code # Copyright 2002 Greg Roelofs and Glenn Randers-Pehrson # Copyright 1998-2001 Greg Roelofs # Copyright 1996-1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # CAUTION: Do not use this makefile with gcc versions 2.7.2.2 and earlier. @@ -13,15 +13,15 @@ # there are no floating-point programs (e.g., SETI@Home) running in # the background! Context switches between MMX and FPU are expensive. -LIBNAME = libpng12 +LIBNAME = libmodpng1412 PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) CC=gcc -# where "make install" puts libpng12.a, libpng12.so*, -# libpng12/png.h and libpng12/pngconf.h +# where "make install" puts libmodpng1412.a, libmodpng1412.so*, +# libmodpng1412/modpng14.h and libmodpng1412/modpng14conf.h # Prefix must be a full pathname. prefix=/usr/local @@ -41,22 +41,22 @@ # for pgcc version 2.95.1, -O3 is buggy; don't use it. -# Remove -DPNG_THREAD_UNSAFE_OK if you need thread safety +# Remove -DMODPNG14_THREAD_UNSAFE_OK if you need thread safety ### for generic gcc: -CFLAGS=-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall \ +CFLAGS=-DMODPNG14_THREAD_UNSAFE_OK -DMODPNG14_USE_PNGGCCRD -I$(ZLIBINC) -Wall \ -O3 $(ALIGN) -funroll-loops \ - -fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5 + -fomit-frame-pointer # $(WARNMORE) -g -DMODPNG14_DEBUG=5 ### for gcc 2.95.2 on 686: -#CFLAGS=-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 \ +#CFLAGS=-DMODPNG14_THREAD_UNSAFE_OK -DMODPNG14_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 \ +#CFLAGS=-DMODPNG14_THREAD_UNSAFE_OK -DMODPNG14_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) -lpng12 -lz -lm -LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm +LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lmodpng1412 -lz -lm +LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libmodpng14.a -lz -lm RANLIB=ranlib #RANLIB=echo @@ -69,7 +69,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -92,30 +92,30 @@ .c.pic.o: $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c -all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).so pngtest pngtest-static libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cppflags=\"-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD\"; \ + echo cppflags=\"-DMODPNG14_THREAD_UNSAFE_OK -DMODPNG14_USE_PNGGCCRD\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config -pnggccrd.o: pnggccrd.c png.h pngconf.h +pnggccrd.o: pnggccrd.c modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) -o $@ $*.c -pnggccrd.pic.o: pnggccrd.c png.h pngconf.h +pnggccrd.pic.o: pnggccrd.c modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) @@ -129,15 +129,15 @@ -o $(LIBNAME).so.$(PNGVER) \ $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -shared -Wl,-soname,libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) \ +libmodpng14.so.3.$(PNGMIN): $(OBJSDLL) + $(CC) -shared -Wl,-soname,libmodpng14.so.3 \ + -o libmodpng14.so.3.$(PNGMIN) \ $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) -pngtest-static: pngtest.o libpng.a +pngtest-static: pngtest.o libmodpng14.a $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A) test: pngtest pngtest-static @@ -146,67 +146,67 @@ @echo "" ./pngtest @echo "" - @echo " Running pngtest statically linked with libpng.a:" + @echo " Running pngtest statically linked with libmodpng14.a:" @echo "" ./pngtest-static -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ + ln -sf libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -sf libmodpng14.so.3 libmodpng14.so; \ ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -215,35 +215,35 @@ test-installed: $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ + /bin/rm -f *.o libmodpng14.a pngtest pngout.png libmodpng14-config \ $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc 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 +png.o png.pic.o: modpng14.h modpng14conf.h png.c +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h pngerror.c +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h pngrio.c +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h pngwio.c +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h pngmem.c +pngset.o pngset.pic.o: modpng14.h modpng14conf.h pngset.c +pngget.o pngget.pic.o: modpng14.h modpng14conf.h pngget.c +pngread.o pngread.pic.o: modpng14.h modpng14conf.h pngread.c +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h pngrtran.c +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h pngrutil.c +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h pngtrans.c +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h pngwrite.c +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h pngwtran.c +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h pngwutil.c +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h pngpread.c -pngtest.o: png.h pngconf.h pngtest.c +pngtest.o: modpng14.h modpng14conf.h pngtest.c --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.hpgcc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.hpgcc @@ -1,21 +1,21 @@ -# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker. +# makefile for libmodpng14 on HP-UX using GCC with the HP ANSI/C linker. # Copyright (C) 2002, Glenn Randers-Pehrson # 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 +# For conditions of distribution and use, see copyright notice in modpng14.h CC=gcc LD=ld -# where "make install" puts libpng.a, libpng.sl*, png.h and pngconf.h +# where "make install" puts libmodpng14.a, libmodpng14.sl*, modpng14.h and modpng14conf.h prefix=/usr/local # Where the zlib library and include files are located ZLIBLIB=/opt/zlib/lib ZLIBINC=/opt/zlib/include -# Note that if you plan to build a libpng shared library, zlib must also +# Note that if you plan to build a libmodpng14 shared library, zlib must also # be a shared library, which zlib's configure does not do. After running # zlib's configure, edit the appropriate lines of makefile to read: # CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \ @@ -33,9 +33,9 @@ # 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) -lpng12 -lz -lm -LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm + $(ALIGN) # $(WARNMORE) -g -DMODPNG14_DEBUG=5 +#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lmodpng1412 -lz -lm +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng1412 -lz -lm RANLIB=ranlib #RANLIB=echo @@ -43,7 +43,7 @@ PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -53,7 +53,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -76,22 +76,22 @@ .c.pic.o: $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c -all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).sl pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ) ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl @@ -103,9 +103,9 @@ $(LD) -b +s \ +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) $(OBJSDLL) -libpng.sl.3.$(PNGMIN): $(OBJSDLL) +libmodpng14.sl.3.$(PNGMIN): $(OBJSDLL) $(LD) -b +s \ - +h libpng.sl.3 -o libpng.sl.3.$(PNGMIN) $(OBJSDLL) + +h libmodpng14.sl.3 -o libmodpng14.sl.3.$(PNGMIN) $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).sl $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) @@ -114,63 +114,63 @@ ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc \ - libpng.sl.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libmodpng14.pc \ + libmodpng14.sl.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGVER)* $(DL)/$(LIBNAME).sl - -@/bin/rm -f $(DL)/libpng.sl - -@/bin/rm -f $(DL)/libpng.sl.3 - -@/bin/rm -f $(DL)/libpng.sl.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.sl + -@/bin/rm -f $(DL)/libmodpng14.sl.3 + -@/bin/rm -f $(DL)/libmodpng14.sl.3.$(PNGMIN)* cp $(LIBNAME).sl.$(PNGVER) $(DL) - cp libpng.sl.3.$(PNGMIN) $(DL) + cp libmodpng14.sl.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER) - chmod 755 $(DL)/libpng.sl.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.sl.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.sl.3.$(PNGMIN) libpng.sl.3; \ - ln -sf libpng.sl.3 libpng.sl; \ + ln -sf libmodpng14.sl.3.$(PNGMIN) libmodpng14.sl.3; \ + ln -sf libmodpng14.sl.3 libmodpng14.sl; \ ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \ ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -181,16 +181,16 @@ echo echo Testing installed dynamic shared library. $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ - libpng.sl.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ + libmodpng14.sl.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -198,20 +198,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.hpux +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.hpux @@ -1,14 +1,14 @@ -# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product. +# makefile for libmodpng14, HPUX (10.20 and 11.00) using the ANSI/C product. # Copyright (C) 1999-2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42 # contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # Where the zlib library and include files are located ZLIBLIB=/opt/zlib/lib ZLIBINC=/opt/zlib/include -# Note that if you plan to build a libpng shared library, zlib must also +# Note that if you plan to build a libmodpng14 shared library, zlib must also # be a shared library, which zlib's configure does not do. After running # zlib's configure, edit the appropriate lines of makefile to read: # CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \ @@ -19,17 +19,17 @@ 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 +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng14 -lz -lm RANLIB=ranlib PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 -# where make install puts libpng.a, libpng12.sl, and png.h -prefix=/opt/libpng +# where make install puts libmodpng14.a, libmodpng1412.sl, and modpng14.h +prefix=/opt/libmodpng14 INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib MANPATH=$(prefix)/man @@ -38,7 +38,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -61,24 +61,24 @@ .c.pic.o: $(CC) -c $(CFLAGS) +z -o $@ $*.c -all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).sl pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ) ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl @@ -90,73 +90,73 @@ $(LD) -b +s \ +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) $(OBJSDLL) -libpng.sl.3.$(PNGMIN): $(OBJSDLL) +libmodpng14.sl.3.$(PNGMIN): $(OBJSDLL) $(LD) -b +s \ - +h libpng.sl.3 -o libpng.sl.3.$(PNGMIN) $(OBJSDLL) + +h libmodpng14.sl.3 -o libmodpng14.sl.3.$(PNGMIN) $(OBJSDLL) -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc \ - libpng.sl.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libmodpng14.pc \ + libmodpng14.sl.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGVER)* $(DL)/$(LIBNAME).sl - -@/bin/rm -f $(DL)/libpng.sl - -@/bin/rm -f $(DL)/libpng.sl.3 - -@/bin/rm -f $(DL)/libpng.sl.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.sl + -@/bin/rm -f $(DL)/libmodpng14.sl.3 + -@/bin/rm -f $(DL)/libmodpng14.sl.3.$(PNGMIN)* cp $(LIBNAME).sl.$(PNGVER) $(DL) - cp libpng.sl.3.$(PNGMIN) $(DL) + cp libmodpng14.sl.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER) - chmod 755 $(DL)/libpng.sl.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.sl.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.sl.3.$(PNGMIN) libpng.sl.3; \ - ln -sf libpng.sl.3 libpng.sl; \ + ln -sf libmodpng14.sl.3.$(PNGMIN) libmodpng14.sl.3; \ + ln -sf libmodpng14.sl.3 libmodpng14.sl; \ ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \ ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -167,16 +167,16 @@ echo echo Testing installed dynamic shared library. $(CC) $(CCFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ - libpng.sl.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ + libmodpng14.sl.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -184,19 +184,19 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.ibmc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.ibmc @@ -1,7 +1,7 @@ -# Makefile for libpng (static) +# Makefile for libmodpng14 (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 +# For conditions of distribution and use, see copyright notice in modpng14.h # Notes: # Derived from makefile.std # All modules are compiled in C mode @@ -31,12 +31,12 @@ 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) +LIBS = libmodpng14$(A) $(ZLIBLIB)/zlib$(A) # Targets -all: libpng$(A) pngtest$(E) +all: libmodpng14$(A) pngtest$(E) -libpng$(A): $(OBJS) +libmodpng14$(A): $(OBJS) $(AR) -out:$@ $(OBJS) test: pngtest$(E) @@ -44,28 +44,28 @@ pngtest: pngtest$(E) -pngtest$(E): pngtest$(O) libpng$(A) +pngtest$(E): pngtest$(O) libmodpng14$(A) $(LD) $(LDFLAGS) pngtest$(O) $(LIBS) clean: $(RM) *$(O) - $(RM) libpng$(A) + $(RM) libmodpng14$(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 +png$(O): modpng14.h modpng14conf.h +pngerror$(O): modpng14.h modpng14conf.h +pngget$(O): modpng14.h modpng14conf.h +pngmem$(O): modpng14.h modpng14conf.h +pngpread$(O): modpng14.h modpng14conf.h +pngread$(O): modpng14.h modpng14conf.h +pngrio$(O): modpng14.h modpng14conf.h +pngrtran$(O): modpng14.h modpng14conf.h +pngrutil$(O): modpng14.h modpng14conf.h +pngset$(O): modpng14.h modpng14conf.h +pngtest$(O): modpng14.h modpng14conf.h +pngtrans$(O): modpng14.h modpng14conf.h +pngwio$(O): modpng14.h modpng14conf.h +pngwrite$(O): modpng14.h modpng14conf.h +pngwtran$(O): modpng14.h modpng14conf.h +pngwutil$(O): modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.intel +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.intel @@ -1,20 +1,20 @@ -# Makefile for libpng +# Makefile for libmodpng14 # 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 +# For conditions of distribution and use, see copyright notice in modpng14.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 +# Caution: the assembler code was introduced at libmodpng14 version 1.0.4 and has # not yet been thoroughly tested. # Use assembler code -ASMCODE=-DPNG_USE_PNGVCRD +ASMCODE=-DMODPNG14_USE_PNGVCRD # Where the zlib library and include files are located ZLIBLIB=..\zlib @@ -49,66 +49,66 @@ all: test -png$(O): png.h pngconf.h +png$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngset$(O): png.h pngconf.h +pngset$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngget$(O): png.h pngconf.h +pngget$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngread$(O): png.h pngconf.h +pngread$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngpread$(O): png.h pngconf.h +pngpread$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngrtran$(O): png.h pngconf.h +pngrtran$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngrutil$(O): png.h pngconf.h +pngrutil$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngvcrd$(O): png.h pngconf.h +pngvcrd$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngerror$(O): png.h pngconf.h +pngerror$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngmem$(O): png.h pngconf.h +pngmem$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngrio$(O): png.h pngconf.h +pngrio$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwio$(O): png.h pngconf.h +pngwio$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngtrans$(O): png.h pngconf.h +pngtrans$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwrite$(O): png.h pngconf.h +pngwrite$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwtran$(O): png.h pngconf.h +pngwtran$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwutil$(O): png.h pngconf.h +pngwutil$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -libpng.lib: $(OBJS) - if exist libpng.lib del libpng.lib - lib /NOLOGO /OUT:libpng.lib $(OBJS) +libmodpng14.lib: $(OBJS) + if exist libmodpng14.lib del libmodpng14.lib + lib /NOLOGO /OUT:libmodpng14.lib $(OBJS) -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib +pngtest.exe: pngtest.obj libmodpng14.lib + $(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libmodpng14.lib $(ZLIBLIB)\zlib.lib test: pngtest.exe pngtest.exe -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.knr +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.knr @@ -1,14 +1,14 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.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 +# where make install puts libmodpng14.a and modpng14.h prefix=/usr/local INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -16,7 +16,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -25,7 +25,7 @@ CC=cc CFLAGS=-I../zlib -O -LDFLAGS=-L. -L../zlib/ -lpng -lz -lm +LDFLAGS=-L. -L../zlib/ -lmodpng14 -lz -lm # flags for ansi2knr ANSI2KNRFLAGS= @@ -36,7 +36,7 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: ansi2knr libpng.a pngtest +all: ansi2knr libmodpng14.a pngtest # general rule to allow ansi2knr to work .c.o: @@ -48,32 +48,32 @@ ansi2knr: ansi2knr.c $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c -libpng.a: ansi2knr $(OBJS) +libmodpng14.a: ansi2knr $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install: libpng.a +install: libmodpng14.a -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng + -@mkdir $(DESTDIR)$(INCPATH)/libmodpng14 -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a + -@rm -f $(DESTDIR)$(INCPATH)/modpng14.h + -@rm -f $(DESTDIR)$(INCPATH)/modpng14conf.h + cp modpng14.h $(DESTDIR)$(INCPATH)/libmodpng14 + cp modpng14conf.h $(DESTDIR)$(INCPATH)/libmodpng14 + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14.h + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14conf.h + (cd $(DESTDIR)$(INCPATH); ln -f -s libmodpng14/* .) + cp libmodpng14.a $(DESTDIR)$(LIBPATH) + chmod 644 $(DESTDIR)$(LIBPATH)/libmodpng14.a clean: - rm -f *.o libpng.a pngtest pngout.png ansi2knr + rm -f *.o libmodpng14.a pngtest pngout.png ansi2knr DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -81,19 +81,19 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.linux +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.linux @@ -1,17 +1,17 @@ -# makefile for libpng.a and libpng12.so on Linux ELF with gcc +# makefile for libmodpng14.a and libmodpng1412.so on Linux ELF with gcc # Copyright (C) 1998, 1999, 2002 Greg Roelofs and Glenn Randers-Pehrson # Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -LIBNAME = libpng12 +LIBNAME = libmodpng1412 PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) CC=gcc -# where "make install" puts libpng12.a, libpng12.so*, -# libpng12/png.h and libpng12/pngconf.h +# where "make install" puts libmodpng1412.a, libmodpng1412.so*, +# libmodpng1412/modpng14.h and libmodpng1412/modpng14conf.h # Prefix must be a full pathname. prefix=/usr/local @@ -32,10 +32,10 @@ # 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 + $(ALIGN) # $(WARNMORE) -g -DMODPNG14_DEBUG=5 -LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm -LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm +LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lmodpng1412 -lz -lm +LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libmodpng14.a -lz -lm RANLIB=ranlib #RANLIB=echo @@ -48,7 +48,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -71,24 +71,24 @@ .c.pic.o: $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c -all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).so pngtest pngtest-static libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -101,15 +101,15 @@ -o $(LIBNAME).so.$(PNGVER) \ $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -shared -Wl,-soname,libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) \ +libmodpng14.so.3.$(PNGMIN): $(OBJSDLL) + $(CC) -shared -Wl,-soname,libmodpng14.so.3 \ + -o libmodpng14.so.3.$(PNGMIN) \ $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) -pngtest-static: pngtest.o libpng.a +pngtest-static: pngtest.o libmodpng14.a $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A) test: pngtest pngtest-static @@ -118,67 +118,67 @@ @echo "" ./pngtest @echo "" - @echo " Running pngtest statically linked with libpng.a:" + @echo " Running pngtest statically linked with libmodpng14.a:" @echo "" ./pngtest-static -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ + ln -sf libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -sf libmodpng14.so.3 libmodpng14.so; \ ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -187,16 +187,16 @@ test-installed: $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ + /bin/rm -f *.o libmodpng14.a pngtest pngout.png libmodpng14-config \ $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -204,20 +204,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.macosx +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.macosx @@ -1,11 +1,11 @@ -# makefile for libpng, MACOS X +# makefile for libmodpng14, MACOS X # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # Modified by Karin Kosina 20011010: # build shared library (*.dylib) -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where make install puts libpng.a and png.h +# where make install puts libmodpng14.a and modpng14.h prefix=/usr/local # Where the zlib library and include files are located @@ -20,10 +20,10 @@ PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DPNG_DEBUG=5 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -current_version $(PNGVER) +CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DMODPNG14_DEBUG=5 +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng14 -lz -current_version $(PNGVER) -LIBNAME=libpng12 +LIBNAME=libmodpng1412 SHAREDLIB_POSTFIX=dylib INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -33,7 +33,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -52,106 +52,106 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest shared libpng.pc libpng-config +all: libmodpng14.a pngtest shared libmodpng14.pc libmodpng14-config shared: $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ + sed -e s/-lm// > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX): $(OBJS) cc -dynamiclib -flat_namespace -undefined suppress -o $@ $(OBJS) -libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX): $(OBJS) +libmodpng14.3.$(PNGMIN).$(SHAREDLIB_POSTFIX): $(OBJS) cc -dynamiclib -compatibility_version 3 -flat_namespace \ -undefined suppress -o $@ $(OBJS) -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -f -s $(LIBNAME) libmodpng14; ln -f -s $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -f -s $(LIBNAME).a libmodpng14.a) install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \ - libpng.pc libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) + libmodpng14.pc libmodpng14.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f \ $(DL)/$(LIBNAME).$(PNGVER)*.$(SHAREDLIB_POSTFIX) -@/bin/rm -f $(DL)/$(LIBNAME).$(SHAREDLIB_POSTFIX) - -@/bin/rm -f libpng.$(SHARED_POSTFIX) - -@/bin/rm -f libpng.3.$(SHARED_POSTFIX) - -@/bin/rm -f libpng.3.$(PNGMIN)*.$(SHARED_POSTFIX) - cp libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) $(DL) + -@/bin/rm -f libmodpng14.$(SHARED_POSTFIX) + -@/bin/rm -f libmodpng14.3.$(SHARED_POSTFIX) + -@/bin/rm -f libmodpng14.3.$(PNGMIN)*.$(SHARED_POSTFIX) + cp libmodpng14.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) $(DL) cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(DL) chmod 755 $(DL)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) - chmod 755 $(DL)/libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) + chmod 755 $(DL)/libmodpng14.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) (cd $(DL); \ - ln -f -s libpng.3.$(PNGMIN).$(SHARED_POSTFIX) \ - libpng.3.$(SHARED_POSTFIX); \ - ln -f -s libpng.3.$(SHARED_POSTFIX) libpng.$(SHARED_POSTFIX); \ + ln -f -s libmodpng14.3.$(PNGMIN).$(SHARED_POSTFIX) \ + libmodpng14.3.$(SHARED_POSTFIX); \ + ln -f -s libmodpng14.3.$(SHARED_POSTFIX) libmodpng14.$(SHARED_POSTFIX); \ ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \ - libpng.$(SHARED_POSTFIX); \ - ln -f -s libpng.3.$(PNGMIN).$(SHARED_POSTFIX) \ - libpng.3.$(SHARED_POSTFIX); \ + libmodpng14.$(SHARED_POSTFIX); \ + ln -f -s libmodpng14.3.$(PNGMIN).$(SHARED_POSTFIX) \ + libmodpng14.3.$(SHARED_POSTFIX); \ ln -f -s $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \ $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \ ln -f -s $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \ $(LIBNAME).$(SHAREDLIB_POSTFIX)) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -160,17 +160,17 @@ test-installed: $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - rm -f *.o libpng.a pngtest pngout.png libpng-config \ + rm -f *.o libmodpng14.a pngtest pngout.png libmodpng14-config \ $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \ $(LIBNAME).$(SHAREDLIB_POSTFIX) \ - libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) \ - libpng.pc + libmodpng14.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -178,20 +178,20 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.mips +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.mips @@ -1,9 +1,9 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where make install puts libpng.a and png.h +# where make install puts libmodpng14.a and modpng14.h prefix=/usr/local INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -11,7 +11,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -21,7 +21,7 @@ CC=cc CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips #CFLAGS=-O -LDFLAGS=-L. -L../zlib/ -lpng -lz -lm +LDFLAGS=-L. -L../zlib/ -lmodpng14 -lz -lm #RANLIB=ranlib RANLIB=echo @@ -30,34 +30,34 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest +all: libmodpng14.a pngtest -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install: libpng.a +install: libmodpng14.a -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng + -@mkdir $(DESTDIR)$(INCPATH)/libmodpng14 -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a + -@rm -f $(DESTDIR)$(INCPATH)/modpng14.h + -@rm -f $(DESTDIR)$(INCPATH)/modpng14conf.h + cp modpng14.h $(DESTDIR)$(INCPATH)/libmodpng14 + cp modpng14conf.h $(DESTDIR)$(INCPATH)/libmodpng14 + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14.h + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14conf.h + (cd $(DESTDIR)$(INCPATH); ln -f -s libmodpng14/* .) + cp libmodpng14.a $(DESTDIR)$(LIBPATH) + chmod 644 $(DESTDIR)$(LIBPATH)/libmodpng14.a clean: - rm -f *.o libpng.a pngtest pngout.png + rm -f *.o libmodpng14.a pngtest pngout.png DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -65,19 +65,19 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.msc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.msc @@ -1,6 +1,6 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.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 -------- @@ -20,67 +20,67 @@ OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) -all: libpng.lib +all: libmodpng14.lib -png$(O): png.h pngconf.h +png$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngset$(O): png.h pngconf.h +pngset$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngget$(O): png.h pngconf.h +pngget$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngread$(O): png.h pngconf.h +pngread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngpread$(O): png.h pngconf.h +pngpread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrtran$(O): png.h pngconf.h +pngrtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrutil$(O): png.h pngconf.h +pngrutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngerror$(O): png.h pngconf.h +pngerror$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngmem$(O): png.h pngconf.h +pngmem$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrio$(O): png.h pngconf.h +pngrio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwio$(O): png.h pngconf.h +pngwio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngtrans$(O): png.h pngconf.h +pngtrans$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwrite$(O): png.h pngconf.h +pngwrite$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwtran$(O): png.h pngconf.h +pngwtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwutil$(O): png.h pngconf.h +pngwutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) - del libpng.lib - lib libpng $(OBJS1); - lib libpng $(OBJS2); - lib libpng $(OBJS3); +libmodpng14.lib: $(OBJS1) $(OBJS2) $(OBJS3) + del libmodpng14.lib + lib libmodpng14 $(OBJS1); + lib libmodpng14 $(OBJS2); + lib libmodpng14 $(OBJS3); -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ; +pngtest.exe: pngtest.obj libmodpng14.lib + $(LD) $(LDFLAGS) pngtest.obj,,,libmodpng14.lib ..\zlib\zlib.lib ; test: pngtest.exe pngtest -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.ne10bsd +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.ne10bsd @@ -1,15 +1,15 @@ -# makefile for libpng for NetBSD for the standard +# makefile for libmodpng14 for NetBSD for the standard # make obj && make depend && make && make test # make includes && make install # Copyright (C) 2002 Patrick R.L. Welche -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # You should also run makefile.netbsd LOCALBASE?=/usr/local LIBDIR= ${LOCALBASE}/lib MANDIR= ${LOCALBASE}/man -INCSDIR=${LOCALBASE}/include/libpng10 +INCSDIR=${LOCALBASE}/include/libmodpng1410 LIB= png10 SHLIB_MAJOR= 0 @@ -17,17 +17,17 @@ 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 +INCS= modpng14.h modpng14conf.h +MAN= libmodpng14.3 libmodpng14pf.3 png.5 -CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD +CPPFLAGS+=-I${.CURDIR} -DMODPNG14_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 +# CPPFLAGS+=-DMODPNG14_THREAD_UNSAFE_OK # MKLINT= no # .else - CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE + CPPFLAGS+=-DMODPNG14_NO_ASSEMBLER_CODE # .endif CLEANFILES+=pngtest.o pngtest @@ -35,7 +35,7 @@ pngtest.o: pngtest.c ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm test: pngtest --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.ne12bsd +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.ne12bsd @@ -1,15 +1,15 @@ -# makefile for libpng for NetBSD for the standard +# makefile for libmodpng14 for NetBSD for the standard # make obj && make depend && make && make test # make includes && make install # Copyright (C) 2002 Patrick R.L. Welche -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # You should also run makefile.netbsd LOCALBASE?=/usr/local LIBDIR= ${LOCALBASE}/lib MANDIR= ${LOCALBASE}/man -INCSDIR=${LOCALBASE}/include/libpng12 +INCSDIR=${LOCALBASE}/include/libmodpng1412 LIB= png12 SHLIB_MAJOR= 0 @@ -17,17 +17,17 @@ 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 +INCS= modpng14.h modpng14conf.h +MAN= libmodpng14.3 libmodpng14pf.3 png.5 -CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD +CPPFLAGS+=-I${.CURDIR} -DMODPNG14_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 +# CPPFLAGS+=-DMODPNG14_THREAD_UNSAFE_OK # MKLINT= no # .else - CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE + CPPFLAGS+=-DMODPNG14_NO_ASSEMBLER_CODE # .endif CLEANFILES+=pngtest.o pngtest @@ -35,7 +35,7 @@ pngtest.o: pngtest.c ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm test: pngtest --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.netbsd +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.netbsd @@ -1,15 +1,15 @@ -# makefile for libpng for NetBSD for the standard +# makefile for libmodpng14 for NetBSD for the standard # make obj && make depend && make && make test # make includes && make install # Copyright (C) 2002 Patrick R.L. Welche -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # You should also run makefile.ne0bsd LOCALBASE?=/usr/local LIBDIR= ${LOCALBASE}/lib MANDIR= ${LOCALBASE}/man -INCSDIR=${LOCALBASE}/include/libpng +INCSDIR=${LOCALBASE}/include/libmodpng14 LIB= png SHLIB_MAJOR= 3 @@ -17,17 +17,17 @@ 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 +INCS= modpng14.h modpng14conf.h +MAN= libmodpng14.3 libmodpng14pf.3 png.5 -CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD +CPPFLAGS+=-I${.CURDIR} -DMODPNG14_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 +# CPPFLAGS+=-DMODPNG14_THREAD_UNSAFE_OK # MKLINT= no # .else - CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE + CPPFLAGS+=-DMODPNG14_NO_ASSEMBLER_CODE # .endif CLEANFILES+=pngtest.o pngtest @@ -35,7 +35,7 @@ pngtest.o: pngtest.c ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm test: pngtest --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.openbsd +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.openbsd @@ -1,6 +1,6 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h PREFIX?= /usr/local LIBDIR= ${PREFIX}/lib @@ -14,31 +14,31 @@ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \ pngwio.c pngwrite.c pngwtran.c pngwutil.c -HDRS= png.h pngconf.h +HDRS= modpng14.h modpng14conf.h CFLAGS+= -Wall -CPPFLAGS+= -I${.CURDIR} -DPNG_NO_ASSEMBLER_CODE -DPNG_USE_PNGGCCRD +CPPFLAGS+= -I${.CURDIR} -DMODPNG14_NO_ASSEMBLER_CODE -DMODPNG14_USE_PNGGCCRD NOPROFILE= Yes CLEANFILES+= pngtest.o pngtest -MAN= libpng.3 libpngpf.3 png.5 -DOCS= ANNOUNCE CHANGES LICENSE README libpng.txt +MAN= libmodpng14.3 libmodpng14pf.3 png.5 +DOCS= ANNOUNCE CHANGES LICENSE README libmodpng14.txt pngtest.o: pngtest.c ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} pngtest: pngtest.o - ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm + ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lmodpng14 -lz -lm test: pngtest cd ${.OBJDIR} && env \ LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest beforeinstall: - if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \ + if [ ! -d ${DESTDIR}${PREFIX}/include/libmodpng14 ]; then \ + ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libmodpng14; \ fi if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \ @@ -57,13 +57,13 @@ fi afterinstall: - @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a - @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a - @rm -f ${DESTDIR}${PREFIX}/include/png.h - @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h + @rm -f ${DESTDIR}${LIBDIR}/libmodpng14_pic.a + @rm -f ${DESTDIR}${LIBDIR}/debug/libmodpng14.a + @rm -f ${DESTDIR}${PREFIX}/include/modpng14.h + @rm -f ${DESTDIR}${PREFIX}/include/modpng14conf.h @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ - -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng + -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libmodpng14 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.os2 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.os2 @@ -1,5 +1,5 @@ -# makefile for libpng on OS/2 with gcc -# For conditions of distribution and use, see copyright notice in png.h +# makefile for libmodpng14 on OS/2 with gcc +# For conditions of distribution and use, see copyright notice in modpng14.h # Related files: pngos2.def @@ -13,8 +13,8 @@ -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 + -malign-functions=2 #$(WARNMORE) -g -DMODPNG14_DEBUG=5 +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng14 -lzdll -Zcrtdll AR=emxomfar PNGLIB=png.lib @@ -50,20 +50,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.sco +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.sco @@ -4,11 +4,11 @@ # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1998 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h CC=cc -# where make install puts libpng.a, libpng.so*, and png.h +# where make install puts libmodpng14.a, libmodpng14.so*, and modpng14.h prefix=/usr/local # Where the zlib library and include files are located @@ -18,7 +18,7 @@ ZLIBINC=../zlib CFLAGS= -dy -belf -I$(ZLIBINC) -O3 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng1412 -lz -lm #RANLIB=ranlib RANLIB=echo @@ -26,9 +26,9 @@ PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 -INCPATH=$(prefix)/include/libpng +INCPATH=$(prefix)/include/libmodpng14 LIBPATH=$(prefix)/lib MANPATH=$(prefix)/man BINPATH=$(prefix)/bin @@ -36,7 +36,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -59,24 +59,24 @@ .c.pic.o: $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).so pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo ccopts=\"-belf\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -88,8 +88,8 @@ $(CC) -G -Wl,-h,$(LIBNAME).so.$(PNGMAJ) -o $(LIBNAME).so.$(PNGVER) \ $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -G -Wl,-h,libpng.so.3 -o libpng.so.3.$(PNGMIN) \ +libmodpng14.so.3.$(PNGMIN): $(OBJSDLL) + $(CC) -G -Wl,-h,libmodpng14.so.3 -o libmodpng14.so.3.$(PNGMIN) \ $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so @@ -98,65 +98,65 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - -@/bin/rm -f $(DI)/png.h - -@/bin/rm -f $(DI)/pngconf.h - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) + -@/bin/rm -f $(DI)/modpng14.h + -@/bin/rm -f $(DI)/modpng14conf.h + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -f -s $(LIBNAME) libmodpng14; ln -f -s $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -f -s $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ + ln -f -s libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -f -s libmodpng14.so.3 libmodpng14.so; \ ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -165,16 +165,16 @@ test-installed: $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ + /bin/rm -f *.o libmodpng14.a pngtest pngout.png libmodpng14-config \ $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -182,20 +182,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.sggcc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.sggcc @@ -1,9 +1,9 @@ -# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc' +# makefile for libmodpng14.a and libmodpng1412.so, SGI IRIX with 'cc' # Copyright (C) 2001-2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# Where make install puts libpng.a, libpng12.so, and libpng12/png.h +# Where make install puts libmodpng14.a, libmodpng1412.so, and libmodpng1412/modpng14.h # Prefix must be a full pathname. prefix=/usr/local @@ -16,7 +16,7 @@ ZLIBLIB=../zlib ZLIBINC=../zlib -LIBNAME=libpng12 +LIBNAME=libmodpng1412 PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) @@ -26,12 +26,12 @@ # See "man abi". zlib must be built with the same ABI. ABI= -WARNMORE= # -g -DPNG_DEBUG=5 +WARNMORE= # -g -DMODPNG14_DEBUG=5 CFLAGS=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 -LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm +LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lmodpng14 -lz -lm LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ) \ -set_version sgi$(PNGMAJ).0 -LDLEGACY=cc $(ABI) -shared -soname libpng.so.3 \ +LDLEGACY=cc $(ABI) -shared -soname libmodpng14.so.3 \ -set_version sgi$3.0 # See "man dso" for info about shared objects @@ -47,7 +47,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -63,28 +63,28 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest shared libpng.pc libpng-config +all: libmodpng14.a pngtest shared libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ shared: $(LIBNAME).so.$(PNGVER) -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo ccopts=\"$(ABI)\"; \ echo ldopts=\"$(ABI)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo libdir=\"$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -96,10 +96,10 @@ $(LDSHARED) -o $@ $(OBJS) rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ) -libpng.so.3.$(PNGMIN): $(OBJS) +libmodpng14.so.3.$(PNGMIN): $(OBJS) $(LDLEGACY) -o $@ $(OBJS) -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest @@ -107,63 +107,63 @@ echo Testing local static library. ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ + ln -sf libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -sf libmodpng14.so.3 libmodpng14.so; \ ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -174,15 +174,15 @@ echo echo Testing installed dynamic shared library. $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --libdir` \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ + -L$(ZLIBLIB) -rpath $(ZLIBLIB):`$(BINPATH)/libmodpng1412-config --libdir` \ + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \ + rm -f *.o libmodpng14.a pngtest pngtesti pngout.png libmodpng14.pc libmodpng14-config \ $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ + libmodpng14.so.3.$(PNGMIN) \ so_locations DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO @@ -191,21 +191,21 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h +pnggccrd.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.sgi +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.sgi @@ -1,14 +1,14 @@ -# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc' +# makefile for libmodpng14.a and libmodpng1412.so, SGI IRIX with 'cc' # Copyright (C) 2001-2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -LIBNAME=libpng12 +LIBNAME=libmodpng1412 PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -# Where make install puts libpng.a, libpng12.so, and libpng12/png.h +# Where make install puts libmodpng14.a, libmodpng1412.so, and libmodpng1412/modpng14.h # Prefix must be a full pathname. prefix=/usr/local @@ -29,14 +29,14 @@ WARNMORE=-fullwarn # Note: -KPIC is the default anyhow -#CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC -DPNG_USE_PNGGCCRD # -g -DPNG_DEBUG=5 -CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD \ - -DPNG_NO_ASSEMBLER_CODE -LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng12 -lz -lm -LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm +#CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC -DMODPNG14_USE_PNGGCCRD # -g -DMODPNG14_DEBUG=5 +CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DMODPNG14_USE_PNGGCCRD \ + -DMODPNG14_NO_ASSEMBLER_CODE +LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lmodpng1412 -lz -lm +LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lmodpng14 -lz -lm LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ) \ -set_version sgi$(PNGMAJ).0 -LDLEGACY=cc $(ABI) -shared -soname libpng.so.3 \ +LDLEGACY=cc $(ABI) -shared -soname libmodpng14.so.3 \ -set_version sgi$3.0 # See "man dso" for info about shared objects @@ -52,7 +52,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -68,29 +68,29 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest shared libpng.pc libpng-config +all: libmodpng14.a pngtest shared libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ shared: $(LIBNAME).so.$(PNGVER) -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cppflags=\"-DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE\"; \ + echo cppflags=\"-DMODPNG14_USE_PNGGCCRD -DMODPNG14_NO_ASSEMBLER_CODE\"; \ echo ccopts=\"$(ABI)\"; \ echo ldopts=\"$(ABI)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo libdir=\"$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -102,10 +102,10 @@ $(LDSHARED) -o $@ $(OBJS) rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ) -libpng.so.3.$(PNGMIN): $(OBJS) +libmodpng14.so.3.$(PNGMIN): $(OBJS) $(LDLEGACY) -o $@ $(OBJS) -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest @@ -113,63 +113,63 @@ echo Testing local static library. ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -sf $(LIBNAME) libmodpng14; ln -sf $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -sf $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ + ln -sf libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -sf libmodpng14.so.3 libmodpng14.so; \ ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -180,15 +180,15 @@ echo echo Testing installed dynamic shared library. $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --libdir` \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ + -L$(ZLIBLIB) -rpath $(ZLIBLIB):`$(BINPATH)/libmodpng1412-config --libdir` \ + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` ./pngtesti pngtest.png clean: - rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \ + rm -f *.o libmodpng14.a pngtest pngtesti pngout.png libmodpng14.pc libmodpng14-config \ $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ + libmodpng14.so.3.$(PNGMIN) \ so_locations DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO @@ -197,21 +197,21 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h +pnggccrd.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.so9 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.so9 @@ -1,15 +1,15 @@ -# makefile for libpng on Solaris 9 (beta) with Forte cc +# makefile for libmodpng14 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) 2002 Glenn Randers-Pehrson # Copyright (C) 1998-2001 Greg Roelofs # Copyright (C) 1996-1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # gcc 2.95 doesn't work. CC=cc -# Where make install puts libpng.a, libpng.so*, and png.h +# Where make install puts libmodpng14.a, libmodpng14.so*, and modpng14.h prefix=/usr/local # Where the zlib library and include files are located @@ -26,9 +26,9 @@ #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) -Wall -O3 $(WARNMORE) -g -DMODPNG14_DEBUG=5 CFLAGS=-I$(ZLIBINC) -O3 -LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm +LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lmodpng1412 -lz -lm #RANLIB=ranlib RANLIB=echo @@ -36,7 +36,7 @@ PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -46,7 +46,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -69,24 +69,24 @@ .c.pic.o: $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).so pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo R_opts=\"-R$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -110,9 +110,9 @@ $(LD) -G -h $(LIBNAME).so.$(PNGMAJ) \ -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJS) - $(LD) -G -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) +libmodpng14.so.3.$(PNGMIN): $(OBJS) + $(LD) -G -h libmodpng14.so.3 \ + -o libmodpng14.so.3.$(PNGMIN) $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) @@ -120,63 +120,63 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -f -s $(LIBNAME) libmodpng14; ln -f -s $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -f -s $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ + ln -f -s libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -f -s libmodpng14.so.3 libmodpng14.so; \ ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -187,16 +187,16 @@ echo echo Testing installed dynamic shared library. $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` \ -L$(ZLIBLIB) -R$(ZLIBLIB) ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -204,20 +204,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.solaris +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.solaris @@ -1,13 +1,13 @@ -# makefile for libpng on Solaris 2.x with gcc +# makefile for libmodpng14 on Solaris 2.x with gcc # Copyright (C) 2002 Glenn Randers-Pehrson # Contributed by William L. Sebok, based on makefile.linux # Copyright (C) 1998 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h CC=gcc -# Where make install puts libpng.a, libpng12.so*, and png.h +# Where make install puts libmodpng14.a, libmodpng1412.so*, and modpng14.h prefix=/usr/local # Where the zlib library and include files are located @@ -23,8 +23,8 @@ -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) -lpng12 -lz -lm + # $(WARNMORE) -g -DMODPNG14_DEBUG=5 +LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lmodpng1412 -lz -lm #RANLIB=ranlib RANLIB=echo @@ -32,7 +32,7 @@ PNGMAJ = 0 PNGMIN = 1.2.5 PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 +LIBNAME = libmodpng1412 INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -42,7 +42,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -65,25 +65,25 @@ .c.pic.o: $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config +all: libmodpng14.a $(LIBNAME).so pngtest libmodpng14.pc libmodpng14-config -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc +libmodpng14.pc: + cat scripts/libmodpng14.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmodpng14.pc -libpng-config: - ( cat scripts/libpng-config-head.in; \ +libmodpng14-config: + ( cat scripts/libmodpng14-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cppflags=\"-DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE\"; \ + echo cppflags=\"-DMODPNG14_USE_PNGGCCRD -DMODPNG14_NO_ASSEMBLER_CODE\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo R_opts=\"-R$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config + echo libs=\"-lmodpng1412 -lz -lm\"; \ + cat scripts/libmodpng14-config-body.in ) > libmodpng14-config + chmod +x libmodpng14-config $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so @@ -107,9 +107,9 @@ $(LD) -G -h $(LIBNAME).so.$(PNGMAJ) \ -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -libpng.so.3.$(PNGMIN): $(OBJS) - $(LD) -G -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) +libmodpng14.so.3.$(PNGMIN): $(OBJS) + $(LD) -G -h libmodpng14.so.3 \ + -o libmodpng14.so.3.$(PNGMIN) $(OBJSDLL) pngtest: pngtest.o $(LIBNAME).so $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) @@ -117,63 +117,63 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: modpng14.h modpng14conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) + cp modpng14.h modpng14conf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/modpng14.h $(DI)/$(LIBNAME)/modpng14conf.h + -@/bin/rm -f $(DI)/modpng14.h $(DI)/modpng14conf.h + -@/bin/rm -f $(DI)/libmodpng14 + (cd $(DI); ln -f -s $(LIBNAME) libmodpng14; ln -f -s $(LIBNAME)/* .) -install-static: install-headers libpng.a +install-static: install-headers libmodpng14.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a + cp libmodpng14.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) + -@/bin/rm -f $(DL)/libmodpng14.a + (cd $(DL); ln -f -s $(LIBNAME).a libmodpng14.a) -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) +install-shared: install-headers $(LIBNAME).so.$(PNGVER) libmodpng14.pc \ + libmodpng14.so.3.$(PNGMIN) -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* + -@/bin/rm -f $(DL)/libmodpng14.so + -@/bin/rm -f $(DL)/libmodpng14.so.3 + -@/bin/rm -f $(DL)/libmodpng14.so.3.$(PNGMIN)* cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) + cp libmodpng14.so.3.$(PNGMIN) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) + chmod 755 $(DL)/libmodpng14.so.3.$(PNGMIN) (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ + ln -f -s libmodpng14.so.3.$(PNGMIN) libmodpng14.so.3; \ + ln -f -s libmodpng14.so.3 libmodpng14.so; \ ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so; \ ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc + -@/bin/rm -f $(DL)/pkgconfig/libmodpng14.pc + cp libmodpng14.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) + (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libmodpng14.pc) -install-man: libpng.3 libpngpf.3 png.5 +install-man: libmodpng14.3 libmodpng14pf.3 png.5 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 + -@/bin/rm -f $(DM)/man3/libmodpng14.3 + -@/bin/rm -f $(DM)/man3/libmodpng14pf.3 + cp libmodpng14.3 $(DM)/man3 + cp libmodpng14pf.3 $(DM)/man3 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi -@/bin/rm -f $(DM)/man5/png.5 cp png.5 $(DM)/man5 -install-config: libpng-config +install-config: libmodpng14-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config + -@/bin/rm -f $(DB)/libmodpng14-config -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config + cp libmodpng14-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) + (cd $(DB); ln -sf $(LIBNAME)-config libmodpng14-config) install: install-static install-shared install-man install-config @@ -184,16 +184,16 @@ echo echo Testing installed dynamic shared library. $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \ + `$(BINPATH)/libmodpng1412-config --cflags` pngtest.c \ + -o pngtesti `$(BINPATH)/libmodpng1412-config --ldflags` \ -L$(ZLIBLIB) -R$(ZLIBLIB) ./pngtesti pngtest.png clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc + /bin/rm -f *.o libmodpng14.a pngtest pngtesti pngout.png \ + libmodpng14-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ + libmodpng14.so.3.$(PNGMIN) \ + libmodpng14.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -201,20 +201,20 @@ # 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 +png.o png.pic.o: modpng14.h modpng14conf.h +pngerror.o pngerror.pic.o: modpng14.h modpng14conf.h +pngrio.o pngrio.pic.o: modpng14.h modpng14conf.h +pngwio.o pngwio.pic.o: modpng14.h modpng14conf.h +pngmem.o pngmem.pic.o: modpng14.h modpng14conf.h +pngset.o pngset.pic.o: modpng14.h modpng14conf.h +pngget.o pngget.pic.o: modpng14.h modpng14conf.h +pngread.o pngread.pic.o: modpng14.h modpng14conf.h +pngrtran.o pngrtran.pic.o: modpng14.h modpng14conf.h +pngrutil.o pngrutil.pic.o: modpng14.h modpng14conf.h +pngtrans.o pngtrans.pic.o: modpng14.h modpng14conf.h +pngwrite.o pngwrite.pic.o: modpng14.h modpng14conf.h +pngwtran.o pngwtran.pic.o: modpng14.h modpng14conf.h +pngwutil.o pngwutil.pic.o: modpng14.h modpng14conf.h +pngpread.o pngpread.pic.o: modpng14.h modpng14conf.h -pngtest.o: png.h pngconf.h +pngtest.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.std +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.std @@ -1,9 +1,9 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where make install puts libpng.a and png.h +# where make install puts libmodpng14.a and modpng14.h prefix=/usr/local INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -11,7 +11,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -25,8 +25,8 @@ ZLIBINC=../zlib CC=cc -CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm +CFLAGS=-I$(ZLIBINC) -O # -g -DMODPNG14_DEBUG=5 +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng14 -lz -lm #RANLIB=echo RANLIB=ranlib @@ -35,34 +35,34 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest +all: libmodpng14.a pngtest -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install: libpng.a +install: libmodpng14.a -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng + -@mkdir $(DESTDIR)$(INCPATH)/libmodpng14 -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a + -@rm -f $(DESTDIR)$(INCPATH)/modpng14.h + -@rm -f $(DESTDIR)$(INCPATH)/modpng14conf.h + cp modpng14.h $(DESTDIR)$(INCPATH)/libmodpng14 + cp modpng14conf.h $(DESTDIR)$(INCPATH)/libmodpng14 + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14.h + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14conf.h + (cd $(DESTDIR)$(INCPATH); ln -f -s libmodpng14/* .) + cp libmodpng14.a $(DESTDIR)$(LIBPATH) + chmod 644 $(DESTDIR)$(LIBPATH)/libmodpng14.a clean: - rm -f *.o libpng.a pngtest pngout.png + rm -f *.o libmodpng14.a pngtest pngout.png DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -70,20 +70,20 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.sunos +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.sunos @@ -1,9 +1,9 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 2002 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h -# where make install puts libpng.a and png.h +# where make install puts libmodpng14.a and modpng14.h prefix=/usr/local INCPATH=$(prefix)/include LIBPATH=$(prefix)/lib @@ -11,7 +11,7 @@ # override DESTDIR= on the make install command line to easily support # installing into a temporary location. Example: # -# make install DESTDIR=/tmp/build/libpng +# make install DESTDIR=/tmp/build/libmodpng14 # # If you're going to install into a temporary location # via DESTDIR, $(DESTDIR)$(prefix) must already exist before @@ -29,8 +29,8 @@ -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 +CFLAGS=-I$(ZLIBINC) -O # $(WARNMORE) -DMODPNG14_DEBUG=5 +LDFLAGS=-L. -L$(ZLIBLIB) -lmodpng14 -lz -lm RANLIB=ranlib #RANLIB=echo @@ -39,34 +39,34 @@ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o -all: libpng.a pngtest +all: libmodpng14.a pngtest -libpng.a: $(OBJS) +libmodpng14.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -pngtest: pngtest.o libpng.a +pngtest: pngtest.o libmodpng14.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) test: pngtest ./pngtest -install: libpng.a +install: libmodpng14.a -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng + -@mkdir $(DESTDIR)$(INCPATH)/libmodpng14 -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a + -@rm -f $(DESTDIR)$(INCPATH)/modpng14.h + -@rm -f $(DESTDIR)$(INCPATH)/modpng14conf.h + cp modpng14.h $(DESTDIR)$(INCPATH)/libmodpng14 + cp modpng14conf.h $(DESTDIR)$(INCPATH)/libmodpng14 + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14.h + chmod 644 $(DESTDIR)$(INCPATH)/libmodpng14/modpng14conf.h + (cd $(DESTDIR)$(INCPATH); ln -f -s libmodpng14/* .) + cp libmodpng14.a $(DESTDIR)$(LIBPATH) + chmod 644 $(DESTDIR)$(LIBPATH)/libmodpng14.a clean: - rm -f *.o libpng.a pngtest pngout.png + rm -f *.o libmodpng14.a pngtest pngout.png DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: @@ -74,20 +74,20 @@ # 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 +png.o: modpng14.h modpng14conf.h +pngerror.o: modpng14.h modpng14conf.h +pngrio.o: modpng14.h modpng14conf.h +pngwio.o: modpng14.h modpng14conf.h +pngmem.o: modpng14.h modpng14conf.h +pngset.o: modpng14.h modpng14conf.h +pngget.o: modpng14.h modpng14conf.h +pngread.o: modpng14.h modpng14conf.h +pngrtran.o: modpng14.h modpng14conf.h +pngrutil.o: modpng14.h modpng14conf.h +pngtest.o: modpng14.h modpng14conf.h +pngtrans.o: modpng14.h modpng14conf.h +pngwrite.o: modpng14.h modpng14conf.h +pngwtran.o: modpng14.h modpng14conf.h +pngwutil.o: modpng14.h modpng14conf.h +pngpread.o: modpng14.h modpng14conf.h --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.tc3 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.tc3 @@ -1,4 +1,4 @@ -# Makefile for libpng +# Makefile for libmodpng14 # TurboC/C++ (Note: All modules are compiled in C mode) # To use, do "make -fmakefile.tc3" @@ -23,67 +23,67 @@ 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) +all: libmodpng14$(MODEL).lib pngtest$(E) pngtest: pngtest$(E) test: pngtest$(E) pngtest$(E) -png$(O): png.h pngconf.h +png$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngset$(O): png.h pngconf.h +pngset$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngget$(O): png.h pngconf.h +pngget$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngread$(O): png.h pngconf.h +pngread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngpread$(O): png.h pngconf.h +pngpread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngrtran$(O): png.h pngconf.h +pngrtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngrutil$(O): png.h pngconf.h +pngrutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngerror$(O): png.h pngconf.h +pngerror$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngmem$(O): png.h pngconf.h +pngmem$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngrio$(O): png.h pngconf.h +pngrio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngwio$(O): png.h pngconf.h +pngwio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngtest$(O): png.h pngconf.h +pngtest$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngtrans$(O): png.h pngconf.h +pngtrans$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngwrite$(O): png.h pngconf.h +pngwrite$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngwtran$(O): png.h pngconf.h +pngwtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -pngwutil$(O): png.h pngconf.h +pngwutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c -libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3) - $(LIB) libpng$(MODEL) +$(OBJSL1) - $(LIB) libpng$(MODEL) +$(OBJSL2) - $(LIB) libpng$(MODEL) +$(OBJSL3) +libmodpng14$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3) + $(LIB) libmodpng14$(MODEL) +$(OBJSL1) + $(LIB) libmodpng14$(MODEL) +$(OBJSL2) + $(LIB) libmodpng14$(MODEL) +$(OBJSL3) -pngtest$(E): pngtest$(O) libpng$(MODEL).lib - $(LD) $(LDFLAGS) pngtest.obj libpng$(MODEL).lib zlib_$(MODEL).lib +pngtest$(E): pngtest$(O) libmodpng14$(MODEL).lib + $(LD) $(LDFLAGS) pngtest.obj libmodpng14$(MODEL).lib zlib_$(MODEL).lib -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.vcawin32 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.vcawin32 @@ -1,17 +1,17 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 1998 Tim Wegner -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib # To use, do "nmake /f scripts\makefile.vcawin32" # -------- Microsoft Visual C++ 5.0 and later, uses assembler code -------- -# Caution: the assembler code was introduced at libpng version 1.0.4 and has +# Caution: the assembler code was introduced at libmodpng14 version 1.0.4 and has # not yet been thoroughly tested. # If you don't want to use assembler code, use makefile.vcwin32 instead. -CFLAGS=-DPNG_USE_PNGVCRD -Ox -GA3s -nologo -W3 -I..\zlib +CFLAGS=-DMODPNG14_USE_PNGVCRD -Ox -GA3s -nologo -W3 -I..\zlib CC=cl LD=link @@ -26,69 +26,69 @@ OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) pngvcrd$(O) -all: libpng.lib +all: libmodpng14.lib -png$(O): png.h pngconf.h +png$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngset$(O): png.h pngconf.h +pngset$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngget$(O): png.h pngconf.h +pngget$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngread$(O): png.h pngconf.h +pngread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngpread$(O): png.h pngconf.h +pngpread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrtran$(O): png.h pngconf.h +pngrtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrutil$(O): png.h pngconf.h +pngrutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngvcrd$(O): png.h pngconf.h +pngvcrd$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngerror$(O): png.h pngconf.h +pngerror$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngmem$(O): png.h pngconf.h +pngmem$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrio$(O): png.h pngconf.h +pngrio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwio$(O): png.h pngconf.h +pngwio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngtrans$(O): png.h pngconf.h +pngtrans$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwrite$(O): png.h pngconf.h +pngwrite$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwtran$(O): png.h pngconf.h +pngwtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwutil$(O): png.h pngconf.h +pngwutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) - echo something to del > libpng.lib - del libpng.lib - lib /OUT:libpng.lib $(OBJS1) $(OBJS2) $(OBJS3) +libmodpng14.lib: $(OBJS1) $(OBJS2) $(OBJS3) + echo something to del > libmodpng14.lib + del libmodpng14.lib + lib /OUT:libmodpng14.lib $(OBJS1) $(OBJS2) $(OBJS3) -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) pngtest.obj libpng.lib ..\zlib\zlib.lib /OUT:pngtest.exe /SUBSYSTEM:CONSOLE +pngtest.exe: pngtest.obj libmodpng14.lib + $(LD) $(LDFLAGS) pngtest.obj libmodpng14.lib ..\zlib\zlib.lib /OUT:pngtest.exe /SUBSYSTEM:CONSOLE test: pngtest.exe pngtest -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.vcwin32 +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.vcwin32 @@ -1,6 +1,6 @@ -# makefile for libpng +# makefile for libmodpng14 # Copyright (C) 1998 Tim Wegner -# For conditions of distribution and use, see copyright notice in png.h +# For conditions of distribution and use, see copyright notice in modpng14.h # Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib # To use, do "nmake /f scripts\makefile.vcwin32" @@ -22,66 +22,66 @@ OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) -all: libpng.lib +all: libmodpng14.lib -png$(O): png.h pngconf.h +png$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngset$(O): png.h pngconf.h +pngset$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngget$(O): png.h pngconf.h +pngget$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngread$(O): png.h pngconf.h +pngread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngpread$(O): png.h pngconf.h +pngpread$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrtran$(O): png.h pngconf.h +pngrtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrutil$(O): png.h pngconf.h +pngrutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngerror$(O): png.h pngconf.h +pngerror$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngmem$(O): png.h pngconf.h +pngmem$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngrio$(O): png.h pngconf.h +pngrio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwio$(O): png.h pngconf.h +pngwio$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngtrans$(O): png.h pngconf.h +pngtrans$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwrite$(O): png.h pngconf.h +pngwrite$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwtran$(O): png.h pngconf.h +pngwtran$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -pngwutil$(O): png.h pngconf.h +pngwutil$(O): modpng14.h modpng14conf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) -libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) - echo something to del > libpng.lib - del libpng.lib - lib /OUT:libpng.lib $(OBJS1) $(OBJS2) $(OBJS3) +libmodpng14.lib: $(OBJS1) $(OBJS2) $(OBJS3) + echo something to del > libmodpng14.lib + del libmodpng14.lib + lib /OUT:libmodpng14.lib $(OBJS1) $(OBJS2) $(OBJS3) -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) pngtest.obj libpng.lib ..\zlib\zlib.lib /OUT:pngtest.exe /SUBSYSTEM:CONSOLE +pngtest.exe: pngtest.obj libmodpng14.lib + $(LD) $(LDFLAGS) pngtest.obj libmodpng14.lib ..\zlib\zlib.lib /OUT:pngtest.exe /SUBSYSTEM:CONSOLE test: pngtest.exe pngtest -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makefile.watcom +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makefile.watcom @@ -1,9 +1,9 @@ -# Makefile for libpng +# Makefile for libmodpng14 # 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 +# For conditions of distribution and use, see copyright notice in modpng14.h # To use, do "wmake /f scripts\makefile.watcom" @@ -46,64 +46,64 @@ all: test -png$(O): png.h pngconf.h +png$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngset$(O): png.h pngconf.h +pngset$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngget$(O): png.h pngconf.h +pngget$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngread$(O): png.h pngconf.h +pngread$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngpread$(O): png.h pngconf.h +pngpread$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngrtran$(O): png.h pngconf.h +pngrtran$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngrutil$(O): png.h pngconf.h +pngrutil$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngerror$(O): png.h pngconf.h +pngerror$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngmem$(O): png.h pngconf.h +pngmem$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngrio$(O): png.h pngconf.h +pngrio$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwio$(O): png.h pngconf.h +pngwio$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngtrans$(O): png.h pngconf.h +pngtrans$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwrite$(O): png.h pngconf.h +pngwrite$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwtran$(O): png.h pngconf.h +pngwtran$(O): modpng14.h modpng14conf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngwutil$(O): png.h pngconf.h +pngwutil$(O): modpng14.h modpng14conf.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) +libmodpng14.lib: $(OBJS1) $(OBJS2) $(OBJS3) + wlib -b -c -n -q libmodpng14.lib $(OBJS1) + wlib -b -c -q libmodpng14.lib $(OBJS2) + wlib -b -c -q libmodpng14.lib $(OBJS3) -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib +pngtest.exe: pngtest.obj libmodpng14.lib + $(LD) $(LDFLAGS) pngtest.obj libmodpng14.lib $(ZLIBLIB)\zlib.lib test: pngtest.exe .symbolic pngtest.exe -# End of makefile for libpng +# End of makefile for libmodpng14 --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/makevms.com +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/makevms.com @@ -1,10 +1,10 @@ -$! make libpng under VMS +$! make libmodpng14 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. +$! the programs from the contrib directory instead of libmodpng14. $! $ p1 = f$edit(p1,"UPCASE") $ if p1 .eqs. "CONTRIB" @@ -54,45 +54,45 @@ $ then $ dele pngtest.obj;* $ CALL MAKE png.OBJ "cc ''CCOPT' png" - - png.c png.h pngconf.h + png.c modpng14.h modpng14conf.h $ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" - - pngpread.c png.h pngconf.h + pngpread.c modpng14.h modpng14conf.h $ CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" - - pngset.c png.h pngconf.h + pngset.c modpng14.h modpng14conf.h $ CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" - - pngget.c png.h pngconf.h + pngget.c modpng14.h modpng14conf.h $ CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" - - pngread.c png.h pngconf.h + pngread.c modpng14.h modpng14conf.h $ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" - - pngpread.c png.h pngconf.h + pngpread.c modpng14.h modpng14conf.h $ CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" - - pngrtran.c png.h pngconf.h + pngrtran.c modpng14.h modpng14conf.h $ CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" - - pngrutil.c png.h pngconf.h + pngrutil.c modpng14.h modpng14conf.h $ CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" - - pngerror.c png.h pngconf.h + pngerror.c modpng14.h modpng14conf.h $ CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" - - pngmem.c png.h pngconf.h + pngmem.c modpng14.h modpng14conf.h $ CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" - - pngrio.c png.h pngconf.h + pngrio.c modpng14.h modpng14conf.h $ CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" - - pngwio.c png.h pngconf.h + pngwio.c modpng14.h modpng14conf.h $ CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" - - pngtrans.c png.h pngconf.h + pngtrans.c modpng14.h modpng14conf.h $ CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" - - pngwrite.c png.h pngconf.h + pngwrite.c modpng14.h modpng14conf.h $ CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" - - pngwtran.c png.h pngconf.h + pngwtran.c modpng14.h modpng14conf.h $ CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" - - pngwutil.c png.h pngconf.h + pngwutil.c modpng14.h modpng14conf.h $ write sys$output "Building Libpng ..." -$ CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ +$ CALL MAKE libmodpng14.OLB "lib/crea libmodpng14.olb *.obj" *.OBJ $ write sys$output "Building pngtest..." $ CALL MAKE pngtest.OBJ "cc ''CCOPT' pngtest" - - pngtest.c png.h pngconf.h + pngtest.c modpng14.h modpng14conf.h $ call make pngtest.exe - - "LINK pngtest,libpng.olb/lib,''zlibsrc'libz.olb/lib" - - pngtest.obj libpng.olb + "LINK pngtest,libmodpng14.olb/lib,''zlibsrc'libz.olb/lib" - + pngtest.obj libmodpng14.olb $ write sys$output "Testing Libpng..." $ run pngtest $ else --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/pngdef.pas +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/pngdef.pas @@ -7,197 +7,197 @@ interface const - PNG_LIBPNG_VER_STRING = '1.2.5'; - PNG_LIBPNG_VER = 10205; + MODPNG14_LIBMODPNG14_VER_STRING = '1.2.5'; + MODPNG14_LIBMODPNG14_VER = 10205; 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; + modpng14_uint_32 = Cardinal; + modpng14_int_32 = Longint; + modpng14_uint_16 = Word; + modpng14_int_16 = Smallint; + modpng14_byte = Byte; + modpng14_size_t = modpng14_uint_32; + modpng14_charpp = ^modpng14_charp; + modpng14_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; + modpng14_bytepp = ^modpng14_bytep; + modpng14_bytep = ^modpng14_byte; + modpng14_uint_16p = ^modpng14_uint_16; + modpng14_uint_16pp = ^modpng14_uint_16p; + modpng14_voidp = pointer; time_t = Longint; - png_doublep = ^png_double; - png_double = double; + modpng14_doublep = ^modpng14_double; + modpng14_double = double; user_error_ptr = Pointer; - png_error_ptrp = ^png_error_ptr; - png_error_ptr = procedure(png_ptr: Pointer; msg: Pointer); + modpng14_error_ptrp = ^modpng14_error_ptr; + modpng14_error_ptr = procedure(modpng14_ptr: Pointer; msg: Pointer); stdcall; - png_rw_ptrp = ^png_rw_ptr; - png_rw_ptr = procedure(png_ptr: Pointer; data: Pointer; - length: png_size_t); + modpng14_rw_ptrp = ^modpng14_rw_ptr; + modpng14_rw_ptr = procedure(modpng14_ptr: Pointer; data: Pointer; + length: modpng14_size_t); stdcall; - png_flush_ptrp = ^png_flush_ptr; - png_flush_ptr = procedure(png_ptr: Pointer); + modpng14_flush_ptrp = ^modpng14_flush_ptr; + modpng14_flush_ptr = procedure(modpng14_ptr: Pointer); stdcall; - png_progressive_info_ptrp = ^png_progressive_info_ptr; - png_progressive_info_ptr = procedure(png_ptr: Pointer; + modpng14_progressive_info_ptrp = ^modpng14_progressive_info_ptr; + modpng14_progressive_info_ptr = procedure(modpng14_ptr: Pointer; info_ptr: Pointer); stdcall; - png_progressive_end_ptrp = ^png_progressive_end_ptr; - png_progressive_end_ptr = procedure(png_ptr: Pointer; + modpng14_progressive_end_ptrp = ^modpng14_progressive_end_ptr; + modpng14_progressive_end_ptr = procedure(modpng14_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; + modpng14_progressive_row_ptrp = ^modpng14_progressive_row_ptr; + modpng14_progressive_row_ptr = procedure(modpng14_ptr: Pointer; + data: Pointer; length: modpng14_uint_32; count: int); stdcall; - png_read_status_ptr = procedure(png_ptr: Pointer; - row_number: png_uint_32; pass: int); + modpng14_read_status_ptr = procedure(modpng14_ptr: Pointer; + row_number: modpng14_uint_32; pass: int); stdcall; - png_write_status_ptr = procedure(png_ptr: Pointer; - row_number: png_uint_32; pass: int); + modpng14_write_status_ptr = procedure(modpng14_ptr: Pointer; + row_number: modpng14_uint_32; pass: int); stdcall; - png_user_chunk_ptr = procedure(png_ptr: Pointer; - data: png_unknown_chunkp); + modpng14_user_chunk_ptr = procedure(modpng14_ptr: Pointer; + data: modpng14_unknown_chunkp); stdcall; - png_user_transform_ptr = procedure(png_ptr: Pointer; - row_info: Pointer; data: png_bytep); + modpng14_user_transform_ptr = procedure(modpng14_ptr: Pointer; + row_info: Pointer; data: modpng14_bytep); stdcall; - png_colorpp = ^png_colorp; - png_colorp = ^png_color; - png_color = packed record - red, green, blue: png_byte; + modpng14_colorpp = ^modpng14_colorp; + modpng14_colorp = ^modpng14_color; + modpng14_color = packed record + red, green, blue: modpng14_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 + modpng14_color_16pp = ^modpng14_color_16p; + modpng14_color_16p = ^modpng14_color_16; + modpng14_color_16 = packed record + index: modpng14_byte; //used for palette files + red, green, blue: modpng14_uint_16; //for use in red green blue files + gray: modpng14_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 + modpng14_color_8pp = ^modpng14_color_8p; + modpng14_color_8p = ^modpng14_color_8; + modpng14_color_8 = packed record + red, green, blue: modpng14_byte; //for use in red green blue files + gray: modpng14_byte; //for use in grayscale files + alpha: modpng14_byte; //for alpha channel files end; - png_textpp = ^png_textp; - png_textp = ^png_text; - png_text = packed record + modpng14_textpp = ^modpng14_textp; + modpng14_textp = ^modpng14_text; + modpng14_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 + key: modpng14_charp; //keyword, 1-79 character description of "text" + text: modpng14_charp; //comment, may be empty ("") + text_length: modpng14_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) + modpng14_timepp = ^modpng14_timep; + modpng14_timep = ^modpng14_time; + modpng14_time = packed record + year: modpng14_uint_16; //yyyy + month: modpng14_byte; //1..12 + day: modpng14_byte; //1..31 + hour: modpng14_byte; //0..23 + minute: modpng14_byte; //0..59 + second: modpng14_byte; //0..60 (leap seconds) end; - png_infopp = ^png_infop; - png_infop = Pointer; + modpng14_infopp = ^modpng14_infop; + modpng14_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) + modpng14_row_infopp = ^modpng14_row_infop; + modpng14_row_infop = ^modpng14_row_info; + modpng14_row_info = packed record + width: modpng14_uint_32; //width of row + rowbytes: modpng14_size_t; //number of bytes in row + color_type: modpng14_byte; //color type of row + bit_depth: modpng14_byte; //bit depth of row + channels: modpng14_byte; //number of channels (1, 2, 3, or 4) + pixel_depth: modpng14_byte; //bits per pixel (depth * channels) end; - png_structpp = ^png_structp; - png_structp = Pointer; + modpng14_structpp = ^modpng14_structp; + modpng14_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. +// The values of the MODPNG14_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; + MODPNG14_TEXT_COMPRESSION_NONE_WR = -3; + MODPNG14_TEXT_COMPRESSION_zTXt_WR = -2; + MODPNG14_TEXT_COMPRESSION_NONE = -1; + MODPNG14_TEXT_COMPRESSION_zTXt = 0; -// These describe the color_type field in png_info. +// These describe the color_type field in modpng14_info. // color type masks - PNG_COLOR_MASK_PALETTE = 1; - PNG_COLOR_MASK_COLOR = 2; - PNG_COLOR_MASK_ALPHA = 4; + MODPNG14_COLOR_MASK_PALETTE = 1; + MODPNG14_COLOR_MASK_COLOR = 2; + MODPNG14_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; + MODPNG14_COLOR_TYPE_GRAY = 0; + MODPNG14_COLOR_TYPE_PALETTE = MODPNG14_COLOR_MASK_COLOR or + MODPNG14_COLOR_MASK_PALETTE; + MODPNG14_COLOR_TYPE_RGB = MODPNG14_COLOR_MASK_COLOR; + MODPNG14_COLOR_TYPE_RGB_ALPHA = MODPNG14_COLOR_MASK_COLOR or + MODPNG14_COLOR_MASK_ALPHA; + MODPNG14_COLOR_TYPE_GRAY_ALPHA = MODPNG14_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; + MODPNG14_COMPRESSION_TYPE_BASE = 0; // Deflate method 8, 32K window + MODPNG14_COMPRESSION_TYPE_DEFAULT = MODPNG14_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; + MODPNG14_FILTER_TYPE_BASE = 0; // Single row per-byte filtering + MODPNG14_FILTER_TYPE_DEFAULT = MODPNG14_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 + MODPNG14_INTERLACE_NONE = 0; // Non-interlaced image + MODPNG14_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) + MODPNG14_OFFSET_PIXEL = 0; // Offset in pixels + MODPNG14_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 + MODPNG14_EQUATION_LINEAR = 0; // Linear transformation + MODPNG14_EQUATION_BASE_E = 1; // Exponential base e transform + MODPNG14_EQUATION_ARBITRARY = 2; // Arbitrary base exponential transform + MODPNG14_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 + MODPNG14_RESOLUTION_UNKNOWN = 0; // pixels/unknown unit (aspect ratio) + MODPNG14_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; + MODPNG14_sRGB_INTENT_PERCEPTUAL = 0; + MODPNG14_sRGB_INTENT_RELATIVE = 1; + MODPNG14_sRGB_INTENT_SATURATION = 2; + MODPNG14_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; + MODPNG14_BACKGROUND_GAMMA_UNKNOWN = 0; + MODPNG14_BACKGROUND_GAMMA_SCREEN = 1; + MODPNG14_BACKGROUND_GAMMA_FILE = 2; + MODPNG14_BACKGROUND_GAMMA_UNIQUE = 3; -// Values for png_set_crc_action() to say how to handle CRC errors in +// Values for modpng14_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, @@ -206,452 +206,452 @@ // 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 + MODPNG14_CRC_DEFAULT = 0; // error/quit warn/discard data + MODPNG14_CRC_ERROR_QUIT = 1; // error/quit error/quit + MODPNG14_CRC_WARN_DISCARD = 2; // (INVALID) warn/discard data + MODPNG14_CRC_WARN_USE = 3; // warn/use data warn/use data + MODPNG14_CRC_QUIET_USE = 4; // quiet/use data quiet/use data + MODPNG14_CRC_NO_CHANGE = 5; // use current value use current value -// Flags for png_set_filter() to say which filters to use. The flags +// Flags for modpng14_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; + MODPNG14_NO_FILTERS = $00; + MODPNG14_FILTER_NONE = $08; + MODPNG14_FILTER_SUB = $10; + MODPNG14_FILTER_UP = $20; + MODPNG14_FILTER_AVG = $40; + MODPNG14_FILTER_PAETH = $80; + MODPNG14_ALL_FILTERS = MODPNG14_FILTER_NONE or MODPNG14_FILTER_SUB or + MODPNG14_FILTER_UP or MODPNG14_FILTER_AVG or + MODPNG14_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; + MODPNG14_FILTER_VALUE_NONE = 0; + MODPNG14_FILTER_VALUE_SUB = 1; + MODPNG14_FILTER_VALUE_UP = 2; + MODPNG14_FILTER_VALUE_AVG = 3; + MODPNG14_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 + MODPNG14_FILTER_HEURISTIC_DEFAULT = 0; // Currently "UNWEIGHTED" + MODPNG14_FILTER_HEURISTIC_UNWEIGHTED = 1; // Used by libmodpng14 < 0.95 + MODPNG14_FILTER_HEURISTIC_WEIGHTED = 2; // Experimental feature + MODPNG14_FILTER_HEURISTIC_LAST = 3; // Not a valid value -procedure png_build_grayscale_palette(bit_depth: int; palette: png_colorp); +procedure modpng14_build_grayscale_palette(bit_depth: int; palette: modpng14_colorp); stdcall; -function png_check_sig(sig: png_bytep; num: int): int; +function modpng14_check_sig(sig: modpng14_bytep; num: int): int; stdcall; -procedure png_chunk_error(png_ptr: png_structp; - const mess: png_charp); +procedure modpng14_chunk_error(modpng14_ptr: modpng14_structp; + const mess: modpng14_charp); stdcall; -procedure png_chunk_warning(png_ptr: png_structp; - const mess: png_charp); +procedure modpng14_chunk_warning(modpng14_ptr: modpng14_structp; + const mess: modpng14_charp); stdcall; -procedure png_convert_from_time_t(ptime: png_timep; ttime: time_t); +procedure modpng14_convert_from_time_t(ptime: modpng14_timep; ttime: time_t); stdcall; -function png_convert_to_rfc1123(png_ptr: png_structp; ptime: png_timep): - png_charp; +function modpng14_convert_to_rfc1123(modpng14_ptr: modpng14_structp; ptime: modpng14_timep): + modpng14_charp; stdcall; -function png_create_info_struct(png_ptr: png_structp): png_infop; +function modpng14_create_info_struct(modpng14_ptr: modpng14_structp): modpng14_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; +function modpng14_create_read_struct(user_modpng14_ver: modpng14_charp; + error_ptr: user_error_ptr; error_fn: modpng14_error_ptr; + warn_fn: modpng14_error_ptr): modpng14_structp; stdcall; -function png_get_copyright(png_ptr: png_structp): png_charp; +function modpng14_get_copyright(modpng14_ptr: modpng14_structp): modpng14_charp; stdcall; -function png_get_header_ver(png_ptr: png_structp): png_charp; +function modpng14_get_header_ver(modpng14_ptr: modpng14_structp): modpng14_charp; stdcall; -function png_get_header_version(png_ptr: png_structp): png_charp; +function modpng14_get_header_version(modpng14_ptr: modpng14_structp): modpng14_charp; stdcall; -function png_get_libpng_ver(png_ptr: png_structp): png_charp; +function modpng14_get_libmodpng14_ver(modpng14_ptr: modpng14_structp): modpng14_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; +function modpng14_create_write_struct(user_modpng14_ver: modpng14_charp; + error_ptr: user_error_ptr; error_fn: modpng14_error_ptr; + warn_fn: modpng14_error_ptr): modpng14_structp; stdcall; -procedure png_destroy_info_struct(png_ptr: png_structp; - info_ptr_ptr: png_infopp); +procedure modpng14_destroy_info_struct(modpng14_ptr: modpng14_structp; + info_ptr_ptr: modpng14_infopp); stdcall; -procedure png_destroy_read_struct(png_ptr_ptr: png_structpp; - info_ptr_ptr, end_info_ptr_ptr: png_infopp); +procedure modpng14_destroy_read_struct(modpng14_ptr_ptr: modpng14_structpp; + info_ptr_ptr, end_info_ptr_ptr: modpng14_infopp); stdcall; -procedure png_destroy_write_struct(png_ptr_ptr: png_structpp; - info_ptr_ptr: png_infopp); +procedure modpng14_destroy_write_struct(modpng14_ptr_ptr: modpng14_structpp; + info_ptr_ptr: modpng14_infopp); stdcall; -function png_get_IHDR(png_ptr: png_structp; info_ptr: png_infop; - var width, height: png_uint_32; var bit_depth, +function modpng14_get_IHDR(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var width, height: modpng14_uint_32; var bit_depth, color_type, interlace_type, compression_type, - filter_type: int): png_uint_32; + filter_type: int): modpng14_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; +function modpng14_get_PLTE(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var palette: modpng14_colorp; var num_palette: int): + modpng14_uint_32; stdcall; -function png_get_bKGD(png_ptr: png_structp; info_ptr: png_infop; - var background: png_color_16p): png_uint_32; +function modpng14_get_bKGD(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var background: modpng14_color_16p): modpng14_uint_32; stdcall; -function png_get_bit_depth(png_ptr: png_structp; info_ptr: png_infop): - png_byte; +function modpng14_get_bit_depth(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_byte; stdcall; -function png_get_cHRM(png_ptr: png_structp; info_ptr: png_infop; +function modpng14_get_cHRM(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; var white_x, white_y, red_x, red_y, green_x, green_y, - blue_x, blue_y: double): png_uint_32; + blue_x, blue_y: double): modpng14_uint_32; stdcall; -function png_get_channels(png_ptr: png_structp; info_ptr: png_infop): - png_byte; +function modpng14_get_channels(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_byte; stdcall; -function png_get_color_type(png_ptr: png_structp; info_ptr: png_infop): - png_byte; +function modpng14_get_color_type(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_byte; stdcall; -function png_get_compression_type(png_ptr: png_structp; - info_ptr: png_infop): png_byte; +function modpng14_get_compression_type(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_byte; stdcall; -function png_get_error_ptr(png_ptr: png_structp): png_voidp; +function modpng14_get_error_ptr(modpng14_ptr: modpng14_structp): modpng14_voidp; stdcall; -function png_get_filter_type(png_ptr: png_structp; info_ptr: png_infop): - png_byte; +function modpng14_get_filter_type(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_byte; stdcall; -function png_get_gAMA(png_ptr: png_structp; info_ptr: png_infop; - var file_gamma: double): png_uint_32; +function modpng14_get_gAMA(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var file_gamma: double): modpng14_uint_32; stdcall; -function png_get_hIST(png_ptr: png_structp; info_ptr: png_infop; - var hist: png_uint_16p): png_uint_32; +function modpng14_get_hIST(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var hist: modpng14_uint_16p): modpng14_uint_32; stdcall; -function png_get_image_height(png_ptr: png_structp; info_ptr: png_infop): - png_uint_32; +function modpng14_get_image_height(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_uint_32; stdcall; -function png_get_image_width(png_ptr: png_structp; info_ptr: png_infop): - png_uint_32; +function modpng14_get_image_width(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_uint_32; stdcall; -function png_get_interlace_type(png_ptr: png_structp; - info_ptr: png_infop): png_byte; +function modpng14_get_interlace_type(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_byte; stdcall; -function png_get_io_ptr(png_ptr: png_structp): png_voidp; +function modpng14_get_io_ptr(modpng14_ptr: modpng14_structp): modpng14_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; +function modpng14_get_oFFs(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var offset_x, offset_y: modpng14_uint_32; + var unit_type: int): modpng14_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; +function modpng14_get_sCAL(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var unit:int; var width: modpng14_uint_32; height: modpng14_uint_32): + modpng14_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; +function modpng14_get_pCAL(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var purpose: modpng14_charp; var X0, X1: modpng14_int_32; + var typ, nparams: int; var units: modpng14_charp; + var params: modpng14_charpp): modpng14_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; +function modpng14_get_pHYs(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var res_x, res_y: modpng14_uint_32; var unit_type: int): + modpng14_uint_32; stdcall; -function png_get_pixel_aspect_ratio(png_ptr: png_structp; - info_ptr: png_infop): float; +function modpng14_get_pixel_aspect_ratio(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): float; stdcall; -function png_get_pixels_per_meter(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_pixels_per_meter(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -function png_get_progressive_ptr(png_ptr: png_structp): png_voidp; +function modpng14_get_progressive_ptr(modpng14_ptr: modpng14_structp): modpng14_voidp; stdcall; -function png_get_rgb_to_gray_status(png_ptr: png_structp); +function modpng14_get_rgb_to_gray_status(modpng14_ptr: modpng14_structp); stdcall; -function png_get_rowbytes(png_ptr: png_structp; info_ptr: png_infop): - png_uint_32; +function modpng14_get_rowbytes(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_uint_32; stdcall; -function png_get_rows(png_ptr: png_structp; info_ptr: png_infop): - png_bytepp; +function modpng14_get_rows(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_bytepp; stdcall; -function png_get_sBIT(png_ptr: png_structp; info_ptr: png_infop; - var sig_bits: png_color_8p): png_uint_32; +function modpng14_get_sBIT(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var sig_bits: modpng14_color_8p): modpng14_uint_32; stdcall; -function png_get_sRGB(png_ptr: png_structp; info_ptr: png_infop; - var file_srgb_intent: int): png_uint_32; +function modpng14_get_sRGB(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var file_srgb_intent: int): modpng14_uint_32; stdcall; -function png_get_signature(png_ptr: png_structp; info_ptr: png_infop): - png_bytep; +function modpng14_get_signature(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop): + modpng14_bytep; stdcall; -function png_get_tIME(png_ptr: png_structp; info_ptr: png_infop; - var mod_time: png_timep): png_uint_32; +function modpng14_get_tIME(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var mod_time: modpng14_timep): modpng14_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; +function modpng14_get_tRNS(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var trans: modpng14_bytep; var num_trans: int; + var trans_values: modpng14_color_16p): modpng14_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; +function modpng14_get_text(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + var text_ptr: modpng14_textp; var num_text: int): + modpng14_uint_32; stdcall; -function png_get_user_chunk_ptr(png_ptr: png_structp): - png_voidp; +function modpng14_get_user_chunk_ptr(modpng14_ptr: modpng14_structp): + modpng14_voidp; stdcall; -function png_get_valid(png_ptr: png_structp; info_ptr: png_infop; - flag: png_uint_32): png_uint_32; +function modpng14_get_valid(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + flag: modpng14_uint_32): modpng14_uint_32; stdcall; -function png_get_x_offset_microns(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_x_offset_microns(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -function png_get_x_offset_pixels(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_x_offset_pixels(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -function png_get_x_pixels_per_meter(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_x_pixels_per_meter(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -function png_get_y_offset_microns(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_y_offset_microns(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -function png_get_y_offset_pixels(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_y_offset_pixels(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -function png_get_y_pixels_per_meter(png_ptr: png_structp; - info_ptr: png_infop): png_uint_32; +function modpng14_get_y_pixels_per_meter(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop): modpng14_uint_32; stdcall; -procedure png_process_data(png_ptr: png_structp; info_ptr: png_infop; - buffer: png_bytep; buffer_size: png_size_t); +procedure modpng14_process_data(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + buffer: modpng14_bytep; buffer_size: modpng14_size_t); stdcall; -procedure png_progressive_combine_row(png_ptr: png_structp; - old_row, new_row: png_bytep); +procedure modpng14_progressive_combine_row(modpng14_ptr: modpng14_structp; + old_row, new_row: modpng14_bytep); stdcall; -procedure png_read_end(png_ptr: png_structp; info_ptr: png_infop); +procedure modpng14_read_end(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop); stdcall; -procedure png_read_image(png_ptr: png_structp; image: png_bytepp); +procedure modpng14_read_image(modpng14_ptr: modpng14_structp; image: modpng14_bytepp); stdcall; -procedure png_read_info(png_ptr: png_structp; info_ptr: png_infop); +procedure modpng14_read_info(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop); stdcall; -procedure png_read_row(png_ptr: png_structp; row, dsp_row: png_bytep); +procedure modpng14_read_row(modpng14_ptr: modpng14_structp; row, dsp_row: modpng14_bytep); stdcall; -procedure png_read_rows(png_ptr: png_structp; row, display_row: - png_bytepp; num_rows: png_uint_32); +procedure modpng14_read_rows(modpng14_ptr: modpng14_structp; row, display_row: + modpng14_bytepp; num_rows: modpng14_uint_32); stdcall; -procedure png_read_update_info(png_ptr: png_structp; info_ptr: png_infop); +procedure modpng14_read_update_info(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop); stdcall; -procedure png_set_IHDR(png_ptr: png_structp; info_ptr: png_infop; - width, height: png_uint_32; bit_depth, color_type, +procedure modpng14_set_IHDR(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + width, height: modpng14_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); +procedure modpng14_set_PLTE(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + palette: modpng14_colorp; num_palette: int); stdcall; -procedure png_set_bKGD(png_ptr: png_structp; info_ptr: png_infop; - background: png_color_16p); +procedure modpng14_set_bKGD(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + background: modpng14_color_16p); stdcall; -procedure png_set_background(png_ptr: png_structp; - background_color: png_color_16p; +procedure modpng14_set_background(modpng14_ptr: modpng14_structp; + background_color: modpng14_color_16p; background_gamma_code, need_expand: int; background_gamma: double); stdcall; -procedure png_set_bgr(png_ptr: png_structp); +procedure modpng14_set_bgr(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_cHRM(png_ptr: png_structp; info_ptr: png_infop; +procedure modpng14_set_cHRM(modpng14_ptr: modpng14_structp; info_ptr: modpng14_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; +procedure modpng14_set_cHRM_fixed(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; white_x, white_y, red_x, red_y, green_x, green_y, - blue_x, blue_y: png_fixed_point); + blue_x, blue_y: modpng14_fixed_point); stdcall; -procedure png_set_compression_level(png_ptr: png_structp; level: int); +procedure modpng14_set_compression_level(modpng14_ptr: modpng14_structp; level: int); stdcall; -procedure png_set_compression_mem_level(png_ptr: png_structp; +procedure modpng14_set_compression_mem_level(modpng14_ptr: modpng14_structp; mem_level: int); stdcall; -procedure png_set_compression_method(png_ptr: png_structp; method: int); +procedure modpng14_set_compression_method(modpng14_ptr: modpng14_structp; method: int); stdcall; -procedure png_set_compression_strategy(png_ptr: png_structp; +procedure modpng14_set_compression_strategy(modpng14_ptr: modpng14_structp; strategy: int); stdcall; -procedure png_set_compression_window_bits(png_ptr: png_structp; +procedure modpng14_set_compression_window_bits(modpng14_ptr: modpng14_structp; window_bits: int); stdcall; -procedure png_set_crc_action(png_ptr: png_structp; +procedure modpng14_set_crc_action(modpng14_ptr: modpng14_structp; crit_action, ancil_action: int); stdcall; -procedure png_set_dither(png_ptr: png_structp; plaette: png_colorp; +procedure modpng14_set_dither(modpng14_ptr: modpng14_structp; plaette: modpng14_colorp; num_palette, maximum_colors: int; - histogram: png_uint_16p; full_dither: int); + histogram: modpng14_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); +procedure modpng14_set_error_fn(modpng14_ptr: modpng14_structp; error_ptr: modpng14_voidp; + error_fn, warning_fn: modpng14_error_ptr); stdcall; -procedure png_set_expand(png_ptr: png_structp); +procedure modpng14_set_expand(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_filler(png_ptr: png_structp; filler: png_uint_32; +procedure modpng14_set_filler(modpng14_ptr: modpng14_structp; filler: modpng14_uint_32; filler_loc: int); stdcall; -procedure png_set_filter(png_ptr: png_structp; method, filters: int); +procedure modpng14_set_filter(modpng14_ptr: modpng14_structp; method, filters: int); stdcall; -procedure png_set_filter_heuristics(png_ptr: png_structp; +procedure modpng14_set_filter_heuristics(modpng14_ptr: modpng14_structp; heuristic_method, num_weights: int; - filter_weights, filter_costs: png_doublep); + filter_weights, filter_costs: modpng14_doublep); stdcall; -procedure png_set_flush(png_ptr: png_structp; nrows: int); +procedure modpng14_set_flush(modpng14_ptr: modpng14_structp; nrows: int); stdcall; -procedure png_set_gAMA(png_ptr: png_structp; info_ptr: png_infop; +procedure modpng14_set_gAMA(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; file_gamma: double); stdcall; -procedure png_set_gAMA_fixed(png_ptr: png_structp; info_ptr: png_infop; - file_gamma: png_fixed_point); +procedure modpng14_set_gAMA_fixed(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + file_gamma: modpng14_fixed_point); stdcall; -procedure png_set_gamma(png_ptr: png_structp; screen_gamma, +procedure modpng14_set_gamma(modpng14_ptr: modpng14_structp; screen_gamma, default_file_gamma: double); stdcall; -procedure png_set_gray_1_2_4_to_8(png_ptr: png_structp); +procedure modpng14_set_gray_1_2_4_to_8(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_gray_to_rgb(png_ptr: png_structp); +procedure modpng14_set_gray_to_rgb(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_hIST(png_ptr: png_structp; info_ptr: png_infop; - hist: png_uint_16p); +procedure modpng14_set_hIST(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + hist: modpng14_uint_16p); stdcall; -function png_set_interlace_handling(png_ptr: png_structp): int; +function modpng14_set_interlace_handling(modpng14_ptr: modpng14_structp): int; stdcall; -procedure png_set_invalid(png_ptr: png_structp; info_ptr:png_infop; +procedure modpng14_set_invalid(modpng14_ptr: modpng14_structp; info_ptr:modpng14_infop; mask: int); stdcall; -procedure png_set_invert_alpha(png_ptr: png_structp); +procedure modpng14_set_invert_alpha(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_invert_mono(png_ptr: png_structp); +procedure modpng14_set_invert_mono(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_oFFs(png_ptr: png_structp; info_ptr: png_infop; - offset_x, offset_y: png_uint_32; unit_type: int); +procedure modpng14_set_oFFs(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + offset_x, offset_y: modpng14_uint_32; unit_type: int); stdcall; -procedure png_set_palette_to_rgb(png_ptr: png_structp); +procedure modpng14_set_palette_to_rgb(modpng14_ptr: modpng14_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); +procedure modpng14_set_pCAL(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + purpose: modpng14_charp; X0, X1: modpng14_int_32; + typ, nparams: int; units: modpng14_charp; + params: modpng14_charpp); stdcall; -procedure png_set_pHYs(png_ptr: png_structp; info_ptr: png_infop; - res_x, res_y: png_uint_32; unit_type: int); +procedure modpng14_set_pHYs(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + res_x, res_y: modpng14_uint_32; unit_type: int); stdcall; -procedure png_set_packing(png_ptr: png_structp); +procedure modpng14_set_packing(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_packswap(png_ptr: png_structp); +procedure modpng14_set_packswap(modpng14_ptr: modpng14_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); +procedure modpng14_set_progressive_read_fn(modpng14_ptr: modpng14_structp; + progressive_ptr: modpng14_voidp; + info_fn: modpng14_progressive_info_ptr; + row_fn: modpng14_progressive_row_ptr; + end_fn: modpng14_progressive_end_ptr); stdcall; -procedure png_set_read_fn(png_ptr: png_structp; - io_ptr: png_voidp; read_data_fn: png_rw_ptr); +procedure modpng14_set_read_fn(modpng14_ptr: modpng14_structp; + io_ptr: modpng14_voidp; read_data_fn: modpng14_rw_ptr); stdcall; -procedure png_set_read_status_fn(png_ptr: png_structp; - read_row_fn: png_read_status_ptr); +procedure modpng14_set_read_status_fn(modpng14_ptr: modpng14_structp; + read_row_fn: modpng14_read_status_ptr); stdcall; -procedure png_set_read_user_chunk_fn(png_ptr: png_structp; - read_user_chunk_fn: png_user_chunk_ptr); +procedure modpng14_set_read_user_chunk_fn(modpng14_ptr: modpng14_structp; + read_user_chunk_fn: modpng14_user_chunk_ptr); stdcall; -procedure png_set_read_user_transform_fn(png_ptr: png_structp; - read_user_transform_fn: png_user_transform_ptr); +procedure modpng14_set_read_user_transform_fn(modpng14_ptr: modpng14_structp; + read_user_transform_fn: modpng14_user_transform_ptr); stdcall; -procedure png_set_rgb_to_gray(png_ptr: png_structp; int: error_action; +procedure modpng14_set_rgb_to_gray(modpng14_ptr: modpng14_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); +procedure modpng14_set_rgb_to_gray_fixed(modpng14_ptr: modpng14_structp; int: error_action; + red_weight, green_weight: modpng14_fixed_point); stdcall; -procedure png_set_rows(png_ptr: png_structp; info_ptr: png_infop; - row_pointers: png_bytepp); +procedure modpng14_set_rows(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + row_pointers: modpng14_bytepp); stdcall; -procedure png_set_sBIT(png_ptr: png_structp; info_ptr: png_infop; - sig_bits: png_color_8p); +procedure modpng14_set_sBIT(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + sig_bits: modpng14_color_8p); stdcall; -procedure png_set_sRGB(png_ptr: png_structp; info_ptr: png_infop; +procedure modpng14_set_sRGB(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; intent: int); stdcall; -procedure png_set_sRGB_gAMA_and_cHRM(png_ptr: png_structp; - info_ptr: png_infop; intent: int); +procedure modpng14_set_sRGB_gAMA_and_cHRM(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop; intent: int); stdcall; -procedure png_set_shift(png_ptr: png_structp; true_bits: png_color_8p); +procedure modpng14_set_shift(modpng14_ptr: modpng14_structp; true_bits: modpng14_color_8p); stdcall; -procedure png_set_sig_bytes(png_ptr: png_structp; num_bytes: int); +procedure modpng14_set_sig_bytes(modpng14_ptr: modpng14_structp; num_bytes: int); stdcall; -procedure png_set_strip_16(png_ptr: png_structp); +procedure modpng14_set_strip_16(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_strip_alpha(png_ptr: png_structp); +procedure modpng14_set_strip_alpha(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_swap(png_ptr: png_structp); +procedure modpng14_set_swap(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_swap_alpha(png_ptr: png_structp); +procedure modpng14_set_swap_alpha(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_tIME(png_ptr: png_structp; info_ptr: png_infop; - mod_time: png_timep); +procedure modpng14_set_tIME(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + mod_time: modpng14_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); +procedure modpng14_set_tRNS(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + trans: modpng14_bytep; num_trans: int; + trans_values: modpng14_color_16p); stdcall; -procedure png_set_tRNS_to_alpha(png_ptr: png_structp); +procedure modpng14_set_tRNS_to_alpha(modpng14_ptr: modpng14_structp); stdcall; -procedure png_set_text(png_ptr: png_structp; info_ptr: png_infop; - text_ptr: png_textp; num_text: int); +procedure modpng14_set_text(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + text_ptr: modpng14_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); +procedure modpng14_set_write_fn(modpng14_ptr: modpng14_structp; + io_ptr: modpng14_voidp; write_data_fn: modpng14_rw_ptr; + output_flush_fn: modpng14_flush_ptr); stdcall; -procedure png_set_write_status_fn(png_ptr: png_structp; - write_row_fn: png_write_status_ptr); +procedure modpng14_set_write_status_fn(modpng14_ptr: modpng14_structp; + write_row_fn: modpng14_write_status_ptr); stdcall; -procedure png_set_write_user_transform_fn(png_ptr: png_structp; - write_user_transform_fn: png_user_transform_ptr); +procedure modpng14_set_write_user_transform_fn(modpng14_ptr: modpng14_structp; + write_user_transform_fn: modpng14_user_transform_ptr); stdcall; -function png_sig_cmp(sig: png_bytep; start, num_to_check: png_size_t): +function modpng14_sig_cmp(sig: modpng14_bytep; start, num_to_check: modpng14_size_t): int; stdcall; -procedure png_start_read_image(png_ptr: png_structp); +procedure modpng14_start_read_image(modpng14_ptr: modpng14_structp); stdcall; -procedure png_write_chunk(png_ptr: png_structp; - chunk_name, data: png_bytep; length: png_size_t); +procedure modpng14_write_chunk(modpng14_ptr: modpng14_structp; + chunk_name, data: modpng14_bytep; length: modpng14_size_t); stdcall; -procedure png_write_chunk_data(png_ptr: png_structp; - data: png_bytep; length: png_size_t); +procedure modpng14_write_chunk_data(modpng14_ptr: modpng14_structp; + data: modpng14_bytep; length: modpng14_size_t); stdcall; -procedure png_write_chunk_end(png_ptr: png_structp); +procedure modpng14_write_chunk_end(modpng14_ptr: modpng14_structp); stdcall; -procedure png_write_chunk_start(png_ptr: png_structp; - chunk_name: png_bytep; length: png_uint_32); +procedure modpng14_write_chunk_start(modpng14_ptr: modpng14_structp; + chunk_name: modpng14_bytep; length: modpng14_uint_32); stdcall; -procedure png_write_end(png_ptr: png_structp; info_ptr: png_infop); +procedure modpng14_write_end(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop); stdcall; -procedure png_write_flush(png_ptr: png_structp); +procedure modpng14_write_flush(modpng14_ptr: modpng14_structp); stdcall; -procedure png_write_image(png_ptr: png_structp; image: png_bytepp); +procedure modpng14_write_image(modpng14_ptr: modpng14_structp; image: modpng14_bytepp); stdcall; -procedure png_write_info(png_ptr: png_structp; info_ptr: png_infop); +procedure modpng14_write_info(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop); stdcall; -procedure png_write_info_before_PLTE(png_ptr: png_structp; info_ptr: png_infop); +procedure modpng14_write_info_before_PLTE(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop); stdcall; -procedure png_write_row(png_ptr: png_structp; row: png_bytep); +procedure modpng14_write_row(modpng14_ptr: modpng14_structp; row: modpng14_bytep); stdcall; -procedure png_write_rows(png_ptr: png_structp; row: png_bytepp; - num_rows: png_uint_32); +procedure modpng14_write_rows(modpng14_ptr: modpng14_structp; row: modpng14_bytepp; + num_rows: modpng14_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; +procedure modpng14_get_iCCP(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + name: modpng14_charpp; compression_type: int *; profile: modpng14_charpp; + proflen: modpng14_int_32): modpng14_bytep; stdcall; -procedure png_get_sPLT(png_ptr: png_structp; - info_ptr: png_infop; entries: png_spalette_pp): png_uint_32; +procedure modpng14_get_sPLT(modpng14_ptr: modpng14_structp; + info_ptr: modpng14_infop; entries: modpng14_spalette_pp): modpng14_uint_32; stdcall; -procedure png_set_iCCP(png_ptr: png_structp; info_ptr: png_infop; - name: png_charp; compression_type: int; profile: png_charp; +procedure modpng14_set_iCCP(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + name: modpng14_charp; compression_type: int; profile: modpng14_charp; proflen: int); stdcall; -procedure png_free_data(png_ptr: png_structp; info_ptr: png_infop; num: int); +procedure modpng14_free_data(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; num: int); stdcall; -procedure png_set_sPLT(png_ptr: png_structp; info_ptr: png_infop; - entries: png_spalette_p; nentries: int); +procedure modpng14_set_sPLT(modpng14_ptr: modpng14_structp; info_ptr: modpng14_infop; + entries: modpng14_spalette_p; nentries: int); stdcall; implementation @@ -659,137 +659,137 @@ 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; +procedure modpng14_build_grayscale_palette; external pngDLL; +function modpng14_check_sig; external pngDLL; +procedure modpng14_chunk_error; external pngDLL; +procedure modpng14_chunk_warning; external pngDLL; +procedure modpng14_convert_from_time_t; external pngDLL; +function modpng14_convert_to_rfc1123; external pngDLL; +function modpng14_create_info_struct; external pngDLL; +function modpng14_create_read_struct; external pngDLL; +function modpng14_create_write_struct; external pngDLL; +procedure modpng14_destroy_info_struct; external pngDLL; +procedure modpng14_destroy_read_struct; external pngDLL; +procedure modpng14_destroy_write_struct; external pngDLL; +function modpng14_get_IHDR; external pngDLL; +function modpng14_get_PLTE; external pngDLL; +function modpng14_get_bKGD; external pngDLL; +function modpng14_get_bit_depth; external pngDLL; +function modpng14_get_cHRM; external pngDLL; +function modpng14_get_channels; external pngDLL; +function modpng14_get_color_type; external pngDLL; +function modpng14_get_compression_type; external pngDLL; +function modpng14_get_error_ptr; external pngDLL; +function modpng14_get_filter_type; external pngDLL; +function modpng14_get_gAMA; external pngDLL; +function modpng14_get_hIST; external pngDLL; +function modpng14_get_image_height; external pngDLL; +function modpng14_get_image_width; external pngDLL; +function modpng14_get_interlace_type; external pngDLL; +function modpng14_get_io_ptr; external pngDLL; +function modpng14_get_oFFs; external pngDLL; +function modpng14_get_pCAL; external pngDLL; +function modpng14_get_pHYs; external pngDLL; +function modpng14_get_pixel_aspect_ratio; external pngDLL; +function modpng14_get_pixels_per_meter; external pngDLL; +function modpng14_get_progressive_ptr; external pngDLL; +function modpng14_get_rowbytes; external pngDLL; +function modpng14_get_rows; external pngDLL; +function modpng14_get_sBIT; external pngDLL; +function modpng14_get_sRGB; external pngDLL; +function modpng14_get_signature; external pngDLL; +function modpng14_get_tIME; external pngDLL; +function modpng14_get_tRNS; external pngDLL; +function modpng14_get_text; external pngDLL; +function modpng14_get_user_chunk_ptr; external pngDLL; +function modpng14_get_valid; external pngDLL; +function modpng14_get_x_offset_microns; external pngDLL; +function modpng14_get_x_offset_pixels; external pngDLL; +function modpng14_get_x_pixels_per_meter; external pngDLL; +function modpng14_get_y_offset_microns; external pngDLL; +function modpng14_get_y_offset_pixels; external pngDLL; +function modpng14_get_y_pixels_per_meter; external pngDLL; +procedure modpng14_process_data; external pngDLL; +procedure modpng14_progressive_combine_row; external pngDLL; +procedure modpng14_read_end; external pngDLL; +procedure modpng14_read_image; external pngDLL; +procedure modpng14_read_info; external pngDLL; +procedure modpng14_read_row; external pngDLL; +procedure modpng14_read_rows; external pngDLL; +procedure modpng14_read_update_info; external pngDLL; +procedure modpng14_set_IHDR; external pngDLL; +procedure modpng14_set_PLTE; external pngDLL; +procedure modpng14_set_bKGD; external pngDLL; +procedure modpng14_set_background; external pngDLL; +procedure modpng14_set_bgr; external pngDLL; +procedure modpng14_set_cHRM; external pngDLL; +procedure modpng14_set_cHRM_fixed; external pngDLL; +procedure modpng14_set_compression_level; external pngDLL; +procedure modpng14_set_compression_mem_level; external pngDLL; +procedure modpng14_set_compression_method; external pngDLL; +procedure modpng14_set_compression_strategy; external pngDLL; +procedure modpng14_set_compression_window_bits; external pngDLL; +procedure modpng14_set_crc_action; external pngDLL; +procedure modpng14_set_dither; external pngDLL; +procedure modpng14_set_error_fn; external pngDLL; +procedure modpng14_set_expand; external pngDLL; +procedure modpng14_set_filler; external pngDLL; +procedure modpng14_set_filter; external pngDLL; +procedure modpng14_set_filter_heuristics; external pngDLL; +procedure modpng14_set_flush; external pngDLL; +procedure modpng14_set_gAMA; external pngDLL; +procedure modpng14_set_gAMA_fixed; external pngDLL; +procedure modpng14_set_gamma; external pngDLL; +procedure modpng14_set_gray_to_rgb; external pngDLL; +procedure modpng14_set_hIST; external pngDLL; +function modpng14_set_interlace_handling; external pngDLL; +procedure modpng14_set_invert_alpha; external pngDLL; +procedure modpng14_set_invert_mono; external pngDLL; +procedure modpng14_set_oFFs; external pngDLL; +procedure modpng14_set_pCAL; external pngDLL; +procedure modpng14_set_pHYs; external pngDLL; +procedure modpng14_set_packing; external pngDLL; +procedure modpng14_set_packswap; external pngDLL; +procedure modpng14_set_progressive_read_fn; external pngDLL; +procedure modpng14_set_read_fn; external pngDLL; +procedure modpng14_set_read_status_fn; external pngDLL; +procedure modpng14_set_read_user_transform_fn; external pngDLL; +procedure modpng14_set_rgb_to_gray; external pngDLL; +procedure modpng14_set_rgb_to_gray_fixed; external pngDLL; +procedure modpng14_set_rows; external pngDLL; +procedure modpng14_set_sBIT; external pngDLL; +procedure modpng14_set_sRGB; external pngDLL; +procedure modpng14_set_sRGB_gAMA_and_cHRM; external pngDLL; +procedure modpng14_set_shift; external pngDLL; +procedure modpng14_set_sig_bytes; external pngDLL; +procedure modpng14_set_strip_16; external pngDLL; +procedure modpng14_set_strip_alpha; external pngDLL; +procedure modpng14_set_swap; external pngDLL; +procedure modpng14_set_swap_alpha; external pngDLL; +procedure modpng14_set_tIME; external pngDLL; +procedure modpng14_set_tRNS; external pngDLL; +procedure modpng14_set_text; external pngDLL; +procedure modpng14_set_user_chunk_fn; external pngDLL; +procedure modpng14_set_write_fn; external pngDLL; +procedure modpng14_set_write_status_fn; external pngDLL; +procedure modpng14_set_write_user_transform_fn; external pngDLL; +function modpng14_sig_cmp; external pngDLL; +procedure modpng14_start_read_image; external pngDLL; +procedure modpng14_write_chunk; external pngDLL; +procedure modpng14_write_chunk_data; external pngDLL; +procedure modpng14_write_chunk_end; external pngDLL; +procedure modpng14_write_chunk_start; external pngDLL; +procedure modpng14_write_end; external pngDLL; +procedure modpng14_write_flush; external pngDLL; +procedure modpng14_write_image; external pngDLL; +procedure modpng14_write_info; external pngDLL; +procedure modpng14_write_info_before_PLTE; external pngDLL; +procedure modpng14_write_row; external pngDLL; +procedure modpng14_write_rows; external pngDLL; +procedure modpng14_get_iCCP; external pngDLL; +procedure modpng14_get_sPLT; external pngDLL; +procedure modpng14_set_iCCP; external pngDLL; +procedure modpng14_set_sPLT; external pngDLL; +procedure modpng14_free_data; external pngDLL; end. --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/pngos2.def +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/pngos2.def @@ -12,230 +12,230 @@ 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 + modpng14_build_grayscale_palette + modpng14_check_sig + modpng14_chunk_error + modpng14_chunk_warning + modpng14_convert_from_struct_tm + modpng14_convert_from_time_t + modpng14_create_info_struct + modpng14_create_read_struct + modpng14_create_write_struct + modpng14_data_freer + modpng14_destroy_info_struct + modpng14_destroy_read_struct + modpng14_destroy_write_struct + modpng14_error + modpng14_free + modpng14_free_data + modpng14_get_IHDR + modpng14_get_PLTE + modpng14_get_bKGD + modpng14_get_bit_depth + modpng14_get_cHRM + modpng14_get_cHRM_fixed + modpng14_get_channels + modpng14_get_color_type + modpng14_get_compression_buffer_size + modpng14_get_compression_type + modpng14_get_copyright + modpng14_get_error_ptr + modpng14_get_filter_type + modpng14_get_gAMA + modpng14_get_gAMA_fixed + modpng14_get_hIST + modpng14_get_header_ver + modpng14_get_header_version + modpng14_get_iCCP + modpng14_get_image_height + modpng14_get_image_width + modpng14_get_interlace_type + modpng14_get_io_ptr + modpng14_get_libmodpng14_ver + modpng14_get_oFFs + modpng14_get_pCAL + modpng14_get_pHYs + modpng14_get_pixel_aspect_ratio + modpng14_get_pixels_per_meter + modpng14_get_progressive_ptr + modpng14_get_rgb_to_gray_status + modpng14_get_rowbytes + modpng14_get_rows + modpng14_get_sBIT + modpng14_get_sCAL + modpng14_get_sPLT + modpng14_get_sRGB + modpng14_get_signature + modpng14_get_tIME + modpng14_get_tRNS + modpng14_get_text + modpng14_get_unknown_chunks + modpng14_get_user_chunk_ptr + modpng14_get_user_transform_ptr + modpng14_get_valid + modpng14_get_x_offset_microns + modpng14_get_x_offset_pixels + modpng14_get_x_pixels_per_meter + modpng14_get_y_offset_microns + modpng14_get_y_offset_pixels + modpng14_get_y_pixels_per_meter + modpng14_malloc + modpng14_memcpy_check + modpng14_memset_check + modpng14_permit_empty_plte + modpng14_process_data + modpng14_progressive_combine_row + modpng14_read_end + modpng14_read_image + modpng14_read_info + modpng14_read_init ; deprecated + modpng14_read_png + modpng14_read_row + modpng14_read_rows + modpng14_read_update_info + modpng14_reset_zstream + modpng14_set_IHDR + modpng14_set_PLTE + modpng14_set_bKGD + modpng14_set_background + modpng14_set_bgr + modpng14_set_cHRM + modpng14_set_cHRM_fixed + modpng14_set_compression_buffer_size + modpng14_set_compression_level + modpng14_set_compression_mem_level + modpng14_set_compression_method + modpng14_set_compression_strategy + modpng14_set_compression_window_bits + modpng14_set_crc_action + modpng14_set_dither + modpng14_set_error_fn + modpng14_set_expand + modpng14_set_filler + modpng14_set_filter + modpng14_set_filter_heuristics + modpng14_set_flush + modpng14_set_gAMA + modpng14_set_gAMA_fixed + modpng14_set_gamma + modpng14_set_gray_1_2_4_to_8 + modpng14_set_gray_to_rgb + modpng14_set_hIST + modpng14_set_iCCP + modpng14_set_interlace_handling + modpng14_set_invert_alpha + modpng14_set_invert_mono + modpng14_set_keep_unknown_chunks + modpng14_set_oFFs + modpng14_set_pCAL + modpng14_set_pHYs + modpng14_set_packing + modpng14_set_packswap + modpng14_set_palette_to_rgb + modpng14_set_progressive_read_fn + modpng14_set_read_fn + modpng14_set_read_status_fn + modpng14_set_read_user_chunk_fn + modpng14_set_read_user_transform_fn + modpng14_set_rgb_to_gray + modpng14_set_rgb_to_gray_fixed + modpng14_set_rows + modpng14_set_sBIT + modpng14_set_sCAL + modpng14_set_sPLT + modpng14_set_sRGB + modpng14_set_sRGB_gAMA_and_cHRM + modpng14_set_shift + modpng14_set_sig_bytes + modpng14_set_strip_16 + modpng14_set_strip_alpha + modpng14_set_swap + modpng14_set_swap_alpha + modpng14_set_tIME + modpng14_set_tRNS + modpng14_set_tRNS_to_alpha + modpng14_set_text + modpng14_set_unknown_chunk_location + modpng14_set_unknown_chunks + modpng14_set_user_transform_info + modpng14_set_write_fn + modpng14_set_write_status_fn + modpng14_set_write_user_transform_fn + modpng14_sig_cmp + modpng14_start_read_image + modpng14_warning + modpng14_write_chunk + modpng14_write_chunk_data + modpng14_write_chunk_end + modpng14_write_chunk_start + modpng14_write_end + modpng14_write_flush + modpng14_write_image + modpng14_write_info + modpng14_write_info_before_PLTE + modpng14_write_init ; deprecated + modpng14_write_png + modpng14_write_row + modpng14_write_rows + modpng14_read_init_2 + modpng14_write_init_2 + modpng14_access_version_number + modpng14_init_io + modpng14_convert_to_rfc1123 + modpng14_set_invalid ; 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 + modpng14_mmx_support + modpng14_permit_empty_plte + modpng14_permit_mng_features + modpng14_get_mmx_flagmask + modpng14_get_asm_flagmask + modpng14_get_asm_flags + modpng14_get_mmx_bitdepth_threshold + modpng14_get_mmx_rowbytes_threshold + modpng14_set_asm_flags + modpng14_init_mmx_flags ; Added at version 1.2.2: - png_handle_as_unknown + modpng14_handle_as_unknown ; Added at version 1.2.2 and deleted from 1.2.3: -; png_zalloc -; png_zfree +; modpng14_zalloc +; modpng14_zfree ; Added at version 1.2.4 - png_malloc_warn + modpng14_malloc_warn -; 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 +; These are not present when libmodpng14 is compiled with MODPNG14_NO_GLOBAL_ARRAYS + modpng14_libmodpng14_ver + modpng14_pass_start + modpng14_pass_inc + modpng14_pass_ystart + modpng14_pass_yinc + modpng14_pass_mask + modpng14_pass_dsp_mask +; modpng14_pass_width +; modpng14_pass_height + +; These are not present when libmodpng14 is compiled with MODPNG14_NO_GLOBAL_ARRAYS + modpng14_IHDR + modpng14_IDAT + modpng14_IEND + modpng14_PLTE + modpng14_bKGD + modpng14_cHRM + modpng14_gAMA + modpng14_hIST + modpng14_iCCP + modpng14_iTXt + modpng14_oFFs + modpng14_pCAL + modpng14_pHYs + modpng14_sBIT + modpng14_sCAL + modpng14_sPLT + modpng14_sRGB + modpng14_tEXt + modpng14_tIME + modpng14_tRNS + modpng14_zTXt --- qt-x11-free-3.3.8b.old/src/3rdparty/libpng/scripts/smakefile.ppc +++ qt-x11-free-3.3.8b/src/3rdparty/libpng/scripts/smakefile.ppc @@ -1,12 +1,12 @@ # Amiga powerUP (TM) Makefile -# makefile for libpng and SAS C V6.58/7.00 PPC compiler +# makefile for libmodpng14 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 +# For conditions of distribution and use, see copyright notice in modpng14.h CC = scppc CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \ OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 -LIBNAME = libpng.a +LIBNAME = libmodpng14.a AR = ppc-amigaos-ar AR_FLAGS = cr RANLIB = ppc-amigaos-ranlib --- qt-x11-free-3.3.8b.old/src/3rdparty/zlib/README +++ qt-x11-free-3.3.8b/src/3rdparty/zlib/README @@ -63,7 +63,7 @@ - For Windows DLL versions, please see win32/DLL_FAQ.txt - 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 + -O, one libmodpng14 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 --- qt-x11-free-3.3.8b.old/src/kernel/qimage.cpp +++ qt-x11-free-3.3.8b/src/kernel/qimage.cpp @@ -6453,7 +6453,7 @@ Records string \a s for the keyword \a key. The \a key should be a portable keyword recognizable by other software - some suggested values can be found in \link - http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html#C.Anc-text + http://www.libmodpng14.org/pub/png/spec/1.2/png-1.2-pdg.html#C.Anc-text the PNG specification \endlink. \a s can be any text. \a lang should specify the language code (see \link http://www.rfc-editor.org/rfc/rfc1766.txt RFC 1766 \endlink) or 0. --- qt-x11-free-3.3.8b.old/src/kernel/qpngio.cpp +++ qt-x11-free-3.3.8b/src/kernel/qpngio.cpp @@ -45,7 +45,7 @@ #include "qasyncimageio.h" #include "qiodevice.h" -#include +#include #ifdef Q_OS_TEMP @@ -67,15 +67,15 @@ #endif static -void CALLBACK_CALL_TYPE iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length) +void CALLBACK_CALL_TYPE iod_read_fn(modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - QImageIO* iio = (QImageIO*)png_get_io_ptr(png_ptr); + QImageIO* iio = (QImageIO*)modpng14_get_io_ptr(modpng14_ptr); QIODevice* in = iio->ioDevice(); while (length) { int nr = in->readBlock((char*)data, length); if (nr <= 0) { - png_error(png_ptr, "Read Error"); + modpng14_error(modpng14_ptr, "Read Error"); return; } length -= nr; @@ -84,23 +84,23 @@ static -void CALLBACK_CALL_TYPE qpiw_write_fn( png_structp png_ptr, png_bytep data, png_size_t length ) +void CALLBACK_CALL_TYPE qpiw_write_fn( modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length ) { - QPNGImageWriter* qpiw = (QPNGImageWriter*)png_get_io_ptr( png_ptr ); + QPNGImageWriter* qpiw = (QPNGImageWriter*)modpng14_get_io_ptr( modpng14_ptr ); QIODevice* out = qpiw->device(); uint nr = out->writeBlock( (char*)data, length ); if ( nr != length ) { - png_error( png_ptr, "Write Error" ); + modpng14_error( modpng14_ptr, "Write Error" ); return; } } static -void CALLBACK_CALL_TYPE qpiw_flush_fn( png_structp png_ptr ) +void CALLBACK_CALL_TYPE qpiw_flush_fn( modpng14_structp modpng14_ptr ) { - QPNGImageWriter* qpiw = (QPNGImageWriter*)png_get_io_ptr( png_ptr ); + QPNGImageWriter* qpiw = (QPNGImageWriter*)modpng14_get_io_ptr( modpng14_ptr ); QIODevice* out = qpiw->device(); out->flush(); @@ -111,86 +111,86 @@ #endif static -void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float screen_gamma=0.0 ) +void setup_qt( QImage& image, modpng14_structp modpng14_ptr, modpng14_infop info_ptr, float screen_gamma=0.0 ) { - if ( screen_gamma != 0.0 && png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) { + if ( screen_gamma != 0.0 && modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_gAMA) ) { double file_gamma; - png_get_gAMA(png_ptr, info_ptr, &file_gamma); - png_set_gamma( png_ptr, screen_gamma, file_gamma ); + modpng14_get_gAMA(modpng14_ptr, info_ptr, &file_gamma); + modpng14_set_gamma( modpng14_ptr, screen_gamma, file_gamma ); } - png_uint_32 width; - png_uint_32 height; + modpng14_uint_32 width; + modpng14_uint_32 height; int bit_depth; int color_type; - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + modpng14_get_IHDR(modpng14_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); - if ( color_type == PNG_COLOR_TYPE_GRAY ) { + if ( color_type == MODPNG14_COLOR_TYPE_GRAY ) { // Black & White or 8-bit grayscale if ( bit_depth == 1 && info_ptr->channels == 1 ) { - png_set_invert_mono( png_ptr ); - png_read_update_info( png_ptr, info_ptr ); + modpng14_set_invert_mono( modpng14_ptr ); + modpng14_read_update_info( modpng14_ptr, info_ptr ); if (!image.create( width, height, 1, 2, QImage::BigEndian )) return; image.setColor( 1, qRgb(0,0,0) ); image.setColor( 0, qRgb(255,255,255) ); - } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_set_expand(png_ptr); - png_set_strip_16(png_ptr); - png_set_gray_to_rgb(png_ptr); + } else if (bit_depth == 16 && modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_tRNS)) { + modpng14_set_expand(modpng14_ptr); + modpng14_set_strip_16(modpng14_ptr); + modpng14_set_gray_to_rgb(modpng14_ptr); if (!image.create(width, height, 32)) return; image.setAlphaBuffer(TRUE); if (QImage::systemByteOrder() == QImage::BigEndian) - png_set_swap_alpha(png_ptr); + modpng14_set_swap_alpha(modpng14_ptr); - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_ptr, info_ptr); } else { if ( bit_depth == 16 ) - png_set_strip_16(png_ptr); + modpng14_set_strip_16(modpng14_ptr); else if ( bit_depth < 8 ) - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); int ncols = bit_depth < 8 ? 1 << bit_depth : 256; - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_ptr, info_ptr); if (!image.create(width, height, 8, ncols)) return; for (int i=0; itrans_values.gray; + if ( modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_tRNS) ) { + const int g = info_ptr->trans_color.gray; if (g < ncols) { image.setAlphaBuffer(TRUE); image.setColor(g, image.color(g) & RGB_MASK); } } } - } else if ( color_type == PNG_COLOR_TYPE_PALETTE - && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE) + } else if ( color_type == MODPNG14_COLOR_TYPE_PALETTE + && modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_PLTE) && info_ptr->num_palette <= 256 ) { // 1-bit and 8-bit color if ( bit_depth != 1 ) - png_set_packing( png_ptr ); - png_read_update_info( png_ptr, info_ptr ); - png_get_IHDR(png_ptr, info_ptr, + modpng14_set_packing( modpng14_ptr ); + modpng14_read_update_info( modpng14_ptr, info_ptr ); + modpng14_get_IHDR(modpng14_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); if (!image.create(width, height, bit_depth, info_ptr->num_palette, QImage::BigEndian)) return; int i = 0; - if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { + if ( modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_tRNS) ) { image.setAlphaBuffer( TRUE ); while ( i < info_ptr->num_trans ) { image.setColor(i, qRgba( info_ptr->palette[i].red, info_ptr->palette[i].green, info_ptr->palette[i].blue, - info_ptr->trans[i] + info_ptr->trans_alpha[i] ) ); i++; @@ -209,37 +209,37 @@ } else { // 32-bit if ( bit_depth == 16 ) - png_set_strip_16(png_ptr); + modpng14_set_strip_16(modpng14_ptr); - png_set_expand(png_ptr); + modpng14_set_expand(modpng14_ptr); - if ( color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) - png_set_gray_to_rgb(png_ptr); + if ( color_type == MODPNG14_COLOR_TYPE_GRAY_ALPHA ) + modpng14_set_gray_to_rgb(modpng14_ptr); if (!image.create(width, height, 32)) return; // Only add filler if no alpha, or we can get 5 channel data. - if (!(color_type & PNG_COLOR_MASK_ALPHA) - && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_set_filler(png_ptr, 0xff, + if (!(color_type & MODPNG14_COLOR_MASK_ALPHA) + && !modpng14_get_valid(modpng14_ptr, info_ptr, MODPNG14_INFO_tRNS)) { + modpng14_set_filler(modpng14_ptr, 0xff, QImage::systemByteOrder() == QImage::BigEndian ? - PNG_FILLER_BEFORE : PNG_FILLER_AFTER); + MODPNG14_FILLER_BEFORE : MODPNG14_FILLER_AFTER); // We want 4 bytes, but it isn't an alpha channel } else { image.setAlphaBuffer(TRUE); } if ( QImage::systemByteOrder() == QImage::BigEndian ) { - png_set_swap_alpha(png_ptr); + modpng14_set_swap_alpha(modpng14_ptr); } - png_read_update_info(png_ptr, info_ptr); + modpng14_read_update_info(modpng14_ptr, info_ptr); } // Qt==ARGB==Big(ARGB)==Little(BGRA) if ( QImage::systemByteOrder() == QImage::LittleEndian ) { - png_set_bgr(png_ptr); + modpng14_set_bgr(modpng14_ptr); } } @@ -247,9 +247,9 @@ #if defined(Q_C_CALLBACKS) extern "C" { #endif -static void CALLBACK_CALL_TYPE qt_png_warning(png_structp /*png_ptr*/, png_const_charp message) +static void CALLBACK_CALL_TYPE qt_modpng14_warning(modpng14_structp /*modpng14_ptr*/, modpng14_const_charp message) { - qWarning("libpng warning: %s", message); + qWarning("libmodpng14 warning: %s", message); } #if defined(Q_C_CALLBACKS) @@ -258,71 +258,71 @@ static -void read_png_image(QImageIO* iio) +void read_modpng14_image(QImageIO* iio) { - png_structp png_ptr; - png_infop info_ptr; - png_infop end_info; - png_bytep* row_pointers; + modpng14_structp modpng14_ptr; + modpng14_infop info_ptr; + modpng14_infop end_info; + modpng14_bytep* row_pointers; - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); - if (!png_ptr) { + modpng14_ptr = modpng14_create_read_struct(MODPNG14_LIBMODPNG14_VER_STRING,0,0,0); + if (!modpng14_ptr) { iio->setStatus(-1); return; } - png_set_error_fn(png_ptr, 0, 0, qt_png_warning); + modpng14_set_error_fn(modpng14_ptr, 0, 0, qt_modpng14_warning); - info_ptr = png_create_info_struct(png_ptr); + info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_read_struct(&png_ptr, 0, 0); + modpng14_destroy_read_struct(&modpng14_ptr, 0, 0); iio->setStatus(-2); return; } - end_info = png_create_info_struct(png_ptr); + end_info = modpng14_create_info_struct(modpng14_ptr); if (!end_info) { - png_destroy_read_struct(&png_ptr, &info_ptr, 0); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, 0); iio->setStatus(-3); return; } - if (setjmp(png_ptr->jmpbuf)) { - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); + if (setjmp(modpng14_ptr->jmpbuf)) { + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); iio->setStatus(-4); return; } - png_set_read_fn(png_ptr, (void*)iio, iod_read_fn); - png_read_info(png_ptr, info_ptr); + modpng14_set_read_fn(modpng14_ptr, (void*)iio, iod_read_fn); + modpng14_read_info(modpng14_ptr, info_ptr); QImage image; - setup_qt(image, png_ptr, info_ptr, iio->gamma()); + setup_qt(image, modpng14_ptr, info_ptr, iio->gamma()); if (image.isNull()) { - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); iio->setStatus(-5); return; } - png_uint_32 width; - png_uint_32 height; + modpng14_uint_32 width; + modpng14_uint_32 height; int bit_depth; int color_type; - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + modpng14_get_IHDR(modpng14_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); uchar** jt = image.jumpTable(); - row_pointers=new png_bytep[height]; + row_pointers=new modpng14_bytep[height]; for (uint y=0; ytrans_values.red << 8 >> bit_depth)&0xff, (info_ptr->trans_values.green << 8 >> bit_depth)&0xff, @@ -338,13 +338,13 @@ } #endif - image.setDotsPerMeterX(png_get_x_pixels_per_meter(png_ptr,info_ptr)); - image.setDotsPerMeterY(png_get_y_pixels_per_meter(png_ptr,info_ptr)); + image.setDotsPerMeterX(modpng14_get_x_pixels_per_meter(modpng14_ptr,info_ptr)); + image.setDotsPerMeterY(modpng14_get_y_pixels_per_meter(modpng14_ptr,info_ptr)); #ifndef QT_NO_IMAGE_TEXT - png_textp text_ptr; + modpng14_textp text_ptr; int num_text=0; - png_get_text(png_ptr,info_ptr,&text_ptr,&num_text); + modpng14_get_text(modpng14_ptr,info_ptr,&text_ptr,&num_text); while (num_text--) { image.setText(text_ptr->key,0,text_ptr->text); text_ptr++; @@ -373,8 +373,8 @@ iio->setImage(image); - png_read_end(png_ptr, end_info); - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); + modpng14_read_end(modpng14_ptr, end_info); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, &end_info); iio->setStatus(0); } @@ -415,11 +415,11 @@ #ifndef QT_NO_IMAGE_TEXT -static void set_text(const QImage& image, png_structp png_ptr, png_infop info_ptr, bool short_not_long) +static void set_text(const QImage& image, modpng14_structp modpng14_ptr, modpng14_infop info_ptr, bool short_not_long) { QValueList keys = image.textList(); if ( keys.count() ) { - png_textp text_ptr = new png_text[keys.count()]; + modpng14_textp text_ptr = new modpng14_text[keys.count()]; int i=0; for (QValueList::Iterator it=keys.begin(); it != keys.end(); ++it) @@ -427,16 +427,16 @@ QString t = image.text(*it); if ( (t.length() <= 200) == short_not_long ) { if ( t.length() < 40 ) - text_ptr[i].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[i].compression = MODPNG14_TEXT_COMPRESSION_NONE; else - text_ptr[i].compression = PNG_TEXT_COMPRESSION_zTXt; - text_ptr[i].key = (png_charp)(*it).key.data(); - text_ptr[i].text = (png_charp)t.latin1(); + text_ptr[i].compression = MODPNG14_TEXT_COMPRESSION_zTXt; + text_ptr[i].key = (modpng14_charp)(*it).key.data(); + text_ptr[i].text = (modpng14_charp)t.latin1(); //text_ptr[i].text = qstrdup(t.latin1()); i++; } } - png_set_text(png_ptr, info_ptr, text_ptr, i); + modpng14_set_text(modpng14_ptr, info_ptr, text_ptr, i); //for (int j=0; jjmpbuf)) { - png_destroy_write_struct(&png_ptr, &info_ptr); + if (setjmp(modpng14_ptr->jmpbuf)) { + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); return FALSE; } @@ -485,44 +485,44 @@ #endif quality = 9; } - png_set_compression_level(png_ptr, quality); + modpng14_set_compression_level(modpng14_ptr, quality); } if (gamma != 0.0) { - png_set_gAMA(png_ptr, info_ptr, 1.0/gamma); + modpng14_set_gAMA(modpng14_ptr, info_ptr, 1.0/gamma); } - png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn); + modpng14_set_write_fn(modpng14_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn); info_ptr->channels = (image.depth() == 32) ? (image.hasAlphaBuffer() ? 4 : 3) : 1; - png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(), + modpng14_set_IHDR(modpng14_ptr, info_ptr, image.width(), image.height(), image.depth() == 1 ? 1 : 8 /* per channel */, image.depth() == 32 ? image.hasAlphaBuffer() - ? PNG_COLOR_TYPE_RGB_ALPHA - : PNG_COLOR_TYPE_RGB - : PNG_COLOR_TYPE_PALETTE, 0, 0, 0); + ? MODPNG14_COLOR_TYPE_RGB_ALPHA + : MODPNG14_COLOR_TYPE_RGB + : MODPNG14_COLOR_TYPE_PALETTE, 0, 0, 0); - //png_set_sBIT(png_ptr, info_ptr, 8); + //modpng14_set_sBIT(modpng14_ptr, info_ptr, 8); info_ptr->sig_bit.red = 8; info_ptr->sig_bit.green = 8; info_ptr->sig_bit.blue = 8; if (image.depth() == 1 && image.bitOrder() == QImage::LittleEndian) - png_set_packswap(png_ptr); + modpng14_set_packswap(modpng14_ptr); - png_colorp palette = 0; - png_bytep copy_trans = 0; + modpng14_colorp palette = 0; + modpng14_bytep copy_trans = 0; if (image.numColors()) { // Paletted int num_palette = image.numColors(); - palette = new png_color[num_palette]; - png_set_PLTE(png_ptr, info_ptr, palette, num_palette); + palette = new modpng14_color[num_palette]; + modpng14_set_PLTE(modpng14_ptr, info_ptr, palette, num_palette); int* trans = new int[num_palette]; int num_trans = 0; for (int i=0; i 0 ) - png_set_sig_bytes(png_ptr, 8); + modpng14_set_sig_bytes(modpng14_ptr, 8); if ( image.dotsPerMeterX() > 0 || image.dotsPerMeterY() > 0 ) { - png_set_pHYs(png_ptr, info_ptr, + modpng14_set_pHYs(modpng14_ptr, info_ptr, image.dotsPerMeterX(), image.dotsPerMeterY(), - PNG_RESOLUTION_METER); + MODPNG14_RESOLUTION_METER); } #ifndef QT_NO_IMAGE_TEXT // Write short texts early. - set_text(image,png_ptr,info_ptr,TRUE); + set_text(image,modpng14_ptr,info_ptr,TRUE); #endif - png_write_info(png_ptr, info_ptr); + modpng14_write_info(modpng14_ptr, info_ptr); #ifndef QT_NO_IMAGE_TEXT // Write long texts later. - set_text(image,png_ptr,info_ptr,FALSE); + set_text(image,modpng14_ptr,info_ptr,FALSE); #endif if ( image.depth() != 1 ) - png_set_packing(png_ptr); + modpng14_set_packing(modpng14_ptr); if ( image.depth() == 32 && !image.hasAlphaBuffer() ) - png_set_filler(png_ptr, 0, + modpng14_set_filler(modpng14_ptr, 0, QImage::systemByteOrder() == QImage::BigEndian ? - PNG_FILLER_BEFORE : PNG_FILLER_AFTER); + MODPNG14_FILLER_BEFORE : MODPNG14_FILLER_AFTER); if ( looping >= 0 && frames_written == 0 ) { uchar data[13] = "NETSCAPE2.0"; // 0123456789aBC data[0xB] = looping%0x100; data[0xC] = looping/0x100; - png_write_chunk(png_ptr, (png_byte*)"gIFx", data, 13); + modpng14_write_chunk(modpng14_ptr, (modpng14_byte*)"gIFx", data, 13); } if ( ms_delay >= 0 || disposal!=Unspecified ) { uchar data[4]; @@ -607,26 +607,26 @@ data[1] = 0; data[2] = (ms_delay/10)/0x100; // hundredths data[3] = (ms_delay/10)%0x100; - png_write_chunk(png_ptr, (png_byte*)"gIFg", data, 4); + modpng14_write_chunk(modpng14_ptr, (modpng14_byte*)"gIFg", data, 4); } - png_uint_32 width; - png_uint_32 height; + modpng14_uint_32 width; + modpng14_uint_32 height; int bit_depth; int color_type; - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + modpng14_get_IHDR(modpng14_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); uchar** jt = image.jumpTable(); - row_pointers=new png_bytep[height]; + row_pointers=new modpng14_bytep[height]; uint y; for (y=0; yioDevice()); int quality = iio->quality(); @@ -835,13 +835,13 @@ int decode(QImage& img, QImageConsumer* consumer, const uchar* buffer, int length); - void info(png_structp png_ptr, png_infop info); - void row(png_structp png_ptr, png_bytep new_row, - png_uint_32 row_num, int pass); - void end(png_structp png_ptr, png_infop info); -#ifdef PNG_USER_CHUNKS_SUPPORTED - int user_chunk(png_structp png_ptr, - png_bytep data, png_uint_32 length); + void info(modpng14_structp modpng14_ptr, modpng14_infop info); + void row(modpng14_structp modpng14_ptr, modpng14_bytep new_row, + modpng14_uint_32 row_num, int pass); + void end(modpng14_structp modpng14_ptr, modpng14_infop info); +#ifdef MODPNG14_USER_CHUNKS_SUPPORTED + int user_chunk(modpng14_structp modpng14_ptr, + modpng14_bytep data, modpng14_uint_32 length); #endif private: @@ -852,8 +852,8 @@ int base_offy; // Image-level information - png_structp png_ptr; - png_infop info_ptr; + modpng14_structp modpng14_ptr; + modpng14_infop info_ptr; // Temporary locals during single data-chunk processing QImageConsumer* consumer; @@ -942,35 +942,35 @@ #endif static void -CALLBACK_CALL_TYPE info_callback(png_structp png_ptr, png_infop info) +CALLBACK_CALL_TYPE info_callback(modpng14_structp modpng14_ptr, modpng14_infop info) { - QPNGFormat* that = (QPNGFormat*)png_get_progressive_ptr(png_ptr); - that->info(png_ptr,info); + QPNGFormat* that = (QPNGFormat*)modpng14_get_progressive_ptr(modpng14_ptr); + that->info(modpng14_ptr,info); } static void -CALLBACK_CALL_TYPE row_callback(png_structp png_ptr, png_bytep new_row, - png_uint_32 row_num, int pass) +CALLBACK_CALL_TYPE row_callback(modpng14_structp modpng14_ptr, modpng14_bytep new_row, + modpng14_uint_32 row_num, int pass) { - QPNGFormat* that = (QPNGFormat*)png_get_progressive_ptr(png_ptr); - that->row(png_ptr,new_row,row_num,pass); + QPNGFormat* that = (QPNGFormat*)modpng14_get_progressive_ptr(modpng14_ptr); + that->row(modpng14_ptr,new_row,row_num,pass); } static void -CALLBACK_CALL_TYPE end_callback(png_structp png_ptr, png_infop info) +CALLBACK_CALL_TYPE end_callback(modpng14_structp modpng14_ptr, modpng14_infop info) { - QPNGFormat* that = (QPNGFormat*)png_get_progressive_ptr(png_ptr); - that->end(png_ptr,info); + QPNGFormat* that = (QPNGFormat*)modpng14_get_progressive_ptr(modpng14_ptr); + that->end(modpng14_ptr,info); } #if 0 -#ifdef PNG_USER_CHUNKS_SUPPORTED +#ifdef MODPNG14_USER_CHUNKS_SUPPORTED static int -CALLBACK_CALL_TYPE user_chunk_callback(png_structp png_ptr, - png_unknown_chunkp chunk) +CALLBACK_CALL_TYPE user_chunk_callback(modpng14_structp modpng14_ptr, + modpng14_unknown_chunkp chunk) { - QPNGFormat* that = (QPNGFormat*)png_get_progressive_ptr(png_ptr); - return that->user_chunk(png_ptr,chunk->data,chunk->size); + QPNGFormat* that = (QPNGFormat*)modpng14_get_progressive_ptr(modpng14_ptr); + return that->user_chunk(modpng14_ptr,chunk->data,chunk->size); } #endif #endif @@ -989,7 +989,7 @@ first_frame = 1; base_offx = 0; base_offy = 0; - png_ptr = 0; + modpng14_ptr = 0; info_ptr = 0; } @@ -999,8 +999,8 @@ */ QPNGFormat::~QPNGFormat() { - if ( png_ptr ) - png_destroy_read_struct(&png_ptr, &info_ptr, 0); + if ( modpng14_ptr ) + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, 0); } @@ -1016,101 +1016,101 @@ image = &img; if ( state != Inside ) { - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); - if (!png_ptr) { + modpng14_ptr = modpng14_create_read_struct(MODPNG14_LIBMODPNG14_VER_STRING, 0, 0, 0); + if (!modpng14_ptr) { info_ptr = 0; image = 0; return -1; } - png_set_error_fn(png_ptr, 0, 0, qt_png_warning); - png_set_compression_level(png_ptr, 9); + modpng14_set_error_fn(modpng14_ptr, 0, 0, qt_modpng14_warning); + modpng14_set_compression_level(modpng14_ptr, 9); - info_ptr = png_create_info_struct(png_ptr); + info_ptr = modpng14_create_info_struct(modpng14_ptr); if (!info_ptr) { - png_destroy_read_struct(&png_ptr, &info_ptr, 0); + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, 0); image = 0; return -1; } - if (setjmp((png_ptr)->jmpbuf)) { - png_destroy_read_struct(&png_ptr, &info_ptr, 0); + if (setjmp((modpng14_ptr)->jmpbuf)) { + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, 0); image = 0; return -1; } - png_set_progressive_read_fn(png_ptr, (void *)this, + modpng14_set_progressive_read_fn(modpng14_ptr, (void *)this, info_callback, row_callback, end_callback); -#ifdef PNG_USER_CHUNKS_SUPPORTED - // Can't do this yet. libpng has a crash bug with unknown (user) chunks. +#ifdef MODPNG14_USER_CHUNKS_SUPPORTED + // Can't do this yet. libmodpng14 has a crash bug with unknown (user) chunks. // Warwick has sent them a patch. - // png_set_read_user_chunk_fn(png_ptr, 0, user_chunk_callback); - // png_set_keep_unknown_chunks(png_ptr, 2/*HANDLE_CHUNK_IF_SAFE*/, 0, 0); + // modpng14_set_read_user_chunk_fn(modpng14_ptr, 0, user_chunk_callback); + // modpng14_set_keep_unknown_chunks(modpng14_ptr, 2/*HANDLE_CHUNK_IF_SAFE*/, 0, 0); #endif if ( state != MovieStart && *buffer != 0211 ) { // Good, no signature - the preferred way to concat PNG images. // Skip them. - png_set_sig_bytes(png_ptr, 8); + modpng14_set_sig_bytes(modpng14_ptr, 8); } state = Inside; } - if ( !png_ptr ) return 0; + if ( !modpng14_ptr ) return 0; - if (setjmp(png_ptr->jmpbuf)) { - png_destroy_read_struct(&png_ptr, &info_ptr, 0); + if (setjmp(modpng14_ptr->jmpbuf)) { + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, 0); image = 0; state = MovieStart; return -1; } unused_data = 0; - png_process_data(png_ptr, info_ptr, (png_bytep)buffer, length); + modpng14_process_data(modpng14_ptr, info_ptr, (modpng14_bytep)buffer, length); int l = length - unused_data; // TODO: send incremental stuff to consumer (optional) if ( state != Inside ) { - if ( png_ptr ) - png_destroy_read_struct(&png_ptr, &info_ptr, 0); + if ( modpng14_ptr ) + modpng14_destroy_read_struct(&modpng14_ptr, &info_ptr, 0); } image = 0; return l; } -void QPNGFormat::info(png_structp png, png_infop) +void QPNGFormat::info(modpng14_structp png, modpng14_infop) { - png_set_interlace_handling(png); + modpng14_set_interlace_handling(png); setup_qt(*image, png, info_ptr); } -void QPNGFormat::row(png_structp png, png_bytep new_row, - png_uint_32 row_num, int) +void QPNGFormat::row(modpng14_structp png, modpng14_bytep new_row, + modpng14_uint_32 row_num, int) { uchar* old_row = image->scanLine(row_num); - png_progressive_combine_row(png, old_row, new_row); + modpng14_progressive_combine_row(png, old_row, new_row); } -void QPNGFormat::end(png_structp png, png_infop info) +void QPNGFormat::end(modpng14_structp png, modpng14_infop info) { - int offx = png_get_x_offset_pixels(png,info) - base_offx; - int offy = png_get_y_offset_pixels(png,info) - base_offy; + int offx = modpng14_get_x_offset_pixels(png,info) - base_offx; + int offy = modpng14_get_y_offset_pixels(png,info) - base_offy; if ( first_frame ) { base_offx = offx; base_offy = offy; first_frame = 0; } image->setOffset(QPoint(offx,offy)); - image->setDotsPerMeterX(png_get_x_pixels_per_meter(png,info)); - image->setDotsPerMeterY(png_get_y_pixels_per_meter(png,info)); + image->setDotsPerMeterX(modpng14_get_x_pixels_per_meter(png,info)); + image->setDotsPerMeterY(modpng14_get_y_pixels_per_meter(png,info)); #ifndef QT_NO_IMAGE_TEXT - png_textp text_ptr; + modpng14_textp text_ptr; int num_text=0; - png_get_text(png,info,&text_ptr,&num_text); + modpng14_get_text(png,info,&text_ptr,&num_text); while (num_text--) { image->setText(text_ptr->key,0,text_ptr->text); text_ptr++; @@ -1120,14 +1120,14 @@ consumer->frameDone(QPoint(offx,offy),r); consumer->end(); state = FrameStart; - unused_data = (int)png->buffer_size; // Since libpng doesn't tell us + unused_data = (int)png->buffer_size; // Since libmodpng14 doesn't tell us } -#ifdef PNG_USER_CHUNKS_SUPPORTED +#ifdef MODPNG14_USER_CHUNKS_SUPPORTED /* #ifndef QT_NO_IMAGE_TEXT -static bool skip(png_uint_32& max, png_bytep& data) +static bool skip(modpng14_uint_32& max, modpng14_bytep& data) { while (*data) { if ( !max ) return FALSE; @@ -1142,8 +1142,8 @@ #endif */ -int QPNGFormat::user_chunk(png_structp png, - png_bytep data, png_uint_32 length) +int QPNGFormat::user_chunk(modpng14_structp png, + modpng14_bytep data, modpng14_uint_32 length) { #if 0 // NOT SUPPORTED: experimental PNG animation. // qDebug("Got %ld-byte %s chunk", length, png->chunk_name); @@ -1173,7 +1173,7 @@ #ifndef QT_NO_IMAGE_TEXT /* - libpng now supports this chunk. + libmodpng14 now supports this chunk. if ( 0==qstrcmp((char*)png->chunk_name, "iTXt") && length>=6 ) { @@ -1224,8 +1224,8 @@ { if ( !done ) { done = TRUE; - QImageIO::defineIOHandler( "PNG", "^.PNG\r", 0, read_png_image, - write_png_image); + QImageIO::defineIOHandler( "PNG", "^.PNG\r", 0, read_modpng14_image, + write_modpng14_image); #ifndef QT_NO_ASYNC_IMAGE_IO globalPngFormatTypeObject = new QPNGFormatType; #endif --- qt-x11-free-3.3.8b.old/src/kernel/qt_gfx.pri +++ qt-x11-free-3.3.8b/src/kernel/qt_gfx.pri @@ -102,25 +102,25 @@ SOURCES+=$$KERNEL_CPP/qpngio.cpp png { system-png { - unix:LIBS += -lpng - win32:LIBS += libpng.lib + unix:LIBS += -lmodpng14 + win32:LIBS += libmodpng14.lib } else { - INCLUDEPATH += 3rdparty/libpng - SOURCES += 3rdparty/libpng/png.c \ - 3rdparty/libpng/pngerror.c \ - 3rdparty/libpng/pngget.c \ - 3rdparty/libpng/pngmem.c \ - 3rdparty/libpng/pngpread.c \ - 3rdparty/libpng/pngread.c \ - 3rdparty/libpng/pngrio.c \ - 3rdparty/libpng/pngrtran.c \ - 3rdparty/libpng/pngrutil.c \ - 3rdparty/libpng/pngset.c \ - 3rdparty/libpng/pngtrans.c \ - 3rdparty/libpng/pngwio.c \ - 3rdparty/libpng/pngwrite.c \ - 3rdparty/libpng/pngwtran.c \ - 3rdparty/libpng/pngwutil.c + INCLUDEPATH += 3rdparty/libmodpng14 + SOURCES += 3rdparty/libmodpng14/png.c \ + 3rdparty/libmodpng14/pngerror.c \ + 3rdparty/libmodpng14/pngget.c \ + 3rdparty/libmodpng14/pngmem.c \ + 3rdparty/libmodpng14/pngpread.c \ + 3rdparty/libmodpng14/pngread.c \ + 3rdparty/libmodpng14/pngrio.c \ + 3rdparty/libmodpng14/pngrtran.c \ + 3rdparty/libmodpng14/pngrutil.c \ + 3rdparty/libmodpng14/pngset.c \ + 3rdparty/libmodpng14/pngtrans.c \ + 3rdparty/libmodpng14/pngwio.c \ + 3rdparty/libmodpng14/pngwrite.c \ + 3rdparty/libmodpng14/pngwtran.c \ + 3rdparty/libmodpng14/pngwutil.c } } else:DEFINES += QT_NO_IMAGEIO_PNG --- qt-x11-free-3.3.8b.old/tools/qvfb/qanimationwriter.cpp +++ qt-x11-free-3.3.8b/tools/qvfb/qanimationwriter.cpp @@ -36,7 +36,7 @@ #define QT_CLEAN_NAMESPACE #include -#include +#include #include // for htonl class QAnimationWriterData { @@ -59,8 +59,8 @@ class QAnimationWriterMNG : public QAnimationWriterData { bool first; - png_structp png_ptr; - png_infop info_ptr; + modpng14_structp modpng14_ptr; + modpng14_infop info_ptr; public: QAnimationWriterMNG(QIODevice* d) : QAnimationWriterData(d) { @@ -81,55 +81,55 @@ void begin_png() { - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,0,0,0); - info_ptr = png_create_info_struct(png_ptr); - png_set_compression_level(png_ptr,9); - png_set_write_fn(png_ptr, (void*)this, write, 0); + modpng14_ptr = modpng14_create_write_struct(MODPNG14_LIBMODPNG14_VER_STRING,0,0,0); + info_ptr = modpng14_create_info_struct(modpng14_ptr); + modpng14_set_compression_level(modpng14_ptr,9); + modpng14_set_write_fn(modpng14_ptr, (void*)this, write, 0); } void end_png() { - png_destroy_write_struct(&png_ptr, &info_ptr); + modpng14_destroy_write_struct(&modpng14_ptr, &info_ptr); } - static void write( png_structp png_ptr, png_bytep data, png_size_t length) + static void write( modpng14_structp modpng14_ptr, modpng14_bytep data, modpng14_size_t length) { - QAnimationWriterMNG* that = (QAnimationWriterMNG*)png_get_io_ptr(png_ptr); + QAnimationWriterMNG* that = (QAnimationWriterMNG*)modpng14_get_io_ptr(modpng14_ptr); /*uint nw =*/ that->dev->writeBlock((const char*)data,length); } void writePNG(const QImage& image) { info_ptr->channels = 4; - png_set_sig_bytes(png_ptr, 8); // Pretend we already wrote the sig - png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(), + modpng14_set_sig_bytes(modpng14_ptr, 8); // Pretend we already wrote the sig + modpng14_set_IHDR(modpng14_ptr, info_ptr, image.width(), image.height(), 8, image.hasAlphaBuffer() - ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB, + ? MODPNG14_COLOR_TYPE_RGB_ALPHA : MODPNG14_COLOR_TYPE_RGB, 0, 0, 0); - png_write_info(png_ptr, info_ptr); + modpng14_write_info(modpng14_ptr, info_ptr); if ( !image.hasAlphaBuffer() ) - png_set_filler(png_ptr, 0, + modpng14_set_filler(modpng14_ptr, 0, QImage::systemByteOrder() == QImage::BigEndian ? - PNG_FILLER_BEFORE : PNG_FILLER_AFTER); + MODPNG14_FILLER_BEFORE : MODPNG14_FILLER_AFTER); //if ( QImage::systemByteOrder() == QImage::BigEndian ) { - //png_set_swap_alpha(png_ptr); + //modpng14_set_swap_alpha(modpng14_ptr); //} if ( QImage::systemByteOrder() == QImage::LittleEndian ) { - png_set_bgr(png_ptr); + modpng14_set_bgr(modpng14_ptr); } - png_bytep* row_pointers; + modpng14_bytep* row_pointers; uint height = image.height(); uchar** jt = image.jumpTable(); - row_pointers=new png_bytep[height]; + row_pointers=new modpng14_bytep[height]; uint y; for (y=0; y