|
fukasawa |
e60969 |
# scripts/pnglibconf.dfa - library build configuration control
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
@/*- pnglibconf.dfn intermediate file
|
|
fukasawa |
e60969 |
@ * generated from scripts/pnglibconf.dfa
|
|
fukasawa |
e60969 |
@ */
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
com pnglibconf.h - library build configuration
|
|
fukasawa |
e60969 |
com
|
|
fukasawa |
e60969 |
version
|
|
fukasawa |
e60969 |
com
|
|
fukasawa |
e60969 |
com Copyright (c) 1998-2016 Glenn Randers-Pehrson
|
|
fukasawa |
e60969 |
com
|
|
fukasawa |
e60969 |
com This code is released under the libpng license.
|
|
fukasawa |
e60969 |
com For conditions of distribution and use, see the disclaimer
|
|
fukasawa |
e60969 |
com and license in png.h
|
|
fukasawa |
e60969 |
com
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This file is preprocessed by scripts/options.awk and the
|
|
fukasawa |
e60969 |
# C compiler to generate 'pnglibconf.h' - a list of all the
|
|
fukasawa |
e60969 |
# configuration options. The file lists the various options
|
|
fukasawa |
e60969 |
# that can *only* be specified during the libpng build;
|
|
fukasawa |
e60969 |
# pnglibconf.h freezes the definitions selected for the specific
|
|
fukasawa |
e60969 |
# build.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# The syntax is detailed in scripts/options.awk; this is a summary
|
|
fukasawa |
e60969 |
# only:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# setting <name> [requires ...] [default]</name>
|
|
fukasawa |
e60969 |
# #define PNG_<name> <value> /* value comes from current setting */</value></name>
|
|
fukasawa |
e60969 |
# option <name> [requires ...] [if ...] [enables ...] [disabled]</name>
|
|
fukasawa |
e60969 |
# #define PNG_<name>_SUPPORTED if the requirements are met and</name>
|
|
fukasawa |
e60969 |
# enable the other options listed
|
|
fukasawa |
e60969 |
# chunk <name> [requires ...] [enables ...] [disabled]</name>
|
|
fukasawa |
e60969 |
# Enable chunk processing for the given ancillary chunk; any
|
|
fukasawa |
e60969 |
# 'requires something' expands to READ_something for read and
|
|
fukasawa |
e60969 |
# WRITE_something for write, but the enables list members are
|
|
fukasawa |
e60969 |
# used as given (e.g. enables GAMMA just expands to that on the
|
|
fukasawa |
e60969 |
# correspond READ_name and WRITE_name lines.)
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# "," may be used to separate options on an 'option' line and is ignored; it
|
|
fukasawa |
e60969 |
# doesn't change the meaning of the line. (NOT setting, where "," becomes
|
|
fukasawa |
e60969 |
# part of the setting!) A comma at the end of an option line causes a
|
|
fukasawa |
e60969 |
# continuation (the next line is included in the option too.)
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Note that the 'on' and 'off' keywords, while valid on both option
|
|
fukasawa |
e60969 |
# and chunk, should not be used in this file because they force the
|
|
fukasawa |
e60969 |
# relevant options on or off.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
#----------------------------------------------------------------------
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The following setting, option and chunk values can all be changed
|
|
fukasawa |
e60969 |
# while building libpng:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# setting: change 'setting' lines to fine tune library performance;
|
|
fukasawa |
e60969 |
# changes to the settings don't affect the libpng API functionally
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# option: change 'option' lines to remove or add capabilities from
|
|
fukasawa |
e60969 |
# or to the library; options change the library API
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# chunk: change 'chunk' lines to remove capabilities to process
|
|
fukasawa |
e60969 |
# optional ('ancillary') chunks. This does not prevent PNG
|
|
fukasawa |
e60969 |
# decoding but does change the libpng API because some chunks
|
|
fukasawa |
e60969 |
# will be ignored.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# There are three ways of disabling features, in no particular order:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 1) Create 'pngusr.h', enter the required private build information
|
|
fukasawa |
e60969 |
# detailed below and #define PNG_NO_<option> for each option you</option>
|
|
fukasawa |
e60969 |
# don't want in that file in that file. You can also turn on options
|
|
fukasawa |
e60969 |
# using PNG_<option>_SUPPORTED. When you have finished rerun</option>
|
|
fukasawa |
e60969 |
# configure and rebuild pnglibconf.h file with -DPNG_USER_CONFIG:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# make clean
|
|
fukasawa |
e60969 |
# CPPFLAGS='-DPNG_USER_CONFIG' ./configure
|
|
fukasawa |
e60969 |
# make pnglibconf.h
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# pngusr.h is only used during the creation of pnglibconf.h, but it
|
|
fukasawa |
e60969 |
# is safer to ensure that -DPNG_USER_CONFIG is specified throughout
|
|
fukasawa |
e60969 |
# the build by changing the CPPFLAGS passed to the initial ./configure
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 2) Add definitions of the settings you want to change to
|
|
fukasawa |
e60969 |
# CPPFLAGS; for example:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# -DPNG_DEFAULT_READ_MACROS=0
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# (This would change the default to *not* use read macros.) Be
|
|
fukasawa |
e60969 |
# very careful to change only settings that don't alter the API
|
|
fukasawa |
e60969 |
# because this approach bypasses the private build checking. You
|
|
fukasawa |
e60969 |
# can also change settings from pngpriv.h (read pngpriv.h) safely
|
|
fukasawa |
e60969 |
# without API changes. Do that in the same way.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 3) Write a new '.dfa' file (say 'pngusr.dfa') and in this file
|
|
fukasawa |
e60969 |
# provide override values for setting entries and turn option or
|
|
fukasawa |
e60969 |
# chunk values explicitly 'on' or 'off':
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# setting FOO default VALUE
|
|
fukasawa |
e60969 |
# option BAR [on|off]
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Then add this file to the options.awk command line (the *first*
|
|
fukasawa |
e60969 |
# one) after this file. The make macro DFA_XTRA is provided to make
|
|
fukasawa |
e60969 |
# this easier (set it like CPPFLAGS prior to running ./configure).
|
|
fukasawa |
e60969 |
# Look at the builds below contrib/pngminim for some extreme examples
|
|
fukasawa |
e60969 |
# of how this can be used.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Don't edit this file unless you are contributing a patch to
|
|
fukasawa |
e60969 |
# libpng and need new or modified options/settings.
|
|
fukasawa |
e60969 |
#----------------------------------------------------------------------
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The following causes commented out #undef lines to be written to
|
|
fukasawa |
e60969 |
# pnglibconf.h; this can be stopped by logunsupported=0 in a later
|
|
fukasawa |
e60969 |
# file or on the command line (after pnglibconf.dfa)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
logunsupported = 1
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The following allows the output from configure to modify the contents of
|
|
fukasawa |
e60969 |
# pnglibconf.h
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
@#ifdef HAVE_CONFIG_H
|
|
fukasawa |
e60969 |
@# include "config.h"
|
|
fukasawa |
e60969 |
@#endif
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# PNG_USER_CONFIG has to be defined on the compiler command line
|
|
fukasawa |
e60969 |
# to cause pngusr.h to be read while constructing pnglibconf.h
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# If you create a private DLL you need to define the following
|
|
fukasawa |
e60969 |
# macros in the file 'pngusr.h' and set -DPNG_USER_CONFIG for
|
|
fukasawa |
e60969 |
# compilation (i.e. in CPPFLAGS.)
|
|
fukasawa |
e60969 |
# #define PNG_USER_PRIVATEBUILD \
|
|
fukasawa |
e60969 |
# <describes and="" built="" by="" dll="" of="" the="" this="" version="" was="" whom="" why=""></describes>
|
|
fukasawa |
e60969 |
# e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
|
|
fukasawa |
e60969 |
# #define PNG_USER_DLLFNAME_POSTFIX
|
|
fukasawa |
e60969 |
# distinguish your DLL from those of the official release. These
|
|
fukasawa |
e60969 |
# correspond to the trailing letters that come after the version
|
|
fukasawa |
e60969 |
# number and must match your private DLL name>
|
|
fukasawa |
e60969 |
# e.g. // private DLL "libpng13gx.dll"
|
|
fukasawa |
e60969 |
# #define PNG_USER_DLLFNAME_POSTFIX "gx"
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# The following macros are also at your disposal if you want to complete the
|
|
fukasawa |
e60969 |
# DLL VERSIONINFO structure.
|
|
fukasawa |
e60969 |
# - PNG_USER_VERSIONINFO_COMMENTS
|
|
fukasawa |
e60969 |
# - PNG_USER_VERSIONINFO_COMPANYNAME
|
|
fukasawa |
e60969 |
# - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# It is necessary to include configures definitions here so that AC_DEFINE
|
|
fukasawa |
e60969 |
# in configure.ac works in a comprehensible way
|
|
fukasawa |
e60969 |
@#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
|
fukasawa |
e60969 |
@# include "config.h"
|
|
fukasawa |
e60969 |
@#endif
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
@#ifdef PNG_USER_CONFIG
|
|
fukasawa |
e60969 |
@# include "pngusr.h"
|
|
fukasawa |
e60969 |
@#endif
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This is a special fixup for the Watcom C compiler on Windows, which has
|
|
fukasawa |
e60969 |
# multiple procedure call standards. Unless PNG_API_RULE is set explicitly
|
|
fukasawa |
e60969 |
# (i.e. if it is not defined at this point) it will be forced to '2' here when
|
|
fukasawa |
e60969 |
# using Watcom. This indicates to the other header files that Watcom behaviour
|
|
fukasawa |
e60969 |
# is required where appropriate.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
@#ifdef __WATCOMC__
|
|
fukasawa |
e60969 |
@# ifndef PNG_API_RULE
|
|
fukasawa |
e60969 |
@# define PNG_API_RULE 2 /* Use Watcom calling conventions */
|
|
fukasawa |
e60969 |
@# endif
|
|
fukasawa |
e60969 |
@#endif
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# IN DEVELOPMENT
|
|
fukasawa |
e60969 |
# These are currently experimental features; define them if you want (NOTE:
|
|
fukasawa |
e60969 |
# experimental options must be disabled before they are defined in this file!)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# NONE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Note that PNG_USER_CONFIG only has an effect when building
|
|
fukasawa |
e60969 |
# pnglibconf.h
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting USER_CONFIG
|
|
fukasawa |
e60969 |
setting USER_PRIVATEBUILD
|
|
fukasawa |
e60969 |
setting USER_DLLFNAME_POSTFIX
|
|
fukasawa |
e60969 |
setting USER_VERSIONINFO_COMMENTS
|
|
fukasawa |
e60969 |
setting USER_VERSIONINFO_COMPANYNAME
|
|
fukasawa |
e60969 |
setting USER_VERSIONINFO_LEGALTRADEMARKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Record the 'API rule' used to select calling conventions on
|
|
fukasawa |
e60969 |
# those systems that support such things (see all the comments in
|
|
fukasawa |
e60969 |
# pngconf.h)
|
|
fukasawa |
e60969 |
# Changing this setting has a fundamental affect on the PNG ABI,
|
|
fukasawa |
e60969 |
# do not release shared libraries with this changed.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting API_RULE default 0
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This allows a prefix to be added to the front of every API functon name (and
|
|
fukasawa |
e60969 |
# therefore every symbol) by redefining all the function names with the prefix
|
|
fukasawa |
e60969 |
# at the end of pnglibconf.h. It also turns on similar internal symbol renaming
|
|
fukasawa |
e60969 |
# by causing a similar build-time only file, pngprefix.h, to be generated.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting PREFIX
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Implementation specific control of the optimizations, enabled by those
|
|
fukasawa |
e60969 |
# hardware or software options that need it (typically when run-time choices
|
|
fukasawa |
e60969 |
# must be made by the user)
|
|
fukasawa |
e60969 |
option SET_OPTION disabled
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# These options are specific to the ARM NEON hardware optimizations. At present
|
|
fukasawa |
e60969 |
# these optimizations depend on GCC specific pre-processing of an assembler (.S)
|
|
fukasawa |
e60969 |
# file so they probably won't work with other compilers.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# ARM_NEON_OPT: unset: check at compile time (__ARM_NEON__ must be defined by
|
|
fukasawa |
e60969 |
# the compiler, typically as a result of specifying
|
|
fukasawa |
e60969 |
# CC="gcc -mfpu=neon".)
|
|
fukasawa |
e60969 |
# 0: disable (even if the CPU has a NEON FPU.)
|
|
fukasawa |
e60969 |
# 1: check at run time (via ARM_NEON_{API,CHECK})
|
|
fukasawa |
e60969 |
# 2: switch on unconditionally (inadvisable - instead pass
|
|
fukasawa |
e60969 |
# -mfpu=neon to GCC in CC)
|
|
fukasawa |
e60969 |
# When building libpng avoid using any setting other than '0'; '1' is
|
|
fukasawa |
e60969 |
# set automatically when either 'API' or 'CHECK' are configured in,
|
|
fukasawa |
e60969 |
# '2' should not be necessary as -mfpu=neon will achieve the same
|
|
fukasawa |
e60969 |
# effect as well as applying NEON optimizations to the rest of the
|
|
fukasawa |
e60969 |
# libpng code.
|
|
fukasawa |
e60969 |
# NOTE: any setting other than '0' requires ALIGNED_MEMORY
|
|
fukasawa |
e60969 |
# ARM_NEON_API: (PNG_ARM_NEON == 1) allow the optimization to be switched on
|
|
fukasawa |
e60969 |
# with png_set_option
|
|
fukasawa |
e60969 |
# ARM_NEON_CHECK: (PNG_ARM_NEON == 1) compile a run-time check to see if Neon
|
|
fukasawa |
e60969 |
# extensions are supported. This is poorly supported and
|
|
fukasawa |
e60969 |
# deprecated - use the png_set_option API.
|
|
fukasawa |
e60969 |
setting ARM_NEON_OPT
|
|
fukasawa |
e60969 |
option ARM_NEON_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
|
|
fukasawa |
e60969 |
sets ARM_NEON_OPT 1
|
|
fukasawa |
e60969 |
option ARM_NEON_CHECK disabled requires ALIGNED_MEMORY,
|
|
fukasawa |
e60969 |
sets ARM_NEON_OPT 1
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# These settings configure the default compression level (0-9) and 'strategy';
|
|
fukasawa |
e60969 |
# strategy is as defined by the implementors of zlib. It describes the input
|
|
fukasawa |
e60969 |
# data and modifies the zlib parameters in an attempt to optimize the balance
|
|
fukasawa |
e60969 |
# between search and huffman encoding in the zlib algorithms. The defaults are
|
|
fukasawa |
e60969 |
# the zlib.h defaults - the apparently recursive definition does not arise
|
|
fukasawa |
e60969 |
# because the name of the setting is prefixed by PNG_
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# The TEXT values are the defaults when writing compressed text (all forms)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Include the zlib header so that the defaults below are known
|
|
fukasawa |
e60969 |
@# include <zlib.h></zlib.h>
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The '@' here means to substitute the value when pnglibconf.h is built
|
|
fukasawa |
e60969 |
setting Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
|
|
fukasawa |
e60969 |
# TODO: why aren't these Z_RLE; zlib.h says that Z_RLE, specifically, is
|
|
fukasawa |
e60969 |
# appropriate for PNG images, maybe it doesn't exist in all versions?
|
|
fukasawa |
e60969 |
setting Z_DEFAULT_STRATEGY default @Z_FILTERED
|
|
fukasawa |
e60969 |
setting Z_DEFAULT_NOFILTER_STRATEGY default @Z_DEFAULT_STRATEGY
|
|
fukasawa |
e60969 |
setting ZLIB_VERNUM default @ZLIB_VERNUM
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Linkage of:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# API: libpng API functions
|
|
fukasawa |
e60969 |
# CALLBACK: internal non-file-local callbacks
|
|
fukasawa |
e60969 |
# FUNCTION: internal non-file-local functions
|
|
fukasawa |
e60969 |
# DATA: internal non-file-local (const) data
|
|
fukasawa |
e60969 |
setting LINKAGE_API default extern
|
|
fukasawa |
e60969 |
setting LINKAGE_CALLBACK default extern
|
|
fukasawa |
e60969 |
setting LINKAGE_FUNCTION default extern
|
|
fukasawa |
e60969 |
setting LINKAGE_DATA default extern
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting TEXT_Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
|
|
fukasawa |
e60969 |
setting TEXT_Z_DEFAULT_STRATEGY default @Z_DEFAULT_STRATEGY
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Default to using the read macros
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting DEFAULT_READ_MACROS default 1
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The alternative is to call functions to read PNG values, if
|
|
fukasawa |
e60969 |
# the functions are turned *off* the read macros must always
|
|
fukasawa |
e60969 |
# be enabled, so turning this off will actually force the
|
|
fukasawa |
e60969 |
# USE_READ_MACROS option on (see pngconf.h)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_INT_FUNCTIONS requires READ
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The same for write but these can only be switched off if no writing
|
|
fukasawa |
e60969 |
# is required at all - hence the use of a 'disabled', not a 'requires'.
|
|
fukasawa |
e60969 |
# If these are needed, they are enabled in the 'WRITE options' section
|
|
fukasawa |
e60969 |
# below.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_INT_FUNCTIONS disabled
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Error controls
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# WARNINGS: normally on, if off no warnings are generated
|
|
fukasawa |
e60969 |
# ERROR_TEXT: normally on, if off errors happen but there is no message
|
|
fukasawa |
e60969 |
# ERROR_NUMBERS: unimplemented feature, therefore disabled
|
|
fukasawa |
e60969 |
# BENIGN_ERRORS: support for just issuing warnings for recoverable errors
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# BENIGN_READ_ERRORS:
|
|
fukasawa |
e60969 |
# By default recoverable errors on read should just generate warnings,
|
|
fukasawa |
e60969 |
# generally safe but PNG files that don't conform to the specification will
|
|
fukasawa |
e60969 |
# be accepted if a meaningful result can be produced.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# BENIGN_WRITE_ERRORS:
|
|
fukasawa |
e60969 |
# By default recoverable errors on write should just generate warnings,
|
|
fukasawa |
e60969 |
# not generally safe because this allows the application to write invalid
|
|
fukasawa |
e60969 |
# PNG files. Applications should enable this themselves; it's useful
|
|
fukasawa |
e60969 |
# because it means that a failure to write an ancilliary chunk can often be
|
|
fukasawa |
e60969 |
# ignored.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WARNINGS
|
|
fukasawa |
e60969 |
option ERROR_TEXT
|
|
fukasawa |
e60969 |
option ERROR_NUMBERS disabled
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option BENIGN_ERRORS
|
|
fukasawa |
e60969 |
option BENIGN_WRITE_ERRORS requires BENIGN_ERRORS disabled
|
|
fukasawa |
e60969 |
option BENIGN_READ_ERRORS requires BENIGN_ERRORS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Generic options - affect both read and write.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option MNG_FEATURES
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Arithmetic options, the first is the big switch that chooses between internal
|
|
fukasawa |
e60969 |
# floating and fixed point arithmetic implementations - it does not affect any
|
|
fukasawa |
e60969 |
# APIs. The second two (the _POINT settings) switch off individual APIs.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Prior to libpng 1.6.8 one of the API (_POINT) variants had to be selected. At
|
|
fukasawa |
e60969 |
# 1.6.8 this restriction has been removed; the simplified API can be used
|
|
fukasawa |
e60969 |
# without enabling any of the low level fixed/floating APIs.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option FLOATING_ARITHMETIC
|
|
fukasawa |
e60969 |
option FLOATING_POINT
|
|
fukasawa |
e60969 |
option FIXED_POINT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This protects us against compilers that run on a windowing system
|
|
fukasawa |
e60969 |
# and thus don't have or would rather us not use the stdio types:
|
|
fukasawa |
e60969 |
# stdin, stdout, and stderr. The only one currently used is stderr
|
|
fukasawa |
e60969 |
# in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
|
|
fukasawa |
e60969 |
# prevent these from being compiled and used. #defining PNG_NO_STDIO
|
|
fukasawa |
e60969 |
# will also prevent these, plus will prevent the entire set of stdio
|
|
fukasawa |
e60969 |
# macros and functions (FILE *, printf, etc.) from being compiled and used,
|
|
fukasawa |
e60969 |
# unless (PNG_DEBUG > 0) has been #defined.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option STDIO
|
|
fukasawa |
e60969 |
option CONSOLE_IO requires STDIO
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Note: prior to 1.5.0 this option could not be disabled if STDIO
|
|
fukasawa |
e60969 |
# was enabled. Prior to 1.5.3 this option required STDIO
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option TIME_RFC1123
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# PNG_SETJMP_NOT_SUPPORTED is an old equivalent for NO_SETJMP
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option SETJMP
|
|
fukasawa |
e60969 |
= NO_SETJMP SETJMP_NOT_SUPPORTED
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# If this is disabled it is not possible for apps to get the
|
|
fukasawa |
e60969 |
# values from the 'info' structure, this effectively removes
|
|
fukasawa |
e60969 |
# quite a lot of the READ API.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option EASY_ACCESS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Added at libpng-1.2.0
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option USER_MEM
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Added at libpng-1.4.0
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option IO_STATE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Libpng limits: limit the size of images and data on read.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# If this option is disabled all the limit checking code will be disabled:
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option USER_LIMITS requires READ
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The default settings given below for the limits mean that libpng will
|
|
fukasawa |
e60969 |
# limit the size of images or the size of data in ancilliary chunks to less
|
|
fukasawa |
e60969 |
# than the specification or implementation limits. Settings have the
|
|
fukasawa |
e60969 |
# following interpretations:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# USER_WIDTH_MAX: maximum width of an image that will be read
|
|
fukasawa |
e60969 |
# USER_HEIGHT_MAX: maximum height
|
|
fukasawa |
e60969 |
# USER_CHUNK_MALLOC_MAX: maximum in-memory (decompressed) size of a single chunk
|
|
fukasawa |
e60969 |
# USER_CHUNK_CACHE_MAX: maximum number of chunks to be cached
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Only chunks that are variable in number are counted towards the
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Use 0x7fffffff for unlimited
|
|
fukasawa |
e60969 |
setting USER_WIDTH_MAX default 1000000
|
|
fukasawa |
e60969 |
setting USER_HEIGHT_MAX default 1000000
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Use 0 for unlimited
|
|
fukasawa |
e60969 |
setting USER_CHUNK_CACHE_MAX default 1000
|
|
fukasawa |
e60969 |
setting USER_CHUNK_MALLOC_MAX default 8000000
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# If this option is enabled APIs to set the above limits at run time are added;
|
|
fukasawa |
e60969 |
# without this the hardwired (compile time) limits will be used.
|
|
fukasawa |
e60969 |
option SET_USER_LIMITS requires USER_LIMITS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# All of the following options relate to code capabilities for
|
|
fukasawa |
e60969 |
# processing image data before creating a PNG or after reading one.
|
|
fukasawa |
e60969 |
# You can remove these capabilities safely and still be PNG
|
|
fukasawa |
e60969 |
# conformant, however the library that results is still non-standard.
|
|
fukasawa |
e60969 |
# See the comments above about how to change options and settings.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# READ options
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# WARNING: in libpng 1.5 maintained configuration compatibility with earlier
|
|
fukasawa |
e60969 |
# versions. In some cases turning off an option turned off other options, in
|
|
fukasawa |
e60969 |
# others it was ineffective unless dependent options were also turned off.
|
|
fukasawa |
e60969 |
# Libpng 1.6 changes this: in general if you turn off an option that affects
|
|
fukasawa |
e60969 |
# APIs it stays off and simply disables APIs that depend on it.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# As a result if you simply port the libpng 1.5 configuration to libpng 1.6 you
|
|
fukasawa |
e60969 |
# will probably see build failures due to missing APIs. Fixing these failures
|
|
fukasawa |
e60969 |
# requires some, perhaps considerable, knowledge of what your libpng using
|
|
fukasawa |
e60969 |
# applications are doing, fortunately there is no great reason for you to move
|
|
fukasawa |
e60969 |
# to libpng 1.6; the new interfaces in 1.6 will take several years to become
|
|
fukasawa |
e60969 |
# popular.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ enables READ_INTERLACING SET_OPTION
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Disabling READ_16BIT does not disable reading 16-bit PNG files, but it
|
|
fukasawa |
e60969 |
# forces them to be chopped down to 8-bit, and disables any 16-bit
|
|
fukasawa |
e60969 |
# processing after that has happened. You need to be sure to enable
|
|
fukasawa |
e60969 |
# READ_SCALE_16_TO_8 or READ_STRIP_16_TO_8 when you disable READ_16BIT for
|
|
fukasawa |
e60969 |
# this to work properly. You should disable the other option if you need to
|
|
fukasawa |
e60969 |
# ensure a particular conversion (otherwise the app can chose.)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_16BIT requires READ enables 16BIT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_QUANTIZE requires READ
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_TRANSFORMS requires READ
|
|
fukasawa |
e60969 |
= NO_READ_TRANSFORMS READ_TRANSFORMS_NOT_SUPPORTED
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Read gamma handling. Gamma processing is a core part of libpng and many of
|
|
fukasawa |
e60969 |
# the capabilities are dependent on libpng performing gamma correction.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# In libpng 1.6 disabling gamma processing (setting PNG_NO_READ_GAMMA)
|
|
fukasawa |
e60969 |
# consistently disables those parts of the API that depend on it. Prior to
|
|
fukasawa |
e60969 |
# 1.6.0 this was not true; the results were unpredictable and varied between
|
|
fukasawa |
e60969 |
# releases.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# If you disable gamma processing and your program no longer compiles you need
|
|
fukasawa |
e60969 |
# to ask whether you really need the APIs that are missing. If you do then you
|
|
fukasawa |
e60969 |
# almost certainly need the gamma processing.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# If you handle gamma issues outside libpng then you do not need the libpng
|
|
fukasawa |
e60969 |
# gamma processing; and it is an enormous waste of space. You just need to
|
|
fukasawa |
e60969 |
# remove the use of libpng APIs that depend on it.
|
|
fukasawa |
e60969 |
option READ_GAMMA requires READ_TRANSFORMS, READ_gAMA, READ_sRGB
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_ALPHA_MODE requires READ_TRANSFORMS, READ_GAMMA
|
|
fukasawa |
e60969 |
option READ_BACKGROUND requires READ_TRANSFORMS, READ_STRIP_ALPHA, READ_GAMMA
|
|
fukasawa |
e60969 |
option READ_BGR requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_EXPAND_16 requires READ_TRANSFORMS, READ_16BIT, READ_EXPAND
|
|
fukasawa |
e60969 |
option READ_EXPAND requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_FILLER requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_GRAY_TO_RGB requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_INVERT_ALPHA requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_INVERT requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_PACK requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_PACKSWAP requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_RGB_TO_GRAY requires READ_TRANSFORMS, READ_GAMMA enables COLORSPACE
|
|
fukasawa |
e60969 |
option READ_SCALE_16_TO_8 requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_SHIFT requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_STRIP_16_TO_8 requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_STRIP_ALPHA requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_SWAP_ALPHA requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
option READ_SWAP requires READ_TRANSFORMS, READ_16BIT
|
|
fukasawa |
e60969 |
option READ_USER_TRANSFORM requires READ_TRANSFORMS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option PROGRESSIVE_READ requires READ
|
|
fukasawa |
e60969 |
option SEQUENTIAL_READ requires READ
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# You can define PNG_NO_PROGRESSIVE_READ if you don't do progressive reading.
|
|
fukasawa |
e60969 |
# This is not talking about interlacing capability! You'll still have
|
|
fukasawa |
e60969 |
# interlacing unless you turn off the following which is required
|
|
fukasawa |
e60969 |
# for PNG-compliant decoders. (In other words, do not do this - in
|
|
fukasawa |
e60969 |
# fact it can't be disabled from the command line!)
|
|
fukasawa |
e60969 |
#option READ_INTERLACING requires READ
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_COMPOSITE_NODIV requires READ
|
|
fukasawa |
e60969 |
= NO_READ_COMPOSITE_NODIV NO_READ_COMPOSITED_NODIV
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Inch conversions
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option INCH_CONVERSIONS
|
|
fukasawa |
e60969 |
= INCH_CONVERSIONS INCH_CONVERSIONS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# API to build a grayscale palette
|
|
fukasawa |
e60969 |
# NOTE: this is not used internally by libpng at present.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option BUILD_GRAYSCALE_PALETTE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# WRITE options
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE enables WRITE_INT_FUNCTIONS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Disabling WRITE_16BIT prevents 16-bit PNG files from being
|
|
fukasawa |
e60969 |
# generated.
|
|
fukasawa |
e60969 |
option WRITE_16BIT requires WRITE enables 16BIT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_TRANSFORMS requires WRITE
|
|
fukasawa |
e60969 |
= NO_WRITE_TRANSFORMS WRITE_TRANSFORMS_NOT_SUPPORTED
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_SHIFT requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_PACK requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_BGR requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_SWAP requires WRITE_TRANSFORMS, WRITE_16BIT
|
|
fukasawa |
e60969 |
option WRITE_PACKSWAP requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_INVERT requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_FILLER requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_SWAP_ALPHA requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_INVERT_ALPHA requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
option WRITE_USER_TRANSFORM requires WRITE_TRANSFORMS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This is not required for PNG-compliant encoders, but can cause
|
|
fukasawa |
e60969 |
# trouble if left undefined
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_INTERLACING requires WRITE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Deprecated, will be removed.
|
|
fukasawa |
e60969 |
option WRITE_WEIGHTED_FILTER requires WRITE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_FLUSH requires WRITE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Note: these can be turned off explicitly if not required by the
|
|
fukasawa |
e60969 |
# apps implementing the user transforms
|
|
fukasawa |
e60969 |
option USER_TRANSFORM_PTR if READ_USER_TRANSFORM, WRITE_USER_TRANSFORM
|
|
fukasawa |
e60969 |
option USER_TRANSFORM_INFO if READ_USER_TRANSFORM, WRITE_USER_TRANSFORM
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This enables API to set compression parameters for compressing
|
|
fukasawa |
e60969 |
# non-IDAT chunks (zTXt, iTXt, iCCP, and unknown chunks). This feature
|
|
fukasawa |
e60969 |
# was added at libpng-1.5.3.
|
|
fukasawa |
e60969 |
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION requires WRITE
|
|
fukasawa |
e60969 |
option WRITE_CUSTOMIZE_COMPRESSION requires WRITE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Any chunks you are not interested in, you can undef here. The
|
|
fukasawa |
e60969 |
# ones that allocate memory may be expecially important (hIST,
|
|
fukasawa |
e60969 |
# tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
|
|
fukasawa |
e60969 |
# a bit smaller.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The size of the png_text structure changed in libpng-1.0.6 when
|
|
fukasawa |
e60969 |
# iTXt support was added. iTXt support was turned off by default through
|
|
fukasawa |
e60969 |
# libpng-1.2.x, to support old apps that malloc the png_text structure
|
|
fukasawa |
e60969 |
# instead of calling png_set_text() and letting libpng malloc it. It
|
|
fukasawa |
e60969 |
# was turned on by default in libpng-1.4.0.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_ANCILLARY_CHUNKS requires READ
|
|
fukasawa |
e60969 |
# PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated.
|
|
fukasawa |
e60969 |
= NO_READ_ANCILLARY_CHUNKS READ_ANCILLARY_CHUNKS_NOT_SUPPORTED
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_ANCILLARY_CHUNKS requires WRITE
|
|
fukasawa |
e60969 |
# PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated.
|
|
fukasawa |
e60969 |
= NO_WRITE_ANCILLARY_CHUNKS WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# These options disable *all* the text chunks if turned off
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_TEXT requires READ_ANCILLARY_CHUNKS enables TEXT
|
|
fukasawa |
e60969 |
option WRITE_TEXT requires WRITE_ANCILLARY_CHUNKS enables TEXT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Moved to pnglibconf.h at libpng-1.5.0
|
|
fukasawa |
e60969 |
# Feature support: in 1.4 this was in pngconf.h, but the following
|
|
fukasawa |
e60969 |
# features have no affect on the libpng API. Add library
|
|
fukasawa |
e60969 |
# only features to the end of this list. Add features that
|
|
fukasawa |
e60969 |
# affect the API above. (Note: the list of chunks follows
|
|
fukasawa |
e60969 |
# the library-only settings.)
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# BUILD TIME ONLY OPTIONS
|
|
fukasawa |
e60969 |
# These options do not affect the API but rather alter how the
|
|
fukasawa |
e60969 |
# API is implemented, they get recorded in pnglibconf.h, but
|
|
fukasawa |
e60969 |
# can't be changed by the application.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Colorspace support (enabled as required); just the support for colorant
|
|
fukasawa |
e60969 |
# information. Gamma support, likewise, is just support for the gamma
|
|
fukasawa |
e60969 |
# information, READ_GAMMA is required for gamma transformations (so it
|
|
fukasawa |
e60969 |
# is possible to read PNG gamma without enabling all the libpng transform
|
|
fukasawa |
e60969 |
# code - do this for applications that do their own gamma processing)
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# As of 1.6.0 COLORSPACE is only useful if the application processes the
|
|
fukasawa |
e60969 |
# information; this is because the library does not do any colorspace
|
|
fukasawa |
e60969 |
# processing, it just validates the data in the PNG file.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option GAMMA disabled
|
|
fukasawa |
e60969 |
option COLORSPACE enables GAMMA disabled
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# When an ICC profile is read, or png_set, it will be checked for a match
|
|
fukasawa |
e60969 |
# against known sRGB profiles if the sRGB handling is enabled. The
|
|
fukasawa |
e60969 |
# PNG_sRGB_PROFILE_CHECKS setting controls how much work is done during the
|
|
fukasawa |
e60969 |
# check:
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# -1: Don't do any sRGB profile checking.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 0: Just validate the profile MD5 signature if present, otherwise use
|
|
fukasawa |
e60969 |
# the checks in option 1.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 1: Additionally check the length, intent and adler32 checksum of the
|
|
fukasawa |
e60969 |
# actual data. If enabled this will reject known profiles that have
|
|
fukasawa |
e60969 |
# had the rendering intent in the header changed as well as other edits
|
|
fukasawa |
e60969 |
# done without updating the checksum. See the discussion below.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 2: Additionally checksum all the data using the ethernet CRC32 algorithm.
|
|
fukasawa |
e60969 |
# This makes it more difficult to fake profiles and makes it less likely
|
|
fukasawa |
e60969 |
# to get a false positive on profiles with no signature, but is probably
|
|
fukasawa |
e60969 |
# just a waste of time since all currently approved ICC sRGB profiles have
|
|
fukasawa |
e60969 |
# a secure MD5 signature.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# The rendering intent. An ICC profile stores an intended rendering intent,
|
|
fukasawa |
e60969 |
# but does not include the value in the signature. The intent is documented
|
|
fukasawa |
e60969 |
# as the intent that should be used when combining two profiles. The sRGB
|
|
fukasawa |
e60969 |
# profile is intended, however, to be used with any of the four defined intents.
|
|
fukasawa |
e60969 |
# For this reason the sRGB chunk includes an 'intent' to be used when displaying
|
|
fukasawa |
e60969 |
# the image (intent is really a property of the image not the profile.)
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Unfortunately the iCCP chunk does not. It may therefore be that some
|
|
fukasawa |
e60969 |
# applications modify the intent in profiles (including sRGB profiles) to work
|
|
fukasawa |
e60969 |
# round this problem. Selecting an option other than option '0' will cause such
|
|
fukasawa |
e60969 |
# modified profiles to be rejected.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Security. The use of Adler32 and CRC32 checksums does not help significantly
|
|
fukasawa |
e60969 |
# with any security issues. It is relatively easy to produce arbitrary profiles
|
|
fukasawa |
e60969 |
# with the required checksums on current computer systems. Nevertheless
|
|
fukasawa |
e60969 |
# security does not seem to be an issue because the only consequence of a false
|
|
fukasawa |
e60969 |
# positive is a false assertion that the profile is an sRGB profile. This might
|
|
fukasawa |
e60969 |
# be used to hide data from libpng using applications, but it doesn't seem
|
|
fukasawa |
e60969 |
# possible to damage them.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting sRGB_PROFILE_CHECKS default 2
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Artificially align memory - the code typically aligns to 8 byte
|
|
fukasawa |
e60969 |
# boundaries if this is switched on, it's a small waste of space
|
|
fukasawa |
e60969 |
# but can help (in theory) on some architectures. Only affects
|
|
fukasawa |
e60969 |
# internal structures. Added at libpng 1.4.0
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option ALIGNED_MEMORY
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING
|
|
fukasawa |
e60969 |
# See png[wr]util.c, normally this should always be *on*
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option POINTER_INDEXING
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Other defines for things like memory and the like can go here.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# BUILD TIME SETTINGS
|
|
fukasawa |
e60969 |
# Like build time options these do not affect the API, but they
|
|
fukasawa |
e60969 |
# may be useful to applications because they record details of
|
|
fukasawa |
e60969 |
# how the API will behave particularly with regard to overall
|
|
fukasawa |
e60969 |
# accuracy.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This controls how fine the quantizing gets. As this allocates
|
|
fukasawa |
e60969 |
# a largish chunk of memory (32K), those who are not as concerned
|
|
fukasawa |
e60969 |
# with quantizing quality can decrease some or all of these.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting QUANTIZE_RED_BITS default 5
|
|
fukasawa |
e60969 |
setting QUANTIZE_GREEN_BITS default 5
|
|
fukasawa |
e60969 |
setting QUANTIZE_BLUE_BITS default 5
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This controls how fine the gamma correction becomes when you
|
|
fukasawa |
e60969 |
# are only interested in 8 bits anyway. Increasing this value
|
|
fukasawa |
e60969 |
# results in more memory being used, and more pow() functions
|
|
fukasawa |
e60969 |
# being called to fill in the gamma tables. Don't set this value
|
|
fukasawa |
e60969 |
# less than 8, and even that may not work (I haven't tested it).
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting MAX_GAMMA_8 default 11
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This controls how much a difference in gamma we can tolerate before
|
|
fukasawa |
e60969 |
# we actually start doing gamma conversion, it's a fixed point value,
|
|
fukasawa |
e60969 |
# so the default below is 0.05, meaning libpng ignores corrections in
|
|
fukasawa |
e60969 |
# the range 0.95 to 1.05
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting GAMMA_THRESHOLD_FIXED default 5000
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Precision to use when converting a floating point value to a PNG
|
|
fukasawa |
e60969 |
# extension format string in an sCAL chunk (only relevant if the
|
|
fukasawa |
e60969 |
# floating point API is enabled)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting sCAL_PRECISION default 5
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This is the size of the compression buffer, and thus the size of
|
|
fukasawa |
e60969 |
# an IDAT chunk. Make this whatever size you feel is best for your
|
|
fukasawa |
e60969 |
# machine. One of these will be allocated per png_struct. When this
|
|
fukasawa |
e60969 |
# is full, it writes the data to the disk, and does some other
|
|
fukasawa |
e60969 |
# calculations. Making this an extremely small size may slow
|
|
fukasawa |
e60969 |
# the library down, but you may want to experiment to determine
|
|
fukasawa |
e60969 |
# where it becomes significant, if you are concerned with memory
|
|
fukasawa |
e60969 |
# usage. Note that zlib allocates at least 32Kb also. For readers,
|
|
fukasawa |
e60969 |
# this describes the size of the buffer available to read the data in.
|
|
fukasawa |
e60969 |
# Unless this gets smaller than the size of a row (compressed),
|
|
fukasawa |
e60969 |
# it should not make much difference how big this is.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting ZBUF_SIZE default 8192
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This is the size of the decompression buffer used when counting or checking
|
|
fukasawa |
e60969 |
# the decompressed size of an LZ stream from a compressed ancilliary chunk; the
|
|
fukasawa |
e60969 |
# decompressed data is never used so a different size may be optimal. This size
|
|
fukasawa |
e60969 |
# was determined using contrib/libtests/timepng.c with compressed zTXt data
|
|
fukasawa |
e60969 |
# around 11MByte in size. Slight speed improvements (up to about 14% in
|
|
fukasawa |
e60969 |
# timepng) can be achieved by very large increases (to 32kbyte) on regular data,
|
|
fukasawa |
e60969 |
# but highly compressible data shows only around 2% improvement. The size is
|
|
fukasawa |
e60969 |
# chosen to minimize the effects of DoS attacks based on using very large
|
|
fukasawa |
e60969 |
# amounts of highly compressible data.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting INFLATE_BUF_SIZE default 1024
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This is the maximum amount of IDAT data that the sequential reader will
|
|
fukasawa |
e60969 |
# process at one time. The setting does not affect the size of IDAT chunks
|
|
fukasawa |
e60969 |
# read, just the amount read at once. Neither does it affect the progressive
|
|
fukasawa |
e60969 |
# reader, which processes just the amount of data the application gives it.
|
|
fukasawa |
e60969 |
# The sequential reader is currently unable to process more than one IDAT at
|
|
fukasawa |
e60969 |
# once - it has to read and process each one in turn. There is no point setting
|
|
fukasawa |
e60969 |
# this to a value larger than the IDAT chunks typically encountered (it would
|
|
fukasawa |
e60969 |
# just waste memory) but there may be some point in reducing it below the value
|
|
fukasawa |
e60969 |
# of ZBUF_SIZE (the size of IDAT chunks written by libpng.)
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
setting IDAT_READ_SIZE default PNG_ZBUF_SIZE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Ancillary chunks
|
|
fukasawa |
e60969 |
chunk bKGD
|
|
fukasawa |
e60969 |
chunk cHRM enables COLORSPACE
|
|
fukasawa |
e60969 |
chunk gAMA enables GAMMA
|
|
fukasawa |
e60969 |
chunk hIST
|
|
fukasawa |
e60969 |
chunk iCCP enables COLORSPACE, GAMMA
|
|
fukasawa |
e60969 |
chunk iTXt enables TEXT
|
|
fukasawa |
e60969 |
chunk oFFs
|
|
fukasawa |
e60969 |
chunk pCAL
|
|
fukasawa |
e60969 |
chunk pHYs
|
|
fukasawa |
e60969 |
chunk sBIT
|
|
fukasawa |
e60969 |
chunk sCAL
|
|
fukasawa |
e60969 |
chunk sPLT
|
|
fukasawa |
e60969 |
chunk sRGB enables COLORSPACE, GAMMA, SET_OPTION
|
|
fukasawa |
e60969 |
chunk tEXt requires TEXT
|
|
fukasawa |
e60969 |
chunk tIME
|
|
fukasawa |
e60969 |
chunk tRNS
|
|
fukasawa |
e60969 |
chunk zTXt enables TEXT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# This only affects support of the optional PLTE chunk in RGB and RGBA
|
|
fukasawa |
e60969 |
# images. Notice that READ_ANCILLARY_CHUNKS therefore disables part
|
|
fukasawa |
e60969 |
# of the regular chunk reading too.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_OPT_PLTE requires READ_ANCILLARY_CHUNKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Unknown chunk handling
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# 'UNKNOWN_CHUNKS' is a global option to disable all unknown chunk handling on
|
|
fukasawa |
e60969 |
# read or write; everything else below requires it (directly or indirectly).
|
|
fukasawa |
e60969 |
option UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# There are three main options to control the ability to read and write unknown
|
|
fukasawa |
e60969 |
# chunks. If either read option is turned on then unknown chunks will be read,
|
|
fukasawa |
e60969 |
# otherwise they are skipped. If the write option is turned on unknown chunks
|
|
fukasawa |
e60969 |
# set by png_set_unknown_chunks will be written otherwise it is an error to call
|
|
fukasawa |
e60969 |
# that API on a write struct.
|
|
fukasawa |
e60969 |
option WRITE_UNKNOWN_CHUNKS requires WRITE requires UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
option WRITE_UNKNOWN_CHUNKS enables STORE_UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The first way to read user chunks is to have libpng save them for a later call
|
|
fukasawa |
e60969 |
# to png_get_unknown_chunks, the application must call
|
|
fukasawa |
e60969 |
# png_set_keep_unknown_chunks to cause this to actually happen (see png.h)
|
|
fukasawa |
e60969 |
option SAVE_UNKNOWN_CHUNKS requires READ requires SET_UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
option SAVE_UNKNOWN_CHUNKS enables READ_UNKNOWN_CHUNKS, STORE_UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The second approach is to use an application provided callback to process the
|
|
fukasawa |
e60969 |
# chunks, the callback can either handle the chunk entirely itself or request
|
|
fukasawa |
e60969 |
# that libpng store the chunk for later retrieval via png_get_unknown_chunks.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# NOTE: If STORE_UNKNOWN_CHUNKS is not enabled (which is the default if
|
|
fukasawa |
e60969 |
# both SAVE_UNKNOWN_CHUNKS and WRITE_UNKNOWN_CHUNKS are disabled) then a
|
|
fukasawa |
e60969 |
# 0 result from the callback will be ignored because no support for saving
|
|
fukasawa |
e60969 |
# unknown chunks has been compiled in. The normal symptom is that your app
|
|
fukasawa |
e60969 |
# fails to compile because png_get_unknown_chunks is no longer defined in png.h.
|
|
fukasawa |
e60969 |
# If you encounter this issue simply enable STORE_UNKNOWN_CHUNKS in your build.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Note that there is no 'WRITE_USER_CHUNKS' so the USER_CHUNKS option is always
|
|
fukasawa |
e60969 |
# the same as READ_USER_CHUNKS at present
|
|
fukasawa |
e60969 |
option READ_USER_CHUNKS requires READ, UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
option READ_USER_CHUNKS enables READ_UNKNOWN_CHUNKS, USER_CHUNKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Two further options are provided to allow detailed control of the handling.
|
|
fukasawa |
e60969 |
# The first enables png_set_keep_unknown_chunks; this allows the default to be
|
|
fukasawa |
e60969 |
# changed from discarding unknown chunks and allows per-chunk control. This is
|
|
fukasawa |
e60969 |
# required to use the SAVE_UNKNOWN_CHUNKS option. If enabled this option also
|
|
fukasawa |
e60969 |
# applies to write (see png.h), otherwise the write API simply writes all the
|
|
fukasawa |
e60969 |
# chunks it is given.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# The second option extends the unknown handling to allow known chunks to be
|
|
fukasawa |
e60969 |
# handled as though they were unknown. This option doesn't change any APIs, it
|
|
fukasawa |
e60969 |
# merely turns on the code to check known as well as unknown chunks.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# This option no longer affects the write code. It can be safely disabled and
|
|
fukasawa |
e60969 |
# will prevent applications stopping libpng reading known chunks.
|
|
fukasawa |
e60969 |
option SET_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
option HANDLE_AS_UNKNOWN requires SET_UNKNOWN_CHUNKS
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# The following options are derived from the above and should not be turned on
|
|
fukasawa |
e60969 |
# explicitly.
|
|
fukasawa |
e60969 |
option READ_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS disabled
|
|
fukasawa |
e60969 |
option STORE_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS disabled
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option CONVERT_tIME requires WRITE_ANCILLARY_CHUNKS
|
|
fukasawa |
e60969 |
# The "tm" structure is not supported on WindowsCE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
@#ifdef _WIN32_WCE
|
|
fukasawa |
e60969 |
@# define PNG_NO_CONVERT_tIME
|
|
fukasawa |
e60969 |
@#endif
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_FILTER requires WRITE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option SAVE_INT_32 disabled
|
|
fukasawa |
e60969 |
# png_save_int_32 is required internally for writing the ancillary chunks oFFs
|
|
fukasawa |
e60969 |
# and pCAL and for both reading and writing iCCP (for the generation/checking of
|
|
fukasawa |
e60969 |
# the corresponding cHRM/gAMA chunks) if full ICC is supported.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# added at libpng-1.5.4
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_OPTIMIZE_CMF requires WRITE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option READ_COMPRESSED_TEXT disabled
|
|
fukasawa |
e60969 |
option READ_iCCP enables READ_COMPRESSED_TEXT
|
|
fukasawa |
e60969 |
option READ_iTXt enables READ_COMPRESSED_TEXT
|
|
fukasawa |
e60969 |
option READ_zTXt enables READ_COMPRESSED_TEXT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_oFFs enables SAVE_INT_32
|
|
fukasawa |
e60969 |
option WRITE_pCAL enables SAVE_INT_32
|
|
fukasawa |
e60969 |
option WRITE_cHRM enables SAVE_INT_32
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option WRITE_COMPRESSED_TEXT disabled
|
|
fukasawa |
e60969 |
option WRITE_iCCP enables WRITE_COMPRESSED_TEXT
|
|
fukasawa |
e60969 |
option WRITE_iTXt enables WRITE_COMPRESSED_TEXT
|
|
fukasawa |
e60969 |
option WRITE_zTXt enables WRITE_COMPRESSED_TEXT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Turn this off to disable png_read_png() and png_write_png() and
|
|
fukasawa |
e60969 |
# leave the row_pointers member out of the info structure.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option INFO_IMAGE
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# added at libpng-1.5.10
|
|
fukasawa |
e60969 |
# Turn this off to disable warning about invalid palette index and
|
|
fukasawa |
e60969 |
# leave the num_palette_max member out of the png structure.
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option CHECK_FOR_INVALID_INDEX enables READ_CHECK_FOR_INVALID_INDEX
|
|
fukasawa |
e60969 |
option CHECK_FOR_INVALID_INDEX enables WRITE_CHECK_FOR_INVALID_INDEX
|
|
fukasawa |
e60969 |
option READ_CHECK_FOR_INVALID_INDEX requires READ, CHECK_FOR_INVALID_INDEX
|
|
fukasawa |
e60969 |
option WRITE_CHECK_FOR_INVALID_INDEX requires WRITE, CHECK_FOR_INVALID_INDEX
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# added at libpng-1.5.15
|
|
fukasawa |
e60969 |
option GET_PALETTE_MAX enables READ_GET_PALETTE_MAX WRITE_GET_PALETTE_MAX
|
|
fukasawa |
e60969 |
option READ_GET_PALETTE_MAX requires READ_CHECK_FOR_INVALID_INDEX disabled
|
|
fukasawa |
e60969 |
option WRITE_GET_PALETTE_MAX requires WRITE_CHECK_FOR_INVALID_INDEX disabled
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Simplified API options (added at libpng-1.6.0)
|
|
fukasawa |
e60969 |
# In libpng 1.6.8 the handling of these options was changed to used 'requires'
|
|
fukasawa |
e60969 |
# throughout, so that disabling some of the low level support always disables
|
|
fukasawa |
e60969 |
# the base simplified read/write API. This much simplifies the handling and
|
|
fukasawa |
e60969 |
# makes 'everything = off' work in a more intuitive way. It eliminates a
|
|
fukasawa |
e60969 |
# previously reported feature that APIs previously enabled by the simplified
|
|
fukasawa |
e60969 |
# API couldn't be turned off without explicitly turning off the simplified
|
|
fukasawa |
e60969 |
# APIs.
|
|
fukasawa |
e60969 |
#
|
|
fukasawa |
e60969 |
# Read:
|
|
fukasawa |
e60969 |
option SIMPLIFIED_READ,
|
|
fukasawa |
e60969 |
requires SEQUENTIAL_READ, READ_TRANSFORMS, SETJMP, BENIGN_ERRORS,
|
|
fukasawa |
e60969 |
READ_EXPAND, READ_16BIT, READ_EXPAND_16, READ_SCALE_16_TO_8,
|
|
fukasawa |
e60969 |
READ_RGB_TO_GRAY, READ_ALPHA_MODE, READ_BACKGROUND, READ_STRIP_ALPHA,
|
|
fukasawa |
e60969 |
READ_FILLER, READ_SWAP, READ_PACK, READ_GRAY_TO_RGB, READ_GAMMA,
|
|
fukasawa |
e60969 |
READ_tRNS, READ_bKGD, READ_gAMA, READ_cHRM, READ_sRGB, READ_sBIT
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# AFIRST and BGR read options:
|
|
fukasawa |
e60969 |
# Prior to libpng 1.6.8 these were disabled but switched on if the low level
|
|
fukasawa |
e60969 |
# libpng routines that do the swaps were enabled. This worked but was
|
|
fukasawa |
e60969 |
# confusing. In libpng 1.6.8 the options were changed to simple 'requires'
|
|
fukasawa |
e60969 |
# and are enabled by default. This should work the same way in practice.
|
|
fukasawa |
e60969 |
option SIMPLIFIED_READ_AFIRST enables FORMAT_AFIRST,
|
|
fukasawa |
e60969 |
requires SIMPLIFIED_READ READ_SWAP_ALPHA
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option SIMPLIFIED_READ_BGR enables FORMAT_BGR,
|
|
fukasawa |
e60969 |
requires SIMPLIFIED_READ READ_BGR
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Write:
|
|
fukasawa |
e60969 |
option SIMPLIFIED_WRITE,
|
|
fukasawa |
e60969 |
requires WRITE STDIO, SETJMP, WRITE_SWAP, WRITE_PACK,
|
|
fukasawa |
e60969 |
WRITE_tRNS, WRITE_gAMA, WRITE_sRGB, WRITE_cHRM
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option SIMPLIFIED_WRITE_AFIRST enables FORMAT_AFIRST,
|
|
fukasawa |
e60969 |
requires SIMPLIFIED_WRITE WRITE_SWAP_ALPHA
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
option SIMPLIFIED_WRITE_BGR enables FORMAT_BGR,
|
|
fukasawa |
e60969 |
requires SIMPLIFIED_WRITE WRITE_BGR
|
|
fukasawa |
e60969 |
|
|
fukasawa |
e60969 |
# Formats:
|
|
fukasawa |
e60969 |
option FORMAT_AFIRST disabled
|
|
fukasawa |
e60969 |
option FORMAT_BGR disabled
|