|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
00001 00002 /* pngconf.h - machine configurable file for libpng 00003 * 00004 * libpng version 1.2.40 - September 10, 2009 00005 * Copyright (c) 1998-2009 Glenn Randers-Pehrson 00006 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 00007 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 00008 * 00009 * This code is released under the libpng license. 00010 * For conditions of distribution and use, see the disclaimer 00011 * and license in png.h 00012 */ 00013 00014 /* Any machine specific code is near the front of this file, so if you 00015 * are configuring libpng for a machine, you may want to read the section 00016 * starting here down to where it starts to typedef png_color, png_text, 00017 * and png_info. 00018 */ 00019 00020 #ifndef PNGCONF_H 00021 #define PNGCONF_H 00022 00023 #define PNG_1_2_X 00024 00025 /* 00026 * PNG_USER_CONFIG has to be defined on the compiler command line. This 00027 * includes the resource compiler for Windows DLL configurations. 00028 */ 00029 #ifdef PNG_USER_CONFIG 00030 # ifndef PNG_USER_PRIVATEBUILD 00031 # define PNG_USER_PRIVATEBUILD 00032 # endif 00033 #include "pngusr.h" 00034 #endif 00035 00036 /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ 00037 #ifdef PNG_CONFIGURE_LIBPNG 00038 #ifdef HAVE_CONFIG_H 00039 #include "config.h" 00040 #endif 00041 #endif 00042 00043 /* 00044 * Added at libpng-1.2.8 00045 * 00046 * If you create a private DLL you need to define in "pngusr.h" the followings: 00047 * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of 00048 * the DLL was built> 00049 * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." 00050 * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to 00051 * distinguish your DLL from those of the official release. These 00052 * correspond to the trailing letters that come after the version 00053 * number and must match your private DLL name> 00054 * e.g. // private DLL "libpng13gx.dll" 00055 * #define PNG_USER_DLLFNAME_POSTFIX "gx" 00056 * 00057 * The following macros are also at your disposal if you want to complete the 00058 * DLL VERSIONINFO structure. 00059 * - PNG_USER_VERSIONINFO_COMMENTS 00060 * - PNG_USER_VERSIONINFO_COMPANYNAME 00061 * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS 00062 */ 00063 00064 #ifdef __STDC__ 00065 #ifdef SPECIALBUILD 00066 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ 00067 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") 00068 #endif 00069 00070 #ifdef PRIVATEBUILD 00071 # pragma message("PRIVATEBUILD is deprecated.\ 00072 Use PNG_USER_PRIVATEBUILD instead.") 00073 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD 00074 #endif 00075 #endif /* __STDC__ */ 00076 00077 #ifndef PNG_VERSION_INFO_ONLY 00078 00079 /* End of material added to libpng-1.2.8 */ 00080 00081 /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble 00082 Restored at libpng-1.2.21 */ 00083 #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ 00084 !defined(PNG_WARN_UNINITIALIZED_ROW) 00085 # define PNG_WARN_UNINITIALIZED_ROW 1 00086 #endif 00087 /* End of material added at libpng-1.2.19/1.2.21 */ 00088 00089 /* This is the size of the compression buffer, and thus the size of 00090 * an IDAT chunk. Make this whatever size you feel is best for your 00091 * machine. One of these will be allocated per png_struct. When this 00092 * is full, it writes the data to the disk, and does some other 00093 * calculations. Making this an extremely small size will slow 00094 * the library down, but you may want to experiment to determine 00095 * where it becomes significant, if you are concerned with memory 00096 * usage. Note that zlib allocates at least 32Kb also. For readers, 00097 * this describes the size of the buffer available to read the data in. 00098 * Unless this gets smaller than the size of a row (compressed), 00099 * it should not make much difference how big this is. 00100 */ 00101 00102 #ifndef PNG_ZBUF_SIZE 00103 # define PNG_ZBUF_SIZE 8192 00104 #endif 00105 00106 /* Enable if you want a write-only libpng */ 00107 00108 #ifndef PNG_NO_READ_SUPPORTED 00109 # define PNG_READ_SUPPORTED 00110 #endif 00111 00112 /* Enable if you want a read-only libpng */ 00113 00114 #ifndef PNG_NO_WRITE_SUPPORTED 00115 # define PNG_WRITE_SUPPORTED 00116 #endif 00117 00118 /* Enabled by default in 1.2.0. You can disable this if you don't need to 00119 support PNGs that are embedded in MNG datastreams */ 00120 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) 00121 # ifndef PNG_MNG_FEATURES_SUPPORTED 00122 # define PNG_MNG_FEATURES_SUPPORTED 00123 # endif 00124 #endif 00125 00126 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED 00127 # ifndef PNG_FLOATING_POINT_SUPPORTED 00128 # define PNG_FLOATING_POINT_SUPPORTED 00129 # endif 00130 #endif 00131 00132 /* If you are running on a machine where you cannot allocate more 00133 * than 64K of memory at once, uncomment this. While libpng will not 00134 * normally need that much memory in a chunk (unless you load up a very 00135 * large file), zlib needs to know how big of a chunk it can use, and 00136 * libpng thus makes sure to check any memory allocation to verify it 00137 * will fit into memory. 00138 #define PNG_MAX_MALLOC_64K 00139 */ 00140 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) 00141 # define PNG_MAX_MALLOC_64K 00142 #endif 00143 00144 /* Special munging to support doing things the 'cygwin' way: 00145 * 'Normal' png-on-win32 defines/defaults: 00146 * PNG_BUILD_DLL -- building dll 00147 * PNG_USE_DLL -- building an application, linking to dll 00148 * (no define) -- building static library, or building an 00149 * application and linking to the static lib 00150 * 'Cygwin' defines/defaults: 00151 * PNG_BUILD_DLL -- (ignored) building the dll 00152 * (no define) -- (ignored) building an application, linking to the dll 00153 * PNG_STATIC -- (ignored) building the static lib, or building an 00154 * application that links to the static lib. 00155 * ALL_STATIC -- (ignored) building various static libs, or building an 00156 * application that links to the static libs. 00157 * Thus, 00158 * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and 00159 * this bit of #ifdefs will define the 'correct' config variables based on 00160 * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but 00161 * unnecessary. 00162 * 00163 * Also, the precedence order is: 00164 * ALL_STATIC (since we can't #undef something outside our namespace) 00165 * PNG_BUILD_DLL 00166 * PNG_STATIC 00167 * (nothing) == PNG_USE_DLL 00168 * 00169 * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent 00170 * of auto-import in binutils, we no longer need to worry about 00171 * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, 00172 * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes 00173 * to __declspec() stuff. However, we DO need to worry about 00174 * PNG_BUILD_DLL and PNG_STATIC because those change some defaults 00175 * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. 00176 */ 00177 #if defined(__CYGWIN__) 00178 # if defined(ALL_STATIC) 00179 # if defined(PNG_BUILD_DLL) 00180 # undef PNG_BUILD_DLL 00181 # endif 00182 # if defined(PNG_USE_DLL) 00183 # undef PNG_USE_DLL 00184 # endif 00185 # if defined(PNG_DLL) 00186 # undef PNG_DLL 00187 # endif 00188 # if !defined(PNG_STATIC) 00189 # define PNG_STATIC 00190 # endif 00191 # else 00192 # if defined (PNG_BUILD_DLL) 00193 # if defined(PNG_STATIC) 00194 # undef PNG_STATIC 00195 # endif 00196 # if defined(PNG_USE_DLL) 00197 # undef PNG_USE_DLL 00198 # endif 00199 # if !defined(PNG_DLL) 00200 # define PNG_DLL 00201 # endif 00202 # else 00203 # if defined(PNG_STATIC) 00204 # if defined(PNG_USE_DLL) 00205 # undef PNG_USE_DLL 00206 # endif 00207 # if defined(PNG_DLL) 00208 # undef PNG_DLL 00209 # endif 00210 # else 00211 # if !defined(PNG_USE_DLL) 00212 # define PNG_USE_DLL 00213 # endif 00214 # if !defined(PNG_DLL) 00215 # define PNG_DLL 00216 # endif 00217 # endif 00218 # endif 00219 # endif 00220 #endif 00221 00222 /* This protects us against compilers that run on a windowing system 00223 * and thus don't have or would rather us not use the stdio types: 00224 * stdin, stdout, and stderr. The only one currently used is stderr 00225 * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will 00226 * prevent these from being compiled and used. #defining PNG_NO_STDIO 00227 * will also prevent these, plus will prevent the entire set of stdio 00228 * macros and functions (FILE *, printf, etc.) from being compiled and used, 00229 * unless (PNG_DEBUG > 0) has been #defined. 00230 * 00231 * #define PNG_NO_CONSOLE_IO 00232 * #define PNG_NO_STDIO 00233 */ 00234 00235 #if defined(_WIN32_WCE) 00236 # include <windows.h> 00237 /* Console I/O functions are not supported on WindowsCE */ 00238 # define PNG_NO_CONSOLE_IO 00239 /* abort() may not be supported on some/all Windows CE platforms */ 00240 # define PNG_ABORT() exit(-1) 00241 # ifdef PNG_DEBUG 00242 # undef PNG_DEBUG 00243 # endif 00244 #endif 00245 00246 #ifdef PNG_BUILD_DLL 00247 # ifndef PNG_CONSOLE_IO_SUPPORTED 00248 # ifndef PNG_NO_CONSOLE_IO 00249 # define PNG_NO_CONSOLE_IO 00250 # endif 00251 # endif 00252 #endif 00253 00254 # ifdef PNG_NO_STDIO 00255 # ifndef PNG_NO_CONSOLE_IO 00256 # define PNG_NO_CONSOLE_IO 00257 # endif 00258 # ifdef PNG_DEBUG 00259 # if (PNG_DEBUG > 0) 00260 # include <stdio.h> 00261 # endif 00262 # endif 00263 # else 00264 # if !defined(_WIN32_WCE) 00265 /* "stdio.h" functions are not supported on WindowsCE */ 00266 # include <stdio.h> 00267 # endif 00268 # endif 00269 00270 /* This macro protects us against machines that don't have function 00271 * prototypes (ie K&R style headers). If your compiler does not handle 00272 * function prototypes, define this macro and use the included ansi2knr. 00273 * I've always been able to use _NO_PROTO as the indicator, but you may 00274 * need to drag the empty declaration out in front of here, or change the 00275 * ifdef to suit your own needs. 00276 */ 00277 #ifndef PNGARG 00278 00279 #ifdef OF /* zlib prototype munger */ 00280 # define PNGARG(arglist) OF(arglist) 00281 #else 00282 00283 #ifdef _NO_PROTO 00284 # define PNGARG(arglist) () 00285 # ifndef PNG_TYPECAST_NULL 00286 # define PNG_TYPECAST_NULL 00287 # endif 00288 #else 00289 # define PNGARG(arglist) arglist 00290 #endif /* _NO_PROTO */ 00291 00292 00293 #endif /* OF */ 00294 00295 #endif /* PNGARG */ 00296 00297 /* Try to determine if we are compiling on a Mac. Note that testing for 00298 * just __MWERKS__ is not good enough, because the Codewarrior is now used 00299 * on non-Mac platforms. 00300 */ 00301 #ifndef MACOS 00302 # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ 00303 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) 00304 # define MACOS 00305 # endif 00306 #endif 00307 00308 /* enough people need this for various reasons to include it here */ 00309 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) 00310 # include <sys/types.h> 00311 #endif 00312 00313 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) 00314 # define PNG_SETJMP_SUPPORTED 00315 #endif 00316 00317 #ifdef PNG_SETJMP_SUPPORTED 00318 /* This is an attempt to force a single setjmp behaviour on Linux. If 00319 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. 00320 * 00321 * You can bypass this test if you know that your application uses exactly 00322 * the same setjmp.h that was included when libpng was built. Only define 00323 * PNG_SKIP_SETJMP_CHECK while building your application, prior to the 00324 * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK 00325 * while building a separate libpng library for general use. 00326 */ 00327 00328 # ifndef PNG_SKIP_SETJMP_CHECK 00329 # ifdef __linux__ 00330 # ifdef _BSD_SOURCE 00331 # define PNG_SAVE_BSD_SOURCE 00332 # undef _BSD_SOURCE 00333 # endif 00334 # ifdef _SETJMP_H 00335 /* If you encounter a compiler error here, see the explanation 00336 * near the end of INSTALL. 00337 */ 00338 __pngconf.h__ in libpng already includes setjmp.h; 00339 __dont__ include it again.; 00340 # endif 00341 # endif /* __linux__ */ 00342 # endif /* PNG_SKIP_SETJMP_CHECK */ 00343 00344 /* include setjmp.h for error handling */ 00345 # include <setjmp.h> 00346 00347 # ifdef __linux__ 00348 # ifdef PNG_SAVE_BSD_SOURCE 00349 # ifndef _BSD_SOURCE 00350 # define _BSD_SOURCE 00351 # endif 00352 # undef PNG_SAVE_BSD_SOURCE 00353 # endif 00354 # endif /* __linux__ */ 00355 #endif /* PNG_SETJMP_SUPPORTED */ 00356 00357 #ifdef BSD 00358 # include <strings.h> 00359 #else 00360 # include <string.h> 00361 #endif 00362 00363 /* Other defines for things like memory and the like can go here. */ 00364 #ifdef PNG_INTERNAL 00365 00366 #include <stdlib.h> 00367 00368 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which 00369 * aren't usually used outside the library (as far as I know), so it is 00370 * debatable if they should be exported at all. In the future, when it is 00371 * possible to have run-time registry of chunk-handling functions, some of 00372 * these will be made available again. 00373 #define PNG_EXTERN extern 00374 */ 00375 #define PNG_EXTERN 00376 00377 /* Other defines specific to compilers can go here. Try to keep 00378 * them inside an appropriate ifdef/endif pair for portability. 00379 */ 00380 00381 #if defined(PNG_FLOATING_POINT_SUPPORTED) 00382 # if defined(MACOS) 00383 /* We need to check that <math.h> hasn't already been included earlier 00384 * as it seems it doesn't agree with <fp.h>, yet we should really use 00385 * <fp.h> if possible. 00386 */ 00387 # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) 00388 # include <fp.h> 00389 # endif 00390 # else 00391 # include <math.h> 00392 # endif 00393 # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) 00394 /* Amiga SAS/C: We must include builtin FPU functions when compiling using 00395 * MATH=68881 00396 */ 00397 # include <m68881.h> 00398 # endif 00399 #endif 00400 00401 /* Codewarrior on NT has linking problems without this. */ 00402 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) 00403 # define PNG_ALWAYS_EXTERN 00404 #endif 00405 00406 /* This provides the non-ANSI (far) memory allocation routines. */ 00407 #if defined(__TURBOC__) && defined(__MSDOS__) 00408 # include <mem.h> 00409 # include <alloc.h> 00410 #endif 00411 00412 /* I have no idea why is this necessary... */ 00413 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ 00414 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) 00415 # include <malloc.h> 00416 #endif 00417 00418 /* This controls how fine the dithering gets. As this allocates 00419 * a largish chunk of memory (32K), those who are not as concerned 00420 * with dithering quality can decrease some or all of these. 00421 */ 00422 #ifndef PNG_DITHER_RED_BITS 00423 # define PNG_DITHER_RED_BITS 5 00424 #endif 00425 #ifndef PNG_DITHER_GREEN_BITS 00426 # define PNG_DITHER_GREEN_BITS 5 00427 #endif 00428 #ifndef PNG_DITHER_BLUE_BITS 00429 # define PNG_DITHER_BLUE_BITS 5 00430 #endif 00431 00432 /* This controls how fine the gamma correction becomes when you 00433 * are only interested in 8 bits anyway. Increasing this value 00434 * results in more memory being used, and more pow() functions 00435 * being called to fill in the gamma tables. Don't set this value 00436 * less then 8, and even that may not work (I haven't tested it). 00437 */ 00438 00439 #ifndef PNG_MAX_GAMMA_8 00440 # define PNG_MAX_GAMMA_8 11 00441 #endif 00442 00443 /* This controls how much a difference in gamma we can tolerate before 00444 * we actually start doing gamma conversion. 00445 */ 00446 #ifndef PNG_GAMMA_THRESHOLD 00447 # define PNG_GAMMA_THRESHOLD 0.05 00448 #endif 00449 00450 #endif /* PNG_INTERNAL */ 00451 00452 /* The following uses const char * instead of char * for error 00453 * and warning message functions, so some compilers won't complain. 00454 * If you do not want to use const, define PNG_NO_CONST here. 00455 */ 00456 00457 #ifndef PNG_NO_CONST 00458 # define PNG_CONST const 00459 #else 00460 # define PNG_CONST 00461 #endif 00462 00463 /* The following defines give you the ability to remove code from the 00464 * library that you will not be using. I wish I could figure out how to 00465 * automate this, but I can't do that without making it seriously hard 00466 * on the users. So if you are not using an ability, change the #define 00467 * to and #undef, and that part of the library will not be compiled. If 00468 * your linker can't find a function, you may want to make sure the 00469 * ability is defined here. Some of these depend upon some others being 00470 * defined. I haven't figured out all the interactions here, so you may 00471 * have to experiment awhile to get everything to compile. If you are 00472 * creating or using a shared library, you probably shouldn't touch this, 00473 * as it will affect the size of the structures, and this will cause bad 00474 * things to happen if the library and/or application ever change. 00475 */ 00476 00477 /* Any features you will not be using can be undef'ed here */ 00478 00479 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user 00480 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS 00481 * on the compile line, then pick and choose which ones to define without 00482 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED 00483 * if you only want to have a png-compliant reader/writer but don't need 00484 * any of the extra transformations. This saves about 80 kbytes in a 00485 * typical installation of the library. (PNG_NO_* form added in version 00486 * 1.0.1c, for consistency) 00487 */ 00488 00489 /* The size of the png_text structure changed in libpng-1.0.6 when 00490 * iTXt support was added. iTXt support was turned off by default through 00491 * libpng-1.2.x, to support old apps that malloc the png_text structure 00492 * instead of calling png_set_text() and letting libpng malloc it. It 00493 * will be turned on by default in libpng-1.4.0. 00494 */ 00495 00496 #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 00497 # ifndef PNG_NO_iTXt_SUPPORTED 00498 # define PNG_NO_iTXt_SUPPORTED 00499 # endif 00500 # ifndef PNG_NO_READ_iTXt 00501 # define PNG_NO_READ_iTXt 00502 # endif 00503 # ifndef PNG_NO_WRITE_iTXt 00504 # define PNG_NO_WRITE_iTXt 00505 # endif 00506 #endif 00507 00508 #if !defined(PNG_NO_iTXt_SUPPORTED) 00509 # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) 00510 # define PNG_READ_iTXt 00511 # endif 00512 # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) 00513 # define PNG_WRITE_iTXt 00514 # endif 00515 #endif 00516 00517 /* The following support, added after version 1.0.0, can be turned off here en 00518 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility 00519 * with old applications that require the length of png_struct and png_info 00520 * to remain unchanged. 00521 */ 00522 00523 #ifdef PNG_LEGACY_SUPPORTED 00524 # define PNG_NO_FREE_ME 00525 # define PNG_NO_READ_UNKNOWN_CHUNKS 00526 # define PNG_NO_WRITE_UNKNOWN_CHUNKS 00527 # define PNG_NO_HANDLE_AS_UNKNOWN 00528 # define PNG_NO_READ_USER_CHUNKS 00529 # define PNG_NO_READ_iCCP 00530 # define PNG_NO_WRITE_iCCP 00531 # define PNG_NO_READ_iTXt 00532 # define PNG_NO_WRITE_iTXt 00533 # define PNG_NO_READ_sCAL 00534 # define PNG_NO_WRITE_sCAL 00535 # define PNG_NO_READ_sPLT 00536 # define PNG_NO_WRITE_sPLT 00537 # define PNG_NO_INFO_IMAGE 00538 # define PNG_NO_READ_RGB_TO_GRAY 00539 # define PNG_NO_READ_USER_TRANSFORM 00540 # define PNG_NO_WRITE_USER_TRANSFORM 00541 # define PNG_NO_USER_MEM 00542 # define PNG_NO_READ_EMPTY_PLTE 00543 # define PNG_NO_MNG_FEATURES 00544 # define PNG_NO_FIXED_POINT_SUPPORTED 00545 #endif 00546 00547 /* Ignore attempt to turn off both floating and fixed point support */ 00548 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ 00549 !defined(PNG_NO_FIXED_POINT_SUPPORTED) 00550 # define PNG_FIXED_POINT_SUPPORTED 00551 #endif 00552 00553 #ifndef PNG_NO_FREE_ME 00554 # define PNG_FREE_ME_SUPPORTED 00555 #endif 00556 00557 #ifdef PNG_READ_SUPPORTED 00558 00559 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ 00560 !defined(PNG_NO_READ_TRANSFORMS) 00561 # define PNG_READ_TRANSFORMS_SUPPORTED 00562 #endif 00563 00564 #ifdef PNG_READ_TRANSFORMS_SUPPORTED 00565 # ifndef PNG_NO_READ_EXPAND 00566 # define PNG_READ_EXPAND_SUPPORTED 00567 # endif 00568 # ifndef PNG_NO_READ_SHIFT 00569 # define PNG_READ_SHIFT_SUPPORTED 00570 # endif 00571 # ifndef PNG_NO_READ_PACK 00572 # define PNG_READ_PACK_SUPPORTED 00573 # endif 00574 # ifndef PNG_NO_READ_BGR 00575 # define PNG_READ_BGR_SUPPORTED 00576 # endif 00577 # ifndef PNG_NO_READ_SWAP 00578 # define PNG_READ_SWAP_SUPPORTED 00579 # endif 00580 # ifndef PNG_NO_READ_PACKSWAP 00581 # define PNG_READ_PACKSWAP_SUPPORTED 00582 # endif 00583 # ifndef PNG_NO_READ_INVERT 00584 # define PNG_READ_INVERT_SUPPORTED 00585 # endif 00586 # ifndef PNG_NO_READ_DITHER 00587 # define PNG_READ_DITHER_SUPPORTED 00588 # endif 00589 # ifndef PNG_NO_READ_BACKGROUND 00590 # define PNG_READ_BACKGROUND_SUPPORTED 00591 # endif 00592 # ifndef PNG_NO_READ_16_TO_8 00593 # define PNG_READ_16_TO_8_SUPPORTED 00594 # endif 00595 # ifndef PNG_NO_READ_FILLER 00596 # define PNG_READ_FILLER_SUPPORTED 00597 # endif 00598 # ifndef PNG_NO_READ_GAMMA 00599 # define PNG_READ_GAMMA_SUPPORTED 00600 # endif 00601 # ifndef PNG_NO_READ_GRAY_TO_RGB 00602 # define PNG_READ_GRAY_TO_RGB_SUPPORTED 00603 # endif 00604 # ifndef PNG_NO_READ_SWAP_ALPHA 00605 # define PNG_READ_SWAP_ALPHA_SUPPORTED 00606 # endif 00607 # ifndef PNG_NO_READ_INVERT_ALPHA 00608 # define PNG_READ_INVERT_ALPHA_SUPPORTED 00609 # endif 00610 # ifndef PNG_NO_READ_STRIP_ALPHA 00611 # define PNG_READ_STRIP_ALPHA_SUPPORTED 00612 # endif 00613 # ifndef PNG_NO_READ_USER_TRANSFORM 00614 # define PNG_READ_USER_TRANSFORM_SUPPORTED 00615 # endif 00616 # ifndef PNG_NO_READ_RGB_TO_GRAY 00617 # define PNG_READ_RGB_TO_GRAY_SUPPORTED 00618 # endif 00619 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ 00620 00621 #if !defined(PNG_NO_PROGRESSIVE_READ) && \ 00622 !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ 00623 # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ 00624 #endif /* about interlacing capability! You'll */ 00625 /* still have interlacing unless you change the following line: */ 00626 00627 #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ 00628 00629 #ifndef PNG_NO_READ_COMPOSITE_NODIV 00630 # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ 00631 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ 00632 # endif 00633 #endif 00634 00635 #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 00636 /* Deprecated, will be removed from version 2.0.0. 00637 Use PNG_MNG_FEATURES_SUPPORTED instead. */ 00638 #ifndef PNG_NO_READ_EMPTY_PLTE 00639 # define PNG_READ_EMPTY_PLTE_SUPPORTED 00640 #endif 00641 #endif 00642 00643 #endif /* PNG_READ_SUPPORTED */ 00644 00645 #ifdef PNG_WRITE_SUPPORTED 00646 00647 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ 00648 !defined(PNG_NO_WRITE_TRANSFORMS) 00649 # define PNG_WRITE_TRANSFORMS_SUPPORTED 00650 #endif 00651 00652 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED 00653 # ifndef PNG_NO_WRITE_SHIFT 00654 # define PNG_WRITE_SHIFT_SUPPORTED 00655 # endif 00656 # ifndef PNG_NO_WRITE_PACK 00657 # define PNG_WRITE_PACK_SUPPORTED 00658 # endif 00659 # ifndef PNG_NO_WRITE_BGR 00660 # define PNG_WRITE_BGR_SUPPORTED 00661 # endif 00662 # ifndef PNG_NO_WRITE_SWAP 00663 # define PNG_WRITE_SWAP_SUPPORTED 00664 # endif 00665 # ifndef PNG_NO_WRITE_PACKSWAP 00666 # define PNG_WRITE_PACKSWAP_SUPPORTED 00667 # endif 00668 # ifndef PNG_NO_WRITE_INVERT 00669 # define PNG_WRITE_INVERT_SUPPORTED 00670 # endif 00671 # ifndef PNG_NO_WRITE_FILLER 00672 # define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ 00673 # endif 00674 # ifndef PNG_NO_WRITE_SWAP_ALPHA 00675 # define PNG_WRITE_SWAP_ALPHA_SUPPORTED 00676 # endif 00677 # ifndef PNG_NO_WRITE_INVERT_ALPHA 00678 # define PNG_WRITE_INVERT_ALPHA_SUPPORTED 00679 # endif 00680 # ifndef PNG_NO_WRITE_USER_TRANSFORM 00681 # define PNG_WRITE_USER_TRANSFORM_SUPPORTED 00682 # endif 00683 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ 00684 00685 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ 00686 !defined(PNG_WRITE_INTERLACING_SUPPORTED) 00687 #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant 00688 encoders, but can cause trouble 00689 if left undefined */ 00690 #endif 00691 00692 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ 00693 !defined(PNG_WRITE_WEIGHTED_FILTER) && \ 00694 defined(PNG_FLOATING_POINT_SUPPORTED) 00695 # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED 00696 #endif 00697 00698 #ifndef PNG_NO_WRITE_FLUSH 00699 # define PNG_WRITE_FLUSH_SUPPORTED 00700 #endif 00701 00702 #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 00703 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ 00704 #ifndef PNG_NO_WRITE_EMPTY_PLTE 00705 # define PNG_WRITE_EMPTY_PLTE_SUPPORTED 00706 #endif 00707 #endif 00708 00709 #endif /* PNG_WRITE_SUPPORTED */ 00710 00711 #ifndef PNG_1_0_X 00712 # ifndef PNG_NO_ERROR_NUMBERS 00713 # define PNG_ERROR_NUMBERS_SUPPORTED 00714 # endif 00715 #endif /* PNG_1_0_X */ 00716 00717 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ 00718 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) 00719 # ifndef PNG_NO_USER_TRANSFORM_PTR 00720 # define PNG_USER_TRANSFORM_PTR_SUPPORTED 00721 # endif 00722 #endif 00723 00724 #ifndef PNG_NO_STDIO 00725 # define PNG_TIME_RFC1123_SUPPORTED 00726 #endif 00727 00728 /* This adds extra functions in pngget.c for accessing data from the 00729 * info pointer (added in version 0.99) 00730 * png_get_image_width() 00731 * png_get_image_height() 00732 * png_get_bit_depth() 00733 * png_get_color_type() 00734 * png_get_compression_type() 00735 * png_get_filter_type() 00736 * png_get_interlace_type() 00737 * png_get_pixel_aspect_ratio() 00738 * png_get_pixels_per_meter() 00739 * png_get_x_offset_pixels() 00740 * png_get_y_offset_pixels() 00741 * png_get_x_offset_microns() 00742 * png_get_y_offset_microns() 00743 */ 00744 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) 00745 # define PNG_EASY_ACCESS_SUPPORTED 00746 #endif 00747 00748 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 00749 * and removed from version 1.2.20. The following will be removed 00750 * from libpng-1.4.0 00751 */ 00752 00753 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) 00754 # ifndef PNG_OPTIMIZED_CODE_SUPPORTED 00755 # define PNG_OPTIMIZED_CODE_SUPPORTED 00756 # endif 00757 #endif 00758 00759 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) 00760 # ifndef PNG_ASSEMBLER_CODE_SUPPORTED 00761 # define PNG_ASSEMBLER_CODE_SUPPORTED 00762 # endif 00763 00764 # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) 00765 /* work around 64-bit gcc compiler bugs in gcc-3.x */ 00766 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 00767 # define PNG_NO_MMX_CODE 00768 # endif 00769 # endif 00770 00771 # if defined(__APPLE__) 00772 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 00773 # define PNG_NO_MMX_CODE 00774 # endif 00775 # endif 00776 00777 # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) 00778 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 00779 # define PNG_NO_MMX_CODE 00780 # endif 00781 # endif 00782 00783 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 00784 # define PNG_MMX_CODE_SUPPORTED 00785 # endif 00786 00787 #endif 00788 /* end of obsolete code to be removed from libpng-1.4.0 */ 00789 00790 #if !defined(PNG_1_0_X) 00791 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) 00792 # define PNG_USER_MEM_SUPPORTED 00793 #endif 00794 #endif /* PNG_1_0_X */ 00795 00796 /* Added at libpng-1.2.6 */ 00797 #if !defined(PNG_1_0_X) 00798 #ifndef PNG_SET_USER_LIMITS_SUPPORTED 00799 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) 00800 # define PNG_SET_USER_LIMITS_SUPPORTED 00801 #endif 00802 #endif 00803 #endif /* PNG_1_0_X */ 00804 00805 /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter 00806 * how large, set these limits to 0x7fffffffL 00807 */ 00808 #ifndef PNG_USER_WIDTH_MAX 00809 # define PNG_USER_WIDTH_MAX 1000000L 00810 #endif 00811 #ifndef PNG_USER_HEIGHT_MAX 00812 # define PNG_USER_HEIGHT_MAX 1000000L 00813 #endif 00814 00815 /* Added at libpng-1.2.34 and 1.4.0 */ 00816 #ifndef PNG_STRING_NEWLINE 00817 #define PNG_STRING_NEWLINE "\n" 00818 #endif 00819 00820 /* These are currently experimental features, define them if you want */ 00821 00822 /* very little testing */ 00823 /* 00824 #ifdef PNG_READ_SUPPORTED 00825 # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED 00826 # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED 00827 # endif 00828 #endif 00829 */ 00830 00831 /* This is only for PowerPC big-endian and 680x0 systems */ 00832 /* some testing */ 00833 /* 00834 #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED 00835 # define PNG_READ_BIG_ENDIAN_SUPPORTED 00836 #endif 00837 */ 00838 00839 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */ 00840 /* 00841 #define PNG_NO_POINTER_INDEXING 00842 */ 00843 00844 /* These functions are turned off by default, as they will be phased out. */ 00845 /* 00846 #define PNG_USELESS_TESTS_SUPPORTED 00847 #define PNG_CORRECT_PALETTE_SUPPORTED 00848 */ 00849 00850 /* Any chunks you are not interested in, you can undef here. The 00851 * ones that allocate memory may be expecially important (hIST, 00852 * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info 00853 * a bit smaller. 00854 */ 00855 00856 #if defined(PNG_READ_SUPPORTED) && \ 00857 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ 00858 !defined(PNG_NO_READ_ANCILLARY_CHUNKS) 00859 # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED 00860 #endif 00861 00862 #if defined(PNG_WRITE_SUPPORTED) && \ 00863 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ 00864 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) 00865 # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED 00866 #endif 00867 00868 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED 00869 00870 #ifdef PNG_NO_READ_TEXT 00871 # define PNG_NO_READ_iTXt 00872 # define PNG_NO_READ_tEXt 00873 # define PNG_NO_READ_zTXt 00874 #endif 00875 #ifndef PNG_NO_READ_bKGD 00876 # define PNG_READ_bKGD_SUPPORTED 00877 # define PNG_bKGD_SUPPORTED 00878 #endif 00879 #ifndef PNG_NO_READ_cHRM 00880 # define PNG_READ_cHRM_SUPPORTED 00881 # define PNG_cHRM_SUPPORTED 00882 #endif 00883 #ifndef PNG_NO_READ_gAMA 00884 # define PNG_READ_gAMA_SUPPORTED 00885 # define PNG_gAMA_SUPPORTED 00886 #endif 00887 #ifndef PNG_NO_READ_hIST 00888 # define PNG_READ_hIST_SUPPORTED 00889 # define PNG_hIST_SUPPORTED 00890 #endif 00891 #ifndef PNG_NO_READ_iCCP 00892 # define PNG_READ_iCCP_SUPPORTED 00893 # define PNG_iCCP_SUPPORTED 00894 #endif 00895 #ifndef PNG_NO_READ_iTXt 00896 # ifndef PNG_READ_iTXt_SUPPORTED 00897 # define PNG_READ_iTXt_SUPPORTED 00898 # endif 00899 # ifndef PNG_iTXt_SUPPORTED 00900 # define PNG_iTXt_SUPPORTED 00901 # endif 00902 #endif 00903 #ifndef PNG_NO_READ_oFFs 00904 # define PNG_READ_oFFs_SUPPORTED 00905 # define PNG_oFFs_SUPPORTED 00906 #endif 00907 #ifndef PNG_NO_READ_pCAL 00908 # define PNG_READ_pCAL_SUPPORTED 00909 # define PNG_pCAL_SUPPORTED 00910 #endif 00911 #ifndef PNG_NO_READ_sCAL 00912 # define PNG_READ_sCAL_SUPPORTED 00913 # define PNG_sCAL_SUPPORTED 00914 #endif 00915 #ifndef PNG_NO_READ_pHYs 00916 # define PNG_READ_pHYs_SUPPORTED 00917 # define PNG_pHYs_SUPPORTED 00918 #endif 00919 #ifndef PNG_NO_READ_sBIT 00920 # define PNG_READ_sBIT_SUPPORTED 00921 # define PNG_sBIT_SUPPORTED 00922 #endif 00923 #ifndef PNG_NO_READ_sPLT 00924 # define PNG_READ_sPLT_SUPPORTED 00925 # define PNG_sPLT_SUPPORTED 00926 #endif 00927 #ifndef PNG_NO_READ_sRGB 00928 # define PNG_READ_sRGB_SUPPORTED 00929 # define PNG_sRGB_SUPPORTED 00930 #endif 00931 #ifndef PNG_NO_READ_tEXt 00932 # define PNG_READ_tEXt_SUPPORTED 00933 # define PNG_tEXt_SUPPORTED 00934 #endif 00935 #ifndef PNG_NO_READ_tIME 00936 # define PNG_READ_tIME_SUPPORTED 00937 # define PNG_tIME_SUPPORTED 00938 #endif 00939 #ifndef PNG_NO_READ_tRNS 00940 # define PNG_READ_tRNS_SUPPORTED 00941 # define PNG_tRNS_SUPPORTED 00942 #endif 00943 #ifndef PNG_NO_READ_zTXt 00944 # define PNG_READ_zTXt_SUPPORTED 00945 # define PNG_zTXt_SUPPORTED 00946 #endif 00947 #ifndef PNG_NO_READ_OPT_PLTE 00948 # define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ 00949 #endif /* optional PLTE chunk in RGB and RGBA images */ 00950 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ 00951 defined(PNG_READ_zTXt_SUPPORTED) 00952 # define PNG_READ_TEXT_SUPPORTED 00953 # define PNG_TEXT_SUPPORTED 00954 #endif 00955 00956 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ 00957 00958 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS 00959 # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED 00960 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED 00961 # define PNG_UNKNOWN_CHUNKS_SUPPORTED 00962 # endif 00963 #endif 00964 #if !defined(PNG_NO_READ_USER_CHUNKS) && \ 00965 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) 00966 # define PNG_READ_USER_CHUNKS_SUPPORTED 00967 # define PNG_USER_CHUNKS_SUPPORTED 00968 # ifdef PNG_NO_READ_UNKNOWN_CHUNKS 00969 # undef PNG_NO_READ_UNKNOWN_CHUNKS 00970 # endif 00971 # ifdef PNG_NO_HANDLE_AS_UNKNOWN 00972 # undef PNG_NO_HANDLE_AS_UNKNOWN 00973 # endif 00974 #endif 00975 00976 #ifndef PNG_NO_HANDLE_AS_UNKNOWN 00977 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 00978 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED 00979 # endif 00980 #endif 00981 00982 #ifdef PNG_WRITE_SUPPORTED 00983 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED 00984 00985 #ifdef PNG_NO_WRITE_TEXT 00986 # define PNG_NO_WRITE_iTXt 00987 # define PNG_NO_WRITE_tEXt 00988 # define PNG_NO_WRITE_zTXt 00989 #endif 00990 #ifndef PNG_NO_WRITE_bKGD 00991 # define PNG_WRITE_bKGD_SUPPORTED 00992 # ifndef PNG_bKGD_SUPPORTED 00993 # define PNG_bKGD_SUPPORTED 00994 # endif 00995 #endif 00996 #ifndef PNG_NO_WRITE_cHRM 00997 # define PNG_WRITE_cHRM_SUPPORTED 00998 # ifndef PNG_cHRM_SUPPORTED 00999 # define PNG_cHRM_SUPPORTED 01000 # endif 01001 #endif 01002 #ifndef PNG_NO_WRITE_gAMA 01003 # define PNG_WRITE_gAMA_SUPPORTED 01004 # ifndef PNG_gAMA_SUPPORTED 01005 # define PNG_gAMA_SUPPORTED 01006 # endif 01007 #endif 01008 #ifndef PNG_NO_WRITE_hIST 01009 # define PNG_WRITE_hIST_SUPPORTED 01010 # ifndef PNG_hIST_SUPPORTED 01011 # define PNG_hIST_SUPPORTED 01012 # endif 01013 #endif 01014 #ifndef PNG_NO_WRITE_iCCP 01015 # define PNG_WRITE_iCCP_SUPPORTED 01016 # ifndef PNG_iCCP_SUPPORTED 01017 # define PNG_iCCP_SUPPORTED 01018 # endif 01019 #endif 01020 #ifndef PNG_NO_WRITE_iTXt 01021 # ifndef PNG_WRITE_iTXt_SUPPORTED 01022 # define PNG_WRITE_iTXt_SUPPORTED 01023 # endif 01024 # ifndef PNG_iTXt_SUPPORTED 01025 # define PNG_iTXt_SUPPORTED 01026 # endif 01027 #endif 01028 #ifndef PNG_NO_WRITE_oFFs 01029 # define PNG_WRITE_oFFs_SUPPORTED 01030 # ifndef PNG_oFFs_SUPPORTED 01031 # define PNG_oFFs_SUPPORTED 01032 # endif 01033 #endif 01034 #ifndef PNG_NO_WRITE_pCAL 01035 # define PNG_WRITE_pCAL_SUPPORTED 01036 # ifndef PNG_pCAL_SUPPORTED 01037 # define PNG_pCAL_SUPPORTED 01038 # endif 01039 #endif 01040 #ifndef PNG_NO_WRITE_sCAL 01041 # define PNG_WRITE_sCAL_SUPPORTED 01042 # ifndef PNG_sCAL_SUPPORTED 01043 # define PNG_sCAL_SUPPORTED 01044 # endif 01045 #endif 01046 #ifndef PNG_NO_WRITE_pHYs 01047 # define PNG_WRITE_pHYs_SUPPORTED 01048 # ifndef PNG_pHYs_SUPPORTED 01049 # define PNG_pHYs_SUPPORTED 01050 # endif 01051 #endif 01052 #ifndef PNG_NO_WRITE_sBIT 01053 # define PNG_WRITE_sBIT_SUPPORTED 01054 # ifndef PNG_sBIT_SUPPORTED 01055 # define PNG_sBIT_SUPPORTED 01056 # endif 01057 #endif 01058 #ifndef PNG_NO_WRITE_sPLT 01059 # define PNG_WRITE_sPLT_SUPPORTED 01060 # ifndef PNG_sPLT_SUPPORTED 01061 # define PNG_sPLT_SUPPORTED 01062 # endif 01063 #endif 01064 #ifndef PNG_NO_WRITE_sRGB 01065 # define PNG_WRITE_sRGB_SUPPORTED 01066 # ifndef PNG_sRGB_SUPPORTED 01067 # define PNG_sRGB_SUPPORTED 01068 # endif 01069 #endif 01070 #ifndef PNG_NO_WRITE_tEXt 01071 # define PNG_WRITE_tEXt_SUPPORTED 01072 # ifndef PNG_tEXt_SUPPORTED 01073 # define PNG_tEXt_SUPPORTED 01074 # endif 01075 #endif 01076 #ifndef PNG_NO_WRITE_tIME 01077 # define PNG_WRITE_tIME_SUPPORTED 01078 # ifndef PNG_tIME_SUPPORTED 01079 # define PNG_tIME_SUPPORTED 01080 # endif 01081 #endif 01082 #ifndef PNG_NO_WRITE_tRNS 01083 # define PNG_WRITE_tRNS_SUPPORTED 01084 # ifndef PNG_tRNS_SUPPORTED 01085 # define PNG_tRNS_SUPPORTED 01086 # endif 01087 #endif 01088 #ifndef PNG_NO_WRITE_zTXt 01089 # define PNG_WRITE_zTXt_SUPPORTED 01090 # ifndef PNG_zTXt_SUPPORTED 01091 # define PNG_zTXt_SUPPORTED 01092 # endif 01093 #endif 01094 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ 01095 defined(PNG_WRITE_zTXt_SUPPORTED) 01096 # define PNG_WRITE_TEXT_SUPPORTED 01097 # ifndef PNG_TEXT_SUPPORTED 01098 # define PNG_TEXT_SUPPORTED 01099 # endif 01100 #endif 01101 01102 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ 01103 01104 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS 01105 # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 01106 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED 01107 # define PNG_UNKNOWN_CHUNKS_SUPPORTED 01108 # endif 01109 #endif 01110 01111 #ifndef PNG_NO_HANDLE_AS_UNKNOWN 01112 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 01113 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED 01114 # endif 01115 #endif 01116 #endif /* PNG_WRITE_SUPPORTED */ 01117 01118 /* Turn this off to disable png_read_png() and 01119 * png_write_png() and leave the row_pointers member 01120 * out of the info structure. 01121 */ 01122 #ifndef PNG_NO_INFO_IMAGE 01123 # define PNG_INFO_IMAGE_SUPPORTED 01124 #endif 01125 01126 /* need the time information for reading tIME chunks */ 01127 #if defined(PNG_tIME_SUPPORTED) 01128 # if !defined(_WIN32_WCE) 01129 /* "time.h" functions are not supported on WindowsCE */ 01130 # include <time.h> 01131 # endif 01132 #endif 01133 01134 /* Some typedefs to get us started. These should be safe on most of the 01135 * common platforms. The typedefs should be at least as large as the 01136 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they 01137 * don't have to be exactly that size. Some compilers dislike passing 01138 * unsigned shorts as function parameters, so you may be better off using 01139 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may 01140 * want to have unsigned int for png_uint_32 instead of unsigned long. 01141 */ 01142 01143 typedef unsigned long png_uint_32; 01144 typedef long png_int_32; 01145 typedef unsigned short png_uint_16; 01146 typedef short png_int_16; 01147 typedef unsigned char png_byte; 01148 01149 /* This is usually size_t. It is typedef'ed just in case you need it to 01150 change (I'm not sure if you will or not, so I thought I'd be safe) */ 01151 #ifdef PNG_SIZE_T 01152 typedef PNG_SIZE_T png_size_t; 01153 # define png_sizeof(x) png_convert_size(sizeof(x)) 01154 #else 01155 typedef size_t png_size_t; 01156 # define png_sizeof(x) sizeof(x) 01157 #endif 01158 01159 /* The following is needed for medium model support. It cannot be in the 01160 * PNG_INTERNAL section. Needs modification for other compilers besides 01161 * MSC. Model independent support declares all arrays and pointers to be 01162 * large using the far keyword. The zlib version used must also support 01163 * model independent data. As of version zlib 1.0.4, the necessary changes 01164 * have been made in zlib. The USE_FAR_KEYWORD define triggers other 01165 * changes that are needed. (Tim Wegner) 01166 */ 01167 01168 /* Separate compiler dependencies (problem here is that zlib.h always 01169 defines FAR. (SJT) */ 01170 #ifdef __BORLANDC__ 01171 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) 01172 # define LDATA 1 01173 # else 01174 # define LDATA 0 01175 # endif 01176 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ 01177 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) 01178 # define PNG_MAX_MALLOC_64K 01179 # if (LDATA != 1) 01180 # ifndef FAR 01181 # define FAR __far 01182 # endif 01183 # define USE_FAR_KEYWORD 01184 # endif /* LDATA != 1 */ 01185 /* Possibly useful for moving data out of default segment. 01186 * Uncomment it if you want. Could also define FARDATA as 01187 * const if your compiler supports it. (SJT) 01188 # define FARDATA FAR 01189 */ 01190 # endif /* __WIN32__, __FLAT__, __CYGWIN__ */ 01191 #endif /* __BORLANDC__ */ 01192 01193 01194 /* Suggest testing for specific compiler first before testing for 01195 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, 01196 * making reliance oncertain keywords suspect. (SJT) 01197 */ 01198 01199 /* MSC Medium model */ 01200 #if defined(FAR) 01201 # if defined(M_I86MM) 01202 # define USE_FAR_KEYWORD 01203 # define FARDATA FAR 01204 # include <dos.h> 01205 # endif 01206 #endif 01207 01208 /* SJT: default case */ 01209 #ifndef FAR 01210 # define FAR 01211 #endif 01212 01213 /* At this point FAR is always defined */ 01214 #ifndef FARDATA 01215 # define FARDATA 01216 #endif 01217 01218 /* Typedef for floating-point numbers that are converted 01219 to fixed-point with a multiple of 100,000, e.g., int_gamma */ 01220 typedef png_int_32 png_fixed_point; 01221 01222 /* Add typedefs for pointers */ 01223 typedef void FAR * png_voidp; 01224 typedef png_byte FAR * png_bytep; 01225 typedef png_uint_32 FAR * png_uint_32p; 01226 typedef png_int_32 FAR * png_int_32p; 01227 typedef png_uint_16 FAR * png_uint_16p; 01228 typedef png_int_16 FAR * png_int_16p; 01229 typedef PNG_CONST char FAR * png_const_charp; 01230 typedef char FAR * png_charp; 01231 typedef png_fixed_point FAR * png_fixed_point_p; 01232 01233 #ifndef PNG_NO_STDIO 01234 #if defined(_WIN32_WCE) 01235 typedef HANDLE png_FILE_p; 01236 #else 01237 typedef FILE * png_FILE_p; 01238 #endif 01239 #endif 01240 01241 #ifdef PNG_FLOATING_POINT_SUPPORTED 01242 typedef double FAR * png_doublep; 01243 #endif 01244 01245 /* Pointers to pointers; i.e. arrays */ 01246 typedef png_byte FAR * FAR * png_bytepp; 01247 typedef png_uint_32 FAR * FAR * png_uint_32pp; 01248 typedef png_int_32 FAR * FAR * png_int_32pp; 01249 typedef png_uint_16 FAR * FAR * png_uint_16pp; 01250 typedef png_int_16 FAR * FAR * png_int_16pp; 01251 typedef PNG_CONST char FAR * FAR * png_const_charpp; 01252 typedef char FAR * FAR * png_charpp; 01253 typedef png_fixed_point FAR * FAR * png_fixed_point_pp; 01254 #ifdef PNG_FLOATING_POINT_SUPPORTED 01255 typedef double FAR * FAR * png_doublepp; 01256 #endif 01257 01258 /* Pointers to pointers to pointers; i.e., pointer to array */ 01259 typedef char FAR * FAR * FAR * png_charppp; 01260 01261 #if defined(PNG_1_0_X) || defined(PNG_1_2_X) 01262 /* SPC - Is this stuff deprecated? */ 01263 /* It'll be removed as of libpng-1.4.0 - GR-P */ 01264 /* libpng typedefs for types in zlib. If zlib changes 01265 * or another compression library is used, then change these. 01266 * Eliminates need to change all the source files. 01267 */ 01268 typedef charf * png_zcharp; 01269 typedef charf * FAR * png_zcharpp; 01270 typedef z_stream FAR * png_zstreamp; 01271 #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ 01272 01273 /* 01274 * Define PNG_BUILD_DLL if the module being built is a Windows 01275 * LIBPNG DLL. 01276 * 01277 * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. 01278 * It is equivalent to Microsoft predefined macro _DLL that is 01279 * automatically defined when you compile using the share 01280 * version of the CRT (C Run-Time library) 01281 * 01282 * The cygwin mods make this behavior a little different: 01283 * Define PNG_BUILD_DLL if you are building a dll for use with cygwin 01284 * Define PNG_STATIC if you are building a static library for use with cygwin, 01285 * -or- if you are building an application that you want to link to the 01286 * static library. 01287 * PNG_USE_DLL is defined by default (no user action needed) unless one of 01288 * the other flags is defined. 01289 */ 01290 01291 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) 01292 # define PNG_DLL 01293 #endif 01294 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. 01295 * When building a static lib, default to no GLOBAL ARRAYS, but allow 01296 * command-line override 01297 */ 01298 #if defined(__CYGWIN__) 01299 # if !defined(PNG_STATIC) 01300 # if defined(PNG_USE_GLOBAL_ARRAYS) 01301 # undef PNG_USE_GLOBAL_ARRAYS 01302 # endif 01303 # if !defined(PNG_USE_LOCAL_ARRAYS) 01304 # define PNG_USE_LOCAL_ARRAYS 01305 # endif 01306 # else 01307 # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) 01308 # if defined(PNG_USE_GLOBAL_ARRAYS) 01309 # undef PNG_USE_GLOBAL_ARRAYS 01310 # endif 01311 # endif 01312 # endif 01313 # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) 01314 # define PNG_USE_LOCAL_ARRAYS 01315 # endif 01316 #endif 01317 01318 /* Do not use global arrays (helps with building DLL's) 01319 * They are no longer used in libpng itself, since version 1.0.5c, 01320 * but might be required for some pre-1.0.5c applications. 01321 */ 01322 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) 01323 # if defined(PNG_NO_GLOBAL_ARRAYS) || \ 01324 (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) 01325 # define PNG_USE_LOCAL_ARRAYS 01326 # else 01327 # define PNG_USE_GLOBAL_ARRAYS 01328 # endif 01329 #endif 01330 01331 #if defined(__CYGWIN__) 01332 # undef PNGAPI 01333 # define PNGAPI __cdecl 01334 # undef PNG_IMPEXP 01335 # define PNG_IMPEXP 01336 #endif 01337 01338 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", 01339 * you may get warnings regarding the linkage of png_zalloc and png_zfree. 01340 * Don't ignore those warnings; you must also reset the default calling 01341 * convention in your compiler to match your PNGAPI, and you must build 01342 * zlib and your applications the same way you build libpng. 01343 */ 01344 01345 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF) 01346 # ifndef PNG_NO_MODULEDEF 01347 # define PNG_NO_MODULEDEF 01348 # endif 01349 #endif 01350 01351 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) 01352 # define PNG_IMPEXP 01353 #endif 01354 01355 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ 01356 (( defined(_Windows) || defined(_WINDOWS) || \ 01357 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) 01358 01359 # ifndef PNGAPI 01360 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) 01361 # define PNGAPI __cdecl 01362 # else 01363 # define PNGAPI _cdecl 01364 # endif 01365 # endif 01366 01367 # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ 01368 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) 01369 # define PNG_IMPEXP 01370 # endif 01371 01372 # if !defined(PNG_IMPEXP) 01373 01374 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol 01375 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol 01376 01377 /* Borland/Microsoft */ 01378 # if defined(_MSC_VER) || defined(__BORLANDC__) 01379 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) 01380 # define PNG_EXPORT PNG_EXPORT_TYPE1 01381 # else 01382 # define PNG_EXPORT PNG_EXPORT_TYPE2 01383 # if defined(PNG_BUILD_DLL) 01384 # define PNG_IMPEXP __export 01385 # else 01386 # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in 01387 VC++ */ 01388 # endif /* Exists in Borland C++ for 01389 C++ classes (== huge) */ 01390 # endif 01391 # endif 01392 01393 # if !defined(PNG_IMPEXP) 01394 # if defined(PNG_BUILD_DLL) 01395 # define PNG_IMPEXP __declspec(dllexport) 01396 # else 01397 # define PNG_IMPEXP __declspec(dllimport) 01398 # endif 01399 # endif 01400 # endif /* PNG_IMPEXP */ 01401 #else /* !(DLL || non-cygwin WINDOWS) */ 01402 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) 01403 # ifndef PNGAPI 01404 # define PNGAPI _System 01405 # endif 01406 # else 01407 # if 0 /* ... other platforms, with other meanings */ 01408 # endif 01409 # endif 01410 #endif 01411 01412 #ifndef PNGAPI 01413 # define PNGAPI 01414 #endif 01415 #ifndef PNG_IMPEXP 01416 # define PNG_IMPEXP 01417 #endif 01418 01419 #ifdef PNG_BUILDSYMS 01420 # ifndef PNG_EXPORT 01421 # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END 01422 # endif 01423 # ifdef PNG_USE_GLOBAL_ARRAYS 01424 # ifndef PNG_EXPORT_VAR 01425 # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT 01426 # endif 01427 # endif 01428 #endif 01429 01430 #ifndef PNG_EXPORT 01431 # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol 01432 #endif 01433 01434 #ifdef PNG_USE_GLOBAL_ARRAYS 01435 # ifndef PNG_EXPORT_VAR 01436 # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type 01437 # endif 01438 #endif 01439 01440 /* User may want to use these so they are not in PNG_INTERNAL. Any library 01441 * functions that are passed far data must be model independent. 01442 */ 01443 01444 #ifndef PNG_ABORT 01445 # define PNG_ABORT() abort() 01446 #endif 01447 01448 #ifdef PNG_SETJMP_SUPPORTED 01449 # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) 01450 #else 01451 # define png_jmpbuf(png_ptr) \ 01452 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) 01453 #endif 01454 01455 #if defined(USE_FAR_KEYWORD) /* memory model independent fns */ 01456 /* use this to make far-to-near assignments */ 01457 # define CHECK 1 01458 # define NOCHECK 0 01459 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) 01460 # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) 01461 # define png_snprintf _fsnprintf /* Added to v 1.2.19 */ 01462 # define png_strlen _fstrlen 01463 # define png_memcmp _fmemcmp /* SJT: added */ 01464 # define png_memcpy _fmemcpy 01465 # define png_memset _fmemset 01466 #else /* use the usual functions */ 01467 # define CVT_PTR(ptr) (ptr) 01468 # define CVT_PTR_NOCHECK(ptr) (ptr) 01469 # ifndef PNG_NO_SNPRINTF 01470 # ifdef _MSC_VER 01471 # define png_snprintf _snprintf /* Added to v 1.2.19 */ 01472 # define png_snprintf2 _snprintf 01473 # define png_snprintf6 _snprintf 01474 # else 01475 # define png_snprintf snprintf /* Added to v 1.2.19 */ 01476 # define png_snprintf2 snprintf 01477 # define png_snprintf6 snprintf 01478 # endif 01479 # else 01480 /* You don't have or don't want to use snprintf(). Caution: Using 01481 * sprintf instead of snprintf exposes your application to accidental 01482 * or malevolent buffer overflows. If you don't have snprintf() 01483 * as a general rule you should provide one (you can get one from 01484 * Portable OpenSSH). */ 01485 # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) 01486 # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) 01487 # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ 01488 sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) 01489 # endif 01490 # define png_strlen strlen 01491 # define png_memcmp memcmp /* SJT: added */ 01492 # define png_memcpy memcpy 01493 # define png_memset memset 01494 #endif 01495 /* End of memory model independent support */ 01496 01497 /* Just a little check that someone hasn't tried to define something 01498 * contradictory. 01499 */ 01500 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) 01501 # undef PNG_ZBUF_SIZE 01502 # define PNG_ZBUF_SIZE 65536L 01503 #endif 01504 01505 /* Added at libpng-1.2.8 */ 01506 #endif /* PNG_VERSION_INFO_ONLY */ 01507 01508 #endif /* PNGCONF_H */