00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef PNGCONF_H
00018 #define PNGCONF_H
00019
00020 #define PNG_1_2_X
00021
00022
00023
00024
00025
00026 #ifdef PNG_USER_CONFIG
00027 # ifndef PNG_USER_PRIVATEBUILD
00028 # define PNG_USER_PRIVATEBUILD
00029 # endif
00030 #include "pngusr.h"
00031 #endif
00032
00033
00034 #ifdef PNG_CONFIGURE_LIBPNG
00035 #ifdef HAVE_CONFIG_H
00036 #include "config.h"
00037 #endif
00038 #endif
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #ifdef __STDC__
00062 #ifdef SPECIALBUILD
00063 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
00064 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
00065 #endif
00066
00067 #ifdef PRIVATEBUILD
00068 # pragma message("PRIVATEBUILD is deprecated.\
00069 Use PNG_USER_PRIVATEBUILD instead.")
00070 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
00071 #endif
00072 #endif
00073
00074 #ifndef PNG_VERSION_INFO_ONLY
00075
00076
00077
00078
00079
00080 #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \
00081 !defined(PNG_WARN_UNINITIALIZED_ROW)
00082 # define PNG_WARN_UNINITIALIZED_ROW 1
00083 #endif
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 #ifndef PNG_ZBUF_SIZE
00100 # define PNG_ZBUF_SIZE 8192
00101 #endif
00102
00103
00104
00105 #ifndef PNG_NO_READ_SUPPORTED
00106 # define PNG_READ_SUPPORTED
00107 #endif
00108
00109
00110
00111 #ifndef PNG_NO_WRITE_SUPPORTED
00112 # define PNG_WRITE_SUPPORTED
00113 #endif
00114
00115
00116
00117 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
00118 # ifndef PNG_MNG_FEATURES_SUPPORTED
00119 # define PNG_MNG_FEATURES_SUPPORTED
00120 # endif
00121 #endif
00122
00123 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
00124 # ifndef PNG_FLOATING_POINT_SUPPORTED
00125 # define PNG_FLOATING_POINT_SUPPORTED
00126 # endif
00127 #endif
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
00138 # define PNG_MAX_MALLOC_64K
00139 #endif
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 #if defined(__CYGWIN__)
00175 # if defined(ALL_STATIC)
00176 # if defined(PNG_BUILD_DLL)
00177 # undef PNG_BUILD_DLL
00178 # endif
00179 # if defined(PNG_USE_DLL)
00180 # undef PNG_USE_DLL
00181 # endif
00182 # if defined(PNG_DLL)
00183 # undef PNG_DLL
00184 # endif
00185 # if !defined(PNG_STATIC)
00186 # define PNG_STATIC
00187 # endif
00188 # else
00189 # if defined (PNG_BUILD_DLL)
00190 # if defined(PNG_STATIC)
00191 # undef PNG_STATIC
00192 # endif
00193 # if defined(PNG_USE_DLL)
00194 # undef PNG_USE_DLL
00195 # endif
00196 # if !defined(PNG_DLL)
00197 # define PNG_DLL
00198 # endif
00199 # else
00200 # if defined(PNG_STATIC)
00201 # if defined(PNG_USE_DLL)
00202 # undef PNG_USE_DLL
00203 # endif
00204 # if defined(PNG_DLL)
00205 # undef PNG_DLL
00206 # endif
00207 # else
00208 # if !defined(PNG_USE_DLL)
00209 # define PNG_USE_DLL
00210 # endif
00211 # if !defined(PNG_DLL)
00212 # define PNG_DLL
00213 # endif
00214 # endif
00215 # endif
00216 # endif
00217 #endif
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 #if defined(_WIN32_WCE)
00233 # include <windows.h>
00234
00235 # define PNG_NO_CONSOLE_IO
00236
00237 # define PNG_ABORT() exit(-1)
00238 # ifdef PNG_DEBUG
00239 # undef PNG_DEBUG
00240 # endif
00241 #endif
00242
00243 #ifdef PNG_BUILD_DLL
00244 # ifndef PNG_CONSOLE_IO_SUPPORTED
00245 # ifndef PNG_NO_CONSOLE_IO
00246 # define PNG_NO_CONSOLE_IO
00247 # endif
00248 # endif
00249 #endif
00250
00251 # ifdef PNG_NO_STDIO
00252 # ifndef PNG_NO_CONSOLE_IO
00253 # define PNG_NO_CONSOLE_IO
00254 # endif
00255 # ifdef PNG_DEBUG
00256 # if (PNG_DEBUG > 0)
00257 # include <stdio.h>
00258 # endif
00259 # endif
00260 # else
00261 # if !defined(_WIN32_WCE)
00262
00263 # include <stdio.h>
00264 # endif
00265 # endif
00266
00267
00268
00269
00270
00271
00272
00273
00274 #ifndef PNGARG
00275
00276 #ifdef OF
00277 # define PNGARG(arglist) OF(arglist)
00278 #else
00279
00280 #ifdef _NO_PROTO
00281 # define PNGARG(arglist) ()
00282 # ifndef PNG_TYPECAST_NULL
00283 # define PNG_TYPECAST_NULL
00284 # endif
00285 #else
00286 # define PNGARG(arglist) arglist
00287 #endif
00288
00289
00290 #endif
00291
00292 #endif
00293
00294
00295
00296
00297
00298 #ifndef MACOS
00299 # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
00300 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
00301 # define MACOS
00302 # endif
00303 #endif
00304
00305
00306 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
00307 # include <sys/types.h>
00308 #endif
00309
00310 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
00311 # define PNG_SETJMP_SUPPORTED
00312 #endif
00313
00314 #ifdef PNG_SETJMP_SUPPORTED
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325 # ifndef PNG_SKIP_SETJMP_CHECK
00326 # ifdef __linux__
00327 # ifdef _BSD_SOURCE
00328 # define PNG_SAVE_BSD_SOURCE
00329 # undef _BSD_SOURCE
00330 # endif
00331 # ifdef _SETJMP_H
00332
00333
00334
00335 __pngconf.h__ in libpng already includes setjmp.h;
00336 __dont__ include it again.;
00337 # endif
00338 # endif
00339 # endif
00340
00341
00342 # include <setjmp.h>
00343
00344 # ifdef __linux__
00345 # ifdef PNG_SAVE_BSD_SOURCE
00346 # ifndef _BSD_SOURCE
00347 # define _BSD_SOURCE
00348 # endif
00349 # undef PNG_SAVE_BSD_SOURCE
00350 # endif
00351 # endif
00352 #endif
00353
00354 #ifdef BSD
00355 # include <strings.h>
00356 #else
00357 # include <string.h>
00358 #endif
00359
00360
00361 #ifdef PNG_INTERNAL
00362
00363 #include <stdlib.h>
00364
00365
00366
00367
00368
00369
00370
00371
00372 #define PNG_EXTERN
00373
00374
00375
00376
00377
00378 #if defined(PNG_FLOATING_POINT_SUPPORTED)
00379 # if defined(MACOS)
00380
00381
00382
00383
00384 # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
00385 # include <fp.h>
00386 # endif
00387 # else
00388 # include <math.h>
00389 # endif
00390 # if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
00391
00392
00393
00394 # include <m68881.h>
00395 # endif
00396 #endif
00397
00398
00399 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
00400 # define PNG_ALWAYS_EXTERN
00401 #endif
00402
00403
00404 #if defined(__TURBOC__) && defined(__MSDOS__)
00405 # include <mem.h>
00406 # include <alloc.h>
00407 #endif
00408
00409
00410 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
00411 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
00412 # include <malloc.h>
00413 #endif
00414
00415
00416
00417
00418
00419 #ifndef PNG_DITHER_RED_BITS
00420 # define PNG_DITHER_RED_BITS 5
00421 #endif
00422 #ifndef PNG_DITHER_GREEN_BITS
00423 # define PNG_DITHER_GREEN_BITS 5
00424 #endif
00425 #ifndef PNG_DITHER_BLUE_BITS
00426 # define PNG_DITHER_BLUE_BITS 5
00427 #endif
00428
00429
00430
00431
00432
00433
00434
00435
00436 #ifndef PNG_MAX_GAMMA_8
00437 # define PNG_MAX_GAMMA_8 11
00438 #endif
00439
00440
00441
00442
00443 #ifndef PNG_GAMMA_THRESHOLD
00444 # define PNG_GAMMA_THRESHOLD 0.05
00445 #endif
00446
00447 #endif
00448
00449
00450
00451
00452
00453
00454 #ifndef PNG_NO_CONST
00455 # define PNG_CONST const
00456 #else
00457 # define PNG_CONST
00458 #endif
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00494 # ifndef PNG_NO_iTXt_SUPPORTED
00495 # define PNG_NO_iTXt_SUPPORTED
00496 # endif
00497 # ifndef PNG_NO_READ_iTXt
00498 # define PNG_NO_READ_iTXt
00499 # endif
00500 # ifndef PNG_NO_WRITE_iTXt
00501 # define PNG_NO_WRITE_iTXt
00502 # endif
00503 #endif
00504
00505 #if !defined(PNG_NO_iTXt_SUPPORTED)
00506 # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
00507 # define PNG_READ_iTXt
00508 # endif
00509 # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
00510 # define PNG_WRITE_iTXt
00511 # endif
00512 #endif
00513
00514
00515
00516
00517
00518
00519
00520 #ifdef PNG_LEGACY_SUPPORTED
00521 # define PNG_NO_FREE_ME
00522 # define PNG_NO_READ_UNKNOWN_CHUNKS
00523 # define PNG_NO_WRITE_UNKNOWN_CHUNKS
00524 # define PNG_NO_READ_USER_CHUNKS
00525 # define PNG_NO_READ_iCCP
00526 # define PNG_NO_WRITE_iCCP
00527 # define PNG_NO_READ_iTXt
00528 # define PNG_NO_WRITE_iTXt
00529 # define PNG_NO_READ_sCAL
00530 # define PNG_NO_WRITE_sCAL
00531 # define PNG_NO_READ_sPLT
00532 # define PNG_NO_WRITE_sPLT
00533 # define PNG_NO_INFO_IMAGE
00534 # define PNG_NO_READ_RGB_TO_GRAY
00535 # define PNG_NO_READ_USER_TRANSFORM
00536 # define PNG_NO_WRITE_USER_TRANSFORM
00537 # define PNG_NO_USER_MEM
00538 # define PNG_NO_READ_EMPTY_PLTE
00539 # define PNG_NO_MNG_FEATURES
00540 # define PNG_NO_FIXED_POINT_SUPPORTED
00541 #endif
00542
00543
00544 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
00545 !defined(PNG_NO_FIXED_POINT_SUPPORTED)
00546 # define PNG_FIXED_POINT_SUPPORTED
00547 #endif
00548
00549 #ifndef PNG_NO_FREE_ME
00550 # define PNG_FREE_ME_SUPPORTED
00551 #endif
00552
00553 #if defined(PNG_READ_SUPPORTED)
00554
00555 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
00556 !defined(PNG_NO_READ_TRANSFORMS)
00557 # define PNG_READ_TRANSFORMS_SUPPORTED
00558 #endif
00559
00560 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
00561 # ifndef PNG_NO_READ_EXPAND
00562 # define PNG_READ_EXPAND_SUPPORTED
00563 # endif
00564 # ifndef PNG_NO_READ_SHIFT
00565 # define PNG_READ_SHIFT_SUPPORTED
00566 # endif
00567 # ifndef PNG_NO_READ_PACK
00568 # define PNG_READ_PACK_SUPPORTED
00569 # endif
00570 # ifndef PNG_NO_READ_BGR
00571 # define PNG_READ_BGR_SUPPORTED
00572 # endif
00573 # ifndef PNG_NO_READ_SWAP
00574 # define PNG_READ_SWAP_SUPPORTED
00575 # endif
00576 # ifndef PNG_NO_READ_PACKSWAP
00577 # define PNG_READ_PACKSWAP_SUPPORTED
00578 # endif
00579 # ifndef PNG_NO_READ_INVERT
00580 # define PNG_READ_INVERT_SUPPORTED
00581 # endif
00582 # ifndef PNG_NO_READ_DITHER
00583 # define PNG_READ_DITHER_SUPPORTED
00584 # endif
00585 # ifndef PNG_NO_READ_BACKGROUND
00586 # define PNG_READ_BACKGROUND_SUPPORTED
00587 # endif
00588 # ifndef PNG_NO_READ_16_TO_8
00589 # define PNG_READ_16_TO_8_SUPPORTED
00590 # endif
00591 # ifndef PNG_NO_READ_FILLER
00592 # define PNG_READ_FILLER_SUPPORTED
00593 # endif
00594 # ifndef PNG_NO_READ_GAMMA
00595 # define PNG_READ_GAMMA_SUPPORTED
00596 # endif
00597 # ifndef PNG_NO_READ_GRAY_TO_RGB
00598 # define PNG_READ_GRAY_TO_RGB_SUPPORTED
00599 # endif
00600 # ifndef PNG_NO_READ_SWAP_ALPHA
00601 # define PNG_READ_SWAP_ALPHA_SUPPORTED
00602 # endif
00603 # ifndef PNG_NO_READ_INVERT_ALPHA
00604 # define PNG_READ_INVERT_ALPHA_SUPPORTED
00605 # endif
00606 # ifndef PNG_NO_READ_STRIP_ALPHA
00607 # define PNG_READ_STRIP_ALPHA_SUPPORTED
00608 # endif
00609 # ifndef PNG_NO_READ_USER_TRANSFORM
00610 # define PNG_READ_USER_TRANSFORM_SUPPORTED
00611 # endif
00612 # ifndef PNG_NO_READ_RGB_TO_GRAY
00613 # define PNG_READ_RGB_TO_GRAY_SUPPORTED
00614 # endif
00615 #endif
00616
00617 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
00618 !defined(PNG_PROGRESSIVE_READ_SUPPORTED)
00619 # define PNG_PROGRESSIVE_READ_SUPPORTED
00620 #endif
00621
00622
00623 #define PNG_READ_INTERLACING_SUPPORTED
00624
00625 #ifndef PNG_NO_READ_COMPOSITE_NODIV
00626 # ifndef PNG_NO_READ_COMPOSITED_NODIV
00627 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED
00628 # endif
00629 #endif
00630
00631 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00632
00633
00634 #ifndef PNG_NO_READ_EMPTY_PLTE
00635 # define PNG_READ_EMPTY_PLTE_SUPPORTED
00636 #endif
00637 #endif
00638
00639 #endif
00640
00641 #if defined(PNG_WRITE_SUPPORTED)
00642
00643 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
00644 !defined(PNG_NO_WRITE_TRANSFORMS)
00645 # define PNG_WRITE_TRANSFORMS_SUPPORTED
00646 #endif
00647
00648 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
00649 # ifndef PNG_NO_WRITE_SHIFT
00650 # define PNG_WRITE_SHIFT_SUPPORTED
00651 # endif
00652 # ifndef PNG_NO_WRITE_PACK
00653 # define PNG_WRITE_PACK_SUPPORTED
00654 # endif
00655 # ifndef PNG_NO_WRITE_BGR
00656 # define PNG_WRITE_BGR_SUPPORTED
00657 # endif
00658 # ifndef PNG_NO_WRITE_SWAP
00659 # define PNG_WRITE_SWAP_SUPPORTED
00660 # endif
00661 # ifndef PNG_NO_WRITE_PACKSWAP
00662 # define PNG_WRITE_PACKSWAP_SUPPORTED
00663 # endif
00664 # ifndef PNG_NO_WRITE_INVERT
00665 # define PNG_WRITE_INVERT_SUPPORTED
00666 # endif
00667 # ifndef PNG_NO_WRITE_FILLER
00668 # define PNG_WRITE_FILLER_SUPPORTED
00669 # endif
00670 # ifndef PNG_NO_WRITE_SWAP_ALPHA
00671 # define PNG_WRITE_SWAP_ALPHA_SUPPORTED
00672 # endif
00673 # ifndef PNG_NO_WRITE_INVERT_ALPHA
00674 # define PNG_WRITE_INVERT_ALPHA_SUPPORTED
00675 # endif
00676 # ifndef PNG_NO_WRITE_USER_TRANSFORM
00677 # define PNG_WRITE_USER_TRANSFORM_SUPPORTED
00678 # endif
00679 #endif
00680
00681 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
00682 !defined(PNG_WRITE_INTERLACING_SUPPORTED)
00683 #define PNG_WRITE_INTERLACING_SUPPORTED
00684
00685
00686 #endif
00687
00688 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
00689 !defined(PNG_WRITE_WEIGHTED_FILTER) && \
00690 defined(PNG_FLOATING_POINT_SUPPORTED)
00691 # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
00692 #endif
00693
00694 #ifndef PNG_NO_WRITE_FLUSH
00695 # define PNG_WRITE_FLUSH_SUPPORTED
00696 #endif
00697
00698 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00699
00700 #ifndef PNG_NO_WRITE_EMPTY_PLTE
00701 # define PNG_WRITE_EMPTY_PLTE_SUPPORTED
00702 #endif
00703 #endif
00704
00705 #endif
00706
00707 #ifndef PNG_1_0_X
00708 # ifndef PNG_NO_ERROR_NUMBERS
00709 # define PNG_ERROR_NUMBERS_SUPPORTED
00710 # endif
00711 #endif
00712
00713 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
00714 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
00715 # ifndef PNG_NO_USER_TRANSFORM_PTR
00716 # define PNG_USER_TRANSFORM_PTR_SUPPORTED
00717 # endif
00718 #endif
00719
00720 #ifndef PNG_NO_STDIO
00721 # define PNG_TIME_RFC1123_SUPPORTED
00722 #endif
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
00741 # define PNG_EASY_ACCESS_SUPPORTED
00742 #endif
00743
00744
00745
00746
00747
00748
00749 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE)
00750 # ifndef PNG_OPTIMIZED_CODE_SUPPORTED
00751 # define PNG_OPTIMIZED_CODE_SUPPORTED
00752 # endif
00753 #endif
00754
00755 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) && defined(__i386__)
00756 # ifndef PNG_ASSEMBLER_CODE_SUPPORTED
00757 # define PNG_ASSEMBLER_CODE_SUPPORTED
00758 # endif
00759
00760 # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4)
00761
00762 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00763 # define PNG_NO_MMX_CODE
00764 # endif
00765 # endif
00766
00767 # if defined(__APPLE__)
00768 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00769 # define PNG_NO_MMX_CODE
00770 # endif
00771 # endif
00772
00773 # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh))
00774 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00775 # define PNG_NO_MMX_CODE
00776 # endif
00777 # endif
00778
00779 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00780 # define PNG_MMX_CODE_SUPPORTED
00781 # endif
00782
00783 #endif
00784
00785
00786 #if !defined(PNG_1_0_X)
00787 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
00788 # define PNG_USER_MEM_SUPPORTED
00789 #endif
00790 #endif
00791
00792
00793 #if !defined(PNG_1_0_X)
00794 #ifndef PNG_SET_USER_LIMITS_SUPPORTED
00795 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
00796 # define PNG_SET_USER_LIMITS_SUPPORTED
00797 #endif
00798 #endif
00799 #endif
00800
00801
00802
00803
00804 #ifndef PNG_USER_WIDTH_MAX
00805 # define PNG_USER_WIDTH_MAX 1000000L
00806 #endif
00807 #ifndef PNG_USER_HEIGHT_MAX
00808 # define PNG_USER_HEIGHT_MAX 1000000L
00809 #endif
00810
00811
00812 #ifndef PNG_STRING_NEWLINE
00813 #define PNG_STRING_NEWLINE "\n"
00814 #endif
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852 #if defined(PNG_READ_SUPPORTED) && \
00853 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00854 !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
00855 # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00856 #endif
00857
00858 #if defined(PNG_WRITE_SUPPORTED) && \
00859 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00860 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
00861 # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00862 #endif
00863
00864 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00865
00866 #ifdef PNG_NO_READ_TEXT
00867 # define PNG_NO_READ_iTXt
00868 # define PNG_NO_READ_tEXt
00869 # define PNG_NO_READ_zTXt
00870 #endif
00871 #ifndef PNG_NO_READ_bKGD
00872 # define PNG_READ_bKGD_SUPPORTED
00873 # define PNG_bKGD_SUPPORTED
00874 #endif
00875 #ifndef PNG_NO_READ_cHRM
00876 # define PNG_READ_cHRM_SUPPORTED
00877 # define PNG_cHRM_SUPPORTED
00878 #endif
00879 #ifndef PNG_NO_READ_gAMA
00880 # define PNG_READ_gAMA_SUPPORTED
00881 # define PNG_gAMA_SUPPORTED
00882 #endif
00883 #ifndef PNG_NO_READ_hIST
00884 # define PNG_READ_hIST_SUPPORTED
00885 # define PNG_hIST_SUPPORTED
00886 #endif
00887 #ifndef PNG_NO_READ_iCCP
00888 # define PNG_READ_iCCP_SUPPORTED
00889 # define PNG_iCCP_SUPPORTED
00890 #endif
00891 #ifndef PNG_NO_READ_iTXt
00892 # ifndef PNG_READ_iTXt_SUPPORTED
00893 # define PNG_READ_iTXt_SUPPORTED
00894 # endif
00895 # ifndef PNG_iTXt_SUPPORTED
00896 # define PNG_iTXt_SUPPORTED
00897 # endif
00898 #endif
00899 #ifndef PNG_NO_READ_oFFs
00900 # define PNG_READ_oFFs_SUPPORTED
00901 # define PNG_oFFs_SUPPORTED
00902 #endif
00903 #ifndef PNG_NO_READ_pCAL
00904 # define PNG_READ_pCAL_SUPPORTED
00905 # define PNG_pCAL_SUPPORTED
00906 #endif
00907 #ifndef PNG_NO_READ_sCAL
00908 # define PNG_READ_sCAL_SUPPORTED
00909 # define PNG_sCAL_SUPPORTED
00910 #endif
00911 #ifndef PNG_NO_READ_pHYs
00912 # define PNG_READ_pHYs_SUPPORTED
00913 # define PNG_pHYs_SUPPORTED
00914 #endif
00915 #ifndef PNG_NO_READ_sBIT
00916 # define PNG_READ_sBIT_SUPPORTED
00917 # define PNG_sBIT_SUPPORTED
00918 #endif
00919 #ifndef PNG_NO_READ_sPLT
00920 # define PNG_READ_sPLT_SUPPORTED
00921 # define PNG_sPLT_SUPPORTED
00922 #endif
00923 #ifndef PNG_NO_READ_sRGB
00924 # define PNG_READ_sRGB_SUPPORTED
00925 # define PNG_sRGB_SUPPORTED
00926 #endif
00927 #ifndef PNG_NO_READ_tEXt
00928 # define PNG_READ_tEXt_SUPPORTED
00929 # define PNG_tEXt_SUPPORTED
00930 #endif
00931 #ifndef PNG_NO_READ_tIME
00932 # define PNG_READ_tIME_SUPPORTED
00933 # define PNG_tIME_SUPPORTED
00934 #endif
00935 #ifndef PNG_NO_READ_tRNS
00936 # define PNG_READ_tRNS_SUPPORTED
00937 # define PNG_tRNS_SUPPORTED
00938 #endif
00939 #ifndef PNG_NO_READ_zTXt
00940 # define PNG_READ_zTXt_SUPPORTED
00941 # define PNG_zTXt_SUPPORTED
00942 #endif
00943 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
00944 # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
00945 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
00946 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
00947 # endif
00948 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
00949 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
00950 # endif
00951 #endif
00952 #if !defined(PNG_NO_READ_USER_CHUNKS) && \
00953 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
00954 # define PNG_READ_USER_CHUNKS_SUPPORTED
00955 # define PNG_USER_CHUNKS_SUPPORTED
00956 # ifdef PNG_NO_READ_UNKNOWN_CHUNKS
00957 # undef PNG_NO_READ_UNKNOWN_CHUNKS
00958 # endif
00959 # ifdef PNG_NO_HANDLE_AS_UNKNOWN
00960 # undef PNG_NO_HANDLE_AS_UNKNOWN
00961 # endif
00962 #endif
00963 #ifndef PNG_NO_READ_OPT_PLTE
00964 # define PNG_READ_OPT_PLTE_SUPPORTED
00965 #endif
00966 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
00967 defined(PNG_READ_zTXt_SUPPORTED)
00968 # define PNG_READ_TEXT_SUPPORTED
00969 # define PNG_TEXT_SUPPORTED
00970 #endif
00971
00972 #endif
00973
00974 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00975
00976 #ifdef PNG_NO_WRITE_TEXT
00977 # define PNG_NO_WRITE_iTXt
00978 # define PNG_NO_WRITE_tEXt
00979 # define PNG_NO_WRITE_zTXt
00980 #endif
00981 #ifndef PNG_NO_WRITE_bKGD
00982 # define PNG_WRITE_bKGD_SUPPORTED
00983 # ifndef PNG_bKGD_SUPPORTED
00984 # define PNG_bKGD_SUPPORTED
00985 # endif
00986 #endif
00987 #ifndef PNG_NO_WRITE_cHRM
00988 # define PNG_WRITE_cHRM_SUPPORTED
00989 # ifndef PNG_cHRM_SUPPORTED
00990 # define PNG_cHRM_SUPPORTED
00991 # endif
00992 #endif
00993 #ifndef PNG_NO_WRITE_gAMA
00994 # define PNG_WRITE_gAMA_SUPPORTED
00995 # ifndef PNG_gAMA_SUPPORTED
00996 # define PNG_gAMA_SUPPORTED
00997 # endif
00998 #endif
00999 #ifndef PNG_NO_WRITE_hIST
01000 # define PNG_WRITE_hIST_SUPPORTED
01001 # ifndef PNG_hIST_SUPPORTED
01002 # define PNG_hIST_SUPPORTED
01003 # endif
01004 #endif
01005 #ifndef PNG_NO_WRITE_iCCP
01006 # define PNG_WRITE_iCCP_SUPPORTED
01007 # ifndef PNG_iCCP_SUPPORTED
01008 # define PNG_iCCP_SUPPORTED
01009 # endif
01010 #endif
01011 #ifndef PNG_NO_WRITE_iTXt
01012 # ifndef PNG_WRITE_iTXt_SUPPORTED
01013 # define PNG_WRITE_iTXt_SUPPORTED
01014 # endif
01015 # ifndef PNG_iTXt_SUPPORTED
01016 # define PNG_iTXt_SUPPORTED
01017 # endif
01018 #endif
01019 #ifndef PNG_NO_WRITE_oFFs
01020 # define PNG_WRITE_oFFs_SUPPORTED
01021 # ifndef PNG_oFFs_SUPPORTED
01022 # define PNG_oFFs_SUPPORTED
01023 # endif
01024 #endif
01025 #ifndef PNG_NO_WRITE_pCAL
01026 # define PNG_WRITE_pCAL_SUPPORTED
01027 # ifndef PNG_pCAL_SUPPORTED
01028 # define PNG_pCAL_SUPPORTED
01029 # endif
01030 #endif
01031 #ifndef PNG_NO_WRITE_sCAL
01032 # define PNG_WRITE_sCAL_SUPPORTED
01033 # ifndef PNG_sCAL_SUPPORTED
01034 # define PNG_sCAL_SUPPORTED
01035 # endif
01036 #endif
01037 #ifndef PNG_NO_WRITE_pHYs
01038 # define PNG_WRITE_pHYs_SUPPORTED
01039 # ifndef PNG_pHYs_SUPPORTED
01040 # define PNG_pHYs_SUPPORTED
01041 # endif
01042 #endif
01043 #ifndef PNG_NO_WRITE_sBIT
01044 # define PNG_WRITE_sBIT_SUPPORTED
01045 # ifndef PNG_sBIT_SUPPORTED
01046 # define PNG_sBIT_SUPPORTED
01047 # endif
01048 #endif
01049 #ifndef PNG_NO_WRITE_sPLT
01050 # define PNG_WRITE_sPLT_SUPPORTED
01051 # ifndef PNG_sPLT_SUPPORTED
01052 # define PNG_sPLT_SUPPORTED
01053 # endif
01054 #endif
01055 #ifndef PNG_NO_WRITE_sRGB
01056 # define PNG_WRITE_sRGB_SUPPORTED
01057 # ifndef PNG_sRGB_SUPPORTED
01058 # define PNG_sRGB_SUPPORTED
01059 # endif
01060 #endif
01061 #ifndef PNG_NO_WRITE_tEXt
01062 # define PNG_WRITE_tEXt_SUPPORTED
01063 # ifndef PNG_tEXt_SUPPORTED
01064 # define PNG_tEXt_SUPPORTED
01065 # endif
01066 #endif
01067 #ifndef PNG_NO_WRITE_tIME
01068 # define PNG_WRITE_tIME_SUPPORTED
01069 # ifndef PNG_tIME_SUPPORTED
01070 # define PNG_tIME_SUPPORTED
01071 # endif
01072 #endif
01073 #ifndef PNG_NO_WRITE_tRNS
01074 # define PNG_WRITE_tRNS_SUPPORTED
01075 # ifndef PNG_tRNS_SUPPORTED
01076 # define PNG_tRNS_SUPPORTED
01077 # endif
01078 #endif
01079 #ifndef PNG_NO_WRITE_zTXt
01080 # define PNG_WRITE_zTXt_SUPPORTED
01081 # ifndef PNG_zTXt_SUPPORTED
01082 # define PNG_zTXt_SUPPORTED
01083 # endif
01084 #endif
01085 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
01086 # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
01087 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
01088 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
01089 # endif
01090 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
01091 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
01092 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
01093 # endif
01094 # endif
01095 #endif
01096 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
01097 defined(PNG_WRITE_zTXt_SUPPORTED)
01098 # define PNG_WRITE_TEXT_SUPPORTED
01099 # ifndef PNG_TEXT_SUPPORTED
01100 # define PNG_TEXT_SUPPORTED
01101 # endif
01102 #endif
01103
01104 #endif
01105
01106
01107
01108
01109
01110 #ifndef PNG_NO_INFO_IMAGE
01111 # define PNG_INFO_IMAGE_SUPPORTED
01112 #endif
01113
01114
01115 #if defined(PNG_tIME_SUPPORTED)
01116 # if !defined(_WIN32_WCE)
01117
01118 # include <time.h>
01119 # endif
01120 #endif
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131 typedef unsigned long png_uint_32;
01132 typedef long png_int_32;
01133 typedef unsigned short png_uint_16;
01134 typedef short png_int_16;
01135 typedef unsigned char png_byte;
01136
01137
01138
01139 #ifdef PNG_SIZE_T
01140 typedef PNG_SIZE_T png_size_t;
01141 # define png_sizeof(x) png_convert_size(sizeof(x))
01142 #else
01143 typedef size_t png_size_t;
01144 # define png_sizeof(x) sizeof(x)
01145 #endif
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158 #ifdef __BORLANDC__
01159 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
01160 # define LDATA 1
01161 # else
01162 # define LDATA 0
01163 # endif
01164
01165 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
01166 # define PNG_MAX_MALLOC_64K
01167 # if (LDATA != 1)
01168 # ifndef FAR
01169 # define FAR __far
01170 # endif
01171 # define USE_FAR_KEYWORD
01172 # endif
01173
01174
01175
01176
01177
01178 # endif
01179 #endif
01180
01181
01182
01183
01184
01185
01186
01187
01188 #if defined(FAR)
01189 # if defined(M_I86MM)
01190 # define USE_FAR_KEYWORD
01191 # define FARDATA FAR
01192 # include <dos.h>
01193 # endif
01194 #endif
01195
01196
01197 #ifndef FAR
01198 # define FAR
01199 #endif
01200
01201
01202 #ifndef FARDATA
01203 # define FARDATA
01204 #endif
01205
01206
01207
01208 typedef png_int_32 png_fixed_point;
01209
01210
01211 typedef void FAR * png_voidp;
01212 typedef png_byte FAR * png_bytep;
01213 typedef png_uint_32 FAR * png_uint_32p;
01214 typedef png_int_32 FAR * png_int_32p;
01215 typedef png_uint_16 FAR * png_uint_16p;
01216 typedef png_int_16 FAR * png_int_16p;
01217 typedef PNG_CONST char FAR * png_const_charp;
01218 typedef char FAR * png_charp;
01219 typedef png_fixed_point FAR * png_fixed_point_p;
01220
01221 #ifndef PNG_NO_STDIO
01222 #if defined(_WIN32_WCE)
01223 typedef HANDLE png_FILE_p;
01224 #else
01225 typedef FILE * png_FILE_p;
01226 #endif
01227 #endif
01228
01229 #ifdef PNG_FLOATING_POINT_SUPPORTED
01230 typedef double FAR * png_doublep;
01231 #endif
01232
01233
01234 typedef png_byte FAR * FAR * png_bytepp;
01235 typedef png_uint_32 FAR * FAR * png_uint_32pp;
01236 typedef png_int_32 FAR * FAR * png_int_32pp;
01237 typedef png_uint_16 FAR * FAR * png_uint_16pp;
01238 typedef png_int_16 FAR * FAR * png_int_16pp;
01239 typedef PNG_CONST char FAR * FAR * png_const_charpp;
01240 typedef char FAR * FAR * png_charpp;
01241 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
01242 #ifdef PNG_FLOATING_POINT_SUPPORTED
01243 typedef double FAR * FAR * png_doublepp;
01244 #endif
01245
01246
01247 typedef char FAR * FAR * FAR * png_charppp;
01248
01249 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
01250
01251
01252
01253
01254
01255
01256 typedef charf * png_zcharp;
01257 typedef charf * FAR * png_zcharpp;
01258 typedef z_stream FAR * png_zstreamp;
01259 #endif
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
01280 # define PNG_DLL
01281 #endif
01282
01283
01284
01285
01286 #if defined(__CYGWIN__)
01287 # if !defined(PNG_STATIC)
01288 # if defined(PNG_USE_GLOBAL_ARRAYS)
01289 # undef PNG_USE_GLOBAL_ARRAYS
01290 # endif
01291 # if !defined(PNG_USE_LOCAL_ARRAYS)
01292 # define PNG_USE_LOCAL_ARRAYS
01293 # endif
01294 # else
01295 # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
01296 # if defined(PNG_USE_GLOBAL_ARRAYS)
01297 # undef PNG_USE_GLOBAL_ARRAYS
01298 # endif
01299 # endif
01300 # endif
01301 # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
01302 # define PNG_USE_LOCAL_ARRAYS
01303 # endif
01304 #endif
01305
01306
01307
01308
01309
01310 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
01311 # if defined(PNG_NO_GLOBAL_ARRAYS) || \
01312 (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER)
01313 # define PNG_USE_LOCAL_ARRAYS
01314 # else
01315 # define PNG_USE_GLOBAL_ARRAYS
01316 # endif
01317 #endif
01318
01319 #if defined(__CYGWIN__)
01320 # undef PNGAPI
01321 # define PNGAPI __cdecl
01322 # undef PNG_IMPEXP
01323 # define PNG_IMPEXP
01324 #endif
01325
01326
01327
01328
01329
01330
01331
01332
01333 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
01334 # ifndef PNG_NO_MODULEDEF
01335 # define PNG_NO_MODULEDEF
01336 # endif
01337 #endif
01338
01339 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
01340 # define PNG_IMPEXP
01341 #endif
01342
01343 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
01344 (( defined(_Windows) || defined(_WINDOWS) || \
01345 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
01346
01347 # ifndef PNGAPI
01348 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
01349 # define PNGAPI __cdecl
01350 # else
01351 # define PNGAPI _cdecl
01352 # endif
01353 # endif
01354
01355 # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
01356 0 )
01357 # define PNG_IMPEXP
01358 # endif
01359
01360 # if !defined(PNG_IMPEXP)
01361
01362 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
01363 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
01364
01365
01366 # if defined(_MSC_VER) || defined(__BORLANDC__)
01367 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
01368 # define PNG_EXPORT PNG_EXPORT_TYPE1
01369 # else
01370 # define PNG_EXPORT PNG_EXPORT_TYPE2
01371 # if defined(PNG_BUILD_DLL)
01372 # define PNG_IMPEXP __export
01373 # else
01374 # define PNG_IMPEXP
01375
01376 # endif
01377
01378 # endif
01379 # endif
01380
01381 # if !defined(PNG_IMPEXP)
01382 # if defined(PNG_BUILD_DLL)
01383 # define PNG_IMPEXP __declspec(dllexport)
01384 # else
01385 # define PNG_IMPEXP __declspec(dllimport)
01386 # endif
01387 # endif
01388 # endif
01389 #else
01390 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
01391 # ifndef PNGAPI
01392 # define PNGAPI _System
01393 # endif
01394 # else
01395 # if 0
01396 # endif
01397 # endif
01398 #endif
01399
01400 #ifndef PNGAPI
01401 # define PNGAPI
01402 #endif
01403 #ifndef PNG_IMPEXP
01404 # define PNG_IMPEXP
01405 #endif
01406
01407 #ifdef PNG_BUILDSYMS
01408 # ifndef PNG_EXPORT
01409 # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
01410 # endif
01411 # ifdef PNG_USE_GLOBAL_ARRAYS
01412 # ifndef PNG_EXPORT_VAR
01413 # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
01414 # endif
01415 # endif
01416 #endif
01417
01418 #ifndef PNG_EXPORT
01419 # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
01420 #endif
01421
01422 #ifdef PNG_USE_GLOBAL_ARRAYS
01423 # ifndef PNG_EXPORT_VAR
01424 # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
01425 # endif
01426 #endif
01427
01428
01429
01430
01431
01432 #ifndef PNG_ABORT
01433 # define PNG_ABORT() abort()
01434 #endif
01435
01436 #ifdef PNG_SETJMP_SUPPORTED
01437 # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
01438 #else
01439 # define png_jmpbuf(png_ptr) \
01440 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
01441 #endif
01442
01443 #if defined(USE_FAR_KEYWORD)
01444
01445 # define CHECK 1
01446 # define NOCHECK 0
01447 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
01448 # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
01449 # define png_snprintf _fsnprintf
01450 # define png_strlen _fstrlen
01451 # define png_memcmp _fmemcmp
01452 # define png_memcpy _fmemcpy
01453 # define png_memset _fmemset
01454 #else
01455 # define CVT_PTR(ptr) (ptr)
01456 # define CVT_PTR_NOCHECK(ptr) (ptr)
01457 # ifndef PNG_NO_SNPRINTF
01458 # ifdef _MSC_VER
01459 # define png_snprintf _snprintf
01460 # define png_snprintf2 _snprintf
01461 # define png_snprintf6 _snprintf
01462 # else
01463 # define png_snprintf snprintf
01464 # define png_snprintf2 snprintf
01465 # define png_snprintf6 snprintf
01466 # endif
01467 # else
01468
01469
01470
01471
01472
01473 # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
01474 # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
01475 # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
01476 sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
01477 # endif
01478 # define png_strlen strlen
01479 # define png_memcmp memcmp
01480 # define png_memcpy memcpy
01481 # define png_memset memset
01482 #endif
01483
01484
01485
01486
01487
01488 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
01489 # undef PNG_ZBUF_SIZE
01490 # define PNG_ZBUF_SIZE 65536L
01491 #endif
01492
01493
01494 #endif
01495
01496 #endif