cairo 1.12.8-x86-mingw32 → 1.12.9-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cairo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/NEWS +23 -0
- data/Rakefile +20 -11
- data/ext/cairo/rb_cairo.c +1 -0
- data/ext/cairo/rb_cairo.h +1 -1
- data/ext/cairo/rb_cairo_context.c +6 -38
- data/ext/cairo/rb_cairo_private.h +1 -0
- data/ext/cairo/rb_cairo_rectangle.c +83 -0
- data/ext/cairo/rb_cairo_surface.c +52 -20
- data/lib/2.0/cairo.so +0 -0
- data/lib/2.1/cairo.so +0 -0
- data/vendor/local/bin/fc-cache.exe +0 -0
- data/vendor/local/bin/fc-cat.exe +0 -0
- data/vendor/local/bin/fc-list.exe +0 -0
- data/vendor/local/bin/fc-match.exe +0 -0
- data/vendor/local/bin/fc-pattern.exe +0 -0
- data/vendor/local/bin/fc-query.exe +0 -0
- data/vendor/local/bin/fc-scan.exe +0 -0
- data/vendor/local/bin/fc-validate.exe +0 -0
- data/vendor/local/bin/freetype-config +12 -3
- data/vendor/local/bin/libcairo-2.dll +0 -0
- data/vendor/local/bin/libcairo-gobject-2.dll +0 -0
- data/vendor/local/bin/libcairo-script-interpreter-2.dll +0 -0
- data/vendor/local/bin/libfontconfig-1.dll +0 -0
- data/vendor/local/bin/libfreetype-6.dll +0 -0
- data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
- data/vendor/local/bin/libpixman-1-0.dll +0 -0
- data/vendor/local/bin/libpng-config +1 -1
- data/vendor/local/bin/libpng16-16.dll +0 -0
- data/vendor/local/bin/libpng16-config +1 -1
- data/vendor/local/bin/libwinpthread-1.dll +0 -0
- data/vendor/local/bin/libxml2-2.dll +0 -0
- data/vendor/local/bin/png-fix-itxt.exe +0 -0
- data/vendor/local/bin/pngfix.exe +0 -0
- data/vendor/local/bin/xmlcatalog.exe +0 -0
- data/vendor/local/bin/xmllint.exe +0 -0
- data/vendor/local/bin/zlib1.dll +0 -0
- data/vendor/local/etc/fonts/conf.d/30-metric-aliases.conf +51 -2
- data/vendor/local/etc/fonts/fonts.conf +1 -1
- data/vendor/local/include/fontconfig/fontconfig.h +4 -1
- data/vendor/local/include/freetype2/config/ftconfig.h +2 -2
- data/vendor/local/include/freetype2/config/ftoption.h +13 -0
- data/vendor/local/include/freetype2/freetype.h +42 -2
- data/vendor/local/include/freetype2/ftautoh.h +46 -1
- data/vendor/local/include/freetype2/ftbdf.h +3 -2
- data/vendor/local/include/freetype2/ftchapters.h +1 -0
- data/vendor/local/include/freetype2/ftoutln.h +4 -1
- data/vendor/local/include/libpng16/png.h +41 -101
- data/vendor/local/include/libpng16/pngconf.h +33 -6
- data/vendor/local/include/libpng16/pnglibconf.h +1 -1
- data/vendor/local/include/png.h +41 -101
- data/vendor/local/include/pngconf.h +33 -6
- data/vendor/local/include/pnglibconf.h +1 -1
- data/vendor/local/lib/fontconfig.def +1 -0
- data/vendor/local/lib/libcairo-gobject.a +0 -0
- data/vendor/local/lib/libcairo-gobject.dll.a +0 -0
- data/vendor/local/lib/libcairo-script-interpreter.a +0 -0
- data/vendor/local/lib/libcairo-script-interpreter.dll.a +0 -0
- data/vendor/local/lib/libcairo.a +0 -0
- data/vendor/local/lib/libcairo.dll.a +0 -0
- data/vendor/local/lib/libfontconfig.dll.a +0 -0
- data/vendor/local/lib/libfontconfig.la +1 -1
- data/vendor/local/lib/libfreetype.a +0 -0
- data/vendor/local/lib/libfreetype.dll.a +0 -0
- data/vendor/local/lib/libfreetype.la +3 -3
- data/vendor/local/lib/libpixman-1.a +0 -0
- data/vendor/local/lib/libpixman-1.dll.a +0 -0
- data/vendor/local/lib/libpng.a +0 -0
- data/vendor/local/lib/libpng.dll.a +0 -0
- data/vendor/local/lib/libpng.la +2 -2
- data/vendor/local/lib/libpng16.a +0 -0
- data/vendor/local/lib/libpng16.dll.a +0 -0
- data/vendor/local/lib/libpng16.la +2 -2
- data/vendor/local/lib/libxml2.a +0 -0
- data/vendor/local/lib/libxml2.dll.a +0 -0
- data/vendor/local/lib/libz.a +0 -0
- data/vendor/local/lib/libz.dll.a +0 -0
- data/vendor/local/lib/pkgconfig/fontconfig.pc +4 -4
- data/vendor/local/lib/pkgconfig/freetype2.pc +4 -2
- data/vendor/local/lib/pkgconfig/libpng.pc +1 -1
- data/vendor/local/lib/pkgconfig/libpng16.pc +1 -1
- data/vendor/local/share/fontconfig/conf.avail/10-no-sub-pixel.conf +1 -1
- data/vendor/local/share/fontconfig/conf.avail/30-metric-aliases.conf +51 -2
- data/vendor/local/share/license/fontconfig/README +55 -2
- data/vendor/local/share/license/freetype/README +6 -6
- data/vendor/local/share/license/libpng/README +2 -2
- data/vendor/local/share/man/man1/freetype-config.1 +108 -0
- data/vendor/local/share/man/man3/libpng.3 +244 -55
- data/vendor/local/share/man/man3/libpngpf.3 +2 -2
- data/vendor/local/share/man/man5/png.5 +1 -1
- data/vendor/local/share/xml/fontconfig/fonts.dtd +1 -1
- metadata +75 -75
- data/lib/1.9/cairo.so +0 -0
- data/vendor/local/lib/libfontconfig.a +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
README for libpng version 1.6.
|
1
|
+
README for libpng version 1.6.10 - March 6, 2014 (shared library 16.0)
|
2
2
|
See the note about version numbers near the top of png.h
|
3
3
|
|
4
4
|
See INSTALL for instructions on how to install libpng.
|
@@ -121,7 +121,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
|
|
121
121
|
to others, if necessary.
|
122
122
|
|
123
123
|
Please do not send suggestions on how to change PNG. We have
|
124
|
-
been discussing PNG for
|
124
|
+
been discussing PNG for nineteen years now, and it is official and
|
125
125
|
finished. If you have suggestions for libpng, however, I'll
|
126
126
|
gladly listen. Even if your suggestion is not used immediately,
|
127
127
|
it may be used later.
|
@@ -0,0 +1,108 @@
|
|
1
|
+
.TH FREETYPE-CONFIG 1 "March 2014" "FreeType 2.5.3"
|
2
|
+
.
|
3
|
+
.
|
4
|
+
.SH NAME
|
5
|
+
.
|
6
|
+
freetype-config \- Get information about a libfreetype installation
|
7
|
+
.
|
8
|
+
.
|
9
|
+
.SH SYNOPSIS
|
10
|
+
.
|
11
|
+
.B freetype-config
|
12
|
+
.RI [ options ]
|
13
|
+
.
|
14
|
+
.
|
15
|
+
.SH DESCRIPTION
|
16
|
+
.
|
17
|
+
.B freetype-config
|
18
|
+
returns information needed for compiling and linking programs with the
|
19
|
+
FreeType library, such as linker flags and compilation parameters.
|
20
|
+
.
|
21
|
+
Alternatively, it can be used to query information about the
|
22
|
+
FreeType library version installed on the system, such as the
|
23
|
+
installation (directory path) prefix or the FreeType version number.
|
24
|
+
.
|
25
|
+
.PP
|
26
|
+
This program is part of the FreeType package.
|
27
|
+
.
|
28
|
+
.
|
29
|
+
.SH OPTIONS
|
30
|
+
.
|
31
|
+
There are two types of options: output/display selection options, and
|
32
|
+
path override options.
|
33
|
+
.
|
34
|
+
.
|
35
|
+
.SS Output selection options
|
36
|
+
.
|
37
|
+
Only one of the output selection options should be given at each program
|
38
|
+
invocation.
|
39
|
+
.
|
40
|
+
.TP
|
41
|
+
.B \-\-prefix
|
42
|
+
Return the prefix value of the installed FreeType library (the default
|
43
|
+
prefix will be `/usr' in most cases for distribution-installed
|
44
|
+
packages).
|
45
|
+
.
|
46
|
+
.TP
|
47
|
+
.B \-\-exec-prefix
|
48
|
+
Return the executable prefix value of the installed FreeType library
|
49
|
+
(will often be the same as the prefix value).
|
50
|
+
.
|
51
|
+
.TP
|
52
|
+
.B \-\-ftversion
|
53
|
+
Return the FreeType version number.
|
54
|
+
.
|
55
|
+
.TP
|
56
|
+
.B \-\-version
|
57
|
+
Return the `libtool version' of the FreeType library.
|
58
|
+
.
|
59
|
+
.TP
|
60
|
+
.B \-\-libtool
|
61
|
+
Return the library name for linking with libtool.
|
62
|
+
.
|
63
|
+
.TP
|
64
|
+
.B \-\-libs
|
65
|
+
Return compiler flags for linking with the installed FreeType library.
|
66
|
+
.
|
67
|
+
.TP
|
68
|
+
.B \-\-cflags
|
69
|
+
Return compiler flags for compiling against the installed FreeType library.
|
70
|
+
.
|
71
|
+
.TP
|
72
|
+
.B \-\-static
|
73
|
+
Make command line options display flags for static linking.
|
74
|
+
.
|
75
|
+
.
|
76
|
+
.SS Path override options
|
77
|
+
.
|
78
|
+
These affect any selected output option, except the libtool version
|
79
|
+
returned by `--version'.
|
80
|
+
.
|
81
|
+
.TP
|
82
|
+
.BI \-\-prefix= PREFIX
|
83
|
+
Override `--prefix' value with
|
84
|
+
.IR PREFIX .
|
85
|
+
.
|
86
|
+
.TP
|
87
|
+
.BI \-\-exec-prefix= EPREFIX
|
88
|
+
Override `--exec-prefix' value with
|
89
|
+
.IR EPREFIX .
|
90
|
+
.
|
91
|
+
.
|
92
|
+
.SH BUGS
|
93
|
+
In case the libraries FreeType links to are located in non-standard
|
94
|
+
directories, the output from option
|
95
|
+
.B \-\-libs
|
96
|
+
might be incomplete.
|
97
|
+
It is thus recommended to use the
|
98
|
+
.BR pkg-config (1)
|
99
|
+
interface instead, which is able to correctly resolve all dependencies.
|
100
|
+
.
|
101
|
+
.
|
102
|
+
.SH AUTHOR
|
103
|
+
.
|
104
|
+
This manual page was contributed by Nis Martensen <nis.martensen@web.de>,
|
105
|
+
with further refinements from the FreeType team.
|
106
|
+
.
|
107
|
+
.
|
108
|
+
.\" eof
|
@@ -1,6 +1,6 @@
|
|
1
|
-
.TH LIBPNG 3 "
|
1
|
+
.TH LIBPNG 3 "March 6, 2014"
|
2
2
|
.SH NAME
|
3
|
-
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.
|
3
|
+
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.10
|
4
4
|
.SH SYNOPSIS
|
5
5
|
\fB
|
6
6
|
#include <png.h>\fP
|
@@ -504,10 +504,10 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
|
|
504
504
|
.SH LIBPNG.TXT
|
505
505
|
libpng-manual.txt - A description on how to use and modify libpng
|
506
506
|
|
507
|
-
libpng version 1.6.
|
507
|
+
libpng version 1.6.10 - March 6, 2014
|
508
508
|
Updated and distributed by Glenn Randers-Pehrson
|
509
509
|
<glennrp at users.sourceforge.net>
|
510
|
-
Copyright (c) 1998-
|
510
|
+
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
511
511
|
|
512
512
|
This document is released under the libpng license.
|
513
513
|
For conditions of distribution and use, see the disclaimer
|
@@ -515,9 +515,9 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|
515
515
|
|
516
516
|
Based on:
|
517
517
|
|
518
|
-
libpng versions 0.97, January 1998, through 1.6.
|
518
|
+
libpng versions 0.97, January 1998, through 1.6.10 - March 6, 2014
|
519
519
|
Updated and distributed by Glenn Randers-Pehrson
|
520
|
-
Copyright (c) 1998-
|
520
|
+
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
521
521
|
|
522
522
|
libpng 1.0 beta 6 version 0.96 May 28, 1997
|
523
523
|
Updated and distributed by Andreas Dilger
|
@@ -778,10 +778,10 @@ This method of building a customized pnglibconf.h is illustrated in
|
|
778
778
|
contrib/pngminim/*. See the "$(PNGCONF):" target in the makefile and
|
779
779
|
pngusr.dfa in these directories.
|
780
780
|
|
781
|
-
C. Configuration using
|
781
|
+
C. Configuration using PNG_USER_CONFIG
|
782
782
|
|
783
|
-
If \-
|
784
|
-
pngusr.h will automatically be included before the options in
|
783
|
+
If \-DPNG_USER_CONFIG is added to the CPPFLAGS when pnglibconf.h is built,
|
784
|
+
the file pngusr.h will automatically be included before the options in
|
785
785
|
scripts/pnglibconf.dfa are processed. Your pngusr.h file should contain only
|
786
786
|
macro definitions turning features on or off or setting settings.
|
787
787
|
|
@@ -1216,12 +1216,12 @@ value. You can also specify a default encoding for the PNG file in
|
|
1216
1216
|
case the required information is missing from the file. By default libpng
|
1217
1217
|
assumes that the PNG data matches your system, to keep this default call:
|
1218
1218
|
|
1219
|
-
png_set_gamma(png_ptr, screen_gamma,
|
1219
|
+
png_set_gamma(png_ptr, screen_gamma, output_gamma);
|
1220
1220
|
|
1221
1221
|
or you can use the fixed point equivalent:
|
1222
1222
|
|
1223
1223
|
png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma,
|
1224
|
-
PNG_FP_1
|
1224
|
+
PNG_FP_1*output_gamma);
|
1225
1225
|
|
1226
1226
|
If you don't know the gamma for your system it is probably 2.2 - a good
|
1227
1227
|
approximation to the IEC standard for display systems (sRGB). If images are
|
@@ -1249,6 +1249,70 @@ component value whenever arithmetic is performed. A lot of graphics software
|
|
1249
1249
|
uses linear values for this reason, often with higher precision component values
|
1250
1250
|
to preserve overall accuracy.
|
1251
1251
|
|
1252
|
+
|
1253
|
+
The output_gamma value expresses how to decode the output values, not how
|
1254
|
+
they are encoded. The values used correspond to the normal numbers used to
|
1255
|
+
describe the overall gamma of a computer display system; for example 2.2 for
|
1256
|
+
an sRGB conformant system. The values are scaled by 100000 in the _fixed
|
1257
|
+
version of the API (so 220000 for sRGB.)
|
1258
|
+
|
1259
|
+
The inverse of the value is always used to provide a default for the PNG file
|
1260
|
+
encoding if it has no gAMA chunk and if png_set_gamma() has not been called
|
1261
|
+
to override the PNG gamma information.
|
1262
|
+
|
1263
|
+
When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode
|
1264
|
+
opaque pixels however pixels with lower alpha values are not encoded,
|
1265
|
+
regardless of the output gamma setting.
|
1266
|
+
|
1267
|
+
When the standard Porter Duff handling is requested with mode 1 the output
|
1268
|
+
encoding is set to be linear and the output_gamma value is only relevant
|
1269
|
+
as a default for input data that has no gamma information. The linear output
|
1270
|
+
encoding will be overridden if png_set_gamma() is called - the results may be
|
1271
|
+
highly unexpected!
|
1272
|
+
|
1273
|
+
The following numbers are derived from the sRGB standard and the research
|
1274
|
+
behind it. sRGB is defined to be approximated by a PNG gAMA chunk value of
|
1275
|
+
0.45455 (1/2.2) for PNG. The value implicitly includes any viewing
|
1276
|
+
correction required to take account of any differences in the color
|
1277
|
+
environment of the original scene and the intended display environment; the
|
1278
|
+
value expresses how to *decode* the image for display, not how the original
|
1279
|
+
data was *encoded*.
|
1280
|
+
|
1281
|
+
sRGB provides a peg for the PNG standard by defining a viewing environment.
|
1282
|
+
sRGB itself, and earlier TV standards, actually use a more complex transform
|
1283
|
+
(a linear portion then a gamma 2.4 power law) than PNG can express. (PNG is
|
1284
|
+
limited to simple power laws.) By saying that an image for direct display on
|
1285
|
+
an sRGB conformant system should be stored with a gAMA chunk value of 45455
|
1286
|
+
(11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification
|
1287
|
+
makes it possible to derive values for other display systems and
|
1288
|
+
environments.
|
1289
|
+
|
1290
|
+
The Mac value is deduced from the sRGB based on an assumption that the actual
|
1291
|
+
extra viewing correction used in early Mac display systems was implemented as
|
1292
|
+
a power 1.45 lookup table.
|
1293
|
+
|
1294
|
+
Any system where a programmable lookup table is used or where the behavior of
|
1295
|
+
the final display device characteristics can be changed requires system
|
1296
|
+
specific code to obtain the current characteristic. However this can be
|
1297
|
+
difficult and most PNG gamma correction only requires an approximate value.
|
1298
|
+
|
1299
|
+
By default, if png_set_alpha_mode() is not called, libpng assumes that all
|
1300
|
+
values are unencoded, linear, values and that the output device also has a
|
1301
|
+
linear characteristic. This is only very rarely correct - it is invariably
|
1302
|
+
better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the
|
1303
|
+
default if you don't know what the right answer is!
|
1304
|
+
|
1305
|
+
The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS
|
1306
|
+
10.6) which used a correction table to implement a somewhat lower gamma on an
|
1307
|
+
otherwise sRGB system.
|
1308
|
+
|
1309
|
+
Both these values are reserved (not simple gamma values) in order to allow
|
1310
|
+
more precise correction internally in the future.
|
1311
|
+
|
1312
|
+
NOTE: the values can be passed to either the fixed or floating
|
1313
|
+
point APIs, but the floating point API will also accept floating point
|
1314
|
+
values.
|
1315
|
+
|
1252
1316
|
The second thing you may need to tell libpng about is how your system handles
|
1253
1317
|
alpha channel information. Some, but not all, PNG files contain an alpha
|
1254
1318
|
channel. To display these files correctly you need to compose the data onto a
|
@@ -1273,11 +1337,11 @@ by png_set_alpha_mode().
|
|
1273
1337
|
|
1274
1338
|
The mode is as follows:
|
1275
1339
|
|
1276
|
-
PNG_ALPHA_PNG: The data is encoded according to the PNG
|
1277
|
-
green and blue, or gray, components are
|
1278
|
-
values and are not premultiplied by the
|
1279
|
-
alpha value is a linear measure of the
|
1280
|
-
pixel to the corresponding final output pixel.
|
1340
|
+
PNG_ALPHA_PNG: The data is encoded according to the PNG
|
1341
|
+
specification. Red, green and blue, or gray, components are
|
1342
|
+
gamma encoded color values and are not premultiplied by the
|
1343
|
+
alpha value. The alpha value is a linear measure of the
|
1344
|
+
contribution of the pixel to the corresponding final output pixel.
|
1281
1345
|
|
1282
1346
|
You should normally use this format if you intend to perform
|
1283
1347
|
color correction on the color values; most, maybe all, color
|
@@ -1294,11 +1358,35 @@ be used!
|
|
1294
1358
|
|
1295
1359
|
The remaining modes assume you don't need to do any further color correction or
|
1296
1360
|
that if you do, your color correction software knows all about alpha (it
|
1297
|
-
probably doesn't!)
|
1298
|
-
|
1299
|
-
|
1300
|
-
is
|
1301
|
-
|
1361
|
+
probably doesn't!). They 'associate' the alpha with the color information by
|
1362
|
+
storing color channel values that have been scaled by the alpha. The
|
1363
|
+
advantage is that the color channels can be resampled (the image can be
|
1364
|
+
scaled) in this form. The disadvantage is that normal practice is to store
|
1365
|
+
linear, not (gamma) encoded, values and this requires 16-bit channels for
|
1366
|
+
still images rather than the 8-bit channels that are just about sufficient if
|
1367
|
+
gamma encoding is used. In addition all non-transparent pixel values,
|
1368
|
+
including completely opaque ones, must be gamma encoded to produce the final
|
1369
|
+
image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes
|
1370
|
+
described below (the latter being the two common names for associated alpha
|
1371
|
+
color channels). Note that PNG files always contain non-associated color
|
1372
|
+
channels; png_set_alpha_mode() with one of the modes causes the decoder to
|
1373
|
+
convert the pixels to an associated form before returning them to your
|
1374
|
+
application.
|
1375
|
+
|
1376
|
+
Since it is not necessary to perform arithmetic on opaque color values so
|
1377
|
+
long as they are not to be resampled and are in the final color space it is
|
1378
|
+
possible to optimize the handling of alpha by storing the opaque pixels in
|
1379
|
+
the PNG format (adjusted for the output color space) while storing partially
|
1380
|
+
opaque pixels in the standard, linear, format. The accuracy required for
|
1381
|
+
standard alpha composition is relatively low, because the pixels are
|
1382
|
+
isolated, therefore typically the accuracy loss in storing 8-bit linear
|
1383
|
+
values is acceptable. (This is not true if the alpha channel is used to
|
1384
|
+
simulate transparency over large areas - use 16 bits or the PNG mode in
|
1385
|
+
this case!) This is the 'OPTIMIZED' mode. For this mode a pixel is
|
1386
|
+
treated as opaque only if the alpha value is equal to the maximum value.
|
1387
|
+
|
1388
|
+
PNG_ALPHA_STANDARD: The data libpng produces is encoded in the
|
1389
|
+
standard way assumed by most correctly written graphics software.
|
1302
1390
|
The gamma encoding will be removed by libpng and the
|
1303
1391
|
linear component values will be pre-multiplied by the
|
1304
1392
|
alpha channel.
|
@@ -1327,9 +1415,8 @@ dynamic range. To avoid problems, and if your software
|
|
1327
1415
|
supports it, use png_set_expand_16() to force all
|
1328
1416
|
components to 16 bits.
|
1329
1417
|
|
1330
|
-
PNG_ALPHA_OPTIMIZED: This mode is the same
|
1331
|
-
|
1332
|
-
completely opaque pixels are gamma encoded according to
|
1418
|
+
PNG_ALPHA_OPTIMIZED: This mode is the same as PNG_ALPHA_STANDARD
|
1419
|
+
except that completely opaque pixels are gamma encoded according to
|
1333
1420
|
the screen_gamma value. Pixels with alpha less than 1.0
|
1334
1421
|
will still have linear components.
|
1335
1422
|
|
@@ -1348,18 +1435,16 @@ representation of non-opaque pixels are irrelevant.
|
|
1348
1435
|
You can also try this format if your software is broken;
|
1349
1436
|
it might look better.
|
1350
1437
|
|
1351
|
-
PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD;
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
separate from the background, as though it had been cut out of paper and pasted
|
1362
|
-
on afterward.
|
1438
|
+
PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD; however, all component
|
1439
|
+
values, including the alpha channel are gamma encoded. This is
|
1440
|
+
broken because, in practice, no implementation that uses this choice
|
1441
|
+
correctly undoes the encoding before handling alpha composition. Use this
|
1442
|
+
choice only if other serious errors in the software or hardware you use
|
1443
|
+
mandate it. In most cases of broken software or hardware the bug in the
|
1444
|
+
final display manifests as a subtle halo around composited parts of the
|
1445
|
+
image. You may not even perceive this as a halo; the composited part of
|
1446
|
+
the image may simply appear separate from the background, as though it had
|
1447
|
+
been cut out of paper and pasted on afterward.
|
1363
1448
|
|
1364
1449
|
If you don't have to deal with bugs in software or hardware, or if you can fix
|
1365
1450
|
them, there are three recommended ways of using png_set_alpha_mode():
|
@@ -1390,6 +1475,89 @@ All you can do is compose the result onto a matching output. Since this
|
|
1390
1475
|
mode is libpng-specific you also need to write your own composition
|
1391
1476
|
software.
|
1392
1477
|
|
1478
|
+
The following are examples of calls to png_set_alpha_mode to achieve the
|
1479
|
+
required overall gamma correction and, where necessary, alpha
|
1480
|
+
premultiplication.
|
1481
|
+
|
1482
|
+
png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);
|
1483
|
+
|
1484
|
+
This is the default libpng handling of the alpha channel - it is not
|
1485
|
+
pre-multiplied into the color components. In addition the call states
|
1486
|
+
that the output is for a sRGB system and causes all PNG files without gAMA
|
1487
|
+
chunks to be assumed to be encoded using sRGB.
|
1488
|
+
|
1489
|
+
png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
|
1490
|
+
|
1491
|
+
In this case the output is assumed to be something like an sRGB conformant
|
1492
|
+
display preceeded by a power-law lookup table of power 1.45. This is how
|
1493
|
+
early Mac systems behaved.
|
1494
|
+
|
1495
|
+
png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);
|
1496
|
+
|
1497
|
+
This is the classic Jim Blinn approach and will work in academic
|
1498
|
+
environments where everything is done by the book. It has the shortcoming
|
1499
|
+
of assuming that input PNG data with no gamma information is linear - this
|
1500
|
+
is unlikely to be correct unless the PNG files where generated locally.
|
1501
|
+
Most of the time the output precision will be so low as to show
|
1502
|
+
significant banding in dark areas of the image.
|
1503
|
+
|
1504
|
+
png_set_expand_16(pp);
|
1505
|
+
png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);
|
1506
|
+
|
1507
|
+
This is a somewhat more realistic Jim Blinn inspired approach. PNG files
|
1508
|
+
are assumed to have the sRGB encoding if not marked with a gamma value and
|
1509
|
+
the output is always 16 bits per component. This permits accurate scaling
|
1510
|
+
and processing of the data. If you know that your input PNG files were
|
1511
|
+
generated locally you might need to replace PNG_DEFAULT_sRGB with the
|
1512
|
+
correct value for your system.
|
1513
|
+
|
1514
|
+
png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB);
|
1515
|
+
|
1516
|
+
If you just need to composite the PNG image onto an existing background
|
1517
|
+
and if you control the code that does this you can use the optimization
|
1518
|
+
setting. In this case you just copy completely opaque pixels to the
|
1519
|
+
output. For pixels that are not completely transparent (you just skip
|
1520
|
+
those) you do the composition math using png_composite or png_composite_16
|
1521
|
+
below then encode the resultant 8-bit or 16-bit values to match the output
|
1522
|
+
encoding.
|
1523
|
+
|
1524
|
+
Other cases
|
1525
|
+
|
1526
|
+
If neither the PNG nor the standard linear encoding work for you because
|
1527
|
+
of the software or hardware you use then you have a big problem. The PNG
|
1528
|
+
case will probably result in halos around the image. The linear encoding
|
1529
|
+
will probably result in a washed out, too bright, image (it's actually too
|
1530
|
+
contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably
|
1531
|
+
substantially reduce the halos. Alternatively try:
|
1532
|
+
|
1533
|
+
png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB);
|
1534
|
+
|
1535
|
+
This option will also reduce the halos, but there will be slight dark
|
1536
|
+
halos round the opaque parts of the image where the background is light.
|
1537
|
+
In the OPTIMIZED mode the halos will be light halos where the background
|
1538
|
+
is dark. Take your pick - the halos are unavoidable unless you can get
|
1539
|
+
your hardware/software fixed! (The OPTIMIZED approach is slightly
|
1540
|
+
faster.)
|
1541
|
+
|
1542
|
+
When the default gamma of PNG files doesn't match the output gamma.
|
1543
|
+
If you have PNG files with no gamma information png_set_alpha_mode allows
|
1544
|
+
you to provide a default gamma, but it also sets the ouput gamma to the
|
1545
|
+
matching value. If you know your PNG files have a gamma that doesn't
|
1546
|
+
match the output you can take advantage of the fact that
|
1547
|
+
png_set_alpha_mode always sets the output gamma but only sets the PNG
|
1548
|
+
default if it is not already set:
|
1549
|
+
|
1550
|
+
png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);
|
1551
|
+
png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
|
1552
|
+
|
1553
|
+
The first call sets both the default and the output gamma values, the
|
1554
|
+
second call overrides the output gamma without changing the default. This
|
1555
|
+
is easier than achieving the same effect with png_set_gamma. You must use
|
1556
|
+
PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will
|
1557
|
+
fire if more than one call to png_set_alpha_mode and png_set_background is
|
1558
|
+
made in the same read operation, however multiple calls with PNG_ALPHA_PNG
|
1559
|
+
are ignored.
|
1560
|
+
|
1393
1561
|
If you don't need, or can't handle, the alpha channel you can call
|
1394
1562
|
png_set_background() to remove it by compositing against a fixed color. Don't
|
1395
1563
|
call png_set_strip_alpha() to do this - it will leave spurious pixel values in
|
@@ -1720,7 +1888,7 @@ png_set_rgb_to_gray()).
|
|
1720
1888
|
|
1721
1889
|
png_get_sRGB(png_ptr, info_ptr, &srgb_intent);
|
1722
1890
|
|
1723
|
-
|
1891
|
+
srgb_intent - the rendering intent (PNG_INFO_sRGB)
|
1724
1892
|
The presence of the sRGB chunk
|
1725
1893
|
means that the pixel data is in the
|
1726
1894
|
sRGB color space. This chunk also
|
@@ -2670,10 +2838,15 @@ how pngvalid.c does it.
|
|
2670
2838
|
.SS Finishing a sequential read
|
2671
2839
|
|
2672
2840
|
After you are finished reading the image through the
|
2673
|
-
low-level interface, you can finish reading the file.
|
2674
|
-
|
2675
|
-
|
2676
|
-
|
2841
|
+
low-level interface, you can finish reading the file.
|
2842
|
+
|
2843
|
+
If you want to use a different crc action for handling CRC errors in
|
2844
|
+
chunks after the image data, you can call png_set_crc_action()
|
2845
|
+
again at this point.
|
2846
|
+
|
2847
|
+
If you are interested in comments or time, which may be stored either
|
2848
|
+
before or after the image data, you should pass the separate png_info
|
2849
|
+
struct if you want to keep the comments from before and after the image
|
2677
2850
|
separate.
|
2678
2851
|
|
2679
2852
|
png_infop end_info = png_create_info_struct(png_ptr);
|
@@ -2689,6 +2862,9 @@ separate.
|
|
2689
2862
|
|
2690
2863
|
If you are not interested, you should still call png_read_end()
|
2691
2864
|
but you can pass NULL, avoiding the need to create an end_info structure.
|
2865
|
+
If you do this, libpng will not process any chunks after IDAT other than
|
2866
|
+
skipping over them and perhaps (depending on whether you have called
|
2867
|
+
png_set_crc_action) checking their CRCs while looking for the IEND chunk.
|
2692
2868
|
|
2693
2869
|
png_read_end(png_ptr, (png_infop)NULL);
|
2694
2870
|
|
@@ -4898,6 +5074,9 @@ png_set_error_fn(), which is essentially the same function, but with a new
|
|
4898
5074
|
name to force compilation errors with applications that try to use the old
|
4899
5075
|
method.
|
4900
5076
|
|
5077
|
+
Support for the sCAL, iCCP, iTXt, and sPLT chunks was added at libpng-1.0.6;
|
5078
|
+
however, iTXt support was not enabled by default.
|
5079
|
+
|
4901
5080
|
Starting with version 1.0.7, you can find out which version of the library
|
4902
5081
|
you are using at run-time:
|
4903
5082
|
|
@@ -5126,6 +5305,7 @@ We removed the trailing '.' from the warning and error messages.
|
|
5126
5305
|
|
5127
5306
|
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
5128
5307
|
function) incorrectly returned a value of type png_uint_32.
|
5308
|
+
The incorrect macro was removed from libpng-1.4.5.
|
5129
5309
|
|
5130
5310
|
Checking for invalid palette index on write was added at libpng
|
5131
5311
|
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
|
@@ -5230,7 +5410,10 @@ and the accuracy of PNG fixed point values is insufficient for
|
|
5230
5410
|
representation of these values. Consequently a "string" API
|
5231
5411
|
(png_get_sCAL_s and png_set_sCAL_s) is the only reliable way of reading
|
5232
5412
|
arbitrary sCAL chunks in the absence of either the floating point API or
|
5233
|
-
internal floating point calculations.
|
5413
|
+
internal floating point calculations. Starting with libpng-1.5.0, both
|
5414
|
+
of these functions are present when PNG_sCAL_SUPPORTED is defined. Prior
|
5415
|
+
to libpng-1.5.0, their presence also depended upon PNG_FIXED_POINT_SUPPORTED
|
5416
|
+
being defined and PNG_FLOATING_POINT_SUPPORTED not being defined.
|
5234
5417
|
|
5235
5418
|
Applications no longer need to include the optional distribution header
|
5236
5419
|
file pngusr.h or define the corresponding macros during application
|
@@ -5250,11 +5433,6 @@ reset by pngusr.h or by explicit settings on the compiler command line.
|
|
5250
5433
|
These settings may produce compiler warnings or errors in 1.5.0 because
|
5251
5434
|
of macro redefinition.
|
5252
5435
|
|
5253
|
-
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
5254
|
-
function) incorrectly returned a value of type png_uint_32. libpng 1.5.0
|
5255
|
-
is consistent with the implementation in 1.4.5 and 1.2.x (where the macro
|
5256
|
-
did not exist.)
|
5257
|
-
|
5258
5436
|
Applications can now choose whether to use these macros or to call the
|
5259
5437
|
corresponding function by defining PNG_USE_READ_MACROS or
|
5260
5438
|
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
@@ -5272,7 +5450,10 @@ option was off by default, and slightly inaccurate scaling occurred.
|
|
5272
5450
|
This option can no longer be turned off, and the choice of accurate
|
5273
5451
|
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
|
5274
5452
|
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
|
5275
|
-
chopping.
|
5453
|
+
chopping. In libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
5454
|
+
macro became PNG_READ_SCALE_16_TO_8_SUPPORTED, and the PNG_READ_16_TO_8
|
5455
|
+
macro became PNG_READ_STRIP_16_TO_8_SUPPORTED, to enable the two
|
5456
|
+
png_set_*_16_to_8() functions separately.
|
5276
5457
|
|
5277
5458
|
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
|
5278
5459
|
used to reduce the width and height limits from the value of
|
@@ -5441,7 +5622,7 @@ pngconf.h no longer includes pngusr.h, therefore pngusr.h is ignored after the
|
|
5441
5622
|
build of pnglibconf.h and it is never included in an application build.
|
5442
5623
|
|
5443
5624
|
The rarely used alternative of adding a list of feature macros to the
|
5444
|
-
|
5625
|
+
CPPFLAGS setting in the build also still works; however, the macros will be
|
5445
5626
|
copied to pnglibconf.h and this may produce macro redefinition warnings
|
5446
5627
|
when the individual C files are compiled.
|
5447
5628
|
|
@@ -5498,7 +5679,6 @@ The following API are now DEPRECATED:
|
|
5498
5679
|
png_info_init_3()
|
5499
5680
|
png_convert_to_rfc1123() which has been replaced
|
5500
5681
|
with png_convert_to_rfc1123_buffer()
|
5501
|
-
png_data_freer()
|
5502
5682
|
png_malloc_default()
|
5503
5683
|
png_free_default()
|
5504
5684
|
png_reset_zstream()
|
@@ -5674,6 +5854,9 @@ exported functions are marked with PNGAPI:
|
|
5674
5854
|
body;
|
5675
5855
|
}
|
5676
5856
|
|
5857
|
+
The return type and decorations are placed on a separate line
|
5858
|
+
ahead of the function name, as illustrated above.
|
5859
|
+
|
5677
5860
|
The prototypes for all exported functions appear in png.h,
|
5678
5861
|
above the comment that says
|
5679
5862
|
|
@@ -5738,13 +5921,13 @@ Other rules can be inferred by inspecting the libpng source.
|
|
5738
5921
|
|
5739
5922
|
.SH XVI. Y2K Compliance in libpng
|
5740
5923
|
|
5741
|
-
|
5924
|
+
March 6, 2014
|
5742
5925
|
|
5743
5926
|
Since the PNG Development group is an ad-hoc body, we can't make
|
5744
5927
|
an official declaration.
|
5745
5928
|
|
5746
5929
|
This is your unofficial assurance that libpng from version 0.71 and
|
5747
|
-
upward through 1.6.
|
5930
|
+
upward through 1.6.10 are Y2K compliant. It is my belief that earlier
|
5748
5931
|
versions were also Y2K compliant.
|
5749
5932
|
|
5750
5933
|
Libpng only has two year fields. One is a 2-byte unsigned integer
|
@@ -5972,6 +6155,12 @@ the first widely used release:
|
|
5972
6155
|
1.6.8beta01-02 16 10608 16.so.16.8[.0]
|
5973
6156
|
1.6.8rc01-02 16 10608 16.so.16.8[.0]
|
5974
6157
|
1.6.8 16 10608 16.so.16.8[.0]
|
6158
|
+
1.6.9beta01-04 16 10609 16.so.16.9[.0]
|
6159
|
+
1.6.9rc01-02 16 10609 16.so.16.9[.0]
|
6160
|
+
1.6.9 16 10609 16.so.16.9[.0]
|
6161
|
+
1.6.10beta01-03 16 10610 16.so.16.10[.0]
|
6162
|
+
1.6.10rc01-04 16 10610 16.so.16.10[.0]
|
6163
|
+
1.6.10 16 10610 16.so.16.10[.0]
|
5975
6164
|
|
5976
6165
|
Henceforth the source version will match the shared-library minor
|
5977
6166
|
and patch numbers; the shared-library major version number will be
|
@@ -6028,7 +6217,7 @@ possible without all of you.
|
|
6028
6217
|
|
6029
6218
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
6030
6219
|
|
6031
|
-
Libpng version 1.6.
|
6220
|
+
Libpng version 1.6.10 - March 6, 2014:
|
6032
6221
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
6033
6222
|
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
6034
6223
|
|
@@ -6051,7 +6240,7 @@ this sentence.
|
|
6051
6240
|
|
6052
6241
|
This code is released under the libpng license.
|
6053
6242
|
|
6054
|
-
libpng versions 1.2.6, August 15, 2004, through 1.6.
|
6243
|
+
libpng versions 1.2.6, August 15, 2004, through 1.6.10, March 6, 2014, are
|
6055
6244
|
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
|
6056
6245
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
6057
6246
|
with the following individual added to the list of Contributing Authors
|
@@ -6150,7 +6339,7 @@ certification mark of the Open Source Initiative.
|
|
6150
6339
|
|
6151
6340
|
Glenn Randers-Pehrson
|
6152
6341
|
glennrp at users.sourceforge.net
|
6153
|
-
|
6342
|
+
March 6, 2014
|
6154
6343
|
|
6155
6344
|
.\" end of man page
|
6156
6345
|
|