source: liacs/MIR2010/SourceCode/cximage/png/pngconf.h@ 219

Last change on this file since 219 was 95, checked in by Rick van der Zwet, 15 years ago

Bad boy, improper move of directory

File size: 45.4 KB
RevLine 
[95]1
2/* pngconf.h - machine configurable file for libpng
3 *
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.)
9 */
10
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,
14 * and png_info.
15 */
16
17#ifndef PNGCONF_H
18#define PNGCONF_H
19
20#define PNG_1_2_X
21
22/*
23 * PNG_USER_CONFIG has to be defined on the compiler command line. This
24 * includes the resource compiler for Windows DLL configurations.
25 */
26#ifdef PNG_USER_CONFIG
27# ifndef PNG_USER_PRIVATEBUILD
28# define PNG_USER_PRIVATEBUILD
29# endif
30#include "pngusr.h"
31#endif
32
33/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
34#ifdef PNG_CONFIGURE_LIBPNG
35#ifdef HAVE_CONFIG_H
36#include "config.h"
37#endif
38#endif
39
40/*
41 * Added at libpng-1.2.8
42 *
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
45 * the DLL was built>
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"
53 *
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
59 */
60
61#ifdef __STDC__
62#ifdef SPECIALBUILD
63# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
64 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
65#endif
66
67#ifdef PRIVATEBUILD
68# pragma message("PRIVATEBUILD is deprecated.\
69 Use PNG_USER_PRIVATEBUILD instead.")
70# define PNG_USER_PRIVATEBUILD PRIVATEBUILD
71#endif
72#endif /* __STDC__ */
73
74#ifndef PNG_VERSION_INFO_ONLY
75
76/* End of material added to libpng-1.2.8 */
77
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.
89 */
90
91#ifndef PNG_ZBUF_SIZE
92# define PNG_ZBUF_SIZE 8192
93#endif
94
95/* Enable if you want a write-only libpng */
96
97#ifndef PNG_NO_READ_SUPPORTED
98# define PNG_READ_SUPPORTED
99#endif
100
101/* Enable if you want a read-only libpng */
102
103#ifndef PNG_NO_WRITE_SUPPORTED
104# define PNG_WRITE_SUPPORTED
105#endif
106
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
112# endif
113#endif
114
115#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
116# ifndef PNG_FLOATING_POINT_SUPPORTED
117# define PNG_FLOATING_POINT_SUPPORTED
118# endif
119#endif
120
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
128 */
129#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
130# define PNG_MAX_MALLOC_64K
131#endif
132
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.
146 * Thus,
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
150 * unnecessary.
151 *
152 * Also, the precedence order is:
153 * ALL_STATIC (since we can't #undef something outside our namespace)
154 * PNG_BUILD_DLL
155 * PNG_STATIC
156 * (nothing) == PNG_USE_DLL
157 *
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.
165 */
166#if defined(__CYGWIN__)
167# if defined(ALL_STATIC)
168# if defined(PNG_BUILD_DLL)
169# undef PNG_BUILD_DLL
170# endif
171# if defined(PNG_USE_DLL)
172# undef PNG_USE_DLL
173# endif
174# if defined(PNG_DLL)
175# undef PNG_DLL
176# endif
177# if !defined(PNG_STATIC)
178# define PNG_STATIC
179# endif
180# else
181# if defined (PNG_BUILD_DLL)
182# if defined(PNG_STATIC)
183# undef PNG_STATIC
184# endif
185# if defined(PNG_USE_DLL)
186# undef PNG_USE_DLL
187# endif
188# if !defined(PNG_DLL)
189# define PNG_DLL
190# endif
191# else
192# if defined(PNG_STATIC)
193# if defined(PNG_USE_DLL)
194# undef PNG_USE_DLL
195# endif
196# if defined(PNG_DLL)
197# undef PNG_DLL
198# endif
199# else
200# if !defined(PNG_USE_DLL)
201# define PNG_USE_DLL
202# endif
203# if !defined(PNG_DLL)
204# define PNG_DLL
205# endif
206# endif
207# endif
208# endif
209#endif
210
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.
219 *
220 * #define PNG_NO_CONSOLE_IO
221 * #define PNG_NO_STDIO
222 */
223
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
228# ifdef PNG_DEBUG
229# undef PNG_DEBUG
230# endif
231#endif
232
233#ifdef PNG_BUILD_DLL
234# ifndef PNG_CONSOLE_IO_SUPPORTED
235# ifndef PNG_NO_CONSOLE_IO
236# define PNG_NO_CONSOLE_IO
237# endif
238# endif
239#endif
240
241# ifdef PNG_NO_STDIO
242# ifndef PNG_NO_CONSOLE_IO
243# define PNG_NO_CONSOLE_IO
244# endif
245# ifdef PNG_DEBUG
246# if (PNG_DEBUG > 0)
247# include <stdio.h>
248# endif
249# endif
250# else
251# if !defined(_WIN32_WCE)
252/* "stdio.h" functions are not supported on WindowsCE */
253# include <stdio.h>
254# endif
255# endif
256
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.
263 */
264#ifndef PNGARG
265
266#ifdef OF /* zlib prototype munger */
267# define PNGARG(arglist) OF(arglist)
268#else
269
270#ifdef _NO_PROTO
271# define PNGARG(arglist) ()
272# ifndef PNG_TYPECAST_NULL
273# define PNG_TYPECAST_NULL
274# endif
275#else
276# define PNGARG(arglist) arglist
277#endif /* _NO_PROTO */
278
279#endif /* OF */
280
281#endif /* PNGARG */
282
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.
286 */
287#ifndef MACOS
288# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
289 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
290# define MACOS
291# endif
292#endif
293
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>
297#endif
298
299#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
300# define PNG_SETJMP_SUPPORTED
301#endif
302
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.
306 */
307
308# ifdef __linux__
309# ifdef _BSD_SOURCE
310# define PNG_SAVE_BSD_SOURCE
311# undef _BSD_SOURCE
312# endif
313# ifdef _SETJMP_H
314 /* If you encounter a compiler error here, see the explanation
315 * near the end of INSTALL.
316 */
317 __png.h__ already includes setjmp.h;
318 __dont__ include it again.;
319# endif
320# endif /* __linux__ */
321
322 /* include setjmp.h for error handling */
323# include <setjmp.h>
324
325# ifdef __linux__
326# ifdef PNG_SAVE_BSD_SOURCE
327# define _BSD_SOURCE
328# undef PNG_SAVE_BSD_SOURCE
329# endif
330# endif /* __linux__ */
331#endif /* PNG_SETJMP_SUPPORTED */
332
333#ifdef BSD
334# include <strings.h>
335#else
336# include <string.h>
337#endif
338
339/* Other defines for things like memory and the like can go here. */
340#ifdef PNG_INTERNAL
341
342#include <stdlib.h>
343
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
350 */
351#define PNG_EXTERN
352
353/* Other defines specific to compilers can go here. Try to keep
354 * them inside an appropriate ifdef/endif pair for portability.
355 */
356
357#if defined(PNG_FLOATING_POINT_SUPPORTED)
358# if defined(MACOS)
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.
362 */
363# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
364# include <fp.h>
365# endif
366# else
367# include <math.h>
368# endif
369# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
370 /* Amiga SAS/C: We must include builtin FPU functions when compiling using
371 * MATH=68881
372 */
373# include <m68881.h>
374# endif
375#endif
376
377/* Codewarrior on NT has linking problems without this. */
378#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
379# define PNG_ALWAYS_EXTERN
380#endif
381
382/* This provides the non-ANSI (far) memory allocation routines. */
383#if defined(__TURBOC__) && defined(__MSDOS__)
384# include <mem.h>
385# include <alloc.h>
386#endif
387
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__))
391# include <malloc.h>
392#endif
393
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.
397 */
398#ifndef PNG_DITHER_RED_BITS
399# define PNG_DITHER_RED_BITS 5
400#endif
401#ifndef PNG_DITHER_GREEN_BITS
402# define PNG_DITHER_GREEN_BITS 5
403#endif
404#ifndef PNG_DITHER_BLUE_BITS
405# define PNG_DITHER_BLUE_BITS 5
406#endif
407
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).
413 */
414
415#ifndef PNG_MAX_GAMMA_8
416# define PNG_MAX_GAMMA_8 11
417#endif
418
419/* This controls how much a difference in gamma we can tolerate before
420 * we actually start doing gamma conversion.
421 */
422#ifndef PNG_GAMMA_THRESHOLD
423# define PNG_GAMMA_THRESHOLD 0.05
424#endif
425
426#endif /* PNG_INTERNAL */
427
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.
431 */
432
433#ifndef PNG_NO_CONST
434# define PNG_CONST const
435#else
436# define PNG_CONST
437#endif
438
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.
451 */
452
453/* Any features you will not be using can be undef'ed here */
454
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)
463 */
464
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.
470 */
471
472#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
473# ifndef PNG_NO_iTXt_SUPPORTED
474# define PNG_NO_iTXt_SUPPORTED
475# endif
476# ifndef PNG_NO_READ_iTXt
477# define PNG_NO_READ_iTXt
478# endif
479# ifndef PNG_NO_WRITE_iTXt
480# define PNG_NO_WRITE_iTXt
481# endif
482#endif
483
484#if !defined(PNG_NO_iTXt_SUPPORTED)
485# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
486# define PNG_READ_iTXt
487# endif
488# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
489# define PNG_WRITE_iTXt
490# endif
491#endif
492
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.
497 */
498
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
520#endif
521
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
526#endif
527
528#ifndef PNG_NO_FREE_ME
529# define PNG_FREE_ME_SUPPORTED
530#endif
531
532#if defined(PNG_READ_SUPPORTED)
533
534#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
535 !defined(PNG_NO_READ_TRANSFORMS)
536# define PNG_READ_TRANSFORMS_SUPPORTED
537#endif
538
539#ifdef PNG_READ_TRANSFORMS_SUPPORTED
540# ifndef PNG_NO_READ_EXPAND
541# define PNG_READ_EXPAND_SUPPORTED
542# endif
543# ifndef PNG_NO_READ_SHIFT
544# define PNG_READ_SHIFT_SUPPORTED
545# endif
546# ifndef PNG_NO_READ_PACK
547# define PNG_READ_PACK_SUPPORTED
548# endif
549# ifndef PNG_NO_READ_BGR
550# define PNG_READ_BGR_SUPPORTED
551# endif
552# ifndef PNG_NO_READ_SWAP
553# define PNG_READ_SWAP_SUPPORTED
554# endif
555# ifndef PNG_NO_READ_PACKSWAP
556# define PNG_READ_PACKSWAP_SUPPORTED
557# endif
558# ifndef PNG_NO_READ_INVERT
559# define PNG_READ_INVERT_SUPPORTED
560# endif
561# ifndef PNG_NO_READ_DITHER
562# define PNG_READ_DITHER_SUPPORTED
563# endif
564# ifndef PNG_NO_READ_BACKGROUND
565# define PNG_READ_BACKGROUND_SUPPORTED
566# endif
567# ifndef PNG_NO_READ_16_TO_8
568# define PNG_READ_16_TO_8_SUPPORTED
569# endif
570# ifndef PNG_NO_READ_FILLER
571# define PNG_READ_FILLER_SUPPORTED
572# endif
573# ifndef PNG_NO_READ_GAMMA
574# define PNG_READ_GAMMA_SUPPORTED
575# endif
576# ifndef PNG_NO_READ_GRAY_TO_RGB
577# define PNG_READ_GRAY_TO_RGB_SUPPORTED
578# endif
579# ifndef PNG_NO_READ_SWAP_ALPHA
580# define PNG_READ_SWAP_ALPHA_SUPPORTED
581# endif
582# ifndef PNG_NO_READ_INVERT_ALPHA
583# define PNG_READ_INVERT_ALPHA_SUPPORTED
584# endif
585# ifndef PNG_NO_READ_STRIP_ALPHA
586# define PNG_READ_STRIP_ALPHA_SUPPORTED
587# endif
588# ifndef PNG_NO_READ_USER_TRANSFORM
589# define PNG_READ_USER_TRANSFORM_SUPPORTED
590# endif
591# ifndef PNG_NO_READ_RGB_TO_GRAY
592# define PNG_READ_RGB_TO_GRAY_SUPPORTED
593# endif
594#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
595
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: */
601
602#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
603
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 */
607# endif
608#endif
609
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
615#endif
616#endif
617
618#endif /* PNG_READ_SUPPORTED */
619
620#if defined(PNG_WRITE_SUPPORTED)
621
622# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
623 !defined(PNG_NO_WRITE_TRANSFORMS)
624# define PNG_WRITE_TRANSFORMS_SUPPORTED
625#endif
626
627#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
628# ifndef PNG_NO_WRITE_SHIFT
629# define PNG_WRITE_SHIFT_SUPPORTED
630# endif
631# ifndef PNG_NO_WRITE_PACK
632# define PNG_WRITE_PACK_SUPPORTED
633# endif
634# ifndef PNG_NO_WRITE_BGR
635# define PNG_WRITE_BGR_SUPPORTED
636# endif
637# ifndef PNG_NO_WRITE_SWAP
638# define PNG_WRITE_SWAP_SUPPORTED
639# endif
640# ifndef PNG_NO_WRITE_PACKSWAP
641# define PNG_WRITE_PACKSWAP_SUPPORTED
642# endif
643# ifndef PNG_NO_WRITE_INVERT
644# define PNG_WRITE_INVERT_SUPPORTED
645# endif
646# ifndef PNG_NO_WRITE_FILLER
647# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
648# endif
649# ifndef PNG_NO_WRITE_SWAP_ALPHA
650# define PNG_WRITE_SWAP_ALPHA_SUPPORTED
651# endif
652# ifndef PNG_NO_WRITE_INVERT_ALPHA
653# define PNG_WRITE_INVERT_ALPHA_SUPPORTED
654# endif
655# ifndef PNG_NO_WRITE_USER_TRANSFORM
656# define PNG_WRITE_USER_TRANSFORM_SUPPORTED
657# endif
658#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
659
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
664 if left undefined */
665#endif
666
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
671#endif
672
673#ifndef PNG_NO_WRITE_FLUSH
674# define PNG_WRITE_FLUSH_SUPPORTED
675#endif
676
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
681#endif
682#endif
683
684#endif /* PNG_WRITE_SUPPORTED */
685
686#ifndef PNG_1_0_X
687# ifndef PNG_NO_ERROR_NUMBERS
688# define PNG_ERROR_NUMBERS_SUPPORTED
689# endif
690#endif /* PNG_1_0_X */
691
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
696# endif
697#endif
698
699#ifndef PNG_NO_STDIO
700# define PNG_TIME_RFC1123_SUPPORTED
701#endif
702
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()
718 */
719#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
720# define PNG_EASY_ACCESS_SUPPORTED
721#endif
722
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.
725 *
726 * PNG_NO_ASSEMBLER_CODE disables use of all assembler code and optimized C,
727 * and removes or includes several functions in the API.
728 *
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.
731*/
732#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
733# ifndef PNG_ASSEMBLER_CODE_SUPPORTED
734# define PNG_ASSEMBLER_CODE_SUPPORTED
735# endif
736# if defined(XP_MACOSX) && !defined(PNG_NO_MMX_CODE)
737 /* work around Intel-Mac compiler bug */
738# define PNG_NO_MMX_CODE
739# endif
740# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) && \
741 defined(__MMX__)
742# define PNG_MMX_CODE_SUPPORTED
743# endif
744# if !defined(PNG_USE_PNGGCCRD) && !defined(PNG_NO_MMX_CODE) && \
745 !defined(PNG_USE_PNGVCRD) && defined(__MMX__)
746# define PNG_USE_PNGGCCRD
747# endif
748#endif
749
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
754*/
755
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
759#endif
760#endif /* PNG_1_0_X */
761
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
767#endif
768#endif
769#endif /* PNG_1_0_X */
770
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
773 */
774#ifndef PNG_USER_WIDTH_MAX
775# define PNG_USER_WIDTH_MAX 1000000L
776#endif
777#ifndef PNG_USER_HEIGHT_MAX
778# define PNG_USER_HEIGHT_MAX 1000000L
779#endif
780
781/* These are currently experimental features, define them if you want */
782
783/* very little testing */
784/*
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
788# endif
789#endif
790*/
791
792/* This is only for PowerPC big-endian and 680x0 systems */
793/* some testing */
794/*
795#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
796# define PNG_READ_BIG_ENDIAN_SUPPORTED
797#endif
798*/
799
800/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
801/*
802#define PNG_NO_POINTER_INDEXING
803*/
804
805/* These functions are turned off by default, as they will be phased out. */
806/*
807#define PNG_USELESS_TESTS_SUPPORTED
808#define PNG_CORRECT_PALETTE_SUPPORTED
809*/
810
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
814 * a bit smaller.
815 */
816
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
821#endif
822
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
827#endif
828
829#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
830
831#ifdef PNG_NO_READ_TEXT
832# define PNG_NO_READ_iTXt
833# define PNG_NO_READ_tEXt
834# define PNG_NO_READ_zTXt
835#endif
836#ifndef PNG_NO_READ_bKGD
837# define PNG_READ_bKGD_SUPPORTED
838# define PNG_bKGD_SUPPORTED
839#endif
840#ifndef PNG_NO_READ_cHRM
841# define PNG_READ_cHRM_SUPPORTED
842# define PNG_cHRM_SUPPORTED
843#endif
844#ifndef PNG_NO_READ_gAMA
845# define PNG_READ_gAMA_SUPPORTED
846# define PNG_gAMA_SUPPORTED
847#endif
848#ifndef PNG_NO_READ_hIST
849# define PNG_READ_hIST_SUPPORTED
850# define PNG_hIST_SUPPORTED
851#endif
852#ifndef PNG_NO_READ_iCCP
853# define PNG_READ_iCCP_SUPPORTED
854# define PNG_iCCP_SUPPORTED
855#endif
856#ifndef PNG_NO_READ_iTXt
857# ifndef PNG_READ_iTXt_SUPPORTED
858# define PNG_READ_iTXt_SUPPORTED
859# endif
860# ifndef PNG_iTXt_SUPPORTED
861# define PNG_iTXt_SUPPORTED
862# endif
863#endif
864#ifndef PNG_NO_READ_oFFs
865# define PNG_READ_oFFs_SUPPORTED
866# define PNG_oFFs_SUPPORTED
867#endif
868#ifndef PNG_NO_READ_pCAL
869# define PNG_READ_pCAL_SUPPORTED
870# define PNG_pCAL_SUPPORTED
871#endif
872#ifndef PNG_NO_READ_sCAL
873# define PNG_READ_sCAL_SUPPORTED
874# define PNG_sCAL_SUPPORTED
875#endif
876#ifndef PNG_NO_READ_pHYs
877# define PNG_READ_pHYs_SUPPORTED
878# define PNG_pHYs_SUPPORTED
879#endif
880#ifndef PNG_NO_READ_sBIT
881# define PNG_READ_sBIT_SUPPORTED
882# define PNG_sBIT_SUPPORTED
883#endif
884#ifndef PNG_NO_READ_sPLT
885# define PNG_READ_sPLT_SUPPORTED
886# define PNG_sPLT_SUPPORTED
887#endif
888#ifndef PNG_NO_READ_sRGB
889# define PNG_READ_sRGB_SUPPORTED
890# define PNG_sRGB_SUPPORTED
891#endif
892#ifndef PNG_NO_READ_tEXt
893# define PNG_READ_tEXt_SUPPORTED
894# define PNG_tEXt_SUPPORTED
895#endif
896#ifndef PNG_NO_READ_tIME
897# define PNG_READ_tIME_SUPPORTED
898# define PNG_tIME_SUPPORTED
899#endif
900#ifndef PNG_NO_READ_tRNS
901# define PNG_READ_tRNS_SUPPORTED
902# define PNG_tRNS_SUPPORTED
903#endif
904#ifndef PNG_NO_READ_zTXt
905# define PNG_READ_zTXt_SUPPORTED
906# define PNG_zTXt_SUPPORTED
907#endif
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
912# endif
913# ifndef PNG_NO_HANDLE_AS_UNKNOWN
914# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
915# endif
916#endif
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
923# endif
924# ifdef PNG_NO_HANDLE_AS_UNKNOWN
925# undef PNG_NO_HANDLE_AS_UNKNOWN
926# endif
927#endif
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
935#endif
936
937#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
938
939#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
940
941#ifdef PNG_NO_WRITE_TEXT
942# define PNG_NO_WRITE_iTXt
943# define PNG_NO_WRITE_tEXt
944# define PNG_NO_WRITE_zTXt
945#endif
946#ifndef PNG_NO_WRITE_bKGD
947# define PNG_WRITE_bKGD_SUPPORTED
948# ifndef PNG_bKGD_SUPPORTED
949# define PNG_bKGD_SUPPORTED
950# endif
951#endif
952#ifndef PNG_NO_WRITE_cHRM
953# define PNG_WRITE_cHRM_SUPPORTED
954# ifndef PNG_cHRM_SUPPORTED
955# define PNG_cHRM_SUPPORTED
956# endif
957#endif
958#ifndef PNG_NO_WRITE_gAMA
959# define PNG_WRITE_gAMA_SUPPORTED
960# ifndef PNG_gAMA_SUPPORTED
961# define PNG_gAMA_SUPPORTED
962# endif
963#endif
964#ifndef PNG_NO_WRITE_hIST
965# define PNG_WRITE_hIST_SUPPORTED
966# ifndef PNG_hIST_SUPPORTED
967# define PNG_hIST_SUPPORTED
968# endif
969#endif
970#ifndef PNG_NO_WRITE_iCCP
971# define PNG_WRITE_iCCP_SUPPORTED
972# ifndef PNG_iCCP_SUPPORTED
973# define PNG_iCCP_SUPPORTED
974# endif
975#endif
976#ifndef PNG_NO_WRITE_iTXt
977# ifndef PNG_WRITE_iTXt_SUPPORTED
978# define PNG_WRITE_iTXt_SUPPORTED
979# endif
980# ifndef PNG_iTXt_SUPPORTED
981# define PNG_iTXt_SUPPORTED
982# endif
983#endif
984#ifndef PNG_NO_WRITE_oFFs
985# define PNG_WRITE_oFFs_SUPPORTED
986# ifndef PNG_oFFs_SUPPORTED
987# define PNG_oFFs_SUPPORTED
988# endif
989#endif
990#ifndef PNG_NO_WRITE_pCAL
991# define PNG_WRITE_pCAL_SUPPORTED
992# ifndef PNG_pCAL_SUPPORTED
993# define PNG_pCAL_SUPPORTED
994# endif
995#endif
996#ifndef PNG_NO_WRITE_sCAL
997# define PNG_WRITE_sCAL_SUPPORTED
998# ifndef PNG_sCAL_SUPPORTED
999# define PNG_sCAL_SUPPORTED
1000# endif
1001#endif
1002#ifndef PNG_NO_WRITE_pHYs
1003# define PNG_WRITE_pHYs_SUPPORTED
1004# ifndef PNG_pHYs_SUPPORTED
1005# define PNG_pHYs_SUPPORTED
1006# endif
1007#endif
1008#ifndef PNG_NO_WRITE_sBIT
1009# define PNG_WRITE_sBIT_SUPPORTED
1010# ifndef PNG_sBIT_SUPPORTED
1011# define PNG_sBIT_SUPPORTED
1012# endif
1013#endif
1014#ifndef PNG_NO_WRITE_sPLT
1015# define PNG_WRITE_sPLT_SUPPORTED
1016# ifndef PNG_sPLT_SUPPORTED
1017# define PNG_sPLT_SUPPORTED
1018# endif
1019#endif
1020#ifndef PNG_NO_WRITE_sRGB
1021# define PNG_WRITE_sRGB_SUPPORTED
1022# ifndef PNG_sRGB_SUPPORTED
1023# define PNG_sRGB_SUPPORTED
1024# endif
1025#endif
1026#ifndef PNG_NO_WRITE_tEXt
1027# define PNG_WRITE_tEXt_SUPPORTED
1028# ifndef PNG_tEXt_SUPPORTED
1029# define PNG_tEXt_SUPPORTED
1030# endif
1031#endif
1032#ifndef PNG_NO_WRITE_tIME
1033# define PNG_WRITE_tIME_SUPPORTED
1034# ifndef PNG_tIME_SUPPORTED
1035# define PNG_tIME_SUPPORTED
1036# endif
1037#endif
1038#ifndef PNG_NO_WRITE_tRNS
1039# define PNG_WRITE_tRNS_SUPPORTED
1040# ifndef PNG_tRNS_SUPPORTED
1041# define PNG_tRNS_SUPPORTED
1042# endif
1043#endif
1044#ifndef PNG_NO_WRITE_zTXt
1045# define PNG_WRITE_zTXt_SUPPORTED
1046# ifndef PNG_zTXt_SUPPORTED
1047# define PNG_zTXt_SUPPORTED
1048# endif
1049#endif
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
1054# endif
1055# ifndef PNG_NO_HANDLE_AS_UNKNOWN
1056# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
1057# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
1058# endif
1059# endif
1060#endif
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
1066# endif
1067#endif
1068
1069#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
1070
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.
1074 */
1075#ifndef PNG_NO_INFO_IMAGE
1076# define PNG_INFO_IMAGE_SUPPORTED
1077#endif
1078
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 */
1083# include <time.h>
1084# endif
1085#endif
1086
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.
1094 */
1095
1096typedef unsigned long png_uint_32;
1097typedef long png_int_32;
1098typedef unsigned short png_uint_16;
1099typedef short png_int_16;
1100typedef unsigned char png_byte;
1101
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) */
1104#ifdef PNG_SIZE_T
1105 typedef PNG_SIZE_T png_size_t;
1106# define png_sizeof(x) png_convert_size(sizeof (x))
1107#else
1108 typedef size_t png_size_t;
1109# define png_sizeof(x) sizeof (x)
1110#endif
1111
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)
1119 */
1120
1121/* Separate compiler dependencies (problem here is that zlib.h always
1122 defines FAR. (SJT) */
1123#ifdef __BORLANDC__
1124# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
1125# define LDATA 1
1126# else
1127# define LDATA 0
1128# endif
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
1132# if (LDATA != 1)
1133# ifndef FAR
1134# define FAR __far
1135# endif
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
1142 */
1143# endif /* __WIN32__, __FLAT__, __CYGWIN__ */
1144#endif /* __BORLANDC__ */
1145
1146
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)
1150 */
1151
1152/* MSC Medium model */
1153#if defined(FAR)
1154# if defined(M_I86MM)
1155# define USE_FAR_KEYWORD
1156# define FARDATA FAR
1157# include <dos.h>
1158# endif
1159#endif
1160
1161/* SJT: default case */
1162#ifndef FAR
1163# define FAR
1164#endif
1165
1166/* At this point FAR is always defined */
1167#ifndef FARDATA
1168# define FARDATA
1169#endif
1170
1171/* Typedef for floating-point numbers that are converted
1172 to fixed-point with a multiple of 100,000, e.g., int_gamma */
1173typedef png_int_32 png_fixed_point;
1174
1175/* Add typedefs for pointers */
1176typedef void FAR * png_voidp;
1177typedef png_byte FAR * png_bytep;
1178typedef png_uint_32 FAR * png_uint_32p;
1179typedef png_int_32 FAR * png_int_32p;
1180typedef png_uint_16 FAR * png_uint_16p;
1181typedef png_int_16 FAR * png_int_16p;
1182typedef PNG_CONST char FAR * png_const_charp;
1183typedef char FAR * png_charp;
1184typedef png_fixed_point FAR * png_fixed_point_p;
1185
1186#ifndef PNG_NO_STDIO
1187#if defined(_WIN32_WCE)
1188typedef HANDLE png_FILE_p;
1189#else
1190typedef FILE * png_FILE_p;
1191#endif
1192#endif
1193
1194#ifdef PNG_FLOATING_POINT_SUPPORTED
1195typedef double FAR * png_doublep;
1196#endif
1197
1198/* Pointers to pointers; i.e. arrays */
1199typedef png_byte FAR * FAR * png_bytepp;
1200typedef png_uint_32 FAR * FAR * png_uint_32pp;
1201typedef png_int_32 FAR * FAR * png_int_32pp;
1202typedef png_uint_16 FAR * FAR * png_uint_16pp;
1203typedef png_int_16 FAR * FAR * png_int_16pp;
1204typedef PNG_CONST char FAR * FAR * png_const_charpp;
1205typedef char FAR * FAR * png_charpp;
1206typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
1207#ifdef PNG_FLOATING_POINT_SUPPORTED
1208typedef double FAR * FAR * png_doublepp;
1209#endif
1210
1211/* Pointers to pointers to pointers; i.e., pointer to array */
1212typedef char FAR * FAR * FAR * png_charppp;
1213
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.
1220 */
1221typedef charf * png_zcharp;
1222typedef charf * FAR * png_zcharpp;
1223typedef z_stream FAR * png_zstreamp;
1224#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
1225
1226/*
1227 * Define PNG_BUILD_DLL if the module being built is a Windows
1228 * LIBPNG DLL.
1229 *
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)
1234 *
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
1239 * static library.
1240 * PNG_USE_DLL is defined by default (no user action needed) unless one of
1241 * the other flags is defined.
1242 */
1243
1244#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
1245# define PNG_DLL
1246#endif
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
1250 */
1251#if defined(__CYGWIN__)
1252# if !defined(PNG_STATIC)
1253# if defined(PNG_USE_GLOBAL_ARRAYS)
1254# undef PNG_USE_GLOBAL_ARRAYS
1255# endif
1256# if !defined(PNG_USE_LOCAL_ARRAYS)
1257# define PNG_USE_LOCAL_ARRAYS
1258# endif
1259# else
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
1263# endif
1264# endif
1265# endif
1266# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
1267# define PNG_USE_LOCAL_ARRAYS
1268# endif
1269#endif
1270
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.
1274 */
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
1278# else
1279# define PNG_USE_GLOBAL_ARRAYS
1280# endif
1281#endif
1282
1283#if defined(__CYGWIN__)
1284# undef PNGAPI
1285# define PNGAPI __cdecl
1286# undef PNG_IMPEXP
1287# define PNG_IMPEXP
1288#endif
1289
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.
1295 */
1296
1297#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
1298# ifndef PNG_NO_MODULEDEF
1299# define PNG_NO_MODULEDEF
1300# endif
1301#endif
1302
1303#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
1304# define PNG_IMPEXP
1305#endif
1306
1307#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
1308 (( defined(_Windows) || defined(_WINDOWS) || \
1309 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
1310
1311# ifndef PNGAPI
1312# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
1313# define PNGAPI __cdecl
1314# else
1315# define PNGAPI _cdecl
1316# endif
1317# endif
1318
1319# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
1320 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
1321# define PNG_IMPEXP
1322# endif
1323
1324# if !defined(PNG_IMPEXP)
1325
1326# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
1327# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
1328
1329 /* Borland/Microsoft */
1330# if defined(_MSC_VER) || defined(__BORLANDC__)
1331# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
1332# define PNG_EXPORT PNG_EXPORT_TYPE1
1333# else
1334# define PNG_EXPORT PNG_EXPORT_TYPE2
1335# if defined(PNG_BUILD_DLL)
1336# define PNG_IMPEXP __export
1337# else
1338# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
1339 VC++ */
1340# endif /* Exists in Borland C++ for
1341 C++ classes (== huge) */
1342# endif
1343# endif
1344
1345# if !defined(PNG_IMPEXP)
1346# if defined(PNG_BUILD_DLL)
1347# define PNG_IMPEXP __declspec(dllexport)
1348# else
1349# define PNG_IMPEXP __declspec(dllimport)
1350# endif
1351# endif
1352# endif /* PNG_IMPEXP */
1353#else /* !(DLL || non-cygwin WINDOWS) */
1354# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
1355# ifndef PNGAPI
1356# define PNGAPI _System
1357# endif
1358# else
1359# if 0 /* ... other platforms, with other meanings */
1360# endif
1361# endif
1362#endif
1363
1364#ifndef PNGAPI
1365# define PNGAPI
1366#endif
1367#ifndef PNG_IMPEXP
1368# define PNG_IMPEXP
1369#endif
1370
1371#ifdef PNG_BUILDSYMS
1372# ifndef PNG_EXPORT
1373# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
1374# endif
1375# ifdef PNG_USE_GLOBAL_ARRAYS
1376# ifndef PNG_EXPORT_VAR
1377# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
1378# endif
1379# endif
1380#endif
1381
1382#ifndef PNG_EXPORT
1383# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
1384#endif
1385
1386#ifdef PNG_USE_GLOBAL_ARRAYS
1387# ifndef PNG_EXPORT_VAR
1388# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
1389# endif
1390#endif
1391
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.
1394 */
1395
1396#ifndef PNG_ABORT
1397# define PNG_ABORT() abort()
1398#endif
1399
1400#ifdef PNG_SETJMP_SUPPORTED
1401# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
1402#else
1403# define png_jmpbuf(png_ptr) \
1404 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
1405#endif
1406
1407#if defined(USE_FAR_KEYWORD) /* memory model independent fns */
1408/* use this to make far-to-near assignments */
1409# define CHECK 1
1410# define NOCHECK 0
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
1428#endif
1429/* End of memory model independent support */
1430
1431/* Just a little check that someone hasn't tried to define something
1432 * contradictory.
1433 */
1434#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
1435# undef PNG_ZBUF_SIZE
1436# define PNG_ZBUF_SIZE 65536L
1437#endif
1438
1439#ifdef PNG_READ_SUPPORTED
1440/* Prior to libpng-1.0.9, this block was in pngasmrd.h */
1441#if defined(PNG_INTERNAL)
1442
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.
1447 */
1448
1449#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
1450# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */
1451#endif
1452#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
1453# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */
1454#endif
1455
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.
1459 */
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
1464#endif
1465
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.
1469 */
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
1474#endif
1475/* - see pnggccrd.c for info about what is currently enabled */
1476
1477#endif /* PNG_INTERNAL */
1478#endif /* PNG_READ_SUPPORTED */
1479
1480/* Added at libpng-1.2.8 */
1481#endif /* PNG_VERSION_INFO_ONLY */
1482
1483#endif /* PNGCONF_H */
Note: See TracBrowser for help on using the repository browser.