pngconf.h 44 KB

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