pnglibconf.dfa 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. # scripts/pnglibconf.dfa - library build configuration control
  2. #
  3. @/*- pnglibconf.dfn intermediate file
  4. @ * generated from scripts/pnglibconf.dfa
  5. @ */
  6. #
  7. com pnglibconf.h - library build configuration
  8. com
  9. version
  10. com
  11. com Copyright (c) 1998-2014 Glenn Randers-Pehrson
  12. com
  13. com This code is released under the libpng license.
  14. com For conditions of distribution and use, see the disclaimer
  15. com and license in png.h
  16. com
  17. file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H
  18. # This file is preprocessed by scripts/options.awk and the
  19. # C compiler to generate 'pnglibconf.h' - a list of all the
  20. # configuration options. The file lists the various options
  21. # that can *only* be specified during the libpng build;
  22. # pnglibconf.h freezes the definitions selected for the specific
  23. # build.
  24. #
  25. # The syntax is detailed in scripts/options.awk; this is a summary
  26. # only:
  27. #
  28. # setting <name> [requires ...] [default]
  29. # #define PNG_<name> <value> /* value comes from current setting */
  30. # option <name> [requires ...] [if ...] [enables ...] [disabled]
  31. # #define PNG_<name>_SUPPORTED if the requirements are met and
  32. # enable the other options listed
  33. # chunk <name> [requires ...] [enables ...] [disabled]
  34. # Enable chunk processing for the given ancillary chunk; any
  35. # 'requires something' expands to READ_something for read and
  36. # WRITE_something for write, but the enables list members are
  37. # used as given (e.g. enables GAMMA just expands to that on the
  38. # correspond READ_name and WRITE_name lines.)
  39. #
  40. # "," may be used to separate options on an 'option' line and is ignored; it
  41. # doesn't change the meaning of the line. (NOT setting, where "," becomes
  42. # part of the setting!) A comma at the end of an option line causes a
  43. # continuation (the next line is included in the option too.)
  44. #
  45. # Note that the 'on' and 'off' keywords, while valid on both option
  46. # and chunk, should not be used in this file because they force the
  47. # relevant options on or off.
  48. #----------------------------------------------------------------------
  49. # The following setting, option and chunk values can all be changed
  50. # while building libpng:
  51. #
  52. # setting: change 'setting' lines to fine tune library performance;
  53. # changes to the settings don't affect the libpng API functionally
  54. #
  55. # option: change 'option' lines to remove or add capabilities from
  56. # or to the library; options change the library API
  57. #
  58. # chunk: change 'chunk' lines to remove capabilities to process
  59. # optional ('ancillary') chunks. This does not prevent PNG
  60. # decoding but does change the libpng API because some chunks
  61. # will be ignored.
  62. #
  63. # There are three ways of disabling features, in no particular order:
  64. #
  65. # 1) Create 'pngusr.h', enter the required private build information
  66. # detailed below and #define PNG_NO_<option> for each option you
  67. # don't want in that file in that file. You can also turn on options
  68. # using PNG_<option>_SUPPORTED. When you have finished rerun
  69. # configure and rebuild pnglibconf.h file with -DPNG_USER_CONFIG:
  70. #
  71. # make clean
  72. # CPPFLAGS='-DPNG_USER_CONFIG' ./configure
  73. # make pnglibconf.h
  74. #
  75. # pngusr.h is only used during the creation of pnglibconf.h, but it
  76. # is safer to ensure that -DPNG_USER_CONFIG is specified throughout
  77. # the build by changing the CPPFLAGS passed to the initial ./configure
  78. #
  79. # 2) Add definitions of the settings you want to change to
  80. # CPPFLAGS; for example:
  81. #
  82. # -DPNG_DEFAULT_READ_MACROS=0
  83. #
  84. # (This would change the default to *not* use read macros.) Be
  85. # very careful to change only settings that don't alter the API
  86. # because this approach bypasses the private build checking. You
  87. # can also change settings from pngpriv.h (read pngpriv.h) safely
  88. # without API changes. Do that in the same way.
  89. #
  90. # 3) Write a new '.dfa' file (say 'pngusr.dfa') and in this file
  91. # provide override values for setting entries and turn option or
  92. # chunk values explicitly 'on' or 'off':
  93. #
  94. # setting FOO default VALUE
  95. # option BAR [on|off]
  96. #
  97. # Then add this file to the options.awk command line (the *first*
  98. # one) after this file. The make macro DFA_XTRA is provided to make
  99. # this easier (set it like CPPFLAGS prior to running ./configure).
  100. # Look at the builds below contrib/pngminim for some extreme examples
  101. # of how this can be used.
  102. #
  103. # Don't edit this file unless you are contributing a patch to
  104. # libpng and need new or modified options/settings.
  105. #----------------------------------------------------------------------
  106. # The following causes commented out #undef lines to be written to
  107. # pnglibconf.h; this can be stopped by logunsupported=0 in a later
  108. # file or on the command line (after pnglibconf.dfa)
  109. logunsupported = 1
  110. # The following allows the output from configure to modify the contents of
  111. # pnglibconf.h
  112. @#ifdef HAVE_CONFIG_H
  113. @# include "config.h"
  114. @#endif
  115. # PNG_USER_CONFIG has to be defined on the compiler command line
  116. # to cause pngusr.h to be read while constructing pnglibconf.h
  117. #
  118. # If you create a private DLL you need to define the following
  119. # macros in the file 'pngusr.h' and set -DPNG_USER_CONFIG for
  120. # compilation (i.e. in CPPFLAGS.)
  121. # #define PNG_USER_PRIVATEBUILD \
  122. # <Describes by whom and why this version of the DLL was built>
  123. # e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
  124. # #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
  125. # distinguish your DLL from those of the official release. These
  126. # correspond to the trailing letters that come after the version
  127. # number and must match your private DLL name>
  128. # e.g. // private DLL "libpng13gx.dll"
  129. # #define PNG_USER_DLLFNAME_POSTFIX "gx"
  130. #
  131. # The following macros are also at your disposal if you want to complete the
  132. # DLL VERSIONINFO structure.
  133. # - PNG_USER_VERSIONINFO_COMMENTS
  134. # - PNG_USER_VERSIONINFO_COMPANYNAME
  135. # - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
  136. # It is necessary to include configures definitions here so that AC_DEFINE
  137. # in configure.ac works in a comprehensible way
  138. @#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
  139. @# include "config.h"
  140. @#endif
  141. @#ifdef PNG_USER_CONFIG
  142. @# include "pngusr.h"
  143. @#endif
  144. # This is a special fixup for the Watcom C compiler on Windows, which has
  145. # multiple procedure call standards. Unless PNG_API_RULE is set explicitly
  146. # (i.e. if it is not defined at this point) it will be forced to '2' here when
  147. # using Watcom. This indicates to the other header files that Watcom behaviour
  148. # is required where appropriate.
  149. @#ifdef __WATCOMC__
  150. @# ifndef PNG_API_RULE
  151. @# define PNG_API_RULE 2 /* Use Watcom calling conventions */
  152. @# endif
  153. @#endif
  154. # IN DEVELOPMENT
  155. # These are currently experimental features; define them if you want (NOTE:
  156. # experimental options must be disabled before they are defined in this file!)
  157. # NONE
  158. # Note that PNG_USER_CONFIG only has an effect when building
  159. # pnglibconf.h
  160. setting USER_CONFIG
  161. setting USER_PRIVATEBUILD
  162. setting USER_DLLFNAME_POSTFIX
  163. setting USER_VERSIONINFO_COMMENTS
  164. setting USER_VERSIONINFO_COMPANYNAME
  165. setting USER_VERSIONINFO_LEGALTRADEMARKS
  166. # Record the 'API rule' used to select calling conventions on
  167. # those systems that support such things (see all the comments in
  168. # pngconf.h)
  169. # Changing this setting has a fundamental affect on the PNG ABI,
  170. # do not release shared libraries with this changed.
  171. setting API_RULE default 0
  172. # This allows a prefix to be added to the front of every API functon name (and
  173. # therefore every symbol) by redefining all the function names with the prefix
  174. # at the end of pnglibconf.h. It also turns on similar internal symbol renaming
  175. # by causing a similar build-time only file, pngprefix.h, to be generated.
  176. setting PREFIX
  177. # Implementation specific control of the optimizations, enabled by those
  178. # hardware or software options that need it (typically when run-time choices
  179. # must be made by the user)
  180. option SET_OPTION disabled
  181. # These options are specific to the ARM NEON hardware optimizations. At present
  182. # these optimizations depend on GCC specific pre-processing of an assembler (.S)
  183. # file so they probably won't work with other compilers.
  184. #
  185. # ARM_NEON_OPT: unset: check at compile time (__ARM_NEON__ must be defined by
  186. # the compiler, typically as a result of specifying
  187. # CC="gcc -mfpu=neon".)
  188. # 0: disable (even if the CPU has a NEON FPU.)
  189. # 1: check at run time (via ARM_NEON_{API,CHECK})
  190. # 2: switch on unconditionally (inadvisable - instead pass
  191. # -mfpu=neon to GCC in CC)
  192. # When building libpng avoid using any setting other than '0'; '1' is
  193. # set automatically when either 'API' or 'CHECK' are configured in,
  194. # '2' should not be necessary as -mfpu=neon will achieve the same
  195. # effect as well as applying NEON optimizations to the rest of the
  196. # libpng code.
  197. # NOTE: any setting other than '0' requires ALIGNED_MEMORY
  198. # ARM_NEON_API: (PNG_ARM_NEON == 1) allow the optimization to be switched on
  199. # with png_set_option
  200. # ARM_NEON_CHECK: (PNG_ARM_NEON == 1) compile a run-time check to see if Neon
  201. # extensions are supported. This is poorly supported and
  202. # deprecated - use the png_set_option API.
  203. setting ARM_NEON_OPT
  204. option ARM_NEON_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
  205. sets ARM_NEON_OPT 1
  206. option ARM_NEON_CHECK disabled requires ALIGNED_MEMORY,
  207. sets ARM_NEON_OPT 1
  208. # These settings configure the default compression level (0-9) and 'strategy';
  209. # strategy is as defined by the implementors of zlib. It describes the input
  210. # data and modifies the zlib parameters in an attempt to optimize the balance
  211. # between search and huffman encoding in the zlib algorithms. The defaults are
  212. # the zlib.h defaults - the apparently recursive definition does not arise
  213. # because the name of the setting is prefixed by PNG_
  214. #
  215. # The TEXT values are the defaults when writing compressed text (all forms)
  216. # Include the zlib header so that the defaults below are known
  217. @# include <zlib.h>
  218. # The '@' here means to substitute the value when pnglibconf.h is built
  219. setting Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
  220. # TODO: why aren't these Z_RLE; zlib.h says that Z_RLE, specifically, is
  221. # appropriate for PNG images, maybe it doesn't exist in all versions?
  222. setting Z_DEFAULT_STRATEGY default @Z_FILTERED
  223. setting Z_DEFAULT_NOFILTER_STRATEGY default @Z_DEFAULT_STRATEGY
  224. setting ZLIB_VERNUM default @ZLIB_VERNUM
  225. # Linkage of:
  226. #
  227. # API: libpng API functions
  228. # CALLBACK: internal non-file-local callbacks
  229. # FUNCTION: internal non-file-local functions
  230. # DATA: internal non-file-local (const) data
  231. setting LINKAGE_API default extern
  232. setting LINKAGE_CALLBACK default extern
  233. setting LINKAGE_FUNCTION default extern
  234. setting LINKAGE_DATA default extern
  235. setting TEXT_Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
  236. setting TEXT_Z_DEFAULT_STRATEGY default @Z_DEFAULT_STRATEGY
  237. # Default to using the read macros
  238. setting DEFAULT_READ_MACROS default 1
  239. # The alternative is to call functions to read PNG values, if
  240. # the functions are turned *off* the read macros must always
  241. # be enabled, so turning this off will actually force the
  242. # USE_READ_MACROS option on (see pngconf.h)
  243. option READ_INT_FUNCTIONS requires READ
  244. # The same for write, but these can only be switched off if
  245. # no writing is required at all - hence the use of an 'enables'
  246. # not a 'requires' below:
  247. option WRITE_INT_FUNCTIONS disabled
  248. option WRITE enables WRITE_INT_FUNCTIONS
  249. # Error controls
  250. #
  251. # WARNINGS: normally on, if off no warnings are generated
  252. # ERROR_TEXT: normally on, if off errors happen but there is no message
  253. # ERROR_NUMBERS: unimplemented feature, therefore disabled
  254. # BENIGN_ERRORS: support for just issuing warnings for recoverable errors
  255. #
  256. # BENIGN_READ_ERRORS:
  257. # By default recoverable errors on read should just generate warnings,
  258. # generally safe but PNG files that don't conform to the specification will
  259. # be accepted if a meaningful result can be produced.
  260. #
  261. # BENIGN_WRITE_ERRORS:
  262. # By default recoverable errors on write should just generate warnings,
  263. # not generally safe because this allows the application to write invalid
  264. # PNG files. Applications should enable this themselves; it's useful
  265. # because it means that a failure to write an ancilliary chunk can often be
  266. # ignored.
  267. option WARNINGS
  268. option ERROR_TEXT
  269. option ERROR_NUMBERS disabled
  270. option BENIGN_ERRORS
  271. option BENIGN_WRITE_ERRORS requires BENIGN_ERRORS disabled
  272. option BENIGN_READ_ERRORS requires BENIGN_ERRORS
  273. # Generic options - affect both read and write.
  274. option MNG_FEATURES
  275. # Arithmetic options, the first is the big switch that chooses between internal
  276. # floating and fixed point arithmetic implementations - it does not affect any
  277. # APIs. The second two (the _POINT settings) switch off individual APIs.
  278. #
  279. # Prior to libpng 1.6.8 one of the API (_POINT) variants had to be selected. At
  280. # 1.6.8 this restriction has been removed; the simplified API can be used
  281. # without enabling any of the low level fixed/floating APIs.
  282. option FLOATING_ARITHMETIC
  283. option FLOATING_POINT
  284. option FIXED_POINT
  285. # This protects us against compilers that run on a windowing system
  286. # and thus don't have or would rather us not use the stdio types:
  287. # stdin, stdout, and stderr. The only one currently used is stderr
  288. # in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
  289. # prevent these from being compiled and used. #defining PNG_NO_STDIO
  290. # will also prevent these, plus will prevent the entire set of stdio
  291. # macros and functions (FILE *, printf, etc.) from being compiled and used,
  292. # unless (PNG_DEBUG > 0) has been #defined.
  293. option STDIO
  294. option CONSOLE_IO requires STDIO
  295. # Note: prior to 1.5.0 this option could not be disabled if STDIO
  296. # was enabled. Prior to 1.5.3 this option required STDIO
  297. option TIME_RFC1123
  298. # PNG_SETJMP_NOT_SUPPORTED is an old equivalent for NO_SETJMP
  299. option SETJMP
  300. = NO_SETJMP SETJMP_NOT_SUPPORTED
  301. # If this is disabled it is not possible for apps to get the
  302. # values from the 'info' structure, this effectively removes
  303. # quite a lot of the READ API.
  304. option EASY_ACCESS
  305. # Added at libpng-1.2.0
  306. option USER_MEM
  307. # Added at libpng-1.4.0
  308. option IO_STATE
  309. # Libpng limits: limit the size of images and data on read.
  310. #
  311. # If this option is disabled all the limit checking code will be disabled:
  312. option USER_LIMITS requires READ
  313. # The default settings given below for the limits mean that libpng will
  314. # limit the size of images or the size of data in ancilliary chunks to less
  315. # than the specification or implementation limits. Settings have the
  316. # following interpretations:
  317. #
  318. # USER_WIDTH_MAX: maximum width of an image that will be read
  319. # USER_HEIGHT_MAX: maximum height
  320. # USER_CHUNK_MALLOC_MAX: maximum in-memory (decompressed) size of a single chunk
  321. # USER_CHUNK_CACHE_MAX: maximum number of chunks to be cached
  322. #
  323. # Only chunks that are variable in number are counted towards the
  324. # Use 0x7fffffff for unlimited
  325. setting USER_WIDTH_MAX default 1000000
  326. setting USER_HEIGHT_MAX default 1000000
  327. # Use 0 for unlimited
  328. setting USER_CHUNK_CACHE_MAX default 1000
  329. setting USER_CHUNK_MALLOC_MAX default 8000000
  330. # If this option is enabled APIs to set the above limits at run time are added;
  331. # without this the hardwired (compile time) limits will be used.
  332. option SET_USER_LIMITS requires USER_LIMITS
  333. # All of the following options relate to code capabilities for
  334. # processing image data before creating a PNG or after reading one.
  335. # You can remove these capabilities safely and still be PNG
  336. # conformant, however the library that results is still non-standard.
  337. # See the comments above about how to change options and settings.
  338. # READ options
  339. #
  340. # WARNING: in libpng 1.5 maintained configuration compatibility with earlier
  341. # versions. In some cases turning off an option turned off other options, in
  342. # others it was ineffective unless dependent options were also turned off.
  343. # Libpng 1.6 changes this: in general if you turn off an option that affects
  344. # APIs it stays off and simply disables APIs that depend on it.
  345. #
  346. # As a result if you simply port the libpng 1.5 configuration to libpng 1.6 you
  347. # will probably see build failures due to missing APIs. Fixing these failures
  348. # requires some, perhaps considerable, knowledge of what your libpng using
  349. # applications are doing, fortunately there is no great reason for you to move
  350. # to libpng 1.6; the new interfaces in 1.6 will take several years to become
  351. # popular.
  352. option READ enables READ_INTERLACING SET_OPTION
  353. # Disabling READ_16BIT does not disable reading 16-bit PNG files, but it
  354. # forces them to be chopped down to 8-bit, and disables any 16-bit
  355. # processing after that has happened. You need to be sure to enable
  356. # READ_SCALE_16_TO_8 or READ_STRIP_16_TO_8 when you disable READ_16BIT for
  357. # this to work properly. You should disable the other option if you need to
  358. # ensure a particular conversion (otherwise the app can chose.)
  359. option READ_16BIT requires READ enables 16BIT
  360. option READ_QUANTIZE requires READ
  361. option READ_TRANSFORMS requires READ
  362. = NO_READ_TRANSFORMS READ_TRANSFORMS_NOT_SUPPORTED
  363. # Read gamma handling. Gamma processing is a core part of libpng and many of
  364. # the capabilities are dependent on libpng performing gamma correction.
  365. #
  366. # In libpng 1.6 disabling gamma processing (setting PNG_NO_READ_GAMMA)
  367. # consistently disables those parts of the API that depend on it. Prior to
  368. # 1.6.0 this was not true; the results were unpredictable and varied between
  369. # releases.
  370. #
  371. # If you disable gamma processing and your program no longer compiles you need
  372. # to ask whether you really need the APIs that are missing. If you do then you
  373. # almost certainly need the gamma processing.
  374. #
  375. # If you handle gamma issues outside libpng then you do not need the libpng
  376. # gamma processing; and it is an enormous waste of space. You just need to
  377. # remove the use of libpng APIs that depend on it.
  378. option READ_GAMMA requires READ_TRANSFORMS, READ_gAMA, READ_sRGB
  379. option READ_ALPHA_MODE requires READ_TRANSFORMS, READ_GAMMA
  380. option READ_BACKGROUND requires READ_TRANSFORMS, READ_STRIP_ALPHA, READ_GAMMA
  381. option READ_BGR requires READ_TRANSFORMS
  382. option READ_EXPAND_16 requires READ_TRANSFORMS, READ_16BIT, READ_EXPAND
  383. option READ_EXPAND requires READ_TRANSFORMS
  384. option READ_FILLER requires READ_TRANSFORMS
  385. option READ_GRAY_TO_RGB requires READ_TRANSFORMS
  386. option READ_INVERT_ALPHA requires READ_TRANSFORMS
  387. option READ_INVERT requires READ_TRANSFORMS
  388. option READ_PACK requires READ_TRANSFORMS
  389. option READ_PACKSWAP requires READ_TRANSFORMS
  390. option READ_RGB_TO_GRAY requires READ_TRANSFORMS, READ_GAMMA enables COLORSPACE
  391. option READ_SCALE_16_TO_8 requires READ_TRANSFORMS
  392. option READ_SHIFT requires READ_TRANSFORMS
  393. option READ_STRIP_16_TO_8 requires READ_TRANSFORMS
  394. option READ_STRIP_ALPHA requires READ_TRANSFORMS
  395. option READ_SWAP_ALPHA requires READ_TRANSFORMS
  396. option READ_SWAP requires READ_TRANSFORMS, READ_16BIT
  397. option READ_USER_TRANSFORM requires READ_TRANSFORMS
  398. option PROGRESSIVE_READ requires READ
  399. option SEQUENTIAL_READ requires READ
  400. # You can define PNG_NO_PROGRESSIVE_READ if you don't do progressive reading.
  401. # This is not talking about interlacing capability! You'll still have
  402. # interlacing unless you turn off the following which is required
  403. # for PNG-compliant decoders. (In other words, do not do this - in
  404. # fact it can't be disabled from the command line!)
  405. #option READ_INTERLACING requires READ
  406. option READ_COMPOSITE_NODIV requires READ
  407. = NO_READ_COMPOSITE_NODIV NO_READ_COMPOSITED_NODIV
  408. # Inch conversions
  409. option INCH_CONVERSIONS
  410. = INCH_CONVERSIONS INCH_CONVERSIONS
  411. # API to build a grayscale palette
  412. # NOTE: this is not used internally by libpng at present.
  413. option BUILD_GRAYSCALE_PALETTE
  414. # WRITE options
  415. option WRITE
  416. # Disabling WRITE_16BIT prevents 16-bit PNG files from being
  417. # generated.
  418. option WRITE_16BIT requires WRITE enables 16BIT
  419. option WRITE_TRANSFORMS requires WRITE
  420. = NO_WRITE_TRANSFORMS WRITE_TRANSFORMS_NOT_SUPPORTED
  421. option WRITE_SHIFT requires WRITE_TRANSFORMS
  422. option WRITE_PACK requires WRITE_TRANSFORMS
  423. option WRITE_BGR requires WRITE_TRANSFORMS
  424. option WRITE_SWAP requires WRITE_TRANSFORMS, WRITE_16BIT
  425. option WRITE_PACKSWAP requires WRITE_TRANSFORMS
  426. option WRITE_INVERT requires WRITE_TRANSFORMS
  427. option WRITE_FILLER requires WRITE_TRANSFORMS
  428. option WRITE_SWAP_ALPHA requires WRITE_TRANSFORMS
  429. option WRITE_INVERT_ALPHA requires WRITE_TRANSFORMS
  430. option WRITE_USER_TRANSFORM requires WRITE_TRANSFORMS
  431. # This is not required for PNG-compliant encoders, but can cause
  432. # trouble if left undefined
  433. option WRITE_INTERLACING requires WRITE
  434. # Deprecated, will be removed.
  435. option WRITE_WEIGHTED_FILTER requires WRITE
  436. option WRITE_FLUSH requires WRITE
  437. # Note: these can be turned off explicitly if not required by the
  438. # apps implementing the user transforms
  439. option USER_TRANSFORM_PTR if READ_USER_TRANSFORM, WRITE_USER_TRANSFORM
  440. option USER_TRANSFORM_INFO if READ_USER_TRANSFORM, WRITE_USER_TRANSFORM
  441. # This enables API to set compression parameters for compressing
  442. # non-IDAT chunks (zTXt, iTXt, iCCP, and unknown chunks). This feature
  443. # was added at libpng-1.5.3.
  444. option WRITE_CUSTOMIZE_ZTXT_COMPRESSION requires WRITE
  445. option WRITE_CUSTOMIZE_COMPRESSION requires WRITE
  446. # Any chunks you are not interested in, you can undef here. The
  447. # ones that allocate memory may be expecially important (hIST,
  448. # tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
  449. # a bit smaller.
  450. # The size of the png_text structure changed in libpng-1.0.6 when
  451. # iTXt support was added. iTXt support was turned off by default through
  452. # libpng-1.2.x, to support old apps that malloc the png_text structure
  453. # instead of calling png_set_text() and letting libpng malloc it. It
  454. # was turned on by default in libpng-1.4.0.
  455. option READ_ANCILLARY_CHUNKS requires READ
  456. # PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated.
  457. = NO_READ_ANCILLARY_CHUNKS READ_ANCILLARY_CHUNKS_NOT_SUPPORTED
  458. option WRITE_ANCILLARY_CHUNKS requires WRITE
  459. # PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated.
  460. = NO_WRITE_ANCILLARY_CHUNKS WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED
  461. # These options disable *all* the text chunks if turned off
  462. option READ_TEXT requires READ_ANCILLARY_CHUNKS enables TEXT
  463. option WRITE_TEXT requires WRITE_ANCILLARY_CHUNKS enables TEXT
  464. # Moved to pnglibconf.h at libpng-1.5.0
  465. # Feature support: in 1.4 this was in pngconf.h, but the following
  466. # features have no affect on the libpng API. Add library
  467. # only features to the end of this list. Add features that
  468. # affect the API above. (Note: the list of chunks follows
  469. # the library-only settings.)
  470. #
  471. # BUILD TIME ONLY OPTIONS
  472. # These options do not affect the API but rather alter how the
  473. # API is implemented, they get recorded in pnglibconf.h, but
  474. # can't be changed by the application.
  475. # Colorspace support (enabled as required); just the support for colorant
  476. # information. Gamma support, likewise, is just support for the gamma
  477. # information, READ_GAMMA is required for gamma transformations (so it
  478. # is possible to read PNG gamma without enabling all the libpng transform
  479. # code - do this for applications that do their own gamma processing)
  480. #
  481. # As of 1.6.0 COLORSPACE is only useful if the application processes the
  482. # information; this is because the library does not do any colorspace
  483. # processing, it just validates the data in the PNG file.
  484. option GAMMA disabled
  485. option COLORSPACE enables GAMMA disabled
  486. # When an ICC profile is read, or png_set, it will be checked for a match
  487. # against known sRGB profiles if the sRGB handling is enabled. The
  488. # PNG_sRGB_PROFILE_CHECKS setting controls how much work is done during the
  489. # check:
  490. #
  491. # -1: Don't do any sRGB profile checking.
  492. #
  493. # 0: Just validate the profile MD5 signature if present, otherwise use
  494. # the checks in option 1.
  495. #
  496. # 1: Additionally check the length, intent and adler32 checksum of the
  497. # actual data. If enabled this will reject known profiles that have
  498. # had the rendering intent in the header changed as well as other edits
  499. # done without updating the checksum. See the discussion below.
  500. #
  501. # 2: Additionally checksum all the data using the ethernet CRC32 algorithm.
  502. # This makes it more difficult to fake profiles and makes it less likely
  503. # to get a false positive on profiles with no signature, but is probably
  504. # just a waste of time since all currently approved ICC sRGB profiles have
  505. # a secure MD5 signature.
  506. #
  507. # The rendering intent. An ICC profile stores an intended rendering intent,
  508. # but does not include the value in the signature. The intent is documented
  509. # as the intent that should be used when combining two profiles. The sRGB
  510. # profile is intended, however, to be used with any of the four defined intents.
  511. # For this reason the sRGB chunk includes an 'intent' to be used when displaying
  512. # the image (intent is really a property of the image not the profile.)
  513. #
  514. # Unfortunately the iCCP chunk does not. It may therefore be that some
  515. # applications modify the intent in profiles (including sRGB profiles) to work
  516. # round this problem. Selecting an option other than option '0' will cause such
  517. # modified profiles to be rejected.
  518. #
  519. # Security. The use of Adler32 and CRC32 checksums does not help significantly
  520. # with any security issues. It is relatively easy to produce arbitrary profiles
  521. # with the required checksums on current computer systems. Nevertheless
  522. # security does not seem to be an issue because the only consequence of a false
  523. # positive is a false assertion that the profile is an sRGB profile. This might
  524. # be used to hide data from libpng using applications, but it doesn't seem
  525. # possible to damage them.
  526. setting sRGB_PROFILE_CHECKS default 2
  527. # Artificially align memory - the code typically aligns to 8 byte
  528. # boundaries if this is switched on, it's a small waste of space
  529. # but can help (in theory) on some architectures. Only affects
  530. # internal structures. Added at libpng 1.4.0
  531. option ALIGNED_MEMORY
  532. # Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING
  533. # See png[wr]util.c, normally this should always be *on*
  534. option POINTER_INDEXING
  535. # Other defines for things like memory and the like can go here.
  536. # BUILD TIME SETTINGS
  537. # Like build time options these do not affect the API, but they
  538. # may be useful to applications because they record details of
  539. # how the API will behave particularly with regard to overall
  540. # accuracy.
  541. # This controls how fine the quantizing gets. As this allocates
  542. # a largish chunk of memory (32K), those who are not as concerned
  543. # with quantizing quality can decrease some or all of these.
  544. setting QUANTIZE_RED_BITS default 5
  545. setting QUANTIZE_GREEN_BITS default 5
  546. setting QUANTIZE_BLUE_BITS default 5
  547. # This controls how fine the gamma correction becomes when you
  548. # are only interested in 8 bits anyway. Increasing this value
  549. # results in more memory being used, and more pow() functions
  550. # being called to fill in the gamma tables. Don't set this value
  551. # less than 8, and even that may not work (I haven't tested it).
  552. setting MAX_GAMMA_8 default 11
  553. # This controls how much a difference in gamma we can tolerate before
  554. # we actually start doing gamma conversion, it's a fixed point value,
  555. # so the default below is 0.05, meaning libpng ignores corrections in
  556. # the range 0.95 to 1.05
  557. setting GAMMA_THRESHOLD_FIXED default 5000
  558. # Precision to use when converting a floating point value to a PNG
  559. # extension format string in an sCAL chunk (only relevant if the
  560. # floating point API is enabled)
  561. setting sCAL_PRECISION default 5
  562. # This is the size of the compression buffer, and thus the size of
  563. # an IDAT chunk. Make this whatever size you feel is best for your
  564. # machine. One of these will be allocated per png_struct. When this
  565. # is full, it writes the data to the disk, and does some other
  566. # calculations. Making this an extremely small size may slow
  567. # the library down, but you may want to experiment to determine
  568. # where it becomes significant, if you are concerned with memory
  569. # usage. Note that zlib allocates at least 32Kb also. For readers,
  570. # this describes the size of the buffer available to read the data in.
  571. # Unless this gets smaller than the size of a row (compressed),
  572. # it should not make much difference how big this is.
  573. setting ZBUF_SIZE default 8192
  574. # This is the size of the decompression buffer used when counting or checking
  575. # the decompressed size of an LZ stream from a compressed ancilliary chunk; the
  576. # decompressed data is never used so a different size may be optimal. This size
  577. # was determined using contrib/libtests/timepng.c with compressed zTXt data
  578. # around 11MByte in size. Slight speed improvements (up to about 14% in
  579. # timepng) can be achieved by very large increases (to 32kbyte) on regular data,
  580. # but highly compressible data shows only around 2% improvement. The size is
  581. # chosen to minimize the effects of DoS attacks based on using very large
  582. # amounts of highly compressible data.
  583. setting INFLATE_BUF_SIZE default 1024
  584. # This is the maximum amount of IDAT data that the sequential reader will
  585. # process at one time. The setting does not affect the size of IDAT chunks
  586. # read, just the amount read at once. Neither does it affect the progressive
  587. # reader, which processes just the amount of data the application gives it.
  588. # The sequential reader is currently unable to process more than one IDAT at
  589. # once - it has to read and process each one in turn. There is no point setting
  590. # this to a value larger than the IDAT chunks typically encountered (it would
  591. # just waste memory) but there may be some point in reducing it below the value
  592. # of ZBUF_SIZE (the size of IDAT chunks written by libpng.)
  593. setting IDAT_READ_SIZE default PNG_ZBUF_SIZE
  594. # Ancillary chunks
  595. chunk bKGD
  596. chunk cHRM enables COLORSPACE
  597. chunk gAMA enables GAMMA
  598. chunk hIST
  599. chunk iCCP enables COLORSPACE, GAMMA
  600. chunk iTXt enables TEXT
  601. chunk oFFs
  602. chunk pCAL
  603. chunk pHYs
  604. chunk sBIT
  605. chunk sCAL
  606. chunk sPLT
  607. chunk sRGB enables COLORSPACE, GAMMA, SET_OPTION
  608. chunk tEXt requires TEXT
  609. chunk tIME
  610. chunk tRNS
  611. chunk zTXt enables TEXT
  612. # This only affects support of the optional PLTE chunk in RGB and RGBA
  613. # images. Notice that READ_ANCILLARY_CHUNKS therefore disables part
  614. # of the regular chunk reading too.
  615. option READ_OPT_PLTE requires READ_ANCILLARY_CHUNKS
  616. # Unknown chunk handling
  617. #
  618. # 'UNKNOWN_CHUNKS' is a global option to disable all unknown chunk handling on
  619. # read or write; everything else below requires it (directly or indirectly).
  620. option UNKNOWN_CHUNKS
  621. # There are three main options to control the ability to read and write unknown
  622. # chunks. If either read option is turned on then unknown chunks will be read,
  623. # otherwise they are skipped. If the write option is turned on unknown chunks
  624. # set by png_set_unknown_chunks will be written otherwise it is an error to call
  625. # that API on a write struct.
  626. option WRITE_UNKNOWN_CHUNKS requires WRITE requires UNKNOWN_CHUNKS
  627. option WRITE_UNKNOWN_CHUNKS enables STORE_UNKNOWN_CHUNKS
  628. # The first way to read user chunks is to have libpng save them for a later call
  629. # to png_get_unknown_chunks, the application must call
  630. # png_set_keep_unknown_chunks to cause this to actually happen (see png.h)
  631. option SAVE_UNKNOWN_CHUNKS requires READ requires SET_UNKNOWN_CHUNKS
  632. option SAVE_UNKNOWN_CHUNKS enables READ_UNKNOWN_CHUNKS, STORE_UNKNOWN_CHUNKS
  633. # The second approach is to use an application provided callback to process the
  634. # chunks, the callback can either handle the chunk entirely itself or request
  635. # that libpng store the chunk for later retrieval via png_get_unknown_chunks.
  636. #
  637. # NOTE: If STORE_UNKNOWN_CHUNKS is not enabled (which is the default if
  638. # both SAVE_UNKNOWN_CHUNKS and WRITE_UNKNOWN_CHUNKS are disabled) then a
  639. # 0 result from the callback will be ignored because no support for saving
  640. # unknown chunks has been compiled in. The normal symptom is that your app
  641. # fails to compile because png_get_unknown_chunks is no longer defined in png.h.
  642. # If you encounter this issue simply enable STORE_UNKNOWN_CHUNKS in your build.
  643. #
  644. # Note that there is no 'WRITE_USER_CHUNKS' so the USER_CHUNKS option is always
  645. # the same as READ_USER_CHUNKS at present
  646. option READ_USER_CHUNKS requires READ, UNKNOWN_CHUNKS
  647. option READ_USER_CHUNKS enables READ_UNKNOWN_CHUNKS, USER_CHUNKS
  648. # Two further options are provided to allow detailed control of the handling.
  649. # The first enables png_set_keep_unknown_chunks; this allows the default to be
  650. # changed from discarding unknown chunks and allows per-chunk control. This is
  651. # required to use the SAVE_UNKNOWN_CHUNKS option. If enabled this option also
  652. # applies to write (see png.h), otherwise the write API simply writes all the
  653. # chunks it is given.
  654. #
  655. # The second option extends the unknown handling to allow known chunks to be
  656. # handled as though they were unknown. This option doesn't change any APIs, it
  657. # merely turns on the code to check known as well as unknown chunks.
  658. #
  659. # This option no longer affects the write code. It can be safely disabled and
  660. # will prevent applications stopping libpng reading known chunks.
  661. option SET_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS
  662. option HANDLE_AS_UNKNOWN requires SET_UNKNOWN_CHUNKS
  663. # The following options are derived from the above and should not be turned on
  664. # explicitly.
  665. option READ_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS disabled
  666. option STORE_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS disabled
  667. option CONVERT_tIME requires WRITE_ANCILLARY_CHUNKS
  668. # The "tm" structure is not supported on WindowsCE
  669. @#ifdef _WIN32_WCE
  670. @# define PNG_NO_CONVERT_tIME
  671. @#endif
  672. option WRITE_FILTER requires WRITE
  673. option SAVE_INT_32 disabled
  674. # png_save_int_32 is required internally for writing the ancillary chunks oFFs
  675. # and pCAL and for both reading and writing iCCP (for the generation/checking of
  676. # the corresponding cHRM/gAMA chunks) if full ICC is supported.
  677. # added at libpng-1.5.4
  678. option WRITE_OPTIMIZE_CMF requires WRITE
  679. option READ_COMPRESSED_TEXT disabled
  680. option READ_iCCP enables READ_COMPRESSED_TEXT
  681. option READ_iTXt enables READ_COMPRESSED_TEXT
  682. option READ_zTXt enables READ_COMPRESSED_TEXT
  683. option WRITE_oFFs enables SAVE_INT_32
  684. option WRITE_pCAL enables SAVE_INT_32
  685. option WRITE_cHRM enables SAVE_INT_32
  686. option WRITE_COMPRESSED_TEXT disabled
  687. option WRITE_iCCP enables WRITE_COMPRESSED_TEXT
  688. option WRITE_iTXt enables WRITE_COMPRESSED_TEXT
  689. option WRITE_zTXt enables WRITE_COMPRESSED_TEXT
  690. # Turn this off to disable png_read_png() and png_write_png() and
  691. # leave the row_pointers member out of the info structure.
  692. option INFO_IMAGE
  693. # added at libpng-1.5.10
  694. # Turn this off to disable warning about invalid palette index and
  695. # leave the num_palette_max member out of the png structure.
  696. option CHECK_FOR_INVALID_INDEX enables READ_CHECK_FOR_INVALID_INDEX
  697. option CHECK_FOR_INVALID_INDEX enables WRITE_CHECK_FOR_INVALID_INDEX
  698. option READ_CHECK_FOR_INVALID_INDEX requires READ, CHECK_FOR_INVALID_INDEX
  699. option WRITE_CHECK_FOR_INVALID_INDEX requires WRITE, CHECK_FOR_INVALID_INDEX
  700. # added at libpng-1.5.15
  701. option GET_PALETTE_MAX enables READ_GET_PALETTE_MAX WRITE_GET_PALETTE_MAX
  702. option READ_GET_PALETTE_MAX requires READ_CHECK_FOR_INVALID_INDEX disabled
  703. option WRITE_GET_PALETTE_MAX requires WRITE_CHECK_FOR_INVALID_INDEX disabled
  704. # Simplified API options (added at libpng-1.6.0)
  705. # In libpng 1.6.8 the handling of these options was changed to used 'requires'
  706. # throughout, so that disabling some of the low level support always disables
  707. # the base simplified read/write API. This much simplifies the handling and
  708. # makes 'everything = off' work in a more intuitive way. It eliminates a
  709. # previously reported feature that APIs previously enabled by the simplified
  710. # API couldn't be turned off without explicitly turning off the simplified
  711. # APIs.
  712. #
  713. # Read:
  714. option SIMPLIFIED_READ,
  715. requires SEQUENTIAL_READ, READ_TRANSFORMS, SETJMP, BENIGN_ERRORS,
  716. READ_EXPAND, READ_16BIT, READ_EXPAND_16, READ_SCALE_16_TO_8,
  717. READ_RGB_TO_GRAY, READ_ALPHA_MODE, READ_BACKGROUND, READ_STRIP_ALPHA,
  718. READ_FILLER, READ_SWAP, READ_PACK, READ_GRAY_TO_RGB, READ_GAMMA,
  719. READ_tRNS, READ_bKGD, READ_gAMA, READ_cHRM, READ_sRGB, READ_sBIT
  720. # AFIRST and BGR read options:
  721. # Prior to libpng 1.6.8 these were disabled but switched on if the low level
  722. # libpng routines that do the swaps were enabled. This worked but was
  723. # confusing. In libpng 1.6.8 the options were changed to simple 'requires'
  724. # and are enabled by default. This should work the same way in practice.
  725. option SIMPLIFIED_READ_AFIRST enables FORMAT_AFIRST,
  726. requires SIMPLIFIED_READ READ_SWAP_ALPHA
  727. option SIMPLIFIED_READ_BGR enables FORMAT_BGR,
  728. requires SIMPLIFIED_READ READ_BGR
  729. # Write:
  730. option SIMPLIFIED_WRITE,
  731. requires WRITE STDIO, SETJMP, WRITE_SWAP, WRITE_PACK,
  732. WRITE_tRNS, WRITE_gAMA, WRITE_sRGB, WRITE_cHRM
  733. option SIMPLIFIED_WRITE_AFIRST enables FORMAT_AFIRST,
  734. requires SIMPLIFIED_WRITE WRITE_SWAP_ALPHA
  735. option SIMPLIFIED_WRITE_BGR enables FORMAT_BGR,
  736. requires SIMPLIFIED_WRITE WRITE_BGR
  737. # Formats:
  738. option FORMAT_AFIRST disabled
  739. option FORMAT_BGR disabled