2 /* pngconf.h - machine configurable file for libpng
4 * libpng version 1.2.18 - May 15, 2007
5 * For conditions of distribution and use, see copyright notice in png.h
6 * Copyright (c) 1998-2007 Glenn Randers-Pehrson
7 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
8 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
11 /* Any machine specific code is near the front of this file, so if you
12 * are configuring libpng for a machine, you may want to read the section
13 * starting here down to where it starts to typedef png_color, png_text,
23 * PNG_USER_CONFIG has to be defined on the compiler command line. This
24 * includes the resource compiler for Windows DLL configurations.
26 #ifdef PNG_USER_CONFIG
27 # ifndef PNG_USER_PRIVATEBUILD
28 # define PNG_USER_PRIVATEBUILD
33 /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
34 #ifdef PNG_CONFIGURE_LIBPNG
41 * Added at libpng-1.2.8
43 * If you create a private DLL you need to define in "pngusr.h" the followings:
44 * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
46 * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
47 * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
48 * distinguish your DLL from those of the official release. These
49 * correspond to the trailing letters that come after the version
50 * number and must match your private DLL name>
51 * e.g. // private DLL "libpng13gx.dll"
52 * #define PNG_USER_DLLFNAME_POSTFIX "gx"
54 * The following macros are also at your disposal if you want to complete the
55 * DLL VERSIONINFO structure.
56 * - PNG_USER_VERSIONINFO_COMMENTS
57 * - PNG_USER_VERSIONINFO_COMPANYNAME
58 * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
63 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
64 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
68 # pragma message("PRIVATEBUILD is deprecated.\
69 Use PNG_USER_PRIVATEBUILD instead.")
70 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
74 #ifndef PNG_VERSION_INFO_ONLY
76 /* End of material added to libpng-1.2.8 */
78 /* This is the size of the compression buffer, and thus the size of
79 * an IDAT chunk. Make this whatever size you feel is best for your
80 * machine. One of these will be allocated per png_struct. When this
81 * is full, it writes the data to the disk, and does some other
82 * calculations. Making this an extremely small size will slow
83 * the library down, but you may want to experiment to determine
84 * where it becomes significant, if you are concerned with memory
85 * usage. Note that zlib allocates at least 32Kb also. For readers,
86 * this describes the size of the buffer available to read the data in.
87 * Unless this gets smaller than the size of a row (compressed),
88 * it should not make much difference how big this is.
92 # define PNG_ZBUF_SIZE 8192
95 /* Enable if you want a write-only libpng */
97 #ifndef PNG_NO_READ_SUPPORTED
98 # define PNG_READ_SUPPORTED
101 /* Enable if you want a read-only libpng */
103 #ifndef PNG_NO_WRITE_SUPPORTED
104 # define PNG_WRITE_SUPPORTED
107 /* Enabled by default in 1.2.0. You can disable this if you don't need to
108 support PNGs that are embedded in MNG datastreams */
109 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
110 # ifndef PNG_MNG_FEATURES_SUPPORTED
111 # define PNG_MNG_FEATURES_SUPPORTED
115 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
116 # ifndef PNG_FLOATING_POINT_SUPPORTED
117 # define PNG_FLOATING_POINT_SUPPORTED
121 /* If you are running on a machine where you cannot allocate more
122 * than 64K of memory at once, uncomment this. While libpng will not
123 * normally need that much memory in a chunk (unless you load up a very
124 * large file), zlib needs to know how big of a chunk it can use, and
125 * libpng thus makes sure to check any memory allocation to verify it
126 * will fit into memory.
127 #define PNG_MAX_MALLOC_64K
129 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
130 # define PNG_MAX_MALLOC_64K
133 /* Special munging to support doing things the 'cygwin' way:
134 * 'Normal' png-on-win32 defines/defaults:
135 * PNG_BUILD_DLL -- building dll
136 * PNG_USE_DLL -- building an application, linking to dll
137 * (no define) -- building static library, or building an
138 * application and linking to the static lib
139 * 'Cygwin' defines/defaults:
140 * PNG_BUILD_DLL -- (ignored) building the dll
141 * (no define) -- (ignored) building an application, linking to the dll
142 * PNG_STATIC -- (ignored) building the static lib, or building an
143 * application that links to the static lib.
144 * ALL_STATIC -- (ignored) building various static libs, or building an
145 * application that links to the static libs.
147 * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
148 * this bit of #ifdefs will define the 'correct' config variables based on
149 * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
152 * Also, the precedence order is:
153 * ALL_STATIC (since we can't #undef something outside our namespace)
156 * (nothing) == PNG_USE_DLL
158 * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
159 * of auto-import in binutils, we no longer need to worry about
160 * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
161 * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
162 * to __declspec() stuff. However, we DO need to worry about
163 * PNG_BUILD_DLL and PNG_STATIC because those change some defaults
164 * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
166 #if defined(__CYGWIN__)
167 # if defined(ALL_STATIC)
168 # if defined(PNG_BUILD_DLL)
169 # undef PNG_BUILD_DLL
171 # if defined(PNG_USE_DLL)
174 # if defined(PNG_DLL)
177 # if !defined(PNG_STATIC)
181 # if defined (PNG_BUILD_DLL)
182 # if defined(PNG_STATIC)
185 # if defined(PNG_USE_DLL)
188 # if !defined(PNG_DLL)
192 # if defined(PNG_STATIC)
193 # if defined(PNG_USE_DLL)
196 # if defined(PNG_DLL)
200 # if !defined(PNG_USE_DLL)
203 # if !defined(PNG_DLL)
211 /* This protects us against compilers that run on a windowing system
212 * and thus don't have or would rather us not use the stdio types:
213 * stdin, stdout, and stderr. The only one currently used is stderr
214 * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
215 * prevent these from being compiled and used. #defining PNG_NO_STDIO
216 * will also prevent these, plus will prevent the entire set of stdio
217 * macros and functions (FILE *, printf, etc.) from being compiled and used,
218 * unless (PNG_DEBUG > 0) has been #defined.
220 * #define PNG_NO_CONSOLE_IO
221 * #define PNG_NO_STDIO
224 #if defined(_WIN32_WCE)
225 # include <windows.h>
226 /* Console I/O functions are not supported on WindowsCE */
227 # define PNG_NO_CONSOLE_IO
234 # ifndef PNG_CONSOLE_IO_SUPPORTED
235 # ifndef PNG_NO_CONSOLE_IO
236 # define PNG_NO_CONSOLE_IO
242 # ifndef PNG_NO_CONSOLE_IO
243 # define PNG_NO_CONSOLE_IO
251 # if !defined(_WIN32_WCE)
252 /* "stdio.h" functions are not supported on WindowsCE */
257 /* This macro protects us against machines that don't have function
258 * prototypes (ie K&R style headers). If your compiler does not handle
259 * function prototypes, define this macro and use the included ansi2knr.
260 * I've always been able to use _NO_PROTO as the indicator, but you may
261 * need to drag the empty declaration out in front of here, or change the
262 * ifdef to suit your own needs.
266 #ifdef OF /* zlib prototype munger */
267 # define PNGARG(arglist) OF(arglist)
271 # define PNGARG(arglist) ()
272 # ifndef PNG_TYPECAST_NULL
273 # define PNG_TYPECAST_NULL
276 # define PNGARG(arglist) arglist
277 #endif /* _NO_PROTO */
283 /* Try to determine if we are compiling on a Mac. Note that testing for
284 * just __MWERKS__ is not good enough, because the Codewarrior is now used
285 * on non-Mac platforms.
288 # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
289 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
294 /* enough people need this for various reasons to include it here */
295 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
296 # include <sys/types.h>
299 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
300 # define PNG_SETJMP_SUPPORTED
303 #ifdef PNG_SETJMP_SUPPORTED
304 /* This is an attempt to force a single setjmp behaviour on Linux. If
305 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
310 # define PNG_SAVE_BSD_SOURCE
314 /* If you encounter a compiler error here, see the explanation
315 * near the end of INSTALL.
317 __png
.h__ already includes setjmp
.h
;
318 __dont__ include it again
.;
320 # endif /* __linux__ */
322 /* include setjmp.h for error handling */
326 # ifdef PNG_SAVE_BSD_SOURCE
328 # undef PNG_SAVE_BSD_SOURCE
330 # endif /* __linux__ */
331 #endif /* PNG_SETJMP_SUPPORTED */
334 # include <strings.h>
339 /* Other defines for things like memory and the like can go here. */
344 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
345 * aren't usually used outside the library (as far as I know), so it is
346 * debatable if they should be exported at all. In the future, when it is
347 * possible to have run-time registry of chunk-handling functions, some of
348 * these will be made available again.
349 #define PNG_EXTERN extern
353 /* Other defines specific to compilers can go here. Try to keep
354 * them inside an appropriate ifdef/endif pair for portability.
357 #if defined(PNG_FLOATING_POINT_SUPPORTED)
359 /* We need to check that <math.h> hasn't already been included earlier
360 * as it seems it doesn't agree with <fp.h>, yet we should really use
361 * <fp.h> if possible.
363 # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
369 # if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
370 /* Amiga SAS/C: We must include builtin FPU functions when compiling using
377 /* Codewarrior on NT has linking problems without this. */
378 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
379 # define PNG_ALWAYS_EXTERN
382 /* This provides the non-ANSI (far) memory allocation routines. */
383 #if defined(__TURBOC__) && defined(__MSDOS__)
388 /* I have no idea why is this necessary... */
389 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
390 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
394 /* This controls how fine the dithering gets. As this allocates
395 * a largish chunk of memory (32K), those who are not as concerned
396 * with dithering quality can decrease some or all of these.
398 #ifndef PNG_DITHER_RED_BITS
399 # define PNG_DITHER_RED_BITS 5
401 #ifndef PNG_DITHER_GREEN_BITS
402 # define PNG_DITHER_GREEN_BITS 5
404 #ifndef PNG_DITHER_BLUE_BITS
405 # define PNG_DITHER_BLUE_BITS 5
408 /* This controls how fine the gamma correction becomes when you
409 * are only interested in 8 bits anyway. Increasing this value
410 * results in more memory being used, and more pow() functions
411 * being called to fill in the gamma tables. Don't set this value
412 * less then 8, and even that may not work (I haven't tested it).
415 #ifndef PNG_MAX_GAMMA_8
416 # define PNG_MAX_GAMMA_8 11
419 /* This controls how much a difference in gamma we can tolerate before
420 * we actually start doing gamma conversion.
422 #ifndef PNG_GAMMA_THRESHOLD
423 # define PNG_GAMMA_THRESHOLD 0.05
426 #endif /* PNG_INTERNAL */
428 /* The following uses const char * instead of char * for error
429 * and warning message functions, so some compilers won't complain.
430 * If you do not want to use const, define PNG_NO_CONST here.
434 # define PNG_CONST const
439 /* The following defines give you the ability to remove code from the
440 * library that you will not be using. I wish I could figure out how to
441 * automate this, but I can't do that without making it seriously hard
442 * on the users. So if you are not using an ability, change the #define
443 * to and #undef, and that part of the library will not be compiled. If
444 * your linker can't find a function, you may want to make sure the
445 * ability is defined here. Some of these depend upon some others being
446 * defined. I haven't figured out all the interactions here, so you may
447 * have to experiment awhile to get everything to compile. If you are
448 * creating or using a shared library, you probably shouldn't touch this,
449 * as it will affect the size of the structures, and this will cause bad
450 * things to happen if the library and/or application ever change.
453 /* Any features you will not be using can be undef'ed here */
455 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
456 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
457 * on the compile line, then pick and choose which ones to define without
458 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
459 * if you only want to have a png-compliant reader/writer but don't need
460 * any of the extra transformations. This saves about 80 kbytes in a
461 * typical installation of the library. (PNG_NO_* form added in version
462 * 1.0.1c, for consistency)
465 /* The size of the png_text structure changed in libpng-1.0.6 when
466 * iTXt support was added. iTXt support was turned off by default through
467 * libpng-1.2.x, to support old apps that malloc the png_text structure
468 * instead of calling png_set_text() and letting libpng malloc it. It
469 * was turned on by default in libpng-1.3.0.
472 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
473 # ifndef PNG_NO_iTXt_SUPPORTED
474 # define PNG_NO_iTXt_SUPPORTED
476 # ifndef PNG_NO_READ_iTXt
477 # define PNG_NO_READ_iTXt
479 # ifndef PNG_NO_WRITE_iTXt
480 # define PNG_NO_WRITE_iTXt
484 #if !defined(PNG_NO_iTXt_SUPPORTED)
485 # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
486 # define PNG_READ_iTXt
488 # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
489 # define PNG_WRITE_iTXt
493 /* The following support, added after version 1.0.0, can be turned off here en
494 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
495 * with old applications that require the length of png_struct and png_info
496 * to remain unchanged.
499 #ifdef PNG_LEGACY_SUPPORTED
500 # define PNG_NO_FREE_ME
501 # define PNG_NO_READ_UNKNOWN_CHUNKS
502 # define PNG_NO_WRITE_UNKNOWN_CHUNKS
503 # define PNG_NO_READ_USER_CHUNKS
504 # define PNG_NO_READ_iCCP
505 # define PNG_NO_WRITE_iCCP
506 # define PNG_NO_READ_iTXt
507 # define PNG_NO_WRITE_iTXt
508 # define PNG_NO_READ_sCAL
509 # define PNG_NO_WRITE_sCAL
510 # define PNG_NO_READ_sPLT
511 # define PNG_NO_WRITE_sPLT
512 # define PNG_NO_INFO_IMAGE
513 # define PNG_NO_READ_RGB_TO_GRAY
514 # define PNG_NO_READ_USER_TRANSFORM
515 # define PNG_NO_WRITE_USER_TRANSFORM
516 # define PNG_NO_USER_MEM
517 # define PNG_NO_READ_EMPTY_PLTE
518 # define PNG_NO_MNG_FEATURES
519 # define PNG_NO_FIXED_POINT_SUPPORTED
522 /* Ignore attempt to turn off both floating and fixed point support */
523 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
524 !defined(PNG_NO_FIXED_POINT_SUPPORTED)
525 # define PNG_FIXED_POINT_SUPPORTED
528 #ifndef PNG_NO_FREE_ME
529 # define PNG_FREE_ME_SUPPORTED
532 #if defined(PNG_READ_SUPPORTED)
534 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
535 !defined(PNG_NO_READ_TRANSFORMS)
536 # define PNG_READ_TRANSFORMS_SUPPORTED
539 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
540 # ifndef PNG_NO_READ_EXPAND
541 # define PNG_READ_EXPAND_SUPPORTED
543 # ifndef PNG_NO_READ_SHIFT
544 # define PNG_READ_SHIFT_SUPPORTED
546 # ifndef PNG_NO_READ_PACK
547 # define PNG_READ_PACK_SUPPORTED
549 # ifndef PNG_NO_READ_BGR
550 # define PNG_READ_BGR_SUPPORTED
552 # ifndef PNG_NO_READ_SWAP
553 # define PNG_READ_SWAP_SUPPORTED
555 # ifndef PNG_NO_READ_PACKSWAP
556 # define PNG_READ_PACKSWAP_SUPPORTED
558 # ifndef PNG_NO_READ_INVERT
559 # define PNG_READ_INVERT_SUPPORTED
561 # ifndef PNG_NO_READ_DITHER
562 # define PNG_READ_DITHER_SUPPORTED
564 # ifndef PNG_NO_READ_BACKGROUND
565 # define PNG_READ_BACKGROUND_SUPPORTED
567 # ifndef PNG_NO_READ_16_TO_8
568 # define PNG_READ_16_TO_8_SUPPORTED
570 # ifndef PNG_NO_READ_FILLER
571 # define PNG_READ_FILLER_SUPPORTED
573 # ifndef PNG_NO_READ_GAMMA
574 # define PNG_READ_GAMMA_SUPPORTED
576 # ifndef PNG_NO_READ_GRAY_TO_RGB
577 # define PNG_READ_GRAY_TO_RGB_SUPPORTED
579 # ifndef PNG_NO_READ_SWAP_ALPHA
580 # define PNG_READ_SWAP_ALPHA_SUPPORTED
582 # ifndef PNG_NO_READ_INVERT_ALPHA
583 # define PNG_READ_INVERT_ALPHA_SUPPORTED
585 # ifndef PNG_NO_READ_STRIP_ALPHA
586 # define PNG_READ_STRIP_ALPHA_SUPPORTED
588 # ifndef PNG_NO_READ_USER_TRANSFORM
589 # define PNG_READ_USER_TRANSFORM_SUPPORTED
591 # ifndef PNG_NO_READ_RGB_TO_GRAY
592 # define PNG_READ_RGB_TO_GRAY_SUPPORTED
594 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
596 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
597 !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */
598 # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
599 #endif /* about interlacing capability! You'll */
600 /* still have interlacing unless you change the following line: */
602 #define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
604 #ifndef PNG_NO_READ_COMPOSITE_NODIV
605 # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
606 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */
610 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
611 /* Deprecated, will be removed from version 2.0.0.
612 Use PNG_MNG_FEATURES_SUPPORTED instead. */
613 #ifndef PNG_NO_READ_EMPTY_PLTE
614 # define PNG_READ_EMPTY_PLTE_SUPPORTED
618 #endif /* PNG_READ_SUPPORTED */
620 #if defined(PNG_WRITE_SUPPORTED)
622 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
623 !defined(PNG_NO_WRITE_TRANSFORMS)
624 # define PNG_WRITE_TRANSFORMS_SUPPORTED
627 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
628 # ifndef PNG_NO_WRITE_SHIFT
629 # define PNG_WRITE_SHIFT_SUPPORTED
631 # ifndef PNG_NO_WRITE_PACK
632 # define PNG_WRITE_PACK_SUPPORTED
634 # ifndef PNG_NO_WRITE_BGR
635 # define PNG_WRITE_BGR_SUPPORTED
637 # ifndef PNG_NO_WRITE_SWAP
638 # define PNG_WRITE_SWAP_SUPPORTED
640 # ifndef PNG_NO_WRITE_PACKSWAP
641 # define PNG_WRITE_PACKSWAP_SUPPORTED
643 # ifndef PNG_NO_WRITE_INVERT
644 # define PNG_WRITE_INVERT_SUPPORTED
646 # ifndef PNG_NO_WRITE_FILLER
647 # define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
649 # ifndef PNG_NO_WRITE_SWAP_ALPHA
650 # define PNG_WRITE_SWAP_ALPHA_SUPPORTED
652 # ifndef PNG_NO_WRITE_INVERT_ALPHA
653 # define PNG_WRITE_INVERT_ALPHA_SUPPORTED
655 # ifndef PNG_NO_WRITE_USER_TRANSFORM
656 # define PNG_WRITE_USER_TRANSFORM_SUPPORTED
658 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
660 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
661 !defined(PNG_WRITE_INTERLACING_SUPPORTED)
662 #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
663 encoders, but can cause trouble
667 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
668 !defined(PNG_WRITE_WEIGHTED_FILTER) && \
669 defined(PNG_FLOATING_POINT_SUPPORTED)
670 # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
673 #ifndef PNG_NO_WRITE_FLUSH
674 # define PNG_WRITE_FLUSH_SUPPORTED
677 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
678 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
679 #ifndef PNG_NO_WRITE_EMPTY_PLTE
680 # define PNG_WRITE_EMPTY_PLTE_SUPPORTED
684 #endif /* PNG_WRITE_SUPPORTED */
687 # ifndef PNG_NO_ERROR_NUMBERS
688 # define PNG_ERROR_NUMBERS_SUPPORTED
690 #endif /* PNG_1_0_X */
692 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
693 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
694 # ifndef PNG_NO_USER_TRANSFORM_PTR
695 # define PNG_USER_TRANSFORM_PTR_SUPPORTED
700 # define PNG_TIME_RFC1123_SUPPORTED
703 /* This adds extra functions in pngget.c for accessing data from the
704 * info pointer (added in version 0.99)
705 * png_get_image_width()
706 * png_get_image_height()
707 * png_get_bit_depth()
708 * png_get_color_type()
709 * png_get_compression_type()
710 * png_get_filter_type()
711 * png_get_interlace_type()
712 * png_get_pixel_aspect_ratio()
713 * png_get_pixels_per_meter()
714 * png_get_x_offset_pixels()
715 * png_get_y_offset_pixels()
716 * png_get_x_offset_microns()
717 * png_get_y_offset_microns()
719 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
720 # define PNG_EASY_ACCESS_SUPPORTED
723 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
724 * even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined.
726 * PNG_NO_ASSEMBLER_CODE disables use of all assembler code and optimized C,
727 * and removes or includes several functions in the API.
729 * PNG_NO_MMX_CODE disables the use of MMX code without changing the API.
730 * When MMX code is off, then optimized C replacement functions are used.
732 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
733 # ifndef PNG_ASSEMBLER_CODE_SUPPORTED
734 # define PNG_ASSEMBLER_CODE_SUPPORTED
736 # if defined(XP_MACOSX) && !defined(PNG_NO_MMX_CODE)
737 /* work around Intel-Mac compiler bug */
738 # define PNG_NO_MMX_CODE
740 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) && \
742 # define PNG_MMX_CODE_SUPPORTED
744 # if !defined(PNG_USE_PNGGCCRD) && !defined(PNG_NO_MMX_CODE) && \
745 !defined(PNG_USE_PNGVCRD) && defined(__MMX__)
746 # define PNG_USE_PNGGCCRD
750 /* If you are sure that you don't need thread safety and you are compiling
751 with PNG_USE_PNGCCRD for an MMX application, you can define this for
752 faster execution. See pnggccrd.c.
753 #define PNG_THREAD_UNSAFE_OK
756 #if !defined(PNG_1_0_X)
757 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
758 # define PNG_USER_MEM_SUPPORTED
760 #endif /* PNG_1_0_X */
762 /* Added at libpng-1.2.6 */
763 #if !defined(PNG_1_0_X)
764 #ifndef PNG_SET_USER_LIMITS_SUPPORTED
765 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
766 # define PNG_SET_USER_LIMITS_SUPPORTED
769 #endif /* PNG_1_0_X */
771 /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
772 * how large, set these limits to 0x7fffffffL
774 #ifndef PNG_USER_WIDTH_MAX
775 # define PNG_USER_WIDTH_MAX 1000000L
777 #ifndef PNG_USER_HEIGHT_MAX
778 # define PNG_USER_HEIGHT_MAX 1000000L
781 /* These are currently experimental features, define them if you want */
783 /* very little testing */
785 #ifdef PNG_READ_SUPPORTED
786 # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
787 # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
792 /* This is only for PowerPC big-endian and 680x0 systems */
795 #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
796 # define PNG_READ_BIG_ENDIAN_SUPPORTED
800 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */
802 #define PNG_NO_POINTER_INDEXING
805 /* These functions are turned off by default, as they will be phased out. */
807 #define PNG_USELESS_TESTS_SUPPORTED
808 #define PNG_CORRECT_PALETTE_SUPPORTED
811 /* Any chunks you are not interested in, you can undef here. The
812 * ones that allocate memory may be expecially important (hIST,
813 * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
817 #if defined(PNG_READ_SUPPORTED) && \
818 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
819 !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
820 # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
823 #if defined(PNG_WRITE_SUPPORTED) && \
824 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
825 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
826 # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
829 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
831 #ifdef PNG_NO_READ_TEXT
832 # define PNG_NO_READ_iTXt
833 # define PNG_NO_READ_tEXt
834 # define PNG_NO_READ_zTXt
836 #ifndef PNG_NO_READ_bKGD
837 # define PNG_READ_bKGD_SUPPORTED
838 # define PNG_bKGD_SUPPORTED
840 #ifndef PNG_NO_READ_cHRM
841 # define PNG_READ_cHRM_SUPPORTED
842 # define PNG_cHRM_SUPPORTED
844 #ifndef PNG_NO_READ_gAMA
845 # define PNG_READ_gAMA_SUPPORTED
846 # define PNG_gAMA_SUPPORTED
848 #ifndef PNG_NO_READ_hIST
849 # define PNG_READ_hIST_SUPPORTED
850 # define PNG_hIST_SUPPORTED
852 #ifndef PNG_NO_READ_iCCP
853 # define PNG_READ_iCCP_SUPPORTED
854 # define PNG_iCCP_SUPPORTED
856 #ifndef PNG_NO_READ_iTXt
857 # ifndef PNG_READ_iTXt_SUPPORTED
858 # define PNG_READ_iTXt_SUPPORTED
860 # ifndef PNG_iTXt_SUPPORTED
861 # define PNG_iTXt_SUPPORTED
864 #ifndef PNG_NO_READ_oFFs
865 # define PNG_READ_oFFs_SUPPORTED
866 # define PNG_oFFs_SUPPORTED
868 #ifndef PNG_NO_READ_pCAL
869 # define PNG_READ_pCAL_SUPPORTED
870 # define PNG_pCAL_SUPPORTED
872 #ifndef PNG_NO_READ_sCAL
873 # define PNG_READ_sCAL_SUPPORTED
874 # define PNG_sCAL_SUPPORTED
876 #ifndef PNG_NO_READ_pHYs
877 # define PNG_READ_pHYs_SUPPORTED
878 # define PNG_pHYs_SUPPORTED
880 #ifndef PNG_NO_READ_sBIT
881 # define PNG_READ_sBIT_SUPPORTED
882 # define PNG_sBIT_SUPPORTED
884 #ifndef PNG_NO_READ_sPLT
885 # define PNG_READ_sPLT_SUPPORTED
886 # define PNG_sPLT_SUPPORTED
888 #ifndef PNG_NO_READ_sRGB
889 # define PNG_READ_sRGB_SUPPORTED
890 # define PNG_sRGB_SUPPORTED
892 #ifndef PNG_NO_READ_tEXt
893 # define PNG_READ_tEXt_SUPPORTED
894 # define PNG_tEXt_SUPPORTED
896 #ifndef PNG_NO_READ_tIME
897 # define PNG_READ_tIME_SUPPORTED
898 # define PNG_tIME_SUPPORTED
900 #ifndef PNG_NO_READ_tRNS
901 # define PNG_READ_tRNS_SUPPORTED
902 # define PNG_tRNS_SUPPORTED
904 #ifndef PNG_NO_READ_zTXt
905 # define PNG_READ_zTXt_SUPPORTED
906 # define PNG_zTXt_SUPPORTED
908 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
909 # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
910 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
911 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
913 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
914 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
917 #if !defined(PNG_NO_READ_USER_CHUNKS) && \
918 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
919 # define PNG_READ_USER_CHUNKS_SUPPORTED
920 # define PNG_USER_CHUNKS_SUPPORTED
921 # ifdef PNG_NO_READ_UNKNOWN_CHUNKS
922 # undef PNG_NO_READ_UNKNOWN_CHUNKS
924 # ifdef PNG_NO_HANDLE_AS_UNKNOWN
925 # undef PNG_NO_HANDLE_AS_UNKNOWN
928 #ifndef PNG_NO_READ_OPT_PLTE
929 # define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
930 #endif /* optional PLTE chunk in RGB and RGBA images */
931 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
932 defined(PNG_READ_zTXt_SUPPORTED)
933 # define PNG_READ_TEXT_SUPPORTED
934 # define PNG_TEXT_SUPPORTED
937 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
939 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
941 #ifdef PNG_NO_WRITE_TEXT
942 # define PNG_NO_WRITE_iTXt
943 # define PNG_NO_WRITE_tEXt
944 # define PNG_NO_WRITE_zTXt
946 #ifndef PNG_NO_WRITE_bKGD
947 # define PNG_WRITE_bKGD_SUPPORTED
948 # ifndef PNG_bKGD_SUPPORTED
949 # define PNG_bKGD_SUPPORTED
952 #ifndef PNG_NO_WRITE_cHRM
953 # define PNG_WRITE_cHRM_SUPPORTED
954 # ifndef PNG_cHRM_SUPPORTED
955 # define PNG_cHRM_SUPPORTED
958 #ifndef PNG_NO_WRITE_gAMA
959 # define PNG_WRITE_gAMA_SUPPORTED
960 # ifndef PNG_gAMA_SUPPORTED
961 # define PNG_gAMA_SUPPORTED
964 #ifndef PNG_NO_WRITE_hIST
965 # define PNG_WRITE_hIST_SUPPORTED
966 # ifndef PNG_hIST_SUPPORTED
967 # define PNG_hIST_SUPPORTED
970 #ifndef PNG_NO_WRITE_iCCP
971 # define PNG_WRITE_iCCP_SUPPORTED
972 # ifndef PNG_iCCP_SUPPORTED
973 # define PNG_iCCP_SUPPORTED
976 #ifndef PNG_NO_WRITE_iTXt
977 # ifndef PNG_WRITE_iTXt_SUPPORTED
978 # define PNG_WRITE_iTXt_SUPPORTED
980 # ifndef PNG_iTXt_SUPPORTED
981 # define PNG_iTXt_SUPPORTED
984 #ifndef PNG_NO_WRITE_oFFs
985 # define PNG_WRITE_oFFs_SUPPORTED
986 # ifndef PNG_oFFs_SUPPORTED
987 # define PNG_oFFs_SUPPORTED
990 #ifndef PNG_NO_WRITE_pCAL
991 # define PNG_WRITE_pCAL_SUPPORTED
992 # ifndef PNG_pCAL_SUPPORTED
993 # define PNG_pCAL_SUPPORTED
996 #ifndef PNG_NO_WRITE_sCAL
997 # define PNG_WRITE_sCAL_SUPPORTED
998 # ifndef PNG_sCAL_SUPPORTED
999 # define PNG_sCAL_SUPPORTED
1002 #ifndef PNG_NO_WRITE_pHYs
1003 # define PNG_WRITE_pHYs_SUPPORTED
1004 # ifndef PNG_pHYs_SUPPORTED
1005 # define PNG_pHYs_SUPPORTED
1008 #ifndef PNG_NO_WRITE_sBIT
1009 # define PNG_WRITE_sBIT_SUPPORTED
1010 # ifndef PNG_sBIT_SUPPORTED
1011 # define PNG_sBIT_SUPPORTED
1014 #ifndef PNG_NO_WRITE_sPLT
1015 # define PNG_WRITE_sPLT_SUPPORTED
1016 # ifndef PNG_sPLT_SUPPORTED
1017 # define PNG_sPLT_SUPPORTED
1020 #ifndef PNG_NO_WRITE_sRGB
1021 # define PNG_WRITE_sRGB_SUPPORTED
1022 # ifndef PNG_sRGB_SUPPORTED
1023 # define PNG_sRGB_SUPPORTED
1026 #ifndef PNG_NO_WRITE_tEXt
1027 # define PNG_WRITE_tEXt_SUPPORTED
1028 # ifndef PNG_tEXt_SUPPORTED
1029 # define PNG_tEXt_SUPPORTED
1032 #ifndef PNG_NO_WRITE_tIME
1033 # define PNG_WRITE_tIME_SUPPORTED
1034 # ifndef PNG_tIME_SUPPORTED
1035 # define PNG_tIME_SUPPORTED
1038 #ifndef PNG_NO_WRITE_tRNS
1039 # define PNG_WRITE_tRNS_SUPPORTED
1040 # ifndef PNG_tRNS_SUPPORTED
1041 # define PNG_tRNS_SUPPORTED
1044 #ifndef PNG_NO_WRITE_zTXt
1045 # define PNG_WRITE_zTXt_SUPPORTED
1046 # ifndef PNG_zTXt_SUPPORTED
1047 # define PNG_zTXt_SUPPORTED
1050 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
1051 # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
1052 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
1053 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
1055 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
1056 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
1057 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
1061 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
1062 defined(PNG_WRITE_zTXt_SUPPORTED)
1063 # define PNG_WRITE_TEXT_SUPPORTED
1064 # ifndef PNG_TEXT_SUPPORTED
1065 # define PNG_TEXT_SUPPORTED
1069 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
1071 /* Turn this off to disable png_read_png() and
1072 * png_write_png() and leave the row_pointers member
1073 * out of the info structure.
1075 #ifndef PNG_NO_INFO_IMAGE
1076 # define PNG_INFO_IMAGE_SUPPORTED
1079 /* need the time information for reading tIME chunks */
1080 #if defined(PNG_tIME_SUPPORTED)
1081 # if !defined(_WIN32_WCE)
1082 /* "time.h" functions are not supported on WindowsCE */
1087 /* Some typedefs to get us started. These should be safe on most of the
1088 * common platforms. The typedefs should be at least as large as the
1089 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
1090 * don't have to be exactly that size. Some compilers dislike passing
1091 * unsigned shorts as function parameters, so you may be better off using
1092 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may
1093 * want to have unsigned int for png_uint_32 instead of unsigned long.
1096 typedef unsigned long png_uint_32
;
1097 typedef long png_int_32
;
1098 typedef unsigned short png_uint_16
;
1099 typedef short png_int_16
;
1100 typedef unsigned char png_byte
;
1102 /* This is usually size_t. It is typedef'ed just in case you need it to
1103 change (I'm not sure if you will or not, so I thought I'd be safe) */
1105 typedef PNG_SIZE_T png_size_t
;
1106 # define png_sizeof(x) png_convert_size(sizeof (x))
1108 typedef size_t png_size_t
;
1109 # define png_sizeof(x) sizeof (x)
1112 /* The following is needed for medium model support. It cannot be in the
1113 * PNG_INTERNAL section. Needs modification for other compilers besides
1114 * MSC. Model independent support declares all arrays and pointers to be
1115 * large using the far keyword. The zlib version used must also support
1116 * model independent data. As of version zlib 1.0.4, the necessary changes
1117 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
1118 * changes that are needed. (Tim Wegner)
1121 /* Separate compiler dependencies (problem here is that zlib.h always
1122 defines FAR. (SJT) */
1124 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
1129 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
1130 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
1131 # define PNG_MAX_MALLOC_64K
1136 # define USE_FAR_KEYWORD
1137 # endif /* LDATA != 1 */
1138 /* Possibly useful for moving data out of default segment.
1139 * Uncomment it if you want. Could also define FARDATA as
1140 * const if your compiler supports it. (SJT)
1141 # define FARDATA FAR
1143 # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
1144 #endif /* __BORLANDC__ */
1147 /* Suggest testing for specific compiler first before testing for
1148 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
1149 * making reliance oncertain keywords suspect. (SJT)
1152 /* MSC Medium model */
1154 # if defined(M_I86MM)
1155 # define USE_FAR_KEYWORD
1156 # define FARDATA FAR
1161 /* SJT: default case */
1166 /* At this point FAR is always defined */
1171 /* Typedef for floating-point numbers that are converted
1172 to fixed-point with a multiple of 100,000, e.g., int_gamma */
1173 typedef png_int_32 png_fixed_point
;
1175 /* Add typedefs for pointers */
1176 typedef void FAR
* png_voidp
;
1177 typedef png_byte FAR
* png_bytep
;
1178 typedef png_uint_32 FAR
* png_uint_32p
;
1179 typedef png_int_32 FAR
* png_int_32p
;
1180 typedef png_uint_16 FAR
* png_uint_16p
;
1181 typedef png_int_16 FAR
* png_int_16p
;
1182 typedef PNG_CONST
char FAR
* png_const_charp
;
1183 typedef char FAR
* png_charp
;
1184 typedef png_fixed_point FAR
* png_fixed_point_p
;
1186 #ifndef PNG_NO_STDIO
1187 #if defined(_WIN32_WCE)
1188 typedef HANDLE png_FILE_p
;
1190 typedef FILE * png_FILE_p
;
1194 #ifdef PNG_FLOATING_POINT_SUPPORTED
1195 typedef double FAR
* png_doublep
;
1198 /* Pointers to pointers; i.e. arrays */
1199 typedef png_byte FAR
* FAR
* png_bytepp
;
1200 typedef png_uint_32 FAR
* FAR
* png_uint_32pp
;
1201 typedef png_int_32 FAR
* FAR
* png_int_32pp
;
1202 typedef png_uint_16 FAR
* FAR
* png_uint_16pp
;
1203 typedef png_int_16 FAR
* FAR
* png_int_16pp
;
1204 typedef PNG_CONST
char FAR
* FAR
* png_const_charpp
;
1205 typedef char FAR
* FAR
* png_charpp
;
1206 typedef png_fixed_point FAR
* FAR
* png_fixed_point_pp
;
1207 #ifdef PNG_FLOATING_POINT_SUPPORTED
1208 typedef double FAR
* FAR
* png_doublepp
;
1211 /* Pointers to pointers to pointers; i.e., pointer to array */
1212 typedef char FAR
* FAR
* FAR
* png_charppp
;
1214 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
1215 /* SPC - Is this stuff deprecated? */
1216 /* It'll be removed as of libpng-1.3.0 - GR-P */
1217 /* libpng typedefs for types in zlib. If zlib changes
1218 * or another compression library is used, then change these.
1219 * Eliminates need to change all the source files.
1221 typedef charf
* png_zcharp
;
1222 typedef charf
* FAR
* png_zcharpp
;
1223 typedef z_stream FAR
* png_zstreamp
;
1224 #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
1227 * Define PNG_BUILD_DLL if the module being built is a Windows
1230 * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
1231 * It is equivalent to Microsoft predefined macro _DLL that is
1232 * automatically defined when you compile using the share
1233 * version of the CRT (C Run-Time library)
1235 * The cygwin mods make this behavior a little different:
1236 * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
1237 * Define PNG_STATIC if you are building a static library for use with cygwin,
1238 * -or- if you are building an application that you want to link to the
1240 * PNG_USE_DLL is defined by default (no user action needed) unless one of
1241 * the other flags is defined.
1244 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
1247 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
1248 * When building a static lib, default to no GLOBAL ARRAYS, but allow
1249 * command-line override
1251 #if defined(__CYGWIN__)
1252 # if !defined(PNG_STATIC)
1253 # if defined(PNG_USE_GLOBAL_ARRAYS)
1254 # undef PNG_USE_GLOBAL_ARRAYS
1256 # if !defined(PNG_USE_LOCAL_ARRAYS)
1257 # define PNG_USE_LOCAL_ARRAYS
1260 # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
1261 # if defined(PNG_USE_GLOBAL_ARRAYS)
1262 # undef PNG_USE_GLOBAL_ARRAYS
1266 # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
1267 # define PNG_USE_LOCAL_ARRAYS
1271 /* Do not use global arrays (helps with building DLL's)
1272 * They are no longer used in libpng itself, since version 1.0.5c,
1273 * but might be required for some pre-1.0.5c applications.
1275 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
1276 # if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL))
1277 # define PNG_USE_LOCAL_ARRAYS
1279 # define PNG_USE_GLOBAL_ARRAYS
1283 #if defined(__CYGWIN__)
1285 # define PNGAPI __cdecl
1290 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
1291 * you may get warnings regarding the linkage of png_zalloc and png_zfree.
1292 * Don't ignore those warnings; you must also reset the default calling
1293 * convention in your compiler to match your PNGAPI, and you must build
1294 * zlib and your applications the same way you build libpng.
1297 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
1298 # ifndef PNG_NO_MODULEDEF
1299 # define PNG_NO_MODULEDEF
1303 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
1307 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
1308 (( defined(_Windows) || defined(_WINDOWS) || \
1309 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
1312 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
1313 # define PNGAPI __cdecl
1315 # define PNGAPI _cdecl
1319 # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
1320 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
1324 # if !defined(PNG_IMPEXP)
1326 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
1327 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
1329 /* Borland/Microsoft */
1330 # if defined(_MSC_VER) || defined(__BORLANDC__)
1331 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
1332 # define PNG_EXPORT PNG_EXPORT_TYPE1
1334 # define PNG_EXPORT PNG_EXPORT_TYPE2
1335 # if defined(PNG_BUILD_DLL)
1336 # define PNG_IMPEXP __export
1338 # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
1340 # endif /* Exists in Borland C++ for
1341 C++ classes (== huge) */
1345 # if !defined(PNG_IMPEXP)
1346 # if defined(PNG_BUILD_DLL)
1347 # define PNG_IMPEXP __declspec(dllexport)
1349 # define PNG_IMPEXP __declspec(dllimport)
1352 # endif /* PNG_IMPEXP */
1353 #else /* !(DLL || non-cygwin WINDOWS) */
1354 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
1356 # define PNGAPI _System
1359 # if 0 /* ... other platforms, with other meanings */
1371 #ifdef PNG_BUILDSYMS
1373 # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
1375 # ifdef PNG_USE_GLOBAL_ARRAYS
1376 # ifndef PNG_EXPORT_VAR
1377 # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
1383 # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
1386 #ifdef PNG_USE_GLOBAL_ARRAYS
1387 # ifndef PNG_EXPORT_VAR
1388 # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
1392 /* User may want to use these so they are not in PNG_INTERNAL. Any library
1393 * functions that are passed far data must be model independent.
1397 # define PNG_ABORT() abort()
1400 #ifdef PNG_SETJMP_SUPPORTED
1401 # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
1403 # define png_jmpbuf(png_ptr) \
1404 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
1407 #if defined(USE_FAR_KEYWORD) /* memory model independent fns */
1408 /* use this to make far-to-near assignments */
1411 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
1412 # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
1413 # define png_strcpy _fstrcpy
1414 # define png_strncpy _fstrncpy /* Added to v 1.2.6 */
1415 # define png_strlen _fstrlen
1416 # define png_memcmp _fmemcmp /* SJT: added */
1417 # define png_memcpy _fmemcpy
1418 # define png_memset _fmemset
1419 #else /* use the usual functions */
1420 # define CVT_PTR(ptr) (ptr)
1421 # define CVT_PTR_NOCHECK(ptr) (ptr)
1422 # define png_strcpy strcpy
1423 # define png_strncpy strncpy /* Added to v 1.2.6 */
1424 # define png_strlen strlen
1425 # define png_memcmp memcmp /* SJT: added */
1426 # define png_memcpy memcpy
1427 # define png_memset memset
1429 /* End of memory model independent support */
1431 /* Just a little check that someone hasn't tried to define something
1434 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
1435 # undef PNG_ZBUF_SIZE
1436 # define PNG_ZBUF_SIZE 65536L
1439 #ifdef PNG_READ_SUPPORTED
1440 /* Prior to libpng-1.0.9, this block was in pngasmrd.h */
1441 #if defined(PNG_INTERNAL)
1443 /* These are the default thresholds before the MMX code kicks in; if either
1444 * rowbytes or bitdepth is below the threshold, plain C code is used. These
1445 * can be overridden at runtime via the png_set_mmx_thresholds() call in
1446 * libpng 1.2.0 and later. The values below were chosen by Intel.
1449 #ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
1450 # define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */
1452 #ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
1453 # define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */
1456 /* Set this in the makefile for VC++ on Pentium, not here. */
1457 /* Platform must be Pentium. Makefile must assemble and load pngvcrd.c .
1458 * MMX will be detected at run time and used if present.
1460 #ifdef PNG_USE_PNGVCRD
1461 # define PNG_HAVE_MMX_COMBINE_ROW
1462 # define PNG_HAVE_MMX_READ_INTERLACE
1463 # define PNG_HAVE_MMX_READ_FILTER_ROW
1466 /* Set this in the makefile for gcc/as on Pentium, not here. */
1467 /* Platform must be Pentium. Makefile must assemble and load pnggccrd.c .
1468 * MMX will be detected at run time and used if present.
1470 #ifdef PNG_USE_PNGGCCRD
1471 # define PNG_HAVE_MMX_COMBINE_ROW
1472 # define PNG_HAVE_MMX_READ_INTERLACE
1473 # define PNG_HAVE_MMX_READ_FILTER_ROW
1475 /* - see pnggccrd.c for info about what is currently enabled */
1477 #endif /* PNG_INTERNAL */
1478 #endif /* PNG_READ_SUPPORTED */
1480 /* Added at libpng-1.2.8 */
1481 #endif /* PNG_VERSION_INFO_ONLY */
1483 #endif /* PNGCONF_H */