~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to frmts/png/libpng/png.h

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* png.h - header file for PNG reference library
2
2
 *
3
 
 * libpng version 1.2.35 - February 14, 2009
4
 
 * Copyright (c) 1998-2009 Glenn Randers-Pehrson
 
3
 * libpng version 1.2.46 - July 9, 2011
 
4
 * Copyright (c) 1998-2011 Glenn Randers-Pehrson
5
5
 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
6
6
 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
7
7
 *
 
8
 * This code is released under the libpng license (See LICENSE, below)
 
9
 *
8
10
 * Authors and maintainers:
9
11
 *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
10
12
 *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
11
 
 *  libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009: Glenn
 
13
 *  libpng versions 0.97, January 1998, through 1.2.46 - July 9, 2011: Glenn
12
14
 *  See also "Contributing Authors", below.
13
15
 *
14
16
 * Note about libpng version numbers:
222
224
 *    1.2.35rc01-02           13    10235  12.so.0.35[.0]
223
225
 *    1.0.43                  10    10043  10.so.0.43[.0]
224
226
 *    1.2.35                  13    10235  12.so.0.35[.0]
 
227
 *    1.2.36beta01-05         13    10236  12.so.0.36[.0]
 
228
 *    1.2.36rc01              13    10236  12.so.0.36[.0]
 
229
 *    1.0.44                  10    10044  10.so.0.44[.0]
 
230
 *    1.2.36                  13    10236  12.so.0.36[.0]
 
231
 *    1.2.37beta01-03         13    10237  12.so.0.37[.0]
 
232
 *    1.2.37rc01              13    10237  12.so.0.37[.0]
 
233
 *    1.2.37                  13    10237  12.so.0.37[.0]
 
234
 *    1.0.45                  10    10045  12.so.0.45[.0]
 
235
 *    1.0.46                  10    10046  10.so.0.46[.0]
 
236
 *    1.2.38beta01            13    10238  12.so.0.38[.0]
 
237
 *    1.2.38rc01-03           13    10238  12.so.0.38[.0]
 
238
 *    1.0.47                  10    10047  10.so.0.47[.0]
 
239
 *    1.2.38                  13    10238  12.so.0.38[.0]
 
240
 *    1.2.39beta01-05         13    10239  12.so.0.39[.0]
 
241
 *    1.2.39rc01              13    10239  12.so.0.39[.0]
 
242
 *    1.0.48                  10    10048  10.so.0.48[.0]
 
243
 *    1.2.39                  13    10239  12.so.0.39[.0]
 
244
 *    1.2.40beta01            13    10240  12.so.0.40[.0]
 
245
 *    1.2.40rc01              13    10240  12.so.0.40[.0]
 
246
 *    1.0.49                  10    10049  10.so.0.49[.0]
 
247
 *    1.2.40                  13    10240  12.so.0.40[.0]
 
248
 *    1.2.41beta01-18         13    10241  12.so.0.41[.0]
 
249
 *    1.0.51rc01              10    10051  10.so.0.51[.0]
 
250
 *    1.2.41rc01-03           13    10241  12.so.0.41[.0]
 
251
 *    1.0.51                  10    10051  10.so.0.51[.0]
 
252
 *    1.2.41                  13    10241  12.so.0.41[.0]
 
253
 *    1.2.42beta01-02         13    10242  12.so.0.42[.0]
 
254
 *    1.2.42rc01-05           13    10242  12.so.0.42[.0]
 
255
 *    1.0.52                  10    10052  10.so.0.52[.0]
 
256
 *    1.2.42                  13    10242  12.so.0.42[.0]
 
257
 *    1.2.43beta01-05         13    10243  12.so.0.43[.0]
 
258
 *    1.0.53rc01-02           10    10053  10.so.0.53[.0]
 
259
 *    1.2.43rc01-02           13    10243  12.so.0.43[.0]
 
260
 *    1.0.53                  10    10053  10.so.0.53[.0]
 
261
 *    1.2.43                  13    10243  12.so.0.43[.0]
 
262
 *    1.2.44beta01-03         13    10244  12.so.0.44[.0]
 
263
 *    1.2.44rc01-03           13    10244  12.so.0.44[.0]
 
264
 *    1.2.44                  13    10244  12.so.0.44[.0]
 
265
 *    1.2.45beta01-03         13    10245  12.so.0.45[.0]
 
266
 *    1.0.55rc01              10    10055  10.so.0.55[.0]
 
267
 *    1.2.45rc01              13    10245  12.so.0.45[.0]
 
268
 *    1.0.55                  10    10055  10.so.0.55[.0]
 
269
 *    1.2.45                  13    10245  12.so.0.45[.0]
 
270
 *    1.2.46rc01-02           13    10246  12.so.0.46[.0]
 
271
 *    1.0.56                  10    10056  10.so.0.56[.0]
 
272
 *    1.2.46                  13    10246  12.so.0.46[.0]
225
273
 *
226
274
 *    Henceforth the source version will match the shared-library major
227
275
 *    and minor numbers; the shared-library major version number will be
251
299
 * If you modify libpng you may insert additional notices immediately following
252
300
 * this sentence.
253
301
 *
254
 
 * libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are
255
 
 * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
 
302
 * This code is released under the libpng license.
 
303
 *
 
304
 * libpng versions 1.2.6, August 15, 2004, through 1.2.46, July 9, 2011, are
 
305
 * Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
256
306
 * distributed according to the same disclaimer and license as libpng-1.2.5
257
307
 * with the following individual added to the list of Contributing Authors:
258
308
 *
363
413
 * Y2K compliance in libpng:
364
414
 * =========================
365
415
 *
366
 
 *    February 14, 2009
 
416
 *    July 9, 2011
367
417
 *
368
418
 *    Since the PNG Development group is an ad-hoc body, we can't make
369
419
 *    an official declaration.
370
420
 *
371
421
 *    This is your unofficial assurance that libpng from version 0.71 and
372
 
 *    upward through 1.2.35 are Y2K compliant.  It is my belief that earlier
 
422
 *    upward through 1.2.46 are Y2K compliant.  It is my belief that earlier
373
423
 *    versions were also Y2K compliant.
374
424
 *
375
425
 *    Libpng only has three year fields.  One is a 2-byte unsigned integer
425
475
 */
426
476
 
427
477
/* Version information for png.h - this should match the version in png.c */
428
 
#define PNG_LIBPNG_VER_STRING "1.2.35"
 
478
#define PNG_LIBPNG_VER_STRING "1.2.46"
429
479
#define PNG_HEADER_VERSION_STRING \
430
 
   " libpng version 1.2.35 - February 14, 2009\n"
 
480
   " libpng version 1.2.46 - July 9, 2011\n"
431
481
 
432
482
#define PNG_LIBPNG_VER_SONUM   0
433
483
#define PNG_LIBPNG_VER_DLLNUM  13
435
485
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
436
486
#define PNG_LIBPNG_VER_MAJOR   1
437
487
#define PNG_LIBPNG_VER_MINOR   2
438
 
#define PNG_LIBPNG_VER_RELEASE 35
 
488
#define PNG_LIBPNG_VER_RELEASE 46
439
489
/* This should match the numeric part of the final component of
440
 
 * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
 
490
 * PNG_LIBPNG_VER_STRING, omitting any leading zero:
 
491
 */
441
492
 
442
493
#define PNG_LIBPNG_VER_BUILD  0
443
494
 
447
498
#define PNG_LIBPNG_BUILD_RC       3
448
499
#define PNG_LIBPNG_BUILD_STABLE   4
449
500
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
450
 
  
 
501
 
451
502
/* Release-Specific Flags */
452
503
#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with
453
504
                                       PNG_LIBPNG_BUILD_STABLE only */
462
513
 * We must not include leading zeros.
463
514
 * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
464
515
 * version 1.0.0 was mis-numbered 100 instead of 10000).  From
465
 
 * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release */
466
 
#define PNG_LIBPNG_VER 10235 /* 1.2.35 */
 
516
 * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
 
517
 */
 
518
#define PNG_LIBPNG_VER 10246 /* 1.2.46 */
467
519
 
468
520
#ifndef PNG_VERSION_INFO_ONLY
469
 
/* include the compression library's header */
 
521
/* Include the compression library's header */
470
522
#include "zlib.h"
471
523
#endif
472
524
 
473
 
/* include all user configurable info, including optional assembler routines */
 
525
/* Include all user configurable info, including optional assembler routines */
474
526
#include "pngconf.h"
475
527
 
476
528
/*
478
530
/* Ref MSDN: Private as priority over Special
479
531
 * VS_FF_PRIVATEBUILD File *was not* built using standard release
480
532
 * procedures. If this value is given, the StringFileInfo block must
481
 
 * contain a PrivateBuild string. 
 
533
 * contain a PrivateBuild string.
482
534
 *
483
535
 * VS_FF_SPECIALBUILD File *was* built by the original company using
484
536
 * standard release procedures but is a variation of the standard
485
537
 * file of the same version number. If this value is given, the
486
 
 * StringFileInfo block must contain a SpecialBuild string. 
 
538
 * StringFileInfo block must contain a SpecialBuild string.
487
539
 */
488
540
 
489
 
#if defined(PNG_USER_PRIVATEBUILD)
 
541
#ifdef PNG_USER_PRIVATEBUILD
490
542
#  define PNG_LIBPNG_BUILD_TYPE \
491
543
          (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
492
544
#else
493
 
#  if defined(PNG_LIBPNG_SPECIALBUILD)
 
545
#  ifdef PNG_LIBPNG_SPECIALBUILD
494
546
#    define PNG_LIBPNG_BUILD_TYPE \
495
547
            (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
496
548
#  else
545
597
#define png_write_status_ptr_NULL NULL
546
598
#endif
547
599
 
548
 
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
 
600
/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */
549
601
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
550
602
/* Version information for C files, stored in png.c.  This had better match
551
603
 * the version above.
552
604
 */
553
605
#ifdef PNG_USE_GLOBAL_ARRAYS
554
606
PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18];
555
 
  /* need room for 99.99.99beta99z */
 
607
  /* Need room for 99.99.99beta99z */
556
608
#else
557
609
#define png_libpng_ver png_get_header_ver(NULL)
558
610
#endif
671
723
#endif
672
724
 
673
725
/* Supported compression types for text in PNG files (tEXt, and zTXt).
674
 
 * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */
 
726
 * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed.
 
727
 */
675
728
#define PNG_TEXT_COMPRESSION_NONE_WR -3
676
729
#define PNG_TEXT_COMPRESSION_zTXt_WR -2
677
730
#define PNG_TEXT_COMPRESSION_NONE    -1
698
751
typedef png_time FAR * png_timep;
699
752
typedef png_time FAR * FAR * png_timepp;
700
753
 
701
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 
754
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
 
755
 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
702
756
/* png_unknown_chunk is a structure to hold queued chunks for which there is
703
757
 * no specific support.  The idea is that we can use this to queue
704
758
 * up private chunks for output even though the library doesn't actually
760
814
 */
761
815
typedef struct png_info_struct
762
816
{
763
 
   /* the following are necessary for every PNG file */
764
 
   png_uint_32 width;       /* width of image in pixels (from IHDR) */
765
 
   png_uint_32 height;      /* height of image in pixels (from IHDR) */
766
 
   png_uint_32 valid;       /* valid chunk data (see PNG_INFO_ below) */
767
 
   png_uint_32 rowbytes;    /* bytes needed to hold an untransformed row */
768
 
   png_colorp palette;      /* array of color values (valid & PNG_INFO_PLTE) */
769
 
   png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
770
 
   png_uint_16 num_trans;   /* number of transparent palette color (tRNS) */
771
 
   png_byte bit_depth;      /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */
772
 
   png_byte color_type;     /* see PNG_COLOR_TYPE_ below (from IHDR) */
 
817
   /* The following are necessary for every PNG file */
 
818
   png_uint_32 width PNG_DEPSTRUCT;       /* width of image in pixels (from IHDR) */
 
819
   png_uint_32 height PNG_DEPSTRUCT;      /* height of image in pixels (from IHDR) */
 
820
   png_uint_32 valid PNG_DEPSTRUCT;       /* valid chunk data (see PNG_INFO_ below) */
 
821
   png_uint_32 rowbytes PNG_DEPSTRUCT;    /* bytes needed to hold an untransformed row */
 
822
   png_colorp palette PNG_DEPSTRUCT;      /* array of color values (valid & PNG_INFO_PLTE) */
 
823
   png_uint_16 num_palette PNG_DEPSTRUCT; /* number of color entries in "palette" (PLTE) */
 
824
   png_uint_16 num_trans PNG_DEPSTRUCT;   /* number of transparent palette color (tRNS) */
 
825
   png_byte bit_depth PNG_DEPSTRUCT;      /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */
 
826
   png_byte color_type PNG_DEPSTRUCT;     /* see PNG_COLOR_TYPE_ below (from IHDR) */
773
827
   /* The following three should have been named *_method not *_type */
774
 
   png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
775
 
   png_byte filter_type;    /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
776
 
   png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 
828
   png_byte compression_type PNG_DEPSTRUCT; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
 
829
   png_byte filter_type PNG_DEPSTRUCT;    /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
 
830
   png_byte interlace_type PNG_DEPSTRUCT; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
777
831
 
778
832
   /* The following is informational only on read, and not used on writes. */
779
 
   png_byte channels;       /* number of data channels per pixel (1, 2, 3, 4) */
780
 
   png_byte pixel_depth;    /* number of bits per pixel */
781
 
   png_byte spare_byte;     /* to align the data, and for future use */
782
 
   png_byte signature[8];   /* magic bytes read by libpng from start of file */
 
833
   png_byte channels PNG_DEPSTRUCT;       /* number of data channels per pixel (1, 2, 3, 4) */
 
834
   png_byte pixel_depth PNG_DEPSTRUCT;    /* number of bits per pixel */
 
835
   png_byte spare_byte PNG_DEPSTRUCT;     /* to align the data, and for future use */
 
836
   png_byte signature[8] PNG_DEPSTRUCT;   /* magic bytes read by libpng from start of file */
783
837
 
784
838
   /* The rest of the data is optional.  If you are reading, check the
785
839
    * valid field to see if the information in these are valid.  If you
792
846
    * on which the image was created, normally in the range [1.0, 2.5].
793
847
    * Data is valid if (valid & PNG_INFO_gAMA) is non-zero.
794
848
    */
795
 
   float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */
 
849
   float gamma PNG_DEPSTRUCT; /* gamma value of image, if (valid & PNG_INFO_gAMA) */
796
850
#endif
797
851
 
798
 
#if defined(PNG_sRGB_SUPPORTED)
 
852
#ifdef PNG_sRGB_SUPPORTED
799
853
    /* GR-P, 0.96a */
800
854
    /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */
801
 
   png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */
 
855
   png_byte srgb_intent PNG_DEPSTRUCT; /* sRGB rendering intent [0, 1, 2, or 3] */
802
856
#endif
803
857
 
804
 
#if defined(PNG_TEXT_SUPPORTED)
 
858
#ifdef PNG_TEXT_SUPPORTED
805
859
   /* The tEXt, and zTXt chunks contain human-readable textual data in
806
860
    * uncompressed, compressed, and optionally compressed forms, respectively.
807
861
    * The data in "text" is an array of pointers to uncompressed,
810
864
    * unique, and the text string may be empty.  Any number of text chunks may
811
865
    * be in an image.
812
866
    */
813
 
   int num_text; /* number of comments read/to write */
814
 
   int max_text; /* current size of text array */
815
 
   png_textp text; /* array of comments read/to write */
 
867
   int num_text PNG_DEPSTRUCT; /* number of comments read/to write */
 
868
   int max_text PNG_DEPSTRUCT; /* current size of text array */
 
869
   png_textp text PNG_DEPSTRUCT; /* array of comments read/to write */
816
870
#endif /* PNG_TEXT_SUPPORTED */
817
871
 
818
 
#if defined(PNG_tIME_SUPPORTED)
 
872
#ifdef PNG_tIME_SUPPORTED
819
873
   /* The tIME chunk holds the last time the displayed image data was
820
874
    * modified.  See the png_time struct for the contents of this struct.
821
875
    */
822
 
   png_time mod_time;
 
876
   png_time mod_time PNG_DEPSTRUCT;
823
877
#endif
824
878
 
825
 
#if defined(PNG_sBIT_SUPPORTED)
 
879
#ifdef PNG_sBIT_SUPPORTED
826
880
   /* The sBIT chunk specifies the number of significant high-order bits
827
881
    * in the pixel data.  Values are in the range [1, bit_depth], and are
828
882
    * only specified for the channels in the pixel data.  The contents of
829
883
    * the low-order bits is not specified.  Data is valid if
830
884
    * (valid & PNG_INFO_sBIT) is non-zero.
831
885
    */
832
 
   png_color_8 sig_bit; /* significant bits in color channels */
 
886
   png_color_8 sig_bit PNG_DEPSTRUCT; /* significant bits in color channels */
833
887
#endif
834
888
 
835
889
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \
843
897
    * single color specified that should be treated as fully transparent.
844
898
    * Data is valid if (valid & PNG_INFO_tRNS) is non-zero.
845
899
    */
846
 
   png_bytep trans; /* transparent values for paletted image */
847
 
   png_color_16 trans_values; /* transparent color for non-palette image */
 
900
   png_bytep trans PNG_DEPSTRUCT; /* transparent values for paletted image */
 
901
   png_color_16 trans_values PNG_DEPSTRUCT; /* transparent color for non-palette image */
848
902
#endif
849
903
 
850
904
#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
854
908
    * in "background" are normally in the same color space/depth as the
855
909
    * pixel data.  Data is valid if (valid & PNG_INFO_bKGD) is non-zero.
856
910
    */
857
 
   png_color_16 background;
 
911
   png_color_16 background PNG_DEPSTRUCT;
858
912
#endif
859
913
 
860
 
#if defined(PNG_oFFs_SUPPORTED)
 
914
#ifdef PNG_oFFs_SUPPORTED
861
915
   /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards
862
916
    * and downwards from the top-left corner of the display, page, or other
863
917
    * application-specific co-ordinate space.  See the PNG_OFFSET_ defines
864
918
    * below for the unit types.  Valid if (valid & PNG_INFO_oFFs) non-zero.
865
919
    */
866
 
   png_int_32 x_offset; /* x offset on page */
867
 
   png_int_32 y_offset; /* y offset on page */
868
 
   png_byte offset_unit_type; /* offset units type */
 
920
   png_int_32 x_offset PNG_DEPSTRUCT; /* x offset on page */
 
921
   png_int_32 y_offset PNG_DEPSTRUCT; /* y offset on page */
 
922
   png_byte offset_unit_type PNG_DEPSTRUCT; /* offset units type */
869
923
#endif
870
924
 
871
 
#if defined(PNG_pHYs_SUPPORTED)
 
925
#ifdef PNG_pHYs_SUPPORTED
872
926
   /* The pHYs chunk gives the physical pixel density of the image for
873
927
    * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_
874
928
    * defines below).  Data is valid if (valid & PNG_INFO_pHYs) is non-zero.
875
929
    */
876
 
   png_uint_32 x_pixels_per_unit; /* horizontal pixel density */
877
 
   png_uint_32 y_pixels_per_unit; /* vertical pixel density */
878
 
   png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
 
930
   png_uint_32 x_pixels_per_unit PNG_DEPSTRUCT; /* horizontal pixel density */
 
931
   png_uint_32 y_pixels_per_unit PNG_DEPSTRUCT; /* vertical pixel density */
 
932
   png_byte phys_unit_type PNG_DEPSTRUCT; /* resolution type (see PNG_RESOLUTION_ below) */
879
933
#endif
880
934
 
881
 
#if defined(PNG_hIST_SUPPORTED)
 
935
#ifdef PNG_hIST_SUPPORTED
882
936
   /* The hIST chunk contains the relative frequency or importance of the
883
937
    * various palette entries, so that a viewer can intelligently select a
884
938
    * reduced-color palette, if required.  Data is an array of "num_palette"
885
939
    * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST)
886
940
    * is non-zero.
887
941
    */
888
 
   png_uint_16p hist;
 
942
   png_uint_16p hist PNG_DEPSTRUCT;
889
943
#endif
890
944
 
891
945
#ifdef PNG_cHRM_SUPPORTED
896
950
    * [0.0, 0.8].  Data valid if (valid & PNG_INFO_cHRM) non-zero.
897
951
    */
898
952
#ifdef PNG_FLOATING_POINT_SUPPORTED
899
 
   float x_white;
900
 
   float y_white;
901
 
   float x_red;
902
 
   float y_red;
903
 
   float x_green;
904
 
   float y_green;
905
 
   float x_blue;
906
 
   float y_blue;
 
953
   float x_white PNG_DEPSTRUCT;
 
954
   float y_white PNG_DEPSTRUCT;
 
955
   float x_red PNG_DEPSTRUCT;
 
956
   float y_red PNG_DEPSTRUCT;
 
957
   float x_green PNG_DEPSTRUCT;
 
958
   float y_green PNG_DEPSTRUCT;
 
959
   float x_blue PNG_DEPSTRUCT;
 
960
   float y_blue PNG_DEPSTRUCT;
907
961
#endif
908
962
#endif
909
963
 
910
 
#if defined(PNG_pCAL_SUPPORTED)
 
964
#ifdef PNG_pCAL_SUPPORTED
911
965
   /* The pCAL chunk describes a transformation between the stored pixel
912
966
    * values and original physical data values used to create the image.
913
967
    * The integer range [0, 2^bit_depth - 1] maps to the floating-point
919
973
    * implemented, and for a description of the ASCII parameter strings.
920
974
    * Data values are valid if (valid & PNG_INFO_pCAL) non-zero.
921
975
    */
922
 
   png_charp pcal_purpose;  /* pCAL chunk description string */
923
 
   png_int_32 pcal_X0;      /* minimum value */
924
 
   png_int_32 pcal_X1;      /* maximum value */
925
 
   png_charp pcal_units;    /* Latin-1 string giving physical units */
926
 
   png_charpp pcal_params;  /* ASCII strings containing parameter values */
927
 
   png_byte pcal_type;      /* equation type (see PNG_EQUATION_ below) */
928
 
   png_byte pcal_nparams;   /* number of parameters given in pcal_params */
 
976
   png_charp pcal_purpose PNG_DEPSTRUCT;  /* pCAL chunk description string */
 
977
   png_int_32 pcal_X0 PNG_DEPSTRUCT;      /* minimum value */
 
978
   png_int_32 pcal_X1 PNG_DEPSTRUCT;      /* maximum value */
 
979
   png_charp pcal_units PNG_DEPSTRUCT;    /* Latin-1 string giving physical units */
 
980
   png_charpp pcal_params PNG_DEPSTRUCT;  /* ASCII strings containing parameter values */
 
981
   png_byte pcal_type PNG_DEPSTRUCT;      /* equation type (see PNG_EQUATION_ below) */
 
982
   png_byte pcal_nparams PNG_DEPSTRUCT;   /* number of parameters given in pcal_params */
929
983
#endif
930
984
 
931
985
/* New members added in libpng-1.0.6 */
932
986
#ifdef PNG_FREE_ME_SUPPORTED
933
 
   png_uint_32 free_me;     /* flags items libpng is responsible for freeing */
934
 
#endif
935
 
 
936
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
937
 
   /* storage for unknown chunks that the library doesn't recognize. */
938
 
   png_unknown_chunkp unknown_chunks;
939
 
   png_size_t unknown_chunks_num;
940
 
#endif
941
 
 
942
 
#if defined(PNG_iCCP_SUPPORTED)
 
987
   png_uint_32 free_me PNG_DEPSTRUCT;     /* flags items libpng is responsible for freeing */
 
988
#endif
 
989
 
 
990
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
 
991
 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
 
992
   /* Storage for unknown chunks that the library doesn't recognize. */
 
993
   png_unknown_chunkp unknown_chunks PNG_DEPSTRUCT;
 
994
   png_size_t unknown_chunks_num PNG_DEPSTRUCT;
 
995
#endif
 
996
 
 
997
#ifdef PNG_iCCP_SUPPORTED
943
998
   /* iCCP chunk data. */
944
 
   png_charp iccp_name;     /* profile name */
945
 
   png_charp iccp_profile;  /* International Color Consortium profile data */
 
999
   png_charp iccp_name PNG_DEPSTRUCT;     /* profile name */
 
1000
   png_charp iccp_profile PNG_DEPSTRUCT;  /* International Color Consortium profile data */
946
1001
                            /* Note to maintainer: should be png_bytep */
947
 
   png_uint_32 iccp_proflen;  /* ICC profile data length */
948
 
   png_byte iccp_compression; /* Always zero */
949
 
#endif
950
 
 
951
 
#if defined(PNG_sPLT_SUPPORTED)
952
 
   /* data on sPLT chunks (there may be more than one). */
953
 
   png_sPLT_tp splt_palettes;
954
 
   png_uint_32 splt_palettes_num;
955
 
#endif
956
 
 
957
 
#if defined(PNG_sCAL_SUPPORTED)
 
1002
   png_uint_32 iccp_proflen PNG_DEPSTRUCT;  /* ICC profile data length */
 
1003
   png_byte iccp_compression PNG_DEPSTRUCT; /* Always zero */
 
1004
#endif
 
1005
 
 
1006
#ifdef PNG_sPLT_SUPPORTED
 
1007
   /* Data on sPLT chunks (there may be more than one). */
 
1008
   png_sPLT_tp splt_palettes PNG_DEPSTRUCT;
 
1009
   png_uint_32 splt_palettes_num PNG_DEPSTRUCT;
 
1010
#endif
 
1011
 
 
1012
#ifdef PNG_sCAL_SUPPORTED
958
1013
   /* The sCAL chunk describes the actual physical dimensions of the
959
1014
    * subject matter of the graphic.  The chunk contains a unit specification
960
1015
    * a byte value, and two ASCII strings representing floating-point
962
1017
    * in the image.  This external representation is converted to double
963
1018
    * here.  Data values are valid if (valid & PNG_INFO_sCAL) is non-zero.
964
1019
    */
965
 
   png_byte scal_unit;         /* unit of physical scale */
 
1020
   png_byte scal_unit PNG_DEPSTRUCT;         /* unit of physical scale */
966
1021
#ifdef PNG_FLOATING_POINT_SUPPORTED
967
 
   double scal_pixel_width;    /* width of one pixel */
968
 
   double scal_pixel_height;   /* height of one pixel */
 
1022
   double scal_pixel_width PNG_DEPSTRUCT;    /* width of one pixel */
 
1023
   double scal_pixel_height PNG_DEPSTRUCT;   /* height of one pixel */
969
1024
#endif
970
1025
#ifdef PNG_FIXED_POINT_SUPPORTED
971
 
   png_charp scal_s_width;     /* string containing height */
972
 
   png_charp scal_s_height;    /* string containing width */
 
1026
   png_charp scal_s_width PNG_DEPSTRUCT;     /* string containing height */
 
1027
   png_charp scal_s_height PNG_DEPSTRUCT;    /* string containing width */
973
1028
#endif
974
1029
#endif
975
1030
 
976
 
#if defined(PNG_INFO_IMAGE_SUPPORTED)
 
1031
#ifdef PNG_INFO_IMAGE_SUPPORTED
977
1032
   /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */
978
1033
   /* Data valid if (valid & PNG_INFO_IDAT) non-zero */
979
 
   png_bytepp row_pointers;        /* the image bits */
 
1034
   png_bytepp row_pointers PNG_DEPSTRUCT;        /* the image bits */
980
1035
#endif
981
1036
 
982
1037
#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED)
983
 
   png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */
 
1038
   png_fixed_point int_gamma PNG_DEPSTRUCT; /* gamma of image, if (valid & PNG_INFO_gAMA) */
984
1039
#endif
985
1040
 
986
1041
#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED)
987
 
   png_fixed_point int_x_white;
988
 
   png_fixed_point int_y_white;
989
 
   png_fixed_point int_x_red;
990
 
   png_fixed_point int_y_red;
991
 
   png_fixed_point int_x_green;
992
 
   png_fixed_point int_y_green;
993
 
   png_fixed_point int_x_blue;
994
 
   png_fixed_point int_y_blue;
 
1042
   png_fixed_point int_x_white PNG_DEPSTRUCT;
 
1043
   png_fixed_point int_y_white PNG_DEPSTRUCT;
 
1044
   png_fixed_point int_x_red PNG_DEPSTRUCT;
 
1045
   png_fixed_point int_y_red PNG_DEPSTRUCT;
 
1046
   png_fixed_point int_x_green PNG_DEPSTRUCT;
 
1047
   png_fixed_point int_y_green PNG_DEPSTRUCT;
 
1048
   png_fixed_point int_x_blue PNG_DEPSTRUCT;
 
1049
   png_fixed_point int_y_blue PNG_DEPSTRUCT;
995
1050
#endif
996
1051
 
997
1052
} png_info;
1144
1199
    png_row_infop, png_bytep));
1145
1200
#endif
1146
1201
 
1147
 
#if defined(PNG_USER_CHUNKS_SUPPORTED)
 
1202
#ifdef PNG_USER_CHUNKS_SUPPORTED
1148
1203
typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp));
1149
1204
#endif
1150
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 
1205
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
1151
1206
typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp));
1152
1207
#endif
1153
1208
 
1164
1219
#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */
1165
1220
#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */
1166
1221
#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */
1167
 
#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* WRITE only, deprecated */
 
1222
#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only, deprecated */
1168
1223
/* Added to libpng-1.2.34 */
1169
 
#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800  /* WRITE only */
1170
 
#define PNG_TRANSFORM_STRIP_FILLER_AFTER  0x1000  /* WRITE only */
 
1224
#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800  /* write only */
 
1225
#define PNG_TRANSFORM_STRIP_FILLER_AFTER  0x1000  /* write only */
 
1226
/* Added to libpng-1.2.41 */
 
1227
#define PNG_TRANSFORM_GRAY_TO_RGB   0x2000      /* read only */
1171
1228
 
1172
1229
/* Flags for MNG supported features */
1173
1230
#define PNG_FLAG_MNG_EMPTY_PLTE     0x01
1189
1246
#ifdef PNG_SETJMP_SUPPORTED
1190
1247
   jmp_buf jmpbuf;            /* used in png_error */
1191
1248
#endif
1192
 
   png_error_ptr error_fn;    /* function for printing errors and aborting */
1193
 
   png_error_ptr warning_fn;  /* function for printing warnings */
1194
 
   png_voidp error_ptr;       /* user supplied struct for error functions */
1195
 
   png_rw_ptr write_data_fn;  /* function for writing output data */
1196
 
   png_rw_ptr read_data_fn;   /* function for reading input data */
1197
 
   png_voidp io_ptr;          /* ptr to application struct for I/O functions */
 
1249
   png_error_ptr error_fn PNG_DEPSTRUCT;    /* function for printing errors and aborting */
 
1250
   png_error_ptr warning_fn PNG_DEPSTRUCT;  /* function for printing warnings */
 
1251
   png_voidp error_ptr PNG_DEPSTRUCT;       /* user supplied struct for error functions */
 
1252
   png_rw_ptr write_data_fn PNG_DEPSTRUCT;  /* function for writing output data */
 
1253
   png_rw_ptr read_data_fn PNG_DEPSTRUCT;   /* function for reading input data */
 
1254
   png_voidp io_ptr PNG_DEPSTRUCT;          /* ptr to application struct for I/O functions */
1198
1255
 
1199
 
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
1200
 
   png_user_transform_ptr read_user_transform_fn; /* user read transform */
 
1256
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
 
1257
   png_user_transform_ptr read_user_transform_fn PNG_DEPSTRUCT; /* user read transform */
1201
1258
#endif
1202
1259
 
1203
 
#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
1204
 
   png_user_transform_ptr write_user_transform_fn; /* user write transform */
 
1260
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
 
1261
   png_user_transform_ptr write_user_transform_fn PNG_DEPSTRUCT; /* user write transform */
1205
1262
#endif
1206
1263
 
1207
1264
/* These were added in libpng-1.0.2 */
1208
 
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
 
1265
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
1209
1266
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
1210
1267
    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
1211
 
   png_voidp user_transform_ptr; /* user supplied struct for user transform */
1212
 
   png_byte user_transform_depth;    /* bit depth of user transformed pixels */
1213
 
   png_byte user_transform_channels; /* channels in user transformed pixels */
1214
 
#endif
1215
 
#endif
1216
 
 
1217
 
   png_uint_32 mode;          /* tells us where we are in the PNG file */
1218
 
   png_uint_32 flags;         /* flags indicating various things to libpng */
1219
 
   png_uint_32 transformations; /* which transformations to perform */
1220
 
 
1221
 
   z_stream zstream;          /* pointer to decompression structure (below) */
1222
 
   png_bytep zbuf;            /* buffer for zlib */
1223
 
   png_size_t zbuf_size;      /* size of zbuf */
1224
 
   int zlib_level;            /* holds zlib compression level */
1225
 
   int zlib_method;           /* holds zlib compression method */
1226
 
   int zlib_window_bits;      /* holds zlib compression window bits */
1227
 
   int zlib_mem_level;        /* holds zlib compression memory level */
1228
 
   int zlib_strategy;         /* holds zlib compression strategy */
1229
 
 
1230
 
   png_uint_32 width;         /* width of image in pixels */
1231
 
   png_uint_32 height;        /* height of image in pixels */
1232
 
   png_uint_32 num_rows;      /* number of rows in current pass */
1233
 
   png_uint_32 usr_width;     /* width of row at start of write */
1234
 
   png_uint_32 rowbytes;      /* size of row in bytes */
1235
 
   png_uint_32 irowbytes;     /* size of current interlaced row in bytes */
1236
 
   png_uint_32 iwidth;        /* width of current interlaced row in pixels */
1237
 
   png_uint_32 row_number;    /* current row in interlace pass */
1238
 
   png_bytep prev_row;        /* buffer to save previous (unfiltered) row */
1239
 
   png_bytep row_buf;         /* buffer to save current (unfiltered) row */
 
1268
   png_voidp user_transform_ptr PNG_DEPSTRUCT; /* user supplied struct for user transform */
 
1269
   png_byte user_transform_depth PNG_DEPSTRUCT;    /* bit depth of user transformed pixels */
 
1270
   png_byte user_transform_channels PNG_DEPSTRUCT; /* channels in user transformed pixels */
 
1271
#endif
 
1272
#endif
 
1273
 
 
1274
   png_uint_32 mode PNG_DEPSTRUCT;          /* tells us where we are in the PNG file */
 
1275
   png_uint_32 flags PNG_DEPSTRUCT;         /* flags indicating various things to libpng */
 
1276
   png_uint_32 transformations PNG_DEPSTRUCT; /* which transformations to perform */
 
1277
 
 
1278
   z_stream zstream PNG_DEPSTRUCT;          /* pointer to decompression structure (below) */
 
1279
   png_bytep zbuf PNG_DEPSTRUCT;            /* buffer for zlib */
 
1280
   png_size_t zbuf_size PNG_DEPSTRUCT;      /* size of zbuf */
 
1281
   int zlib_level PNG_DEPSTRUCT;            /* holds zlib compression level */
 
1282
   int zlib_method PNG_DEPSTRUCT;           /* holds zlib compression method */
 
1283
   int zlib_window_bits PNG_DEPSTRUCT;      /* holds zlib compression window bits */
 
1284
   int zlib_mem_level PNG_DEPSTRUCT;        /* holds zlib compression memory level */
 
1285
   int zlib_strategy PNG_DEPSTRUCT;         /* holds zlib compression strategy */
 
1286
 
 
1287
   png_uint_32 width PNG_DEPSTRUCT;         /* width of image in pixels */
 
1288
   png_uint_32 height PNG_DEPSTRUCT;        /* height of image in pixels */
 
1289
   png_uint_32 num_rows PNG_DEPSTRUCT;      /* number of rows in current pass */
 
1290
   png_uint_32 usr_width PNG_DEPSTRUCT;     /* width of row at start of write */
 
1291
   png_uint_32 rowbytes PNG_DEPSTRUCT;      /* size of row in bytes */
 
1292
#if 0 /* Replaced with the following in libpng-1.2.43 */
 
1293
   png_size_t irowbytes PNG_DEPSTRUCT;
 
1294
#endif
 
1295
/* Added in libpng-1.2.43 */
 
1296
#ifdef PNG_USER_LIMITS_SUPPORTED
 
1297
   /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown
 
1298
    * chunks that can be stored (0 means unlimited).
 
1299
    */
 
1300
   png_uint_32 user_chunk_cache_max PNG_DEPSTRUCT;
 
1301
#endif
 
1302
   png_uint_32 iwidth PNG_DEPSTRUCT;        /* width of current interlaced row in pixels */
 
1303
   png_uint_32 row_number PNG_DEPSTRUCT;    /* current row in interlace pass */
 
1304
   png_bytep prev_row PNG_DEPSTRUCT;        /* buffer to save previous (unfiltered) row */
 
1305
   png_bytep row_buf PNG_DEPSTRUCT;         /* buffer to save current (unfiltered) row */
1240
1306
#ifndef PNG_NO_WRITE_FILTER
1241
 
   png_bytep sub_row;         /* buffer to save "sub" row when filtering */
1242
 
   png_bytep up_row;          /* buffer to save "up" row when filtering */
1243
 
   png_bytep avg_row;         /* buffer to save "avg" row when filtering */
1244
 
   png_bytep paeth_row;       /* buffer to save "Paeth" row when filtering */
 
1307
   png_bytep sub_row PNG_DEPSTRUCT;         /* buffer to save "sub" row when filtering */
 
1308
   png_bytep up_row PNG_DEPSTRUCT;          /* buffer to save "up" row when filtering */
 
1309
   png_bytep avg_row PNG_DEPSTRUCT;         /* buffer to save "avg" row when filtering */
 
1310
   png_bytep paeth_row PNG_DEPSTRUCT;       /* buffer to save "Paeth" row when filtering */
1245
1311
#endif
1246
 
   png_row_info row_info;     /* used for transformation routines */
 
1312
   png_row_info row_info PNG_DEPSTRUCT;     /* used for transformation routines */
1247
1313
 
1248
 
   png_uint_32 idat_size;     /* current IDAT size for read */
1249
 
   png_uint_32 crc;           /* current chunk CRC value */
1250
 
   png_colorp palette;        /* palette from the input file */
1251
 
   png_uint_16 num_palette;   /* number of color entries in palette */
1252
 
   png_uint_16 num_trans;     /* number of transparency values */
1253
 
   png_byte chunk_name[5];    /* null-terminated name of current chunk */
1254
 
   png_byte compression;      /* file compression type (always 0) */
1255
 
   png_byte filter;           /* file filter type (always 0) */
1256
 
   png_byte interlaced;       /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
1257
 
   png_byte pass;             /* current interlace pass (0 - 6) */
1258
 
   png_byte do_filter;        /* row filter flags (see PNG_FILTER_ below ) */
1259
 
   png_byte color_type;       /* color type of file */
1260
 
   png_byte bit_depth;        /* bit depth of file */
1261
 
   png_byte usr_bit_depth;    /* bit depth of users row */
1262
 
   png_byte pixel_depth;      /* number of bits per pixel */
1263
 
   png_byte channels;         /* number of channels in file */
1264
 
   png_byte usr_channels;     /* channels at start of write */
1265
 
   png_byte sig_bytes;        /* magic bytes read/written from start of file */
 
1314
   png_uint_32 idat_size PNG_DEPSTRUCT;     /* current IDAT size for read */
 
1315
   png_uint_32 crc PNG_DEPSTRUCT;           /* current chunk CRC value */
 
1316
   png_colorp palette PNG_DEPSTRUCT;        /* palette from the input file */
 
1317
   png_uint_16 num_palette PNG_DEPSTRUCT;   /* number of color entries in palette */
 
1318
   png_uint_16 num_trans PNG_DEPSTRUCT;     /* number of transparency values */
 
1319
   png_byte chunk_name[5] PNG_DEPSTRUCT;    /* null-terminated name of current chunk */
 
1320
   png_byte compression PNG_DEPSTRUCT;      /* file compression type (always 0) */
 
1321
   png_byte filter PNG_DEPSTRUCT;           /* file filter type (always 0) */
 
1322
   png_byte interlaced PNG_DEPSTRUCT;       /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 
1323
   png_byte pass PNG_DEPSTRUCT;             /* current interlace pass (0 - 6) */
 
1324
   png_byte do_filter PNG_DEPSTRUCT;        /* row filter flags (see PNG_FILTER_ below ) */
 
1325
   png_byte color_type PNG_DEPSTRUCT;       /* color type of file */
 
1326
   png_byte bit_depth PNG_DEPSTRUCT;        /* bit depth of file */
 
1327
   png_byte usr_bit_depth PNG_DEPSTRUCT;    /* bit depth of users row */
 
1328
   png_byte pixel_depth PNG_DEPSTRUCT;      /* number of bits per pixel */
 
1329
   png_byte channels PNG_DEPSTRUCT;         /* number of channels in file */
 
1330
   png_byte usr_channels PNG_DEPSTRUCT;     /* channels at start of write */
 
1331
   png_byte sig_bytes PNG_DEPSTRUCT;        /* magic bytes read/written from start of file */
1266
1332
 
1267
1333
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
1268
1334
#ifdef PNG_LEGACY_SUPPORTED
1269
 
   png_byte filler;           /* filler byte for pixel expansion */
 
1335
   png_byte filler PNG_DEPSTRUCT;           /* filler byte for pixel expansion */
1270
1336
#else
1271
 
   png_uint_16 filler;           /* filler bytes for pixel expansion */
 
1337
   png_uint_16 filler PNG_DEPSTRUCT;           /* filler bytes for pixel expansion */
1272
1338
#endif
1273
1339
#endif
1274
1340
 
1275
 
#if defined(PNG_bKGD_SUPPORTED)
1276
 
   png_byte background_gamma_type;
 
1341
#ifdef PNG_bKGD_SUPPORTED
 
1342
   png_byte background_gamma_type PNG_DEPSTRUCT;
1277
1343
#  ifdef PNG_FLOATING_POINT_SUPPORTED
1278
 
   float background_gamma;
 
1344
   float background_gamma PNG_DEPSTRUCT;
1279
1345
#  endif
1280
 
   png_color_16 background;   /* background color in screen gamma space */
1281
 
#if defined(PNG_READ_GAMMA_SUPPORTED)
1282
 
   png_color_16 background_1; /* background normalized to gamma 1.0 */
 
1346
   png_color_16 background PNG_DEPSTRUCT;   /* background color in screen gamma space */
 
1347
#ifdef PNG_READ_GAMMA_SUPPORTED
 
1348
   png_color_16 background_1 PNG_DEPSTRUCT; /* background normalized to gamma 1.0 */
1283
1349
#endif
1284
1350
#endif /* PNG_bKGD_SUPPORTED */
1285
1351
 
1286
 
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
1287
 
   png_flush_ptr output_flush_fn;/* Function for flushing output */
1288
 
   png_uint_32 flush_dist;    /* how many rows apart to flush, 0 - no flush */
1289
 
   png_uint_32 flush_rows;    /* number of rows written since last flush */
 
1352
#ifdef PNG_WRITE_FLUSH_SUPPORTED
 
1353
   png_flush_ptr output_flush_fn PNG_DEPSTRUCT; /* Function for flushing output */
 
1354
   png_uint_32 flush_dist PNG_DEPSTRUCT;    /* how many rows apart to flush, 0 - no flush */
 
1355
   png_uint_32 flush_rows PNG_DEPSTRUCT;    /* number of rows written since last flush */
1290
1356
#endif
1291
1357
 
1292
1358
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
1293
 
   int gamma_shift;      /* number of "insignificant" bits 16-bit gamma */
 
1359
   int gamma_shift PNG_DEPSTRUCT;      /* number of "insignificant" bits 16-bit gamma */
1294
1360
#ifdef PNG_FLOATING_POINT_SUPPORTED
1295
 
   float gamma;          /* file gamma value */
1296
 
   float screen_gamma;   /* screen gamma value (display_exponent) */
 
1361
   float gamma PNG_DEPSTRUCT;          /* file gamma value */
 
1362
   float screen_gamma PNG_DEPSTRUCT;   /* screen gamma value (display_exponent) */
1297
1363
#endif
1298
1364
#endif
1299
1365
 
1300
1366
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
1301
 
   png_bytep gamma_table;     /* gamma table for 8-bit depth files */
1302
 
   png_bytep gamma_from_1;    /* converts from 1.0 to screen */
1303
 
   png_bytep gamma_to_1;      /* converts from file to 1.0 */
1304
 
   png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
1305
 
   png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
1306
 
   png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
 
1367
   png_bytep gamma_table PNG_DEPSTRUCT;     /* gamma table for 8-bit depth files */
 
1368
   png_bytep gamma_from_1 PNG_DEPSTRUCT;    /* converts from 1.0 to screen */
 
1369
   png_bytep gamma_to_1 PNG_DEPSTRUCT;      /* converts from file to 1.0 */
 
1370
   png_uint_16pp gamma_16_table PNG_DEPSTRUCT; /* gamma table for 16-bit depth files */
 
1371
   png_uint_16pp gamma_16_from_1 PNG_DEPSTRUCT; /* converts from 1.0 to screen */
 
1372
   png_uint_16pp gamma_16_to_1 PNG_DEPSTRUCT; /* converts from file to 1.0 */
1307
1373
#endif
1308
1374
 
1309
1375
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
1310
 
   png_color_8 sig_bit;       /* significant bits in each available channel */
 
1376
   png_color_8 sig_bit PNG_DEPSTRUCT;       /* significant bits in each available channel */
1311
1377
#endif
1312
1378
 
1313
1379
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
1314
 
   png_color_8 shift;         /* shift for significant bit tranformation */
 
1380
   png_color_8 shift PNG_DEPSTRUCT;         /* shift for significant bit tranformation */
1315
1381
#endif
1316
1382
 
1317
1383
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
1318
1384
 || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
1319
 
   png_bytep trans;           /* transparency values for paletted files */
1320
 
   png_color_16 trans_values; /* transparency values for non-paletted files */
 
1385
   png_bytep trans PNG_DEPSTRUCT;           /* transparency values for paletted files */
 
1386
   png_color_16 trans_values PNG_DEPSTRUCT; /* transparency values for non-paletted files */
1321
1387
#endif
1322
1388
 
1323
 
   png_read_status_ptr read_row_fn;   /* called after each row is decoded */
1324
 
   png_write_status_ptr write_row_fn; /* called after each row is encoded */
 
1389
   png_read_status_ptr read_row_fn PNG_DEPSTRUCT;   /* called after each row is decoded */
 
1390
   png_write_status_ptr write_row_fn PNG_DEPSTRUCT; /* called after each row is encoded */
1325
1391
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
1326
 
   png_progressive_info_ptr info_fn; /* called after header data fully read */
1327
 
   png_progressive_row_ptr row_fn;   /* called after each prog. row is decoded */
1328
 
   png_progressive_end_ptr end_fn;   /* called after image is complete */
1329
 
   png_bytep save_buffer_ptr;        /* current location in save_buffer */
1330
 
   png_bytep save_buffer;            /* buffer for previously read data */
1331
 
   png_bytep current_buffer_ptr;     /* current location in current_buffer */
1332
 
   png_bytep current_buffer;         /* buffer for recently used data */
1333
 
   png_uint_32 push_length;          /* size of current input chunk */
1334
 
   png_uint_32 skip_length;          /* bytes to skip in input data */
1335
 
   png_size_t save_buffer_size;      /* amount of data now in save_buffer */
1336
 
   png_size_t save_buffer_max;       /* total size of save_buffer */
1337
 
   png_size_t buffer_size;           /* total amount of available input data */
1338
 
   png_size_t current_buffer_size;   /* amount of data now in current_buffer */
1339
 
   int process_mode;                 /* what push library is currently doing */
1340
 
   int cur_palette;                  /* current push library palette index */
 
1392
   png_progressive_info_ptr info_fn PNG_DEPSTRUCT; /* called after header data fully read */
 
1393
   png_progressive_row_ptr row_fn PNG_DEPSTRUCT;   /* called after each prog. row is decoded */
 
1394
   png_progressive_end_ptr end_fn PNG_DEPSTRUCT;   /* called after image is complete */
 
1395
   png_bytep save_buffer_ptr PNG_DEPSTRUCT;        /* current location in save_buffer */
 
1396
   png_bytep save_buffer PNG_DEPSTRUCT;            /* buffer for previously read data */
 
1397
   png_bytep current_buffer_ptr PNG_DEPSTRUCT;     /* current location in current_buffer */
 
1398
   png_bytep current_buffer PNG_DEPSTRUCT;         /* buffer for recently used data */
 
1399
   png_uint_32 push_length PNG_DEPSTRUCT;          /* size of current input chunk */
 
1400
   png_uint_32 skip_length PNG_DEPSTRUCT;          /* bytes to skip in input data */
 
1401
   png_size_t save_buffer_size PNG_DEPSTRUCT;      /* amount of data now in save_buffer */
 
1402
   png_size_t save_buffer_max PNG_DEPSTRUCT;       /* total size of save_buffer */
 
1403
   png_size_t buffer_size PNG_DEPSTRUCT;           /* total amount of available input data */
 
1404
   png_size_t current_buffer_size PNG_DEPSTRUCT;   /* amount of data now in current_buffer */
 
1405
   int process_mode PNG_DEPSTRUCT;                 /* what push library is currently doing */
 
1406
   int cur_palette PNG_DEPSTRUCT;                  /* current push library palette index */
1341
1407
 
1342
 
#  if defined(PNG_TEXT_SUPPORTED)
1343
 
     png_size_t current_text_size;   /* current size of text input data */
1344
 
     png_size_t current_text_left;   /* how much text left to read in input */
1345
 
     png_charp current_text;         /* current text chunk buffer */
1346
 
     png_charp current_text_ptr;     /* current location in current_text */
 
1408
#  ifdef PNG_TEXT_SUPPORTED
 
1409
     png_size_t current_text_size PNG_DEPSTRUCT;   /* current size of text input data */
 
1410
     png_size_t current_text_left PNG_DEPSTRUCT;   /* how much text left to read in input */
 
1411
     png_charp current_text PNG_DEPSTRUCT;         /* current text chunk buffer */
 
1412
     png_charp current_text_ptr PNG_DEPSTRUCT;     /* current location in current_text */
1347
1413
#  endif /* PNG_TEXT_SUPPORTED */
1348
1414
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
1349
1415
 
1350
1416
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
1351
1417
/* for the Borland special 64K segment handler */
1352
 
   png_bytepp offset_table_ptr;
1353
 
   png_bytep offset_table;
1354
 
   png_uint_16 offset_table_number;
1355
 
   png_uint_16 offset_table_count;
1356
 
   png_uint_16 offset_table_count_free;
 
1418
   png_bytepp offset_table_ptr PNG_DEPSTRUCT;
 
1419
   png_bytep offset_table PNG_DEPSTRUCT;
 
1420
   png_uint_16 offset_table_number PNG_DEPSTRUCT;
 
1421
   png_uint_16 offset_table_count PNG_DEPSTRUCT;
 
1422
   png_uint_16 offset_table_count_free PNG_DEPSTRUCT;
1357
1423
#endif
1358
1424
 
1359
 
#if defined(PNG_READ_DITHER_SUPPORTED)
1360
 
   png_bytep palette_lookup;         /* lookup table for dithering */
1361
 
   png_bytep dither_index;           /* index translation for palette files */
 
1425
#ifdef PNG_READ_DITHER_SUPPORTED
 
1426
   png_bytep palette_lookup PNG_DEPSTRUCT;         /* lookup table for dithering */
 
1427
   png_bytep dither_index PNG_DEPSTRUCT;           /* index translation for palette files */
1362
1428
#endif
1363
1429
 
1364
1430
#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED)
1365
 
   png_uint_16p hist;                /* histogram */
1366
 
#endif
1367
 
 
1368
 
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
1369
 
   png_byte heuristic_method;        /* heuristic for row filter selection */
1370
 
   png_byte num_prev_filters;        /* number of weights for previous rows */
1371
 
   png_bytep prev_filters;           /* filter type(s) of previous row(s) */
1372
 
   png_uint_16p filter_weights;      /* weight(s) for previous line(s) */
1373
 
   png_uint_16p inv_filter_weights;  /* 1/weight(s) for previous line(s) */
1374
 
   png_uint_16p filter_costs;        /* relative filter calculation cost */
1375
 
   png_uint_16p inv_filter_costs;    /* 1/relative filter calculation cost */
1376
 
#endif
1377
 
 
1378
 
#if defined(PNG_TIME_RFC1123_SUPPORTED)
1379
 
   png_charp time_buffer;            /* String to hold RFC 1123 time text */
 
1431
   png_uint_16p hist PNG_DEPSTRUCT;                /* histogram */
 
1432
#endif
 
1433
 
 
1434
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
 
1435
   png_byte heuristic_method PNG_DEPSTRUCT;        /* heuristic for row filter selection */
 
1436
   png_byte num_prev_filters PNG_DEPSTRUCT;        /* number of weights for previous rows */
 
1437
   png_bytep prev_filters PNG_DEPSTRUCT;           /* filter type(s) of previous row(s) */
 
1438
   png_uint_16p filter_weights PNG_DEPSTRUCT;      /* weight(s) for previous line(s) */
 
1439
   png_uint_16p inv_filter_weights PNG_DEPSTRUCT;  /* 1/weight(s) for previous line(s) */
 
1440
   png_uint_16p filter_costs PNG_DEPSTRUCT;        /* relative filter calculation cost */
 
1441
   png_uint_16p inv_filter_costs PNG_DEPSTRUCT;    /* 1/relative filter calculation cost */
 
1442
#endif
 
1443
 
 
1444
#ifdef PNG_TIME_RFC1123_SUPPORTED
 
1445
   png_charp time_buffer PNG_DEPSTRUCT;            /* String to hold RFC 1123 time text */
1380
1446
#endif
1381
1447
 
1382
1448
/* New members added in libpng-1.0.6 */
1383
1449
 
1384
1450
#ifdef PNG_FREE_ME_SUPPORTED
1385
 
   png_uint_32 free_me;       /* flags items libpng is responsible for freeing */
1386
 
#endif
1387
 
 
1388
 
#if defined(PNG_USER_CHUNKS_SUPPORTED)
1389
 
   png_voidp user_chunk_ptr;
1390
 
   png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
1391
 
#endif
1392
 
 
1393
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
1394
 
   int num_chunk_list;
1395
 
   png_bytep chunk_list;
 
1451
   png_uint_32 free_me PNG_DEPSTRUCT;   /* flags items libpng is responsible for freeing */
 
1452
#endif
 
1453
 
 
1454
#ifdef PNG_USER_CHUNKS_SUPPORTED
 
1455
   png_voidp user_chunk_ptr PNG_DEPSTRUCT;
 
1456
   png_user_chunk_ptr read_user_chunk_fn PNG_DEPSTRUCT; /* user read chunk handler */
 
1457
#endif
 
1458
 
 
1459
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
 
1460
   int num_chunk_list PNG_DEPSTRUCT;
 
1461
   png_bytep chunk_list PNG_DEPSTRUCT;
1396
1462
#endif
1397
1463
 
1398
1464
/* New members added in libpng-1.0.3 */
1399
 
#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
1400
 
   png_byte rgb_to_gray_status;
 
1465
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
 
1466
   png_byte rgb_to_gray_status PNG_DEPSTRUCT;
1401
1467
   /* These were changed from png_byte in libpng-1.0.6 */
1402
 
   png_uint_16 rgb_to_gray_red_coeff;
1403
 
   png_uint_16 rgb_to_gray_green_coeff;
1404
 
   png_uint_16 rgb_to_gray_blue_coeff;
 
1468
   png_uint_16 rgb_to_gray_red_coeff PNG_DEPSTRUCT;
 
1469
   png_uint_16 rgb_to_gray_green_coeff PNG_DEPSTRUCT;
 
1470
   png_uint_16 rgb_to_gray_blue_coeff PNG_DEPSTRUCT;
1405
1471
#endif
1406
1472
 
1407
1473
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
1408
1474
#if defined(PNG_MNG_FEATURES_SUPPORTED) || \
1409
1475
    defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
1410
1476
    defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
1411
 
/* changed from png_byte to png_uint_32 at version 1.2.0 */
 
1477
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
1412
1478
#ifdef PNG_1_0_X
1413
 
   png_byte mng_features_permitted;
 
1479
   png_byte mng_features_permitted PNG_DEPSTRUCT;
1414
1480
#else
1415
 
   png_uint_32 mng_features_permitted;
 
1481
   png_uint_32 mng_features_permitted PNG_DEPSTRUCT;
1416
1482
#endif /* PNG_1_0_X */
1417
1483
#endif
1418
1484
 
1419
1485
/* New member added in libpng-1.0.7 */
1420
1486
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
1421
 
   png_fixed_point int_gamma;
 
1487
   png_fixed_point int_gamma PNG_DEPSTRUCT;
1422
1488
#endif
1423
1489
 
1424
1490
/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */
1425
 
#if defined(PNG_MNG_FEATURES_SUPPORTED)
1426
 
   png_byte filter_type;
 
1491
#ifdef PNG_MNG_FEATURES_SUPPORTED
 
1492
   png_byte filter_type PNG_DEPSTRUCT;
1427
1493
#endif
1428
1494
 
1429
 
#if defined(PNG_1_0_X)
 
1495
#ifdef PNG_1_0_X
1430
1496
/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */
1431
 
   png_uint_32 row_buf_size;
 
1497
   png_uint_32 row_buf_size PNG_DEPSTRUCT;
1432
1498
#endif
1433
1499
 
1434
1500
/* New members added in libpng-1.2.0 */
1435
 
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
1436
 
#  if !defined(PNG_1_0_X)
1437
 
#    if defined(PNG_MMX_CODE_SUPPORTED)
1438
 
   png_byte     mmx_bitdepth_threshold;
1439
 
   png_uint_32  mmx_rowbytes_threshold;
 
1501
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
 
1502
#  ifndef PNG_1_0_X
 
1503
#    ifdef PNG_MMX_CODE_SUPPORTED
 
1504
   png_byte     mmx_bitdepth_threshold PNG_DEPSTRUCT;
 
1505
   png_uint_32  mmx_rowbytes_threshold PNG_DEPSTRUCT;
1440
1506
#    endif
1441
 
   png_uint_32  asm_flags;
 
1507
   png_uint_32  asm_flags PNG_DEPSTRUCT;
1442
1508
#  endif
1443
1509
#endif
1444
1510
 
1445
1511
/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
1446
1512
#ifdef PNG_USER_MEM_SUPPORTED
1447
 
   png_voidp mem_ptr;                /* user supplied struct for mem functions */
1448
 
   png_malloc_ptr malloc_fn;         /* function for allocating memory */
1449
 
   png_free_ptr free_fn;             /* function for freeing memory */
 
1513
   png_voidp mem_ptr PNG_DEPSTRUCT;            /* user supplied struct for mem functions */
 
1514
   png_malloc_ptr malloc_fn PNG_DEPSTRUCT;     /* function for allocating memory */
 
1515
   png_free_ptr free_fn PNG_DEPSTRUCT;         /* function for freeing memory */
1450
1516
#endif
1451
1517
 
1452
1518
/* New member added in libpng-1.0.13 and 1.2.0 */
1453
 
   png_bytep big_row_buf;         /* buffer to save current (unfiltered) row */
 
1519
   png_bytep big_row_buf PNG_DEPSTRUCT;        /* buffer to save current (unfiltered) row */
1454
1520
 
1455
 
#if defined(PNG_READ_DITHER_SUPPORTED)
 
1521
#ifdef PNG_READ_DITHER_SUPPORTED
1456
1522
/* The following three members were added at version 1.0.14 and 1.2.4 */
1457
 
   png_bytep dither_sort;            /* working sort array */
1458
 
   png_bytep index_to_palette;       /* where the original index currently is */
1459
 
                                     /* in the palette */
1460
 
   png_bytep palette_to_index;       /* which original index points to this */
1461
 
                                     /* palette color */
 
1523
   png_bytep dither_sort PNG_DEPSTRUCT;        /* working sort array */
 
1524
   png_bytep index_to_palette PNG_DEPSTRUCT;   /* where the original index currently is */
 
1525
                                 /* in the palette */
 
1526
   png_bytep palette_to_index PNG_DEPSTRUCT;   /* which original index points to this */
 
1527
                                 /* palette color */
1462
1528
#endif
1463
1529
 
1464
1530
/* New members added in libpng-1.0.16 and 1.2.6 */
1465
 
   png_byte compression_type;
 
1531
   png_byte compression_type PNG_DEPSTRUCT;
1466
1532
 
1467
 
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
1468
 
   png_uint_32 user_width_max;
1469
 
   png_uint_32 user_height_max;
 
1533
#ifdef PNG_USER_LIMITS_SUPPORTED
 
1534
   png_uint_32 user_width_max PNG_DEPSTRUCT;
 
1535
   png_uint_32 user_height_max PNG_DEPSTRUCT;
1470
1536
#endif
1471
1537
 
1472
1538
/* New member added in libpng-1.0.25 and 1.2.17 */
1473
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
1474
 
   /* storage for unknown chunk that the library doesn't recognize. */
1475
 
   png_unknown_chunk unknown_chunk;
 
1539
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
 
1540
   /* Storage for unknown chunk that the library doesn't recognize. */
 
1541
   png_unknown_chunk unknown_chunk PNG_DEPSTRUCT;
1476
1542
#endif
1477
1543
 
1478
1544
/* New members added in libpng-1.2.26 */
1479
 
  png_uint_32 old_big_row_buf_size, old_prev_row_size;
 
1545
  png_uint_32 old_big_row_buf_size PNG_DEPSTRUCT;
 
1546
  png_uint_32 old_prev_row_size PNG_DEPSTRUCT;
1480
1547
 
1481
1548
/* New member added in libpng-1.2.30 */
1482
 
  png_charp chunkdata;  /* buffer for reading chunk data */
 
1549
  png_charp chunkdata PNG_DEPSTRUCT;  /* buffer for reading chunk data */
 
1550
 
1483
1551
 
1484
1552
};
1485
1553
 
1487
1555
/* This triggers a compiler error in png.c, if png.c and png.h
1488
1556
 * do not agree upon the version number.
1489
1557
 */
1490
 
typedef png_structp version_1_2_35;
 
1558
typedef png_structp version_1_2_46;
1491
1559
 
1492
1560
typedef png_struct FAR * FAR * png_structpp;
1493
1561
 
1517
1585
/* Simple signature checking function.  This is the same as calling
1518
1586
 * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
1519
1587
 */
1520
 
extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num));
 
1588
extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)) PNG_DEPRECATED;
1521
1589
 
1522
1590
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
1523
1591
extern PNG_EXPORT(png_structp,png_create_read_struct)
1524
1592
   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1525
 
   png_error_ptr error_fn, png_error_ptr warn_fn));
 
1593
   png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED;
1526
1594
 
1527
1595
/* Allocate and initialize png_ptr struct for writing, and any other memory */
1528
1596
extern PNG_EXPORT(png_structp,png_create_write_struct)
1529
1597
   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1530
 
   png_error_ptr error_fn, png_error_ptr warn_fn));
 
1598
   png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED;
1531
1599
 
1532
1600
#ifdef PNG_WRITE_SUPPORTED
1533
1601
extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size)
1547
1615
extern PNG_EXPORT(png_structp,png_create_read_struct_2)
1548
1616
   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1549
1617
   png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
1550
 
   png_malloc_ptr malloc_fn, png_free_ptr free_fn));
 
1618
   png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED;
1551
1619
extern PNG_EXPORT(png_structp,png_create_write_struct_2)
1552
1620
   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1553
1621
   png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
1554
 
   png_malloc_ptr malloc_fn, png_free_ptr free_fn));
 
1622
   png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED;
1555
1623
#endif
1556
1624
 
1557
1625
/* Write a PNG chunk - size, type, (optional) data, CRC. */
1571
1639
 
1572
1640
/* Allocate and initialize the info structure */
1573
1641
extern PNG_EXPORT(png_infop,png_create_info_struct)
1574
 
   PNGARG((png_structp png_ptr));
 
1642
   PNGARG((png_structp png_ptr)) PNG_ALLOCATED;
1575
1643
 
1576
1644
#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
1577
1645
/* Initialize the info structure (old interface - DEPRECATED) */
1578
 
extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
 
1646
extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr))
 
1647
    PNG_DEPRECATED;
1579
1648
#undef png_info_init
1580
1649
#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\
1581
1650
    png_sizeof(png_info));
1590
1659
extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
1591
1660
   png_infop info_ptr));
1592
1661
 
1593
 
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
1594
 
/* read the information before the actual image data. */
 
1662
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 
1663
/* Read the information before the actual image data. */
1595
1664
extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
1596
1665
   png_infop info_ptr));
1597
1666
#endif
1598
1667
 
1599
 
#if defined(PNG_TIME_RFC1123_SUPPORTED)
 
1668
#ifdef PNG_TIME_RFC1123_SUPPORTED
1600
1669
extern PNG_EXPORT(png_charp,png_convert_to_rfc1123)
1601
1670
   PNGARG((png_structp png_ptr, png_timep ptime));
1602
1671
#endif
1603
1672
 
1604
 
#if !defined(_WIN32_WCE)
1605
 
/* "time.h" functions are not supported on WindowsCE */
1606
 
#if defined(PNG_WRITE_tIME_SUPPORTED)
1607
 
/* convert from a struct tm to png_time */
 
1673
#ifdef PNG_CONVERT_tIME_SUPPORTED
 
1674
/* Convert from a struct tm to png_time */
1608
1675
extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
1609
1676
   struct tm FAR * ttime));
1610
1677
 
1611
 
/* convert from time_t to png_time.  Uses gmtime() */
 
1678
/* Convert from time_t to png_time.  Uses gmtime() */
1612
1679
extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
1613
1680
   time_t ttime));
1614
 
#endif /* PNG_WRITE_tIME_SUPPORTED */
1615
 
#endif /* _WIN32_WCE */
 
1681
#endif /* PNG_CONVERT_tIME_SUPPORTED */
1616
1682
 
1617
 
#if defined(PNG_READ_EXPAND_SUPPORTED)
 
1683
#ifdef PNG_READ_EXPAND_SUPPORTED
1618
1684
/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
1619
1685
extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
1620
 
#if !defined(PNG_1_0_X)
 
1686
#ifndef PNG_1_0_X
1621
1687
extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
1622
1688
  png_ptr));
1623
1689
#endif
1625
1691
extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
1626
1692
#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
1627
1693
/* Deprecated */
1628
 
extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));
 
1694
extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp
 
1695
    png_ptr)) PNG_DEPRECATED;
1629
1696
#endif
1630
1697
#endif
1631
1698
 
1634
1701
extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));
1635
1702
#endif
1636
1703
 
1637
 
#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 
1704
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
1638
1705
/* Expand the grayscale to 24-bit RGB if necessary. */
1639
1706
extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));
1640
1707
#endif
1641
1708
 
1642
 
#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 
1709
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
1643
1710
/* Reduce RGB to grayscale. */
1644
1711
#ifdef PNG_FLOATING_POINT_SUPPORTED
1645
1712
extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr,
1654
1721
extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
1655
1722
   png_colorp palette));
1656
1723
 
1657
 
#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 
1724
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
1658
1725
extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
1659
1726
#endif
1660
1727
 
1676
1743
#define PNG_FILLER_BEFORE 0
1677
1744
#define PNG_FILLER_AFTER 1
1678
1745
/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
1679
 
#if !defined(PNG_1_0_X)
 
1746
#ifndef PNG_1_0_X
1680
1747
extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
1681
1748
   png_uint_32 filler, int flags));
1682
1749
#endif
1714
1781
extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
1715
1782
#endif
1716
1783
 
1717
 
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 
1784
#ifdef PNG_READ_BACKGROUND_SUPPORTED
1718
1785
/* Handle alpha and tRNS by replacing with a background color. */
1719
1786
#ifdef PNG_FLOATING_POINT_SUPPORTED
1720
1787
extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
1727
1794
#define PNG_BACKGROUND_GAMMA_UNIQUE  3
1728
1795
#endif
1729
1796
 
1730
 
#if defined(PNG_READ_16_TO_8_SUPPORTED)
1731
 
/* strip the second byte of information from a 16-bit depth file. */
 
1797
#ifdef PNG_READ_16_TO_8_SUPPORTED
 
1798
/* Strip the second byte of information from a 16-bit depth file. */
1732
1799
extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
1733
1800
#endif
1734
1801
 
1735
 
#if defined(PNG_READ_DITHER_SUPPORTED)
 
1802
#ifdef PNG_READ_DITHER_SUPPORTED
1736
1803
/* Turn on dithering, and reduce the palette to the number of colors available. */
1737
1804
extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr,
1738
1805
   png_colorp palette, int num_palette, int maximum_colors,
1739
1806
   png_uint_16p histogram, int full_dither));
1740
1807
#endif
1741
1808
 
1742
 
#if defined(PNG_READ_GAMMA_SUPPORTED)
 
1809
#ifdef PNG_READ_GAMMA_SUPPORTED
1743
1810
/* Handle gamma correction. Screen_gamma=(display_exponent) */
1744
1811
#ifdef PNG_FLOATING_POINT_SUPPORTED
1745
1812
extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
1753
1820
/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */
1754
1821
/* Deprecated and will be removed.  Use png_permit_mng_features() instead. */
1755
1822
extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr,
1756
 
   int empty_plte_permitted));
 
1823
   int empty_plte_permitted)) PNG_DEPRECATED;
1757
1824
#endif
1758
1825
#endif
1759
1826
 
1760
 
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
 
1827
#ifdef PNG_WRITE_FLUSH_SUPPORTED
1761
1828
/* Set how many lines between output flushes - 0 for no flushing */
1762
1829
extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows));
1763
1830
/* Flush the current PNG output buffer */
1764
1831
extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr));
1765
1832
#endif
1766
1833
 
1767
 
/* optional update palette with requested transformations */
 
1834
/* Optional update palette with requested transformations */
1768
1835
extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
1769
1836
 
1770
 
/* optional call to update the users info structure */
 
1837
/* Optional call to update the users info structure */
1771
1838
extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
1772
1839
   png_infop info_ptr));
1773
1840
 
1774
1841
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
1775
 
/* read one or more rows of image data. */
 
1842
/* Read one or more rows of image data. */
1776
1843
extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
1777
1844
   png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
1778
1845
#endif
1779
1846
 
1780
1847
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
1781
 
/* read a row of data. */
 
1848
/* Read a row of data. */
1782
1849
extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
1783
1850
   png_bytep row,
1784
1851
   png_bytep display_row));
1785
1852
#endif
1786
1853
 
1787
1854
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
1788
 
/* read the whole image into memory at once. */
 
1855
/* Read the whole image into memory at once. */
1789
1856
extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
1790
1857
   png_bytepp image));
1791
1858
#endif
1792
1859
 
1793
 
/* write a row of image data */
 
1860
/* Write a row of image data */
1794
1861
extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
1795
1862
   png_bytep row));
1796
1863
 
1797
 
/* write a few rows of image data */
 
1864
/* Write a few rows of image data */
1798
1865
extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
1799
1866
   png_bytepp row, png_uint_32 num_rows));
1800
1867
 
1801
 
/* write the image data */
 
1868
/* Write the image data */
1802
1869
extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
1803
1870
   png_bytepp image));
1804
1871
 
1805
 
/* writes the end of the PNG file. */
 
1872
/* Writes the end of the PNG file. */
1806
1873
extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
1807
1874
   png_infop info_ptr));
1808
1875
 
1809
1876
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
1810
 
/* read the end of the PNG file. */
 
1877
/* Read the end of the PNG file. */
1811
1878
extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
1812
1879
   png_infop info_ptr));
1813
1880
#endif
1814
1881
 
1815
 
/* free any memory associated with the png_info_struct */
 
1882
/* Free any memory associated with the png_info_struct */
1816
1883
extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
1817
1884
   png_infopp info_ptr_ptr));
1818
1885
 
1819
 
/* free any memory associated with the png_struct and the png_info_structs */
 
1886
/* Free any memory associated with the png_struct and the png_info_structs */
1820
1887
extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
1821
1888
   png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
1822
1889
 
1823
 
/* free all memory used by the read (old method - NOT DLL EXPORTED) */
 
1890
/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
1824
1891
extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
1825
 
   png_infop end_info_ptr));
 
1892
   png_infop end_info_ptr)) PNG_DEPRECATED;
1826
1893
 
1827
 
/* free any memory associated with the png_struct and the png_info_structs */
 
1894
/* Free any memory associated with the png_struct and the png_info_structs */
1828
1895
extern PNG_EXPORT(void,png_destroy_write_struct)
1829
1896
   PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
1830
1897
 
1831
 
/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
1832
 
extern void png_write_destroy PNGARG((png_structp png_ptr));
 
1898
/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
 
1899
extern void png_write_destroy PNGARG((png_structp png_ptr)) PNG_DEPRECATED;
1833
1900
 
1834
 
/* set the libpng method of handling chunk CRC errors */
 
1901
/* Set the libpng method of handling chunk CRC errors */
1835
1902
extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
1836
1903
   int crit_action, int ancil_action));
1837
1904
 
1859
1926
 * header file (zlib.h) for an explination of the compression functions.
1860
1927
 */
1861
1928
 
1862
 
/* set the filtering method(s) used by libpng.  Currently, the only valid
 
1929
/* Set the filtering method(s) used by libpng.  Currently, the only valid
1863
1930
 * value for "method" is 0.
1864
1931
 */
1865
1932
extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
1964
2031
 * more information.
1965
2032
 */
1966
2033
 
1967
 
#if !defined(PNG_NO_STDIO)
 
2034
#ifdef PNG_STDIO_SUPPORTED
1968
2035
/* Initialize the input/output for the PNG file to the default functions. */
1969
2036
extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp));
1970
2037
#endif
1987
2054
 * If buffered output is not used, then output_flush_fn can be set to NULL.
1988
2055
 * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
1989
2056
 * output_flush_fn will be ignored (and thus can be NULL).
 
2057
 * It is probably a mistake to use NULL for output_flush_fn if
 
2058
 * write_data_fn is not also NULL unless you have built libpng with
 
2059
 * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's
 
2060
 * default flush function, which uses the standard *FILE structure, will
 
2061
 * be used.
1990
2062
 */
1991
2063
extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
1992
2064
   png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
2051
2123
   png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
2052
2124
   png_progressive_end_ptr end_fn));
2053
2125
 
2054
 
/* returns the user pointer associated with the push read functions */
 
2126
/* Returns the user pointer associated with the push read functions */
2055
2127
extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
2056
2128
   PNGARG((png_structp png_ptr));
2057
2129
 
2058
 
/* function to be called when data becomes available */
 
2130
/* Function to be called when data becomes available */
2059
2131
extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
2060
2132
   png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
2061
2133
 
2062
 
/* function that combines rows.  Not very much different than the
 
2134
/* Function that combines rows.  Not very much different than the
2063
2135
 * png_combine_row() call.  Is this even used?????
2064
2136
 */
2065
2137
extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
2067
2139
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
2068
2140
 
2069
2141
extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
2070
 
   png_uint_32 size));
 
2142
   png_uint_32 size)) PNG_ALLOCATED;
2071
2143
 
2072
 
#if defined(PNG_1_0_X)
 
2144
#ifdef PNG_1_0_X
2073
2145
#  define png_malloc_warn png_malloc
2074
2146
#else
2075
2147
/* Added at libpng version 1.2.4 */
2076
2148
extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
2077
 
   png_uint_32 size));
 
2149
   png_uint_32 size)) PNG_ALLOCATED;
2078
2150
#endif
2079
2151
 
2080
 
/* frees a pointer allocated by png_malloc() */
 
2152
/* Frees a pointer allocated by png_malloc() */
2081
2153
extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
2082
2154
 
2083
 
#if defined(PNG_1_0_X)
 
2155
#ifdef PNG_1_0_X
2084
2156
/* Function to allocate memory for zlib. */
2085
2157
extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
2086
2158
   uInt size));
2094
2166
   png_infop info_ptr, png_uint_32 free_me, int num));
2095
2167
#ifdef PNG_FREE_ME_SUPPORTED
2096
2168
/* Reassign responsibility for freeing existing data, whether allocated
2097
 
 * by libpng or by the application */
 
2169
 * by libpng or by the application
 
2170
 */
2098
2171
extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
2099
2172
   png_infop info_ptr, int freer, png_uint_32 mask));
2100
2173
#endif
2101
 
/* assignments for png_data_freer */
 
2174
/* Assignments for png_data_freer */
2102
2175
#define PNG_DESTROY_WILL_FREE_DATA 1
2103
2176
#define PNG_SET_WILL_FREE_DATA 1
2104
2177
#define PNG_USER_WILL_FREE_DATA 2
2119
2192
 
2120
2193
#ifdef PNG_USER_MEM_SUPPORTED
2121
2194
extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
2122
 
   png_uint_32 size));
 
2195
   png_uint_32 size)) PNG_ALLOCATED;
2123
2196
extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr,
2124
2197
   png_voidp ptr));
2125
2198
#endif
2126
2199
 
2127
2200
extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr,
2128
 
   png_voidp s1, png_voidp s2, png_uint_32 size));
 
2201
   png_voidp s1, png_voidp s2, png_uint_32 size)) PNG_DEPRECATED;
2129
2202
 
2130
2203
extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr,
2131
 
   png_voidp s1, int value, png_uint_32 size));
 
2204
   png_voidp s1, int value, png_uint_32 size)) PNG_DEPRECATED;
2132
2205
 
2133
2206
#if defined(USE_FAR_KEYWORD)  /* memory model conversion function */
2134
2207
extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
2138
2211
#ifndef PNG_NO_ERROR_TEXT
2139
2212
/* Fatal error in PNG image of libpng - can't continue */
2140
2213
extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
2141
 
   png_const_charp error_message));
 
2214
   png_const_charp error_message)) PNG_NORETURN;
2142
2215
 
2143
2216
/* The same, but the chunk name is prepended to the error string. */
2144
2217
extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
2145
 
   png_const_charp error_message));
 
2218
   png_const_charp error_message)) PNG_NORETURN;
2146
2219
#else
2147
2220
/* Fatal error in PNG image of libpng - can't continue */
2148
 
extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr));
 
2221
extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)) PNG_NORETURN;
2149
2222
#endif
2150
2223
 
2151
2224
#ifndef PNG_NO_WARNINGS
2180
2253
extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr,
2181
2254
png_infop info_ptr));
2182
2255
 
2183
 
#if defined(PNG_INFO_IMAGE_SUPPORTED)
 
2256
#ifdef PNG_INFO_IMAGE_SUPPORTED
2184
2257
/* Returns row_pointers, which is an array of pointers to scanlines that was
2185
 
returned from png_read_png(). */
 
2258
 * returned from png_read_png().
 
2259
 */
2186
2260
extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
2187
2261
png_infop info_ptr));
2188
2262
/* Set row_pointers, which is an array of pointers to scanlines for use
2189
 
by png_write_png(). */
 
2263
 * by png_write_png().
 
2264
 */
2190
2265
extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
2191
2266
   png_infop info_ptr, png_bytepp row_pointers));
2192
2267
#endif
2254
2329
extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr,
2255
2330
png_infop info_ptr));
2256
2331
 
2257
 
#if defined(PNG_bKGD_SUPPORTED)
 
2332
#ifdef PNG_bKGD_SUPPORTED
2258
2333
extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr,
2259
2334
   png_infop info_ptr, png_color_16p *background));
2260
2335
#endif
2261
2336
 
2262
 
#if defined(PNG_bKGD_SUPPORTED)
 
2337
#ifdef PNG_bKGD_SUPPORTED
2263
2338
extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr,
2264
2339
   png_infop info_ptr, png_color_16p background));
2265
2340
#endif
2266
2341
 
2267
 
#if defined(PNG_cHRM_SUPPORTED)
 
2342
#ifdef PNG_cHRM_SUPPORTED
2268
2343
#ifdef PNG_FLOATING_POINT_SUPPORTED
2269
2344
extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr,
2270
2345
   png_infop info_ptr, double *white_x, double *white_y, double *red_x,
2280
2355
#endif
2281
2356
#endif
2282
2357
 
2283
 
#if defined(PNG_cHRM_SUPPORTED)
 
2358
#ifdef PNG_cHRM_SUPPORTED
2284
2359
#ifdef PNG_FLOATING_POINT_SUPPORTED
2285
2360
extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr,
2286
2361
   png_infop info_ptr, double white_x, double white_y, double red_x,
2295
2370
#endif
2296
2371
#endif
2297
2372
 
2298
 
#if defined(PNG_gAMA_SUPPORTED)
 
2373
#ifdef PNG_gAMA_SUPPORTED
2299
2374
#ifdef PNG_FLOATING_POINT_SUPPORTED
2300
2375
extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr,
2301
2376
   png_infop info_ptr, double *file_gamma));
2304
2379
   png_infop info_ptr, png_fixed_point *int_file_gamma));
2305
2380
#endif
2306
2381
 
2307
 
#if defined(PNG_gAMA_SUPPORTED)
 
2382
#ifdef PNG_gAMA_SUPPORTED
2308
2383
#ifdef PNG_FLOATING_POINT_SUPPORTED
2309
2384
extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr,
2310
2385
   png_infop info_ptr, double file_gamma));
2313
2388
   png_infop info_ptr, png_fixed_point int_file_gamma));
2314
2389
#endif
2315
2390
 
2316
 
#if defined(PNG_hIST_SUPPORTED)
 
2391
#ifdef PNG_hIST_SUPPORTED
2317
2392
extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr,
2318
2393
   png_infop info_ptr, png_uint_16p *hist));
2319
2394
#endif
2320
2395
 
2321
 
#if defined(PNG_hIST_SUPPORTED)
 
2396
#ifdef PNG_hIST_SUPPORTED
2322
2397
extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
2323
2398
   png_infop info_ptr, png_uint_16p hist));
2324
2399
#endif
2333
2408
   int color_type, int interlace_method, int compression_method,
2334
2409
   int filter_method));
2335
2410
 
2336
 
#if defined(PNG_oFFs_SUPPORTED)
 
2411
#ifdef PNG_oFFs_SUPPORTED
2337
2412
extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr,
2338
2413
   png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
2339
2414
   int *unit_type));
2340
2415
#endif
2341
2416
 
2342
 
#if defined(PNG_oFFs_SUPPORTED)
 
2417
#ifdef PNG_oFFs_SUPPORTED
2343
2418
extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr,
2344
2419
   png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y,
2345
2420
   int unit_type));
2346
2421
#endif
2347
2422
 
2348
 
#if defined(PNG_pCAL_SUPPORTED)
 
2423
#ifdef PNG_pCAL_SUPPORTED
2349
2424
extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr,
2350
2425
   png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
2351
2426
   int *type, int *nparams, png_charp *units, png_charpp *params));
2352
2427
#endif
2353
2428
 
2354
 
#if defined(PNG_pCAL_SUPPORTED)
 
2429
#ifdef PNG_pCAL_SUPPORTED
2355
2430
extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr,
2356
2431
   png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1,
2357
2432
   int type, int nparams, png_charp units, png_charpp params));
2358
2433
#endif
2359
2434
 
2360
 
#if defined(PNG_pHYs_SUPPORTED)
 
2435
#ifdef PNG_pHYs_SUPPORTED
2361
2436
extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr,
2362
2437
   png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
2363
2438
#endif
2364
2439
 
2365
 
#if defined(PNG_pHYs_SUPPORTED)
 
2440
#ifdef PNG_pHYs_SUPPORTED
2366
2441
extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
2367
2442
   png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
2368
2443
#endif
2373
2448
extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
2374
2449
   png_infop info_ptr, png_colorp palette, int num_palette));
2375
2450
 
2376
 
#if defined(PNG_sBIT_SUPPORTED)
 
2451
#ifdef PNG_sBIT_SUPPORTED
2377
2452
extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr,
2378
2453
   png_infop info_ptr, png_color_8p *sig_bit));
2379
2454
#endif
2380
2455
 
2381
 
#if defined(PNG_sBIT_SUPPORTED)
 
2456
#ifdef PNG_sBIT_SUPPORTED
2382
2457
extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
2383
2458
   png_infop info_ptr, png_color_8p sig_bit));
2384
2459
#endif
2385
2460
 
2386
 
#if defined(PNG_sRGB_SUPPORTED)
 
2461
#ifdef PNG_sRGB_SUPPORTED
2387
2462
extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr,
2388
2463
   png_infop info_ptr, int *intent));
2389
2464
#endif
2390
2465
 
2391
 
#if defined(PNG_sRGB_SUPPORTED)
 
2466
#ifdef PNG_sRGB_SUPPORTED
2392
2467
extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
2393
2468
   png_infop info_ptr, int intent));
2394
2469
extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
2395
2470
   png_infop info_ptr, int intent));
2396
2471
#endif
2397
2472
 
2398
 
#if defined(PNG_iCCP_SUPPORTED)
 
2473
#ifdef PNG_iCCP_SUPPORTED
2399
2474
extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
2400
2475
   png_infop info_ptr, png_charpp name, int *compression_type,
2401
2476
   png_charpp profile, png_uint_32 *proflen));
2402
2477
   /* Note to maintainer: profile should be png_bytepp */
2403
2478
#endif
2404
2479
 
2405
 
#if defined(PNG_iCCP_SUPPORTED)
 
2480
#ifdef PNG_iCCP_SUPPORTED
2406
2481
extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
2407
2482
   png_infop info_ptr, png_charp name, int compression_type,
2408
2483
   png_charp profile, png_uint_32 proflen));
2409
2484
   /* Note to maintainer: profile should be png_bytep */
2410
2485
#endif
2411
2486
 
2412
 
#if defined(PNG_sPLT_SUPPORTED)
 
2487
#ifdef PNG_sPLT_SUPPORTED
2413
2488
extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr,
2414
2489
   png_infop info_ptr, png_sPLT_tpp entries));
2415
2490
#endif
2416
2491
 
2417
 
#if defined(PNG_sPLT_SUPPORTED)
 
2492
#ifdef PNG_sPLT_SUPPORTED
2418
2493
extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
2419
2494
   png_infop info_ptr, png_sPLT_tp entries, int nentries));
2420
2495
#endif
2421
2496
 
2422
 
#if defined(PNG_TEXT_SUPPORTED)
 
2497
#ifdef PNG_TEXT_SUPPORTED
2423
2498
/* png_get_text also returns the number of text chunks in *num_text */
2424
2499
extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
2425
2500
   png_infop info_ptr, png_textp *text_ptr, int *num_text));
2433
2508
 *  they will never be NULL pointers.
2434
2509
 */
2435
2510
 
2436
 
#if defined(PNG_TEXT_SUPPORTED)
 
2511
#ifdef PNG_TEXT_SUPPORTED
2437
2512
extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr,
2438
2513
   png_infop info_ptr, png_textp text_ptr, int num_text));
2439
2514
#endif
2440
2515
 
2441
 
#if defined(PNG_tIME_SUPPORTED)
 
2516
#ifdef PNG_tIME_SUPPORTED
2442
2517
extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr,
2443
2518
   png_infop info_ptr, png_timep *mod_time));
2444
2519
#endif
2445
2520
 
2446
 
#if defined(PNG_tIME_SUPPORTED)
 
2521
#ifdef PNG_tIME_SUPPORTED
2447
2522
extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr,
2448
2523
   png_infop info_ptr, png_timep mod_time));
2449
2524
#endif
2450
2525
 
2451
 
#if defined(PNG_tRNS_SUPPORTED)
 
2526
#ifdef PNG_tRNS_SUPPORTED
2452
2527
extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr,
2453
2528
   png_infop info_ptr, png_bytep *trans, int *num_trans,
2454
2529
   png_color_16p *trans_values));
2455
2530
#endif
2456
2531
 
2457
 
#if defined(PNG_tRNS_SUPPORTED)
 
2532
#ifdef PNG_tRNS_SUPPORTED
2458
2533
extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
2459
2534
   png_infop info_ptr, png_bytep trans, int num_trans,
2460
2535
   png_color_16p trans_values));
2461
2536
#endif
2462
2537
 
2463
 
#if defined(PNG_tRNS_SUPPORTED)
 
2538
#ifdef PNG_tRNS_SUPPORTED
2464
2539
#endif
2465
2540
 
2466
 
#if defined(PNG_sCAL_SUPPORTED)
 
2541
#ifdef PNG_sCAL_SUPPORTED
2467
2542
#ifdef PNG_FLOATING_POINT_SUPPORTED
2468
2543
extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr,
2469
2544
   png_infop info_ptr, int *unit, double *width, double *height));
2475
2550
#endif
2476
2551
#endif /* PNG_sCAL_SUPPORTED */
2477
2552
 
2478
 
#if defined(PNG_sCAL_SUPPORTED)
 
2553
#ifdef PNG_sCAL_SUPPORTED
2479
2554
#ifdef PNG_FLOATING_POINT_SUPPORTED
2480
2555
extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr,
2481
2556
   png_infop info_ptr, int unit, double width, double height));
2487
2562
#endif
2488
2563
#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */
2489
2564
 
2490
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
2491
 
/* provide a list of chunks and how they are to be handled, if the built-in
 
2565
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
 
2566
/* Provide a list of chunks and how they are to be handled, if the built-in
2492
2567
   handling or default unknown chunk handling is not desired.  Any chunks not
2493
2568
   listed will be handled in the default manner.  The IHDR and IEND chunks
2494
2569
   must not be listed.
2499
2574
*/
2500
2575
extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
2501
2576
   png_ptr, int keep, png_bytep chunk_list, int num_chunks));
 
2577
PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
 
2578
   chunk_name));
 
2579
#endif
 
2580
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
2502
2581
extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
2503
2582
   png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
2504
2583
extern PNG_EXPORT(void, png_set_unknown_chunk_location)
2506
2585
extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
2507
2586
   png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
2508
2587
#endif
2509
 
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2510
 
PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
2511
 
   chunk_name));
2512
 
#endif
2513
2588
 
2514
2589
/* Png_free_data() will turn off the "valid" flag for anything it frees.
2515
 
   If you need to turn it off for a chunk that your application has freed,
2516
 
   you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */
 
2590
 * If you need to turn it off for a chunk that your application has freed,
 
2591
 * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
 
2592
 */
2517
2593
extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
2518
2594
   png_infop info_ptr, int mask));
2519
2595
 
2520
 
#if defined(PNG_INFO_IMAGE_SUPPORTED)
 
2596
#ifdef PNG_INFO_IMAGE_SUPPORTED
2521
2597
/* The "params" pointer is currently not used and is for future expansion. */
2522
2598
extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr,
2523
2599
                        png_infop info_ptr,
2556
2632
#ifndef PNG_DEBUG_FILE
2557
2633
#define PNG_DEBUG_FILE stderr
2558
2634
#endif /* PNG_DEBUG_FILE */
 
2635
 
2559
2636
#if (PNG_DEBUG > 1)
2560
 
#ifndef png_debug
2561
 
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
2562
 
 * non-ISO compilers */
2563
 
#ifdef __STDC__
2564
 
#define png_debug(l,m) \
2565
 
{ \
2566
 
     int num_tabs=l; \
2567
 
     fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
2568
 
       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
2569
 
}
2570
 
#endif
2571
 
#ifndef png_debug1
2572
 
#define png_debug1(l,m,p1) \
2573
 
{ \
2574
 
     int num_tabs=l; \
2575
 
     fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
2576
 
       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
2577
 
}
2578
 
#endif
2579
 
#ifndef png_debug2
2580
 
#define png_debug2(l,m,p1,p2) \
2581
 
{ \
2582
 
     int num_tabs=l; \
2583
 
     fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
2584
 
       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
2585
 
}
2586
 
#endif
2587
 
#else /* __STDC __ */
2588
 
#ifndef png_debug
2589
 
#define png_debug(l,m) \
2590
 
     int num_tabs=l; \
2591
 
     char format[256]; \
2592
 
     snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
2593
 
       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
2594
 
       m,PNG_STRING_NEWLINE); \
2595
 
     fprintf(PNG_DEBUG_FILE,format);
2596
 
#endif
2597
 
#ifndef png_debug1
2598
 
#define png_debug1(l,m,p1) \
2599
 
     int num_tabs=l; \
2600
 
     char format[256]; \
2601
 
     snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
2602
 
       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
2603
 
       m,PNG_STRING_NEWLINE); \
2604
 
     fprintf(PNG_DEBUG_FILE,format,p1);
2605
 
#endif
2606
 
#ifndef png_debug2
2607
 
#define png_debug2(l,m,p1,p2) \
2608
 
     int num_tabs=l; \
2609
 
     char format[256]; \
2610
 
     snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
2611
 
       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
2612
 
       m,PNG_STRING_NEWLINE); \
2613
 
     fprintf(PNG_DEBUG_FILE,format,p1,p2);
2614
 
#endif
2615
 
#endif /* __STDC __ */
 
2637
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on non-ISO
 
2638
 * compilers.
 
2639
 */
 
2640
#  ifdef __STDC__
 
2641
#    ifndef png_debug
 
2642
#      define png_debug(l,m) \
 
2643
       { \
 
2644
       int num_tabs=l; \
 
2645
       fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
 
2646
         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
 
2647
       }
 
2648
#    endif
 
2649
#    ifndef png_debug1
 
2650
#      define png_debug1(l,m,p1) \
 
2651
       { \
 
2652
       int num_tabs=l; \
 
2653
       fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
 
2654
         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
 
2655
       }
 
2656
#    endif
 
2657
#    ifndef png_debug2
 
2658
#      define png_debug2(l,m,p1,p2) \
 
2659
       { \
 
2660
       int num_tabs=l; \
 
2661
       fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
 
2662
         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
 
2663
       }
 
2664
#    endif
 
2665
#  else /* __STDC __ */
 
2666
#    ifndef png_debug
 
2667
#      define png_debug(l,m) \
 
2668
       { \
 
2669
       int num_tabs=l; \
 
2670
       char format[256]; \
 
2671
       snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
 
2672
         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
 
2673
         m,PNG_STRING_NEWLINE); \
 
2674
       fprintf(PNG_DEBUG_FILE,format); \
 
2675
       }
 
2676
#    endif
 
2677
#    ifndef png_debug1
 
2678
#      define png_debug1(l,m,p1) \
 
2679
       { \
 
2680
       int num_tabs=l; \
 
2681
       char format[256]; \
 
2682
       snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
 
2683
         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
 
2684
         m,PNG_STRING_NEWLINE); \
 
2685
       fprintf(PNG_DEBUG_FILE,format,p1); \
 
2686
       }
 
2687
#    endif
 
2688
#    ifndef png_debug2
 
2689
#      define png_debug2(l,m,p1,p2) \
 
2690
       { \
 
2691
       int num_tabs=l; \
 
2692
       char format[256]; \
 
2693
       snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
 
2694
         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
 
2695
         m,PNG_STRING_NEWLINE); \
 
2696
       fprintf(PNG_DEBUG_FILE,format,p1,p2); \
 
2697
       }
 
2698
#    endif
 
2699
#  endif /* __STDC __ */
2616
2700
#endif /* (PNG_DEBUG > 1) */
 
2701
 
2617
2702
#endif /* _MSC_VER */
2618
2703
#endif /* (PNG_DEBUG > 0) */
2619
2704
#endif /* PNG_DEBUG */
2644
2729
#define PNG_HANDLE_CHUNK_ALWAYS       3
2645
2730
 
2646
2731
/* Added to version 1.2.0 */
2647
 
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
2648
 
#if defined(PNG_MMX_CODE_SUPPORTED)
 
2732
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
 
2733
#ifdef PNG_MMX_CODE_SUPPORTED
2649
2734
#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED  0x01  /* not user-settable */
2650
2735
#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU    0x02  /* not user-settable */
2651
2736
#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  0x04
2673
2758
#define PNG_SELECT_WRITE  2
2674
2759
#endif /* PNG_MMX_CODE_SUPPORTED */
2675
2760
 
2676
 
#if !defined(PNG_1_0_X)
 
2761
#ifndef PNG_1_0_X
2677
2762
/* pngget.c */
2678
2763
extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask)
2679
2764
   PNGARG((int flag_select, int *compilerID));
2705
2790
 
2706
2791
#endif /* PNG_1_0_X */
2707
2792
 
2708
 
#if !defined(PNG_1_0_X)
 
2793
#ifndef PNG_1_0_X
2709
2794
/* png.c, pnggccrd.c, or pngvcrd.c */
2710
2795
extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
 
2796
#endif /* PNG_1_0_X */
2711
2797
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
2712
2798
 
2713
2799
/* Strip the prepended error numbers ("#nnn ") from error and warning
2714
 
 * messages before passing them to the error or warning handler. */
 
2800
 * messages before passing them to the error or warning handler.
 
2801
 */
2715
2802
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
2716
2803
extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
2717
2804
   png_ptr, png_uint_32 strip_mode));
2718
2805
#endif
2719
2806
 
2720
 
#endif /* PNG_1_0_X */
2721
 
 
2722
2807
/* Added at libpng-1.2.6 */
2723
2808
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
2724
2809
extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
2728
2813
extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
2729
2814
   png_ptr));
2730
2815
#endif
2731
 
 
2732
 
 
2733
 
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
 
2816
/* Maintainer: Put new public prototypes here ^, in libpng.3, and in
 
2817
 * project defs
 
2818
 */
2734
2819
 
2735
2820
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
2736
2821
/* With these routines we avoid an integer divide, which will be slower on
2759
2844
                        (png_uint_32)(alpha)) + (png_uint_32)32768L);        \
2760
2845
       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
2761
2846
 
2762
 
#else  /* standard method using integer division */
 
2847
#else  /* Standard method using integer division */
2763
2848
 
2764
2849
#  define png_composite(composite, fg, alpha, bg)                            \
2765
2850
     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +    \
2781
2866
 * routine also assumes we are using two's complement format for negative
2782
2867
 * values, which is almost certainly true.
2783
2868
 */
2784
 
#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED)
 
2869
#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED
2785
2870
#  define png_get_uint_32(buf) ( *((png_uint_32p) (buf)))
2786
2871
#  define png_get_uint_16(buf) ( *((png_uint_16p) (buf)))
2787
2872
#  define png_get_int_32(buf)  ( *((png_int_32p)  (buf)))
2827
2912
#define PNG_AFTER_IDAT              0x08 /* Have complete zlib datastream */
2828
2913
#define PNG_HAVE_IEND               0x10
2829
2914
 
2830
 
#if defined(PNG_INTERNAL)
 
2915
#ifdef PNG_INTERNAL
2831
2916
 
2832
2917
/* More modes of operation.  Note that after an init, mode is set to
2833
2918
 * zero automatically when the structure is created.
2842
2927
#define PNG_HAVE_PNG_SIGNATURE    0x1000
2843
2928
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
2844
2929
 
2845
 
/* flags for the transformations the PNG library does on the image data */
 
2930
/* Flags for the transformations the PNG library does on the image data */
2846
2931
#define PNG_BGR                0x0001
2847
2932
#define PNG_INTERLACE          0x0002
2848
2933
#define PNG_PACK               0x0004
2870
2955
                       /*    0x800000L     Unused */
2871
2956
#define PNG_ADD_ALPHA       0x1000000L  /* Added to libpng-1.2.7 */
2872
2957
#define PNG_EXPAND_tRNS     0x2000000L  /* Added to libpng-1.2.9 */
2873
 
                       /*   0x4000000L  unused */
 
2958
#define PNG_PREMULTIPLY_ALPHA 0x4000000L  /* Added to libpng-1.2.41 */
 
2959
                                          /* by volker */
2874
2960
                       /*   0x8000000L  unused */
2875
2961
                       /*  0x10000000L  unused */
2876
2962
                       /*  0x20000000L  unused */
2877
2963
                       /*  0x40000000L  unused */
2878
2964
 
2879
 
/* flags for png_create_struct */
 
2965
/* Flags for png_create_struct */
2880
2966
#define PNG_STRUCT_PNG   0x0001
2881
2967
#define PNG_STRUCT_INFO  0x0002
2882
2968
 
2886
2972
#define PNG_COST_SHIFT 3
2887
2973
#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
2888
2974
 
2889
 
/* flags for the png_ptr->flags rather than declaring a byte for each one */
 
2975
/* Flags for the png_ptr->flags rather than declaring a byte for each one */
2890
2976
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001
2891
2977
#define PNG_FLAG_ZLIB_CUSTOM_LEVEL        0x0002
2892
2978
#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL    0x0004
2928
3014
#define PNG_FLAG_CRC_MASK           (PNG_FLAG_CRC_ANCILLARY_MASK | \
2929
3015
                                     PNG_FLAG_CRC_CRITICAL_MASK)
2930
3016
 
2931
 
/* save typing and make code easier to understand */
 
3017
/* Save typing and make code easier to understand */
2932
3018
 
2933
3019
#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
2934
3020
   abs((int)((c1).green) - (int)((c2).green)) + \
2941
3027
    (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) )
2942
3028
 
2943
3029
/* PNG_OUT_OF_RANGE returns true if value is outside the range
2944
 
   ideal-delta..ideal+delta.  Each argument is evaluated twice.
2945
 
   "ideal" and "delta" should be constants, normally simple
2946
 
   integers, "value" a variable. Added to libpng-1.2.6 JB */
 
3030
 * ideal-delta..ideal+delta.  Each argument is evaluated twice.
 
3031
 * "ideal" and "delta" should be constants, normally simple
 
3032
 * integers, "value" a variable. Added to libpng-1.2.6 JB
 
3033
 */
2947
3034
#define PNG_OUT_OF_RANGE(value, ideal, delta) \
2948
3035
        ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
2949
3036
 
2950
 
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
 
3037
/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */
2951
3038
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
2952
 
/* place to hold the signature string for a PNG file. */
 
3039
/* Place to hold the signature string for a PNG file. */
2953
3040
#ifdef PNG_USE_GLOBAL_ARRAYS
2954
3041
   PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8];
2955
3042
#else
3010
3097
/* Initialize png_ptr struct for reading, and allocate any other memory.
3011
3098
 * (old interface - DEPRECATED - use png_create_read_struct instead).
3012
3099
 */
3013
 
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
 
3100
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr))
 
3101
    PNG_DEPRECATED;
3014
3102
#undef png_read_init
3015
3103
#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
3016
3104
    PNG_LIBPNG_VER_STRING,  png_sizeof(png_struct));
3028
3116
/* Initialize png_ptr struct for writing, and allocate any other memory.
3029
3117
 * (old interface - DEPRECATED - use png_create_write_struct instead).
3030
3118
 */
3031
 
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
 
3119
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr))
 
3120
    PNG_DEPRECATED;
3032
3121
#undef png_write_init
3033
3122
#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
3034
3123
    PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
3041
3130
    png_info_size));
3042
3131
 
3043
3132
/* Allocate memory for an internal libpng struct */
3044
 
PNG_EXTERN png_voidp png_create_struct PNGARG((int type));
 
3133
PNG_EXTERN png_voidp png_create_struct PNGARG((int type)) PNG_PRIVATE;
3045
3134
 
3046
3135
/* Free memory from internal libpng struct */
3047
 
PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
 
3136
PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)) PNG_PRIVATE;
3048
3137
 
3049
3138
PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr
3050
 
  malloc_fn, png_voidp mem_ptr));
 
3139
  malloc_fn, png_voidp mem_ptr)) PNG_PRIVATE;
3051
3140
PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
3052
 
   png_free_ptr free_fn, png_voidp mem_ptr));
 
3141
   png_free_ptr free_fn, png_voidp mem_ptr)) PNG_PRIVATE;
3053
3142
 
3054
3143
/* Free any memory that info_ptr points to and reset struct. */
3055
3144
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
3056
 
   png_infop info_ptr));
 
3145
   png_infop info_ptr)) PNG_PRIVATE;
3057
3146
 
3058
3147
#ifndef PNG_1_0_X
3059
3148
/* Function to allocate memory for zlib. */
3060
 
PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
 
3149
PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items,
 
3150
   uInt size)) PNG_PRIVATE;
3061
3151
 
3062
3152
/* Function to free memory for zlib */
3063
 
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
 
3153
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)) PNG_PRIVATE;
3064
3154
 
3065
3155
#ifdef PNG_SIZE_T
3066
3156
/* Function to convert a sizeof an item to png_sizeof item */
3067
 
   PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
 
3157
   PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size))
 
3158
      PNG_PRIVATE;
3068
3159
#endif
3069
3160
 
3070
3161
/* Next four functions are used internally as callbacks.  PNGAPI is required
3071
 
 * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3. */
 
3162
 * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3.
 
3163
 */
3072
3164
 
3073
3165
PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
3074
 
   png_bytep data, png_size_t length));
 
3166
   png_bytep data, png_size_t length)) PNG_PRIVATE;
3075
3167
 
3076
3168
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
3077
3169
PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
3078
 
   png_bytep buffer, png_size_t length));
 
3170
   png_bytep buffer, png_size_t length)) PNG_PRIVATE;
3079
3171
#endif
3080
3172
 
3081
3173
PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
3082
 
   png_bytep data, png_size_t length));
 
3174
   png_bytep data, png_size_t length)) PNG_PRIVATE;
3083
3175
 
3084
 
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
3085
 
#if !defined(PNG_NO_STDIO)
3086
 
PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
 
3176
#ifdef PNG_WRITE_FLUSH_SUPPORTED
 
3177
#ifdef PNG_STDIO_SUPPORTED
 
3178
PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr))
 
3179
   PNG_PRIVATE;
3087
3180
#endif
3088
3181
#endif
3089
3182
#else /* PNG_1_0_X */
3090
3183
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
3091
3184
PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
3092
 
   png_bytep buffer, png_size_t length));
 
3185
   png_bytep buffer, png_size_t length)) PNG_PRIVATE;
3093
3186
#endif
3094
3187
#endif /* PNG_1_0_X */
3095
3188
 
3096
3189
/* Reset the CRC variable */
3097
 
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
 
3190
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3098
3191
 
3099
3192
/* Write the "data" buffer to whatever output you are using. */
3100
3193
PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data,
3101
 
   png_size_t length));
 
3194
   png_size_t length)) PNG_PRIVATE;
3102
3195
 
3103
3196
/* Read data from whatever input you are using into the "data" buffer */
3104
3197
PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
3105
 
   png_size_t length));
 
3198
   png_size_t length)) PNG_PRIVATE;
3106
3199
 
3107
3200
/* Read bytes into buf, and update png_ptr->crc */
3108
3201
PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
3109
 
   png_size_t length));
 
3202
   png_size_t length)) PNG_PRIVATE;
3110
3203
 
3111
3204
/* Decompress data in a chunk that uses compression */
3112
3205
#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
3113
3206
    defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
3114
3207
PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
3115
3208
   int comp_type, png_size_t chunklength,
3116
 
   png_size_t prefix_length, png_size_t *data_length));
 
3209
   png_size_t prefix_length, png_size_t *data_length)) PNG_PRIVATE;
3117
3210
#endif
3118
3211
 
3119
3212
/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
3120
 
PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
 
3213
PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)
 
3214
   PNG_PRIVATE);
3121
3215
 
3122
3216
/* Read the CRC from the file and compare it to the libpng calculated CRC */
3123
 
PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
 
3217
PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3124
3218
 
3125
3219
/* Calculate the CRC over a section of data.  Note that we are only
3126
3220
 * passing a maximum of 64K on systems that have this as a memory limit,
3127
3221
 * since this is the maximum buffer size we can specify.
3128
3222
 */
3129
3223
PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
3130
 
   png_size_t length));
 
3224
   png_size_t length)) PNG_PRIVATE;
3131
3225
 
3132
 
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
3133
 
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
 
3226
#ifdef PNG_WRITE_FLUSH_SUPPORTED
 
3227
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3134
3228
#endif
3135
3229
 
3136
 
/* simple function to write the signature */
3137
 
PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr));
 
3230
/* Simple function to write the signature */
 
3231
PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3138
3232
 
3139
 
/* write various chunks */
 
3233
/* Write various chunks */
3140
3234
 
3141
3235
/* Write the IHDR chunk, and update the png_struct with the necessary
3142
3236
 * information.
3144
3238
PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
3145
3239
   png_uint_32 height,
3146
3240
   int bit_depth, int color_type, int compression_method, int filter_method,
3147
 
   int interlace_method));
 
3241
   int interlace_method)) PNG_PRIVATE;
3148
3242
 
3149
3243
PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette,
3150
 
   png_uint_32 num_pal));
 
3244
   png_uint_32 num_pal)) PNG_PRIVATE;
3151
3245
 
3152
3246
PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
3153
 
   png_size_t length));
3154
 
 
3155
 
PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
3156
 
 
3157
 
#if defined(PNG_WRITE_gAMA_SUPPORTED)
 
3247
   png_size_t length)) PNG_PRIVATE;
 
3248
 
 
3249
PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3250
 
 
3251
#ifdef PNG_WRITE_gAMA_SUPPORTED
3158
3252
#ifdef PNG_FLOATING_POINT_SUPPORTED
3159
 
PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
 
3253
PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma))
 
3254
    PNG_PRIVATE;
3160
3255
#endif
3161
3256
#ifdef PNG_FIXED_POINT_SUPPORTED
3162
 
PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point
3163
 
    file_gamma));
 
3257
PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr,
 
3258
    png_fixed_point file_gamma)) PNG_PRIVATE;
3164
3259
#endif
3165
3260
#endif
3166
3261
 
3167
 
#if defined(PNG_WRITE_sBIT_SUPPORTED)
 
3262
#ifdef PNG_WRITE_sBIT_SUPPORTED
3168
3263
PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit,
3169
 
   int color_type));
 
3264
   int color_type)) PNG_PRIVATE;
3170
3265
#endif
3171
3266
 
3172
 
#if defined(PNG_WRITE_cHRM_SUPPORTED)
 
3267
#ifdef PNG_WRITE_cHRM_SUPPORTED
3173
3268
#ifdef PNG_FLOATING_POINT_SUPPORTED
3174
3269
PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
3175
3270
   double white_x, double white_y,
3176
3271
   double red_x, double red_y, double green_x, double green_y,
3177
 
   double blue_x, double blue_y));
 
3272
   double blue_x, double blue_y)) PNG_PRIVATE;
3178
3273
#endif
3179
3274
#ifdef PNG_FIXED_POINT_SUPPORTED
3180
3275
PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
3181
3276
   png_fixed_point int_white_x, png_fixed_point int_white_y,
3182
3277
   png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
3183
3278
   int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
3184
 
   png_fixed_point int_blue_y));
 
3279
   png_fixed_point int_blue_y)) PNG_PRIVATE;
3185
3280
#endif
3186
3281
#endif
3187
3282
 
3188
 
#if defined(PNG_WRITE_sRGB_SUPPORTED)
 
3283
#ifdef PNG_WRITE_sRGB_SUPPORTED
3189
3284
PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
3190
 
   int intent));
 
3285
   int intent)) PNG_PRIVATE;
3191
3286
#endif
3192
3287
 
3193
 
#if defined(PNG_WRITE_iCCP_SUPPORTED)
 
3288
#ifdef PNG_WRITE_iCCP_SUPPORTED
3194
3289
PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
3195
3290
   png_charp name, int compression_type,
3196
 
   png_charp profile, int proflen));
 
3291
   png_charp profile, int proflen)) PNG_PRIVATE;
3197
3292
   /* Note to maintainer: profile should be png_bytep */
3198
3293
#endif
3199
3294
 
3200
 
#if defined(PNG_WRITE_sPLT_SUPPORTED)
 
3295
#ifdef PNG_WRITE_sPLT_SUPPORTED
3201
3296
PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
3202
 
   png_sPLT_tp palette));
 
3297
   png_sPLT_tp palette)) PNG_PRIVATE;
3203
3298
#endif
3204
3299
 
3205
 
#if defined(PNG_WRITE_tRNS_SUPPORTED)
 
3300
#ifdef PNG_WRITE_tRNS_SUPPORTED
3206
3301
PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans,
3207
 
   png_color_16p values, int number, int color_type));
 
3302
   png_color_16p values, int number, int color_type)) PNG_PRIVATE;
3208
3303
#endif
3209
3304
 
3210
 
#if defined(PNG_WRITE_bKGD_SUPPORTED)
 
3305
#ifdef PNG_WRITE_bKGD_SUPPORTED
3211
3306
PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
3212
 
   png_color_16p values, int color_type));
 
3307
   png_color_16p values, int color_type)) PNG_PRIVATE;
3213
3308
#endif
3214
3309
 
3215
 
#if defined(PNG_WRITE_hIST_SUPPORTED)
 
3310
#ifdef PNG_WRITE_hIST_SUPPORTED
3216
3311
PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist,
3217
 
   int num_hist));
 
3312
   int num_hist)) PNG_PRIVATE;
3218
3313
#endif
3219
3314
 
3220
3315
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
3221
3316
    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
3222
3317
PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
3223
 
   png_charp key, png_charpp new_key));
 
3318
   png_charp key, png_charpp new_key)) PNG_PRIVATE;
3224
3319
#endif
3225
3320
 
3226
 
#if defined(PNG_WRITE_tEXt_SUPPORTED)
 
3321
#ifdef PNG_WRITE_tEXt_SUPPORTED
3227
3322
PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key,
3228
 
   png_charp text, png_size_t text_len));
 
3323
   png_charp text, png_size_t text_len)) PNG_PRIVATE;
3229
3324
#endif
3230
3325
 
3231
 
#if defined(PNG_WRITE_zTXt_SUPPORTED)
 
3326
#ifdef PNG_WRITE_zTXt_SUPPORTED
3232
3327
PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key,
3233
 
   png_charp text, png_size_t text_len, int compression));
 
3328
   png_charp text, png_size_t text_len, int compression)) PNG_PRIVATE;
3234
3329
#endif
3235
3330
 
3236
 
#if defined(PNG_WRITE_iTXt_SUPPORTED)
 
3331
#ifdef PNG_WRITE_iTXt_SUPPORTED
3237
3332
PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
3238
3333
   int compression, png_charp key, png_charp lang, png_charp lang_key,
3239
 
   png_charp text));
 
3334
   png_charp text)) PNG_PRIVATE;
3240
3335
#endif
3241
3336
 
3242
 
#if defined(PNG_TEXT_SUPPORTED)  /* Added at version 1.0.14 and 1.2.4 */
 
3337
#ifdef PNG_TEXT_SUPPORTED  /* Added at version 1.0.14 and 1.2.4 */
3243
3338
PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
3244
 
   png_infop info_ptr, png_textp text_ptr, int num_text));
 
3339
   png_infop info_ptr, png_textp text_ptr, int num_text)) PNG_PRIVATE;
3245
3340
#endif
3246
3341
 
3247
 
#if defined(PNG_WRITE_oFFs_SUPPORTED)
 
3342
#ifdef PNG_WRITE_oFFs_SUPPORTED
3248
3343
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
3249
 
   png_int_32 x_offset, png_int_32 y_offset, int unit_type));
 
3344
   png_int_32 x_offset, png_int_32 y_offset, int unit_type)) PNG_PRIVATE;
3250
3345
#endif
3251
3346
 
3252
 
#if defined(PNG_WRITE_pCAL_SUPPORTED)
 
3347
#ifdef PNG_WRITE_pCAL_SUPPORTED
3253
3348
PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
3254
3349
   png_int_32 X0, png_int_32 X1, int type, int nparams,
3255
 
   png_charp units, png_charpp params));
 
3350
   png_charp units, png_charpp params)) PNG_PRIVATE;
3256
3351
#endif
3257
3352
 
3258
 
#if defined(PNG_WRITE_pHYs_SUPPORTED)
 
3353
#ifdef PNG_WRITE_pHYs_SUPPORTED
3259
3354
PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
3260
3355
   png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
3261
 
   int unit_type));
 
3356
   int unit_type)) PNG_PRIVATE;
3262
3357
#endif
3263
3358
 
3264
 
#if defined(PNG_WRITE_tIME_SUPPORTED)
 
3359
#ifdef PNG_WRITE_tIME_SUPPORTED
3265
3360
PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
3266
 
   png_timep mod_time));
 
3361
   png_timep mod_time)) PNG_PRIVATE;
3267
3362
#endif
3268
3363
 
3269
 
#if defined(PNG_WRITE_sCAL_SUPPORTED)
 
3364
#ifdef PNG_WRITE_sCAL_SUPPORTED
3270
3365
#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
3271
3366
PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr,
3272
 
   int unit, double width, double height));
 
3367
   int unit, double width, double height)) PNG_PRIVATE;
3273
3368
#else
3274
3369
#ifdef PNG_FIXED_POINT_SUPPORTED
3275
3370
PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
3276
 
   int unit, png_charp width, png_charp height));
 
3371
   int unit, png_charp width, png_charp height)) PNG_PRIVATE;
3277
3372
#endif
3278
3373
#endif
3279
3374
#endif
3280
3375
 
3281
3376
/* Called when finished processing a row of data */
3282
 
PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
 
3377
PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3283
3378
 
3284
3379
/* Internal use only.   Called before first row of data */
3285
 
PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
 
3380
PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3286
3381
 
3287
 
#if defined(PNG_READ_GAMMA_SUPPORTED)
3288
 
PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr));
 
3382
#ifdef PNG_READ_GAMMA_SUPPORTED
 
3383
PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3289
3384
#endif
3290
3385
 
3291
 
/* combine a row of data, dealing with alpha, etc. if requested */
 
3386
/* Combine a row of data, dealing with alpha, etc. if requested */
3292
3387
PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
3293
 
   int mask));
 
3388
   int mask)) PNG_PRIVATE;
3294
3389
 
3295
 
#if defined(PNG_READ_INTERLACING_SUPPORTED)
3296
 
/* expand an interlaced row */
 
3390
#ifdef PNG_READ_INTERLACING_SUPPORTED
 
3391
/* Expand an interlaced row */
3297
3392
/* OLD pre-1.0.9 interface:
3298
3393
PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
3299
 
   png_bytep row, int pass, png_uint_32 transformations));
 
3394
   png_bytep row, int pass, png_uint_32 transformations)) PNG_PRIVATE;
3300
3395
 */
3301
 
PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
 
3396
PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3302
3397
#endif
3303
3398
 
3304
3399
/* GRR TO DO (2.0 or whenever):  simplify other internal calling interfaces */
3305
3400
 
3306
 
#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
3307
 
/* grab pixels out of a row for an interlaced pass */
 
3401
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
 
3402
/* Grab pixels out of a row for an interlaced pass */
3308
3403
PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
3309
 
   png_bytep row, int pass));
 
3404
   png_bytep row, int pass)) PNG_PRIVATE;
3310
3405
#endif
3311
3406
 
3312
 
/* unfilter a row */
 
3407
/* Unfilter a row */
3313
3408
PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
3314
 
   png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter));
 
3409
   png_row_infop row_info, png_bytep row, png_bytep prev_row,
 
3410
   int filter)) PNG_PRIVATE;
3315
3411
 
3316
3412
/* Choose the best filter to use and filter the row data */
3317
3413
PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
3318
 
   png_row_infop row_info));
 
3414
   png_row_infop row_info)) PNG_PRIVATE;
3319
3415
 
3320
3416
/* Write out the filtered row. */
3321
3417
PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
3322
 
   png_bytep filtered_row));
3323
 
/* finish a row while reading, dealing with interlacing passes, etc. */
 
3418
   png_bytep filtered_row)) PNG_PRIVATE;
 
3419
/* Finish a row while reading, dealing with interlacing passes, etc. */
3324
3420
PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
3325
3421
 
3326
 
/* initialize the row buffers, etc. */
3327
 
PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
3328
 
/* optional call to update the users info structure */
 
3422
/* Initialize the row buffers, etc. */
 
3423
PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3424
/* Optional call to update the users info structure */
3329
3425
PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
3330
 
   png_infop info_ptr));
 
3426
   png_infop info_ptr)) PNG_PRIVATE;
3331
3427
 
3332
 
/* these are the functions that do the transformations */
3333
 
#if defined(PNG_READ_FILLER_SUPPORTED)
 
3428
/* These are the functions that do the transformations */
 
3429
#ifdef PNG_READ_FILLER_SUPPORTED
3334
3430
PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
3335
 
   png_bytep row, png_uint_32 filler, png_uint_32 flags));
 
3431
   png_bytep row, png_uint_32 filler, png_uint_32 flags)) PNG_PRIVATE;
3336
3432
#endif
3337
3433
 
3338
 
#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
 
3434
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
3339
3435
PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
3340
 
   png_bytep row));
 
3436
   png_bytep row)) PNG_PRIVATE;
3341
3437
#endif
3342
3438
 
3343
 
#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
 
3439
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
3344
3440
PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
3345
 
   png_bytep row));
 
3441
   png_bytep row)) PNG_PRIVATE;
3346
3442
#endif
3347
3443
 
3348
 
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
 
3444
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
3349
3445
PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
3350
 
   png_bytep row));
 
3446
   png_bytep row)) PNG_PRIVATE;
3351
3447
#endif
3352
3448
 
3353
 
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
 
3449
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
3354
3450
PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
3355
 
   png_bytep row));
 
3451
   png_bytep row)) PNG_PRIVATE;
3356
3452
#endif
3357
3453
 
3358
3454
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
3359
3455
    defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
3360
3456
PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
3361
 
   png_bytep row, png_uint_32 flags));
 
3457
   png_bytep row, png_uint_32 flags)) PNG_PRIVATE;
3362
3458
#endif
3363
3459
 
3364
3460
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
3365
 
PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row));
 
3461
PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info,
 
3462
    png_bytep row)) PNG_PRIVATE;
3366
3463
#endif
3367
3464
 
3368
3465
#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
3369
 
PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row));
 
3466
PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info,
 
3467
    png_bytep row)) PNG_PRIVATE;
3370
3468
#endif
3371
3469
 
3372
 
#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 
3470
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
3373
3471
PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop
3374
 
   row_info, png_bytep row));
 
3472
   row_info, png_bytep row)) PNG_PRIVATE;
3375
3473
#endif
3376
3474
 
3377
 
#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 
3475
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
3378
3476
PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
3379
 
   png_bytep row));
3380
 
#endif
3381
 
 
3382
 
#if defined(PNG_READ_PACK_SUPPORTED)
3383
 
PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row));
3384
 
#endif
3385
 
 
3386
 
#if defined(PNG_READ_SHIFT_SUPPORTED)
 
3477
   png_bytep row)) PNG_PRIVATE;
 
3478
#endif
 
3479
 
 
3480
#ifdef PNG_READ_PACK_SUPPORTED
 
3481
PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info,
 
3482
    png_bytep row)) PNG_PRIVATE;
 
3483
#endif
 
3484
 
 
3485
#ifdef PNG_READ_SHIFT_SUPPORTED
3387
3486
PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row,
3388
 
   png_color_8p sig_bits));
 
3487
   png_color_8p sig_bits)) PNG_PRIVATE;
3389
3488
#endif
3390
3489
 
3391
3490
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
3392
 
PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row));
3393
 
#endif
3394
 
 
3395
 
#if defined(PNG_READ_16_TO_8_SUPPORTED)
3396
 
PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row));
3397
 
#endif
3398
 
 
3399
 
#if defined(PNG_READ_DITHER_SUPPORTED)
 
3491
PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info,
 
3492
    png_bytep row)) PNG_PRIVATE;
 
3493
#endif
 
3494
 
 
3495
#ifdef PNG_READ_16_TO_8_SUPPORTED
 
3496
PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info,
 
3497
    png_bytep row)) PNG_PRIVATE;
 
3498
#endif
 
3499
 
 
3500
#ifdef PNG_READ_DITHER_SUPPORTED
3400
3501
PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info,
3401
 
   png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup));
 
3502
   png_bytep row, png_bytep palette_lookup,
 
3503
    png_bytep dither_lookup)) PNG_PRIVATE;
3402
3504
 
3403
 
#  if defined(PNG_CORRECT_PALETTE_SUPPORTED)
 
3505
#  ifdef PNG_CORRECT_PALETTE_SUPPORTED
3404
3506
PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
3405
 
   png_colorp palette, int num_palette));
 
3507
   png_colorp palette, int num_palette)) PNG_PRIVATE;
3406
3508
#  endif
3407
3509
#endif
3408
3510
 
3409
3511
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
3410
 
PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row));
 
3512
PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info,
 
3513
    png_bytep row)) PNG_PRIVATE;
3411
3514
#endif
3412
3515
 
3413
 
#if defined(PNG_WRITE_PACK_SUPPORTED)
 
3516
#ifdef PNG_WRITE_PACK_SUPPORTED
3414
3517
PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
3415
 
   png_bytep row, png_uint_32 bit_depth));
 
3518
   png_bytep row, png_uint_32 bit_depth)) PNG_PRIVATE;
3416
3519
#endif
3417
3520
 
3418
 
#if defined(PNG_WRITE_SHIFT_SUPPORTED)
 
3521
#ifdef PNG_WRITE_SHIFT_SUPPORTED
3419
3522
PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row,
3420
 
   png_color_8p bit_depth));
 
3523
   png_color_8p bit_depth)) PNG_PRIVATE;
3421
3524
#endif
3422
3525
 
3423
 
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
3424
 
#if defined(PNG_READ_GAMMA_SUPPORTED)
 
3526
#ifdef PNG_READ_BACKGROUND_SUPPORTED
 
3527
#ifdef PNG_READ_GAMMA_SUPPORTED
3425
3528
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
3426
3529
   png_color_16p trans_values, png_color_16p background,
3427
3530
   png_color_16p background_1,
3428
3531
   png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
3429
3532
   png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
3430
 
   png_uint_16pp gamma_16_to_1, int gamma_shift));
 
3533
   png_uint_16pp gamma_16_to_1, int gamma_shift)) PNG_PRIVATE;
3431
3534
#else
3432
3535
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
3433
 
   png_color_16p trans_values, png_color_16p background));
 
3536
   png_color_16p trans_values, png_color_16p background)) PNG_PRIVATE;
3434
3537
#endif
3435
3538
#endif
3436
3539
 
3437
 
#if defined(PNG_READ_GAMMA_SUPPORTED)
 
3540
#ifdef PNG_READ_GAMMA_SUPPORTED
3438
3541
PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row,
3439
3542
   png_bytep gamma_table, png_uint_16pp gamma_16_table,
3440
 
   int gamma_shift));
 
3543
   int gamma_shift)) PNG_PRIVATE;
3441
3544
#endif
3442
3545
 
3443
 
#if defined(PNG_READ_EXPAND_SUPPORTED)
 
3546
#ifdef PNG_READ_EXPAND_SUPPORTED
3444
3547
PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
3445
 
   png_bytep row, png_colorp palette, png_bytep trans, int num_trans));
 
3548
   png_bytep row, png_colorp palette, png_bytep trans,
 
3549
   int num_trans)) PNG_PRIVATE;
3446
3550
PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
3447
 
   png_bytep row, png_color_16p trans_value));
 
3551
   png_bytep row, png_color_16p trans_value)) PNG_PRIVATE;
3448
3552
#endif
3449
3553
 
3450
3554
/* The following decodes the appropriate chunks, and does error correction,
3451
3555
 * then calls the appropriate callback for the chunk if it is valid.
3452
3556
 */
3453
3557
 
3454
 
/* decode the IHDR chunk */
 
3558
/* Decode the IHDR chunk */
3455
3559
PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
3456
 
   png_uint_32 length));
 
3560
   png_uint_32 length)) PNG_PRIVATE;
3457
3561
PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
3458
3562
   png_uint_32 length));
3459
3563
PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
3460
3564
   png_uint_32 length));
3461
3565
 
3462
 
#if defined(PNG_READ_bKGD_SUPPORTED)
 
3566
#ifdef PNG_READ_bKGD_SUPPORTED
3463
3567
PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
3464
 
   png_uint_32 length));
 
3568
   png_uint_32 length)) PNG_PRIVATE;
3465
3569
#endif
3466
3570
 
3467
 
#if defined(PNG_READ_cHRM_SUPPORTED)
 
3571
#ifdef PNG_READ_cHRM_SUPPORTED
3468
3572
PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
3469
 
   png_uint_32 length));
 
3573
   png_uint_32 length)) PNG_PRIVATE;
3470
3574
#endif
3471
3575
 
3472
 
#if defined(PNG_READ_gAMA_SUPPORTED)
 
3576
#ifdef PNG_READ_gAMA_SUPPORTED
3473
3577
PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
3474
 
   png_uint_32 length));
 
3578
   png_uint_32 length)) PNG_PRIVATE;
3475
3579
#endif
3476
3580
 
3477
 
#if defined(PNG_READ_hIST_SUPPORTED)
 
3581
#ifdef PNG_READ_hIST_SUPPORTED
3478
3582
PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
3479
 
   png_uint_32 length));
 
3583
   png_uint_32 length)) PNG_PRIVATE;
3480
3584
#endif
3481
3585
 
3482
 
#if defined(PNG_READ_iCCP_SUPPORTED)
 
3586
#ifdef PNG_READ_iCCP_SUPPORTED
3483
3587
extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
3484
3588
   png_uint_32 length));
3485
3589
#endif /* PNG_READ_iCCP_SUPPORTED */
3486
3590
 
3487
 
#if defined(PNG_READ_iTXt_SUPPORTED)
 
3591
#ifdef PNG_READ_iTXt_SUPPORTED
3488
3592
PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
3489
 
   png_uint_32 length));
 
3593
   png_uint_32 length)) PNG_PRIVATE;
3490
3594
#endif
3491
3595
 
3492
 
#if defined(PNG_READ_oFFs_SUPPORTED)
 
3596
#ifdef PNG_READ_oFFs_SUPPORTED
3493
3597
PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
3494
 
   png_uint_32 length));
 
3598
   png_uint_32 length)) PNG_PRIVATE;
3495
3599
#endif
3496
3600
 
3497
 
#if defined(PNG_READ_pCAL_SUPPORTED)
 
3601
#ifdef PNG_READ_pCAL_SUPPORTED
3498
3602
PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
3499
 
   png_uint_32 length));
 
3603
   png_uint_32 length)) PNG_PRIVATE;
3500
3604
#endif
3501
3605
 
3502
 
#if defined(PNG_READ_pHYs_SUPPORTED)
 
3606
#ifdef PNG_READ_pHYs_SUPPORTED
3503
3607
PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
3504
 
   png_uint_32 length));
 
3608
   png_uint_32 length)) PNG_PRIVATE;
3505
3609
#endif
3506
3610
 
3507
 
#if defined(PNG_READ_sBIT_SUPPORTED)
 
3611
#ifdef PNG_READ_sBIT_SUPPORTED
3508
3612
PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
3509
 
   png_uint_32 length));
 
3613
   png_uint_32 length)) PNG_PRIVATE;
3510
3614
#endif
3511
3615
 
3512
 
#if defined(PNG_READ_sCAL_SUPPORTED)
 
3616
#ifdef PNG_READ_sCAL_SUPPORTED
3513
3617
PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
3514
 
   png_uint_32 length));
 
3618
   png_uint_32 length)) PNG_PRIVATE;
3515
3619
#endif
3516
3620
 
3517
 
#if defined(PNG_READ_sPLT_SUPPORTED)
 
3621
#ifdef PNG_READ_sPLT_SUPPORTED
3518
3622
extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
3519
 
   png_uint_32 length));
 
3623
   png_uint_32 length)) PNG_PRIVATE;
3520
3624
#endif /* PNG_READ_sPLT_SUPPORTED */
3521
3625
 
3522
 
#if defined(PNG_READ_sRGB_SUPPORTED)
 
3626
#ifdef PNG_READ_sRGB_SUPPORTED
3523
3627
PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
3524
 
   png_uint_32 length));
 
3628
   png_uint_32 length)) PNG_PRIVATE;
3525
3629
#endif
3526
3630
 
3527
 
#if defined(PNG_READ_tEXt_SUPPORTED)
 
3631
#ifdef PNG_READ_tEXt_SUPPORTED
3528
3632
PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
3529
 
   png_uint_32 length));
 
3633
   png_uint_32 length)) PNG_PRIVATE;
3530
3634
#endif
3531
3635
 
3532
 
#if defined(PNG_READ_tIME_SUPPORTED)
 
3636
#ifdef PNG_READ_tIME_SUPPORTED
3533
3637
PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
3534
 
   png_uint_32 length));
 
3638
   png_uint_32 length)) PNG_PRIVATE;
3535
3639
#endif
3536
3640
 
3537
 
#if defined(PNG_READ_tRNS_SUPPORTED)
 
3641
#ifdef PNG_READ_tRNS_SUPPORTED
3538
3642
PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
3539
 
   png_uint_32 length));
 
3643
   png_uint_32 length)) PNG_PRIVATE;
3540
3644
#endif
3541
3645
 
3542
 
#if defined(PNG_READ_zTXt_SUPPORTED)
 
3646
#ifdef PNG_READ_zTXt_SUPPORTED
3543
3647
PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
3544
 
   png_uint_32 length));
 
3648
   png_uint_32 length)) PNG_PRIVATE;
3545
3649
#endif
3546
3650
 
3547
3651
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
3548
 
   png_infop info_ptr, png_uint_32 length));
 
3652
   png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE;
3549
3653
 
3550
3654
PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
3551
 
   png_bytep chunk_name));
3552
 
 
3553
 
/* handle the transformations for reading and writing */
3554
 
PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
3555
 
PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
3556
 
 
3557
 
PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
 
3655
   png_bytep chunk_name)) PNG_PRIVATE;
 
3656
 
 
3657
/* Handle the transformations for reading and writing */
 
3658
PNG_EXTERN void png_do_read_transformations
 
3659
   PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3660
PNG_EXTERN void png_do_write_transformations
 
3661
   PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3662
 
 
3663
PNG_EXTERN void png_init_read_transformations
 
3664
   PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3558
3665
 
3559
3666
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
3560
3667
PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
3561
 
   png_infop info_ptr));
 
3668
   png_infop info_ptr)) PNG_PRIVATE;
3562
3669
PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
3563
 
   png_infop info_ptr));
3564
 
PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
 
3670
   png_infop info_ptr)) PNG_PRIVATE;
 
3671
PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3565
3672
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
3566
 
   png_uint_32 length));
3567
 
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
3568
 
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
 
3673
   png_uint_32 length)) PNG_PRIVATE;
 
3674
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3675
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3569
3676
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
3570
 
   png_bytep buffer, png_size_t buffer_length));
3571
 
PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
 
3677
   png_bytep buffer, png_size_t buffer_length)) PNG_PRIVATE;
 
3678
PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3572
3679
PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
3573
 
   png_bytep buffer, png_size_t buffer_length));
3574
 
PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
 
3680
   png_bytep buffer, png_size_t buffer_length)) PNG_PRIVATE;
 
3681
PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3575
3682
PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
3576
 
   png_infop info_ptr, png_uint_32 length));
 
3683
   png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE;
3577
3684
PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
3578
 
   png_infop info_ptr));
 
3685
   png_infop info_ptr)) PNG_PRIVATE;
3579
3686
PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
3580
 
   png_infop info_ptr));
3581
 
PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
 
3687
   png_infop info_ptr)) PNG_PRIVATE;
 
3688
PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr,
 
3689
   png_bytep row)) PNG_PRIVATE;
3582
3690
PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
3583
 
   png_infop info_ptr));
 
3691
   png_infop info_ptr)) PNG_PRIVATE;
3584
3692
PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
3585
 
   png_infop info_ptr));
3586
 
PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
3587
 
#if defined(PNG_READ_tEXt_SUPPORTED)
 
3693
   png_infop info_ptr)) PNG_PRIVATE;
 
3694
PNG_EXTERN void png_read_push_finish_row
 
3695
   PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3696
#ifdef PNG_READ_tEXt_SUPPORTED
3588
3697
PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
3589
 
   png_infop info_ptr, png_uint_32 length));
 
3698
   png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE;
3590
3699
PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
3591
 
   png_infop info_ptr));
 
3700
   png_infop info_ptr)) PNG_PRIVATE;
3592
3701
#endif
3593
 
#if defined(PNG_READ_zTXt_SUPPORTED)
 
3702
#ifdef PNG_READ_zTXt_SUPPORTED
3594
3703
PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
3595
 
   png_infop info_ptr, png_uint_32 length));
 
3704
   png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE;
3596
3705
PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
3597
 
   png_infop info_ptr));
 
3706
   png_infop info_ptr)) PNG_PRIVATE;
3598
3707
#endif
3599
 
#if defined(PNG_READ_iTXt_SUPPORTED)
 
3708
#ifdef PNG_READ_iTXt_SUPPORTED
3600
3709
PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
3601
 
   png_infop info_ptr, png_uint_32 length));
 
3710
   png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE;
3602
3711
PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
3603
 
   png_infop info_ptr));
 
3712
   png_infop info_ptr)) PNG_PRIVATE;
3604
3713
#endif
3605
3714
 
3606
3715
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
3607
3716
 
3608
3717
#ifdef PNG_MNG_FEATURES_SUPPORTED
3609
3718
PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
3610
 
   png_bytep row));
 
3719
   png_bytep row)) PNG_PRIVATE;
3611
3720
PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
3612
 
   png_bytep row));
 
3721
   png_bytep row)) PNG_PRIVATE;
3613
3722
#endif
3614
3723
 
3615
 
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
3616
 
#if defined(PNG_MMX_CODE_SUPPORTED)
 
3724
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
 
3725
#ifdef PNG_MMX_CODE_SUPPORTED
3617
3726
/* png.c */ /* PRIVATE */
3618
 
PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr));
3619
 
#endif
3620
 
#endif
3621
 
 
 
3727
PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)) PNG_PRIVATE;
 
3728
#endif
 
3729
#endif
 
3730
 
 
3731
 
 
3732
/* The following six functions will be exported in libpng-1.4.0. */
3622
3733
#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
3623
3734
PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr,
3624
3735
png_infop info_ptr));
3635
3746
PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr,
3636
3747
png_infop info_ptr));
3637
3748
 
3638
 
#if defined(PNG_pHYs_SUPPORTED)
 
3749
#ifdef PNG_pHYs_SUPPORTED
3639
3750
PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr,
3640
3751
png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
3641
3752
#endif /* PNG_pHYs_SUPPORTED */
3642
3753
#endif  /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
3643
3754
 
3644
3755
/* Read the chunk header (length + type name) */
3645
 
PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
 
3756
PNG_EXTERN png_uint_32 png_read_chunk_header
 
3757
   PNGARG((png_structp png_ptr)) PNG_PRIVATE;
3646
3758
 
3647
3759
/* Added at libpng version 1.2.34 */
3648
 
#if defined(PNG_cHRM_SUPPORTED)
3649
 
PNG_EXTERN int png_check_cHRM_fixed  PNGARG((png_structp png_ptr,
 
3760
#ifdef PNG_cHRM_SUPPORTED
 
3761
PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr,
3650
3762
   png_fixed_point int_white_x, png_fixed_point int_white_y,
3651
3763
   png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
3652
3764
   int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
3653
 
   png_fixed_point int_blue_y));
3654
 
#endif
 
3765
   png_fixed_point int_blue_y)) PNG_PRIVATE;
 
3766
#endif
 
3767
 
 
3768
#ifdef PNG_cHRM_SUPPORTED
 
3769
#ifdef PNG_CHECK_cHRM_SUPPORTED
 
3770
/* Added at libpng version 1.2.34 */
 
3771
PNG_EXTERN void png_64bit_product PNGARG((long v1, long v2,
 
3772
   unsigned long *hi_product, unsigned long *lo_product)) PNG_PRIVATE;
 
3773
#endif
 
3774
#endif
 
3775
 
 
3776
/* Added at libpng version 1.2.41 */
 
3777
PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr,
 
3778
   png_uint_32 width, png_uint_32 height, int bit_depth,
 
3779
   int color_type, int interlace_type, int compression_type,
 
3780
   int filter_type)) PNG_PRIVATE;
 
3781
 
 
3782
/* Added at libpng version 1.2.41 */
 
3783
PNG_EXTERN png_voidp png_calloc PNGARG((png_structp png_ptr,
 
3784
   png_uint_32 size));
3655
3785
 
3656
3786
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
3657
3787
 
3662
3792
#endif
3663
3793
 
3664
3794
#endif /* PNG_VERSION_INFO_ONLY */
3665
 
/* do not put anything past this line */
 
3795
/* Do not put anything past this line */
3666
3796
#endif /* PNG_H */