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