pngconf.h 44 KB

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