PageRenderTime 549ms CodeModel.GetById 171ms app.highlight 122ms RepoModel.GetById 239ms app.codeStats 1ms

/src/compiler/android/jni/ftk/png.h

http://ftk.googlecode.com/
C++ Header | 1411 lines | 563 code | 110 blank | 738 comment | 16 complexity | a993e38bb811d258493ecaa4da2b7533 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/* png.h - header file for PNG reference library
   2 *
   3 * libpng version 1.2.44 - June 26, 2010
   4 * Copyright (c) 1998-2010 Glenn Randers-Pehrson
   5 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   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)
   9 *
  10 * Authors and maintainers:
  11 *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  12 *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
  13 *  libpng versions 0.97, January 1998, through 1.2.44 - June 26, 2010: Glenn
  14 *  See also "Contributing Authors", below.
  15 *
  16 * Note about libpng version numbers:
  17 *
  18 *    Due to various miscommunications, unforeseen code incompatibilities
  19 *    and occasional factors outside the authors' control, version numbering
  20 *    on the library has not always been consistent and straightforward.
  21 *    The following table summarizes matters since version 0.89c, which was
  22 *    the first widely used release:
  23 *
  24 *    source                 png.h  png.h  shared-lib
  25 *    version                string   int  version
  26 *    -------                ------ -----  ----------
  27 *    0.89c "1.0 beta 3"     0.89      89  1.0.89
  28 *    0.90  "1.0 beta 4"     0.90      90  0.90  [should have been 2.0.90]
  29 *    0.95  "1.0 beta 5"     0.95      95  0.95  [should have been 2.0.95]
  30 *    0.96  "1.0 beta 6"     0.96      96  0.96  [should have been 2.0.96]
  31 *    0.97b "1.00.97 beta 7" 1.00.97   97  1.0.1 [should have been 2.0.97]
  32 *    0.97c                  0.97      97  2.0.97
  33 *    0.98                   0.98      98  2.0.98
  34 *    0.99                   0.99      98  2.0.99
  35 *    0.99a-m                0.99      99  2.0.99
  36 *    1.00                   1.00     100  2.1.0 [100 should be 10000]
  37 *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]
  38 *    1.0.1       png.h string is   10001  2.1.0
  39 *    1.0.1a-e    identical to the  10002  from here on, the shared library
  40 *    1.0.2       source version)   10002  is 2.V where V is the source code
  41 *    1.0.2a-b                      10003  version, except as noted.
  42 *    1.0.3                         10003
  43 *    1.0.3a-d                      10004
  44 *    1.0.4                         10004
  45 *    1.0.4a-f                      10005
  46 *    1.0.5 (+ 2 patches)           10005
  47 *    1.0.5a-d                      10006
  48 *    1.0.5e-r                      10100 (not source compatible)
  49 *    1.0.5s-v                      10006 (not binary compatible)
  50 *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)
  51 *    1.0.6d-f                      10007 (still binary incompatible)
  52 *    1.0.6g                        10007
  53 *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)
  54 *    1.0.6i                        10007  10.6i
  55 *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)
  56 *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)
  57 *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)
  58 *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)
  59 *    1.0.7                    1    10007  (still compatible)
  60 *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4
  61 *    1.0.8rc1                 1    10008  2.1.0.8rc1
  62 *    1.0.8                    1    10008  2.1.0.8
  63 *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6
  64 *    1.0.9rc1                 1    10009  2.1.0.9rc1
  65 *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10
  66 *    1.0.9rc2                 1    10009  2.1.0.9rc2
  67 *    1.0.9                    1    10009  2.1.0.9
  68 *    1.0.10beta1              1    10010  2.1.0.10beta1
  69 *    1.0.10rc1                1    10010  2.1.0.10rc1
  70 *    1.0.10                   1    10010  2.1.0.10
  71 *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3
  72 *    1.0.11rc1                1    10011  2.1.0.11rc1
  73 *    1.0.11                   1    10011  2.1.0.11
  74 *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2
  75 *    1.0.12rc1                2    10012  2.1.0.12rc1
  76 *    1.0.12                   2    10012  2.1.0.12
  77 *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)
  78 *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2
  79 *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5
  80 *    1.2.0rc1                 3    10200  3.1.2.0rc1
  81 *    1.2.0                    3    10200  3.1.2.0
  82 *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4
  83 *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2
  84 *    1.2.1                    3    10201  3.1.2.1
  85 *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6
  86 *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1
  87 *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1
  88 *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1
  89 *    1.0.13                  10    10013  10.so.0.1.0.13
  90 *    1.2.2                   12    10202  12.so.0.1.2.2
  91 *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6
  92 *    1.2.3                   12    10203  12.so.0.1.2.3
  93 *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3
  94 *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1
  95 *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1
  96 *    1.0.14                  10    10014  10.so.0.1.0.14
  97 *    1.2.4                   13    10204  12.so.0.1.2.4
  98 *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2
  99 *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3
 100 *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3
 101 *    1.0.15                  10    10015  10.so.0.1.0.15
 102 *    1.2.5                   13    10205  12.so.0.1.2.5
 103 *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4
 104 *    1.0.16                  10    10016  10.so.0.1.0.16
 105 *    1.2.6                   13    10206  12.so.0.1.2.6
 106 *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2
 107 *    1.0.17rc1               10    10017  10.so.0.1.0.17rc1
 108 *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1
 109 *    1.0.17                  10    10017  10.so.0.1.0.17
 110 *    1.2.7                   13    10207  12.so.0.1.2.7
 111 *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5
 112 *    1.0.18rc1-5             10    10018  10.so.0.1.0.18rc1-5
 113 *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5
 114 *    1.0.18                  10    10018  10.so.0.1.0.18
 115 *    1.2.8                   13    10208  12.so.0.1.2.8
 116 *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3
 117 *    1.2.9beta4-11           13    10209  12.so.0.9[.0]
 118 *    1.2.9rc1                13    10209  12.so.0.9[.0]
 119 *    1.2.9                   13    10209  12.so.0.9[.0]
 120 *    1.2.10beta1-8           13    10210  12.so.0.10[.0]
 121 *    1.2.10rc1-3             13    10210  12.so.0.10[.0]
 122 *    1.2.10                  13    10210  12.so.0.10[.0]
 123 *    1.2.11beta1-4           13    10211  12.so.0.11[.0]
 124 *    1.0.19rc1-5             10    10019  10.so.0.19[.0]
 125 *    1.2.11rc1-5             13    10211  12.so.0.11[.0]
 126 *    1.0.19                  10    10019  10.so.0.19[.0]
 127 *    1.2.11                  13    10211  12.so.0.11[.0]
 128 *    1.0.20                  10    10020  10.so.0.20[.0]
 129 *    1.2.12                  13    10212  12.so.0.12[.0]
 130 *    1.2.13beta1             13    10213  12.so.0.13[.0]
 131 *    1.0.21                  10    10021  10.so.0.21[.0]
 132 *    1.2.13                  13    10213  12.so.0.13[.0]
 133 *    1.2.14beta1-2           13    10214  12.so.0.14[.0]
 134 *    1.0.22rc1               10    10022  10.so.0.22[.0]
 135 *    1.2.14rc1               13    10214  12.so.0.14[.0]
 136 *    1.0.22                  10    10022  10.so.0.22[.0]
 137 *    1.2.14                  13    10214  12.so.0.14[.0]
 138 *    1.2.15beta1-6           13    10215  12.so.0.15[.0]
 139 *    1.0.23rc1-5             10    10023  10.so.0.23[.0]
 140 *    1.2.15rc1-5             13    10215  12.so.0.15[.0]
 141 *    1.0.23                  10    10023  10.so.0.23[.0]
 142 *    1.2.15                  13    10215  12.so.0.15[.0]
 143 *    1.2.16beta1-2           13    10216  12.so.0.16[.0]
 144 *    1.2.16rc1               13    10216  12.so.0.16[.0]
 145 *    1.0.24                  10    10024  10.so.0.24[.0]
 146 *    1.2.16                  13    10216  12.so.0.16[.0]
 147 *    1.2.17beta1-2           13    10217  12.so.0.17[.0]
 148 *    1.0.25rc1               10    10025  10.so.0.25[.0]
 149 *    1.2.17rc1-3             13    10217  12.so.0.17[.0]
 150 *    1.0.25                  10    10025  10.so.0.25[.0]
 151 *    1.2.17                  13    10217  12.so.0.17[.0]
 152 *    1.0.26                  10    10026  10.so.0.26[.0]
 153 *    1.2.18                  13    10218  12.so.0.18[.0]
 154 *    1.2.19beta1-31          13    10219  12.so.0.19[.0]
 155 *    1.0.27rc1-6             10    10027  10.so.0.27[.0]
 156 *    1.2.19rc1-6             13    10219  12.so.0.19[.0]
 157 *    1.0.27                  10    10027  10.so.0.27[.0]
 158 *    1.2.19                  13    10219  12.so.0.19[.0]
 159 *    1.2.20beta01-04         13    10220  12.so.0.20[.0]
 160 *    1.0.28rc1-6             10    10028  10.so.0.28[.0]
 161 *    1.2.20rc1-6             13    10220  12.so.0.20[.0]
 162 *    1.0.28                  10    10028  10.so.0.28[.0]
 163 *    1.2.20                  13    10220  12.so.0.20[.0]
 164 *    1.2.21beta1-2           13    10221  12.so.0.21[.0]
 165 *    1.2.21rc1-3             13    10221  12.so.0.21[.0]
 166 *    1.0.29                  10    10029  10.so.0.29[.0]
 167 *    1.2.21                  13    10221  12.so.0.21[.0]
 168 *    1.2.22beta1-4           13    10222  12.so.0.22[.0]
 169 *    1.0.30rc1               10    10030  10.so.0.30[.0]
 170 *    1.2.22rc1               13    10222  12.so.0.22[.0]
 171 *    1.0.30                  10    10030  10.so.0.30[.0]
 172 *    1.2.22                  13    10222  12.so.0.22[.0]
 173 *    1.2.23beta01-05         13    10223  12.so.0.23[.0]
 174 *    1.2.23rc01              13    10223  12.so.0.23[.0]
 175 *    1.2.23                  13    10223  12.so.0.23[.0]
 176 *    1.2.24beta01-02         13    10224  12.so.0.24[.0]
 177 *    1.2.24rc01              13    10224  12.so.0.24[.0]
 178 *    1.2.24                  13    10224  12.so.0.24[.0]
 179 *    1.2.25beta01-06         13    10225  12.so.0.25[.0]
 180 *    1.2.25rc01-02           13    10225  12.so.0.25[.0]
 181 *    1.0.31                  10    10031  10.so.0.31[.0]
 182 *    1.2.25                  13    10225  12.so.0.25[.0]
 183 *    1.2.26beta01-06         13    10226  12.so.0.26[.0]
 184 *    1.2.26rc01              13    10226  12.so.0.26[.0]
 185 *    1.2.26                  13    10226  12.so.0.26[.0]
 186 *    1.0.32                  10    10032  10.so.0.32[.0]
 187 *    1.2.27beta01-06         13    10227  12.so.0.27[.0]
 188 *    1.2.27rc01              13    10227  12.so.0.27[.0]
 189 *    1.0.33                  10    10033  10.so.0.33[.0]
 190 *    1.2.27                  13    10227  12.so.0.27[.0]
 191 *    1.0.34                  10    10034  10.so.0.34[.0]
 192 *    1.2.28                  13    10228  12.so.0.28[.0]
 193 *    1.2.29beta01-03         13    10229  12.so.0.29[.0]
 194 *    1.2.29rc01              13    10229  12.so.0.29[.0]
 195 *    1.0.35                  10    10035  10.so.0.35[.0]
 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]
 248 *    1.2.41beta01-18         13    10241  12.so.0.41[.0]
 249 *    1.0.51rc01              10    10051  10.so.0.51[.0]
 250 *    1.2.41rc01-03           13    10241  12.so.0.41[.0]
 251 *    1.0.51                  10    10051  10.so.0.51[.0]
 252 *    1.2.41                  13    10241  12.so.0.41[.0]
 253 *    1.2.42beta01-02         13    10242  12.so.0.42[.0]
 254 *    1.2.42rc01-05           13    10242  12.so.0.42[.0]
 255 *    1.0.52                  10    10052  10.so.0.52[.0]
 256 *    1.2.42                  13    10242  12.so.0.42[.0]
 257 *    1.2.43beta01-05         13    10243  12.so.0.43[.0]
 258 *    1.0.53rc01-02           10    10053  10.so.0.53[.0]
 259 *    1.2.43rc01-02           13    10243  12.so.0.43[.0]
 260 *    1.0.53                  10    10053  10.so.0.53[.0]
 261 *    1.2.43                  13    10243  12.so.0.43[.0]
 262 *    1.2.44beta01-03         13    10244  12.so.0.44[.0]
 263 *    1.2.44rc01-03           13    10244  12.so.0.44[.0]
 264 *    1.2.44                  13    10244  12.so.0.44[.0]
 265 *
 266 *    Henceforth the source version will match the shared-library major
 267 *    and minor numbers; the shared-library major version number will be
 268 *    used for changes in backward compatibility, as it is intended.  The
 269 *    PNG_LIBPNG_VER macro, which is not used within libpng but is available
 270 *    for applications, is an unsigned integer of the form xyyzz corresponding
 271 *    to the source version x.y.z (leading zeros in y and z).  Beta versions
 272 *    were given the previous public release number plus a letter, until
 273 *    version 1.0.6j; from then on they were given the upcoming public
 274 *    release number plus "betaNN" or "rcNN".
 275 *
 276 *    Binary incompatibility exists only when applications make direct access
 277 *    to the info_ptr or png_ptr members through png.h, and the compiled
 278 *    application is loaded with a different version of the library.
 279 *
 280 *    DLLNUM will change each time there are forward or backward changes
 281 *    in binary compatibility (e.g., when a new feature is added).
 282 *
 283 * See libpng.txt or libpng.3 for more information.  The PNG specification
 284 * is available as a W3C Recommendation and as an ISO Specification,
 285 * <http://www.w3.org/TR/2003/REC-PNG-20031110/
 286 */
 287
 288/*
 289 * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
 290 *
 291 * If you modify libpng you may insert additional notices immediately following
 292 * this sentence.
 293 *
 294 * This code is released under the libpng license.
 295 *
 296 * libpng versions 1.2.6, August 15, 2004, through 1.2.44, June 26, 2010, are
 297 * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
 298 * distributed according to the same disclaimer and license as libpng-1.2.5
 299 * with the following individual added to the list of Contributing Authors:
 300 *
 301 *    Cosmin Truta
 302 *
 303 * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
 304 * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
 305 * distributed according to the same disclaimer and license as libpng-1.0.6
 306 * with the following individuals added to the list of Contributing Authors:
 307 *
 308 *    Simon-Pierre Cadieux
 309 *    Eric S. Raymond
 310 *    Gilles Vollant
 311 *
 312 * and with the following additions to the disclaimer:
 313 *
 314 *    There is no warranty against interference with your enjoyment of the
 315 *    library or against infringement.  There is no warranty that our
 316 *    efforts or the library will fulfill any of your particular purposes
 317 *    or needs.  This library is provided with all faults, and the entire
 318 *    risk of satisfactory quality, performance, accuracy, and effort is with
 319 *    the user.
 320 *
 321 * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
 322 * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
 323 * distributed according to the same disclaimer and license as libpng-0.96,
 324 * with the following individuals added to the list of Contributing Authors:
 325 *
 326 *    Tom Lane
 327 *    Glenn Randers-Pehrson
 328 *    Willem van Schaik
 329 *
 330 * libpng versions 0.89, June 1996, through 0.96, May 1997, are
 331 * Copyright (c) 1996, 1997 Andreas Dilger
 332 * Distributed according to the same disclaimer and license as libpng-0.88,
 333 * with the following individuals added to the list of Contributing Authors:
 334 *
 335 *    John Bowler
 336 *    Kevin Bracey
 337 *    Sam Bushell
 338 *    Magnus Holmgren
 339 *    Greg Roelofs
 340 *    Tom Tanner
 341 *
 342 * libpng versions 0.5, May 1995, through 0.88, January 1996, are
 343 * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
 344 *
 345 * For the purposes of this copyright and license, "Contributing Authors"
 346 * is defined as the following set of individuals:
 347 *
 348 *    Andreas Dilger
 349 *    Dave Martindale
 350 *    Guy Eric Schalnat
 351 *    Paul Schmidt
 352 *    Tim Wegner
 353 *
 354 * The PNG Reference Library is supplied "AS IS".  The Contributing Authors
 355 * and Group 42, Inc. disclaim all warranties, expressed or implied,
 356 * including, without limitation, the warranties of merchantability and of
 357 * fitness for any purpose.  The Contributing Authors and Group 42, Inc.
 358 * assume no liability for direct, indirect, incidental, special, exemplary,
 359 * or consequential damages, which may result from the use of the PNG
 360 * Reference Library, even if advised of the possibility of such damage.
 361 *
 362 * Permission is hereby granted to use, copy, modify, and distribute this
 363 * source code, or portions hereof, for any purpose, without fee, subject
 364 * to the following restrictions:
 365 *
 366 * 1. The origin of this source code must not be misrepresented.
 367 *
 368 * 2. Altered versions must be plainly marked as such and
 369 * must not be misrepresented as being the original source.
 370 *
 371 * 3. This Copyright notice may not be removed or altered from
 372 *    any source or altered source distribution.
 373 *
 374 * The Contributing Authors and Group 42, Inc. specifically permit, without
 375 * fee, and encourage the use of this source code as a component to
 376 * supporting the PNG file format in commercial products.  If you use this
 377 * source code in a product, acknowledgment is not required but would be
 378 * appreciated.
 379 */
 380
 381/*
 382 * A "png_get_copyright" function is available, for convenient use in "about"
 383 * boxes and the like:
 384 *
 385 * printf("%s",png_get_copyright(NULL));
 386 *
 387 * Also, the PNG logo (in PNG format, of course) is supplied in the
 388 * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
 389 */
 390
 391/*
 392 * Libpng is OSI Certified Open Source Software.  OSI Certified is a
 393 * certification mark of the Open Source Initiative.
 394 */
 395
 396/*
 397 * The contributing authors would like to thank all those who helped
 398 * with testing, bug fixes, and patience.  This wouldn't have been
 399 * possible without all of you.
 400 *
 401 * Thanks to Frank J. T. Wojcik for helping with the documentation.
 402 */
 403
 404/*
 405 * Y2K compliance in libpng:
 406 * =========================
 407 *
 408 *    June 26, 2010
 409 *
 410 *    Since the PNG Development group is an ad-hoc body, we can't make
 411 *    an official declaration.
 412 *
 413 *    This is your unofficial assurance that libpng from version 0.71 and
 414 *    upward through 1.2.44 are Y2K compliant.  It is my belief that earlier
 415 *    versions were also Y2K compliant.
 416 *
 417 *    Libpng only has three year fields.  One is a 2-byte unsigned integer
 418 *    that will hold years up to 65535.  The other two hold the date in text
 419 *    format, and will hold years up to 9999.
 420 *
 421 *    The integer is
 422 *        "png_uint_16 year" in png_time_struct.
 423 *
 424 *    The strings are
 425 *        "png_charp time_buffer" in png_struct and
 426 *        "near_time_buffer", which is a local character string in png.c.
 427 *
 428 *    There are seven time-related functions:
 429 *        png.c: png_convert_to_rfc_1123() in png.c
 430 *          (formerly png_convert_to_rfc_1152() in error)
 431 *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
 432 *        png_convert_from_time_t() in pngwrite.c
 433 *        png_get_tIME() in pngget.c
 434 *        png_handle_tIME() in pngrutil.c, called in pngread.c
 435 *        png_set_tIME() in pngset.c
 436 *        png_write_tIME() in pngwutil.c, called in pngwrite.c
 437 *
 438 *    All handle dates properly in a Y2K environment.  The
 439 *    png_convert_from_time_t() function calls gmtime() to convert from system
 440 *    clock time, which returns (year - 1900), which we properly convert to
 441 *    the full 4-digit year.  There is a possibility that applications using
 442 *    libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
 443 *    function, or that they are incorrectly passing only a 2-digit year
 444 *    instead of "year - 1900" into the png_convert_from_struct_tm() function,
 445 *    but this is not under our control.  The libpng documentation has always
 446 *    stated that it works with 4-digit years, and the APIs have been
 447 *    documented as such.
 448 *
 449 *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned
 450 *    integer to hold the year, and can hold years as large as 65535.
 451 *
 452 *    zlib, upon which libpng depends, is also Y2K compliant.  It contains
 453 *    no date-related code.
 454 *
 455 *       Glenn Randers-Pehrson
 456 *       libpng maintainer
 457 *       PNG Development Group
 458 */
 459
 460#ifndef PNG_H
 461#define PNG_H
 462
 463/* This is not the place to learn how to use libpng.  The file libpng.txt
 464 * describes how to use libpng, and the file example.c summarizes it
 465 * with some code on which to build.  This file is useful for looking
 466 * at the actual function definitions and structure components.
 467 */
 468
 469/* Version information for png.h - this should match the version in png.c */
 470#define PNG_LIBPNG_VER_STRING "1.2.44"
 471#define PNG_HEADER_VERSION_STRING \
 472   " libpng version 1.2.44 - June 26, 2010\n"
 473
 474#define PNG_LIBPNG_VER_SONUM   0
 475#define PNG_LIBPNG_VER_DLLNUM  13
 476
 477/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
 478#define PNG_LIBPNG_VER_MAJOR   1
 479#define PNG_LIBPNG_VER_MINOR   2
 480#define PNG_LIBPNG_VER_RELEASE 44
 481/* This should match the numeric part of the final component of
 482 * PNG_LIBPNG_VER_STRING, omitting any leading zero:
 483 */
 484
 485#define PNG_LIBPNG_VER_BUILD  0
 486
 487/* Release Status */
 488#define PNG_LIBPNG_BUILD_ALPHA    1
 489#define PNG_LIBPNG_BUILD_BETA     2
 490#define PNG_LIBPNG_BUILD_RC       3
 491#define PNG_LIBPNG_BUILD_STABLE   4
 492#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
 493
 494/* Release-Specific Flags */
 495#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with
 496                                       PNG_LIBPNG_BUILD_STABLE only */
 497#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with
 498                                       PNG_LIBPNG_BUILD_SPECIAL */
 499#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
 500                                       PNG_LIBPNG_BUILD_PRIVATE */
 501
 502#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
 503
 504/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.
 505 * We must not include leading zeros.
 506 * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
 507 * version 1.0.0 was mis-numbered 100 instead of 10000).  From
 508 * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
 509 */
 510#define PNG_LIBPNG_VER 10244 /* 1.2.44 */
 511
 512#ifndef PNG_VERSION_INFO_ONLY
 513/* Include the compression library's header */
 514#include "zlib.h"
 515#endif
 516
 517/* Include all user configurable info, including optional assembler routines */
 518#include "pngconf.h"
 519
 520/*
 521 * Added at libpng-1.2.8 */
 522/* Ref MSDN: Private as priority over Special
 523 * VS_FF_PRIVATEBUILD File *was not* built using standard release
 524 * procedures. If this value is given, the StringFileInfo block must
 525 * contain a PrivateBuild string.
 526 *
 527 * VS_FF_SPECIALBUILD File *was* built by the original company using
 528 * standard release procedures but is a variation of the standard
 529 * file of the same version number. If this value is given, the
 530 * StringFileInfo block must contain a SpecialBuild string.
 531 */
 532
 533#ifdef PNG_USER_PRIVATEBUILD
 534#  define PNG_LIBPNG_BUILD_TYPE \
 535          (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
 536#else
 537#  ifdef PNG_LIBPNG_SPECIALBUILD
 538#    define PNG_LIBPNG_BUILD_TYPE \
 539            (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
 540#  else
 541#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
 542#  endif
 543#endif
 544
 545#ifndef PNG_VERSION_INFO_ONLY
 546
 547/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
 548#ifdef __cplusplus
 549extern "C" {
 550#endif /* __cplusplus */
 551
 552/* This file is arranged in several sections.  The first section contains
 553 * structure and type definitions.  The second section contains the external
 554 * library functions, while the third has the internal library functions,
 555 * which applications aren't expected to use directly.
 556 */
 557
 558#ifndef PNG_NO_TYPECAST_NULL
 559#define int_p_NULL                (int *)NULL
 560#define png_bytep_NULL            (png_bytep)NULL
 561#define png_bytepp_NULL           (png_bytepp)NULL
 562#define png_doublep_NULL          (png_doublep)NULL
 563#define png_error_ptr_NULL        (png_error_ptr)NULL
 564#define png_flush_ptr_NULL        (png_flush_ptr)NULL
 565#define png_free_ptr_NULL         (png_free_ptr)NULL
 566#define png_infopp_NULL           (png_infopp)NULL
 567#define png_malloc_ptr_NULL       (png_malloc_ptr)NULL
 568#define png_read_status_ptr_NULL  (png_read_status_ptr)NULL
 569#define png_rw_ptr_NULL           (png_rw_ptr)NULL
 570#define png_structp_NULL          (png_structp)NULL
 571#define png_uint_16p_NULL         (png_uint_16p)NULL
 572#define png_voidp_NULL            (png_voidp)NULL
 573#define png_write_status_ptr_NULL (png_write_status_ptr)NULL
 574#else
 575#define int_p_NULL                NULL
 576#define png_bytep_NULL            NULL
 577#define png_bytepp_NULL           NULL
 578#define png_doublep_NULL          NULL
 579#define png_error_ptr_NULL        NULL
 580#define png_flush_ptr_NULL        NULL
 581#define png_free_ptr_NULL         NULL
 582#define png_infopp_NULL           NULL
 583#define png_malloc_ptr_NULL       NULL
 584#define png_read_status_ptr_NULL  NULL
 585#define png_rw_ptr_NULL           NULL
 586#define png_structp_NULL          NULL
 587#define png_uint_16p_NULL         NULL
 588#define png_voidp_NULL            NULL
 589#define png_write_status_ptr_NULL NULL
 590#endif
 591
 592/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */
 593#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
 594/* Version information for C files, stored in png.c.  This had better match
 595 * the version above.
 596 */
 597#ifdef PNG_USE_GLOBAL_ARRAYS
 598PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18];
 599  /* Need room for 99.99.99beta99z */
 600#else
 601#define png_libpng_ver png_get_header_ver(NULL)
 602#endif
 603
 604#ifdef PNG_USE_GLOBAL_ARRAYS
 605/* This was removed in version 1.0.5c */
 606/* Structures to facilitate easy interlacing.  See png.c for more details */
 607PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_start[7];
 608PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_inc[7];
 609PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_ystart[7];
 610PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_yinc[7];
 611PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_mask[7];
 612PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_dsp_mask[7];
 613/* This isn't currently used.  If you need it, see png.c for more details.
 614PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_height[7];
 615*/
 616#endif
 617
 618#endif /* PNG_NO_EXTERN */
 619
 620/* Three color definitions.  The order of the red, green, and blue, (and the
 621 * exact size) is not important, although the size of the fields need to
 622 * be png_byte or png_uint_16 (as defined below).
 623 */
 624typedef struct png_color_struct
 625{
 626   png_byte red;
 627   png_byte green;
 628   png_byte blue;
 629} png_color;
 630typedef png_color FAR * png_colorp;
 631typedef png_color FAR * FAR * png_colorpp;
 632
 633typedef struct png_color_16_struct
 634{
 635   png_byte index;    /* used for palette files */
 636   png_uint_16 red;   /* for use in red green blue files */
 637   png_uint_16 green;
 638   png_uint_16 blue;
 639   png_uint_16 gray;  /* for use in grayscale files */
 640} png_color_16;
 641typedef png_color_16 FAR * png_color_16p;
 642typedef png_color_16 FAR * FAR * png_color_16pp;
 643
 644typedef struct png_color_8_struct
 645{
 646   png_byte red;   /* for use in red green blue files */
 647   png_byte green;
 648   png_byte blue;
 649   png_byte gray;  /* for use in grayscale files */
 650   png_byte alpha; /* for alpha channel files */
 651} png_color_8;
 652typedef png_color_8 FAR * png_color_8p;
 653typedef png_color_8 FAR * FAR * png_color_8pp;
 654
 655/*
 656 * The following two structures are used for the in-core representation
 657 * of sPLT chunks.
 658 */
 659typedef struct png_sPLT_entry_struct
 660{
 661   png_uint_16 red;
 662   png_uint_16 green;
 663   png_uint_16 blue;
 664   png_uint_16 alpha;
 665   png_uint_16 frequency;
 666} png_sPLT_entry;
 667typedef png_sPLT_entry FAR * png_sPLT_entryp;
 668typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
 669
 670/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples
 671 *  occupy the LSB of their respective members, and the MSB of each member
 672 *  is zero-filled.  The frequency member always occupies the full 16 bits.
 673 */
 674
 675typedef struct png_sPLT_struct
 676{
 677   png_charp name;           /* palette name */
 678   png_byte depth;           /* depth of palette samples */
 679   png_sPLT_entryp entries;  /* palette entries */
 680   png_int_32 nentries;      /* number of palette entries */
 681} png_sPLT_t;
 682typedef png_sPLT_t FAR * png_sPLT_tp;
 683typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
 684
 685#ifdef PNG_TEXT_SUPPORTED
 686/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
 687 * and whether that contents is compressed or not.  The "key" field
 688 * points to a regular zero-terminated C string.  The "text", "lang", and
 689 * "lang_key" fields can be regular C strings, empty strings, or NULL pointers.
 690 * However, the * structure returned by png_get_text() will always contain
 691 * regular zero-terminated C strings (possibly empty), never NULL pointers,
 692 * so they can be safely used in printf() and other string-handling functions.
 693 */
 694typedef struct png_text_struct
 695{
 696   int  compression;       /* compression value:
 697                             -1: tEXt, none
 698                              0: zTXt, deflate
 699                              1: iTXt, none
 700                              2: iTXt, deflate  */
 701   png_charp key;          /* keyword, 1-79 character description of "text" */
 702   png_charp text;         /* comment, may be an empty string (ie "")
 703                              or a NULL pointer */
 704   png_size_t text_length; /* length of the text string */
 705#ifdef PNG_iTXt_SUPPORTED
 706   png_size_t itxt_length; /* length of the itxt string */
 707   png_charp lang;         /* language code, 0-79 characters
 708                              or a NULL pointer */
 709   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more
 710                              chars or a NULL pointer */
 711#endif
 712} png_text;
 713typedef png_text FAR * png_textp;
 714typedef png_text FAR * FAR * png_textpp;
 715#endif
 716
 717/* Supported compression types for text in PNG files (tEXt, and zTXt).
 718 * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed.
 719 */
 720#define PNG_TEXT_COMPRESSION_NONE_WR -3
 721#define PNG_TEXT_COMPRESSION_zTXt_WR -2
 722#define PNG_TEXT_COMPRESSION_NONE    -1
 723#define PNG_TEXT_COMPRESSION_zTXt     0
 724#define PNG_ITXT_COMPRESSION_NONE     1
 725#define PNG_ITXT_COMPRESSION_zTXt     2
 726#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */
 727
 728/* png_time is a way to hold the time in an machine independent way.
 729 * Two conversions are provided, both from time_t and struct tm.  There
 730 * is no portable way to convert to either of these structures, as far
 731 * as I know.  If you know of a portable way, send it to me.  As a side
 732 * note - PNG has always been Year 2000 compliant!
 733 */
 734typedef struct png_time_struct
 735{
 736   png_uint_16 year; /* full year, as in, 1995 */
 737   png_byte month;   /* month of year, 1 - 12 */
 738   png_byte day;     /* day of month, 1 - 31 */
 739   png_byte hour;    /* hour of day, 0 - 23 */
 740   png_byte minute;  /* minute of hour, 0 - 59 */
 741   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */
 742} png_time;
 743typedef png_time FAR * png_timep;
 744typedef png_time FAR * FAR * png_timepp;
 745
 746#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
 747 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
 748/* png_unknown_chunk is a structure to hold queued chunks for which there is
 749 * no specific support.  The idea is that we can use this to queue
 750 * up private chunks for output even though the library doesn't actually
 751 * know about their semantics.
 752 */
 753#define PNG_CHUNK_NAME_LENGTH 5
 754typedef struct png_unknown_chunk_t
 755{
 756    png_byte name[PNG_CHUNK_NAME_LENGTH];
 757    png_byte *data;
 758    png_size_t size;
 759
 760    /* libpng-using applications should NOT directly modify this byte. */
 761    png_byte location; /* mode of operation at read time */
 762}
 763png_unknown_chunk;
 764typedef png_unknown_chunk FAR * png_unknown_chunkp;
 765typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
 766#endif
 767
 768#ifdef PNG_INDEX_SUPPORTED
 769/* png_line_index_struct records an index point, where we impose an index point
 770 * to be located at the beginning of a line for simplifying the implementation.
 771 */
 772typedef struct png_line_index_struct
 773{
 774   // state of the lz decoder
 775   z_streamp   z_state;
 776
 777   // the IDAT header position of the chunk, which the index point is in
 778   png_uint_32  stream_idat_position;
 779
 780   // we intend to record the offset of the index point in the chunk,
 781   // but we record the number of remaining bytes in the chunk after the
 782   // index point. That's because PNG processes a chunk this way.
 783   png_uint_32  bytes_left_in_idat;
 784
 785   // decompressed data of the previous row
 786   png_bytep   prev_row;
 787} png_line_index;
 788typedef png_line_index FAR * png_line_indexp;
 789
 790typedef struct png_index_struct
 791{
 792   // A temporary variable used when we build the index. The variable records
 793   // the IDAT header position of the last chunk read in so far.
 794   png_uint_32  stream_idat_position;
 795
 796   // line index information about each passes
 797
 798   // the number of index points in each pass
 799   png_uint_32  size[7];
 800
 801   // the line span of two index points of each pass
 802   png_uint_32  step[7];
 803
 804   // the index points of each pass
 805   png_line_indexp  *pass_line_index[7];
 806} png_index;
 807typedef png_index FAR * png_indexp;
 808
 809#define INDEX_SAMPLE_SIZE 254
 810#endif
 811
 812/* png_info is a structure that holds the information in a PNG file so
 813 * that the application can find out the characteristics of the image.
 814 * If you are reading the file, this structure will tell you what is
 815 * in the PNG file.  If you are writing the file, fill in the information
 816 * you want to put into the PNG file, then call png_write_info().
 817 * The names chosen should be very close to the PNG specification, so
 818 * consult that document for information about the meaning of each field.
 819 *
 820 * With libpng < 0.95, it was only possible to directly set and read the
 821 * the values in the png_info_struct, which meant that the contents and
 822 * order of the values had to remain fixed.  With libpng 0.95 and later,
 823 * however, there are now functions that abstract the contents of
 824 * png_info_struct from the application, so this makes it easier to use
 825 * libpng with dynamic libraries, and even makes it possible to use
 826 * libraries that don't have all of the libpng ancillary chunk-handing
 827 * functionality.
 828 *
 829 * In any case, the order of the parameters in png_info_struct should NOT
 830 * be changed for as long as possible to keep compatibility with applications
 831 * that use the old direct-access method with png_info_struct.
 832 *
 833 * The following members may have allocated storage attached that should be
 834 * cleaned up before the structure is discarded: palette, trans, text,
 835 * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
 836 * splt_palettes, scal_unit, row_pointers, and unknowns.   By default, these
 837 * are automatically freed when the info structure is deallocated, if they were
 838 * allocated internally by libpng.  This behavior can be changed by means
 839 * of the png_data_freer() function.
 840 *
 841 * More allocation details: all the chunk-reading functions that
 842 * change these members go through the corresponding png_set_*
 843 * functions.  A function to clear these members is available: see
 844 * png_free_data().  The png_set_* functions do not depend on being
 845 * able to point info structure members to any of the storage they are
 846 * passed (they make their own copies), EXCEPT that the png_set_text
 847 * functions use the same storage passed to them in the text_ptr or
 848 * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
 849 * functions do not make their own copies.
 850 */
 851typedef struct png_info_struct
 852{
 853   /* The following are necessary for every PNG file */
 854   png_uint_32 width PNG_DEPSTRUCT;       /* width of image in pixels (from IHDR) */
 855   png_uint_32 height PNG_DEPSTRUCT;      /* height of image in pixels (from IHDR) */
 856   png_uint_32 valid PNG_DEPSTRUCT;       /* valid chunk data (see PNG_INFO_ below) */
 857   png_uint_32 rowbytes PNG_DEPSTRUCT;    /* bytes needed to hold an untransformed row */
 858   png_colorp palette PNG_DEPSTRUCT;      /* array of color values (valid & PNG_INFO_PLTE) */
 859   png_uint_16 num_palette PNG_DEPSTRUCT; /* number of color entries in "palette" (PLTE) */
 860   png_uint_16 num_trans PNG_DEPSTRUCT;   /* number of transparent palette color (tRNS) */
 861   png_byte bit_depth PNG_DEPSTRUCT;      /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */
 862   png_byte color_type PNG_DEPSTRUCT;     /* see PNG_COLOR_TYPE_ below (from IHDR) */
 863   /* The following three should have been named *_method not *_type */
 864   png_byte compression_type PNG_DEPSTRUCT; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
 865   png_byte filter_type PNG_DEPSTRUCT;    /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
 866   png_byte interlace_type PNG_DEPSTRUCT; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 867
 868   /* The following is informational only on read, and not used on writes. */
 869   png_byte channels PNG_DEPSTRUCT;       /* number of data channels per pixel (1, 2, 3, 4) */
 870   png_byte pixel_depth PNG_DEPSTRUCT;    /* number of bits per pixel */
 871   png_byte spare_byte PNG_DEPSTRUCT;     /* to align the data, and for future use */
 872   png_byte signature[8] PNG_DEPSTRUCT;   /* magic bytes read by libpng from start of file */
 873
 874   /* The rest of the data is optional.  If you are reading, check the
 875    * valid field to see if the information in these are valid.  If you
 876    * are writing, set the valid field to those chunks you want written,
 877    * and initialize the appropriate fields below.
 878    */
 879
 880#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
 881   /* The gAMA chunk describes the gamma characteristics of the system
 882    * on which the image was created, normally in the range [1.0, 2.5].
 883    * Data is valid if (valid & PNG_INFO_gAMA) is non-zero.
 884    */
 885   float gamma PNG_DEPSTRUCT; /* gamma value of image, if (valid & PNG_INFO_gAMA) */
 886#endif
 887
 888#ifdef PNG_sRGB_SUPPORTED
 889    /* GR-P, 0.96a */
 890    /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */
 891   png_byte srgb_intent PNG_DEPSTRUCT; /* sRGB rendering intent [0, 1, 2, or 3] */
 892#endif
 893
 894#ifdef PNG_TEXT_SUPPORTED
 895   /* The tEXt, and zTXt chunks contain human-readable textual data in
 896    * uncompressed, compressed, and optionally compressed forms, respectively.
 897    * The data in "text" is an array of pointers to uncompressed,
 898    * null-terminated C strings. Each chunk has a keyword that describes the
 899    * textual data contained in that chunk.  Keywords are not required to be
 900    * unique, and the text string may be empty.  Any number of text chunks may
 901    * be in an image.
 902    */
 903   int num_text PNG_DEPSTRUCT; /* number of comments read/to write */
 904   int max_text PNG_DEPSTRUCT; /* current size of text array */
 905   png_textp text PNG_DEPSTRUCT; /* array of comments read/to write */
 906#endif /* PNG_TEXT_SUPPORTED */
 907
 908#ifdef PNG_tIME_SUPPORTED
 909   /* The tIME chunk holds the last time the displayed image data was
 910    * modified.  See the png_time struct for the contents of this struct.
 911    */
 912   png_time mod_time PNG_DEPSTRUCT;
 913#endif
 914
 915#ifdef PNG_sBIT_SUPPORTED
 916   /* The sBIT chunk specifies the number of significant high-order bits
 917    * in the pixel data.  Values are in the range [1, bit_depth], and are
 918    * only specified for the channels in the pixel data.  The contents of
 919    * the low-order bits is not specified.  Data is valid if
 920    * (valid & PNG_INFO_sBIT) is non-zero.
 921    */
 922   png_color_8 sig_bit PNG_DEPSTRUCT; /* significant bits in color channels */
 923#endif
 924
 925#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \
 926defined(PNG_READ_BACKGROUND_SUPPORTED)
 927   /* The tRNS chunk supplies transparency data for paletted images and
 928    * other image types that don't need a full alpha channel.  There are
 929    * "num_trans" transparency values for a paletted image, stored in the
 930    * same order as the palette colors, starting from index 0.  Values
 931    * for the data are in the range [0, 255], ranging from fully transparent
 932    * to fully opaque, respectively.  For non-paletted images, there is a
 933    * single color specified that should be treated as fully transparent.
 934    * Data is valid if (valid & PNG_INFO_tRNS) is non-zero.
 935    */
 936   png_bytep trans PNG_DEPSTRUCT; /* transparent values for paletted image */
 937   png_color_16 trans_values PNG_DEPSTRUCT; /* transparent color for non-palette image */
 938#endif
 939
 940#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 941   /* The bKGD chunk gives the suggested image background color if the
 942    * display program does not have its own background color and the image
 943    * is needs to composited onto a background before display.  The colors
 944    * in "background" are normally in the same color space/depth as the
 945    * pixel data.  Data is valid if (valid & PNG_INFO_bKGD) is non-zero.
 946    */
 947   png_color_16 background PNG_DEPSTRUCT;
 948#endif
 949
 950#ifdef PNG_oFFs_SUPPORTED
 951   /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards
 952    * and downwards from the top-left corner of the display, page, or other
 953    * application-specific co-ordinate space.  See the PNG_OFFSET_ defines
 954    * below for the unit types.  Valid if (valid & PNG_INFO_oFFs) non-zero.
 955    */
 956   png_int_32 x_offset PNG_DEPSTRUCT; /* x offset on page */
 957   png_int_32 y_offset PNG_DEPSTRUCT; /* y offset on page */
 958   png_byte offset_unit_type PNG_DEPSTRUCT; /* offset units type */
 959#endif
 960
 961#ifdef PNG_pHYs_SUPPORTED
 962   /* The pHYs chunk gives the physical pixel density of the image for
 963    * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_
 964    * defines below).  Data is valid if (valid & PNG_INFO_pHYs) is non-zero.
 965    */
 966   png_uint_32 x_pixels_per_unit PNG_DEPSTRUCT; /* horizontal pixel density */
 967   png_uint_32 y_pixels_per_unit PNG_DEPSTRUCT; /* vertical pixel density */
 968   png_byte phys_unit_type PNG_DEPSTRUCT; /* resolution type (see PNG_RESOLUTION_ below) */
 969#endif
 970
 971#ifdef PNG_hIST_SUPPORTED
 972   /* The hIST chunk contains the relative frequency or importance of the
 973    * various palette entries, so that a viewer can intelligently select a
 974    * reduced-color palette, if required.  Data is an array of "num_palette"
 975    * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST)
 976    * is non-zero.
 977    */
 978   png_uint_16p hist PNG_DEPSTRUCT;
 979#endif
 980
 981#ifdef PNG_cHRM_SUPPORTED
 982   /* The cHRM chunk describes the CIE color characteristics of the monitor
 983    * on which the PNG was created.  This data allows the viewer to do gamut
 984    * mapping of the input image to ensure that the viewer sees the same
 985    * colors in the image as the creator.  Values are in the range
 986    * [0.0, 0.8].  Data valid if (valid & PNG_INFO_cHRM) non-zero.
 987    */
 988#ifdef PNG_FLOATING_POINT_SUPPORTED
 989   float x_white PNG_DEPSTRUCT;
 990   float y_white PNG_DEPSTRUCT;
 991   float x_red PNG_DEPSTRUCT;
 992   float y_red PNG_DEPSTRUCT;
 993   float x_green PNG_DEPSTRUCT;
 994   float y_green PNG_DEPSTRUCT;
 995   float x_blue PNG_DEPSTRUCT;
 996   float y_blue PNG_DEPSTRUCT;
 997#endif
 998#endif
 999
1000#ifdef PNG_pCAL_SUPPORTED
1001   /* The pCAL chunk describes a transformation between the stored pixel
1002    * values and original physical data values used to create the image.
1003    * The integer range [0, 2^bit_depth - 1] maps to the floating-point
1004    * range given by [pcal_X0, pcal_X1], and are further transformed by a
1005    * (possibly non-linear) transformation function given by "pcal_type"
1006    * and "pcal_params" into "pcal_units".  Please see the PNG_EQUATION_
1007    * defines below, and the PNG-Group's PNG extensions document for a
1008    * complete description of the transformations and how they should be
1009    * implemented, and for a description of the ASCII parameter strings.
1010    * Data values are valid if (valid & PNG_INFO_pCAL) non-zero.
1011    */
1012   png_charp pcal_purpose PNG_DEPSTRUCT;  /* pCAL chunk description string */
1013   png_int_32 pcal_X0 PNG_DEPSTRUCT;      /* minimum value */
1014   png_int_32 pcal_X1 PNG_DEPSTRUCT;      /* maximum value */
1015   png_charp pcal_units PNG_DEPSTRUCT;    /* Latin-1 string giving physical units */
1016   png_charpp pcal_params PNG_DEPSTRUCT;  /* ASCII strings containing parameter values */
1017   png_byte pcal_type PNG_DEPSTRUCT;      /* equation type (see PNG_EQUATION_ below) */
1018   png_byte pcal_nparams PNG_DEPSTRUCT;   /* number of parameters given in pcal_params */
1019#endif
1020
1021/* New members added in libpng-1.0.6 */
1022#ifdef PNG_FREE_ME_SUPPORTED
1023   png_uint_32 free_me PNG_DEPSTRUCT;     /* flags items libpng is responsible for freeing */
1024#endif
1025
1026#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
1027 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
1028   /* Storage for unknown chunks that the library doesn't recognize. */
1029   png_unknown_chunkp unknown_chunks PNG_DEPSTRUCT;
1030   png_size_t unknown_chunks_num PNG_DEPSTRUCT;
1031#endif
1032
1033#ifdef PNG_iCCP_SUPPORTED
1034   /* iCCP chunk data. */
1035   png_charp iccp_name PNG_DEPSTRUCT;     /* profile name */
1036   png_charp iccp_profile PNG_DEPSTRUCT;  /* International Color Consortium profile data */
1037                            /* Note to maintainer: should be png_bytep */
1038   png_uint_32 iccp_proflen PNG_DEPSTRUCT;  /* ICC profile data length */
1039   png_byte iccp_compression PNG_DEPSTRUCT; /* Always zero */
1040#endif
1041
1042#ifdef PNG_sPLT_SUPPORTED
1043   /* Data on sPLT chunks (there may be more than one). */
1044   png_sPLT_tp splt_palettes PNG_DEPSTRUCT;
1045   png_uint_32 splt_palettes_num PNG_DEPSTRUCT;
1046#endif
1047
1048#ifdef PNG_sCAL_SUPPORTED
1049   /* The sCAL chunk describes the actual physical dimensions of the
1050    * subject matter of the graphic.  The chunk contains a unit specification
1051    * a byte value, and two ASCII strings representing floating-point
1052    * values.  The values are width and height corresponsing to one pixel
1053    * in the image.  This external representation is converted to double
1054    * here.  Data values are valid if (valid & PNG_INFO_sCAL) is non-zero.
1055    */
1056   png_byte scal_unit PNG_DEPSTRUCT;         /* unit of physical scale */
1057#ifdef PNG_FLOATING_POINT_SUPPORTED
1058   double scal_pixel_width PNG_DEPSTRUCT;    /* width of one pixel */
1059   double scal_pixel_height PNG_DEPSTRUCT;   /* height of one pixel */
1060#endif
1061#ifdef PNG_FIXED_POINT_SUPPORTED
1062   png_charp scal_s_width PNG_DEPSTRUCT;     /* string containing height */
1063   png_charp scal_s_height PNG_DEPSTRUCT;    /* string containing width */
1064#endif
1065#endif
1066
1067#ifdef PNG_INFO_IMAGE_SUPPORTED
1068   /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */
1069   /* Data valid if (valid & PNG_INFO_IDAT) non-zero */
1070   png_bytepp row_pointers PNG_DEPSTRUCT;        /* the image bits */
1071#endif
1072
1073#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED)
1074   png_fixed_point int_gamma PNG_DEPSTRUCT; /* gamma of image, if (valid & PNG_INFO_gAMA) */
1075#endif
1076
1077#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED)
1078   png_fixed_point int_x_white PNG_DEPSTRUCT;
1079   png_fixed_point int_y_white PNG_DEPSTRUCT;
1080   png_fixed_point int_x_red PNG_DEPSTRUCT;
1081   png_fixed_point int_y_red PNG_DEPSTRUCT;
1082   png_fixed_point int_x_green PNG_DEPSTRUCT;
1083   png_fixed_point int_y_green PNG_DEPSTRUCT;
1084   png_fixed_point int_x_blue PNG_DEPSTRUCT;
1085   png_fixed_point int_y_blue PNG_DEPSTRUCT;
1086#endif
1087
1088} png_info;
1089
1090typedef png_info FAR * png_infop;
1091typedef png_info FAR * FAR * png_infopp;
1092
1093/* Maxim…

Large files files are truncated, but you can click here to view the full file