home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !LibU / include / libpng12 / h / pngconf < prev   
Encoding:
Text File  |  2006-09-20  |  43.0 KB  |  1,443 lines

  1.  
  2. /* pngconf.h - machine configurable file for libpng
  3.  *
  4.  * libpng version 1.2.8 - December 3, 2004
  5.  * For conditions of distribution and use, see copyright notice in png.h
  6.  * Copyright (c) 1998-2004 Glenn Randers-Pehrson
  7.  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  8.  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  9.  */
  10.  
  11. /* Any machine specific code is near the front of this file, so if you
  12.  * are configuring libpng for a machine, you may want to read the section
  13.  * starting here down to where it starts to typedef png_color, png_text,
  14.  * and png_info.
  15.  */
  16.  
  17. #ifndef PNGCONF_H
  18. #define PNGCONF_H
  19.  
  20. #define PNG_1_2_X
  21.  
  22. /* 
  23.  * PNG_USER_CONFIG has to be defined on the compiler command line. This
  24.  * includes the resource compiler for Windows DLL configurations.
  25.  */
  26. #ifdef PNG_USER_CONFIG
  27. #include "pngusr.h"
  28. #endif
  29.  
  30. /*
  31.  * Added at libpng-1.2.8
  32.  *  
  33.  * If you create a private DLL you need to define in "pngusr.h" the followings:
  34.  * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
  35.  *        the DLL was built>
  36.  *  e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
  37.  * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
  38.  *        distinguish your DLL from those of the official release. These
  39.  *        correspond to the trailing letters that come after the version
  40.  *        number and must match your private DLL name>
  41.  *  e.g. // private DLL "libpng13gx.dll"
  42.  *       #define PNG_USER_DLLFNAME_POSTFIX "gx"
  43.  * 
  44.  * The following macros are also at your disposal if you want to complete the 
  45.  * DLL VERSIONINFO structure.
  46.  * - PNG_USER_VERSIONINFO_COMMENTS
  47.  * - PNG_USER_VERSIONINFO_COMPANYNAME
  48.  * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
  49.  */
  50.  
  51. #ifdef __STDC__
  52. #ifdef SPECIALBUILD
  53. #  pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
  54.  are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
  55. #endif
  56.  
  57. #ifdef PRIVATEBUILD
  58. # pragma message("PRIVATEBUILD is deprecated. Use\
  59.  PNG_USER_PRIVATEBUILD instead.")
  60. # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
  61. #endif
  62. #endif /* __STDC__ */
  63.  
  64. #ifndef PNG_VERSION_INFO_ONLY
  65.  
  66. /* End of material added to libpng-1.2.8 */
  67.  
  68. /* This is the size of the compression buffer, and thus the size of
  69.  * an IDAT chunk.  Make this whatever size you feel is best for your
  70.  * machine.  One of these will be allocated per png_struct.  When this
  71.  * is full, it writes the data to the disk, and does some other
  72.  * calculations.  Making this an extremely small size will slow
  73.  * the library down, but you may want to experiment to determine
  74.  * where it becomes significant, if you are concerned with memory
  75.  * usage.  Note that zlib allocates at least 32Kb also.  For readers,
  76.  * this describes the size of the buffer available to read the data in.
  77.  * Unless this gets smaller than the size of a row (compressed),
  78.  * it should not make much difference how big this is.
  79.  */
  80.  
  81. #ifndef PNG_ZBUF_SIZE
  82. #  define PNG_ZBUF_SIZE 8192
  83. #endif
  84.  
  85. /* Enable if you want a write-only libpng */
  86.  
  87. #ifndef PNG_NO_READ_SUPPORTED
  88. #  define PNG_READ_SUPPORTED
  89. #endif
  90.  
  91. /* Enable if you want a read-only libpng */
  92.  
  93. #ifndef PNG_NO_WRITE_SUPPORTED
  94. #  define PNG_WRITE_SUPPORTED
  95. #endif
  96.  
  97. /* Enabled by default in 1.2.0.  You can disable this if you don't need to
  98.    support PNGs that are embedded in MNG datastreams */
  99. #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
  100. #  ifndef PNG_MNG_FEATURES_SUPPORTED
  101. #    define PNG_MNG_FEATURES_SUPPORTED
  102. #  endif
  103. #endif
  104.  
  105. #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
  106. #  ifndef PNG_FLOATING_POINT_SUPPORTED
  107. #    define PNG_FLOATING_POINT_SUPPORTED
  108. #  endif
  109. #endif
  110.  
  111. /* If you are running on a machine where you cannot allocate more
  112.  * than 64K of memory at once, uncomment this.  While libpng will not
  113.  * normally need that much memory in a chunk (unless you load up a very
  114.  * large file), zlib needs to know how big of a chunk it can use, and
  115.  * libpng thus makes sure to check any memory allocation to verify it
  116.  * will fit into memory.
  117. #define PNG_MAX_MALLOC_64K
  118.  */
  119. #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
  120. #  define PNG_MAX_MALLOC_64K
  121. #endif
  122.  
  123. /* Special munging to support doing things the 'cygwin' way:
  124.  * 'Normal' png-on-win32 defines/defaults:
  125.  *   PNG_BUILD_DLL -- building dll
  126.  *   PNG_USE_DLL   -- building an application, linking to dll
  127.  *   (no define)   -- building static library, or building an
  128.  *                    application and linking to the static lib
  129.  * 'Cygwin' defines/defaults:
  130.  *   PNG_BUILD_DLL -- (ignored) building the dll
  131.  *   (no define)   -- (ignored) building an application, linking to the dll
  132.  *   PNG_STATIC    -- (ignored) building the static lib, or building an 
  133.  *                    application that links to the static lib.
  134.  *   ALL_STATIC    -- (ignored) building various static libs, or building an 
  135.  *                    application that links to the static libs.
  136.  * Thus,
  137.  * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
  138.  * this bit of #ifdefs will define the 'correct' config variables based on
  139.  * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
  140.  * unnecessary.
  141.  *
  142.  * Also, the precedence order is:
  143.  *   ALL_STATIC (since we can't #undef something outside our namespace)
  144.  *   PNG_BUILD_DLL
  145.  *   PNG_STATIC
  146.  *   (nothing) == PNG_USE_DLL
  147.  * 
  148.  * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
  149.  *   of auto-import in binutils, we no longer need to worry about 
  150.  *   __declspec(dllexport) / __declspec(dllimport) and friends.  Therefore,
  151.  *   we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
  152.  *   to __declspec() stuff.  However, we DO need to worry about 
  153.  *   PNG_BUILD_DLL and PNG_STATIC because those change some defaults
  154.  *   such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
  155.  */
  156. #if defined(__CYGWIN__)
  157. #  if defined(ALL_STATIC)
  158. #    if defined(PNG_BUILD_DLL)
  159. #      undef PNG_BUILD_DLL
  160. #    endif
  161. #    if defined(PNG_USE_DLL)
  162. #      undef PNG_USE_DLL
  163. #    endif
  164. #    if defined(PNG_DLL)
  165. #      undef PNG_DLL
  166. #    endif
  167. #    if !defined(PNG_STATIC)
  168. #      define PNG_STATIC
  169. #    endif
  170. #  else
  171. #    if defined (PNG_BUILD_DLL)
  172. #      if defined(PNG_STATIC)
  173. #        undef PNG_STATIC
  174. #      endif
  175. #      if defined(PNG_USE_DLL)
  176. #        undef PNG_USE_DLL
  177. #      endif
  178. #      if !defined(PNG_DLL)
  179. #        define PNG_DLL
  180. #      endif
  181. #    else
  182. #      if defined(PNG_STATIC)
  183. #        if defined(PNG_USE_DLL)
  184. #          undef PNG_USE_DLL
  185. #        endif
  186. #        if defined(PNG_DLL)
  187. #          undef PNG_DLL
  188. #        endif
  189. #      else
  190. #        if !defined(PNG_USE_DLL)
  191. #          define PNG_USE_DLL
  192. #        endif
  193. #        if !defined(PNG_DLL)
  194. #          define PNG_DLL
  195. #        endif
  196. #      endif  
  197. #    endif  
  198. #  endif
  199. #endif
  200.  
  201. /* This protects us against compilers that run on a windowing system
  202.  * and thus don't have or would rather us not use the stdio types:
  203.  * stdin, stdout, and stderr.  The only one currently used is stderr
  204.  * in png_error() and png_warning().  #defining PNG_NO_CONSOLE_IO will
  205.  * prevent these from being compiled and used. #defining PNG_NO_STDIO
  206.  * will also prevent these, plus will prevent the entire set of stdio
  207.  * macros and functions (FILE *, printf, etc.) from being compiled and used,
  208.  * unless (PNG_DEBUG > 0) has been #defined.
  209.  *
  210.  * #define PNG_NO_CONSOLE_IO
  211.  * #define PNG_NO_STDIO
  212.  */
  213.  
  214. #if defined(_WIN32_WCE)
  215. #  include <windows.h>
  216.    /* Console I/O functions are not supported on WindowsCE */
  217. #  define PNG_NO_CONSOLE_IO
  218. #  ifdef PNG_DEBUG
  219. #    undef PNG_DEBUG
  220. #  endif
  221. #endif
  222.  
  223. #ifdef PNG_BUILD_DLL
  224. #  ifndef PNG_CONSOLE_IO_SUPPORTED
  225. #    ifndef PNG_NO_CONSOLE_IO
  226. #      define PNG_NO_CONSOLE_IO
  227. #    endif
  228. #  endif
  229. #endif
  230.  
  231. #  ifdef PNG_NO_STDIO
  232. #    ifndef PNG_NO_CONSOLE_IO
  233. #      define PNG_NO_CONSOLE_IO
  234. #    endif
  235. #    ifdef PNG_DEBUG
  236. #      if (PNG_DEBUG > 0)
  237. #        include <stdio.h>
  238. #      endif
  239. #    endif
  240. #  else
  241. #    if !defined(_WIN32_WCE)
  242. /* "stdio.h" functions are not supported on WindowsCE */
  243. #      include <stdio.h>
  244. #    endif
  245. #  endif
  246.  
  247. /* This macro protects us against machines that don't have function
  248.  * prototypes (ie K&R style headers).  If your compiler does not handle
  249.  * function prototypes, define this macro and use the included ansi2knr.
  250.  * I've always been able to use _NO_PROTO as the indicator, but you may
  251.  * need to drag the empty declaration out in front of here, or change the
  252.  * ifdef to suit your own needs.
  253.  */
  254. #ifndef PNGARG
  255.  
  256. #ifdef OF /* zlib prototype munger */
  257. #  define PNGARG(arglist) OF(arglist)
  258. #else
  259.  
  260. #ifdef _NO_PROTO
  261. #  define PNGARG(arglist) ()
  262. #  ifndef PNG_TYPECAST_NULL
  263. #     define PNG_TYPECAST_NULL
  264. #  endif
  265. #else
  266. #  define PNGARG(arglist) arglist
  267. #endif /* _NO_PROTO */
  268.  
  269. #endif /* OF */
  270.  
  271. #endif /* PNGARG */
  272.  
  273. /* Try to determine if we are compiling on a Mac.  Note that testing for
  274.  * just __MWERKS__ is not good enough, because the Codewarrior is now used
  275.  * on non-Mac platforms.
  276.  */
  277. #ifndef MACOS
  278. #  if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
  279.       defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
  280. #    define MACOS
  281. #  endif
  282. #endif
  283.  
  284. /* enough people need this for various reasons to include it here */
  285. #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
  286. #  include <sys/types.h>
  287. #endif
  288.  
  289. #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
  290. #  define PNG_SETJMP_SUPPORTED
  291. #endif
  292.  
  293. #ifdef PNG_SETJMP_SUPPORTED
  294. /* This is an attempt to force a single setjmp behaviour on Linux.  If
  295.  * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
  296.  */
  297.  
  298. #  ifdef __linux__
  299. #    ifdef _BSD_SOURCE
  300. #      define PNG_SAVE_BSD_SOURCE
  301. #      undef _BSD_SOURCE
  302. #      ifdef _SETJMP_H
  303. /* Explanation added by debian maintainer Philippe Troin <phil@fifi.org>.
  304.    There are two versions of setjmp, depending wether or not we compile for
  305.    BSD. They are incompatible and can cause crashes. The PNG people force
  306.    here a unique behavior for setjmp. It fou get the error below,
  307.    then include <png.h> before <setjmp.h>.
  308. */
  309. /* Extra modification by Josselin Mouette <joss@debian.org>: there is no
  310.  * need to fail if we are not using _BSD_SOURCE.
  311.  * */
  312. #        error png.h already includes setjmp.h with some additional fixup.
  313. #      endif
  314. #    endif
  315. #  endif /* __linux__ */
  316.  
  317.    /* include setjmp.h for error handling */
  318. #  include <setjmp.h>
  319.  
  320. #  ifdef __linux__
  321. #    ifdef PNG_SAVE_BSD_SOURCE
  322. #      define _BSD_SOURCE
  323. #      undef PNG_SAVE_BSD_SOURCE
  324. #    endif
  325. #  endif /* __linux__ */
  326. #endif /* PNG_SETJMP_SUPPORTED */
  327.  
  328. #ifdef BSD
  329. #  include <strings.h>
  330. #else
  331. #  include <string.h>
  332. #endif
  333.  
  334. /* Other defines for things like memory and the like can go here.  */
  335. #ifdef PNG_INTERNAL
  336.  
  337. #include <stdlib.h>
  338.  
  339. /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
  340.  * aren't usually used outside the library (as far as I know), so it is
  341.  * debatable if they should be exported at all.  In the future, when it is
  342.  * possible to have run-time registry of chunk-handling functions, some of
  343.  * these will be made available again.
  344. #define PNG_EXTERN extern
  345.  */
  346. #define PNG_EXTERN
  347.  
  348. /* Other defines specific to compilers can go here.  Try to keep
  349.  * them inside an appropriate ifdef/endif pair for portability.
  350.  */
  351.  
  352. #if defined(PNG_FLOATING_POINT_SUPPORTED)
  353. #  if defined(MACOS)
  354.      /* We need to check that <math.h> hasn't already been included earlier
  355.       * as it seems it doesn't agree with <fp.h>, yet we should really use
  356.       * <fp.h> if possible.
  357.       */
  358. #    if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
  359. #      include <fp.h>
  360. #    endif
  361. #  else
  362. #    include <math.h>
  363. #  endif
  364. #  if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
  365.      /* Amiga SAS/C: We must include builtin FPU functions when compiling using
  366.       * MATH=68881
  367.       */
  368. #    include <m68881.h>
  369. #  endif
  370. #endif
  371.  
  372. /* Codewarrior on NT has linking problems without this. */
  373. #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
  374. #  define PNG_ALWAYS_EXTERN
  375. #endif
  376.  
  377. /* This provides the non-ANSI (far) memory allocation routines. */
  378. #if defined(__TURBOC__) && defined(__MSDOS__)
  379. #  include <mem.h>
  380. #  include <alloc.h>
  381. #endif
  382.  
  383. /* I have no idea why is this necessary... */
  384. #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
  385.     defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
  386. #  include <malloc.h>
  387. #endif
  388.  
  389. /* This controls how fine the dithering gets.  As this allocates
  390.  * a largish chunk of memory (32K), those who are not as concerned
  391.  * with dithering quality can decrease some or all of these.
  392.  */
  393. #ifndef PNG_DITHER_RED_BITS
  394. #  define PNG_DITHER_RED_BITS 5
  395. #endif
  396. #ifndef PNG_DITHER_GREEN_BITS
  397. #  define PNG_DITHER_GREEN_BITS 5
  398. #endif
  399. #ifndef PNG_DITHER_BLUE_BITS
  400. #  define PNG_DITHER_BLUE_BITS 5
  401. #endif
  402.  
  403. /* This controls how fine the gamma correction becomes when you
  404.  * are only interested in 8 bits anyway.  Increasing this value
  405.  * results in more memory being used, and more pow() functions
  406.  * being called to fill in the gamma tables.  Don't set this value
  407.  * less then 8, and even that may not work (I haven't tested it).
  408.  */
  409.  
  410. #ifndef PNG_MAX_GAMMA_8
  411. #  define PNG_MAX_GAMMA_8 11
  412. #endif
  413.  
  414. /* This controls how much a difference in gamma we can tolerate before
  415.  * we actually start doing gamma conversion.
  416.  */
  417. #ifndef PNG_GAMMA_THRESHOLD
  418. #  define PNG_GAMMA_THRESHOLD 0.05
  419. #endif
  420.  
  421. #endif /* PNG_INTERNAL */
  422.  
  423. /* The following uses const char * instead of char * for error
  424.  * and warning message functions, so some compilers won't complain.
  425.  * If you do not want to use const, define PNG_NO_CONST here.
  426.  */
  427.  
  428. #ifndef PNG_NO_CONST
  429. #  define PNG_CONST const
  430. #else
  431. #  define PNG_CONST
  432. #endif
  433.  
  434. /* The following defines give you the ability to remove code from the
  435.  * library that you will not be using.  I wish I could figure out how to
  436.  * automate this, but I can't do that without making it seriously hard
  437.  * on the users.  So if you are not using an ability, change the #define
  438.  * to and #undef, and that part of the library will not be compiled.  If
  439.  * your linker can't find a function, you may want to make sure the
  440.  * ability is defined here.  Some of these depend upon some others being
  441.  * defined.  I haven't figured out all the interactions here, so you may
  442.  * have to experiment awhile to get everything to compile.  If you are
  443.  * creating or using a shared library, you probably shouldn't touch this,
  444.  * as it will affect the size of the structures, and this will cause bad
  445.  * things to happen if the library and/or application ever change.
  446.  */
  447.  
  448. /* Any features you will not be using can be undef'ed here */
  449.  
  450. /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
  451.  * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
  452.  * on the compile line, then pick and choose which ones to define without
  453.  * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
  454.  * if you only want to have a png-compliant reader/writer but don't need
  455.  * any of the extra transformations.  This saves about 80 kbytes in a
  456.  * typical installation of the library. (PNG_NO_* form added in version
  457.  * 1.0.1c, for consistency)
  458.  */
  459.  
  460. /* The size of the png_text structure changed in libpng-1.0.6 when
  461.  * iTXt is supported.  It is turned off by default, to support old apps
  462.  * that malloc the png_text structure instead of calling png_set_text()
  463.  * and letting libpng malloc it.  It will be turned on by default in
  464.  * libpng-1.3.0.
  465.  */
  466.  
  467. #ifndef PNG_iTXt_SUPPORTED
  468. #  if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
  469. #    define PNG_NO_READ_iTXt
  470. #  endif
  471. #  if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
  472. #    define PNG_NO_WRITE_iTXt
  473. #  endif
  474. #endif
  475.  
  476. /* The following support, added after version 1.0.0, can be turned off here en
  477.  * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
  478.  * with old applications that require the length of png_struct and png_info
  479.  * to remain unchanged.
  480.  */
  481.  
  482. #ifdef PNG_LEGACY_SUPPORTED
  483. #  define PNG_NO_FREE_ME
  484. #  define PNG_NO_READ_UNKNOWN_CHUNKS
  485. #  define PNG_NO_WRITE_UNKNOWN_CHUNKS
  486. #  define PNG_NO_READ_USER_CHUNKS
  487. #  define PNG_NO_READ_iCCP
  488. #  define PNG_NO_WRITE_iCCP
  489. #  define PNG_NO_READ_iTXt
  490. #  define PNG_NO_WRITE_iTXt
  491. #  define PNG_NO_READ_sCAL
  492. #  define PNG_NO_WRITE_sCAL
  493. #  define PNG_NO_READ_sPLT
  494. #  define PNG_NO_WRITE_sPLT
  495. #  define PNG_NO_INFO_IMAGE
  496. #  define PNG_NO_READ_RGB_TO_GRAY
  497. #  define PNG_NO_READ_USER_TRANSFORM
  498. #  define PNG_NO_WRITE_USER_TRANSFORM
  499. #  define PNG_NO_USER_MEM
  500. #  define PNG_NO_READ_EMPTY_PLTE
  501. #  define PNG_NO_MNG_FEATURES
  502. #  define PNG_NO_FIXED_POINT_SUPPORTED
  503. #endif
  504.  
  505. /* Ignore attempt to turn off both floating and fixed point support */
  506. #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
  507.     !defined(PNG_NO_FIXED_POINT_SUPPORTED)
  508. #  define PNG_FIXED_POINT_SUPPORTED
  509. #endif
  510.  
  511. #ifndef PNG_NO_FREE_ME
  512. #  define PNG_FREE_ME_SUPPORTED
  513. #endif
  514.  
  515. #if defined(PNG_READ_SUPPORTED)
  516.  
  517. #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
  518.       !defined(PNG_NO_READ_TRANSFORMS)
  519. #  define PNG_READ_TRANSFORMS_SUPPORTED
  520. #endif
  521.  
  522. #ifdef PNG_READ_TRANSFORMS_SUPPORTED
  523. #  ifndef PNG_NO_READ_EXPAND
  524. #    define PNG_READ_EXPAND_SUPPORTED
  525. #  endif
  526. #  ifndef PNG_NO_READ_SHIFT
  527. #    define PNG_READ_SHIFT_SUPPORTED
  528. #  endif
  529. #  ifndef PNG_NO_READ_PACK
  530. #    define PNG_READ_PACK_SUPPORTED
  531. #  endif
  532. #  ifndef PNG_NO_READ_BGR
  533. #    define PNG_READ_BGR_SUPPORTED
  534. #  endif
  535. #  ifndef PNG_NO_READ_SWAP
  536. #    define PNG_READ_SWAP_SUPPORTED
  537. #  endif
  538. #  ifndef PNG_NO_READ_PACKSWAP
  539. #    define PNG_READ_PACKSWAP_SUPPORTED
  540. #  endif
  541. #  ifndef PNG_NO_READ_INVERT
  542. #    define PNG_READ_INVERT_SUPPORTED
  543. #  endif
  544. #  ifndef PNG_NO_READ_DITHER
  545. #    define PNG_READ_DITHER_SUPPORTED
  546. #  endif
  547. #  ifndef PNG_NO_READ_BACKGROUND
  548. #    define PNG_READ_BACKGROUND_SUPPORTED
  549. #  endif
  550. #  ifndef PNG_NO_READ_16_TO_8
  551. #    define PNG_READ_16_TO_8_SUPPORTED
  552. #  endif
  553. #  ifndef PNG_NO_READ_FILLER
  554. #    define PNG_READ_FILLER_SUPPORTED
  555. #  endif
  556. #  ifndef PNG_NO_READ_GAMMA
  557. #    define PNG_READ_GAMMA_SUPPORTED
  558. #  endif
  559. #  ifndef PNG_NO_READ_GRAY_TO_RGB
  560. #    define PNG_READ_GRAY_TO_RGB_SUPPORTED
  561. #  endif
  562. #  ifndef PNG_NO_READ_SWAP_ALPHA
  563. #    define PNG_READ_SWAP_ALPHA_SUPPORTED
  564. #  endif
  565. #  ifndef PNG_NO_READ_INVERT_ALPHA
  566. #    define PNG_READ_INVERT_ALPHA_SUPPORTED
  567. #  endif
  568. #  ifndef PNG_NO_READ_STRIP_ALPHA
  569. #    define PNG_READ_STRIP_ALPHA_SUPPORTED
  570. #  endif
  571. #  ifndef PNG_NO_READ_USER_TRANSFORM
  572. #    define PNG_READ_USER_TRANSFORM_SUPPORTED
  573. #  endif
  574. #  ifndef PNG_NO_READ_RGB_TO_GRAY
  575. #    define PNG_READ_RGB_TO_GRAY_SUPPORTED
  576. #  endif
  577. #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
  578.  
  579. #if !defined(PNG_NO_PROGRESSIVE_READ) && \
  580.  !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED)  /* if you don't do progressive */
  581. #  define PNG_PROGRESSIVE_READ_SUPPORTED     /* reading.  This is not talking */
  582. #endif                               /* about interlacing capability!  You'll */
  583.               /* still have interlacing unless you change the following line: */
  584.  
  585. #define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
  586.  
  587. #ifndef PNG_NO_READ_COMPOSITE_NODIV
  588. #  ifndef PNG_NO_READ_COMPOSITED_NODIV  /* libpng-1.0.x misspelling */
  589. #    define PNG_READ_COMPOSITE_NODIV_SUPPORTED   /* well tested on Intel, SGI */
  590. #  endif
  591. #endif
  592.  
  593. /* Deprecated, will be removed from version 2.0.0.
  594.    Use PNG_MNG_FEATURES_SUPPORTED instead. */
  595. #ifndef PNG_NO_READ_EMPTY_PLTE
  596. #  define PNG_READ_EMPTY_PLTE_SUPPORTED
  597. #endif
  598.  
  599. #endif /* PNG_READ_SUPPORTED */
  600.  
  601. #if defined(PNG_WRITE_SUPPORTED)
  602.  
  603. # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
  604.     !defined(PNG_NO_WRITE_TRANSFORMS)
  605. #  define PNG_WRITE_TRANSFORMS_SUPPORTED
  606. #endif
  607.  
  608. #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
  609. #  ifndef PNG_NO_WRITE_SHIFT
  610. #    define PNG_WRITE_SHIFT_SUPPORTED
  611. #  endif
  612. #  ifndef PNG_NO_WRITE_PACK
  613. #    define PNG_WRITE_PACK_SUPPORTED
  614. #  endif
  615. #  ifndef PNG_NO_WRITE_BGR
  616. #    define PNG_WRITE_BGR_SUPPORTED
  617. #  endif
  618. #  ifndef PNG_NO_WRITE_SWAP
  619. #    define PNG_WRITE_SWAP_SUPPORTED
  620. #  endif
  621. #  ifndef PNG_NO_WRITE_PACKSWAP
  622. #    define PNG_WRITE_PACKSWAP_SUPPORTED
  623. #  endif
  624. #  ifndef PNG_NO_WRITE_INVERT
  625. #    define PNG_WRITE_INVERT_SUPPORTED
  626. #  endif
  627. #  ifndef PNG_NO_WRITE_FILLER
  628. #    define PNG_WRITE_FILLER_SUPPORTED   /* same as WRITE_STRIP_ALPHA */
  629. #  endif
  630. #  ifndef PNG_NO_WRITE_SWAP_ALPHA
  631. #    define PNG_WRITE_SWAP_ALPHA_SUPPORTED
  632. #  endif
  633. #  ifndef PNG_NO_WRITE_INVERT_ALPHA
  634. #    define PNG_WRITE_INVERT_ALPHA_SUPPORTED
  635. #  endif
  636. #  ifndef PNG_NO_WRITE_USER_TRANSFORM
  637. #    define PNG_WRITE_USER_TRANSFORM_SUPPORTED
  638. #  endif
  639. #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
  640.  
  641. #define PNG_WRITE_INTERLACING_SUPPORTED  /* not required for PNG-compliant
  642.                                             encoders, but can cause trouble
  643.                                             if left undefined */
  644.  
  645. #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
  646.      defined(PNG_FLOATING_POINT_SUPPORTED)
  647. #  define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
  648. #endif
  649.  
  650. #ifndef PNG_NO_WRITE_FLUSH
  651. #  define PNG_WRITE_FLUSH_SUPPORTED
  652. #endif
  653.  
  654. /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
  655. #ifndef PNG_NO_WRITE_EMPTY_PLTE
  656. #  define PNG_WRITE_EMPTY_PLTE_SUPPORTED
  657. #endif
  658.  
  659. #endif /* PNG_WRITE_SUPPORTED */
  660.  
  661. #ifndef PNG_1_0_X
  662. #  ifndef PNG_NO_ERROR_NUMBERS
  663. #    define PNG_ERROR_NUMBERS_SUPPORTED
  664. #  endif
  665. #endif /* PNG_1_0_X */
  666.  
  667. #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
  668.     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
  669. #  ifndef PNG_NO_USER_TRANSFORM_PTR
  670. #    define PNG_USER_TRANSFORM_PTR_SUPPORTED
  671. #  endif
  672. #endif
  673.  
  674. #ifndef PNG_NO_STDIO
  675. #  define PNG_TIME_RFC1123_SUPPORTED
  676. #endif
  677.  
  678. /* This adds extra functions in pngget.c for accessing data from the
  679.  * info pointer (added in version 0.99)
  680.  * png_get_image_width()
  681.  * png_get_image_height()
  682.  * png_get_bit_depth()
  683.  * png_get_color_type()
  684.  * png_get_compression_type()
  685.  * png_get_filter_type()
  686.  * png_get_interlace_type()
  687.  * png_get_pixel_aspect_ratio()
  688.  * png_get_pixels_per_meter()
  689.  * png_get_x_offset_pixels()
  690.  * png_get_y_offset_pixels()
  691.  * png_get_x_offset_microns()
  692.  * png_get_y_offset_microns()
  693.  */
  694. #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
  695. #  define PNG_EASY_ACCESS_SUPPORTED
  696. #endif
  697.  
  698. /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 
  699.    even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */
  700. #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
  701. #  ifndef PNG_ASSEMBLER_CODE_SUPPORTED
  702. #    define PNG_ASSEMBLER_CODE_SUPPORTED
  703. #  endif
  704. #  if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
  705. #    define PNG_MMX_CODE_SUPPORTED
  706. #  endif
  707. #endif
  708.  
  709. /* If you are sure that you don't need thread safety and you are compiling
  710.    with PNG_USE_PNGCCRD for an MMX application, you can define this for
  711.    faster execution.  See pnggccrd.c.
  712. #define PNG_THREAD_UNSAFE_OK
  713. */
  714.  
  715. #if !defined(PNG_1_0_X)
  716. #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
  717. #  define PNG_USER_MEM_SUPPORTED
  718. #endif
  719. #endif /* PNG_1_0_X */
  720.  
  721. /* Added at libpng-1.2.6 */
  722. #if !defined(PNG_1_0_X)
  723. #ifndef PNG_SET_USER_LIMITS_SUPPORTED
  724. #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
  725. #  define PNG_SET_USER_LIMITS_SUPPORTED
  726. #endif
  727. #endif
  728. #endif /* PNG_1_0_X */
  729.  
  730. /* Added at libpng-1.0.16 and 1.2.6.  To accept all valid PNGS no matter
  731.  * how large, set these limits to 0x7fffffffL
  732.  */
  733. #ifndef PNG_USER_WIDTH_MAX
  734. #  define PNG_USER_WIDTH_MAX 1000000L
  735. #endif
  736. #ifndef PNG_USER_HEIGHT_MAX
  737. #  define PNG_USER_HEIGHT_MAX 1000000L
  738. #endif
  739.  
  740. /* These are currently experimental features, define them if you want */
  741.  
  742. /* very little testing */
  743. /*
  744. #ifdef PNG_READ_SUPPORTED
  745. #  ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
  746. #    define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
  747. #  endif
  748. #endif
  749. */
  750.  
  751. /* This is only for PowerPC big-endian and 680x0 systems */
  752. /* some testing */
  753. /*
  754. #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
  755. #  define PNG_READ_BIG_ENDIAN_SUPPORTED
  756. #endif
  757. */
  758.  
  759. /* Buggy compilers (e.g., gcc 2.7.2.2) need this */
  760. /*
  761. #define PNG_NO_POINTER_INDEXING
  762. */
  763.  
  764. /* These functions are turned off by default, as they will be phased out. */
  765. /*
  766. #define  PNG_USELESS_TESTS_SUPPORTED
  767. #define  PNG_CORRECT_PALETTE_SUPPORTED
  768. */
  769.  
  770. /* Any chunks you are not interested in, you can undef here.  The
  771.  * ones that allocate memory may be expecially important (hIST,
  772.  * tEXt, zTXt, tRNS, pCAL).  Others will just save time and make png_info
  773.  * a bit smaller.
  774.  */
  775.  
  776. #if defined(PNG_READ_SUPPORTED) && \
  777.     !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
  778.     !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
  779. #  define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
  780. #endif
  781.  
  782. #if defined(PNG_WRITE_SUPPORTED) && \
  783.     !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
  784.     !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
  785. #  define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
  786. #endif
  787.  
  788. #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
  789.  
  790. #ifdef PNG_NO_READ_TEXT
  791. #  define PNG_NO_READ_iTXt
  792. #  define PNG_NO_READ_tEXt
  793. #  define PNG_NO_READ_zTXt
  794. #endif
  795. #ifndef PNG_NO_READ_bKGD
  796. #  define PNG_READ_bKGD_SUPPORTED
  797. #  define PNG_bKGD_SUPPORTED
  798. #endif
  799. #ifndef PNG_NO_READ_cHRM
  800. #  define PNG_READ_cHRM_SUPPORTED
  801. #  define PNG_cHRM_SUPPORTED
  802. #endif
  803. #ifndef PNG_NO_READ_gAMA
  804. #  define PNG_READ_gAMA_SUPPORTED
  805. #  define PNG_gAMA_SUPPORTED
  806. #endif
  807. #ifndef PNG_NO_READ_hIST
  808. #  define PNG_READ_hIST_SUPPORTED
  809. #  define PNG_hIST_SUPPORTED
  810. #endif
  811. #ifndef PNG_NO_READ_iCCP
  812. #  define PNG_READ_iCCP_SUPPORTED
  813. #  define PNG_iCCP_SUPPORTED
  814. #endif
  815. #ifndef PNG_NO_READ_iTXt
  816. #  ifndef PNG_READ_iTXt_SUPPORTED
  817. #    define PNG_READ_iTXt_SUPPORTED
  818. #  endif
  819. #  ifndef PNG_iTXt_SUPPORTED
  820. #    define PNG_iTXt_SUPPORTED
  821. #  endif
  822. #endif
  823. #ifndef PNG_NO_READ_oFFs
  824. #  define PNG_READ_oFFs_SUPPORTED
  825. #  define PNG_oFFs_SUPPORTED
  826. #endif
  827. #ifndef PNG_NO_READ_pCAL
  828. #  define PNG_READ_pCAL_SUPPORTED
  829. #  define PNG_pCAL_SUPPORTED
  830. #endif
  831. #ifndef PNG_NO_READ_sCAL
  832. #  define PNG_READ_sCAL_SUPPORTED
  833. #  define PNG_sCAL_SUPPORTED
  834. #endif
  835. #ifndef PNG_NO_READ_pHYs
  836. #  define PNG_READ_pHYs_SUPPORTED
  837. #  define PNG_pHYs_SUPPORTED
  838. #endif
  839. #ifndef PNG_NO_READ_sBIT
  840. #  define PNG_READ_sBIT_SUPPORTED
  841. #  define PNG_sBIT_SUPPORTED
  842. #endif
  843. #ifndef PNG_NO_READ_sPLT
  844. #  define PNG_READ_sPLT_SUPPORTED
  845. #  define PNG_sPLT_SUPPORTED
  846. #endif
  847. #ifndef PNG_NO_READ_sRGB
  848. #  define PNG_READ_sRGB_SUPPORTED
  849. #  define PNG_sRGB_SUPPORTED
  850. #endif
  851. #ifndef PNG_NO_READ_tEXt
  852. #  define PNG_READ_tEXt_SUPPORTED
  853. #  define PNG_tEXt_SUPPORTED
  854. #endif
  855. #ifndef PNG_NO_READ_tIME
  856. #  define PNG_READ_tIME_SUPPORTED
  857. #  define PNG_tIME_SUPPORTED
  858. #endif
  859. #ifndef PNG_NO_READ_tRNS
  860. #  define PNG_READ_tRNS_SUPPORTED
  861. #  define PNG_tRNS_SUPPORTED
  862. #endif
  863. #ifndef PNG_NO_READ_zTXt
  864. #  define PNG_READ_zTXt_SUPPORTED
  865. #  define PNG_zTXt_SUPPORTED
  866. #endif
  867. #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
  868. #  define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
  869. #  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
  870. #    define PNG_UNKNOWN_CHUNKS_SUPPORTED
  871. #  endif
  872. #  ifndef PNG_NO_HANDLE_AS_UNKNOWN
  873. #    define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  874. #  endif
  875. #endif
  876. #if !defined(PNG_NO_READ_USER_CHUNKS) && \
  877.      defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
  878. #  define PNG_READ_USER_CHUNKS_SUPPORTED
  879. #  define PNG_USER_CHUNKS_SUPPORTED
  880. #  ifdef PNG_NO_READ_UNKNOWN_CHUNKS
  881. #    undef PNG_NO_READ_UNKNOWN_CHUNKS
  882. #  endif
  883. #  ifdef PNG_NO_HANDLE_AS_UNKNOWN
  884. #    undef PNG_NO_HANDLE_AS_UNKNOWN
  885. #  endif
  886. #endif
  887. #ifndef PNG_NO_READ_OPT_PLTE
  888. #  define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
  889. #endif                      /* optional PLTE chunk in RGB and RGBA images */
  890. #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
  891.     defined(PNG_READ_zTXt_SUPPORTED)
  892. #  define PNG_READ_TEXT_SUPPORTED
  893. #  define PNG_TEXT_SUPPORTED
  894. #endif
  895.  
  896. #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
  897.  
  898. #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
  899.  
  900. #ifdef PNG_NO_WRITE_TEXT
  901. #  define PNG_NO_WRITE_iTXt
  902. #  define PNG_NO_WRITE_tEXt
  903. #  define PNG_NO_WRITE_zTXt
  904. #endif
  905. #ifndef PNG_NO_WRITE_bKGD
  906. #  define PNG_WRITE_bKGD_SUPPORTED
  907. #  ifndef PNG_bKGD_SUPPORTED
  908. #    define PNG_bKGD_SUPPORTED
  909. #  endif
  910. #endif
  911. #ifndef PNG_NO_WRITE_cHRM
  912. #  define PNG_WRITE_cHRM_SUPPORTED
  913. #  ifndef PNG_cHRM_SUPPORTED
  914. #    define PNG_cHRM_SUPPORTED
  915. #  endif
  916. #endif
  917. #ifndef PNG_NO_WRITE_gAMA
  918. #  define PNG_WRITE_gAMA_SUPPORTED
  919. #  ifndef PNG_gAMA_SUPPORTED
  920. #    define PNG_gAMA_SUPPORTED
  921. #  endif
  922. #endif
  923. #ifndef PNG_NO_WRITE_hIST
  924. #  define PNG_WRITE_hIST_SUPPORTED
  925. #  ifndef PNG_hIST_SUPPORTED
  926. #    define PNG_hIST_SUPPORTED
  927. #  endif
  928. #endif
  929. #ifndef PNG_NO_WRITE_iCCP
  930. #  define PNG_WRITE_iCCP_SUPPORTED
  931. #  ifndef PNG_iCCP_SUPPORTED
  932. #    define PNG_iCCP_SUPPORTED
  933. #  endif
  934. #endif
  935. #ifndef PNG_NO_WRITE_iTXt
  936. #  ifndef PNG_WRITE_iTXt_SUPPORTED
  937. #    define PNG_WRITE_iTXt_SUPPORTED
  938. #  endif
  939. #  ifndef PNG_iTXt_SUPPORTED
  940. #    define PNG_iTXt_SUPPORTED
  941. #  endif
  942. #endif
  943. #ifndef PNG_NO_WRITE_oFFs
  944. #  define PNG_WRITE_oFFs_SUPPORTED
  945. #  ifndef PNG_oFFs_SUPPORTED
  946. #    define PNG_oFFs_SUPPORTED
  947. #  endif
  948. #endif
  949. #ifndef PNG_NO_WRITE_pCAL
  950. #  define PNG_WRITE_pCAL_SUPPORTED
  951. #  ifndef PNG_pCAL_SUPPORTED
  952. #    define PNG_pCAL_SUPPORTED
  953. #  endif
  954. #endif
  955. #ifndef PNG_NO_WRITE_sCAL
  956. #  define PNG_WRITE_sCAL_SUPPORTED
  957. #  ifndef PNG_sCAL_SUPPORTED
  958. #    define PNG_sCAL_SUPPORTED
  959. #  endif
  960. #endif
  961. #ifndef PNG_NO_WRITE_pHYs
  962. #  define PNG_WRITE_pHYs_SUPPORTED
  963. #  ifndef PNG_pHYs_SUPPORTED
  964. #    define PNG_pHYs_SUPPORTED
  965. #  endif
  966. #endif
  967. #ifndef PNG_NO_WRITE_sBIT
  968. #  define PNG_WRITE_sBIT_SUPPORTED
  969. #  ifndef PNG_sBIT_SUPPORTED
  970. #    define PNG_sBIT_SUPPORTED
  971. #  endif
  972. #endif
  973. #ifndef PNG_NO_WRITE_sPLT
  974. #  define PNG_WRITE_sPLT_SUPPORTED
  975. #  ifndef PNG_sPLT_SUPPORTED
  976. #    define PNG_sPLT_SUPPORTED
  977. #  endif
  978. #endif
  979. #ifndef PNG_NO_WRITE_sRGB
  980. #  define PNG_WRITE_sRGB_SUPPORTED
  981. #  ifndef PNG_sRGB_SUPPORTED
  982. #    define PNG_sRGB_SUPPORTED
  983. #  endif
  984. #endif
  985. #ifndef PNG_NO_WRITE_tEXt
  986. #  define PNG_WRITE_tEXt_SUPPORTED
  987. #  ifndef PNG_tEXt_SUPPORTED
  988. #    define PNG_tEXt_SUPPORTED
  989. #  endif
  990. #endif
  991. #ifndef PNG_NO_WRITE_tIME
  992. #  define PNG_WRITE_tIME_SUPPORTED
  993. #  ifndef PNG_tIME_SUPPORTED
  994. #    define PNG_tIME_SUPPORTED
  995. #  endif
  996. #endif
  997. #ifndef PNG_NO_WRITE_tRNS
  998. #  define PNG_WRITE_tRNS_SUPPORTED
  999. #  ifndef PNG_tRNS_SUPPORTED
  1000. #    define PNG_tRNS_SUPPORTED
  1001. #  endif
  1002. #endif
  1003. #ifndef PNG_NO_WRITE_zTXt
  1004. #  define PNG_WRITE_zTXt_SUPPORTED
  1005. #  ifndef PNG_zTXt_SUPPORTED
  1006. #    define PNG_zTXt_SUPPORTED
  1007. #  endif
  1008. #endif
  1009. #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
  1010. #  define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
  1011. #  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
  1012. #    define PNG_UNKNOWN_CHUNKS_SUPPORTED
  1013. #  endif
  1014. #  ifndef PNG_NO_HANDLE_AS_UNKNOWN
  1015. #     ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  1016. #       define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  1017. #     endif
  1018. #  endif
  1019. #endif
  1020. #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
  1021.     defined(PNG_WRITE_zTXt_SUPPORTED)
  1022. #  define PNG_WRITE_TEXT_SUPPORTED
  1023. #  ifndef PNG_TEXT_SUPPORTED
  1024. #    define PNG_TEXT_SUPPORTED
  1025. #  endif
  1026. #endif
  1027.  
  1028. #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
  1029.  
  1030. /* Turn this off to disable png_read_png() and
  1031.  * png_write_png() and leave the row_pointers member
  1032.  * out of the info structure.
  1033.  */
  1034. #ifndef PNG_NO_INFO_IMAGE
  1035. #  define PNG_INFO_IMAGE_SUPPORTED
  1036. #endif
  1037.  
  1038. /* need the time information for reading tIME chunks */
  1039. #if defined(PNG_tIME_SUPPORTED)
  1040. #  if !defined(_WIN32_WCE)
  1041.      /* "time.h" functions are not supported on WindowsCE */
  1042. #    include <time.h>
  1043. #  endif
  1044. #endif
  1045.  
  1046. /* Some typedefs to get us started.  These should be safe on most of the
  1047.  * common platforms.  The typedefs should be at least as large as the
  1048.  * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
  1049.  * don't have to be exactly that size.  Some compilers dislike passing
  1050.  * unsigned shorts as function parameters, so you may be better off using
  1051.  * unsigned int for png_uint_16.  Likewise, for 64-bit systems, you may
  1052.  * want to have unsigned int for png_uint_32 instead of unsigned long.
  1053.  */
  1054.  
  1055. typedef unsigned long png_uint_32;
  1056. typedef long png_int_32;
  1057. typedef unsigned short png_uint_16;
  1058. typedef short png_int_16;
  1059. typedef unsigned char png_byte;
  1060.  
  1061. /* This is usually size_t.  It is typedef'ed just in case you need it to
  1062.    change (I'm not sure if you will or not, so I thought I'd be safe) */
  1063. #ifdef PNG_SIZE_T
  1064.    typedef PNG_SIZE_T png_size_t;
  1065. #  define png_sizeof(x) png_convert_size(sizeof (x))
  1066. #else
  1067.    typedef size_t png_size_t;
  1068. #  define png_sizeof(x) sizeof (x)
  1069. #endif
  1070.  
  1071. /* The following is needed for medium model support.  It cannot be in the
  1072.  * PNG_INTERNAL section.  Needs modification for other compilers besides
  1073.  * MSC.  Model independent support declares all arrays and pointers to be
  1074.  * large using the far keyword.  The zlib version used must also support
  1075.  * model independent data.  As of version zlib 1.0.4, the necessary changes
  1076.  * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
  1077.  * changes that are needed. (Tim Wegner)
  1078.  */
  1079.  
  1080. /* Separate compiler dependencies (problem here is that zlib.h always
  1081.    defines FAR. (SJT) */
  1082. #ifdef __BORLANDC__
  1083. #  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
  1084. #    define LDATA 1
  1085. #  else
  1086. #    define LDATA 0
  1087. #  endif
  1088.    /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
  1089. #  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
  1090. #    define PNG_MAX_MALLOC_64K
  1091. #    if (LDATA != 1)
  1092. #      ifndef FAR
  1093. #        define FAR __far
  1094. #      endif
  1095. #      define USE_FAR_KEYWORD
  1096. #    endif   /* LDATA != 1 */
  1097.      /* Possibly useful for moving data out of default segment.
  1098.       * Uncomment it if you want. Could also define FARDATA as
  1099.       * const if your compiler supports it. (SJT)
  1100. #    define FARDATA FAR
  1101.       */
  1102. #  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
  1103. #endif   /* __BORLANDC__ */
  1104.  
  1105.  
  1106. /* Suggest testing for specific compiler first before testing for
  1107.  * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
  1108.  * making reliance oncertain keywords suspect. (SJT)
  1109.  */
  1110.  
  1111. /* MSC Medium model */
  1112. #if defined(FAR)
  1113. #  if defined(M_I86MM)
  1114. #    define USE_FAR_KEYWORD
  1115. #    define FARDATA FAR
  1116. #    include <dos.h>
  1117. #  endif
  1118. #endif
  1119.  
  1120. /* SJT: default case */
  1121. #ifndef FAR
  1122. #  define FAR
  1123. #endif
  1124.  
  1125. /* At this point FAR is always defined */
  1126. #ifndef FARDATA
  1127. #  define FARDATA
  1128. #endif
  1129.  
  1130. /* Typedef for floating-point numbers that are converted
  1131.    to fixed-point with a multiple of 100,000, e.g., int_gamma */
  1132. typedef png_int_32 png_fixed_point;
  1133.  
  1134. /* Add typedefs for pointers */
  1135. typedef void            FAR * png_voidp;
  1136. typedef png_byte        FAR * png_bytep;
  1137. typedef png_uint_32     FAR * png_uint_32p;
  1138. typedef png_int_32      FAR * png_int_32p;
  1139. typedef png_uint_16     FAR * png_uint_16p;
  1140. typedef png_int_16      FAR * png_int_16p;
  1141. typedef PNG_CONST char  FAR * png_const_charp;
  1142. typedef char            FAR * png_charp;
  1143. typedef png_fixed_point FAR * png_fixed_point_p;
  1144.  
  1145. #ifndef PNG_NO_STDIO
  1146. #if defined(_WIN32_WCE)
  1147. typedef HANDLE                png_FILE_p;
  1148. #else
  1149. typedef FILE                * png_FILE_p;
  1150. #endif
  1151. #endif
  1152.  
  1153. #ifdef PNG_FLOATING_POINT_SUPPORTED
  1154. typedef double          FAR * png_doublep;
  1155. #endif
  1156.  
  1157. /* Pointers to pointers; i.e. arrays */
  1158. typedef png_byte        FAR * FAR * png_bytepp;
  1159. typedef png_uint_32     FAR * FAR * png_uint_32pp;
  1160. typedef png_int_32      FAR * FAR * png_int_32pp;
  1161. typedef png_uint_16     FAR * FAR * png_uint_16pp;
  1162. typedef png_int_16      FAR * FAR * png_int_16pp;
  1163. typedef PNG_CONST char  FAR * FAR * png_const_charpp;
  1164. typedef char            FAR * FAR * png_charpp;
  1165. typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
  1166. #ifdef PNG_FLOATING_POINT_SUPPORTED
  1167. typedef double          FAR * FAR * png_doublepp;
  1168. #endif
  1169.  
  1170. /* Pointers to pointers to pointers; i.e., pointer to array */
  1171. typedef char            FAR * FAR * FAR * png_charppp;
  1172.  
  1173. #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
  1174. /* SPC -  Is this stuff deprecated? */
  1175. /* It'll be removed as of libpng-1.3.0 - GR-P */
  1176. /* libpng typedefs for types in zlib. If zlib changes
  1177.  * or another compression library is used, then change these.
  1178.  * Eliminates need to change all the source files.
  1179.  */
  1180. typedef charf *         png_zcharp;
  1181. typedef charf * FAR *   png_zcharpp;
  1182. typedef z_stream FAR *  png_zstreamp;
  1183. #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
  1184.  
  1185. /*
  1186.  * Define PNG_BUILD_DLL if the module being built is a Windows
  1187.  * LIBPNG DLL.
  1188.  *
  1189.  * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
  1190.  * It is equivalent to Microsoft predefined macro _DLL that is
  1191.  * automatically defined when you compile using the share
  1192.  * version of the CRT (C Run-Time library)
  1193.  *
  1194.  * The cygwin mods make this behavior a little different:
  1195.  * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
  1196.  * Define PNG_STATIC if you are building a static library for use with cygwin,
  1197.  *   -or- if you are building an application that you want to link to the
  1198.  *   static library.
  1199.  * PNG_USE_DLL is defined by default (no user action needed) unless one of
  1200.  *   the other flags is defined.
  1201.  */
  1202.  
  1203. #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
  1204. #  define PNG_DLL
  1205. #endif
  1206. /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
  1207.  * When building a static lib, default to no GLOBAL ARRAYS, but allow
  1208.  * command-line override
  1209.  */
  1210. #if defined(__CYGWIN__)
  1211. #  if !defined(PNG_STATIC)
  1212. #    if defined(PNG_USE_GLOBAL_ARRAYS)
  1213. #      undef PNG_USE_GLOBAL_ARRAYS
  1214. #    endif
  1215. #    if !defined(PNG_USE_LOCAL_ARRAYS)
  1216. #      define PNG_USE_LOCAL_ARRAYS
  1217. #    endif
  1218. #  else
  1219. #    if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
  1220. #      if defined(PNG_USE_GLOBAL_ARRAYS)
  1221. #        undef PNG_USE_GLOBAL_ARRAYS
  1222. #      endif
  1223. #    endif
  1224. #  endif
  1225. #  if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
  1226. #    define PNG_USE_LOCAL_ARRAYS
  1227. #  endif
  1228. #endif
  1229.  
  1230. /* Do not use global arrays (helps with building DLL's)
  1231.  * They are no longer used in libpng itself, since version 1.0.5c,
  1232.  * but might be required for some pre-1.0.5c applications.
  1233.  */
  1234. #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
  1235. #  if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL))
  1236. #    define PNG_USE_LOCAL_ARRAYS
  1237. #  else
  1238. #    define PNG_USE_GLOBAL_ARRAYS
  1239. #  endif
  1240. #endif
  1241.  
  1242. #if defined(__CYGWIN__)
  1243. #  undef PNGAPI
  1244. #  define PNGAPI __cdecl
  1245. #  undef PNG_IMPEXP
  1246. #  define PNG_IMPEXP
  1247. #endif  
  1248.  
  1249. /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
  1250.  * you may get warnings regarding the linkage of png_zalloc and png_zfree.
  1251.  * Don't ignore those warnings; you must also reset the default calling
  1252.  * convention in your compiler to match your PNGAPI, and you must build
  1253.  * zlib and your applications the same way you build libpng.
  1254.  */
  1255.  
  1256. #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
  1257. #  ifndef PNG_NO_MODULEDEF
  1258. #    define PNG_NO_MODULEDEF
  1259. #  endif
  1260. #endif
  1261.  
  1262. #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
  1263. #  define PNG_IMPEXP
  1264. #endif
  1265.  
  1266. #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
  1267.     (( defined(_Windows) || defined(_WINDOWS) || \
  1268.        defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
  1269.  
  1270. #  ifndef PNGAPI
  1271. #     if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
  1272. #        define PNGAPI __cdecl
  1273. #     else
  1274. #        define PNGAPI _cdecl
  1275. #     endif
  1276. #  endif
  1277.  
  1278. #  if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
  1279.        0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
  1280. #     define PNG_IMPEXP
  1281. #  endif
  1282.  
  1283. #  if !defined(PNG_IMPEXP)
  1284.  
  1285. #     define PNG_EXPORT_TYPE1(type,symbol)  PNG_IMPEXP type PNGAPI symbol
  1286. #     define PNG_EXPORT_TYPE2(type,symbol)  type PNG_IMPEXP PNGAPI symbol
  1287.  
  1288.       /* Borland/Microsoft */
  1289. #     if defined(_MSC_VER) || defined(__BORLANDC__)
  1290. #        if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
  1291. #           define PNG_EXPORT PNG_EXPORT_TYPE1
  1292. #        else
  1293. #           define PNG_EXPORT PNG_EXPORT_TYPE2
  1294. #           if defined(PNG_BUILD_DLL)
  1295. #              define PNG_IMPEXP __export
  1296. #           else
  1297. #              define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
  1298.                                                  VC++ */
  1299. #           endif                             /* Exists in Borland C++ for
  1300.                                                  C++ classes (== huge) */
  1301. #        endif
  1302. #     endif
  1303.  
  1304. #     if !defined(PNG_IMPEXP)
  1305. #        if defined(PNG_BUILD_DLL)
  1306. #           define PNG_IMPEXP __declspec(dllexport)
  1307. #        else
  1308. #           define PNG_IMPEXP __declspec(dllimport)
  1309. #        endif
  1310. #     endif
  1311. #  endif  /* PNG_IMPEXP */
  1312. #else /* !(DLL || non-cygwin WINDOWS) */
  1313. #   if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
  1314. #      ifndef PNGAPI
  1315. #         define PNGAPI _System
  1316. #      endif
  1317. #   else
  1318. #      if 0 /* ... other platforms, with other meanings */
  1319. #      endif
  1320. #   endif
  1321. #endif
  1322.  
  1323. #ifndef PNGAPI
  1324. #  define PNGAPI
  1325. #endif
  1326. #ifndef PNG_IMPEXP
  1327. #  define PNG_IMPEXP
  1328. #endif
  1329.  
  1330. #ifdef PNG_BUILDSYMS
  1331. #  ifndef PNG_EXPORT
  1332. #    define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
  1333. #  endif
  1334. #  ifdef PNG_USE_GLOBAL_ARRAYS
  1335. #    ifndef PNG_EXPORT_VAR
  1336. #      define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
  1337. #    endif
  1338. #  endif
  1339. #endif
  1340.  
  1341. #ifndef PNG_EXPORT
  1342. #  define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
  1343. #endif
  1344.  
  1345. #ifdef PNG_USE_GLOBAL_ARRAYS
  1346. #  ifndef PNG_EXPORT_VAR
  1347. #    define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
  1348. #  endif
  1349. #endif
  1350.  
  1351. /* User may want to use these so they are not in PNG_INTERNAL. Any library
  1352.  * functions that are passed far data must be model independent.
  1353.  */
  1354.  
  1355. #ifndef PNG_ABORT
  1356. #  define PNG_ABORT() abort()
  1357. #endif
  1358.  
  1359. #ifdef PNG_SETJMP_SUPPORTED
  1360. #  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
  1361. #else
  1362. #  define png_jmpbuf(png_ptr) \
  1363.    (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
  1364. #endif
  1365.  
  1366. #if defined(USE_FAR_KEYWORD)  /* memory model independent fns */
  1367. /* use this to make far-to-near assignments */
  1368. #  define CHECK   1
  1369. #  define NOCHECK 0
  1370. #  define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
  1371. #  define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
  1372. #  define png_strcpy  _fstrcpy
  1373. #  define png_strncpy _fstrncpy   /* Added to v 1.2.6 */
  1374. #  define png_strlen  _fstrlen
  1375. #  define png_memcmp  _fmemcmp    /* SJT: added */
  1376. #  define png_memcpy  _fmemcpy
  1377. #  define png_memset  _fmemset
  1378. #else /* use the usual functions */
  1379. #  define CVT_PTR(ptr)         (ptr)
  1380. #  define CVT_PTR_NOCHECK(ptr) (ptr)
  1381. #  define png_strcpy  strcpy
  1382. #  define png_strncpy strncpy     /* Added to v 1.2.6 */
  1383. #  define png_strlen  strlen
  1384. #  define png_memcmp  memcmp      /* SJT: added */
  1385. #  define png_memcpy  memcpy
  1386. #  define png_memset  memset
  1387. #endif
  1388. /* End of memory model independent support */
  1389.  
  1390. /* Just a little check that someone hasn't tried to define something
  1391.  * contradictory.
  1392.  */
  1393. #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
  1394. #  undef PNG_ZBUF_SIZE
  1395. #  define PNG_ZBUF_SIZE 65536L
  1396. #endif
  1397.  
  1398. #ifdef PNG_READ_SUPPORTED
  1399. /* Prior to libpng-1.0.9, this block was in pngasmrd.h */
  1400. #if defined(PNG_INTERNAL)
  1401.  
  1402. /* These are the default thresholds before the MMX code kicks in; if either
  1403.  * rowbytes or bitdepth is below the threshold, plain C code is used.  These
  1404.  * can be overridden at runtime via the png_set_mmx_thresholds() call in
  1405.  * libpng 1.2.0 and later.  The values below were chosen by Intel.
  1406.  */
  1407.  
  1408. #ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
  1409. #  define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT  128  /*  >=  */
  1410. #endif
  1411. #ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
  1412. #  define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT  9    /*  >=  */   
  1413. #endif
  1414.  
  1415. /* Set this in the makefile for VC++ on Pentium, not here. */
  1416. /* Platform must be Pentium.  Makefile must assemble and load pngvcrd.c .
  1417.  * MMX will be detected at run time and used if present.
  1418.  */
  1419. #ifdef PNG_USE_PNGVCRD
  1420. #  define PNG_HAVE_ASSEMBLER_COMBINE_ROW
  1421. #  define PNG_HAVE_ASSEMBLER_READ_INTERLACE
  1422. #  define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
  1423. #endif
  1424.  
  1425. /* Set this in the makefile for gcc/as on Pentium, not here. */
  1426. /* Platform must be Pentium.  Makefile must assemble and load pnggccrd.c .
  1427.  * MMX will be detected at run time and used if present.
  1428.  */
  1429. #ifdef PNG_USE_PNGGCCRD
  1430. #  define PNG_HAVE_ASSEMBLER_COMBINE_ROW
  1431. #  define PNG_HAVE_ASSEMBLER_READ_INTERLACE
  1432. #  define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
  1433. #endif
  1434. /* - see pnggccrd.c for info about what is currently enabled */
  1435.  
  1436. #endif /* PNG_INTERNAL */
  1437. #endif /* PNG_READ_SUPPORTED */
  1438.  
  1439. /* Added at libpng-1.2.8 */
  1440. #endif /* PNG_VERSION_INFO_ONLY */
  1441.  
  1442. #endif /* PNGCONF_H */
  1443.