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