Index: third_party/libpng/png.h |
diff --git a/third_party/lpng_v163/png.h b/third_party/libpng/png.h |
similarity index 79% |
rename from third_party/lpng_v163/png.h |
rename to third_party/libpng/png.h |
index 538b5613a9ad3aa935912ed8d6bb871912a40b28..4d03dfc136cd60eb37679e4eaaa2d82b561fcbfe 100644 |
--- a/third_party/lpng_v163/png.h |
+++ b/third_party/libpng/png.h |
@@ -1,8 +1,9 @@ |
/* png.h - header file for PNG reference library |
* |
- * libpng version 1.6.3 - July 18, 2013 |
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson |
+ * libpng version 1.6.20, December 3, 2015 |
+ * |
+ * Copyright (c) 1998-2015 Glenn Randers-Pehrson |
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
* |
@@ -10,195 +11,10 @@ |
* |
* Authors and maintainers: |
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat |
- * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger |
- * libpng versions 0.97, January 1998, through 1.6.3 - July 18, 2013: Glenn |
+ * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger |
+ * libpng versions 0.97, January 1998, through 1.6.20, December 3, 2015: |
+ * Glenn Randers-Pehrson. |
* See also "Contributing Authors", below. |
- * |
- * Note about libpng version numbers: |
- * |
- * Due to various miscommunications, unforeseen code incompatibilities |
- * and occasional factors outside the authors' control, version numbering |
- * on the library has not always been consistent and straightforward. |
- * The following table summarizes matters since version 0.89c, which was |
- * the first widely used release: |
- * |
- * source png.h png.h shared-lib |
- * version string int version |
- * ------- ------ ----- ---------- |
- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 |
- * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] |
- * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] |
- * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] |
- * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] |
- * 0.97c 0.97 97 2.0.97 |
- * 0.98 0.98 98 2.0.98 |
- * 0.99 0.99 98 2.0.99 |
- * 0.99a-m 0.99 99 2.0.99 |
- * 1.00 1.00 100 2.1.0 [100 should be 10000] |
- * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] |
- * 1.0.1 png.h string is 10001 2.1.0 |
- * 1.0.1a-e identical to the 10002 from here on, the shared library |
- * 1.0.2 source version) 10002 is 2.V where V is the source code |
- * 1.0.2a-b 10003 version, except as noted. |
- * 1.0.3 10003 |
- * 1.0.3a-d 10004 |
- * 1.0.4 10004 |
- * 1.0.4a-f 10005 |
- * 1.0.5 (+ 2 patches) 10005 |
- * 1.0.5a-d 10006 |
- * 1.0.5e-r 10100 (not source compatible) |
- * 1.0.5s-v 10006 (not binary compatible) |
- * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) |
- * 1.0.6d-f 10007 (still binary incompatible) |
- * 1.0.6g 10007 |
- * 1.0.6h 10007 10.6h (testing xy.z so-numbering) |
- * 1.0.6i 10007 10.6i |
- * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) |
- * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) |
- * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) |
- * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) |
- * 1.0.7 1 10007 (still compatible) |
- * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 |
- * 1.0.8rc1 1 10008 2.1.0.8rc1 |
- * 1.0.8 1 10008 2.1.0.8 |
- * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 |
- * 1.0.9rc1 1 10009 2.1.0.9rc1 |
- * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 |
- * 1.0.9rc2 1 10009 2.1.0.9rc2 |
- * 1.0.9 1 10009 2.1.0.9 |
- * 1.0.10beta1 1 10010 2.1.0.10beta1 |
- * 1.0.10rc1 1 10010 2.1.0.10rc1 |
- * 1.0.10 1 10010 2.1.0.10 |
- * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 |
- * 1.0.11rc1 1 10011 2.1.0.11rc1 |
- * 1.0.11 1 10011 2.1.0.11 |
- * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 |
- * 1.0.12rc1 2 10012 2.1.0.12rc1 |
- * 1.0.12 2 10012 2.1.0.12 |
- * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) |
- * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 |
- * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 |
- * 1.2.0rc1 3 10200 3.1.2.0rc1 |
- * 1.2.0 3 10200 3.1.2.0 |
- * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 |
- * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 |
- * 1.2.1 3 10201 3.1.2.1 |
- * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 |
- * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 |
- * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 |
- * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 |
- * 1.0.13 10 10013 10.so.0.1.0.13 |
- * 1.2.2 12 10202 12.so.0.1.2.2 |
- * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 |
- * 1.2.3 12 10203 12.so.0.1.2.3 |
- * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 |
- * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 |
- * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 |
- * 1.0.14 10 10014 10.so.0.1.0.14 |
- * 1.2.4 13 10204 12.so.0.1.2.4 |
- * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 |
- * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 |
- * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 |
- * 1.0.15 10 10015 10.so.0.1.0.15 |
- * 1.2.5 13 10205 12.so.0.1.2.5 |
- * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 |
- * 1.0.16 10 10016 10.so.0.1.0.16 |
- * 1.2.6 13 10206 12.so.0.1.2.6 |
- * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 |
- * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 |
- * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 |
- * 1.0.17 10 10017 12.so.0.1.0.17 |
- * 1.2.7 13 10207 12.so.0.1.2.7 |
- * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 |
- * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 |
- * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 |
- * 1.0.18 10 10018 12.so.0.1.0.18 |
- * 1.2.8 13 10208 12.so.0.1.2.8 |
- * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 |
- * 1.2.9beta4-11 13 10209 12.so.0.9[.0] |
- * 1.2.9rc1 13 10209 12.so.0.9[.0] |
- * 1.2.9 13 10209 12.so.0.9[.0] |
- * 1.2.10beta1-7 13 10210 12.so.0.10[.0] |
- * 1.2.10rc1-2 13 10210 12.so.0.10[.0] |
- * 1.2.10 13 10210 12.so.0.10[.0] |
- * 1.4.0beta1-5 14 10400 14.so.0.0[.0] |
- * 1.2.11beta1-4 13 10211 12.so.0.11[.0] |
- * 1.4.0beta7-8 14 10400 14.so.0.0[.0] |
- * 1.2.11 13 10211 12.so.0.11[.0] |
- * 1.2.12 13 10212 12.so.0.12[.0] |
- * 1.4.0beta9-14 14 10400 14.so.0.0[.0] |
- * 1.2.13 13 10213 12.so.0.13[.0] |
- * 1.4.0beta15-36 14 10400 14.so.0.0[.0] |
- * 1.4.0beta37-87 14 10400 14.so.14.0[.0] |
- * 1.4.0rc01 14 10400 14.so.14.0[.0] |
- * 1.4.0beta88-109 14 10400 14.so.14.0[.0] |
- * 1.4.0rc02-08 14 10400 14.so.14.0[.0] |
- * 1.4.0 14 10400 14.so.14.0[.0] |
- * 1.4.1beta01-03 14 10401 14.so.14.1[.0] |
- * 1.4.1rc01 14 10401 14.so.14.1[.0] |
- * 1.4.1beta04-12 14 10401 14.so.14.1[.0] |
- * 1.4.1 14 10401 14.so.14.1[.0] |
- * 1.4.2 14 10402 14.so.14.2[.0] |
- * 1.4.3 14 10403 14.so.14.3[.0] |
- * 1.4.4 14 10404 14.so.14.4[.0] |
- * 1.5.0beta01-58 15 10500 15.so.15.0[.0] |
- * 1.5.0rc01-07 15 10500 15.so.15.0[.0] |
- * 1.5.0 15 10500 15.so.15.0[.0] |
- * 1.5.1beta01-11 15 10501 15.so.15.1[.0] |
- * 1.5.1rc01-02 15 10501 15.so.15.1[.0] |
- * 1.5.1 15 10501 15.so.15.1[.0] |
- * 1.5.2beta01-03 15 10502 15.so.15.2[.0] |
- * 1.5.2rc01-03 15 10502 15.so.15.2[.0] |
- * 1.5.2 15 10502 15.so.15.2[.0] |
- * 1.5.3beta01-10 15 10503 15.so.15.3[.0] |
- * 1.5.3rc01-02 15 10503 15.so.15.3[.0] |
- * 1.5.3beta11 15 10503 15.so.15.3[.0] |
- * 1.5.3 [omitted] |
- * 1.5.4beta01-08 15 10504 15.so.15.4[.0] |
- * 1.5.4rc01 15 10504 15.so.15.4[.0] |
- * 1.5.4 15 10504 15.so.15.4[.0] |
- * 1.5.5beta01-08 15 10505 15.so.15.5[.0] |
- * 1.5.5rc01 15 10505 15.so.15.5[.0] |
- * 1.5.5 15 10505 15.so.15.5[.0] |
- * 1.5.6beta01-07 15 10506 15.so.15.6[.0] |
- * 1.5.6rc01-03 15 10506 15.so.15.6[.0] |
- * 1.5.6 15 10506 15.so.15.6[.0] |
- * 1.5.7beta01-05 15 10507 15.so.15.7[.0] |
- * 1.5.7rc01-03 15 10507 15.so.15.7[.0] |
- * 1.5.7 15 10507 15.so.15.7[.0] |
- * 1.6.0beta01-40 16 10600 16.so.16.0[.0] |
- * 1.6.0rc01-08 16 10600 16.so.16.0[.0] |
- * 1.6.0 16 10600 16.so.16.0[.0] |
- * 1.6.1beta01-09 16 10601 16.so.16.1[.0] |
- * 1.6.1rc01 16 10601 16.so.16.1[.0] |
- * 1.6.1 16 10601 16.so.16.1[.0] |
- * 1.6.2beta01 16 10602 16.so.16.2[.0] |
- * 1.6.2rc01-06 16 10602 16.so.16.2[.0] |
- * 1.6.2 16 10602 16.so.16.2[.0] |
- * 1.6.3beta01-11 16 10603 16.so.16.3[.0] |
- * 1.6.3rc01 16 10603 16.so.16.3[.0] |
- * 1.6.3 16 10603 16.so.16.3[.0] |
- * |
- * Henceforth the source version will match the shared-library major |
- * and minor numbers; the shared-library major version number will be |
- * used for changes in backward compatibility, as it is intended. The |
- * PNG_LIBPNG_VER macro, which is not used within libpng but is available |
- * for applications, is an unsigned integer of the form xyyzz corresponding |
- * to the source version x.y.z (leading zeros in y and z). Beta versions |
- * were given the previous public release number plus a letter, until |
- * version 1.0.6j; from then on they were given the upcoming public |
- * release number plus "betaNN" or "rcNN". |
- * |
- * Binary incompatibility exists only when applications make direct access |
- * to the info_ptr or png_ptr members through png.h, and the compiled |
- * application is loaded with a different version of the library. |
- * |
- * DLLNUM will change each time there are forward or backward changes |
- * in binary compatibility (e.g., when a new feature is added). |
- * |
- * See libpng-manual.txt or libpng.3 for more information. The PNG |
- * specification is available as a W3C Recommendation and as an ISO |
- * Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/ |
*/ |
/* |
@@ -209,21 +25,18 @@ |
* |
* This code is released under the libpng license. |
* |
- * libpng versions 1.2.6, August 15, 2004, through 1.6.3, July 18, 2013, are |
- * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are |
- * distributed according to the same disclaimer and license as libpng-1.2.5 |
- * with the following individual added to the list of Contributing Authors: |
- * |
- * Cosmin Truta |
- * |
- * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are |
- * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are |
- * distributed according to the same disclaimer and license as libpng-1.0.6 |
- * with the following individuals added to the list of Contributing Authors: |
+ * libpng versions 1.0.7, July 1, 2000, through 1.6.20, December 3, 2015, are |
+ * Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are |
+ * derived from libpng-1.0.6, and are distributed according to the same |
+ * disclaimer and license as libpng-1.0.6 with the following individuals |
+ * added to the list of Contributing Authors: |
* |
* Simon-Pierre Cadieux |
* Eric S. Raymond |
+ * Mans Rullgard |
+ * Cosmin Truta |
* Gilles Vollant |
+ * James Yu |
* |
* and with the following additions to the disclaimer: |
* |
@@ -235,18 +48,20 @@ |
* the user. |
* |
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are |
- * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are |
- * distributed according to the same disclaimer and license as libpng-0.96, |
- * with the following individuals added to the list of Contributing Authors: |
+ * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from |
+ * libpng-0.96, and are distributed according to the same disclaimer and |
+ * license as libpng-0.96, with the following individuals added to the list |
+ * of Contributing Authors: |
* |
* Tom Lane |
* Glenn Randers-Pehrson |
* Willem van Schaik |
* |
* libpng versions 0.89, June 1996, through 0.96, May 1997, are |
- * Copyright (c) 1996, 1997 Andreas Dilger |
- * Distributed according to the same disclaimer and license as libpng-0.88, |
- * with the following individuals added to the list of Contributing Authors: |
+ * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, |
+ * and are distributed according to the same disclaimer and license as |
+ * libpng-0.88, with the following individuals added to the list of |
+ * Contributing Authors: |
* |
* John Bowler |
* Kevin Bracey |
@@ -256,7 +71,7 @@ |
* Tom Tanner |
* |
* libpng versions 0.5, May 1995, through 0.88, January 1996, are |
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. |
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. |
* |
* For the purposes of this copyright and license, "Contributing Authors" |
* is defined as the following set of individuals: |
@@ -284,29 +99,32 @@ |
* 2. Altered versions must be plainly marked as such and must not |
* be misrepresented as being the original source. |
* |
- * 3. This Copyright notice may not be removed or altered from |
- * any source or altered source distribution. |
+ * 3. This Copyright notice may not be removed or altered from any |
+ * source or altered source distribution. |
* |
* The Contributing Authors and Group 42, Inc. specifically permit, without |
* fee, and encourage the use of this source code as a component to |
* supporting the PNG file format in commercial products. If you use this |
* source code in a product, acknowledgment is not required but would be |
* appreciated. |
+ * |
+ * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. |
*/ |
/* |
* A "png_get_copyright" function is available, for convenient use in "about" |
* boxes and the like: |
* |
- * printf("%s", png_get_copyright(NULL)); |
+ * printf("%s", png_get_copyright(NULL)); |
* |
* Also, the PNG logo (in PNG format, of course) is supplied in the |
* files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). |
*/ |
/* |
- * Libpng is OSI Certified Open Source Software. OSI Certified is a |
- * certification mark of the Open Source Initiative. |
+ * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is |
+ * a certification mark of the Open Source Initiative. OSI has not addressed |
+ * the additional disclaimers inserted at version 1.0.7. |
*/ |
/* |
@@ -317,17 +135,92 @@ |
* Thanks to Frank J. T. Wojcik for helping with the documentation. |
*/ |
+/* Note about libpng version numbers: |
+ * |
+ * Due to various miscommunications, unforeseen code incompatibilities |
+ * and occasional factors outside the authors' control, version numbering |
+ * on the library has not always been consistent and straightforward. |
+ * The following table summarizes matters since version 0.89c, which was |
+ * the first widely used release: |
+ * |
+ * source png.h png.h shared-lib |
+ * version string int version |
+ * ------- ------ ----- ---------- |
+ * 0.89c "1.0 beta 3" 0.89 89 1.0.89 |
+ * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] |
+ * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] |
+ * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] |
+ * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] |
+ * 0.97c 0.97 97 2.0.97 |
+ * 0.98 0.98 98 2.0.98 |
+ * 0.99 0.99 98 2.0.99 |
+ * 0.99a-m 0.99 99 2.0.99 |
+ * 1.00 1.00 100 2.1.0 [100 should be 10000] |
+ * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] |
+ * 1.0.1 png.h string is 10001 2.1.0 |
+ * 1.0.1a-e identical to the 10002 from here on, the shared library |
+ * 1.0.2 source version) 10002 is 2.V where V is the source code |
+ * 1.0.2a-b 10003 version, except as noted. |
+ * 1.0.3 10003 |
+ * 1.0.3a-d 10004 |
+ * 1.0.4 10004 |
+ * 1.0.4a-f 10005 |
+ * 1.0.5 (+ 2 patches) 10005 |
+ * 1.0.5a-d 10006 |
+ * 1.0.5e-r 10100 (not source compatible) |
+ * 1.0.5s-v 10006 (not binary compatible) |
+ * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) |
+ * 1.0.6d-f 10007 (still binary incompatible) |
+ * 1.0.6g 10007 |
+ * 1.0.6h 10007 10.6h (testing xy.z so-numbering) |
+ * 1.0.6i 10007 10.6i |
+ * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) |
+ * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) |
+ * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) |
+ * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) |
+ * 1.0.7 1 10007 (still compatible) |
+ * ... |
+ * 1.0.19 10 10019 10.so.0.19[.0] |
+ * ... |
+ * 1.2.53 13 10253 12.so.0.53[.0] |
+ * ... |
+ * 1.5.23 15 10523 15.so.15.23[.0] |
+ * ... |
+ * 1.6.20 16 10620 16.so.16.20[.0] |
+ * |
+ * Henceforth the source version will match the shared-library major |
+ * and minor numbers; the shared-library major version number will be |
+ * used for changes in backward compatibility, as it is intended. The |
+ * PNG_LIBPNG_VER macro, which is not used within libpng but is available |
+ * for applications, is an unsigned integer of the form xyyzz corresponding |
+ * to the source version x.y.z (leading zeros in y and z). Beta versions |
+ * were given the previous public release number plus a letter, until |
+ * version 1.0.6j; from then on they were given the upcoming public |
+ * release number plus "betaNN" or "rcNN". |
+ * |
+ * Binary incompatibility exists only when applications make direct access |
+ * to the info_ptr or png_ptr members through png.h, and the compiled |
+ * application is loaded with a different version of the library. |
+ * |
+ * DLLNUM will change each time there are forward or backward changes |
+ * in binary compatibility (e.g., when a new feature is added). |
+ * |
+ * See libpng.txt or libpng.3 for more information. The PNG specification |
+ * is available as a W3C Recommendation and as an ISO Specification, |
+ * <http://www.w3.org/TR/2003/REC-PNG-20031110/ |
+ */ |
+ |
/* |
* Y2K compliance in libpng: |
* ========================= |
* |
- * July 18, 2013 |
+ * December 3, 2015 |
* |
* Since the PNG Development group is an ad-hoc body, we can't make |
* an official declaration. |
* |
* This is your unofficial assurance that libpng from version 0.71 and |
- * upward through 1.6.3 are Y2K compliant. It is my belief that |
+ * upward through 1.6.20 are Y2K compliant. It is my belief that |
* earlier versions were also Y2K compliant. |
* |
* Libpng only has two year fields. One is a 2-byte unsigned integer |
@@ -380,272 +273,18 @@ |
/* This is not the place to learn how to use libpng. The file libpng-manual.txt |
* describes how to use libpng, and the file example.c summarizes it |
* with some code on which to build. This file is useful for looking |
- * at the actual function definitions and structure components. |
+ * at the actual function definitions and structure components. If that |
+ * file has been stripped from your copy of libpng, you can find it at |
+ * <http://www.libpng.org/pub/png/libpng-manual.txt> |
* |
* If you just need to read a PNG file and don't want to read the documentation |
* skip to the end of this file and read the section entitled 'simplified API'. |
*/ |
-/* Sunliang.liu add 20100319 for avoid name conflict. */ |
-#define png_set_sig_bytes FOXIT_png_set_sig_bytes |
-#define png_sig_cmp FOXIT_png_sig_cmp |
-#define png_create_info_struct FOXIT_png_create_info_struct |
-#define png_destroy_info_struct FOXIT_png_destroy_info_struct |
-#define png_info_init_3 FOXIT_png_info_init_3 |
-#define png_data_freer FOXIT_png_data_freer |
-#define png_free_data FOXIT_png_free_data |
-#define png_info_destroy FOXIT_png_info_destroy |
-#define png_get_io_ptr FOXIT_png_get_io_ptr |
-#define png_init_io FOXIT_png_init_io |
-#define png_convert_to_rfc1123 FOXIT_png_convert_to_rfc1123 |
-#define png_get_copyright FOXIT_png_get_copyright |
-#define png_get_libpng_ver FOXIT_png_get_libpng_ver |
-#define png_get_header_ver FOXIT_png_get_header_ver |
-#define png_get_header_version FOXIT_png_get_header_version |
-#define png_handle_as_unknown FOXIT_png_handle_as_unknown |
-#define png_reset_zstream FOXIT_png_reset_zstream |
-#define png_access_version_number FOXIT_png_access_version_number |
-#define png_mmx_support FOXIT_png_mmx_support |
-#define png_create_read_struct FOXIT_png_create_read_struct |
-#define png_create_read_struct_2 FOXIT_png_create_read_struct_2 |
-#define png_create_write_struct FOXIT_png_create_write_struct |
-#define png_create_write_struct_2 FOXIT_png_create_write_struct_2 |
-#define png_get_compression_buffer_size FOXIT_png_get_compression_buffer_size |
-#define png_set_compression_buffer_size FOXIT_png_set_compression_buffer_size |
-#define png_set_longjmp_fn FOXIT_png_set_longjmp_fn |
-#define png_longjmp FOXIT_png_longjmp |
-#define png_write_sig FOXIT_png_write_sig |
-#define png_write_chunk FOXIT_png_write_chunk |
-#define png_write_chunk_start FOXIT_png_write_chunk_start |
-#define png_write_chunk_data FOXIT_png_write_chunk_data |
-#define png_write_chunk_end FOXIT_png_write_chunk_end |
-#define png_write_info_before_PLTE FOXIT_png_write_info_before_PLTE |
-#define png_write_info FOXIT_png_write_info |
-#define png_read_info FOXIT_png_read_info |
-#define png_convert_to_rfc1123_buffer FOXIT_png_convert_to_rfc1123_buffer |
-#define png_convert_from_struct_tm FOXIT_png_convert_from_struct_tm |
-#define png_convert_from_time_t FOXIT_png_convert_from_time_t |
-#define png_set_expand FOXIT_png_set_expand |
-#define png_set_expand_gray_1_2_4_to_8 FOXIT_png_set_expand_gray_1_2_4_to_8 |
-#define png_set_palette_to_rgb FOXIT_png_set_palette_to_rgb |
-#define png_set_tRNS_to_alpha FOXIT_png_set_tRNS_to_alpha |
-#define png_set_expand_16 FOXIT_png_set_expand_16 |
-#define png_set_bgr FOXIT_png_set_bgr |
-#define png_set_gray_to_rgb FOXIT_png_set_gray_to_rgb |
-#define png_set_rgb_to_gray FOXIT_png_set_rgb_to_gray |
-#define png_set_rgb_to_gray_fixed FOXIT_png_set_rgb_to_gray_fixed |
-#define png_get_rgb_to_gray_status FOXIT_png_get_rgb_to_gray_status |
-#define png_build_grayscale_palette FOXIT_png_build_grayscale_palette |
-#define png_set_alpha_mode FOXIT_png_set_alpha_mode |
-#define png_set_alpha_mode_fixed FOXIT_png_set_alpha_mode_fixed |
-#define png_set_strip_alpha FOXIT_png_set_strip_alpha |
-#define png_set_swap_alpha FOXIT_png_set_swap_alpha |
-#define png_set_invert_alpha FOXIT_png_set_invert_alpha |
-#define png_set_filler FOXIT_png_set_filler |
-#define png_set_add_alpha FOXIT_png_set_add_alpha |
-#define png_set_swap FOXIT_png_set_swap |
-#define png_set_packing FOXIT_png_set_packing |
-#define png_set_packswap FOXIT_png_set_packswap |
-#define png_set_shift FOXIT_png_set_shift |
-#define png_set_interlace_handling FOXIT_png_set_interlace_handling |
-#define png_set_invert_mono FOXIT_png_set_invert_mono |
-#define png_set_background FOXIT_png_set_background |
-#define png_set_background_fixed FOXIT_png_set_background_fixed |
-#define png_set_scale_16 FOXIT_png_set_scale_16 |
-#define png_set_quantize FOXIT_png_set_quantize |
-#define png_set_gamma FOXIT_png_set_gamma |
-#define png_set_gamma_fixed FOXIT_png_set_gamma_fixed |
-#define png_set_flush FOXIT_png_set_flush |
-#define png_write_flush FOXIT_png_write_flush |
-#define png_start_read_image FOXIT_png_start_read_image |
-#define png_read_update_info FOXIT_png_read_update_info |
-#define png_read_rows FOXIT_png_read_rows |
-#define png_read_row FOXIT_png_read_row |
-#define png_read_image FOXIT_png_read_image |
-#define png_write_row FOXIT_png_write_row |
-#define png_write_rows FOXIT_png_write_rows |
-#define png_write_image FOXIT_png_write_image |
-#define png_write_end FOXIT_png_write_end |
-#define png_read_end FOXIT_png_read_end |
-#define png_destroy_read_struct FOXIT_png_destroy_read_struct |
-#define png_destroy_write_struct FOXIT_png_destroy_write_struct |
-#define png_set_crc_action FOXIT_png_set_crc_action |
-#define png_set_filter FOXIT_png_set_filter |
-#define png_set_filter_heuristics FOXIT_png_set_filter_heuristics |
-#define png_set_filter_heuristics_fixed FOXIT_png_set_filter_heuristics_fixed |
-#define png_set_compression_level FOXIT_png_set_compression_level |
-#define png_set_compression_mem_level FOXIT_png_set_compression_mem_level |
-#define png_set_compression_strategy FOXIT_png_set_compression_strategy |
-#define png_set_compression_window_bits FOXIT_png_set_compression_window_bits |
-#define png_set_compression_method FOXIT_png_set_compression_method |
-#define png_set_text_compression_level FOXIT_png_set_text_compression_level |
-#define png_set_text_compression_mem_level FOXIT_png_set_text_compression_mem_level |
-#define png_set_text_compression_strategy FOXIT_png_set_text_compression_strategy |
-#define png_set_text_compression_window_bits FOXIT_png_set_text_compression_window_bits |
-#define png_set_text_compression_method FOXIT_png_set_text_compression_method |
-#define png_set_error_fn FOXIT_png_set_error_fn |
-#define png_get_error_ptr FOXIT_png_get_error_ptr |
-#define png_set_write_fn FOXIT_png_set_write_fn |
-#define png_set_read_fn FOXIT_png_set_read_fn |
-#define png_set_read_status_fn FOXIT_png_set_read_status_fn |
-#define png_set_write_status_fn FOXIT_png_set_write_status_fn |
-#define png_set_read_user_transform_fn FOXIT_png_set_read_user_transform_fn |
-#define png_set_write_user_transform_fn FOXIT_png_set_write_user_transform_fn |
-#define png_set_user_transform_info FOXIT_png_set_user_transform_info |
-#define png_get_user_transform_ptr FOXIT_png_get_user_transform_ptr |
-#define png_get_current_row_number FOXIT_png_get_current_row_number |
-#define png_get_current_pass_number FOXIT_png_get_current_pass_number |
-#define png_set_read_user_chunk_fn FOXIT_png_set_read_user_chunk_fn |
-#define png_get_user_chunk_ptr FOXIT_png_get_user_chunk_ptr |
-#define png_set_progressive_read_fn FOXIT_png_set_progressive_read_fn |
-#define png_get_progressive_ptr FOXIT_png_get_progressive_ptr |
-#define png_process_data FOXIT_png_process_data |
-#define png_process_data_pause FOXIT_png_process_data_pause |
-#define png_process_data_skip FOXIT_png_process_data_skip |
-#define png_progressive_combine_row FOXIT_png_progressive_combine_row |
-#define png_calloc FOXIT_png_calloc |
-#define png_error FOXIT_png_error |
-#define png_chunk_error FOXIT_png_chunk_error |
-#define png_err FOXIT_png_err |
-#define png_warning FOXIT_png_warning |
-#define png_chunk_warning FOXIT_png_chunk_warning |
-#define png_benign_error FOXIT_png_benign_error |
-#define png_chunk_benign_error FOXIT_png_chunk_benign_error |
-#define png_set_benign_errors FOXIT_png_set_benign_errors |
-#define png_get_valid FOXIT_png_get_valid |
-#define png_get_rowbytes FOXIT_png_get_rowbytes |
-#define png_get_rows FOXIT_png_get_rows |
-#define png_set_rows FOXIT_png_set_rows |
-#define png_get_channels FOXIT_png_get_channels |
-#define png_get_image_width FOXIT_png_get_image_width |
-#define png_get_image_height FOXIT_png_get_image_height |
-#define png_get_bit_depth FOXIT_png_get_bit_depth |
-#define png_get_color_type FOXIT_png_get_color_type |
-#define png_get_filter_type FOXIT_png_get_filter_type |
-#define png_get_interlace_type FOXIT_png_get_interlace_type |
-#define png_get_compression_type FOXIT_png_get_compression_type |
-#define png_get_pixels_per_meter FOXIT_png_get_pixels_per_meter |
-#define png_get_x_pixels_per_meter FOXIT_png_get_x_pixels_per_meter |
-#define png_get_y_pixels_per_meter FOXIT_png_get_y_pixels_per_meter |
-#define png_get_pixel_aspect_ratio FOXIT_png_get_pixel_aspect_ratio |
-#define png_get_pixel_aspect_ratio_fixed FOXIT_png_get_pixel_aspect_ratio_fixed |
-#define png_get_x_offset_pixels FOXIT_png_get_x_offset_pixels |
-#define png_get_y_offset_pixels FOXIT_png_get_y_offset_pixels |
-#define png_get_x_offset_microns FOXIT_png_get_x_offset_microns |
-#define png_get_y_offset_microns FOXIT_png_get_y_offset_microns |
-#define png_get_signature FOXIT_png_get_signature |
-#define png_get_bKGD FOXIT_png_get_bKGD |
-#define png_set_bKGD FOXIT_png_set_bKGD |
-#define png_get_cHRM FOXIT_png_get_cHRM |
-#define png_get_cHRM_XYZ FOXIT_png_get_cHRM_XYZ |
-#define png_get_cHRM_fixed FOXIT_png_get_cHRM_fixed |
-#define png_get_cHRM_XYZ_fixed FOXIT_png_get_cHRM_XYZ_fixed |
-#define png_set_cHRM FOXIT_png_set_cHRM |
-#define png_set_cHRM_XYZ FOXIT_png_set_cHRM_XYZ |
-#define png_set_cHRM_fixed FOXIT_png_set_cHRM_fixed |
-#define png_set_cHRM_XYZ_fixed FOXIT_png_set_cHRM_XYZ_fixed |
-#define png_get_gAMA FOXIT_png_get_gAMA |
-#define png_set_gAMA FOXIT_png_set_gAMA |
-#define png_set_gAMA_fixed FOXIT_png_set_gAMA_fixed |
-#define png_get_hIST FOXIT_png_get_hIST |
-#define png_set_hIST FOXIT_png_set_hIST |
-#define png_get_IHDR FOXIT_png_get_IHDR |
-#define png_set_IHDR FOXIT_png_set_IHDR |
-#define png_get_oFFs FOXIT_png_get_oFFs |
-#define png_set_oFFs FOXIT_png_set_oFFs |
-#define png_get_pCAL FOXIT_png_get_pCAL |
-#define png_set_pCAL FOXIT_png_set_pCAL |
-#define png_set_pHYs FOXIT_png_set_pHYs |
-#define png_get_PLTE FOXIT_png_get_PLTE |
-#define png_set_PLTE FOXIT_png_set_PLTE |
-#define png_get_sBIT FOXIT_png_get_sBIT |
-#define png_set_sBIT FOXIT_png_set_sBIT |
-#define png_get_sRGB FOXIT_png_get_sRGB |
-#define png_set_sRGB FOXIT_png_set_sRGB |
-#define png_set_sRGB_gAMA_and_cHRM FOXIT_png_set_sRGB_gAMA_and_cHRM |
-#define png_get_iCCP FOXIT_png_get_iCCP |
-#define png_set_iCCP FOXIT_png_set_iCCP |
-#define png_get_sPLT FOXIT_png_get_sPLT |
-#define png_set_sPLT FOXIT_png_set_sPLT |
-#define png_get_text FOXIT_png_get_text |
-#define png_set_text FOXIT_png_set_text |
-#define png_get_tIME FOXIT_png_get_tIME |
-#define png_set_tIME FOXIT_png_set_tIME |
-#define png_get_tRNS FOXIT_png_get_tRNS |
-#define png_set_tRNS FOXIT_png_set_tRNS |
-#define png_get_sCAL FOXIT_png_get_sCAL |
-#define png_get_sCAL_fixed FOXIT_png_get_sCAL_fixed |
-#define png_get_sCAL_s FOXIT_png_get_sCAL_s |
-#define png_set_sCAL FOXIT_png_set_sCAL |
-#define png_set_sCAL_s FOXIT_png_set_sCAL_s |
-#define png_set_keep_unknown_chunks FOXIT_png_set_keep_unknown_chunks |
-#define png_set_unknown_chunks FOXIT_png_set_unknown_chunks |
-#define png_set_unknown_chunk_location FOXIT_png_set_unknown_chunk_location |
-#define png_get_unknown_chunks FOXIT_png_get_unknown_chunks |
-#define png_set_invalid FOXIT_png_set_invalid |
-#define png_read_png FOXIT_png_read_png |
-#define png_write_png FOXIT_png_write_png |
-#define png_permit_mng_features FOXIT_png_permit_mng_features |
-#define png_set_strip_error_numbers FOXIT_png_set_strip_error_numbers |
-#define png_set_user_limits FOXIT_png_set_user_limits |
-#define png_get_user_width_max FOXIT_png_get_user_width_max |
-#define png_get_user_height_max FOXIT_png_get_user_height_max |
-#define png_set_chunk_cache_max FOXIT_png_set_chunk_cache_max |
-#define png_get_chunk_cache_max FOXIT_png_get_chunk_cache_max |
-#define png_set_chunk_malloc_max FOXIT_png_set_chunk_malloc_max |
-#define png_get_chunk_malloc_max FOXIT_png_get_chunk_malloc_max |
-#define png_get_pixels_per_inch FOXIT_png_get_pixels_per_inch |
-#define png_get_x_pixels_per_inch FOXIT_png_get_x_pixels_per_inch |
-#define png_get_y_pixels_per_inch FOXIT_png_get_y_pixels_per_inch |
-#define png_get_x_offset_inches FOXIT_png_get_x_offset_inches |
-#define png_get_x_offset_inches_fixed FOXIT_png_get_x_offset_inches_fixed |
-#define png_get_y_offset_inches FOXIT_png_get_y_offset_inches |
-#define png_get_y_offset_inches_fixed FOXIT_png_get_y_offset_inches_fixed |
-#define png_get_pHYs_dpi FOXIT_png_get_pHYs_dpi |
-#define png_get_io_state FOXIT_png_get_io_state |
-#define png_get_io_chunk_name FOXIT_png_get_io_chunk_name |
-#define png_get_io_chunk_type FOXIT_png_get_io_chunk_type |
-#define png_get_uint_31 FOXIT_png_get_uint_31 |
-#define png_get_uint_32 FOXIT_png_get_uint_32 |
-#define png_get_uint_16 FOXIT_png_get_uint_16 |
-#define png_get_int_32 FOXIT_png_get_int_32 |
-#define png_save_uint_32 FOXIT_png_save_uint_32 |
-#define png_save_int_32 FOXIT_png_save_int_32 |
-#define png_save_uint_16 FOXIT_png_save_uint_16 |
-#define png_image_begin_read_from_file FOXIT_png_image_begin_read_from_file |
-#define png_image_begin_read_from_stdio FOXIT_png_image_begin_read_from_stdio |
-#define png_image_begin_read_from_memory FOXIT_png_image_begin_read_from_memory |
-#define png_image_finish_read FOXIT_png_image_finish_read |
-#define png_image_free FOXIT_png_image_free |
-#define png_image_write_to_file FOXIT_png_image_write_to_file |
-#define png_image_write_to_stdio FOXIT_png_image_write_to_stdio |
-#define png_set_check_for_invalid_index FOXIT_png_set_check_for_invalid_index |
-#define png_get_palette_max FOXIT_png_get_palette_max |
-#define png_set_option FOXIT_png_set_option |
- |
-#define png_set_strip_16 FOXIT_png_set_strip_16 |
-#define png_64bit_product FOXIT_png_64bit_product |
-#define png_check_cHRM_fixed FOXIT_png_check_cHRM_fixed |
-#define png_free FOXIT_png_free |
-#define png_free_default FOXIT_png_free_default |
-#define png_get_mem_ptr FOXIT_png_get_mem_ptr |
-#define png_malloc FOXIT_png_malloc |
-#define png_malloc_default FOXIT_png_malloc_default |
-#define png_malloc_warn FOXIT_png_malloc_warn |
-#define png_memcpy_check FOXIT_png_memcpy_check |
-#define png_memset_check FOXIT_png_memset_check |
-#define png_pass_dsp_mask FOXIT_png_pass_dsp_mask |
-#define png_pass_inc FOXIT_png_pass_inc |
-#define png_pass_mask FOXIT_png_pass_mask |
-#define png_pass_start FOXIT_png_pass_start |
-#define png_pass_yinc FOXIT_png_pass_yinc |
-#define png_pass_ystart FOXIT_png_pass_ystart |
-#define png_set_mem_fn FOXIT_png_set_mem_fn |
- |
/* Version information for png.h - this should match the version in png.c */ |
-#define PNG_LIBPNG_VER_STRING "1.6.3" |
+#define PNG_LIBPNG_VER_STRING "1.6.20" |
#define PNG_HEADER_VERSION_STRING \ |
- " libpng version 1.6.3 - July 18, 2013\n" |
+ " libpng version 1.6.20 - December 3, 2015\n" |
#define PNG_LIBPNG_VER_SONUM 16 |
#define PNG_LIBPNG_VER_DLLNUM 16 |
@@ -653,7 +292,7 @@ |
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ |
#define PNG_LIBPNG_VER_MAJOR 1 |
#define PNG_LIBPNG_VER_MINOR 6 |
-#define PNG_LIBPNG_VER_RELEASE 3 |
+#define PNG_LIBPNG_VER_RELEASE 20 |
/* This should match the numeric part of the final component of |
* PNG_LIBPNG_VER_STRING, omitting any leading zero: |
@@ -684,7 +323,7 @@ |
* version 1.0.0 was mis-numbered 100 instead of 10000). From |
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release |
*/ |
-#define PNG_LIBPNG_VER 10603 /* 1.6.3 */ |
+#define PNG_LIBPNG_VER 10620 /* 1.6.20 */ |
/* Library configuration: these options cannot be changed after |
* the library has been built. |
@@ -741,17 +380,22 @@ extern "C" { |
/* This file is arranged in several sections: |
* |
- * 1. Any configuration options that can be specified by for the application |
+ * 1. [omitted] |
+ * 2. Any configuration options that can be specified by for the application |
* code when it is built. (Build time configuration is in pnglibconf.h) |
- * 2. Type definitions (base types are defined in pngconf.h), structure |
+ * 3. Type definitions (base types are defined in pngconf.h), structure |
* definitions. |
- * 3. Exported library functions. |
- * 4. Simplified API. |
+ * 4. Exported library functions. |
+ * 5. Simplified API. |
+ * 6. Implementation options. |
* |
* The library source code has additional files (principally pngpriv.h) that |
* allow configuration of the library. |
*/ |
-/* Section 1: run time configuration |
+ |
+/* Section 1: [omitted] */ |
+ |
+/* Section 2: run time configuration |
* See pnglibconf.h for build time configuration |
* |
* Run time configuration allows the application to choose between |
@@ -781,7 +425,7 @@ extern "C" { |
* Otherwise the calls are mapped to png_error. |
*/ |
-/* Section 2: type definitions, including structures and compile time |
+/* Section 3: type definitions, including structures and compile time |
* constants. |
* See pngconf.h for base types that vary by machine/system |
*/ |
@@ -789,7 +433,7 @@ extern "C" { |
/* This triggers a compiler error in png.c, if png.c and png.h |
* do not agree upon the version number. |
*/ |
-typedef char* png_libpng_version_1_6_3; |
+typedef char* png_libpng_version_1_6_20; |
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. |
* |
@@ -971,7 +615,8 @@ typedef png_time * png_timep; |
typedef const png_time * png_const_timep; |
typedef png_time * * png_timepp; |
-#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED |
+#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) ||\ |
+ defined(PNG_USER_CHUNKS_SUPPORTED) |
/* png_unknown_chunk is a structure to hold queued chunks for which there is |
* no specific support. The idea is that we can use this to queue |
* up private chunks for output even though the library doesn't actually |
@@ -1104,7 +749,9 @@ typedef png_unknown_chunk * * png_unknown_chunkpp; |
#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ |
#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ |
#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ |
+#if INT_MAX >= 0x8000 /* else this might break */ |
#define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ |
+#endif |
/* This is used for the transformation routines, as some of them |
* change these values for the row. It also should enable using |
@@ -1208,7 +855,9 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); |
#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ |
/* Added to libpng-1.5.4 */ |
#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ |
+#if INT_MAX >= 0x8000 /* else this might break */ |
#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ |
+#endif |
/* Flags for MNG supported features */ |
#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 |
@@ -1225,7 +874,7 @@ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, |
png_alloc_size_t)); |
typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); |
-/* Section 3: exported functions |
+/* Section 4: exported functions |
* Here are the function definitions most commonly used. This is not |
* the place to find out how to use libpng. See libpng-manual.txt for the |
* full explanation, see example.c for the summary. This just provides |
@@ -1401,7 +1050,7 @@ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, |
/* Convert from time_t to png_time. Uses gmtime() */ |
PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); |
-#endif /* PNG_CONVERT_tIME_SUPPORTED */ |
+#endif /* CONVERT_tIME */ |
#ifdef PNG_READ_EXPAND_SUPPORTED |
/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ |
@@ -1450,9 +1099,9 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, |
#endif |
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED |
-/* How the alpha channel is interpreted - this affects how the color channels of |
- * a PNG file are returned when an alpha channel, or tRNS chunk in a palette |
- * file, is present. |
+/* How the alpha channel is interpreted - this affects how the color channels |
+ * of a PNG file are returned to the calling application when an alpha channel, |
+ * or a tRNS chunk in a palette file, is present. |
* |
* This has no effect on the way pixels are written into a PNG output |
* datastream. The color samples in a PNG datastream are never premultiplied |
@@ -1460,33 +1109,19 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, |
* |
* The default is to return data according to the PNG specification: the alpha |
* channel is a linear measure of the contribution of the pixel to the |
- * corresponding composited pixel. The gamma encoded color channels must be |
- * scaled according to the contribution and to do this it is necessary to undo |
+ * corresponding composited pixel, and the color channels are unassociated |
+ * (not premultiplied). The gamma encoded color channels must be scaled |
+ * according to the contribution and to do this it is necessary to undo |
* the encoding, scale the color values, perform the composition and reencode |
* the values. This is the 'PNG' mode. |
* |
* The alternative is to 'associate' the alpha with the color information by |
- * storing color channel values that have been scaled by the alpha. The |
- * advantage is that the color channels can be resampled (the image can be |
- * scaled) in this form. The disadvantage is that normal practice is to store |
- * linear, not (gamma) encoded, values and this requires 16-bit channels for |
- * still images rather than the 8-bit channels that are just about sufficient if |
- * gamma encoding is used. In addition all non-transparent pixel values, |
- * including completely opaque ones, must be gamma encoded to produce the final |
- * image. This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the |
- * latter being the two common names for associated alpha color channels.) |
- * |
- * Since it is not necessary to perform arithmetic on opaque color values so |
- * long as they are not to be resampled and are in the final color space it is |
- * possible to optimize the handling of alpha by storing the opaque pixels in |
- * the PNG format (adjusted for the output color space) while storing partially |
- * opaque pixels in the standard, linear, format. The accuracy required for |
- * standard alpha composition is relatively low, because the pixels are |
- * isolated, therefore typically the accuracy loss in storing 8-bit linear |
- * values is acceptable. (This is not true if the alpha channel is used to |
- * simulate transparency over large areas - use 16 bits or the PNG mode in |
- * this case!) This is the 'OPTIMIZED' mode. For this mode a pixel is |
- * treated as opaque only if the alpha value is equal to the maximum value. |
+ * storing color channel values that have been scaled by the alpha. |
+ * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes |
+ * (the latter being the two common names for associated alpha color channels). |
+ * |
+ * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha |
+ * value is equal to the maximum value. |
* |
* The final choice is to gamma encode the alpha channel as well. This is |
* broken because, in practice, no implementation that uses this choice |
@@ -1513,68 +1148,7 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, |
#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) |
/* The output_gamma value is a screen gamma in libpng terminology: it expresses |
- * how to decode the output values, not how they are encoded. The values used |
- * correspond to the normal numbers used to describe the overall gamma of a |
- * computer display system; for example 2.2 for an sRGB conformant system. The |
- * values are scaled by 100000 in the _fixed version of the API (so 220000 for |
- * sRGB.) |
- * |
- * The inverse of the value is always used to provide a default for the PNG file |
- * encoding if it has no gAMA chunk and if png_set_gamma() has not been called |
- * to override the PNG gamma information. |
- * |
- * When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode |
- * opaque pixels however pixels with lower alpha values are not encoded, |
- * regardless of the output gamma setting. |
- * |
- * When the standard Porter Duff handling is requested with mode 1 the output |
- * encoding is set to be linear and the output_gamma value is only relevant |
- * as a default for input data that has no gamma information. The linear output |
- * encoding will be overridden if png_set_gamma() is called - the results may be |
- * highly unexpected! |
- * |
- * The following numbers are derived from the sRGB standard and the research |
- * behind it. sRGB is defined to be approximated by a PNG gAMA chunk value of |
- * 0.45455 (1/2.2) for PNG. The value implicitly includes any viewing |
- * correction required to take account of any differences in the color |
- * environment of the original scene and the intended display environment; the |
- * value expresses how to *decode* the image for display, not how the original |
- * data was *encoded*. |
- * |
- * sRGB provides a peg for the PNG standard by defining a viewing environment. |
- * sRGB itself, and earlier TV standards, actually use a more complex transform |
- * (a linear portion then a gamma 2.4 power law) than PNG can express. (PNG is |
- * limited to simple power laws.) By saying that an image for direct display on |
- * an sRGB conformant system should be stored with a gAMA chunk value of 45455 |
- * (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification |
- * makes it possible to derive values for other display systems and |
- * environments. |
- * |
- * The Mac value is deduced from the sRGB based on an assumption that the actual |
- * extra viewing correction used in early Mac display systems was implemented as |
- * a power 1.45 lookup table. |
- * |
- * Any system where a programmable lookup table is used or where the behavior of |
- * the final display device characteristics can be changed requires system |
- * specific code to obtain the current characteristic. However this can be |
- * difficult and most PNG gamma correction only requires an approximate value. |
- * |
- * By default, if png_set_alpha_mode() is not called, libpng assumes that all |
- * values are unencoded, linear, values and that the output device also has a |
- * linear characteristic. This is only very rarely correct - it is invariably |
- * better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the |
- * default if you don't know what the right answer is! |
- * |
- * The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS |
- * 10.6) which used a correction table to implement a somewhat lower gamma on an |
- * otherwise sRGB system. |
- * |
- * Both these values are reserved (not simple gamma values) in order to allow |
- * more precise correction internally in the future. |
- * |
- * NOTE: the following values can be passed to either the fixed or floating |
- * point APIs, but the floating point API will also accept floating point |
- * values. |
+ * how to decode the output values, not how they are encoded. |
*/ |
#define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ |
#define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ |
@@ -1673,16 +1247,16 @@ PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); |
#endif |
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) |
-/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ |
+/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ |
PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, |
int flags)); |
/* The values of the PNG_FILLER_ defines should NOT be changed */ |
# define PNG_FILLER_BEFORE 0 |
# define PNG_FILLER_AFTER 1 |
-/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ |
+/* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ |
PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, |
png_uint_32 filler, int flags)); |
-#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ |
+#endif /* READ_FILLER || WRITE_FILLER */ |
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) |
/* Swap bytes in 16-bit depth files. */ |
@@ -1872,6 +1446,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, |
#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ |
#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ |
+#ifdef PNG_WRITE_SUPPORTED |
/* These functions give the user control over the scan-line filtering in |
* libpng and the compression methods used by zlib. These functions are |
* mainly useful for testing, as the defaults should work with most users. |
@@ -1885,6 +1460,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, |
*/ |
PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, |
int filters)); |
+#endif /* WRITE */ |
/* Flags for png_set_filter() to say which filters to use. The flags |
* are chosen so that they don't conflict with real filter types |
@@ -1910,35 +1486,8 @@ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, |
#define PNG_FILTER_VALUE_PAETH 4 |
#define PNG_FILTER_VALUE_LAST 5 |
-#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */ |
-/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ |
- * defines, either the default (minimum-sum-of-absolute-differences), or |
- * the experimental method (weighted-minimum-sum-of-absolute-differences). |
- * |
- * Weights are factors >= 1.0, indicating how important it is to keep the |
- * filter type consistent between rows. Larger numbers mean the current |
- * filter is that many times as likely to be the same as the "num_weights" |
- * previous filters. This is cumulative for each previous row with a weight. |
- * There needs to be "num_weights" values in "filter_weights", or it can be |
- * NULL if the weights aren't being specified. Weights have no influence on |
- * the selection of the first row filter. Well chosen weights can (in theory) |
- * improve the compression for a given image. |
- * |
- * Costs are factors >= 1.0 indicating the relative decoding costs of a |
- * filter type. Higher costs indicate more decoding expense, and are |
- * therefore less likely to be selected over a filter with lower computational |
- * costs. There needs to be a value in "filter_costs" for each valid filter |
- * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't |
- * setting the costs. Costs try to improve the speed of decompression without |
- * unduly increasing the compressed image size. |
- * |
- * A negative weight or cost indicates the default value is to be used, and |
- * values in the range [0.0, 1.0) indicate the value is to remain unchanged. |
- * The default values for both weights and costs are currently 1.0, but may |
- * change if good general weighting/cost heuristics can be found. If both |
- * the weights and costs are set to 1.0, this degenerates the WEIGHTED method |
- * to the UNWEIGHTED method, but with added encoding time/computation. |
- */ |
+#ifdef PNG_WRITE_SUPPORTED |
+#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ |
PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, |
int heuristic_method, int num_weights, png_const_doublep filter_weights, |
png_const_doublep filter_costs)) |
@@ -1946,17 +1495,14 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, |
(png_structrp png_ptr, int heuristic_method, int num_weights, |
png_const_fixed_point_p filter_weights, |
png_const_fixed_point_p filter_costs)) |
-#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ |
+#endif /* WRITE_WEIGHTED_FILTER */ |
-/* Heuristic used for row filter selection. These defines should NOT be |
- * changed. |
- */ |
+/* The following are no longer used and will be removed from libpng-1.7: */ |
#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ |
#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ |
#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ |
#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ |
-#ifdef PNG_WRITE_SUPPORTED |
/* Set the library compression level. Currently, valid values range from |
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9 |
* (0 - no compression, 9 - "maximal" compression). Note that tests have |
@@ -1964,6 +1510,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, |
* for PNG images, and do considerably fewer caclulations. In the future, |
* these values may not correspond directly to the zlib compression levels. |
*/ |
+#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED |
PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, |
int level)); |
@@ -1981,7 +1528,7 @@ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, |
PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, |
int method)); |
-#endif |
+#endif /* WRITE_CUSTOMIZE_COMPRESSION */ |
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED |
/* Also set zlib parameters for compressing non-IDAT chunks */ |
@@ -2002,7 +1549,8 @@ PNG_EXPORT(225, void, png_set_text_compression_window_bits, |
PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, |
int method)); |
-#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */ |
+#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ |
+#endif /* WRITE */ |
/* These next functions are called for input/output, memory, and error |
* handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, |
@@ -2113,7 +1661,7 @@ PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); |
* |
* The integer return from the callback function is interpreted thus: |
* |
- * negative: An error occured, png_chunk_error will be called. |
+ * negative: An error occurred; png_chunk_error will be called. |
* zero: The chunk was not handled, the chunk will be saved. A critical |
* chunk will cause an error at this point unless it is to be saved. |
* positive: The chunk was handled, libpng will ignore/discard it. |
@@ -2162,7 +1710,6 @@ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); |
*/ |
PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); |
-#ifdef PNG_READ_INTERLACING_SUPPORTED |
/* Function that combines rows. 'new_row' is a flag that should come from |
* the callback and be non-NULL if anything needs to be done; the library |
* stores its own version of the new data internally and ignores the passed |
@@ -2170,8 +1717,7 @@ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); |
*/ |
PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, |
png_bytep old_row, png_const_bytep new_row)); |
-#endif /* PNG_READ_INTERLACING_SUPPORTED */ |
-#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ |
+#endif /* PROGRESSIVE_READ */ |
PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, |
png_alloc_size_t size), PNG_ALLOCATED); |
@@ -2197,8 +1743,8 @@ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, |
* It is unlikely that this function works correctly as of 1.6.0 and using it |
* may result either in memory leaks or double free of allocated data. |
*/ |
-PNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr, |
- png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED); |
+PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, |
+ png_inforp info_ptr, int freer, png_uint_32 mask)); |
/* Assignments for png_data_freer */ |
#define PNG_DESTROY_WILL_FREE_DATA 1 |
@@ -2240,6 +1786,8 @@ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, |
#else |
/* Fatal error in PNG image of libpng - can't continue */ |
PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); |
+# define png_error(s1,s2) png_err(s1) |
+# define png_chunk_error(s1,s2) png_err(s1) |
#endif |
#ifdef PNG_WARNINGS_SUPPORTED |
@@ -2250,6 +1798,9 @@ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, |
/* Non-fatal error in libpng, chunk name is prepended to message. */ |
PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, |
png_const_charp warning_message)); |
+#else |
+# define png_warning(s1,s2) ((void)(s1)) |
+# define png_chunk_warning(s1,s2) ((void)(s1)) |
#endif |
#ifdef PNG_BENIGN_ERRORS_SUPPORTED |
@@ -2367,7 +1918,7 @@ PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, |
PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, |
(png_const_structrp png_ptr, png_const_inforp info_ptr)); |
-#endif /* PNG_EASY_ACCESS_SUPPORTED */ |
+#endif /* EASY_ACCESS */ |
#ifdef PNG_READ_SUPPORTED |
/* Returns pointer to signature string read from PNG header */ |
@@ -2619,7 +2170,7 @@ PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, |
PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, |
png_inforp info_ptr, int unit, |
png_const_charp swidth, png_const_charp sheight)); |
-#endif /* PNG_sCAL_SUPPORTED */ |
+#endif /* sCAL */ |
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED |
/* Provide the default handling for all unknown chunks or, optionally, for |
@@ -2760,11 +2311,15 @@ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, |
#ifdef PNG_INFO_IMAGE_SUPPORTED |
/* The "params" pointer is currently not used and is for future expansion. */ |
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED |
PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, |
int transforms, png_voidp params)); |
+#endif |
+#ifdef PNG_WRITE_SUPPORTED |
PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, |
int transforms, png_voidp params)); |
#endif |
+#endif |
PNG_EXPORT(180, png_const_charp, png_get_copyright, |
(png_const_structrp png_ptr)); |
@@ -2843,8 +2398,8 @@ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, |
PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, |
png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, |
int *unit_type)); |
-# endif /* PNG_pHYs_SUPPORTED */ |
-#endif /* PNG_INCH_CONVERSIONS_SUPPORTED */ |
+# endif /* pHYs */ |
+#endif /* INCH_CONVERSIONS */ |
/* Added in libpng-1.4.0 */ |
#ifdef PNG_IO_STATE_SUPPORTED |
@@ -2867,7 +2422,7 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, |
# define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ |
# define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ |
# define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ |
-#endif /* ?PNG_IO_STATE_SUPPORTED */ |
+#endif /* IO_STATE */ |
/* Interlace support. The following macros are always defined so that if |
* libpng interlace handling is turned off the macros may be used to handle |
@@ -2951,27 +2506,29 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, |
* (png_uint_16)(alpha) \ |
+ (png_uint_16)(bg)*(png_uint_16)(255 \ |
- (png_uint_16)(alpha)) + 128); \ |
- (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } |
+ (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); } |
# define png_composite_16(composite, fg, alpha, bg) \ |
{ png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ |
* (png_uint_32)(alpha) \ |
+ (png_uint_32)(bg)*(65535 \ |
- (png_uint_32)(alpha)) + 32768); \ |
- (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } |
+ (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); } |
#else /* Standard method using integer division */ |
-# define png_composite(composite, fg, alpha, bg) \ |
- (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ |
- (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ |
- 127) / 255) |
+# define png_composite(composite, fg, alpha, bg) \ |
+ (composite) = \ |
+ (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ |
+ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ |
+ 127) / 255)) |
# define png_composite_16(composite, fg, alpha, bg) \ |
- (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ |
- (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ |
- 32767) / 65535) |
-#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ |
+ (composite) = \ |
+ (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ |
+ (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ |
+ 32767) / 65535)) |
+#endif /* READ_COMPOSITE_NODIV */ |
#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED |
PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); |
@@ -3021,7 +2578,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); |
# define PNG_get_int_32(buf) \ |
((png_int_32)((*(buf) & 0x80) \ |
- ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \ |
+ ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ |
: (png_int_32)png_get_uint_32(buf))) |
/* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, |
@@ -3041,8 +2598,17 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); |
# endif |
#endif |
+#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED |
+PNG_EXPORT(242, void, png_set_check_for_invalid_index, |
+ (png_structrp png_ptr, int allowed)); |
+# ifdef PNG_GET_PALETTE_MAX_SUPPORTED |
+PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, |
+ png_const_infop info_ptr)); |
+# endif |
+#endif /* CHECK_FOR_INVALID_INDEX */ |
+ |
/******************************************************************************* |
- * SIMPLIFIED API |
+ * Section 5: SIMPLIFIED API |
******************************************************************************* |
* |
* Please read the documentation in libpng-manual.txt (TODO: write said |
@@ -3058,8 +2624,9 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); |
* |
* To read a PNG file using the simplified API: |
* |
- * 1) Declare a 'png_image' structure (see below) on the stack and set the |
- * version field to PNG_IMAGE_VERSION. |
+ * 1) Declare a 'png_image' structure (see below) on the stack, set the |
+ * version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL |
+ * (this is REQUIRED, your program may crash if you don't do it.) |
* 2) Call the appropriate png_image_begin_read... function. |
* 3) Set the png_image 'format' member to the required sample format. |
* 4) Allocate a buffer for the image and, if required, the color-map. |
@@ -3086,6 +2653,9 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); |
* when it is being read or defines the in-memory format of an image that you |
* need to write: |
*/ |
+#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ |
+ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) |
+ |
#define PNG_IMAGE_VERSION 1 |
typedef struct png_control *png_controlp; |
@@ -3112,7 +2682,7 @@ typedef struct |
# define PNG_IMAGE_WARNING 1 |
# define PNG_IMAGE_ERROR 2 |
/* |
- * The result is a two bit code such that a value more than 1 indicates |
+ * The result is a two-bit code such that a value more than 1 indicates |
* a failure in the API just called: |
* |
* 0 - no warning or error |
@@ -3185,7 +2755,7 @@ typedef struct |
* called to read or write the color-map and set the format correctly for the |
* image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! |
* |
- * NOTE: libpng can be built with particular features disabled, if you see |
+ * NOTE: libpng can be built with particular features disabled. If you see |
* compiler errors because the definition of one of the following flags has been |
* compiled out it is because libpng does not have the required support. It is |
* possible, however, for the libpng configuration to enable the format on just |
@@ -3197,7 +2767,7 @@ typedef struct |
*/ |
#define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ |
#define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ |
-#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2 byte channels else 1 byte */ |
+#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2-byte channels else 1-byte */ |
#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ |
#ifdef PNG_FORMAT_BGR_SUPPORTED |
@@ -3397,7 +2967,7 @@ PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, |
PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, |
FILE* file)); |
/* The PNG header is read from the stdio FILE object. */ |
-#endif /* PNG_STDIO_SUPPORTED */ |
+#endif /* STDIO */ |
PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, |
png_const_voidp memory, png_size_t size)); |
@@ -3442,7 +3012,7 @@ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); |
/* Free any data allocated by libpng in image->opaque, setting the pointer to |
* NULL. May be called at any time after the structure is initialized. |
*/ |
-#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ |
+#endif /* SIMPLIFIED_READ */ |
#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED |
#ifdef PNG_STDIO_SUPPORTED |
@@ -3484,27 +3054,21 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, |
* |
* With all APIs row_stride is handled as in the read APIs - it is the spacing |
* from one row to the next in component sized units (1 or 2 bytes) and if |
- * negative indicates a bottom-up row layout in the buffer. |
+ * negative indicates a bottom-up row layout in the buffer. If row_stride is zero, |
+ * libpng will calculate it for you from the image width and number of channels. |
* |
- * Note that the write API does not support interlacing or sub-8-bit pixels. |
+ * Note that the write API does not support interlacing, sub-8-bit pixels, indexed |
+ * PNG (color_type 3) or most ancillary chunks. |
*/ |
-#endif /* PNG_STDIO_SUPPORTED */ |
-#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */ |
+#endif /* STDIO */ |
+#endif /* SIMPLIFIED_WRITE */ |
/******************************************************************************* |
* END OF SIMPLIFIED API |
******************************************************************************/ |
- |
-#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED |
-PNG_EXPORT(242, void, png_set_check_for_invalid_index, |
- (png_structrp png_ptr, int allowed)); |
-# ifdef PNG_GET_PALETTE_MAX_SUPPORTED |
-PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, |
- png_const_infop info_ptr)); |
-# endif |
-#endif /* CHECK_FOR_INVALID_INDEX */ |
+#endif /* SIMPLIFIED_{READ|WRITE} */ |
/******************************************************************************* |
- * IMPLEMENTATION OPTIONS |
+ * Section 6: IMPLEMENTATION OPTIONS |
******************************************************************************* |
* |
* Support for arbitrary implementation-specific optimizations. The API allows |
@@ -3529,7 +3093,8 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, |
# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ |
#endif |
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ |
-#define PNG_OPTION_NEXT 4 /* Next option - numbers must be even */ |
+#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */ |
+#define PNG_OPTION_NEXT 6 /* Next option - numbers must be even */ |
/* Return values: NOTE: there are four values and 'off' is *not* zero */ |
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ |
@@ -3539,19 +3104,18 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, |
PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, |
int onoff)); |
-#endif |
+#endif /* SET_OPTION */ |
/******************************************************************************* |
- * END OF HARDWARE OPTIONS |
+ * END OF HARDWARE AND SOFTWARE OPTIONS |
******************************************************************************/ |
-/* Maintainer: Put new public prototypes here ^, in libpng.3, and project |
- * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt |
+/* Maintainer: Put new public prototypes here ^, in libpng.3, in project |
+ * defs, and in scripts/symbols.def. |
*/ |
/* The last ordinal number (this is the *last* one already used; the next |
- * one to use is one more than this.) Maintainer, remember to add an entry to |
- * scripts/symbols.def as well. |
+ * one to use is one more than this.) |
*/ |
#ifdef PNG_EXPORT_LAST_ORDINAL |
PNG_EXPORT_LAST_ORDINAL(244); |