pngconf.h 44 KB

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