SWILIB API (ELKA)    
Loading...
Searching...
No Matches
pngconf.h
Go to the documentation of this file.
1/* pngconf.h - machine configurable file for libpng
2 *
3 * libpng 1.2.5 - October 3, 2002
4 * For conditions of distribution and use, see copyright notice in png.h
5 * Copyright (c) 1998-2002 Glenn Randers-Pehrson
6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
8 */
9
10/* Any machine specific code is near the front of this file, so if you
11 * are configuring libpng for a machine, you may want to read the section
12 * starting here down to where it starts to typedef png_color, png_text,
13 * and png_info.
14 */
15
16#ifndef PNGCONF_H
17#define PNGCONF_H
18
19/*
20 * Siemens config
21 * */
22#define PNG_NO_WRITE_tIME
23#define PNG_NO_READ_tIME
24#define PNG_NO_CONSOLE_IO
25#define PNG_NO_STDIO
26
27/* This is the size of the compression buffer, and thus the size of
28 * an IDAT chunk. Make this whatever size you feel is best for your
29 * machine. One of these will be allocated per png_struct. When this
30 * is full, it writes the data to the disk, and does some other
31 * calculations. Making this an extremely small size will slow
32 * the library down, but you may want to experiment to determine
33 * where it becomes significant, if you are concerned with memory
34 * usage. Note that zlib allocates at least 32Kb also. For readers,
35 * this describes the size of the buffer available to read the data in.
36 * Unless this gets smaller than the size of a row (compressed),
37 * it should not make much difference how big this is.
38 */
39
40#ifndef PNG_ZBUF_SIZE
41# define PNG_ZBUF_SIZE 8192
42#endif
43
44/* Enable if you want a write-only libpng */
45
46#ifndef PNG_NO_READ_SUPPORTED
47# define PNG_READ_SUPPORTED
48#endif
49
50/* Enable if you want a read-only libpng */
51
52#ifndef PNG_NO_WRITE_SUPPORTED
53# define PNG_WRITE_SUPPORTED
54#endif
55
56/* Enabled by default in 1.2.0. You can disable this if you don't need to
57 support PNGs that are embedded in MNG datastreams */
58#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
59# ifndef PNG_MNG_FEATURES_SUPPORTED
60# define PNG_MNG_FEATURES_SUPPORTED
61# endif
62#endif
63
64#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
65# ifndef PNG_FLOATING_POINT_SUPPORTED
66# define PNG_FLOATING_POINT_SUPPORTED
67# endif
68#endif
69
70/* If you are running on a machine where you cannot allocate more
71 * than 64K of memory at once, uncomment this. While libpng will not
72 * normally need that much memory in a chunk (unless you load up a very
73 * large file), zlib needs to know how big of a chunk it can use, and
74 * libpng thus makes sure to check any memory allocation to verify it
75 * will fit into memory.
76#define PNG_MAX_MALLOC_64K
77 */
78#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
79# define PNG_MAX_MALLOC_64K
80#endif
81
82/* Special munging to support doing things the 'cygwin' way:
83 * 'Normal' png-on-win32 defines/defaults:
84 * PNG_BUILD_DLL -- building dll
85 * PNG_USE_DLL -- building an application, linking to dll
86 * (no define) -- building static library, or building an
87 * application and linking to the static lib
88 * 'Cygwin' defines/defaults:
89 * PNG_BUILD_DLL -- (ignored) building the dll
90 * (no define) -- (ignored) building an application, linking to the dll
91 * PNG_STATIC -- (ignored) building the static lib, or building an
92 * application that links to the static lib.
93 * ALL_STATIC -- (ignored) building various static libs, or building an
94 * application that links to the static libs.
95 * Thus,
96 * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
97 * this bit of #ifdefs will define the 'correct' config variables based on
98 * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
99 * unnecessary.
100 *
101 * Also, the precedence order is:
102 * ALL_STATIC (since we can't #undef something outside our namespace)
103 * PNG_BUILD_DLL
104 * PNG_STATIC
105 * (nothing) == PNG_USE_DLL
106 *
107 * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
108 * of auto-import in binutils, we no longer need to worry about
109 * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
110 * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
111 * to __declspec() stuff. However, we DO need to worry about
112 * PNG_BUILD_DLL and PNG_STATIC because those change some defaults
113 * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
114 */
115#if defined(__CYGWIN__)
116# if defined(ALL_STATIC)
117# if defined(PNG_BUILD_DLL)
118# undef PNG_BUILD_DLL
119# endif
120# if defined(PNG_USE_DLL)
121# undef PNG_USE_DLL
122# endif
123# if defined(PNG_DLL)
124# undef PNG_DLL
125# endif
126# if !defined(PNG_STATIC)
127# define PNG_STATIC
128# endif
129# else
130# if defined (PNG_BUILD_DLL)
131# if defined(PNG_STATIC)
132# undef PNG_STATIC
133# endif
134# if defined(PNG_USE_DLL)
135# undef PNG_USE_DLL
136# endif
137# if !defined(PNG_DLL)
138# define PNG_DLL
139# endif
140# else
141# if defined(PNG_STATIC)
142# if defined(PNG_USE_DLL)
143# undef PNG_USE_DLL
144# endif
145# if defined(PNG_DLL)
146# undef PNG_DLL
147# endif
148# else
149# if !defined(PNG_USE_DLL)
150# define PNG_USE_DLL
151# endif
152# if !defined(PNG_DLL)
153# define PNG_DLL
154# endif
155# endif
156# endif
157# endif
158#endif
159
160/* This protects us against compilers that run on a windowing system
161 * and thus don't have or would rather us not use the stdio types:
162 * stdin, stdout, and stderr. The only one currently used is stderr
163 * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
164 * prevent these from being compiled and used. #defining PNG_NO_STDIO
165 * will also prevent these, plus will prevent the entire set of stdio
166 * macros and functions (FILE *, printf, etc.) from being compiled and used,
167 * unless (PNG_DEBUG > 0) has been #defined.
168 *
169 * #define PNG_NO_CONSOLE_IO
170 * #define PNG_NO_STDIO
171 */
172
173#if defined(_WIN32_WCE)
174# include <windows.h>
175 /* Console I/O functions are not supported on WindowsCE */
176# define PNG_NO_CONSOLE_IO
177# ifdef PNG_DEBUG
178# undef PNG_DEBUG
179# endif
180#endif
181
182#ifdef PNG_BUILD_DLL
183# ifndef PNG_CONSOLE_IO_SUPPORTED
184# ifndef PNG_NO_CONSOLE_IO
185# define PNG_NO_CONSOLE_IO
186# endif
187# endif
188#endif
189
190# ifdef PNG_NO_STDIO
191# ifndef PNG_NO_CONSOLE_IO
192# define PNG_NO_CONSOLE_IO
193# endif
194# ifdef PNG_DEBUG
195# if (PNG_DEBUG > 0)
196# include <stdio.h>
197# endif
198# endif
199# else
200# if !defined(_WIN32_WCE)
201/* "stdio.h" functions are not supported on WindowsCE */
202# include <stdio.h>
203# endif
204# endif
205
206/* This macro protects us against machines that don't have function
207 * prototypes (ie K&R style headers). If your compiler does not handle
208 * function prototypes, define this macro and use the included ansi2knr.
209 * I've always been able to use _NO_PROTO as the indicator, but you may
210 * need to drag the empty declaration out in front of here, or change the
211 * ifdef to suit your own needs.
212 */
213#ifndef PNGARG
214
215#ifdef OF /* zlib prototype munger */
216# define PNGARG(arglist) OF(arglist)
217#else
218
219#ifdef _NO_PROTO
220# define PNGARG(arglist) ()
221# ifndef PNG_TYPECAST_NULL
222# define PNG_TYPECAST_NULL
223# endif
224#else
225# define PNGARG(arglist) arglist
226#endif /* _NO_PROTO */
227
228#endif /* OF */
229
230#endif /* PNGARG */
231
232/* Try to determine if we are compiling on a Mac. Note that testing for
233 * just __MWERKS__ is not good enough, because the Codewarrior is now used
234 * on non-Mac platforms.
235 */
236#ifndef MACOS
237# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
238 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
239# define MACOS
240# endif
241#endif
242
243/* enough people need this for various reasons to include it here */
244//#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
245//# include <sys/types.h>
246//#endif
247
248#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
249# define PNG_SETJMP_SUPPORTED
250#endif
251
252#ifdef PNG_SETJMP_SUPPORTED
253/* This is an attempt to force a single setjmp behaviour on Linux. If
254 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
255 */
256
257# ifdef __linux__
258# ifdef _BSD_SOURCE
259# define PNG_SAVE_BSD_SOURCE
260# undef _BSD_SOURCE
261# endif
262# ifdef _SETJMP_H
263 __png.h__ already includes setjmp.h;
264 __dont__ include it again.;
265# endif
266# endif /* __linux__ */
267
268 /* include setjmp.h for error handling */
269#ifndef SWILIB_LIBC
270# include <setjmp.h>
271#endif
272
273
274# ifdef __linux__
275# ifdef PNG_SAVE_BSD_SOURCE
276# define _BSD_SOURCE
277# undef PNG_SAVE_BSD_SOURCE
278# endif
279# endif /* __linux__ */
280#endif /* PNG_SETJMP_SUPPORTED */
281
282/*
283#ifdef BSD
284# include <strings.h>
285#else
286# include <string.h>
287#endif
288*/
289
290/* Other defines for things like memory and the like can go here. */
291#ifdef PNG_INTERNAL
292
293#include <stdlib.h>
294
295/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
296 * aren't usually used outside the library (as far as I know), so it is
297 * debatable if they should be exported at all. In the future, when it is
298 * possible to have run-time registry of chunk-handling functions, some of
299 * these will be made available again.
300#define PNG_EXTERN extern
301 */
302#define PNG_EXTERN
303
304/* Other defines specific to compilers can go here. Try to keep
305 * them inside an appropriate ifdef/endif pair for portability.
306 */
307
308#if defined(PNG_FLOATING_POINT_SUPPORTED)
309# if defined(MACOS)
310 /* We need to check that <math.h> hasn't already been included earlier
311 * as it seems it doesn't agree with <fp.h>, yet we should really use
312 * <fp.h> if possible.
313 */
314# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
315# include <fp.h>
316# endif
317# else
318# include <math.h>
319# endif
320# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
321 /* Amiga SAS/C: We must include builtin FPU functions when compiling using
322 * MATH=68881
323 */
324# include <m68881.h>
325# endif
326#endif
327
328/* Codewarrior on NT has linking problems without this. */
329#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
330# define PNG_ALWAYS_EXTERN
331#endif
332
333/* For some reason, Borland C++ defines memcmp, etc. in mem.h, not
334 * stdlib.h like it should (I think). Or perhaps this is a C++
335 * "feature"?
336 */
337#ifdef __TURBOC__
338# include <mem.h>
339# include "alloc.h"
340#endif
341
342#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
343 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
344# include <malloc.h>
345#endif
346
347/* This controls how fine the dithering gets. As this allocates
348 * a largish chunk of memory (32K), those who are not as concerned
349 * with dithering quality can decrease some or all of these.
350 */
351#ifndef PNG_DITHER_RED_BITS
352# define PNG_DITHER_RED_BITS 5
353#endif
354#ifndef PNG_DITHER_GREEN_BITS
355# define PNG_DITHER_GREEN_BITS 5
356#endif
357#ifndef PNG_DITHER_BLUE_BITS
358# define PNG_DITHER_BLUE_BITS 5
359#endif
360
361/* This controls how fine the gamma correction becomes when you
362 * are only interested in 8 bits anyway. Increasing this value
363 * results in more memory being used, and more pow() functions
364 * being called to fill in the gamma tables. Don't set this value
365 * less then 8, and even that may not work (I haven't tested it).
366 */
367
368#ifndef PNG_MAX_GAMMA_8
369# define PNG_MAX_GAMMA_8 11
370#endif
371
372/* This controls how much a difference in gamma we can tolerate before
373 * we actually start doing gamma conversion.
374 */
375#ifndef PNG_GAMMA_THRESHOLD
376# define PNG_GAMMA_THRESHOLD 0.05
377#endif
378
379#endif /* PNG_INTERNAL */
380
381/* The following uses const char * instead of char * for error
382 * and warning message functions, so some compilers won't complain.
383 * If you do not want to use const, define PNG_NO_CONST here.
384 */
385
386#ifndef PNG_NO_CONST
387# define PNG_CONST const
388#else
389# define PNG_CONST
390#endif
391
392/* The following defines give you the ability to remove code from the
393 * library that you will not be using. I wish I could figure out how to
394 * automate this, but I can't do that without making it seriously hard
395 * on the users. So if you are not using an ability, change the #define
396 * to and #undef, and that part of the library will not be compiled. If
397 * your linker can't find a function, you may want to make sure the
398 * ability is defined here. Some of these depend upon some others being
399 * defined. I haven't figured out all the interactions here, so you may
400 * have to experiment awhile to get everything to compile. If you are
401 * creating or using a shared library, you probably shouldn't touch this,
402 * as it will affect the size of the structures, and this will cause bad
403 * things to happen if the library and/or application ever change.
404 */
405
406/* Any features you will not be using can be undef'ed here */
407
408/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
409 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
410 * on the compile line, then pick and choose which ones to define without
411 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
412 * if you only want to have a png-compliant reader/writer but don't need
413 * any of the extra transformations. This saves about 80 kbytes in a
414 * typical installation of the library. (PNG_NO_* form added in version
415 * 1.0.1c, for consistency)
416 */
417
418/* The size of the png_text structure changed in libpng-1.0.6 when
419 * iTXt is supported. It is turned off by default, to support old apps
420 * that malloc the png_text structure instead of calling png_set_text()
421 * and letting libpng malloc it. It will be turned on by default in
422 * libpng-1.3.0.
423 */
424
425#ifndef PNG_iTXt_SUPPORTED
426# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
427# define PNG_NO_READ_iTXt
428# endif
429# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
430# define PNG_NO_WRITE_iTXt
431# endif
432#endif
433
434/* The following support, added after version 1.0.0, can be turned off here en
435 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
436 * with old applications that require the length of png_struct and png_info
437 * to remain unchanged.
438 */
439
440#ifdef PNG_LEGACY_SUPPORTED
441# define PNG_NO_FREE_ME
442# define PNG_NO_READ_UNKNOWN_CHUNKS
443# define PNG_NO_WRITE_UNKNOWN_CHUNKS
444# define PNG_NO_READ_USER_CHUNKS
445# define PNG_NO_READ_iCCP
446# define PNG_NO_WRITE_iCCP
447# define PNG_NO_READ_iTXt
448# define PNG_NO_WRITE_iTXt
449# define PNG_NO_READ_sCAL
450# define PNG_NO_WRITE_sCAL
451# define PNG_NO_READ_sPLT
452# define PNG_NO_WRITE_sPLT
453# define PNG_NO_INFO_IMAGE
454# define PNG_NO_READ_RGB_TO_GRAY
455# define PNG_NO_READ_USER_TRANSFORM
456# define PNG_NO_WRITE_USER_TRANSFORM
457# define PNG_NO_USER_MEM
458# define PNG_NO_READ_EMPTY_PLTE
459# define PNG_NO_MNG_FEATURES
460# define PNG_NO_FIXED_POINT_SUPPORTED
461#endif
462
463/* Ignore attempt to turn off both floating and fixed point support */
464#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
465 !defined(PNG_NO_FIXED_POINT_SUPPORTED)
466# define PNG_FIXED_POINT_SUPPORTED
467#endif
468
469#ifndef PNG_NO_FREE_ME
470# define PNG_FREE_ME_SUPPORTED
471#endif
472
473#if defined(PNG_READ_SUPPORTED)
474
475#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
476 !defined(PNG_NO_READ_TRANSFORMS)
477# define PNG_READ_TRANSFORMS_SUPPORTED
478#endif
479
480#ifdef PNG_READ_TRANSFORMS_SUPPORTED
481# ifndef PNG_NO_READ_EXPAND
482# define PNG_READ_EXPAND_SUPPORTED
483# endif
484# ifndef PNG_NO_READ_SHIFT
485# define PNG_READ_SHIFT_SUPPORTED
486# endif
487# ifndef PNG_NO_READ_PACK
488# define PNG_READ_PACK_SUPPORTED
489# endif
490# ifndef PNG_NO_READ_BGR
491# define PNG_READ_BGR_SUPPORTED
492# endif
493# ifndef PNG_NO_READ_SWAP
494# define PNG_READ_SWAP_SUPPORTED
495# endif
496# ifndef PNG_NO_READ_PACKSWAP
497# define PNG_READ_PACKSWAP_SUPPORTED
498# endif
499# ifndef PNG_NO_READ_INVERT
500# define PNG_READ_INVERT_SUPPORTED
501# endif
502# ifndef PNG_NO_READ_DITHER
503# define PNG_READ_DITHER_SUPPORTED
504# endif
505# ifndef PNG_NO_READ_BACKGROUND
506# define PNG_READ_BACKGROUND_SUPPORTED
507# endif
508# ifndef PNG_NO_READ_16_TO_8
509# define PNG_READ_16_TO_8_SUPPORTED
510# endif
511# ifndef PNG_NO_READ_FILLER
512# define PNG_READ_FILLER_SUPPORTED
513# endif
514# ifndef PNG_NO_READ_GAMMA
515# define PNG_READ_GAMMA_SUPPORTED
516# endif
517# ifndef PNG_NO_READ_GRAY_TO_RGB
518# define PNG_READ_GRAY_TO_RGB_SUPPORTED
519# endif
520# ifndef PNG_NO_READ_SWAP_ALPHA
521# define PNG_READ_SWAP_ALPHA_SUPPORTED
522# endif
523# ifndef PNG_NO_READ_INVERT_ALPHA
524# define PNG_READ_INVERT_ALPHA_SUPPORTED
525# endif
526# ifndef PNG_NO_READ_STRIP_ALPHA
527# define PNG_READ_STRIP_ALPHA_SUPPORTED
528# endif
529# ifndef PNG_NO_READ_USER_TRANSFORM
530# define PNG_READ_USER_TRANSFORM_SUPPORTED
531# endif
532# ifndef PNG_NO_READ_RGB_TO_GRAY
533# define PNG_READ_RGB_TO_GRAY_SUPPORTED
534# endif
535#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
536
537#if !defined(PNG_NO_PROGRESSIVE_READ) && \
538 !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */
539# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
540#endif /* about interlacing capability! You'll */
541 /* still have interlacing unless you change the following line: */
542
543#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
544
545#ifndef PNG_NO_READ_COMPOSITE_NODIV
546# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
547# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */
548# endif
549#endif
550
551/* Deprecated, will be removed from version 2.0.0.
552 Use PNG_MNG_FEATURES_SUPPORTED instead. */
553#ifndef PNG_NO_READ_EMPTY_PLTE
554# define PNG_READ_EMPTY_PLTE_SUPPORTED
555#endif
556
557#endif /* PNG_READ_SUPPORTED */
558
559#if defined(PNG_WRITE_SUPPORTED)
560
561# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
562 !defined(PNG_NO_WRITE_TRANSFORMS)
563# define PNG_WRITE_TRANSFORMS_SUPPORTED
564#endif
565
566#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
567# ifndef PNG_NO_WRITE_SHIFT
568# define PNG_WRITE_SHIFT_SUPPORTED
569# endif
570# ifndef PNG_NO_WRITE_PACK
571# define PNG_WRITE_PACK_SUPPORTED
572# endif
573# ifndef PNG_NO_WRITE_BGR
574# define PNG_WRITE_BGR_SUPPORTED
575# endif
576# ifndef PNG_NO_WRITE_SWAP
577# define PNG_WRITE_SWAP_SUPPORTED
578# endif
579# ifndef PNG_NO_WRITE_PACKSWAP
580# define PNG_WRITE_PACKSWAP_SUPPORTED
581# endif
582# ifndef PNG_NO_WRITE_INVERT
583# define PNG_WRITE_INVERT_SUPPORTED
584# endif
585# ifndef PNG_NO_WRITE_FILLER
586# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
587# endif
588# ifndef PNG_NO_WRITE_SWAP_ALPHA
589# define PNG_WRITE_SWAP_ALPHA_SUPPORTED
590# endif
591# ifndef PNG_NO_WRITE_INVERT_ALPHA
592# define PNG_WRITE_INVERT_ALPHA_SUPPORTED
593# endif
594# ifndef PNG_NO_WRITE_USER_TRANSFORM
595# define PNG_WRITE_USER_TRANSFORM_SUPPORTED
596# endif
597#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
598
599#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
600 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
601# ifndef PNG_NO_USER_TRANSFORM_PTR
602# define PNG_USER_TRANSFORM_PTR_SUPPORTED
603# endif
604#endif
605
606#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
607 encoders, but can cause trouble
608 if left undefined */
609
610#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
611 defined(PNG_FLOATING_POINT_SUPPORTED)
612# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
613#endif
614
615#ifndef PNG_1_0_X
616#ifndef PNG_NO_ERROR_NUMBERS
617#define PNG_ERROR_NUMBERS_SUPPORTED
618#endif
619#endif /* PNG_1_0_X */
621#ifndef PNG_NO_WRITE_FLUSH
622# define PNG_WRITE_FLUSH_SUPPORTED
623#endif
624
625/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
626#ifndef PNG_NO_WRITE_EMPTY_PLTE
627# define PNG_WRITE_EMPTY_PLTE_SUPPORTED
628#endif
629
630#endif /* PNG_WRITE_SUPPORTED */
631
632#ifndef PNG_NO_STDIO
633# define PNG_TIME_RFC1123_SUPPORTED
634#endif
635
636/* This adds extra functions in pngget.c for accessing data from the
637 * info pointer (added in version 0.99)
638 * png_get_image_width()
639 * png_get_image_height()
640 * png_get_bit_depth()
641 * png_get_color_type()
642 * png_get_compression_type()
643 * png_get_filter_type()
644 * png_get_interlace_type()
645 * png_get_pixel_aspect_ratio()
646 * png_get_pixels_per_meter()
647 * png_get_x_offset_pixels()
648 * png_get_y_offset_pixels()
649 * png_get_x_offset_microns()
650 * png_get_y_offset_microns()
651 */
652#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
653# define PNG_EASY_ACCESS_SUPPORTED
654#endif
655
656/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
657 even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */
658#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
659# ifndef PNG_ASSEMBLER_CODE_SUPPORTED
660# define PNG_ASSEMBLER_CODE_SUPPORTED
661# endif
662# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
663# define PNG_MMX_CODE_SUPPORTED
664# endif
665#endif
666
667/* If you are sure that you don't need thread safety and you are compiling
668 with PNG_USE_PNGCCRD for an MMX application, you can define this for
669 faster execution. See pnggccrd.c.
670#define PNG_THREAD_UNSAFE_OK
671*/
672
673#if !defined(PNG_1_0_X)
674#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
675# define PNG_USER_MEM_SUPPORTED
676#endif
677#endif /* PNG_1_0_X */
678
679/* These are currently experimental features, define them if you want */
680
681/* very little testing */
682/*
683#ifdef PNG_READ_SUPPORTED
684# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
685# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
686# endif
687#endif
688*/
689
690/* This is only for PowerPC big-endian and 680x0 systems */
691/* some testing */
692/*
693#ifdef PNG_READ_SUPPORTED
694# ifndef PNG_PNG_READ_BIG_ENDIAN_SUPPORTED
695# define PNG_READ_BIG_ENDIAN_SUPPORTED
696# endif
697#endif
698*/
699
700/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
701/*
702#define PNG_NO_POINTER_INDEXING
703*/
704
705/* These functions are turned off by default, as they will be phased out. */
706/*
707#define PNG_USELESS_TESTS_SUPPORTED
708#define PNG_CORRECT_PALETTE_SUPPORTED
709*/
710
711/* Any chunks you are not interested in, you can undef here. The
712 * ones that allocate memory may be expecially important (hIST,
713 * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
714 * a bit smaller.
715 */
716
717#if defined(PNG_READ_SUPPORTED) && \
718 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
719 !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
720# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
721#endif
722
723#if defined(PNG_WRITE_SUPPORTED) && \
724 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
725 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
726# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
727#endif
728
729#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
730
731#ifdef PNG_NO_READ_TEXT
732# define PNG_NO_READ_iTXt
733# define PNG_NO_READ_tEXt
734# define PNG_NO_READ_zTXt
735#endif
736#ifndef PNG_NO_READ_bKGD
737# define PNG_READ_bKGD_SUPPORTED
738# define PNG_bKGD_SUPPORTED
739#endif
740#ifndef PNG_NO_READ_cHRM
741# define PNG_READ_cHRM_SUPPORTED
742# define PNG_cHRM_SUPPORTED
743#endif
744#ifndef PNG_NO_READ_gAMA
745# define PNG_READ_gAMA_SUPPORTED
746# define PNG_gAMA_SUPPORTED
747#endif
748#ifndef PNG_NO_READ_hIST
749# define PNG_READ_hIST_SUPPORTED
750# define PNG_hIST_SUPPORTED
751#endif
752#ifndef PNG_NO_READ_iCCP
753# define PNG_READ_iCCP_SUPPORTED
754# define PNG_iCCP_SUPPORTED
755#endif
756#ifndef PNG_NO_READ_iTXt
757# ifndef PNG_READ_iTXt_SUPPORTED
758# define PNG_READ_iTXt_SUPPORTED
759# endif
760# ifndef PNG_iTXt_SUPPORTED
761# define PNG_iTXt_SUPPORTED
762# endif
763#endif
764#ifndef PNG_NO_READ_oFFs
765# define PNG_READ_oFFs_SUPPORTED
766# define PNG_oFFs_SUPPORTED
767#endif
768#ifndef PNG_NO_READ_pCAL
769# define PNG_READ_pCAL_SUPPORTED
770# define PNG_pCAL_SUPPORTED
771#endif
772#ifndef PNG_NO_READ_sCAL
773# define PNG_READ_sCAL_SUPPORTED
774# define PNG_sCAL_SUPPORTED
775#endif
776#ifndef PNG_NO_READ_pHYs
777# define PNG_READ_pHYs_SUPPORTED
778# define PNG_pHYs_SUPPORTED
779#endif
780#ifndef PNG_NO_READ_sBIT
781# define PNG_READ_sBIT_SUPPORTED
782# define PNG_sBIT_SUPPORTED
783#endif
784#ifndef PNG_NO_READ_sPLT
785# define PNG_READ_sPLT_SUPPORTED
786# define PNG_sPLT_SUPPORTED
787#endif
788#ifndef PNG_NO_READ_sRGB
789# define PNG_READ_sRGB_SUPPORTED
790# define PNG_sRGB_SUPPORTED
791#endif
792#ifndef PNG_NO_READ_tEXt
793# define PNG_READ_tEXt_SUPPORTED
794# define PNG_tEXt_SUPPORTED
795#endif
796#ifndef PNG_NO_READ_tIME
797# define PNG_READ_tIME_SUPPORTED
798# define PNG_tIME_SUPPORTED
799#endif
800#ifndef PNG_NO_READ_tRNS
801# define PNG_READ_tRNS_SUPPORTED
802# define PNG_tRNS_SUPPORTED
803#endif
804#ifndef PNG_NO_READ_zTXt
805# define PNG_READ_zTXt_SUPPORTED
806# define PNG_zTXt_SUPPORTED
807#endif
808#ifndef PNG_NO_READ_UNKNOWN_CHUNKS
809# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
810# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
811# define PNG_UNKNOWN_CHUNKS_SUPPORTED
812# endif
813# ifndef PNG_NO_HANDLE_AS_UNKNOWN
814# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
815# endif
816#endif
817#if !defined(PNG_NO_READ_USER_CHUNKS) && \
818 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
819# define PNG_READ_USER_CHUNKS_SUPPORTED
820# define PNG_USER_CHUNKS_SUPPORTED
821# ifdef PNG_NO_READ_UNKNOWN_CHUNKS
822# undef PNG_NO_READ_UNKNOWN_CHUNKS
823# endif
824# ifdef PNG_NO_HANDLE_AS_UNKNOWN
825# undef PNG_NO_HANDLE_AS_UNKNOWN
826# endif
827#endif
828#ifndef PNG_NO_READ_OPT_PLTE
829# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
830#endif /* optional PLTE chunk in RGB and RGBA images */
831#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
832 defined(PNG_READ_zTXt_SUPPORTED)
833# define PNG_READ_TEXT_SUPPORTED
834# define PNG_TEXT_SUPPORTED
835#endif
836
837#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
838
839#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
840
841#ifdef PNG_NO_WRITE_TEXT
842# define PNG_NO_WRITE_iTXt
843# define PNG_NO_WRITE_tEXt
844# define PNG_NO_WRITE_zTXt
845#endif
846#ifndef PNG_NO_WRITE_bKGD
847# define PNG_WRITE_bKGD_SUPPORTED
848# ifndef PNG_bKGD_SUPPORTED
849# define PNG_bKGD_SUPPORTED
850# endif
851#endif
852#ifndef PNG_NO_WRITE_cHRM
853# define PNG_WRITE_cHRM_SUPPORTED
854# ifndef PNG_cHRM_SUPPORTED
855# define PNG_cHRM_SUPPORTED
856# endif
857#endif
858#ifndef PNG_NO_WRITE_gAMA
859# define PNG_WRITE_gAMA_SUPPORTED
860# ifndef PNG_gAMA_SUPPORTED
861# define PNG_gAMA_SUPPORTED
862# endif
863#endif
864#ifndef PNG_NO_WRITE_hIST
865# define PNG_WRITE_hIST_SUPPORTED
866# ifndef PNG_hIST_SUPPORTED
867# define PNG_hIST_SUPPORTED
868# endif
869#endif
870#ifndef PNG_NO_WRITE_iCCP
871# define PNG_WRITE_iCCP_SUPPORTED
872# ifndef PNG_iCCP_SUPPORTED
873# define PNG_iCCP_SUPPORTED
874# endif
875#endif
876#ifndef PNG_NO_WRITE_iTXt
877# ifndef PNG_WRITE_iTXt_SUPPORTED
878# define PNG_WRITE_iTXt_SUPPORTED
879# endif
880# ifndef PNG_iTXt_SUPPORTED
881# define PNG_iTXt_SUPPORTED
882# endif
883#endif
884#ifndef PNG_NO_WRITE_oFFs
885# define PNG_WRITE_oFFs_SUPPORTED
886# ifndef PNG_oFFs_SUPPORTED
887# define PNG_oFFs_SUPPORTED
888# endif
889#endif
890#ifndef PNG_NO_WRITE_pCAL
891# define PNG_WRITE_pCAL_SUPPORTED
892# ifndef PNG_pCAL_SUPPORTED
893# define PNG_pCAL_SUPPORTED
894# endif
895#endif
896#ifndef PNG_NO_WRITE_sCAL
897# define PNG_WRITE_sCAL_SUPPORTED
898# ifndef PNG_sCAL_SUPPORTED
899# define PNG_sCAL_SUPPORTED
900# endif
901#endif
902#ifndef PNG_NO_WRITE_pHYs
903# define PNG_WRITE_pHYs_SUPPORTED
904# ifndef PNG_pHYs_SUPPORTED
905# define PNG_pHYs_SUPPORTED
906# endif
907#endif
908#ifndef PNG_NO_WRITE_sBIT
909# define PNG_WRITE_sBIT_SUPPORTED
910# ifndef PNG_sBIT_SUPPORTED
911# define PNG_sBIT_SUPPORTED
912# endif
913#endif
914#ifndef PNG_NO_WRITE_sPLT
915# define PNG_WRITE_sPLT_SUPPORTED
916# ifndef PNG_sPLT_SUPPORTED
917# define PNG_sPLT_SUPPORTED
918# endif
919#endif
920#ifndef PNG_NO_WRITE_sRGB
921# define PNG_WRITE_sRGB_SUPPORTED
922# ifndef PNG_sRGB_SUPPORTED
923# define PNG_sRGB_SUPPORTED
924# endif
925#endif
926#ifndef PNG_NO_WRITE_tEXt
927# define PNG_WRITE_tEXt_SUPPORTED
928# ifndef PNG_tEXt_SUPPORTED
929# define PNG_tEXt_SUPPORTED
930# endif
931#endif
932#ifndef PNG_NO_WRITE_tIME
933# define PNG_WRITE_tIME_SUPPORTED
934# ifndef PNG_tIME_SUPPORTED
935# define PNG_tIME_SUPPORTED
936# endif
937#endif
938#ifndef PNG_NO_WRITE_tRNS
939# define PNG_WRITE_tRNS_SUPPORTED
940# ifndef PNG_tRNS_SUPPORTED
941# define PNG_tRNS_SUPPORTED
942# endif
943#endif
944#ifndef PNG_NO_WRITE_zTXt
945# define PNG_WRITE_zTXt_SUPPORTED
946# ifndef PNG_zTXt_SUPPORTED
947# define PNG_zTXt_SUPPORTED
948# endif
949#endif
950#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
951# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
952# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
953# define PNG_UNKNOWN_CHUNKS_SUPPORTED
954# endif
955# ifndef PNG_NO_HANDLE_AS_UNKNOWN
956# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
957# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
958# endif
959# endif
960#endif
961#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
962 defined(PNG_WRITE_zTXt_SUPPORTED)
963# define PNG_WRITE_TEXT_SUPPORTED
964# ifndef PNG_TEXT_SUPPORTED
965# define PNG_TEXT_SUPPORTED
966# endif
967#endif
968
969#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
970
971/* Turn this off to disable png_read_png() and
972 * png_write_png() and leave the row_pointers member
973 * out of the info structure.
974 */
975#ifndef PNG_NO_INFO_IMAGE
976# define PNG_INFO_IMAGE_SUPPORTED
977#endif
978
979/* need the time information for reading tIME chunks */
980#if defined(PNG_tIME_SUPPORTED)
981# if !defined(_WIN32_WCE)
982 /* "time.h" functions are not supported on WindowsCE */
983# include <time.h>
984# endif
985#endif
986
987/* Some typedefs to get us started. These should be safe on most of the
988 * common platforms. The typedefs should be at least as large as the
989 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
990 * don't have to be exactly that size. Some compilers dislike passing
991 * unsigned shorts as function parameters, so you may be better off using
992 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may
993 * want to have unsigned int for png_uint_32 instead of unsigned long.
994 */
996typedef unsigned long png_uint_32;
997typedef long png_int_32;
998typedef unsigned short png_uint_16;
999typedef short png_int_16;
1000typedef unsigned char png_byte;
1001
1002/* This is usually size_t. It is typedef'ed just in case you need it to
1003 change (I'm not sure if you will or not, so I thought I'd be safe) */
1004typedef size_t png_size_t;
1005
1006/* The following is needed for medium model support. It cannot be in the
1007 * PNG_INTERNAL section. Needs modification for other compilers besides
1008 * MSC. Model independent support declares all arrays and pointers to be
1009 * large using the far keyword. The zlib version used must also support
1010 * model independent data. As of version zlib 1.0.4, the necessary changes
1011 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
1012 * changes that are needed. (Tim Wegner)
1013 */
1014
1015/* Separate compiler dependencies (problem here is that zlib.h always
1016 defines FAR. (SJT) */
1017#ifdef __BORLANDC__
1018# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
1019# define LDATA 1
1020# else
1021# define LDATA 0
1022# endif
1023 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
1024# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
1025# define PNG_MAX_MALLOC_64K
1026# if (LDATA != 1)
1027# ifndef FAR
1028# define FAR __far
1029# endif
1030# define USE_FAR_KEYWORD
1031# endif /* LDATA != 1 */
1032 /* Possibly useful for moving data out of default segment.
1033 * Uncomment it if you want. Could also define FARDATA as
1034 * const if your compiler supports it. (SJT)
1035# define FARDATA FAR
1036 */
1037# endif /* __WIN32__, __FLAT__, __CYGWIN__ */
1038#endif /* __BORLANDC__ */
1039
1040
1041/* Suggest testing for specific compiler first before testing for
1042 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
1043 * making reliance oncertain keywords suspect. (SJT)
1044 */
1045
1046/* MSC Medium model */
1047#if defined(FAR)
1048# if defined(M_I86MM)
1049# define USE_FAR_KEYWORD
1050# define FARDATA FAR
1051# include <dos.h>
1052# endif
1053#endif
1054
1055/* SJT: default case */
1056#ifndef FAR
1057# define FAR
1058#endif
1059
1060/* At this point FAR is always defined */
1061#ifndef FARDATA
1062# define FARDATA
1063#endif
1064
1065/* Typedef for floating-point numbers that are converted
1066 to fixed-point with a multiple of 100,000, e.g., int_gamma */
1069/* Add typedefs for pointers */
1070typedef void FAR * png_voidp;
1077typedef char FAR * png_charp;
1079
1080#ifndef PNG_NO_STDIO
1081#if defined(_WIN32_WCE)
1082typedef HANDLE png_FILE_p;
1083#else
1084typedef FILE * png_FILE_p;
1085#endif
1086#endif
1088#ifdef PNG_FLOATING_POINT_SUPPORTED
1089typedef double FAR * png_doublep;
1090#endif
1092/* Pointers to pointers; i.e. arrays */
1099typedef char FAR * FAR * png_charpp;
1101#ifdef PNG_FLOATING_POINT_SUPPORTED
1102typedef double FAR * FAR * png_doublepp;
1103#endif
1105/* Pointers to pointers to pointers; i.e., pointer to array */
1106typedef char FAR * FAR * FAR * png_charppp;
1107
1108/* libpng typedefs for types in zlib. If zlib changes
1109 * or another compression library is used, then change these.
1110 * Eliminates need to change all the source files.
1113typedef charf * FAR * png_zcharpp;
1114typedef z_stream FAR * png_zstreamp;
1115
1116/*
1117 * Define PNG_BUILD_DLL if the module being built is a Windows
1118 * LIBPNG DLL.
1119 *
1120 * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
1121 * It is equivalent to Microsoft predefined macro _DLL that is
1122 * automatically defined when you compile using the share
1123 * version of the CRT (C Run-Time library)
1124 *
1125 * The cygwin mods make this behavior a little different:
1126 * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
1127 * Define PNG_STATIC if you are building a static library for use with cygwin,
1128 * -or- if you are building an application that you want to link to the
1129 * static library.
1130 * PNG_USE_DLL is defined by default (no user action needed) unless one of
1131 * the other flags is defined.
1132 */
1133
1134#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
1135# define PNG_DLL
1136#endif
1137/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
1138 * When building a static lib, default to no GLOBAL ARRAYS, but allow
1139 * command-line override
1140 */
1141#if defined(__CYGWIN__)
1142# if !defined(PNG_STATIC)
1143# if defined(PNG_USE_GLOBAL_ARRAYS)
1144# undef PNG_USE_GLOBAL_ARRAYS
1145# endif
1146# if !defined(PNG_USE_LOCAL_ARRAYS)
1147# define PNG_USE_LOCAL_ARRAYS
1148# endif
1149# else
1150# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
1151# if defined(PNG_USE_GLOBAL_ARRAYS)
1152# undef PNG_USE_GLOBAL_ARRAYS
1153# endif
1154# endif
1155# endif
1156# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
1157# define PNG_USE_LOCAL_ARRAYS
1158# endif
1159#endif
1160
1161/* Do not use global arrays (helps with building DLL's)
1162 * They are no longer used in libpng itself, since version 1.0.5c,
1163 * but might be required for some pre-1.0.5c applications.
1164 */
1165#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
1166# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL))
1167# define PNG_USE_LOCAL_ARRAYS
1168# else
1169# define PNG_USE_GLOBAL_ARRAYS
1170# endif
1171#endif
1172
1173#if defined(__CYGWIN__)
1174# undef PNGAPI
1175# define PNGAPI __cdecl
1176# undef PNG_IMPEXP
1177# define PNG_IMPEXP
1178#endif
1179
1180/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
1181 * you may get warnings regarding the linkage of png_zalloc and png_zfree.
1182 * Don't ignore those warnings; you must also reset the default calling
1183 * convention in your compiler to match your PNGAPI, and you must build
1184 * zlib and your applications the same way you build libpng.
1185 */
1186
1187#ifndef PNGAPI
1188
1189#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
1190# ifndef PNG_NO_MODULEDEF
1191# define PNG_NO_MODULEDEF
1192# endif
1193#endif
1194
1195#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
1196# define PNG_IMPEXP
1197#endif
1198
1199#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
1200 (( defined(_Windows) || defined(_WINDOWS) || \
1201 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
1202
1203# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
1204# define PNGAPI __cdecl
1205# else
1206# define PNGAPI _cdecl
1207# endif
1208
1209# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
1210 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
1211# define PNG_IMPEXP
1212# endif
1213
1214# if !defined(PNG_IMPEXP)
1215
1216# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
1217# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
1218
1219 /* Borland/Microsoft */
1220# if defined(_MSC_VER) || defined(__BORLANDC__)
1221# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
1222# define PNG_EXPORT PNG_EXPORT_TYPE1
1223# else
1224# define PNG_EXPORT PNG_EXPORT_TYPE2
1225# if defined(PNG_BUILD_DLL)
1226# define PNG_IMPEXP __export
1227# else
1228# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
1229 VC++ */
1230# endif /* Exists in Borland C++ for
1231 C++ classes (== huge) */
1232# endif
1233# endif
1234
1235# if !defined(PNG_IMPEXP)
1236# if defined(PNG_BUILD_DLL)
1237# define PNG_IMPEXP __declspec(dllexport)
1238# else
1239# define PNG_IMPEXP __declspec(dllimport)
1240# endif
1241# endif
1242# endif /* PNG_IMPEXP */
1243#else /* !(DLL || non-cygwin WINDOWS) */
1244# if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__)
1245# define PNGAPI _System
1246# define PNG_IMPEXP
1247# else
1248# if 0 /* ... other platforms, with other meanings */
1249# else
1250# define PNGAPI
1251# define PNG_IMPEXP
1252# endif
1253# endif
1254#endif
1255#endif
1256
1257#ifndef PNGAPI
1258# define PNGAPI
1259#endif
1260#ifndef PNG_IMPEXP
1261# define PNG_IMPEXP
1262#endif
1264#ifndef PNG_EXPORT
1265# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
1266#endif
1267
1268#ifdef PNG_USE_GLOBAL_ARRAYS
1269# ifndef PNG_EXPORT_VAR
1270# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
1271# endif
1272#endif
1273
1274/* User may want to use these so they are not in PNG_INTERNAL. Any library
1275 * functions that are passed far data must be model independent.
1276 */
1278#ifndef PNG_ABORT
1279# define PNG_ABORT() abort()
1280#endif
1282#ifdef PNG_SETJMP_SUPPORTED
1283# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
1284#else
1285# define png_jmpbuf(png_ptr) \
1286 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
1287#endif
1288
1289#if defined(USE_FAR_KEYWORD) /* memory model independent fns */
1290/* use this to make far-to-near assignments */
1291# define CHECK 1
1292# define NOCHECK 0
1293# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
1294# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
1295# define png_strcpy _fstrcpy
1296# define png_strlen _fstrlen
1297# define png_memcmp _fmemcmp /* SJT: added */
1298# define png_memcpy _fmemcpy
1299# define png_memset _fmemset
1300#else /* use the usual functions */
1301# define CVT_PTR(ptr) (ptr)
1302# define CVT_PTR_NOCHECK(ptr) (ptr)
1303# define png_strcpy strcpy
1304# define png_strlen strlen
1305# define png_memcmp memcmp /* SJT: added */
1306# define png_memcpy memcpy
1307# define png_memset memset
1308#endif
1309/* End of memory model independent support */
1310
1311/* Just a little check that someone hasn't tried to define something
1312 * contradictory.
1313 */
1314#if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K)
1315# undef PNG_ZBUF_SIZE
1316# define PNG_ZBUF_SIZE 65536
1317#endif
1318
1319#ifdef PNG_READ_SUPPORTED
1320/* Prior to libpng-1.0.9, this block was in pngasmrd.h */
1321#if defined(PNG_INTERNAL)
1322
1323/* These are the default thresholds before the MMX code kicks in; if either
1324 * rowbytes or bitdepth is below the threshold, plain C code is used. These
1325 * can be overridden at runtime via the png_set_mmx_thresholds() call in
1326 * libpng 1.2.0 and later. The values below were chosen by Intel.
1327 */
1328
1329#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
1330# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */
1331#endif
1332#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
1333# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */
1334#endif
1335
1336/* Set this in the makefile for VC++ on Pentium, not here. */
1337/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c .
1338 * MMX will be detected at run time and used if present.
1339 */
1340#ifdef PNG_USE_PNGVCRD
1341# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
1342# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
1343# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
1344#endif
1345
1346/* Set this in the makefile for gcc/as on Pentium, not here. */
1347/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c .
1348 * MMX will be detected at run time and used if present.
1349 */
1350#ifdef PNG_USE_PNGGCCRD
1351# define PNG_HAVE_ASSEMBLER_COMBINE_ROW
1352# define PNG_HAVE_ASSEMBLER_READ_INTERLACE
1353# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
1354#endif
1355/* - see pnggccrd.c for info about what is currently enabled */
1356
1357#endif /* PNG_INTERNAL */
1358#endif /* PNG_READ_SUPPORTED */
1359
1360#endif /* PNGCONF_H */
1361
int setjmp(jmp_buf env)
Save calling environment for long jump.
charf ** png_zcharpp
Definition pngconf.h:1111
char * png_charp
Definition pngconf.h:1075
png_fixed_point ** png_fixed_point_pp
Definition pngconf.h:1098
unsigned short png_uint_16
Definition pngconf.h:996
unsigned char png_byte
Definition pngconf.h:998
char ** png_charpp
Definition pngconf.h:1097
png_uint_32 ** png_uint_32pp
Definition pngconf.h:1092
unsigned long png_uint_32
Definition pngconf.h:994
png_byte * png_bytep
Definition pngconf.h:1069
double ** png_doublepp
Definition pngconf.h:1100
long png_int_32
Definition pngconf.h:995
png_int_16 ** png_int_16pp
Definition pngconf.h:1095
png_byte ** png_bytepp
Definition pngconf.h:1091
png_uint_16 * png_uint_16p
Definition pngconf.h:1072
size_t png_size_t
Definition pngconf.h:1002
png_int_32 * png_int_32p
Definition pngconf.h:1071
const char ** png_const_charpp
Definition pngconf.h:1096
void * png_voidp
Definition pngconf.h:1068
z_stream * png_zstreamp
Definition pngconf.h:1112
png_fixed_point * png_fixed_point_p
Definition pngconf.h:1076
png_uint_32 * png_uint_32p
Definition pngconf.h:1070
double * png_doublep
Definition pngconf.h:1087
#define PNG_CONST
Definition pngconf.h:387
short png_int_16
Definition pngconf.h:997
char *** png_charppp
Definition pngconf.h:1104
png_int_32 png_fixed_point
Definition pngconf.h:1065
png_int_32 ** png_int_32pp
Definition pngconf.h:1093
const char * png_const_charp
Definition pngconf.h:1074
png_uint_16 ** png_uint_16pp
Definition pngconf.h:1094
png_int_16 * png_int_16p
Definition pngconf.h:1073
#define FAR
Definition pngconf.h:1055
charf * png_zcharp
Definition pngconf.h:1110
char charf
Definition zconf.h:263