Navit SVN

/work/compile/navit/src/navit/support/libpng/pngconf.h

00001 
00002 /* pngconf.h - machine configurable file for libpng
00003  *
00004  * libpng version 1.2.36 - May 7, 2009
00005  * For conditions of distribution and use, see copyright notice in png.h
00006  * Copyright (c) 1998-2009 Glenn Randers-Pehrson
00007  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
00008  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
00009  */
00010 
00011 /* Any machine specific code is near the front of this file, so if you
00012  * are configuring libpng for a machine, you may want to read the section
00013  * starting here down to where it starts to typedef png_color, png_text,
00014  * and png_info.
00015  */
00016 
00017 #ifndef PNGCONF_H
00018 #define PNGCONF_H
00019 
00020 #define PNG_1_2_X
00021 
00022 /* 
00023  * PNG_USER_CONFIG has to be defined on the compiler command line. This
00024  * includes the resource compiler for Windows DLL configurations.
00025  */
00026 #ifdef PNG_USER_CONFIG
00027 #  ifndef PNG_USER_PRIVATEBUILD
00028 #    define PNG_USER_PRIVATEBUILD
00029 #  endif
00030 #include "pngusr.h"
00031 #endif
00032 
00033 /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
00034 #ifdef PNG_CONFIGURE_LIBPNG
00035 #ifdef HAVE_CONFIG_H
00036 #include "config.h"
00037 #endif
00038 #endif
00039 
00040 /*
00041  * Added at libpng-1.2.8
00042  *  
00043  * If you create a private DLL you need to define in "pngusr.h" the followings:
00044  * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
00045  *        the DLL was built>
00046  *  e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
00047  * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
00048  *        distinguish your DLL from those of the official release. These
00049  *        correspond to the trailing letters that come after the version
00050  *        number and must match your private DLL name>
00051  *  e.g. // private DLL "libpng13gx.dll"
00052  *       #define PNG_USER_DLLFNAME_POSTFIX "gx"
00053  * 
00054  * The following macros are also at your disposal if you want to complete the 
00055  * DLL VERSIONINFO structure.
00056  * - PNG_USER_VERSIONINFO_COMMENTS
00057  * - PNG_USER_VERSIONINFO_COMPANYNAME
00058  * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
00059  */
00060 
00061 #ifdef __STDC__
00062 #ifdef SPECIALBUILD
00063 #  pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
00064  are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
00065 #endif
00066 
00067 #ifdef PRIVATEBUILD
00068 # pragma message("PRIVATEBUILD is deprecated.\
00069  Use PNG_USER_PRIVATEBUILD instead.")
00070 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
00071 #endif
00072 #endif /* __STDC__ */
00073 
00074 #ifndef PNG_VERSION_INFO_ONLY
00075 
00076 /* End of material added to libpng-1.2.8 */
00077 
00078 /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble
00079    Restored at libpng-1.2.21 */
00080 #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \
00081     !defined(PNG_WARN_UNINITIALIZED_ROW)
00082 #  define PNG_WARN_UNINITIALIZED_ROW 1
00083 #endif
00084 /* End of material added at libpng-1.2.19/1.2.21 */
00085 
00086 /* This is the size of the compression buffer, and thus the size of
00087  * an IDAT chunk.  Make this whatever size you feel is best for your
00088  * machine.  One of these will be allocated per png_struct.  When this
00089  * is full, it writes the data to the disk, and does some other
00090  * calculations.  Making this an extremely small size will slow
00091  * the library down, but you may want to experiment to determine
00092  * where it becomes significant, if you are concerned with memory
00093  * usage.  Note that zlib allocates at least 32Kb also.  For readers,
00094  * this describes the size of the buffer available to read the data in.
00095  * Unless this gets smaller than the size of a row (compressed),
00096  * it should not make much difference how big this is.
00097  */
00098 
00099 #ifndef PNG_ZBUF_SIZE
00100 #  define PNG_ZBUF_SIZE 8192
00101 #endif
00102 
00103 /* Enable if you want a write-only libpng */
00104 
00105 #ifndef PNG_NO_READ_SUPPORTED
00106 #  define PNG_READ_SUPPORTED
00107 #endif
00108 
00109 /* Enable if you want a read-only libpng */
00110 
00111 #ifndef PNG_NO_WRITE_SUPPORTED
00112 #  define PNG_WRITE_SUPPORTED
00113 #endif
00114 
00115 /* Enabled by default in 1.2.0.  You can disable this if you don't need to
00116    support PNGs that are embedded in MNG datastreams */
00117 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
00118 #  ifndef PNG_MNG_FEATURES_SUPPORTED
00119 #    define PNG_MNG_FEATURES_SUPPORTED
00120 #  endif
00121 #endif
00122 
00123 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
00124 #  ifndef PNG_FLOATING_POINT_SUPPORTED
00125 #    define PNG_FLOATING_POINT_SUPPORTED
00126 #  endif
00127 #endif
00128 
00129 /* If you are running on a machine where you cannot allocate more
00130  * than 64K of memory at once, uncomment this.  While libpng will not
00131  * normally need that much memory in a chunk (unless you load up a very
00132  * large file), zlib needs to know how big of a chunk it can use, and
00133  * libpng thus makes sure to check any memory allocation to verify it
00134  * will fit into memory.
00135 #define PNG_MAX_MALLOC_64K
00136  */
00137 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
00138 #  define PNG_MAX_MALLOC_64K
00139 #endif
00140 
00141 /* Special munging to support doing things the 'cygwin' way:
00142  * 'Normal' png-on-win32 defines/defaults:
00143  *   PNG_BUILD_DLL -- building dll
00144  *   PNG_USE_DLL   -- building an application, linking to dll
00145  *   (no define)   -- building static library, or building an
00146  *                    application and linking to the static lib
00147  * 'Cygwin' defines/defaults:
00148  *   PNG_BUILD_DLL -- (ignored) building the dll
00149  *   (no define)   -- (ignored) building an application, linking to the dll
00150  *   PNG_STATIC    -- (ignored) building the static lib, or building an 
00151  *                    application that links to the static lib.
00152  *   ALL_STATIC    -- (ignored) building various static libs, or building an 
00153  *                    application that links to the static libs.
00154  * Thus,
00155  * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
00156  * this bit of #ifdefs will define the 'correct' config variables based on
00157  * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
00158  * unnecessary.
00159  *
00160  * Also, the precedence order is:
00161  *   ALL_STATIC (since we can't #undef something outside our namespace)
00162  *   PNG_BUILD_DLL
00163  *   PNG_STATIC
00164  *   (nothing) == PNG_USE_DLL
00165  * 
00166  * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
00167  *   of auto-import in binutils, we no longer need to worry about 
00168  *   __declspec(dllexport) / __declspec(dllimport) and friends.  Therefore,
00169  *   we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
00170  *   to __declspec() stuff.  However, we DO need to worry about 
00171  *   PNG_BUILD_DLL and PNG_STATIC because those change some defaults
00172  *   such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
00173  */
00174 #if defined(__CYGWIN__)
00175 #  if defined(ALL_STATIC)
00176 #    if defined(PNG_BUILD_DLL)
00177 #      undef PNG_BUILD_DLL
00178 #    endif
00179 #    if defined(PNG_USE_DLL)
00180 #      undef PNG_USE_DLL
00181 #    endif
00182 #    if defined(PNG_DLL)
00183 #      undef PNG_DLL
00184 #    endif
00185 #    if !defined(PNG_STATIC)
00186 #      define PNG_STATIC
00187 #    endif
00188 #  else
00189 #    if defined (PNG_BUILD_DLL)
00190 #      if defined(PNG_STATIC)
00191 #        undef PNG_STATIC
00192 #      endif
00193 #      if defined(PNG_USE_DLL)
00194 #        undef PNG_USE_DLL
00195 #      endif
00196 #      if !defined(PNG_DLL)
00197 #        define PNG_DLL
00198 #      endif
00199 #    else
00200 #      if defined(PNG_STATIC)
00201 #        if defined(PNG_USE_DLL)
00202 #          undef PNG_USE_DLL
00203 #        endif
00204 #        if defined(PNG_DLL)
00205 #          undef PNG_DLL
00206 #        endif
00207 #      else
00208 #        if !defined(PNG_USE_DLL)
00209 #          define PNG_USE_DLL
00210 #        endif
00211 #        if !defined(PNG_DLL)
00212 #          define PNG_DLL
00213 #        endif
00214 #      endif  
00215 #    endif  
00216 #  endif
00217 #endif
00218 
00219 /* This protects us against compilers that run on a windowing system
00220  * and thus don't have or would rather us not use the stdio types:
00221  * stdin, stdout, and stderr.  The only one currently used is stderr
00222  * in png_error() and png_warning().  #defining PNG_NO_CONSOLE_IO will
00223  * prevent these from being compiled and used. #defining PNG_NO_STDIO
00224  * will also prevent these, plus will prevent the entire set of stdio
00225  * macros and functions (FILE *, printf, etc.) from being compiled and used,
00226  * unless (PNG_DEBUG > 0) has been #defined.
00227  *
00228  * #define PNG_NO_CONSOLE_IO
00229  * #define PNG_NO_STDIO
00230  */
00231 
00232 #if defined(_WIN32_WCE)
00233 #  include <windows.h>
00234    /* Console I/O functions are not supported on WindowsCE */
00235 #  define PNG_NO_CONSOLE_IO
00236    /* abort() may not be supported on some/all Windows CE platforms */
00237 #  define PNG_ABORT() exit(-1)
00238 #  ifdef PNG_DEBUG
00239 #    undef PNG_DEBUG
00240 #  endif
00241 #endif
00242 
00243 #ifdef PNG_BUILD_DLL
00244 #  ifndef PNG_CONSOLE_IO_SUPPORTED
00245 #    ifndef PNG_NO_CONSOLE_IO
00246 #      define PNG_NO_CONSOLE_IO
00247 #    endif
00248 #  endif
00249 #endif
00250 
00251 #  ifdef PNG_NO_STDIO
00252 #    ifndef PNG_NO_CONSOLE_IO
00253 #      define PNG_NO_CONSOLE_IO
00254 #    endif
00255 #    ifdef PNG_DEBUG
00256 #      if (PNG_DEBUG > 0)
00257 #        include <stdio.h>
00258 #      endif
00259 #    endif
00260 #  else
00261 #    if !defined(_WIN32_WCE)
00262 /* "stdio.h" functions are not supported on WindowsCE */
00263 #      include <stdio.h>
00264 #    endif
00265 #  endif
00266 
00267 /* This macro protects us against machines that don't have function
00268  * prototypes (ie K&R style headers).  If your compiler does not handle
00269  * function prototypes, define this macro and use the included ansi2knr.
00270  * I've always been able to use _NO_PROTO as the indicator, but you may
00271  * need to drag the empty declaration out in front of here, or change the
00272  * ifdef to suit your own needs.
00273  */
00274 #ifndef PNGARG
00275 
00276 #ifdef OF /* zlib prototype munger */
00277 #  define PNGARG(arglist) OF(arglist)
00278 #else
00279 
00280 #ifdef _NO_PROTO
00281 #  define PNGARG(arglist) ()
00282 #  ifndef PNG_TYPECAST_NULL
00283 #     define PNG_TYPECAST_NULL
00284 #  endif
00285 #else
00286 #  define PNGARG(arglist) arglist
00287 #endif /* _NO_PROTO */
00288 
00289 
00290 #endif /* OF */
00291 
00292 #endif /* PNGARG */
00293 
00294 /* Try to determine if we are compiling on a Mac.  Note that testing for
00295  * just __MWERKS__ is not good enough, because the Codewarrior is now used
00296  * on non-Mac platforms.
00297  */
00298 #ifndef MACOS
00299 #  if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
00300       defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
00301 #    define MACOS
00302 #  endif
00303 #endif
00304 
00305 /* enough people need this for various reasons to include it here */
00306 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
00307 #  include <sys/types.h>
00308 #endif
00309 
00310 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
00311 #  define PNG_SETJMP_SUPPORTED
00312 #endif
00313 
00314 #ifdef PNG_SETJMP_SUPPORTED
00315 /* This is an attempt to force a single setjmp behaviour on Linux.  If
00316  * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
00317  *
00318  * You can bypass this test if you know that your application uses exactly
00319  * the same setjmp.h that was included when libpng was built.  Only define
00320  * PNG_SKIP_SETJMP_CHECK while building your application, prior to the
00321  * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK
00322  * while building a separate libpng library for general use.
00323  */
00324 
00325 #  ifndef PNG_SKIP_SETJMP_CHECK
00326 #    ifdef __linux__
00327 #      ifdef _BSD_SOURCE
00328 #        define PNG_SAVE_BSD_SOURCE
00329 #        undef _BSD_SOURCE
00330 #      endif
00331 #      ifdef _SETJMP_H
00332        /* If you encounter a compiler error here, see the explanation
00333         * near the end of INSTALL.
00334         */
00335            __pngconf.h__ in libpng already includes setjmp.h;
00336            __dont__ include it again.;
00337 #      endif
00338 #    endif /* __linux__ */
00339 #  endif /* PNG_SKIP_SETJMP_CHECK */
00340 
00341    /* include setjmp.h for error handling */
00342 #  include <setjmp.h>
00343 
00344 #  ifdef __linux__
00345 #    ifdef PNG_SAVE_BSD_SOURCE
00346 #      ifndef _BSD_SOURCE
00347 #        define _BSD_SOURCE
00348 #      endif
00349 #      undef PNG_SAVE_BSD_SOURCE
00350 #    endif
00351 #  endif /* __linux__ */
00352 #endif /* PNG_SETJMP_SUPPORTED */
00353 
00354 #ifdef BSD
00355 #  include <strings.h>
00356 #else
00357 #  include <string.h>
00358 #endif
00359 
00360 /* Other defines for things like memory and the like can go here.  */
00361 #ifdef PNG_INTERNAL
00362 
00363 #include <stdlib.h>
00364 
00365 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
00366  * aren't usually used outside the library (as far as I know), so it is
00367  * debatable if they should be exported at all.  In the future, when it is
00368  * possible to have run-time registry of chunk-handling functions, some of
00369  * these will be made available again.
00370 #define PNG_EXTERN extern
00371  */
00372 #define PNG_EXTERN
00373 
00374 /* Other defines specific to compilers can go here.  Try to keep
00375  * them inside an appropriate ifdef/endif pair for portability.
00376  */
00377 
00378 #if defined(PNG_FLOATING_POINT_SUPPORTED)
00379 #  if defined(MACOS)
00380      /* We need to check that <math.h> hasn't already been included earlier
00381       * as it seems it doesn't agree with <fp.h>, yet we should really use
00382       * <fp.h> if possible.
00383       */
00384 #    if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
00385 #      include <fp.h>
00386 #    endif
00387 #  else
00388 #    include <math.h>
00389 #  endif
00390 #  if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
00391      /* Amiga SAS/C: We must include builtin FPU functions when compiling using
00392       * MATH=68881
00393       */
00394 #    include <m68881.h>
00395 #  endif
00396 #endif
00397 
00398 /* Codewarrior on NT has linking problems without this. */
00399 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
00400 #  define PNG_ALWAYS_EXTERN
00401 #endif
00402 
00403 /* This provides the non-ANSI (far) memory allocation routines. */
00404 #if defined(__TURBOC__) && defined(__MSDOS__)
00405 #  include <mem.h>
00406 #  include <alloc.h>
00407 #endif
00408 
00409 /* I have no idea why is this necessary... */
00410 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
00411     defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
00412 #  include <malloc.h>
00413 #endif
00414 
00415 /* This controls how fine the dithering gets.  As this allocates
00416  * a largish chunk of memory (32K), those who are not as concerned
00417  * with dithering quality can decrease some or all of these.
00418  */
00419 #ifndef PNG_DITHER_RED_BITS
00420 #  define PNG_DITHER_RED_BITS 5
00421 #endif
00422 #ifndef PNG_DITHER_GREEN_BITS
00423 #  define PNG_DITHER_GREEN_BITS 5
00424 #endif
00425 #ifndef PNG_DITHER_BLUE_BITS
00426 #  define PNG_DITHER_BLUE_BITS 5
00427 #endif
00428 
00429 /* This controls how fine the gamma correction becomes when you
00430  * are only interested in 8 bits anyway.  Increasing this value
00431  * results in more memory being used, and more pow() functions
00432  * being called to fill in the gamma tables.  Don't set this value
00433  * less then 8, and even that may not work (I haven't tested it).
00434  */
00435 
00436 #ifndef PNG_MAX_GAMMA_8
00437 #  define PNG_MAX_GAMMA_8 11
00438 #endif
00439 
00440 /* This controls how much a difference in gamma we can tolerate before
00441  * we actually start doing gamma conversion.
00442  */
00443 #ifndef PNG_GAMMA_THRESHOLD
00444 #  define PNG_GAMMA_THRESHOLD 0.05
00445 #endif
00446 
00447 #endif /* PNG_INTERNAL */
00448 
00449 /* The following uses const char * instead of char * for error
00450  * and warning message functions, so some compilers won't complain.
00451  * If you do not want to use const, define PNG_NO_CONST here.
00452  */
00453 
00454 #ifndef PNG_NO_CONST
00455 #  define PNG_CONST const
00456 #else
00457 #  define PNG_CONST
00458 #endif
00459 
00460 /* The following defines give you the ability to remove code from the
00461  * library that you will not be using.  I wish I could figure out how to
00462  * automate this, but I can't do that without making it seriously hard
00463  * on the users.  So if you are not using an ability, change the #define
00464  * to and #undef, and that part of the library will not be compiled.  If
00465  * your linker can't find a function, you may want to make sure the
00466  * ability is defined here.  Some of these depend upon some others being
00467  * defined.  I haven't figured out all the interactions here, so you may
00468  * have to experiment awhile to get everything to compile.  If you are
00469  * creating or using a shared library, you probably shouldn't touch this,
00470  * as it will affect the size of the structures, and this will cause bad
00471  * things to happen if the library and/or application ever change.
00472  */
00473 
00474 /* Any features you will not be using can be undef'ed here */
00475 
00476 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
00477  * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
00478  * on the compile line, then pick and choose which ones to define without
00479  * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
00480  * if you only want to have a png-compliant reader/writer but don't need
00481  * any of the extra transformations.  This saves about 80 kbytes in a
00482  * typical installation of the library. (PNG_NO_* form added in version
00483  * 1.0.1c, for consistency)
00484  */
00485 
00486 /* The size of the png_text structure changed in libpng-1.0.6 when
00487  * iTXt support was added.  iTXt support was turned off by default through
00488  * libpng-1.2.x, to support old apps that malloc the png_text structure
00489  * instead of calling png_set_text() and letting libpng malloc it.  It
00490  * was turned on by default in libpng-1.3.0.
00491  */
00492 
00493 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00494 #  ifndef PNG_NO_iTXt_SUPPORTED
00495 #    define PNG_NO_iTXt_SUPPORTED
00496 #  endif
00497 #  ifndef PNG_NO_READ_iTXt
00498 #    define PNG_NO_READ_iTXt
00499 #  endif
00500 #  ifndef PNG_NO_WRITE_iTXt
00501 #    define PNG_NO_WRITE_iTXt
00502 #  endif
00503 #endif
00504 
00505 #if !defined(PNG_NO_iTXt_SUPPORTED)
00506 #  if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
00507 #    define PNG_READ_iTXt
00508 #  endif
00509 #  if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
00510 #    define PNG_WRITE_iTXt
00511 #  endif
00512 #endif
00513 
00514 /* The following support, added after version 1.0.0, can be turned off here en
00515  * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
00516  * with old applications that require the length of png_struct and png_info
00517  * to remain unchanged.
00518  */
00519 
00520 #ifdef PNG_LEGACY_SUPPORTED
00521 #  define PNG_NO_FREE_ME
00522 #  define PNG_NO_READ_UNKNOWN_CHUNKS
00523 #  define PNG_NO_WRITE_UNKNOWN_CHUNKS
00524 #  define PNG_NO_READ_USER_CHUNKS
00525 #  define PNG_NO_READ_iCCP
00526 #  define PNG_NO_WRITE_iCCP
00527 #  define PNG_NO_READ_iTXt
00528 #  define PNG_NO_WRITE_iTXt
00529 #  define PNG_NO_READ_sCAL
00530 #  define PNG_NO_WRITE_sCAL
00531 #  define PNG_NO_READ_sPLT
00532 #  define PNG_NO_WRITE_sPLT
00533 #  define PNG_NO_INFO_IMAGE
00534 #  define PNG_NO_READ_RGB_TO_GRAY
00535 #  define PNG_NO_READ_USER_TRANSFORM
00536 #  define PNG_NO_WRITE_USER_TRANSFORM
00537 #  define PNG_NO_USER_MEM
00538 #  define PNG_NO_READ_EMPTY_PLTE
00539 #  define PNG_NO_MNG_FEATURES
00540 #  define PNG_NO_FIXED_POINT_SUPPORTED
00541 #endif
00542 
00543 /* Ignore attempt to turn off both floating and fixed point support */
00544 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
00545     !defined(PNG_NO_FIXED_POINT_SUPPORTED)
00546 #  define PNG_FIXED_POINT_SUPPORTED
00547 #endif
00548 
00549 #ifndef PNG_NO_FREE_ME
00550 #  define PNG_FREE_ME_SUPPORTED
00551 #endif
00552 
00553 #if defined(PNG_READ_SUPPORTED)
00554 
00555 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
00556       !defined(PNG_NO_READ_TRANSFORMS)
00557 #  define PNG_READ_TRANSFORMS_SUPPORTED
00558 #endif
00559 
00560 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
00561 #  ifndef PNG_NO_READ_EXPAND
00562 #    define PNG_READ_EXPAND_SUPPORTED
00563 #  endif
00564 #  ifndef PNG_NO_READ_SHIFT
00565 #    define PNG_READ_SHIFT_SUPPORTED
00566 #  endif
00567 #  ifndef PNG_NO_READ_PACK
00568 #    define PNG_READ_PACK_SUPPORTED
00569 #  endif
00570 #  ifndef PNG_NO_READ_BGR
00571 #    define PNG_READ_BGR_SUPPORTED
00572 #  endif
00573 #  ifndef PNG_NO_READ_SWAP
00574 #    define PNG_READ_SWAP_SUPPORTED
00575 #  endif
00576 #  ifndef PNG_NO_READ_PACKSWAP
00577 #    define PNG_READ_PACKSWAP_SUPPORTED
00578 #  endif
00579 #  ifndef PNG_NO_READ_INVERT
00580 #    define PNG_READ_INVERT_SUPPORTED
00581 #  endif
00582 #  ifndef PNG_NO_READ_DITHER
00583 #    define PNG_READ_DITHER_SUPPORTED
00584 #  endif
00585 #  ifndef PNG_NO_READ_BACKGROUND
00586 #    define PNG_READ_BACKGROUND_SUPPORTED
00587 #  endif
00588 #  ifndef PNG_NO_READ_16_TO_8
00589 #    define PNG_READ_16_TO_8_SUPPORTED
00590 #  endif
00591 #  ifndef PNG_NO_READ_FILLER
00592 #    define PNG_READ_FILLER_SUPPORTED
00593 #  endif
00594 #  ifndef PNG_NO_READ_GAMMA
00595 #    define PNG_READ_GAMMA_SUPPORTED
00596 #  endif
00597 #  ifndef PNG_NO_READ_GRAY_TO_RGB
00598 #    define PNG_READ_GRAY_TO_RGB_SUPPORTED
00599 #  endif
00600 #  ifndef PNG_NO_READ_SWAP_ALPHA
00601 #    define PNG_READ_SWAP_ALPHA_SUPPORTED
00602 #  endif
00603 #  ifndef PNG_NO_READ_INVERT_ALPHA
00604 #    define PNG_READ_INVERT_ALPHA_SUPPORTED
00605 #  endif
00606 #  ifndef PNG_NO_READ_STRIP_ALPHA
00607 #    define PNG_READ_STRIP_ALPHA_SUPPORTED
00608 #  endif
00609 #  ifndef PNG_NO_READ_USER_TRANSFORM
00610 #    define PNG_READ_USER_TRANSFORM_SUPPORTED
00611 #  endif
00612 #  ifndef PNG_NO_READ_RGB_TO_GRAY
00613 #    define PNG_READ_RGB_TO_GRAY_SUPPORTED
00614 #  endif
00615 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
00616 
00617 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
00618  !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive   */
00619 #  define PNG_PROGRESSIVE_READ_SUPPORTED  /* reading.  This is not talking */
00620 #endif                            /* about interlacing capability!  You'll */
00621            /* still have interlacing unless you change the following line: */
00622 
00623 #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */
00624 
00625 #ifndef PNG_NO_READ_COMPOSITE_NODIV
00626 #  ifndef PNG_NO_READ_COMPOSITED_NODIV  /* libpng-1.0.x misspelling */
00627 #    define PNG_READ_COMPOSITE_NODIV_SUPPORTED  /* well tested on Intel, SGI */
00628 #  endif
00629 #endif
00630 
00631 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00632 /* Deprecated, will be removed from version 2.0.0.
00633    Use PNG_MNG_FEATURES_SUPPORTED instead. */
00634 #ifndef PNG_NO_READ_EMPTY_PLTE
00635 #  define PNG_READ_EMPTY_PLTE_SUPPORTED
00636 #endif
00637 #endif
00638 
00639 #endif /* PNG_READ_SUPPORTED */
00640 
00641 #if defined(PNG_WRITE_SUPPORTED)
00642 
00643 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
00644     !defined(PNG_NO_WRITE_TRANSFORMS)
00645 #  define PNG_WRITE_TRANSFORMS_SUPPORTED
00646 #endif
00647 
00648 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
00649 #  ifndef PNG_NO_WRITE_SHIFT
00650 #    define PNG_WRITE_SHIFT_SUPPORTED
00651 #  endif
00652 #  ifndef PNG_NO_WRITE_PACK
00653 #    define PNG_WRITE_PACK_SUPPORTED
00654 #  endif
00655 #  ifndef PNG_NO_WRITE_BGR
00656 #    define PNG_WRITE_BGR_SUPPORTED
00657 #  endif
00658 #  ifndef PNG_NO_WRITE_SWAP
00659 #    define PNG_WRITE_SWAP_SUPPORTED
00660 #  endif
00661 #  ifndef PNG_NO_WRITE_PACKSWAP
00662 #    define PNG_WRITE_PACKSWAP_SUPPORTED
00663 #  endif
00664 #  ifndef PNG_NO_WRITE_INVERT
00665 #    define PNG_WRITE_INVERT_SUPPORTED
00666 #  endif
00667 #  ifndef PNG_NO_WRITE_FILLER
00668 #    define PNG_WRITE_FILLER_SUPPORTED   /* same as WRITE_STRIP_ALPHA */
00669 #  endif
00670 #  ifndef PNG_NO_WRITE_SWAP_ALPHA
00671 #    define PNG_WRITE_SWAP_ALPHA_SUPPORTED
00672 #  endif
00673 #  ifndef PNG_NO_WRITE_INVERT_ALPHA
00674 #    define PNG_WRITE_INVERT_ALPHA_SUPPORTED
00675 #  endif
00676 #  ifndef PNG_NO_WRITE_USER_TRANSFORM
00677 #    define PNG_WRITE_USER_TRANSFORM_SUPPORTED
00678 #  endif
00679 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
00680 
00681 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
00682     !defined(PNG_WRITE_INTERLACING_SUPPORTED)
00683 #define PNG_WRITE_INTERLACING_SUPPORTED  /* not required for PNG-compliant
00684                                             encoders, but can cause trouble
00685                                             if left undefined */
00686 #endif
00687 
00688 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
00689     !defined(PNG_WRITE_WEIGHTED_FILTER) && \
00690      defined(PNG_FLOATING_POINT_SUPPORTED)
00691 #  define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
00692 #endif
00693 
00694 #ifndef PNG_NO_WRITE_FLUSH
00695 #  define PNG_WRITE_FLUSH_SUPPORTED
00696 #endif
00697 
00698 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00699 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
00700 #ifndef PNG_NO_WRITE_EMPTY_PLTE
00701 #  define PNG_WRITE_EMPTY_PLTE_SUPPORTED
00702 #endif
00703 #endif
00704 
00705 #endif /* PNG_WRITE_SUPPORTED */
00706 
00707 #ifndef PNG_1_0_X
00708 #  ifndef PNG_NO_ERROR_NUMBERS
00709 #    define PNG_ERROR_NUMBERS_SUPPORTED
00710 #  endif
00711 #endif /* PNG_1_0_X */
00712 
00713 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
00714     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
00715 #  ifndef PNG_NO_USER_TRANSFORM_PTR
00716 #    define PNG_USER_TRANSFORM_PTR_SUPPORTED
00717 #  endif
00718 #endif
00719 
00720 #ifndef PNG_NO_STDIO
00721 #  define PNG_TIME_RFC1123_SUPPORTED
00722 #endif
00723 
00724 /* This adds extra functions in pngget.c for accessing data from the
00725  * info pointer (added in version 0.99)
00726  * png_get_image_width()
00727  * png_get_image_height()
00728  * png_get_bit_depth()
00729  * png_get_color_type()
00730  * png_get_compression_type()
00731  * png_get_filter_type()
00732  * png_get_interlace_type()
00733  * png_get_pixel_aspect_ratio()
00734  * png_get_pixels_per_meter()
00735  * png_get_x_offset_pixels()
00736  * png_get_y_offset_pixels()
00737  * png_get_x_offset_microns()
00738  * png_get_y_offset_microns()
00739  */
00740 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
00741 #  define PNG_EASY_ACCESS_SUPPORTED
00742 #endif
00743 
00744 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 
00745  * and removed from version 1.2.20.  The following will be removed
00746  * from libpng-1.4.0
00747 */
00748 
00749 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE)
00750 #  ifndef PNG_OPTIMIZED_CODE_SUPPORTED
00751 #    define PNG_OPTIMIZED_CODE_SUPPORTED
00752 #  endif
00753 #endif
00754 
00755 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
00756 #  ifndef PNG_ASSEMBLER_CODE_SUPPORTED
00757 #    define PNG_ASSEMBLER_CODE_SUPPORTED
00758 #  endif
00759 
00760 #  if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4)
00761      /* work around 64-bit gcc compiler bugs in gcc-3.x */
00762 #    if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00763 #      define PNG_NO_MMX_CODE
00764 #    endif
00765 #  endif
00766 
00767 #  if defined(__APPLE__)
00768 #    if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00769 #      define PNG_NO_MMX_CODE
00770 #    endif
00771 #  endif
00772 
00773 #  if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh))
00774 #    if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00775 #      define PNG_NO_MMX_CODE
00776 #    endif
00777 #  endif
00778 
00779 #  if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00780 #    define PNG_MMX_CODE_SUPPORTED
00781 #  endif
00782 
00783 #endif
00784 /* end of obsolete code to be removed from libpng-1.4.0 */
00785 
00786 #if !defined(PNG_1_0_X)
00787 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
00788 #  define PNG_USER_MEM_SUPPORTED
00789 #endif
00790 #endif /* PNG_1_0_X */
00791 
00792 /* Added at libpng-1.2.6 */
00793 #if !defined(PNG_1_0_X)
00794 #ifndef PNG_SET_USER_LIMITS_SUPPORTED
00795 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
00796 #  define PNG_SET_USER_LIMITS_SUPPORTED
00797 #endif
00798 #endif
00799 #endif /* PNG_1_0_X */
00800 
00801 /* Added at libpng-1.0.16 and 1.2.6.  To accept all valid PNGS no matter
00802  * how large, set these limits to 0x7fffffffL
00803  */
00804 #ifndef PNG_USER_WIDTH_MAX
00805 #  define PNG_USER_WIDTH_MAX 1000000L
00806 #endif
00807 #ifndef PNG_USER_HEIGHT_MAX
00808 #  define PNG_USER_HEIGHT_MAX 1000000L
00809 #endif
00810 
00811 /* Added at libpng-1.2.34 and 1.4.0 */
00812 #ifndef PNG_STRING_NEWLINE
00813 #define PNG_STRING_NEWLINE "\n"
00814 #endif
00815 
00816 /* These are currently experimental features, define them if you want */
00817 
00818 /* very little testing */
00819 /*
00820 #ifdef PNG_READ_SUPPORTED
00821 #  ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
00822 #    define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
00823 #  endif
00824 #endif
00825 */
00826 
00827 /* This is only for PowerPC big-endian and 680x0 systems */
00828 /* some testing */
00829 /*
00830 #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
00831 #  define PNG_READ_BIG_ENDIAN_SUPPORTED
00832 #endif
00833 */
00834 
00835 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */
00836 /*
00837 #define PNG_NO_POINTER_INDEXING
00838 */
00839 
00840 /* These functions are turned off by default, as they will be phased out. */
00841 /*
00842 #define  PNG_USELESS_TESTS_SUPPORTED
00843 #define  PNG_CORRECT_PALETTE_SUPPORTED
00844 */
00845 
00846 /* Any chunks you are not interested in, you can undef here.  The
00847  * ones that allocate memory may be expecially important (hIST,
00848  * tEXt, zTXt, tRNS, pCAL).  Others will just save time and make png_info
00849  * a bit smaller.
00850  */
00851 
00852 #if defined(PNG_READ_SUPPORTED) && \
00853     !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00854     !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
00855 #  define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00856 #endif
00857 
00858 #if defined(PNG_WRITE_SUPPORTED) && \
00859     !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00860     !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
00861 #  define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00862 #endif
00863 
00864 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00865 
00866 #ifdef PNG_NO_READ_TEXT
00867 #  define PNG_NO_READ_iTXt
00868 #  define PNG_NO_READ_tEXt
00869 #  define PNG_NO_READ_zTXt
00870 #endif
00871 #ifndef PNG_NO_READ_bKGD
00872 #  define PNG_READ_bKGD_SUPPORTED
00873 #  define PNG_bKGD_SUPPORTED
00874 #endif
00875 #ifndef PNG_NO_READ_cHRM
00876 #  define PNG_READ_cHRM_SUPPORTED
00877 #  define PNG_cHRM_SUPPORTED
00878 #endif
00879 #ifndef PNG_NO_READ_gAMA
00880 #  define PNG_READ_gAMA_SUPPORTED
00881 #  define PNG_gAMA_SUPPORTED
00882 #endif
00883 #ifndef PNG_NO_READ_hIST
00884 #  define PNG_READ_hIST_SUPPORTED
00885 #  define PNG_hIST_SUPPORTED
00886 #endif
00887 #ifndef PNG_NO_READ_iCCP
00888 #  define PNG_READ_iCCP_SUPPORTED
00889 #  define PNG_iCCP_SUPPORTED
00890 #endif
00891 #ifndef PNG_NO_READ_iTXt
00892 #  ifndef PNG_READ_iTXt_SUPPORTED
00893 #    define PNG_READ_iTXt_SUPPORTED
00894 #  endif
00895 #  ifndef PNG_iTXt_SUPPORTED
00896 #    define PNG_iTXt_SUPPORTED
00897 #  endif
00898 #endif
00899 #ifndef PNG_NO_READ_oFFs
00900 #  define PNG_READ_oFFs_SUPPORTED
00901 #  define PNG_oFFs_SUPPORTED
00902 #endif
00903 #ifndef PNG_NO_READ_pCAL
00904 #  define PNG_READ_pCAL_SUPPORTED
00905 #  define PNG_pCAL_SUPPORTED
00906 #endif
00907 #ifndef PNG_NO_READ_sCAL
00908 #  define PNG_READ_sCAL_SUPPORTED
00909 #  define PNG_sCAL_SUPPORTED
00910 #endif
00911 #ifndef PNG_NO_READ_pHYs
00912 #  define PNG_READ_pHYs_SUPPORTED
00913 #  define PNG_pHYs_SUPPORTED
00914 #endif
00915 #ifndef PNG_NO_READ_sBIT
00916 #  define PNG_READ_sBIT_SUPPORTED
00917 #  define PNG_sBIT_SUPPORTED
00918 #endif
00919 #ifndef PNG_NO_READ_sPLT
00920 #  define PNG_READ_sPLT_SUPPORTED
00921 #  define PNG_sPLT_SUPPORTED
00922 #endif
00923 #ifndef PNG_NO_READ_sRGB
00924 #  define PNG_READ_sRGB_SUPPORTED
00925 #  define PNG_sRGB_SUPPORTED
00926 #endif
00927 #ifndef PNG_NO_READ_tEXt
00928 #  define PNG_READ_tEXt_SUPPORTED
00929 #  define PNG_tEXt_SUPPORTED
00930 #endif
00931 #ifndef PNG_NO_READ_tIME
00932 #  define PNG_READ_tIME_SUPPORTED
00933 #  define PNG_tIME_SUPPORTED
00934 #endif
00935 #ifndef PNG_NO_READ_tRNS
00936 #  define PNG_READ_tRNS_SUPPORTED
00937 #  define PNG_tRNS_SUPPORTED
00938 #endif
00939 #ifndef PNG_NO_READ_zTXt
00940 #  define PNG_READ_zTXt_SUPPORTED
00941 #  define PNG_zTXt_SUPPORTED
00942 #endif
00943 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
00944 #  define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
00945 #  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
00946 #    define PNG_UNKNOWN_CHUNKS_SUPPORTED
00947 #  endif
00948 #  ifndef PNG_NO_HANDLE_AS_UNKNOWN
00949 #    define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
00950 #  endif
00951 #endif
00952 #if !defined(PNG_NO_READ_USER_CHUNKS) && \
00953      defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
00954 #  define PNG_READ_USER_CHUNKS_SUPPORTED
00955 #  define PNG_USER_CHUNKS_SUPPORTED
00956 #  ifdef PNG_NO_READ_UNKNOWN_CHUNKS
00957 #    undef PNG_NO_READ_UNKNOWN_CHUNKS
00958 #  endif
00959 #  ifdef PNG_NO_HANDLE_AS_UNKNOWN
00960 #    undef PNG_NO_HANDLE_AS_UNKNOWN
00961 #  endif
00962 #endif
00963 #ifndef PNG_NO_READ_OPT_PLTE
00964 #  define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
00965 #endif                      /* optional PLTE chunk in RGB and RGBA images */
00966 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
00967     defined(PNG_READ_zTXt_SUPPORTED)
00968 #  define PNG_READ_TEXT_SUPPORTED
00969 #  define PNG_TEXT_SUPPORTED
00970 #endif
00971 
00972 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
00973 
00974 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00975 
00976 #ifdef PNG_NO_WRITE_TEXT
00977 #  define PNG_NO_WRITE_iTXt
00978 #  define PNG_NO_WRITE_tEXt
00979 #  define PNG_NO_WRITE_zTXt
00980 #endif
00981 #ifndef PNG_NO_WRITE_bKGD
00982 #  define PNG_WRITE_bKGD_SUPPORTED
00983 #  ifndef PNG_bKGD_SUPPORTED
00984 #    define PNG_bKGD_SUPPORTED
00985 #  endif
00986 #endif
00987 #ifndef PNG_NO_WRITE_cHRM
00988 #  define PNG_WRITE_cHRM_SUPPORTED
00989 #  ifndef PNG_cHRM_SUPPORTED
00990 #    define PNG_cHRM_SUPPORTED
00991 #  endif
00992 #endif
00993 #ifndef PNG_NO_WRITE_gAMA
00994 #  define PNG_WRITE_gAMA_SUPPORTED
00995 #  ifndef PNG_gAMA_SUPPORTED
00996 #    define PNG_gAMA_SUPPORTED
00997 #  endif
00998 #endif
00999 #ifndef PNG_NO_WRITE_hIST
01000 #  define PNG_WRITE_hIST_SUPPORTED
01001 #  ifndef PNG_hIST_SUPPORTED
01002 #    define PNG_hIST_SUPPORTED
01003 #  endif
01004 #endif
01005 #ifndef PNG_NO_WRITE_iCCP
01006 #  define PNG_WRITE_iCCP_SUPPORTED
01007 #  ifndef PNG_iCCP_SUPPORTED
01008 #    define PNG_iCCP_SUPPORTED
01009 #  endif
01010 #endif
01011 #ifndef PNG_NO_WRITE_iTXt
01012 #  ifndef PNG_WRITE_iTXt_SUPPORTED
01013 #    define PNG_WRITE_iTXt_SUPPORTED
01014 #  endif
01015 #  ifndef PNG_iTXt_SUPPORTED
01016 #    define PNG_iTXt_SUPPORTED
01017 #  endif
01018 #endif
01019 #ifndef PNG_NO_WRITE_oFFs
01020 #  define PNG_WRITE_oFFs_SUPPORTED
01021 #  ifndef PNG_oFFs_SUPPORTED
01022 #    define PNG_oFFs_SUPPORTED
01023 #  endif
01024 #endif
01025 #ifndef PNG_NO_WRITE_pCAL
01026 #  define PNG_WRITE_pCAL_SUPPORTED
01027 #  ifndef PNG_pCAL_SUPPORTED
01028 #    define PNG_pCAL_SUPPORTED
01029 #  endif
01030 #endif
01031 #ifndef PNG_NO_WRITE_sCAL
01032 #  define PNG_WRITE_sCAL_SUPPORTED
01033 #  ifndef PNG_sCAL_SUPPORTED
01034 #    define PNG_sCAL_SUPPORTED
01035 #  endif
01036 #endif
01037 #ifndef PNG_NO_WRITE_pHYs
01038 #  define PNG_WRITE_pHYs_SUPPORTED
01039 #  ifndef PNG_pHYs_SUPPORTED
01040 #    define PNG_pHYs_SUPPORTED
01041 #  endif
01042 #endif
01043 #ifndef PNG_NO_WRITE_sBIT
01044 #  define PNG_WRITE_sBIT_SUPPORTED
01045 #  ifndef PNG_sBIT_SUPPORTED
01046 #    define PNG_sBIT_SUPPORTED
01047 #  endif
01048 #endif
01049 #ifndef PNG_NO_WRITE_sPLT
01050 #  define PNG_WRITE_sPLT_SUPPORTED
01051 #  ifndef PNG_sPLT_SUPPORTED
01052 #    define PNG_sPLT_SUPPORTED
01053 #  endif
01054 #endif
01055 #ifndef PNG_NO_WRITE_sRGB
01056 #  define PNG_WRITE_sRGB_SUPPORTED
01057 #  ifndef PNG_sRGB_SUPPORTED
01058 #    define PNG_sRGB_SUPPORTED
01059 #  endif
01060 #endif
01061 #ifndef PNG_NO_WRITE_tEXt
01062 #  define PNG_WRITE_tEXt_SUPPORTED
01063 #  ifndef PNG_tEXt_SUPPORTED
01064 #    define PNG_tEXt_SUPPORTED
01065 #  endif
01066 #endif
01067 #ifndef PNG_NO_WRITE_tIME
01068 #  define PNG_WRITE_tIME_SUPPORTED
01069 #  ifndef PNG_tIME_SUPPORTED
01070 #    define PNG_tIME_SUPPORTED
01071 #  endif
01072 #endif
01073 #ifndef PNG_NO_WRITE_tRNS
01074 #  define PNG_WRITE_tRNS_SUPPORTED
01075 #  ifndef PNG_tRNS_SUPPORTED
01076 #    define PNG_tRNS_SUPPORTED
01077 #  endif
01078 #endif
01079 #ifndef PNG_NO_WRITE_zTXt
01080 #  define PNG_WRITE_zTXt_SUPPORTED
01081 #  ifndef PNG_zTXt_SUPPORTED
01082 #    define PNG_zTXt_SUPPORTED
01083 #  endif
01084 #endif
01085 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
01086 #  define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
01087 #  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
01088 #    define PNG_UNKNOWN_CHUNKS_SUPPORTED
01089 #  endif
01090 #  ifndef PNG_NO_HANDLE_AS_UNKNOWN
01091 #     ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
01092 #       define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
01093 #     endif
01094 #  endif
01095 #endif
01096 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
01097     defined(PNG_WRITE_zTXt_SUPPORTED)
01098 #  define PNG_WRITE_TEXT_SUPPORTED
01099 #  ifndef PNG_TEXT_SUPPORTED
01100 #    define PNG_TEXT_SUPPORTED
01101 #  endif
01102 #endif
01103 
01104 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
01105 
01106 /* Turn this off to disable png_read_png() and
01107  * png_write_png() and leave the row_pointers member
01108  * out of the info structure.
01109  */
01110 #ifndef PNG_NO_INFO_IMAGE
01111 #  define PNG_INFO_IMAGE_SUPPORTED
01112 #endif
01113 
01114 /* need the time information for reading tIME chunks */
01115 #if defined(PNG_tIME_SUPPORTED)
01116 #  if !defined(_WIN32_WCE)
01117      /* "time.h" functions are not supported on WindowsCE */
01118 #    include <time.h>
01119 #  endif
01120 #endif
01121 
01122 /* Some typedefs to get us started.  These should be safe on most of the
01123  * common platforms.  The typedefs should be at least as large as the
01124  * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
01125  * don't have to be exactly that size.  Some compilers dislike passing
01126  * unsigned shorts as function parameters, so you may be better off using
01127  * unsigned int for png_uint_16.  Likewise, for 64-bit systems, you may
01128  * want to have unsigned int for png_uint_32 instead of unsigned long.
01129  */
01130 
01131 typedef unsigned long png_uint_32;
01132 typedef long png_int_32;
01133 typedef unsigned short png_uint_16;
01134 typedef short png_int_16;
01135 typedef unsigned char png_byte;
01136 
01137 /* This is usually size_t.  It is typedef'ed just in case you need it to
01138    change (I'm not sure if you will or not, so I thought I'd be safe) */
01139 #ifdef PNG_SIZE_T
01140    typedef PNG_SIZE_T png_size_t;
01141 #  define png_sizeof(x) png_convert_size(sizeof(x))
01142 #else
01143    typedef size_t png_size_t;
01144 #  define png_sizeof(x) sizeof(x)
01145 #endif
01146 
01147 /* The following is needed for medium model support.  It cannot be in the
01148  * PNG_INTERNAL section.  Needs modification for other compilers besides
01149  * MSC.  Model independent support declares all arrays and pointers to be
01150  * large using the far keyword.  The zlib version used must also support
01151  * model independent data.  As of version zlib 1.0.4, the necessary changes
01152  * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
01153  * changes that are needed. (Tim Wegner)
01154  */
01155 
01156 /* Separate compiler dependencies (problem here is that zlib.h always
01157    defines FAR. (SJT) */
01158 #ifdef __BORLANDC__
01159 #  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
01160 #    define LDATA 1
01161 #  else
01162 #    define LDATA 0
01163 #  endif
01164    /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
01165 #  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
01166 #    define PNG_MAX_MALLOC_64K
01167 #    if (LDATA != 1)
01168 #      ifndef FAR
01169 #        define FAR __far
01170 #      endif
01171 #      define USE_FAR_KEYWORD
01172 #    endif   /* LDATA != 1 */
01173      /* Possibly useful for moving data out of default segment.
01174       * Uncomment it if you want. Could also define FARDATA as
01175       * const if your compiler supports it. (SJT)
01176 #    define FARDATA FAR
01177       */
01178 #  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
01179 #endif   /* __BORLANDC__ */
01180 
01181 
01182 /* Suggest testing for specific compiler first before testing for
01183  * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
01184  * making reliance oncertain keywords suspect. (SJT)
01185  */
01186 
01187 /* MSC Medium model */
01188 #if defined(FAR)
01189 #  if defined(M_I86MM)
01190 #    define USE_FAR_KEYWORD
01191 #    define FARDATA FAR
01192 #    include <dos.h>
01193 #  endif
01194 #endif
01195 
01196 /* SJT: default case */
01197 #ifndef FAR
01198 #  define FAR
01199 #endif
01200 
01201 /* At this point FAR is always defined */
01202 #ifndef FARDATA
01203 #  define FARDATA
01204 #endif
01205 
01206 /* Typedef for floating-point numbers that are converted
01207    to fixed-point with a multiple of 100,000, e.g., int_gamma */
01208 typedef png_int_32 png_fixed_point;
01209 
01210 /* Add typedefs for pointers */
01211 typedef void            FAR * png_voidp;
01212 typedef png_byte        FAR * png_bytep;
01213 typedef png_uint_32     FAR * png_uint_32p;
01214 typedef png_int_32      FAR * png_int_32p;
01215 typedef png_uint_16     FAR * png_uint_16p;
01216 typedef png_int_16      FAR * png_int_16p;
01217 typedef PNG_CONST char  FAR * png_const_charp;
01218 typedef char            FAR * png_charp;
01219 typedef png_fixed_point FAR * png_fixed_point_p;
01220 
01221 #ifndef PNG_NO_STDIO
01222 #if defined(_WIN32_WCE)
01223 typedef HANDLE                png_FILE_p;
01224 #else
01225 typedef FILE                * png_FILE_p;
01226 #endif
01227 #endif
01228 
01229 #ifdef PNG_FLOATING_POINT_SUPPORTED
01230 typedef double          FAR * png_doublep;
01231 #endif
01232 
01233 /* Pointers to pointers; i.e. arrays */
01234 typedef png_byte        FAR * FAR * png_bytepp;
01235 typedef png_uint_32     FAR * FAR * png_uint_32pp;
01236 typedef png_int_32      FAR * FAR * png_int_32pp;
01237 typedef png_uint_16     FAR * FAR * png_uint_16pp;
01238 typedef png_int_16      FAR * FAR * png_int_16pp;
01239 typedef PNG_CONST char  FAR * FAR * png_const_charpp;
01240 typedef char            FAR * FAR * png_charpp;
01241 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
01242 #ifdef PNG_FLOATING_POINT_SUPPORTED
01243 typedef double          FAR * FAR * png_doublepp;
01244 #endif
01245 
01246 /* Pointers to pointers to pointers; i.e., pointer to array */
01247 typedef char            FAR * FAR * FAR * png_charppp;
01248 
01249 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
01250 /* SPC -  Is this stuff deprecated? */
01251 /* It'll be removed as of libpng-1.3.0 - GR-P */
01252 /* libpng typedefs for types in zlib. If zlib changes
01253  * or another compression library is used, then change these.
01254  * Eliminates need to change all the source files.
01255  */
01256 typedef charf *         png_zcharp;
01257 typedef charf * FAR *   png_zcharpp;
01258 typedef z_stream FAR *  png_zstreamp;
01259 #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
01260 
01261 /*
01262  * Define PNG_BUILD_DLL if the module being built is a Windows
01263  * LIBPNG DLL.
01264  *
01265  * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
01266  * It is equivalent to Microsoft predefined macro _DLL that is
01267  * automatically defined when you compile using the share
01268  * version of the CRT (C Run-Time library)
01269  *
01270  * The cygwin mods make this behavior a little different:
01271  * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
01272  * Define PNG_STATIC if you are building a static library for use with cygwin,
01273  *   -or- if you are building an application that you want to link to the
01274  *   static library.
01275  * PNG_USE_DLL is defined by default (no user action needed) unless one of
01276  *   the other flags is defined.
01277  */
01278 
01279 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
01280 #  define PNG_DLL
01281 #endif
01282 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
01283  * When building a static lib, default to no GLOBAL ARRAYS, but allow
01284  * command-line override
01285  */
01286 #if defined(__CYGWIN__)
01287 #  if !defined(PNG_STATIC)
01288 #    if defined(PNG_USE_GLOBAL_ARRAYS)
01289 #      undef PNG_USE_GLOBAL_ARRAYS
01290 #    endif
01291 #    if !defined(PNG_USE_LOCAL_ARRAYS)
01292 #      define PNG_USE_LOCAL_ARRAYS
01293 #    endif
01294 #  else
01295 #    if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
01296 #      if defined(PNG_USE_GLOBAL_ARRAYS)
01297 #        undef PNG_USE_GLOBAL_ARRAYS
01298 #      endif
01299 #    endif
01300 #  endif
01301 #  if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
01302 #    define PNG_USE_LOCAL_ARRAYS
01303 #  endif
01304 #endif
01305 
01306 /* Do not use global arrays (helps with building DLL's)
01307  * They are no longer used in libpng itself, since version 1.0.5c,
01308  * but might be required for some pre-1.0.5c applications.
01309  */
01310 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
01311 #  if defined(PNG_NO_GLOBAL_ARRAYS) || \
01312       (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER)
01313 #    define PNG_USE_LOCAL_ARRAYS
01314 #  else
01315 #    define PNG_USE_GLOBAL_ARRAYS
01316 #  endif
01317 #endif
01318 
01319 #if defined(__CYGWIN__)
01320 #  undef PNGAPI
01321 #  define PNGAPI __cdecl
01322 #  undef PNG_IMPEXP
01323 #  define PNG_IMPEXP
01324 #endif  
01325 
01326 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
01327  * you may get warnings regarding the linkage of png_zalloc and png_zfree.
01328  * Don't ignore those warnings; you must also reset the default calling
01329  * convention in your compiler to match your PNGAPI, and you must build
01330  * zlib and your applications the same way you build libpng.
01331  */
01332 
01333 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
01334 #  ifndef PNG_NO_MODULEDEF
01335 #    define PNG_NO_MODULEDEF
01336 #  endif
01337 #endif
01338 
01339 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
01340 #  define PNG_IMPEXP
01341 #endif
01342 
01343 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
01344     (( defined(_Windows) || defined(_WINDOWS) || \
01345        defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
01346 
01347 #  ifndef PNGAPI
01348 #     if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
01349 #        define PNGAPI __cdecl
01350 #     else
01351 #        define PNGAPI _cdecl
01352 #     endif
01353 #  endif
01354 
01355 #  if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
01356        0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
01357 #     define PNG_IMPEXP
01358 #  endif
01359 
01360 #  if !defined(PNG_IMPEXP)
01361 
01362 #     define PNG_EXPORT_TYPE1(type,symbol)  PNG_IMPEXP type PNGAPI symbol
01363 #     define PNG_EXPORT_TYPE2(type,symbol)  type PNG_IMPEXP PNGAPI symbol
01364 
01365       /* Borland/Microsoft */
01366 #     if defined(_MSC_VER) || defined(__BORLANDC__)
01367 #        if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
01368 #           define PNG_EXPORT PNG_EXPORT_TYPE1
01369 #        else
01370 #           define PNG_EXPORT PNG_EXPORT_TYPE2
01371 #           if defined(PNG_BUILD_DLL)
01372 #              define PNG_IMPEXP __export
01373 #           else
01374 #              define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
01375                                                  VC++ */
01376 #           endif                             /* Exists in Borland C++ for
01377                                                  C++ classes (== huge) */
01378 #        endif
01379 #     endif
01380 
01381 #     if !defined(PNG_IMPEXP)
01382 #        if defined(PNG_BUILD_DLL)
01383 #           define PNG_IMPEXP __declspec(dllexport)
01384 #        else
01385 #           define PNG_IMPEXP __declspec(dllimport)
01386 #        endif
01387 #     endif
01388 #  endif  /* PNG_IMPEXP */
01389 #else /* !(DLL || non-cygwin WINDOWS) */
01390 #   if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
01391 #      ifndef PNGAPI
01392 #         define PNGAPI _System
01393 #      endif
01394 #   else
01395 #      if 0 /* ... other platforms, with other meanings */
01396 #      endif
01397 #   endif
01398 #endif
01399 
01400 #ifndef PNGAPI
01401 #  define PNGAPI
01402 #endif
01403 #ifndef PNG_IMPEXP
01404 #  define PNG_IMPEXP
01405 #endif
01406 
01407 #ifdef PNG_BUILDSYMS
01408 #  ifndef PNG_EXPORT
01409 #    define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
01410 #  endif
01411 #  ifdef PNG_USE_GLOBAL_ARRAYS
01412 #    ifndef PNG_EXPORT_VAR
01413 #      define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
01414 #    endif
01415 #  endif
01416 #endif
01417 
01418 #ifndef PNG_EXPORT
01419 #  define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
01420 #endif
01421 
01422 #ifdef PNG_USE_GLOBAL_ARRAYS
01423 #  ifndef PNG_EXPORT_VAR
01424 #    define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
01425 #  endif
01426 #endif
01427 
01428 /* User may want to use these so they are not in PNG_INTERNAL. Any library
01429  * functions that are passed far data must be model independent.
01430  */
01431 
01432 #ifndef PNG_ABORT
01433 #  define PNG_ABORT() abort()
01434 #endif
01435 
01436 #ifdef PNG_SETJMP_SUPPORTED
01437 #  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
01438 #else
01439 #  define png_jmpbuf(png_ptr) \
01440    (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
01441 #endif
01442 
01443 #if defined(USE_FAR_KEYWORD)  /* memory model independent fns */
01444 /* use this to make far-to-near assignments */
01445 #  define CHECK   1
01446 #  define NOCHECK 0
01447 #  define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
01448 #  define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
01449 #  define png_snprintf _fsnprintf   /* Added to v 1.2.19 */
01450 #  define png_strlen  _fstrlen
01451 #  define png_memcmp  _fmemcmp    /* SJT: added */
01452 #  define png_memcpy  _fmemcpy
01453 #  define png_memset  _fmemset
01454 #else /* use the usual functions */
01455 #  define CVT_PTR(ptr)         (ptr)
01456 #  define CVT_PTR_NOCHECK(ptr) (ptr)
01457 #  ifndef PNG_NO_SNPRINTF
01458 #    ifdef _MSC_VER
01459 #      define png_snprintf _snprintf   /* Added to v 1.2.19 */
01460 #      define png_snprintf2 _snprintf
01461 #      define png_snprintf6 _snprintf
01462 #    else
01463 #      define png_snprintf snprintf   /* Added to v 1.2.19 */
01464 #      define png_snprintf2 snprintf
01465 #      define png_snprintf6 snprintf
01466 #    endif
01467 #  else
01468      /* You don't have or don't want to use snprintf().  Caution: Using
01469       * sprintf instead of snprintf exposes your application to accidental
01470       * or malevolent buffer overflows.  If you don't have snprintf()
01471       * as a general rule you should provide one (you can get one from
01472       * Portable OpenSSH). */
01473 #    define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
01474 #    define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
01475 #    define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
01476         sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
01477 #  endif
01478 #  define png_strlen  strlen
01479 #  define png_memcmp  memcmp      /* SJT: added */
01480 #  define png_memcpy  memcpy
01481 #  define png_memset  memset
01482 #endif
01483 /* End of memory model independent support */
01484 
01485 /* Just a little check that someone hasn't tried to define something
01486  * contradictory.
01487  */
01488 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
01489 #  undef PNG_ZBUF_SIZE
01490 #  define PNG_ZBUF_SIZE 65536L
01491 #endif
01492 
01493 /* Added at libpng-1.2.8 */
01494 #endif /* PNG_VERSION_INFO_ONLY */
01495 
01496 #endif /* PNGCONF_H */