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