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