Changeset 561 for trunk/src/3rdparty/libpng/png.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/3rdparty/libpng/png.h
r2 r561 1 1 /* png.h - header file for PNG reference library 2 2 * 3 * libpng version 1.2. 29 - May 8, 20084 * Copyright (c) 1998-200 8Glenn Randers-Pehrson3 * libpng version 1.2.40 - September 10, 2009 4 * Copyright (c) 1998-2009 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 * 8 * This code is released under the libpng license (See LICENSE, below) 7 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. 29 - May 8, 2008: Glenn13 * libpng versions 0.97, January 1998, through 1.2.40 - September 10, 2009: Glenn 12 14 * See also "Contributing Authors", below. 13 15 * … … 193 195 * 1.0.35 10 10035 10.so.0.35[.0] 194 196 * 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] 195 248 * 196 249 * Henceforth the source version will match the shared-library major … … 222 275 * this sentence. 223 276 * 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 226 281 * distributed according to the same disclaimer and license as libpng-1.2.5 227 282 * with the following individual added to the list of Contributing Authors: … … 334 389 * ========================= 335 390 * 336 * May 8, 2008391 * September 10, 2009 337 392 * 338 393 * Since the PNG Development group is an ad-hoc body, we can't make … … 340 395 * 341 396 * This is your unofficial assurance that libpng from version 0.71 and 342 * upward through 1.2. 29are Y2K compliant. It is my belief that earlier397 * upward through 1.2.40 are Y2K compliant. It is my belief that earlier 343 398 * versions were also Y2K compliant. 344 399 * … … 396 451 397 452 /* 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" 399 454 #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" 401 456 402 457 #define PNG_LIBPNG_VER_SONUM 0 … … 406 461 #define PNG_LIBPNG_VER_MAJOR 1 407 462 #define PNG_LIBPNG_VER_MINOR 2 408 #define PNG_LIBPNG_VER_RELEASE 29463 #define PNG_LIBPNG_VER_RELEASE 40 409 464 /* 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 */ 411 467 412 468 #define PNG_LIBPNG_VER_BUILD 0 … … 418 474 #define PNG_LIBPNG_BUILD_STABLE 4 419 475 #define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 420 476 421 477 /* Release-Specific Flags */ 422 478 #define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with … … 433 489 * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only 434 490 * 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 */ 437 494 438 495 #ifndef PNG_VERSION_INFO_ONLY 439 /* include the compression library's header */496 /* Include the compression library's header */ 440 497 #include "zlib.h" 441 498 #endif 442 499 443 /* include all user configurable info, including optional assembler routines */500 /* Include all user configurable info, including optional assembler routines */ 444 501 #include "pngconf.h" 445 502 … … 449 506 * VS_FF_PRIVATEBUILD File *was not* built using standard release 450 507 * procedures. If this value is given, the StringFileInfo block must 451 * contain a PrivateBuild string. 508 * contain a PrivateBuild string. 452 509 * 453 510 * VS_FF_SPECIALBUILD File *was* built by the original company using 454 511 * standard release procedures but is a variation of the standard 455 512 * 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. 457 514 */ 458 515 … … 516 573 #endif 517 574 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 */ 519 576 #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) 520 577 /* Version information for C files, stored in png.c. This had better match … … 523 580 #ifdef PNG_USE_GLOBAL_ARRAYS 524 581 PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18]; 525 /* need room for 99.99.99beta99z */582 /* Need room for 99.99.99beta99z */ 526 583 #else 527 584 #define png_libpng_ver png_get_header_ver(NULL) … … 642 699 643 700 /* 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 */ 645 703 #define PNG_TEXT_COMPRESSION_NONE_WR -3 646 704 #define PNG_TEXT_COMPRESSION_zTXt_WR -2 … … 669 727 typedef png_time FAR * FAR * png_timepp; 670 728 671 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) 729 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \ 730 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) 672 731 /* png_unknown_chunk is a structure to hold queued chunks for which there is 673 732 * no specific support. The idea is that we can use this to queue … … 731 790 typedef struct png_info_struct 732 791 { 733 /* the following are necessary for every PNG file */792 /* The following are necessary for every PNG file */ 734 793 png_uint_32 width; /* width of image in pixels (from IHDR) */ 735 794 png_uint_32 height; /* height of image in pixels (from IHDR) */ … … 904 963 #endif 905 964 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. */ 908 968 png_unknown_chunkp unknown_chunks; 909 969 png_size_t unknown_chunks_num; … … 920 980 921 981 #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). */ 923 983 png_sPLT_tp splt_palettes; 924 984 png_uint_32 splt_palettes_num; … … 1135 1195 #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ 1136 1196 #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 */ 1138 1201 1139 1202 /* Flags for MNG supported features */ … … 1205 1268 png_bytep prev_row; /* buffer to save previous (unfiltered) row */ 1206 1269 png_bytep row_buf; /* buffer to save current (unfiltered) row */ 1207 #ifndef PNG_NO_WRITE_FILTER ING1270 #ifndef PNG_NO_WRITE_FILTER 1208 1271 png_bytep sub_row; /* buffer to save "sub" row when filtering */ 1209 1272 png_bytep up_row; /* buffer to save "up" row when filtering */ … … 1252 1315 1253 1316 #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 */ 1255 1318 png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ 1256 1319 png_uint_32 flush_rows; /* number of rows written since last flush */ … … 1350 1413 1351 1414 #ifdef PNG_FREE_ME_SUPPORTED 1352 png_uint_32 free_me; 1415 png_uint_32 free_me; /* flags items libpng is responsible for freeing */ 1353 1416 #endif 1354 1417 … … 1358 1421 #endif 1359 1422 1360 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)1423 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1361 1424 int num_chunk_list; 1362 1425 png_bytep chunk_list; … … 1376 1439 defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ 1377 1440 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 */ 1379 1442 #ifdef PNG_1_0_X 1380 1443 png_byte mng_features_permitted; … … 1412 1475 /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ 1413 1476 #ifdef PNG_USER_MEM_SUPPORTED 1414 png_voidp mem_ptr; 1415 png_malloc_ptr malloc_fn; 1416 png_free_ptr free_fn; 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 */ 1417 1480 #endif 1418 1481 1419 1482 /* New member added in libpng-1.0.13 and 1.2.0 */ 1420 png_bytep big_row_buf; 1483 png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ 1421 1484 1422 1485 #if defined(PNG_READ_DITHER_SUPPORTED) 1423 1486 /* The following three members were added at version 1.0.14 and 1.2.4 */ 1424 png_bytep dither_sort; 1425 png_bytep index_to_palette; 1426 1427 png_bytep palette_to_index; 1428 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 */ 1429 1492 #endif 1430 1493 … … 1439 1502 /* New member added in libpng-1.0.25 and 1.2.17 */ 1440 1503 #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. */ 1442 1505 png_unknown_chunk unknown_chunk; 1443 1506 #endif … … 1445 1508 /* New members added in libpng-1.2.26 */ 1446 1509 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 1447 1514 }; 1448 1515 … … 1451 1518 * do not agree upon the version number. 1452 1519 */ 1453 typedef png_structp version_1_2_ 29;1520 typedef png_structp version_1_2_40; 1454 1521 1455 1522 typedef png_struct FAR * FAR * png_structpp; … … 1555 1622 1556 1623 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 1557 /* read the information before the actual image data. */1624 /* Read the information before the actual image data. */ 1558 1625 extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, 1559 1626 png_infop info_ptr)); … … 1568 1635 /* "time.h" functions are not supported on WindowsCE */ 1569 1636 #if defined(PNG_WRITE_tIME_SUPPORTED) 1570 /* convert from a struct tm to png_time */1637 /* Convert from a struct tm to png_time */ 1571 1638 extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, 1572 1639 struct tm FAR * ttime)); 1573 1640 1574 /* convert from time_t to png_time. Uses gmtime() */1641 /* Convert from time_t to png_time. Uses gmtime() */ 1575 1642 extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, 1576 1643 time_t ttime)); … … 1692 1759 1693 1760 #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. */ 1695 1762 extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); 1696 1763 #endif … … 1728 1795 #endif 1729 1796 1730 /* optional update palette with requested transformations */1797 /* Optional update palette with requested transformations */ 1731 1798 extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); 1732 1799 1733 /* optional call to update the users info structure */1800 /* Optional call to update the users info structure */ 1734 1801 extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, 1735 1802 png_infop info_ptr)); 1736 1803 1737 1804 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 1738 /* read one or more rows of image data. */1805 /* Read one or more rows of image data. */ 1739 1806 extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, 1740 1807 png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); … … 1742 1809 1743 1810 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 1744 /* read a row of data. */1811 /* Read a row of data. */ 1745 1812 extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, 1746 1813 png_bytep row, … … 1749 1816 1750 1817 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 1751 /* read the whole image into memory at once. */1818 /* Read the whole image into memory at once. */ 1752 1819 extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, 1753 1820 png_bytepp image)); 1754 1821 #endif 1755 1822 1756 /* write a row of image data */1823 /* Write a row of image data */ 1757 1824 extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, 1758 1825 png_bytep row)); 1759 1826 1760 /* write a few rows of image data */1827 /* Write a few rows of image data */ 1761 1828 extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, 1762 1829 png_bytepp row, png_uint_32 num_rows)); 1763 1830 1764 /* write the image data */1831 /* Write the image data */ 1765 1832 extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, 1766 1833 png_bytepp image)); 1767 1834 1768 /* writes the end of the PNG file. */1835 /* Writes the end of the PNG file. */ 1769 1836 extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, 1770 1837 png_infop info_ptr)); 1771 1838 1772 1839 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 1773 /* read the end of the PNG file. */1840 /* Read the end of the PNG file. */ 1774 1841 extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, 1775 1842 png_infop info_ptr)); 1776 1843 #endif 1777 1844 1778 /* free any memory associated with the png_info_struct */1845 /* Free any memory associated with the png_info_struct */ 1779 1846 extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, 1780 1847 png_infopp info_ptr_ptr)); 1781 1848 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 */ 1783 1850 extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp 1784 1851 png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); 1785 1852 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) */ 1787 1854 extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, 1788 1855 png_infop end_info_ptr)); 1789 1856 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 */ 1791 1858 extern PNG_EXPORT(void,png_destroy_write_struct) 1792 1859 PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); 1793 1860 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) */ 1795 1862 extern void png_write_destroy PNGARG((png_structp png_ptr)); 1796 1863 1797 /* set the libpng method of handling chunk CRC errors */1864 /* Set the libpng method of handling chunk CRC errors */ 1798 1865 extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, 1799 1866 int crit_action, int ancil_action)); … … 1823 1890 */ 1824 1891 1825 /* set the filtering method(s) used by libpng. Currently, the only valid1892 /* Set the filtering method(s) used by libpng. Currently, the only valid 1826 1893 * value for "method" is 0. 1827 1894 */ … … 1951 2018 * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time 1952 2019 * 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. 1953 2025 */ 1954 2026 extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, … … 2015 2087 png_progressive_end_ptr end_fn)); 2016 2088 2017 /* returns the user pointer associated with the push read functions */2089 /* Returns the user pointer associated with the push read functions */ 2018 2090 extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) 2019 2091 PNGARG((png_structp png_ptr)); 2020 2092 2021 /* function to be called when data becomes available */2093 /* Function to be called when data becomes available */ 2022 2094 extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, 2023 2095 png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); 2024 2096 2025 /* function that combines rows. Not very much different than the2097 /* Function that combines rows. Not very much different than the 2026 2098 * png_combine_row() call. Is this even used????? 2027 2099 */ … … 2041 2113 #endif 2042 2114 2043 /* frees a pointer allocated by png_malloc() */2115 /* Frees a pointer allocated by png_malloc() */ 2044 2116 extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); 2045 2117 … … 2058 2130 #ifdef PNG_FREE_ME_SUPPORTED 2059 2131 /* Reassign responsibility for freeing existing data, whether allocated 2060 * by libpng or by the application */ 2132 * by libpng or by the application 2133 */ 2061 2134 extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, 2062 2135 png_infop info_ptr, int freer, png_uint_32 mask)); 2063 2136 #endif 2064 /* assignments for png_data_freer */2137 /* Assignments for png_data_freer */ 2065 2138 #define PNG_DESTROY_WILL_FREE_DATA 1 2066 2139 #define PNG_SET_WILL_FREE_DATA 1 … … 2146 2219 #if defined(PNG_INFO_IMAGE_SUPPORTED) 2147 2220 /* 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 */ 2149 2223 extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, 2150 2224 png_infop info_ptr)); 2151 2225 /* Set row_pointers, which is an array of pointers to scanlines for use 2152 by png_write_png(). */ 2226 * by png_write_png(). 2227 */ 2153 2228 extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, 2154 2229 png_infop info_ptr, png_bytepp row_pointers)); … … 2451 2526 #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ 2452 2527 2453 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)2454 /* provide a list of chunks and how they are to be handled, if the built-in2528 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 2529 /* Provide a list of chunks and how they are to be handled, if the built-in 2455 2530 handling or default unknown chunk handling is not desired. Any chunks not 2456 2531 listed will be handled in the default manner. The IHDR and IEND chunks … … 2463 2538 extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp 2464 2539 png_ptr, int keep, png_bytep chunk_list, int num_chunks)); 2540 PNG_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) 2465 2544 extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, 2466 2545 png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); … … 2470 2549 png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); 2471 2550 #endif 2472 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED2473 PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep2474 chunk_name));2475 #endif2476 2551 2477 2552 /* 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 */ 2480 2556 extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, 2481 2557 png_infop info_ptr, int mask)); … … 2503 2579 #include <crtdbg.h> 2504 2580 #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 2508 2593 #endif 2509 2594 #else /* PNG_DEBUG_FILE || !_MSC_VER */ … … 2511 2596 #define PNG_DEBUG_FILE stderr 2512 2597 #endif /* PNG_DEBUG_FILE */ 2598 2513 2599 #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 __ */ 2532 2663 #endif /* (PNG_DEBUG > 1) */ 2664 2533 2665 #endif /* _MSC_VER */ 2534 2666 #endif /* (PNG_DEBUG > 0) */ … … 2625 2757 /* png.c, pnggccrd.c, or pngvcrd.c */ 2626 2758 extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); 2759 #endif /* PNG_1_0_X */ 2627 2760 #endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ 2628 2761 2629 2762 /* 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 */ 2631 2765 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 2632 2766 extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp 2633 2767 png_ptr, png_uint_32 strip_mode)); 2634 2768 #endif 2635 2636 #endif /* PNG_1_0_X */2637 2769 2638 2770 /* Added at libpng-1.2.6 */ … … 2646 2778 #endif 2647 2779 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 */ 2649 2784 2650 2785 #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED … … 2675 2810 (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } 2676 2811 2677 #else /* standard method using integer division */2812 #else /* Standard method using integer division */ 2678 2813 2679 2814 # define png_composite(composite, fg, alpha, bg) \ … … 2758 2893 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ 2759 2894 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 */ 2761 2896 #define PNG_BGR 0x0001 2762 2897 #define PNG_INTERLACE 0x0002 … … 2792 2927 /* 0x40000000L unused */ 2793 2928 2794 /* flags for png_create_struct */2929 /* Flags for png_create_struct */ 2795 2930 #define PNG_STRUCT_PNG 0x0001 2796 2931 #define PNG_STRUCT_INFO 0x0002 … … 2802 2937 #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) 2803 2938 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 */ 2805 2940 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 2806 2941 #define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 … … 2844 2979 PNG_FLAG_CRC_CRITICAL_MASK) 2845 2980 2846 /* save typing and make code easier to understand */2981 /* Save typing and make code easier to understand */ 2847 2982 2848 2983 #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ … … 2857 2992 2858 2993 /* 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 */ 2862 2998 #define PNG_OUT_OF_RANGE(value, ideal, delta) \ 2863 2999 ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) 2864 3000 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 */ 2866 3002 #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. */ 2868 3004 #ifdef PNG_USE_GLOBAL_ARRAYS 2869 3005 PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8]; … … 2984 3120 2985 3121 /* 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 */ 2987 3124 2988 3125 PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, … … 3027 3164 #if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ 3028 3165 defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) 3029 PNG_EXTERN png_charppng_decompress_chunk PNGARG((png_structp png_ptr,3030 int comp_type, png_ charp chunkdata, png_size_t chunklength,3166 PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr, 3167 int comp_type, png_size_t chunklength, 3031 3168 png_size_t prefix_length, png_size_t *data_length)); 3032 3169 #endif … … 3049 3186 #endif 3050 3187 3051 /* simple function to write the signature */3188 /* Simple function to write the signature */ 3052 3189 PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); 3053 3190 3054 /* write various chunks */3191 /* Write various chunks */ 3055 3192 3056 3193 /* Write the IHDR chunk, and update the png_struct with the necessary … … 3204 3341 #endif 3205 3342 3206 /* combine a row of data, dealing with alpha, etc. if requested */3343 /* Combine a row of data, dealing with alpha, etc. if requested */ 3207 3344 PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, 3208 3345 int mask)); 3209 3346 3210 3347 #if defined(PNG_READ_INTERLACING_SUPPORTED) 3211 /* expand an interlaced row */3348 /* Expand an interlaced row */ 3212 3349 /* OLD pre-1.0.9 interface: 3213 3350 PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, … … 3220 3357 3221 3358 #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 */ 3223 3360 PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, 3224 3361 png_bytep row, int pass)); 3225 3362 #endif 3226 3363 3227 /* unfilter a row */3364 /* Unfilter a row */ 3228 3365 PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, 3229 3366 png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); … … 3236 3373 PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, 3237 3374 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. */ 3239 3376 PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); 3240 3377 3241 /* initialize the row buffers, etc. */3378 /* Initialize the row buffers, etc. */ 3242 3379 PNG_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 */ 3244 3381 PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, 3245 3382 png_infop info_ptr)); 3246 3383 3247 /* these are the functions that do the transformations */3384 /* These are the functions that do the transformations */ 3248 3385 #if defined(PNG_READ_FILLER_SUPPORTED) 3249 3386 PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, … … 3367 3504 */ 3368 3505 3369 /* decode the IHDR chunk */3506 /* Decode the IHDR chunk */ 3370 3507 PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, 3371 3508 png_uint_32 length)); … … 3466 3603 png_bytep chunk_name)); 3467 3604 3468 /* handle the transformations for reading and writing */3605 /* Handle the transformations for reading and writing */ 3469 3606 PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); 3470 3607 PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); … … 3557 3694 #endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ 3558 3695 3696 /* Read the chunk header (length + type name) */ 3697 PNG_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) 3701 PNG_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 */ 3711 PNG_EXTERN void png_64bit_product (long v1, long v2, unsigned long *hi_product, 3712 unsigned long *lo_product); 3713 #endif 3714 #endif 3715 3559 3716 /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ 3560 3717 … … 3566 3723 3567 3724 #endif /* PNG_VERSION_INFO_ONLY */ 3568 /* do not put anything past this line */3725 /* Do not put anything past this line */ 3569 3726 #endif /* PNG_H */
Note:
See TracChangeset
for help on using the changeset viewer.