Back to index

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