3dphotoshoot

annotate libs/libpng/pngconf.h @ 14:06dc8b9b4f89

added libimago, libjpeg and libpng
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 07 Jun 2015 17:25:49 +0300
parents
children
rev   line source
nuclear@14 1
nuclear@14 2 /* pngconf.h - machine configurable file for libpng
nuclear@14 3 *
nuclear@14 4 * libpng version 1.2.33 - October 31, 2008
nuclear@14 5 * For conditions of distribution and use, see copyright notice in png.h
nuclear@14 6 * Copyright (c) 1998-2008 Glenn Randers-Pehrson
nuclear@14 7 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
nuclear@14 8 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
nuclear@14 9 */
nuclear@14 10
nuclear@14 11 /* Any machine specific code is near the front of this file, so if you
nuclear@14 12 * are configuring libpng for a machine, you may want to read the section
nuclear@14 13 * starting here down to where it starts to typedef png_color, png_text,
nuclear@14 14 * and png_info.
nuclear@14 15 */
nuclear@14 16
nuclear@14 17 #ifndef PNGCONF_H
nuclear@14 18 #define PNGCONF_H
nuclear@14 19
nuclear@14 20 #define PNG_1_2_X
nuclear@14 21
nuclear@14 22 /*
nuclear@14 23 * PNG_USER_CONFIG has to be defined on the compiler command line. This
nuclear@14 24 * includes the resource compiler for Windows DLL configurations.
nuclear@14 25 */
nuclear@14 26 #ifdef PNG_USER_CONFIG
nuclear@14 27 # ifndef PNG_USER_PRIVATEBUILD
nuclear@14 28 # define PNG_USER_PRIVATEBUILD
nuclear@14 29 # endif
nuclear@14 30 #include "pngusr.h"
nuclear@14 31 #endif
nuclear@14 32
nuclear@14 33 /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
nuclear@14 34 #ifdef PNG_CONFIGURE_LIBPNG
nuclear@14 35 #ifdef HAVE_CONFIG_H
nuclear@14 36 #include "config.h"
nuclear@14 37 #endif
nuclear@14 38 #endif
nuclear@14 39
nuclear@14 40 /*
nuclear@14 41 * Added at libpng-1.2.8
nuclear@14 42 *
nuclear@14 43 * If you create a private DLL you need to define in "pngusr.h" the followings:
nuclear@14 44 * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
nuclear@14 45 * the DLL was built>
nuclear@14 46 * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
nuclear@14 47 * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
nuclear@14 48 * distinguish your DLL from those of the official release. These
nuclear@14 49 * correspond to the trailing letters that come after the version
nuclear@14 50 * number and must match your private DLL name>
nuclear@14 51 * e.g. // private DLL "libpng13gx.dll"
nuclear@14 52 * #define PNG_USER_DLLFNAME_POSTFIX "gx"
nuclear@14 53 *
nuclear@14 54 * The following macros are also at your disposal if you want to complete the
nuclear@14 55 * DLL VERSIONINFO structure.
nuclear@14 56 * - PNG_USER_VERSIONINFO_COMMENTS
nuclear@14 57 * - PNG_USER_VERSIONINFO_COMPANYNAME
nuclear@14 58 * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
nuclear@14 59 */
nuclear@14 60
nuclear@14 61 #ifdef __STDC__
nuclear@14 62 #ifdef SPECIALBUILD
nuclear@14 63 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
nuclear@14 64 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
nuclear@14 65 #endif
nuclear@14 66
nuclear@14 67 #ifdef PRIVATEBUILD
nuclear@14 68 # pragma message("PRIVATEBUILD is deprecated.\
nuclear@14 69 Use PNG_USER_PRIVATEBUILD instead.")
nuclear@14 70 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
nuclear@14 71 #endif
nuclear@14 72 #endif /* __STDC__ */
nuclear@14 73
nuclear@14 74 #ifndef PNG_VERSION_INFO_ONLY
nuclear@14 75
nuclear@14 76 /* End of material added to libpng-1.2.8 */
nuclear@14 77
nuclear@14 78 /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble
nuclear@14 79 Restored at libpng-1.2.21 */
nuclear@14 80 #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \
nuclear@14 81 !defined(PNG_WARN_UNINITIALIZED_ROW)
nuclear@14 82 # define PNG_WARN_UNINITIALIZED_ROW 1
nuclear@14 83 #endif
nuclear@14 84 /* End of material added at libpng-1.2.19/1.2.21 */
nuclear@14 85
nuclear@14 86 /* This is the size of the compression buffer, and thus the size of
nuclear@14 87 * an IDAT chunk. Make this whatever size you feel is best for your
nuclear@14 88 * machine. One of these will be allocated per png_struct. When this
nuclear@14 89 * is full, it writes the data to the disk, and does some other
nuclear@14 90 * calculations. Making this an extremely small size will slow
nuclear@14 91 * the library down, but you may want to experiment to determine
nuclear@14 92 * where it becomes significant, if you are concerned with memory
nuclear@14 93 * usage. Note that zlib allocates at least 32Kb also. For readers,
nuclear@14 94 * this describes the size of the buffer available to read the data in.
nuclear@14 95 * Unless this gets smaller than the size of a row (compressed),
nuclear@14 96 * it should not make much difference how big this is.
nuclear@14 97 */
nuclear@14 98
nuclear@14 99 #ifndef PNG_ZBUF_SIZE
nuclear@14 100 # define PNG_ZBUF_SIZE 8192
nuclear@14 101 #endif
nuclear@14 102
nuclear@14 103 /* Enable if you want a write-only libpng */
nuclear@14 104
nuclear@14 105 #ifndef PNG_NO_READ_SUPPORTED
nuclear@14 106 # define PNG_READ_SUPPORTED
nuclear@14 107 #endif
nuclear@14 108
nuclear@14 109 /* Enable if you want a read-only libpng */
nuclear@14 110
nuclear@14 111 #ifndef PNG_NO_WRITE_SUPPORTED
nuclear@14 112 # define PNG_WRITE_SUPPORTED
nuclear@14 113 #endif
nuclear@14 114
nuclear@14 115 /* Enabled by default in 1.2.0. You can disable this if you don't need to
nuclear@14 116 support PNGs that are embedded in MNG datastreams */
nuclear@14 117 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
nuclear@14 118 # ifndef PNG_MNG_FEATURES_SUPPORTED
nuclear@14 119 # define PNG_MNG_FEATURES_SUPPORTED
nuclear@14 120 # endif
nuclear@14 121 #endif
nuclear@14 122
nuclear@14 123 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
nuclear@14 124 # ifndef PNG_FLOATING_POINT_SUPPORTED
nuclear@14 125 # define PNG_FLOATING_POINT_SUPPORTED
nuclear@14 126 # endif
nuclear@14 127 #endif
nuclear@14 128
nuclear@14 129 /* If you are running on a machine where you cannot allocate more
nuclear@14 130 * than 64K of memory at once, uncomment this. While libpng will not
nuclear@14 131 * normally need that much memory in a chunk (unless you load up a very
nuclear@14 132 * large file), zlib needs to know how big of a chunk it can use, and
nuclear@14 133 * libpng thus makes sure to check any memory allocation to verify it
nuclear@14 134 * will fit into memory.
nuclear@14 135 #define PNG_MAX_MALLOC_64K
nuclear@14 136 */
nuclear@14 137 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
nuclear@14 138 # define PNG_MAX_MALLOC_64K
nuclear@14 139 #endif
nuclear@14 140
nuclear@14 141 /* Special munging to support doing things the 'cygwin' way:
nuclear@14 142 * 'Normal' png-on-win32 defines/defaults:
nuclear@14 143 * PNG_BUILD_DLL -- building dll
nuclear@14 144 * PNG_USE_DLL -- building an application, linking to dll
nuclear@14 145 * (no define) -- building static library, or building an
nuclear@14 146 * application and linking to the static lib
nuclear@14 147 * 'Cygwin' defines/defaults:
nuclear@14 148 * PNG_BUILD_DLL -- (ignored) building the dll
nuclear@14 149 * (no define) -- (ignored) building an application, linking to the dll
nuclear@14 150 * PNG_STATIC -- (ignored) building the static lib, or building an
nuclear@14 151 * application that links to the static lib.
nuclear@14 152 * ALL_STATIC -- (ignored) building various static libs, or building an
nuclear@14 153 * application that links to the static libs.
nuclear@14 154 * Thus,
nuclear@14 155 * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
nuclear@14 156 * this bit of #ifdefs will define the 'correct' config variables based on
nuclear@14 157 * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
nuclear@14 158 * unnecessary.
nuclear@14 159 *
nuclear@14 160 * Also, the precedence order is:
nuclear@14 161 * ALL_STATIC (since we can't #undef something outside our namespace)
nuclear@14 162 * PNG_BUILD_DLL
nuclear@14 163 * PNG_STATIC
nuclear@14 164 * (nothing) == PNG_USE_DLL
nuclear@14 165 *
nuclear@14 166 * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
nuclear@14 167 * of auto-import in binutils, we no longer need to worry about
nuclear@14 168 * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
nuclear@14 169 * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
nuclear@14 170 * to __declspec() stuff. However, we DO need to worry about
nuclear@14 171 * PNG_BUILD_DLL and PNG_STATIC because those change some defaults
nuclear@14 172 * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
nuclear@14 173 */
nuclear@14 174 #if defined(__CYGWIN__)
nuclear@14 175 # if defined(ALL_STATIC)
nuclear@14 176 # if defined(PNG_BUILD_DLL)
nuclear@14 177 # undef PNG_BUILD_DLL
nuclear@14 178 # endif
nuclear@14 179 # if defined(PNG_USE_DLL)
nuclear@14 180 # undef PNG_USE_DLL
nuclear@14 181 # endif
nuclear@14 182 # if defined(PNG_DLL)
nuclear@14 183 # undef PNG_DLL
nuclear@14 184 # endif
nuclear@14 185 # if !defined(PNG_STATIC)
nuclear@14 186 # define PNG_STATIC
nuclear@14 187 # endif
nuclear@14 188 # else
nuclear@14 189 # if defined (PNG_BUILD_DLL)
nuclear@14 190 # if defined(PNG_STATIC)
nuclear@14 191 # undef PNG_STATIC
nuclear@14 192 # endif
nuclear@14 193 # if defined(PNG_USE_DLL)
nuclear@14 194 # undef PNG_USE_DLL
nuclear@14 195 # endif
nuclear@14 196 # if !defined(PNG_DLL)
nuclear@14 197 # define PNG_DLL
nuclear@14 198 # endif
nuclear@14 199 # else
nuclear@14 200 # if defined(PNG_STATIC)
nuclear@14 201 # if defined(PNG_USE_DLL)
nuclear@14 202 # undef PNG_USE_DLL
nuclear@14 203 # endif
nuclear@14 204 # if defined(PNG_DLL)
nuclear@14 205 # undef PNG_DLL
nuclear@14 206 # endif
nuclear@14 207 # else
nuclear@14 208 # if !defined(PNG_USE_DLL)
nuclear@14 209 # define PNG_USE_DLL
nuclear@14 210 # endif
nuclear@14 211 # if !defined(PNG_DLL)
nuclear@14 212 # define PNG_DLL
nuclear@14 213 # endif
nuclear@14 214 # endif
nuclear@14 215 # endif
nuclear@14 216 # endif
nuclear@14 217 #endif
nuclear@14 218
nuclear@14 219 /* This protects us against compilers that run on a windowing system
nuclear@14 220 * and thus don't have or would rather us not use the stdio types:
nuclear@14 221 * stdin, stdout, and stderr. The only one currently used is stderr
nuclear@14 222 * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
nuclear@14 223 * prevent these from being compiled and used. #defining PNG_NO_STDIO
nuclear@14 224 * will also prevent these, plus will prevent the entire set of stdio
nuclear@14 225 * macros and functions (FILE *, printf, etc.) from being compiled and used,
nuclear@14 226 * unless (PNG_DEBUG > 0) has been #defined.
nuclear@14 227 *
nuclear@14 228 * #define PNG_NO_CONSOLE_IO
nuclear@14 229 * #define PNG_NO_STDIO
nuclear@14 230 */
nuclear@14 231
nuclear@14 232 #if defined(_WIN32_WCE)
nuclear@14 233 # include <windows.h>
nuclear@14 234 /* Console I/O functions are not supported on WindowsCE */
nuclear@14 235 # define PNG_NO_CONSOLE_IO
nuclear@14 236 # ifdef PNG_DEBUG
nuclear@14 237 # undef PNG_DEBUG
nuclear@14 238 # endif
nuclear@14 239 #endif
nuclear@14 240
nuclear@14 241 #ifdef PNG_BUILD_DLL
nuclear@14 242 # ifndef PNG_CONSOLE_IO_SUPPORTED
nuclear@14 243 # ifndef PNG_NO_CONSOLE_IO
nuclear@14 244 # define PNG_NO_CONSOLE_IO
nuclear@14 245 # endif
nuclear@14 246 # endif
nuclear@14 247 #endif
nuclear@14 248
nuclear@14 249 # ifdef PNG_NO_STDIO
nuclear@14 250 # ifndef PNG_NO_CONSOLE_IO
nuclear@14 251 # define PNG_NO_CONSOLE_IO
nuclear@14 252 # endif
nuclear@14 253 # ifdef PNG_DEBUG
nuclear@14 254 # if (PNG_DEBUG > 0)
nuclear@14 255 # include <stdio.h>
nuclear@14 256 # endif
nuclear@14 257 # endif
nuclear@14 258 # else
nuclear@14 259 # if !defined(_WIN32_WCE)
nuclear@14 260 /* "stdio.h" functions are not supported on WindowsCE */
nuclear@14 261 # include <stdio.h>
nuclear@14 262 # endif
nuclear@14 263 # endif
nuclear@14 264
nuclear@14 265 /* This macro protects us against machines that don't have function
nuclear@14 266 * prototypes (ie K&R style headers). If your compiler does not handle
nuclear@14 267 * function prototypes, define this macro and use the included ansi2knr.
nuclear@14 268 * I've always been able to use _NO_PROTO as the indicator, but you may
nuclear@14 269 * need to drag the empty declaration out in front of here, or change the
nuclear@14 270 * ifdef to suit your own needs.
nuclear@14 271 */
nuclear@14 272 #ifndef PNGARG
nuclear@14 273
nuclear@14 274 #ifdef OF /* zlib prototype munger */
nuclear@14 275 # define PNGARG(arglist) OF(arglist)
nuclear@14 276 #else
nuclear@14 277
nuclear@14 278 #ifdef _NO_PROTO
nuclear@14 279 # define PNGARG(arglist) ()
nuclear@14 280 # ifndef PNG_TYPECAST_NULL
nuclear@14 281 # define PNG_TYPECAST_NULL
nuclear@14 282 # endif
nuclear@14 283 #else
nuclear@14 284 # define PNGARG(arglist) arglist
nuclear@14 285 #endif /* _NO_PROTO */
nuclear@14 286
nuclear@14 287
nuclear@14 288 #endif /* OF */
nuclear@14 289
nuclear@14 290 #endif /* PNGARG */
nuclear@14 291
nuclear@14 292 /* Try to determine if we are compiling on a Mac. Note that testing for
nuclear@14 293 * just __MWERKS__ is not good enough, because the Codewarrior is now used
nuclear@14 294 * on non-Mac platforms.
nuclear@14 295 */
nuclear@14 296 #ifndef MACOS
nuclear@14 297 # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
nuclear@14 298 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
nuclear@14 299 # define MACOS
nuclear@14 300 # endif
nuclear@14 301 #endif
nuclear@14 302
nuclear@14 303 /* enough people need this for various reasons to include it here */
nuclear@14 304 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
nuclear@14 305 # include <sys/types.h>
nuclear@14 306 #endif
nuclear@14 307
nuclear@14 308 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
nuclear@14 309 # define PNG_SETJMP_SUPPORTED
nuclear@14 310 #endif
nuclear@14 311
nuclear@14 312 #ifdef PNG_SETJMP_SUPPORTED
nuclear@14 313 /* This is an attempt to force a single setjmp behaviour on Linux. If
nuclear@14 314 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
nuclear@14 315 */
nuclear@14 316
nuclear@14 317 # ifdef __linux__
nuclear@14 318 # ifdef _BSD_SOURCE
nuclear@14 319 # define PNG_SAVE_BSD_SOURCE
nuclear@14 320 # undef _BSD_SOURCE
nuclear@14 321 # endif
nuclear@14 322 # ifdef _SETJMP_H
nuclear@14 323 /* If you encounter a compiler error here, see the explanation
nuclear@14 324 * near the end of INSTALL.
nuclear@14 325 */
nuclear@14 326 __pngconf.h__ already includes setjmp.h;
nuclear@14 327 __dont__ include it again.;
nuclear@14 328 # endif
nuclear@14 329 # endif /* __linux__ */
nuclear@14 330
nuclear@14 331 /* include setjmp.h for error handling */
nuclear@14 332 # include <setjmp.h>
nuclear@14 333
nuclear@14 334 # ifdef __linux__
nuclear@14 335 # ifdef PNG_SAVE_BSD_SOURCE
nuclear@14 336 # ifndef _BSD_SOURCE
nuclear@14 337 # define _BSD_SOURCE
nuclear@14 338 # endif
nuclear@14 339 # undef PNG_SAVE_BSD_SOURCE
nuclear@14 340 # endif
nuclear@14 341 # endif /* __linux__ */
nuclear@14 342 #endif /* PNG_SETJMP_SUPPORTED */
nuclear@14 343
nuclear@14 344 #ifdef BSD
nuclear@14 345 # include <strings.h>
nuclear@14 346 #else
nuclear@14 347 # include <string.h>
nuclear@14 348 #endif
nuclear@14 349
nuclear@14 350 /* Other defines for things like memory and the like can go here. */
nuclear@14 351 #ifdef PNG_INTERNAL
nuclear@14 352
nuclear@14 353 #include <stdlib.h>
nuclear@14 354
nuclear@14 355 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
nuclear@14 356 * aren't usually used outside the library (as far as I know), so it is
nuclear@14 357 * debatable if they should be exported at all. In the future, when it is
nuclear@14 358 * possible to have run-time registry of chunk-handling functions, some of
nuclear@14 359 * these will be made available again.
nuclear@14 360 #define PNG_EXTERN extern
nuclear@14 361 */
nuclear@14 362 #define PNG_EXTERN
nuclear@14 363
nuclear@14 364 /* Other defines specific to compilers can go here. Try to keep
nuclear@14 365 * them inside an appropriate ifdef/endif pair for portability.
nuclear@14 366 */
nuclear@14 367
nuclear@14 368 #if defined(PNG_FLOATING_POINT_SUPPORTED)
nuclear@14 369 # if defined(MACOS)
nuclear@14 370 /* We need to check that <math.h> hasn't already been included earlier
nuclear@14 371 * as it seems it doesn't agree with <fp.h>, yet we should really use
nuclear@14 372 * <fp.h> if possible.
nuclear@14 373 */
nuclear@14 374 # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
nuclear@14 375 # include <fp.h>
nuclear@14 376 # endif
nuclear@14 377 # else
nuclear@14 378 # include <math.h>
nuclear@14 379 # endif
nuclear@14 380 # if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
nuclear@14 381 /* Amiga SAS/C: We must include builtin FPU functions when compiling using
nuclear@14 382 * MATH=68881
nuclear@14 383 */
nuclear@14 384 # include <m68881.h>
nuclear@14 385 # endif
nuclear@14 386 #endif
nuclear@14 387
nuclear@14 388 /* Codewarrior on NT has linking problems without this. */
nuclear@14 389 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
nuclear@14 390 # define PNG_ALWAYS_EXTERN
nuclear@14 391 #endif
nuclear@14 392
nuclear@14 393 /* This provides the non-ANSI (far) memory allocation routines. */
nuclear@14 394 #if defined(__TURBOC__) && defined(__MSDOS__)
nuclear@14 395 # include <mem.h>
nuclear@14 396 # include <alloc.h>
nuclear@14 397 #endif
nuclear@14 398
nuclear@14 399 /* I have no idea why is this necessary... */
nuclear@14 400 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
nuclear@14 401 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
nuclear@14 402 # include <malloc.h>
nuclear@14 403 #endif
nuclear@14 404
nuclear@14 405 /* This controls how fine the dithering gets. As this allocates
nuclear@14 406 * a largish chunk of memory (32K), those who are not as concerned
nuclear@14 407 * with dithering quality can decrease some or all of these.
nuclear@14 408 */
nuclear@14 409 #ifndef PNG_DITHER_RED_BITS
nuclear@14 410 # define PNG_DITHER_RED_BITS 5
nuclear@14 411 #endif
nuclear@14 412 #ifndef PNG_DITHER_GREEN_BITS
nuclear@14 413 # define PNG_DITHER_GREEN_BITS 5
nuclear@14 414 #endif
nuclear@14 415 #ifndef PNG_DITHER_BLUE_BITS
nuclear@14 416 # define PNG_DITHER_BLUE_BITS 5
nuclear@14 417 #endif
nuclear@14 418
nuclear@14 419 /* This controls how fine the gamma correction becomes when you
nuclear@14 420 * are only interested in 8 bits anyway. Increasing this value
nuclear@14 421 * results in more memory being used, and more pow() functions
nuclear@14 422 * being called to fill in the gamma tables. Don't set this value
nuclear@14 423 * less then 8, and even that may not work (I haven't tested it).
nuclear@14 424 */
nuclear@14 425
nuclear@14 426 #ifndef PNG_MAX_GAMMA_8
nuclear@14 427 # define PNG_MAX_GAMMA_8 11
nuclear@14 428 #endif
nuclear@14 429
nuclear@14 430 /* This controls how much a difference in gamma we can tolerate before
nuclear@14 431 * we actually start doing gamma conversion.
nuclear@14 432 */
nuclear@14 433 #ifndef PNG_GAMMA_THRESHOLD
nuclear@14 434 # define PNG_GAMMA_THRESHOLD 0.05
nuclear@14 435 #endif
nuclear@14 436
nuclear@14 437 #endif /* PNG_INTERNAL */
nuclear@14 438
nuclear@14 439 /* The following uses const char * instead of char * for error
nuclear@14 440 * and warning message functions, so some compilers won't complain.
nuclear@14 441 * If you do not want to use const, define PNG_NO_CONST here.
nuclear@14 442 */
nuclear@14 443
nuclear@14 444 #ifndef PNG_NO_CONST
nuclear@14 445 # define PNG_CONST const
nuclear@14 446 #else
nuclear@14 447 # define PNG_CONST
nuclear@14 448 #endif
nuclear@14 449
nuclear@14 450 /* The following defines give you the ability to remove code from the
nuclear@14 451 * library that you will not be using. I wish I could figure out how to
nuclear@14 452 * automate this, but I can't do that without making it seriously hard
nuclear@14 453 * on the users. So if you are not using an ability, change the #define
nuclear@14 454 * to and #undef, and that part of the library will not be compiled. If
nuclear@14 455 * your linker can't find a function, you may want to make sure the
nuclear@14 456 * ability is defined here. Some of these depend upon some others being
nuclear@14 457 * defined. I haven't figured out all the interactions here, so you may
nuclear@14 458 * have to experiment awhile to get everything to compile. If you are
nuclear@14 459 * creating or using a shared library, you probably shouldn't touch this,
nuclear@14 460 * as it will affect the size of the structures, and this will cause bad
nuclear@14 461 * things to happen if the library and/or application ever change.
nuclear@14 462 */
nuclear@14 463
nuclear@14 464 /* Any features you will not be using can be undef'ed here */
nuclear@14 465
nuclear@14 466 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
nuclear@14 467 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
nuclear@14 468 * on the compile line, then pick and choose which ones to define without
nuclear@14 469 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
nuclear@14 470 * if you only want to have a png-compliant reader/writer but don't need
nuclear@14 471 * any of the extra transformations. This saves about 80 kbytes in a
nuclear@14 472 * typical installation of the library. (PNG_NO_* form added in version
nuclear@14 473 * 1.0.1c, for consistency)
nuclear@14 474 */
nuclear@14 475
nuclear@14 476 /* The size of the png_text structure changed in libpng-1.0.6 when
nuclear@14 477 * iTXt support was added. iTXt support was turned off by default through
nuclear@14 478 * libpng-1.2.x, to support old apps that malloc the png_text structure
nuclear@14 479 * instead of calling png_set_text() and letting libpng malloc it. It
nuclear@14 480 * was turned on by default in libpng-1.3.0.
nuclear@14 481 */
nuclear@14 482
nuclear@14 483 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
nuclear@14 484 # ifndef PNG_NO_iTXt_SUPPORTED
nuclear@14 485 # define PNG_NO_iTXt_SUPPORTED
nuclear@14 486 # endif
nuclear@14 487 # ifndef PNG_NO_READ_iTXt
nuclear@14 488 # define PNG_NO_READ_iTXt
nuclear@14 489 # endif
nuclear@14 490 # ifndef PNG_NO_WRITE_iTXt
nuclear@14 491 # define PNG_NO_WRITE_iTXt
nuclear@14 492 # endif
nuclear@14 493 #endif
nuclear@14 494
nuclear@14 495 #if !defined(PNG_NO_iTXt_SUPPORTED)
nuclear@14 496 # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
nuclear@14 497 # define PNG_READ_iTXt
nuclear@14 498 # endif
nuclear@14 499 # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
nuclear@14 500 # define PNG_WRITE_iTXt
nuclear@14 501 # endif
nuclear@14 502 #endif
nuclear@14 503
nuclear@14 504 /* The following support, added after version 1.0.0, can be turned off here en
nuclear@14 505 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
nuclear@14 506 * with old applications that require the length of png_struct and png_info
nuclear@14 507 * to remain unchanged.
nuclear@14 508 */
nuclear@14 509
nuclear@14 510 #ifdef PNG_LEGACY_SUPPORTED
nuclear@14 511 # define PNG_NO_FREE_ME
nuclear@14 512 # define PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@14 513 # define PNG_NO_WRITE_UNKNOWN_CHUNKS
nuclear@14 514 # define PNG_NO_READ_USER_CHUNKS
nuclear@14 515 # define PNG_NO_READ_iCCP
nuclear@14 516 # define PNG_NO_WRITE_iCCP
nuclear@14 517 # define PNG_NO_READ_iTXt
nuclear@14 518 # define PNG_NO_WRITE_iTXt
nuclear@14 519 # define PNG_NO_READ_sCAL
nuclear@14 520 # define PNG_NO_WRITE_sCAL
nuclear@14 521 # define PNG_NO_READ_sPLT
nuclear@14 522 # define PNG_NO_WRITE_sPLT
nuclear@14 523 # define PNG_NO_INFO_IMAGE
nuclear@14 524 # define PNG_NO_READ_RGB_TO_GRAY
nuclear@14 525 # define PNG_NO_READ_USER_TRANSFORM
nuclear@14 526 # define PNG_NO_WRITE_USER_TRANSFORM
nuclear@14 527 # define PNG_NO_USER_MEM
nuclear@14 528 # define PNG_NO_READ_EMPTY_PLTE
nuclear@14 529 # define PNG_NO_MNG_FEATURES
nuclear@14 530 # define PNG_NO_FIXED_POINT_SUPPORTED
nuclear@14 531 #endif
nuclear@14 532
nuclear@14 533 /* Ignore attempt to turn off both floating and fixed point support */
nuclear@14 534 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
nuclear@14 535 !defined(PNG_NO_FIXED_POINT_SUPPORTED)
nuclear@14 536 # define PNG_FIXED_POINT_SUPPORTED
nuclear@14 537 #endif
nuclear@14 538
nuclear@14 539 #ifndef PNG_NO_FREE_ME
nuclear@14 540 # define PNG_FREE_ME_SUPPORTED
nuclear@14 541 #endif
nuclear@14 542
nuclear@14 543 #if defined(PNG_READ_SUPPORTED)
nuclear@14 544
nuclear@14 545 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
nuclear@14 546 !defined(PNG_NO_READ_TRANSFORMS)
nuclear@14 547 # define PNG_READ_TRANSFORMS_SUPPORTED
nuclear@14 548 #endif
nuclear@14 549
nuclear@14 550 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
nuclear@14 551 # ifndef PNG_NO_READ_EXPAND
nuclear@14 552 # define PNG_READ_EXPAND_SUPPORTED
nuclear@14 553 # endif
nuclear@14 554 # ifndef PNG_NO_READ_SHIFT
nuclear@14 555 # define PNG_READ_SHIFT_SUPPORTED
nuclear@14 556 # endif
nuclear@14 557 # ifndef PNG_NO_READ_PACK
nuclear@14 558 # define PNG_READ_PACK_SUPPORTED
nuclear@14 559 # endif
nuclear@14 560 # ifndef PNG_NO_READ_BGR
nuclear@14 561 # define PNG_READ_BGR_SUPPORTED
nuclear@14 562 # endif
nuclear@14 563 # ifndef PNG_NO_READ_SWAP
nuclear@14 564 # define PNG_READ_SWAP_SUPPORTED
nuclear@14 565 # endif
nuclear@14 566 # ifndef PNG_NO_READ_PACKSWAP
nuclear@14 567 # define PNG_READ_PACKSWAP_SUPPORTED
nuclear@14 568 # endif
nuclear@14 569 # ifndef PNG_NO_READ_INVERT
nuclear@14 570 # define PNG_READ_INVERT_SUPPORTED
nuclear@14 571 # endif
nuclear@14 572 # ifndef PNG_NO_READ_DITHER
nuclear@14 573 # define PNG_READ_DITHER_SUPPORTED
nuclear@14 574 # endif
nuclear@14 575 # ifndef PNG_NO_READ_BACKGROUND
nuclear@14 576 # define PNG_READ_BACKGROUND_SUPPORTED
nuclear@14 577 # endif
nuclear@14 578 # ifndef PNG_NO_READ_16_TO_8
nuclear@14 579 # define PNG_READ_16_TO_8_SUPPORTED
nuclear@14 580 # endif
nuclear@14 581 # ifndef PNG_NO_READ_FILLER
nuclear@14 582 # define PNG_READ_FILLER_SUPPORTED
nuclear@14 583 # endif
nuclear@14 584 # ifndef PNG_NO_READ_GAMMA
nuclear@14 585 # define PNG_READ_GAMMA_SUPPORTED
nuclear@14 586 # endif
nuclear@14 587 # ifndef PNG_NO_READ_GRAY_TO_RGB
nuclear@14 588 # define PNG_READ_GRAY_TO_RGB_SUPPORTED
nuclear@14 589 # endif
nuclear@14 590 # ifndef PNG_NO_READ_SWAP_ALPHA
nuclear@14 591 # define PNG_READ_SWAP_ALPHA_SUPPORTED
nuclear@14 592 # endif
nuclear@14 593 # ifndef PNG_NO_READ_INVERT_ALPHA
nuclear@14 594 # define PNG_READ_INVERT_ALPHA_SUPPORTED
nuclear@14 595 # endif
nuclear@14 596 # ifndef PNG_NO_READ_STRIP_ALPHA
nuclear@14 597 # define PNG_READ_STRIP_ALPHA_SUPPORTED
nuclear@14 598 # endif
nuclear@14 599 # ifndef PNG_NO_READ_USER_TRANSFORM
nuclear@14 600 # define PNG_READ_USER_TRANSFORM_SUPPORTED
nuclear@14 601 # endif
nuclear@14 602 # ifndef PNG_NO_READ_RGB_TO_GRAY
nuclear@14 603 # define PNG_READ_RGB_TO_GRAY_SUPPORTED
nuclear@14 604 # endif
nuclear@14 605 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
nuclear@14 606
nuclear@14 607 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
nuclear@14 608 !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */
nuclear@14 609 # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
nuclear@14 610 #endif /* about interlacing capability! You'll */
nuclear@14 611 /* still have interlacing unless you change the following line: */
nuclear@14 612
nuclear@14 613 #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */
nuclear@14 614
nuclear@14 615 #ifndef PNG_NO_READ_COMPOSITE_NODIV
nuclear@14 616 # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
nuclear@14 617 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */
nuclear@14 618 # endif
nuclear@14 619 #endif
nuclear@14 620
nuclear@14 621 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
nuclear@14 622 /* Deprecated, will be removed from version 2.0.0.
nuclear@14 623 Use PNG_MNG_FEATURES_SUPPORTED instead. */
nuclear@14 624 #ifndef PNG_NO_READ_EMPTY_PLTE
nuclear@14 625 # define PNG_READ_EMPTY_PLTE_SUPPORTED
nuclear@14 626 #endif
nuclear@14 627 #endif
nuclear@14 628
nuclear@14 629 #endif /* PNG_READ_SUPPORTED */
nuclear@14 630
nuclear@14 631 #if defined(PNG_WRITE_SUPPORTED)
nuclear@14 632
nuclear@14 633 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
nuclear@14 634 !defined(PNG_NO_WRITE_TRANSFORMS)
nuclear@14 635 # define PNG_WRITE_TRANSFORMS_SUPPORTED
nuclear@14 636 #endif
nuclear@14 637
nuclear@14 638 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
nuclear@14 639 # ifndef PNG_NO_WRITE_SHIFT
nuclear@14 640 # define PNG_WRITE_SHIFT_SUPPORTED
nuclear@14 641 # endif
nuclear@14 642 # ifndef PNG_NO_WRITE_PACK
nuclear@14 643 # define PNG_WRITE_PACK_SUPPORTED
nuclear@14 644 # endif
nuclear@14 645 # ifndef PNG_NO_WRITE_BGR
nuclear@14 646 # define PNG_WRITE_BGR_SUPPORTED
nuclear@14 647 # endif
nuclear@14 648 # ifndef PNG_NO_WRITE_SWAP
nuclear@14 649 # define PNG_WRITE_SWAP_SUPPORTED
nuclear@14 650 # endif
nuclear@14 651 # ifndef PNG_NO_WRITE_PACKSWAP
nuclear@14 652 # define PNG_WRITE_PACKSWAP_SUPPORTED
nuclear@14 653 # endif
nuclear@14 654 # ifndef PNG_NO_WRITE_INVERT
nuclear@14 655 # define PNG_WRITE_INVERT_SUPPORTED
nuclear@14 656 # endif
nuclear@14 657 # ifndef PNG_NO_WRITE_FILLER
nuclear@14 658 # define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
nuclear@14 659 # endif
nuclear@14 660 # ifndef PNG_NO_WRITE_SWAP_ALPHA
nuclear@14 661 # define PNG_WRITE_SWAP_ALPHA_SUPPORTED
nuclear@14 662 # endif
nuclear@14 663 # ifndef PNG_NO_WRITE_INVERT_ALPHA
nuclear@14 664 # define PNG_WRITE_INVERT_ALPHA_SUPPORTED
nuclear@14 665 # endif
nuclear@14 666 # ifndef PNG_NO_WRITE_USER_TRANSFORM
nuclear@14 667 # define PNG_WRITE_USER_TRANSFORM_SUPPORTED
nuclear@14 668 # endif
nuclear@14 669 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
nuclear@14 670
nuclear@14 671 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
nuclear@14 672 !defined(PNG_WRITE_INTERLACING_SUPPORTED)
nuclear@14 673 #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
nuclear@14 674 encoders, but can cause trouble
nuclear@14 675 if left undefined */
nuclear@14 676 #endif
nuclear@14 677
nuclear@14 678 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
nuclear@14 679 !defined(PNG_WRITE_WEIGHTED_FILTER) && \
nuclear@14 680 defined(PNG_FLOATING_POINT_SUPPORTED)
nuclear@14 681 # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
nuclear@14 682 #endif
nuclear@14 683
nuclear@14 684 #ifndef PNG_NO_WRITE_FLUSH
nuclear@14 685 # define PNG_WRITE_FLUSH_SUPPORTED
nuclear@14 686 #endif
nuclear@14 687
nuclear@14 688 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
nuclear@14 689 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
nuclear@14 690 #ifndef PNG_NO_WRITE_EMPTY_PLTE
nuclear@14 691 # define PNG_WRITE_EMPTY_PLTE_SUPPORTED
nuclear@14 692 #endif
nuclear@14 693 #endif
nuclear@14 694
nuclear@14 695 #endif /* PNG_WRITE_SUPPORTED */
nuclear@14 696
nuclear@14 697 #ifndef PNG_1_0_X
nuclear@14 698 # ifndef PNG_NO_ERROR_NUMBERS
nuclear@14 699 # define PNG_ERROR_NUMBERS_SUPPORTED
nuclear@14 700 # endif
nuclear@14 701 #endif /* PNG_1_0_X */
nuclear@14 702
nuclear@14 703 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
nuclear@14 704 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
nuclear@14 705 # ifndef PNG_NO_USER_TRANSFORM_PTR
nuclear@14 706 # define PNG_USER_TRANSFORM_PTR_SUPPORTED
nuclear@14 707 # endif
nuclear@14 708 #endif
nuclear@14 709
nuclear@14 710 #ifndef PNG_NO_STDIO
nuclear@14 711 # define PNG_TIME_RFC1123_SUPPORTED
nuclear@14 712 #endif
nuclear@14 713
nuclear@14 714 /* This adds extra functions in pngget.c for accessing data from the
nuclear@14 715 * info pointer (added in version 0.99)
nuclear@14 716 * png_get_image_width()
nuclear@14 717 * png_get_image_height()
nuclear@14 718 * png_get_bit_depth()
nuclear@14 719 * png_get_color_type()
nuclear@14 720 * png_get_compression_type()
nuclear@14 721 * png_get_filter_type()
nuclear@14 722 * png_get_interlace_type()
nuclear@14 723 * png_get_pixel_aspect_ratio()
nuclear@14 724 * png_get_pixels_per_meter()
nuclear@14 725 * png_get_x_offset_pixels()
nuclear@14 726 * png_get_y_offset_pixels()
nuclear@14 727 * png_get_x_offset_microns()
nuclear@14 728 * png_get_y_offset_microns()
nuclear@14 729 */
nuclear@14 730 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
nuclear@14 731 # define PNG_EASY_ACCESS_SUPPORTED
nuclear@14 732 #endif
nuclear@14 733
nuclear@14 734 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
nuclear@14 735 * and removed from version 1.2.20. The following will be removed
nuclear@14 736 * from libpng-1.4.0
nuclear@14 737 */
nuclear@14 738
nuclear@14 739 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE)
nuclear@14 740 # ifndef PNG_OPTIMIZED_CODE_SUPPORTED
nuclear@14 741 # define PNG_OPTIMIZED_CODE_SUPPORTED
nuclear@14 742 # endif
nuclear@14 743 #endif
nuclear@14 744
nuclear@14 745 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
nuclear@14 746 # ifndef PNG_ASSEMBLER_CODE_SUPPORTED
nuclear@14 747 # define PNG_ASSEMBLER_CODE_SUPPORTED
nuclear@14 748 # endif
nuclear@14 749
nuclear@14 750 # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4)
nuclear@14 751 /* work around 64-bit gcc compiler bugs in gcc-3.x */
nuclear@14 752 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@14 753 # define PNG_NO_MMX_CODE
nuclear@14 754 # endif
nuclear@14 755 # endif
nuclear@14 756
nuclear@14 757 # if defined(__APPLE__)
nuclear@14 758 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@14 759 # define PNG_NO_MMX_CODE
nuclear@14 760 # endif
nuclear@14 761 # endif
nuclear@14 762
nuclear@14 763 # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh))
nuclear@14 764 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@14 765 # define PNG_NO_MMX_CODE
nuclear@14 766 # endif
nuclear@14 767 # endif
nuclear@14 768
nuclear@14 769 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@14 770 # define PNG_MMX_CODE_SUPPORTED
nuclear@14 771 # endif
nuclear@14 772
nuclear@14 773 #endif
nuclear@14 774 /* end of obsolete code to be removed from libpng-1.4.0 */
nuclear@14 775
nuclear@14 776 #if !defined(PNG_1_0_X)
nuclear@14 777 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
nuclear@14 778 # define PNG_USER_MEM_SUPPORTED
nuclear@14 779 #endif
nuclear@14 780 #endif /* PNG_1_0_X */
nuclear@14 781
nuclear@14 782 /* Added at libpng-1.2.6 */
nuclear@14 783 #if !defined(PNG_1_0_X)
nuclear@14 784 #ifndef PNG_SET_USER_LIMITS_SUPPORTED
nuclear@14 785 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
nuclear@14 786 # define PNG_SET_USER_LIMITS_SUPPORTED
nuclear@14 787 #endif
nuclear@14 788 #endif
nuclear@14 789 #endif /* PNG_1_0_X */
nuclear@14 790
nuclear@14 791 /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
nuclear@14 792 * how large, set these limits to 0x7fffffffL
nuclear@14 793 */
nuclear@14 794 #ifndef PNG_USER_WIDTH_MAX
nuclear@14 795 # define PNG_USER_WIDTH_MAX 1000000L
nuclear@14 796 #endif
nuclear@14 797 #ifndef PNG_USER_HEIGHT_MAX
nuclear@14 798 # define PNG_USER_HEIGHT_MAX 1000000L
nuclear@14 799 #endif
nuclear@14 800
nuclear@14 801 /* These are currently experimental features, define them if you want */
nuclear@14 802
nuclear@14 803 /* very little testing */
nuclear@14 804 /*
nuclear@14 805 #ifdef PNG_READ_SUPPORTED
nuclear@14 806 # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
nuclear@14 807 # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
nuclear@14 808 # endif
nuclear@14 809 #endif
nuclear@14 810 */
nuclear@14 811
nuclear@14 812 /* This is only for PowerPC big-endian and 680x0 systems */
nuclear@14 813 /* some testing */
nuclear@14 814 /*
nuclear@14 815 #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
nuclear@14 816 # define PNG_READ_BIG_ENDIAN_SUPPORTED
nuclear@14 817 #endif
nuclear@14 818 */
nuclear@14 819
nuclear@14 820 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */
nuclear@14 821 /*
nuclear@14 822 #define PNG_NO_POINTER_INDEXING
nuclear@14 823 */
nuclear@14 824
nuclear@14 825 /* These functions are turned off by default, as they will be phased out. */
nuclear@14 826 /*
nuclear@14 827 #define PNG_USELESS_TESTS_SUPPORTED
nuclear@14 828 #define PNG_CORRECT_PALETTE_SUPPORTED
nuclear@14 829 */
nuclear@14 830
nuclear@14 831 /* Any chunks you are not interested in, you can undef here. The
nuclear@14 832 * ones that allocate memory may be expecially important (hIST,
nuclear@14 833 * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
nuclear@14 834 * a bit smaller.
nuclear@14 835 */
nuclear@14 836
nuclear@14 837 #if defined(PNG_READ_SUPPORTED) && \
nuclear@14 838 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
nuclear@14 839 !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
nuclear@14 840 # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
nuclear@14 841 #endif
nuclear@14 842
nuclear@14 843 #if defined(PNG_WRITE_SUPPORTED) && \
nuclear@14 844 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
nuclear@14 845 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
nuclear@14 846 # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
nuclear@14 847 #endif
nuclear@14 848
nuclear@14 849 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
nuclear@14 850
nuclear@14 851 #ifdef PNG_NO_READ_TEXT
nuclear@14 852 # define PNG_NO_READ_iTXt
nuclear@14 853 # define PNG_NO_READ_tEXt
nuclear@14 854 # define PNG_NO_READ_zTXt
nuclear@14 855 #endif
nuclear@14 856 #ifndef PNG_NO_READ_bKGD
nuclear@14 857 # define PNG_READ_bKGD_SUPPORTED
nuclear@14 858 # define PNG_bKGD_SUPPORTED
nuclear@14 859 #endif
nuclear@14 860 #ifndef PNG_NO_READ_cHRM
nuclear@14 861 # define PNG_READ_cHRM_SUPPORTED
nuclear@14 862 # define PNG_cHRM_SUPPORTED
nuclear@14 863 #endif
nuclear@14 864 #ifndef PNG_NO_READ_gAMA
nuclear@14 865 # define PNG_READ_gAMA_SUPPORTED
nuclear@14 866 # define PNG_gAMA_SUPPORTED
nuclear@14 867 #endif
nuclear@14 868 #ifndef PNG_NO_READ_hIST
nuclear@14 869 # define PNG_READ_hIST_SUPPORTED
nuclear@14 870 # define PNG_hIST_SUPPORTED
nuclear@14 871 #endif
nuclear@14 872 #ifndef PNG_NO_READ_iCCP
nuclear@14 873 # define PNG_READ_iCCP_SUPPORTED
nuclear@14 874 # define PNG_iCCP_SUPPORTED
nuclear@14 875 #endif
nuclear@14 876 #ifndef PNG_NO_READ_iTXt
nuclear@14 877 # ifndef PNG_READ_iTXt_SUPPORTED
nuclear@14 878 # define PNG_READ_iTXt_SUPPORTED
nuclear@14 879 # endif
nuclear@14 880 # ifndef PNG_iTXt_SUPPORTED
nuclear@14 881 # define PNG_iTXt_SUPPORTED
nuclear@14 882 # endif
nuclear@14 883 #endif
nuclear@14 884 #ifndef PNG_NO_READ_oFFs
nuclear@14 885 # define PNG_READ_oFFs_SUPPORTED
nuclear@14 886 # define PNG_oFFs_SUPPORTED
nuclear@14 887 #endif
nuclear@14 888 #ifndef PNG_NO_READ_pCAL
nuclear@14 889 # define PNG_READ_pCAL_SUPPORTED
nuclear@14 890 # define PNG_pCAL_SUPPORTED
nuclear@14 891 #endif
nuclear@14 892 #ifndef PNG_NO_READ_sCAL
nuclear@14 893 # define PNG_READ_sCAL_SUPPORTED
nuclear@14 894 # define PNG_sCAL_SUPPORTED
nuclear@14 895 #endif
nuclear@14 896 #ifndef PNG_NO_READ_pHYs
nuclear@14 897 # define PNG_READ_pHYs_SUPPORTED
nuclear@14 898 # define PNG_pHYs_SUPPORTED
nuclear@14 899 #endif
nuclear@14 900 #ifndef PNG_NO_READ_sBIT
nuclear@14 901 # define PNG_READ_sBIT_SUPPORTED
nuclear@14 902 # define PNG_sBIT_SUPPORTED
nuclear@14 903 #endif
nuclear@14 904 #ifndef PNG_NO_READ_sPLT
nuclear@14 905 # define PNG_READ_sPLT_SUPPORTED
nuclear@14 906 # define PNG_sPLT_SUPPORTED
nuclear@14 907 #endif
nuclear@14 908 #ifndef PNG_NO_READ_sRGB
nuclear@14 909 # define PNG_READ_sRGB_SUPPORTED
nuclear@14 910 # define PNG_sRGB_SUPPORTED
nuclear@14 911 #endif
nuclear@14 912 #ifndef PNG_NO_READ_tEXt
nuclear@14 913 # define PNG_READ_tEXt_SUPPORTED
nuclear@14 914 # define PNG_tEXt_SUPPORTED
nuclear@14 915 #endif
nuclear@14 916 #ifndef PNG_NO_READ_tIME
nuclear@14 917 # define PNG_READ_tIME_SUPPORTED
nuclear@14 918 # define PNG_tIME_SUPPORTED
nuclear@14 919 #endif
nuclear@14 920 #ifndef PNG_NO_READ_tRNS
nuclear@14 921 # define PNG_READ_tRNS_SUPPORTED
nuclear@14 922 # define PNG_tRNS_SUPPORTED
nuclear@14 923 #endif
nuclear@14 924 #ifndef PNG_NO_READ_zTXt
nuclear@14 925 # define PNG_READ_zTXt_SUPPORTED
nuclear@14 926 # define PNG_zTXt_SUPPORTED
nuclear@14 927 #endif
nuclear@14 928 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@14 929 # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
nuclear@14 930 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@14 931 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@14 932 # endif
nuclear@14 933 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@14 934 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
nuclear@14 935 # endif
nuclear@14 936 #endif
nuclear@14 937 #if !defined(PNG_NO_READ_USER_CHUNKS) && \
nuclear@14 938 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
nuclear@14 939 # define PNG_READ_USER_CHUNKS_SUPPORTED
nuclear@14 940 # define PNG_USER_CHUNKS_SUPPORTED
nuclear@14 941 # ifdef PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@14 942 # undef PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@14 943 # endif
nuclear@14 944 # ifdef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@14 945 # undef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@14 946 # endif
nuclear@14 947 #endif
nuclear@14 948 #ifndef PNG_NO_READ_OPT_PLTE
nuclear@14 949 # define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
nuclear@14 950 #endif /* optional PLTE chunk in RGB and RGBA images */
nuclear@14 951 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
nuclear@14 952 defined(PNG_READ_zTXt_SUPPORTED)
nuclear@14 953 # define PNG_READ_TEXT_SUPPORTED
nuclear@14 954 # define PNG_TEXT_SUPPORTED
nuclear@14 955 #endif
nuclear@14 956
nuclear@14 957 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
nuclear@14 958
nuclear@14 959 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
nuclear@14 960
nuclear@14 961 #ifdef PNG_NO_WRITE_TEXT
nuclear@14 962 # define PNG_NO_WRITE_iTXt
nuclear@14 963 # define PNG_NO_WRITE_tEXt
nuclear@14 964 # define PNG_NO_WRITE_zTXt
nuclear@14 965 #endif
nuclear@14 966 #ifndef PNG_NO_WRITE_bKGD
nuclear@14 967 # define PNG_WRITE_bKGD_SUPPORTED
nuclear@14 968 # ifndef PNG_bKGD_SUPPORTED
nuclear@14 969 # define PNG_bKGD_SUPPORTED
nuclear@14 970 # endif
nuclear@14 971 #endif
nuclear@14 972 #ifndef PNG_NO_WRITE_cHRM
nuclear@14 973 # define PNG_WRITE_cHRM_SUPPORTED
nuclear@14 974 # ifndef PNG_cHRM_SUPPORTED
nuclear@14 975 # define PNG_cHRM_SUPPORTED
nuclear@14 976 # endif
nuclear@14 977 #endif
nuclear@14 978 #ifndef PNG_NO_WRITE_gAMA
nuclear@14 979 # define PNG_WRITE_gAMA_SUPPORTED
nuclear@14 980 # ifndef PNG_gAMA_SUPPORTED
nuclear@14 981 # define PNG_gAMA_SUPPORTED
nuclear@14 982 # endif
nuclear@14 983 #endif
nuclear@14 984 #ifndef PNG_NO_WRITE_hIST
nuclear@14 985 # define PNG_WRITE_hIST_SUPPORTED
nuclear@14 986 # ifndef PNG_hIST_SUPPORTED
nuclear@14 987 # define PNG_hIST_SUPPORTED
nuclear@14 988 # endif
nuclear@14 989 #endif
nuclear@14 990 #ifndef PNG_NO_WRITE_iCCP
nuclear@14 991 # define PNG_WRITE_iCCP_SUPPORTED
nuclear@14 992 # ifndef PNG_iCCP_SUPPORTED
nuclear@14 993 # define PNG_iCCP_SUPPORTED
nuclear@14 994 # endif
nuclear@14 995 #endif
nuclear@14 996 #ifndef PNG_NO_WRITE_iTXt
nuclear@14 997 # ifndef PNG_WRITE_iTXt_SUPPORTED
nuclear@14 998 # define PNG_WRITE_iTXt_SUPPORTED
nuclear@14 999 # endif
nuclear@14 1000 # ifndef PNG_iTXt_SUPPORTED
nuclear@14 1001 # define PNG_iTXt_SUPPORTED
nuclear@14 1002 # endif
nuclear@14 1003 #endif
nuclear@14 1004 #ifndef PNG_NO_WRITE_oFFs
nuclear@14 1005 # define PNG_WRITE_oFFs_SUPPORTED
nuclear@14 1006 # ifndef PNG_oFFs_SUPPORTED
nuclear@14 1007 # define PNG_oFFs_SUPPORTED
nuclear@14 1008 # endif
nuclear@14 1009 #endif
nuclear@14 1010 #ifndef PNG_NO_WRITE_pCAL
nuclear@14 1011 # define PNG_WRITE_pCAL_SUPPORTED
nuclear@14 1012 # ifndef PNG_pCAL_SUPPORTED
nuclear@14 1013 # define PNG_pCAL_SUPPORTED
nuclear@14 1014 # endif
nuclear@14 1015 #endif
nuclear@14 1016 #ifndef PNG_NO_WRITE_sCAL
nuclear@14 1017 # define PNG_WRITE_sCAL_SUPPORTED
nuclear@14 1018 # ifndef PNG_sCAL_SUPPORTED
nuclear@14 1019 # define PNG_sCAL_SUPPORTED
nuclear@14 1020 # endif
nuclear@14 1021 #endif
nuclear@14 1022 #ifndef PNG_NO_WRITE_pHYs
nuclear@14 1023 # define PNG_WRITE_pHYs_SUPPORTED
nuclear@14 1024 # ifndef PNG_pHYs_SUPPORTED
nuclear@14 1025 # define PNG_pHYs_SUPPORTED
nuclear@14 1026 # endif
nuclear@14 1027 #endif
nuclear@14 1028 #ifndef PNG_NO_WRITE_sBIT
nuclear@14 1029 # define PNG_WRITE_sBIT_SUPPORTED
nuclear@14 1030 # ifndef PNG_sBIT_SUPPORTED
nuclear@14 1031 # define PNG_sBIT_SUPPORTED
nuclear@14 1032 # endif
nuclear@14 1033 #endif
nuclear@14 1034 #ifndef PNG_NO_WRITE_sPLT
nuclear@14 1035 # define PNG_WRITE_sPLT_SUPPORTED
nuclear@14 1036 # ifndef PNG_sPLT_SUPPORTED
nuclear@14 1037 # define PNG_sPLT_SUPPORTED
nuclear@14 1038 # endif
nuclear@14 1039 #endif
nuclear@14 1040 #ifndef PNG_NO_WRITE_sRGB
nuclear@14 1041 # define PNG_WRITE_sRGB_SUPPORTED
nuclear@14 1042 # ifndef PNG_sRGB_SUPPORTED
nuclear@14 1043 # define PNG_sRGB_SUPPORTED
nuclear@14 1044 # endif
nuclear@14 1045 #endif
nuclear@14 1046 #ifndef PNG_NO_WRITE_tEXt
nuclear@14 1047 # define PNG_WRITE_tEXt_SUPPORTED
nuclear@14 1048 # ifndef PNG_tEXt_SUPPORTED
nuclear@14 1049 # define PNG_tEXt_SUPPORTED
nuclear@14 1050 # endif
nuclear@14 1051 #endif
nuclear@14 1052 #ifndef PNG_NO_WRITE_tIME
nuclear@14 1053 # define PNG_WRITE_tIME_SUPPORTED
nuclear@14 1054 # ifndef PNG_tIME_SUPPORTED
nuclear@14 1055 # define PNG_tIME_SUPPORTED
nuclear@14 1056 # endif
nuclear@14 1057 #endif
nuclear@14 1058 #ifndef PNG_NO_WRITE_tRNS
nuclear@14 1059 # define PNG_WRITE_tRNS_SUPPORTED
nuclear@14 1060 # ifndef PNG_tRNS_SUPPORTED
nuclear@14 1061 # define PNG_tRNS_SUPPORTED
nuclear@14 1062 # endif
nuclear@14 1063 #endif
nuclear@14 1064 #ifndef PNG_NO_WRITE_zTXt
nuclear@14 1065 # define PNG_WRITE_zTXt_SUPPORTED
nuclear@14 1066 # ifndef PNG_zTXt_SUPPORTED
nuclear@14 1067 # define PNG_zTXt_SUPPORTED
nuclear@14 1068 # endif
nuclear@14 1069 #endif
nuclear@14 1070 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
nuclear@14 1071 # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
nuclear@14 1072 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@14 1073 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@14 1074 # endif
nuclear@14 1075 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@14 1076 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
nuclear@14 1077 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
nuclear@14 1078 # endif
nuclear@14 1079 # endif
nuclear@14 1080 #endif
nuclear@14 1081 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
nuclear@14 1082 defined(PNG_WRITE_zTXt_SUPPORTED)
nuclear@14 1083 # define PNG_WRITE_TEXT_SUPPORTED
nuclear@14 1084 # ifndef PNG_TEXT_SUPPORTED
nuclear@14 1085 # define PNG_TEXT_SUPPORTED
nuclear@14 1086 # endif
nuclear@14 1087 #endif
nuclear@14 1088
nuclear@14 1089 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
nuclear@14 1090
nuclear@14 1091 /* Turn this off to disable png_read_png() and
nuclear@14 1092 * png_write_png() and leave the row_pointers member
nuclear@14 1093 * out of the info structure.
nuclear@14 1094 */
nuclear@14 1095 #ifndef PNG_NO_INFO_IMAGE
nuclear@14 1096 # define PNG_INFO_IMAGE_SUPPORTED
nuclear@14 1097 #endif
nuclear@14 1098
nuclear@14 1099 /* need the time information for reading tIME chunks */
nuclear@14 1100 #if defined(PNG_tIME_SUPPORTED)
nuclear@14 1101 # if !defined(_WIN32_WCE)
nuclear@14 1102 /* "time.h" functions are not supported on WindowsCE */
nuclear@14 1103 # include <time.h>
nuclear@14 1104 # endif
nuclear@14 1105 #endif
nuclear@14 1106
nuclear@14 1107 /* Some typedefs to get us started. These should be safe on most of the
nuclear@14 1108 * common platforms. The typedefs should be at least as large as the
nuclear@14 1109 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
nuclear@14 1110 * don't have to be exactly that size. Some compilers dislike passing
nuclear@14 1111 * unsigned shorts as function parameters, so you may be better off using
nuclear@14 1112 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may
nuclear@14 1113 * want to have unsigned int for png_uint_32 instead of unsigned long.
nuclear@14 1114 */
nuclear@14 1115
nuclear@14 1116 typedef unsigned long png_uint_32;
nuclear@14 1117 typedef long png_int_32;
nuclear@14 1118 typedef unsigned short png_uint_16;
nuclear@14 1119 typedef short png_int_16;
nuclear@14 1120 typedef unsigned char png_byte;
nuclear@14 1121
nuclear@14 1122 /* This is usually size_t. It is typedef'ed just in case you need it to
nuclear@14 1123 change (I'm not sure if you will or not, so I thought I'd be safe) */
nuclear@14 1124 #ifdef PNG_SIZE_T
nuclear@14 1125 typedef PNG_SIZE_T png_size_t;
nuclear@14 1126 # define png_sizeof(x) png_convert_size(sizeof(x))
nuclear@14 1127 #else
nuclear@14 1128 typedef size_t png_size_t;
nuclear@14 1129 # define png_sizeof(x) sizeof(x)
nuclear@14 1130 #endif
nuclear@14 1131
nuclear@14 1132 /* The following is needed for medium model support. It cannot be in the
nuclear@14 1133 * PNG_INTERNAL section. Needs modification for other compilers besides
nuclear@14 1134 * MSC. Model independent support declares all arrays and pointers to be
nuclear@14 1135 * large using the far keyword. The zlib version used must also support
nuclear@14 1136 * model independent data. As of version zlib 1.0.4, the necessary changes
nuclear@14 1137 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
nuclear@14 1138 * changes that are needed. (Tim Wegner)
nuclear@14 1139 */
nuclear@14 1140
nuclear@14 1141 /* Separate compiler dependencies (problem here is that zlib.h always
nuclear@14 1142 defines FAR. (SJT) */
nuclear@14 1143 #ifdef __BORLANDC__
nuclear@14 1144 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
nuclear@14 1145 # define LDATA 1
nuclear@14 1146 # else
nuclear@14 1147 # define LDATA 0
nuclear@14 1148 # endif
nuclear@14 1149 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
nuclear@14 1150 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
nuclear@14 1151 # define PNG_MAX_MALLOC_64K
nuclear@14 1152 # if (LDATA != 1)
nuclear@14 1153 # ifndef FAR
nuclear@14 1154 # define FAR __far
nuclear@14 1155 # endif
nuclear@14 1156 # define USE_FAR_KEYWORD
nuclear@14 1157 # endif /* LDATA != 1 */
nuclear@14 1158 /* Possibly useful for moving data out of default segment.
nuclear@14 1159 * Uncomment it if you want. Could also define FARDATA as
nuclear@14 1160 * const if your compiler supports it. (SJT)
nuclear@14 1161 # define FARDATA FAR
nuclear@14 1162 */
nuclear@14 1163 # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
nuclear@14 1164 #endif /* __BORLANDC__ */
nuclear@14 1165
nuclear@14 1166
nuclear@14 1167 /* Suggest testing for specific compiler first before testing for
nuclear@14 1168 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
nuclear@14 1169 * making reliance oncertain keywords suspect. (SJT)
nuclear@14 1170 */
nuclear@14 1171
nuclear@14 1172 /* MSC Medium model */
nuclear@14 1173 #if defined(FAR)
nuclear@14 1174 # if defined(M_I86MM)
nuclear@14 1175 # define USE_FAR_KEYWORD
nuclear@14 1176 # define FARDATA FAR
nuclear@14 1177 # include <dos.h>
nuclear@14 1178 # endif
nuclear@14 1179 #endif
nuclear@14 1180
nuclear@14 1181 /* SJT: default case */
nuclear@14 1182 #ifndef FAR
nuclear@14 1183 # define FAR
nuclear@14 1184 #endif
nuclear@14 1185
nuclear@14 1186 /* At this point FAR is always defined */
nuclear@14 1187 #ifndef FARDATA
nuclear@14 1188 # define FARDATA
nuclear@14 1189 #endif
nuclear@14 1190
nuclear@14 1191 /* Typedef for floating-point numbers that are converted
nuclear@14 1192 to fixed-point with a multiple of 100,000, e.g., int_gamma */
nuclear@14 1193 typedef png_int_32 png_fixed_point;
nuclear@14 1194
nuclear@14 1195 /* Add typedefs for pointers */
nuclear@14 1196 typedef void FAR * png_voidp;
nuclear@14 1197 typedef png_byte FAR * png_bytep;
nuclear@14 1198 typedef png_uint_32 FAR * png_uint_32p;
nuclear@14 1199 typedef png_int_32 FAR * png_int_32p;
nuclear@14 1200 typedef png_uint_16 FAR * png_uint_16p;
nuclear@14 1201 typedef png_int_16 FAR * png_int_16p;
nuclear@14 1202 typedef PNG_CONST char FAR * png_const_charp;
nuclear@14 1203 typedef char FAR * png_charp;
nuclear@14 1204 typedef png_fixed_point FAR * png_fixed_point_p;
nuclear@14 1205
nuclear@14 1206 #ifndef PNG_NO_STDIO
nuclear@14 1207 #if defined(_WIN32_WCE)
nuclear@14 1208 typedef HANDLE png_FILE_p;
nuclear@14 1209 #else
nuclear@14 1210 typedef FILE * png_FILE_p;
nuclear@14 1211 #endif
nuclear@14 1212 #endif
nuclear@14 1213
nuclear@14 1214 #ifdef PNG_FLOATING_POINT_SUPPORTED
nuclear@14 1215 typedef double FAR * png_doublep;
nuclear@14 1216 #endif
nuclear@14 1217
nuclear@14 1218 /* Pointers to pointers; i.e. arrays */
nuclear@14 1219 typedef png_byte FAR * FAR * png_bytepp;
nuclear@14 1220 typedef png_uint_32 FAR * FAR * png_uint_32pp;
nuclear@14 1221 typedef png_int_32 FAR * FAR * png_int_32pp;
nuclear@14 1222 typedef png_uint_16 FAR * FAR * png_uint_16pp;
nuclear@14 1223 typedef png_int_16 FAR * FAR * png_int_16pp;
nuclear@14 1224 typedef PNG_CONST char FAR * FAR * png_const_charpp;
nuclear@14 1225 typedef char FAR * FAR * png_charpp;
nuclear@14 1226 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
nuclear@14 1227 #ifdef PNG_FLOATING_POINT_SUPPORTED
nuclear@14 1228 typedef double FAR * FAR * png_doublepp;
nuclear@14 1229 #endif
nuclear@14 1230
nuclear@14 1231 /* Pointers to pointers to pointers; i.e., pointer to array */
nuclear@14 1232 typedef char FAR * FAR * FAR * png_charppp;
nuclear@14 1233
nuclear@14 1234 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
nuclear@14 1235 /* SPC - Is this stuff deprecated? */
nuclear@14 1236 /* It'll be removed as of libpng-1.3.0 - GR-P */
nuclear@14 1237 /* libpng typedefs for types in zlib. If zlib changes
nuclear@14 1238 * or another compression library is used, then change these.
nuclear@14 1239 * Eliminates need to change all the source files.
nuclear@14 1240 */
nuclear@14 1241 typedef charf * png_zcharp;
nuclear@14 1242 typedef charf * FAR * png_zcharpp;
nuclear@14 1243 typedef z_stream FAR * png_zstreamp;
nuclear@14 1244 #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
nuclear@14 1245
nuclear@14 1246 /*
nuclear@14 1247 * Define PNG_BUILD_DLL if the module being built is a Windows
nuclear@14 1248 * LIBPNG DLL.
nuclear@14 1249 *
nuclear@14 1250 * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
nuclear@14 1251 * It is equivalent to Microsoft predefined macro _DLL that is
nuclear@14 1252 * automatically defined when you compile using the share
nuclear@14 1253 * version of the CRT (C Run-Time library)
nuclear@14 1254 *
nuclear@14 1255 * The cygwin mods make this behavior a little different:
nuclear@14 1256 * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
nuclear@14 1257 * Define PNG_STATIC if you are building a static library for use with cygwin,
nuclear@14 1258 * -or- if you are building an application that you want to link to the
nuclear@14 1259 * static library.
nuclear@14 1260 * PNG_USE_DLL is defined by default (no user action needed) unless one of
nuclear@14 1261 * the other flags is defined.
nuclear@14 1262 */
nuclear@14 1263
nuclear@14 1264 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
nuclear@14 1265 # define PNG_DLL
nuclear@14 1266 #endif
nuclear@14 1267 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
nuclear@14 1268 * When building a static lib, default to no GLOBAL ARRAYS, but allow
nuclear@14 1269 * command-line override
nuclear@14 1270 */
nuclear@14 1271 #if defined(__CYGWIN__)
nuclear@14 1272 # if !defined(PNG_STATIC)
nuclear@14 1273 # if defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@14 1274 # undef PNG_USE_GLOBAL_ARRAYS
nuclear@14 1275 # endif
nuclear@14 1276 # if !defined(PNG_USE_LOCAL_ARRAYS)
nuclear@14 1277 # define PNG_USE_LOCAL_ARRAYS
nuclear@14 1278 # endif
nuclear@14 1279 # else
nuclear@14 1280 # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
nuclear@14 1281 # if defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@14 1282 # undef PNG_USE_GLOBAL_ARRAYS
nuclear@14 1283 # endif
nuclear@14 1284 # endif
nuclear@14 1285 # endif
nuclear@14 1286 # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@14 1287 # define PNG_USE_LOCAL_ARRAYS
nuclear@14 1288 # endif
nuclear@14 1289 #endif
nuclear@14 1290
nuclear@14 1291 /* Do not use global arrays (helps with building DLL's)
nuclear@14 1292 * They are no longer used in libpng itself, since version 1.0.5c,
nuclear@14 1293 * but might be required for some pre-1.0.5c applications.
nuclear@14 1294 */
nuclear@14 1295 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@14 1296 # if defined(PNG_NO_GLOBAL_ARRAYS) || \
nuclear@14 1297 (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER)
nuclear@14 1298 # define PNG_USE_LOCAL_ARRAYS
nuclear@14 1299 # else
nuclear@14 1300 # define PNG_USE_GLOBAL_ARRAYS
nuclear@14 1301 # endif
nuclear@14 1302 #endif
nuclear@14 1303
nuclear@14 1304 #if defined(__CYGWIN__)
nuclear@14 1305 # undef PNGAPI
nuclear@14 1306 # define PNGAPI __cdecl
nuclear@14 1307 # undef PNG_IMPEXP
nuclear@14 1308 # define PNG_IMPEXP
nuclear@14 1309 #endif
nuclear@14 1310
nuclear@14 1311 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
nuclear@14 1312 * you may get warnings regarding the linkage of png_zalloc and png_zfree.
nuclear@14 1313 * Don't ignore those warnings; you must also reset the default calling
nuclear@14 1314 * convention in your compiler to match your PNGAPI, and you must build
nuclear@14 1315 * zlib and your applications the same way you build libpng.
nuclear@14 1316 */
nuclear@14 1317
nuclear@14 1318 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
nuclear@14 1319 # ifndef PNG_NO_MODULEDEF
nuclear@14 1320 # define PNG_NO_MODULEDEF
nuclear@14 1321 # endif
nuclear@14 1322 #endif
nuclear@14 1323
nuclear@14 1324 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
nuclear@14 1325 # define PNG_IMPEXP
nuclear@14 1326 #endif
nuclear@14 1327
nuclear@14 1328 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
nuclear@14 1329 (( defined(_Windows) || defined(_WINDOWS) || \
nuclear@14 1330 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
nuclear@14 1331
nuclear@14 1332 # ifndef PNGAPI
nuclear@14 1333 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
nuclear@14 1334 # define PNGAPI __cdecl
nuclear@14 1335 # else
nuclear@14 1336 # define PNGAPI _cdecl
nuclear@14 1337 # endif
nuclear@14 1338 # endif
nuclear@14 1339
nuclear@14 1340 # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
nuclear@14 1341 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
nuclear@14 1342 # define PNG_IMPEXP
nuclear@14 1343 # endif
nuclear@14 1344
nuclear@14 1345 # if !defined(PNG_IMPEXP)
nuclear@14 1346
nuclear@14 1347 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
nuclear@14 1348 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
nuclear@14 1349
nuclear@14 1350 /* Borland/Microsoft */
nuclear@14 1351 # if defined(_MSC_VER) || defined(__BORLANDC__)
nuclear@14 1352 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
nuclear@14 1353 # define PNG_EXPORT PNG_EXPORT_TYPE1
nuclear@14 1354 # else
nuclear@14 1355 # define PNG_EXPORT PNG_EXPORT_TYPE2
nuclear@14 1356 # if defined(PNG_BUILD_DLL)
nuclear@14 1357 # define PNG_IMPEXP __export
nuclear@14 1358 # else
nuclear@14 1359 # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
nuclear@14 1360 VC++ */
nuclear@14 1361 # endif /* Exists in Borland C++ for
nuclear@14 1362 C++ classes (== huge) */
nuclear@14 1363 # endif
nuclear@14 1364 # endif
nuclear@14 1365
nuclear@14 1366 # if !defined(PNG_IMPEXP)
nuclear@14 1367 # if defined(PNG_BUILD_DLL)
nuclear@14 1368 # define PNG_IMPEXP __declspec(dllexport)
nuclear@14 1369 # else
nuclear@14 1370 # define PNG_IMPEXP __declspec(dllimport)
nuclear@14 1371 # endif
nuclear@14 1372 # endif
nuclear@14 1373 # endif /* PNG_IMPEXP */
nuclear@14 1374 #else /* !(DLL || non-cygwin WINDOWS) */
nuclear@14 1375 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
nuclear@14 1376 # ifndef PNGAPI
nuclear@14 1377 # define PNGAPI _System
nuclear@14 1378 # endif
nuclear@14 1379 # else
nuclear@14 1380 # if 0 /* ... other platforms, with other meanings */
nuclear@14 1381 # endif
nuclear@14 1382 # endif
nuclear@14 1383 #endif
nuclear@14 1384
nuclear@14 1385 #ifndef PNGAPI
nuclear@14 1386 # define PNGAPI
nuclear@14 1387 #endif
nuclear@14 1388 #ifndef PNG_IMPEXP
nuclear@14 1389 # define PNG_IMPEXP
nuclear@14 1390 #endif
nuclear@14 1391
nuclear@14 1392 #ifdef PNG_BUILDSYMS
nuclear@14 1393 # ifndef PNG_EXPORT
nuclear@14 1394 # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
nuclear@14 1395 # endif
nuclear@14 1396 # ifdef PNG_USE_GLOBAL_ARRAYS
nuclear@14 1397 # ifndef PNG_EXPORT_VAR
nuclear@14 1398 # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
nuclear@14 1399 # endif
nuclear@14 1400 # endif
nuclear@14 1401 #endif
nuclear@14 1402
nuclear@14 1403 #ifndef PNG_EXPORT
nuclear@14 1404 # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
nuclear@14 1405 #endif
nuclear@14 1406
nuclear@14 1407 #ifdef PNG_USE_GLOBAL_ARRAYS
nuclear@14 1408 # ifndef PNG_EXPORT_VAR
nuclear@14 1409 # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
nuclear@14 1410 # endif
nuclear@14 1411 #endif
nuclear@14 1412
nuclear@14 1413 /* User may want to use these so they are not in PNG_INTERNAL. Any library
nuclear@14 1414 * functions that are passed far data must be model independent.
nuclear@14 1415 */
nuclear@14 1416
nuclear@14 1417 #ifndef PNG_ABORT
nuclear@14 1418 # define PNG_ABORT() abort()
nuclear@14 1419 #endif
nuclear@14 1420
nuclear@14 1421 #ifdef PNG_SETJMP_SUPPORTED
nuclear@14 1422 # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
nuclear@14 1423 #else
nuclear@14 1424 # define png_jmpbuf(png_ptr) \
nuclear@14 1425 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
nuclear@14 1426 #endif
nuclear@14 1427
nuclear@14 1428 #if defined(USE_FAR_KEYWORD) /* memory model independent fns */
nuclear@14 1429 /* use this to make far-to-near assignments */
nuclear@14 1430 # define CHECK 1
nuclear@14 1431 # define NOCHECK 0
nuclear@14 1432 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
nuclear@14 1433 # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
nuclear@14 1434 # define png_snprintf _fsnprintf /* Added to v 1.2.19 */
nuclear@14 1435 # define png_strlen _fstrlen
nuclear@14 1436 # define png_memcmp _fmemcmp /* SJT: added */
nuclear@14 1437 # define png_memcpy _fmemcpy
nuclear@14 1438 # define png_memset _fmemset
nuclear@14 1439 #else /* use the usual functions */
nuclear@14 1440 # define CVT_PTR(ptr) (ptr)
nuclear@14 1441 # define CVT_PTR_NOCHECK(ptr) (ptr)
nuclear@14 1442 # ifndef PNG_NO_SNPRINTF
nuclear@14 1443 # ifdef _MSC_VER
nuclear@14 1444 # define png_snprintf _snprintf /* Added to v 1.2.19 */
nuclear@14 1445 # define png_snprintf2 _snprintf
nuclear@14 1446 # define png_snprintf6 _snprintf
nuclear@14 1447 # else
nuclear@14 1448 # define png_snprintf snprintf /* Added to v 1.2.19 */
nuclear@14 1449 # define png_snprintf2 snprintf
nuclear@14 1450 # define png_snprintf6 snprintf
nuclear@14 1451 # endif
nuclear@14 1452 # else
nuclear@14 1453 /* You don't have or don't want to use snprintf(). Caution: Using
nuclear@14 1454 * sprintf instead of snprintf exposes your application to accidental
nuclear@14 1455 * or malevolent buffer overflows. If you don't have snprintf()
nuclear@14 1456 * as a general rule you should provide one (you can get one from
nuclear@14 1457 * Portable OpenSSH). */
nuclear@14 1458 # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
nuclear@14 1459 # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
nuclear@14 1460 # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
nuclear@14 1461 sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
nuclear@14 1462 # endif
nuclear@14 1463 # define png_strlen strlen
nuclear@14 1464 # define png_memcmp memcmp /* SJT: added */
nuclear@14 1465 # define png_memcpy memcpy
nuclear@14 1466 # define png_memset memset
nuclear@14 1467 #endif
nuclear@14 1468 /* End of memory model independent support */
nuclear@14 1469
nuclear@14 1470 /* Just a little check that someone hasn't tried to define something
nuclear@14 1471 * contradictory.
nuclear@14 1472 */
nuclear@14 1473 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
nuclear@14 1474 # undef PNG_ZBUF_SIZE
nuclear@14 1475 # define PNG_ZBUF_SIZE 65536L
nuclear@14 1476 #endif
nuclear@14 1477
nuclear@14 1478 /* Added at libpng-1.2.8 */
nuclear@14 1479 #endif /* PNG_VERSION_INFO_ONLY */
nuclear@14 1480
nuclear@14 1481 #endif /* PNGCONF_H */