home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / flash078.zip / flashsource-r0_7_8.zip / libpng / pngconf.h < prev    next >
C/C++ Source or Header  |  2001-04-27  |  40KB  |  1,307 lines

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