Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/libpng/png.h

    r2 r561  
    11/* png.h - header file for PNG reference library
    22 *
    3  * libpng version 1.2.29 - May 8, 2008
    4  * Copyright (c) 1998-2008 Glenn Randers-Pehrson
     3 * libpng version 1.2.40 - September 10, 2009
     4 * Copyright (c) 1998-2009 Glenn Randers-Pehrson
    55 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
    66 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
     7 *
     8 * This code is released under the libpng license (See LICENSE, below)
    79 *
    810 * Authors and maintainers:
    911 *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
    1012 *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
    11  *  libpng versions 0.97, January 1998, through 1.2.29 - May 8, 2008: Glenn
     13 *  libpng versions 0.97, January 1998, through 1.2.40 - September 10, 2009: Glenn
    1214 *  See also "Contributing Authors", below.
    1315 *
     
    193195 *    1.0.35                  10    10035  10.so.0.35[.0]
    194196 *    1.2.29                  13    10229  12.so.0.29[.0]
     197 *    1.0.37                  10    10037  10.so.0.37[.0]
     198 *    1.2.30beta01-04         13    10230  12.so.0.30[.0]
     199 *    1.0.38rc01-08           10    10038  10.so.0.38[.0]
     200 *    1.2.30rc01-08           13    10230  12.so.0.30[.0]
     201 *    1.0.38                  10    10038  10.so.0.38[.0]
     202 *    1.2.30                  13    10230  12.so.0.30[.0]
     203 *    1.0.39rc01-03           10    10039  10.so.0.39[.0]
     204 *    1.2.31rc01-03           13    10231  12.so.0.31[.0]
     205 *    1.0.39                  10    10039  10.so.0.39[.0]
     206 *    1.2.31                  13    10231  12.so.0.31[.0]
     207 *    1.2.32beta01-02         13    10232  12.so.0.32[.0]
     208 *    1.0.40rc01              10    10040  10.so.0.40[.0]
     209 *    1.2.32rc01              13    10232  12.so.0.32[.0]
     210 *    1.0.40                  10    10040  10.so.0.40[.0]
     211 *    1.2.32                  13    10232  12.so.0.32[.0]
     212 *    1.2.33beta01-02         13    10233  12.so.0.33[.0]
     213 *    1.2.33rc01-02           13    10233  12.so.0.33[.0]
     214 *    1.0.41rc01              10    10041  10.so.0.41[.0]
     215 *    1.2.33                  13    10233  12.so.0.33[.0]
     216 *    1.0.41                  10    10041  10.so.0.41[.0]
     217 *    1.2.34beta01-07         13    10234  12.so.0.34[.0]
     218 *    1.0.42rc01              10    10042  10.so.0.42[.0]
     219 *    1.2.34rc01              13    10234  12.so.0.34[.0]
     220 *    1.0.42                  10    10042  10.so.0.42[.0]
     221 *    1.2.34                  13    10234  12.so.0.34[.0]
     222 *    1.2.35beta01-03         13    10235  12.so.0.35[.0]
     223 *    1.0.43rc01-02           10    10043  10.so.0.43[.0]
     224 *    1.2.35rc01-02           13    10235  12.so.0.35[.0]
     225 *    1.0.43                  10    10043  10.so.0.43[.0]
     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.2.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]
    195248 *
    196249 *    Henceforth the source version will match the shared-library major
     
    222275 * this sentence.
    223276 *
    224  * libpng versions 1.2.6, August 15, 2004, through 1.2.29, May 8, 2008, are
    225  * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
     277 * This code is released under the libpng license.
     278 *
     279 * libpng versions 1.2.6, August 15, 2004, through 1.2.40, September 10, 2009, are
     280 * Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
    226281 * distributed according to the same disclaimer and license as libpng-1.2.5
    227282 * with the following individual added to the list of Contributing Authors:
     
    334389 * =========================
    335390 *
    336  *    May 8, 2008
     391 *    September 10, 2009
    337392 *
    338393 *    Since the PNG Development group is an ad-hoc body, we can't make
     
    340395 *
    341396 *    This is your unofficial assurance that libpng from version 0.71 and
    342  *    upward through 1.2.29 are Y2K compliant.  It is my belief that earlier
     397 *    upward through 1.2.40 are Y2K compliant.  It is my belief that earlier
    343398 *    versions were also Y2K compliant.
    344399 *
     
    396451
    397452/* Version information for png.h - this should match the version in png.c */
    398 #define PNG_LIBPNG_VER_STRING "1.2.29"
     453#define PNG_LIBPNG_VER_STRING "1.2.40"
    399454#define PNG_HEADER_VERSION_STRING \
    400    " libpng version 1.2.29 - May 8, 2008\n"
     455   " libpng version 1.2.40 - September 10, 2009\n"
    401456
    402457#define PNG_LIBPNG_VER_SONUM   0
     
    406461#define PNG_LIBPNG_VER_MAJOR   1
    407462#define PNG_LIBPNG_VER_MINOR   2
    408 #define PNG_LIBPNG_VER_RELEASE 29
     463#define PNG_LIBPNG_VER_RELEASE 40
    409464/* This should match the numeric part of the final component of
    410  * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
     465 * PNG_LIBPNG_VER_STRING, omitting any leading zero:
     466 */
    411467
    412468#define PNG_LIBPNG_VER_BUILD  0
     
    418474#define PNG_LIBPNG_BUILD_STABLE   4
    419475#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
    420  
     476
    421477/* Release-Specific Flags */
    422478#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with
     
    433489 * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
    434490 * version 1.0.0 was mis-numbered 100 instead of 10000).  From
    435  * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release */
    436 #define PNG_LIBPNG_VER 10229 /* 1.2.29 */
     491 * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
     492 */
     493#define PNG_LIBPNG_VER 10240 /* 1.2.40 */
    437494
    438495#ifndef PNG_VERSION_INFO_ONLY
    439 /* include the compression library's header */
     496/* Include the compression library's header */
    440497#include "zlib.h"
    441498#endif
    442499
    443 /* include all user configurable info, including optional assembler routines */
     500/* Include all user configurable info, including optional assembler routines */
    444501#include "pngconf.h"
    445502
     
    449506 * VS_FF_PRIVATEBUILD File *was not* built using standard release
    450507 * procedures. If this value is given, the StringFileInfo block must
    451  * contain a PrivateBuild string. 
     508 * contain a PrivateBuild string.
    452509 *
    453510 * VS_FF_SPECIALBUILD File *was* built by the original company using
    454511 * standard release procedures but is a variation of the standard
    455512 * file of the same version number. If this value is given, the
    456  * StringFileInfo block must contain a SpecialBuild string. 
     513 * StringFileInfo block must contain a SpecialBuild string.
    457514 */
    458515
     
    516573#endif
    517574
    518 /* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
     575/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */
    519576#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
    520577/* Version information for C files, stored in png.c.  This had better match
     
    523580#ifdef PNG_USE_GLOBAL_ARRAYS
    524581PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18];
    525   /* need room for 99.99.99beta99z */
     582  /* Need room for 99.99.99beta99z */
    526583#else
    527584#define png_libpng_ver png_get_header_ver(NULL)
     
    642699
    643700/* Supported compression types for text in PNG files (tEXt, and zTXt).
    644  * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */
     701 * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed.
     702 */
    645703#define PNG_TEXT_COMPRESSION_NONE_WR -3
    646704#define PNG_TEXT_COMPRESSION_zTXt_WR -2
     
    669727typedef png_time FAR * FAR * png_timepp;
    670728
    671 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
     729#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
     730 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
    672731/* png_unknown_chunk is a structure to hold queued chunks for which there is
    673732 * no specific support.  The idea is that we can use this to queue
     
    731790typedef struct png_info_struct
    732791{
    733    /* the following are necessary for every PNG file */
     792   /* The following are necessary for every PNG file */
    734793   png_uint_32 width;       /* width of image in pixels (from IHDR) */
    735794   png_uint_32 height;      /* height of image in pixels (from IHDR) */
     
    904963#endif
    905964
    906 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
    907    /* storage for unknown chunks that the library doesn't recognize. */
     965#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
     966 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
     967   /* Storage for unknown chunks that the library doesn't recognize. */
    908968   png_unknown_chunkp unknown_chunks;
    909969   png_size_t unknown_chunks_num;
     
    920980
    921981#if defined(PNG_sPLT_SUPPORTED)
    922    /* data on sPLT chunks (there may be more than one). */
     982   /* Data on sPLT chunks (there may be more than one). */
    923983   png_sPLT_tp splt_palettes;
    924984   png_uint_32 splt_palettes_num;
     
    11351195#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */
    11361196#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */
    1137 #define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* WRITE only */
     1197#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only, deprecated */
     1198/* Added to libpng-1.2.34 */
     1199#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800  /* write only */
     1200#define PNG_TRANSFORM_STRIP_FILLER_AFTER  0x1000  /* write only */
    11381201
    11391202/* Flags for MNG supported features */
     
    12051268   png_bytep prev_row;        /* buffer to save previous (unfiltered) row */
    12061269   png_bytep row_buf;         /* buffer to save current (unfiltered) row */
    1207 #ifndef PNG_NO_WRITE_FILTERING
     1270#ifndef PNG_NO_WRITE_FILTER
    12081271   png_bytep sub_row;         /* buffer to save "sub" row when filtering */
    12091272   png_bytep up_row;          /* buffer to save "up" row when filtering */
     
    12521315
    12531316#if defined(PNG_WRITE_FLUSH_SUPPORTED)
    1254    png_flush_ptr output_flush_fn;/* Function for flushing output */
     1317   png_flush_ptr output_flush_fn; /* Function for flushing output */
    12551318   png_uint_32 flush_dist;    /* how many rows apart to flush, 0 - no flush */
    12561319   png_uint_32 flush_rows;    /* number of rows written since last flush */
     
    13501413
    13511414#ifdef PNG_FREE_ME_SUPPORTED
    1352    png_uint_32 free_me;       /* flags items libpng is responsible for freeing */
     1415   png_uint_32 free_me;   /* flags items libpng is responsible for freeing */
    13531416#endif
    13541417
     
    13581421#endif
    13591422
    1360 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
     1423#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
    13611424   int num_chunk_list;
    13621425   png_bytep chunk_list;
     
    13761439    defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
    13771440    defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
    1378 /* changed from png_byte to png_uint_32 at version 1.2.0 */
     1441/* Changed from png_byte to png_uint_32 at version 1.2.0 */
    13791442#ifdef PNG_1_0_X
    13801443   png_byte mng_features_permitted;
     
    14121475/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
    14131476#ifdef PNG_USER_MEM_SUPPORTED
    1414    png_voidp mem_ptr;                /* user supplied struct for mem functions */
    1415    png_malloc_ptr malloc_fn;         /* function for allocating memory */
    1416    png_free_ptr free_fn;             /* function for freeing memory */
     1477   png_voidp mem_ptr;            /* user supplied struct for mem functions */
     1478   png_malloc_ptr malloc_fn;     /* function for allocating memory */
     1479   png_free_ptr free_fn;         /* function for freeing memory */
    14171480#endif
    14181481
    14191482/* New member added in libpng-1.0.13 and 1.2.0 */
    1420    png_bytep big_row_buf;         /* buffer to save current (unfiltered) row */
     1483   png_bytep big_row_buf;        /* buffer to save current (unfiltered) row */
    14211484
    14221485#if defined(PNG_READ_DITHER_SUPPORTED)
    14231486/* The following three members were added at version 1.0.14 and 1.2.4 */
    1424    png_bytep dither_sort;            /* working sort array */
    1425    png_bytep index_to_palette;       /* where the original index currently is */
    1426                                      /* in the palette */
    1427    png_bytep palette_to_index;       /* which original index points to this */
    1428                                      /* palette color */
     1487   png_bytep dither_sort;        /* working sort array */
     1488   png_bytep index_to_palette;   /* where the original index currently is */
     1489                                 /* in the palette */
     1490   png_bytep palette_to_index;   /* which original index points to this */
     1491                                 /* palette color */
    14291492#endif
    14301493
     
    14391502/* New member added in libpng-1.0.25 and 1.2.17 */
    14401503#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
    1441    /* storage for unknown chunk that the library doesn't recognize. */
     1504   /* Storage for unknown chunk that the library doesn't recognize. */
    14421505   png_unknown_chunk unknown_chunk;
    14431506#endif
     
    14451508/* New members added in libpng-1.2.26 */
    14461509  png_uint_32 old_big_row_buf_size, old_prev_row_size;
     1510
     1511/* New member added in libpng-1.2.30 */
     1512  png_charp chunkdata;  /* buffer for reading chunk data */
     1513
    14471514};
    14481515
     
    14511518 * do not agree upon the version number.
    14521519 */
    1453 typedef png_structp version_1_2_29;
     1520typedef png_structp version_1_2_40;
    14541521
    14551522typedef png_struct FAR * FAR * png_structpp;
     
    15551622
    15561623#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
    1557 /* read the information before the actual image data. */
     1624/* Read the information before the actual image data. */
    15581625extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
    15591626   png_infop info_ptr));
     
    15681635/* "time.h" functions are not supported on WindowsCE */
    15691636#if defined(PNG_WRITE_tIME_SUPPORTED)
    1570 /* convert from a struct tm to png_time */
     1637/* Convert from a struct tm to png_time */
    15711638extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
    15721639   struct tm FAR * ttime));
    15731640
    1574 /* convert from time_t to png_time.  Uses gmtime() */
     1641/* Convert from time_t to png_time.  Uses gmtime() */
    15751642extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
    15761643   time_t ttime));
     
    16921759
    16931760#if defined(PNG_READ_16_TO_8_SUPPORTED)
    1694 /* strip the second byte of information from a 16-bit depth file. */
     1761/* Strip the second byte of information from a 16-bit depth file. */
    16951762extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
    16961763#endif
     
    17281795#endif
    17291796
    1730 /* optional update palette with requested transformations */
     1797/* Optional update palette with requested transformations */
    17311798extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
    17321799
    1733 /* optional call to update the users info structure */
     1800/* Optional call to update the users info structure */
    17341801extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
    17351802   png_infop info_ptr));
    17361803
    17371804#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
    1738 /* read one or more rows of image data. */
     1805/* Read one or more rows of image data. */
    17391806extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
    17401807   png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
     
    17421809
    17431810#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
    1744 /* read a row of data. */
     1811/* Read a row of data. */
    17451812extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
    17461813   png_bytep row,
     
    17491816
    17501817#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
    1751 /* read the whole image into memory at once. */
     1818/* Read the whole image into memory at once. */
    17521819extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
    17531820   png_bytepp image));
    17541821#endif
    17551822
    1756 /* write a row of image data */
     1823/* Write a row of image data */
    17571824extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
    17581825   png_bytep row));
    17591826
    1760 /* write a few rows of image data */
     1827/* Write a few rows of image data */
    17611828extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
    17621829   png_bytepp row, png_uint_32 num_rows));
    17631830
    1764 /* write the image data */
     1831/* Write the image data */
    17651832extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
    17661833   png_bytepp image));
    17671834
    1768 /* writes the end of the PNG file. */
     1835/* Writes the end of the PNG file. */
    17691836extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
    17701837   png_infop info_ptr));
    17711838
    17721839#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
    1773 /* read the end of the PNG file. */
     1840/* Read the end of the PNG file. */
    17741841extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
    17751842   png_infop info_ptr));
    17761843#endif
    17771844
    1778 /* free any memory associated with the png_info_struct */
     1845/* Free any memory associated with the png_info_struct */
    17791846extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
    17801847   png_infopp info_ptr_ptr));
    17811848
    1782 /* free any memory associated with the png_struct and the png_info_structs */
     1849/* Free any memory associated with the png_struct and the png_info_structs */
    17831850extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
    17841851   png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
    17851852
    1786 /* free all memory used by the read (old method - NOT DLL EXPORTED) */
     1853/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
    17871854extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
    17881855   png_infop end_info_ptr));
    17891856
    1790 /* free any memory associated with the png_struct and the png_info_structs */
     1857/* Free any memory associated with the png_struct and the png_info_structs */
    17911858extern PNG_EXPORT(void,png_destroy_write_struct)
    17921859   PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
    17931860
    1794 /* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
     1861/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
    17951862extern void png_write_destroy PNGARG((png_structp png_ptr));
    17961863
    1797 /* set the libpng method of handling chunk CRC errors */
     1864/* Set the libpng method of handling chunk CRC errors */
    17981865extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
    17991866   int crit_action, int ancil_action));
     
    18231890 */
    18241891
    1825 /* set the filtering method(s) used by libpng.  Currently, the only valid
     1892/* Set the filtering method(s) used by libpng.  Currently, the only valid
    18261893 * value for "method" is 0.
    18271894 */
     
    19512018 * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
    19522019 * output_flush_fn will be ignored (and thus can be NULL).
     2020 * It is probably a mistake to use NULL for output_flush_fn if
     2021 * write_data_fn is not also NULL unless you have built libpng with
     2022 * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's
     2023 * default flush function, which uses the standard *FILE structure, will
     2024 * be used.
    19532025 */
    19542026extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
     
    20152087   png_progressive_end_ptr end_fn));
    20162088
    2017 /* returns the user pointer associated with the push read functions */
     2089/* Returns the user pointer associated with the push read functions */
    20182090extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
    20192091   PNGARG((png_structp png_ptr));
    20202092
    2021 /* function to be called when data becomes available */
     2093/* Function to be called when data becomes available */
    20222094extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
    20232095   png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
    20242096
    2025 /* function that combines rows.  Not very much different than the
     2097/* Function that combines rows.  Not very much different than the
    20262098 * png_combine_row() call.  Is this even used?????
    20272099 */
     
    20412113#endif
    20422114
    2043 /* frees a pointer allocated by png_malloc() */
     2115/* Frees a pointer allocated by png_malloc() */
    20442116extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
    20452117
     
    20582130#ifdef PNG_FREE_ME_SUPPORTED
    20592131/* Reassign responsibility for freeing existing data, whether allocated
    2060  * by libpng or by the application */
     2132 * by libpng or by the application
     2133 */
    20612134extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
    20622135   png_infop info_ptr, int freer, png_uint_32 mask));
    20632136#endif
    2064 /* assignments for png_data_freer */
     2137/* Assignments for png_data_freer */
    20652138#define PNG_DESTROY_WILL_FREE_DATA 1
    20662139#define PNG_SET_WILL_FREE_DATA 1
     
    21462219#if defined(PNG_INFO_IMAGE_SUPPORTED)
    21472220/* Returns row_pointers, which is an array of pointers to scanlines that was
    2148 returned from png_read_png(). */
     2221 * returned from png_read_png().
     2222 */
    21492223extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
    21502224png_infop info_ptr));
    21512225/* Set row_pointers, which is an array of pointers to scanlines for use
    2152 by png_write_png(). */
     2226 * by png_write_png().
     2227 */
    21532228extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
    21542229   png_infop info_ptr, png_bytepp row_pointers));
     
    24512526#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */
    24522527
    2453 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
    2454 /* provide a list of chunks and how they are to be handled, if the built-in
     2528#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
     2529/* Provide a list of chunks and how they are to be handled, if the built-in
    24552530   handling or default unknown chunk handling is not desired.  Any chunks not
    24562531   listed will be handled in the default manner.  The IHDR and IEND chunks
     
    24632538extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
    24642539   png_ptr, int keep, png_bytep chunk_list, int num_chunks));
     2540PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
     2541   chunk_name));
     2542#endif
     2543#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
    24652544extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
    24662545   png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
     
    24702549   png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
    24712550#endif
    2472 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
    2473 PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
    2474    chunk_name));
    2475 #endif
    24762551
    24772552/* Png_free_data() will turn off the "valid" flag for anything it frees.
    2478    If you need to turn it off for a chunk that your application has freed,
    2479    you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */
     2553 * If you need to turn it off for a chunk that your application has freed,
     2554 * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
     2555 */
    24802556extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
    24812557   png_infop info_ptr, int mask));
     
    25032579#include <crtdbg.h>
    25042580#if (PNG_DEBUG > 1)
    2505 #define png_debug(l,m)  _RPT0(_CRT_WARN,m)
    2506 #define png_debug1(l,m,p1)  _RPT1(_CRT_WARN,m,p1)
    2507 #define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2)
     2581#ifndef _DEBUG
     2582#  define _DEBUG
     2583#endif
     2584#ifndef png_debug
     2585#define png_debug(l,m)  _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
     2586#endif
     2587#ifndef png_debug1
     2588#define png_debug1(l,m,p1)  _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
     2589#endif
     2590#ifndef png_debug2
     2591#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
     2592#endif
    25082593#endif
    25092594#else /* PNG_DEBUG_FILE || !_MSC_VER */
     
    25112596#define PNG_DEBUG_FILE stderr
    25122597#endif /* PNG_DEBUG_FILE */
     2598
    25132599#if (PNG_DEBUG > 1)
    2514 #define png_debug(l,m) \
    2515 { \
    2516      int num_tabs=l; \
    2517      fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
    2518        (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
    2519 }
    2520 #define png_debug1(l,m,p1) \
    2521 { \
    2522      int num_tabs=l; \
    2523      fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
    2524        (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
    2525 }
    2526 #define png_debug2(l,m,p1,p2) \
    2527 { \
    2528      int num_tabs=l; \
    2529      fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
    2530        (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
    2531 }
     2600/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on non-ISO
     2601 * compilers.
     2602 */
     2603#  ifdef __STDC__
     2604#    ifndef png_debug
     2605#      define png_debug(l,m) \
     2606       { \
     2607       int num_tabs=l; \
     2608       fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
     2609         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
     2610       }
     2611#    endif
     2612#    ifndef png_debug1
     2613#      define png_debug1(l,m,p1) \
     2614       { \
     2615       int num_tabs=l; \
     2616       fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
     2617         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
     2618       }
     2619#    endif
     2620#    ifndef png_debug2
     2621#      define png_debug2(l,m,p1,p2) \
     2622       { \
     2623       int num_tabs=l; \
     2624       fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
     2625         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
     2626       }
     2627#    endif
     2628#  else /* __STDC __ */
     2629#    ifndef png_debug
     2630#      define png_debug(l,m) \
     2631       { \
     2632       int num_tabs=l; \
     2633       char format[256]; \
     2634       snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
     2635         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
     2636         m,PNG_STRING_NEWLINE); \
     2637       fprintf(PNG_DEBUG_FILE,format); \
     2638       }
     2639#    endif
     2640#    ifndef png_debug1
     2641#      define png_debug1(l,m,p1) \
     2642       { \
     2643       int num_tabs=l; \
     2644       char format[256]; \
     2645       snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
     2646         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
     2647         m,PNG_STRING_NEWLINE); \
     2648       fprintf(PNG_DEBUG_FILE,format,p1); \
     2649       }
     2650#    endif
     2651#    ifndef png_debug2
     2652#      define png_debug2(l,m,p1,p2) \
     2653       { \
     2654       int num_tabs=l; \
     2655       char format[256]; \
     2656       snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
     2657         (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
     2658         m,PNG_STRING_NEWLINE); \
     2659       fprintf(PNG_DEBUG_FILE,format,p1,p2); \
     2660       }
     2661#    endif
     2662#  endif /* __STDC __ */
    25322663#endif /* (PNG_DEBUG > 1) */
     2664
    25332665#endif /* _MSC_VER */
    25342666#endif /* (PNG_DEBUG > 0) */
     
    26252757/* png.c, pnggccrd.c, or pngvcrd.c */
    26262758extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
     2759#endif /* PNG_1_0_X */
    26272760#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
    26282761
    26292762/* Strip the prepended error numbers ("#nnn ") from error and warning
    2630  * messages before passing them to the error or warning handler. */
     2763 * messages before passing them to the error or warning handler.
     2764 */
    26312765#ifdef PNG_ERROR_NUMBERS_SUPPORTED
    26322766extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
    26332767   png_ptr, png_uint_32 strip_mode));
    26342768#endif
    2635 
    2636 #endif /* PNG_1_0_X */
    26372769
    26382770/* Added at libpng-1.2.6 */
     
    26462778#endif
    26472779
    2648 /* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
     2780
     2781/* Maintainer: Put new public prototypes here ^, in libpng.3, and in
     2782 * project defs
     2783 */
    26492784
    26502785#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
     
    26752810       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
    26762811
    2677 #else  /* standard method using integer division */
     2812#else  /* Standard method using integer division */
    26782813
    26792814#  define png_composite(composite, fg, alpha, bg)                            \
     
    27582893#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
    27592894
    2760 /* flags for the transformations the PNG library does on the image data */
     2895/* Flags for the transformations the PNG library does on the image data */
    27612896#define PNG_BGR                0x0001
    27622897#define PNG_INTERLACE          0x0002
     
    27922927                       /*  0x40000000L  unused */
    27932928
    2794 /* flags for png_create_struct */
     2929/* Flags for png_create_struct */
    27952930#define PNG_STRUCT_PNG   0x0001
    27962931#define PNG_STRUCT_INFO  0x0002
     
    28022937#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
    28032938
    2804 /* flags for the png_ptr->flags rather than declaring a byte for each one */
     2939/* Flags for the png_ptr->flags rather than declaring a byte for each one */
    28052940#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001
    28062941#define PNG_FLAG_ZLIB_CUSTOM_LEVEL        0x0002
     
    28442979                                     PNG_FLAG_CRC_CRITICAL_MASK)
    28452980
    2846 /* save typing and make code easier to understand */
     2981/* Save typing and make code easier to understand */
    28472982
    28482983#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
     
    28572992
    28582993/* PNG_OUT_OF_RANGE returns true if value is outside the range
    2859    ideal-delta..ideal+delta.  Each argument is evaluated twice.
    2860    "ideal" and "delta" should be constants, normally simple
    2861    integers, "value" a variable. Added to libpng-1.2.6 JB */
     2994 * ideal-delta..ideal+delta.  Each argument is evaluated twice.
     2995 * "ideal" and "delta" should be constants, normally simple
     2996 * integers, "value" a variable. Added to libpng-1.2.6 JB
     2997 */
    28622998#define PNG_OUT_OF_RANGE(value, ideal, delta) \
    28632999        ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
    28643000
    2865 /* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
     3001/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */
    28663002#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
    2867 /* place to hold the signature string for a PNG file. */
     3003/* Place to hold the signature string for a PNG file. */
    28683004#ifdef PNG_USE_GLOBAL_ARRAYS
    28693005   PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8];
     
    29843120
    29853121/* Next four functions are used internally as callbacks.  PNGAPI is required
    2986  * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3. */
     3122 * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3.
     3123 */
    29873124
    29883125PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
     
    30273164#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
    30283165    defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
    3029 PNG_EXTERN png_charp png_decompress_chunk PNGARG((png_structp png_ptr,
    3030    int comp_type, png_charp chunkdata, png_size_t chunklength,
     3166PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
     3167   int comp_type, png_size_t chunklength,
    30313168   png_size_t prefix_length, png_size_t *data_length));
    30323169#endif
     
    30493186#endif
    30503187
    3051 /* simple function to write the signature */
     3188/* Simple function to write the signature */
    30523189PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr));
    30533190
    3054 /* write various chunks */
     3191/* Write various chunks */
    30553192
    30563193/* Write the IHDR chunk, and update the png_struct with the necessary
     
    32043341#endif
    32053342
    3206 /* combine a row of data, dealing with alpha, etc. if requested */
     3343/* Combine a row of data, dealing with alpha, etc. if requested */
    32073344PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
    32083345   int mask));
    32093346
    32103347#if defined(PNG_READ_INTERLACING_SUPPORTED)
    3211 /* expand an interlaced row */
     3348/* Expand an interlaced row */
    32123349/* OLD pre-1.0.9 interface:
    32133350PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
     
    32203357
    32213358#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
    3222 /* grab pixels out of a row for an interlaced pass */
     3359/* Grab pixels out of a row for an interlaced pass */
    32233360PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
    32243361   png_bytep row, int pass));
    32253362#endif
    32263363
    3227 /* unfilter a row */
     3364/* Unfilter a row */
    32283365PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
    32293366   png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter));
     
    32363373PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
    32373374   png_bytep filtered_row));
    3238 /* finish a row while reading, dealing with interlacing passes, etc. */
     3375/* Finish a row while reading, dealing with interlacing passes, etc. */
    32393376PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
    32403377
    3241 /* initialize the row buffers, etc. */
     3378/* Initialize the row buffers, etc. */
    32423379PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
    3243 /* optional call to update the users info structure */
     3380/* Optional call to update the users info structure */
    32443381PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
    32453382   png_infop info_ptr));
    32463383
    3247 /* these are the functions that do the transformations */
     3384/* These are the functions that do the transformations */
    32483385#if defined(PNG_READ_FILLER_SUPPORTED)
    32493386PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
     
    33673504 */
    33683505
    3369 /* decode the IHDR chunk */
     3506/* Decode the IHDR chunk */
    33703507PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
    33713508   png_uint_32 length));
     
    34663603   png_bytep chunk_name));
    34673604
    3468 /* handle the transformations for reading and writing */
     3605/* Handle the transformations for reading and writing */
    34693606PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
    34703607PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
     
    35573694#endif  /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
    35583695
     3696/* Read the chunk header (length + type name) */
     3697PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
     3698
     3699/* Added at libpng version 1.2.34 */
     3700#if defined(PNG_cHRM_SUPPORTED)
     3701PNG_EXTERN int png_check_cHRM_fixed  PNGARG((png_structp png_ptr,
     3702   png_fixed_point int_white_x, png_fixed_point int_white_y,
     3703   png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
     3704   int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
     3705   png_fixed_point int_blue_y));
     3706#endif
     3707
     3708#if defined(PNG_cHRM_SUPPORTED)
     3709#if !defined(PNG_NO_CHECK_cHRM)
     3710/* Added at libpng version 1.2.34 */
     3711PNG_EXTERN void png_64bit_product (long v1, long v2, unsigned long *hi_product,
     3712   unsigned long *lo_product);
     3713#endif
     3714#endif
     3715
    35593716/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
    35603717
     
    35663723
    35673724#endif /* PNG_VERSION_INFO_ONLY */
    3568 /* do not put anything past this line */
     3725/* Do not put anything past this line */
    35693726#endif /* PNG_H */
Note: See TracChangeset for help on using the changeset viewer.