pngconf.h revision 0
0N/A/*
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation. Sun designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/A * by Sun in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A * CA 95054 USA or visit www.sun.com if you need additional information or
0N/A * have any questions.
0N/A */
0N/A
0N/A/* pngconf.h - machine configurable file for libpng
0N/A *
0N/A * This file is available under and governed by the GNU General Public
0N/A * License version 2 only, as published by the Free Software Foundation.
0N/A * However, the following notice accompanied the original version of this
0N/A * file and, per its terms, should not be removed:
0N/A *
0N/A * libpng version 1.2.18 - May 15, 2007
0N/A * For conditions of distribution and use, see copyright notice in png.h
0N/A * Copyright (c) 1998-2007 Glenn Randers-Pehrson
0N/A * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
0N/A * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
0N/A */
0N/A
0N/A/* Any machine specific code is near the front of this file, so if you
0N/A * are configuring libpng for a machine, you may want to read the section
0N/A * starting here down to where it starts to typedef png_color, png_text,
0N/A * and png_info.
0N/A */
0N/A
0N/A#ifndef PNGCONF_H
0N/A#define PNGCONF_H
0N/A
0N/A#define PNG_1_2_X
0N/A
0N/A/*
0N/A * PNG_USER_CONFIG has to be defined on the compiler command line. This
0N/A * includes the resource compiler for Windows DLL configurations.
0N/A */
0N/A#ifdef PNG_USER_CONFIG
0N/A# ifndef PNG_USER_PRIVATEBUILD
0N/A# define PNG_USER_PRIVATEBUILD
0N/A# endif
0N/A#include "pngusr.h"
0N/A#endif
0N/A
0N/A/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
0N/A#ifdef PNG_CONFIGURE_LIBPNG
0N/A#ifdef HAVE_CONFIG_H
0N/A#include "config.h"
0N/A#endif
0N/A#endif
0N/A
0N/A/*
0N/A * Added at libpng-1.2.8
0N/A *
0N/A * If you create a private DLL you need to define in "pngusr.h" the followings:
0N/A * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
0N/A * the DLL was built>
0N/A * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
0N/A * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
0N/A * distinguish your DLL from those of the official release. These
0N/A * correspond to the trailing letters that come after the version
0N/A * number and must match your private DLL name>
0N/A * e.g. // private DLL "libpng13gx.dll"
0N/A * #define PNG_USER_DLLFNAME_POSTFIX "gx"
0N/A *
0N/A * The following macros are also at your disposal if you want to complete the
0N/A * DLL VERSIONINFO structure.
0N/A * - PNG_USER_VERSIONINFO_COMMENTS
0N/A * - PNG_USER_VERSIONINFO_COMPANYNAME
0N/A * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
0N/A */
0N/A
0N/A#ifdef __STDC__
0N/A#ifdef SPECIALBUILD
0N/A# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
0N/A are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
0N/A#endif
0N/A
0N/A#ifdef PRIVATEBUILD
0N/A# pragma message("PRIVATEBUILD is deprecated.\
0N/A Use PNG_USER_PRIVATEBUILD instead.")
0N/A# define PNG_USER_PRIVATEBUILD PRIVATEBUILD
0N/A#endif
0N/A#endif /* __STDC__ */
0N/A
0N/A#ifndef PNG_VERSION_INFO_ONLY
0N/A
0N/A/* End of material added to libpng-1.2.8 */
0N/A
0N/A/* This is the size of the compression buffer, and thus the size of
0N/A * an IDAT chunk. Make this whatever size you feel is best for your
0N/A * machine. One of these will be allocated per png_struct. When this
0N/A * is full, it writes the data to the disk, and does some other
0N/A * calculations. Making this an extremely small size will slow
0N/A * the library down, but you may want to experiment to determine
0N/A * where it becomes significant, if you are concerned with memory
0N/A * usage. Note that zlib allocates at least 32Kb also. For readers,
0N/A * this describes the size of the buffer available to read the data in.
0N/A * Unless this gets smaller than the size of a row (compressed),
0N/A * it should not make much difference how big this is.
0N/A */
0N/A
0N/A#ifndef PNG_ZBUF_SIZE
0N/A# define PNG_ZBUF_SIZE 8192
0N/A#endif
0N/A
0N/A/* Enable if you want a write-only libpng */
0N/A
0N/A#ifndef PNG_NO_READ_SUPPORTED
0N/A# define PNG_READ_SUPPORTED
0N/A#endif
0N/A
0N/A/* Enable if you want a read-only libpng */
0N/A
0N/A#ifndef PNG_NO_WRITE_SUPPORTED
0N/A# define PNG_WRITE_SUPPORTED
0N/A#endif
0N/A
0N/A/* Enabled by default in 1.2.0. You can disable this if you don't need to
0N/A support PNGs that are embedded in MNG datastreams */
0N/A#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
0N/A# ifndef PNG_MNG_FEATURES_SUPPORTED
0N/A# define PNG_MNG_FEATURES_SUPPORTED
0N/A# endif
0N/A#endif
0N/A
0N/A#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
0N/A# ifndef PNG_FLOATING_POINT_SUPPORTED
0N/A# define PNG_FLOATING_POINT_SUPPORTED
0N/A# endif
0N/A#endif
0N/A
0N/A/* If you are running on a machine where you cannot allocate more
0N/A * than 64K of memory at once, uncomment this. While libpng will not
0N/A * normally need that much memory in a chunk (unless you load up a very
0N/A * large file), zlib needs to know how big of a chunk it can use, and
0N/A * libpng thus makes sure to check any memory allocation to verify it
0N/A * will fit into memory.
0N/A#define PNG_MAX_MALLOC_64K
0N/A */
0N/A#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
0N/A# define PNG_MAX_MALLOC_64K
0N/A#endif
0N/A
0N/A/* Special munging to support doing things the 'cygwin' way:
0N/A * 'Normal' png-on-win32 defines/defaults:
0N/A * PNG_BUILD_DLL -- building dll
0N/A * PNG_USE_DLL -- building an application, linking to dll
0N/A * (no define) -- building static library, or building an
0N/A * application and linking to the static lib
0N/A * 'Cygwin' defines/defaults:
0N/A * PNG_BUILD_DLL -- (ignored) building the dll
0N/A * (no define) -- (ignored) building an application, linking to the dll
0N/A * PNG_STATIC -- (ignored) building the static lib, or building an
0N/A * application that links to the static lib.
0N/A * ALL_STATIC -- (ignored) building various static libs, or building an
0N/A * application that links to the static libs.
0N/A * Thus,
0N/A * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
0N/A * this bit of #ifdefs will define the 'correct' config variables based on
0N/A * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
0N/A * unnecessary.
0N/A *
0N/A * Also, the precedence order is:
0N/A * ALL_STATIC (since we can't #undef something outside our namespace)
0N/A * PNG_BUILD_DLL
0N/A * PNG_STATIC
0N/A * (nothing) == PNG_USE_DLL
0N/A *
0N/A * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
0N/A * of auto-import in binutils, we no longer need to worry about
0N/A * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
0N/A * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
0N/A * to __declspec() stuff. However, we DO need to worry about
0N/A * PNG_BUILD_DLL and PNG_STATIC because those change some defaults
0N/A * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
0N/A */
0N/A#if defined(__CYGWIN__)
0N/A# if defined(ALL_STATIC)
0N/A# if defined(PNG_BUILD_DLL)
0N/A# undef PNG_BUILD_DLL
0N/A# endif
0N/A# if defined(PNG_USE_DLL)
0N/A# undef PNG_USE_DLL
0N/A# endif
0N/A# if defined(PNG_DLL)
0N/A# undef PNG_DLL
0N/A# endif
0N/A# if !defined(PNG_STATIC)
0N/A# define PNG_STATIC
0N/A# endif
0N/A# else
0N/A# if defined (PNG_BUILD_DLL)
0N/A# if defined(PNG_STATIC)
0N/A# undef PNG_STATIC
0N/A# endif
0N/A# if defined(PNG_USE_DLL)
0N/A# undef PNG_USE_DLL
0N/A# endif
0N/A# if !defined(PNG_DLL)
0N/A# define PNG_DLL
0N/A# endif
0N/A# else
0N/A# if defined(PNG_STATIC)
0N/A# if defined(PNG_USE_DLL)
0N/A# undef PNG_USE_DLL
0N/A# endif
0N/A# if defined(PNG_DLL)
0N/A# undef PNG_DLL
0N/A# endif
0N/A# else
0N/A# if !defined(PNG_USE_DLL)
0N/A# define PNG_USE_DLL
0N/A# endif
0N/A# if !defined(PNG_DLL)
0N/A# define PNG_DLL
0N/A# endif
0N/A# endif
0N/A# endif
0N/A# endif
0N/A#endif
0N/A
0N/A/* This protects us against compilers that run on a windowing system
0N/A * and thus don't have or would rather us not use the stdio types:
0N/A * stdin, stdout, and stderr. The only one currently used is stderr
0N/A * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
0N/A * prevent these from being compiled and used. #defining PNG_NO_STDIO
0N/A * will also prevent these, plus will prevent the entire set of stdio
0N/A * macros and functions (FILE *, printf, etc.) from being compiled and used,
0N/A * unless (PNG_DEBUG > 0) has been #defined.
0N/A *
0N/A * #define PNG_NO_CONSOLE_IO
0N/A * #define PNG_NO_STDIO
0N/A */
0N/A
0N/A#if defined(_WIN32_WCE)
0N/A# include <windows.h>
0N/A /* Console I/O functions are not supported on WindowsCE */
0N/A# define PNG_NO_CONSOLE_IO
0N/A# ifdef PNG_DEBUG
0N/A# undef PNG_DEBUG
0N/A# endif
0N/A#endif
0N/A
0N/A#ifdef PNG_BUILD_DLL
0N/A# ifndef PNG_CONSOLE_IO_SUPPORTED
0N/A# ifndef PNG_NO_CONSOLE_IO
0N/A# define PNG_NO_CONSOLE_IO
0N/A# endif
0N/A# endif
0N/A#endif
0N/A
0N/A# ifdef PNG_NO_STDIO
0N/A# ifndef PNG_NO_CONSOLE_IO
0N/A# define PNG_NO_CONSOLE_IO
0N/A# endif
0N/A# ifdef PNG_DEBUG
0N/A# if (PNG_DEBUG > 0)
0N/A# include <stdio.h>
0N/A# endif
0N/A# endif
0N/A# else
0N/A# if !defined(_WIN32_WCE)
0N/A/* "stdio.h" functions are not supported on WindowsCE */
0N/A# include <stdio.h>
0N/A# endif
0N/A# endif
0N/A
0N/A/* This macro protects us against machines that don't have function
0N/A * prototypes (ie K&R style headers). If your compiler does not handle
0N/A * function prototypes, define this macro and use the included ansi2knr.
0N/A * I've always been able to use _NO_PROTO as the indicator, but you may
0N/A * need to drag the empty declaration out in front of here, or change the
0N/A * ifdef to suit your own needs.
0N/A */
0N/A#ifndef PNGARG
0N/A
0N/A#ifdef OF /* zlib prototype munger */
0N/A# define PNGARG(arglist) OF(arglist)
0N/A#else
0N/A
0N/A#ifdef _NO_PROTO
0N/A# define PNGARG(arglist) ()
0N/A# ifndef PNG_TYPECAST_NULL
0N/A# define PNG_TYPECAST_NULL
0N/A# endif
0N/A#else
0N/A# define PNGARG(arglist) arglist
0N/A#endif /* _NO_PROTO */
0N/A
0N/A#endif /* OF */
0N/A
0N/A#endif /* PNGARG */
0N/A
0N/A/* Try to determine if we are compiling on a Mac. Note that testing for
0N/A * just __MWERKS__ is not good enough, because the Codewarrior is now used
0N/A * on non-Mac platforms.
0N/A */
0N/A#ifndef MACOS
0N/A# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
0N/A defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
0N/A# define MACOS
0N/A# endif
0N/A#endif
0N/A
0N/A/* enough people need this for various reasons to include it here */
0N/A#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
0N/A# include <sys/types.h>
0N/A#endif
0N/A
0N/A#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
0N/A# define PNG_SETJMP_SUPPORTED
0N/A#endif
0N/A
0N/A#ifdef PNG_SETJMP_SUPPORTED
0N/A/* This is an attempt to force a single setjmp behaviour on Linux. If
0N/A * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
0N/A */
0N/A
0N/A# ifdef __linux__
0N/A# ifdef _BSD_SOURCE
0N/A# define PNG_SAVE_BSD_SOURCE
0N/A# undef _BSD_SOURCE
0N/A# endif
0N/A# ifdef _SETJMP_H
0N/A /* If you encounter a compiler error here, see the explanation
0N/A * near the end of INSTALL.
0N/A */
0N/A __png.h__ already includes setjmp.h;
0N/A __dont__ include it again.;
0N/A# endif
0N/A# endif /* __linux__ */
0N/A
0N/A /* include setjmp.h for error handling */
0N/A# include <setjmp.h>
0N/A
0N/A# ifdef __linux__
0N/A# ifdef PNG_SAVE_BSD_SOURCE
0N/A# define _BSD_SOURCE
0N/A# undef PNG_SAVE_BSD_SOURCE
0N/A# endif
0N/A# endif /* __linux__ */
0N/A#endif /* PNG_SETJMP_SUPPORTED */
0N/A
0N/A#ifdef BSD
0N/A# include <strings.h>
0N/A#else
0N/A# include <string.h>
0N/A#endif
0N/A
0N/A/* Other defines for things like memory and the like can go here. */
0N/A#ifdef PNG_INTERNAL
0N/A
0N/A#include <stdlib.h>
0N/A
0N/A/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
0N/A * aren't usually used outside the library (as far as I know), so it is
0N/A * debatable if they should be exported at all. In the future, when it is
0N/A * possible to have run-time registry of chunk-handling functions, some of
0N/A * these will be made available again.
0N/A#define PNG_EXTERN extern
0N/A */
0N/A#define PNG_EXTERN
0N/A
0N/A/* Other defines specific to compilers can go here. Try to keep
0N/A * them inside an appropriate ifdef/endif pair for portability.
0N/A */
0N/A
0N/A#if defined(PNG_FLOATING_POINT_SUPPORTED)
0N/A# if defined(MACOS)
0N/A /* We need to check that <math.h> hasn't already been included earlier
0N/A * as it seems it doesn't agree with <fp.h>, yet we should really use
0N/A * <fp.h> if possible.
0N/A */
0N/A# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
0N/A# include <fp.h>
0N/A# endif
0N/A# else
0N/A# include <math.h>
0N/A# endif
0N/A# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
0N/A /* Amiga SAS/C: We must include builtin FPU functions when compiling using
0N/A * MATH=68881
0N/A */
0N/A# include <m68881.h>
0N/A# endif
0N/A#endif
0N/A
0N/A/* Codewarrior on NT has linking problems without this. */
0N/A#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
0N/A# define PNG_ALWAYS_EXTERN
0N/A#endif
0N/A
0N/A/* This provides the non-ANSI (far) memory allocation routines. */
0N/A#if defined(__TURBOC__) && defined(__MSDOS__)
0N/A# include <mem.h>
0N/A# include <alloc.h>
0N/A#endif
0N/A
0N/A/* I have no idea why is this necessary... */
0N/A#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
0N/A defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
0N/A# include <malloc.h>
0N/A#endif
0N/A
0N/A/* This controls how fine the dithering gets. As this allocates
0N/A * a largish chunk of memory (32K), those who are not as concerned
0N/A * with dithering quality can decrease some or all of these.
0N/A */
0N/A#ifndef PNG_DITHER_RED_BITS
0N/A# define PNG_DITHER_RED_BITS 5
0N/A#endif
0N/A#ifndef PNG_DITHER_GREEN_BITS
0N/A# define PNG_DITHER_GREEN_BITS 5
0N/A#endif
0N/A#ifndef PNG_DITHER_BLUE_BITS
0N/A# define PNG_DITHER_BLUE_BITS 5
0N/A#endif
0N/A
0N/A/* This controls how fine the gamma correction becomes when you
0N/A * are only interested in 8 bits anyway. Increasing this value
0N/A * results in more memory being used, and more pow() functions
0N/A * being called to fill in the gamma tables. Don't set this value
0N/A * less then 8, and even that may not work (I haven't tested it).
0N/A */
0N/A
0N/A#ifndef PNG_MAX_GAMMA_8
0N/A# define PNG_MAX_GAMMA_8 11
0N/A#endif
0N/A
0N/A/* This controls how much a difference in gamma we can tolerate before
0N/A * we actually start doing gamma conversion.
0N/A */
0N/A#ifndef PNG_GAMMA_THRESHOLD
0N/A# define PNG_GAMMA_THRESHOLD 0.05
0N/A#endif
0N/A
0N/A#endif /* PNG_INTERNAL */
0N/A
0N/A/* The following uses const char * instead of char * for error
0N/A * and warning message functions, so some compilers won't complain.
0N/A * If you do not want to use const, define PNG_NO_CONST here.
0N/A */
0N/A
0N/A#ifndef PNG_NO_CONST
0N/A# define PNG_CONST const
0N/A#else
0N/A# define PNG_CONST
0N/A#endif
0N/A
0N/A/* The following defines give you the ability to remove code from the
0N/A * library that you will not be using. I wish I could figure out how to
0N/A * automate this, but I can't do that without making it seriously hard
0N/A * on the users. So if you are not using an ability, change the #define
0N/A * to and #undef, and that part of the library will not be compiled. If
0N/A * your linker can't find a function, you may want to make sure the
0N/A * ability is defined here. Some of these depend upon some others being
0N/A * defined. I haven't figured out all the interactions here, so you may
0N/A * have to experiment awhile to get everything to compile. If you are
0N/A * creating or using a shared library, you probably shouldn't touch this,
0N/A * as it will affect the size of the structures, and this will cause bad
0N/A * things to happen if the library and/or application ever change.
0N/A */
0N/A
0N/A/* Any features you will not be using can be undef'ed here */
0N/A
0N/A/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
0N/A * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
0N/A * on the compile line, then pick and choose which ones to define without
0N/A * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
0N/A * if you only want to have a png-compliant reader/writer but don't need
0N/A * any of the extra transformations. This saves about 80 kbytes in a
0N/A * typical installation of the library. (PNG_NO_* form added in version
0N/A * 1.0.1c, for consistency)
0N/A */
0N/A
0N/A/* The size of the png_text structure changed in libpng-1.0.6 when
0N/A * iTXt support was added. iTXt support was turned off by default through
0N/A * libpng-1.2.x, to support old apps that malloc the png_text structure
0N/A * instead of calling png_set_text() and letting libpng malloc it. It
0N/A * was turned on by default in libpng-1.3.0.
0N/A */
0N/A
0N/A#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
0N/A# ifndef PNG_NO_iTXt_SUPPORTED
0N/A# define PNG_NO_iTXt_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_iTXt
0N/A# define PNG_NO_READ_iTXt
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_iTXt
0N/A# define PNG_NO_WRITE_iTXt
0N/A# endif
0N/A#endif
0N/A
0N/A#if !defined(PNG_NO_iTXt_SUPPORTED)
0N/A# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
0N/A# define PNG_READ_iTXt
0N/A# endif
0N/A# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
0N/A# define PNG_WRITE_iTXt
0N/A# endif
0N/A#endif
0N/A
0N/A/* The following support, added after version 1.0.0, can be turned off here en
0N/A * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
0N/A * with old applications that require the length of png_struct and png_info
0N/A * to remain unchanged.
0N/A */
0N/A
0N/A#ifdef PNG_LEGACY_SUPPORTED
0N/A# define PNG_NO_FREE_ME
0N/A# define PNG_NO_READ_UNKNOWN_CHUNKS
0N/A# define PNG_NO_WRITE_UNKNOWN_CHUNKS
0N/A# define PNG_NO_READ_USER_CHUNKS
0N/A# define PNG_NO_READ_iCCP
0N/A# define PNG_NO_WRITE_iCCP
0N/A# define PNG_NO_READ_iTXt
0N/A# define PNG_NO_WRITE_iTXt
0N/A# define PNG_NO_READ_sCAL
0N/A# define PNG_NO_WRITE_sCAL
0N/A# define PNG_NO_READ_sPLT
0N/A# define PNG_NO_WRITE_sPLT
0N/A# define PNG_NO_INFO_IMAGE
0N/A# define PNG_NO_READ_RGB_TO_GRAY
0N/A# define PNG_NO_READ_USER_TRANSFORM
0N/A# define PNG_NO_WRITE_USER_TRANSFORM
0N/A# define PNG_NO_USER_MEM
0N/A# define PNG_NO_READ_EMPTY_PLTE
0N/A# define PNG_NO_MNG_FEATURES
0N/A# define PNG_NO_FIXED_POINT_SUPPORTED
0N/A#endif
0N/A
0N/A/* Ignore attempt to turn off both floating and fixed point support */
0N/A#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
0N/A !defined(PNG_NO_FIXED_POINT_SUPPORTED)
0N/A# define PNG_FIXED_POINT_SUPPORTED
0N/A#endif
0N/A
0N/A#ifndef PNG_NO_FREE_ME
0N/A# define PNG_FREE_ME_SUPPORTED
0N/A#endif
0N/A
0N/A#if defined(PNG_READ_SUPPORTED)
0N/A
0N/A#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
0N/A !defined(PNG_NO_READ_TRANSFORMS)
0N/A# define PNG_READ_TRANSFORMS_SUPPORTED
0N/A#endif
0N/A
0N/A#ifdef PNG_READ_TRANSFORMS_SUPPORTED
0N/A# ifndef PNG_NO_READ_EXPAND
0N/A# define PNG_READ_EXPAND_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_SHIFT
0N/A# define PNG_READ_SHIFT_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_PACK
0N/A# define PNG_READ_PACK_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_BGR
0N/A# define PNG_READ_BGR_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_SWAP
0N/A# define PNG_READ_SWAP_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_PACKSWAP
0N/A# define PNG_READ_PACKSWAP_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_INVERT
0N/A# define PNG_READ_INVERT_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_DITHER
0N/A# define PNG_READ_DITHER_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_BACKGROUND
0N/A# define PNG_READ_BACKGROUND_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_16_TO_8
0N/A# define PNG_READ_16_TO_8_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_FILLER
0N/A# define PNG_READ_FILLER_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_GAMMA
0N/A# define PNG_READ_GAMMA_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_GRAY_TO_RGB
0N/A# define PNG_READ_GRAY_TO_RGB_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_SWAP_ALPHA
0N/A# define PNG_READ_SWAP_ALPHA_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_INVERT_ALPHA
0N/A# define PNG_READ_INVERT_ALPHA_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_STRIP_ALPHA
0N/A# define PNG_READ_STRIP_ALPHA_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_USER_TRANSFORM
0N/A# define PNG_READ_USER_TRANSFORM_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_READ_RGB_TO_GRAY
0N/A# define PNG_READ_RGB_TO_GRAY_SUPPORTED
0N/A# endif
0N/A#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
0N/A
0N/A#if !defined(PNG_NO_PROGRESSIVE_READ) && \
0N/A !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */
0N/A# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
0N/A#endif /* about interlacing capability! You'll */
0N/A /* still have interlacing unless you change the following line: */
0N/A
0N/A#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
0N/A
0N/A#ifndef PNG_NO_READ_COMPOSITE_NODIV
0N/A# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
0N/A# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */
0N/A# endif
0N/A#endif
0N/A
0N/A#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
0N/A/* Deprecated, will be removed from version 2.0.0.
0N/A Use PNG_MNG_FEATURES_SUPPORTED instead. */
0N/A#ifndef PNG_NO_READ_EMPTY_PLTE
0N/A# define PNG_READ_EMPTY_PLTE_SUPPORTED
0N/A#endif
0N/A#endif
0N/A
0N/A#endif /* PNG_READ_SUPPORTED */
0N/A
0N/A#if defined(PNG_WRITE_SUPPORTED)
0N/A
0N/A# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
0N/A !defined(PNG_NO_WRITE_TRANSFORMS)
0N/A# define PNG_WRITE_TRANSFORMS_SUPPORTED
0N/A#endif
0N/A
0N/A#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
0N/A# ifndef PNG_NO_WRITE_SHIFT
0N/A# define PNG_WRITE_SHIFT_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_PACK
0N/A# define PNG_WRITE_PACK_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_BGR
0N/A# define PNG_WRITE_BGR_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_SWAP
0N/A# define PNG_WRITE_SWAP_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_PACKSWAP
0N/A# define PNG_WRITE_PACKSWAP_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_INVERT
0N/A# define PNG_WRITE_INVERT_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_FILLER
0N/A# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_SWAP_ALPHA
0N/A# define PNG_WRITE_SWAP_ALPHA_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_INVERT_ALPHA
0N/A# define PNG_WRITE_INVERT_ALPHA_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_WRITE_USER_TRANSFORM
0N/A# define PNG_WRITE_USER_TRANSFORM_SUPPORTED
0N/A# endif
0N/A#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
0N/A
0N/A#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
0N/A !defined(PNG_WRITE_INTERLACING_SUPPORTED)
0N/A#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
0N/A encoders, but can cause trouble
0N/A if left undefined */
0N/A#endif
0N/A
0N/A#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
0N/A !defined(PNG_WRITE_WEIGHTED_FILTER) && \
0N/A defined(PNG_FLOATING_POINT_SUPPORTED)
0N/A# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
0N/A#endif
0N/A
0N/A#ifndef PNG_NO_WRITE_FLUSH
0N/A# define PNG_WRITE_FLUSH_SUPPORTED
0N/A#endif
0N/A
0N/A#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
0N/A/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
0N/A#ifndef PNG_NO_WRITE_EMPTY_PLTE
0N/A# define PNG_WRITE_EMPTY_PLTE_SUPPORTED
0N/A#endif
0N/A#endif
0N/A
0N/A#endif /* PNG_WRITE_SUPPORTED */
0N/A
0N/A#ifndef PNG_1_0_X
0N/A# ifndef PNG_NO_ERROR_NUMBERS
0N/A# define PNG_ERROR_NUMBERS_SUPPORTED
0N/A# endif
0N/A#endif /* PNG_1_0_X */
0N/A
0N/A#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
0N/A defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
0N/A# ifndef PNG_NO_USER_TRANSFORM_PTR
0N/A# define PNG_USER_TRANSFORM_PTR_SUPPORTED
0N/A# endif
0N/A#endif
0N/A
0N/A#ifndef PNG_NO_STDIO
0N/A# define PNG_TIME_RFC1123_SUPPORTED
0N/A#endif
0N/A
0N/A/* This adds extra functions in pngget.c for accessing data from the
0N/A * info pointer (added in version 0.99)
0N/A * png_get_image_width()
0N/A * png_get_image_height()
0N/A * png_get_bit_depth()
0N/A * png_get_color_type()
0N/A * png_get_compression_type()
0N/A * png_get_filter_type()
0N/A * png_get_interlace_type()
0N/A * png_get_pixel_aspect_ratio()
0N/A * png_get_pixels_per_meter()
0N/A * png_get_x_offset_pixels()
0N/A * png_get_y_offset_pixels()
0N/A * png_get_x_offset_microns()
0N/A * png_get_y_offset_microns()
0N/A */
0N/A#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
0N/A# define PNG_EASY_ACCESS_SUPPORTED
0N/A#endif
0N/A
0N/A/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
0N/A * even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined.
0N/A *
0N/A * PNG_NO_ASSEMBLER_CODE disables use of all assembler code and optimized C,
0N/A * and removes or includes several functions in the API.
0N/A *
0N/A * PNG_NO_MMX_CODE disables the use of MMX code without changing the API.
0N/A * When MMX code is off, then optimized C replacement functions are used.
0N/A*/
0N/A#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
0N/A# ifndef PNG_ASSEMBLER_CODE_SUPPORTED
0N/A# define PNG_ASSEMBLER_CODE_SUPPORTED
0N/A# endif
0N/A# if defined(XP_MACOSX) && !defined(PNG_NO_MMX_CODE)
0N/A /* work around Intel-Mac compiler bug */
0N/A# define PNG_NO_MMX_CODE
0N/A# endif
0N/A# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) && \
0N/A defined(__MMX__)
0N/A# define PNG_MMX_CODE_SUPPORTED
0N/A# endif
0N/A# if !defined(PNG_USE_PNGGCCRD) && !defined(PNG_NO_MMX_CODE) && \
0N/A !defined(PNG_USE_PNGVCRD) && defined(__MMX__)
0N/A# define PNG_USE_PNGGCCRD
0N/A# endif
0N/A#endif
0N/A
0N/A/* If you are sure that you don't need thread safety and you are compiling
0N/A with PNG_USE_PNGCCRD for an MMX application, you can define this for
0N/A faster execution. See pnggccrd.c.
0N/A#define PNG_THREAD_UNSAFE_OK
0N/A*/
0N/A
0N/A#if !defined(PNG_1_0_X)
0N/A#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
0N/A# define PNG_USER_MEM_SUPPORTED
0N/A#endif
0N/A#endif /* PNG_1_0_X */
0N/A
0N/A/* Added at libpng-1.2.6 */
0N/A#if !defined(PNG_1_0_X)
0N/A#ifndef PNG_SET_USER_LIMITS_SUPPORTED
0N/A#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
0N/A# define PNG_SET_USER_LIMITS_SUPPORTED
0N/A#endif
0N/A#endif
0N/A#endif /* PNG_1_0_X */
0N/A
0N/A/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
0N/A * how large, set these limits to 0x7fffffffL
0N/A */
0N/A#ifndef PNG_USER_WIDTH_MAX
0N/A# define PNG_USER_WIDTH_MAX 1000000L
0N/A#endif
0N/A#ifndef PNG_USER_HEIGHT_MAX
0N/A# define PNG_USER_HEIGHT_MAX 1000000L
0N/A#endif
0N/A
0N/A/* These are currently experimental features, define them if you want */
0N/A
0N/A/* very little testing */
0N/A/*
0N/A#ifdef PNG_READ_SUPPORTED
0N/A# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
0N/A# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
0N/A# endif
0N/A#endif
0N/A*/
0N/A
0N/A/* This is only for PowerPC big-endian and 680x0 systems */
0N/A/* some testing */
0N/A/*
0N/A#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
0N/A# define PNG_READ_BIG_ENDIAN_SUPPORTED
0N/A#endif
0N/A*/
0N/A
0N/A/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
0N/A/*
0N/A#define PNG_NO_POINTER_INDEXING
0N/A*/
0N/A
0N/A/* These functions are turned off by default, as they will be phased out. */
0N/A/*
0N/A#define PNG_USELESS_TESTS_SUPPORTED
0N/A#define PNG_CORRECT_PALETTE_SUPPORTED
0N/A*/
0N/A
0N/A/* Any chunks you are not interested in, you can undef here. The
0N/A * ones that allocate memory may be expecially important (hIST,
0N/A * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
0N/A * a bit smaller.
0N/A */
0N/A
0N/A#if defined(PNG_READ_SUPPORTED) && \
0N/A !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
0N/A !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
0N/A# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
0N/A#endif
0N/A
0N/A#if defined(PNG_WRITE_SUPPORTED) && \
0N/A !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
0N/A !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
0N/A# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
0N/A#endif
0N/A
0N/A#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
0N/A
0N/A#ifdef PNG_NO_READ_TEXT
0N/A# define PNG_NO_READ_iTXt
0N/A# define PNG_NO_READ_tEXt
0N/A# define PNG_NO_READ_zTXt
0N/A#endif
0N/A#ifndef PNG_NO_READ_bKGD
0N/A# define PNG_READ_bKGD_SUPPORTED
0N/A# define PNG_bKGD_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_cHRM
0N/A# define PNG_READ_cHRM_SUPPORTED
0N/A# define PNG_cHRM_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_gAMA
0N/A# define PNG_READ_gAMA_SUPPORTED
0N/A# define PNG_gAMA_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_hIST
0N/A# define PNG_READ_hIST_SUPPORTED
0N/A# define PNG_hIST_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_iCCP
0N/A# define PNG_READ_iCCP_SUPPORTED
0N/A# define PNG_iCCP_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_iTXt
0N/A# ifndef PNG_READ_iTXt_SUPPORTED
0N/A# define PNG_READ_iTXt_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_iTXt_SUPPORTED
0N/A# define PNG_iTXt_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_READ_oFFs
0N/A# define PNG_READ_oFFs_SUPPORTED
0N/A# define PNG_oFFs_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_pCAL
0N/A# define PNG_READ_pCAL_SUPPORTED
0N/A# define PNG_pCAL_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_sCAL
0N/A# define PNG_READ_sCAL_SUPPORTED
0N/A# define PNG_sCAL_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_pHYs
0N/A# define PNG_READ_pHYs_SUPPORTED
0N/A# define PNG_pHYs_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_sBIT
0N/A# define PNG_READ_sBIT_SUPPORTED
0N/A# define PNG_sBIT_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_sPLT
0N/A# define PNG_READ_sPLT_SUPPORTED
0N/A# define PNG_sPLT_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_sRGB
0N/A# define PNG_READ_sRGB_SUPPORTED
0N/A# define PNG_sRGB_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_tEXt
0N/A# define PNG_READ_tEXt_SUPPORTED
0N/A# define PNG_tEXt_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_tIME
0N/A# define PNG_READ_tIME_SUPPORTED
0N/A# define PNG_tIME_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_tRNS
0N/A# define PNG_READ_tRNS_SUPPORTED
0N/A# define PNG_tRNS_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_zTXt
0N/A# define PNG_READ_zTXt_SUPPORTED
0N/A# define PNG_zTXt_SUPPORTED
0N/A#endif
0N/A#ifndef PNG_NO_READ_UNKNOWN_CHUNKS
0N/A# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
0N/A# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
0N/A# define PNG_UNKNOWN_CHUNKS_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_HANDLE_AS_UNKNOWN
0N/A# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#if !defined(PNG_NO_READ_USER_CHUNKS) && \
0N/A defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
0N/A# define PNG_READ_USER_CHUNKS_SUPPORTED
0N/A# define PNG_USER_CHUNKS_SUPPORTED
0N/A# ifdef PNG_NO_READ_UNKNOWN_CHUNKS
0N/A# undef PNG_NO_READ_UNKNOWN_CHUNKS
0N/A# endif
0N/A# ifdef PNG_NO_HANDLE_AS_UNKNOWN
0N/A# undef PNG_NO_HANDLE_AS_UNKNOWN
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_READ_OPT_PLTE
0N/A# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
0N/A#endif /* optional PLTE chunk in RGB and RGBA images */
0N/A#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
0N/A defined(PNG_READ_zTXt_SUPPORTED)
0N/A# define PNG_READ_TEXT_SUPPORTED
0N/A# define PNG_TEXT_SUPPORTED
0N/A#endif
0N/A
0N/A#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
0N/A
0N/A#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
0N/A
0N/A#ifdef PNG_NO_WRITE_TEXT
0N/A# define PNG_NO_WRITE_iTXt
0N/A# define PNG_NO_WRITE_tEXt
0N/A# define PNG_NO_WRITE_zTXt
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_bKGD
0N/A# define PNG_WRITE_bKGD_SUPPORTED
0N/A# ifndef PNG_bKGD_SUPPORTED
0N/A# define PNG_bKGD_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_cHRM
0N/A# define PNG_WRITE_cHRM_SUPPORTED
0N/A# ifndef PNG_cHRM_SUPPORTED
0N/A# define PNG_cHRM_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_gAMA
0N/A# define PNG_WRITE_gAMA_SUPPORTED
0N/A# ifndef PNG_gAMA_SUPPORTED
0N/A# define PNG_gAMA_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_hIST
0N/A# define PNG_WRITE_hIST_SUPPORTED
0N/A# ifndef PNG_hIST_SUPPORTED
0N/A# define PNG_hIST_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_iCCP
0N/A# define PNG_WRITE_iCCP_SUPPORTED
0N/A# ifndef PNG_iCCP_SUPPORTED
0N/A# define PNG_iCCP_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_iTXt
0N/A# ifndef PNG_WRITE_iTXt_SUPPORTED
0N/A# define PNG_WRITE_iTXt_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_iTXt_SUPPORTED
0N/A# define PNG_iTXt_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_oFFs
0N/A# define PNG_WRITE_oFFs_SUPPORTED
0N/A# ifndef PNG_oFFs_SUPPORTED
0N/A# define PNG_oFFs_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_pCAL
0N/A# define PNG_WRITE_pCAL_SUPPORTED
0N/A# ifndef PNG_pCAL_SUPPORTED
0N/A# define PNG_pCAL_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_sCAL
0N/A# define PNG_WRITE_sCAL_SUPPORTED
0N/A# ifndef PNG_sCAL_SUPPORTED
0N/A# define PNG_sCAL_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_pHYs
0N/A# define PNG_WRITE_pHYs_SUPPORTED
0N/A# ifndef PNG_pHYs_SUPPORTED
0N/A# define PNG_pHYs_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_sBIT
0N/A# define PNG_WRITE_sBIT_SUPPORTED
0N/A# ifndef PNG_sBIT_SUPPORTED
0N/A# define PNG_sBIT_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_sPLT
0N/A# define PNG_WRITE_sPLT_SUPPORTED
0N/A# ifndef PNG_sPLT_SUPPORTED
0N/A# define PNG_sPLT_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_sRGB
0N/A# define PNG_WRITE_sRGB_SUPPORTED
0N/A# ifndef PNG_sRGB_SUPPORTED
0N/A# define PNG_sRGB_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_tEXt
0N/A# define PNG_WRITE_tEXt_SUPPORTED
0N/A# ifndef PNG_tEXt_SUPPORTED
0N/A# define PNG_tEXt_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_tIME
0N/A# define PNG_WRITE_tIME_SUPPORTED
0N/A# ifndef PNG_tIME_SUPPORTED
0N/A# define PNG_tIME_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_tRNS
0N/A# define PNG_WRITE_tRNS_SUPPORTED
0N/A# ifndef PNG_tRNS_SUPPORTED
0N/A# define PNG_tRNS_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_zTXt
0N/A# define PNG_WRITE_zTXt_SUPPORTED
0N/A# ifndef PNG_zTXt_SUPPORTED
0N/A# define PNG_zTXt_SUPPORTED
0N/A# endif
0N/A#endif
0N/A#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
0N/A# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
0N/A# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
0N/A# define PNG_UNKNOWN_CHUNKS_SUPPORTED
0N/A# endif
0N/A# ifndef PNG_NO_HANDLE_AS_UNKNOWN
0N/A# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
0N/A# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
0N/A# endif
0N/A# endif
0N/A#endif
0N/A#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
0N/A defined(PNG_WRITE_zTXt_SUPPORTED)
0N/A# define PNG_WRITE_TEXT_SUPPORTED
0N/A# ifndef PNG_TEXT_SUPPORTED
0N/A# define PNG_TEXT_SUPPORTED
0N/A# endif
0N/A#endif
0N/A
0N/A#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
0N/A
0N/A/* Turn this off to disable png_read_png() and
0N/A * png_write_png() and leave the row_pointers member
0N/A * out of the info structure.
0N/A */
0N/A#ifndef PNG_NO_INFO_IMAGE
0N/A# define PNG_INFO_IMAGE_SUPPORTED
0N/A#endif
0N/A
0N/A/* need the time information for reading tIME chunks */
0N/A#if defined(PNG_tIME_SUPPORTED)
0N/A# if !defined(_WIN32_WCE)
0N/A /* "time.h" functions are not supported on WindowsCE */
0N/A# include <time.h>
0N/A# endif
0N/A#endif
0N/A
0N/A/* Some typedefs to get us started. These should be safe on most of the
0N/A * common platforms. The typedefs should be at least as large as the
0N/A * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
0N/A * don't have to be exactly that size. Some compilers dislike passing
0N/A * unsigned shorts as function parameters, so you may be better off using
0N/A * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may
0N/A * want to have unsigned int for png_uint_32 instead of unsigned long.
0N/A */
0N/A
0N/Atypedef unsigned long png_uint_32;
0N/Atypedef long png_int_32;
0N/Atypedef unsigned short png_uint_16;
0N/Atypedef short png_int_16;
0N/Atypedef unsigned char png_byte;
0N/A
0N/A/* This is usually size_t. It is typedef'ed just in case you need it to
0N/A change (I'm not sure if you will or not, so I thought I'd be safe) */
0N/A#ifdef PNG_SIZE_T
0N/A typedef PNG_SIZE_T png_size_t;
0N/A# define png_sizeof(x) png_convert_size(sizeof (x))
0N/A#else
0N/A typedef size_t png_size_t;
0N/A# define png_sizeof(x) sizeof (x)
0N/A#endif
0N/A
0N/A/* The following is needed for medium model support. It cannot be in the
0N/A * PNG_INTERNAL section. Needs modification for other compilers besides
0N/A * MSC. Model independent support declares all arrays and pointers to be
0N/A * large using the far keyword. The zlib version used must also support
0N/A * model independent data. As of version zlib 1.0.4, the necessary changes
0N/A * have been made in zlib. The USE_FAR_KEYWORD define triggers other
0N/A * changes that are needed. (Tim Wegner)
0N/A */
0N/A
0N/A/* Separate compiler dependencies (problem here is that zlib.h always
0N/A defines FAR. (SJT) */
0N/A#ifdef __BORLANDC__
0N/A# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
0N/A# define LDATA 1
0N/A# else
0N/A# define LDATA 0
0N/A# endif
0N/A /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
0N/A# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
0N/A# define PNG_MAX_MALLOC_64K
0N/A# if (LDATA != 1)
0N/A# ifndef FAR
0N/A# define FAR __far
0N/A# endif
0N/A# define USE_FAR_KEYWORD
0N/A# endif /* LDATA != 1 */
0N/A /* Possibly useful for moving data out of default segment.
0N/A * Uncomment it if you want. Could also define FARDATA as
0N/A * const if your compiler supports it. (SJT)
0N/A# define FARDATA FAR
0N/A */
0N/A# endif /* __WIN32__, __FLAT__, __CYGWIN__ */
0N/A#endif /* __BORLANDC__ */
0N/A
0N/A
0N/A/* Suggest testing for specific compiler first before testing for
0N/A * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
0N/A * making reliance oncertain keywords suspect. (SJT)
0N/A */
0N/A
0N/A/* MSC Medium model */
0N/A#if defined(FAR)
0N/A# if defined(M_I86MM)
0N/A# define USE_FAR_KEYWORD
0N/A# define FARDATA FAR
0N/A# include <dos.h>
0N/A# endif
0N/A#endif
0N/A
0N/A/* SJT: default case */
0N/A#ifndef FAR
0N/A# define FAR
0N/A#endif
0N/A
0N/A/* At this point FAR is always defined */
0N/A#ifndef FARDATA
0N/A# define FARDATA
0N/A#endif
0N/A
0N/A/* Typedef for floating-point numbers that are converted
0N/A to fixed-point with a multiple of 100,000, e.g., int_gamma */
0N/Atypedef png_int_32 png_fixed_point;
0N/A
0N/A/* Add typedefs for pointers */
0N/Atypedef void FAR * png_voidp;
0N/Atypedef png_byte FAR * png_bytep;
0N/Atypedef png_uint_32 FAR * png_uint_32p;
0N/Atypedef png_int_32 FAR * png_int_32p;
0N/Atypedef png_uint_16 FAR * png_uint_16p;
0N/Atypedef png_int_16 FAR * png_int_16p;
0N/Atypedef PNG_CONST char FAR * png_const_charp;
0N/Atypedef char FAR * png_charp;
0N/Atypedef png_fixed_point FAR * png_fixed_point_p;
0N/A
0N/A#ifndef PNG_NO_STDIO
0N/A#if defined(_WIN32_WCE)
0N/Atypedef HANDLE png_FILE_p;
0N/A#else
0N/Atypedef FILE * png_FILE_p;
0N/A#endif
0N/A#endif
0N/A
0N/A#ifdef PNG_FLOATING_POINT_SUPPORTED
0N/Atypedef double FAR * png_doublep;
0N/A#endif
0N/A
0N/A/* Pointers to pointers; i.e. arrays */
0N/Atypedef png_byte FAR * FAR * png_bytepp;
0N/Atypedef png_uint_32 FAR * FAR * png_uint_32pp;
0N/Atypedef png_int_32 FAR * FAR * png_int_32pp;
0N/Atypedef png_uint_16 FAR * FAR * png_uint_16pp;
0N/Atypedef png_int_16 FAR * FAR * png_int_16pp;
0N/Atypedef PNG_CONST char FAR * FAR * png_const_charpp;
0N/Atypedef char FAR * FAR * png_charpp;
0N/Atypedef png_fixed_point FAR * FAR * png_fixed_point_pp;
0N/A#ifdef PNG_FLOATING_POINT_SUPPORTED
0N/Atypedef double FAR * FAR * png_doublepp;
0N/A#endif
0N/A
0N/A/* Pointers to pointers to pointers; i.e., pointer to array */
0N/Atypedef char FAR * FAR * FAR * png_charppp;
0N/A
0N/A#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
0N/A/* SPC - Is this stuff deprecated? */
0N/A/* It'll be removed as of libpng-1.3.0 - GR-P */
0N/A/* libpng typedefs for types in zlib. If zlib changes
0N/A * or another compression library is used, then change these.
0N/A * Eliminates need to change all the source files.
0N/A */
0N/Atypedef charf * png_zcharp;
0N/Atypedef charf * FAR * png_zcharpp;
0N/Atypedef z_stream FAR * png_zstreamp;
0N/A#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
0N/A
0N/A/*
0N/A * Define PNG_BUILD_DLL if the module being built is a Windows
0N/A * LIBPNG DLL.
0N/A *
0N/A * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
0N/A * It is equivalent to Microsoft predefined macro _DLL that is
0N/A * automatically defined when you compile using the share
0N/A * version of the CRT (C Run-Time library)
0N/A *
0N/A * The cygwin mods make this behavior a little different:
0N/A * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
0N/A * Define PNG_STATIC if you are building a static library for use with cygwin,
0N/A * -or- if you are building an application that you want to link to the
0N/A * static library.
0N/A * PNG_USE_DLL is defined by default (no user action needed) unless one of
0N/A * the other flags is defined.
0N/A */
0N/A
0N/A#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
0N/A# define PNG_DLL
0N/A#endif
0N/A/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
0N/A * When building a static lib, default to no GLOBAL ARRAYS, but allow
0N/A * command-line override
0N/A */
0N/A#if defined(__CYGWIN__)
0N/A# if !defined(PNG_STATIC)
0N/A# if defined(PNG_USE_GLOBAL_ARRAYS)
0N/A# undef PNG_USE_GLOBAL_ARRAYS
0N/A# endif
0N/A# if !defined(PNG_USE_LOCAL_ARRAYS)
0N/A# define PNG_USE_LOCAL_ARRAYS
0N/A# endif
0N/A# else
0N/A# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
0N/A# if defined(PNG_USE_GLOBAL_ARRAYS)
0N/A# undef PNG_USE_GLOBAL_ARRAYS
0N/A# endif
0N/A# endif
0N/A# endif
0N/A# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
0N/A# define PNG_USE_LOCAL_ARRAYS
0N/A# endif
0N/A#endif
0N/A
0N/A/* Do not use global arrays (helps with building DLL's)
0N/A * They are no longer used in libpng itself, since version 1.0.5c,
0N/A * but might be required for some pre-1.0.5c applications.
0N/A */
0N/A#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
0N/A# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL))
0N/A# define PNG_USE_LOCAL_ARRAYS
0N/A# else
0N/A# define PNG_USE_GLOBAL_ARRAYS
0N/A# endif
0N/A#endif
0N/A
0N/A#if defined(__CYGWIN__)
0N/A# undef PNGAPI
0N/A# define PNGAPI __cdecl
0N/A# undef PNG_IMPEXP
0N/A# define PNG_IMPEXP
0N/A#endif
0N/A
0N/A/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
0N/A * you may get warnings regarding the linkage of png_zalloc and png_zfree.
0N/A * Don't ignore those warnings; you must also reset the default calling
0N/A * convention in your compiler to match your PNGAPI, and you must build
0N/A * zlib and your applications the same way you build libpng.
0N/A */
0N/A
0N/A#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
0N/A# ifndef PNG_NO_MODULEDEF
0N/A# define PNG_NO_MODULEDEF
0N/A# endif
0N/A#endif
0N/A
0N/A#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
0N/A# define PNG_IMPEXP
0N/A#endif
0N/A
0N/A#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
0N/A (( defined(_Windows) || defined(_WINDOWS) || \
0N/A defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
0N/A
0N/A# ifndef PNGAPI
0N/A# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
0N/A# define PNGAPI __cdecl
0N/A# else
0N/A# define PNGAPI _cdecl
0N/A# endif
0N/A# endif
0N/A
0N/A# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
0N/A 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
0N/A# define PNG_IMPEXP
0N/A# endif
0N/A
0N/A# if !defined(PNG_IMPEXP)
0N/A
0N/A# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
0N/A# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
0N/A
0N/A /* Borland/Microsoft */
0N/A# if defined(_MSC_VER) || defined(__BORLANDC__)
0N/A# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
0N/A# define PNG_EXPORT PNG_EXPORT_TYPE1
0N/A# else
0N/A# define PNG_EXPORT PNG_EXPORT_TYPE2
0N/A# if defined(PNG_BUILD_DLL)
0N/A# define PNG_IMPEXP __export
0N/A# else
0N/A# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
0N/A VC++ */
0N/A# endif /* Exists in Borland C++ for
0N/A C++ classes (== huge) */
0N/A# endif
0N/A# endif
0N/A
0N/A# if !defined(PNG_IMPEXP)
0N/A# if defined(PNG_BUILD_DLL)
0N/A# define PNG_IMPEXP __declspec(dllexport)
0N/A# else
0N/A# define PNG_IMPEXP __declspec(dllimport)
0N/A# endif
0N/A# endif
0N/A# endif /* PNG_IMPEXP */
0N/A#else /* !(DLL || non-cygwin WINDOWS) */
0N/A# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
0N/A# ifndef PNGAPI
0N/A# define PNGAPI _System
0N/A# endif
0N/A# else
0N/A# if 0 /* ... other platforms, with other meanings */
0N/A# endif
0N/A# endif
0N/A#endif
0N/A
0N/A#ifndef PNGAPI
0N/A# define PNGAPI
0N/A#endif
0N/A#ifndef PNG_IMPEXP
0N/A# define PNG_IMPEXP
0N/A#endif
0N/A
0N/A#ifdef PNG_BUILDSYMS
0N/A# ifndef PNG_EXPORT
0N/A# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
0N/A# endif
0N/A# ifdef PNG_USE_GLOBAL_ARRAYS
0N/A# ifndef PNG_EXPORT_VAR
0N/A# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
0N/A# endif
0N/A# endif
0N/A#endif
0N/A
0N/A#ifndef PNG_EXPORT
0N/A# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
0N/A#endif
0N/A
0N/A#ifdef PNG_USE_GLOBAL_ARRAYS
0N/A# ifndef PNG_EXPORT_VAR
0N/A# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
0N/A# endif
0N/A#endif
0N/A
0N/A/* User may want to use these so they are not in PNG_INTERNAL. Any library
0N/A * functions that are passed far data must be model independent.
0N/A */
0N/A
0N/A#ifndef PNG_ABORT
0N/A# define PNG_ABORT() abort()
0N/A#endif
0N/A
0N/A#ifdef PNG_SETJMP_SUPPORTED
0N/A# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
0N/A#else
0N/A# define png_jmpbuf(png_ptr) \
0N/A (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
0N/A#endif
0N/A
0N/A#if defined(USE_FAR_KEYWORD) /* memory model independent fns */
0N/A/* use this to make far-to-near assignments */
0N/A# define CHECK 1
0N/A# define NOCHECK 0
0N/A# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
0N/A# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
0N/A# define png_strcpy _fstrcpy
0N/A# define png_strncpy _fstrncpy /* Added to v 1.2.6 */
0N/A# define png_strlen _fstrlen
0N/A# define png_memcmp _fmemcmp /* SJT: added */
0N/A# define png_memcpy _fmemcpy
0N/A# define png_memset _fmemset
0N/A#else /* use the usual functions */
0N/A# define CVT_PTR(ptr) (ptr)
0N/A# define CVT_PTR_NOCHECK(ptr) (ptr)
0N/A# define png_strcpy strcpy
0N/A# define png_strncpy strncpy /* Added to v 1.2.6 */
0N/A# define png_strlen strlen
0N/A# define png_memcmp memcmp /* SJT: added */
0N/A# define png_memcpy memcpy
0N/A# define png_memset memset
0N/A#endif
0N/A/* End of memory model independent support */
0N/A
0N/A/* Just a little check that someone hasn't tried to define something
0N/A * contradictory.
0N/A */
0N/A#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
0N/A# undef PNG_ZBUF_SIZE
0N/A# define PNG_ZBUF_SIZE 65536L
0N/A#endif
0N/A
0N/A#ifdef PNG_READ_SUPPORTED
0N/A/* Prior to libpng-1.0.9, this block was in pngasmrd.h */
0N/A#if defined(PNG_INTERNAL)
0N/A
0N/A/* These are the default thresholds before the MMX code kicks in; if either
0N/A * rowbytes or bitdepth is below the threshold, plain C code is used. These
0N/A * can be overridden at runtime via the png_set_mmx_thresholds() call in
0N/A * libpng 1.2.0 and later. The values below were chosen by Intel.
0N/A */
0N/A
0N/A#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
0N/A# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */
0N/A#endif
0N/A#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
0N/A# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */
0N/A#endif
0N/A
0N/A/* Set this in the makefile for VC++ on Pentium, not here. */
0N/A/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c .
0N/A * MMX will be detected at run time and used if present.
0N/A */
0N/A#ifdef PNG_USE_PNGVCRD
0N/A# define PNG_HAVE_MMX_COMBINE_ROW
0N/A# define PNG_HAVE_MMX_READ_INTERLACE
0N/A# define PNG_HAVE_MMX_READ_FILTER_ROW
0N/A#endif
0N/A
0N/A/* Set this in the makefile for gcc/as on Pentium, not here. */
0N/A/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c .
0N/A * MMX will be detected at run time and used if present.
0N/A */
0N/A#ifdef PNG_USE_PNGGCCRD
0N/A# define PNG_HAVE_MMX_COMBINE_ROW
0N/A# define PNG_HAVE_MMX_READ_INTERLACE
0N/A# define PNG_HAVE_MMX_READ_FILTER_ROW
0N/A#endif
0N/A/* - see pnggccrd.c for info about what is currently enabled */
0N/A
0N/A#endif /* PNG_INTERNAL */
0N/A#endif /* PNG_READ_SUPPORTED */
0N/A
0N/A/* Added at libpng-1.2.8 */
0N/A#endif /* PNG_VERSION_INFO_ONLY */
0N/A
0N/A#endif /* PNGCONF_H */