| 1 | /* |
|---|
| 2 | * $Id: //suprahd/releases/suprahd_163/suprahd_ztvapp640_163/drivers/graphics/PNG/lpng102/pngconf.h#1 $ |
|---|
| 3 | * $Revision: #1 $ |
|---|
| 4 | * $DateTime: 2006/02/24 17:51:46 $ |
|---|
| 5 | * $Change: 42566 $ |
|---|
| 6 | * $Author: pryush.sharma $ |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | /* pngconf.h - machine configurable file for libpng |
|---|
| 11 | * |
|---|
| 12 | * libpng 1.0.2 - June 14, 1998 |
|---|
| 13 | * For conditions of distribution and use, see copyright notice in png.h |
|---|
| 14 | * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. |
|---|
| 15 | * Copyright (c) 1996, 1997 Andreas Dilger |
|---|
| 16 | * Copyright (c) 1998, Glenn Randers-Pehrson |
|---|
| 17 | */ |
|---|
| 18 | |
|---|
| 19 | /* Any machine specific code is near the front of this file, so if you |
|---|
| 20 | * are configuring libpng for a machine, you may want to read the section |
|---|
| 21 | * starting here down to where it starts to typedef png_color, png_text, |
|---|
| 22 | * and png_info. |
|---|
| 23 | */ |
|---|
| 24 | |
|---|
| 25 | #ifndef PNGCONF_H |
|---|
| 26 | #define PNGCONF_H |
|---|
| 27 | |
|---|
| 28 | /* This is the size of the compression buffer, and thus the size of |
|---|
| 29 | * an IDAT chunk. Make this whatever size you feel is best for your |
|---|
| 30 | * machine. One of these will be allocated per png_struct. When this |
|---|
| 31 | * is full, it writes the data to the disk, and does some other |
|---|
| 32 | * calculations. Making this an extremely small size will slow |
|---|
| 33 | * the library down, but you may want to experiment to determine |
|---|
| 34 | * where it becomes significant, if you are concerned with memory |
|---|
| 35 | * usage. Note that zlib allocates at least 32Kb also. For readers, |
|---|
| 36 | * this describes the size of the buffer available to read the data in. |
|---|
| 37 | * Unless this gets smaller than the size of a row (compressed), |
|---|
| 38 | * it should not make much difference how big this is. |
|---|
| 39 | */ |
|---|
| 40 | |
|---|
| 41 | #ifndef PNG_ZBUF_SIZE |
|---|
| 42 | #define PNG_ZBUF_SIZE 8192 |
|---|
| 43 | #endif |
|---|
| 44 | |
|---|
| 45 | /* If you are running on a machine where you cannot allocate more |
|---|
| 46 | * than 64K of memory at once, uncomment this. While libpng will not |
|---|
| 47 | * normally need that much memory in a chunk (unless you load up a very |
|---|
| 48 | * large file), zlib needs to know how big of a chunk it can use, and |
|---|
| 49 | * libpng thus makes sure to check any memory allocation to verify it |
|---|
| 50 | * will fit into memory. |
|---|
| 51 | #define PNG_MAX_MALLOC_64K |
|---|
| 52 | */ |
|---|
| 53 | #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) |
|---|
| 54 | #define PNG_MAX_MALLOC_64K |
|---|
| 55 | #endif |
|---|
| 56 | |
|---|
| 57 | /* This protects us against compilers that run on a windowing system |
|---|
| 58 | * and thus don't have or would rather us not use the stdio types: |
|---|
| 59 | * stdin, stdout, and stderr. The only one currently used is stderr |
|---|
| 60 | * in png_error() and png_warning(). #defining PNG_NO_STDIO will |
|---|
| 61 | * prevent these from being compiled and used. |
|---|
| 62 | * #define PNG_NO_STDIO |
|---|
| 63 | */ |
|---|
| 64 | #define PNG_NO_STDIO/*BKTODO*/ |
|---|
| 65 | |
|---|
| 66 | #ifndef PNG_NO_STDIO |
|---|
| 67 | #include <stdio.h> |
|---|
| 68 | #endif |
|---|
| 69 | |
|---|
| 70 | /* This macro protects us against machines that don't have function |
|---|
| 71 | * prototypes (ie K&R style headers). If your compiler does not handle |
|---|
| 72 | * function prototypes, define this macro and use the included ansi2knr. |
|---|
| 73 | * I've always been able to use _NO_PROTO as the indicator, but you may |
|---|
| 74 | * need to drag the empty declaration out in front of here, or change the |
|---|
| 75 | * ifdef to suit your own needs. |
|---|
| 76 | */ |
|---|
| 77 | #ifndef PNGARG |
|---|
| 78 | |
|---|
| 79 | #ifdef OF /* zlib prototype munger */ |
|---|
| 80 | #define PNGARG(arglist) OF(arglist) |
|---|
| 81 | #else |
|---|
| 82 | |
|---|
| 83 | #ifdef _NO_PROTO |
|---|
| 84 | #define PNGARG(arglist) () |
|---|
| 85 | #else |
|---|
| 86 | #define PNGARG(arglist) arglist |
|---|
| 87 | #endif /* _NO_PROTO */ |
|---|
| 88 | |
|---|
| 89 | #endif /* OF */ |
|---|
| 90 | |
|---|
| 91 | #endif /* PNGARG */ |
|---|
| 92 | |
|---|
| 93 | /* Try to determine if we are compiling on a Mac. Note that testing for |
|---|
| 94 | * just __MWERKS__ is not good enough, because the Codewarrior is now used |
|---|
| 95 | * on non-Mac platforms. |
|---|
| 96 | */ |
|---|
| 97 | #ifndef MACOS |
|---|
| 98 | #if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ |
|---|
| 99 | defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) |
|---|
| 100 | #define MACOS |
|---|
| 101 | #endif |
|---|
| 102 | #endif |
|---|
| 103 | |
|---|
| 104 | #if 0 |
|---|
| 105 | /* enough people need this for various reasons to include it here */ |
|---|
| 106 | #if !defined(MACOS) && !defined(RISCOS) && !defined(__arm) && (TL_THREADX==0) |
|---|
| 107 | #include <sys/types.h> |
|---|
| 108 | #endif |
|---|
| 109 | #endif |
|---|
| 110 | |
|---|
| 111 | /* This is an attempt to force a single setjmp behaviour on Linux. If |
|---|
| 112 | * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. |
|---|
| 113 | */ |
|---|
| 114 | #ifdef __linux__ |
|---|
| 115 | #ifdef _BSD_SOURCE |
|---|
| 116 | #define _PNG_SAVE_BSD_SOURCE |
|---|
| 117 | #undef _BSD_SOURCE |
|---|
| 118 | #endif |
|---|
| 119 | #ifdef _SETJMP_H |
|---|
| 120 | __png.h__ already includes setjmp.h |
|---|
| 121 | __dont__ include it again |
|---|
| 122 | #endif |
|---|
| 123 | #endif /* __linux__ */ |
|---|
| 124 | |
|---|
| 125 | /* include setjmp.h for error handling */ |
|---|
| 126 | |
|---|
| 127 | #if 1//BKTEMP |
|---|
| 128 | //BKTEMP #include <setjmp.h> |
|---|
| 129 | #include "ministd.h" //BKTEMP |
|---|
| 130 | typedef int time_t; //BKTEMP |
|---|
| 131 | |
|---|
| 132 | #define PNG_NO_WRITE_tIME |
|---|
| 133 | #define PNG_NO_READ_tIME |
|---|
| 134 | |
|---|
| 135 | #define abs(a) ((a)>=0?(a):-(a)) |
|---|
| 136 | |
|---|
| 137 | #endif |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | #ifdef __linux__ |
|---|
| 146 | #ifdef _PNG_SAVE_BSD_SOURCE |
|---|
| 147 | #define _BSD_SOURCE |
|---|
| 148 | #undef _PNG_SAVE_BSD_SOURCE |
|---|
| 149 | #endif |
|---|
| 150 | #endif /* __linux__ */ |
|---|
| 151 | |
|---|
| 152 | #ifdef BSD |
|---|
| 153 | //#include <string.h> |
|---|
| 154 | #else |
|---|
| 155 | //BKTEMP //#include <string.h> |
|---|
| 156 | #endif |
|---|
| 157 | |
|---|
| 158 | /* Other defines for things like memory and the like can go here. */ |
|---|
| 159 | #ifdef PNG_INTERNAL |
|---|
| 160 | //BKTEMP //#include <string.h> |
|---|
| 161 | |
|---|
| 162 | /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which |
|---|
| 163 | * aren't usually used outside the library (as far as I know), so it is |
|---|
| 164 | * debatable if they should be exported at all. In the future, when it is |
|---|
| 165 | * possible to have run-time registry of chunk-handling functions, some of |
|---|
| 166 | * these will be made available again. |
|---|
| 167 | #define PNG_EXTERN extern |
|---|
| 168 | */ |
|---|
| 169 | #define PNG_EXTERN |
|---|
| 170 | |
|---|
| 171 | /* Other defines specific to compilers can go here. Try to keep |
|---|
| 172 | * them inside an appropriate ifdef/endif pair for portability. |
|---|
| 173 | */ |
|---|
| 174 | |
|---|
| 175 | #if defined(MACOS) |
|---|
| 176 | /* We need to check that <math.h> hasn't already been included earlier |
|---|
| 177 | * as it seems it doesn't agree with <fp.h>, yet we should really use |
|---|
| 178 | * <fp.h> if possible. |
|---|
| 179 | */ |
|---|
| 180 | #if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) |
|---|
| 181 | #include <fp.h> |
|---|
| 182 | #endif |
|---|
| 183 | #else |
|---|
| 184 | //BKTEMP#include <math.h> |
|---|
| 185 | #endif |
|---|
| 186 | |
|---|
| 187 | /* Codewarrior on NT has linking problems without this. */ |
|---|
| 188 | #if defined(__MWERKS__) && defined(WIN32) |
|---|
| 189 | #define PNG_ALWAYS_EXTERN |
|---|
| 190 | #endif |
|---|
| 191 | |
|---|
| 192 | /* For some reason, Borland C++ defines memcmp, etc. in mem.h, not |
|---|
| 193 | * stdlib.h like it should (I think). Or perhaps this is a C++ |
|---|
| 194 | * "feature"? |
|---|
| 195 | */ |
|---|
| 196 | #ifdef __TURBOC__ |
|---|
| 197 | //BKTEMP#include <mem.h> |
|---|
| 198 | //BKTEMP#include "alloc.h" |
|---|
| 199 | #endif |
|---|
| 200 | |
|---|
| 201 | #ifdef _MSC_VER |
|---|
| 202 | //BKTEMP#include <malloc.h> |
|---|
| 203 | #endif |
|---|
| 204 | |
|---|
| 205 | /* This controls how fine the dithering gets. As this allocates |
|---|
| 206 | * a largish chunk of memory (32K), those who are not as concerned |
|---|
| 207 | * with dithering quality can decrease some or all of these. |
|---|
| 208 | */ |
|---|
| 209 | #ifndef PNG_DITHER_RED_BITS |
|---|
| 210 | #define PNG_DITHER_RED_BITS 5 |
|---|
| 211 | #endif |
|---|
| 212 | #ifndef PNG_DITHER_GREEN_BITS |
|---|
| 213 | #define PNG_DITHER_GREEN_BITS 5 |
|---|
| 214 | #endif |
|---|
| 215 | #ifndef PNG_DITHER_BLUE_BITS |
|---|
| 216 | #define PNG_DITHER_BLUE_BITS 5 |
|---|
| 217 | #endif |
|---|
| 218 | |
|---|
| 219 | /* This controls how fine the gamma correction becomes when you |
|---|
| 220 | * are only interested in 8 bits anyway. Increasing this value |
|---|
| 221 | * results in more memory being used, and more pow() functions |
|---|
| 222 | * being called to fill in the gamma tables. Don't set this value |
|---|
| 223 | * less then 8, and even that may not work (I haven't tested it). |
|---|
| 224 | */ |
|---|
| 225 | |
|---|
| 226 | #ifndef PNG_MAX_GAMMA_8 |
|---|
| 227 | #define PNG_MAX_GAMMA_8 11 |
|---|
| 228 | #endif |
|---|
| 229 | |
|---|
| 230 | /* This controls how much a difference in gamma we can tolerate before |
|---|
| 231 | * we actually start doing gamma conversion. |
|---|
| 232 | */ |
|---|
| 233 | #ifndef PNG_GAMMA_THRESHOLD |
|---|
| 234 | #define PNG_GAMMA_THRESHOLD 0.05 |
|---|
| 235 | #endif |
|---|
| 236 | |
|---|
| 237 | #endif /* PNG_INTERNAL */ |
|---|
| 238 | |
|---|
| 239 | /* The following uses const char * instead of char * for error |
|---|
| 240 | * and warning message functions, so some compilers won't complain. |
|---|
| 241 | * If you do not want to use const, define PNG_NO_CONST here. |
|---|
| 242 | */ |
|---|
| 243 | |
|---|
| 244 | #ifndef PNG_NO_CONST |
|---|
| 245 | # define PNG_CONST const |
|---|
| 246 | #else |
|---|
| 247 | # define PNG_CONST |
|---|
| 248 | #endif |
|---|
| 249 | |
|---|
| 250 | /* The following defines give you the ability to remove code from the |
|---|
| 251 | * library that you will not be using. I wish I could figure out how to |
|---|
| 252 | * automate this, but I can't do that without making it seriously hard |
|---|
| 253 | * on the users. So if you are not using an ability, change the #define |
|---|
| 254 | * to and #undef, and that part of the library will not be compiled. If |
|---|
| 255 | * your linker can't find a function, you may want to make sure the |
|---|
| 256 | * ability is defined here. Some of these depend upon some others being |
|---|
| 257 | * defined. I haven't figured out all the interactions here, so you may |
|---|
| 258 | * have to experiment awhile to get everything to compile. If you are |
|---|
| 259 | * creating or using a shared library, you probably shouldn't touch this, |
|---|
| 260 | * as it will affect the size of the structures, and this will cause bad |
|---|
| 261 | * things to happen if the library and/or application ever change. |
|---|
| 262 | */ |
|---|
| 263 | |
|---|
| 264 | /* Any transformations you will not be using can be undef'ed here */ |
|---|
| 265 | |
|---|
| 266 | /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user |
|---|
| 267 | to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS |
|---|
| 268 | on the compile line, then pick and choose which ones to define without |
|---|
| 269 | having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED |
|---|
| 270 | if you only want to have a png-compliant reader/writer but don't need |
|---|
| 271 | any of the extra transformations. This saves about 80 kbytes in a |
|---|
| 272 | typical installation of the library. (PNG_NO_* form added in version |
|---|
| 273 | 1.0.1c, for consistency) |
|---|
| 274 | */ |
|---|
| 275 | |
|---|
| 276 | |
|---|
| 277 | #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ |
|---|
| 278 | !defined(PNG_NO_READ_TRANSFORMS) |
|---|
| 279 | #define PNG_READ_TRANSFORMS_SUPPORTED |
|---|
| 280 | #endif |
|---|
| 281 | #if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ |
|---|
| 282 | !defined(PNG_NO_WRITE_TRANSFORMS) |
|---|
| 283 | #define PNG_WRITE_TRANSFORMS_SUPPORTED |
|---|
| 284 | #endif |
|---|
| 285 | |
|---|
| 286 | #ifdef PNG_READ_TRANSFORMS_SUPPORTED |
|---|
| 287 | #ifndef PNG_NO_READ_EXPAND |
|---|
| 288 | #define PNG_READ_EXPAND_SUPPORTED |
|---|
| 289 | #endif |
|---|
| 290 | #ifndef PNG_NO_READ_SHIFT |
|---|
| 291 | #define PNG_READ_SHIFT_SUPPORTED |
|---|
| 292 | #endif |
|---|
| 293 | #ifndef PNG_NO_READ_PACK |
|---|
| 294 | #define PNG_READ_PACK_SUPPORTED |
|---|
| 295 | #endif |
|---|
| 296 | #ifndef PNG_NO_READ_BGR |
|---|
| 297 | #define PNG_READ_BGR_SUPPORTED |
|---|
| 298 | #endif |
|---|
| 299 | #ifndef PNG_NO_READ_SWAP |
|---|
| 300 | #define PNG_READ_SWAP_SUPPORTED |
|---|
| 301 | #endif |
|---|
| 302 | #ifndef PNG_NO_READ_PACKSWAP |
|---|
| 303 | #define PNG_READ_PACKSWAP_SUPPORTED |
|---|
| 304 | #endif |
|---|
| 305 | #ifndef PNG_NO_READ_INVERT |
|---|
| 306 | #define PNG_READ_INVERT_SUPPORTED |
|---|
| 307 | #endif |
|---|
| 308 | #ifndef PNG_NO_READ_DITHER |
|---|
| 309 | #define PNG_READ_DITHER_SUPPORTED |
|---|
| 310 | #endif |
|---|
| 311 | #ifndef PNG_NO_READ_BACKGROUND |
|---|
| 312 | #define PNG_READ_BACKGROUND_SUPPORTED |
|---|
| 313 | #endif |
|---|
| 314 | #ifndef PNG_NO_READ_16_TO_8 |
|---|
| 315 | #define PNG_READ_16_TO_8_SUPPORTED |
|---|
| 316 | #endif |
|---|
| 317 | #ifndef PNG_NO_READ_FILLER |
|---|
| 318 | #define PNG_READ_FILLER_SUPPORTED |
|---|
| 319 | #endif |
|---|
| 320 | #ifndef PNG_NO_READ_GAMMA |
|---|
| 321 | #define PNG_READ_GAMMA_SUPPORTED |
|---|
| 322 | #endif |
|---|
| 323 | #ifndef PNG_NO_READ_GRAY_TO_RGB |
|---|
| 324 | #define PNG_READ_GRAY_TO_RGB_SUPPORTED |
|---|
| 325 | #endif |
|---|
| 326 | #ifndef PNG_NO_READ_SWAP_ALPHA |
|---|
| 327 | #define PNG_READ_SWAP_ALPHA_SUPPORTED |
|---|
| 328 | #endif |
|---|
| 329 | #ifndef PNG_NO_READ_INVERT_ALPHA |
|---|
| 330 | #define PNG_READ_INVERT_ALPHA_SUPPORTED |
|---|
| 331 | #endif |
|---|
| 332 | #ifndef PNG_NO_READ_STRIP_ALPHA |
|---|
| 333 | #define PNG_READ_STRIP_ALPHA_SUPPORTED |
|---|
| 334 | #endif |
|---|
| 335 | #ifndef PNG_NO_READ_USER_TRANSFORM |
|---|
| 336 | #define PNG_READ_USER_TRANSFORM_SUPPORTED |
|---|
| 337 | #endif |
|---|
| 338 | /* the following aren't implemented yet |
|---|
| 339 | #ifndef PNG_NO_READ_RGB_TO_GRAY |
|---|
| 340 | #define PNG_READ_RGB_TO_GRAY_SUPPORTED |
|---|
| 341 | #endif |
|---|
| 342 | */ |
|---|
| 343 | #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ |
|---|
| 344 | |
|---|
| 345 | #if !defined(PNG_NO_PROGRESSIVE_READ) && \ |
|---|
| 346 | !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ |
|---|
| 347 | #define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ |
|---|
| 348 | #endif /* about interlacing capability! You'll */ |
|---|
| 349 | /* still have interlacing unless you change the following line: */ |
|---|
| 350 | #define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ |
|---|
| 351 | |
|---|
| 352 | #ifndef PNG_NO_READ_COMPOSITED_NODIV |
|---|
| 353 | #define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel and SGI */ |
|---|
| 354 | #endif |
|---|
| 355 | |
|---|
| 356 | #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED |
|---|
| 357 | #ifndef PNG_NO_WRITE_SHIFT |
|---|
| 358 | #define PNG_WRITE_SHIFT_SUPPORTED |
|---|
| 359 | #endif |
|---|
| 360 | #ifndef PNG_NO_WRITE_PACK |
|---|
| 361 | #define PNG_WRITE_PACK_SUPPORTED |
|---|
| 362 | #endif |
|---|
| 363 | #ifndef PNG_NO_WRITE_BGR |
|---|
| 364 | #define PNG_WRITE_BGR_SUPPORTED |
|---|
| 365 | #endif |
|---|
| 366 | #ifndef PNG_NO_WRITE_SWAP |
|---|
| 367 | #define PNG_WRITE_SWAP_SUPPORTED |
|---|
| 368 | #endif |
|---|
| 369 | #ifndef PNG_NO_WRITE_PACKSWAP |
|---|
| 370 | #define PNG_WRITE_PACKSWAP_SUPPORTED |
|---|
| 371 | #endif |
|---|
| 372 | #ifndef PNG_NO_WRITE_INVERT |
|---|
| 373 | #define PNG_WRITE_INVERT_SUPPORTED |
|---|
| 374 | #endif |
|---|
| 375 | #ifndef PNG_NO_WRITE_FILLER |
|---|
| 376 | #define PNG_WRITE_FILLER_SUPPORTED /* This is the same as WRITE_STRIP_ALPHA */ |
|---|
| 377 | #endif |
|---|
| 378 | #ifndef PNG_NO_WRITE_SWAP_ALPHA |
|---|
| 379 | #define PNG_WRITE_SWAP_ALPHA_SUPPORTED |
|---|
| 380 | #endif |
|---|
| 381 | #ifndef PNG_NO_WRITE_INVERT_ALPHA |
|---|
| 382 | #define PNG_WRITE_INVERT_ALPHA_SUPPORTED |
|---|
| 383 | #endif |
|---|
| 384 | #ifndef PNG_NO_WRITE_USER_TRANSFORM |
|---|
| 385 | #define PNG_WRITE_USER_TRANSFORM_SUPPORTED |
|---|
| 386 | #endif |
|---|
| 387 | #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ |
|---|
| 388 | |
|---|
| 389 | #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant |
|---|
| 390 | encoders, but can cause trouble |
|---|
| 391 | if left undefined */ |
|---|
| 392 | |
|---|
| 393 | #ifndef PNG_NO_WRITE_WEIGHTED_FILTER |
|---|
| 394 | #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED |
|---|
| 395 | #endif |
|---|
| 396 | |
|---|
| 397 | #ifndef PNG_NO_WRITE_FLUSH |
|---|
| 398 | #define PNG_WRITE_FLUSH_SUPPORTED |
|---|
| 399 | #endif |
|---|
| 400 | |
|---|
| 401 | #ifndef PNG_NO_STDIO |
|---|
| 402 | #define PNG_TIME_RFC1123_SUPPORTED |
|---|
| 403 | #endif |
|---|
| 404 | |
|---|
| 405 | /* This adds extra functions in pngget.c for accessing data from the |
|---|
| 406 | * info pointer (added in version 0.99) |
|---|
| 407 | * png_get_image_width() |
|---|
| 408 | * png_get_image_height() |
|---|
| 409 | * png_get_bit_depth() |
|---|
| 410 | * png_get_color_type() |
|---|
| 411 | * png_get_compression_type() |
|---|
| 412 | * png_get_filter_type() |
|---|
| 413 | * png_get_interlace_type() |
|---|
| 414 | * png_get_pixel_aspect_ratio() |
|---|
| 415 | * png_get_pixels_per_meter() |
|---|
| 416 | * png_get_x_offset_pixels() |
|---|
| 417 | * png_get_y_offset_pixels() |
|---|
| 418 | * png_get_x_offset_microns() |
|---|
| 419 | * png_get_y_offset_microns() |
|---|
| 420 | */ |
|---|
| 421 | #ifndef PNG_NO_EASY_ACCESS |
|---|
| 422 | #define PNG_EASY_ACCESS_SUPPORTED |
|---|
| 423 | #endif |
|---|
| 424 | |
|---|
| 425 | #define PNG_USER_MEM_SUPPORTED 1 |
|---|
| 426 | |
|---|
| 427 | /* These are currently experimental features, define them if you want */ |
|---|
| 428 | |
|---|
| 429 | /* very little testing */ |
|---|
| 430 | /* |
|---|
| 431 | #define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED |
|---|
| 432 | */ |
|---|
| 433 | |
|---|
| 434 | /* This is only for PowerPC big-endian and 680x0 systems */ |
|---|
| 435 | /* some testing */ |
|---|
| 436 | /* |
|---|
| 437 | #define PNG_READ_BIG_ENDIAN_SUPPORTED |
|---|
| 438 | */ |
|---|
| 439 | |
|---|
| 440 | /* These functions are turned off by default, as they will be phased out. */ |
|---|
| 441 | /* |
|---|
| 442 | #define PNG_USELESS_TESTS_SUPPORTED |
|---|
| 443 | #define PNG_CORRECT_PALETTE_SUPPORTED |
|---|
| 444 | */ |
|---|
| 445 | |
|---|
| 446 | /* Any chunks you are not interested in, you can undef here. The |
|---|
| 447 | * ones that allocate memory may be expecially important (hIST, |
|---|
| 448 | * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info |
|---|
| 449 | * a bit smaller. |
|---|
| 450 | */ |
|---|
| 451 | |
|---|
| 452 | #if !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ |
|---|
| 453 | !defined(PNG_NO_READ_ANCILLARY_CHUNKS) |
|---|
| 454 | #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED |
|---|
| 455 | #endif |
|---|
| 456 | #if !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ |
|---|
| 457 | !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) |
|---|
| 458 | #define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED |
|---|
| 459 | #endif |
|---|
| 460 | |
|---|
| 461 | #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED |
|---|
| 462 | #ifndef PNG_NO_READ_bKGD |
|---|
| 463 | #define PNG_READ_bKGD_SUPPORTED |
|---|
| 464 | #endif |
|---|
| 465 | #ifndef PNG_NO_READ_cHRM |
|---|
| 466 | #define PNG_READ_cHRM_SUPPORTED |
|---|
| 467 | #endif |
|---|
| 468 | #ifndef PNG_NO_READ_gAMA |
|---|
| 469 | #define PNG_READ_gAMA_SUPPORTED |
|---|
| 470 | #endif |
|---|
| 471 | #ifndef PNG_NO_READ_hIST |
|---|
| 472 | #define PNG_READ_hIST_SUPPORTED |
|---|
| 473 | #endif |
|---|
| 474 | #ifndef PNG_NO_READ_oFFs |
|---|
| 475 | #define PNG_READ_oFFs_SUPPORTED |
|---|
| 476 | #endif |
|---|
| 477 | #ifndef PNG_NO_READ_pCAL |
|---|
| 478 | #define PNG_READ_pCAL_SUPPORTED |
|---|
| 479 | #endif |
|---|
| 480 | #ifndef PNG_NO_READ_pHYs |
|---|
| 481 | #define PNG_READ_pHYs_SUPPORTED |
|---|
| 482 | #endif |
|---|
| 483 | #ifndef PNG_NO_READ_sBIT |
|---|
| 484 | #define PNG_READ_sBIT_SUPPORTED |
|---|
| 485 | #endif |
|---|
| 486 | #ifndef PNG_NO_READ_sRGB |
|---|
| 487 | #define PNG_READ_sRGB_SUPPORTED |
|---|
| 488 | #endif |
|---|
| 489 | #ifndef PNG_NO_READ_tEXt |
|---|
| 490 | #define PNG_READ_tEXt_SUPPORTED |
|---|
| 491 | #endif |
|---|
| 492 | #ifndef PNG_NO_READ_tIME |
|---|
| 493 | #define PNG_READ_tIME_SUPPORTED |
|---|
| 494 | #endif |
|---|
| 495 | #ifndef PNG_NO_READ_tRNS |
|---|
| 496 | #define PNG_READ_tRNS_SUPPORTED |
|---|
| 497 | #endif |
|---|
| 498 | #ifndef PNG_NO_READ_zTXt |
|---|
| 499 | #define PNG_READ_zTXt_SUPPORTED |
|---|
| 500 | #endif |
|---|
| 501 | #ifndef PNG_NO_READ_OPT_PLTE |
|---|
| 502 | #define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the optional */ |
|---|
| 503 | #endif /* PLTE chunk in RGB and RGBA images */ |
|---|
| 504 | #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ |
|---|
| 505 | |
|---|
| 506 | #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED |
|---|
| 507 | #ifndef PNG_NO_WRITE_bKGD |
|---|
| 508 | #define PNG_WRITE_bKGD_SUPPORTED |
|---|
| 509 | #endif |
|---|
| 510 | #ifndef PNG_NO_WRITE_cHRM |
|---|
| 511 | #define PNG_WRITE_cHRM_SUPPORTED |
|---|
| 512 | #endif |
|---|
| 513 | #ifndef PNG_NO_WRITE_gAMA |
|---|
| 514 | #define PNG_WRITE_gAMA_SUPPORTED |
|---|
| 515 | #endif |
|---|
| 516 | #ifndef PNG_NO_WRITE_hIST |
|---|
| 517 | #define PNG_WRITE_hIST_SUPPORTED |
|---|
| 518 | #endif |
|---|
| 519 | #ifndef PNG_NO_WRITE_oFFs |
|---|
| 520 | #define PNG_WRITE_oFFs_SUPPORTED |
|---|
| 521 | #endif |
|---|
| 522 | #ifndef PNG_NO_WRITE_pCAL |
|---|
| 523 | #define PNG_WRITE_pCAL_SUPPORTED |
|---|
| 524 | #endif |
|---|
| 525 | #ifndef PNG_NO_WRITE_pHYs |
|---|
| 526 | #define PNG_WRITE_pHYs_SUPPORTED |
|---|
| 527 | #endif |
|---|
| 528 | #ifndef PNG_NO_WRITE_sBIT |
|---|
| 529 | #define PNG_WRITE_sBIT_SUPPORTED |
|---|
| 530 | #endif |
|---|
| 531 | #ifndef PNG_NO_WRITE_sRGB |
|---|
| 532 | #define PNG_WRITE_sRGB_SUPPORTED |
|---|
| 533 | #endif |
|---|
| 534 | #ifndef PNG_NO_WRITE_tEXt |
|---|
| 535 | #define PNG_WRITE_tEXt_SUPPORTED |
|---|
| 536 | #endif |
|---|
| 537 | #ifndef PNG_NO_WRITE_tIME |
|---|
| 538 | #define PNG_WRITE_tIME_SUPPORTED |
|---|
| 539 | #endif |
|---|
| 540 | #ifndef PNG_NO_WRITE_tRNS |
|---|
| 541 | #define PNG_WRITE_tRNS_SUPPORTED |
|---|
| 542 | #endif |
|---|
| 543 | #ifndef PNG_NO_WRITE_zTXt |
|---|
| 544 | #define PNG_WRITE_zTXt_SUPPORTED |
|---|
| 545 | #endif |
|---|
| 546 | #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ |
|---|
| 547 | |
|---|
| 548 | /* need the time information for reading tIME chunks */ |
|---|
| 549 | #if defined(PNG_READ_tIME_SUPPORTED) || defined(PNG_WRITE_tIME_SUPPORTED) |
|---|
| 550 | //BKTEMP#include <time.h> |
|---|
| 551 | #endif |
|---|
| 552 | |
|---|
| 553 | /* Some typedefs to get us started. These should be safe on most of the |
|---|
| 554 | * common platforms. The typedefs should be at least as large as the |
|---|
| 555 | * numbers suggest (a png_uint_32 must be at least 32 bits long), but they |
|---|
| 556 | * don't have to be exactly that size. Some compilers dislike passing |
|---|
| 557 | * unsigned shorts as function parameters, so you may be better off using |
|---|
| 558 | * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may |
|---|
| 559 | * want to have unsigned int for png_uint_32 instead of unsigned long. |
|---|
| 560 | */ |
|---|
| 561 | |
|---|
| 562 | typedef unsigned long png_uint_32; |
|---|
| 563 | typedef long png_int_32; |
|---|
| 564 | typedef unsigned short png_uint_16; |
|---|
| 565 | typedef short png_int_16; |
|---|
| 566 | typedef unsigned char png_byte; |
|---|
| 567 | |
|---|
| 568 | /* This is usually size_t. It is typedef'ed just in case you need it to |
|---|
| 569 | change (I'm not sure if you will or not, so I thought I'd be safe) */ |
|---|
| 570 | typedef unsigned int png_size_t; |
|---|
| 571 | |
|---|
| 572 | /* The following is needed for medium model support. It cannot be in the |
|---|
| 573 | * PNG_INTERNAL section. Needs modification for other compilers besides |
|---|
| 574 | * MSC. Model independent support declares all arrays and pointers to be |
|---|
| 575 | * large using the far keyword. The zlib version used must also support |
|---|
| 576 | * model independent data. As of version zlib 1.0.4, the necessary changes |
|---|
| 577 | * have been made in zlib. The USE_FAR_KEYWORD define triggers other |
|---|
| 578 | * changes that are needed. (Tim Wegner) |
|---|
| 579 | */ |
|---|
| 580 | |
|---|
| 581 | /* Separate compiler dependencies (problem here is that zlib.h always |
|---|
| 582 | defines FAR. (SJT) */ |
|---|
| 583 | #ifdef __BORLANDC__ |
|---|
| 584 | #if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) |
|---|
| 585 | #define LDATA 1 |
|---|
| 586 | #else |
|---|
| 587 | #define LDATA 0 |
|---|
| 588 | #endif |
|---|
| 589 | |
|---|
| 590 | #if !defined(__WIN32__) && !defined(__FLAT__) |
|---|
| 591 | #define PNG_MAX_MALLOC_64K |
|---|
| 592 | #if (LDATA != 1) |
|---|
| 593 | #ifndef FAR |
|---|
| 594 | #define FAR __far |
|---|
| 595 | #endif |
|---|
| 596 | #define USE_FAR_KEYWORD |
|---|
| 597 | #endif /* LDATA != 1 */ |
|---|
| 598 | |
|---|
| 599 | /* Possibly useful for moving data out of default segment. |
|---|
| 600 | * Uncomment it if you want. Could also define FARDATA as |
|---|
| 601 | * const if your compiler supports it. (SJT) |
|---|
| 602 | # define FARDATA FAR |
|---|
| 603 | */ |
|---|
| 604 | #endif /* __WIN32__, __FLAT__ */ |
|---|
| 605 | |
|---|
| 606 | #endif /* __BORLANDC__ */ |
|---|
| 607 | |
|---|
| 608 | |
|---|
| 609 | /* Suggest testing for specific compiler first before testing for |
|---|
| 610 | * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, |
|---|
| 611 | * making reliance oncertain keywords suspect. (SJT) |
|---|
| 612 | */ |
|---|
| 613 | |
|---|
| 614 | /* MSC Medium model */ |
|---|
| 615 | #if defined(FAR) |
|---|
| 616 | # if defined(M_I86MM) |
|---|
| 617 | # define USE_FAR_KEYWORD |
|---|
| 618 | # define FARDATA FAR |
|---|
| 619 | # include <dos.h> |
|---|
| 620 | # endif |
|---|
| 621 | #endif |
|---|
| 622 | |
|---|
| 623 | /* SJT: default case */ |
|---|
| 624 | #ifndef FAR |
|---|
| 625 | # define FAR |
|---|
| 626 | #endif |
|---|
| 627 | |
|---|
| 628 | /* At this point FAR is always defined */ |
|---|
| 629 | #ifndef FARDATA |
|---|
| 630 | #define FARDATA |
|---|
| 631 | #endif |
|---|
| 632 | |
|---|
| 633 | /* Add typedefs for pointers */ |
|---|
| 634 | typedef void FAR * png_voidp; |
|---|
| 635 | typedef png_byte FAR * png_bytep; |
|---|
| 636 | typedef png_uint_32 FAR * png_uint_32p; |
|---|
| 637 | typedef png_int_32 FAR * png_int_32p; |
|---|
| 638 | typedef png_uint_16 FAR * png_uint_16p; |
|---|
| 639 | typedef png_int_16 FAR * png_int_16p; |
|---|
| 640 | typedef PNG_CONST char FAR * png_const_charp; |
|---|
| 641 | typedef char FAR * png_charp; |
|---|
| 642 | typedef double FAR * png_doublep; |
|---|
| 643 | |
|---|
| 644 | /* Pointers to pointers; i.e. arrays */ |
|---|
| 645 | typedef png_byte FAR * FAR * png_bytepp; |
|---|
| 646 | typedef png_uint_32 FAR * FAR * png_uint_32pp; |
|---|
| 647 | typedef png_int_32 FAR * FAR * png_int_32pp; |
|---|
| 648 | typedef png_uint_16 FAR * FAR * png_uint_16pp; |
|---|
| 649 | typedef png_int_16 FAR * FAR * png_int_16pp; |
|---|
| 650 | typedef PNG_CONST char FAR * FAR * png_const_charpp; |
|---|
| 651 | typedef char FAR * FAR * png_charpp; |
|---|
| 652 | typedef double FAR * FAR * png_doublepp; |
|---|
| 653 | |
|---|
| 654 | /* Pointers to pointers to pointers; i.e. pointer to array */ |
|---|
| 655 | typedef char FAR * FAR * FAR * png_charppp; |
|---|
| 656 | |
|---|
| 657 | /* libpng typedefs for types in zlib. If zlib changes |
|---|
| 658 | * or another compression library is used, then change these. |
|---|
| 659 | * Eliminates need to change all the source files. |
|---|
| 660 | */ |
|---|
| 661 | typedef charf * png_zcharp; |
|---|
| 662 | typedef charf * FAR * png_zcharpp; |
|---|
| 663 | typedef z_stream FAR * png_zstreamp; |
|---|
| 664 | |
|---|
| 665 | /* allow for compilation as dll under MS Windows */ |
|---|
| 666 | #ifdef __WIN32DLL__ |
|---|
| 667 | #define PNG_EXPORT(type,symbol) __declspec(dllexport) type symbol |
|---|
| 668 | #endif |
|---|
| 669 | |
|---|
| 670 | /* allow for compilation as dll with BORLAND C++ 5.0 */ |
|---|
| 671 | #if defined(__BORLANDC__) && defined(_Windows) && defined(__DLL__) |
|---|
| 672 | # define PNG_EXPORT(type,symbol) type _export symbol |
|---|
| 673 | #endif |
|---|
| 674 | |
|---|
| 675 | /* allow for compilation as shared lib under BeOS */ |
|---|
| 676 | #ifdef __BEOSDLL__ |
|---|
| 677 | #define PNG_EXPORT(type,symbol) __declspec(export) type symbol |
|---|
| 678 | #endif |
|---|
| 679 | |
|---|
| 680 | #ifndef PNG_EXPORT |
|---|
| 681 | #define PNG_EXPORT(type,symbol) type symbol |
|---|
| 682 | #endif |
|---|
| 683 | |
|---|
| 684 | |
|---|
| 685 | /* User may want to use these so not in PNG_INTERNAL. Any library functions |
|---|
| 686 | * that are passed far data must be model independent. |
|---|
| 687 | */ |
|---|
| 688 | |
|---|
| 689 | #if defined(USE_FAR_KEYWORD) /* memory model independent fns */ |
|---|
| 690 | /* use this to make far-to-near assignments */ |
|---|
| 691 | # define CHECK 1 |
|---|
| 692 | # define NOCHECK 0 |
|---|
| 693 | # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) |
|---|
| 694 | # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) |
|---|
| 695 | # define png_strcpy _fstrcpy |
|---|
| 696 | # define png_strlen _fstrlen |
|---|
| 697 | # define png_memcmp _fmemcmp /* SJT: added */ |
|---|
| 698 | # define png_memcpy _fmemcpy |
|---|
| 699 | # define png_memset _fmemset |
|---|
| 700 | #else /* use the usual functions */ |
|---|
| 701 | # define CVT_PTR(ptr) (ptr) |
|---|
| 702 | # define CVT_PTR_NOCHECK(ptr) (ptr) |
|---|
| 703 | # define png_strcpy strcpy |
|---|
| 704 | # define png_strlen strlen |
|---|
| 705 | # define png_memcmp memcmp /* SJT: added */ |
|---|
| 706 | # define png_memcpy memcpy |
|---|
| 707 | # define png_memset memset |
|---|
| 708 | #endif |
|---|
| 709 | /* End of memory model independent support */ |
|---|
| 710 | |
|---|
| 711 | /* Just a double check that someone hasn't tried to define something |
|---|
| 712 | * contradictory. |
|---|
| 713 | */ |
|---|
| 714 | #if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K) |
|---|
| 715 | #undef PNG_ZBUF_SIZE |
|---|
| 716 | #define PNG_ZBUF_SIZE 65536 |
|---|
| 717 | #endif |
|---|
| 718 | |
|---|
| 719 | #endif /* PNGCONF_H */ |
|---|
| 720 | |
|---|