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

Generated on Mon Sep 18 01:24:41 2006 for BRL-CAD by  doxygen 1.4.6