00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
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
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403 #ifndef PNG_H
00404 #define PNG_H
00405
00406
00407
00408
00409
00410
00411
00412
00413 #define PNG_LIBPNG_VER_STRING "1.2.32"
00414 #define PNG_HEADER_VERSION_STRING \
00415 " libpng version 1.2.32 - September 18, 2008\n"
00416
00417 #define PNG_LIBPNG_VER_SONUM 0
00418 #define PNG_LIBPNG_VER_DLLNUM 13
00419
00420
00421 #define PNG_LIBPNG_VER_MAJOR 1
00422 #define PNG_LIBPNG_VER_MINOR 2
00423 #define PNG_LIBPNG_VER_RELEASE 32
00424
00425
00426
00427 #define PNG_LIBPNG_VER_BUILD 0
00428
00429
00430 #define PNG_LIBPNG_BUILD_ALPHA 1
00431 #define PNG_LIBPNG_BUILD_BETA 2
00432 #define PNG_LIBPNG_BUILD_RC 3
00433 #define PNG_LIBPNG_BUILD_STABLE 4
00434 #define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
00435
00436
00437 #define PNG_LIBPNG_BUILD_PATCH 8
00438
00439 #define PNG_LIBPNG_BUILD_PRIVATE 16
00440
00441 #define PNG_LIBPNG_BUILD_SPECIAL 32
00442
00443
00444 #define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
00445
00446
00447
00448
00449
00450
00451 #define PNG_LIBPNG_VER 10232
00452
00453 #ifndef PNG_VERSION_INFO_ONLY
00454
00455 #include "zlib.h"
00456 #endif
00457
00458
00459 #include "pngconf.h"
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474 #if defined(PNG_USER_PRIVATEBUILD)
00475 # define PNG_LIBPNG_BUILD_TYPE \
00476 (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
00477 #else
00478 # if defined(PNG_LIBPNG_SPECIALBUILD)
00479 # define PNG_LIBPNG_BUILD_TYPE \
00480 (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
00481 # else
00482 # define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
00483 # endif
00484 #endif
00485
00486 #ifndef PNG_VERSION_INFO_ONLY
00487
00488
00489 #ifdef __cplusplus
00490 extern "C" {
00491 #endif
00492
00493
00494
00495
00496
00497
00498
00499 #ifndef PNG_NO_TYPECAST_NULL
00500 #define int_p_NULL (int *)NULL
00501 #define png_bytep_NULL (png_bytep)NULL
00502 #define png_bytepp_NULL (png_bytepp)NULL
00503 #define png_doublep_NULL (png_doublep)NULL
00504 #define png_error_ptr_NULL (png_error_ptr)NULL
00505 #define png_flush_ptr_NULL (png_flush_ptr)NULL
00506 #define png_free_ptr_NULL (png_free_ptr)NULL
00507 #define png_infopp_NULL (png_infopp)NULL
00508 #define png_malloc_ptr_NULL (png_malloc_ptr)NULL
00509 #define png_read_status_ptr_NULL (png_read_status_ptr)NULL
00510 #define png_rw_ptr_NULL (png_rw_ptr)NULL
00511 #define png_structp_NULL (png_structp)NULL
00512 #define png_uint_16p_NULL (png_uint_16p)NULL
00513 #define png_voidp_NULL (png_voidp)NULL
00514 #define png_write_status_ptr_NULL (png_write_status_ptr)NULL
00515 #else
00516 #define int_p_NULL NULL
00517 #define png_bytep_NULL NULL
00518 #define png_bytepp_NULL NULL
00519 #define png_doublep_NULL NULL
00520 #define png_error_ptr_NULL NULL
00521 #define png_flush_ptr_NULL NULL
00522 #define png_free_ptr_NULL NULL
00523 #define png_infopp_NULL NULL
00524 #define png_malloc_ptr_NULL NULL
00525 #define png_read_status_ptr_NULL NULL
00526 #define png_rw_ptr_NULL NULL
00527 #define png_structp_NULL NULL
00528 #define png_uint_16p_NULL NULL
00529 #define png_voidp_NULL NULL
00530 #define png_write_status_ptr_NULL NULL
00531 #endif
00532
00533
00534 #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
00535
00536
00537
00538 #ifdef PNG_USE_GLOBAL_ARRAYS
00539 PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18];
00540
00541 #else
00542 #define png_libpng_ver png_get_header_ver(NULL)
00543 #endif
00544
00545 #ifdef PNG_USE_GLOBAL_ARRAYS
00546
00547
00548 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_start[7];
00549 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_inc[7];
00550 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_ystart[7];
00551 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_yinc[7];
00552 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_mask[7];
00553 PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_dsp_mask[7];
00554
00555
00556
00557 #endif
00558
00559 #endif
00560
00561
00562
00563
00564
00565 typedef struct png_color_struct
00566 {
00567 png_byte red;
00568 png_byte green;
00569 png_byte blue;
00570 } png_color;
00571 typedef png_color FAR * png_colorp;
00572 typedef png_color FAR * FAR * png_colorpp;
00573
00574 typedef struct png_color_16_struct
00575 {
00576 png_byte index;
00577 png_uint_16 red;
00578 png_uint_16 green;
00579 png_uint_16 blue;
00580 png_uint_16 gray;
00581 } png_color_16;
00582 typedef png_color_16 FAR * png_color_16p;
00583 typedef png_color_16 FAR * FAR * png_color_16pp;
00584
00585 typedef struct png_color_8_struct
00586 {
00587 png_byte red;
00588 png_byte green;
00589 png_byte blue;
00590 png_byte gray;
00591 png_byte alpha;
00592 } png_color_8;
00593 typedef png_color_8 FAR * png_color_8p;
00594 typedef png_color_8 FAR * FAR * png_color_8pp;
00595
00596
00597
00598
00599
00600 typedef struct png_sPLT_entry_struct
00601 {
00602 png_uint_16 red;
00603 png_uint_16 green;
00604 png_uint_16 blue;
00605 png_uint_16 alpha;
00606 png_uint_16 frequency;
00607 } png_sPLT_entry;
00608 typedef png_sPLT_entry FAR * png_sPLT_entryp;
00609 typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
00610
00611
00612
00613
00614
00615
00616 typedef struct png_sPLT_struct
00617 {
00618 png_charp name;
00619 png_byte depth;
00620 png_sPLT_entryp entries;
00621 png_int_32 nentries;
00622 } png_sPLT_t;
00623 typedef png_sPLT_t FAR * png_sPLT_tp;
00624 typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
00625
00626 #ifdef PNG_TEXT_SUPPORTED
00627
00628
00629
00630
00631
00632
00633
00634
00635 typedef struct png_text_struct
00636 {
00637 int compression;
00638
00639
00640
00641
00642 png_charp key;
00643 png_charp text;
00644
00645 png_size_t text_length;
00646 #ifdef PNG_iTXt_SUPPORTED
00647 png_size_t itxt_length;
00648 png_charp lang;
00649
00650 png_charp lang_key;
00651
00652 #endif
00653 } png_text;
00654 typedef png_text FAR * png_textp;
00655 typedef png_text FAR * FAR * png_textpp;
00656 #endif
00657
00658
00659
00660 #define PNG_TEXT_COMPRESSION_NONE_WR -3
00661 #define PNG_TEXT_COMPRESSION_zTXt_WR -2
00662 #define PNG_TEXT_COMPRESSION_NONE -1
00663 #define PNG_TEXT_COMPRESSION_zTXt 0
00664 #define PNG_ITXT_COMPRESSION_NONE 1
00665 #define PNG_ITXT_COMPRESSION_zTXt 2
00666 #define PNG_TEXT_COMPRESSION_LAST 3
00667
00668
00669
00670
00671
00672
00673
00674 typedef struct png_time_struct
00675 {
00676 png_uint_16 year;
00677 png_byte month;
00678 png_byte day;
00679 png_byte hour;
00680 png_byte minute;
00681 png_byte second;
00682 } png_time;
00683 typedef png_time FAR * png_timep;
00684 typedef png_time FAR * FAR * png_timepp;
00685
00686 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
00687
00688
00689
00690
00691
00692 #define PNG_CHUNK_NAME_LENGTH 5
00693 typedef struct png_unknown_chunk_t
00694 {
00695 png_byte name[PNG_CHUNK_NAME_LENGTH];
00696 png_byte *data;
00697 png_size_t size;
00698
00699
00700 png_byte location;
00701 }
00702 png_unknown_chunk;
00703 typedef png_unknown_chunk FAR * png_unknown_chunkp;
00704 typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
00705 #endif
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746 typedef struct png_info_struct
00747 {
00748
00749 png_uint_32 width;
00750 png_uint_32 height;
00751 png_uint_32 valid;
00752 png_uint_32 rowbytes;
00753 png_colorp palette;
00754 png_uint_16 num_palette;
00755 png_uint_16 num_trans;
00756 png_byte bit_depth;
00757 png_byte color_type;
00758
00759 png_byte compression_type;
00760 png_byte filter_type;
00761 png_byte interlace_type;
00762
00763
00764 png_byte channels;
00765 png_byte pixel_depth;
00766 png_byte spare_byte;
00767 png_byte signature[8];
00768
00769
00770
00771
00772
00773
00774
00775 #if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
00776
00777
00778
00779
00780 float gamma;
00781 #endif
00782
00783 #if defined(PNG_sRGB_SUPPORTED)
00784
00785
00786 png_byte srgb_intent;
00787 #endif
00788
00789 #if defined(PNG_TEXT_SUPPORTED)
00790
00791
00792
00793
00794
00795
00796
00797
00798 int num_text;
00799 int max_text;
00800 png_textp text;
00801 #endif
00802
00803 #if defined(PNG_tIME_SUPPORTED)
00804
00805
00806
00807 png_time mod_time;
00808 #endif
00809
00810 #if defined(PNG_sBIT_SUPPORTED)
00811
00812
00813
00814
00815
00816
00817 png_color_8 sig_bit;
00818 #endif
00819
00820 #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \
00821 defined(PNG_READ_BACKGROUND_SUPPORTED)
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831 png_bytep trans;
00832 png_color_16 trans_values;
00833 #endif
00834
00835 #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
00836
00837
00838
00839
00840
00841
00842 png_color_16 background;
00843 #endif
00844
00845 #if defined(PNG_oFFs_SUPPORTED)
00846
00847
00848
00849
00850
00851 png_int_32 x_offset;
00852 png_int_32 y_offset;
00853 png_byte offset_unit_type;
00854 #endif
00855
00856 #if defined(PNG_pHYs_SUPPORTED)
00857
00858
00859
00860
00861 png_uint_32 x_pixels_per_unit;
00862 png_uint_32 y_pixels_per_unit;
00863 png_byte phys_unit_type;
00864 #endif
00865
00866 #if defined(PNG_hIST_SUPPORTED)
00867
00868
00869
00870
00871
00872
00873 png_uint_16p hist;
00874 #endif
00875
00876 #ifdef PNG_cHRM_SUPPORTED
00877
00878
00879
00880
00881
00882
00883 #ifdef PNG_FLOATING_POINT_SUPPORTED
00884 float x_white;
00885 float y_white;
00886 float x_red;
00887 float y_red;
00888 float x_green;
00889 float y_green;
00890 float x_blue;
00891 float y_blue;
00892 #endif
00893 #endif
00894
00895 #if defined(PNG_pCAL_SUPPORTED)
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907 png_charp pcal_purpose;
00908 png_int_32 pcal_X0;
00909 png_int_32 pcal_X1;
00910 png_charp pcal_units;
00911 png_charpp pcal_params;
00912 png_byte pcal_type;
00913 png_byte pcal_nparams;
00914 #endif
00915
00916
00917 #ifdef PNG_FREE_ME_SUPPORTED
00918 png_uint_32 free_me;
00919 #endif
00920
00921 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
00922
00923 png_unknown_chunkp unknown_chunks;
00924 png_size_t unknown_chunks_num;
00925 #endif
00926
00927 #if defined(PNG_iCCP_SUPPORTED)
00928
00929 png_charp iccp_name;
00930 png_charp iccp_profile;
00931
00932 png_uint_32 iccp_proflen;
00933 png_byte iccp_compression;
00934 #endif
00935
00936 #if defined(PNG_sPLT_SUPPORTED)
00937
00938 png_sPLT_tp splt_palettes;
00939 png_uint_32 splt_palettes_num;
00940 #endif
00941
00942 #if defined(PNG_sCAL_SUPPORTED)
00943
00944
00945
00946
00947
00948
00949
00950 png_byte scal_unit;
00951 #ifdef PNG_FLOATING_POINT_SUPPORTED
00952 double scal_pixel_width;
00953 double scal_pixel_height;
00954 #endif
00955 #ifdef PNG_FIXED_POINT_SUPPORTED
00956 png_charp scal_s_width;
00957 png_charp scal_s_height;
00958 #endif
00959 #endif
00960
00961 #if defined(PNG_INFO_IMAGE_SUPPORTED)
00962
00963
00964 png_bytepp row_pointers;
00965 #endif
00966
00967 #if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED)
00968 png_fixed_point int_gamma;
00969 #endif
00970
00971 #if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED)
00972 png_fixed_point int_x_white;
00973 png_fixed_point int_y_white;
00974 png_fixed_point int_x_red;
00975 png_fixed_point int_y_red;
00976 png_fixed_point int_x_green;
00977 png_fixed_point int_y_green;
00978 png_fixed_point int_x_blue;
00979 png_fixed_point int_y_blue;
00980 #endif
00981
00982 } png_info;
00983
00984 typedef png_info FAR * png_infop;
00985 typedef png_info FAR * FAR * png_infopp;
00986
00987
00988 #define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
00989 #define PNG_UINT_32_MAX ((png_uint_32)(-1))
00990 #define PNG_SIZE_MAX ((png_size_t)(-1))
00991 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
00992
00993 #define PNG_MAX_UINT PNG_UINT_31_MAX
00994 #endif
00995
00996
00997
00998 #define PNG_COLOR_MASK_PALETTE 1
00999 #define PNG_COLOR_MASK_COLOR 2
01000 #define PNG_COLOR_MASK_ALPHA 4
01001
01002
01003 #define PNG_COLOR_TYPE_GRAY 0
01004 #define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
01005 #define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR)
01006 #define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
01007 #define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
01008
01009 #define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA
01010 #define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA
01011
01012
01013 #define PNG_COMPRESSION_TYPE_BASE 0
01014 #define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE
01015
01016
01017 #define PNG_FILTER_TYPE_BASE 0
01018 #define PNG_INTRAPIXEL_DIFFERENCING 64
01019 #define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE
01020
01021
01022 #define PNG_INTERLACE_NONE 0
01023 #define PNG_INTERLACE_ADAM7 1
01024 #define PNG_INTERLACE_LAST 2
01025
01026
01027 #define PNG_OFFSET_PIXEL 0
01028 #define PNG_OFFSET_MICROMETER 1
01029 #define PNG_OFFSET_LAST 2
01030
01031
01032 #define PNG_EQUATION_LINEAR 0
01033 #define PNG_EQUATION_BASE_E 1
01034 #define PNG_EQUATION_ARBITRARY 2
01035 #define PNG_EQUATION_HYPERBOLIC 3
01036 #define PNG_EQUATION_LAST 4
01037
01038
01039 #define PNG_SCALE_UNKNOWN 0
01040 #define PNG_SCALE_METER 1
01041 #define PNG_SCALE_RADIAN 2
01042 #define PNG_SCALE_LAST 3
01043
01044
01045 #define PNG_RESOLUTION_UNKNOWN 0
01046 #define PNG_RESOLUTION_METER 1
01047 #define PNG_RESOLUTION_LAST 2
01048
01049
01050 #define PNG_sRGB_INTENT_PERCEPTUAL 0
01051 #define PNG_sRGB_INTENT_RELATIVE 1
01052 #define PNG_sRGB_INTENT_SATURATION 2
01053 #define PNG_sRGB_INTENT_ABSOLUTE 3
01054 #define PNG_sRGB_INTENT_LAST 4
01055
01056
01057 #define PNG_KEYWORD_MAX_LENGTH 79
01058
01059
01060 #define PNG_MAX_PALETTE_LENGTH 256
01061
01062
01063
01064
01065
01066
01067 #define PNG_INFO_gAMA 0x0001
01068 #define PNG_INFO_sBIT 0x0002
01069 #define PNG_INFO_cHRM 0x0004
01070 #define PNG_INFO_PLTE 0x0008
01071 #define PNG_INFO_tRNS 0x0010
01072 #define PNG_INFO_bKGD 0x0020
01073 #define PNG_INFO_hIST 0x0040
01074 #define PNG_INFO_pHYs 0x0080
01075 #define PNG_INFO_oFFs 0x0100
01076 #define PNG_INFO_tIME 0x0200
01077 #define PNG_INFO_pCAL 0x0400
01078 #define PNG_INFO_sRGB 0x0800
01079 #define PNG_INFO_iCCP 0x1000
01080 #define PNG_INFO_sPLT 0x2000
01081 #define PNG_INFO_sCAL 0x4000
01082 #define PNG_INFO_IDAT 0x8000L
01083
01084
01085
01086
01087
01088 typedef struct png_row_info_struct
01089 {
01090 png_uint_32 width;
01091 png_uint_32 rowbytes;
01092 png_byte color_type;
01093 png_byte bit_depth;
01094 png_byte channels;
01095 png_byte pixel_depth;
01096 } png_row_info;
01097
01098 typedef png_row_info FAR * png_row_infop;
01099 typedef png_row_info FAR * FAR * png_row_infopp;
01100
01101
01102
01103
01104
01105
01106
01107 typedef struct png_struct_def png_struct;
01108 typedef png_struct FAR * png_structp;
01109
01110 typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
01111 typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
01112 typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp));
01113 typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32,
01114 int));
01115 typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32,
01116 int));
01117
01118 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
01119 typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop));
01120 typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop));
01121 typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
01122 png_uint_32, int));
01123 #endif
01124
01125 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01126 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
01127 defined(PNG_LEGACY_SUPPORTED)
01128 typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp,
01129 png_row_infop, png_bytep));
01130 #endif
01131
01132 #if defined(PNG_USER_CHUNKS_SUPPORTED)
01133 typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp));
01134 #endif
01135 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
01136 typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp));
01137 #endif
01138
01139
01140 #define PNG_TRANSFORM_IDENTITY 0x0000
01141 #define PNG_TRANSFORM_STRIP_16 0x0001
01142 #define PNG_TRANSFORM_STRIP_ALPHA 0x0002
01143 #define PNG_TRANSFORM_PACKING 0x0004
01144 #define PNG_TRANSFORM_PACKSWAP 0x0008
01145 #define PNG_TRANSFORM_EXPAND 0x0010
01146 #define PNG_TRANSFORM_INVERT_MONO 0x0020
01147 #define PNG_TRANSFORM_SHIFT 0x0040
01148 #define PNG_TRANSFORM_BGR 0x0080
01149 #define PNG_TRANSFORM_SWAP_ALPHA 0x0100
01150 #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200
01151 #define PNG_TRANSFORM_INVERT_ALPHA 0x0400
01152 #define PNG_TRANSFORM_STRIP_FILLER 0x0800
01153
01154
01155 #define PNG_FLAG_MNG_EMPTY_PLTE 0x01
01156 #define PNG_FLAG_MNG_FILTER_64 0x04
01157 #define PNG_ALL_MNG_FEATURES 0x05
01158
01159 typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t));
01160 typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp));
01161
01162
01163
01164
01165
01166
01167
01168
01169 struct png_struct_def
01170 {
01171 #ifdef PNG_SETJMP_SUPPORTED
01172 jmp_buf jmpbuf;
01173 #endif
01174 png_error_ptr error_fn;
01175 png_error_ptr warning_fn;
01176 png_voidp error_ptr;
01177 png_rw_ptr write_data_fn;
01178 png_rw_ptr read_data_fn;
01179 png_voidp io_ptr;
01180
01181 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
01182 png_user_transform_ptr read_user_transform_fn;
01183 #endif
01184
01185 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
01186 png_user_transform_ptr write_user_transform_fn;
01187 #endif
01188
01189
01190 #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
01191 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01192 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
01193 png_voidp user_transform_ptr;
01194 png_byte user_transform_depth;
01195 png_byte user_transform_channels;
01196 #endif
01197 #endif
01198
01199 png_uint_32 mode;
01200 png_uint_32 flags;
01201 png_uint_32 transformations;
01202
01203 z_stream zstream;
01204 png_bytep zbuf;
01205 png_size_t zbuf_size;
01206 int zlib_level;
01207 int zlib_method;
01208 int zlib_window_bits;
01209 int zlib_mem_level;
01210 int zlib_strategy;
01211
01212 png_uint_32 width;
01213 png_uint_32 height;
01214 png_uint_32 num_rows;
01215 png_uint_32 usr_width;
01216 png_uint_32 rowbytes;
01217 png_uint_32 irowbytes;
01218 png_uint_32 iwidth;
01219 png_uint_32 row_number;
01220 png_bytep prev_row;
01221 png_bytep row_buf;
01222 #ifndef PNG_NO_WRITE_FILTER
01223 png_bytep sub_row;
01224 png_bytep up_row;
01225 png_bytep avg_row;
01226 png_bytep paeth_row;
01227 #endif
01228 png_row_info row_info;
01229
01230 png_uint_32 idat_size;
01231 png_uint_32 crc;
01232 png_colorp palette;
01233 png_uint_16 num_palette;
01234 png_uint_16 num_trans;
01235 png_byte chunk_name[5];
01236 png_byte compression;
01237 png_byte filter;
01238 png_byte interlaced;
01239 png_byte pass;
01240 png_byte do_filter;
01241 png_byte color_type;
01242 png_byte bit_depth;
01243 png_byte usr_bit_depth;
01244 png_byte pixel_depth;
01245 png_byte channels;
01246 png_byte usr_channels;
01247 png_byte sig_bytes;
01248
01249 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
01250 #ifdef PNG_LEGACY_SUPPORTED
01251 png_byte filler;
01252 #else
01253 png_uint_16 filler;
01254 #endif
01255 #endif
01256
01257 #if defined(PNG_bKGD_SUPPORTED)
01258 png_byte background_gamma_type;
01259 # ifdef PNG_FLOATING_POINT_SUPPORTED
01260 float background_gamma;
01261 # endif
01262 png_color_16 background;
01263 #if defined(PNG_READ_GAMMA_SUPPORTED)
01264 png_color_16 background_1;
01265 #endif
01266 #endif
01267
01268 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
01269 png_flush_ptr output_flush_fn;
01270 png_uint_32 flush_dist;
01271 png_uint_32 flush_rows;
01272 #endif
01273
01274 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01275 int gamma_shift;
01276 #ifdef PNG_FLOATING_POINT_SUPPORTED
01277 float gamma;
01278 float screen_gamma;
01279 #endif
01280 #endif
01281
01282 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01283 png_bytep gamma_table;
01284 png_bytep gamma_from_1;
01285 png_bytep gamma_to_1;
01286 png_uint_16pp gamma_16_table;
01287 png_uint_16pp gamma_16_from_1;
01288 png_uint_16pp gamma_16_to_1;
01289 #endif
01290
01291 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
01292 png_color_8 sig_bit;
01293 #endif
01294
01295 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
01296 png_color_8 shift;
01297 #endif
01298
01299 #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
01300 || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01301 png_bytep trans;
01302 png_color_16 trans_values;
01303 #endif
01304
01305 png_read_status_ptr read_row_fn;
01306 png_write_status_ptr write_row_fn;
01307 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
01308 png_progressive_info_ptr info_fn;
01309 png_progressive_row_ptr row_fn;
01310 png_progressive_end_ptr end_fn;
01311 png_bytep save_buffer_ptr;
01312 png_bytep save_buffer;
01313 png_bytep current_buffer_ptr;
01314 png_bytep current_buffer;
01315 png_uint_32 push_length;
01316 png_uint_32 skip_length;
01317 png_size_t save_buffer_size;
01318 png_size_t save_buffer_max;
01319 png_size_t buffer_size;
01320 png_size_t current_buffer_size;
01321 int process_mode;
01322 int cur_palette;
01323
01324 # if defined(PNG_TEXT_SUPPORTED)
01325 png_size_t current_text_size;
01326 png_size_t current_text_left;
01327 png_charp current_text;
01328 png_charp current_text_ptr;
01329 # endif
01330 #endif
01331
01332 #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
01333
01334 png_bytepp offset_table_ptr;
01335 png_bytep offset_table;
01336 png_uint_16 offset_table_number;
01337 png_uint_16 offset_table_count;
01338 png_uint_16 offset_table_count_free;
01339 #endif
01340
01341 #if defined(PNG_READ_DITHER_SUPPORTED)
01342 png_bytep palette_lookup;
01343 png_bytep dither_index;
01344 #endif
01345
01346 #if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED)
01347 png_uint_16p hist;
01348 #endif
01349
01350 #if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
01351 png_byte heuristic_method;
01352 png_byte num_prev_filters;
01353 png_bytep prev_filters;
01354 png_uint_16p filter_weights;
01355 png_uint_16p inv_filter_weights;
01356 png_uint_16p filter_costs;
01357 png_uint_16p inv_filter_costs;
01358 #endif
01359
01360 #if defined(PNG_TIME_RFC1123_SUPPORTED)
01361 png_charp time_buffer;
01362 #endif
01363
01364
01365
01366 #ifdef PNG_FREE_ME_SUPPORTED
01367 png_uint_32 free_me;
01368 #endif
01369
01370 #if defined(PNG_USER_CHUNKS_SUPPORTED)
01371 png_voidp user_chunk_ptr;
01372 png_user_chunk_ptr read_user_chunk_fn;
01373 #endif
01374
01375 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
01376 int num_chunk_list;
01377 png_bytep chunk_list;
01378 #endif
01379
01380
01381 #if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
01382 png_byte rgb_to_gray_status;
01383
01384 png_uint_16 rgb_to_gray_red_coeff;
01385 png_uint_16 rgb_to_gray_green_coeff;
01386 png_uint_16 rgb_to_gray_blue_coeff;
01387 #endif
01388
01389
01390 #if defined(PNG_MNG_FEATURES_SUPPORTED) || \
01391 defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
01392 defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
01393
01394 #ifdef PNG_1_0_X
01395 png_byte mng_features_permitted;
01396 #else
01397 png_uint_32 mng_features_permitted;
01398 #endif
01399 #endif
01400
01401
01402 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
01403 png_fixed_point int_gamma;
01404 #endif
01405
01406
01407 #if defined(PNG_MNG_FEATURES_SUPPORTED)
01408 png_byte filter_type;
01409 #endif
01410
01411 #if defined(PNG_1_0_X)
01412
01413 png_uint_32 row_buf_size;
01414 #endif
01415
01416
01417 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
01418 # if !defined(PNG_1_0_X)
01419 # if defined(PNG_MMX_CODE_SUPPORTED)
01420 png_byte mmx_bitdepth_threshold;
01421 png_uint_32 mmx_rowbytes_threshold;
01422 # endif
01423 png_uint_32 asm_flags;
01424 # endif
01425 #endif
01426
01427
01428 #ifdef PNG_USER_MEM_SUPPORTED
01429 png_voidp mem_ptr;
01430 png_malloc_ptr malloc_fn;
01431 png_free_ptr free_fn;
01432 #endif
01433
01434
01435 png_bytep big_row_buf;
01436
01437 #if defined(PNG_READ_DITHER_SUPPORTED)
01438
01439 png_bytep dither_sort;
01440 png_bytep index_to_palette;
01441
01442 png_bytep palette_to_index;
01443
01444 #endif
01445
01446
01447 png_byte compression_type;
01448
01449 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
01450 png_uint_32 user_width_max;
01451 png_uint_32 user_height_max;
01452 #endif
01453
01454
01455 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
01456
01457 png_unknown_chunk unknown_chunk;
01458 #endif
01459
01460
01461 png_uint_32 old_big_row_buf_size, old_prev_row_size;
01462
01463
01464 png_charp chunkdata;
01465
01466 };
01467
01468
01469
01470
01471
01472 typedef png_structp version_1_2_32;
01473
01474 typedef png_struct FAR * FAR * png_structpp;
01475
01476
01477
01478
01479
01480
01481
01482
01483 extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));
01484
01485
01486
01487
01488 extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
01489 int num_bytes));
01490
01491
01492
01493
01494
01495
01496 extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
01497 png_size_t num_to_check));
01498
01499
01500
01501
01502 extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num));
01503
01504
01505 extern PNG_EXPORT(png_structp,png_create_read_struct)
01506 PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01507 png_error_ptr error_fn, png_error_ptr warn_fn));
01508
01509
01510 extern PNG_EXPORT(png_structp,png_create_write_struct)
01511 PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01512 png_error_ptr error_fn, png_error_ptr warn_fn));
01513
01514 #ifdef PNG_WRITE_SUPPORTED
01515 extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size)
01516 PNGARG((png_structp png_ptr));
01517 #endif
01518
01519 #ifdef PNG_WRITE_SUPPORTED
01520 extern PNG_EXPORT(void,png_set_compression_buffer_size)
01521 PNGARG((png_structp png_ptr, png_uint_32 size));
01522 #endif
01523
01524
01525 extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
01526
01527
01528 #ifdef PNG_USER_MEM_SUPPORTED
01529 extern PNG_EXPORT(png_structp,png_create_read_struct_2)
01530 PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01531 png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
01532 png_malloc_ptr malloc_fn, png_free_ptr free_fn));
01533 extern PNG_EXPORT(png_structp,png_create_write_struct_2)
01534 PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
01535 png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
01536 png_malloc_ptr malloc_fn, png_free_ptr free_fn));
01537 #endif
01538
01539
01540 extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr,
01541 png_bytep chunk_name, png_bytep data, png_size_t length));
01542
01543
01544 extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr,
01545 png_bytep chunk_name, png_uint_32 length));
01546
01547
01548 extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr,
01549 png_bytep data, png_size_t length));
01550
01551
01552 extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr));
01553
01554
01555 extern PNG_EXPORT(png_infop,png_create_info_struct)
01556 PNGARG((png_structp png_ptr));
01557
01558 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
01559
01560 extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
01561 #undef png_info_init
01562 #define png_info_init(info_ptr) png_info_init_3(&info_ptr,\
01563 png_sizeof(png_info));
01564 #endif
01565
01566 extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
01567 png_size_t png_info_struct_size));
01568
01569
01570 extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr,
01571 png_infop info_ptr));
01572 extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
01573 png_infop info_ptr));
01574
01575 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01576
01577 extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
01578 png_infop info_ptr));
01579 #endif
01580
01581 #if defined(PNG_TIME_RFC1123_SUPPORTED)
01582 extern PNG_EXPORT(png_charp,png_convert_to_rfc1123)
01583 PNGARG((png_structp png_ptr, png_timep ptime));
01584 #endif
01585
01586 #if !defined(_WIN32_WCE)
01587
01588 #if defined(PNG_WRITE_tIME_SUPPORTED)
01589
01590 extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
01591 struct tm FAR * ttime));
01592
01593
01594 extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
01595 time_t ttime));
01596 #endif
01597 #endif
01598
01599 #if defined(PNG_READ_EXPAND_SUPPORTED)
01600
01601 extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
01602 #if !defined(PNG_1_0_X)
01603 extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
01604 png_ptr));
01605 #endif
01606 extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));
01607 extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
01608 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
01609
01610 extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));
01611 #endif
01612 #endif
01613
01614 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
01615
01616 extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));
01617 #endif
01618
01619 #if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
01620
01621 extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));
01622 #endif
01623
01624 #if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
01625
01626 #ifdef PNG_FLOATING_POINT_SUPPORTED
01627 extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr,
01628 int error_action, double red, double green ));
01629 #endif
01630 extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr,
01631 int error_action, png_fixed_point red, png_fixed_point green ));
01632 extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp
01633 png_ptr));
01634 #endif
01635
01636 extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
01637 png_colorp palette));
01638
01639 #if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
01640 extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
01641 #endif
01642
01643 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
01644 defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
01645 extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr));
01646 #endif
01647
01648 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
01649 defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
01650 extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
01651 #endif
01652
01653 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
01654
01655 extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr,
01656 png_uint_32 filler, int flags));
01657
01658 #define PNG_FILLER_BEFORE 0
01659 #define PNG_FILLER_AFTER 1
01660
01661 #if !defined(PNG_1_0_X)
01662 extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
01663 png_uint_32 filler, int flags));
01664 #endif
01665 #endif
01666
01667 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
01668
01669 extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr));
01670 #endif
01671
01672 #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
01673
01674 extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr));
01675 #endif
01676
01677 #if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
01678
01679 extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr));
01680 #endif
01681
01682 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
01683
01684 extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr,
01685 png_color_8p true_bits));
01686 #endif
01687
01688 #if defined(PNG_READ_INTERLACING_SUPPORTED) || \
01689 defined(PNG_WRITE_INTERLACING_SUPPORTED)
01690
01691 extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));
01692 #endif
01693
01694 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
01695
01696 extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
01697 #endif
01698
01699 #if defined(PNG_READ_BACKGROUND_SUPPORTED)
01700
01701 #ifdef PNG_FLOATING_POINT_SUPPORTED
01702 extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
01703 png_color_16p background_color, int background_gamma_code,
01704 int need_expand, double background_gamma));
01705 #endif
01706 #define PNG_BACKGROUND_GAMMA_UNKNOWN 0
01707 #define PNG_BACKGROUND_GAMMA_SCREEN 1
01708 #define PNG_BACKGROUND_GAMMA_FILE 2
01709 #define PNG_BACKGROUND_GAMMA_UNIQUE 3
01710 #endif
01711
01712 #if defined(PNG_READ_16_TO_8_SUPPORTED)
01713
01714 extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
01715 #endif
01716
01717 #if defined(PNG_READ_DITHER_SUPPORTED)
01718
01719 extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr,
01720 png_colorp palette, int num_palette, int maximum_colors,
01721 png_uint_16p histogram, int full_dither));
01722 #endif
01723
01724 #if defined(PNG_READ_GAMMA_SUPPORTED)
01725
01726 #ifdef PNG_FLOATING_POINT_SUPPORTED
01727 extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
01728 double screen_gamma, double default_file_gamma));
01729 #endif
01730 #endif
01731
01732 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
01733 #if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
01734 defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
01735
01736
01737 extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr,
01738 int empty_plte_permitted));
01739 #endif
01740 #endif
01741
01742 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
01743
01744 extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows));
01745
01746 extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr));
01747 #endif
01748
01749
01750 extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
01751
01752
01753 extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
01754 png_infop info_ptr));
01755
01756 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01757
01758 extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
01759 png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
01760 #endif
01761
01762 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01763
01764 extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
01765 png_bytep row,
01766 png_bytep display_row));
01767 #endif
01768
01769 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01770
01771 extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
01772 png_bytepp image));
01773 #endif
01774
01775
01776 extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
01777 png_bytep row));
01778
01779
01780 extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
01781 png_bytepp row, png_uint_32 num_rows));
01782
01783
01784 extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
01785 png_bytepp image));
01786
01787
01788 extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
01789 png_infop info_ptr));
01790
01791 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
01792
01793 extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
01794 png_infop info_ptr));
01795 #endif
01796
01797
01798 extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
01799 png_infopp info_ptr_ptr));
01800
01801
01802 extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
01803 png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
01804
01805
01806 extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
01807 png_infop end_info_ptr));
01808
01809
01810 extern PNG_EXPORT(void,png_destroy_write_struct)
01811 PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
01812
01813
01814 extern void png_write_destroy PNGARG((png_structp png_ptr));
01815
01816
01817 extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
01818 int crit_action, int ancil_action));
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829 #define PNG_CRC_DEFAULT 0
01830 #define PNG_CRC_ERROR_QUIT 1
01831 #define PNG_CRC_WARN_DISCARD 2
01832 #define PNG_CRC_WARN_USE 3
01833 #define PNG_CRC_QUIET_USE 4
01834 #define PNG_CRC_NO_CHANGE 5
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847 extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
01848 int filters));
01849
01850
01851
01852
01853
01854
01855 #define PNG_NO_FILTERS 0x00
01856 #define PNG_FILTER_NONE 0x08
01857 #define PNG_FILTER_SUB 0x10
01858 #define PNG_FILTER_UP 0x20
01859 #define PNG_FILTER_AVG 0x40
01860 #define PNG_FILTER_PAETH 0x80
01861 #define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
01862 PNG_FILTER_AVG | PNG_FILTER_PAETH)
01863
01864
01865
01866
01867 #define PNG_FILTER_VALUE_NONE 0
01868 #define PNG_FILTER_VALUE_SUB 1
01869 #define PNG_FILTER_VALUE_UP 2
01870 #define PNG_FILTER_VALUE_AVG 3
01871 #define PNG_FILTER_VALUE_PAETH 4
01872 #define PNG_FILTER_VALUE_LAST 5
01873
01874 #if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
01875
01876
01877
01878
01879
01880
01881
01882
01883
01884
01885
01886
01887
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903 #ifdef PNG_FLOATING_POINT_SUPPORTED
01904 extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr,
01905 int heuristic_method, int num_weights, png_doublep filter_weights,
01906 png_doublep filter_costs));
01907 #endif
01908 #endif
01909
01910
01911
01912
01913 #define PNG_FILTER_HEURISTIC_DEFAULT 0
01914 #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1
01915 #define PNG_FILTER_HEURISTIC_WEIGHTED 2
01916 #define PNG_FILTER_HEURISTIC_LAST 3
01917
01918
01919
01920
01921
01922
01923
01924
01925 extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr,
01926 int level));
01927
01928 extern PNG_EXPORT(void,png_set_compression_mem_level)
01929 PNGARG((png_structp png_ptr, int mem_level));
01930
01931 extern PNG_EXPORT(void,png_set_compression_strategy)
01932 PNGARG((png_structp png_ptr, int strategy));
01933
01934 extern PNG_EXPORT(void,png_set_compression_window_bits)
01935 PNGARG((png_structp png_ptr, int window_bits));
01936
01937 extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr,
01938 int method));
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949 #if !defined(PNG_NO_STDIO)
01950
01951 extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp));
01952 #endif
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962 extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr,
01963 png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
01964
01965
01966 extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
01967
01968
01969
01970
01971
01972
01973 extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
01974 png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
01975
01976
01977 extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr,
01978 png_voidp io_ptr, png_rw_ptr read_data_fn));
01979
01980
01981 extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr));
01982
01983 extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr,
01984 png_read_status_ptr read_row_fn));
01985
01986 extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr,
01987 png_write_status_ptr write_row_fn));
01988
01989 #ifdef PNG_USER_MEM_SUPPORTED
01990
01991 extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr,
01992 png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));
01993
01994 extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr));
01995 #endif
01996
01997 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
01998 defined(PNG_LEGACY_SUPPORTED)
01999 extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp
02000 png_ptr, png_user_transform_ptr read_user_transform_fn));
02001 #endif
02002
02003 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
02004 defined(PNG_LEGACY_SUPPORTED)
02005 extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp
02006 png_ptr, png_user_transform_ptr write_user_transform_fn));
02007 #endif
02008
02009 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
02010 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
02011 defined(PNG_LEGACY_SUPPORTED)
02012 extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp
02013 png_ptr, png_voidp user_transform_ptr, int user_transform_depth,
02014 int user_transform_channels));
02015
02016 extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr)
02017 PNGARG((png_structp png_ptr));
02018 #endif
02019
02020 #ifdef PNG_USER_CHUNKS_SUPPORTED
02021 extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr,
02022 png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
02023 extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp
02024 png_ptr));
02025 #endif
02026
02027 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
02028
02029
02030
02031 extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr,
02032 png_voidp progressive_ptr,
02033 png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
02034 png_progressive_end_ptr end_fn));
02035
02036
02037 extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
02038 PNGARG((png_structp png_ptr));
02039
02040
02041 extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
02042 png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
02043
02044
02045
02046
02047 extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
02048 png_bytep old_row, png_bytep new_row));
02049 #endif
02050
02051 extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
02052 png_uint_32 size));
02053
02054 #if defined(PNG_1_0_X)
02055 # define png_malloc_warn png_malloc
02056 #else
02057
02058 extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
02059 png_uint_32 size));
02060 #endif
02061
02062
02063 extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
02064
02065 #if defined(PNG_1_0_X)
02066
02067 extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
02068 uInt size));
02069
02070
02071 extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
02072 #endif
02073
02074
02075 extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
02076 png_infop info_ptr, png_uint_32 free_me, int num));
02077 #ifdef PNG_FREE_ME_SUPPORTED
02078
02079
02080 extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
02081 png_infop info_ptr, int freer, png_uint_32 mask));
02082 #endif
02083
02084 #define PNG_DESTROY_WILL_FREE_DATA 1
02085 #define PNG_SET_WILL_FREE_DATA 1
02086 #define PNG_USER_WILL_FREE_DATA 2
02087
02088 #define PNG_FREE_HIST 0x0008
02089 #define PNG_FREE_ICCP 0x0010
02090 #define PNG_FREE_SPLT 0x0020
02091 #define PNG_FREE_ROWS 0x0040
02092 #define PNG_FREE_PCAL 0x0080
02093 #define PNG_FREE_SCAL 0x0100
02094 #define PNG_FREE_UNKN 0x0200
02095 #define PNG_FREE_LIST 0x0400
02096 #define PNG_FREE_PLTE 0x1000
02097 #define PNG_FREE_TRNS 0x2000
02098 #define PNG_FREE_TEXT 0x4000
02099 #define PNG_FREE_ALL 0x7fff
02100 #define PNG_FREE_MUL 0x4220
02101
02102 #ifdef PNG_USER_MEM_SUPPORTED
02103 extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
02104 png_uint_32 size));
02105 extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr,
02106 png_voidp ptr));
02107 #endif
02108
02109 extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr,
02110 png_voidp s1, png_voidp s2, png_uint_32 size));
02111
02112 extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr,
02113 png_voidp s1, int value, png_uint_32 size));
02114
02115 #if defined(USE_FAR_KEYWORD)
02116 extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
02117 int check));
02118 #endif
02119
02120 #ifndef PNG_NO_ERROR_TEXT
02121
02122 extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
02123 png_const_charp error_message));
02124
02125
02126 extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
02127 png_const_charp error_message));
02128 #else
02129
02130 extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr));
02131 #endif
02132
02133 #ifndef PNG_NO_WARNINGS
02134
02135 extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
02136 png_const_charp warning_message));
02137
02138 #ifdef PNG_READ_SUPPORTED
02139
02140 extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
02141 png_const_charp warning_message));
02142 #endif
02143 #endif
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153
02154
02155
02156
02157
02158 extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr,
02159 png_infop info_ptr, png_uint_32 flag));
02160
02161
02162 extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr,
02163 png_infop info_ptr));
02164
02165 #if defined(PNG_INFO_IMAGE_SUPPORTED)
02166
02167
02168 extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
02169 png_infop info_ptr));
02170
02171
02172 extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
02173 png_infop info_ptr, png_bytepp row_pointers));
02174 #endif
02175
02176
02177 extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr,
02178 png_infop info_ptr));
02179
02180 #ifdef PNG_EASY_ACCESS_SUPPORTED
02181
02182 extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp
02183 png_ptr, png_infop info_ptr));
02184
02185
02186 extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp
02187 png_ptr, png_infop info_ptr));
02188
02189
02190 extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp
02191 png_ptr, png_infop info_ptr));
02192
02193
02194 extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp
02195 png_ptr, png_infop info_ptr));
02196
02197
02198 extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp
02199 png_ptr, png_infop info_ptr));
02200
02201
02202 extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp
02203 png_ptr, png_infop info_ptr));
02204
02205
02206 extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp
02207 png_ptr, png_infop info_ptr));
02208
02209
02210 extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp
02211 png_ptr, png_infop info_ptr));
02212 extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp
02213 png_ptr, png_infop info_ptr));
02214 extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp
02215 png_ptr, png_infop info_ptr));
02216
02217
02218 #ifdef PNG_FLOATING_POINT_SUPPORTED
02219 extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp
02220 png_ptr, png_infop info_ptr));
02221 #endif
02222
02223
02224 extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp
02225 png_ptr, png_infop info_ptr));
02226 extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp
02227 png_ptr, png_infop info_ptr));
02228 extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp
02229 png_ptr, png_infop info_ptr));
02230 extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp
02231 png_ptr, png_infop info_ptr));
02232
02233 #endif
02234
02235
02236 extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr,
02237 png_infop info_ptr));
02238
02239 #if defined(PNG_bKGD_SUPPORTED)
02240 extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr,
02241 png_infop info_ptr, png_color_16p *background));
02242 #endif
02243
02244 #if defined(PNG_bKGD_SUPPORTED)
02245 extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr,
02246 png_infop info_ptr, png_color_16p background));
02247 #endif
02248
02249 #if defined(PNG_cHRM_SUPPORTED)
02250 #ifdef PNG_FLOATING_POINT_SUPPORTED
02251 extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr,
02252 png_infop info_ptr, double *white_x, double *white_y, double *red_x,
02253 double *red_y, double *green_x, double *green_y, double *blue_x,
02254 double *blue_y));
02255 #endif
02256 #ifdef PNG_FIXED_POINT_SUPPORTED
02257 extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr,
02258 png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point
02259 *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y,
02260 png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point
02261 *int_blue_x, png_fixed_point *int_blue_y));
02262 #endif
02263 #endif
02264
02265 #if defined(PNG_cHRM_SUPPORTED)
02266 #ifdef PNG_FLOATING_POINT_SUPPORTED
02267 extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr,
02268 png_infop info_ptr, double white_x, double white_y, double red_x,
02269 double red_y, double green_x, double green_y, double blue_x, double blue_y));
02270 #endif
02271 #ifdef PNG_FIXED_POINT_SUPPORTED
02272 extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr,
02273 png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y,
02274 png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
02275 int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
02276 png_fixed_point int_blue_y));
02277 #endif
02278 #endif
02279
02280 #if defined(PNG_gAMA_SUPPORTED)
02281 #ifdef PNG_FLOATING_POINT_SUPPORTED
02282 extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr,
02283 png_infop info_ptr, double *file_gamma));
02284 #endif
02285 extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr,
02286 png_infop info_ptr, png_fixed_point *int_file_gamma));
02287 #endif
02288
02289 #if defined(PNG_gAMA_SUPPORTED)
02290 #ifdef PNG_FLOATING_POINT_SUPPORTED
02291 extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr,
02292 png_infop info_ptr, double file_gamma));
02293 #endif
02294 extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr,
02295 png_infop info_ptr, png_fixed_point int_file_gamma));
02296 #endif
02297
02298 #if defined(PNG_hIST_SUPPORTED)
02299 extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr,
02300 png_infop info_ptr, png_uint_16p *hist));
02301 #endif
02302
02303 #if defined(PNG_hIST_SUPPORTED)
02304 extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
02305 png_infop info_ptr, png_uint_16p hist));
02306 #endif
02307
02308 extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr,
02309 png_infop info_ptr, png_uint_32 *width, png_uint_32 *height,
02310 int *bit_depth, int *color_type, int *interlace_method,
02311 int *compression_method, int *filter_method));
02312
02313 extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr,
02314 png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,
02315 int color_type, int interlace_method, int compression_method,
02316 int filter_method));
02317
02318 #if defined(PNG_oFFs_SUPPORTED)
02319 extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr,
02320 png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
02321 int *unit_type));
02322 #endif
02323
02324 #if defined(PNG_oFFs_SUPPORTED)
02325 extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr,
02326 png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y,
02327 int unit_type));
02328 #endif
02329
02330 #if defined(PNG_pCAL_SUPPORTED)
02331 extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr,
02332 png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
02333 int *type, int *nparams, png_charp *units, png_charpp *params));
02334 #endif
02335
02336 #if defined(PNG_pCAL_SUPPORTED)
02337 extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr,
02338 png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1,
02339 int type, int nparams, png_charp units, png_charpp params));
02340 #endif
02341
02342 #if defined(PNG_pHYs_SUPPORTED)
02343 extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr,
02344 png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
02345 #endif
02346
02347 #if defined(PNG_pHYs_SUPPORTED)
02348 extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
02349 png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
02350 #endif
02351
02352 extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr,
02353 png_infop info_ptr, png_colorp *palette, int *num_palette));
02354
02355 extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
02356 png_infop info_ptr, png_colorp palette, int num_palette));
02357
02358 #if defined(PNG_sBIT_SUPPORTED)
02359 extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr,
02360 png_infop info_ptr, png_color_8p *sig_bit));
02361 #endif
02362
02363 #if defined(PNG_sBIT_SUPPORTED)
02364 extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
02365 png_infop info_ptr, png_color_8p sig_bit));
02366 #endif
02367
02368 #if defined(PNG_sRGB_SUPPORTED)
02369 extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr,
02370 png_infop info_ptr, int *intent));
02371 #endif
02372
02373 #if defined(PNG_sRGB_SUPPORTED)
02374 extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
02375 png_infop info_ptr, int intent));
02376 extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
02377 png_infop info_ptr, int intent));
02378 #endif
02379
02380 #if defined(PNG_iCCP_SUPPORTED)
02381 extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
02382 png_infop info_ptr, png_charpp name, int *compression_type,
02383 png_charpp profile, png_uint_32 *proflen));
02384
02385 #endif
02386
02387 #if defined(PNG_iCCP_SUPPORTED)
02388 extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
02389 png_infop info_ptr, png_charp name, int compression_type,
02390 png_charp profile, png_uint_32 proflen));
02391
02392 #endif
02393
02394 #if defined(PNG_sPLT_SUPPORTED)
02395 extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr,
02396 png_infop info_ptr, png_sPLT_tpp entries));
02397 #endif
02398
02399 #if defined(PNG_sPLT_SUPPORTED)
02400 extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
02401 png_infop info_ptr, png_sPLT_tp entries, int nentries));
02402 #endif
02403
02404 #if defined(PNG_TEXT_SUPPORTED)
02405
02406 extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
02407 png_infop info_ptr, png_textp *text_ptr, int *num_text));
02408 #endif
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418 #if defined(PNG_TEXT_SUPPORTED)
02419 extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr,
02420 png_infop info_ptr, png_textp text_ptr, int num_text));
02421 #endif
02422
02423 #if defined(PNG_tIME_SUPPORTED)
02424 extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr,
02425 png_infop info_ptr, png_timep *mod_time));
02426 #endif
02427
02428 #if defined(PNG_tIME_SUPPORTED)
02429 extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr,
02430 png_infop info_ptr, png_timep mod_time));
02431 #endif
02432
02433 #if defined(PNG_tRNS_SUPPORTED)
02434 extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr,
02435 png_infop info_ptr, png_bytep *trans, int *num_trans,
02436 png_color_16p *trans_values));
02437 #endif
02438
02439 #if defined(PNG_tRNS_SUPPORTED)
02440 extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
02441 png_infop info_ptr, png_bytep trans, int num_trans,
02442 png_color_16p trans_values));
02443 #endif
02444
02445 #if defined(PNG_tRNS_SUPPORTED)
02446 #endif
02447
02448 #if defined(PNG_sCAL_SUPPORTED)
02449 #ifdef PNG_FLOATING_POINT_SUPPORTED
02450 extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr,
02451 png_infop info_ptr, int *unit, double *width, double *height));
02452 #else
02453 #ifdef PNG_FIXED_POINT_SUPPORTED
02454 extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr,
02455 png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
02456 #endif
02457 #endif
02458 #endif
02459
02460 #if defined(PNG_sCAL_SUPPORTED)
02461 #ifdef PNG_FLOATING_POINT_SUPPORTED
02462 extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr,
02463 png_infop info_ptr, int unit, double width, double height));
02464 #else
02465 #ifdef PNG_FIXED_POINT_SUPPORTED
02466 extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
02467 png_infop info_ptr, int unit, png_charp swidth, png_charp sheight));
02468 #endif
02469 #endif
02470 #endif
02471
02472 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482 extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
02483 png_ptr, int keep, png_bytep chunk_list, int num_chunks));
02484 extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
02485 png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
02486 extern PNG_EXPORT(void, png_set_unknown_chunk_location)
02487 PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location));
02488 extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
02489 png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
02490 #endif
02491 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
02492 PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
02493 chunk_name));
02494 #endif
02495
02496
02497
02498
02499 extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
02500 png_infop info_ptr, int mask));
02501
02502 #if defined(PNG_INFO_IMAGE_SUPPORTED)
02503
02504 extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr,
02505 png_infop info_ptr,
02506 int transforms,
02507 png_voidp params));
02508 extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
02509 png_infop info_ptr,
02510 int transforms,
02511 png_voidp params));
02512 #endif
02513
02514
02515
02516
02517
02518
02519 #ifdef PNG_DEBUG
02520 #if (PNG_DEBUG > 0)
02521 #if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
02522 #include <crtdbg.h>
02523 #if (PNG_DEBUG > 1)
02524 #define png_debug(l,m) _RPT0(_CRT_WARN,m)
02525 #define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1)
02526 #define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2)
02527 #endif
02528 #else
02529 #ifndef PNG_DEBUG_FILE
02530 #define PNG_DEBUG_FILE stderr
02531 #endif
02532 #if (PNG_DEBUG > 1)
02533 #define png_debug(l,m) \
02534 { \
02535 int num_tabs=l; \
02536 fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
02537 (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
02538 }
02539 #define png_debug1(l,m,p1) \
02540 { \
02541 int num_tabs=l; \
02542 fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
02543 (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
02544 }
02545 #define png_debug2(l,m,p1,p2) \
02546 { \
02547 int num_tabs=l; \
02548 fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
02549 (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
02550 }
02551 #endif
02552 #endif
02553 #endif
02554 #endif
02555 #ifndef png_debug
02556 #define png_debug(l, m)
02557 #endif
02558 #ifndef png_debug1
02559 #define png_debug1(l, m, p1)
02560 #endif
02561 #ifndef png_debug2
02562 #define png_debug2(l, m, p1, p2)
02563 #endif
02564
02565 extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr));
02566 extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr));
02567 extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr));
02568 extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
02569
02570 #ifdef PNG_MNG_FEATURES_SUPPORTED
02571 extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
02572 png_ptr, png_uint_32 mng_features_permitted));
02573 #endif
02574
02575
02576 #define PNG_HANDLE_CHUNK_AS_DEFAULT 0
02577 #define PNG_HANDLE_CHUNK_NEVER 1
02578 #define PNG_HANDLE_CHUNK_IF_SAFE 2
02579 #define PNG_HANDLE_CHUNK_ALWAYS 3
02580
02581
02582 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
02583 #if defined(PNG_MMX_CODE_SUPPORTED)
02584 #define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01
02585 #define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02
02586 #define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04
02587 #define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08
02588 #define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10
02589 #define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20
02590 #define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40
02591 #define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
02592 #define PNG_ASM_FLAGS_INITIALIZED 0x80000000
02593
02594 #define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
02595 | PNG_ASM_FLAG_MMX_READ_INTERLACE \
02596 | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
02597 | PNG_ASM_FLAG_MMX_READ_FILTER_UP \
02598 | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
02599 | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH )
02600 #define PNG_MMX_WRITE_FLAGS ( 0 )
02601
02602 #define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \
02603 | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \
02604 | PNG_MMX_READ_FLAGS \
02605 | PNG_MMX_WRITE_FLAGS )
02606
02607 #define PNG_SELECT_READ 1
02608 #define PNG_SELECT_WRITE 2
02609 #endif
02610
02611 #if !defined(PNG_1_0_X)
02612
02613 extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask)
02614 PNGARG((int flag_select, int *compilerID));
02615
02616
02617 extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask)
02618 PNGARG((int flag_select));
02619
02620
02621 extern PNG_EXPORT(png_uint_32,png_get_asm_flags)
02622 PNGARG((png_structp png_ptr));
02623
02624
02625 extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold)
02626 PNGARG((png_structp png_ptr));
02627
02628
02629 extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold)
02630 PNGARG((png_structp png_ptr));
02631
02632
02633 extern PNG_EXPORT(void,png_set_asm_flags)
02634 PNGARG((png_structp png_ptr, png_uint_32 asm_flags));
02635
02636
02637 extern PNG_EXPORT(void,png_set_mmx_thresholds)
02638 PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold,
02639 png_uint_32 mmx_rowbytes_threshold));
02640
02641 #endif
02642
02643 #if !defined(PNG_1_0_X)
02644
02645 extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
02646 #endif
02647
02648
02649
02650 #ifdef PNG_ERROR_NUMBERS_SUPPORTED
02651 extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
02652 png_ptr, png_uint_32 strip_mode));
02653 #endif
02654
02655 #endif
02656
02657
02658 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
02659 extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
02660 png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
02661 extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
02662 png_ptr));
02663 extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
02664 png_ptr));
02665 #endif
02666
02667
02668
02669
02670 #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
02671
02672
02673
02674
02675
02676
02677
02678
02679
02680
02681
02682
02683
02684
02685 # define png_composite(composite, fg, alpha, bg) \
02686 { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \
02687 + (png_uint_16)(bg)*(png_uint_16)(255 - \
02688 (png_uint_16)(alpha)) + (png_uint_16)128); \
02689 (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }
02690
02691 # define png_composite_16(composite, fg, alpha, bg) \
02692 { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \
02693 + (png_uint_32)(bg)*(png_uint_32)(65535L - \
02694 (png_uint_32)(alpha)) + (png_uint_32)32768L); \
02695 (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
02696
02697 #else
02698
02699 # define png_composite(composite, fg, alpha, bg) \
02700 (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \
02701 (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \
02702 (png_uint_16)127) / 255)
02703
02704 # define png_composite_16(composite, fg, alpha, bg) \
02705 (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
02706 (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \
02707 (png_uint_32)32767) / (png_uint_32)65535L)
02708
02709 #endif
02710
02711
02712
02713
02714
02715
02716
02717
02718
02719 #if defined(PNG_READ_BIG_ENDIAN_SUPPORTED)
02720 # define png_get_uint_32(buf) ( *((png_uint_32p) (buf)))
02721 # define png_get_uint_16(buf) ( *((png_uint_16p) (buf)))
02722 # define png_get_int_32(buf) ( *((png_int_32p) (buf)))
02723 #else
02724 extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf));
02725 extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf));
02726 extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf));
02727 #endif
02728 extern PNG_EXPORT(png_uint_32,png_get_uint_31)
02729 PNGARG((png_structp png_ptr, png_bytep buf));
02730
02731
02732
02733
02734 extern PNG_EXPORT(void,png_save_uint_32)
02735 PNGARG((png_bytep buf, png_uint_32 i));
02736 extern PNG_EXPORT(void,png_save_int_32)
02737 PNGARG((png_bytep buf, png_int_32 i));
02738
02739
02740
02741
02742
02743 extern PNG_EXPORT(void,png_save_uint_16)
02744 PNGARG((png_bytep buf, unsigned int i));
02745
02746
02747
02748
02749
02750
02751
02752
02753
02754
02755
02756
02757
02758
02759 #define PNG_HAVE_IHDR 0x01
02760 #define PNG_HAVE_PLTE 0x02
02761 #define PNG_HAVE_IDAT 0x04
02762 #define PNG_AFTER_IDAT 0x08
02763 #define PNG_HAVE_IEND 0x10
02764
02765 #if defined(PNG_INTERNAL)
02766
02767
02768
02769
02770 #define PNG_HAVE_gAMA 0x20
02771 #define PNG_HAVE_cHRM 0x40
02772 #define PNG_HAVE_sRGB 0x80
02773 #define PNG_HAVE_CHUNK_HEADER 0x100
02774 #define PNG_WROTE_tIME 0x200
02775 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400
02776 #define PNG_BACKGROUND_IS_GRAY 0x800
02777 #define PNG_HAVE_PNG_SIGNATURE 0x1000
02778 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000
02779
02780
02781 #define PNG_BGR 0x0001
02782 #define PNG_INTERLACE 0x0002
02783 #define PNG_PACK 0x0004
02784 #define PNG_SHIFT 0x0008
02785 #define PNG_SWAP_BYTES 0x0010
02786 #define PNG_INVERT_MONO 0x0020
02787 #define PNG_DITHER 0x0040
02788 #define PNG_BACKGROUND 0x0080
02789 #define PNG_BACKGROUND_EXPAND 0x0100
02790
02791 #define PNG_16_TO_8 0x0400
02792 #define PNG_RGBA 0x0800
02793 #define PNG_EXPAND 0x1000
02794 #define PNG_GAMMA 0x2000
02795 #define PNG_GRAY_TO_RGB 0x4000
02796 #define PNG_FILLER 0x8000L
02797 #define PNG_PACKSWAP 0x10000L
02798 #define PNG_SWAP_ALPHA 0x20000L
02799 #define PNG_STRIP_ALPHA 0x40000L
02800 #define PNG_INVERT_ALPHA 0x80000L
02801 #define PNG_USER_TRANSFORM 0x100000L
02802 #define PNG_RGB_TO_GRAY_ERR 0x200000L
02803 #define PNG_RGB_TO_GRAY_WARN 0x400000L
02804 #define PNG_RGB_TO_GRAY 0x600000L
02805
02806 #define PNG_ADD_ALPHA 0x1000000L
02807 #define PNG_EXPAND_tRNS 0x2000000L
02808
02809
02810
02811
02812
02813
02814
02815 #define PNG_STRUCT_PNG 0x0001
02816 #define PNG_STRUCT_INFO 0x0002
02817
02818
02819 #define PNG_WEIGHT_SHIFT 8
02820 #define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT))
02821 #define PNG_COST_SHIFT 3
02822 #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
02823
02824
02825 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001
02826 #define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002
02827 #define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004
02828 #define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008
02829 #define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010
02830 #define PNG_FLAG_ZLIB_FINISHED 0x0020
02831 #define PNG_FLAG_ROW_INIT 0x0040
02832 #define PNG_FLAG_FILLER_AFTER 0x0080
02833 #define PNG_FLAG_CRC_ANCILLARY_USE 0x0100
02834 #define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200
02835 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400
02836 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800
02837 #define PNG_FLAG_FREE_PLTE 0x1000
02838 #define PNG_FLAG_FREE_TRNS 0x2000
02839 #define PNG_FLAG_FREE_HIST 0x4000
02840 #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L
02841 #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L
02842 #define PNG_FLAG_LIBRARY_MISMATCH 0x20000L
02843 #define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L
02844 #define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L
02845 #define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L
02846 #define PNG_FLAG_ADD_ALPHA 0x200000L
02847 #define PNG_FLAG_STRIP_ALPHA 0x400000L
02848
02849
02850
02851
02852
02853
02854
02855
02856
02857 #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
02858 PNG_FLAG_CRC_ANCILLARY_NOWARN)
02859
02860 #define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \
02861 PNG_FLAG_CRC_CRITICAL_IGNORE)
02862
02863 #define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \
02864 PNG_FLAG_CRC_CRITICAL_MASK)
02865
02866
02867
02868 #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
02869 abs((int)((c1).green) - (int)((c2).green)) + \
02870 abs((int)((c1).blue) - (int)((c2).blue)))
02871
02872
02873 #define PNG_ROWBYTES(pixel_bits, width) \
02874 ((pixel_bits) >= 8 ? \
02875 ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \
02876 (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) )
02877
02878
02879
02880
02881
02882 #define PNG_OUT_OF_RANGE(value, ideal, delta) \
02883 ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
02884
02885
02886 #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
02887
02888 #ifdef PNG_USE_GLOBAL_ARRAYS
02889 PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8];
02890 #else
02891 #endif
02892 #endif
02893
02894
02895
02896
02897
02898 #define PNG_IHDR png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'}
02899 #define PNG_IDAT png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'}
02900 #define PNG_IEND png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'}
02901 #define PNG_PLTE png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'}
02902 #define PNG_bKGD png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'}
02903 #define PNG_cHRM png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'}
02904 #define PNG_gAMA png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'}
02905 #define PNG_hIST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'}
02906 #define PNG_iCCP png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'}
02907 #define PNG_iTXt png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'}
02908 #define PNG_oFFs png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'}
02909 #define PNG_pCAL png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'}
02910 #define PNG_sCAL png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'}
02911 #define PNG_pHYs png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'}
02912 #define PNG_sBIT png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'}
02913 #define PNG_sPLT png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'}
02914 #define PNG_sRGB png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'}
02915 #define PNG_tEXt png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'}
02916 #define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'}
02917 #define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'}
02918 #define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'}
02919
02920 #ifdef PNG_USE_GLOBAL_ARRAYS
02921 PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5];
02922 PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5];
02923 PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5];
02924 PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5];
02925 PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5];
02926 PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5];
02927 PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5];
02928 PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5];
02929 PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5];
02930 PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5];
02931 PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5];
02932 PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5];
02933 PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5];
02934 PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5];
02935 PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5];
02936 PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5];
02937 PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5];
02938 PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5];
02939 PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5];
02940 PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5];
02941 PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5];
02942 #endif
02943
02944 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
02945
02946
02947
02948 extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
02949 #undef png_read_init
02950 #define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
02951 PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
02952 #endif
02953
02954 extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
02955 png_const_charp user_png_ver, png_size_t png_struct_size));
02956 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
02957 extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
02958 png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
02959 png_info_size));
02960 #endif
02961
02962 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
02963
02964
02965
02966 extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
02967 #undef png_write_init
02968 #define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
02969 PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
02970 #endif
02971
02972 extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
02973 png_const_charp user_png_ver, png_size_t png_struct_size));
02974 extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr,
02975 png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
02976 png_info_size));
02977
02978
02979 PNG_EXTERN png_voidp png_create_struct PNGARG((int type));
02980
02981
02982 PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
02983
02984 PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr
02985 malloc_fn, png_voidp mem_ptr));
02986 PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
02987 png_free_ptr free_fn, png_voidp mem_ptr));
02988
02989
02990 PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
02991 png_infop info_ptr));
02992
02993 #ifndef PNG_1_0_X
02994
02995 PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
02996
02997
02998 PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
02999
03000 #ifdef PNG_SIZE_T
03001
03002 PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
03003 #endif
03004
03005
03006
03007
03008 PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
03009 png_bytep data, png_size_t length));
03010
03011 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
03012 PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
03013 png_bytep buffer, png_size_t length));
03014 #endif
03015
03016 PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
03017 png_bytep data, png_size_t length));
03018
03019 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
03020 #if !defined(PNG_NO_STDIO)
03021 PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
03022 #endif
03023 #endif
03024 #else
03025 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
03026 PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
03027 png_bytep buffer, png_size_t length));
03028 #endif
03029 #endif
03030
03031
03032 PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
03033
03034
03035 PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data,
03036 png_size_t length));
03037
03038
03039 PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
03040 png_size_t length));
03041
03042
03043 PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
03044 png_size_t length));
03045
03046
03047 #if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
03048 defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
03049 PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
03050 int comp_type, png_size_t chunklength,
03051 png_size_t prefix_length, png_size_t *data_length));
03052 #endif
03053
03054
03055 PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
03056
03057
03058 PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
03059
03060
03061
03062
03063
03064 PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
03065 png_size_t length));
03066
03067 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
03068 PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
03069 #endif
03070
03071
03072 PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr));
03073
03074
03075
03076
03077
03078
03079 PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
03080 png_uint_32 height,
03081 int bit_depth, int color_type, int compression_method, int filter_method,
03082 int interlace_method));
03083
03084 PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette,
03085 png_uint_32 num_pal));
03086
03087 PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
03088 png_size_t length));
03089
03090 PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
03091
03092 #if defined(PNG_WRITE_gAMA_SUPPORTED)
03093 #ifdef PNG_FLOATING_POINT_SUPPORTED
03094 PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
03095 #endif
03096 #ifdef PNG_FIXED_POINT_SUPPORTED
03097 PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point
03098 file_gamma));
03099 #endif
03100 #endif
03101
03102 #if defined(PNG_WRITE_sBIT_SUPPORTED)
03103 PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit,
03104 int color_type));
03105 #endif
03106
03107 #if defined(PNG_WRITE_cHRM_SUPPORTED)
03108 #ifdef PNG_FLOATING_POINT_SUPPORTED
03109 PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
03110 double white_x, double white_y,
03111 double red_x, double red_y, double green_x, double green_y,
03112 double blue_x, double blue_y));
03113 #endif
03114 #ifdef PNG_FIXED_POINT_SUPPORTED
03115 PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
03116 png_fixed_point int_white_x, png_fixed_point int_white_y,
03117 png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
03118 int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
03119 png_fixed_point int_blue_y));
03120 #endif
03121 #endif
03122
03123 #if defined(PNG_WRITE_sRGB_SUPPORTED)
03124 PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
03125 int intent));
03126 #endif
03127
03128 #if defined(PNG_WRITE_iCCP_SUPPORTED)
03129 PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
03130 png_charp name, int compression_type,
03131 png_charp profile, int proflen));
03132
03133 #endif
03134
03135 #if defined(PNG_WRITE_sPLT_SUPPORTED)
03136 PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
03137 png_sPLT_tp palette));
03138 #endif
03139
03140 #if defined(PNG_WRITE_tRNS_SUPPORTED)
03141 PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans,
03142 png_color_16p values, int number, int color_type));
03143 #endif
03144
03145 #if defined(PNG_WRITE_bKGD_SUPPORTED)
03146 PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
03147 png_color_16p values, int color_type));
03148 #endif
03149
03150 #if defined(PNG_WRITE_hIST_SUPPORTED)
03151 PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist,
03152 int num_hist));
03153 #endif
03154
03155 #if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
03156 defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
03157 PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
03158 png_charp key, png_charpp new_key));
03159 #endif
03160
03161 #if defined(PNG_WRITE_tEXt_SUPPORTED)
03162 PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key,
03163 png_charp text, png_size_t text_len));
03164 #endif
03165
03166 #if defined(PNG_WRITE_zTXt_SUPPORTED)
03167 PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key,
03168 png_charp text, png_size_t text_len, int compression));
03169 #endif
03170
03171 #if defined(PNG_WRITE_iTXt_SUPPORTED)
03172 PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
03173 int compression, png_charp key, png_charp lang, png_charp lang_key,
03174 png_charp text));
03175 #endif
03176
03177 #if defined(PNG_TEXT_SUPPORTED)
03178 PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
03179 png_infop info_ptr, png_textp text_ptr, int num_text));
03180 #endif
03181
03182 #if defined(PNG_WRITE_oFFs_SUPPORTED)
03183 PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
03184 png_int_32 x_offset, png_int_32 y_offset, int unit_type));
03185 #endif
03186
03187 #if defined(PNG_WRITE_pCAL_SUPPORTED)
03188 PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
03189 png_int_32 X0, png_int_32 X1, int type, int nparams,
03190 png_charp units, png_charpp params));
03191 #endif
03192
03193 #if defined(PNG_WRITE_pHYs_SUPPORTED)
03194 PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
03195 png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
03196 int unit_type));
03197 #endif
03198
03199 #if defined(PNG_WRITE_tIME_SUPPORTED)
03200 PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
03201 png_timep mod_time));
03202 #endif
03203
03204 #if defined(PNG_WRITE_sCAL_SUPPORTED)
03205 #if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
03206 PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr,
03207 int unit, double width, double height));
03208 #else
03209 #ifdef PNG_FIXED_POINT_SUPPORTED
03210 PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
03211 int unit, png_charp width, png_charp height));
03212 #endif
03213 #endif
03214 #endif
03215
03216
03217 PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
03218
03219
03220 PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
03221
03222 #if defined(PNG_READ_GAMMA_SUPPORTED)
03223 PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr));
03224 #endif
03225
03226
03227 PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
03228 int mask));
03229
03230 #if defined(PNG_READ_INTERLACING_SUPPORTED)
03231
03232
03233
03234
03235
03236 PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
03237 #endif
03238
03239
03240
03241 #if defined(PNG_WRITE_INTERLACING_SUPPORTED)
03242
03243 PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
03244 png_bytep row, int pass));
03245 #endif
03246
03247
03248 PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
03249 png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter));
03250
03251
03252 PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
03253 png_row_infop row_info));
03254
03255
03256 PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
03257 png_bytep filtered_row));
03258
03259 PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
03260
03261
03262 PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
03263
03264 PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
03265 png_infop info_ptr));
03266
03267
03268 #if defined(PNG_READ_FILLER_SUPPORTED)
03269 PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
03270 png_bytep row, png_uint_32 filler, png_uint_32 flags));
03271 #endif
03272
03273 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
03274 PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
03275 png_bytep row));
03276 #endif
03277
03278 #if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
03279 PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
03280 png_bytep row));
03281 #endif
03282
03283 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
03284 PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
03285 png_bytep row));
03286 #endif
03287
03288 #if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
03289 PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
03290 png_bytep row));
03291 #endif
03292
03293 #if defined(PNG_WRITE_FILLER_SUPPORTED) || \
03294 defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
03295 PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
03296 png_bytep row, png_uint_32 flags));
03297 #endif
03298
03299 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
03300 PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row));
03301 #endif
03302
03303 #if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
03304 PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row));
03305 #endif
03306
03307 #if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
03308 PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop
03309 row_info, png_bytep row));
03310 #endif
03311
03312 #if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
03313 PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
03314 png_bytep row));
03315 #endif
03316
03317 #if defined(PNG_READ_PACK_SUPPORTED)
03318 PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row));
03319 #endif
03320
03321 #if defined(PNG_READ_SHIFT_SUPPORTED)
03322 PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row,
03323 png_color_8p sig_bits));
03324 #endif
03325
03326 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
03327 PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row));
03328 #endif
03329
03330 #if defined(PNG_READ_16_TO_8_SUPPORTED)
03331 PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row));
03332 #endif
03333
03334 #if defined(PNG_READ_DITHER_SUPPORTED)
03335 PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info,
03336 png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup));
03337
03338 # if defined(PNG_CORRECT_PALETTE_SUPPORTED)
03339 PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
03340 png_colorp palette, int num_palette));
03341 # endif
03342 #endif
03343
03344 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
03345 PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row));
03346 #endif
03347
03348 #if defined(PNG_WRITE_PACK_SUPPORTED)
03349 PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
03350 png_bytep row, png_uint_32 bit_depth));
03351 #endif
03352
03353 #if defined(PNG_WRITE_SHIFT_SUPPORTED)
03354 PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row,
03355 png_color_8p bit_depth));
03356 #endif
03357
03358 #if defined(PNG_READ_BACKGROUND_SUPPORTED)
03359 #if defined(PNG_READ_GAMMA_SUPPORTED)
03360 PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
03361 png_color_16p trans_values, png_color_16p background,
03362 png_color_16p background_1,
03363 png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
03364 png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
03365 png_uint_16pp gamma_16_to_1, int gamma_shift));
03366 #else
03367 PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
03368 png_color_16p trans_values, png_color_16p background));
03369 #endif
03370 #endif
03371
03372 #if defined(PNG_READ_GAMMA_SUPPORTED)
03373 PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row,
03374 png_bytep gamma_table, png_uint_16pp gamma_16_table,
03375 int gamma_shift));
03376 #endif
03377
03378 #if defined(PNG_READ_EXPAND_SUPPORTED)
03379 PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
03380 png_bytep row, png_colorp palette, png_bytep trans, int num_trans));
03381 PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
03382 png_bytep row, png_color_16p trans_value));
03383 #endif
03384
03385
03386
03387
03388
03389
03390 PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
03391 png_uint_32 length));
03392 PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
03393 png_uint_32 length));
03394 PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
03395 png_uint_32 length));
03396
03397 #if defined(PNG_READ_bKGD_SUPPORTED)
03398 PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
03399 png_uint_32 length));
03400 #endif
03401
03402 #if defined(PNG_READ_cHRM_SUPPORTED)
03403 PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
03404 png_uint_32 length));
03405 #endif
03406
03407 #if defined(PNG_READ_gAMA_SUPPORTED)
03408 PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
03409 png_uint_32 length));
03410 #endif
03411
03412 #if defined(PNG_READ_hIST_SUPPORTED)
03413 PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
03414 png_uint_32 length));
03415 #endif
03416
03417 #if defined(PNG_READ_iCCP_SUPPORTED)
03418 extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
03419 png_uint_32 length));
03420 #endif
03421
03422 #if defined(PNG_READ_iTXt_SUPPORTED)
03423 PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
03424 png_uint_32 length));
03425 #endif
03426
03427 #if defined(PNG_READ_oFFs_SUPPORTED)
03428 PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
03429 png_uint_32 length));
03430 #endif
03431
03432 #if defined(PNG_READ_pCAL_SUPPORTED)
03433 PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
03434 png_uint_32 length));
03435 #endif
03436
03437 #if defined(PNG_READ_pHYs_SUPPORTED)
03438 PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
03439 png_uint_32 length));
03440 #endif
03441
03442 #if defined(PNG_READ_sBIT_SUPPORTED)
03443 PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
03444 png_uint_32 length));
03445 #endif
03446
03447 #if defined(PNG_READ_sCAL_SUPPORTED)
03448 PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
03449 png_uint_32 length));
03450 #endif
03451
03452 #if defined(PNG_READ_sPLT_SUPPORTED)
03453 extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
03454 png_uint_32 length));
03455 #endif
03456
03457 #if defined(PNG_READ_sRGB_SUPPORTED)
03458 PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
03459 png_uint_32 length));
03460 #endif
03461
03462 #if defined(PNG_READ_tEXt_SUPPORTED)
03463 PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
03464 png_uint_32 length));
03465 #endif
03466
03467 #if defined(PNG_READ_tIME_SUPPORTED)
03468 PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
03469 png_uint_32 length));
03470 #endif
03471
03472 #if defined(PNG_READ_tRNS_SUPPORTED)
03473 PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
03474 png_uint_32 length));
03475 #endif
03476
03477 #if defined(PNG_READ_zTXt_SUPPORTED)
03478 PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
03479 png_uint_32 length));
03480 #endif
03481
03482 PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
03483 png_infop info_ptr, png_uint_32 length));
03484
03485 PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
03486 png_bytep chunk_name));
03487
03488
03489 PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
03490 PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
03491
03492 PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
03493
03494 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
03495 PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
03496 png_infop info_ptr));
03497 PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
03498 png_infop info_ptr));
03499 PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
03500 PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
03501 png_uint_32 length));
03502 PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
03503 PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
03504 PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
03505 png_bytep buffer, png_size_t buffer_length));
03506 PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
03507 PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
03508 png_bytep buffer, png_size_t buffer_length));
03509 PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
03510 PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
03511 png_infop info_ptr, png_uint_32 length));
03512 PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
03513 png_infop info_ptr));
03514 PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
03515 png_infop info_ptr));
03516 PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
03517 PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
03518 png_infop info_ptr));
03519 PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
03520 png_infop info_ptr));
03521 PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
03522 #if defined(PNG_READ_tEXt_SUPPORTED)
03523 PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
03524 png_infop info_ptr, png_uint_32 length));
03525 PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
03526 png_infop info_ptr));
03527 #endif
03528 #if defined(PNG_READ_zTXt_SUPPORTED)
03529 PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
03530 png_infop info_ptr, png_uint_32 length));
03531 PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
03532 png_infop info_ptr));
03533 #endif
03534 #if defined(PNG_READ_iTXt_SUPPORTED)
03535 PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
03536 png_infop info_ptr, png_uint_32 length));
03537 PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
03538 png_infop info_ptr));
03539 #endif
03540
03541 #endif
03542
03543 #ifdef PNG_MNG_FEATURES_SUPPORTED
03544 PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
03545 png_bytep row));
03546 PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
03547 png_bytep row));
03548 #endif
03549
03550 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
03551 #if defined(PNG_MMX_CODE_SUPPORTED)
03552
03553 PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr));
03554 #endif
03555 #endif
03556
03557 #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
03558 PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr,
03559 png_infop info_ptr));
03560
03561 PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr,
03562 png_infop info_ptr));
03563
03564 PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr,
03565 png_infop info_ptr));
03566
03567 PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr,
03568 png_infop info_ptr));
03569
03570 PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr,
03571 png_infop info_ptr));
03572
03573 #if defined(PNG_pHYs_SUPPORTED)
03574 PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr,
03575 png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
03576 #endif
03577 #endif
03578
03579
03580 PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
03581
03582
03583
03584 #endif
03585
03586 #ifdef __cplusplus
03587 }
03588 #endif
03589
03590 #endif
03591
03592 #endif