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