The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1506 lines
46KB

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