Back to index

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