png.h

Go to the documentation of this file.
00001 
00002 /* png.h - header file for PNG reference library
00003  *
00004  * libpng version 1.2.23 - November 6, 2007
00005  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
00006  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
00007  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
00008  *
00009  * Authors and maintainers:
00010  *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
00011  *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
00012  *  libpng versions 0.97, January 1998, through 1.2.23 - November 6, 2007: Glenn
00013  *  See also "Contributing Authors", below.
00014  *
00015  * Note about libpng version numbers:
00016  *
00017  *    Due to various miscommunications, unforeseen code incompatibilities
00018  *    and occasional factors outside the authors' control, version numbering
00019  *    on the library has not always been consistent and straightforward.
00020  *    The following table summarizes matters since version 0.89c, which was
00021  *    the first widely used release:
00022  *
00023  *    source                 png.h  png.h  shared-lib
00024  *    version                string   int  version
00025  *    -------                ------ -----  ----------
00026  *    0.89c "1.0 beta 3"     0.89      89  1.0.89
00027  *    0.90  "1.0 beta 4"     0.90      90  0.90  [should have been 2.0.90]
00028  *    0.95  "1.0 beta 5"     0.95      95  0.95  [should have been 2.0.95]
00029  *    0.96  "1.0 beta 6"     0.96      96  0.96  [should have been 2.0.96]
00030  *    0.97b "1.00.97 beta 7" 1.00.97   97  1.0.1 [should have been 2.0.97]
00031  *    0.97c                  0.97      97  2.0.97
00032  *    0.98                   0.98      98  2.0.98
00033  *    0.99                   0.99      98  2.0.99
00034  *    0.99a-m                0.99      99  2.0.99
00035  *    1.00                   1.00     100  2.1.0 [100 should be 10000]
00036  *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]
00037  *    1.0.1       png.h string is   10001  2.1.0
00038  *    1.0.1a-e    identical to the  10002  from here on, the shared library
00039  *    1.0.2       source version)   10002  is 2.V where V is the source code
00040  *    1.0.2a-b                      10003  version, except as noted.
00041  *    1.0.3                         10003
00042  *    1.0.3a-d                      10004
00043  *    1.0.4                         10004
00044  *    1.0.4a-f                      10005
00045  *    1.0.5 (+ 2 patches)           10005
00046  *    1.0.5a-d                      10006
00047  *    1.0.5e-r                      10100 (not source compatible)
00048  *    1.0.5s-v                      10006 (not binary compatible)
00049  *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)
00050  *    1.0.6d-f                      10007 (still binary incompatible)
00051  *    1.0.6g                        10007
00052  *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)
00053  *    1.0.6i                        10007  10.6i
00054  *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)
00055  *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)
00056  *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)
00057  *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)
00058  *    1.0.7                    1    10007  (still compatible)
00059  *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4
00060  *    1.0.8rc1                 1    10008  2.1.0.8rc1
00061  *    1.0.8                    1    10008  2.1.0.8
00062  *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6
00063  *    1.0.9rc1                 1    10009  2.1.0.9rc1
00064  *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10
00065  *    1.0.9rc2                 1    10009  2.1.0.9rc2
00066  *    1.0.9                    1    10009  2.1.0.9
00067  *    1.0.10beta1              1    10010  2.1.0.10beta1
00068  *    1.0.10rc1                1    10010  2.1.0.10rc1
00069  *    1.0.10                   1    10010  2.1.0.10
00070  *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3
00071  *    1.0.11rc1                1    10011  2.1.0.11rc1
00072  *    1.0.11                   1    10011  2.1.0.11
00073  *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2
00074  *    1.0.12rc1                2    10012  2.1.0.12rc1
00075  *    1.0.12                   2    10012  2.1.0.12
00076  *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)
00077  *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2
00078  *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5
00079  *    1.2.0rc1                 3    10200  3.1.2.0rc1
00080  *    1.2.0                    3    10200  3.1.2.0
00081  *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4
00082  *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2
00083  *    1.2.1                    3    10201  3.1.2.1
00084  *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6
00085  *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1
00086  *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1
00087  *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1
00088  *    1.0.13                  10    10013  10.so.0.1.0.13
00089  *    1.2.2                   12    10202  12.so.0.1.2.2
00090  *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6
00091  *    1.2.3                   12    10203  12.so.0.1.2.3
00092  *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3
00093  *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1
00094  *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1
00095  *    1.0.14                  10    10014  10.so.0.1.0.14
00096  *    1.2.4                   13    10204  12.so.0.1.2.4
00097  *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2
00098  *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3
00099  *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3
00100  *    1.0.15                  10    10015  10.so.0.1.0.15
00101  *    1.2.5                   13    10205  12.so.0.1.2.5
00102  *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4
00103  *    1.0.16                  10    10016  10.so.0.1.0.16
00104  *    1.2.6                   13    10206  12.so.0.1.2.6
00105  *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2
00106  *    1.0.17rc1               10    10017  10.so.0.1.0.17rc1
00107  *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1
00108  *    1.0.17                  10    10017  10.so.0.1.0.17
00109  *    1.2.7                   13    10207  12.so.0.1.2.7
00110  *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5
00111  *    1.0.18rc1-5             10    10018  10.so.0.1.0.18rc1-5
00112  *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5
00113  *    1.0.18                  10    10018  10.so.0.1.0.18
00114  *    1.2.8                   13    10208  12.so.0.1.2.8
00115  *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3
00116  *    1.2.9beta4-11           13    10209  12.so.0.9[.0]
00117  *    1.2.9rc1                13    10209  12.so.0.9[.0]
00118  *    1.2.9                   13    10209  12.so.0.9[.0]
00119  *    1.2.10beta1-8           13    10210  12.so.0.10[.0]
00120  *    1.2.10rc1-3             13    10210  12.so.0.10[.0]
00121  *    1.2.10                  13    10210  12.so.0.10[.0]
00122  *    1.2.11beta1-4           13    10211  12.so.0.11[.0]
00123  *    1.0.19rc1-5             10    10019  10.so.0.19[.0]
00124  *    1.2.11rc1-5             13    10211  12.so.0.11[.0]
00125  *    1.0.19                  10    10019  10.so.0.19[.0]
00126  *    1.2.11                  13    10211  12.so.0.11[.0]
00127  *    1.0.20                  10    10020  10.so.0.20[.0]
00128  *    1.2.12                  13    10212  12.so.0.12[.0]
00129  *    1.2.13beta1             13    10213  12.so.0.13[.0]
00130  *    1.0.21                  10    10021  10.so.0.21[.0]
00131  *    1.2.13                  13    10213  12.so.0.13[.0]
00132  *    1.2.14beta1-2           13    10214  12.so.0.14[.0]
00133  *    1.0.22rc1               10    10022  10.so.0.22[.0]
00134  *    1.2.14rc1               13    10214  12.so.0.14[.0]
00135  *    1.0.22                  10    10022  10.so.0.22[.0]
00136  *    1.2.14                  13    10214  12.so.0.14[.0]
00137  *    1.2.15beta1-6           13    10215  12.so.0.15[.0]
00138  *    1.0.23rc1-5             10    10023  10.so.0.23[.0]
00139  *    1.2.15rc1-5             13    10215  12.so.0.15[.0]
00140  *    1.0.23                  10    10023  10.so.0.23[.0]
00141  *    1.2.15                  13    10215  12.so.0.15[.0]
00142  *    1.2.16beta1-2           13    10216  12.so.0.16[.0]
00143  *    1.2.16rc1               13    10216  12.so.0.16[.0]
00144  *    1.0.24                  10    10024  10.so.0.24[.0]
00145  *    1.2.16                  13    10216  12.so.0.16[.0]
00146  *    1.2.17beta1-2           13    10217  12.so.0.17[.0]
00147  *    1.0.25rc1               10    10025  10.so.0.25[.0]
00148  *    1.2.17rc1-3             13    10217  12.so.0.17[.0]
00149  *    1.0.25                  10    10025  10.so.0.25[.0]
00150  *    1.2.17                  13    10217  12.so.0.17[.0]
00151  *    1.0.26                  10    10026  10.so.0.26[.0]
00152  *    1.2.18                  13    10218  12.so.0.18[.0]
00153  *    1.2.19beta1-31          13    10219  12.so.0.19[.0]
00154  *    1.0.27rc1-6             10    10027  10.so.0.27[.0]
00155  *    1.2.19rc1-6             13    10219  12.so.0.19[.0]
00156  *    1.0.27                  10    10027  10.so.0.27[.0]
00157  *    1.2.19                  13    10219  12.so.0.19[.0]
00158  *    1.2.20beta01-04         13    10220  12.so.0.20[.0]
00159  *    1.0.28rc1-6             10    10028  10.so.0.28[.0]
00160  *    1.2.20rc1-6             13    10220  12.so.0.20[.0]
00161  *    1.0.28                  10    10028  10.so.0.28[.0]
00162  *    1.2.20                  13    10220  12.so.0.20[.0]
00163  *    1.2.21beta1-2           13    10221  12.so.0.21[.0]
00164  *    1.2.21rc1-3             13    10221  12.so.0.21[.0]
00165  *    1.0.29                  10    10029  10.so.0.29[.0]
00166  *    1.2.21                  13    10221  12.so.0.21[.0]
00167  *    1.2.22beta1-4           13    10222  12.so.0.22[.0]
00168  *    1.0.30rc1               10    10030  10.so.0.30[.0]
00169  *    1.2.22rc1               13    10222  12.so.0.22[.0]
00170  *    1.0.30                  10    10030  10.so.0.30[.0]
00171  *    1.2.22                  13    10222  12.so.0.22[.0]
00172  *    1.2.23beta01-05         13    10223  12.so.0.23[.0]
00173  *    1.2.23rc01              13    10223  12.so.0.23[.0]
00174  *    1.2.23                  13    10223  12.so.0.23[.0]
00175  *
00176  *    Henceforth the source version will match the shared-library major
00177  *    and minor numbers; the shared-library major version number will be
00178  *    used for changes in backward compatibility, as it is intended.  The
00179  *    PNG_LIBPNG_VER macro, which is not used within libpng but is available
00180  *    for applications, is an unsigned integer of the form xyyzz corresponding
00181  *    to the source version x.y.z (leading zeros in y and z).  Beta versions
00182  *    were given the previous public release number plus a letter, until
00183  *    version 1.0.6j; from then on they were given the upcoming public
00184  *    release number plus "betaNN" or "rcN".
00185  *
00186  *    Binary incompatibility exists only when applications make direct access
00187  *    to the info_ptr or png_ptr members through png.h, and the compiled
00188  *    application is loaded with a different version of the library.
00189  *
00190  *    DLLNUM will change each time there are forward or backward changes
00191  *    in binary compatibility (e.g., when a new feature is added).
00192  *
00193  * See libpng.txt or libpng.3 for more information.  The PNG specification
00194  * is available as a W3C Recommendation and as an ISO Specification,
00195  * <http://www.w3.org/TR/2003/REC-PNG-20031110/
00196  */
00197 
00198 /*
00199  * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
00200  *
00201  * If you modify libpng you may insert additional notices immediately following
00202  * this sentence.
00203  *
00204  * libpng versions 1.2.6, August 15, 2004, through 1.2.23, November 6, 2007, are
00205  * Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
00206  * distributed according to the same disclaimer and license as libpng-1.2.5
00207  * with the following individual added to the list of Contributing Authors:
00208  *
00209  *    Cosmin Truta
00210  *
00211  * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
00212  * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
00213  * distributed according to the same disclaimer and license as libpng-1.0.6
00214  * with the following individuals added to the list of Contributing Authors:
00215  *
00216  *    Simon-Pierre Cadieux
00217  *    Eric S. Raymond
00218  *    Gilles Vollant
00219  *
00220  * and with the following additions to the disclaimer:
00221  *
00222  *    There is no warranty against interference with your enjoyment of the
00223  *    library or against infringement.  There is no warranty that our
00224  *    efforts or the library will fulfill any of your particular purposes
00225  *    or needs.  This library is provided with all faults, and the entire
00226  *    risk of satisfactory quality, performance, accuracy, and effort is with
00227  *    the user.
00228  *
00229  * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
00230  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
00231  * distributed according to the same disclaimer and license as libpng-0.96,
00232  * with the following individuals added to the list of Contributing Authors:
00233  *
00234  *    Tom Lane
00235  *    Glenn Randers-Pehrson
00236  *    Willem van Schaik
00237  *
00238  * libpng versions 0.89, June 1996, through 0.96, May 1997, are
00239  * Copyright (c) 1996, 1997 Andreas Dilger
00240  * Distributed according to the same disclaimer and license as libpng-0.88,
00241  * with the following individuals added to the list of Contributing Authors:
00242  *
00243  *    John Bowler
00244  *    Kevin Bracey
00245  *    Sam Bushell
00246  *    Magnus Holmgren
00247  *    Greg Roelofs
00248  *    Tom Tanner
00249  *
00250  * libpng versions 0.5, May 1995, through 0.88, January 1996, are
00251  * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
00252  *
00253  * For the purposes of this copyright and license, "Contributing Authors"
00254  * is defined as the following set of individuals:
00255  *
00256  *    Andreas Dilger
00257  *    Dave Martindale
00258  *    Guy Eric Schalnat
00259  *    Paul Schmidt
00260  *    Tim Wegner
00261  *
00262  * The PNG Reference Library is supplied "AS IS".  The Contributing Authors
00263  * and Group 42, Inc. disclaim all warranties, expressed or implied,
00264  * including, without limitation, the warranties of merchantability and of
00265  * fitness for any purpose.  The Contributing Authors and Group 42, Inc.
00266  * assume no liability for direct, indirect, incidental, special, exemplary,
00267  * or consequential damages, which may result from the use of the PNG
00268  * Reference Library, even if advised of the possibility of such damage.
00269  *
00270  * Permission is hereby granted to use, copy, modify, and distribute this
00271  * source code, or portions hereof, for any purpose, without fee, subject
00272  * to the following restrictions:
00273  *
00274  * 1. The origin of this source code must not be misrepresented.
00275  *
00276  * 2. Altered versions must be plainly marked as such and
00277  * must not be misrepresented as being the original source.
00278  *
00279  * 3. This Copyright notice may not be removed or altered from
00280  *    any source or altered source distribution.
00281  *
00282  * The Contributing Authors and Group 42, Inc. specifically permit, without
00283  * fee, and encourage the use of this source code as a component to
00284  * supporting the PNG file format in commercial products.  If you use this
00285  * source code in a product, acknowledgment is not required but would be
00286  * appreciated.
00287  */
00288 
00289 /*
00290  * A "png_get_copyright" function is available, for convenient use in "about"
00291  * boxes and the like:
00292  *
00293  * printf("%s",png_get_copyright(NULL));
00294  *
00295  * Also, the PNG logo (in PNG format, of course) is supplied in the
00296  * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
00297  */
00298 
00299 /*
00300  * Libpng is OSI Certified Open Source Software.  OSI Certified is a
00301  * certification mark of the Open Source Initiative.
00302  */
00303 
00304 /*
00305  * The contributing authors would like to thank all those who helped
00306  * with testing, bug fixes, and patience.  This wouldn't have been
00307  * possible without all of you.
00308  *
00309  * Thanks to Frank J. T. Wojcik for helping with the documentation.
00310  */
00311 
00312 /*
00313  * Y2K compliance in libpng:
00314  * =========================
00315  *
00316  *    November 6, 2007
00317  *
00318  *    Since the PNG Development group is an ad-hoc body, we can't make
00319  *    an official declaration.
00320  *
00321  *    This is your unofficial assurance that libpng from version 0.71 and
00322  *    upward through 1.2.23 are Y2K compliant.  It is my belief that earlier
00323  *    versions were also Y2K compliant.
00324  *
00325  *    Libpng only has three year fields.  One is a 2-byte unsigned integer
00326  *    that will hold years up to 65535.  The other two hold the date in text
00327  *    format, and will hold years up to 9999.
00328  *
00329  *    The integer is
00330  *        "png_uint_16 year" in png_time_struct.
00331  *
00332  *    The strings are
00333  *        "png_charp time_buffer" in png_struct and
00334  *        "near_time_buffer", which is a local character string in png.c.
00335  *
00336  *    There are seven time-related functions:
00337  *        png.c: png_convert_to_rfc_1123() in png.c
00338  *          (formerly png_convert_to_rfc_1152() in error)
00339  *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
00340  *        png_convert_from_time_t() in pngwrite.c
00341  *        png_get_tIME() in pngget.c
00342  *        png_handle_tIME() in pngrutil.c, called in pngread.c
00343  *        png_set_tIME() in pngset.c
00344  *        png_write_tIME() in pngwutil.c, called in pngwrite.c
00345  *
00346  *    All handle dates properly in a Y2K environment.  The
00347  *    png_convert_from_time_t() function calls gmtime() to convert from system
00348  *    clock time, which returns (year - 1900), which we properly convert to
00349  *    the full 4-digit year.  There is a possibility that applications using
00350  *    libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
00351  *    function, or that they are incorrectly passing only a 2-digit year
00352  *    instead of "year - 1900" into the png_convert_from_struct_tm() function,
00353  *    but this is not under our control.  The libpng documentation has always
00354  *    stated that it works with 4-digit years, and the APIs have been
00355  *    documented as such.
00356  *
00357  *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned
00358  *    integer to hold the year, and can hold years as large as 65535.
00359  *
00360  *    zlib, upon which libpng depends, is also Y2K compliant.  It contains
00361  *    no date-related code.
00362  *
00363  *       Glenn Randers-Pehrson
00364  *       libpng maintainer
00365  *       PNG Development Group
00366  */
00367 
00368 #ifndef PNG_H
00369 #define PNG_H
00370 
00371 /* This is not the place to learn how to use libpng.  The file libpng.txt
00372  * describes how to use libpng, and the file example.c summarizes it
00373  * with some code on which to build.  This file is useful for looking
00374  * at the actual function definitions and structure components.
00375  */
00376 
00377 /* Version information for png.h - this should match the version in png.c */
00378 #define PNG_LIBPNG_VER_STRING "1.2.23"
00379 #define PNG_HEADER_VERSION_STRING \
00380    " libpng version 1.2.23 - November 6, 2007\n"
00381 
00382 #define PNG_LIBPNG_VER_SONUM   0
00383 #define PNG_LIBPNG_VER_DLLNUM  13
00384 
00385 /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
00386 #define PNG_LIBPNG_VER_MAJOR   1
00387 #define PNG_LIBPNG_VER_MINOR   2
00388 #define PNG_LIBPNG_VER_RELEASE 23
00389 /* This should match the numeric part of the final component of
00390  * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
00391 
00392 #define PNG_LIBPNG_VER_BUILD  0
00393 
00394 /* Release Status */
00395 #define PNG_LIBPNG_BUILD_ALPHA    1
00396 #define PNG_LIBPNG_BUILD_BETA     2
00397 #define PNG_LIBPNG_BUILD_RC       3
00398 #define PNG_LIBPNG_BUILD_STABLE   4
00399 #define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
00400   
00401 /* Release-Specific Flags */
00402 #define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with
00403                                        PNG_LIBPNG_BUILD_STABLE only */
00404 #define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with
00405                                        PNG_LIBPNG_BUILD_SPECIAL */
00406 #define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
00407                                        PNG_LIBPNG_BUILD_PRIVATE */
00408 
00409 #define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
00410 
00411 /* Careful here.  At one time, Guy wanted to use 082, but that would be octal.
00412  * We must not include leading zeros.
00413  * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
00414  * version 1.0.0 was mis-numbered 100 instead of 10000).  From
00415  * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release */
00416 #define PNG_LIBPNG_VER 10223 /* 1.2.23 */
00417 
00418 #ifndef PNG_VERSION_INFO_ONLY
00419 /* include the compression library's header */
00420 # ifdef _WIN32
00421 #  include "..\zlib\zlib.h"
00422 # else
00423 #  include "zlib.h"
00424 # endif
00425 #endif
00426 
00427 /* include all user configurable info, including optional assembler routines */
00428 #include "pngconf.h"
00429 
00430 /*
00431  * Added at libpng-1.2.8 */
00432 /* Ref MSDN: Private as priority over Special
00433  * VS_FF_PRIVATEBUILD File *was not* built using standard release
00434  * procedures. If this value is given, the StringFileInfo block must
00435  * contain a PrivateBuild string. 
00436  *
00437  * VS_FF_SPECIALBUILD File *was* built by the original company using
00438  * standard release procedures but is a variation of the standard
00439  * file of the same version number. If this value is given, the
00440  * StringFileInfo block must contain a SpecialBuild string. 
00441  */
00442 
00443 #if defined(PNG_USER_PRIVATEBUILD)
00444 #  define PNG_LIBPNG_BUILD_TYPE \
00445           (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
00446 #else
00447 #  if defined(PNG_LIBPNG_SPECIALBUILD)
00448 #    define PNG_LIBPNG_BUILD_TYPE \
00449             (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
00450 #  else
00451 #    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
00452 #  endif
00453 #endif
00454 
00455 #ifndef PNG_VERSION_INFO_ONLY
00456 
00457 /* Inhibit C++ name-mangling for libpng functions but not for system calls. */
00458 #ifdef __cplusplus
00459 extern "C" {
00460 #endif /* __cplusplus */
00461 
00462 /* This file is arranged in several sections.  The first section contains
00463  * structure and type definitions.  The second section contains the external
00464  * library functions, while the third has the internal library functions,
00465  * which applications aren't expected to use directly.
00466  */
00467 
00468 #ifndef PNG_NO_TYPECAST_NULL
00469 #define int_p_NULL                (int *)NULL
00470 #define png_bytep_NULL            (png_bytep)NULL
00471 #define png_bytepp_NULL           (png_bytepp)NULL
00472 #define png_doublep_NULL          (png_doublep)NULL
00473 #define png_error_ptr_NULL        (png_error_ptr)NULL
00474 #define png_flush_ptr_NULL        (png_flush_ptr)NULL
00475 #define png_free_ptr_NULL         (png_free_ptr)NULL
00476 #define png_infopp_NULL           (png_infopp)NULL
00477 #define png_malloc_ptr_NULL       (png_malloc_ptr)NULL
00478 #define png_read_status_ptr_NULL  (png_read_status_ptr)NULL
00479 #define png_rw_ptr_NULL           (png_rw_ptr)NULL
00480 #define png_structp_NULL          (png_structp)NULL
00481 #define png_uint_16p_NULL         (png_uint_16p)NULL
00482 #define png_voidp_NULL            (png_voidp)NULL
00483 #define png_write_status_ptr_NULL (png_write_status_ptr)NULL
00484 #else
00485 #define int_p_NULL                NULL
00486 #define png_bytep_NULL            NULL
00487 #define png_bytepp_NULL           NULL
00488 #define png_doublep_NULL          NULL
00489 #define png_error_ptr_NULL        NULL
00490 #define png_flush_ptr_NULL        NULL
00491 #define png_free_ptr_NULL         NULL
00492 #define png_infopp_NULL           NULL
00493 #define png_malloc_ptr_NULL       NULL
00494 #define png_read_status_ptr_NULL  NULL
00495 #define png_rw_ptr_NULL           NULL
00496 #define png_structp_NULL          NULL
00497 #define png_uint_16p_NULL         NULL
00498 #define png_voidp_NULL            NULL
00499 #define png_write_status_ptr_NULL NULL
00500 #endif
00501 
00502 /* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
00503 #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
00504 /* Version information for C files, stored in png.c.  This had better match
00505  * the version above.
00506  */
00507 #ifdef PNG_USE_GLOBAL_ARRAYS
00508 PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18];
00509   /* need room for 99.99.99beta99z */
00510 #else
00511 #define png_libpng_ver png_get_header_ver(NULL)
00512 #endif
00513 
00514 #ifdef PNG_USE_GLOBAL_ARRAYS
00515 /* This was removed in version 1.0.5c */
00516 /* Structures to facilitate easy interlacing.  See png.c for more details */
00517 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_start[7];
00518 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_inc[7];
00519 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_ystart[7];
00520 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_yinc[7];
00521 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_mask[7];
00522 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_dsp_mask[7];
00523 /* This isn't currently used.  If you need it, see png.c for more details.
00524 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_height[7];
00525 */
00526 #endif
00527 
00528 #endif /* PNG_NO_EXTERN */
00529 
00530 /* Three color definitions.  The order of the red, green, and blue, (and the
00531  * exact size) is not important, although the size of the fields need to
00532  * be png_byte or png_uint_16 (as defined below).
00533  */
00534 typedef struct png_color_struct
00535 {
00536    png_byte red;
00537    png_byte green;
00538    png_byte blue;
00539 } png_color;
00540 typedef png_color FAR * png_colorp;
00541 typedef png_color FAR * FAR * png_colorpp;
00542 
00543 typedef struct png_color_16_struct
00544 {
00545    png_byte index;    /* used for palette files */
00546    png_uint_16 red;   /* for use in red green blue files */
00547    png_uint_16 green;
00548    png_uint_16 blue;
00549    png_uint_16 gray;  /* for use in grayscale files */
00550 } png_color_16;
00551 typedef png_color_16 FAR * png_color_16p;
00552 typedef png_color_16 FAR * FAR * png_color_16pp;
00553 
00554 typedef struct png_color_8_struct
00555 {
00556    png_byte red;   /* for use in red green blue files */
00557    png_byte green;
00558    png_byte blue;
00559    png_byte gray;  /* for use in grayscale files */
00560    png_byte alpha; /* for alpha channel files */
00561 } png_color_8;
00562 typedef png_color_8 FAR * png_color_8p;
00563 typedef png_color_8 FAR * FAR * png_color_8pp;
00564 
00565 /*
00566  * The following two structures are used for the in-core representation
00567  * of sPLT chunks.
00568  */
00569 typedef struct png_sPLT_entry_struct
00570 {
00571    png_uint_16 red;
00572    png_uint_16 green;
00573    png_uint_16 blue;
00574    png_uint_16 alpha;
00575    png_uint_16 frequency;
00576 } png_sPLT_entry;
00577 typedef png_sPLT_entry FAR * png_sPLT_entryp;
00578 typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
00579 
00580 /*  When the depth of the sPLT palette is 8 bits, the color and alpha samples
00581  *  occupy the LSB of their respective members, and the MSB of each member
00582  *  is zero-filled.  The frequency member always occupies the full 16 bits.
00583  */
00584 
00585 typedef struct png_sPLT_struct
00586 {
00587    png_charp name;           /* palette name */
00588    png_byte depth;           /* depth of palette samples */
00589    png_sPLT_entryp entries;  /* palette entries */
00590    png_int_32 nentries;      /* number of palette entries */
00591 } png_sPLT_t;
00592 typedef png_sPLT_t FAR * png_sPLT_tp;
00593 typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
00594 
00595 #ifdef PNG_TEXT_SUPPORTED
00596 /* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
00597  * and whether that contents is compressed or not.  The "key" field
00598  * points to a regular zero-terminated C string.  The "text", "lang", and
00599  * "lang_key" fields can be regular C strings, empty strings, or NULL pointers.
00600  * However, the * structure returned by png_get_text() will always contain
00601  * regular zero-terminated C strings (possibly empty), never NULL pointers,
00602  * so they can be safely used in printf() and other string-handling functions.
00603  */
00604 typedef struct png_text_struct
00605 {
00606    int  compression;       /* compression value:
00607                              -1: tEXt, none
00608                               0: zTXt, deflate
00609                               1: iTXt, none
00610                               2: iTXt, deflate  */
00611    png_charp key;          /* keyword, 1-79 character description of "text" */
00612    png_charp text;         /* comment, may be an empty string (ie "")
00613                               or a NULL pointer */
00614    png_size_t text_length; /* length of the text string */
00615 #ifdef PNG_iTXt_SUPPORTED
00616    png_size_t itxt_length; /* length of the itxt string */
00617    png_charp lang;         /* language code, 0-79 characters
00618                               or a NULL pointer */
00619    png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more
00620                               chars or a NULL pointer */
00621 #endif
00622 } png_text;
00623 typedef png_text FAR * png_textp;
00624 typedef png_text FAR * FAR * png_textpp;
00625 #endif
00626 
00627 /* Supported compression types for text in PNG files (tEXt, and zTXt).
00628  * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */
00629 #define PNG_TEXT_COMPRESSION_NONE_WR -3
00630 #define PNG_TEXT_COMPRESSION_zTXt_WR -2
00631 #define PNG_TEXT_COMPRESSION_NONE    -1
00632 #define PNG_TEXT_COMPRESSION_zTXt     0
00633 #define PNG_ITXT_COMPRESSION_NONE     1
00634 #define PNG_ITXT_COMPRESSION_zTXt     2
00635 #define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */
00636 
00637 /* png_time is a way to hold the time in an machine independent way.
00638  * Two conversions are provided, both from time_t and struct tm.  There
00639  * is no portable way to convert to either of these structures, as far
00640  * as I know.  If you know of a portable way, send it to me.  As a side
00641  * note - PNG has always been Year 2000 compliant!
00642  */
00643 typedef struct png_time_struct
00644 {
00645    png_uint_16 year; /* full year, as in, 1995 */
00646    png_byte month;   /* month of year, 1 - 12 */
00647    png_byte day;     /* day of month, 1 - 31 */
00648    png_byte hour;    /* hour of day, 0 - 23 */
00649    png_byte minute;  /* minute of hour, 0 - 59 */
00650    png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */
00651 } png_time;
00652 typedef png_time FAR * png_timep;
00653 typedef png_time FAR * FAR * png_timepp;
00654 
00655 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
00656 /* png_unknown_chunk is a structure to hold queued chunks for which there is
00657  * no specific support.  The idea is that we can use this to queue
00658  * up private chunks for output even though the library doesn't actually
00659  * know about their semantics.
00660  */
00661 #define PNG_CHUNK_NAME_LENGTH 5
00662 typedef struct png_unknown_chunk_t
00663 {
00664     png_byte name[PNG_CHUNK_NAME_LENGTH];
00665     png_byte *data;
00666     png_size_t size;
00667 
00668     /* libpng-using applications should NOT directly modify this byte. */
00669     png_byte location; /* mode of operation at read time */
00670 }
00671 png_unknown_chunk;
00672 typedef png_unknown_chunk FAR * png_unknown_chunkp;
00673 typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
00674 #endif
00675 
00676 /* png_info is a structure that holds the information in a PNG file so
00677  * that the application can find out the characteristics of the image.
00678  * If you are reading the file, this structure will tell you what is
00679  * in the PNG file.  If you are writing the file, fill in the information
00680  * you want to put into the PNG file, then call png_write_info().
00681  * The names chosen should be very close to the PNG specification, so
00682  * consult that document for information about the meaning of each field.
00683  *
00684  * With libpng < 0.95, it was only possible to directly set and read the
00685  * the values in the png_info_struct, which meant that the contents and
00686  * order of the values had to remain fixed.  With libpng 0.95 and later,
00687  * however, there are now functions that abstract the contents of
00688  * png_info_struct from the application, so this makes it easier to use
00689  * libpng with dynamic libraries, and even makes it possible to use
00690  * libraries that don't have all of the libpng ancillary chunk-handing
00691  * functionality.
00692  *
00693  * In any case, the order of the parameters in png_info_struct should NOT
00694  * be changed for as long as possible to keep compatibility with applications
00695  * that use the old direct-access method with png_info_struct.
00696  *
00697  * The following members may have allocated storage attached that should be
00698  * cleaned up before the structure is discarded: palette, trans, text,
00699  * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
00700  * splt_palettes, scal_unit, row_pointers, and unknowns.   By default, these
00701  * are automatically freed when the info structure is deallocated, if they were
00702  * allocated internally by libpng.  This behavior can be changed by means
00703  * of the png_data_freer() function.
00704  *
00705  * More allocation details: all the chunk-reading functions that
00706  * change these members go through the corresponding png_set_*
00707  * functions.  A function to clear these members is available: see
00708  * png_free_data().  The png_set_* functions do not depend on being
00709  * able to point info structure members to any of the storage they are
00710  * passed (they make their own copies), EXCEPT that the png_set_text
00711  * functions use the same storage passed to them in the text_ptr or
00712  * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
00713  * functions do not make their own copies.
00714  */
00715 typedef struct png_info_struct
00716 {
00717    /* the following are necessary for every PNG file */
00718    png_uint_32 width;       /* width of image in pixels (from IHDR) */
00719    png_uint_32 height;      /* height of image in pixels (from IHDR) */
00720    png_uint_32 valid;       /* valid chunk data (see PNG_INFO_ below) */
00721    png_uint_32 rowbytes;    /* bytes needed to hold an untransformed row */
00722    png_colorp palette;      /* array of color values (valid & PNG_INFO_PLTE) */
00723    png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
00724    png_uint_16 num_trans;   /* number of transparent palette color (tRNS) */
00725    png_byte bit_depth;      /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */
00726    png_byte color_type;     /* see PNG_COLOR_TYPE_ below (from IHDR) */
00727    /* The following three should have been named *_method not *_type */
00728    png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
00729    png_byte filter_type;    /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
00730    png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
00731 
00732    /* The following is informational only on read, and not used on writes. */
00733    png_byte channels;       /* number of data channels per pixel (1, 2, 3, 4) */
00734    png_byte pixel_depth;    /* number of bits per pixel */
00735    png_byte spare_byte;     /* to align the data, and for future use */
00736    png_byte signature[8];   /* magic bytes read by libpng from start of file */
00737 
00738    /* The rest of the data is optional.  If you are reading, check the
00739     * valid field to see if the information in these are valid.  If you
00740     * are writing, set the valid field to those chunks you want written,
00741     * and initialize the appropriate fields below.
00742     */
00743 
00744 #if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
00745    /* The gAMA chunk describes the gamma characteristics of the system
00746     * on which the image was created, normally in the range [1.0, 2.5].
00747     * Data is valid if (valid & PNG_INFO_gAMA) is non-zero.
00748     */
00749    float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */
00750 #endif
00751 
00752 #if defined(PNG_sRGB_SUPPORTED)
00753     /* GR-P, 0.96a */
00754     /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */
00755    png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */
00756 #endif
00757 
00758 #if defined(PNG_TEXT_SUPPORTED)
00759    /* The tEXt, and zTXt chunks contain human-readable textual data in
00760     * uncompressed, compressed, and optionally compressed forms, respectively.
00761     * The data in "text" is an array of pointers to uncompressed,
00762     * null-terminated C strings. Each chunk has a keyword that describes the
00763     * textual data contained in that chunk.  Keywords are not required to be
00764     * unique, and the text string may be empty.  Any number of text chunks may
00765     * be in an image.
00766     */
00767    int num_text; /* number of comments read/to write */
00768    int max_text; /* current size of text array */
00769    png_textp text; /* array of comments read/to write */
00770 #endif /* PNG_TEXT_SUPPORTED */
00771 
00772 #if defined(PNG_tIME_SUPPORTED)
00773    /* The tIME chunk holds the last time the displayed image data was
00774     * modified.  See the png_time struct for the contents of this struct.
00775     */
00776    png_time mod_time;
00777 #endif
00778 
00779 #if defined(PNG_sBIT_SUPPORTED)
00780    /* The sBIT chunk specifies the number of significant high-order bits
00781     * in the pixel data.  Values are in the range [1, bit_depth], and are
00782     * only specified for the channels in the pixel data.  The contents of
00783     * the low-order bits is not specified.  Data is valid if
00784     * (valid & PNG_INFO_sBIT) is non-zero.
00785     */
00786    png_color_8 sig_bit; /* significant bits in color channels */
00787 #endif
00788 
00789 #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \
00790 defined(PNG_READ_BACKGROUND_SUPPORTED)
00791    /* The tRNS chunk supplies transparency data for paletted images and
00792     * other image types that don't need a full alpha channel.  There are
00793     * "num_trans" transparency values for a paletted image, stored in the
00794     * same order as the palette colors, starting from index 0.  Values
00795     * for the data are in the range [0, 255], ranging from fully transparent
00796     * to fully opaque, respectively.  For non-paletted images, there is a
00797     * single color specified that should be treated as fully transparent.
00798     * Data is valid if (valid & PNG_INFO_tRNS) is non-zero.
00799     */
00800    png_bytep trans; /* transparent values for paletted image */
00801    png_color_16 trans_values; /* transparent color for non-palette image */
00802 #endif
00803 
00804 #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
00805    /* The bKGD chunk gives the suggested image background color if the
00806     * display program does not have its own background color and the image
00807     * is needs to composited onto a background before display.  The colors
00808     * in "background" are normally in the same color space/depth as the
00809     * pixel data.  Data is valid if (valid & PNG_INFO_bKGD) is non-zero.
00810     */
00811    png_color_16 background;
00812 #endif
00813 
00814 #if defined(PNG_oFFs_SUPPORTED)
00815    /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards
00816     * and downwards from the top-left corner of the display, page, or other
00817     * application-specific co-ordinate space.  See the PNG_OFFSET_ defines
00818     * below for the unit types.  Valid if (valid & PNG_INFO_oFFs) non-zero.
00819     */
00820    png_int_32 x_offset; /* x offset on page */
00821    png_int_32 y_offset; /* y offset on page */
00822    png_byte offset_unit_type; /* offset units type */
00823 #endif
00824 
00825 #if defined(PNG_pHYs_SUPPORTED)
00826    /* The pHYs chunk gives the physical pixel density of the image for
00827     * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_
00828     * defines below).  Data is valid if (valid & PNG_INFO_pHYs) is non-zero.
00829     */
00830    png_uint_32 x_pixels_per_unit; /* horizontal pixel density */
00831    png_uint_32 y_pixels_per_unit; /* vertical pixel density */
00832    png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
00833 #endif
00834 
00835 #if defined(PNG_hIST_SUPPORTED)
00836    /* The hIST chunk contains the relative frequency or importance of the
00837     * various palette entries, so that a viewer can intelligently select a
00838     * reduced-color palette, if required.  Data is an array of "num_palette"
00839     * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST)
00840     * is non-zero.
00841     */
00842    png_uint_16p hist;
00843 #endif
00844 
00845 #ifdef PNG_cHRM_SUPPORTED
00846    /* The cHRM chunk describes the CIE color characteristics of the monitor
00847     * on which the PNG was created.  This data allows the viewer to do gamut
00848     * mapping of the input image to ensure that the viewer sees the same
00849     * colors in the image as the creator.  Values are in the range
00850     * [0.0, 0.8].  Data valid if (valid & PNG_INFO_cHRM) non-zero.
00851     */
00852 #ifdef PNG_FLOATING_POINT_SUPPORTED
00853    float x_white;
00854    float y_white;
00855    float x_red;
00856    float y_red;
00857    float x_green;
00858    float y_green;
00859    float x_blue;
00860    float y_blue;
00861 #endif
00862 #endif
00863 
00864 #if defined(PNG_pCAL_SUPPORTED)
00865    /* The pCAL chunk describes a transformation between the stored pixel
00866     * values and original physical data values used to create the image.
00867     * The integer range [0, 2^bit_depth - 1] maps to the floating-point
00868     * range given by [pcal_X0, pcal_X1], and are further transformed by a
00869     * (possibly non-linear) transformation function given by "pcal_type"
00870     * and "pcal_params" into "pcal_units".  Please see the PNG_EQUATION_
00871     * defines below, and the PNG-Group's PNG extensions document for a
00872     * complete description of the transformations and how they should be
00873     * implemented, and for a description of the ASCII parameter strings.
00874     * Data values are valid if (valid & PNG_INFO_pCAL) non-zero.
00875     */
00876    png_charp pcal_purpose;  /* pCAL chunk description string */
00877    png_int_32 pcal_X0;      /* minimum value */
00878    png_int_32 pcal_X1;      /* maximum value */
00879    png_charp pcal_units;    /* Latin-1 string giving physical units */
00880    png_charpp pcal_params;  /* ASCII strings containing parameter values */
00881    png_byte pcal_type;      /* equation type (see PNG_EQUATION_ below) */
00882    png_byte pcal_nparams;   /* number of parameters given in pcal_params */
00883 #endif
00884 
00885 /* New members added in libpng-1.0.6 */
00886 #ifdef PNG_FREE_ME_SUPPORTED
00887    png_uint_32 free_me;     /* flags items libpng is responsible for freeing */
00888 #endif
00889 
00890 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
00891    /* storage for unknown chunks that the library doesn't recognize. */
00892    png_unknown_chunkp unknown_chunks;
00893    png_size_t unknown_chunks_num;
00894 #endif
00895 
00896 #if defined(PNG_iCCP_SUPPORTED)
00897    /* iCCP chunk data. */
00898    png_charp iccp_name;     /* profile name */
00899    png_charp iccp_profile;  /* International Color Consortium profile data */
00900                             /* Note to maintainer: should be png_bytep */
00901    png_uint_32 iccp_proflen;  /* ICC profile data length */
00902    png_byte iccp_compression; /* Always zero */
00903 #endif
00904 
00905 #if defined(PNG_sPLT_SUPPORTED)
00906    /* data on sPLT chunks (there may be more than one). */
00907    png_sPLT_tp splt_palettes;
00908    png_uint_32 splt_palettes_num;
00909 #endif
00910 
00911 #if defined(PNG_sCAL_SUPPORTED)
00912    /* The sCAL chunk describes the actual physical dimensions of the
00913     * subject matter of the graphic.  The chunk contains a unit specification
00914     * a byte value, and two ASCII strings representing floating-point
00915     * values.  The values are width and height corresponsing to one pixel
00916     * in the image.  This external representation is converted to double
00917     * here.  Data values are valid if (valid & PNG_INFO_sCAL) is non-zero.
00918     */
00919    png_byte scal_unit;         /* unit of physical scale */
00920 #ifdef PNG_FLOATING_POINT_SUPPORTED
00921    double scal_pixel_width;    /* width of one pixel */
00922    double scal_pixel_height;   /* height of one pixel */
00923 #endif
00924 #ifdef PNG_FIXED_POINT_SUPPORTED
00925    png_charp scal_s_width;     /* string containing height */
00926    png_charp scal_s_height;    /* string containing width */
00927 #endif
00928 #endif
00929 
00930 #if defined(PNG_INFO_IMAGE_SUPPORTED)
00931    /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */
00932    /* Data valid if (valid & PNG_INFO_IDAT) non-zero */
00933    png_bytepp row_pointers;        /* the image bits */
00934 #endif
00935 
00936 #if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED)
00937    png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */
00938 #endif
00939 
00940 #if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED)
00941    png_fixed_point int_x_white;
00942    png_fixed_point int_y_white;
00943    png_fixed_point int_x_red;
00944    png_fixed_point int_y_red;
00945    png_fixed_point int_x_green;
00946    png_fixed_point int_y_green;
00947    png_fixed_point int_x_blue;
00948    png_fixed_point int_y_blue;
00949 #endif
00950 
00951 } png_info;
00952 
00953 typedef png_info FAR * png_infop;
00954 typedef png_info FAR * FAR * png_infopp;
00955 
00956 /* Maximum positive integer used in PNG is (2^31)-1 */
00957 #define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
00958 #define PNG_UINT_32_MAX ((png_uint_32)(-1))
00959 #define PNG_SIZE_MAX ((png_size_t)(-1))
00960 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00961 /* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */
00962 #define PNG_MAX_UINT PNG_UINT_31_MAX
00963 #endif
00964 
00965 /* These describe the color_type field in png_info. */
00966 /* color type masks */
00967 #define PNG_COLOR_MASK_PALETTE    1
00968 #define PNG_COLOR_MASK_COLOR      2
00969 #define PNG_COLOR_MASK_ALPHA      4
00970 
00971 /* color types.  Note that not all combinations are legal */
00972 #define PNG_COLOR_TYPE_GRAY 0
00973 #define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
00974 #define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
00975 #define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
00976 #define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
00977 /* aliases */
00978 #define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA
00979 #define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA
00980 
00981 /* This is for compression type. PNG 1.0-1.2 only define the single type. */
00982 #define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */
00983 #define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE
00984 
00985 /* This is for filter type. PNG 1.0-1.2 only define the single type. */
00986 #define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */
00987 #define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */
00988 #define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE
00989 
00990 /* These are for the interlacing type.  These values should NOT be changed. */
00991 #define PNG_INTERLACE_NONE        0 /* Non-interlaced image */
00992 #define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */
00993 #define PNG_INTERLACE_LAST        2 /* Not a valid value */
00994 
00995 /* These are for the oFFs chunk.  These values should NOT be changed. */
00996 #define PNG_OFFSET_PIXEL          0 /* Offset in pixels */
00997 #define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */
00998 #define PNG_OFFSET_LAST           2 /* Not a valid value */
00999 
01000 /* These are for the pCAL chunk.  These values should NOT be changed. */
01001 #define PNG_EQUATION_LINEAR       0 /* Linear transformation */
01002 #define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */
01003 #define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */
01004 #define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */
01005 #define PNG_EQUATION_LAST         4 /* Not a valid value */
01006 
01007 /* These are for the sCAL chunk.  These values should NOT be changed. */
01008 #define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */
01009 #define PNG_SCALE_METER           1 /* meters per pixel */
01010 #define PNG_SCALE_RADIAN          2 /* radians per pixel */
01011 #define PNG_SCALE_LAST            3 /* Not a valid value */
01012 
01013 /* These are for the pHYs chunk.  These values should NOT be changed. */
01014 #define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */
01015 #define PNG_RESOLUTION_METER      1 /* pixels/meter */
01016 #define PNG_RESOLUTION_LAST       2 /* Not a valid value */
01017 
01018 /* These are for the sRGB chunk.  These values should NOT be changed. */
01019 #define PNG_sRGB_INTENT_PERCEPTUAL 0
01020 #define PNG_sRGB_INTENT_RELATIVE   1
01021 #define PNG_sRGB_INTENT_SATURATION 2
01022 #define PNG_sRGB_INTENT_ABSOLUTE   3
01023 #define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */
01024 
01025 /* This is for text chunks */
01026 #define PNG_KEYWORD_MAX_LENGTH     79
01027 
01028 /* Maximum number of entries in PLTE/sPLT/tRNS arrays */
01029 #define PNG_MAX_PALETTE_LENGTH    256
01030 
01031 /* These determine if an ancillary chunk's data has been successfully read
01032  * from the PNG header, or if the application has filled in the corresponding
01033  * data in the info_struct to be written into the output file.  The values
01034  * of the PNG_INFO_<chunk> defines should NOT be changed.
01035  */
01036 #define PNG_INFO_gAMA 0x0001
01037 #define PNG_INFO_sBIT 0x0002
01038 #define PNG_INFO_cHRM 0x0004
01039 #define PNG_INFO_PLTE 0x0008
01040 #define PNG_INFO_tRNS 0x0010
01041 #define PNG_INFO_bKGD 0x0020
01042 #define PNG_INFO_hIST 0x0040
01043 #define PNG_INFO_pHYs 0x0080
01044 #define PNG_INFO_oFFs 0x0100
01045 #define PNG_INFO_tIME 0x0200
01046 #define PNG_INFO_pCAL 0x0400
01047 #define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */
01048 #define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */
01049 #define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */
01050 #define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */
01051 #define PNG_INFO_IDAT 0x8000L  /* ESR, 1.0.6 */
01052 
01053 /* This is used for the transformation routines, as some of them
01054  * change these values for the row.  It also should enable using
01055  * the routines for other purposes.
01056  */
01057 typedef struct png_row_info_struct
01058 {
01059    png_uint_32 width; /* width of row */
01060    png_uint_32 rowbytes; /* number of bytes in row */
01061    png_byte color_type; /* color type of row */
01062    png_byte bit_depth; /* bit depth of row */
01063    png_byte channels; /* number of channels (1, 2, 3, or 4) */
01064    png_byte pixel_depth; /* bits per pixel (depth * channels) */
01065 } png_row_info;
01066 
01067 typedef png_row_info FAR * png_row_infop;
01068 typedef png_row_info FAR * FAR * png_row_infopp;
01069 
01070 /* These are the function types for the I/O functions and for the functions
01071  * that allow the user to override the default I/O functions with his or her
01072  * own.  The png_error_ptr type should match that of user-supplied warning
01073  * and error functions, while the png_rw_ptr type should match that of the
01074  * user read/write data functions.
01075  */
01076 typedef struct png_struct_def png_struct;
01077 typedef png_struct FAR * png_structp;
01078 
01079 typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
01080 typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
01081 typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp));
01082 typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32,
01083    int));
01084 typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32,
01085    int));
01086 
01087 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
01088 typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop));
01089 typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop));
01090 typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
01091    png_uint_32, int));
01092 #endif
01093 
01094 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01095     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
01096     defined(PNG_LEGACY_SUPPORTED)
01097 typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp,
01098     png_row_infop, png_bytep));
01099 #endif
01100 
01101 #if defined(PNG_USER_CHUNKS_SUPPORTED)
01102 typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp));
01103 #endif
01104 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
01105 typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp));
01106 #endif
01107 
01108 /* Transform masks for the high-level interface */
01109 #define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */
01110 #define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */
01111 #define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */
01112 #define PNG_TRANSFORM_PACKING        0x0004    /* read and write */
01113 #define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */
01114 #define PNG_TRANSFORM_EXPAND         0x0010    /* read only */
01115 #define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */
01116 #define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */
01117 #define PNG_TRANSFORM_BGR            0x0080    /* read and write */
01118 #define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */
01119 #define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */
01120 #define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */
01121 #define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* WRITE only */
01122 
01123 /* Flags for MNG supported features */
01124 #define PNG_FLAG_MNG_EMPTY_PLTE     0x01
01125 #define PNG_FLAG_MNG_FILTER_64      0x04
01126 #define PNG_ALL_MNG_FEATURES        0x05
01127 
01128 typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t));
01129 typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp));
01130 
01131 /* The structure that holds the information to read and write PNG files.
01132  * The only people who need to care about what is inside of this are the
01133  * people who will be modifying the library for their own special needs.
01134  * It should NOT be accessed directly by an application, except to store
01135  * the jmp_buf.
01136  */
01137 
01138 struct png_struct_def
01139 {
01140 #ifdef PNG_SETJMP_SUPPORTED
01141    jmp_buf jmpbuf;            /* used in png_error */
01142 #endif
01143    png_error_ptr error_fn;    /* function for printing errors and aborting */
01144    png_error_ptr warning_fn;  /* function for printing warnings */
01145    png_voidp error_ptr;       /* user supplied struct for error functions */
01146    png_rw_ptr write_data_fn;  /* function for writing output data */
01147    png_rw_ptr read_data_fn;   /* function for reading input data */
01148    png_voidp io_ptr;          /* ptr to application struct for I/O functions */
01149 
01150 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
01151    png_user_transform_ptr read_user_transform_fn; /* user read transform */
01152 #endif
01153 
01154 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
01155    png_user_transform_ptr write_user_transform_fn; /* user write transform */
01156 #endif
01157 
01158 /* These were added in libpng-1.0.2 */
01159 #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
01160 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01161     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
01162    png_voidp user_transform_ptr; /* user supplied struct for user transform */
01163    png_byte user_transform_depth;    /* bit depth of user transformed pixels */
01164    png_byte user_transform_channels; /* channels in user transformed pixels */
01165 #endif
01166 #endif
01167 
01168    png_uint_32 mode;          /* tells us where we are in the PNG file */
01169    png_uint_32 flags;         /* flags indicating various things to libpng */
01170    png_uint_32 transformations; /* which transformations to perform */
01171 
01172    z_stream zstream;          /* pointer to decompression structure (below) */
01173    png_bytep zbuf;            /* buffer for zlib */
01174    png_size_t zbuf_size;      /* size of zbuf */
01175    int zlib_level;            /* holds zlib compression level */
01176    int zlib_method;           /* holds zlib compression method */
01177    int zlib_window_bits;      /* holds zlib compression window bits */
01178    int zlib_mem_level;        /* holds zlib compression memory level */
01179    int zlib_strategy;         /* holds zlib compression strategy */
01180 
01181    png_uint_32 width;         /* width of image in pixels */
01182    png_uint_32 height;        /* height of image in pixels */
01183    png_uint_32 num_rows;      /* number of rows in current pass */
01184    png_uint_32 usr_width;     /* width of row at start of write */
01185    png_uint_32 rowbytes;      /* size of row in bytes */
01186    png_uint_32 irowbytes;     /* size of current interlaced row in bytes */
01187    png_uint_32 iwidth;        /* width of current interlaced row in pixels */
01188    png_uint_32 row_number;    /* current row in interlace pass */
01189    png_bytep prev_row;        /* buffer to save previous (unfiltered) row */
01190    png_bytep row_buf;         /* buffer to save current (unfiltered) row */
01191    png_bytep sub_row;         /* buffer to save "sub" row when filtering */
01192    png_bytep up_row;          /* buffer to save "up" row when filtering */
01193    png_bytep avg_row;         /* buffer to save "avg" row when filtering */
01194    png_bytep paeth_row;       /* buffer to save "Paeth" row when filtering */
01195    png_row_info row_info;     /* used for transformation routines */
01196 
01197    png_uint_32 idat_size;     /* current IDAT size for read */
01198    png_uint_32 crc;           /* current chunk CRC value */
01199    png_colorp palette;        /* palette from the input file */
01200    png_uint_16 num_palette;   /* number of color entries in palette */
01201    png_uint_16 num_trans;     /* number of transparency values */
01202    png_byte chunk_name[5];    /* null-terminated name of current chunk */
01203    png_byte compression;      /* file compression type (always 0) */
01204    png_byte filter;           /* file filter type (always 0) */
01205    png_byte interlaced;       /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
01206    png_byte pass;             /* current interlace pass (0 - 6) */
01207    png_byte do_filter;        /* row filter flags (see PNG_FILTER_ below ) */
01208    png_byte color_type;       /* color type of file */
01209    png_byte bit_depth;        /* bit depth of file */
01210    png_byte usr_bit_depth;    /* bit depth of users row */
01211    png_byte pixel_depth;      /* number of bits per pixel */
01212    png_byte channels;         /* number of channels in file */
01213    png_byte usr_channels;     /* channels at start of write */
01214    png_byte sig_bytes;        /* magic bytes read/written from start of file */
01215 
01216 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
01217 #ifdef PNG_LEGACY_SUPPORTED
01218    png_byte filler;           /* filler byte for pixel expansion */
01219 #else
01220    png_uint_16 filler;           /* filler bytes for pixel expansion */
01221 #endif
01222 #endif
01223 
01224 #if defined(PNG_bKGD_SUPPORTED)
01225    png_byte background_gamma_type;
01226 #  ifdef PNG_FLOATING_POINT_SUPPORTED
01227    float background_gamma;
01228 #  endif
01229    png_color_16 background;   /* background color in screen gamma space */
01230 #if defined(PNG_READ_GAMMA_SUPPORTED)
01231    png_color_16 background_1; /* background normalized to gamma 1.0 */
01232 #endif
01233 #endif /* PNG_bKGD_SUPPORTED */
01234 
01235 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
01236    png_flush_ptr output_flush_fn;/* Function for flushing output */
01237    png_uint_32 flush_dist;    /* how many rows apart to flush, 0 - no flush */
01238    png_uint_32 flush_rows;    /* number of rows written since last flush */
01239 #endif
01240 
01241 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01242    int gamma_shift;      /* number of "insignificant" bits 16-bit gamma */
01243 #ifdef PNG_FLOATING_POINT_SUPPORTED
01244    float gamma;          /* file gamma value */
01245    float screen_gamma;   /* screen gamma value (display_exponent) */
01246 #endif
01247 #endif
01248 
01249 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01250    png_bytep gamma_table;     /* gamma table for 8-bit depth files */
01251    png_bytep gamma_from_1;    /* converts from 1.0 to screen */
01252    png_bytep gamma_to_1;      /* converts from file to 1.0 */
01253    png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
01254    png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
01255    png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
01256 #endif
01257 
01258 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
01259    png_color_8 sig_bit;       /* significant bits in each available channel */
01260 #endif
01261 
01262 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
01263    png_color_8 shift;         /* shift for significant bit tranformation */
01264 #endif
01265 
01266 #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
01267  || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01268    png_bytep trans;           /* transparency values for paletted files */
01269    png_color_16 trans_values; /* transparency values for non-paletted files */
01270 #endif
01271 
01272    png_read_status_ptr read_row_fn;   /* called after each row is decoded */
01273    png_write_status_ptr write_row_fn; /* called after each row is encoded */
01274 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
01275    png_progressive_info_ptr info_fn; /* called after header data fully read */
01276    png_progressive_row_ptr row_fn;   /* called after each prog. row is decoded */
01277    png_progressive_end_ptr end_fn;   /* called after image is complete */
01278    png_bytep save_buffer_ptr;        /* current location in save_buffer */
01279    png_bytep save_buffer;            /* buffer for previously read data */
01280    png_bytep current_buffer_ptr;     /* current location in current_buffer */
01281    png_bytep current_buffer;         /* buffer for recently used data */
01282    png_uint_32 push_length;          /* size of current input chunk */
01283    png_uint_32 skip_length;          /* bytes to skip in input data */
01284    png_size_t save_buffer_size;      /* amount of data now in save_buffer */
01285    png_size_t save_buffer_max;       /* total size of save_buffer */
01286    png_size_t buffer_size;           /* total amount of available input data */
01287    png_size_t current_buffer_size;   /* amount of data now in current_buffer */
01288    int process_mode;                 /* what push library is currently doing */
01289    int cur_palette;                  /* current push library palette index */
01290 
01291 #  if defined(PNG_TEXT_SUPPORTED)
01292      png_size_t current_text_size;   /* current size of text input data */
01293      png_size_t current_text_left;   /* how much text left to read in input */
01294      png_charp current_text;         /* current text chunk buffer */
01295      png_charp current_text_ptr;     /* current location in current_text */
01296 #  endif /* PNG_TEXT_SUPPORTED */
01297 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
01298 
01299 #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
01300 /* for the Borland special 64K segment handler */
01301    png_bytepp offset_table_ptr;
01302    png_bytep offset_table;
01303    png_uint_16 offset_table_number;
01304    png_uint_16 offset_table_count;
01305    png_uint_16 offset_table_count_free;
01306 #endif
01307 
01308 #if defined(PNG_READ_DITHER_SUPPORTED)
01309    png_bytep palette_lookup;         /* lookup table for dithering */
01310    png_bytep dither_index;           /* index translation for palette files */
01311 #endif
01312 
01313 #if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED)
01314    png_uint_16p hist;                /* histogram */
01315 #endif
01316 
01317 #if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
01318    png_byte heuristic_method;        /* heuristic for row filter selection */
01319    png_byte num_prev_filters;        /* number of weights for previous rows */
01320    png_bytep prev_filters;           /* filter type(s) of previous row(s) */
01321    png_uint_16p filter_weights;      /* weight(s) for previous line(s) */
01322    png_uint_16p inv_filter_weights;  /* 1/weight(s) for previous line(s) */
01323    png_uint_16p filter_costs;        /* relative filter calculation cost */
01324    png_uint_16p inv_filter_costs;    /* 1/relative filter calculation cost */
01325 #endif
01326 
01327 #if defined(PNG_TIME_RFC1123_SUPPORTED)
01328    png_charp time_buffer;            /* String to hold RFC 1123 time text */
01329 #endif
01330 
01331 /* New members added in libpng-1.0.6 */
01332 
01333 #ifdef PNG_FREE_ME_SUPPORTED
01334    png_uint_32 free_me;       /* flags items libpng is responsible for freeing */
01335 #endif
01336 
01337 #if defined(PNG_USER_CHUNKS_SUPPORTED)
01338    png_voidp user_chunk_ptr;
01339    png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
01340 #endif
01341 
01342 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
01343    int num_chunk_list;
01344    png_bytep chunk_list;
01345 #endif
01346 
01347 /* New members added in libpng-1.0.3 */
01348 #if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
01349    png_byte rgb_to_gray_status;
01350    /* These were changed from png_byte in libpng-1.0.6 */
01351    png_uint_16 rgb_to_gray_red_coeff;
01352    png_uint_16 rgb_to_gray_green_coeff;
01353    png_uint_16 rgb_to_gray_blue_coeff;
01354 #endif
01355 
01356 /* New member added in libpng-1.0.4 (renamed in 1.0.9) */
01357 #if defined(PNG_MNG_FEATURES_SUPPORTED) || \
01358     defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
01359     defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
01360 /* changed from png_byte to png_uint_32 at version 1.2.0 */
01361 #ifdef PNG_1_0_X
01362    png_byte mng_features_permitted;
01363 #else
01364    png_uint_32 mng_features_permitted;
01365 #endif /* PNG_1_0_X */
01366 #endif
01367 
01368 /* New member added in libpng-1.0.7 */
01369 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01370    png_fixed_point int_gamma;
01371 #endif
01372 
01373 /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */
01374 #if defined(PNG_MNG_FEATURES_SUPPORTED)
01375    png_byte filter_type;
01376 #endif
01377 
01378 #if defined(PNG_1_0_X)
01379 /* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */
01380    png_uint_32 row_buf_size;
01381 #endif
01382 
01383 /* New members added in libpng-1.2.0 */
01384 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
01385 #  if !defined(PNG_1_0_X)
01386 #    if defined(PNG_MMX_CODE_SUPPORTED)
01387    png_byte     mmx_bitdepth_threshold;
01388    png_uint_32  mmx_rowbytes_threshold;
01389 #    endif
01390    png_uint_32  asm_flags;
01391 #  endif
01392 #endif
01393 
01394 /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
01395 #ifdef PNG_USER_MEM_SUPPORTED
01396    png_voidp mem_ptr;                /* user supplied struct for mem functions */
01397    png_malloc_ptr malloc_fn;         /* function for allocating memory */
01398    png_free_ptr free_fn;             /* function for freeing memory */
01399 #endif
01400 
01401 /* New member added in libpng-1.0.13 and 1.2.0 */
01402    png_bytep big_row_buf;         /* buffer to save current (unfiltered) row */
01403 
01404 #if defined(PNG_READ_DITHER_SUPPORTED)
01405 /* The following three members were added at version 1.0.14 and 1.2.4 */
01406    png_bytep dither_sort;            /* working sort array */
01407    png_bytep index_to_palette;       /* where the original index currently is */
01408                                      /* in the palette */
01409    png_bytep palette_to_index;       /* which original index points to this */
01410                                      /* palette color */
01411 #endif
01412 
01413 /* New members added in libpng-1.0.16 and 1.2.6 */
01414    png_byte compression_type;
01415 
01416 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
01417    png_uint_32 user_width_max;
01418    png_uint_32 user_height_max;
01419 #endif
01420 
01421 /* New member added in libpng-1.0.25 and 1.2.17 */
01422 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
01423    /* storage for unknown chunk that the library doesn't recognize. */
01424    png_unknown_chunk unknown_chunk;
01425 #endif
01426 };
01427 
01428 
01429 /* This triggers a compiler error in png.c, if png.c and png.h
01430  * do not agree upon the version number.
01431  */
01432 typedef png_structp version_1_2_23;
01433 
01434 typedef png_struct FAR * FAR * png_structpp;
01435 
01436 /* Here are the function definitions most commonly used.  This is not
01437  * the place to find out how to use libpng.  See libpng.txt for the
01438  * full explanation, see example.c for the summary.  This just provides
01439  * a simple one line description of the use of each function.
01440  */
01441 
01442 /* Returns the version number of the library */
01443 extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));
01444 
01445 /* Tell lib we have already handled the first <num_bytes> magic bytes.
01446  * Handling more than 8 bytes from the beginning of the file is an error.
01447  */
01448 extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
01449    int num_bytes));
01450 
01451 /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
01452  * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG
01453  * signature, and non-zero otherwise.  Having num_to_check == 0 or
01454  * start > 7 will always fail (ie return non-zero).
01455  */
01456 extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
01457    png_size_t num_to_check));
01458 
01459 /* Simple signature checking function.  This is the same as calling
01460  * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
01461  */
01462 extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num));
01463 
01464 /* Allocate and initialize png_ptr struct for reading, and any other memory. */
01465 extern PNG_EXPORT(png_structp,png_create_read_struct)
01466    PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01467    png_error_ptr error_fn, png_error_ptr warn_fn));
01468 
01469 /* Allocate and initialize png_ptr struct for writing, and any other memory */
01470 extern PNG_EXPORT(png_structp,png_create_write_struct)
01471    PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01472    png_error_ptr error_fn, png_error_ptr warn_fn));
01473 
01474 #ifdef PNG_WRITE_SUPPORTED
01475 extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size)
01476    PNGARG((png_structp png_ptr));
01477 #endif
01478 
01479 #ifdef PNG_WRITE_SUPPORTED
01480 extern PNG_EXPORT(void,png_set_compression_buffer_size)
01481    PNGARG((png_structp png_ptr, png_uint_32 size));
01482 #endif
01483 
01484 /* Reset the compression stream */
01485 extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
01486 
01487 /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
01488 #ifdef PNG_USER_MEM_SUPPORTED
01489 extern PNG_EXPORT(png_structp,png_create_read_struct_2)
01490    PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01491    png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
01492    png_malloc_ptr malloc_fn, png_free_ptr free_fn));
01493 extern PNG_EXPORT(png_structp,png_create_write_struct_2)
01494    PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01495    png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
01496    png_malloc_ptr malloc_fn, png_free_ptr free_fn));
01497 #endif
01498 
01499 /* Write a PNG chunk - size, type, (optional) data, CRC. */
01500 extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr,
01501    png_bytep chunk_name, png_bytep data, png_size_t length));
01502 
01503 /* Write the start of a PNG chunk - length and chunk name. */
01504 extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr,
01505    png_bytep chunk_name, png_uint_32 length));
01506 
01507 /* Write the data of a PNG chunk started with png_write_chunk_start(). */
01508 extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr,
01509    png_bytep data, png_size_t length));
01510 
01511 /* Finish a chunk started with png_write_chunk_start() (includes CRC). */
01512 extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr));
01513 
01514 /* Allocate and initialize the info structure */
01515 extern PNG_EXPORT(png_infop,png_create_info_struct)
01516    PNGARG((png_structp png_ptr));
01517 
01518 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
01519 /* Initialize the info structure (old interface - DEPRECATED) */
01520 extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
01521 #undef png_info_init
01522 #define png_info_init(info_ptr) png_info_init_3(&info_ptr,\
01523     png_sizeof(png_info));
01524 #endif
01525 
01526 extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
01527     png_size_t png_info_struct_size));
01528 
01529 /* Writes all the PNG information before the image. */
01530 extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr,
01531    png_infop info_ptr));
01532 extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
01533    png_infop info_ptr));
01534 
01535 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01536 /* read the information before the actual image data. */
01537 extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
01538    png_infop info_ptr));
01539 #endif
01540 
01541 #if defined(PNG_TIME_RFC1123_SUPPORTED)
01542 extern PNG_EXPORT(png_charp,png_convert_to_rfc1123)
01543    PNGARG((png_structp png_ptr, png_timep ptime));
01544 #endif
01545 
01546 #if !defined(_WIN32_WCE)
01547 /* "time.h" functions are not supported on WindowsCE */
01548 #if defined(PNG_WRITE_tIME_SUPPORTED)
01549 /* convert from a struct tm to png_time */
01550 extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
01551    struct tm FAR * ttime));
01552 
01553 /* convert from time_t to png_time.  Uses gmtime() */
01554 extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
01555    time_t ttime));
01556 #endif /* PNG_WRITE_tIME_SUPPORTED */
01557 #endif /* _WIN32_WCE */
01558 
01559 #if defined(PNG_READ_EXPAND_SUPPORTED)
01560 /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
01561 extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
01562 #if !defined(PNG_1_0_X)
01563 extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
01564   png_ptr));
01565 #endif
01566 extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));
01567 extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
01568 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
01569 /* Deprecated */
01570 extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));
01571 #endif
01572 #endif
01573 
01574 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
01575 /* Use blue, green, red order for pixels. */
01576 extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));
01577 #endif
01578 
01579 #if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
01580 /* Expand the grayscale to 24-bit RGB if necessary. */
01581 extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));
01582 #endif
01583 
01584 #if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
01585 /* Reduce RGB to grayscale. */
01586 #ifdef PNG_FLOATING_POINT_SUPPORTED
01587 extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr,
01588    int error_action, double red, double green ));
01589 #endif
01590 extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr,
01591    int error_action, png_fixed_point red, png_fixed_point green ));
01592 extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp
01593    png_ptr));
01594 #endif
01595 
01596 extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
01597    png_colorp palette));
01598 
01599 #if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
01600 extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
01601 #endif
01602 
01603 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
01604     defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
01605 extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr));
01606 #endif
01607 
01608 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
01609     defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
01610 extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
01611 #endif
01612 
01613 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
01614 /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
01615 extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr,
01616    png_uint_32 filler, int flags));
01617 /* The values of the PNG_FILLER_ defines should NOT be changed */
01618 #define PNG_FILLER_BEFORE 0
01619 #define PNG_FILLER_AFTER 1
01620 /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
01621 #if !defined(PNG_1_0_X)
01622 extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
01623    png_uint_32 filler, int flags));
01624 #endif
01625 #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
01626 
01627 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
01628 /* Swap bytes in 16-bit depth files. */
01629 extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr));
01630 #endif
01631 
01632 #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
01633 /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
01634 extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr));
01635 #endif
01636 
01637 #if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
01638 /* Swap packing order of pixels in bytes. */
01639 extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr));
01640 #endif
01641 
01642 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
01643 /* Converts files to legal bit depths. */
01644 extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr,
01645    png_color_8p true_bits));
01646 #endif
01647 
01648 #if defined(PNG_READ_INTERLACING_SUPPORTED) || \
01649     defined(PNG_WRITE_INTERLACING_SUPPORTED)
01650 /* Have the code handle the interlacing.  Returns the number of passes. */
01651 extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));
01652 #endif
01653 
01654 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
01655 /* Invert monochrome files */
01656 extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
01657 #endif
01658 
01659 #if defined(PNG_READ_BACKGROUND_SUPPORTED)
01660 /* Handle alpha and tRNS by replacing with a background color. */
01661 #ifdef PNG_FLOATING_POINT_SUPPORTED
01662 extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
01663    png_color_16p background_color, int background_gamma_code,
01664    int need_expand, double background_gamma));
01665 #endif
01666 #define PNG_BACKGROUND_GAMMA_UNKNOWN 0
01667 #define PNG_BACKGROUND_GAMMA_SCREEN  1
01668 #define PNG_BACKGROUND_GAMMA_FILE    2
01669 #define PNG_BACKGROUND_GAMMA_UNIQUE  3
01670 #endif
01671 
01672 #if defined(PNG_READ_16_TO_8_SUPPORTED)
01673 /* strip the second byte of information from a 16-bit depth file. */
01674 extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
01675 #endif
01676 
01677 #if defined(PNG_READ_DITHER_SUPPORTED)
01678 /* Turn on dithering, and reduce the palette to the number of colors available. */
01679 extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr,
01680    png_colorp palette, int num_palette, int maximum_colors,
01681    png_uint_16p histogram, int full_dither));
01682 #endif
01683 
01684 #if defined(PNG_READ_GAMMA_SUPPORTED)
01685 /* Handle gamma correction. Screen_gamma=(display_exponent) */
01686 #ifdef PNG_FLOATING_POINT_SUPPORTED
01687 extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
01688    double screen_gamma, double default_file_gamma));
01689 #endif
01690 #endif
01691 
01692 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
01693 #if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
01694     defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
01695 /* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */
01696 /* Deprecated and will be removed.  Use png_permit_mng_features() instead. */
01697 extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr,
01698    int empty_plte_permitted));
01699 #endif
01700 #endif
01701 
01702 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
01703 /* Set how many lines between output flushes - 0 for no flushing */
01704 extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows));
01705 /* Flush the current PNG output buffer */
01706 extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr));
01707 #endif
01708 
01709 /* optional update palette with requested transformations */
01710 extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
01711 
01712 /* optional call to update the users info structure */
01713 extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
01714    png_infop info_ptr));
01715 
01716 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01717 /* read one or more rows of image data. */
01718 extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
01719    png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
01720 #endif
01721 
01722 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01723 /* read a row of data. */
01724 extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
01725    png_bytep row,
01726    png_bytep display_row));
01727 #endif
01728 
01729 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01730 /* read the whole image into memory at once. */
01731 extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
01732    png_bytepp image));
01733 #endif
01734 
01735 /* write a row of image data */
01736 extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
01737    png_bytep row));
01738 
01739 /* write a few rows of image data */
01740 extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
01741    png_bytepp row, png_uint_32 num_rows));
01742 
01743 /* write the image data */
01744 extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
01745    png_bytepp image));
01746 
01747 /* writes the end of the PNG file. */
01748 extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
01749    png_infop info_ptr));
01750 
01751 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01752 /* read the end of the PNG file. */
01753 extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
01754    png_infop info_ptr));
01755 #endif
01756 
01757 /* free any memory associated with the png_info_struct */
01758 extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
01759    png_infopp info_ptr_ptr));
01760 
01761 /* free any memory associated with the png_struct and the png_info_structs */
01762 extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
01763    png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
01764 
01765 /* free all memory used by the read (old method - NOT DLL EXPORTED) */
01766 extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
01767    png_infop end_info_ptr));
01768 
01769 /* free any memory associated with the png_struct and the png_info_structs */
01770 extern PNG_EXPORT(void,png_destroy_write_struct)
01771    PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
01772 
01773 /* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
01774 extern void png_write_destroy PNGARG((png_structp png_ptr));
01775 
01776 /* set the libpng method of handling chunk CRC errors */
01777 extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
01778    int crit_action, int ancil_action));
01779 
01780 /* Values for png_set_crc_action() to say how to handle CRC errors in
01781  * ancillary and critical chunks, and whether to use the data contained
01782  * therein.  Note that it is impossible to "discard" data in a critical
01783  * chunk.  For versions prior to 0.90, the action was always error/quit,
01784  * whereas in version 0.90 and later, the action for CRC errors in ancillary
01785  * chunks is warn/discard.  These values should NOT be changed.
01786  *
01787  *      value                       action:critical     action:ancillary
01788  */
01789 #define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */
01790 #define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */
01791 #define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */
01792 #define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */
01793 #define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */
01794 #define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */
01795 
01796 /* These functions give the user control over the scan-line filtering in
01797  * libpng and the compression methods used by zlib.  These functions are
01798  * mainly useful for testing, as the defaults should work with most users.
01799  * Those users who are tight on memory or want faster performance at the
01800  * expense of compression can modify them.  See the compression library
01801  * header file (zlib.h) for an explination of the compression functions.
01802  */
01803 
01804 /* set the filtering method(s) used by libpng.  Currently, the only valid
01805  * value for "method" is 0.
01806  */
01807 extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
01808    int filters));
01809 
01810 /* Flags for png_set_filter() to say which filters to use.  The flags
01811  * are chosen so that they don't conflict with real filter types
01812  * below, in case they are supplied instead of the #defined constants.
01813  * These values should NOT be changed.
01814  */
01815 #define PNG_NO_FILTERS     0x00
01816 #define PNG_FILTER_NONE    0x08
01817 #define PNG_FILTER_SUB     0x10
01818 #define PNG_FILTER_UP      0x20
01819 #define PNG_FILTER_AVG     0x40
01820 #define PNG_FILTER_PAETH   0x80
01821 #define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
01822                          PNG_FILTER_AVG | PNG_FILTER_PAETH)
01823 
01824 /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
01825  * These defines should NOT be changed.
01826  */
01827 #define PNG_FILTER_VALUE_NONE  0
01828 #define PNG_FILTER_VALUE_SUB   1
01829 #define PNG_FILTER_VALUE_UP    2
01830 #define PNG_FILTER_VALUE_AVG   3
01831 #define PNG_FILTER_VALUE_PAETH 4
01832 #define PNG_FILTER_VALUE_LAST  5
01833 
01834 #if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */
01835 /* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_
01836  * defines, either the default (minimum-sum-of-absolute-differences), or
01837  * the experimental method (weighted-minimum-sum-of-absolute-differences).
01838  *
01839  * Weights are factors >= 1.0, indicating how important it is to keep the
01840  * filter type consistent between rows.  Larger numbers mean the current
01841  * filter is that many times as likely to be the same as the "num_weights"
01842  * previous filters.  This is cumulative for each previous row with a weight.
01843  * There needs to be "num_weights" values in "filter_weights", or it can be
01844  * NULL if the weights aren't being specified.  Weights have no influence on
01845  * the selection of the first row filter.  Well chosen weights can (in theory)
01846  * improve the compression for a given image.
01847  *
01848  * Costs are factors >= 1.0 indicating the relative decoding costs of a
01849  * filter type.  Higher costs indicate more decoding expense, and are
01850  * therefore less likely to be selected over a filter with lower computational
01851  * costs.  There needs to be a value in "filter_costs" for each valid filter
01852  * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't
01853  * setting the costs.  Costs try to improve the speed of decompression without
01854  * unduly increasing the compressed image size.
01855  *
01856  * A negative weight or cost indicates the default value is to be used, and
01857  * values in the range [0.0, 1.0) indicate the value is to remain unchanged.
01858  * The default values for both weights and costs are currently 1.0, but may
01859  * change if good general weighting/cost heuristics can be found.  If both
01860  * the weights and costs are set to 1.0, this degenerates the WEIGHTED method
01861  * to the UNWEIGHTED method, but with added encoding time/computation.
01862  */
01863 #ifdef PNG_FLOATING_POINT_SUPPORTED
01864 extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr,
01865    int heuristic_method, int num_weights, png_doublep filter_weights,
01866    png_doublep filter_costs));
01867 #endif
01868 #endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
01869 
01870 /* Heuristic used for row filter selection.  These defines should NOT be
01871  * changed.
01872  */
01873 #define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently "UNWEIGHTED" */
01874 #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */
01875 #define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */
01876 #define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */
01877 
01878 /* Set the library compression level.  Currently, valid values range from
01879  * 0 - 9, corresponding directly to the zlib compression levels 0 - 9
01880  * (0 - no compression, 9 - "maximal" compression).  Note that tests have
01881  * shown that zlib compression levels 3-6 usually perform as well as level 9
01882  * for PNG images, and do considerably fewer caclulations.  In the future,
01883  * these values may not correspond directly to the zlib compression levels.
01884  */
01885 extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr,
01886    int level));
01887 
01888 extern PNG_EXPORT(void,png_set_compression_mem_level)
01889    PNGARG((png_structp png_ptr, int mem_level));
01890 
01891 extern PNG_EXPORT(void,png_set_compression_strategy)
01892    PNGARG((png_structp png_ptr, int strategy));
01893 
01894 extern PNG_EXPORT(void,png_set_compression_window_bits)
01895    PNGARG((png_structp png_ptr, int window_bits));
01896 
01897 extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr,
01898    int method));
01899 
01900 /* These next functions are called for input/output, memory, and error
01901  * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,
01902  * and call standard C I/O routines such as fread(), fwrite(), and
01903  * fprintf().  These functions can be made to use other I/O routines
01904  * at run time for those applications that need to handle I/O in a
01905  * different manner by calling png_set_???_fn().  See libpng.txt for
01906  * more information.
01907  */
01908 
01909 #if !defined(PNG_NO_STDIO)
01910 /* Initialize the input/output for the PNG file to the default functions. */
01911 extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp));
01912 #endif
01913 
01914 /* Replace the (error and abort), and warning functions with user
01915  * supplied functions.  If no messages are to be printed you must still
01916  * write and use replacement functions. The replacement error_fn should
01917  * still do a longjmp to the last setjmp location if you are using this
01918  * method of error handling.  If error_fn or warning_fn is NULL, the
01919  * default function will be used.
01920  */
01921 
01922 extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr,
01923    png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
01924 
01925 /* Return the user pointer associated with the error functions */
01926 extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
01927 
01928 /* Replace the default data output functions with a user supplied one(s).
01929  * If buffered output is not used, then output_flush_fn can be set to NULL.
01930  * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
01931  * output_flush_fn will be ignored (and thus can be NULL).
01932  */
01933 extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
01934    png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
01935 
01936 /* Replace the default data input function with a user supplied one. */
01937 extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr,
01938    png_voidp io_ptr, png_rw_ptr read_data_fn));
01939 
01940 /* Return the user pointer associated with the I/O functions */
01941 extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr));
01942 
01943 extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr,
01944    png_read_status_ptr read_row_fn));
01945 
01946 extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr,
01947    png_write_status_ptr write_row_fn));
01948 
01949 #ifdef PNG_USER_MEM_SUPPORTED
01950 /* Replace the default memory allocation functions with user supplied one(s). */
01951 extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr,
01952    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));
01953 /* Return the user pointer associated with the memory functions */
01954 extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr));
01955 #endif
01956 
01957 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01958     defined(PNG_LEGACY_SUPPORTED)
01959 extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp
01960    png_ptr, png_user_transform_ptr read_user_transform_fn));
01961 #endif
01962 
01963 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
01964     defined(PNG_LEGACY_SUPPORTED)
01965 extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp
01966    png_ptr, png_user_transform_ptr write_user_transform_fn));
01967 #endif
01968 
01969 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01970     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
01971     defined(PNG_LEGACY_SUPPORTED)
01972 extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp
01973    png_ptr, png_voidp user_transform_ptr, int user_transform_depth,
01974    int user_transform_channels));
01975 /* Return the user pointer associated with the user transform functions */
01976 extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr)
01977    PNGARG((png_structp png_ptr));
01978 #endif
01979 
01980 #ifdef PNG_USER_CHUNKS_SUPPORTED
01981 extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr,
01982    png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
01983 extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp
01984    png_ptr));
01985 #endif
01986 
01987 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
01988 /* Sets the function callbacks for the push reader, and a pointer to a
01989  * user-defined structure available to the callback functions.
01990  */
01991 extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr,
01992    png_voidp progressive_ptr,
01993    png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
01994    png_progressive_end_ptr end_fn));
01995 
01996 /* returns the user pointer associated with the push read functions */
01997 extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
01998    PNGARG((png_structp png_ptr));
01999 
02000 /* function to be called when data becomes available */
02001 extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
02002    png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
02003 
02004 /* function that combines rows.  Not very much different than the
02005  * png_combine_row() call.  Is this even used?????
02006  */
02007 extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
02008    png_bytep old_row, png_bytep new_row));
02009 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
02010 
02011 extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
02012    png_uint_32 size));
02013 
02014 #if defined(PNG_1_0_X)
02015 #  define png_malloc_warn png_malloc
02016 #else
02017 /* Added at libpng version 1.2.4 */
02018 extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
02019    png_uint_32 size));
02020 #endif
02021 
02022 /* frees a pointer allocated by png_malloc() */
02023 extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
02024 
02025 #if defined(PNG_1_0_X)
02026 /* Function to allocate memory for zlib. */
02027 extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
02028    uInt size));
02029 
02030 /* Function to free memory for zlib */
02031 extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
02032 #endif
02033 
02034 /* Free data that was allocated internally */
02035 extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
02036    png_infop info_ptr, png_uint_32 free_me, int num));
02037 #ifdef PNG_FREE_ME_SUPPORTED
02038 /* Reassign responsibility for freeing existing data, whether allocated
02039  * by libpng or by the application */
02040 extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
02041    png_infop info_ptr, int freer, png_uint_32 mask));
02042 #endif
02043 /* assignments for png_data_freer */
02044 #define PNG_DESTROY_WILL_FREE_DATA 1
02045 #define PNG_SET_WILL_FREE_DATA 1
02046 #define PNG_USER_WILL_FREE_DATA 2
02047 /* Flags for png_ptr->free_me and info_ptr->free_me */
02048 #define PNG_FREE_HIST 0x0008
02049 #define PNG_FREE_ICCP 0x0010
02050 #define PNG_FREE_SPLT 0x0020
02051 #define PNG_FREE_ROWS 0x0040
02052 #define PNG_FREE_PCAL 0x0080
02053 #define PNG_FREE_SCAL 0x0100
02054 #define PNG_FREE_UNKN 0x0200
02055 #define PNG_FREE_LIST 0x0400
02056 #define PNG_FREE_PLTE 0x1000
02057 #define PNG_FREE_TRNS 0x2000
02058 #define PNG_FREE_TEXT 0x4000
02059 #define PNG_FREE_ALL  0x7fff
02060 #define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
02061 
02062 #ifdef PNG_USER_MEM_SUPPORTED
02063 extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
02064    png_uint_32 size));
02065 extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr,
02066    png_voidp ptr));
02067 #endif
02068 
02069 extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr,
02070    png_voidp s1, png_voidp s2, png_uint_32 size));
02071 
02072 extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr,
02073    png_voidp s1, int value, png_uint_32 size));
02074 
02075 #if defined(USE_FAR_KEYWORD)  /* memory model conversion function */
02076 extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
02077    int check));
02078 #endif /* USE_FAR_KEYWORD */
02079 
02080 #ifndef PNG_NO_ERROR_TEXT
02081 /* Fatal error in PNG image of libpng - can't continue */
02082 extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
02083    png_const_charp error_message));
02084 
02085 /* The same, but the chunk name is prepended to the error string. */
02086 extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
02087    png_const_charp error_message));
02088 #else
02089 /* Fatal error in PNG image of libpng - can't continue */
02090 extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr));
02091 #endif
02092 
02093 #ifndef PNG_NO_WARNINGS
02094 /* Non-fatal error in libpng.  Can continue, but may have a problem. */
02095 extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
02096    png_const_charp warning_message));
02097 
02098 #ifdef PNG_READ_SUPPORTED
02099 /* Non-fatal error in libpng, chunk name is prepended to message. */
02100 extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
02101    png_const_charp warning_message));
02102 #endif /* PNG_READ_SUPPORTED */
02103 #endif /* PNG_NO_WARNINGS */
02104 
02105 /* The png_set_<chunk> functions are for storing values in the png_info_struct.
02106  * Similarly, the png_get_<chunk> calls are used to read values from the
02107  * png_info_struct, either storing the parameters in the passed variables, or
02108  * setting pointers into the png_info_struct where the data is stored.  The
02109  * png_get_<chunk> functions return a non-zero value if the data was available
02110  * in info_ptr, or return zero and do not change any of the parameters if the
02111  * data was not available.
02112  *
02113  * These functions should be used instead of directly accessing png_info
02114  * to avoid problems with future changes in the size and internal layout of
02115  * png_info_struct.
02116  */
02117 /* Returns "flag" if chunk data is valid in info_ptr. */
02118 extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr,
02119 png_infop info_ptr, png_uint_32 flag));
02120 
02121 /* Returns number of bytes needed to hold a transformed row. */
02122 extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr,
02123 png_infop info_ptr));
02124 
02125 #if defined(PNG_INFO_IMAGE_SUPPORTED)
02126 /* Returns row_pointers, which is an array of pointers to scanlines that was
02127 returned from png_read_png(). */
02128 extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
02129 png_infop info_ptr));
02130 /* Set row_pointers, which is an array of pointers to scanlines for use
02131 by png_write_png(). */
02132 extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
02133    png_infop info_ptr, png_bytepp row_pointers));
02134 #endif
02135 
02136 /* Returns number of color channels in image. */
02137 extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr,
02138 png_infop info_ptr));
02139 
02140 #ifdef PNG_EASY_ACCESS_SUPPORTED
02141 /* Returns image width in pixels. */
02142 extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp
02143 png_ptr, png_infop info_ptr));
02144 
02145 /* Returns image height in pixels. */
02146 extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp
02147 png_ptr, png_infop info_ptr));
02148 
02149 /* Returns image bit_depth. */
02150 extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp
02151 png_ptr, png_infop info_ptr));
02152 
02153 /* Returns image color_type. */
02154 extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp
02155 png_ptr, png_infop info_ptr));
02156 
02157 /* Returns image filter_type. */
02158 extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp
02159 png_ptr, png_infop info_ptr));
02160 
02161 /* Returns image interlace_type. */
02162 extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp
02163 png_ptr, png_infop info_ptr));
02164 
02165 /* Returns image compression_type. */
02166 extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp
02167 png_ptr, png_infop info_ptr));
02168 
02169 /* Returns image resolution in pixels per meter, from pHYs chunk data. */
02170 extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp
02171 png_ptr, png_infop info_ptr));
02172 extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp
02173 png_ptr, png_infop info_ptr));
02174 extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp
02175 png_ptr, png_infop info_ptr));
02176 
02177 /* Returns pixel aspect ratio, computed from pHYs chunk data.  */
02178 #ifdef PNG_FLOATING_POINT_SUPPORTED
02179 extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp
02180 png_ptr, png_infop info_ptr));
02181 #endif
02182 
02183 /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
02184 extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp
02185 png_ptr, png_infop info_ptr));
02186 extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp
02187 png_ptr, png_infop info_ptr));
02188 extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp
02189 png_ptr, png_infop info_ptr));
02190 extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp
02191 png_ptr, png_infop info_ptr));
02192 
02193 #endif /* PNG_EASY_ACCESS_SUPPORTED */
02194 
02195 /* Returns pointer to signature string read from PNG header */
02196 extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr,
02197 png_infop info_ptr));
02198 
02199 #if defined(PNG_bKGD_SUPPORTED)
02200 extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr,
02201    png_infop info_ptr, png_color_16p *background));
02202 #endif
02203 
02204 #if defined(PNG_bKGD_SUPPORTED)
02205 extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr,
02206    png_infop info_ptr, png_color_16p background));
02207 #endif
02208 
02209 #if defined(PNG_cHRM_SUPPORTED)
02210 #ifdef PNG_FLOATING_POINT_SUPPORTED
02211 extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr,
02212    png_infop info_ptr, double *white_x, double *white_y, double *red_x,
02213    double *red_y, double *green_x, double *green_y, double *blue_x,
02214    double *blue_y));
02215 #endif
02216 #ifdef PNG_FIXED_POINT_SUPPORTED
02217 extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr,
02218    png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point
02219    *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y,
02220    png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point
02221    *int_blue_x, png_fixed_point *int_blue_y));
02222 #endif
02223 #endif
02224 
02225 #if defined(PNG_cHRM_SUPPORTED)
02226 #ifdef PNG_FLOATING_POINT_SUPPORTED
02227 extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr,
02228    png_infop info_ptr, double white_x, double white_y, double red_x,
02229    double red_y, double green_x, double green_y, double blue_x, double blue_y));
02230 #endif
02231 #ifdef PNG_FIXED_POINT_SUPPORTED
02232 extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr,
02233    png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y,
02234    png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
02235    int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
02236    png_fixed_point int_blue_y));
02237 #endif
02238 #endif
02239 
02240 #if defined(PNG_gAMA_SUPPORTED)
02241 #ifdef PNG_FLOATING_POINT_SUPPORTED
02242 extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr,
02243    png_infop info_ptr, double *file_gamma));
02244 #endif
02245 extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr,
02246    png_infop info_ptr, png_fixed_point *int_file_gamma));
02247 #endif
02248 
02249 #if defined(PNG_gAMA_SUPPORTED)
02250 #ifdef PNG_FLOATING_POINT_SUPPORTED
02251 extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr,
02252    png_infop info_ptr, double file_gamma));
02253 #endif
02254 extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr,
02255    png_infop info_ptr, png_fixed_point int_file_gamma));
02256 #endif
02257 
02258 #if defined(PNG_hIST_SUPPORTED)
02259 extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr,
02260    png_infop info_ptr, png_uint_16p *hist));
02261 #endif
02262 
02263 #if defined(PNG_hIST_SUPPORTED)
02264 extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
02265    png_infop info_ptr, png_uint_16p hist));
02266 #endif
02267 
02268 extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr,
02269    png_infop info_ptr, png_uint_32 *width, png_uint_32 *height,
02270    int *bit_depth, int *color_type, int *interlace_method,
02271    int *compression_method, int *filter_method));
02272 
02273 extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr,
02274    png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,
02275    int color_type, int interlace_method, int compression_method,
02276    int filter_method));
02277 
02278 #if defined(PNG_oFFs_SUPPORTED)
02279 extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr,
02280    png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
02281    int *unit_type));
02282 #endif
02283 
02284 #if defined(PNG_oFFs_SUPPORTED)
02285 extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr,
02286    png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y,
02287    int unit_type));
02288 #endif
02289 
02290 #if defined(PNG_pCAL_SUPPORTED)
02291 extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr,
02292    png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
02293    int *type, int *nparams, png_charp *units, png_charpp *params));
02294 #endif
02295 
02296 #if defined(PNG_pCAL_SUPPORTED)
02297 extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr,
02298    png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1,
02299    int type, int nparams, png_charp units, png_charpp params));
02300 #endif
02301 
02302 #if defined(PNG_pHYs_SUPPORTED)
02303 extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr,
02304    png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
02305 #endif
02306 
02307 #if defined(PNG_pHYs_SUPPORTED)
02308 extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
02309    png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
02310 #endif
02311 
02312 extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr,
02313    png_infop info_ptr, png_colorp *palette, int *num_palette));
02314 
02315 extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
02316    png_infop info_ptr, png_colorp palette, int num_palette));
02317 
02318 #if defined(PNG_sBIT_SUPPORTED)
02319 extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr,
02320    png_infop info_ptr, png_color_8p *sig_bit));
02321 #endif
02322 
02323 #if defined(PNG_sBIT_SUPPORTED)
02324 extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
02325    png_infop info_ptr, png_color_8p sig_bit));
02326 #endif
02327 
02328 #if defined(PNG_sRGB_SUPPORTED)
02329 extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr,
02330    png_infop info_ptr, int *intent));
02331 #endif
02332 
02333 #if defined(PNG_sRGB_SUPPORTED)
02334 extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
02335    png_infop info_ptr, int intent));
02336 extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
02337    png_infop info_ptr, int intent));
02338 #endif
02339 
02340 #if defined(PNG_iCCP_SUPPORTED)
02341 extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
02342    png_infop info_ptr, png_charpp name, int *compression_type,
02343    png_charpp profile, png_uint_32 *proflen));
02344    /* Note to maintainer: profile should be png_bytepp */
02345 #endif
02346 
02347 #if defined(PNG_iCCP_SUPPORTED)
02348 extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
02349    png_infop info_ptr, png_charp name, int compression_type,
02350    png_charp profile, png_uint_32 proflen));
02351    /* Note to maintainer: profile should be png_bytep */
02352 #endif
02353 
02354 #if defined(PNG_sPLT_SUPPORTED)
02355 extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr,
02356    png_infop info_ptr, png_sPLT_tpp entries));
02357 #endif
02358 
02359 #if defined(PNG_sPLT_SUPPORTED)
02360 extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
02361    png_infop info_ptr, png_sPLT_tp entries, int nentries));
02362 #endif
02363 
02364 #if defined(PNG_TEXT_SUPPORTED)
02365 /* png_get_text also returns the number of text chunks in *num_text */
02366 extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
02367    png_infop info_ptr, png_textp *text_ptr, int *num_text));
02368 #endif
02369 
02370 /*
02371  *  Note while png_set_text() will accept a structure whose text,
02372  *  language, and  translated keywords are NULL pointers, the structure
02373  *  returned by png_get_text will always contain regular
02374  *  zero-terminated C strings.  They might be empty strings but
02375  *  they will never be NULL pointers.
02376  */
02377 
02378 #if defined(PNG_TEXT_SUPPORTED)
02379 extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr,
02380    png_infop info_ptr, png_textp text_ptr, int num_text));
02381 #endif
02382 
02383 #if defined(PNG_tIME_SUPPORTED)
02384 extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr,
02385    png_infop info_ptr, png_timep *mod_time));
02386 #endif
02387 
02388 #if defined(PNG_tIME_SUPPORTED)
02389 extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr,
02390    png_infop info_ptr, png_timep mod_time));
02391 #endif
02392 
02393 #if defined(PNG_tRNS_SUPPORTED)
02394 extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr,
02395    png_infop info_ptr, png_bytep *trans, int *num_trans,
02396    png_color_16p *trans_values));
02397 #endif
02398 
02399 #if defined(PNG_tRNS_SUPPORTED)
02400 extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
02401    png_infop info_ptr, png_bytep trans, int num_trans,
02402    png_color_16p trans_values));
02403 #endif
02404 
02405 #if defined(PNG_tRNS_SUPPORTED)
02406 #endif
02407 
02408 #if defined(PNG_sCAL_SUPPORTED)
02409 #ifdef PNG_FLOATING_POINT_SUPPORTED
02410 extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr,
02411    png_infop info_ptr, int *unit, double *width, double *height));
02412 #else
02413 #ifdef PNG_FIXED_POINT_SUPPORTED
02414 extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr,
02415    png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
02416 #endif
02417 #endif
02418 #endif /* PNG_sCAL_SUPPORTED */
02419 
02420 #if defined(PNG_sCAL_SUPPORTED)
02421 #ifdef PNG_FLOATING_POINT_SUPPORTED
02422 extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr,
02423    png_infop info_ptr, int unit, double width, double height));
02424 #else
02425 #ifdef PNG_FIXED_POINT_SUPPORTED
02426 extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
02427    png_infop info_ptr, int unit, png_charp swidth, png_charp sheight));
02428 #endif
02429 #endif
02430 #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */
02431 
02432 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
02433 /* provide a list of chunks and how they are to be handled, if the built-in
02434    handling or default unknown chunk handling is not desired.  Any chunks not
02435    listed will be handled in the default manner.  The IHDR and IEND chunks
02436    must not be listed.
02437       keep = 0: follow default behaviour
02438            = 1: do not keep
02439            = 2: keep only if safe-to-copy
02440            = 3: keep even if unsafe-to-copy
02441 */
02442 extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
02443    png_ptr, int keep, png_bytep chunk_list, int num_chunks));
02444 extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
02445    png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
02446 extern PNG_EXPORT(void, png_set_unknown_chunk_location)
02447    PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location));
02448 extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
02449    png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
02450 #endif
02451 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
02452 PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
02453    chunk_name));
02454 #endif
02455 
02456 /* Png_free_data() will turn off the "valid" flag for anything it frees.
02457    If you need to turn it off for a chunk that your application has freed,
02458    you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */
02459 extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
02460    png_infop info_ptr, int mask));
02461 
02462 #if defined(PNG_INFO_IMAGE_SUPPORTED)
02463 /* The "params" pointer is currently not used and is for future expansion. */
02464 extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr,
02465                         png_infop info_ptr,
02466                         int transforms,
02467                         png_voidp params));
02468 extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
02469                         png_infop info_ptr,
02470                         int transforms,
02471                         png_voidp params));
02472 #endif
02473 
02474 /* Define PNG_DEBUG at compile time for debugging information.  Higher
02475  * numbers for PNG_DEBUG mean more debugging information.  This has
02476  * only been added since version 0.95 so it is not implemented throughout
02477  * libpng yet, but more support will be added as needed.
02478  */
02479 #ifdef PNG_DEBUG
02480 #if (PNG_DEBUG > 0)
02481 #if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
02482 #include <crtdbg.h>
02483 #if (PNG_DEBUG > 1)
02484 #define png_debug(l,m)  _RPT0(_CRT_WARN,m)
02485 #define png_debug1(l,m,p1)  _RPT1(_CRT_WARN,m,p1)
02486 #define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2)
02487 #endif
02488 #else /* PNG_DEBUG_FILE || !_MSC_VER */
02489 #ifndef PNG_DEBUG_FILE
02490 #define PNG_DEBUG_FILE stderr
02491 #endif /* PNG_DEBUG_FILE */
02492 #if (PNG_DEBUG > 1)
02493 #define png_debug(l,m) \
02494 { \
02495      int num_tabs=l; \
02496      fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
02497        (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
02498 }
02499 #define png_debug1(l,m,p1) \
02500 { \
02501      int num_tabs=l; \
02502      fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
02503        (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
02504 }
02505 #define png_debug2(l,m,p1,p2) \
02506 { \
02507      int num_tabs=l; \
02508      fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
02509        (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
02510 }
02511 #endif /* (PNG_DEBUG > 1) */
02512 #endif /* _MSC_VER */
02513 #endif /* (PNG_DEBUG > 0) */
02514 #endif /* PNG_DEBUG */
02515 #ifndef png_debug
02516 #define png_debug(l, m)
02517 #endif
02518 #ifndef png_debug1
02519 #define png_debug1(l, m, p1)
02520 #endif
02521 #ifndef png_debug2
02522 #define png_debug2(l, m, p1, p2)
02523 #endif
02524 
02525 extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr));
02526 extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr));
02527 extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr));
02528 extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
02529 
02530 #ifdef PNG_MNG_FEATURES_SUPPORTED
02531 extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
02532    png_ptr, png_uint_32 mng_features_permitted));
02533 #endif
02534 
02535 /* For use in png_set_keep_unknown, added to version 1.2.6 */
02536 #define PNG_HANDLE_CHUNK_AS_DEFAULT   0
02537 #define PNG_HANDLE_CHUNK_NEVER        1
02538 #define PNG_HANDLE_CHUNK_IF_SAFE      2
02539 #define PNG_HANDLE_CHUNK_ALWAYS       3
02540 
02541 /* Added to version 1.2.0 */
02542 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
02543 #if defined(PNG_MMX_CODE_SUPPORTED)
02544 #define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED  0x01  /* not user-settable */
02545 #define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU    0x02  /* not user-settable */
02546 #define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  0x04
02547 #define PNG_ASM_FLAG_MMX_READ_INTERLACE    0x08
02548 #define PNG_ASM_FLAG_MMX_READ_FILTER_SUB   0x10
02549 #define PNG_ASM_FLAG_MMX_READ_FILTER_UP    0x20
02550 #define PNG_ASM_FLAG_MMX_READ_FILTER_AVG   0x40
02551 #define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
02552 #define PNG_ASM_FLAGS_INITIALIZED          0x80000000  /* not user-settable */
02553 
02554 #define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  \
02555                            | PNG_ASM_FLAG_MMX_READ_INTERLACE    \
02556                            | PNG_ASM_FLAG_MMX_READ_FILTER_SUB   \
02557                            | PNG_ASM_FLAG_MMX_READ_FILTER_UP    \
02558                            | PNG_ASM_FLAG_MMX_READ_FILTER_AVG   \
02559                            | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH )
02560 #define PNG_MMX_WRITE_FLAGS ( 0 )
02561 
02562 #define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \
02563                       | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU   \
02564                       | PNG_MMX_READ_FLAGS                \
02565                       | PNG_MMX_WRITE_FLAGS )
02566 
02567 #define PNG_SELECT_READ   1
02568 #define PNG_SELECT_WRITE  2
02569 #endif /* PNG_MMX_CODE_SUPPORTED */
02570 
02571 #if !defined(PNG_1_0_X)
02572 /* pngget.c */
02573 extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask)
02574    PNGARG((int flag_select, int *compilerID));
02575 
02576 /* pngget.c */
02577 extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask)
02578    PNGARG((int flag_select));
02579 
02580 /* pngget.c */
02581 extern PNG_EXPORT(png_uint_32,png_get_asm_flags)
02582    PNGARG((png_structp png_ptr));
02583 
02584 /* pngget.c */
02585 extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold)
02586    PNGARG((png_structp png_ptr));
02587 
02588 /* pngget.c */
02589 extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold)
02590    PNGARG((png_structp png_ptr));
02591 
02592 /* pngset.c */
02593 extern PNG_EXPORT(void,png_set_asm_flags)
02594    PNGARG((png_structp png_ptr, png_uint_32 asm_flags));
02595 
02596 /* pngset.c */
02597 extern PNG_EXPORT(void,png_set_mmx_thresholds)
02598    PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold,
02599    png_uint_32 mmx_rowbytes_threshold));
02600 
02601 #endif /* PNG_1_0_X */
02602 
02603 #if !defined(PNG_1_0_X)
02604 /* png.c, pnggccrd.c, or pngvcrd.c */
02605 extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
02606 #endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
02607 
02608 /* Strip the prepended error numbers ("#nnn ") from error and warning
02609  * messages before passing them to the error or warning handler. */
02610 #ifdef PNG_ERROR_NUMBERS_SUPPORTED
02611 extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
02612    png_ptr, png_uint_32 strip_mode));
02613 #endif
02614 
02615 #endif /* PNG_1_0_X */
02616 
02617 /* Added at libpng-1.2.6 */
02618 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
02619 extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
02620    png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
02621 extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
02622    png_ptr));
02623 extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
02624    png_ptr));
02625 #endif
02626 
02627 /* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
02628 
02629 #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
02630 /* With these routines we avoid an integer divide, which will be slower on
02631  * most machines.  However, it does take more operations than the corresponding
02632  * divide method, so it may be slower on a few RISC systems.  There are two
02633  * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.
02634  *
02635  * Note that the rounding factors are NOT supposed to be the same!  128 and
02636  * 32768 are correct for the NODIV code; 127 and 32767 are correct for the
02637  * standard method.
02638  *
02639  * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]
02640  */
02641 
02642  /* fg and bg should be in `gamma 1.0' space; alpha is the opacity          */
02643 
02644 #  define png_composite(composite, fg, alpha, bg)                            \
02645      { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \
02646                         +        (png_uint_16)(bg)*(png_uint_16)(255 -       \
02647                         (png_uint_16)(alpha)) + (png_uint_16)128);           \
02648        (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }
02649 
02650 #  define png_composite_16(composite, fg, alpha, bg)                         \
02651      { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \
02652                         + (png_uint_32)(bg)*(png_uint_32)(65535L -           \
02653                         (png_uint_32)(alpha)) + (png_uint_32)32768L);        \
02654        (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
02655 
02656 #else  /* standard method using integer division */
02657 
02658 #  define png_composite(composite, fg, alpha, bg)                            \
02659      (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +    \
02660        (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \
02661        (png_uint_16)127) / 255)
02662 
02663 #  define png_composite_16(composite, fg, alpha, bg)                         \
02664      (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
02665        (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) +      \
02666        (png_uint_32)32767) / (png_uint_32)65535L)
02667 
02668 #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
02669 
02670 /* Inline macros to do direct reads of bytes from the input buffer.  These
02671  * require that you are using an architecture that uses PNG byte ordering
02672  * (MSB first) and supports unaligned data storage.  I think that PowerPC
02673  * in big-endian mode and 680x0 are the only ones that will support this.
02674  * The x86 line of processors definitely do not.  The png_get_int_32()
02675  * routine also assumes we are using two's complement format for negative
02676  * values, which is almost certainly true.
02677  */
02678 #if defined(PNG_READ_BIG_ENDIAN_SUPPORTED)
02679 #  define png_get_uint_32(buf) ( *((png_uint_32p) (buf)))
02680 #  define png_get_uint_16(buf) ( *((png_uint_16p) (buf)))
02681 #  define png_get_int_32(buf)  ( *((png_int_32p)  (buf)))
02682 #else
02683 extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf));
02684 extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf));
02685 extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf));
02686 #endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
02687 extern PNG_EXPORT(png_uint_32,png_get_uint_31)
02688   PNGARG((png_structp png_ptr, png_bytep buf));
02689 /* No png_get_int_16 -- may be added if there's a real need for it. */
02690 
02691 /* Place a 32-bit number into a buffer in PNG byte order (big-endian).
02692  */
02693 extern PNG_EXPORT(void,png_save_uint_32)
02694    PNGARG((png_bytep buf, png_uint_32 i));
02695 extern PNG_EXPORT(void,png_save_int_32)
02696    PNGARG((png_bytep buf, png_int_32 i));
02697 
02698 /* Place a 16-bit number into a buffer in PNG byte order.
02699  * The parameter is declared unsigned int, not png_uint_16,
02700  * just to avoid potential problems on pre-ANSI C compilers.
02701  */
02702 extern PNG_EXPORT(void,png_save_uint_16)
02703    PNGARG((png_bytep buf, unsigned int i));
02704 /* No png_save_int_16 -- may be added if there's a real need for it. */
02705 
02706 /* ************************************************************************* */
02707 
02708 /* These next functions are used internally in the code.  They generally
02709  * shouldn't be used unless you are writing code to add or replace some
02710  * functionality in libpng.  More information about most functions can
02711  * be found in the files where the functions are located.
02712  */
02713 
02714 
02715 /* Various modes of operation, that are visible to applications because
02716  * they are used for unknown chunk location.
02717  */
02718 #define PNG_HAVE_IHDR               0x01
02719 #define PNG_HAVE_PLTE               0x02
02720 #define PNG_HAVE_IDAT               0x04
02721 #define PNG_AFTER_IDAT              0x08 /* Have complete zlib datastream */
02722 #define PNG_HAVE_IEND               0x10
02723 
02724 #if defined(PNG_INTERNAL)
02725 
02726 /* More modes of operation.  Note that after an init, mode is set to
02727  * zero automatically when the structure is created.
02728  */
02729 #define PNG_HAVE_gAMA               0x20
02730 #define PNG_HAVE_cHRM               0x40
02731 #define PNG_HAVE_sRGB               0x80
02732 #define PNG_HAVE_CHUNK_HEADER      0x100
02733 #define PNG_WROTE_tIME             0x200
02734 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400
02735 #define PNG_BACKGROUND_IS_GRAY     0x800
02736 #define PNG_HAVE_PNG_SIGNATURE    0x1000
02737 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
02738 
02739 /* flags for the transformations the PNG library does on the image data */
02740 #define PNG_BGR                0x0001
02741 #define PNG_INTERLACE          0x0002
02742 #define PNG_PACK               0x0004
02743 #define PNG_SHIFT              0x0008
02744 #define PNG_SWAP_BYTES         0x0010
02745 #define PNG_INVERT_MONO        0x0020
02746 #define PNG_DITHER             0x0040
02747 #define PNG_BACKGROUND         0x0080
02748 #define PNG_BACKGROUND_EXPAND  0x0100
02749                           /*   0x0200 unused */
02750 #define PNG_16_TO_8            0x0400
02751 #define PNG_RGBA               0x0800
02752 #define PNG_EXPAND             0x1000
02753 #define PNG_GAMMA              0x2000
02754 #define PNG_GRAY_TO_RGB        0x4000
02755 #define PNG_FILLER             0x8000L
02756 #define PNG_PACKSWAP          0x10000L
02757 #define PNG_SWAP_ALPHA        0x20000L
02758 #define PNG_STRIP_ALPHA       0x40000L
02759 #define PNG_INVERT_ALPHA      0x80000L
02760 #define PNG_USER_TRANSFORM   0x100000L
02761 #define PNG_RGB_TO_GRAY_ERR  0x200000L
02762 #define PNG_RGB_TO_GRAY_WARN 0x400000L
02763 #define PNG_RGB_TO_GRAY      0x600000L  /* two bits, RGB_TO_GRAY_ERR|WARN */
02764                        /*    0x800000L     Unused */
02765 #define PNG_ADD_ALPHA       0x1000000L  /* Added to libpng-1.2.7 */
02766 #define PNG_EXPAND_tRNS     0x2000000L  /* Added to libpng-1.2.9 */
02767                        /*   0x4000000L  unused */
02768                        /*   0x8000000L  unused */
02769                        /*  0x10000000L  unused */
02770                        /*  0x20000000L  unused */
02771                        /*  0x40000000L  unused */
02772 
02773 /* flags for png_create_struct */
02774 #define PNG_STRUCT_PNG   0x0001
02775 #define PNG_STRUCT_INFO  0x0002
02776 
02777 /* Scaling factor for filter heuristic weighting calculations */
02778 #define PNG_WEIGHT_SHIFT 8
02779 #define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT))
02780 #define PNG_COST_SHIFT 3
02781 #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
02782 
02783 /* flags for the png_ptr->flags rather than declaring a byte for each one */
02784 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001
02785 #define PNG_FLAG_ZLIB_CUSTOM_LEVEL        0x0002
02786 #define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL    0x0004
02787 #define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS  0x0008
02788 #define PNG_FLAG_ZLIB_CUSTOM_METHOD       0x0010
02789 #define PNG_FLAG_ZLIB_FINISHED            0x0020
02790 #define PNG_FLAG_ROW_INIT                 0x0040
02791 #define PNG_FLAG_FILLER_AFTER             0x0080
02792 #define PNG_FLAG_CRC_ANCILLARY_USE        0x0100
02793 #define PNG_FLAG_CRC_ANCILLARY_NOWARN     0x0200
02794 #define PNG_FLAG_CRC_CRITICAL_USE         0x0400
02795 #define PNG_FLAG_CRC_CRITICAL_IGNORE      0x0800
02796 #define PNG_FLAG_FREE_PLTE                0x1000
02797 #define PNG_FLAG_FREE_TRNS                0x2000
02798 #define PNG_FLAG_FREE_HIST                0x4000
02799 #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS      0x8000L
02800 #define PNG_FLAG_KEEP_UNSAFE_CHUNKS       0x10000L
02801 #define PNG_FLAG_LIBRARY_MISMATCH         0x20000L
02802 #define PNG_FLAG_STRIP_ERROR_NUMBERS      0x40000L
02803 #define PNG_FLAG_STRIP_ERROR_TEXT         0x80000L
02804 #define PNG_FLAG_MALLOC_NULL_MEM_OK       0x100000L
02805 #define PNG_FLAG_ADD_ALPHA                0x200000L  /* Added to libpng-1.2.8 */
02806 #define PNG_FLAG_STRIP_ALPHA              0x400000L  /* Added to libpng-1.2.8 */
02807                                   /*      0x800000L  unused */
02808                                   /*     0x1000000L  unused */
02809                                   /*     0x2000000L  unused */
02810                                   /*     0x4000000L  unused */
02811                                   /*     0x8000000L  unused */
02812                                   /*    0x10000000L  unused */
02813                                   /*    0x20000000L  unused */
02814                                   /*    0x40000000L  unused */
02815 
02816 #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
02817                                      PNG_FLAG_CRC_ANCILLARY_NOWARN)
02818 
02819 #define PNG_FLAG_CRC_CRITICAL_MASK  (PNG_FLAG_CRC_CRITICAL_USE | \
02820                                      PNG_FLAG_CRC_CRITICAL_IGNORE)
02821 
02822 #define PNG_FLAG_CRC_MASK           (PNG_FLAG_CRC_ANCILLARY_MASK | \
02823                                      PNG_FLAG_CRC_CRITICAL_MASK)
02824 
02825 /* save typing and make code easier to understand */
02826 
02827 #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
02828    abs((int)((c1).green) - (int)((c2).green)) + \
02829    abs((int)((c1).blue) - (int)((c2).blue)))
02830 
02831 /* Added to libpng-1.2.6 JB */
02832 #define PNG_ROWBYTES(pixel_bits, width) \
02833     ((pixel_bits) >= 8 ? \
02834     ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \
02835     (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) )
02836 
02837 /* PNG_OUT_OF_RANGE returns true if value is outside the range
02838    ideal-delta..ideal+delta.  Each argument is evaluated twice.
02839    "ideal" and "delta" should be constants, normally simple
02840    integers, "value" a variable. Added to libpng-1.2.6 JB */
02841 #define PNG_OUT_OF_RANGE(value, ideal, delta) \
02842         ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
02843 
02844 /* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
02845 #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
02846 /* place to hold the signature string for a PNG file. */
02847 #ifdef PNG_USE_GLOBAL_ARRAYS
02848    PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8];
02849 #else
02850 #endif
02851 #endif /* PNG_NO_EXTERN */
02852 
02853 /* Constant strings for known chunk types.  If you need to add a chunk,
02854  * define the name here, and add an invocation of the macro in png.c and
02855  * wherever it's needed.
02856  */
02857 #define PNG_IHDR png_byte png_IHDR[5] = { 73,  72,  68,  82, '\0'}
02858 #define PNG_IDAT png_byte png_IDAT[5] = { 73,  68,  65,  84, '\0'}
02859 #define PNG_IEND png_byte png_IEND[5] = { 73,  69,  78,  68, '\0'}
02860 #define PNG_PLTE png_byte png_PLTE[5] = { 80,  76,  84,  69, '\0'}
02861 #define PNG_bKGD png_byte png_bKGD[5] = { 98,  75,  71,  68, '\0'}
02862 #define PNG_cHRM png_byte png_cHRM[5] = { 99,  72,  82,  77, '\0'}
02863 #define PNG_gAMA png_byte png_gAMA[5] = {103,  65,  77,  65, '\0'}
02864 #define PNG_hIST png_byte png_hIST[5] = {104,  73,  83,  84, '\0'}
02865 #define PNG_iCCP png_byte png_iCCP[5] = {105,  67,  67,  80, '\0'}
02866 #define PNG_iTXt png_byte png_iTXt[5] = {105,  84,  88, 116, '\0'}
02867 #define PNG_oFFs png_byte png_oFFs[5] = {111,  70,  70, 115, '\0'}
02868 #define PNG_pCAL png_byte png_pCAL[5] = {112,  67,  65,  76, '\0'}
02869 #define PNG_sCAL png_byte png_sCAL[5] = {115,  67,  65,  76, '\0'}
02870 #define PNG_pHYs png_byte png_pHYs[5] = {112,  72,  89, 115, '\0'}
02871 #define PNG_sBIT png_byte png_sBIT[5] = {115,  66,  73,  84, '\0'}
02872 #define PNG_sPLT png_byte png_sPLT[5] = {115,  80,  76,  84, '\0'}
02873 #define PNG_sRGB png_byte png_sRGB[5] = {115,  82,  71,  66, '\0'}
02874 #define PNG_tEXt png_byte png_tEXt[5] = {116,  69,  88, 116, '\0'}
02875 #define PNG_tIME png_byte png_tIME[5] = {116,  73,  77,  69, '\0'}
02876 #define PNG_tRNS png_byte png_tRNS[5] = {116,  82,  78,  83, '\0'}
02877 #define PNG_zTXt png_byte png_zTXt[5] = {122,  84,  88, 116, '\0'}
02878 
02879 #ifdef PNG_USE_GLOBAL_ARRAYS
02880 PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5];
02881 PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5];
02882 PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5];
02883 PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5];
02884 PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5];
02885 PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5];
02886 PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5];
02887 PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5];
02888 PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5];
02889 PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5];
02890 PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5];
02891 PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5];
02892 PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5];
02893 PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5];
02894 PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5];
02895 PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5];
02896 PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5];
02897 PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5];
02898 PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5];
02899 PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5];
02900 PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5];
02901 #endif /* PNG_USE_GLOBAL_ARRAYS */
02902 
02903 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
02904 /* Initialize png_ptr struct for reading, and allocate any other memory.
02905  * (old interface - DEPRECATED - use png_create_read_struct instead).
02906  */
02907 extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
02908 #undef png_read_init
02909 #define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
02910     PNG_LIBPNG_VER_STRING,  png_sizeof(png_struct));
02911 #endif
02912 
02913 extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
02914     png_const_charp user_png_ver, png_size_t png_struct_size));
02915 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
02916 extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
02917     png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
02918     png_info_size));
02919 #endif
02920 
02921 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
02922 /* Initialize png_ptr struct for writing, and allocate any other memory.
02923  * (old interface - DEPRECATED - use png_create_write_struct instead).
02924  */
02925 extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
02926 #undef png_write_init
02927 #define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
02928     PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
02929 #endif
02930 
02931 extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
02932     png_const_charp user_png_ver, png_size_t png_struct_size));
02933 extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr,
02934     png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
02935     png_info_size));
02936 
02937 /* Allocate memory for an internal libpng struct */
02938 PNG_EXTERN png_voidp png_create_struct PNGARG((int type));
02939 
02940 /* Free memory from internal libpng struct */
02941 PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
02942 
02943 PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr
02944   malloc_fn, png_voidp mem_ptr));
02945 PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
02946    png_free_ptr free_fn, png_voidp mem_ptr));
02947 
02948 /* Free any memory that info_ptr points to and reset struct. */
02949 PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
02950    png_infop info_ptr));
02951 
02952 #ifndef PNG_1_0_X
02953 /* Function to allocate memory for zlib. */
02954 PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
02955 
02956 /* Function to free memory for zlib */
02957 PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
02958 
02959 #ifdef PNG_SIZE_T
02960 /* Function to convert a sizeof an item to png_sizeof item */
02961    PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
02962 #endif
02963 
02964 /* Next four functions are used internally as callbacks.  PNGAPI is required
02965  * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3. */
02966 
02967 PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
02968    png_bytep data, png_size_t length));
02969 
02970 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
02971 PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
02972    png_bytep buffer, png_size_t length));
02973 #endif
02974 
02975 PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
02976    png_bytep data, png_size_t length));
02977 
02978 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
02979 #if !defined(PNG_NO_STDIO)
02980 PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
02981 #endif
02982 #endif
02983 #else /* PNG_1_0_X */
02984 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
02985 PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
02986    png_bytep buffer, png_size_t length));
02987 #endif
02988 #endif /* PNG_1_0_X */
02989 
02990 /* Reset the CRC variable */
02991 PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
02992 
02993 /* Write the "data" buffer to whatever output you are using. */
02994 PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data,
02995    png_size_t length));
02996 
02997 /* Read data from whatever input you are using into the "data" buffer */
02998 PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
02999    png_size_t length));
03000 
03001 /* Read bytes into buf, and update png_ptr->crc */
03002 PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
03003    png_size_t length));
03004 
03005 /* Decompress data in a chunk that uses compression */
03006 #if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
03007     defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
03008 PNG_EXTERN png_charp png_decompress_chunk PNGARG((png_structp png_ptr,
03009    int comp_type, png_charp chunkdata, png_size_t chunklength,
03010    png_size_t prefix_length, png_size_t *data_length));
03011 #endif
03012 
03013 /* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
03014 PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
03015 
03016 /* Read the CRC from the file and compare it to the libpng calculated CRC */
03017 PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
03018 
03019 /* Calculate the CRC over a section of data.  Note that we are only
03020  * passing a maximum of 64K on systems that have this as a memory limit,
03021  * since this is the maximum buffer size we can specify.
03022  */
03023 PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
03024    png_size_t length));
03025 
03026 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
03027 PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
03028 #endif
03029 
03030 /* simple function to write the signature */
03031 PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr));
03032 
03033 /* write various chunks */
03034 
03035 /* Write the IHDR chunk, and update the png_struct with the necessary
03036  * information.
03037  */
03038 PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
03039    png_uint_32 height,
03040    int bit_depth, int color_type, int compression_method, int filter_method,
03041    int interlace_method));
03042 
03043 PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette,
03044    png_uint_32 num_pal));
03045 
03046 PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
03047    png_size_t length));
03048 
03049 PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
03050 
03051 #if defined(PNG_WRITE_gAMA_SUPPORTED)
03052 #ifdef PNG_FLOATING_POINT_SUPPORTED
03053 PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
03054 #endif
03055 #ifdef PNG_FIXED_POINT_SUPPORTED
03056 PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point
03057     file_gamma));
03058 #endif
03059 #endif
03060 
03061 #if defined(PNG_WRITE_sBIT_SUPPORTED)
03062 PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit,
03063    int color_type));
03064 #endif
03065 
03066 #if defined(PNG_WRITE_cHRM_SUPPORTED)
03067 #ifdef PNG_FLOATING_POINT_SUPPORTED
03068 PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
03069    double white_x, double white_y,
03070    double red_x, double red_y, double green_x, double green_y,
03071    double blue_x, double blue_y));
03072 #endif
03073 #ifdef PNG_FIXED_POINT_SUPPORTED
03074 PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
03075    png_fixed_point int_white_x, png_fixed_point int_white_y,
03076    png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
03077    int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
03078    png_fixed_point int_blue_y));
03079 #endif
03080 #endif
03081 
03082 #if defined(PNG_WRITE_sRGB_SUPPORTED)
03083 PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
03084    int intent));
03085 #endif
03086 
03087 #if defined(PNG_WRITE_iCCP_SUPPORTED)
03088 PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
03089    png_charp name, int compression_type,
03090    png_charp profile, int proflen));
03091    /* Note to maintainer: profile should be png_bytep */
03092 #endif
03093 
03094 #if defined(PNG_WRITE_sPLT_SUPPORTED)
03095 PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
03096    png_sPLT_tp palette));
03097 #endif
03098 
03099 #if defined(PNG_WRITE_tRNS_SUPPORTED)
03100 PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans,
03101    png_color_16p values, int number, int color_type));
03102 #endif
03103 
03104 #if defined(PNG_WRITE_bKGD_SUPPORTED)
03105 PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
03106    png_color_16p values, int color_type));
03107 #endif
03108 
03109 #if defined(PNG_WRITE_hIST_SUPPORTED)
03110 PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist,
03111    int num_hist));
03112 #endif
03113 
03114 #if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
03115     defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
03116 PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
03117    png_charp key, png_charpp new_key));
03118 #endif
03119 
03120 #if defined(PNG_WRITE_tEXt_SUPPORTED)
03121 PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key,
03122    png_charp text, png_size_t text_len));
03123 #endif
03124 
03125 #if defined(PNG_WRITE_zTXt_SUPPORTED)
03126 PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key,
03127    png_charp text, png_size_t text_len, int compression));
03128 #endif
03129 
03130 #if defined(PNG_WRITE_iTXt_SUPPORTED)
03131 PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
03132    int compression, png_charp key, png_charp lang, png_charp lang_key,
03133    png_charp text));
03134 #endif
03135 
03136 #if defined(PNG_TEXT_SUPPORTED)  /* Added at version 1.0.14 and 1.2.4 */
03137 PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
03138    png_infop info_ptr, png_textp text_ptr, int num_text));
03139 #endif
03140 
03141 #if defined(PNG_WRITE_oFFs_SUPPORTED)
03142 PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
03143    png_int_32 x_offset, png_int_32 y_offset, int unit_type));
03144 #endif
03145 
03146 #if defined(PNG_WRITE_pCAL_SUPPORTED)
03147 PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
03148    png_int_32 X0, png_int_32 X1, int type, int nparams,
03149    png_charp units, png_charpp params));
03150 #endif
03151 
03152 #if defined(PNG_WRITE_pHYs_SUPPORTED)
03153 PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
03154    png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
03155    int unit_type));
03156 #endif
03157 
03158 #if defined(PNG_WRITE_tIME_SUPPORTED)
03159 PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
03160    png_timep mod_time));
03161 #endif
03162 
03163 #if defined(PNG_WRITE_sCAL_SUPPORTED)
03164 #if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
03165 PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr,
03166    int unit, double width, double height));
03167 #else
03168 #ifdef PNG_FIXED_POINT_SUPPORTED
03169 PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
03170    int unit, png_charp width, png_charp height));
03171 #endif
03172 #endif
03173 #endif
03174 
03175 /* Called when finished processing a row of data */
03176 PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
03177 
03178 /* Internal use only.   Called before first row of data */
03179 PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
03180 
03181 #if defined(PNG_READ_GAMMA_SUPPORTED)
03182 PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr));
03183 #endif
03184 
03185 /* combine a row of data, dealing with alpha, etc. if requested */
03186 PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
03187    int mask));
03188 
03189 #if defined(PNG_READ_INTERLACING_SUPPORTED)
03190 /* expand an interlaced row */
03191 /* OLD pre-1.0.9 interface:
03192 PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
03193    png_bytep row, int pass, png_uint_32 transformations));
03194  */
03195 PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
03196 #endif
03197 
03198 /* GRR TO DO (2.0 or whenever):  simplify other internal calling interfaces */
03199 
03200 #if defined(PNG_WRITE_INTERLACING_SUPPORTED)
03201 /* grab pixels out of a row for an interlaced pass */
03202 PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
03203    png_bytep row, int pass));
03204 #endif
03205 
03206 /* unfilter a row */
03207 PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
03208    png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter));
03209 
03210 /* Choose the best filter to use and filter the row data */
03211 PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
03212    png_row_infop row_info));
03213 
03214 /* Write out the filtered row. */
03215 PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
03216    png_bytep filtered_row));
03217 /* finish a row while reading, dealing with interlacing passes, etc. */
03218 PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
03219 
03220 /* initialize the row buffers, etc. */
03221 PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
03222 /* optional call to update the users info structure */
03223 PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
03224    png_infop info_ptr));
03225 
03226 /* these are the functions that do the transformations */
03227 #if defined(PNG_READ_FILLER_SUPPORTED)
03228 PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
03229    png_bytep row, png_uint_32 filler, png_uint_32 flags));
03230 #endif
03231 
03232 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
03233 PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
03234    png_bytep row));
03235 #endif
03236 
03237 #if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
03238 PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
03239    png_bytep row));
03240 #endif
03241 
03242 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
03243 PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
03244    png_bytep row));
03245 #endif
03246 
03247 #if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
03248 PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
03249    png_bytep row));
03250 #endif
03251 
03252 #if defined(PNG_WRITE_FILLER_SUPPORTED) || \
03253     defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
03254 PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
03255    png_bytep row, png_uint_32 flags));
03256 #endif
03257 
03258 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
03259 PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row));
03260 #endif
03261 
03262 #if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
03263 PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row));
03264 #endif
03265 
03266 #if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
03267 PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop
03268    row_info, png_bytep row));
03269 #endif
03270 
03271 #if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
03272 PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
03273    png_bytep row));
03274 #endif
03275 
03276 #if defined(PNG_READ_PACK_SUPPORTED)
03277 PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row));
03278 #endif
03279 
03280 #if defined(PNG_READ_SHIFT_SUPPORTED)
03281 PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row,
03282    png_color_8p sig_bits));
03283 #endif
03284 
03285 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
03286 PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row));
03287 #endif
03288 
03289 #if defined(PNG_READ_16_TO_8_SUPPORTED)
03290 PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row));
03291 #endif
03292 
03293 #if defined(PNG_READ_DITHER_SUPPORTED)
03294 PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info,
03295    png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup));
03296 
03297 #  if defined(PNG_CORRECT_PALETTE_SUPPORTED)
03298 PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
03299    png_colorp palette, int num_palette));
03300 #  endif
03301 #endif
03302 
03303 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
03304 PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row));
03305 #endif
03306 
03307 #if defined(PNG_WRITE_PACK_SUPPORTED)
03308 PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
03309    png_bytep row, png_uint_32 bit_depth));
03310 #endif
03311 
03312 #if defined(PNG_WRITE_SHIFT_SUPPORTED)
03313 PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row,
03314    png_color_8p bit_depth));
03315 #endif
03316 
03317 #if defined(PNG_READ_BACKGROUND_SUPPORTED)
03318 #if defined(PNG_READ_GAMMA_SUPPORTED)
03319 PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
03320    png_color_16p trans_values, png_color_16p background,
03321    png_color_16p background_1,
03322    png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
03323    png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
03324    png_uint_16pp gamma_16_to_1, int gamma_shift));
03325 #else
03326 PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
03327    png_color_16p trans_values, png_color_16p background));
03328 #endif
03329 #endif
03330 
03331 #if defined(PNG_READ_GAMMA_SUPPORTED)
03332 PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row,
03333    png_bytep gamma_table, png_uint_16pp gamma_16_table,
03334    int gamma_shift));
03335 #endif
03336 
03337 #if defined(PNG_READ_EXPAND_SUPPORTED)
03338 PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
03339    png_bytep row, png_colorp palette, png_bytep trans, int num_trans));
03340 PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
03341    png_bytep row, png_color_16p trans_value));
03342 #endif
03343 
03344 /* The following decodes the appropriate chunks, and does error correction,
03345  * then calls the appropriate callback for the chunk if it is valid.
03346  */
03347 
03348 /* decode the IHDR chunk */
03349 PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
03350    png_uint_32 length));
03351 PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
03352    png_uint_32 length));
03353 PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
03354    png_uint_32 length));
03355 
03356 #if defined(PNG_READ_bKGD_SUPPORTED)
03357 PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
03358    png_uint_32 length));
03359 #endif
03360 
03361 #if defined(PNG_READ_cHRM_SUPPORTED)
03362 PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
03363    png_uint_32 length));
03364 #endif
03365 
03366 #if defined(PNG_READ_gAMA_SUPPORTED)
03367 PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
03368    png_uint_32 length));
03369 #endif
03370 
03371 #if defined(PNG_READ_hIST_SUPPORTED)
03372 PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
03373    png_uint_32 length));
03374 #endif
03375 
03376 #if defined(PNG_READ_iCCP_SUPPORTED)
03377 extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
03378    png_uint_32 length));
03379 #endif /* PNG_READ_iCCP_SUPPORTED */
03380 
03381 #if defined(PNG_READ_iTXt_SUPPORTED)
03382 PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
03383    png_uint_32 length));
03384 #endif
03385 
03386 #if defined(PNG_READ_oFFs_SUPPORTED)
03387 PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
03388    png_uint_32 length));
03389 #endif
03390 
03391 #if defined(PNG_READ_pCAL_SUPPORTED)
03392 PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
03393    png_uint_32 length));
03394 #endif
03395 
03396 #if defined(PNG_READ_pHYs_SUPPORTED)
03397 PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
03398    png_uint_32 length));
03399 #endif
03400 
03401 #if defined(PNG_READ_sBIT_SUPPORTED)
03402 PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
03403    png_uint_32 length));
03404 #endif
03405 
03406 #if defined(PNG_READ_sCAL_SUPPORTED)
03407 PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
03408    png_uint_32 length));
03409 #endif
03410 
03411 #if defined(PNG_READ_sPLT_SUPPORTED)
03412 extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
03413    png_uint_32 length));
03414 #endif /* PNG_READ_sPLT_SUPPORTED */
03415 
03416 #if defined(PNG_READ_sRGB_SUPPORTED)
03417 PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
03418    png_uint_32 length));
03419 #endif
03420 
03421 #if defined(PNG_READ_tEXt_SUPPORTED)
03422 PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
03423    png_uint_32 length));
03424 #endif
03425 
03426 #if defined(PNG_READ_tIME_SUPPORTED)
03427 PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
03428    png_uint_32 length));
03429 #endif
03430 
03431 #if defined(PNG_READ_tRNS_SUPPORTED)
03432 PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
03433    png_uint_32 length));
03434 #endif
03435 
03436 #if defined(PNG_READ_zTXt_SUPPORTED)
03437 PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
03438    png_uint_32 length));
03439 #endif
03440 
03441 PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
03442    png_infop info_ptr, png_uint_32 length));
03443 
03444 PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
03445    png_bytep chunk_name));
03446 
03447 /* handle the transformations for reading and writing */
03448 PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
03449 PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
03450 
03451 PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
03452 
03453 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
03454 PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
03455    png_infop info_ptr));
03456 PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
03457    png_infop info_ptr));
03458 PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
03459 PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
03460    png_uint_32 length));
03461 PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
03462 PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
03463 PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
03464    png_bytep buffer, png_size_t buffer_length));
03465 PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
03466 PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
03467    png_bytep buffer, png_size_t buffer_length));
03468 PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
03469 PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
03470    png_infop info_ptr, png_uint_32 length));
03471 PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
03472    png_infop info_ptr));
03473 PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
03474    png_infop info_ptr));
03475 PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
03476 PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
03477    png_infop info_ptr));
03478 PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
03479    png_infop info_ptr));
03480 PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
03481 #if defined(PNG_READ_tEXt_SUPPORTED)
03482 PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
03483    png_infop info_ptr, png_uint_32 length));
03484 PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
03485    png_infop info_ptr));
03486 #endif
03487 #if defined(PNG_READ_zTXt_SUPPORTED)
03488 PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
03489    png_infop info_ptr, png_uint_32 length));
03490 PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
03491    png_infop info_ptr));
03492 #endif
03493 #if defined(PNG_READ_iTXt_SUPPORTED)
03494 PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
03495    png_infop info_ptr, png_uint_32 length));
03496 PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
03497    png_infop info_ptr));
03498 #endif
03499 
03500 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
03501 
03502 #ifdef PNG_MNG_FEATURES_SUPPORTED
03503 PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
03504    png_bytep row));
03505 PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
03506    png_bytep row));
03507 #endif
03508 
03509 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
03510 #if defined(PNG_MMX_CODE_SUPPORTED)
03511 /* png.c */ /* PRIVATE */
03512 PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr));
03513 #endif
03514 #endif
03515 
03516 #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
03517 PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr,
03518 png_infop info_ptr));
03519 
03520 PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr,
03521 png_infop info_ptr));
03522 
03523 PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr,
03524 png_infop info_ptr));
03525 
03526 PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr,
03527 png_infop info_ptr));
03528 
03529 PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr,
03530 png_infop info_ptr));
03531 
03532 #if defined(PNG_pHYs_SUPPORTED)
03533 PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr,
03534 png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
03535 #endif /* PNG_pHYs_SUPPORTED */
03536 #endif  /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
03537 
03538 /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
03539 
03540 #endif /* PNG_INTERNAL */
03541 
03542 #ifdef __cplusplus
03543 }
03544 #endif
03545 
03546 #endif /* PNG_VERSION_INFO_ONLY */
03547 /* do not put anything past this line */
03548 #endif /* PNG_H */

Generated on Tue Jul 5 14:13:31 2011 for ROOT_528-00b_version by  doxygen 1.5.1