mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
4157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba980b8f0c | ||
|
|
27e548af25 | ||
|
|
92b2128a75 | ||
|
|
6159bad8a9 | ||
|
|
3285bf0d4c | ||
|
|
4edbb4da81 | ||
|
|
9a774b9156 | ||
|
|
671661849a | ||
|
|
438a518611 | ||
|
|
8fb49b8b94 | ||
|
|
144b348e07 | ||
|
|
1a0d7a7481 | ||
|
|
866fdf6f8f | ||
|
|
6f8257e437 | ||
|
|
269b753496 | ||
|
|
2b814cde29 | ||
|
|
893b8113f0 | ||
|
|
7ec2bd28c7 | ||
|
|
70d10da35c | ||
|
|
064f992187 | ||
|
|
46f1106a3f | ||
|
|
a7fe3414e5 | ||
|
|
ce4b632dd7 | ||
|
|
6b0d1bd75b | ||
|
|
2a4f0f5aee | ||
|
|
7dacc4d5aa | ||
|
|
da109d3e6e | ||
|
|
f9348b77da | ||
|
|
2ea11e2235 | ||
|
|
b60316f4ee | ||
|
|
050ce505e4 | ||
|
|
2a23247420 | ||
|
|
6b241f3786 | ||
|
|
b3521c60af | ||
|
|
6beae586d6 | ||
|
|
bdbbcaa457 | ||
|
|
abb8d4a71f | ||
|
|
c993ae4c67 | ||
|
|
6abf8c1e91 | ||
|
|
0dfe422e9f | ||
|
|
71b9b5e16e | ||
|
|
9f9f8d8e63 | ||
|
|
437b24a958 | ||
|
|
2ed5a70bca | ||
|
|
85f866dea3 | ||
|
|
2fff013a69 | ||
|
|
acfd50ae0b | ||
|
|
8fc13a8704 | ||
|
|
1460b3ce78 | ||
|
|
e1088f99d4 | ||
|
|
d65b3ebf00 | ||
|
|
a3d1a35b98 | ||
|
|
9c1dc4d13d | ||
|
|
e755fb79ba | ||
|
|
f79c85e22d | ||
|
|
53d2188fa5 | ||
|
|
f2294569cf | ||
|
|
1547b335e4 | ||
|
|
b2ef6edbe8 | ||
|
|
5a6ea1822b | ||
|
|
22ad62c25e | ||
|
|
71475b064f | ||
|
|
ee9d6d7bf2 | ||
|
|
f8e5fa92b0 | ||
|
|
c81516e943 | ||
|
|
0b7bc40de1 | ||
|
|
82414985c1 | ||
|
|
c0616f1017 | ||
|
|
c741d1e392 | ||
|
|
ad9e42a877 | ||
|
|
d7f77bf271 | ||
|
|
f135775ad4 | ||
|
|
afc6c595bf | ||
|
|
e6c5bf46c4 | ||
|
|
8be5c147d5 | ||
|
|
f7abe3c419 | ||
|
|
82097c2108 | ||
|
|
e519af8b49 | ||
|
|
efc96c9d59 | ||
|
|
aab24fa1b3 | ||
|
|
efa9c2e920 | ||
|
|
c22ef3b2e3 | ||
|
|
66fede80d2 | ||
|
|
59fa76e164 | ||
|
|
70fda1837d | ||
|
|
aeb26da4cb | ||
|
|
cd0ea2a7f5 | ||
|
|
9923515ff4 | ||
|
|
61bfdb0cb0 | ||
|
|
9db8cff6ef | ||
|
|
b445aade83 | ||
|
|
3c152a8ef7 | ||
|
|
5a0b7e9c29 | ||
|
|
b126f80710 | ||
|
|
3c761b5135 | ||
|
|
07b8803110 | ||
|
|
32f465a66b | ||
|
|
074e2eaab0 | ||
|
|
790fef342b | ||
|
|
8a5732fcb3 | ||
|
|
77c3a39299 | ||
|
|
8cfdb5436d | ||
|
|
f6036c0aeb | ||
|
|
689e06516b | ||
|
|
33de006e12 | ||
|
|
9b5488054b | ||
|
|
04c016d79f | ||
|
|
b8ca9108ac | ||
|
|
e56f79c0c6 | ||
|
|
12222e6fbd | ||
|
|
9b65ad49d3 | ||
|
|
3f991d5092 | ||
|
|
b422bc1181 | ||
|
|
6fc5119423 | ||
|
|
0a158f3506 | ||
|
|
50d7a85154 | ||
|
|
2733482d8e | ||
|
|
3d57708c91 | ||
|
|
abccfd7968 | ||
|
|
823ef44f01 | ||
|
|
d72cda543c | ||
|
|
3c67eeca51 | ||
|
|
b60656ecdc | ||
|
|
c64655d058 | ||
|
|
8b7b99c1db | ||
|
|
62c027d4df | ||
|
|
e9e9801a84 | ||
|
|
0c2388cdae | ||
|
|
9cb84c4cb9 | ||
|
|
8c542ad9df | ||
|
|
2abaf81e0f | ||
|
|
ad0245bb96 | ||
|
|
1f974dd2a9 | ||
|
|
3ec225dd41 | ||
|
|
36bd1bbd54 | ||
|
|
0406deb1ca | ||
|
|
5f5f98a1a9 | ||
|
|
f10c6bb603 | ||
|
|
f16427e58e | ||
|
|
6aff792b66 | ||
|
|
ed8840a36f | ||
|
|
efdb24e54b | ||
|
|
1f20bc1e85 | ||
|
|
bbab57105b | ||
|
|
a1a81cc2ac | ||
|
|
c3a1d8424c | ||
|
|
eda0f47f46 | ||
|
|
3848c73ab4 | ||
|
|
dd8db8105c | ||
|
|
763c77e628 | ||
|
|
840af2eda6 | ||
|
|
8a354b41e9 | ||
|
|
0fe598d2f6 | ||
|
|
cbf8c64b58 | ||
|
|
6a42bc1c8e | ||
|
|
9e32b6f1ad | ||
|
|
cc0e959722 | ||
|
|
403422674d | ||
|
|
bfb0abe4d9 | ||
|
|
081e6751ab | ||
|
|
103f8346e3 | ||
|
|
723b2d9f2e | ||
|
|
b7ea74c97d | ||
|
|
8c3fdb0ac1 | ||
|
|
a37d483651 | ||
|
|
3796518809 | ||
|
|
8ca01083d6 | ||
|
|
cd03aaf7bf | ||
|
|
c4bd411c35 | ||
|
|
2224c8ea7b | ||
|
|
e2bb5e7512 | ||
|
|
d6e13b2acd | ||
|
|
c2e2cd2ec5 | ||
|
|
c3f209178b | ||
|
|
dbe3e0c43e | ||
|
|
2f753e260c | ||
|
|
f5d5f5ae0e | ||
|
|
3676fd324a | ||
|
|
28c0f8895e | ||
|
|
87378bc21d | ||
|
|
6c6f7d105a | ||
|
|
6842c58adc | ||
|
|
a6fc80300f | ||
|
|
5e8b45c436 | ||
|
|
6dd99ca9c8 | ||
|
|
52ee167644 | ||
|
|
eb6767273a | ||
|
|
9f734b13f4 | ||
|
|
3cec1a16f5 | ||
|
|
50bd1abdb1 | ||
|
|
2dd5630eae | ||
|
|
b9155ce3fd | ||
|
|
2c0aee56a0 | ||
|
|
301f7a1429 | ||
|
|
386707c6d1 | ||
|
|
216387f6f7 | ||
|
|
b9e811fa99 | ||
|
|
cdbb8ec7aa | ||
|
|
72fa126446 | ||
|
|
5df8e982e2 | ||
|
|
a40189cf88 | ||
|
|
8da8257d0b | ||
|
|
27e8b99287 | ||
|
|
62a56d4fcc | ||
|
|
3342fafa60 | ||
|
|
3f0f1d5579 | ||
|
|
dcefbc7dcd | ||
|
|
1f0221fad7 | ||
|
|
a627bd26a3 | ||
|
|
82ae623ec9 | ||
|
|
9c0d5c77bf | ||
|
|
8439534daa | ||
|
|
70d122aac4 | ||
|
|
0a882b5787 | ||
|
|
fef895aa28 | ||
|
|
43b4141839 | ||
|
|
6a94d14567 | ||
|
|
0e13545712 | ||
|
|
eddf902320 | ||
|
|
85acd919b9 | ||
|
|
e79085a172 | ||
|
|
81a65de25d | ||
|
|
702a07e716 | ||
|
|
7b2224cb6e | ||
|
|
ee7967eea4 | ||
|
|
a54a0562c5 | ||
|
|
94429a335b | ||
|
|
1ceaa83a84 | ||
|
|
b66ed71131 | ||
|
|
7734cda20c | ||
|
|
2fc5ddff18 | ||
|
|
8033c96f32 | ||
|
|
d3d1baadb4 | ||
|
|
a294c1bcb6 | ||
|
|
ceb327789b | ||
|
|
1ef8882814 | ||
|
|
58eedced25 | ||
|
|
1d89a5db66 | ||
|
|
43446b735d | ||
|
|
6c059f8f5b | ||
|
|
f5d48df418 | ||
|
|
9730362202 | ||
|
|
7cb7afb43d | ||
|
|
1bd4214a42 | ||
|
|
6d55a14c58 | ||
|
|
8440326590 | ||
|
|
b729fff4a3 | ||
|
|
c36c09f004 | ||
|
|
a873893279 | ||
|
|
47f18784e4 | ||
|
|
d4fb621429 | ||
|
|
fb6312a9f9 | ||
|
|
ddc842bf06 | ||
|
|
46924bd877 | ||
|
|
8da397423e | ||
|
|
c17d164b44 | ||
|
|
46aedd8961 | ||
|
|
2471434d29 | ||
|
|
8a05766cb7 | ||
|
|
a74aa9a002 | ||
|
|
916117d970 | ||
|
|
7784cd3f6f | ||
|
|
cde1e1fe79 | ||
|
|
0e06b5948c | ||
|
|
3fecfeada1 | ||
|
|
140f3aa280 | ||
|
|
eb91c0e4ed | ||
|
|
d5e4915ebe | ||
|
|
fe669f6f38 | ||
|
|
84e6e35675 | ||
|
|
28d0ee757d | ||
|
|
f07b985ddb | ||
|
|
d532334ef5 | ||
|
|
7292c861b1 | ||
|
|
fc32eb1662 | ||
|
|
7ca2f0e078 | ||
|
|
babae66b48 | ||
|
|
3403a6e387 | ||
|
|
b196bd6566 | ||
|
|
f23b41d7b1 | ||
|
|
7125401411 | ||
|
|
4b52ef8e76 | ||
|
|
5d7b4ab289 | ||
|
|
7ee802a5a2 | ||
|
|
2f8b82ebca | ||
|
|
aea0ec4346 | ||
|
|
af08094ba6 | ||
|
|
9bddba26de | ||
|
|
3b5bcea010 | ||
|
|
adefba1b03 | ||
|
|
48a2460393 | ||
|
|
2be0f33e7c | ||
|
|
ccc77d2a8d | ||
|
|
f648294931 | ||
|
|
83f27f018c | ||
|
|
fefe0affc1 | ||
|
|
a3d1057a73 | ||
|
|
12384eae6f | ||
|
|
357af1f095 | ||
|
|
ab791fc9d6 | ||
|
|
f5f8b98dbb | ||
|
|
293b6aaa59 | ||
|
|
98a3b2a5c2 | ||
|
|
78ad1208d6 | ||
|
|
477a241c10 | ||
|
|
edb1f47139 | ||
|
|
0f9f170e9f | ||
|
|
99d4a62c9a | ||
|
|
2227793efc | ||
|
|
b78804f9a2 | ||
|
|
345fc37fdc | ||
|
|
c1effe1bbf | ||
|
|
2ee8cb0559 | ||
|
|
414de98047 | ||
|
|
0512c63533 | ||
|
|
cae11e3e43 | ||
|
|
4f0a0b9a94 | ||
|
|
dc22583aca | ||
|
|
346cbf2c2a | ||
|
|
8eb79b3435 | ||
|
|
13a158690f | ||
|
|
e4c8312d31 | ||
|
|
3d2d0b52a3 | ||
|
|
073fe76f6a | ||
|
|
4b7635ce72 | ||
|
|
96333b6bea | ||
|
|
90dd185aed | ||
|
|
8746d57184 | ||
|
|
0165badb9d | ||
|
|
60d297d592 | ||
|
|
2da37077db | ||
|
|
e1220aefc4 | ||
|
|
5efa483265 | ||
|
|
5f0c9fabbc | ||
|
|
397c7eea38 | ||
|
|
066cb34268 | ||
|
|
721b96ef90 | ||
|
|
562a68513e | ||
|
|
a7722aee32 | ||
|
|
413de0a56a | ||
|
|
04e16d2817 | ||
|
|
d1a0937cae | ||
|
|
1c98b85886 | ||
|
|
4de130c255 | ||
|
|
4ddead1e1c | ||
|
|
d7edcc40e4 | ||
|
|
7d40b53fbf | ||
|
|
76b269b1f4 | ||
|
|
61d29bfc80 | ||
|
|
0f2adc19eb | ||
|
|
1aabcfdbae | ||
|
|
b5ae93d72e | ||
|
|
6a2a762914 | ||
|
|
50c9e15a7d | ||
|
|
c0f02a8078 | ||
|
|
3789cba2f2 | ||
|
|
8592873f24 | ||
|
|
051dcaf877 | ||
|
|
95046512a4 | ||
|
|
4e9839d453 | ||
|
|
d17041f052 | ||
|
|
cbcb39932c | ||
|
|
52a566af97 | ||
|
|
9050c32365 | ||
|
|
4911714f74 | ||
|
|
c77de19ba9 | ||
|
|
051d6cc19b | ||
|
|
61e0a38091 | ||
|
|
fca1862ac9 | ||
|
|
c2c8b398a9 | ||
|
|
9495ab477b | ||
|
|
62a2463211 | ||
|
|
dcd3edaf87 | ||
|
|
b47e0f5ceb | ||
|
|
84a5bf83ff | ||
|
|
f3a22d396a | ||
|
|
eb2f42aa97 | ||
|
|
47aa798127 | ||
|
|
5c27e93f51 | ||
|
|
efaf42e5df | ||
|
|
d3220babe2 | ||
|
|
a1b5be044f | ||
|
|
58720d3c06 | ||
|
|
d64c5ea1a8 | ||
|
|
50d2d49220 | ||
|
|
d2b9af04ac | ||
|
|
321c24b0d7 | ||
|
|
14a8996fe6 | ||
|
|
ef76b1f688 | ||
|
|
5c616548a0 | ||
|
|
da923d334d | ||
|
|
e06ec26906 | ||
|
|
f6ca33d42c | ||
|
|
f8110669f0 | ||
|
|
df7e9dae0c | ||
|
|
4760bac13d | ||
|
|
737f347f23 | ||
|
|
1257369169 | ||
|
|
de315dfaad | ||
|
|
ba5f7f6a3e | ||
|
|
b0d14c7d13 | ||
|
|
735fde494a | ||
|
|
d2533b96f3 | ||
|
|
ddabd0c70a | ||
|
|
945759162e | ||
|
|
bcb739a864 | ||
|
|
90b437e372 | ||
|
|
ab3ea490fd | ||
|
|
d19e8b9a4b | ||
|
|
c5f801c82b | ||
|
|
7b8b7115d9 | ||
|
|
646fad9d55 | ||
|
|
06ec4252a4 | ||
|
|
33848546a3 | ||
|
|
fa2f72258a | ||
|
|
7653aaa4b1 | ||
|
|
c362a8c80e | ||
|
|
c339da7fc2 | ||
|
|
33787340a4 | ||
|
|
cf713fb0ab | ||
|
|
c82ae40e9f | ||
|
|
099558d100 | ||
|
|
8ed418b042 | ||
|
|
39d84f4f6a | ||
|
|
c5c778bcfc | ||
|
|
1ebe4f75cc | ||
|
|
13bc0b6b1f | ||
|
|
fcd1bb9312 | ||
|
|
c33d624988 | ||
|
|
0ec733ce61 | ||
|
|
dbdeb1f3fa | ||
|
|
3d7f3e57b5 | ||
|
|
a64c8ca9e9 | ||
|
|
378e926d78 | ||
|
|
3a957dd96f | ||
|
|
554d4400ab | ||
|
|
2037030d50 | ||
|
|
207392821d | ||
|
|
2dca15686f | ||
|
|
469317d9bd | ||
|
|
894a9869dd | ||
|
|
c14be73428 | ||
|
|
2dbef2f2a9 | ||
|
|
4ac8b5e0d6 | ||
|
|
9d4215e6c0 | ||
|
|
d683af0f12 | ||
|
|
095b4ce16b | ||
|
|
bfdabdacff | ||
|
|
6f89dff45e | ||
|
|
d930d36155 | ||
|
|
a1fe2c9848 | ||
|
|
6b53a5ed7b | ||
|
|
70041f4038 | ||
|
|
96b65b3644 | ||
|
|
347538efbd | ||
|
|
2b37d46564 | ||
|
|
2df5c96352 | ||
|
|
3fa1df48a1 | ||
|
|
f30f1ae3ea | ||
|
|
7c709f039f | ||
|
|
f8de55da04 | ||
|
|
fd6b87253c | ||
|
|
821b1dcf34 | ||
|
|
611b29acd8 | ||
|
|
71a56180e5 | ||
|
|
cb628b2e4e | ||
|
|
bc68c41d5f | ||
|
|
4aad3c0eb0 | ||
|
|
68a80b10fe | ||
|
|
c17b7b38b0 | ||
|
|
91540c56af | ||
|
|
90d3ff290f | ||
|
|
619cf868e6 | ||
|
|
3524b0d201 | ||
|
|
3e753f5cbe | ||
|
|
c77274ffa9 | ||
|
|
323c8655cf | ||
|
|
40afb68570 | ||
|
|
4ab78af90a | ||
|
|
b73c891891 | ||
|
|
fbff8986e7 | ||
|
|
9fcb846402 | ||
|
|
136b3203f4 | ||
|
|
1ed0b3f7ca | ||
|
|
a354e5c1ff | ||
|
|
3de6fa1122 | ||
|
|
db16b27d11 | ||
|
|
d2fcc41eec | ||
|
|
cd37210184 | ||
|
|
a5b6751bbd | ||
|
|
cd8eb93ecb | ||
|
|
68cb0aaee3 | ||
|
|
40943eb67a | ||
|
|
f78a3e7326 | ||
|
|
72d07d3202 | ||
|
|
ecea632c4c | ||
|
|
fd9c48fd9c | ||
|
|
f2621c5137 | ||
|
|
a947052ec2 | ||
|
|
0a9d2719c5 | ||
|
|
aa6e0482fa | ||
|
|
77a063af16 | ||
|
|
5cc23552a7 | ||
|
|
76b3a7e78f | ||
|
|
2b80b401be | ||
|
|
f16c3406cd | ||
|
|
918a6ac2b4 | ||
|
|
bd5a826d37 | ||
|
|
50b6df5389 | ||
|
|
857ef82edf | ||
|
|
f380ae5243 | ||
|
|
23b51990e3 | ||
|
|
77417b8ea0 | ||
|
|
eed9efec4e | ||
|
|
b5c16f8bfc | ||
|
|
89b8c133e7 | ||
|
|
54126d5c59 | ||
|
|
660ce58597 | ||
|
|
9f7134c3fc | ||
|
|
145361aaac | ||
|
|
8c552ddf5b | ||
|
|
58649f19cb | ||
|
|
14be73c8a3 | ||
|
|
87cd2dc07d | ||
|
|
2d306c4b15 | ||
|
|
5aaf6e889c | ||
|
|
c548328904 | ||
|
|
11629b1c1a | ||
|
|
774922da91 | ||
|
|
7da2ea45b9 | ||
|
|
95f3c07d6f | ||
|
|
a315efe3b2 | ||
|
|
6155c6629d | ||
|
|
d40ac082ef | ||
|
|
d2ac910a53 | ||
|
|
a1577bf965 | ||
|
|
e486c76253 | ||
|
|
30d1f909ed | ||
|
|
8359b90057 | ||
|
|
11c25c0e9e | ||
|
|
b99308a33c | ||
|
|
170a44b222 | ||
|
|
0808d75851 | ||
|
|
2eff8ef504 | ||
|
|
60d8ae1003 | ||
|
|
53f22aed41 | ||
|
|
13370c536c | ||
|
|
054be18721 | ||
|
|
64f81108db | ||
|
|
ead7079f1d | ||
|
|
82add753e5 | ||
|
|
b3ffdc5991 | ||
|
|
e744ee1338 | ||
|
|
ab8dbdcce5 | ||
|
|
7bbd665b34 | ||
|
|
dce241c107 | ||
|
|
8c50acb9d2 | ||
|
|
92fcd25e9d | ||
|
|
9b0170dd03 | ||
|
|
2239961279 | ||
|
|
18834ff62b | ||
|
|
03a6f3f9c9 | ||
|
|
b363e01e6b | ||
|
|
d42e88d5b3 | ||
|
|
fae874c8ca | ||
|
|
0b1f7e412b | ||
|
|
a8de1a70d1 | ||
|
|
7db98a18fe | ||
|
|
a7029a5b4c | ||
|
|
4f31b7f242 | ||
|
|
b475d0593c | ||
|
|
862a2858b0 | ||
|
|
364450bf8d | ||
|
|
f6d358ff42 | ||
|
|
7980c79d69 | ||
|
|
5e8c50cc8d | ||
|
|
7218761fe1 | ||
|
|
3644db298b | ||
|
|
29775cef5e | ||
|
|
a343882c74 | ||
|
|
6f6c396604 | ||
|
|
483bcad21d | ||
|
|
310dee21f7 | ||
|
|
d1c12e85c1 | ||
|
|
99d7285f20 | ||
|
|
d4bdca45b3 | ||
|
|
58e9d5d59d | ||
|
|
7428ca944d | ||
|
|
ae15e839d9 | ||
|
|
8a242668fd | ||
|
|
b42e8bce3a | ||
|
|
b1be78460a | ||
|
|
d57bed7838 | ||
|
|
b8afc73b73 | ||
|
|
19425d32f3 | ||
|
|
9bd58f9387 | ||
|
|
f2b829166d | ||
|
|
ab2a639a2a | ||
|
|
0aa1b967f0 | ||
|
|
80041d15b2 | ||
|
|
2cc569eab7 | ||
|
|
bea573d370 | ||
|
|
d0d310f1cb | ||
|
|
3907feb306 | ||
|
|
acb155d893 | ||
|
|
c47ddcf22b | ||
|
|
565d4beea2 | ||
|
|
c43aaa8b20 | ||
|
|
6ddcd33daa | ||
|
|
24b27e5948 | ||
|
|
f604c74a5f | ||
|
|
c3f4e5fb1a | ||
|
|
adbf1d6d1c | ||
|
|
9b0311a4d8 | ||
|
|
b455622aa8 | ||
|
|
ccef5edbfe | ||
|
|
91acd4baf8 | ||
|
|
6ff408d423 | ||
|
|
ee5804fa14 | ||
|
|
2b6e59d968 | ||
|
|
ae794eefaa | ||
|
|
dd24a6ca15 | ||
|
|
a0e3160ad4 | ||
|
|
4c0740c8de | ||
|
|
8c6c9e6d56 | ||
|
|
f8fe5f8560 | ||
|
|
eaca53a2d9 | ||
|
|
bef76802de | ||
|
|
ebede25ceb | ||
|
|
4ddac468c4 | ||
|
|
0a181e1665 | ||
|
|
17ad597dba | ||
|
|
b784934049 | ||
|
|
93b3476358 | ||
|
|
6df2225c55 | ||
|
|
562751dcc9 | ||
|
|
3785125faf | ||
|
|
edef058e18 | ||
|
|
16fe975928 | ||
|
|
24dfd3f2d7 | ||
|
|
f8bdbd4d8f | ||
|
|
f981826204 | ||
|
|
14e885a54c | ||
|
|
dd8aa3e939 | ||
|
|
29b9fd605e | ||
|
|
aa5bb2c3dd | ||
|
|
993bd61329 | ||
|
|
b9b490c7f5 | ||
|
|
09fae1b5d3 | ||
|
|
e4b59e5583 | ||
|
|
e9c3d83d5a | ||
|
|
812768d7a9 | ||
|
|
a3b5edc934 | ||
|
|
aaed6782e8 | ||
|
|
fd3a683b2a | ||
|
|
08d00b25d8 | ||
|
|
61a9a054fd | ||
|
|
bf90247a63 | ||
|
|
4708ca268e | ||
|
|
7bb00afec3 | ||
|
|
13a354f81e | ||
|
|
8187ba1518 | ||
|
|
dbb5fce3d8 | ||
|
|
d65a92b951 | ||
|
|
a69dd76eac | ||
|
|
e36003e9b8 | ||
|
|
2accfbd6f3 | ||
|
|
858cb585d7 | ||
|
|
35cbe7640b | ||
|
|
0c440812db | ||
|
|
436ce2c6e9 | ||
|
|
a1312f7b19 | ||
|
|
01e99bbac1 | ||
|
|
dd6d7f031f | ||
|
|
f7fe4db91b | ||
|
|
a106899acd | ||
|
|
ffaeff82d3 | ||
|
|
13bdd8bcdf | ||
|
|
7d7694ae6a | ||
|
|
b3540f9932 | ||
|
|
a5084f1522 | ||
|
|
565a751ca2 | ||
|
|
f6497e03d1 | ||
|
|
b7b59b7fe9 | ||
|
|
890611200a | ||
|
|
ce45f85c61 | ||
|
|
761d833372 | ||
|
|
3875d9af4c | ||
|
|
ad3318ddc8 | ||
|
|
7184475a98 | ||
|
|
c180e7a437 | ||
|
|
fbe3e002bc | ||
|
|
b5b77a72b4 | ||
|
|
97dfccb632 | ||
|
|
319c9852bf | ||
|
|
1b363fa6b0 | ||
|
|
fa24421216 | ||
|
|
d84fd77bf8 | ||
|
|
04dab1e82d | ||
|
|
394be58371 | ||
|
|
217546ae43 | ||
|
|
8aa1638ccc | ||
|
|
89ea081433 | ||
|
|
7835716cef | ||
|
|
cb1787f033 | ||
|
|
1842d7c865 | ||
|
|
bc2bb96cd7 | ||
|
|
5cb1700702 | ||
|
|
7dc0329250 | ||
|
|
90ea4af4a1 | ||
|
|
a744b11975 | ||
|
|
597b1a1b5e | ||
|
|
f0b453bc3e | ||
|
|
c9d7b865b6 | ||
|
|
eb5cdf0c64 | ||
|
|
e3a6631123 | ||
|
|
434aecf327 | ||
|
|
abd88841ef | ||
|
|
42e5441888 | ||
|
|
01b6ca34b7 | ||
|
|
4ade4e8a0d | ||
|
|
d1f14c829a | ||
|
|
b43133b361 | ||
|
|
2e2330bf25 | ||
|
|
0a2d496d58 | ||
|
|
000f07bfbe | ||
|
|
2e7c3a6e70 | ||
|
|
05a4db1fcd | ||
|
|
ee5e39835c | ||
|
|
143434ac78 | ||
|
|
4dc4b2efac | ||
|
|
e175eb1ffb | ||
|
|
4be85e1b37 | ||
|
|
9cab7a24fd | ||
|
|
39df0ced18 | ||
|
|
2705f55221 | ||
|
|
4679be7c2b | ||
|
|
935676cdad | ||
|
|
8ff2ed2fe1 | ||
|
|
6bdaf38d12 | ||
|
|
e018ab98be | ||
|
|
92a7c79db2 | ||
|
|
19fefd3a4b | ||
|
|
cdc0e74ee6 | ||
|
|
0c29ab2b31 | ||
|
|
b50d5cea2b | ||
|
|
3d3c23b39f | ||
|
|
2bb9ee89fa | ||
|
|
96db0fff50 | ||
|
|
99663e95f8 | ||
|
|
1153ddccb6 | ||
|
|
8d091a640b | ||
|
|
2c0b7a8ff6 | ||
|
|
faa3e537e1 | ||
|
|
0a5e99d7ee | ||
|
|
d1f9149d8a | ||
|
|
ee079481c9 | ||
|
|
639b48625f | ||
|
|
dd70604cec | ||
|
|
34c783e2fe | ||
|
|
82d0009885 | ||
|
|
baed0e32f9 | ||
|
|
3c7c436303 | ||
|
|
9b14f5f85a | ||
|
|
0fd9a249de | ||
|
|
7a18a2de59 | ||
|
|
5d7c7d5132 | ||
|
|
192e92d681 | ||
|
|
1b9f4817c8 | ||
|
|
d9940f6207 | ||
|
|
f7d5419816 | ||
|
|
9928ee0a52 | ||
|
|
66f796e74c | ||
|
|
a3eac818d5 | ||
|
|
cfc19ff1b6 | ||
|
|
80495124b2 | ||
|
|
2c21a4778d | ||
|
|
14b8dee96f | ||
|
|
11c88033d4 | ||
|
|
25bb30c9b8 | ||
|
|
54feb0ad2a | ||
|
|
b733c50bc0 | ||
|
|
a93744423d | ||
|
|
9957c45073 | ||
|
|
0ac91cc657 | ||
|
|
d9779744f9 | ||
|
|
ed5a01d922 | ||
|
|
d43f93ff93 | ||
|
|
3f2879bf60 | ||
|
|
ee1e535298 | ||
|
|
4b4a9583b4 | ||
|
|
da2ba024a5 | ||
|
|
e5d468ea9c | ||
|
|
21d9e6e0fb | ||
|
|
98af505439 | ||
|
|
1df0ace0b4 | ||
|
|
4af267c07b | ||
|
|
6c7c5a04b8 | ||
|
|
42069e9432 | ||
|
|
36762ac4b4 | ||
|
|
147dc568da | ||
|
|
29135161d7 | ||
|
|
9c04f57cab | ||
|
|
e1123aa80c | ||
|
|
4a8105e925 | ||
|
|
51df269afe | ||
|
|
bf2613b975 | ||
|
|
5c6b7e177c | ||
|
|
428f5ddabd | ||
|
|
a4b26efa1f | ||
|
|
5a8b04137f | ||
|
|
ed6db9d86b | ||
|
|
ee3c4e43ae | ||
|
|
6d4e4d0cce | ||
|
|
89158b9ad1 | ||
|
|
1fdac25f66 | ||
|
|
1017744c94 | ||
|
|
f757d74898 | ||
|
|
bd2370c054 | ||
|
|
dbfd68ae3a | ||
|
|
801b925edf | ||
|
|
a201f859cd | ||
|
|
84cc738166 | ||
|
|
81f0273d54 | ||
|
|
3f46c67c69 | ||
|
|
6c7459e455 | ||
|
|
8d16725373 | ||
|
|
4e34fd3b8a | ||
|
|
87c14c528a | ||
|
|
ac43a87820 | ||
|
|
474751e6b2 | ||
|
|
37ab4d946c | ||
|
|
d6e5a72c84 | ||
|
|
add4581894 | ||
|
|
45ad37b31b | ||
|
|
f6ca49c863 | ||
|
|
7fa1b5b26c | ||
|
|
0794fee913 | ||
|
|
319a7b842b | ||
|
|
50d41533d2 | ||
|
|
8e89b13c47 | ||
|
|
f962ee9dc6 | ||
|
|
a271625928 | ||
|
|
9f642c1bbc | ||
|
|
21939d36ec | ||
|
|
8c754b1834 | ||
|
|
2b9f68631c | ||
|
|
830608b4b8 | ||
|
|
eefd9127ca | ||
|
|
0392e36e94 | ||
|
|
a967818235 | ||
|
|
8eaa434163 | ||
|
|
af9d06e06a | ||
|
|
703944c39d | ||
|
|
e81f16bf5d | ||
|
|
7572840cd0 | ||
|
|
569a1d27b4 | ||
|
|
d642eede9a | ||
|
|
5b0a0ded05 | ||
|
|
819b125e6e | ||
|
|
fa551df95e | ||
|
|
76531da252 | ||
|
|
daf2169797 | ||
|
|
e0acad59cb | ||
|
|
5765a22249 | ||
|
|
f47e1d4995 | ||
|
|
8f506d3257 | ||
|
|
d960ced6e1 | ||
|
|
7cf9a34ade | ||
|
|
5ef8d1bfbf | ||
|
|
6ee90f06ab | ||
|
|
46861bc41e | ||
|
|
12e63e91af | ||
|
|
edad4639cf | ||
|
|
1a3fa1e091 | ||
|
|
9295264b6f | ||
|
|
46c47291e8 | ||
|
|
e25323e81b | ||
|
|
2a25fc41f6 | ||
|
|
4b4700ceca | ||
|
|
0df91242a2 | ||
|
|
9821954ecc | ||
|
|
e2d113cadf | ||
|
|
b4f9f5d041 | ||
|
|
6c3d5bd2a0 | ||
|
|
da9d1d7aa6 | ||
|
|
52846504da | ||
|
|
d06d66e899 | ||
|
|
cdd9a23fd4 | ||
|
|
4233766b1d | ||
|
|
f78d1cd47a | ||
|
|
c3a45944e2 | ||
|
|
342c4eab2a | ||
|
|
fb375429b5 | ||
|
|
9a308a3344 | ||
|
|
0348a407e5 | ||
|
|
5bc58a0ebc | ||
|
|
577c1f0305 | ||
|
|
f84f957881 | ||
|
|
9c946e22fc | ||
|
|
1099cdcb5a | ||
|
|
0c27c8633e | ||
|
|
baf301d122 | ||
|
|
08bd7654bc | ||
|
|
7684bcae7d | ||
|
|
461c7e45b5 | ||
|
|
a4a54aa1bf | ||
|
|
337c694971 | ||
|
|
05591abeb1 | ||
|
|
196a50a4bd | ||
|
|
84a5b7a0f8 | ||
|
|
ed23815985 | ||
|
|
f1eafe8b01 | ||
|
|
2d3bd021d0 | ||
|
|
2a28a4320a | ||
|
|
8fb55653d1 | ||
|
|
e717842a54 | ||
|
|
74e481c743 | ||
|
|
98c6fa2495 | ||
|
|
4dac51d260 | ||
|
|
ac796d3f9a | ||
|
|
e0ce90ea0a | ||
|
|
f6a23fe205 | ||
|
|
d2b8d46658 | ||
|
|
93a3bc7343 | ||
|
|
7f576964d8 | ||
|
|
0873ae8242 | ||
|
|
571abc9a67 | ||
|
|
c68f20cecc | ||
|
|
94f4e972b5 | ||
|
|
175a126a1a | ||
|
|
95d2726ecc | ||
|
|
b8dbd78de8 | ||
|
|
777dbf46dc | ||
|
|
e8558d2160 | ||
|
|
5031c77d85 | ||
|
|
5756fcab2f | ||
|
|
fc0786a442 | ||
|
|
780079e771 | ||
|
|
253326c52d | ||
|
|
81dfc2163b | ||
|
|
9b54f0037a | ||
|
|
b416dc5fc8 | ||
|
|
ecc022ee5f | ||
|
|
092b8d7bf3 | ||
|
|
912f030532 | ||
|
|
66db757dd4 | ||
|
|
9616bf6882 | ||
|
|
dea53bb460 | ||
|
|
35a5a6c16d | ||
|
|
42b438b7dc | ||
|
|
18765d0032 | ||
|
|
4aa590288b | ||
|
|
315b39c73a | ||
|
|
2225ca0a54 | ||
|
|
ad29c03711 | ||
|
|
0a4967ce0c | ||
|
|
b3d3a5ed6a | ||
|
|
4d8de33979 | ||
|
|
32629bb522 | ||
|
|
0bc972fbc2 | ||
|
|
6cc84b3c44 | ||
|
|
c5e81c51d9 | ||
|
|
cbe5d34f6f | ||
|
|
975cbbb029 | ||
|
|
f3da771890 | ||
|
|
2edfd187f2 | ||
|
|
2c8a90ef52 | ||
|
|
0de0101fdd | ||
|
|
1dbfb07c08 | ||
|
|
047737496a | ||
|
|
5b6a6f914b | ||
|
|
4fa5f90346 | ||
|
|
ebeca5bd9b | ||
|
|
9dcf45c65c | ||
|
|
030e12ec39 | ||
|
|
12bebfe0f9 | ||
|
|
28a1cdfc2e | ||
|
|
e7092bc59c | ||
|
|
87049cbf84 | ||
|
|
19ffb62903 | ||
|
|
f5778c8fbb | ||
|
|
92ec30a3b1 | ||
|
|
8a08b6457a | ||
|
|
9a2065c5ee | ||
|
|
27f08ac11d | ||
|
|
0a9afc12de | ||
|
|
a1a2ae2a25 | ||
|
|
26942c818e | ||
|
|
8ba160ba94 | ||
|
|
1ceedd0bf6 | ||
|
|
4db6127658 | ||
|
|
c4b2282fee | ||
|
|
001513c9ca | ||
|
|
162f9f87f9 | ||
|
|
9965f63a44 | ||
|
|
070a0eb58f | ||
|
|
0b4e7deab1 | ||
|
|
f1cdf4e1ca | ||
|
|
b9c62013ef | ||
|
|
415d26805a | ||
|
|
83f4c735c8 | ||
|
|
64fef09b67 | ||
|
|
9f2ad4928e | ||
|
|
0e30044094 | ||
|
|
fc8450833a | ||
|
|
6761aacbfa | ||
|
|
408dbac801 | ||
|
|
b00d986d54 | ||
|
|
305ada6672 | ||
|
|
1bef8e9799 | ||
|
|
a901eb3ce6 | ||
|
|
896c3cfb76 | ||
|
|
06509be841 | ||
|
|
81f44665cc | ||
|
|
9c7ed35a65 | ||
|
|
05e81e18d2 | ||
|
|
6ca8ee1518 | ||
|
|
59e655b020 | ||
|
|
5bd9d66098 | ||
|
|
2163c930b0 | ||
|
|
18f0bd1d63 | ||
|
|
5b9c044332 | ||
|
|
dc3069bcb1 | ||
|
|
9517f7b636 | ||
|
|
b77d929217 | ||
|
|
b939ce06be | ||
|
|
f9e37f54eb | ||
|
|
04402a9126 | ||
|
|
068cb3a64c | ||
|
|
f4302a73ac | ||
|
|
23ddeb58a5 | ||
|
|
956f295d48 | ||
|
|
61257bc2de | ||
|
|
6297297708 | ||
|
|
fd42ef9b06 | ||
|
|
a2671a7f49 | ||
|
|
fa5ba2e026 | ||
|
|
01a0e8062d | ||
|
|
5b038f83e7 | ||
|
|
efe4e5d10d | ||
|
|
d6eb4b71ac | ||
|
|
4c9c43d4d4 | ||
|
|
0cc11b86ba | ||
|
|
93b4568fc0 | ||
|
|
f6cd8f2d65 | ||
|
|
8bfcb4c7a7 | ||
|
|
eb0bf4f468 | ||
|
|
e8c554661c | ||
|
|
c3e7e7d715 | ||
|
|
1e16e8829d | ||
|
|
33a97c5c8a | ||
|
|
39be3b81da | ||
|
|
4c02a5930a | ||
|
|
2d62f7406f | ||
|
|
6530e3898d | ||
|
|
5a26171dd7 | ||
|
|
167b5e4c27 | ||
|
|
a8242fe6fb | ||
|
|
15e69748f1 | ||
|
|
268c7bf68b | ||
|
|
d8b93c29a7 | ||
|
|
b9ba8d6a57 | ||
|
|
751cee5ef1 | ||
|
|
8ba4b13c55 | ||
|
|
8b83ff3704 | ||
|
|
a472858297 | ||
|
|
682f4ba2d5 | ||
|
|
656720fb42 | ||
|
|
fd8ef4c428 | ||
|
|
4e1d299e6b | ||
|
|
0e9cd91609 | ||
|
|
52d159a784 | ||
|
|
67806d44c1 | ||
|
|
8510247b5f | ||
|
|
77becc566f | ||
|
|
e1b505cd1d | ||
|
|
e485a09e0e | ||
|
|
1fa62ae734 | ||
|
|
262c396666 | ||
|
|
59a82b40b0 | ||
|
|
e10b7e73db | ||
|
|
476250ebd2 | ||
|
|
287fb89248 | ||
|
|
e6172809bd | ||
|
|
db8704e1f4 | ||
|
|
1a73305ac2 | ||
|
|
285a9b22c7 | ||
|
|
be55943d45 | ||
|
|
e0874e1934 | ||
|
|
4cb6607c89 | ||
|
|
751eb368a8 | ||
|
|
f7654a0c61 | ||
|
|
d78eb10f29 | ||
|
|
d2a35c6088 | ||
|
|
b9e5e5f5a8 | ||
|
|
a390897ba4 | ||
|
|
4e5ac72254 | ||
|
|
9d4ea3014b | ||
|
|
f86720c6c0 | ||
|
|
c6f629ffdd | ||
|
|
81487c8b54 | ||
|
|
f6e7551f06 | ||
|
|
4293254bef | ||
|
|
867f2ec058 | ||
|
|
b26b51d154 | ||
|
|
f50b593ac0 | ||
|
|
7023d871e8 | ||
|
|
2dfcf65981 | ||
|
|
b780eba4e4 | ||
|
|
25bfb13770 | ||
|
|
1a6841c99c | ||
|
|
1d4f804bc1 | ||
|
|
89edbf8317 | ||
|
|
a008dd8344 | ||
|
|
20a2f9b9be | ||
|
|
1088f4925f | ||
|
|
b66de48b3b | ||
|
|
e6877671f1 | ||
|
|
9fbdce8fb5 | ||
|
|
f6b9c993e1 | ||
|
|
d46b570919 | ||
|
|
918d23f658 | ||
|
|
d2fedd629d | ||
|
|
2d069831fb | ||
|
|
8ee821e69a | ||
|
|
279dc3f0bf | ||
|
|
846357d592 | ||
|
|
d8d18fbb02 | ||
|
|
74428df2fd | ||
|
|
d6b1375bf5 | ||
|
|
0f12df19a1 | ||
|
|
cde3078963 | ||
|
|
216ab04994 | ||
|
|
e0f0d05938 | ||
|
|
23da29af91 | ||
|
|
ecc391bbcf | ||
|
|
c861dc8923 | ||
|
|
507a8cdc5e | ||
|
|
bd85b5713c | ||
|
|
a21a5b22c1 | ||
|
|
d344589703 | ||
|
|
218a6fe9e5 | ||
|
|
2b667e4923 | ||
|
|
c98f7fb4e3 | ||
|
|
f17e6c3046 | ||
|
|
6eecfe3886 | ||
|
|
b383798ac9 | ||
|
|
ea037b01eb | ||
|
|
04445235f1 | ||
|
|
778ccbbafa | ||
|
|
c5370ede95 | ||
|
|
2b66107abb | ||
|
|
0aabfe2a4c | ||
|
|
16f9246853 | ||
|
|
c9fd075c89 | ||
|
|
47e1315459 | ||
|
|
49fa8d4cdd | ||
|
|
a60de343a9 | ||
|
|
f2c37d0abf | ||
|
|
bc27b2f432 | ||
|
|
3645008e22 | ||
|
|
06ee532286 | ||
|
|
bbe2be3f54 | ||
|
|
bb098218ca | ||
|
|
217d38cdea | ||
|
|
377fb53944 | ||
|
|
7f85da8df7 | ||
|
|
3e0bef6da4 | ||
|
|
82511341d7 | ||
|
|
4029db9aac | ||
|
|
7011a8cec3 | ||
|
|
9a3de48b48 | ||
|
|
494e75ac83 | ||
|
|
3f49c1e42a | ||
|
|
68f4ea7423 | ||
|
|
c6b29ff896 | ||
|
|
76f93293a0 | ||
|
|
d375ca5e0d | ||
|
|
60a7506744 | ||
|
|
d3ff44f0d5 | ||
|
|
43d90b1610 | ||
|
|
de23a49231 | ||
|
|
4b65a89cf4 | ||
|
|
471b38aa00 | ||
|
|
b6c9ac6304 | ||
|
|
8cd78da8b3 | ||
|
|
8f0e2729dd | ||
|
|
c73d6219f2 | ||
|
|
6ef579df50 | ||
|
|
bd76965879 | ||
|
|
070a616b82 | ||
|
|
7a015b92b2 | ||
|
|
2f56fe4071 | ||
|
|
9d6cab3b21 | ||
|
|
04affde6a1 | ||
|
|
018b4fccb9 | ||
|
|
bba3aa9533 | ||
|
|
b6788ccaff | ||
|
|
cde8cd6b30 | ||
|
|
19ec55f40e | ||
|
|
6a6eb354ff | ||
|
|
6b5abbe58e | ||
|
|
66c1ec5a26 | ||
|
|
ecd074945c | ||
|
|
88dd30b232 | ||
|
|
10569a452f | ||
|
|
dc294204b6 | ||
|
|
06ee38423b | ||
|
|
6d8c88177a | ||
|
|
f43b5e3709 | ||
|
|
a00ea0aeae | ||
|
|
0659cddd21 | ||
|
|
66d846b0cc | ||
|
|
d040886dc4 | ||
|
|
91f9e0370d | ||
|
|
86a7eef997 | ||
|
|
530eec311d | ||
|
|
7c5d037032 | ||
|
|
ee16fc4a6f | ||
|
|
2d24cbdd98 | ||
|
|
da7a1e79af | ||
|
|
e8ef689cb9 | ||
|
|
aebb7585c9 | ||
|
|
5b9ac20297 | ||
|
|
9c05216461 | ||
|
|
d4965b4014 | ||
|
|
b8eb945946 | ||
|
|
6df21524cd | ||
|
|
fa49aae286 | ||
|
|
05e11008c0 | ||
|
|
40656e9855 | ||
|
|
7cee075a32 | ||
|
|
985dc00f1f | ||
|
|
cda68df8c1 | ||
|
|
70cb8f9a7e | ||
|
|
674c3e5816 | ||
|
|
61ea3eacb0 | ||
|
|
8e7c35fc81 | ||
|
|
234fe626af | ||
|
|
03df189954 | ||
|
|
6f2c50e7fc | ||
|
|
c9720568d0 | ||
|
|
5be76ae252 | ||
|
|
a2fe24d186 | ||
|
|
97dd654ba4 | ||
|
|
f1b547a509 | ||
|
|
5efb1327df | ||
|
|
b5113f4e70 | ||
|
|
445475a166 | ||
|
|
2eb712e519 | ||
|
|
736c8e8773 | ||
|
|
3278452323 | ||
|
|
bd3818eb1b | ||
|
|
b75c3cc415 | ||
|
|
b963feeec6 | ||
|
|
f2d4167fee | ||
|
|
5d713fe123 | ||
|
|
6b9a20e7f9 | ||
|
|
11d4a2a451 | ||
|
|
c6a8cb7d10 | ||
|
|
7f6826368a | ||
|
|
bf95fad5f5 | ||
|
|
ebba0746bc | ||
|
|
67152e75e6 | ||
|
|
4aa3f403f1 | ||
|
|
56e9307d8f | ||
|
|
eed640dbe8 | ||
|
|
edb772fd6d | ||
|
|
e557fd7c44 | ||
|
|
8ba743d8d2 | ||
|
|
279205664f | ||
|
|
f7a7bb0384 | ||
|
|
3922544139 | ||
|
|
bea9784db0 | ||
|
|
6cae24c265 | ||
|
|
06ec570881 | ||
|
|
25d240dc6e | ||
|
|
470d64c2dd | ||
|
|
d7eff5d864 | ||
|
|
a11cd84160 | ||
|
|
f56c00f050 | ||
|
|
f1a22bf9b3 | ||
|
|
a4fa1c57f4 | ||
|
|
27f0332cae | ||
|
|
9127138a30 | ||
|
|
ca9c3a601b | ||
|
|
91e3a7d735 | ||
|
|
cb4823d91f | ||
|
|
d752225d05 | ||
|
|
f1eacc08e6 | ||
|
|
6147fae405 | ||
|
|
c5dc456afd | ||
|
|
f633a4eb9c | ||
|
|
6c48f77bba | ||
|
|
4c0ded3c4e | ||
|
|
36b246a571 | ||
|
|
48e6fad71c | ||
|
|
1b3a9fd6bf | ||
|
|
b4ef94559d | ||
|
|
af557d98e1 | ||
|
|
551019baf6 | ||
|
|
77145bf678 | ||
|
|
91685564d1 | ||
|
|
44bda93154 | ||
|
|
baa95a2d49 | ||
|
|
996046aed5 | ||
|
|
e4489f1db2 | ||
|
|
3fe1616c45 | ||
|
|
0df3198719 | ||
|
|
3a05d2df0f | ||
|
|
de5e34f3ce | ||
|
|
0a3c788b51 | ||
|
|
664bd637b5 | ||
|
|
3669467347 | ||
|
|
bcd3209a42 | ||
|
|
17fba0f7d1 | ||
|
|
d55c4f32fc | ||
|
|
259fb7761d | ||
|
|
3ac41798c3 | ||
|
|
26a94ab06f | ||
|
|
83fb26e38d | ||
|
|
9782cced3a | ||
|
|
ff649a0710 | ||
|
|
389e5cbabf | ||
|
|
72e25f9583 | ||
|
|
a243ec06b0 | ||
|
|
37c3b082a7 | ||
|
|
5e6931e10a | ||
|
|
0ece631b37 | ||
|
|
3efbecab92 | ||
|
|
ae991771ad | ||
|
|
071a17f194 | ||
|
|
398b00734c | ||
|
|
8661906769 | ||
|
|
91319c67d5 | ||
|
|
c45f1223cb | ||
|
|
910aaadddb | ||
|
|
fc932f7b03 | ||
|
|
83ae6fc266 | ||
|
|
33ebeec0b5 | ||
|
|
225af8f363 | ||
|
|
151eb95305 | ||
|
|
f36a94207c | ||
|
|
212fd5745d | ||
|
|
238e7646a8 | ||
|
|
e429c66cea | ||
|
|
1a4c0144da | ||
|
|
db1a0e763f | ||
|
|
41694dcaea | ||
|
|
ff3fb08157 | ||
|
|
79b7e4e621 | ||
|
|
b41a37d403 | ||
|
|
b7afba6a0b | ||
|
|
da7b692ce0 | ||
|
|
d21eae44e7 | ||
|
|
c4e0f3de64 | ||
|
|
ee6050ecb4 | ||
|
|
165f072144 | ||
|
|
7acfe50855 | ||
|
|
5808e7b8c8 | ||
|
|
f85092bc7b | ||
|
|
d1c5f48c05 | ||
|
|
e95ce2c517 | ||
|
|
0d5ac5d809 | ||
|
|
f30aa7ed92 | ||
|
|
ab9736a647 | ||
|
|
5a1d1b5369 | ||
|
|
d5201df56b | ||
|
|
be19c07dd9 | ||
|
|
0ace9f589f | ||
|
|
72855fb11e | ||
|
|
9f1aa186e6 | ||
|
|
7a0ca967b4 | ||
|
|
478062d9b5 | ||
|
|
86b8016ee9 | ||
|
|
f169806b7b | ||
|
|
c4b3718856 | ||
|
|
fa26eb1678 | ||
|
|
d17313e075 | ||
|
|
6b570f11e1 | ||
|
|
804c76b47b | ||
|
|
247d262d3a | ||
|
|
9ab7b4ca58 | ||
|
|
ae6eaa89e5 | ||
|
|
82200daec2 | ||
|
|
6572c7dab5 | ||
|
|
372cad05a9 | ||
|
|
010222c55d | ||
|
|
d74d82137b | ||
|
|
a518abd582 | ||
|
|
23646318e4 | ||
|
|
149eea29b6 | ||
|
|
2ca2a0b222 | ||
|
|
7017c4078d | ||
|
|
c2a15d01af | ||
|
|
0464b436b6 | ||
|
|
2f5fb84cc4 | ||
|
|
33e2bd910f | ||
|
|
05670156f3 | ||
|
|
b65b3412b1 | ||
|
|
71d23c4d6e | ||
|
|
1cc02f0395 | ||
|
|
4df37bfa4f | ||
|
|
c978642c48 | ||
|
|
24afd07ab9 | ||
|
|
c540d8bed7 | ||
|
|
3e5d04df37 | ||
|
|
6e8ba0fab6 | ||
|
|
b3a765066f | ||
|
|
4c7bb07857 | ||
|
|
b8f433417f | ||
|
|
53c60fa94b | ||
|
|
ab56b743c1 | ||
|
|
3455238a4e | ||
|
|
9f0ac8548b | ||
|
|
2fff8078dc | ||
|
|
da7027b6b0 | ||
|
|
9e06534572 | ||
|
|
be040c98f8 | ||
|
|
bd792c020f | ||
|
|
079a724833 | ||
|
|
1301356273 | ||
|
|
78c28fea51 | ||
|
|
45625eceb4 | ||
|
|
e3ae583514 | ||
|
|
eb657ae68f | ||
|
|
f5df058bee | ||
|
|
dd6679dce8 | ||
|
|
9c5a1baea5 | ||
|
|
37b7299b60 | ||
|
|
0b61d10ad4 | ||
|
|
dba54b8888 | ||
|
|
38ef9c9779 | ||
|
|
103b04170d | ||
|
|
e40e37018d | ||
|
|
9eec159ab0 | ||
|
|
414d7b5f7d | ||
|
|
685dff485e | ||
|
|
8a227ff25a | ||
|
|
a710317d2f | ||
|
|
3e753eb8b2 | ||
|
|
759c903686 | ||
|
|
8c12078e95 | ||
|
|
b91528db20 | ||
|
|
2f1dede991 | ||
|
|
5af0307f11 | ||
|
|
efaaad7447 | ||
|
|
bda94b1005 | ||
|
|
4250328102 | ||
|
|
bb6e0a2db3 | ||
|
|
41633d33c4 | ||
|
|
88cf760b07 | ||
|
|
4ea97d8bc7 | ||
|
|
bef206b0a8 | ||
|
|
b94db2eb34 | ||
|
|
3f7a169c2d | ||
|
|
bc79c250e9 | ||
|
|
3cc9e8ff96 | ||
|
|
95a197397f | ||
|
|
d0479d24a0 | ||
|
|
1fc0171278 | ||
|
|
a8472470a4 | ||
|
|
88ecac68be | ||
|
|
e51ba2eff4 | ||
|
|
a80e864faa | ||
|
|
1d3c990425 | ||
|
|
79f0ba499f | ||
|
|
74e84d0f7d | ||
|
|
4568762d28 | ||
|
|
0740c62700 | ||
|
|
38f49403bd | ||
|
|
8f1150eb75 | ||
|
|
c10930a4fc | ||
|
|
bff81bdddc | ||
|
|
339ef1ec97 | ||
|
|
be3977de2c | ||
|
|
67f101e6c9 | ||
|
|
b6f0a641cb | ||
|
|
81dfd007b2 | ||
|
|
1f23775d10 | ||
|
|
84092bbf29 | ||
|
|
1658e602c6 | ||
|
|
83b132f14d | ||
|
|
1f63da349b | ||
|
|
44db02364e | ||
|
|
3f8a2ed600 | ||
|
|
30145f29c5 | ||
|
|
d56af331e1 | ||
|
|
1c6e5f8caa | ||
|
|
27ae9362d8 | ||
|
|
88507b4ef9 | ||
|
|
0f6303301f | ||
|
|
aaf1bb1ae1 | ||
|
|
b5596712fc | ||
|
|
503a49458b | ||
|
|
c912050a7b | ||
|
|
113213416c | ||
|
|
bd757acf26 | ||
|
|
a7f0bcb3a6 | ||
|
|
7976b3c3e3 | ||
|
|
012d36f643 | ||
|
|
68dfa9e526 | ||
|
|
416bb9320f | ||
|
|
f2b8961f58 | ||
|
|
6a3805c25b | ||
|
|
0e60f06b7c | ||
|
|
cf247ebffe | ||
|
|
a066d49b01 | ||
|
|
0ea69cdfa9 | ||
|
|
8bf54399a3 | ||
|
|
4da9d314bc | ||
|
|
08b0620202 | ||
|
|
dee5a914fc | ||
|
|
d2d09e5bf9 | ||
|
|
03eafe24ed | ||
|
|
e9a8fb8d07 | ||
|
|
fd8bba4b80 | ||
|
|
bb9adfdad9 | ||
|
|
393d3c8285 | ||
|
|
9450ffb26d | ||
|
|
ed049010b1 | ||
|
|
db9d96840d | ||
|
|
9e9977e153 | ||
|
|
681b731151 | ||
|
|
83a841ab7c | ||
|
|
85c2ec9a69 | ||
|
|
cf644fa901 | ||
|
|
17ad121e93 | ||
|
|
19e4edaf3f | ||
|
|
e1540e3b4c | ||
|
|
063eb1b497 | ||
|
|
fecdd46639 | ||
|
|
0e036921aa | ||
|
|
e827fa24a0 | ||
|
|
34ac3691cb | ||
|
|
236e105170 | ||
|
|
5b1df53a82 | ||
|
|
940b37b197 | ||
|
|
0441ff62e7 | ||
|
|
de723276e5 | ||
|
|
2464dbfe4c | ||
|
|
b3721757a0 | ||
|
|
cc93d89e43 | ||
|
|
8f381901e3 | ||
|
|
15a80443de | ||
|
|
6f8f004fe1 | ||
|
|
873f16fe2f | ||
|
|
7ae451f527 | ||
|
|
391459424e | ||
|
|
05f3788b7a | ||
|
|
53ae7dc514 | ||
|
|
cd6a3ef31f | ||
|
|
90e288241d | ||
|
|
209d3eb5c6 | ||
|
|
d42dc54df5 | ||
|
|
877afaf17e | ||
|
|
8c49ddcf56 | ||
|
|
5680f5d6f2 | ||
|
|
324402044f | ||
|
|
685d79e27a | ||
|
|
52083f9152 | ||
|
|
7191f6e9e6 | ||
|
|
4dcbf24d82 | ||
|
|
492e67163e | ||
|
|
5881b11629 | ||
|
|
fca68966b2 | ||
|
|
847e9efb66 | ||
|
|
db56fa18c2 | ||
|
|
bc8e40d611 | ||
|
|
2b87a54d07 | ||
|
|
b23afad4a1 | ||
|
|
f5d7f438e5 | ||
|
|
b4ec1f8451 | ||
|
|
f5f1206778 | ||
|
|
497e7319f4 | ||
|
|
d5dd93f5d1 | ||
|
|
7f9a49aa65 | ||
|
|
573c9d434f | ||
|
|
56a1a66656 | ||
|
|
d992e05da8 | ||
|
|
870beb5279 | ||
|
|
b0d97356ce | ||
|
|
04d4e38ac2 | ||
|
|
67a46d17d8 | ||
|
|
bbc29a858d | ||
|
|
3948b94700 | ||
|
|
746bc7d883 | ||
|
|
f260f6d156 | ||
|
|
18dd07e3e6 | ||
|
|
0486b17fbd | ||
|
|
aa22442a9c | ||
|
|
4a43182924 | ||
|
|
810b6e51e4 | ||
|
|
88610994da | ||
|
|
1b9b970598 | ||
|
|
43f0311b57 | ||
|
|
421f95deb5 | ||
|
|
f96251291d | ||
|
|
cafa0eebb9 | ||
|
|
afd6cecb76 | ||
|
|
61dbc4c608 | ||
|
|
bea86bba24 | ||
|
|
7fc85a3f46 | ||
|
|
bb8d4f76f4 | ||
|
|
b79c98e57c | ||
|
|
4cf2465c71 | ||
|
|
4ea93e69bc | ||
|
|
ff141eb21e | ||
|
|
122bec17f2 | ||
|
|
9afb90f885 | ||
|
|
34b7d62488 | ||
|
|
3f2b5a6670 | ||
|
|
294d0b8408 | ||
|
|
62c6fbbd29 | ||
|
|
0c7ac064d3 | ||
|
|
db67cba8d4 | ||
|
|
2aa6c96e5d | ||
|
|
2fd3434fa4 | ||
|
|
2c0833e265 | ||
|
|
127b08a265 | ||
|
|
0f42908c0a | ||
|
|
f18a28cc13 | ||
|
|
56d6bc2e88 | ||
|
|
61946e0f56 | ||
|
|
49f9c24910 | ||
|
|
c62fda06a3 | ||
|
|
cd62215d61 | ||
|
|
ac09cd0fec | ||
|
|
529045cf26 | ||
|
|
a4f7ea0d11 | ||
|
|
7b1da52549 | ||
|
|
34d20f482f | ||
|
|
399430dac2 | ||
|
|
3f677d1c65 | ||
|
|
809355b4aa | ||
|
|
7fd71746d0 | ||
|
|
0ee3465fba | ||
|
|
a793120405 | ||
|
|
9bdba4e630 | ||
|
|
a74b70871c | ||
|
|
0d50d6562c | ||
|
|
453fbf942c | ||
|
|
6e1c74b39b | ||
|
|
fdc2d5f38f | ||
|
|
67a289ffa9 | ||
|
|
bf15ac7e86 | ||
|
|
7ef0c46488 | ||
|
|
8d9e494dfb | ||
|
|
0794df4062 | ||
|
|
7a69beda7b | ||
|
|
e4413a735b | ||
|
|
7fdb594e73 | ||
|
|
f1736a636b | ||
|
|
3b4c60f26b | ||
|
|
5c55ccdf4f | ||
|
|
5ec05b3d7c | ||
|
|
70eb0720a0 | ||
|
|
9bb775fc8c | ||
|
|
a8715cabd1 | ||
|
|
364acf40aa | ||
|
|
b44cd59ad9 | ||
|
|
e2d8e11407 | ||
|
|
43c07e1b48 | ||
|
|
2e0c5f0dff | ||
|
|
3a83aa328d | ||
|
|
41db297e63 | ||
|
|
5087805e7c | ||
|
|
4e6e2166a5 | ||
|
|
1affc5622b | ||
|
|
cd1cd2dafc | ||
|
|
caa3f296df | ||
|
|
2286a7cef4 | ||
|
|
3c8b422b0a | ||
|
|
0645b62528 | ||
|
|
0281dee877 | ||
|
|
e55b25a962 | ||
|
|
14638c1f20 | ||
|
|
59ae38984f | ||
|
|
1f24cb74f2 | ||
|
|
1cbfa24a93 | ||
|
|
8c87dc88d6 | ||
|
|
f3728100d9 | ||
|
|
e15b537825 | ||
|
|
e57f094fd6 | ||
|
|
4ea113b7f0 | ||
|
|
871b1d0fab | ||
|
|
f3af706c2a | ||
|
|
96cf4bde0e | ||
|
|
1118d6d985 | ||
|
|
e444514a94 | ||
|
|
efda7376c8 | ||
|
|
ccec786ca7 | ||
|
|
2621be1bdb | ||
|
|
45bb4530fd | ||
|
|
a97fc46e43 | ||
|
|
3fa1893804 | ||
|
|
f8a8ead5cb | ||
|
|
6df55cece7 | ||
|
|
09a5ca72ac | ||
|
|
0cc3e9e38c | ||
|
|
adb9613699 | ||
|
|
c0a0d4a6d2 | ||
|
|
2bad851ab3 | ||
|
|
f2350f3987 | ||
|
|
b4ef7c4af2 | ||
|
|
9e8fd50d76 | ||
|
|
ea3288f1c5 | ||
|
|
cc074dcaa6 | ||
|
|
3b8e7e869d | ||
|
|
765d145ec4 | ||
|
|
c9b11ff0d4 | ||
|
|
23a101e06d | ||
|
|
b724c812ec | ||
|
|
0695fcd834 | ||
|
|
42835d3d19 | ||
|
|
2d99978f67 | ||
|
|
9d2e875826 | ||
|
|
0da9cf38cd | ||
|
|
681de8c8dc | ||
|
|
c53778ff53 | ||
|
|
44db2cfb15 | ||
|
|
6db8e4dd11 | ||
|
|
88c5a2a068 | ||
|
|
bf9f74b657 | ||
|
|
0d270082d2 | ||
|
|
d000fb89c0 | ||
|
|
9fabbedcf3 | ||
|
|
d7dc03e371 | ||
|
|
b8d0534e9d | ||
|
|
f88ac51a2e | ||
|
|
bbac5e692f | ||
|
|
a4081f2990 | ||
|
|
1f8e81738a | ||
|
|
9002f5b1f0 | ||
|
|
f5a83fb2b3 | ||
|
|
154de9398a | ||
|
|
777044a856 | ||
|
|
fe5c8b9755 | ||
|
|
8d391c6cea | ||
|
|
32d6a74293 | ||
|
|
806477742a | ||
|
|
d14caad2e9 | ||
|
|
29890b0439 | ||
|
|
9f860f59d9 | ||
|
|
f8aa57e791 | ||
|
|
4567935fe4 | ||
|
|
2414bd99d8 | ||
|
|
1f76e62d6c | ||
|
|
e208108dfc | ||
|
|
590c8b0987 | ||
|
|
c5c8b542fb | ||
|
|
91a7ad9d2b | ||
|
|
9dd2bfafe5 | ||
|
|
ba35f1e4c1 | ||
|
|
5851280929 | ||
|
|
1c6e22a360 | ||
|
|
37109a9f5b | ||
|
|
a70216aa60 | ||
|
|
9477ecdfa6 | ||
|
|
408652acaf | ||
|
|
744f041adf | ||
|
|
86c739e8bc | ||
|
|
00634fdac8 | ||
|
|
79ee877fb4 | ||
|
|
e9d616321a | ||
|
|
24639a63ce | ||
|
|
5362c9d5e5 | ||
|
|
b6bfd40da2 | ||
|
|
a1d32d08e1 | ||
|
|
350cbf14df | ||
|
|
7bde6e23bb | ||
|
|
5d9dc4563f | ||
|
|
aa41547a4d | ||
|
|
8c3d4f387a | ||
|
|
6e265d137c | ||
|
|
7b26920d9b | ||
|
|
785a8b1505 | ||
|
|
6cf32b460f | ||
|
|
f758d6c813 | ||
|
|
5c2d76fdef | ||
|
|
e4f124e335 | ||
|
|
1f84bd7000 | ||
|
|
b76ab1260d | ||
|
|
026b295698 | ||
|
|
eb8e19baa3 | ||
|
|
661bc6f6b0 | ||
|
|
6dae6d8f3b | ||
|
|
5b9a28f2b8 | ||
|
|
5f4b95e513 | ||
|
|
70850fce0c | ||
|
|
9d1ddbb78f | ||
|
|
f2aacefb3f | ||
|
|
4314d63792 | ||
|
|
7b3eefbcfd | ||
|
|
bb39dc545c | ||
|
|
520803d57e | ||
|
|
7f912dbeb5 | ||
|
|
ab1477d662 | ||
|
|
f0fb1746b0 | ||
|
|
f8dfd123e2 | ||
|
|
e6b710cb3f | ||
|
|
be85fa6027 | ||
|
|
43648b02bc | ||
|
|
75fde9e99a | ||
|
|
9a82547afe | ||
|
|
a9f44be8c2 | ||
|
|
e15b1e8136 | ||
|
|
fa63beaa34 | ||
|
|
c39be26f5a | ||
|
|
c2ac10b502 | ||
|
|
6ae34790cc | ||
|
|
8de49d0921 | ||
|
|
48cbba8e8e | ||
|
|
b257147015 | ||
|
|
73f826cb49 | ||
|
|
933bc842ac | ||
|
|
329d033d25 | ||
|
|
9c06d78468 | ||
|
|
b98681b49a | ||
|
|
53f7051b1b | ||
|
|
d099973c4f | ||
|
|
97a77a6f7b | ||
|
|
b2aba47a6d | ||
|
|
ed3ca0e3eb | ||
|
|
fd043e5d0d | ||
|
|
cc02f89eb2 | ||
|
|
14d0ca620e | ||
|
|
8010217201 | ||
|
|
702053d110 | ||
|
|
74a9c07fdd | ||
|
|
d0eef28ee1 | ||
|
|
3c1f6983c5 | ||
|
|
4a6c6df6c7 | ||
|
|
025d415838 | ||
|
|
810c99583b | ||
|
|
e9567514dd | ||
|
|
b593b3f035 | ||
|
|
0f08665bfb | ||
|
|
3744f94fd1 | ||
|
|
aa9dea57d7 | ||
|
|
ece07cfe9c | ||
|
|
dbb7e19fda | ||
|
|
e2098ba085 | ||
|
|
26849f4693 | ||
|
|
ad5a993954 | ||
|
|
6954141484 | ||
|
|
ba2dd33d9c | ||
|
|
134c5761fa | ||
|
|
865e14fd32 | ||
|
|
5d1df4fdf4 | ||
|
|
8d3453a22d | ||
|
|
4430b91363 | ||
|
|
dff6f4c4f0 | ||
|
|
432c174b64 | ||
|
|
5f5977e708 | ||
|
|
0a9f8eb272 | ||
|
|
cad0150d12 | ||
|
|
ee427ad39a | ||
|
|
01b813000a | ||
|
|
449db5a9c1 | ||
|
|
80b67e47e8 | ||
|
|
0a9f26e219 | ||
|
|
05ed18e7d1 | ||
|
|
c86cf4b7e4 | ||
|
|
edb3523a9b | ||
|
|
46cb5109bd | ||
|
|
5845d3eabd | ||
|
|
4a37149f66 | ||
|
|
fc58b17772 | ||
|
|
96b917056d | ||
|
|
981560ae60 | ||
|
|
0546e4e579 | ||
|
|
05af5cd8fb | ||
|
|
d630301d99 | ||
|
|
2ec8409046 | ||
|
|
905cc94e3d | ||
|
|
8f424b8270 | ||
|
|
cc46157421 | ||
|
|
14ca47b453 | ||
|
|
b1e7771d5e | ||
|
|
ff7b7ba060 | ||
|
|
1935d0738f | ||
|
|
04c1c078b9 | ||
|
|
8f4d67218e | ||
|
|
15f6fd3492 | ||
|
|
b45416921b | ||
|
|
040575c80b | ||
|
|
43309056ac | ||
|
|
bc2a57f657 | ||
|
|
56f22f4320 | ||
|
|
cd39adb561 | ||
|
|
b4f5c42092 | ||
|
|
e243a1fbd8 | ||
|
|
747b554a86 | ||
|
|
f229d4df3a | ||
|
|
96027d919f | ||
|
|
d5a80e0944 | ||
|
|
58f277c18e | ||
|
|
921648a997 | ||
|
|
23a30f8583 | ||
|
|
48015617d3 | ||
|
|
13a87d9682 | ||
|
|
c1217ee280 | ||
|
|
51d1e2be1b | ||
|
|
f7677a348e | ||
|
|
8fbd60ded2 | ||
|
|
b11b31aea2 | ||
|
|
5a13159bfc | ||
|
|
51624965e2 | ||
|
|
ce9d8a3f48 | ||
|
|
eda53e5770 | ||
|
|
2bc76ffaf1 | ||
|
|
66efa24241 | ||
|
|
0c11b5f8e7 | ||
|
|
f5dcba6b9b | ||
|
|
c26d6e9aac | ||
|
|
42ed02ed9a | ||
|
|
31d66245ea | ||
|
|
d9d7a7e8f0 | ||
|
|
d15d124d6d | ||
|
|
dd6ecbe688 | ||
|
|
aa816c4444 | ||
|
|
209b3e4b79 | ||
|
|
f2715a558a | ||
|
|
845ee6af72 | ||
|
|
9ff37ea94f | ||
|
|
35f2e1768b | ||
|
|
945cb1f9be | ||
|
|
ae1b45a046 | ||
|
|
71db131882 | ||
|
|
bf7661f01b | ||
|
|
9066919600 | ||
|
|
1ffbe8c7c1 | ||
|
|
8d0215928d | ||
|
|
b5d0051dcb | ||
|
|
6038b80277 | ||
|
|
187694b9ec | ||
|
|
b57c1c9e6e | ||
|
|
0c98cc7023 | ||
|
|
6225b0e61e | ||
|
|
d072048925 | ||
|
|
7d4fbb2fbb | ||
|
|
42a2b556e9 | ||
|
|
e2ae0f2f2b | ||
|
|
d6cf3a3791 | ||
|
|
e741cd592e | ||
|
|
0ae4f7b705 | ||
|
|
29a6ba01a7 | ||
|
|
434801a39c | ||
|
|
79a141876a | ||
|
|
eeb1bb678d | ||
|
|
8e92cd51c6 | ||
|
|
363387c9c0 | ||
|
|
6f237b6bf0 | ||
|
|
a0ddf0b5f2 | ||
|
|
5541ea8aaf | ||
|
|
cf49919686 | ||
|
|
363ae65e2b | ||
|
|
cb129a6234 | ||
|
|
dee7577330 | ||
|
|
1c25b9b06b | ||
|
|
0a92b23c4b | ||
|
|
5408b613f8 | ||
|
|
b7e32059d3 | ||
|
|
faf38eea03 | ||
|
|
9eb125e927 | ||
|
|
203e6dd7cf | ||
|
|
16bb03b8b4 | ||
|
|
df44c4c4d9 | ||
|
|
4690b89eaa | ||
|
|
10c0693210 | ||
|
|
3484a760f4 | ||
|
|
715423c8d6 | ||
|
|
d57dc304c4 | ||
|
|
17ba5de88f | ||
|
|
8a2033d77f | ||
|
|
932d7ac5e9 | ||
|
|
f9accb9df2 | ||
|
|
7a4e497b62 | ||
|
|
0207529f27 | ||
|
|
7d5bf79d88 | ||
|
|
a4badc4b50 | ||
|
|
b0606ea043 | ||
|
|
566fb611b6 | ||
|
|
c737b7cf70 | ||
|
|
67dba43998 | ||
|
|
bce7988230 | ||
|
|
a08f60352c | ||
|
|
0bddb27e75 | ||
|
|
864270e18f | ||
|
|
74df4f1956 | ||
|
|
a67ddd4b9f | ||
|
|
aa725a375c | ||
|
|
5578c3719e | ||
|
|
ce3c7330ba | ||
|
|
c8348f80d5 | ||
|
|
612d52afce | ||
|
|
a7e9d7bfc2 | ||
|
|
28c3a2f9f9 | ||
|
|
df0773c1b9 | ||
|
|
3449169622 | ||
|
|
ead660ae1e | ||
|
|
04afaab56a | ||
|
|
781a90b358 | ||
|
|
61d7058b5b | ||
|
|
db6850b389 | ||
|
|
eda298bc01 | ||
|
|
516c9c97a6 | ||
|
|
902dbe619e | ||
|
|
0f59bbb5b6 | ||
|
|
0d4d0b4d32 | ||
|
|
5bffd6c6d5 | ||
|
|
816ff328d2 | ||
|
|
34dca8f8e8 | ||
|
|
3167541570 | ||
|
|
6437604a5e | ||
|
|
2dd49fbeae | ||
|
|
f1c0678c16 | ||
|
|
42369ccd85 | ||
|
|
572b078d8c | ||
|
|
40ca77a721 | ||
|
|
05cbe5ae28 | ||
|
|
5cdff4144e | ||
|
|
feecc898d9 | ||
|
|
3a1d63dc69 | ||
|
|
573a51143a | ||
|
|
6690011811 | ||
|
|
dde1f98626 | ||
|
|
aaf1179ec1 | ||
|
|
e044649282 | ||
|
|
a23f3dbcb6 | ||
|
|
a12d2328b4 | ||
|
|
95a8a665e4 | ||
|
|
9ca5f1bdc8 | ||
|
|
9f01d0d665 | ||
|
|
da544d7d3e | ||
|
|
da2194c0d5 | ||
|
|
1eb2c48458 | ||
|
|
8fb6c6a9b3 | ||
|
|
9c7f99c9cb | ||
|
|
99c7ad2904 | ||
|
|
e7b4d26ec1 | ||
|
|
c35f888c46 | ||
|
|
5635573cfc | ||
|
|
fea2a877c8 | ||
|
|
5bc90389bf | ||
|
|
2312167d51 | ||
|
|
edbcd02133 | ||
|
|
04336ba10f | ||
|
|
ea8d0b9408 | ||
|
|
da1c5ca65a | ||
|
|
00c6a9a62c | ||
|
|
665031e834 | ||
|
|
0501c1c570 | ||
|
|
1531bd61a0 | ||
|
|
d9fc0622a1 | ||
|
|
6e4184249c | ||
|
|
04ab33560f | ||
|
|
0522f269e0 | ||
|
|
fcd301daed | ||
|
|
4f67e40898 | ||
|
|
f87ef8bcb5 | ||
|
|
a5bf4e3767 | ||
|
|
5d56786eff | ||
|
|
d7c22fb7ec | ||
|
|
939310bac1 | ||
|
|
29fca0d497 | ||
|
|
df477e4652 | ||
|
|
5a956a7a58 | ||
|
|
67ee8cee39 | ||
|
|
28d9339777 | ||
|
|
bc79d70965 | ||
|
|
40b2603687 | ||
|
|
ad41b8838a | ||
|
|
1d7f56ab64 | ||
|
|
3c1c95399b | ||
|
|
d332c67da7 | ||
|
|
9287447cef | ||
|
|
b74fb4e49c | ||
|
|
a6f369b150 | ||
|
|
13831bc06e | ||
|
|
adf049e435 | ||
|
|
681c1fc02a | ||
|
|
ba6fbc57ba | ||
|
|
d1dceee2f7 | ||
|
|
94531034cc | ||
|
|
751a93f3ec | ||
|
|
0b3634bcc4 | ||
|
|
efaeadaa86 | ||
|
|
d35a3a826e | ||
|
|
c4f94cbd08 | ||
|
|
26aad85204 | ||
|
|
e23fedc9de | ||
|
|
cd3f5bb507 | ||
|
|
c4081f05c8 | ||
|
|
eb26ee6602 | ||
|
|
b0270a9e47 | ||
|
|
52cbf46f30 | ||
|
|
d61b42c81d | ||
|
|
90a87c8853 | ||
|
|
12924f33bd | ||
|
|
8fd9c16642 | ||
|
|
e22ea758e4 | ||
|
|
ec6d6fa51b | ||
|
|
f22c0ac2a5 | ||
|
|
4f547b7177 | ||
|
|
1f0eaa046c | ||
|
|
c4fe32016c | ||
|
|
1be5c22e5c | ||
|
|
956c0599e6 | ||
|
|
97c8fbb949 | ||
|
|
a50ce74850 | ||
|
|
6bdefdd977 | ||
|
|
405a398b3e | ||
|
|
8888ea4479 | ||
|
|
8973ee17bb | ||
|
|
2e31b96a5a | ||
|
|
0b26ac5dee | ||
|
|
0222124801 | ||
|
|
414769b415 | ||
|
|
5e934ba900 | ||
|
|
b72bc15e22 | ||
|
|
4c7e8208b6 | ||
|
|
baeb6d1e92 | ||
|
|
2ddb252d07 | ||
|
|
61b23d59b1 | ||
|
|
cc1fa5df3a | ||
|
|
7455cbf47e | ||
|
|
cc5664ddad | ||
|
|
87fadd5eee | ||
|
|
e209df47c4 | ||
|
|
5b79cd52f4 | ||
|
|
36082cffcd | ||
|
|
e1bb124baa | ||
|
|
585f8b49b5 | ||
|
|
4491fa237f | ||
|
|
15ea1fa337 | ||
|
|
12fb29f951 | ||
|
|
8500b7720b | ||
|
|
e7ad104ac3 | ||
|
|
3b1f03084e | ||
|
|
680da02ade | ||
|
|
8e83631361 | ||
|
|
8501129c17 | ||
|
|
3706d730d1 | ||
|
|
925a60278e | ||
|
|
29fca795b9 | ||
|
|
bd2fa5def6 | ||
|
|
36251d3f76 | ||
|
|
d92c1fcd55 | ||
|
|
4af7710f94 | ||
|
|
7e97c182a8 | ||
|
|
e0bcbfd0fd | ||
|
|
17878c6e65 | ||
|
|
7006dc4c6a | ||
|
|
c4253c4683 | ||
|
|
4fa96a42f7 | ||
|
|
c2d8399581 | ||
|
|
18c5cfafeb | ||
|
|
36f5884359 | ||
|
|
e7acc6ac3d | ||
|
|
76b0459fdd | ||
|
|
ae41dc55a2 | ||
|
|
45bb9a62ba | ||
|
|
89c2f84287 | ||
|
|
ed9f84475d | ||
|
|
1eb188932b | ||
|
|
8596468e51 | ||
|
|
c32de8c64d | ||
|
|
6d8e090419 | ||
|
|
816e687de8 | ||
|
|
0a521d3785 | ||
|
|
d3feb52955 | ||
|
|
65f3ac192b | ||
|
|
4be12aa1e3 | ||
|
|
84b0da9c94 | ||
|
|
e6fb691c49 | ||
|
|
d4973837b2 | ||
|
|
dd81915d5b | ||
|
|
3615d03e05 | ||
|
|
e0a6c06bfd | ||
|
|
efc4b69767 | ||
|
|
7875d534cb | ||
|
|
92a1d46c8d | ||
|
|
7de02e722f | ||
|
|
61bd4f76ad | ||
|
|
8b67ee5d3d | ||
|
|
fc45f68623 | ||
|
|
a004e23a4c | ||
|
|
88bcdc269b | ||
|
|
aad7c828b2 | ||
|
|
5a9aca17df | ||
|
|
55e85c24b4 | ||
|
|
fcc0263191 | ||
|
|
1d8b75550f | ||
|
|
aff44028ba | ||
|
|
6d7705eedf | ||
|
|
d3a94802d8 | ||
|
|
2b7d730e27 | ||
|
|
bc6726bc04 | ||
|
|
1876366b17 | ||
|
|
c94b996af8 | ||
|
|
0e9f8ced1e | ||
|
|
7342fcaf92 | ||
|
|
92ef313c77 | ||
|
|
cb75699dff | ||
|
|
122a525c83 | ||
|
|
5e823c1fd5 | ||
|
|
8db19980fa | ||
|
|
ef02d563a3 | ||
|
|
b2068640d1 | ||
|
|
93254f66fc | ||
|
|
52093f1776 | ||
|
|
0654d63196 | ||
|
|
4e8aa822dc | ||
|
|
1c42276a39 | ||
|
|
c9e27d026d | ||
|
|
e7db181e5d | ||
|
|
f5c5e53bf5 | ||
|
|
ecb3ad035a | ||
|
|
fb5b3ac013 | ||
|
|
5b84901c55 | ||
|
|
57cbcf6b8f | ||
|
|
07772cba07 | ||
|
|
5c1905caae | ||
|
|
d58251b47e | ||
|
|
d3dcb463d6 | ||
|
|
3dbfd300ff | ||
|
|
ff36991ca2 | ||
|
|
5b3b54e3f6 | ||
|
|
ba55c0770b | ||
|
|
4e68aa7e40 | ||
|
|
76b62317b5 | ||
|
|
4dd0dc6399 | ||
|
|
8be28e3eb6 | ||
|
|
ac8375d000 | ||
|
|
65c0339b5c | ||
|
|
4daae30174 | ||
|
|
d5bc89ef11 | ||
|
|
fa7d7934f6 | ||
|
|
59d3ef11ed | ||
|
|
a92a212925 | ||
|
|
435cf87469 | ||
|
|
e51916c0f9 | ||
|
|
997b193f63 | ||
|
|
e29c4b9b93 | ||
|
|
8e25a61277 | ||
|
|
f573ff7792 | ||
|
|
1a16735ce7 | ||
|
|
d02d6a1c7d | ||
|
|
968c231cc8 | ||
|
|
bb5cb1476b | ||
|
|
115020d985 | ||
|
|
3e2263abf2 | ||
|
|
d71f09df4d | ||
|
|
0a456b5d16 | ||
|
|
d3261115a8 | ||
|
|
673a1166fe | ||
|
|
853afe631c | ||
|
|
fe85bafedf | ||
|
|
751561218f | ||
|
|
f0c19e6455 | ||
|
|
ccff383d44 | ||
|
|
f3f7e14727 | ||
|
|
3c2ae60f46 | ||
|
|
95ba417c82 | ||
|
|
b6e4d58e4b | ||
|
|
ef43c17bfe | ||
|
|
6bc7fc80da | ||
|
|
ad8b7b71b4 | ||
|
|
83bd94f1f4 | ||
|
|
63071acbd9 | ||
|
|
44271398bd | ||
|
|
90cd362a87 | ||
|
|
b293334e7a | ||
|
|
4ae297867d | ||
|
|
ec3ff78f70 | ||
|
|
6d62ef108a | ||
|
|
b6874f8062 | ||
|
|
8b8aacde83 | ||
|
|
bbd17bd7c4 | ||
|
|
b5cebba675 | ||
|
|
736f40f459 | ||
|
|
0c03fc6f75 | ||
|
|
e61e403d20 | ||
|
|
9d824eb166 | ||
|
|
75d5bfda5b | ||
|
|
9b979b177b | ||
|
|
7b9796539d | ||
|
|
0bc79772c8 | ||
|
|
a45ffbefb9 | ||
|
|
99ffac0838 | ||
|
|
6c98897a64 | ||
|
|
b17c75b222 | ||
|
|
d4e1ddb631 | ||
|
|
aab2aa196d | ||
|
|
03d6b482b5 | ||
|
|
4dcce66295 | ||
|
|
7a28724e6b | ||
|
|
a5bcab7854 | ||
|
|
0a007b743e | ||
|
|
e9ef47f69e | ||
|
|
0532aca928 | ||
|
|
5a77e672e1 | ||
|
|
c2891d0011 | ||
|
|
5b03469a93 | ||
|
|
25e0f55586 | ||
|
|
ce775cc851 | ||
|
|
d0797f5b53 | ||
|
|
a5e5547679 | ||
|
|
f5b9abde98 | ||
|
|
4164c6f949 | ||
|
|
4b2237a6a4 | ||
|
|
340c9b237b | ||
|
|
cb47e20509 | ||
|
|
d3a0b23c1b | ||
|
|
ab38979670 | ||
|
|
628b632419 | ||
|
|
fb2bd00859 | ||
|
|
5109688803 | ||
|
|
8fdd2fcef6 | ||
|
|
e7625063dc | ||
|
|
d404b6d488 | ||
|
|
38404a5996 | ||
|
|
05fc4ccd30 | ||
|
|
24f40e321c | ||
|
|
78bb9dafe1 | ||
|
|
4fca25504e | ||
|
|
9daf91ed5c | ||
|
|
fcd7c13ffd | ||
|
|
0bb898a885 | ||
|
|
5bcd0a8c14 | ||
|
|
61a2d8a2a7 | ||
|
|
8d261262d9 | ||
|
|
af96543688 | ||
|
|
c4a8214b77 | ||
|
|
34f5449736 | ||
|
|
4e47be74e9 | ||
|
|
314ef3e72b | ||
|
|
aee83b43d6 | ||
|
|
9a1e2232ba | ||
|
|
6da2f2d92a | ||
|
|
24145c8869 | ||
|
|
e6a8060a71 | ||
|
|
98f053edbd | ||
|
|
581d29d4c9 | ||
|
|
484a48e221 | ||
|
|
66b942ce16 | ||
|
|
86cf9b2e89 | ||
|
|
fb29e51dbd | ||
|
|
ab63dd0892 | ||
|
|
a7428d443c | ||
|
|
857dbbe7cc | ||
|
|
3fb7c07ea5 | ||
|
|
60d7c022e5 | ||
|
|
850769f787 | ||
|
|
5f0b9276ec | ||
|
|
733b131545 | ||
|
|
ef217b76a3 | ||
|
|
b0791f75ad | ||
|
|
039ad872fe | ||
|
|
903c64dce8 | ||
|
|
8f4edd07be | ||
|
|
be720edba7 | ||
|
|
140504b11a | ||
|
|
cd3b0cc4d9 | ||
|
|
06a9684cfa | ||
|
|
45599ad00f | ||
|
|
677819fe66 | ||
|
|
2232baa41b | ||
|
|
7dffa41643 | ||
|
|
550bab03fb | ||
|
|
413138a5ca | ||
|
|
74945f2f04 | ||
|
|
97039baa88 | ||
|
|
fd73d04515 | ||
|
|
141d9e3c20 | ||
|
|
0cb906d804 | ||
|
|
b704036531 | ||
|
|
6f55ee2ec5 | ||
|
|
6a1dc2329a | ||
|
|
59a6c379dd | ||
|
|
d2f0bc2d13 | ||
|
|
b011fe1c12 | ||
|
|
0eadc27cd6 | ||
|
|
700c55036c | ||
|
|
b2bee3374c | ||
|
|
cc2770850a | ||
|
|
fb27873021 | ||
|
|
590fb8c481 | ||
|
|
4e8d7ec5fc | ||
|
|
254a513fd1 | ||
|
|
ab1a573768 | ||
|
|
cc5226bf2a | ||
|
|
8fbb563f4e | ||
|
|
65e6d5a34f | ||
|
|
38a9d2763c | ||
|
|
07e1d34a84 | ||
|
|
47be2e7c3a | ||
|
|
4d694dadd8 | ||
|
|
59397f985e | ||
|
|
cc1d4d0dbc | ||
|
|
070434c045 | ||
|
|
0dc882d7c3 | ||
|
|
c3ac9a507a | ||
|
|
a6afebc718 | ||
|
|
d41915dc2a | ||
|
|
5a5ad7a5fa | ||
|
|
9dad5e37ae | ||
|
|
36edbb5eee | ||
|
|
3fceee058f | ||
|
|
adde7b5c1e | ||
|
|
0640cc3d3a | ||
|
|
3f68453d4a | ||
|
|
0a048923ae | ||
|
|
5441e18988 | ||
|
|
db0ed3e62d | ||
|
|
8a7ec52c8b | ||
|
|
66e1b3abba | ||
|
|
cd116fa248 | ||
|
|
c261077788 | ||
|
|
55fbff358a | ||
|
|
1921e6db90 | ||
|
|
bb4f77cd95 | ||
|
|
5ca62c9f35 | ||
|
|
1591a4c9dc | ||
|
|
c36074e85a | ||
|
|
73904f52b4 | ||
|
|
0e128dfa2f | ||
|
|
9994f25733 | ||
|
|
593fc04096 | ||
|
|
cb0b29631f | ||
|
|
ed4d32baa4 | ||
|
|
d83530f45d | ||
|
|
cb3f42123f | ||
|
|
36fa2a0abd | ||
|
|
2d3fc1ca3b | ||
|
|
f70c7d02e9 | ||
|
|
d768d103cf | ||
|
|
44e26d4149 | ||
|
|
96cec0e1a3 | ||
|
|
a9b34191ae | ||
|
|
e9eeb743cb | ||
|
|
8ba34667a1 | ||
|
|
87952f0623 | ||
|
|
d12c02f020 | ||
|
|
f3d737dad1 | ||
|
|
492ef9c964 | ||
|
|
c7822514cc | ||
|
|
d273ad2d0f | ||
|
|
af855e415d | ||
|
|
6ee0edf880 | ||
|
|
00015a81dd | ||
|
|
e1018a5bbb | ||
|
|
c5bef946b1 | ||
|
|
c559bb58ed | ||
|
|
4753906826 | ||
|
|
88b77cc6f3 | ||
|
|
b3b7168077 | ||
|
|
3bdde42e40 | ||
|
|
6b4dee12f5 | ||
|
|
355b90387b | ||
|
|
f512ca7625 | ||
|
|
1384c048e4 | ||
|
|
24fde6e00f | ||
|
|
33ced44f9e | ||
|
|
e6dc85bb0b | ||
|
|
20786be695 | ||
|
|
99778e17af | ||
|
|
cf78aee1c4 | ||
|
|
6cd31bbfce | ||
|
|
4bc9f8472c | ||
|
|
4a12f4a22a | ||
|
|
a1f9426399 | ||
|
|
9f1cd70774 | ||
|
|
d2795b7909 | ||
|
|
b75b24103d | ||
|
|
cb1aee2506 | ||
|
|
8d4ce1fed5 | ||
|
|
7abc130a81 | ||
|
|
5adc5a2ff8 | ||
|
|
b302c4721a | ||
|
|
537c146082 | ||
|
|
16ee3e9870 | ||
|
|
c8444775b1 | ||
|
|
784d80b509 | ||
|
|
98aacb16c3 | ||
|
|
8a35e25852 | ||
|
|
97eb073189 | ||
|
|
28534bd47a | ||
|
|
2053a26873 | ||
|
|
b6743ea08e | ||
|
|
61365b6d15 | ||
|
|
736a230890 | ||
|
|
3926448598 | ||
|
|
1b491cbda0 | ||
|
|
8abcf141fa | ||
|
|
b8e314072f | ||
|
|
6785856858 | ||
|
|
e99107b1aa | ||
|
|
f30f0e04e3 | ||
|
|
c3b3240a03 | ||
|
|
65a24d0638 | ||
|
|
a45f47c225 | ||
|
|
c683100e31 | ||
|
|
ec8296ab81 | ||
|
|
bdb0130aea | ||
|
|
5975f31ff0 | ||
|
|
205483d592 | ||
|
|
3bb8683a79 | ||
|
|
bef60dc624 | ||
|
|
8eb8833b74 | ||
|
|
b0525f83e1 | ||
|
|
ee1369b853 | ||
|
|
ea0c7b699e | ||
|
|
f83783115f | ||
|
|
ed8aab4d85 | ||
|
|
6bdea98992 | ||
|
|
4a392c74cf | ||
|
|
1ecd786d95 | ||
|
|
1345cbeea8 | ||
|
|
ab23d34dd9 | ||
|
|
907333884f | ||
|
|
6b3d50b2cd | ||
|
|
11130874d4 | ||
|
|
dcc3505c7b | ||
|
|
0d00d83ef0 | ||
|
|
47dc5f7b54 | ||
|
|
f2598a8b60 | ||
|
|
80de04e560 | ||
|
|
77fd083041 | ||
|
|
22b9a84314 | ||
|
|
ef5a57119a | ||
|
|
31f4e52842 | ||
|
|
f27592a0cd | ||
|
|
0e1aad158a | ||
|
|
3f2339b551 | ||
|
|
eceff8b3c3 | ||
|
|
5f5d6d637b | ||
|
|
a2336bcf05 | ||
|
|
20e6003290 | ||
|
|
54c633b810 | ||
|
|
f0c2cc32b1 | ||
|
|
8709982e22 | ||
|
|
686d45dcfd | ||
|
|
f3dd1cc51e | ||
|
|
8502e1ff25 | ||
|
|
603c9fd959 | ||
|
|
86946fdc03 | ||
|
|
d32a671dff | ||
|
|
ffc9e9503d | ||
|
|
38734eeb45 | ||
|
|
41b1ffdf36 | ||
|
|
eb7d7955e5 | ||
|
|
4411742328 | ||
|
|
7c969f347f | ||
|
|
d08b6bdbf7 | ||
|
|
0b5b4b456c | ||
|
|
1faed9c234 | ||
|
|
59010e53f4 | ||
|
|
cd11345693 | ||
|
|
9616ad9828 | ||
|
|
8ea598b1d1 | ||
|
|
93215674db | ||
|
|
67703b11fe | ||
|
|
a3791aabaa | ||
|
|
cad6798a8c | ||
|
|
c85f5f6db0 | ||
|
|
c36bb79352 | ||
|
|
63d059ab0b | ||
|
|
3aa94d69fb | ||
|
|
4d56296443 | ||
|
|
9b872f4cf9 | ||
|
|
5432c01ffd | ||
|
|
9c69360e97 | ||
|
|
6a6d79fc00 | ||
|
|
c83d421d9e | ||
|
|
2438825d77 | ||
|
|
a257f80d95 | ||
|
|
973c493e1b | ||
|
|
58bd925acc | ||
|
|
8625b394b5 | ||
|
|
47a007a945 | ||
|
|
3d3aae1697 | ||
|
|
2506e53400 | ||
|
|
25d2d47f86 | ||
|
|
4c0eaee5c6 | ||
|
|
cbbe9a5c01 | ||
|
|
7ccc2daf09 | ||
|
|
ef123cc005 | ||
|
|
254670338e | ||
|
|
bf3293a3cb | ||
|
|
4e7c47fb73 | ||
|
|
afea7d19e0 | ||
|
|
fca50dfab3 | ||
|
|
4e2e14addf | ||
|
|
0e15da5b94 | ||
|
|
2774238722 | ||
|
|
0012e9cd54 | ||
|
|
8d0bc0f026 | ||
|
|
81ce889435 | ||
|
|
135d17ce3e | ||
|
|
9962b84659 | ||
|
|
b0b058b767 | ||
|
|
f21a0d0eee | ||
|
|
af4c99b21a | ||
|
|
97d2d68428 | ||
|
|
ce5d7cb7aa | ||
|
|
d52cd11ed2 | ||
|
|
3bd489d315 | ||
|
|
cbabd9c7e1 | ||
|
|
f19abd6725 | ||
|
|
0a5c9c02fa | ||
|
|
155ce40218 | ||
|
|
71a10f2ca1 | ||
|
|
a861ed971e | ||
|
|
bb98bcba91 | ||
|
|
adaffe7761 | ||
|
|
cf7cce6da5 | ||
|
|
aa23159209 | ||
|
|
c63409b078 | ||
|
|
eac893b60b | ||
|
|
a63dbedead | ||
|
|
5c5db5a55f | ||
|
|
7bc25013f0 | ||
|
|
b86b4928d6 | ||
|
|
c4ff4e7167 | ||
|
|
b94d24eb25 | ||
|
|
379d0160ea | ||
|
|
2cb633b915 | ||
|
|
47457a01f7 | ||
|
|
77c3bf17ca | ||
|
|
168a433352 | ||
|
|
1408c2afeb | ||
|
|
c9ae31c23a | ||
|
|
2ca8490a32 | ||
|
|
2368a92b2d | ||
|
|
498d19243c | ||
|
|
27bf8986f9 | ||
|
|
e03dd5bd64 | ||
|
|
5acd8fe9cb | ||
|
|
e2062f9fa0 | ||
|
|
9f45c8e6e1 | ||
|
|
00879b155a | ||
|
|
23c2ea38a6 | ||
|
|
366eb49f99 | ||
|
|
4a5a1ec0b4 | ||
|
|
d486eb18c5 | ||
|
|
f3c51e4a28 | ||
|
|
b764c60a12 | ||
|
|
a10d488a32 | ||
|
|
25d754e86d | ||
|
|
bba85637d7 | ||
|
|
94c3a45f4c | ||
|
|
62e956e1dd | ||
|
|
d3edb3f27c | ||
|
|
e15a96b333 | ||
|
|
3200e1e088 | ||
|
|
033155ca21 | ||
|
|
e8edb5a809 | ||
|
|
4e230b087e | ||
|
|
a96117f52c | ||
|
|
fff1093227 | ||
|
|
9d23b40c24 | ||
|
|
5c92dec542 | ||
|
|
9dd1cdff66 | ||
|
|
20788d3b90 | ||
|
|
512cbf8ade | ||
|
|
59fa3e920c | ||
|
|
f5ea1b7095 | ||
|
|
64b863cd2a | ||
|
|
a7d604e681 | ||
|
|
977f6eba3d | ||
|
|
8f8061adba | ||
|
|
8409b8f6db | ||
|
|
221be3def1 | ||
|
|
1daf8980dd | ||
|
|
5945408a93 | ||
|
|
f2e2833f28 | ||
|
|
9a8c568e3c | ||
|
|
332594dd06 | ||
|
|
7de3260017 | ||
|
|
e06092a24e | ||
|
|
57731529dc | ||
|
|
9830f98ff9 | ||
|
|
5aff745c15 | ||
|
|
3af77feaa3 | ||
|
|
fb05477e11 | ||
|
|
fd20a5ae9b | ||
|
|
d3b76572c7 | ||
|
|
6e97410f66 | ||
|
|
b2888db940 | ||
|
|
56a739bf4e | ||
|
|
8f6628ed9f | ||
|
|
660c6e4d70 | ||
|
|
df68ef4d5e | ||
|
|
d857ed275e | ||
|
|
14181b7f48 | ||
|
|
6916ec5fa9 | ||
|
|
acb4822f6b | ||
|
|
4c93a7cb6f | ||
|
|
9a462393e4 | ||
|
|
138142583e | ||
|
|
571db950d1 | ||
|
|
15c9be10b3 | ||
|
|
d5e3590df7 | ||
|
|
b54498edea | ||
|
|
ba851ccd9f | ||
|
|
6f1af78401 | ||
|
|
798b1613ab | ||
|
|
9fa9ebebc0 | ||
|
|
6735058024 | ||
|
|
9f044c17fa | ||
|
|
d02f246887 | ||
|
|
f1cf90238b | ||
|
|
845b74e6d4 | ||
|
|
e24196eeeb | ||
|
|
234e543afb | ||
|
|
49a56e7688 | ||
|
|
5f59c87604 | ||
|
|
23d3970929 | ||
|
|
27df3a44eb | ||
|
|
a451725242 | ||
|
|
d546f4399f | ||
|
|
38ef3a592c | ||
|
|
79fb836d66 | ||
|
|
010110a0be | ||
|
|
caed8f30ee | ||
|
|
756f873a25 | ||
|
|
2fe7f06a55 | ||
|
|
5b40b01319 | ||
|
|
b93e0326d2 | ||
|
|
e2d740ae04 | ||
|
|
ff244b6181 | ||
|
|
2776d5e9e6 | ||
|
|
c3ed437d9e | ||
|
|
d3494d172c | ||
|
|
b3edc73afa | ||
|
|
2922c07e67 | ||
|
|
c03a949a0d | ||
|
|
105c416007 | ||
|
|
377e3ca5e6 | ||
|
|
a581556b17 | ||
|
|
f320728911 | ||
|
|
b4a5d88e0a | ||
|
|
7ea0b3b9e2 | ||
|
|
aa3725c860 | ||
|
|
8aa84c7fce | ||
|
|
453ceae85f | ||
|
|
1f5a0b9fa6 | ||
|
|
820a8d1de9 | ||
|
|
6bb02b28a1 | ||
|
|
60ba227d57 | ||
|
|
175e21f5e1 | ||
|
|
d801b3882c | ||
|
|
ed3dfbd25a | ||
|
|
97db6709e4 | ||
|
|
ccadcae40b | ||
|
|
33893095b5 | ||
|
|
5c5f593ffb | ||
|
|
62333ba0cb | ||
|
|
c508081afc | ||
|
|
71c0dd6c4a | ||
|
|
63495a4ba4 | ||
|
|
475074dfb5 | ||
|
|
557b256b32 | ||
|
|
48854aec52 | ||
|
|
f3abb2c352 | ||
|
|
88910f5b9d | ||
|
|
a60f8a9c1f | ||
|
|
10973a581f | ||
|
|
a655407f1b | ||
|
|
a9b4f16b04 | ||
|
|
6612114f86 | ||
|
|
66676016f6 | ||
|
|
e5900f1bc9 | ||
|
|
85497d7a4b | ||
|
|
5393915bf6 | ||
|
|
f197d6d0f6 | ||
|
|
4fa1816cf6 | ||
|
|
1c91ab2586 | ||
|
|
f0eda4e8d7 | ||
|
|
a0de64f3c3 | ||
|
|
7e1fabe2f7 | ||
|
|
c0fc0dfc45 | ||
|
|
79b2d64a67 | ||
|
|
f3eadd1737 | ||
|
|
e34f80e5aa | ||
|
|
bc363eca41 | ||
|
|
d233287325 | ||
|
|
c127057f7d | ||
|
|
9a75d99438 | ||
|
|
e9c395a3bf | ||
|
|
4f5b846bb4 | ||
|
|
79bdad205f | ||
|
|
94b582e45e | ||
|
|
1b49a71df4 | ||
|
|
c4ec48281c | ||
|
|
1a006390d9 | ||
|
|
953f265513 | ||
|
|
468877578a | ||
|
|
209eee579a | ||
|
|
83b4fc4af4 | ||
|
|
b0876110ca | ||
|
|
ff14eeb4f2 | ||
|
|
5f3eabf4cd | ||
|
|
110c9367bd | ||
|
|
bbc70d2471 | ||
|
|
bab8df881a | ||
|
|
e89d33ab3d | ||
|
|
0c3fea306a | ||
|
|
a0cafa3d0b | ||
|
|
58219ca22f | ||
|
|
50b28f3bf2 | ||
|
|
0f8345abf7 | ||
|
|
4f213e08aa | ||
|
|
8493de3cee | ||
|
|
fee6e7428f | ||
|
|
d10616d364 | ||
|
|
85d143a273 | ||
|
|
6e72bc46d3 | ||
|
|
a2218a4b6d | ||
|
|
b8eed1d830 | ||
|
|
a64ecdfa5b | ||
|
|
bcfc0ce5f6 | ||
|
|
8bc0719dde | ||
|
|
185cd6c058 | ||
|
|
afb77541b4 | ||
|
|
4f8e7e5f41 | ||
|
|
e197cded79 | ||
|
|
bcb3aac3c5 | ||
|
|
c4a5c2de26 | ||
|
|
87bc4b08ff | ||
|
|
65cdb3dfa8 | ||
|
|
9a5c1c180f | ||
|
|
39515c9ee0 | ||
|
|
8ca1700976 | ||
|
|
fded04fbf6 | ||
|
|
9c69091c9d | ||
|
|
4554a54a6c | ||
|
|
8c69d7bc63 | ||
|
|
0c57414490 | ||
|
|
2f70282295 | ||
|
|
55f71781d8 | ||
|
|
925d23b32a | ||
|
|
4e4876104d | ||
|
|
0717029581 | ||
|
|
a774c5de84 | ||
|
|
a041ae4cde | ||
|
|
7d3e6732fb | ||
|
|
07d9fc9478 | ||
|
|
cc411ae004 | ||
|
|
f521b99b09 | ||
|
|
be6f0c2c50 | ||
|
|
a7119547e2 | ||
|
|
c97cf70bc7 | ||
|
|
4f108d8af6 | ||
|
|
f45a345adb | ||
|
|
54872297d3 | ||
|
|
8c66786419 | ||
|
|
15333cd28d | ||
|
|
b5b38edf30 | ||
|
|
b08f330d62 | ||
|
|
9b362b1e4f | ||
|
|
4befef0c18 | ||
|
|
438b3caedb | ||
|
|
9b780b8add | ||
|
|
0f21161e51 | ||
|
|
db712a93b4 | ||
|
|
f18a0ed39b | ||
|
|
92ac4fc237 | ||
|
|
21af4cc914 | ||
|
|
949d46c7ba | ||
|
|
921d91576a | ||
|
|
8c037305e4 | ||
|
|
41ffb1c950 | ||
|
|
ebe3ea3204 | ||
|
|
d94c4516c6 | ||
|
|
b0f8d9bb97 | ||
|
|
04dfe7b3f6 | ||
|
|
547afcfc74 | ||
|
|
48afdb4eef | ||
|
|
a7866f7b95 | ||
|
|
b5a53da717 | ||
|
|
c08cae1c22 | ||
|
|
4aa2cd69ae | ||
|
|
3b5d695583 | ||
|
|
67439c4701 | ||
|
|
a313751258 | ||
|
|
11966d9c55 | ||
|
|
ea2f7e07d7 | ||
|
|
e600c51355 | ||
|
|
21b4b339d9 | ||
|
|
9ee96e3ba9 | ||
|
|
7de0534490 | ||
|
|
70c8d32f2e | ||
|
|
08c2e81ac2 | ||
|
|
0311f5412e | ||
|
|
e734eba51e | ||
|
|
2a718a3f53 | ||
|
|
7ed40716cb | ||
|
|
363f96e717 | ||
|
|
9f65059a5b | ||
|
|
b757b1b5ee | ||
|
|
155889b318 | ||
|
|
4dd011f6d0 | ||
|
|
a85264b1fc | ||
|
|
ad18363852 | ||
|
|
836fe66e24 | ||
|
|
e45a5d3a32 | ||
|
|
80a1050237 | ||
|
|
54592bba4d | ||
|
|
d4028b4373 | ||
|
|
902d4d109a | ||
|
|
d8daacf157 | ||
|
|
0da5bcb414 | ||
|
|
d3a726db0d | ||
|
|
ac6555fa3c | ||
|
|
3e71719502 | ||
|
|
2c700f970c | ||
|
|
77396b63f9 | ||
|
|
2af7ef63c3 | ||
|
|
21c1f06ef9 | ||
|
|
3df324d845 | ||
|
|
c27291d4e3 | ||
|
|
bdabd8f75b | ||
|
|
48dc6ebf5c | ||
|
|
4009a76e97 | ||
|
|
459432a1b8 | ||
|
|
33d8c2a1dd | ||
|
|
4eb18e9ca2 | ||
|
|
dd80757941 | ||
|
|
b4e6997999 | ||
|
|
53c7502663 | ||
|
|
1e7d7d3cbf | ||
|
|
7b81e2e747 | ||
|
|
f3d53796af | ||
|
|
0fb715a904 | ||
|
|
233357ef0e | ||
|
|
b9109e8254 | ||
|
|
6679d7c0b1 | ||
|
|
dbe0c9d8c7 | ||
|
|
f01459fd40 | ||
|
|
11a5687b72 | ||
|
|
6c47e84d2e | ||
|
|
2be8b64af2 | ||
|
|
a7a76a674f | ||
|
|
29034c5076 | ||
|
|
31aee0d0c0 | ||
|
|
6da5b35fca | ||
|
|
abd68eb92b | ||
|
|
bf451ffc9a | ||
|
|
be734f5592 | ||
|
|
d7aa6aa916 | ||
|
|
9f0c080847 | ||
|
|
3a1ba773b0 | ||
|
|
915bab5fc7 | ||
|
|
5fd46fb8f7 | ||
|
|
849a1ab845 | ||
|
|
940de5ab02 | ||
|
|
dd9578f379 | ||
|
|
c182d55fc5 | ||
|
|
0ce807691b | ||
|
|
11a6f58528 | ||
|
|
d9d4cecaad | ||
|
|
f1202087f8 | ||
|
|
39a8bb71d3 | ||
|
|
4f8ea5eede | ||
|
|
7869e676af | ||
|
|
0ee51445f6 | ||
|
|
af0a726689 | ||
|
|
8f9de7acbd | ||
|
|
aa4e359f62 | ||
|
|
8d9263fca6 | ||
|
|
d6a0cbaade | ||
|
|
289500ab8d | ||
|
|
73e28ef13d | ||
|
|
2302a4d04f | ||
|
|
6cac43c974 | ||
|
|
82980f31d9 | ||
|
|
8f9a2d08ea | ||
|
|
a691ca0f85 | ||
|
|
a42edec9ef | ||
|
|
a272d8fe3d | ||
|
|
30c73195b5 | ||
|
|
a81c59a960 | ||
|
|
097485195c | ||
|
|
c5f6fa110a | ||
|
|
90cfcecc09 | ||
|
|
dee0e2ed0f | ||
|
|
5ad9884ff1 | ||
|
|
188eb6b426 | ||
|
|
8361f64dbf | ||
|
|
2a6227941e | ||
|
|
a582b8f840 | ||
|
|
4db344230d | ||
|
|
821b7106b2 | ||
|
|
ef3831a1fe | ||
|
|
5feb87cd0e | ||
|
|
57d9617964 | ||
|
|
78d55454aa | ||
|
|
5b3d554e1e | ||
|
|
53c07f5909 | ||
|
|
5316f66005 | ||
|
|
f86905457a | ||
|
|
abb211c4e8 | ||
|
|
537c1a5747 | ||
|
|
f24daf23a5 | ||
|
|
bb56c39d16 | ||
|
|
77237196c7 | ||
|
|
a310a3b398 | ||
|
|
e0f6c7d90b | ||
|
|
a1587302aa | ||
|
|
cc0bff446b | ||
|
|
9b8ddff5b7 | ||
|
|
ac4942e26b | ||
|
|
198d836483 | ||
|
|
d05f3728de | ||
|
|
2b8bef1d15 | ||
|
|
2c55e3e917 | ||
|
|
db082802c6 | ||
|
|
b367fb5ac6 | ||
|
|
e9ab2f8d94 | ||
|
|
98914f74bf | ||
|
|
aa3143cf6f | ||
|
|
a845cca037 | ||
|
|
3ab6ef0aa1 | ||
|
|
1f1becf87f | ||
|
|
198ed18b9e | ||
|
|
9110473f93 | ||
|
|
97313e0aab | ||
|
|
259f12628e | ||
|
|
b621794ed5 | ||
|
|
a0b0d8b9db | ||
|
|
f10fa3c9f4 | ||
|
|
4a4de1899a | ||
|
|
cf2fd3b6ca | ||
|
|
1ce8133282 | ||
|
|
5905484c75 | ||
|
|
cb096a4f05 | ||
|
|
b7e1abe25c | ||
|
|
d24a6b5fd0 | ||
|
|
e3e8f6bf02 | ||
|
|
cd74549840 | ||
|
|
34713ce23c | ||
|
|
bb317fb0b2 | ||
|
|
8876e74e43 | ||
|
|
510227e39e | ||
|
|
deec549d9f | ||
|
|
d026f9cce6 | ||
|
|
7a1f214166 | ||
|
|
5913dd10f1 | ||
|
|
cd01d222fb | ||
|
|
9c5beb56e3 | ||
|
|
810c2e6077 | ||
|
|
d35b878b5e | ||
|
|
087ebd80da | ||
|
|
5a36a3379b | ||
|
|
1ebd001fb4 | ||
|
|
18b897da9c | ||
|
|
d3bb6bb5c1 | ||
|
|
25ea204b1b | ||
|
|
7b52087998 | ||
|
|
b56e0d06f9 | ||
|
|
304a1a1754 | ||
|
|
9ee577c7f5 | ||
|
|
c3d73f4da9 | ||
|
|
1ff571914c | ||
|
|
40f7bcc3c0 | ||
|
|
9e023307b9 | ||
|
|
8b1b1219e5 | ||
|
|
5623f781bc | ||
|
|
7efdbaf320 | ||
|
|
98eb24c726 | ||
|
|
8bdfb47d8c | ||
|
|
aecef098f9 | ||
|
|
8c065ddbe6 | ||
|
|
6ff9ec81c5 | ||
|
|
9d976c0ef1 | ||
|
|
8fc3604418 | ||
|
|
bb6d66e8ef | ||
|
|
114f675bd7 | ||
|
|
c9cd65ad7a | ||
|
|
8027fed7d1 | ||
|
|
f90165b452 | ||
|
|
5e69cd2c14 | ||
|
|
5eb5cce173 | ||
|
|
725314432d | ||
|
|
98b4f0032b | ||
|
|
294e380438 | ||
|
|
862cb20ea6 | ||
|
|
3cd7cffd0c | ||
|
|
bc9267e3a6 | ||
|
|
a019c335c9 | ||
|
|
ed49c8c1b6 | ||
|
|
2a243fc074 | ||
|
|
47045ce402 | ||
|
|
d6e67586bf | ||
|
|
6e9783bd25 | ||
|
|
8dc3729522 | ||
|
|
0f0a19e9ce | ||
|
|
7aad4e7fb4 | ||
|
|
6098807252 | ||
|
|
930af7d50b | ||
|
|
0f544f62d6 | ||
|
|
54ac9a918e | ||
|
|
398c212955 | ||
|
|
2ec1fc60c3 | ||
|
|
f136155383 | ||
|
|
c2fa196d14 | ||
|
|
3e42a99cf5 | ||
|
|
92a3ef4a14 | ||
|
|
946c3f985f | ||
|
|
dd78d526d0 | ||
|
|
9ba962665d | ||
|
|
844a3c050c | ||
|
|
b07e8568ee | ||
|
|
b2eacd3e1f | ||
|
|
7e597910fd | ||
|
|
4c8f7269ff | ||
|
|
8069aeb88e | ||
|
|
c551c0dbb3 | ||
|
|
b92e2f7335 | ||
|
|
42928551cf | ||
|
|
53198fb8b1 | ||
|
|
4a215541e7 | ||
|
|
d00bbb29b8 | ||
|
|
2bc7abfaca | ||
|
|
882340c959 | ||
|
|
c44253fa0c | ||
|
|
d7da8bb121 | ||
|
|
1a0e1d27e4 | ||
|
|
a528fba7aa | ||
|
|
eae8e36ec4 | ||
|
|
69dd5f56f8 | ||
|
|
300c8aea4d | ||
|
|
d0e35cdb53 | ||
|
|
526a6ad5f6 | ||
|
|
2f7cbabfda | ||
|
|
c6fecfbaa5 | ||
|
|
632a84eff7 | ||
|
|
31f92b0ffa | ||
|
|
f70645c592 | ||
|
|
dc6182a307 | ||
|
|
f2c99bd5dc | ||
|
|
afa999d446 | ||
|
|
3919f23a69 | ||
|
|
c957b6b0a4 | ||
|
|
86f88ddd53 | ||
|
|
c17c957f95 | ||
|
|
c3cd22b404 | ||
|
|
b709c4aedc | ||
|
|
aaf377c874 | ||
|
|
e4c706af54 | ||
|
|
6f6a91a131 | ||
|
|
e8b1aa0c5a | ||
|
|
d4df36c7f0 | ||
|
|
a565f0e234 | ||
|
|
72cda2db72 | ||
|
|
16908a1d78 | ||
|
|
da30135c4c | ||
|
|
45624d6c2c | ||
|
|
4e763f1b30 | ||
|
|
7fb32a8621 | ||
|
|
3ea36758ef | ||
|
|
262d0ff047 | ||
|
|
65a223794a | ||
|
|
6c2e919c7e | ||
|
|
c01ee053b1 | ||
|
|
d259e6c570 | ||
|
|
b0baee5e36 | ||
|
|
4531ded5c1 | ||
|
|
b55295cb12 | ||
|
|
5928ee97ca | ||
|
|
2445ad4331 | ||
|
|
93d6d9d835 | ||
|
|
95ca51b6e2 | ||
|
|
a24fc2e1d3 | ||
|
|
69e238b098 | ||
|
|
64af5394f5 | ||
|
|
1beadafcc7 | ||
|
|
81dab093fc | ||
|
|
6a9e480512 | ||
|
|
f98726ae98 | ||
|
|
946199e8e4 | ||
|
|
d207e6a6ad | ||
|
|
df6f3f404a | ||
|
|
cce6521a9f | ||
|
|
357c1c8c53 | ||
|
|
63ee896ab5 | ||
|
|
9e966cadbd | ||
|
|
44827ccad8 | ||
|
|
0d1a2dd7a9 | ||
|
|
7a5be53631 | ||
|
|
471c9b47fe | ||
|
|
23b9a2fda0 | ||
|
|
7d6103ad6c | ||
|
|
6e283234c9 | ||
|
|
ec39f8f8d7 | ||
|
|
288ea702f2 | ||
|
|
a2cde53c87 | ||
|
|
ee4eb9a910 | ||
|
|
9d51afcacb | ||
|
|
389c1f20ad | ||
|
|
4748a3346e | ||
|
|
9b0956fed1 | ||
|
|
7d1f5914e5 | ||
|
|
2f84504413 | ||
|
|
42f93fb706 | ||
|
|
f97953181a | ||
|
|
3f506b788e | ||
|
|
db5f4307ca | ||
|
|
b9a78bedee | ||
|
|
f0cdbe7e03 | ||
|
|
13714e87f2 | ||
|
|
9101d75316 | ||
|
|
42c4ebbea6 | ||
|
|
f1eb918dc8 | ||
|
|
3c6df196b5 | ||
|
|
0014f3de55 | ||
|
|
233edbf415 | ||
|
|
bd209f75fa | ||
|
|
e00ed36d71 | ||
|
|
27854a478e | ||
|
|
c40df89cef | ||
|
|
e3f3c4ea0b | ||
|
|
f12a87a96c | ||
|
|
cb4358ddbb | ||
|
|
c4819d78ba | ||
|
|
0b721cd4c4 | ||
|
|
b025757328 | ||
|
|
4bd73b6947 | ||
|
|
f3c42680db | ||
|
|
c10066205d | ||
|
|
21b7aaa428 | ||
|
|
d7225fdfce | ||
|
|
deb870c77d | ||
|
|
c05538959b | ||
|
|
f6c761dda1 | ||
|
|
877b08d6d2 | ||
|
|
a69064328b | ||
|
|
01b9566e50 | ||
|
|
ca3a100be6 | ||
|
|
1655e4ddb0 | ||
|
|
526f839764 | ||
|
|
1a86bd2a09 | ||
|
|
610e7b5bd6 | ||
|
|
86f6c04d84 | ||
|
|
fb3a1da4bb | ||
|
|
525efcbb7b | ||
|
|
ea4340e1ec | ||
|
|
91f3864fbd | ||
|
|
14fa704caf | ||
|
|
ad1f8180a5 | ||
|
|
e364f899af | ||
|
|
40683870ea | ||
|
|
7569d7c069 | ||
|
|
c87ddbb3ce | ||
|
|
793fedcf57 | ||
|
|
74fd86a69e | ||
|
|
f234091207 | ||
|
|
772b72139a | ||
|
|
6e6a844baf | ||
|
|
2f2f80273b | ||
|
|
353d8860ac | ||
|
|
fab96cb72a | ||
|
|
2203e41900 | ||
|
|
e16f2bc5f7 | ||
|
|
2381cf3269 | ||
|
|
7e3a82cd9c | ||
|
|
115817d118 | ||
|
|
67a83db98d | ||
|
|
a0e0c6c8e7 | ||
|
|
5cfea4fc98 | ||
|
|
a87c870f99 | ||
|
|
b9d671326b | ||
|
|
8e4e070151 | ||
|
|
a58818a079 | ||
|
|
e69b55d9ac | ||
|
|
a515d3066e | ||
|
|
45af819322 | ||
|
|
f81b50bf9d | ||
|
|
e52c7ac7a3 | ||
|
|
5ce838be40 | ||
|
|
a687af1e72 | ||
|
|
70529c3b40 | ||
|
|
dbcfb7151f | ||
|
|
6ba9088de9 | ||
|
|
7520224a42 | ||
|
|
4607e1386f | ||
|
|
9686172872 | ||
|
|
8563ac1664 | ||
|
|
9a80a35f4b | ||
|
|
296f64a43e | ||
|
|
d44e05a363 | ||
|
|
5265c3889c | ||
|
|
4cde19b0c9 | ||
|
|
230e8b436f | ||
|
|
62ca98ef5e | ||
|
|
dbb86efac3 | ||
|
|
094340d287 | ||
|
|
addb84b1bc | ||
|
|
ffa8924330 | ||
|
|
e8d28e1b1c | ||
|
|
0452bbcf84 | ||
|
|
a3a5d0d1f4 | ||
|
|
7a59e1eae8 | ||
|
|
3da965ce4b | ||
|
|
4cf1ca4338 | ||
|
|
f174f27096 | ||
|
|
1a15762c59 | ||
|
|
f633e33632 | ||
|
|
914a7e3d4f | ||
|
|
d84af669dc | ||
|
|
451fd6c439 | ||
|
|
316152fe73 | ||
|
|
03f9b02953 | ||
|
|
fec6a4ca4e | ||
|
|
bcc878bb81 | ||
|
|
df61a00acc | ||
|
|
878fea5403 | ||
|
|
804cc98cd1 | ||
|
|
6e00020a9f | ||
|
|
ce96c3e6b7 | ||
|
|
2aac9a1fa3 | ||
|
|
5aa8676122 | ||
|
|
133840ba4b | ||
|
|
e4b9fc28de | ||
|
|
5876b850b2 | ||
|
|
4cfdb3c095 | ||
|
|
b2154ccb2b | ||
|
|
5a2015e146 | ||
|
|
ea88d94dcf | ||
|
|
eaa1b0a5f2 | ||
|
|
de5c932283 | ||
|
|
3b673e0fb0 | ||
|
|
d23f2b2845 | ||
|
|
9d172423df | ||
|
|
ec29c6507b | ||
|
|
768429bbc1 | ||
|
|
83b84d65c2 | ||
|
|
c31e04e2f8 | ||
|
|
a460e00574 | ||
|
|
2a087220dd | ||
|
|
bbd20f0a74 | ||
|
|
eae2cf0add | ||
|
|
ae3a70351c | ||
|
|
52f4f257c9 | ||
|
|
931400bd04 | ||
|
|
1e6ed7364b | ||
|
|
4a72ebfafa | ||
|
|
f4ea22480a | ||
|
|
eddc5af8f5 | ||
|
|
edcd6e14c6 | ||
|
|
311c8476f8 | ||
|
|
e5403da657 | ||
|
|
a7eda24870 | ||
|
|
bda72552bf | ||
|
|
a02188ae94 | ||
|
|
5b7d8ff306 | ||
|
|
cd7d63a805 | ||
|
|
c593d488f9 | ||
|
|
44a7c89e02 | ||
|
|
9d27a1becf | ||
|
|
c00408a4e5 | ||
|
|
bb0f557859 | ||
|
|
ac18f8a706 | ||
|
|
a2aebb551e | ||
|
|
354bdb0d58 | ||
|
|
8e3389e574 | ||
|
|
0dfd8d379b | ||
|
|
3c38651e8c | ||
|
|
88bbbfa567 | ||
|
|
22ad8f0e7a | ||
|
|
76a64f4491 | ||
|
|
5741bac1c6 | ||
|
|
8590d46785 | ||
|
|
71cff967a9 | ||
|
|
b612eee957 | ||
|
|
28d4aae5b9 | ||
|
|
11313ba8e7 | ||
|
|
d708cb8360 | ||
|
|
78c419c698 | ||
|
|
3f2b6a67d1 | ||
|
|
9ef984d168 | ||
|
|
e3f9ce59eb | ||
|
|
12f0c2f580 | ||
|
|
fa557347ba | ||
|
|
1c6959cfbe | ||
|
|
be199c1304 | ||
|
|
51633b7bd7 | ||
|
|
0acc99fdcd | ||
|
|
6099e57b07 | ||
|
|
e53ecd35c0 | ||
|
|
8397b45b20 | ||
|
|
bcb1b414ed | ||
|
|
f210a05c37 | ||
|
|
9d57241790 | ||
|
|
30ec56c8d3 | ||
|
|
ce00e7de36 | ||
|
|
4e1e199da8 | ||
|
|
7336dd4a97 | ||
|
|
03c1bf96b2 | ||
|
|
ef07ed3bf8 | ||
|
|
197c2f3244 | ||
|
|
bdbade92a7 | ||
|
|
bef02a89ea | ||
|
|
1aae1bf9fd | ||
|
|
078f2aecfb | ||
|
|
c87f913eb9 | ||
|
|
a5fc3eb9d4 | ||
|
|
b0dd0ad7af | ||
|
|
95a15f7a83 | ||
|
|
780dc06584 | ||
|
|
365cddf35f | ||
|
|
fd10753fd8 | ||
|
|
c099ea497a | ||
|
|
336b43d278 | ||
|
|
d88da23cbd | ||
|
|
d5513a7490 | ||
|
|
08e585d948 | ||
|
|
3d7e15f353 | ||
|
|
ec3f949874 | ||
|
|
7aacd895ee | ||
|
|
884297323d | ||
|
|
3130af0e2b | ||
|
|
02a58af3c0 | ||
|
|
86645a3f19 | ||
|
|
edc3994cfd | ||
|
|
015289e21d | ||
|
|
17ca34034b | ||
|
|
71f29b701d | ||
|
|
b4b853b4c5 | ||
|
|
d5483f3352 | ||
|
|
44db6e39c3 | ||
|
|
2522de8594 | ||
|
|
e5e60564cf | ||
|
|
bf2dabe6f1 | ||
|
|
70c873bcac | ||
|
|
5aabf5b8eb | ||
|
|
20e82ae2a2 | ||
|
|
e890cb118c | ||
|
|
275d1aa94e | ||
|
|
f748fda0ed | ||
|
|
87480bf6d4 | ||
|
|
bd6f1edea8 | ||
|
|
013d1d68c0 | ||
|
|
69b0bc089a | ||
|
|
0dd4a43f49 | ||
|
|
727d3d7463 | ||
|
|
c2fb9ec3fa | ||
|
|
9a4ed98618 | ||
|
|
58c4f6b355 | ||
|
|
d29033f264 | ||
|
|
047c34b734 | ||
|
|
649f741e71 | ||
|
|
d740c8425e | ||
|
|
9038c3bc48 | ||
|
|
ed4c9fc4e9 | ||
|
|
8f8be84024 | ||
|
|
ead562ed05 | ||
|
|
74b5acc35d | ||
|
|
8cf8726c7c | ||
|
|
45b8761bc8 | ||
|
|
b83df4e711 | ||
|
|
cef4f14470 | ||
|
|
7e64470a71 | ||
|
|
53651229b5 | ||
|
|
fd3d717df5 | ||
|
|
555126e06f | ||
|
|
d4ebb803fa | ||
|
|
163fd0a3e8 | ||
|
|
ef9c0e9b19 | ||
|
|
5d276731e6 | ||
|
|
65d235a5db | ||
|
|
6dcfbc479d | ||
|
|
0cb46e200c | ||
|
|
3ce2146941 | ||
|
|
d8bf20d9ac | ||
|
|
33023522ba | ||
|
|
d6ea40a7f0 | ||
|
|
38453101f0 | ||
|
|
8e46375186 | ||
|
|
c75d7fb32e | ||
|
|
6e0cf087ad | ||
|
|
af9a41d770 | ||
|
|
d6dc43db7d | ||
|
|
4c49647788 | ||
|
|
99106deaa2 | ||
|
|
3de7bde0e1 | ||
|
|
34a2ebdc4f | ||
|
|
418783e760 | ||
|
|
dc38e24fed | ||
|
|
a61724c004 | ||
|
|
29b738b4e6 | ||
|
|
07def6f68b | ||
|
|
8f5846f86d | ||
|
|
602d314ba0 | ||
|
|
a68974409c | ||
|
|
5d67107c79 | ||
|
|
f298db9762 | ||
|
|
ef29a5e827 | ||
|
|
da9b591621 | ||
|
|
2e8aa25844 | ||
|
|
6611322a8b | ||
|
|
8fe28948ca | ||
|
|
948c6ee88d | ||
|
|
ee35abbcd0 | ||
|
|
e108e19daf | ||
|
|
b7a9d80f28 | ||
|
|
277f6fbe49 | ||
|
|
e05080f5a8 | ||
|
|
4de250dd75 | ||
|
|
8f2f7f431c | ||
|
|
733da8cc46 | ||
|
|
5df7edb6af | ||
|
|
4f67b78853 | ||
|
|
4b14b35208 | ||
|
|
bc2ab12f99 | ||
|
|
4f25bf37c2 | ||
|
|
dfa99afe40 | ||
|
|
c1a4d64a7b | ||
|
|
c3166b2a48 | ||
|
|
1eef1e5b2f | ||
|
|
a2567be084 | ||
|
|
8191965555 | ||
|
|
f1c9244dfd | ||
|
|
58155a9921 | ||
|
|
5d398a69fb | ||
|
|
4560de58f4 | ||
|
|
7f9f605781 | ||
|
|
41cad5fbed | ||
|
|
e4f15b0f0e | ||
|
|
614b91ded0 | ||
|
|
d4e3ef6eae | ||
|
|
bee5836721 | ||
|
|
eda90ace80 | ||
|
|
0c127348e1 | ||
|
|
eb6b59af64 | ||
|
|
2f89d766fc | ||
|
|
a98aa48e57 | ||
|
|
11066e33f8 | ||
|
|
51a32d64d8 | ||
|
|
77a9f59487 | ||
|
|
1814c4e45b | ||
|
|
722f5fd8d4 | ||
|
|
e9c8dcf96c | ||
|
|
89e0d95883 | ||
|
|
aeb9906717 | ||
|
|
fa0281061b | ||
|
|
ea15ec6aa2 | ||
|
|
368971ec8b | ||
|
|
90b878c583 | ||
|
|
0112826daf | ||
|
|
9023e8f7bb | ||
|
|
132c7b03f0 | ||
|
|
48fac4e8ce | ||
|
|
c5e4cd3345 | ||
|
|
edeccce619 | ||
|
|
aeaae7210f | ||
|
|
60668aa210 | ||
|
|
b69df93ec3 | ||
|
|
455e8a4281 | ||
|
|
0bfb58ff80 | ||
|
|
b35a745561 | ||
|
|
5d7fe7a718 | ||
|
|
64ca95e375 | ||
|
|
b91c634df1 | ||
|
|
5ade7edd7e | ||
|
|
dd66f3ed20 | ||
|
|
837eecbc91 | ||
|
|
26cc10a00c | ||
|
|
f12abe957d | ||
|
|
caaf688582 | ||
|
|
3dfd0cd62a | ||
|
|
6076da8079 | ||
|
|
18bd86f154 | ||
|
|
338f465019 | ||
|
|
ac13f5e6f9 | ||
|
|
d237dacd83 | ||
|
|
398a4138d5 | ||
|
|
7ec330ddeb | ||
|
|
6564abbf26 | ||
|
|
b4f9901580 | ||
|
|
85b0237adc | ||
|
|
4071d1ed7e | ||
|
|
134bbe416d | ||
|
|
3243fea0ac | ||
|
|
216c9b00a8 | ||
|
|
67f3b485c2 | ||
|
|
b2aca215c0 | ||
|
|
e26c09529a | ||
|
|
212defee0f | ||
|
|
4e6b5e91df | ||
|
|
9bf6083375 | ||
|
|
72cbc6ee95 | ||
|
|
f74c5acf29 | ||
|
|
6bbc336c02 | ||
|
|
93fc3da348 | ||
|
|
c7dd196b04 | ||
|
|
9c1bb203e3 | ||
|
|
63a054d7d7 | ||
|
|
495e399865 | ||
|
|
36ac0b59b0 | ||
|
|
1b6f6d80ea | ||
|
|
00768a2d76 | ||
|
|
18b078414a | ||
|
|
bb9ff29efd | ||
|
|
5d95de74d3 | ||
|
|
5618e46179 | ||
|
|
b380515c84 | ||
|
|
9e9788497e | ||
|
|
8631250eea | ||
|
|
3d893a0804 | ||
|
|
c31d7179e5 | ||
|
|
77d0cdef02 | ||
|
|
02564cc842 | ||
|
|
d9f21ee796 | ||
|
|
0af5378d4d | ||
|
|
dbd4014239 | ||
|
|
8551d59672 | ||
|
|
10ee432860 | ||
|
|
194ca9e7bb | ||
|
|
2d7767b700 | ||
|
|
f6ce318061 | ||
|
|
e14f98280b | ||
|
|
38e467edac | ||
|
|
5b754aac0d | ||
|
|
9d2ab7b405 | ||
|
|
21ab827567 | ||
|
|
b7e4c1c2e2 | ||
|
|
023841f4fd | ||
|
|
a21c94e3dc | ||
|
|
6d75d0c51f | ||
|
|
3dfe93776f | ||
|
|
ec323d3036 | ||
|
|
f4431031a7 | ||
|
|
0fe929e778 | ||
|
|
626afd6219 | ||
|
|
38b92d56e7 | ||
|
|
a08d95b971 | ||
|
|
339416b38b | ||
|
|
c81bb8a463 | ||
|
|
b3ce365d91 | ||
|
|
da00980433 | ||
|
|
951028949c | ||
|
|
fbd727aa11 | ||
|
|
3358a9880b | ||
|
|
7e2f07486a | ||
|
|
a3e569cdda | ||
|
|
d68d8d82e6 | ||
|
|
997b4a544d | ||
|
|
176d2b622e | ||
|
|
3c9c3ea7ae | ||
|
|
6abea7562b | ||
|
|
866b62acdc | ||
|
|
3a9ab23713 | ||
|
|
3a054e1e96 | ||
|
|
9e88fcd58c | ||
|
|
39ffc1c3c7 | ||
|
|
ad81d71ecb | ||
|
|
faf49916cb | ||
|
|
69d0e44295 | ||
|
|
bb8d8a8a4a | ||
|
|
bafb1e27c2 | ||
|
|
8568f6e3e9 | ||
|
|
dfabe7d0f8 | ||
|
|
81233967ca | ||
|
|
d2d5e540ac | ||
|
|
922ad083e6 | ||
|
|
d7bd2d2b2c | ||
|
|
ddf5fc8a42 | ||
|
|
0d6ade69e2 | ||
|
|
416976fffd | ||
|
|
0841c63e0d | ||
|
|
a4d439b975 | ||
|
|
8de509a837 | ||
|
|
bc438d3671 | ||
|
|
e2a118f81a | ||
|
|
78389d8396 | ||
|
|
219760639a | ||
|
|
1cece74438 | ||
|
|
38ed8795ab | ||
|
|
55697d7dc9 | ||
|
|
a7fb782aea | ||
|
|
3f705ba9a5 | ||
|
|
8f075be1e2 | ||
|
|
8cb69f0f2b | ||
|
|
97a4573885 | ||
|
|
4ace0e1530 | ||
|
|
9d8b41ea6f | ||
|
|
0b1ba8c05e | ||
|
|
12a11c521b | ||
|
|
9c90d7f4ee | ||
|
|
575d067998 | ||
|
|
ae4af5600d | ||
|
|
d91c64e428 | ||
|
|
4aa911abc6 | ||
|
|
64c72bb919 | ||
|
|
fec191d3cc | ||
|
|
ee100094e4 | ||
|
|
bc7156d089 | ||
|
|
237d1fba11 | ||
|
|
99708d560f | ||
|
|
6878eb6899 | ||
|
|
cd2634b3ce | ||
|
|
7430bcbc44 | ||
|
|
eba11d2ba5 | ||
|
|
bfbf86558c | ||
|
|
c332bbcd34 | ||
|
|
e0dc4c8a1e | ||
|
|
02045b57b1 | ||
|
|
037023bb31 | ||
|
|
ed82c3bb59 | ||
|
|
3e61d7985c | ||
|
|
d84748a467 | ||
|
|
668af4ef48 | ||
|
|
a3a724f805 | ||
|
|
a770d71890 | ||
|
|
1de866cd09 | ||
|
|
54380f53a2 | ||
|
|
83fb85581d | ||
|
|
7d870524d3 | ||
|
|
d28aad9a58 | ||
|
|
59c39b886d | ||
|
|
3b3e09075a | ||
|
|
658ea4304e | ||
|
|
8be63adbc8 | ||
|
|
33188acf8f | ||
|
|
7d8f352e0a | ||
|
|
587382c0ba | ||
|
|
38674ec994 | ||
|
|
8d6adb6090 | ||
|
|
d60c886ebc | ||
|
|
0f714ca6bc | ||
|
|
6c7a09ab7c | ||
|
|
63da1df6fe | ||
|
|
bbe589da44 | ||
|
|
7824a70c1d | ||
|
|
b278e91338 | ||
|
|
b5444a1779 | ||
|
|
f2609e133d | ||
|
|
9dcde09ac8 | ||
|
|
e14fdbbddb | ||
|
|
7aa1834c95 | ||
|
|
424c98547d | ||
|
|
a162155919 | ||
|
|
4d7ae382a8 | ||
|
|
37e7e0bd81 | ||
|
|
0c86eb2dc7 | ||
|
|
70c2db8b9f | ||
|
|
e0c505cfae | ||
|
|
c1dd118d2c | ||
|
|
d8eb62ff15 | ||
|
|
45ae51743b | ||
|
|
2d21d91abd | ||
|
|
e5ee05dc0d | ||
|
|
c0d53e176b | ||
|
|
4bb4d01681 | ||
|
|
b26d188190 | ||
|
|
0a6382e2af | ||
|
|
b205f291f6 | ||
|
|
a24b08a42a | ||
|
|
058d6f321a | ||
|
|
1214d8cd26 | ||
|
|
65a30ab0a2 | ||
|
|
dbab08f936 | ||
|
|
c996d13ec3 | ||
|
|
a31c74f7ef | ||
|
|
0ab7868d8a | ||
|
|
61616abef2 | ||
|
|
bb1fcd1ba8 | ||
|
|
6d65121993 | ||
|
|
ecf0bffb79 | ||
|
|
af2ea0a1f2 | ||
|
|
286467db82 | ||
|
|
6b60a31ebf | ||
|
|
54028e5943 | ||
|
|
5902059c7c | ||
|
|
580f4f5561 | ||
|
|
0c062e839d | ||
|
|
0fcbf05b6d | ||
|
|
f4276c36c9 | ||
|
|
ba05bddf92 | ||
|
|
ee59a9f9f0 | ||
|
|
7654682c25 | ||
|
|
7a63d75a83 | ||
|
|
da3f74a70e | ||
|
|
b1c0d33128 | ||
|
|
9a692c0769 | ||
|
|
11a3c7b50a | ||
|
|
acfe7dc475 | ||
|
|
5f26656fc5 | ||
|
|
64548deafc | ||
|
|
2f76e90d1a | ||
|
|
1296329f02 | ||
|
|
640b7d514d | ||
|
|
e38b432846 | ||
|
|
549a5101e7 | ||
|
|
031a8648cb | ||
|
|
a8476a8404 | ||
|
|
25c8491fc8 | ||
|
|
d603c89397 | ||
|
|
cdd4330edc | ||
|
|
389c655a5a | ||
|
|
31cafa0a3e | ||
|
|
3011945d6f | ||
|
|
7ecf7bdc6b | ||
|
|
4cd137127f | ||
|
|
0a2547e83d | ||
|
|
d209ec76b2 | ||
|
|
92d9534c1a | ||
|
|
d0d637dd47 | ||
|
|
1d0240500c | ||
|
|
977c6bd44c | ||
|
|
89ad3aa168 | ||
|
|
55b921dab2 | ||
|
|
92d0fe938f | ||
|
|
d07e9b03c4 | ||
|
|
4db4affbaf | ||
|
|
8764c2595d | ||
|
|
4ec05bf614 | ||
|
|
871f5cd155 | ||
|
|
f0a8fe0bf6 | ||
|
|
a93c942070 | ||
|
|
6cbd1cba68 | ||
|
|
3b8df1f143 | ||
|
|
85f7d0a8d5 | ||
|
|
556450a2ff | ||
|
|
6048b12510 | ||
|
|
8cafc1e1ac | ||
|
|
51807d7608 | ||
|
|
e104df5bb7 | ||
|
|
c6df7e5899 | ||
|
|
d0a4300dde | ||
|
|
d8865433f9 | ||
|
|
9c2bd642ba | ||
|
|
09883db208 | ||
|
|
f7f68f7160 | ||
|
|
31f744a8c0 | ||
|
|
bc66c96275 | ||
|
|
87c2acdeae | ||
|
|
6b90023764 | ||
|
|
e502bca962 | ||
|
|
c4d44b72e8 | ||
|
|
e7324bb94f | ||
|
|
8431b2c190 | ||
|
|
7d376ccd8c | ||
|
|
382410249d | ||
|
|
bfb5132362 | ||
|
|
4489dbc630 | ||
|
|
5c31bc8ffc | ||
|
|
baee5f46cf | ||
|
|
66ab7ffa15 | ||
|
|
32df7eb346 | ||
|
|
576b532b45 | ||
|
|
b520414d5a | ||
|
|
b54fd5c588 | ||
|
|
d9b4c01719 | ||
|
|
84d5d968a6 | ||
|
|
9c8717e42f | ||
|
|
3215e97b17 | ||
|
|
975e721432 | ||
|
|
b8bccdd081 | ||
|
|
4310a4d813 | ||
|
|
b96b342561 | ||
|
|
eb1cd11d57 | ||
|
|
a55c72890d | ||
|
|
247e230581 | ||
|
|
1586ea6fe9 | ||
|
|
ae505c50b0 | ||
|
|
fce1b4b1fb | ||
|
|
c6bcbf4951 | ||
|
|
6ed6086da5 | ||
|
|
9f7b16ad19 | ||
|
|
fc70a92071 | ||
|
|
ccaaab2898 | ||
|
|
8d36e630f2 | ||
|
|
eb1f347bca | ||
|
|
7db798186c | ||
|
|
a1cd94bfbb | ||
|
|
d9d2a6f6d9 | ||
|
|
b8c4b82d18 | ||
|
|
b8f615d7a1 | ||
|
|
35d97eb5c5 | ||
|
|
fc15b2e479 | ||
|
|
936df0d290 | ||
|
|
3236beddf8 | ||
|
|
c13f8f10e6 | ||
|
|
d8b530b93c | ||
|
|
2296f211e8 | ||
|
|
a5136b8863 | ||
|
|
913bc38217 | ||
|
|
4b7dca3d2c | ||
|
|
5c58e3ee31 | ||
|
|
49f304bd07 | ||
|
|
c95be42221 | ||
|
|
dbc07e13bb | ||
|
|
5ca40ebc22 | ||
|
|
a8e07274ae | ||
|
|
af99dba018 | ||
|
|
03dfa028d2 | ||
|
|
541b47ac2a | ||
|
|
507a35a9be | ||
|
|
1eddb5463e | ||
|
|
d91769efd4 | ||
|
|
134a8eb272 | ||
|
|
930be98598 | ||
|
|
28e3cb3e93 | ||
|
|
6328671ef8 | ||
|
|
fab1959d00 | ||
|
|
5ab788cd84 | ||
|
|
ce2a6d3739 | ||
|
|
40dd10dfb2 | ||
|
|
e41076e082 | ||
|
|
582fec4e11 | ||
|
|
42ae02aa08 | ||
|
|
79e3fc64c4 | ||
|
|
b188d671d1 | ||
|
|
5ecf1b53ea | ||
|
|
0636311d37 | ||
|
|
219d3b449f | ||
|
|
22eaa89c5a | ||
|
|
79e28a4c2e | ||
|
|
db05b1eb2b | ||
|
|
d20666a228 | ||
|
|
9cc7b03503 | ||
|
|
b38f12d519 | ||
|
|
e736f1ead9 | ||
|
|
b56c1f6023 | ||
|
|
268f0d64fc | ||
|
|
b3ea17736b | ||
|
|
963daeaec5 | ||
|
|
249bd44ebc | ||
|
|
04a1b1c123 | ||
|
|
3922e7afc3 | ||
|
|
f0a97a0d80 | ||
|
|
88713fd590 | ||
|
|
394759e0c8 | ||
|
|
c229f65dcf | ||
|
|
f929861609 | ||
|
|
f024ce7675 | ||
|
|
f3fcf00392 | ||
|
|
08313ef870 | ||
|
|
911c469d69 | ||
|
|
07c089ee04 | ||
|
|
dadc944810 | ||
|
|
80663032a9 | ||
|
|
67c75ee7f0 | ||
|
|
62626737a5 | ||
|
|
e404eed318 | ||
|
|
3c115428ea | ||
|
|
db40ca4aca | ||
|
|
f456d0d6bb | ||
|
|
06fe17eb9f | ||
|
|
7945bdb88f | ||
|
|
f7794ec181 | ||
|
|
16851b3eb3 | ||
|
|
c72d8d4d29 | ||
|
|
2b7436558e | ||
|
|
e59c47d5b1 | ||
|
|
c1523ad16d | ||
|
|
d0be8e27de | ||
|
|
5c66b81289 | ||
|
|
1a42cb2013 | ||
|
|
cf2978cbbb | ||
|
|
8a9733e777 | ||
|
|
ba880c5501 | ||
|
|
788f962fbd | ||
|
|
12f8283560 | ||
|
|
4d27f6b77b | ||
|
|
413ed28246 | ||
|
|
ad084f559a | ||
|
|
3832ab1c21 | ||
|
|
999bceb413 | ||
|
|
e8f6605642 | ||
|
|
3148c65323 | ||
|
|
0a3d2cc68b | ||
|
|
11cf76edb3 | ||
|
|
8833ad415c | ||
|
|
bc290d8e6c | ||
|
|
9c5b3a4060 | ||
|
|
04bbba55c7 | ||
|
|
40b70d5373 | ||
|
|
833d32646e | ||
|
|
6cdefb3cac | ||
|
|
f959d3ee7a | ||
|
|
b0952eabc7 | ||
|
|
43bb4ba4bf | ||
|
|
c2de22abeb | ||
|
|
a0113ee049 | ||
|
|
05db10fda3 | ||
|
|
948ee23a2a | ||
|
|
271a2931b6 | ||
|
|
9fe05edd47 | ||
|
|
c2573702cf | ||
|
|
b8e76b586e | ||
|
|
11a89964b9 | ||
|
|
b5bfcbae59 | ||
|
|
efe95a6953 | ||
|
|
e88a5eca8b | ||
|
|
2e3980e1de | ||
|
|
0ff85c6923 | ||
|
|
e3358d1839 | ||
|
|
f5eac0c7fa | ||
|
|
6034592a27 | ||
|
|
7b00d826d3 | ||
|
|
52ef3586b9 | ||
|
|
4118fcdd14 | ||
|
|
d9e18047d3 | ||
|
|
734f320ade | ||
|
|
79f25cdeb2 | ||
|
|
413f3db617 | ||
|
|
4db11d5143 | ||
|
|
78d28c6b96 | ||
|
|
24df7333a2 | ||
|
|
8694cd8bf5 | ||
|
|
a6cc627446 | ||
|
|
6a9c2cefdd | ||
|
|
8fb550cc3e | ||
|
|
6917b51660 | ||
|
|
0ffb71a6af | ||
|
|
79134c69a4 | ||
|
|
4a82d69b9f | ||
|
|
1eb14e95d3 | ||
|
|
65a0992f0d | ||
|
|
5ca69e43ec | ||
|
|
d6d8075c0a | ||
|
|
35f5196386 | ||
|
|
71a3c1f821 | ||
|
|
02a5e33061 | ||
|
|
398b5a31a7 | ||
|
|
d0c40591f2 | ||
|
|
f783101c88 | ||
|
|
97a9b48789 | ||
|
|
56f6396137 | ||
|
|
a5fa5c9013 | ||
|
|
800d1e9a67 | ||
|
|
dbed41fde1 | ||
|
|
4198360421 | ||
|
|
1916f6ae42 | ||
|
|
e0784c72f4 | ||
|
|
43aaf6eb37 | ||
|
|
51650b8a65 | ||
|
|
79084216af | ||
|
|
eb58091392 | ||
|
|
895a9c97e2 | ||
|
|
72b633026b | ||
|
|
d8d7b949d9 | ||
|
|
b3ff968558 | ||
|
|
145f5c8164 | ||
|
|
a7dbcba1e8 | ||
|
|
c3f52f12bb | ||
|
|
7edd45814c | ||
|
|
701dbaa81e | ||
|
|
ae4bd5c2be | ||
|
|
6b12c08bfc | ||
|
|
3779c69674 | ||
|
|
ebd7f9a371 | ||
|
|
beb572e616 | ||
|
|
3424ee7354 | ||
|
|
e826d7e200 | ||
|
|
d120996a49 | ||
|
|
6bc53be992 | ||
|
|
f46918d129 | ||
|
|
73b064c2af | ||
|
|
b3870ab5f9 | ||
|
|
86dc981475 | ||
|
|
d60b8fab03 | ||
|
|
1721829464 | ||
|
|
f628ee2fa4 | ||
|
|
ad310547a2 | ||
|
|
629330e761 | ||
|
|
b511b60aaa | ||
|
|
77be22c09a | ||
|
|
b0270f77a9 | ||
|
|
3a5a759bb7 | ||
|
|
d5d63601b9 | ||
|
|
a7d0c94169 | ||
|
|
3a51203c48 | ||
|
|
4deeb795f6 | ||
|
|
26e47d9a71 | ||
|
|
170b70ce30 | ||
|
|
1ce0836b4a | ||
|
|
5c60b2367e | ||
|
|
b7f9593715 | ||
|
|
e64746200b | ||
|
|
c3d51c14f2 | ||
|
|
7b34df33a5 | ||
|
|
ddfebd35be | ||
|
|
9c3ab68145 | ||
|
|
917648ecb9 | ||
|
|
584b96e859 | ||
|
|
228c637527 | ||
|
|
c3dda6daea | ||
|
|
73b029f9d3 | ||
|
|
5dd2b8e208 | ||
|
|
4093607bc9 | ||
|
|
878b31e0b4 | ||
|
|
7806777139 | ||
|
|
94d9362fc5 | ||
|
|
16e11660fe | ||
|
|
250dfe1777 | ||
|
|
5b77916ecd | ||
|
|
67864af957 | ||
|
|
a4981d4ded | ||
|
|
37f116a900 | ||
|
|
8f3dd833d7 | ||
|
|
36d7bc7530 | ||
|
|
d029a75d4f | ||
|
|
dff799ef89 | ||
|
|
272489dc69 | ||
|
|
5fea36fb00 | ||
|
|
5b5dcf8b88 | ||
|
|
761bf9f06f | ||
|
|
c33ab4e8df | ||
|
|
0cc2f95a9d | ||
|
|
5ff38d3e16 | ||
|
|
865f4f073a | ||
|
|
51d9250c88 | ||
|
|
8a7df0024b | ||
|
|
859665d847 | ||
|
|
484a8a10fe | ||
|
|
2ae022da7e | ||
|
|
d020e9d826 | ||
|
|
d1e8c8694d | ||
|
|
07748d1b2c | ||
|
|
cfbed9bdf2 | ||
|
|
22f28966c4 | ||
|
|
837a3d1745 | ||
|
|
704228f7e7 | ||
|
|
299d73503c | ||
|
|
25d8224d15 | ||
|
|
03008a08d1 | ||
|
|
4fb046a52d | ||
|
|
fcbd7870e9 | ||
|
|
25228abdc1 | ||
|
|
73d57cb97b | ||
|
|
377657d1d6 | ||
|
|
c1bfe686ce | ||
|
|
c6de22da1d | ||
|
|
9c0f094b21 | ||
|
|
f50c91b7bd | ||
|
|
db3b88dad2 | ||
|
|
ae498dcff3 | ||
|
|
5cded0b4b5 | ||
|
|
3f549259b2 | ||
|
|
6c97ddbffc | ||
|
|
5a0be341ba | ||
|
|
10781048be | ||
|
|
1b8e567237 | ||
|
|
1ea0ff34fa | ||
|
|
b182893c04 | ||
|
|
8b6a889881 | ||
|
|
3097f618f2 | ||
|
|
1fd5fb33c2 |
78
.appveyor.yml
Normal file
78
.appveyor.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
version: 1.6.x-{build}
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /libpng[0-1][0-7]/
|
||||
|
||||
image:
|
||||
- Visual Studio 2022
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- TOOLCHAIN: vstudio
|
||||
AUTOMATION: cmake
|
||||
ARCH: x86
|
||||
- TOOLCHAIN: vstudio
|
||||
AUTOMATION: cmake
|
||||
ARCH: x64
|
||||
- TOOLCHAIN: vstudio
|
||||
AUTOMATION: cmake
|
||||
ARCH: arm64
|
||||
- TOOLCHAIN: llvm
|
||||
AUTOMATION: cmake
|
||||
ARCH: x64
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: cmake
|
||||
ARCH: i686
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: cmake
|
||||
ARCH: x86_64
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: configure
|
||||
ARCH: i686
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: configure
|
||||
ARCH: x86_64
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: makefiles
|
||||
ARCH: i686
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: makefiles
|
||||
ARCH: x86_64
|
||||
|
||||
install:
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
|
||||
|
||||
before_build:
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang.exe'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" set CI_CMAKE_GENERATOR=Unix Makefiles'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set PATH=C:\msys64\mingw32\bin;%PATH%'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set PATH=C:\msys64\mingw64\bin;%PATH%'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" set CI_CC=%ARCH%-w64-mingw32-gcc.exe'
|
||||
- 'set CI_CMAKE_BUILD_FLAGS=-j2'
|
||||
- 'set CI_CTEST_FLAGS=-j2'
|
||||
- 'set CI_MAKE_FLAGS=-j2'
|
||||
- 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
|
||||
|
||||
build_script:
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'
|
||||
|
||||
cache:
|
||||
- C:\tools\vcpkg\installed
|
||||
79
.gitignore
vendored
Normal file
79
.gitignore
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Precompiled headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Linker output files
|
||||
*.exp
|
||||
*.ilk
|
||||
*.map
|
||||
|
||||
# Compiled dynamic libraries
|
||||
*.dll
|
||||
*.dylib
|
||||
*.so
|
||||
*.so.*
|
||||
|
||||
# Compiled static libraries
|
||||
*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.lib
|
||||
|
||||
# Compiled executables
|
||||
*.app/
|
||||
*.exe
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.idb
|
||||
*.pdb
|
||||
*.su
|
||||
|
||||
# Libpng configuration and build artifacts
|
||||
*.out
|
||||
.deps/
|
||||
.dirstamp
|
||||
/Makefile
|
||||
/autom4te.cache/
|
||||
/config.guess~
|
||||
/config.h.in~
|
||||
/config.log
|
||||
/config.status
|
||||
/config.sub~
|
||||
/configure~
|
||||
/install-sh~
|
||||
/libpng-config
|
||||
/libpng.pc
|
||||
/libpng.vers
|
||||
/libpng16-config
|
||||
/libpng16.pc
|
||||
/libtool
|
||||
/stamp-h1
|
||||
pnglibconf.[ch]
|
||||
pnglibconf.dfn
|
||||
pnglibconf.pre
|
||||
pngprefix.h
|
||||
|
||||
# Libpng test artifacts
|
||||
png-fix-itxt
|
||||
pngcp
|
||||
pngfix
|
||||
pngimage
|
||||
pngstest
|
||||
pngtest
|
||||
pngunknown
|
||||
pngvalid
|
||||
timepng
|
||||
pngout.png
|
||||
|
||||
# Libpng CI artifacts
|
||||
out/
|
||||
33
.travis.yml
Normal file
33
.travis.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
branches:
|
||||
except:
|
||||
- /libpng[0-1][0-7]/
|
||||
|
||||
language: c
|
||||
|
||||
os:
|
||||
- freebsd
|
||||
- linux
|
||||
- osx
|
||||
|
||||
env:
|
||||
- AUTOMATION=cmake CI_CMAKE_VARS="-DPNG_HARDWARE_OPTIMIZATIONS=ON"
|
||||
- AUTOMATION=cmake CI_CMAKE_VARS="-DPNG_HARDWARE_OPTIMIZATIONS=OFF"
|
||||
- AUTOMATION=configure CI_CONFIGURE_FLAGS="--enable-hardware-optimizations"
|
||||
- AUTOMATION=configure CI_CONFIGURE_FLAGS="--disable-hardware-optimizations"
|
||||
- AUTOMATION=makefiles
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
env: AUTOMATION=cmake CI_CMAKE_GENERATOR=Xcode
|
||||
|
||||
before_script:
|
||||
- 'if test "$TRAVIS_OS_NAME" = "linux"; then export CI_CC="gcc"; else export CI_CC="clang"; fi'
|
||||
- 'if test "$TRAVIS_OS_NAME" != "osx"; then export CI_SANITIZERS="address,undefined"; fi'
|
||||
- 'export CI_MAKEFILES="scripts/makefile.$CI_CC scripts/makefile.std"'
|
||||
- 'export CI_MAKE_FLAGS=-j2'
|
||||
- 'export CI_CMAKE_BUILD_FLAGS=-j2'
|
||||
- 'export CI_CTEST_FLAGS=-j2'
|
||||
|
||||
script:
|
||||
- './ci/ci_verify_$AUTOMATION.sh'
|
||||
5
.yamllint.yml
Normal file
5
.yamllint.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
extends: default
|
||||
rules:
|
||||
document-start: disable
|
||||
document-end: disable
|
||||
line-length: disable
|
||||
76
ANNOUNCE
76
ANNOUNCE
@@ -1,22 +1,66 @@
|
||||
libpng 1.6.41 - January 24, 2024
|
||||
================================
|
||||
|
||||
Libpng 1.0.12beta1 - May 14, 2001
|
||||
This is a public release of libpng, intended for use in production code.
|
||||
|
||||
This is a public release of libpng, intended for use in production codes.
|
||||
|
||||
Changes since the last public release (1.0.11):
|
||||
Files available for download
|
||||
----------------------------
|
||||
|
||||
Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot)
|
||||
Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h
|
||||
Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings.
|
||||
Bumped DLLNUM to 2.
|
||||
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
|
||||
Eliminated the png_error about apps using png_read|write_init(). Instead,
|
||||
libpng will reallocate the png_struct and info_struct if they are too small.
|
||||
This achieves future binary compatibility for old applications written for
|
||||
libpng-0.88 and earlier.
|
||||
Modified png_create_struct so it passes user mem_ptr to user memory allocator.
|
||||
Source files with LF line endings (for Unix/Linux):
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||
* libpng-1.6.41.tar.xz (LZMA-compressed, recommended)
|
||||
* libpng-1.6.41.tar.gz (deflate-compressed)
|
||||
|
||||
Glenn R-P
|
||||
Source files with CRLF line endings (for Windows):
|
||||
|
||||
* lpng1641.7z (LZMA-compressed, recommended)
|
||||
* lpng1641.zip (deflate-compressed)
|
||||
|
||||
Other information:
|
||||
|
||||
* README.md
|
||||
* LICENSE.md
|
||||
* AUTHORS.md
|
||||
* TRADEMARK.md
|
||||
|
||||
|
||||
Changes from version 1.6.40 to version 1.6.41
|
||||
---------------------------------------------
|
||||
|
||||
* Added SIMD-optimized code for the Loongarch LSX hardware.
|
||||
(Contributed by GuXiWei, JinBo and ZhangLixia)
|
||||
* Fixed the run-time discovery of MIPS MSA hardware.
|
||||
(Contributed by Sui Jingfeng)
|
||||
* Fixed an off-by-one error in the function `png_do_check_palette_indexes`,
|
||||
which failed to recognize errors that might have existed in the first
|
||||
column of a broken palette-encoded image. This was a benign regression
|
||||
accidentally introduced in libpng-1.6.33. No pixel was harmed.
|
||||
(Contributed by Adam Richter; reviewed by John Bowler)
|
||||
* Fixed, improved and modernized the contrib/pngminus programs, i.e.,
|
||||
png2pnm.c and pnm2png.c
|
||||
* Removed old and peculiar portability hacks that were meant to silence
|
||||
warnings issued by gcc version 7.1 alone.
|
||||
(Contributed by John Bowler)
|
||||
* Fixed and modernized the CMake file, and raised the minimum required
|
||||
CMake version from 3.1 to 3.6.
|
||||
(Contributed by Clinton Ingram, Timothy Lyanguzov, Tyler Kropp, et al.)
|
||||
* Allowed the configure script to disable the building of auxiliary tools
|
||||
and tests, thus catching up with the CMake file.
|
||||
(Contributed by Carlo Bramini)
|
||||
* Fixed a build issue on Mac.
|
||||
(Contributed by Zixu Wang)
|
||||
* Moved the Autoconf macro files to scripts/autoconf.
|
||||
* Moved the CMake files (except for the main CMakeLists.txt) to
|
||||
scripts/cmake and moved the list of their contributing authors to
|
||||
scripts/cmake/AUTHORS.md
|
||||
* Updated the CI configurations and scripts.
|
||||
* Relicensed the CI scripts to the MIT License.
|
||||
* Improved the test coverage.
|
||||
(Contributed by John Bowler)
|
||||
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe.
|
||||
|
||||
60
AUTHORS
Normal file
60
AUTHORS
Normal file
@@ -0,0 +1,60 @@
|
||||
PNG REFERENCE LIBRARY AUTHORS
|
||||
=============================
|
||||
|
||||
This is the list of PNG Reference Library ("libpng") Contributing
|
||||
Authors, for copyright and licensing purposes.
|
||||
|
||||
* Adam Richter
|
||||
* Andreas Dilger
|
||||
* Cosmin Truta
|
||||
* Dave Martindale
|
||||
* Eric S. Raymond
|
||||
* Gilles Vollant
|
||||
* Glenn Randers-Pehrson
|
||||
* Greg Roelofs
|
||||
* Guy Eric Schalnat
|
||||
* James Yu
|
||||
* John Bowler
|
||||
* Kevin Bracey
|
||||
* Magnus Holmgren
|
||||
* Mandar Sahastrabuddhe
|
||||
* Mans Rullgard
|
||||
* Matt Sarett
|
||||
* Mike Klein
|
||||
* Pascal Massimino
|
||||
* Paul Schmidt
|
||||
* Philippe Antoine
|
||||
* Qiang Zhou
|
||||
* Sam Bushell
|
||||
* Samuel Williams
|
||||
* Simon-Pierre Cadieux
|
||||
* Tim Wegner
|
||||
* Tom Lane
|
||||
* Tom Tanner
|
||||
* Vadim Barkov
|
||||
* Willem van Schaik
|
||||
* Zhijie Liang
|
||||
* Apple Inc.
|
||||
- Zixu Wang (王子旭)
|
||||
* Arm Holdings
|
||||
- Richard Townsend
|
||||
* Google Inc.
|
||||
- Dan Field
|
||||
- Leon Scroggins III
|
||||
- Matt Sarett
|
||||
- Mike Klein
|
||||
- Sami Boukortt
|
||||
- Wan-Teh Chang
|
||||
* Loongson Technology Corporation Ltd.
|
||||
- GuXiWei (顾希伟)
|
||||
- JinBo (金波)
|
||||
- ZhangLixia (张利霞)
|
||||
|
||||
The build projects, the build scripts, the test scripts, and other
|
||||
files in the "projects", "scripts" and "tests" directories, have
|
||||
other copyright owners, but are released under the libpng license.
|
||||
|
||||
Some files in the "ci" and "contrib" directories, as well as some
|
||||
of the tools-generated files that are distributed with libpng, have
|
||||
other copyright owners, and are released under other open source
|
||||
licenses.
|
||||
1079
CMakeLists.txt
Normal file
1079
CMakeLists.txt
Normal file
File diff suppressed because it is too large
Load Diff
527
INSTALL
527
INSTALL
@@ -1,137 +1,464 @@
|
||||
|
||||
Installing libpng version 1.0.12beta1 - May 14, 2001
|
||||
Installing libpng
|
||||
|
||||
Before installing libpng, you must first install zlib. zlib
|
||||
can usually be found wherever you got libpng. zlib can be
|
||||
placed in another directory, at the same level as libpng.
|
||||
Note that your system might already have a preinstalled
|
||||
zlib, but you will still need to have access to the
|
||||
zlib.h and zconf.h include files that correspond to the
|
||||
version of zlib that's installed.
|
||||
Contents
|
||||
|
||||
I. Simple installation
|
||||
II. Rebuilding the configure scripts
|
||||
III. Using scripts/makefile*
|
||||
IV. Using cmake
|
||||
V. Directory structure
|
||||
VI. Building with project files
|
||||
VII. Building with makefiles
|
||||
VIII. Configuring libpng for 16-bit platforms
|
||||
IX. Configuring for DOS
|
||||
X. Configuring for Medium Model
|
||||
XI. Prepending a prefix to exported symbols
|
||||
XII. Configuring for compiler xxx:
|
||||
XIII. Removing unwanted object code
|
||||
XIV. Enabling or disabling hardware optimizations
|
||||
XV. Changes to the build and configuration of libpng in libpng-1.5.x
|
||||
XVI. Setjmp/longjmp issues
|
||||
XVII. Common linking failures
|
||||
XVIII. Other sources of information about libpng
|
||||
|
||||
I. Simple installation
|
||||
|
||||
On Unix/Linux and similar systems, you can simply type
|
||||
|
||||
./configure [--prefix=/path]
|
||||
make check
|
||||
make install
|
||||
|
||||
and ignore the rest of this document. "/path" is the path to the directory
|
||||
where you want to install the libpng "lib", "include", and "bin"
|
||||
subdirectories.
|
||||
|
||||
If you downloaded a GIT clone, you will need to run ./autogen.sh before
|
||||
running ./configure, to create "configure" and "Makefile.in" which are
|
||||
not included in the GIT repository.
|
||||
|
||||
Note that "configure" is only included in the "*.tar" distributions and not
|
||||
in the "*.zip" or "*.7z" distributions. If you downloaded one of those
|
||||
distributions, see "Building with project files" or "Building with makefiles",
|
||||
below.
|
||||
|
||||
II. Rebuilding the configure scripts
|
||||
|
||||
If configure does not work on your system, or if you have a need to
|
||||
change configure.ac or Makefile.am, and you have a reasonably
|
||||
up-to-date set of tools, running ./autogen.sh in a git clone before
|
||||
running ./configure may fix the problem. To be really sure that you
|
||||
aren't using any of the included pre-built scripts, especially if you
|
||||
are building from a tar distribution instead of a git distribution,
|
||||
do this:
|
||||
|
||||
./configure --enable-maintainer-mode
|
||||
make maintainer-clean
|
||||
./autogen.sh --maintainer --clean
|
||||
./autogen.sh --maintainer
|
||||
./configure [--prefix=/path] [other options]
|
||||
make
|
||||
make install
|
||||
make check
|
||||
|
||||
III. Using scripts/makefile*
|
||||
|
||||
Instead, you can use one of the custom-built makefiles in the
|
||||
"scripts" directory
|
||||
|
||||
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
|
||||
cp scripts/makefile.system makefile
|
||||
make test
|
||||
make install
|
||||
|
||||
The files that are presently available in the scripts directory
|
||||
are listed and described in scripts/README.txt.
|
||||
|
||||
Or you can use one of the "projects" in the "projects" directory.
|
||||
|
||||
Before installing libpng, you must first install zlib, if it
|
||||
is not already on your system. zlib can usually be found
|
||||
wherever you got libpng; otherwise go to https://zlib.net/. You can
|
||||
place zlib in the same directory as libpng or in another directory.
|
||||
|
||||
If your system already has a preinstalled zlib you will still need
|
||||
to have access to the zlib.h and zconf.h include files that
|
||||
correspond to the version of zlib that's installed.
|
||||
|
||||
If you wish to test with a particular zlib that is not first in the
|
||||
standard library search path, put ZLIBLIB, ZLIBINC, CPPFLAGS, LDFLAGS,
|
||||
and LD_LIBRARY_PATH in your environment before running "make test"
|
||||
or "make distcheck":
|
||||
|
||||
ZLIBLIB=/path/to/lib export ZLIBLIB
|
||||
ZLIBINC=/path/to/include export ZLIBINC
|
||||
CPPFLAGS="-I$ZLIBINC" export CPPFLAGS
|
||||
LDFLAGS="-L$ZLIBLIB" export LDFLAGS
|
||||
LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
|
||||
|
||||
If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
|
||||
in your environment and type
|
||||
|
||||
make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test
|
||||
|
||||
IV. Using cmake
|
||||
|
||||
If you want to use "cmake" (see www.cmake.org), type
|
||||
|
||||
cmake . -DCMAKE_INSTALL_PREFIX=/path
|
||||
make
|
||||
make install
|
||||
|
||||
As when using the simple configure method described above, "/path" points to
|
||||
the installation directory where you want to put the libpng "lib", "include",
|
||||
and "bin" subdirectories.
|
||||
|
||||
V. Directory structure
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.0.12beta1" or "lpng109" and "zlib-1.1.3"
|
||||
or "zlib113") so that you have directories called "zlib" and "libpng".
|
||||
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.8"
|
||||
or "zlib128") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
|
||||
.. (the parent directory)
|
||||
libpng (this directory)
|
||||
.. (the parent directory)
|
||||
libpng (this directory)
|
||||
INSTALL (this file)
|
||||
README
|
||||
*.h
|
||||
*.c
|
||||
*.h, *.c => libpng source files
|
||||
CMakeLists.txt => "cmake" script
|
||||
ci
|
||||
ci_*.sh
|
||||
configuration files:
|
||||
configure.ac, configure, Makefile.am, Makefile.in,
|
||||
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
|
||||
libpng-config.in, aclocal.m4, config.h.in, config.sub,
|
||||
depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
|
||||
contrib
|
||||
gregbook
|
||||
msvctest
|
||||
pngminus
|
||||
pngsuite
|
||||
visupng
|
||||
arm-neon, conftest, examples, gregbook, libtests, pngminim,
|
||||
pngminus, pngsuite, tools, visupng
|
||||
projects
|
||||
beos
|
||||
borland
|
||||
msvc
|
||||
wince
|
||||
owatcom, visualc71, vstudio
|
||||
scripts
|
||||
makefile.*
|
||||
*.def (module definition files)
|
||||
etc.
|
||||
pngtest.png
|
||||
etc.
|
||||
zlib
|
||||
README
|
||||
*.h
|
||||
*.c
|
||||
contrib
|
||||
etc.
|
||||
README, *.h, *.c, contrib, etc.
|
||||
|
||||
If the line endings in the files look funny, you may wish to get the other
|
||||
distribution of libpng. It is available in both tar.gz (UNIX style line
|
||||
endings) and zip (DOS style line endings) formats.
|
||||
|
||||
If you are building libpng with MSVC, you can enter the libpng\msvc directory
|
||||
and follow the instructions in msvc\README.txt. You can build libpng for
|
||||
WindowsCE by entering the libpng\wince directory and following the
|
||||
instructions in the README* files.
|
||||
VI. Building with project files
|
||||
|
||||
Else enter the zlib directory and follow the instructions in zlib/README,
|
||||
then come back here and choose the appropriate makefile.sys in the scripts
|
||||
directory.
|
||||
If you are building libpng with Microsoft Visual Studio, you can enter
|
||||
the directory projects\visualc71 or projects\vstudio and follow the
|
||||
instructions in README.txt.
|
||||
|
||||
The files that are presently available in the scripts directory
|
||||
include
|
||||
Otherwise, enter the zlib directory and follow the instructions in
|
||||
zlib/README, then come back here and run "configure" or choose the
|
||||
appropriate makefile in the scripts directory.
|
||||
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.12beta1,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
ftp://ftp.cs.wisc.edu/ghost)
|
||||
makefile.aix => AIX makefile
|
||||
makefile.cygwin => Cygwin/gcc makefile
|
||||
makefile.dec => DEC Alpha UNIX makefile
|
||||
makefile.hpgcc => HPUX makefile using gcc
|
||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||
makefile.intel => Intel C/C++ version 4.0 and later
|
||||
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||
makefile.macosx => MACOS X Makefile
|
||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.mips => MIPS makefile
|
||||
makefile.acorn => Acorn makefile
|
||||
makefile.amiga => Amiga makefile
|
||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
|
||||
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
|
||||
makefile.atari => Atari makefile
|
||||
makefile.beos => BEOS makefile for X86
|
||||
makefile.bor => Borland makefile (uses bcc)
|
||||
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
|
||||
makefile.bd32 => To make a png32bd.dll with Borland C++ 4.5
|
||||
makefile.tc3 => Turbo C 3.0 makefile
|
||||
makefile.dj2 => DJGPP 2 makefile
|
||||
makefile.msc => Microsoft C makefile
|
||||
makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and later (uses
|
||||
assembler code tuned for Intel MMX platform)
|
||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later (does
|
||||
not use assembler code)
|
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
||||
pngos2.def => OS/2 module definition file used by makefile.os2
|
||||
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
|
||||
makevms.com => VMS build script
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5
|
||||
SCOPTIONS.ppc => Used with smakefile.ppc
|
||||
VII. Building with makefiles
|
||||
|
||||
Copy the file (or files) that you need from the
|
||||
scripts directory into this directory, for example
|
||||
|
||||
MSDOS example: copy scripts\makefile.msc makefile
|
||||
UNIX example: cp scripts/makefile.std makefile
|
||||
UNIX example:
|
||||
|
||||
cp scripts/makefile.std Makefile
|
||||
make
|
||||
|
||||
Windows example:
|
||||
|
||||
nmake -f scripts\makefile.vcwin32
|
||||
|
||||
Read the makefile to see if you need to change any source or
|
||||
target directories to match your preferences.
|
||||
|
||||
Then read pngconf.h to see if you want to make any configuration
|
||||
Then read pnglibconf.dfa to see if you want to make any configuration
|
||||
changes.
|
||||
|
||||
Then just run "make test" which will create the libpng library in
|
||||
this directory and run a quick test that reads the "pngtest.png"
|
||||
file and writes a "pngout.png" file that should be identical to it.
|
||||
Look for "9782 zero samples" in the output of the test. For more
|
||||
confidence, you can run another test by typing "pngtest pngnow.png"
|
||||
and looking for "289 zero samples" in the output. Also, you can
|
||||
run "pngtest -m *.png" in the "contrib/pngsuite" directory and compare
|
||||
Then just run "make" which will create the libpng library in
|
||||
this directory and "make test" which will run a quick test that reads
|
||||
the "pngtest.png" file and writes a "pngout.png" file that should be
|
||||
identical to it. Look for "9782 zero samples" in the output of the
|
||||
test. For more confidence, you can run another test by typing
|
||||
"pngtest pngnow.png" and looking for "289 zero samples" in the output.
|
||||
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
|
||||
your output with the result shown in contrib/pngsuite/README.
|
||||
|
||||
Most of the makefiles will allow you to run "make install" to
|
||||
put the library in its final resting place (if you want to
|
||||
do that, run "make install" in the zlib directory first if necessary).
|
||||
Most of the makefiles used to allow you to run "make install" to put
|
||||
the library in its final resting place, but that feature is no longer
|
||||
supported. The only tested and supported manners to install libpng are
|
||||
the conventional build and install procedures driven by the configure
|
||||
script or by the CMake file.
|
||||
|
||||
Further information can be found in the README and libpng.txt
|
||||
files, in the individual makefiles, in png.h, in the README files in
|
||||
subdirectories of the LIB directory, and the manual pages libpng.3 and png.5.
|
||||
VIII. Configuring for DOS and other 16-bit platforms
|
||||
|
||||
Officially, the support for 16-bit platforms has been removed.
|
||||
|
||||
For DOS users who only have access to the lower 640K, you will
|
||||
have to limit zlib's memory usage via a png_set_compression_mem_level()
|
||||
call. See zlib.h or zconf.h in the zlib library for more information.
|
||||
|
||||
You may be or may not be in luck if you target the "large" memory model,
|
||||
but all the smaller models ("small", "compact" and "medium") are known
|
||||
to be unworkable. For DOS users who have access beyond the lower 640K,
|
||||
a "flat" 32-bit DOS model (such as DJGPP) is strongly recommended.
|
||||
|
||||
For DOS users who only have access to the lower 640K, you will have to
|
||||
limit zlib's memory usage via a png_set_compression_mem_level() call.
|
||||
You will also have to look into zconf.h to tell zlib (and thus libpng)
|
||||
that it cannot allocate more than 64K at a time. Even if you can, the
|
||||
memory won't be accessible. Therefore, you should limit zlib and libpng
|
||||
to 64K by defining MAXSEG_64K.
|
||||
|
||||
IX. Prepending a prefix to exported symbols
|
||||
|
||||
Starting with libpng-1.6.0, you can configure libpng (when using the
|
||||
"configure" script) to prefix all exported symbols by means of the
|
||||
configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
|
||||
string beginning with a letter and containing only uppercase
|
||||
and lowercase letters, digits, and the underscore (i.e., a C language
|
||||
identifier). This creates a set of macros in pnglibconf.h, so this is
|
||||
transparent to applications; their function calls get transformed by
|
||||
the macros to use the modified names.
|
||||
|
||||
X. Configuring for compiler xxx:
|
||||
|
||||
All includes for libpng are in pngconf.h. If you need to add, change
|
||||
or delete an include, this is the place to do it.
|
||||
The includes that are not needed outside libpng are placed in pngpriv.h,
|
||||
which is only used by the routines inside libpng itself.
|
||||
The files in libpng proper only include pngpriv.h and png.h, which
|
||||
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
|
||||
As of libpng-1.5.0, pngpriv.h also includes three other private header
|
||||
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
|
||||
that previously appeared in the public headers.
|
||||
|
||||
XI. Removing unwanted object code
|
||||
|
||||
There are a bunch of #define's in pngconf.h that control what parts of
|
||||
libpng are compiled. All the defines end in _SUPPORTED. If you are
|
||||
never going to use a capability, you can change the #define to #undef
|
||||
before recompiling libpng and save yourself code and data space, or
|
||||
you can turn off individual capabilities with defines that begin with
|
||||
"PNG_NO_".
|
||||
|
||||
In libpng-1.5.0 and later, the #define's are in pnglibconf.h instead.
|
||||
|
||||
You can also turn all of the transforms and ancillary chunk capabilities
|
||||
off en masse with compiler directives that define
|
||||
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
|
||||
or all four, along with directives to turn on any of the capabilities that
|
||||
you do want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the
|
||||
extra transformations but still leave the library fully capable of reading
|
||||
and writing PNG files with all known public chunks. Use of the
|
||||
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
|
||||
that is incapable of reading or writing ancillary chunks. If you are
|
||||
not using the progressive reading capability, you can turn that off
|
||||
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
|
||||
capability, which you'll still have).
|
||||
|
||||
All the reading and writing specific code are in separate files, so the
|
||||
linker should only grab the files it needs. However, if you want to
|
||||
make sure, or if you are building a stand alone library, all the
|
||||
reading files start with "pngr" and all the writing files start with "pngw".
|
||||
The files that don't match either (like png.c, pngtrans.c, etc.)
|
||||
are used for both reading and writing, and always need to be included.
|
||||
The progressive reader is in pngpread.c
|
||||
|
||||
If you are creating or distributing a dynamically linked library (a .so
|
||||
or DLL file), you should not remove or disable any parts of the library,
|
||||
as this will cause applications linked with different versions of the
|
||||
library to fail if they call functions not available in your library.
|
||||
The size of the library itself should not be an issue, because only
|
||||
those sections that are actually used will be loaded into memory.
|
||||
|
||||
XII. Enabling or disabling hardware optimizations
|
||||
|
||||
Certain hardware capabilities, such as the Intel SSE instructions,
|
||||
are normally detected at run time. Enable them with configure options
|
||||
such as one of
|
||||
|
||||
--enable-arm-neon=yes
|
||||
--enable-mips-msa=yes
|
||||
--enable-intel-sse=yes
|
||||
--enable-powerpc-vsx=yes
|
||||
|
||||
or enable them all at once with
|
||||
|
||||
--enable-hardware-optimizations=yes
|
||||
|
||||
or, if you are not using "configure", you can use one
|
||||
or more of
|
||||
|
||||
CPPFLAGS += "-DPNG_ARM_NEON"
|
||||
CPPFLAGS += "-DPNG_MIPS_MSA"
|
||||
CPPFLAGS += "-DPNG_INTEL_SSE"
|
||||
CPPFLAGS += "-DPNG_POWERPC_VSX"
|
||||
|
||||
See for example scripts/makefile.linux-opt
|
||||
|
||||
If you wish to avoid using them,
|
||||
you can disable them via the configure option
|
||||
|
||||
--disable-hardware-optimizations
|
||||
|
||||
to disable them all, or
|
||||
|
||||
--enable-intel-sse=no
|
||||
|
||||
to disable a particular one,
|
||||
or via compiler-command options such as
|
||||
|
||||
CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0,
|
||||
-DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0"
|
||||
|
||||
If you are using cmake, hardware optimizations are "on"
|
||||
by default. To disable them, use
|
||||
|
||||
cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \
|
||||
-DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no
|
||||
|
||||
or disable them all at once with
|
||||
|
||||
cmake . -DPNG_HARDWARE_OPTIMIZATIONS=no
|
||||
|
||||
XIII. Changes to the build and configuration of libpng in libpng-1.5.x
|
||||
|
||||
Details of internal changes to the library code can be found in the CHANGES
|
||||
file and in the GIT repository logs. These will be of no concern to the vast
|
||||
majority of library users or builders; however, the few who configure libpng
|
||||
to a non-default feature set may need to change how this is done.
|
||||
|
||||
There should be no need for library builders to alter build scripts if
|
||||
these use the distributed build support - configure or the makefiles -
|
||||
however, users of the makefiles may care to update their build scripts
|
||||
to build pnglibconf.h where the corresponding makefile does not do so.
|
||||
|
||||
Building libpng with a non-default configuration has changed completely.
|
||||
The old method using pngusr.h should still work correctly even though the
|
||||
way pngusr.h is used in the build has been changed; however, library
|
||||
builders will probably want to examine the changes to take advantage of
|
||||
new capabilities and to simplify their build system.
|
||||
|
||||
A. Specific changes to library configuration capabilities
|
||||
|
||||
The exact mechanism used to control attributes of API functions has
|
||||
changed. A single set of operating system independent macro definitions
|
||||
is used and operating system specific directives are defined in
|
||||
pnglibconf.h
|
||||
|
||||
As part of this the mechanism used to choose procedure call standards on
|
||||
those systems that allow a choice has been changed. At present this only
|
||||
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
|
||||
running on Intel processors. As before, PNGAPI is defined where required
|
||||
to control the exported API functions; however, two new macros, PNGCBAPI
|
||||
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
|
||||
(PNGCAPI) for functions that must match a C library prototype (currently
|
||||
only png_longjmp_ptr, which must match the C longjmp function.) The new
|
||||
approach is documented in pngconf.h
|
||||
|
||||
Despite these changes, libpng 1.5.0 only supports the native C function
|
||||
calling standard on those platforms tested so far ("__cdecl" on Microsoft
|
||||
Windows). This is because the support requirements for alternative
|
||||
calling conventions seem to no longer exist. Developers who find it
|
||||
necessary to set PNG_API_RULE to 1 should advise the mailing list
|
||||
(png-mng-implement) of this and library builders who use Openwatcom and
|
||||
therefore set PNG_API_RULE to 2 should also contact the mailing list.
|
||||
|
||||
B. Changes to the configuration mechanism
|
||||
|
||||
Prior to libpng-1.5.0 library builders who needed to configure libpng
|
||||
had either to modify the exported pngconf.h header file to add system
|
||||
specific configuration or had to write feature selection macros into
|
||||
pngusr.h and cause this to be included into pngconf.h by defining
|
||||
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
|
||||
application built without PNG_USER_CONFIG defined would see the
|
||||
unmodified, default, libpng API and thus would probably fail to link.
|
||||
|
||||
These mechanisms still work in the configure build and in any makefile
|
||||
build that builds pnglibconf.h, although the feature selection macros
|
||||
have changed somewhat as described above. In 1.5.0, however, pngusr.h is
|
||||
processed only once, at the time the exported header file pnglibconf.h is
|
||||
built. pngconf.h no longer includes pngusr.h; therefore, pngusr.h is ignored
|
||||
after the build of pnglibconf.h and it is never included in an application
|
||||
build.
|
||||
|
||||
The formerly used alternative of adding a list of feature macros to the
|
||||
CPPFLAGS setting in the build also still works; however, the macros will be
|
||||
copied to pnglibconf.h and this may produce macro redefinition warnings
|
||||
when the individual C files are compiled.
|
||||
|
||||
All configuration now only works if pnglibconf.h is built from
|
||||
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
|
||||
(the original author of awk) maintains C source code of that awk and this
|
||||
and all known later implementations (often called by subtly different
|
||||
names - nawk and gawk for example) are adequate to build pnglibconf.h.
|
||||
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
|
||||
and does not work; this may also apply to other systems that have a
|
||||
functioning awk called 'nawk'.
|
||||
|
||||
Configuration options are now documented in scripts/pnglibconf.dfa. This
|
||||
file also includes dependency information that ensures a configuration is
|
||||
consistent; that is, if a feature is switched off, dependent features are
|
||||
also switched off. As a recommended alternative to using feature macros in
|
||||
pngusr.h a system builder may also define equivalent options in pngusr.dfa
|
||||
(or, indeed, any file) and add that to the configuration by setting
|
||||
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
|
||||
how to do this, and also illustrate a case where pngusr.h is still required.
|
||||
|
||||
After you have built libpng, the definitions that were recorded in
|
||||
pnglibconf.h are available to your application (pnglibconf.h is included
|
||||
in png.h and gets installed alongside png.h and pngconf.h in your
|
||||
$PREFIX/include directory). Do not edit pnglibconf.h after you have built
|
||||
libpng, because than the settings would not accurately reflect the settings
|
||||
that were used to build libpng.
|
||||
|
||||
XIV. Setjmp/longjmp issues
|
||||
|
||||
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
|
||||
is known to be not thread-safe on some platforms and we don't know of
|
||||
any platform where it is guaranteed to be thread-safe. Therefore, if
|
||||
your application is going to be using multiple threads, you should
|
||||
configure libpng with PNG_NO_SETJMP in your pngusr.dfa file, with
|
||||
-DPNG_NO_SETJMP on your compile line, or with
|
||||
|
||||
#undef PNG_SETJMP_SUPPORTED
|
||||
|
||||
in your pnglibconf.h or pngusr.h.
|
||||
|
||||
Starting with libpng-1.6.0, the library included a "simplified API".
|
||||
This requires setjmp/longjmp, so you must either build the library
|
||||
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
|
||||
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
|
||||
|
||||
XV. Common linking failures
|
||||
|
||||
If your application fails to find libpng or zlib entries while linking:
|
||||
|
||||
Be sure "-lz" appears after "-lpng" on your linking command.
|
||||
|
||||
Be sure you have built libpng, zlib, and your application for the
|
||||
same platform (e.g., 32-bit or 64-bit).
|
||||
|
||||
If you are using the vstudio project, observe the WARNING in
|
||||
project/vstudio/README.txt.
|
||||
|
||||
XVI. Other sources of information about libpng:
|
||||
|
||||
Further information can be found in the README and libpng-manual.txt
|
||||
files, in the individual makefiles, in png.h, and the manual pages
|
||||
libpng.3 and png.5.
|
||||
|
||||
Copyright (c) 2022 Cosmin Truta
|
||||
Copyright (c) 1998-2002,2006-2016 Glenn Randers-Pehrson
|
||||
This document is released under the libpng license.
|
||||
For conditions of distribution and use, see the disclaimer
|
||||
and license in png.h.
|
||||
|
||||
7
KNOWNBUG
7
KNOWNBUG
@@ -1,7 +0,0 @@
|
||||
|
||||
Known bugs in libpng-1.0.11
|
||||
|
||||
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
||||
reading interlaced PNG files, when assembler code is enabled.
|
||||
|
||||
STATUS: Under investigation.
|
||||
178
LICENSE
178
LICENSE
@@ -1,102 +1,134 @@
|
||||
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
||||
=========================================
|
||||
|
||||
This copy of the libpng notices is provided for your convenience. In case of
|
||||
any discrepancy between this copy and the notices in the file png.h that is
|
||||
included in the libpng distribution, the latter shall prevail.
|
||||
PNG Reference Library License version 2
|
||||
---------------------------------------
|
||||
|
||||
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||
* Copyright (c) 1995-2024 The PNG Reference Library Authors.
|
||||
* Copyright (c) 2018-2024 Cosmin Truta.
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
||||
* Copyright (c) 1996-1997 Andreas Dilger.
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
The software is supplied "as is", without warranty of any kind,
|
||||
express or implied, including, without limitation, the warranties
|
||||
of merchantability, fitness for a particular purpose, title, and
|
||||
non-infringement. In no event shall the Copyright owners, or
|
||||
anyone distributing the software, be liable for any damages or
|
||||
other liability, whether in contract, tort or otherwise, arising
|
||||
from, out of, or in connection with the software, or the use or
|
||||
other dealings in the software, even if advised of the possibility
|
||||
of such damage.
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.0.12beta1, May 14, 2001, are
|
||||
Copyright (c) 2000, 2001 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
|
||||
Permission is hereby granted to use, copy, modify, and distribute
|
||||
this software, or portions hereof, for any purpose, without fee,
|
||||
subject to the following restrictions:
|
||||
|
||||
Simon-Pierre Cadieux
|
||||
Eric S. Raymond
|
||||
Gilles Vollant
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you
|
||||
use this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated, but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
3. This Copyright notice may not be removed or altered from any
|
||||
source or altered source distribution.
|
||||
|
||||
|
||||
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2018 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
|
||||
Mandar Sahastrabuddhe
|
||||
Google Inc.
|
||||
Vadim Barkov
|
||||
|
||||
and with the following additions to the disclaimer:
|
||||
|
||||
There is no warranty against interference with your enjoyment of the
|
||||
library or against infringement. There is no warranty that our
|
||||
efforts or the library will fulfill any of your particular purposes
|
||||
or needs. This library is provided with all faults, and the entire
|
||||
risk of satisfactory quality, performance, accuracy, and effort is with
|
||||
the user.
|
||||
There is no warranty against interference with your enjoyment of
|
||||
the library or against infringement. There is no warranty that our
|
||||
efforts or the library will fulfill any of your particular purposes
|
||||
or needs. This library is provided with all faults, and the entire
|
||||
risk of satisfactory quality, performance, accuracy, and effort is
|
||||
with the user.
|
||||
|
||||
Some files in the "contrib" directory and some configure-generated
|
||||
files that are distributed with libpng have other copyright owners, and
|
||||
are released under other open source licenses.
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||
Copyright (c) 1998, 1999 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
|
||||
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
|
||||
Sam Bushell
|
||||
Magnus Holmgren
|
||||
Greg Roelofs
|
||||
Tom Tanner
|
||||
John Bowler
|
||||
Kevin Bracey
|
||||
Sam Bushell
|
||||
Magnus Holmgren
|
||||
Greg Roelofs
|
||||
Tom Tanner
|
||||
|
||||
Some files in the "scripts" directory have other copyright owners,
|
||||
but are released under this license.
|
||||
|
||||
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:
|
||||
|
||||
Andreas Dilger
|
||||
Dave Martindale
|
||||
Guy Eric Schalnat
|
||||
Paul Schmidt
|
||||
Tim Wegner
|
||||
Andreas Dilger
|
||||
Dave Martindale
|
||||
Guy Eric Schalnat
|
||||
Paul Schmidt
|
||||
Tim Wegner
|
||||
|
||||
The PNG Reference Library is supplied "AS IS". The Contributing Authors
|
||||
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
||||
including, without limitation, the warranties of merchantability and of
|
||||
fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
||||
assume no liability for direct, indirect, incidental, special, exemplary,
|
||||
or consequential damages, which may result from the use of the PNG
|
||||
Reference Library, even if advised of the possibility of such damage.
|
||||
The PNG Reference Library is supplied "AS IS". The Contributing
|
||||
Authors and Group 42, Inc. disclaim all warranties, expressed or
|
||||
implied, including, without limitation, the warranties of
|
||||
merchantability and of fitness for any purpose. The Contributing
|
||||
Authors and Group 42, Inc. assume no liability for direct, indirect,
|
||||
incidental, special, exemplary, or consequential damages, which may
|
||||
result from the use of the PNG Reference Library, even if advised of
|
||||
the possibility of such damage.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
source code, or portions hereof, for any purpose, without fee, subject
|
||||
to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented.
|
||||
1. The origin of this source code must not be misrepresented.
|
||||
|
||||
2. Altered versions must be plainly marked as such and
|
||||
must not be misrepresented as being the original source.
|
||||
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.
|
||||
|
||||
|
||||
A "png_get_copyright" function is available, for convenient use in "about"
|
||||
boxes and the like:
|
||||
|
||||
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 Open Source is a
|
||||
certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
randeg@alum.rpi.edu
|
||||
May 14, 2001
|
||||
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.
|
||||
|
||||
426
Makefile.am
Normal file
426
Makefile.am
Normal file
@@ -0,0 +1,426 @@
|
||||
# Makefile.am, the source file for Makefile.in (and hence Makefile), is
|
||||
#
|
||||
# Copyright (c) 2018-2024 Cosmin Truta
|
||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I scripts/autoconf
|
||||
|
||||
# test programs - run on make check, make distcheck
|
||||
if ENABLE_TESTS
|
||||
check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp
|
||||
if HAVE_CLOCK_GETTIME
|
||||
check_PROGRAMS += timepng
|
||||
endif
|
||||
else
|
||||
check_PROGRAMS=
|
||||
endif
|
||||
|
||||
# Utilities - installed
|
||||
if ENABLE_TOOLS
|
||||
bin_PROGRAMS= pngfix png-fix-itxt
|
||||
else
|
||||
bin_PROGRAMS=
|
||||
endif
|
||||
|
||||
# This ensures that pnglibconf.h gets built at the start of 'make all' or
|
||||
# 'make check', but it does not add dependencies to the individual programs,
|
||||
# this is done below.
|
||||
#
|
||||
# IMPORTANT: always add the object modules of new programs to the list below
|
||||
# because otherwise the sequence 'configure; make new-program' will *sometimes*
|
||||
# result in the installed (system) pnglibconf.h being used and the result is
|
||||
# always wrong and always very confusing.
|
||||
BUILT_SOURCES = pnglibconf.h
|
||||
|
||||
if ENABLE_TESTS
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
pngvalid_SOURCES = contrib/libtests/pngvalid.c
|
||||
pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
pngstest_SOURCES = contrib/libtests/pngstest.c
|
||||
pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
pngunknown_SOURCES = contrib/libtests/pngunknown.c
|
||||
pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
pngimage_SOURCES = contrib/libtests/pngimage.c
|
||||
pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
timepng_SOURCES = contrib/libtests/timepng.c
|
||||
timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
pngcp_SOURCES = contrib/tools/pngcp.c
|
||||
pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
endif
|
||||
|
||||
if ENABLE_TOOLS
|
||||
pngfix_SOURCES = contrib/tools/pngfix.c
|
||||
pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c
|
||||
endif
|
||||
|
||||
# Generally these are single line shell scripts to run a test with a particular
|
||||
# set of parameters:
|
||||
if ENABLE_TESTS
|
||||
TESTS =\
|
||||
tests/pngtest-all\
|
||||
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
|
||||
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
|
||||
tests/pngvalid-gamma-expand16-background\
|
||||
tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
|
||||
tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
|
||||
tests/pngvalid-progressive-size\
|
||||
tests/pngvalid-progressive-interlace-standard\
|
||||
tests/pngvalid-transform\
|
||||
tests/pngvalid-progressive-standard tests/pngvalid-standard\
|
||||
tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\
|
||||
tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\
|
||||
tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\
|
||||
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
|
||||
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
|
||||
tests/pngimage-quick tests/pngimage-full
|
||||
endif
|
||||
|
||||
# man pages
|
||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||
|
||||
# generate the -config scripts if required
|
||||
binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
bin_SCRIPTS= @binconfigs@
|
||||
|
||||
# rules to build libpng, only build the old library on request
|
||||
lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
# EXTRA_LTLIBRARIES= libpng.la
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
|
||||
pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\
|
||||
pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\
|
||||
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
|
||||
|
||||
if PNG_ARM_NEON
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
||||
arm/filter_neon.S arm/filter_neon_intrinsics.c \
|
||||
arm/palette_neon_intrinsics.c
|
||||
endif
|
||||
|
||||
if PNG_MIPS_MSA
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c\
|
||||
mips/filter_msa_intrinsics.c
|
||||
endif
|
||||
|
||||
if PNG_MIPS_MMI
|
||||
if !PNG_MIPS_MSA
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c
|
||||
endif
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/filter_mmi_inline_assembly.c
|
||||
endif
|
||||
|
||||
if PNG_INTEL_SSE
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += intel/intel_init.c\
|
||||
intel/filter_sse2_intrinsics.c
|
||||
endif
|
||||
|
||||
if PNG_POWERPC_VSX
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += powerpc/powerpc_init.c\
|
||||
powerpc/filter_vsx_intrinsics.c
|
||||
endif
|
||||
|
||||
if PNG_LOONGARCH_LSX
|
||||
noinst_LTLIBRARIES= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_SOURCES = loongarch/loongarch_lsx_init.c\
|
||||
loongarch/filter_lsx_intrinsics.c
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_CFLAGS = -mlsx
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
|
||||
# libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
|
||||
endif
|
||||
|
||||
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
||||
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||
-version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
|
||||
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
# Versioned symbols and restricted exports
|
||||
if HAVE_SOLARIS_LD
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers
|
||||
else
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||
endif
|
||||
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers
|
||||
else
|
||||
# Only restricted exports when possible
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
|
||||
endif
|
||||
|
||||
if PNG_LOONGARCH_LSX
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
|
||||
endif
|
||||
|
||||
#distribute headers in /usr/include/libpng/*
|
||||
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
|
||||
pkginclude_HEADERS= png.h pngconf.h
|
||||
nodist_pkginclude_HEADERS= pnglibconf.h
|
||||
|
||||
# pkg-config stuff, note that libpng.pc is always required in order
|
||||
# to get the correct library
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
|
||||
|
||||
# Extra source distribution files, '${srcdir}' is used below to stop build files
|
||||
# from those directories being included. This only works if the configure is
|
||||
# not done in the source directory!
|
||||
EXTRA_DIST= \
|
||||
ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \
|
||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||
${srcdir}/ci ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
|
||||
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
|
||||
CMakeLists.txt example.c libpng-manual.txt
|
||||
|
||||
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk
|
||||
|
||||
CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
|
||||
check.new pnglibconf.h pngprefix.h symbols.new pngtest-log.txt \
|
||||
pnglibconf.out pnglibconf.c pnglibconf.pre pnglibconf.dfn \
|
||||
$(SCRIPT_CLEANFILES)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
config.sub configure depcomp install-sh ltmain.sh missing
|
||||
|
||||
# PNG_COPTS give extra options for the C compiler to be used on all compilation
|
||||
# steps (unless targe_CFLAGS is specified; that will take precedence over
|
||||
# AM_CFLAGS)
|
||||
PNG_COPTS = @PNG_COPTS@
|
||||
AM_CFLAGS = ${PNG_COPTS}
|
||||
|
||||
# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
|
||||
# other operating systems (NeXT?) the C preprocessor selected by configure
|
||||
# checks input tokens for validity - effectively it performs part of the ANSI-C
|
||||
# parsing - and therefore fails with the .df files. configure.ac has special
|
||||
# checks for this and sets DFNCPP appropriately.
|
||||
DFNCPP = @DFNCPP@
|
||||
|
||||
SUFFIXES = .chk .out
|
||||
|
||||
$(PNGLIB_BASENAME).pc: libpng.pc
|
||||
cp libpng.pc $@
|
||||
|
||||
$(PNGLIB_BASENAME)-config: libpng-config
|
||||
cp libpng-config $@
|
||||
|
||||
scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
|
||||
scripts/prefix.out: png.h pngconf.h pnglibconf.out
|
||||
scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
|
||||
scripts/intprefix.out: pnglibconf.h
|
||||
|
||||
libpng.sym: scripts/sym.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
libpng.vers: scripts/vers.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
|
||||
if DO_PNG_PREFIX
|
||||
# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
|
||||
# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
|
||||
# implementation of the macro).
|
||||
pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
|
||||
rm -f $@
|
||||
$(AWK) 's==0 && NR>1{print prev}\
|
||||
s==0{prev=$$0}\
|
||||
s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\
|
||||
s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\
|
||||
END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\
|
||||
s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8
|
||||
mv pnglibconf.tf8 $@
|
||||
|
||||
pngprefix.h: scripts/intprefix.out
|
||||
rm -f pngprefix.tf1
|
||||
$(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
|
||||
mv pngprefix.tf1 $@
|
||||
else
|
||||
pnglibconf.h: pnglibconf.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
|
||||
pngprefix.h: # is empty
|
||||
:>$@
|
||||
endif
|
||||
|
||||
$(srcdir)/scripts/pnglibconf.h.prebuilt:
|
||||
@echo "Attempting to build $@" >&2
|
||||
@echo "This is a machine generated file, but if you want to make" >&2
|
||||
@echo "a new one simply make 'scripts/pnglibconf.out', copy that" >&2
|
||||
@echo "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2
|
||||
@exit 1
|
||||
|
||||
# The following is necessary to ensure that the local pnglibconf.h is used, not
|
||||
# an installed one (this can happen immediately after on a clean system if
|
||||
# 'make test' is the first thing the user does.) Only files which include
|
||||
# one of the png source files (typically png.h or pngpriv.h) need to be listed
|
||||
# here:
|
||||
pngtest.o: pnglibconf.h
|
||||
|
||||
contrib/libtests/makepng.o: pnglibconf.h
|
||||
contrib/libtests/pngstest.o: pnglibconf.h
|
||||
contrib/libtests/pngunknown.o: pnglibconf.h
|
||||
contrib/libtests/pngimage.o: pnglibconf.h
|
||||
contrib/libtests/pngvalid.o: pnglibconf.h
|
||||
contrib/libtests/readpng.o: pnglibconf.h
|
||||
contrib/libtests/tarith.o: pnglibconf.h
|
||||
contrib/libtests/timepng.o: pnglibconf.h
|
||||
|
||||
contrib/tools/makesRGB.o: pnglibconf.h
|
||||
contrib/tools/pngfix.o: pnglibconf.h
|
||||
contrib/tools/pngcp.o: pnglibconf.h
|
||||
|
||||
# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
|
||||
# be built with PNG_USE_READ_MACROS; this prevents the read macros from
|
||||
# interfering with the symbol file format.
|
||||
SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
|
||||
-DPNGLIB_VERSION='@PNGLIB_VERSION@'\
|
||||
-DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
|
||||
-DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
|
||||
|
||||
if DO_PNG_PREFIX
|
||||
SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
|
||||
endif
|
||||
|
||||
.c.out:
|
||||
rm -f $@ $*.tf[12]
|
||||
test -d scripts || mkdir scripts || test -d scripts
|
||||
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
|
||||
$(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1
|
||||
$(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
|
||||
rm -f $*.tf1
|
||||
mv $*.tf2 $@
|
||||
|
||||
# The .c file for pnglibconf.h is machine generated
|
||||
pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
|
||||
rm -f $@ $*.tf[45]
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
|
||||
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
||||
${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
|
||||
rm $*.tf4
|
||||
mv $*.tf5 $@
|
||||
|
||||
# Symbol checks (.def and .out files should match)
|
||||
scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
|
||||
|
||||
.out.chk:
|
||||
rm -f $@ $*.new
|
||||
$(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
|
||||
of="$*.new" $< >&2
|
||||
mv $*.new $@
|
||||
|
||||
# used on demand to regenerate the standard header, CPPFLAGS should
|
||||
# be empty - no non-standard defines
|
||||
scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
|
||||
rm -f $@ pnglibconf.tf[67]
|
||||
test -z "$(CPPFLAGS)"
|
||||
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
|
||||
logunsupported=1 version=search ${srcdir}/pngconf.h -\
|
||||
${srcdir}/scripts/pnglibconf.dfa 1>&2
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\
|
||||
pnglibconf.tf6 1>&2
|
||||
rm pnglibconf.tf6
|
||||
mv pnglibconf.tf7 $@
|
||||
|
||||
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
|
||||
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
|
||||
|
||||
test: check-am
|
||||
|
||||
# Extra checks
|
||||
check: scripts/symbols.chk
|
||||
|
||||
# Don't distribute the generated script files
|
||||
dist-hook:
|
||||
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
|
||||
|
||||
# Make links between installed files with release-specific names and the generic
|
||||
# file names. If this install rule is run the generic names will be deleted and
|
||||
# recreated - this has obvious issues for systems with multiple installations.
|
||||
|
||||
install-header-links:
|
||||
@set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \
|
||||
rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done
|
||||
|
||||
uninstall-header-links:
|
||||
cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS)
|
||||
|
||||
install-libpng-pc:
|
||||
@set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \
|
||||
$(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc
|
||||
|
||||
uninstall-libpng-pc:
|
||||
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
|
||||
|
||||
# EXT_LIST is a list of the possibly library directory extensions, this exists
|
||||
# because we can't find a good way of discovering the file extensions that are
|
||||
# actually installed on a given system, so instead we check for every extension
|
||||
# we have seen.
|
||||
|
||||
EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib
|
||||
|
||||
install-library-links:
|
||||
@set -x; cd '$(DESTDIR)$(libdir)';\
|
||||
for ext in $(EXT_LIST); do\
|
||||
rm -f "libpng.$$ext";\
|
||||
if test -f "$(PNGLIB_BASENAME).$$ext"; then\
|
||||
$(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\
|
||||
fi;\
|
||||
done
|
||||
|
||||
uninstall-library-links:
|
||||
@set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\
|
||||
rm -f "libpng.$$ext"; done
|
||||
|
||||
install-libpng-config:
|
||||
@set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \
|
||||
$(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config
|
||||
|
||||
uninstall-libpng-config:
|
||||
rm -f '$(DESTDIR)$(bindir)/libpng-config'
|
||||
|
||||
if DO_INSTALL_LINKS
|
||||
# If --enable-unversioned-links is specified the header and lib file links
|
||||
# will be automatically made on a 'make install':
|
||||
|
||||
install-data-hook: install-header-links
|
||||
uninstall-hook: uninstall-header-links
|
||||
install-exec-hook: install-library-links
|
||||
uninstall-hook: uninstall-library-links
|
||||
endif
|
||||
|
||||
if DO_INSTALL_LIBPNG_PC
|
||||
# Likewise, --install-pc causes libpng.pc to be constructed:
|
||||
|
||||
install-data-hook: install-libpng-pc
|
||||
uninstall-hook: uninstall-libpng-pc
|
||||
endif
|
||||
|
||||
if DO_INSTALL_LIBPNG_CONFIG
|
||||
# And --install-config:
|
||||
|
||||
install-exec-hook: install-libpng-config
|
||||
uninstall-hook: uninstall-libpng-config
|
||||
endif
|
||||
|
||||
# The following addition ensures that 'make all' always builds the test programs
|
||||
# too. It used to, but some change either in libpng or configure stopped this
|
||||
# working.
|
||||
all-am: $(check_PROGRAMS)
|
||||
2550
Makefile.in
Normal file
2550
Makefile.in
Normal file
File diff suppressed because it is too large
Load Diff
381
README
381
README
@@ -1,49 +1,88 @@
|
||||
README for libpng 1.0.12beta1 - May 14, 2001 (shared library 2.1)
|
||||
See the note about version numbers near the top of png.h
|
||||
README for libpng version 1.6.41
|
||||
================================
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
See the note about version numbers near the top of `png.h`.
|
||||
See `INSTALL` for instructions on how to install libpng.
|
||||
|
||||
Libpng comes in two distribution formats. Get libpng-*.tar.gz if you
|
||||
want UNIX-style line endings in the text files, or lpng*.zip if you want
|
||||
DOS-style line endings.
|
||||
Libpng comes in several distribution formats. Get `libpng-*.tar.gz`
|
||||
or `libpng-*.tar.xz` if you want UNIX-style line endings in the text
|
||||
files, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.
|
||||
|
||||
Version 0.89 was the first official release of libpng. Don't let the
|
||||
fact that it's the first release fool you. The libpng library has been in
|
||||
extensive use and testing since mid-1995. By late 1997 it had
|
||||
finally gotten to the stage where there hadn't been significant
|
||||
changes to the API in some time, and people have a bad feeling about
|
||||
libraries with versions < 1.0. Version 1.0.0 was released in
|
||||
March 1998.
|
||||
For a detailed description on using libpng, read `libpng-manual.txt`.
|
||||
For examples of libpng in a program, see `example.c` and `pngtest.c`.
|
||||
For usage information and restrictions (what little they are) on libpng,
|
||||
see `png.h`. For a description on using zlib (the compression library
|
||||
used by libpng) and zlib's restrictions, see `zlib.h`.
|
||||
|
||||
****
|
||||
Note that some of the changes to the png_info structure render this
|
||||
You should use zlib 1.0.4 or later to run this, but it _may_ work with
|
||||
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
||||
versions which can cause the output of invalid compression streams for
|
||||
some images.
|
||||
|
||||
You should also note that zlib is a compression library that is useful
|
||||
for more things than just PNG files. You can use zlib as a drop-in
|
||||
replacement for `fread()` and `fwrite()`, if you are so inclined.
|
||||
|
||||
zlib should be available at the same place that libpng is, or at
|
||||
https://zlib.net .
|
||||
|
||||
You may also want a copy of the PNG specification. It is available
|
||||
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
||||
these at http://www.libpng.org/pub/png/pngdocs.html .
|
||||
|
||||
This code is currently being archived at https://libpng.sourceforge.io
|
||||
in the download area, and at http://libpng.download/src .
|
||||
|
||||
This release, based in a large way on Glenn's, Guy's and Andreas'
|
||||
earlier work, was created and will be supported by myself and the PNG
|
||||
development group.
|
||||
|
||||
Send comments, corrections and commendations to `png-mng-implement`
|
||||
at `lists.sourceforge.net`. (Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe.)
|
||||
|
||||
Send general questions about the PNG specification to `png-mng-misc`
|
||||
at `lists.sourceforge.net`. (Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
|
||||
to subscribe.)
|
||||
|
||||
Historical notes
|
||||
----------------
|
||||
|
||||
The libpng library has been in extensive use and testing since mid-1995.
|
||||
Version 0.89, published a year later, was the first official release.
|
||||
By late 1997, it had finally gotten to the stage where there hadn't
|
||||
been significant changes to the API in some time, and people have a bad
|
||||
feeling about libraries with versions below 1.0. Version 1.0.0 was
|
||||
released in March 1998.
|
||||
|
||||
Note that some of the changes to the `png_info` structure render this
|
||||
version of the library binary incompatible with libpng-0.89 or
|
||||
earlier versions if you are using a shared library. The type of the
|
||||
"filler" parameter for png_set_filler() has changed from png_byte to
|
||||
png_uint_32, which will affect shared-library applications that use
|
||||
this function.
|
||||
`filler` parameter for `png_set_filler()` has changed from `png_byte`
|
||||
to `png_uint_32`, which will affect shared-library applications that
|
||||
use this function.
|
||||
|
||||
To avoid problems with changes to the internals of png_info_struct,
|
||||
To avoid problems with changes to the internals of the `info_struct`,
|
||||
new APIs have been made available in 0.95 to avoid direct application
|
||||
access to info_ptr. These functions are the png_set_<chunk> and
|
||||
png_get_<chunk> functions. These functions should be used when
|
||||
accessing/storing the info_struct data, rather than manipulating it
|
||||
access to `info_ptr`. These functions are the `png_set_<chunk>` and
|
||||
`png_get_<chunk>` functions. These functions should be used when
|
||||
accessing/storing the `info_struct` data, rather than manipulating it
|
||||
directly, to avoid such problems in the future.
|
||||
|
||||
It is important to note that the APIs do not make current programs
|
||||
It is important to note that the APIs did not make current programs
|
||||
that access the info struct directly incompatible with the new
|
||||
library. However, it is strongly suggested that new programs use
|
||||
the new APIs (as shown in example.c and pngtest.c), and older programs
|
||||
be converted to the new format, to facilitate upgrades in the future.
|
||||
****
|
||||
|
||||
Additions since 0.90 include the ability to compile libpng as a
|
||||
Windows DLL, and new APIs for accessing data in the info struct.
|
||||
Experimental functions include the ability to set weighting and cost
|
||||
factors for row filter selection, direct reads of integers from buffers
|
||||
on big-endian processors that support misaligned data access, faster
|
||||
methods of doing alpha composition, and more accurate 16->8 bit color
|
||||
conversion.
|
||||
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
|
||||
be a transitional release, members of the `png_struct` and the
|
||||
`info_struct` can still be accessed, but the compiler will issue a
|
||||
warning about deprecated usage. Since libpng-1.5.0, direct access
|
||||
to these structs is not allowed, and the definitions of the structs
|
||||
reside in private `pngstruct.h` and `pnginfo.h` header files that are
|
||||
not accessible to applications. It is strongly suggested that new
|
||||
programs use the new APIs (as shown in `example.c` and `pngtest.c`),
|
||||
and older programs be converted to the new format, to facilitate
|
||||
upgrades in the future.
|
||||
|
||||
The additions since 0.89 include the ability to read from a PNG stream
|
||||
which has had some (or all) of the signature bytes read by the calling
|
||||
@@ -53,195 +92,91 @@ the library action on the detection of chunk CRC errors. It is possible
|
||||
to set different actions based on whether the CRC error occurred in a
|
||||
critical or an ancillary chunk.
|
||||
|
||||
The changes made to the library, and bugs fixed are based on discussions
|
||||
on the PNG implementation mailing list <png-implement@ccrc.wustl.edu>
|
||||
and not on material submitted privately to Guy, Andreas, or Glenn. They will
|
||||
forward any good suggestions to the list.
|
||||
The additions since 0.90 include the ability to compile libpng as a
|
||||
Windows DLL, and new APIs for accessing data in the `info_struct`.
|
||||
Experimental functions included the ability to set weighting and cost
|
||||
factors for row filter selection, direct reads of integers from buffers
|
||||
on big-endian processors that support misaligned data access, faster
|
||||
methods of doing alpha composition, and more accurate 16-to-8 bit color
|
||||
conversion. Some of these experimental functions, such as the weighted
|
||||
filter heuristics, have since been removed.
|
||||
|
||||
For a detailed description on using libpng, read libpng.txt. For
|
||||
examples of libpng in a program, see example.c and pngtest.c. For usage
|
||||
information and restrictions (what little they are) on libpng, see
|
||||
png.h. For a description on using zlib (the compression library used by
|
||||
libpng) and zlib's restrictions, see zlib.h
|
||||
Files included in this distribution
|
||||
-----------------------------------
|
||||
|
||||
I have included a general makefile, as well as several machine and
|
||||
compiler specific ones, but you may have to modify one for your own needs.
|
||||
ANNOUNCE => Announcement of this version, with recent changes
|
||||
AUTHORS => List of contributing authors
|
||||
CHANGES => Description of changes between libpng versions
|
||||
INSTALL => Instructions to install libpng
|
||||
LICENSE => License to use and redistribute libpng
|
||||
README => This file
|
||||
TODO => Things not implemented in the current library
|
||||
TRADEMARK => Trademark information
|
||||
example.c => Example code for using libpng functions
|
||||
libpng.3 => Manual page for libpng (includes libpng-manual.txt)
|
||||
libpng-manual.txt => Description of libpng and its functions
|
||||
libpngpf.3 => Manual page for libpng's private functions (deprecated)
|
||||
png.5 => Manual page for the PNG format
|
||||
png.c => Basic interface functions common to library
|
||||
png.h => Library function and interface declarations (public)
|
||||
pngpriv.h => Library function and interface declarations (private)
|
||||
pngconf.h => System specific library configuration (public)
|
||||
pngstruct.h => png_struct declaration (private)
|
||||
pnginfo.h => png_info struct declaration (private)
|
||||
pngdebug.h => debugging macros (private)
|
||||
pngerror.c => Error/warning message I/O functions
|
||||
pngget.c => Functions for retrieving info from struct
|
||||
pngmem.c => Memory handling functions
|
||||
pngbar.png => PNG logo, 88x31
|
||||
pngnow.png => PNG logo, 98x31
|
||||
pngpread.c => Progressive reading functions
|
||||
pngread.c => Read data/helper high-level functions
|
||||
pngrio.c => Lowest-level data read I/O functions
|
||||
pngrtran.c => Read data transformation functions
|
||||
pngrutil.c => Read data utility functions
|
||||
pngset.c => Functions for storing data into the info_struct
|
||||
pngtest.c => Library test program
|
||||
pngtest.png => Library test sample image
|
||||
pngtrans.c => Common data transformation functions
|
||||
pngwio.c => Lowest-level write I/O functions
|
||||
pngwrite.c => High-level write functions
|
||||
pngwtran.c => Write data transformations
|
||||
pngwutil.c => Write utility functions
|
||||
arm/ => Optimized code for the ARM platform
|
||||
intel/ => Optimized code for the INTEL-SSE2 platform
|
||||
mips/ => Optimized code for the MIPS platform
|
||||
powerpc/ => Optimized code for the PowerPC platform
|
||||
ci/ => Scripts for continuous integration
|
||||
contrib/ => External contributions
|
||||
arm-neon/ => Optimized code for the ARM-NEON platform
|
||||
mips-msa/ => Optimized code for the MIPS-MSA platform
|
||||
powerpc-vsx/ => Optimized code for the POWERPC-VSX platform
|
||||
examples/ => Examples of libpng usage
|
||||
gregbook/ => Source code for PNG reading and writing, from
|
||||
"PNG: The Definitive Guide" by Greg Roelofs,
|
||||
O'Reilly, 1999
|
||||
libtests/ => Test programs
|
||||
oss-fuzz/ => Files used by the OSS-Fuzz project for fuzz-testing
|
||||
libpng
|
||||
pngminim/ => Minimal decoder, encoder, and progressive decoder
|
||||
programs demonstrating the use of pngusr.dfa
|
||||
pngminus/ => Simple pnm2png and png2pnm programs
|
||||
pngsuite/ => Test images
|
||||
testpngs/ => Test images
|
||||
tools/ => Various tools
|
||||
visupng/ => VisualPng, a Windows viewer for PNG images
|
||||
projects/ => Project files and workspaces for various IDEs
|
||||
owatcom/ => OpenWatcom project
|
||||
visualc71/ => Microsoft Visual C++ 7.1 workspace
|
||||
vstudio/ => Microsoft Visual Studio workspace
|
||||
scripts/ => Scripts and makefiles for building libpng
|
||||
(see scripts/README.txt for the complete list)
|
||||
tests/ => Test scripts
|
||||
|
||||
You should use zlib 1.0.4 or later to run this, but it MAY work with
|
||||
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
||||
versions which can cause the output of invalid compression streams for
|
||||
some images. You will definitely need zlib 1.0.4 or later if you are
|
||||
taking advantage of the MS-DOS "far" structure allocation for the small
|
||||
and medium memory models. You should also note that zlib is a
|
||||
compression library that is useful for more things than just PNG files.
|
||||
You can use zlib as a drop-in replacement for fread() and fwrite() if
|
||||
you are so inclined.
|
||||
Good luck, and happy coding!
|
||||
|
||||
zlib should be available at the same place that libpng is.
|
||||
If not, it should be at ftp.uu.net in /graphics/png
|
||||
Eventually, it will be at ftp.uu.net in /pub/archiving/zip/zlib
|
||||
|
||||
You may also want a copy of the PNG specification. It is available
|
||||
as an RFC and a W3C Recommendation. Failing
|
||||
these resources you can try ftp.uu.net in the /graphics/png directory.
|
||||
|
||||
This code is currently being archived at ftp.uu.net in the
|
||||
/graphics/png directory, and on CompuServe, Lib 20 (PNG SUPPORT)
|
||||
at GO GRAPHSUP. If you can't find it in any of those places,
|
||||
e-mail me, and I'll help you find it.
|
||||
|
||||
If you have any code changes, requests, problems, etc., please e-mail
|
||||
them to me. Also, I'd appreciate any make files or project files,
|
||||
and any modifications you needed to make to get libpng to compile,
|
||||
along with a #define variable to tell what compiler/system you are on.
|
||||
If you needed to add transformations to libpng, or wish libpng would
|
||||
provide the image in a different way, drop me a note (and code, if
|
||||
possible), so I can consider supporting the transformation.
|
||||
Finally, if you get any warning messages when compiling libpng
|
||||
(note: not zlib), and they are easy to fix, I'd appreciate the
|
||||
fix. Please mention "libpng" somewhere in the subject line. Thanks.
|
||||
|
||||
This release was created and will be supported by myself (of course
|
||||
based in a large way on Guy's and Andreas' earlier work), and the PNG group.
|
||||
|
||||
randeg@alum.rpi.edu
|
||||
png-implement@ccrc.wustl.edu
|
||||
|
||||
You can't reach Guy, the original libpng author, at the addresses
|
||||
given in previous versions of this document. He and Andreas will read mail
|
||||
addressed to the png-implement list, however.
|
||||
|
||||
Please do not send general questions about PNG. Send them to
|
||||
the address in the specification (png-group@w3.org). At the same
|
||||
time, please do not send libpng questions to that address, send them to me
|
||||
or to png-implement@ccrc.wustl.edu. I'll
|
||||
get them in the end anyway. If you have a question about something
|
||||
in the PNG specification that is related to using libpng, send it
|
||||
to me. Send me any questions that start with "I was using libpng,
|
||||
and ...". If in doubt, send questions to me. I'll bounce them
|
||||
to others, if necessary.
|
||||
|
||||
Please do not send suggestions on how to change PNG. We have
|
||||
been discussing PNG for three years now, and it is official and
|
||||
finished. If you have suggestions for libpng, however, I'll
|
||||
gladly listen. Even if your suggestion is not used for version
|
||||
1.0, it may be used later.
|
||||
|
||||
Files in this distribution:
|
||||
|
||||
ANNOUNCE => Announcement of this version, with recent changes
|
||||
CHANGES => Description of changes between libpng versions
|
||||
KNOWNBUG => List of known bugs and deficiencies
|
||||
LICENSE => License to use and redistribute libpng
|
||||
README => This file
|
||||
TODO => Things not implemented in the current library
|
||||
Y2KINFO => Statement of Y2K compliance
|
||||
example.c => Example code for using libpng functions
|
||||
libpng.3 => manual page for libpng (includes libpng.txt)
|
||||
libpng.txt => Description of libpng and its functions
|
||||
libpngpf.3 => manual page for libpng's private functions
|
||||
png.5 => manual page for the PNG format
|
||||
png.c => Basic interface functions common to library
|
||||
png.h => Library function and interface declarations
|
||||
pngconf.h => System specific library configuration
|
||||
pngasmrd.h => Header file for assembler-coded functions
|
||||
pngerror.c => Error/warning message I/O functions
|
||||
pngget.c => Functions for retrieving info from struct
|
||||
pngmem.c => Memory handling functions
|
||||
pngbar.png => PNG logo, 88x31
|
||||
pngnow.png => PNG logo, 98x31
|
||||
pngpread.c => Progressive reading functions
|
||||
pngread.c => Read data/helper high-level functions
|
||||
pngrio.c => Lowest-level data read I/O functions
|
||||
pngrtran.c => Read data transformation functions
|
||||
pngrutil.c => Read data utility functions
|
||||
pngset.c => Functions for storing data into the info_struct
|
||||
pngtest.c => Library test program
|
||||
pngtest.png => Library test sample image
|
||||
pngtrans.c => Common data transformation functions
|
||||
pngwio.c => Lowest-level write I/O functions
|
||||
pngwrite.c => High-level write functions
|
||||
pngwtran.c => Write data transformations
|
||||
pngwutil.c => Write utility functions
|
||||
contrib => Contributions
|
||||
gregbook => source code for PNG reading and writing, from
|
||||
Greg Roelofs' "PNG: The Definitive Guide",
|
||||
O'Reilly, 1999
|
||||
msvctest => Builds and runs pngtest using a MSVC workspace
|
||||
pngminus => Simple pnm2png and png2pnm programs
|
||||
pngsuite => Test images
|
||||
visupng => Contains a MSVC workspace for VisualPng
|
||||
projects => Contains project files and workspaces for building DLL
|
||||
beos => Contains a Beos workspace for building libpng
|
||||
borland => Contains a Borland workspace for building libpng
|
||||
and zlib
|
||||
msvc => Contains a Microsoft Visual C++ (MSVC) workspace
|
||||
for building libpng and zlib
|
||||
wince => Contains a Microsoft Visual C++ (Windows CD Toolkit)
|
||||
workspace for building libpng and zlib on WindowsCE
|
||||
scripts => Directory containing scripts for building libpng:
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||
libpng.so.2.1.0.12beta1, uses assembler code
|
||||
tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
ftp://ftp.cs.wisc.edu/ghost)
|
||||
makefile.aix => AIX makefile
|
||||
makefile.cygwin => Cygwin/gcc makefile
|
||||
makefile.dec => DEC Alpha UNIX makefile
|
||||
makefile.hpgcc => HPUX makefile using gcc
|
||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||
makefile.intel => Intel C/C++ version 4.0 and later
|
||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||
makefile.macosx => MACOS X Makefile
|
||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng.so.2.1.0.12beta1)
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.mips => MIPS makefile
|
||||
makefile.acorn => Acorn makefile
|
||||
makefile.amiga => Amiga makefile
|
||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC
|
||||
compiler (Requires SCOPTIONS, copied from
|
||||
scripts/SCOPTIONS.ppc)
|
||||
makefile.atari => Atari makefile
|
||||
makefile.beos => BEOS makefile for X86
|
||||
makefile.bor => Borland makefile (uses bcc)
|
||||
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
|
||||
makefile.bd32 => To make a png32bd.dll with Borland C++ 4.5
|
||||
makefile.tc3 => Turbo C 3.0 makefile
|
||||
makefile.dj2 => DJGPP 2 makefile
|
||||
makefile.msc => Microsoft C makefile
|
||||
makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and
|
||||
later (uses assembler code tuned for Intel MMX
|
||||
platform)
|
||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and
|
||||
later (does not use assembler code)
|
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
||||
pngos2.def => OS/2 module definition file used by makefile.os2
|
||||
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
|
||||
makevms.com => VMS build script
|
||||
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5
|
||||
SCOPTIONS.ppc => Used with smakefile.ppc
|
||||
|
||||
Good luck, and happy coding.
|
||||
|
||||
-Glenn Randers-Pehrson
|
||||
Internet: randeg@alum.rpi.edu
|
||||
|
||||
-Andreas Eric Dilger
|
||||
Internet: adilger@enel.ucalgary.ca
|
||||
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
|
||||
|
||||
-Guy Eric Schalnat
|
||||
(formerly of Group 42, Inc)
|
||||
Internet: gschal@infinet.com
|
||||
* Cosmin Truta (current maintainer, since 2018)
|
||||
* Glenn Randers-Pehrson (former maintainer, 1998-2018)
|
||||
* Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||
* Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
||||
(formerly of Group 42, Inc.)
|
||||
|
||||
43
TODO
43
TODO
@@ -1,24 +1,23 @@
|
||||
TODO - list of things to do for libpng:
|
||||
|
||||
Final bug fixes.
|
||||
Improve API by hiding the png_struct and png_info structs.
|
||||
Finish work on the no-floating-point version (including gamma compensation)
|
||||
Better C++ wrapper/full C++ implementation?
|
||||
Fix problem with C++ and EXTERN "C".
|
||||
cHRM transformation.
|
||||
Improve setjmp/longjmp usage or remove it in favor of returning error codes.
|
||||
Add "grayscale->palette" transformation and "palette->grayscale" detection.
|
||||
Improved dithering.
|
||||
Multi-lingual error and warning message support.
|
||||
Complete sRGB transformation (presently it simply uses gamma=0.45455).
|
||||
Man pages for function calls.
|
||||
Better documentation.
|
||||
Better filter selection
|
||||
(counting huffman bits/precompression? filter inertia? filter costs?).
|
||||
Histogram creation.
|
||||
Text conversion between different code pages (Latin-1 -> Mac and DOS).
|
||||
Should we always malloc 2^bit_depth PLTE/tRNS/hIST entries for safety?
|
||||
Build gamma tables using fixed point (and do away with floating point entirely).
|
||||
Use greater precision when changing to linear gamma for compositing against
|
||||
background and doing rgb-to-gray transformation.
|
||||
Investigate pre-incremented loop counters and other loop constructions.
|
||||
* Fix all defects (duh!)
|
||||
* Better C++ wrapper / full C++ implementation (?)
|
||||
* Fix the problems with C++ and 'extern "C"'.
|
||||
* cHRM transformation.
|
||||
* Palette creation.
|
||||
* "grayscale->palette" transformation and "palette->grayscale" detection.
|
||||
* Improved dithering.
|
||||
* Multi-lingual error and warning message support.
|
||||
* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
|
||||
* Man pages for function calls.
|
||||
* Better documentation.
|
||||
* Better filter selection
|
||||
(e.g., counting huffman bits/precompression; filter inertia; filter costs).
|
||||
* Histogram creation.
|
||||
* Text conversion between different code pages (e.g., Latin-1 -> Mac).
|
||||
* Avoid building gamma tables whenever possible.
|
||||
* Greater precision in changing to linear gamma for compositing against
|
||||
background, and in doing rgb-to-gray transformations.
|
||||
* Investigate pre-incremented loop counters and other loop constructions.
|
||||
* Interpolated method of handling interlacing.
|
||||
* More validations for libpng transformations.
|
||||
|
||||
8
TRADEMARK
Normal file
8
TRADEMARK
Normal file
@@ -0,0 +1,8 @@
|
||||
TRADEMARK
|
||||
=========
|
||||
|
||||
The name "libpng" has not been registered by the Copyright owners
|
||||
as a trademark in any jurisdiction. However, because libpng has
|
||||
been distributed and maintained world-wide, continually since 1995,
|
||||
the Copyright owners claim "common-law trademark protection" in any
|
||||
jurisdiction where common-law trademark is recognized.
|
||||
55
Y2KINFO
55
Y2KINFO
@@ -1,55 +0,0 @@
|
||||
Y2K compliance in libpng:
|
||||
=========================
|
||||
|
||||
May 14, 2001
|
||||
|
||||
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.0.12beta1 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
that will hold years up to 65535. The other two hold the date in text
|
||||
format, and will hold years up to 9999.
|
||||
|
||||
The integer is
|
||||
"png_uint_16 year" in png_time_struct.
|
||||
|
||||
The strings are
|
||||
"png_charp time_buffer" in png_struct and
|
||||
"near_time_buffer", which is a local character string in png.c.
|
||||
|
||||
There are seven time-related functions:
|
||||
|
||||
png_convert_to_rfc_1123() in png.c
|
||||
(formerly png_convert_to_rfc_1152() in error)
|
||||
png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
|
||||
png_convert_from_time_t() in pngwrite.c
|
||||
png_get_tIME() in pngget.c
|
||||
png_handle_tIME() in pngrutil.c, called in pngread.c
|
||||
png_set_tIME() in pngset.c
|
||||
png_write_tIME() in pngwutil.c, called in pngwrite.c
|
||||
|
||||
All appear to handle dates properly in a Y2K environment. The
|
||||
png_convert_from_time_t() function calls gmtime() to convert from system
|
||||
clock time, which returns (year - 1900), which we properly convert to
|
||||
the full 4-digit year. There is a possibility that applications using
|
||||
libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
|
||||
function, or that they are incorrectly passing only a 2-digit year
|
||||
instead of "year - 1900" into the png_convert_from_struct_tm() function,
|
||||
but this is not under our control. The libpng documentation has always
|
||||
stated that it works with 4-digit years, and the APIs have been
|
||||
documented as such.
|
||||
|
||||
The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
|
||||
integer to hold the year, and can hold years as large as 65535.
|
||||
|
||||
zlib, upon which libpng depends, is also Y2K compliant. It contains
|
||||
no date-related code.
|
||||
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
libpng maintainer
|
||||
PNG Development Group
|
||||
1211
aclocal.m4
vendored
Normal file
1211
aclocal.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
139
arm/arm_init.c
Normal file
139
arm/arm_init.c
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
/* arm_init.c - NEON optimised filter functions
|
||||
*
|
||||
* Copyright (c) 2018-2022 Cosmin Truta
|
||||
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
|
||||
* Written by Mans Rullgard, 2011.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* This module requires POSIX 1003.1 functions. */
|
||||
#define _POSIX_SOURCE 1
|
||||
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
#if PNG_ARM_NEON_OPT > 0
|
||||
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
|
||||
/* WARNING: it is strongly recommended that you do not build libpng with
|
||||
* run-time checks for CPU features if at all possible. In the case of the ARM
|
||||
* NEON instructions there is no processor-specific way of detecting the
|
||||
* presence of the required support, therefore run-time detection is extremely
|
||||
* OS specific.
|
||||
*
|
||||
* You may set the macro PNG_ARM_NEON_FILE to the file name of file containing
|
||||
* a fragment of C source code which defines the png_have_neon function. There
|
||||
* are a number of implementations in contrib/arm-neon, but the only one that
|
||||
* has partial support is contrib/arm-neon/linux.c - a generic Linux
|
||||
* implementation which reads /proc/cpufino.
|
||||
*/
|
||||
#include <signal.h> /* for sig_atomic_t */
|
||||
|
||||
#ifndef PNG_ARM_NEON_FILE
|
||||
# if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* ARM Neon is expected to be unconditionally available on ARM64. */
|
||||
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
|
||||
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
|
||||
/* ARM Neon is expected to be available on the target CPU architecture. */
|
||||
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
|
||||
# elif defined(__linux__)
|
||||
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
|
||||
# else
|
||||
# error "No support for run-time ARM Neon checking; use compile-time options"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static int png_have_neon(png_structp png_ptr);
|
||||
#ifdef PNG_ARM_NEON_FILE
|
||||
# include PNG_ARM_NEON_FILE
|
||||
#endif
|
||||
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
||||
|
||||
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
|
||||
#endif
|
||||
|
||||
void
|
||||
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
|
||||
{
|
||||
/* The switch statement is compiled in for ARM_NEON_API, the call to
|
||||
* png_have_neon is compiled in for ARM_NEON_CHECK. If both are defined
|
||||
* the check is only performed if the API has not set the NEON option on
|
||||
* or off explicitly. In this case the check controls what happens.
|
||||
*
|
||||
* If the CHECK is not compiled in and the option is UNSET the behavior prior
|
||||
* to 1.6.7 was to use the NEON code - this was a bug caused by having the
|
||||
* wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF,
|
||||
* as documented in png.h
|
||||
*/
|
||||
png_debug(1, "in png_init_filter_functions_neon");
|
||||
#ifdef PNG_ARM_NEON_API_SUPPORTED
|
||||
switch ((pp->options >> PNG_ARM_NEON) & 3)
|
||||
{
|
||||
case PNG_OPTION_UNSET:
|
||||
/* Allow the run-time check to execute if it has been enabled -
|
||||
* thus both API and CHECK can be turned on. If it isn't supported
|
||||
* this case will fall through to the 'default' below, which just
|
||||
* returns.
|
||||
*/
|
||||
#endif /* PNG_ARM_NEON_API_SUPPORTED */
|
||||
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
|
||||
{
|
||||
static volatile sig_atomic_t no_neon = -1; /* not checked */
|
||||
|
||||
if (no_neon < 0)
|
||||
no_neon = !png_have_neon(pp);
|
||||
|
||||
if (no_neon)
|
||||
return;
|
||||
}
|
||||
#ifdef PNG_ARM_NEON_API_SUPPORTED
|
||||
break;
|
||||
#endif
|
||||
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
||||
|
||||
#ifdef PNG_ARM_NEON_API_SUPPORTED
|
||||
default: /* OFF or INVALID */
|
||||
return;
|
||||
|
||||
case PNG_OPTION_ON:
|
||||
/* Option turned on */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* IMPORTANT: any new external functions used here must be declared using
|
||||
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
|
||||
* 'prefix' option to configure works:
|
||||
*
|
||||
* ./configure --with-libpng-prefix=foobar_
|
||||
*
|
||||
* Verify you have got this right by running the above command, doing a build
|
||||
* and examining pngprefix.h; it must contain a #define for every external
|
||||
* function you add. (Notice that this happens automatically for the
|
||||
* initialization function.)
|
||||
*/
|
||||
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
|
||||
|
||||
if (bpp == 3)
|
||||
{
|
||||
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
|
||||
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
|
||||
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
|
||||
png_read_filter_row_paeth3_neon;
|
||||
}
|
||||
|
||||
else if (bpp == 4)
|
||||
{
|
||||
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon;
|
||||
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon;
|
||||
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
|
||||
png_read_filter_row_paeth4_neon;
|
||||
}
|
||||
}
|
||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||
#endif /* READ */
|
||||
253
arm/filter_neon.S
Normal file
253
arm/filter_neon.S
Normal file
@@ -0,0 +1,253 @@
|
||||
|
||||
/* filter_neon.S - NEON optimised filter functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2014,2017 Glenn Randers-Pehrson
|
||||
* Written by Mans Rullgard, 2011.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* This is required to get the symbol renames, which are #defines, and the
|
||||
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
|
||||
*/
|
||||
#define PNG_VERSION_INFO_ONLY
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
/* Assembler NEON support - only works for 32-bit ARM (i.e. it does not work for
|
||||
* ARM64). The code in arm/filter_neon_intrinsics.c supports ARM64, however it
|
||||
* only works if -mfpu=neon is specified on the GCC command line. See pngpriv.h
|
||||
* for the logic which sets PNG_USE_ARM_NEON_ASM:
|
||||
*/
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
|
||||
|
||||
#if PNG_ARM_NEON_OPT > 0
|
||||
|
||||
#ifdef __ELF__
|
||||
# define ELF
|
||||
#else
|
||||
# define ELF @
|
||||
#endif
|
||||
|
||||
.arch armv7-a
|
||||
.fpu neon
|
||||
|
||||
.macro func name, export=0
|
||||
.macro endfunc
|
||||
ELF .size \name, . - \name
|
||||
.endfunc
|
||||
.purgem endfunc
|
||||
.endm
|
||||
.text
|
||||
|
||||
/* Explicitly specifying alignment here because some versions of
|
||||
* GAS don't align code correctly. This is harmless in correctly
|
||||
* written versions of GAS.
|
||||
*/
|
||||
.align 2
|
||||
|
||||
.if \export
|
||||
.global \name
|
||||
.endif
|
||||
ELF .type \name, STT_FUNC
|
||||
.func \name
|
||||
\name:
|
||||
.endm
|
||||
|
||||
func png_read_filter_row_sub4_neon, export=1
|
||||
ldr r3, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
1:
|
||||
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
|
||||
vadd.u8 d0, d3, d4
|
||||
vadd.u8 d1, d0, d5
|
||||
vadd.u8 d2, d1, d6
|
||||
vadd.u8 d3, d2, d7
|
||||
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
|
||||
subs r3, r3, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_sub3_neon, export=1
|
||||
ldr r3, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
mov r0, r1
|
||||
mov r2, #3
|
||||
mov r12, #12
|
||||
vld1.8 {q11}, [r0], r12
|
||||
1:
|
||||
vext.8 d5, d22, d23, #3
|
||||
vadd.u8 d0, d3, d22
|
||||
vext.8 d6, d22, d23, #6
|
||||
vadd.u8 d1, d0, d5
|
||||
vext.8 d7, d23, d23, #1
|
||||
vld1.8 {q11}, [r0], r12
|
||||
vst1.32 {d0[0]}, [r1,:32], r2
|
||||
vadd.u8 d2, d1, d6
|
||||
vst1.32 {d1[0]}, [r1], r2
|
||||
vadd.u8 d3, d2, d7
|
||||
vst1.32 {d2[0]}, [r1], r2
|
||||
vst1.32 {d3[0]}, [r1], r2
|
||||
subs r3, r3, #12
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_up_neon, export=1
|
||||
ldr r3, [r0, #4] @ rowbytes
|
||||
1:
|
||||
vld1.8 {q0}, [r1,:128]
|
||||
vld1.8 {q1}, [r2,:128]!
|
||||
vadd.u8 q0, q0, q1
|
||||
vst1.8 {q0}, [r1,:128]!
|
||||
subs r3, r3, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_avg4_neon, export=1
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
1:
|
||||
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
|
||||
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
|
||||
vhadd.u8 d0, d3, d16
|
||||
vadd.u8 d0, d0, d4
|
||||
vhadd.u8 d1, d0, d17
|
||||
vadd.u8 d1, d1, d5
|
||||
vhadd.u8 d2, d1, d18
|
||||
vadd.u8 d2, d2, d6
|
||||
vhadd.u8 d3, d2, d19
|
||||
vadd.u8 d3, d3, d7
|
||||
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
|
||||
subs r12, r12, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_avg3_neon, export=1
|
||||
push {r4,lr}
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
mov r0, r1
|
||||
mov r4, #3
|
||||
mov lr, #12
|
||||
vld1.8 {q11}, [r0], lr
|
||||
1:
|
||||
vld1.8 {q10}, [r2], lr
|
||||
vext.8 d5, d22, d23, #3
|
||||
vhadd.u8 d0, d3, d20
|
||||
vext.8 d17, d20, d21, #3
|
||||
vadd.u8 d0, d0, d22
|
||||
vext.8 d6, d22, d23, #6
|
||||
vhadd.u8 d1, d0, d17
|
||||
vext.8 d18, d20, d21, #6
|
||||
vadd.u8 d1, d1, d5
|
||||
vext.8 d7, d23, d23, #1
|
||||
vld1.8 {q11}, [r0], lr
|
||||
vst1.32 {d0[0]}, [r1,:32], r4
|
||||
vhadd.u8 d2, d1, d18
|
||||
vst1.32 {d1[0]}, [r1], r4
|
||||
vext.8 d19, d21, d21, #1
|
||||
vadd.u8 d2, d2, d6
|
||||
vhadd.u8 d3, d2, d19
|
||||
vst1.32 {d2[0]}, [r1], r4
|
||||
vadd.u8 d3, d3, d7
|
||||
vst1.32 {d3[0]}, [r1], r4
|
||||
subs r12, r12, #12
|
||||
bgt 1b
|
||||
|
||||
pop {r4,pc}
|
||||
endfunc
|
||||
|
||||
.macro paeth rx, ra, rb, rc
|
||||
vaddl.u8 q12, \ra, \rb @ a + b
|
||||
vaddl.u8 q15, \rc, \rc @ 2*c
|
||||
vabdl.u8 q13, \rb, \rc @ pa
|
||||
vabdl.u8 q14, \ra, \rc @ pb
|
||||
vabd.u16 q15, q12, q15 @ pc
|
||||
vcle.u16 q12, q13, q14 @ pa <= pb
|
||||
vcle.u16 q13, q13, q15 @ pa <= pc
|
||||
vcle.u16 q14, q14, q15 @ pb <= pc
|
||||
vand q12, q12, q13 @ pa <= pb && pa <= pc
|
||||
vmovn.u16 d28, q14
|
||||
vmovn.u16 \rx, q12
|
||||
vbsl d28, \rb, \rc
|
||||
vbsl \rx, \ra, d28
|
||||
.endm
|
||||
|
||||
func png_read_filter_row_paeth4_neon, export=1
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
vmov.i8 d20, #0
|
||||
1:
|
||||
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
|
||||
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
|
||||
paeth d0, d3, d16, d20
|
||||
vadd.u8 d0, d0, d4
|
||||
paeth d1, d0, d17, d16
|
||||
vadd.u8 d1, d1, d5
|
||||
paeth d2, d1, d18, d17
|
||||
vadd.u8 d2, d2, d6
|
||||
paeth d3, d2, d19, d18
|
||||
vmov d20, d19
|
||||
vadd.u8 d3, d3, d7
|
||||
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
|
||||
subs r12, r12, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_paeth3_neon, export=1
|
||||
push {r4,lr}
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
vmov.i8 d4, #0
|
||||
mov r0, r1
|
||||
mov r4, #3
|
||||
mov lr, #12
|
||||
vld1.8 {q11}, [r0], lr
|
||||
1:
|
||||
vld1.8 {q10}, [r2], lr
|
||||
paeth d0, d3, d20, d4
|
||||
vext.8 d5, d22, d23, #3
|
||||
vadd.u8 d0, d0, d22
|
||||
vext.8 d17, d20, d21, #3
|
||||
paeth d1, d0, d17, d20
|
||||
vst1.32 {d0[0]}, [r1,:32], r4
|
||||
vext.8 d6, d22, d23, #6
|
||||
vadd.u8 d1, d1, d5
|
||||
vext.8 d18, d20, d21, #6
|
||||
paeth d2, d1, d18, d17
|
||||
vext.8 d7, d23, d23, #1
|
||||
vld1.8 {q11}, [r0], lr
|
||||
vst1.32 {d1[0]}, [r1], r4
|
||||
vadd.u8 d2, d2, d6
|
||||
vext.8 d19, d21, d21, #1
|
||||
paeth d3, d2, d19, d18
|
||||
vst1.32 {d2[0]}, [r1], r4
|
||||
vmov d4, d19
|
||||
vadd.u8 d3, d3, d7
|
||||
vst1.32 {d3[0]}, [r1], r4
|
||||
subs r12, r12, #12
|
||||
bgt 1b
|
||||
|
||||
pop {r4,pc}
|
||||
endfunc
|
||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 (assembler) */
|
||||
#endif /* READ */
|
||||
402
arm/filter_neon_intrinsics.c
Normal file
402
arm/filter_neon_intrinsics.c
Normal file
@@ -0,0 +1,402 @@
|
||||
|
||||
/* filter_neon_intrinsics.c - NEON optimised filter functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
|
||||
* Written by James Yu <james.yu at linaro.org>, October 2013.
|
||||
* Based on filter_neon.S, written by Mans Rullgard, 2011.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
/* This code requires -mfpu=neon on the command line: */
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
|
||||
# include <arm64_neon.h>
|
||||
#else
|
||||
# include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
/* libpng row pointers are not necessarily aligned to any particular boundary,
|
||||
* however this code will only work with appropriate alignment. arm/arm_init.c
|
||||
* checks for this (and will not compile unless it is done). This code uses
|
||||
* variants of png_aligncast to avoid compiler warnings.
|
||||
*/
|
||||
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
|
||||
#define png_ptrc(type,pointer) png_aligncastconst(const type *,pointer)
|
||||
|
||||
/* The following relies on a variable 'temp_pointer' being declared with type
|
||||
* 'type'. This is written this way just to hide the GCC strict aliasing
|
||||
* warning; note that the code is safe because there never is an alias between
|
||||
* the input and output pointers.
|
||||
*
|
||||
* When compiling with MSVC ARM64, the png_ldr macro can't be passed directly
|
||||
* to vst4_lane_u32, because of an internal compiler error inside MSVC.
|
||||
* To avoid this compiler bug, we use a temporary variable (vdest_val) to store
|
||||
* the result of png_ldr.
|
||||
*/
|
||||
#define png_ldr(type,pointer)\
|
||||
(temp_pointer = png_ptr(type,pointer), *temp_pointer)
|
||||
|
||||
#if PNG_ARM_NEON_OPT > 0
|
||||
|
||||
void
|
||||
png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
png_const_bytep pp = prev_row;
|
||||
|
||||
png_debug(1, "in png_read_filter_row_up_neon");
|
||||
|
||||
for (; rp < rp_stop; rp += 16, pp += 16)
|
||||
{
|
||||
uint8x16_t qrp, qpp;
|
||||
|
||||
qrp = vld1q_u8(rp);
|
||||
qpp = vld1q_u8(pp);
|
||||
qrp = vaddq_u8(qrp, qpp);
|
||||
vst1q_u8(rp, qrp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
|
||||
uint8x16_t vtmp = vld1q_u8(rp);
|
||||
uint8x8x2_t *vrpt = png_ptr(uint8x8x2_t, &vtmp);
|
||||
uint8x8x2_t vrp = *vrpt;
|
||||
|
||||
uint8x8x4_t vdest;
|
||||
vdest.val[3] = vdup_n_u8(0);
|
||||
|
||||
png_debug(1, "in png_read_filter_row_sub3_neon");
|
||||
|
||||
for (; rp < rp_stop;)
|
||||
{
|
||||
uint8x8_t vtmp1, vtmp2;
|
||||
uint32x2_t *temp_pointer;
|
||||
|
||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
|
||||
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
|
||||
vtmp2 = vext_u8(vrp.val[0], vrp.val[1], 6);
|
||||
vdest.val[1] = vadd_u8(vdest.val[0], vtmp1);
|
||||
|
||||
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
|
||||
vdest.val[2] = vadd_u8(vdest.val[1], vtmp2);
|
||||
vdest.val[3] = vadd_u8(vdest.val[2], vtmp1);
|
||||
|
||||
vtmp = vld1q_u8(rp + 12);
|
||||
vrpt = png_ptr(uint8x8x2_t, &vtmp);
|
||||
vrp = *vrpt;
|
||||
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
|
||||
rp += 3;
|
||||
}
|
||||
|
||||
PNG_UNUSED(prev_row)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
|
||||
uint8x8x4_t vdest;
|
||||
vdest.val[3] = vdup_n_u8(0);
|
||||
|
||||
png_debug(1, "in png_read_filter_row_sub4_neon");
|
||||
|
||||
for (; rp < rp_stop; rp += 16)
|
||||
{
|
||||
uint32x2x4_t vtmp = vld4_u32(png_ptr(uint32_t,rp));
|
||||
uint8x8x4_t *vrpt = png_ptr(uint8x8x4_t,&vtmp);
|
||||
uint8x8x4_t vrp = *vrpt;
|
||||
uint32x2x4_t *temp_pointer;
|
||||
uint32x2x4_t vdest_val;
|
||||
|
||||
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
|
||||
vdest.val[1] = vadd_u8(vdest.val[0], vrp.val[1]);
|
||||
vdest.val[2] = vadd_u8(vdest.val[1], vrp.val[2]);
|
||||
vdest.val[3] = vadd_u8(vdest.val[2], vrp.val[3]);
|
||||
|
||||
vdest_val = png_ldr(uint32x2x4_t, &vdest);
|
||||
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
|
||||
}
|
||||
|
||||
PNG_UNUSED(prev_row)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
|
||||
uint8x16_t vtmp;
|
||||
uint8x8x2_t *vrpt;
|
||||
uint8x8x2_t vrp;
|
||||
uint8x8x4_t vdest;
|
||||
vdest.val[3] = vdup_n_u8(0);
|
||||
|
||||
vtmp = vld1q_u8(rp);
|
||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
||||
vrp = *vrpt;
|
||||
|
||||
png_debug(1, "in png_read_filter_row_avg3_neon");
|
||||
|
||||
for (; rp < rp_stop; pp += 12)
|
||||
{
|
||||
uint8x8_t vtmp1, vtmp2, vtmp3;
|
||||
|
||||
uint8x8x2_t *vppt;
|
||||
uint8x8x2_t vpp;
|
||||
|
||||
uint32x2_t *temp_pointer;
|
||||
|
||||
vtmp = vld1q_u8(pp);
|
||||
vppt = png_ptr(uint8x8x2_t,&vtmp);
|
||||
vpp = *vppt;
|
||||
|
||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
|
||||
vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]);
|
||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
||||
|
||||
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3);
|
||||
vtmp3 = vext_u8(vrp.val[0], vrp.val[1], 6);
|
||||
vdest.val[1] = vhadd_u8(vdest.val[0], vtmp2);
|
||||
vdest.val[1] = vadd_u8(vdest.val[1], vtmp1);
|
||||
|
||||
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 6);
|
||||
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
|
||||
|
||||
vtmp = vld1q_u8(rp + 12);
|
||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
||||
vrp = *vrpt;
|
||||
|
||||
vdest.val[2] = vhadd_u8(vdest.val[1], vtmp2);
|
||||
vdest.val[2] = vadd_u8(vdest.val[2], vtmp3);
|
||||
|
||||
vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1);
|
||||
|
||||
vdest.val[3] = vhadd_u8(vdest.val[2], vtmp2);
|
||||
vdest.val[3] = vadd_u8(vdest.val[3], vtmp1);
|
||||
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
|
||||
rp += 3;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
png_const_bytep pp = prev_row;
|
||||
|
||||
uint8x8x4_t vdest;
|
||||
vdest.val[3] = vdup_n_u8(0);
|
||||
|
||||
png_debug(1, "in png_read_filter_row_avg4_neon");
|
||||
|
||||
for (; rp < rp_stop; rp += 16, pp += 16)
|
||||
{
|
||||
uint32x2x4_t vtmp;
|
||||
uint8x8x4_t *vrpt, *vppt;
|
||||
uint8x8x4_t vrp, vpp;
|
||||
uint32x2x4_t *temp_pointer;
|
||||
uint32x2x4_t vdest_val;
|
||||
|
||||
vtmp = vld4_u32(png_ptr(uint32_t,rp));
|
||||
vrpt = png_ptr(uint8x8x4_t,&vtmp);
|
||||
vrp = *vrpt;
|
||||
vtmp = vld4_u32(png_ptrc(uint32_t,pp));
|
||||
vppt = png_ptr(uint8x8x4_t,&vtmp);
|
||||
vpp = *vppt;
|
||||
|
||||
vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]);
|
||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
||||
vdest.val[1] = vhadd_u8(vdest.val[0], vpp.val[1]);
|
||||
vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]);
|
||||
vdest.val[2] = vhadd_u8(vdest.val[1], vpp.val[2]);
|
||||
vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]);
|
||||
vdest.val[3] = vhadd_u8(vdest.val[2], vpp.val[3]);
|
||||
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
|
||||
|
||||
vdest_val = png_ldr(uint32x2x4_t, &vdest);
|
||||
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static uint8x8_t
|
||||
paeth(uint8x8_t a, uint8x8_t b, uint8x8_t c)
|
||||
{
|
||||
uint8x8_t d, e;
|
||||
uint16x8_t p1, pa, pb, pc;
|
||||
|
||||
p1 = vaddl_u8(a, b); /* a + b */
|
||||
pc = vaddl_u8(c, c); /* c * 2 */
|
||||
pa = vabdl_u8(b, c); /* pa */
|
||||
pb = vabdl_u8(a, c); /* pb */
|
||||
pc = vabdq_u16(p1, pc); /* pc */
|
||||
|
||||
p1 = vcleq_u16(pa, pb); /* pa <= pb */
|
||||
pa = vcleq_u16(pa, pc); /* pa <= pc */
|
||||
pb = vcleq_u16(pb, pc); /* pb <= pc */
|
||||
|
||||
p1 = vandq_u16(p1, pa); /* pa <= pb && pa <= pc */
|
||||
|
||||
d = vmovn_u16(pb);
|
||||
e = vmovn_u16(p1);
|
||||
|
||||
d = vbsl_u8(d, b, c);
|
||||
e = vbsl_u8(e, a, d);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
|
||||
uint8x16_t vtmp;
|
||||
uint8x8x2_t *vrpt;
|
||||
uint8x8x2_t vrp;
|
||||
uint8x8_t vlast = vdup_n_u8(0);
|
||||
uint8x8x4_t vdest;
|
||||
vdest.val[3] = vdup_n_u8(0);
|
||||
|
||||
vtmp = vld1q_u8(rp);
|
||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
||||
vrp = *vrpt;
|
||||
|
||||
png_debug(1, "in png_read_filter_row_paeth3_neon");
|
||||
|
||||
for (; rp < rp_stop; pp += 12)
|
||||
{
|
||||
uint8x8x2_t *vppt;
|
||||
uint8x8x2_t vpp;
|
||||
uint8x8_t vtmp1, vtmp2, vtmp3;
|
||||
uint32x2_t *temp_pointer;
|
||||
|
||||
vtmp = vld1q_u8(pp);
|
||||
vppt = png_ptr(uint8x8x2_t,&vtmp);
|
||||
vpp = *vppt;
|
||||
|
||||
vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast);
|
||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
||||
|
||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
|
||||
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3);
|
||||
vdest.val[1] = paeth(vdest.val[0], vtmp2, vpp.val[0]);
|
||||
vdest.val[1] = vadd_u8(vdest.val[1], vtmp1);
|
||||
|
||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 6);
|
||||
vtmp3 = vext_u8(vpp.val[0], vpp.val[1], 6);
|
||||
vdest.val[2] = paeth(vdest.val[1], vtmp3, vtmp2);
|
||||
vdest.val[2] = vadd_u8(vdest.val[2], vtmp1);
|
||||
|
||||
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
|
||||
vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1);
|
||||
|
||||
vtmp = vld1q_u8(rp + 12);
|
||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
||||
vrp = *vrpt;
|
||||
|
||||
vdest.val[3] = paeth(vdest.val[2], vtmp2, vtmp3);
|
||||
vdest.val[3] = vadd_u8(vdest.val[3], vtmp1);
|
||||
|
||||
vlast = vtmp2;
|
||||
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
|
||||
rp += 3;
|
||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
|
||||
rp += 3;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + row_info->rowbytes;
|
||||
png_const_bytep pp = prev_row;
|
||||
|
||||
uint8x8_t vlast = vdup_n_u8(0);
|
||||
uint8x8x4_t vdest;
|
||||
vdest.val[3] = vdup_n_u8(0);
|
||||
|
||||
png_debug(1, "in png_read_filter_row_paeth4_neon");
|
||||
|
||||
for (; rp < rp_stop; rp += 16, pp += 16)
|
||||
{
|
||||
uint32x2x4_t vtmp;
|
||||
uint8x8x4_t *vrpt, *vppt;
|
||||
uint8x8x4_t vrp, vpp;
|
||||
uint32x2x4_t *temp_pointer;
|
||||
uint32x2x4_t vdest_val;
|
||||
|
||||
vtmp = vld4_u32(png_ptr(uint32_t,rp));
|
||||
vrpt = png_ptr(uint8x8x4_t,&vtmp);
|
||||
vrp = *vrpt;
|
||||
vtmp = vld4_u32(png_ptrc(uint32_t,pp));
|
||||
vppt = png_ptr(uint8x8x4_t,&vtmp);
|
||||
vpp = *vppt;
|
||||
|
||||
vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast);
|
||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
||||
vdest.val[1] = paeth(vdest.val[0], vpp.val[1], vpp.val[0]);
|
||||
vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]);
|
||||
vdest.val[2] = paeth(vdest.val[1], vpp.val[2], vpp.val[1]);
|
||||
vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]);
|
||||
vdest.val[3] = paeth(vdest.val[2], vpp.val[3], vpp.val[2]);
|
||||
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
|
||||
|
||||
vlast = vpp.val[3];
|
||||
|
||||
vdest_val = png_ldr(uint32x2x4_t, &vdest);
|
||||
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 1 (intrinsics) */
|
||||
#endif /* READ */
|
||||
151
arm/palette_neon_intrinsics.c
Normal file
151
arm/palette_neon_intrinsics.c
Normal file
@@ -0,0 +1,151 @@
|
||||
|
||||
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
|
||||
*
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
|
||||
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
|
||||
# include <arm64_neon.h>
|
||||
#else
|
||||
# include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
|
||||
void
|
||||
png_riffle_palette_neon(png_structrp png_ptr)
|
||||
{
|
||||
png_const_colorp palette = png_ptr->palette;
|
||||
png_bytep riffled_palette = png_ptr->riffled_palette;
|
||||
png_const_bytep trans_alpha = png_ptr->trans_alpha;
|
||||
int num_trans = png_ptr->num_trans;
|
||||
int i;
|
||||
|
||||
/* Initially black, opaque. */
|
||||
uint8x16x4_t w = {{
|
||||
vdupq_n_u8(0x00),
|
||||
vdupq_n_u8(0x00),
|
||||
vdupq_n_u8(0x00),
|
||||
vdupq_n_u8(0xff),
|
||||
}};
|
||||
|
||||
png_debug(1, "in png_riffle_palette_neon");
|
||||
|
||||
/* First, riffle the RGB colours into an RGBA8 palette.
|
||||
* The alpha component is set to opaque for now.
|
||||
*/
|
||||
for (i = 0; i < 256; i += 16)
|
||||
{
|
||||
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
|
||||
w.val[0] = v.val[0];
|
||||
w.val[1] = v.val[1];
|
||||
w.val[2] = v.val[2];
|
||||
vst4q_u8(riffled_palette + (i << 2), w);
|
||||
}
|
||||
|
||||
/* Fix up the missing transparency values. */
|
||||
for (i = 0; i < num_trans; i++)
|
||||
riffled_palette[(i << 2) + 3] = trans_alpha[i];
|
||||
}
|
||||
|
||||
/* Expands a palettized row into RGBA8. */
|
||||
int
|
||||
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
const png_uint_32 *riffled_palette =
|
||||
(const png_uint_32 *)png_ptr->riffled_palette;
|
||||
const png_uint_32 pixels_per_chunk = 4;
|
||||
png_uint_32 i;
|
||||
|
||||
png_debug(1, "in png_do_expand_palette_rgba8_neon");
|
||||
|
||||
PNG_UNUSED(row)
|
||||
if (row_width < pixels_per_chunk)
|
||||
return 0;
|
||||
|
||||
/* This function originally gets the last byte of the output row.
|
||||
* The NEON part writes forward from a given position, so we have
|
||||
* to seek this back by 4 pixels x 4 bytes.
|
||||
*/
|
||||
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1);
|
||||
|
||||
for (i = 0; i < row_width; i += pixels_per_chunk)
|
||||
{
|
||||
uint32x4_t cur;
|
||||
png_bytep sp = *ssp - i, dp = *ddp - (i << 2);
|
||||
cur = vld1q_dup_u32 (riffled_palette + *(sp - 3));
|
||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1);
|
||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2);
|
||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3);
|
||||
vst1q_u32((void *)dp, cur);
|
||||
}
|
||||
if (i != row_width)
|
||||
{
|
||||
/* Remove the amount that wasn't processed. */
|
||||
i -= pixels_per_chunk;
|
||||
}
|
||||
|
||||
/* Decrement output pointers. */
|
||||
*ssp = *ssp - i;
|
||||
*ddp = *ddp - (i << 2);
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Expands a palettized row into RGB8. */
|
||||
int
|
||||
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
png_const_bytep palette = (png_const_bytep)png_ptr->palette;
|
||||
const png_uint_32 pixels_per_chunk = 8;
|
||||
png_uint_32 i;
|
||||
|
||||
png_debug(1, "in png_do_expand_palette_rgb8_neon");
|
||||
|
||||
PNG_UNUSED(row)
|
||||
if (row_width <= pixels_per_chunk)
|
||||
return 0;
|
||||
|
||||
/* Seeking this back by 8 pixels x 3 bytes. */
|
||||
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1);
|
||||
|
||||
for (i = 0; i < row_width; i += pixels_per_chunk)
|
||||
{
|
||||
uint8x8x3_t cur;
|
||||
png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i);
|
||||
cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7)));
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7);
|
||||
vst3_u8((void *)dp, cur);
|
||||
}
|
||||
|
||||
if (i != row_width)
|
||||
{
|
||||
/* Remove the amount that wasn't processed. */
|
||||
i -= pixels_per_chunk;
|
||||
}
|
||||
|
||||
/* Decrement output pointers. */
|
||||
*ssp = *ssp - i;
|
||||
*ddp = *ddp - ((i << 1) + i);
|
||||
return i;
|
||||
}
|
||||
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION */
|
||||
226
autogen.sh
Executable file
226
autogen.sh
Executable file
@@ -0,0 +1,226 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
|
||||
# control files.
|
||||
#
|
||||
# The first time this is run on a GIT checkout the only files that exist are
|
||||
# configure.ac and Makefile.am; all of the autotools support scripts are
|
||||
# missing. They are instantiated with autoreconf --force --install.
|
||||
#
|
||||
# For regular ("tarball") distributions all the files should exist. We do not
|
||||
# want them to be updated *under any circumstances*. It should never be
|
||||
# necessary to run autogen.sh because ./configure --enable-maintainer-mode says
|
||||
# what to do if Makefile.am or configure.ac are changed.
|
||||
#
|
||||
# It is *probably* OK to update the files on a GIT checkout, because they have
|
||||
# come from the local tools, but leave that to the user who is assumed to know
|
||||
# whether it is ok or required.
|
||||
#
|
||||
# This script is intended to work without arguments, there are, however, hidden
|
||||
# arguments (a) for use while testing the script and (b) to fix up systems that
|
||||
# have been broken. If (b) is required the script prompts for the correct
|
||||
# options. For this reason the options are *NOT* documented in the help; this
|
||||
# is deliberate; UTSL.
|
||||
#
|
||||
clean=
|
||||
maintainer=
|
||||
while test $# -gt 0
|
||||
do
|
||||
case "$1" in
|
||||
--maintainer)
|
||||
maintainer=1;;
|
||||
|
||||
--clean)
|
||||
clean=1;;
|
||||
|
||||
*)
|
||||
exec >&2
|
||||
echo "$0: usage: ./autogen.sh"
|
||||
if test -d .git
|
||||
then
|
||||
echo " ./autogen.sh generates the configure script and"
|
||||
echo " Makefile.in, or refreshes them after changes to Makefile.am"
|
||||
echo " or configure.ac. You may prefer to just run autoreconf."
|
||||
elif test -z "$maintainer"
|
||||
then
|
||||
echo " DO NOT RUN THIS SCRIPT."
|
||||
echo " If you need to change Makefile.am or configure.ac then you"
|
||||
echo " also need to run ./configure --enable-maintainer-mode and"
|
||||
echo " use the appropriate autotools, *NOT* this script, to update"
|
||||
echo " everything, please check the documentation of autoreconf."
|
||||
echo " WARNING: libpng is intentionally generated with a known,"
|
||||
echo " fixed, set of autotools. It is known *NOT* to work with"
|
||||
echo " the collection of autotools distributed on highly reputable"
|
||||
echo " operating systems."
|
||||
echo " Remember: autotools is GNU software, you are expected to"
|
||||
echo " pay for support."
|
||||
else
|
||||
echo " You have run autogen.sh with --maintainer enabled and you"
|
||||
echo " are not using a GIT distribution, then you have given an"
|
||||
echo " unrecognized argument. This is not good. --maintainer"
|
||||
echo " switches off any assumptions that you might not know what"
|
||||
echo " you are doing."
|
||||
fi
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
#
|
||||
# First check for a set of the autotools files; if absent then this is assumed
|
||||
# to be a GIT version and the local autotools must be used. If present this
|
||||
# is a tarball distribution and the script should not be used. If partially
|
||||
# present bad things are happening.
|
||||
#
|
||||
# The autotools generated files:
|
||||
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
|
||||
config.sub configure depcomp install-sh ltmain.sh missing\
|
||||
test-driver"
|
||||
#
|
||||
# Files generated by versions of autoconf >2.68 or automake >1.13 (i.e. later
|
||||
# versions than those required by configure.ac):
|
||||
libpng_autotools_extra="compile config.h.in~"
|
||||
#
|
||||
# These are separate because 'maintainer-clean' does not remove them.
|
||||
libpng_libtool_files="scripts/autoconf/libtool.m4 scripts/autoconf/ltoptions.m4\
|
||||
scripts/autoconf/ltsugar.m4 scripts/autoconf/ltversion.m4\
|
||||
scripts/autoconf/lt~obsolete.m4"
|
||||
|
||||
libpng_autotools_dirs="autom4te.cache" # not required
|
||||
#
|
||||
# The configure generated files:
|
||||
libpng_configure_files="Makefile config.h config.log config.status\
|
||||
libpng-config libpng.pc libtool stamp-h1"
|
||||
|
||||
libpng_configure_dirs=".deps"
|
||||
#
|
||||
# We must remove the configure generated files as well as the autotools
|
||||
# generated files if autotools are regenerated because otherwise if configure
|
||||
# has been run without "--enable-maintainer-mode" make can do a partial update
|
||||
# of Makefile. These functions do the two bits of cleaning.
|
||||
clean_autotools(){
|
||||
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
|
||||
rm -rf $libpng_autotools_extra
|
||||
}
|
||||
|
||||
clean_configure(){
|
||||
rm -rf $libpng_configure_files $libpng_configure_dirs
|
||||
}
|
||||
#
|
||||
# Clean: remove everything (this is to help with testing)
|
||||
if test -n "$clean"
|
||||
then
|
||||
clean_configure
|
||||
if test -n "$maintainer"
|
||||
then
|
||||
clean_autotools
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
#
|
||||
# Validate the distribution.
|
||||
libpng_autotools_file_found=
|
||||
libpng_autotools_file_missing=
|
||||
for file in $libpng_autotools_files
|
||||
do
|
||||
if test -f "$file"
|
||||
then
|
||||
libpng_autotools_file_found=1
|
||||
else
|
||||
libpng_autotools_file_missing=1
|
||||
fi
|
||||
done
|
||||
#
|
||||
# Presence of one of these does not *invalidate* missing, but absence
|
||||
# invalidates found.
|
||||
for file in $libpng_libtool_files
|
||||
do
|
||||
if test ! -f "$file"
|
||||
then
|
||||
libpng_autotools_file_missing=1
|
||||
fi
|
||||
done
|
||||
#
|
||||
# The cache directory doesn't matter - it will be regenerated and does not exist
|
||||
# anyway in a tarball.
|
||||
#
|
||||
# Either everything is missing or everything is there, the --maintainer option
|
||||
# just changes this so that the mode is set to generate all the files.
|
||||
mode=
|
||||
if test -z "$libpng_autotools_file_found" -o -n "$maintainer"
|
||||
then
|
||||
mode="autoreconf"
|
||||
else
|
||||
if test -n "$libpng_autotools_file_missing"
|
||||
then
|
||||
mode="broken"
|
||||
else
|
||||
mode="configure"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# So:
|
||||
case "$mode" in
|
||||
autoreconf)
|
||||
# Clean in case configure files exist
|
||||
clean_configure
|
||||
clean_autotools
|
||||
# Everything must be initialized, so use --force
|
||||
if autoreconf --warnings=all --force --install
|
||||
then
|
||||
missing=
|
||||
for file in $libpng_autotools_files
|
||||
do
|
||||
test -f "$file" || missing=1
|
||||
done
|
||||
# ignore the cache directory
|
||||
test -z "$missing" || {
|
||||
exec >&2
|
||||
echo "autoreconf was run, but did not produce all the expected"
|
||||
echo "files. It is likely that your autotools installation is"
|
||||
echo "not compatible with that expected by libpng."
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
exec >&2
|
||||
echo "autoreconf failed: your version of autotools is incompatible"
|
||||
echo "with this libpng version. Please use a distributed archive"
|
||||
echo "(which includes the autotools generated files) and run configure"
|
||||
echo "instead."
|
||||
exit 1
|
||||
fi;;
|
||||
|
||||
configure)
|
||||
if test -d .git
|
||||
then
|
||||
exec >&2
|
||||
echo "ERROR: running autoreconf on an initialized system"
|
||||
echo " This is not necessary; it is only necessary to remake the"
|
||||
echo " autotools generated files if Makefile.am or configure.ac"
|
||||
echo " change and make does the right thing with:"
|
||||
echo
|
||||
echo " ./configure --enable-maintainer-mode."
|
||||
echo
|
||||
echo " You can run autoreconf yourself if you don't like maintainer"
|
||||
echo " mode and you can also just run autoreconf -f -i to initialize"
|
||||
echo " everything in the first place; this script is only for"
|
||||
echo " compatibility with prior releases."
|
||||
exit 1
|
||||
else
|
||||
exec >&2
|
||||
echo "autogen.sh is intended only to generate 'configure' on systems"
|
||||
echo "that do not have it. You have a complete 'configure', if you"
|
||||
echo "need to change Makefile.am or configure.ac you also need to"
|
||||
echo "run configure with the --enable-maintainer-mode option."
|
||||
exit 1
|
||||
fi;;
|
||||
|
||||
broken)
|
||||
exec >&2
|
||||
echo "Your system has a partial set of autotools generated files."
|
||||
echo "autogen.sh is unable to proceed. The full set of files is"
|
||||
echo "contained in the libpng 'tar' distribution archive and you do"
|
||||
echo "not need to run autogen.sh if you use it."
|
||||
exit 1;;
|
||||
esac
|
||||
11
ci/.shellcheckrc
Normal file
11
ci/.shellcheckrc
Normal file
@@ -0,0 +1,11 @@
|
||||
# Disable the "variable appears unused" warning caused by the use of getopts
|
||||
# with an obligatory (but unused) variable name in the main function.
|
||||
disable=SC2034
|
||||
|
||||
# Disable all the "quote to prevent globbing or word splitting" advice.
|
||||
# We need word splitting for well-known variables like MAKEFLAGS and CFLAGS.
|
||||
disable=SC2086,SC2206
|
||||
|
||||
# Disable the "possible misspelling" warnings that might be flagged, e.g.,
|
||||
# inside function ci_trace_build.
|
||||
disable=SC2153
|
||||
19
ci/LICENSE_MIT.txt
Normal file
19
ci/LICENSE_MIT.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
88
ci/ci_lint_ci.sh
Executable file
88
ci/ci_lint_ci.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Copyright (c) 2019-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source="ci/lib/ci.lib.sh"
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SHELLCHECK="$(command -v shellcheck || true)"
|
||||
CI_YAMLLINT="$(command -v yamllint || true)"
|
||||
CI_LINT_COUNTER=0
|
||||
|
||||
function ci_lint_ci_config_files {
|
||||
ci_info "linting: CI config files"
|
||||
local MY_FILE
|
||||
if [[ -x $CI_YAMLLINT ]]
|
||||
then
|
||||
ci_spawn "$CI_YAMLLINT" --version
|
||||
for MY_FILE in "$CI_TOPLEVEL_DIR"/.*.yml
|
||||
do
|
||||
ci_spawn "$CI_YAMLLINT" --strict "$MY_FILE" ||
|
||||
CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1))
|
||||
done
|
||||
else
|
||||
ci_warn "program not found: 'yamllint'; skipping checks"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_lint_ci_scripts {
|
||||
ci_info "linting: CI scripts"
|
||||
local MY_FILE
|
||||
if [[ -x $CI_SHELLCHECK ]]
|
||||
then
|
||||
ci_spawn "$CI_SHELLCHECK" --version
|
||||
for MY_FILE in "$CI_SCRIPT_DIR"/*.sh
|
||||
do
|
||||
ci_spawn "$CI_SHELLCHECK" -x "$MY_FILE" ||
|
||||
CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1))
|
||||
done
|
||||
else
|
||||
ci_warn "program not found: 'shellcheck'; skipping checks"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_lint_ci_scripts_license {
|
||||
ci_info "linting: CI scripts license"
|
||||
ci_spawn grep -F "MIT License" ci/LICENSE_MIT.txt || {
|
||||
ci_warn "bad or missing CI license file: '$CI_SCRIPT_DIR/LICENSE_MIT.txt'"
|
||||
CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1))
|
||||
}
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help ]] && usage
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
# And... go!
|
||||
[[ $# -eq 0 ]] || ci_err "unexpected argument: '$1'"
|
||||
ci_lint_ci_config_files
|
||||
ci_lint_ci_scripts
|
||||
ci_lint_ci_scripts_license
|
||||
if [[ $CI_LINT_COUNTER -eq 0 ]]
|
||||
then
|
||||
ci_info "success!"
|
||||
exit 0
|
||||
else
|
||||
ci_info "failed on $CI_LINT_COUNTER file(s)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
194
ci/ci_verify_cmake.sh
Executable file
194
ci/ci_verify_cmake.sh
Executable file
@@ -0,0 +1,194 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Copyright (c) 2019-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source="ci/lib/ci.lib.sh"
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
||||
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
|
||||
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
|
||||
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
|
||||
|
||||
# Keep the following relative paths in sync with the absolute paths.
|
||||
# We use them for the benefit of native Windows tools that might be
|
||||
# otherwise confused by the path encoding used by Bash-on-Windows.
|
||||
CI_BUILD_TO_SRC_RELDIR="../.."
|
||||
CI_BUILD_TO_INSTALL_RELDIR="../ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
|
||||
|
||||
function ci_init_build {
|
||||
# Ensure that the mandatory variables are initialized.
|
||||
CI_CMAKE="${CI_CMAKE:-cmake}"
|
||||
CI_CTEST="${CI_CTEST:-ctest}"
|
||||
CI_CMAKE_BUILD_TYPE="${CI_CMAKE_BUILD_TYPE:-Release}"
|
||||
[[ -x $(command -v ninja) ]] &&
|
||||
CI_CMAKE_GENERATOR="${CI_CMAKE_GENERATOR:-Ninja}"
|
||||
if [[ $CI_CMAKE_GENERATOR == "Visual Studio"* ]]
|
||||
then
|
||||
# Clean up incidental mixtures of Windows and Bash-on-Windows
|
||||
# environment variables, to avoid confusing MSBuild.
|
||||
[[ $TEMP && ( $Temp || $temp ) ]] && unset TEMP
|
||||
[[ $TMP && ( $Tmp || $tmp ) ]] && unset TMP
|
||||
# Ensure that CI_CMAKE_GENERATOR_PLATFORM is initialized for this generator.
|
||||
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] ||
|
||||
ci_err_internal "missing \$CI_CMAKE_GENERATOR_PLATFORM"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_trace_build {
|
||||
ci_info "## START OF CONFIGURATION ##"
|
||||
ci_info "build arch: $CI_BUILD_ARCH"
|
||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
||||
ci_info "target arch: $CI_TARGET_ARCH"
|
||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
||||
}
|
||||
ci_info "source directory: $CI_SRC_DIR"
|
||||
ci_info "build directory: $CI_BUILD_DIR"
|
||||
ci_info "install directory: $CI_INSTALL_DIR"
|
||||
ci_info "environment option: \$CI_CMAKE: '$CI_CMAKE'"
|
||||
ci_info "environment option: \$CI_CMAKE_GENERATOR: '$CI_CMAKE_GENERATOR'"
|
||||
ci_info "environment option: \$CI_CMAKE_GENERATOR_PLATFORM: '$CI_CMAKE_GENERATOR_PLATFORM'"
|
||||
ci_info "environment option: \$CI_CMAKE_BUILD_TYPE: '$CI_CMAKE_BUILD_TYPE'"
|
||||
ci_info "environment option: \$CI_CMAKE_BUILD_FLAGS: '$CI_CMAKE_BUILD_FLAGS'"
|
||||
ci_info "environment option: \$CI_CMAKE_TOOLCHAIN_FILE: '$CI_CMAKE_TOOLCHAIN_FILE'"
|
||||
ci_info "environment option: \$CI_CMAKE_VARS: '$CI_CMAKE_VARS'"
|
||||
ci_info "environment option: \$CI_CTEST: '$CI_CTEST'"
|
||||
ci_info "environment option: \$CI_CTEST_FLAGS: '$CI_CTEST_FLAGS'"
|
||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
||||
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
||||
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
ci_info "executable: \$CI_CMAKE: $(command -V "$CI_CMAKE")"
|
||||
ci_info "executable: \$CI_CTEST: $(command -V "$CI_CTEST")"
|
||||
[[ $CI_CC ]] &&
|
||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
||||
[[ $CI_AR ]] &&
|
||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
||||
[[ $CI_RANLIB ]] &&
|
||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
||||
ci_info "## END OF CONFIGURATION ##"
|
||||
}
|
||||
|
||||
function ci_cleanup_old_build {
|
||||
if [[ -e $CI_BUILD_DIR || -e $CI_INSTALL_DIR ]]
|
||||
then
|
||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
||||
ci_spawn rm -fr "$CI_BUILD_DIR"
|
||||
ci_spawn rm -fr "$CI_INSTALL_DIR"
|
||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_build {
|
||||
ci_info "## START OF BUILD ##"
|
||||
ci_spawn "$(command -v "$CI_CMAKE")" --version
|
||||
ci_spawn "$(command -v "$CI_CTEST")" --version
|
||||
[[ $CI_CMAKE_GENERATOR == *"Ninja"* ]] &&
|
||||
ci_spawn "$(command -v ninja)" --version
|
||||
# Initialize ALL_CC_FLAGS as a string.
|
||||
local ALL_CC_FLAGS="$CI_CC_FLAGS"
|
||||
[[ $CI_SANITIZERS ]] &&
|
||||
ALL_CC_FLAGS="-fsanitize=$CI_SANITIZERS $ALL_CC_FLAGS"
|
||||
# Initialize ALL_CMAKE_VARS, ALL_CMAKE_BUILD_FLAGS and ALL_CTEST_FLAGS as arrays.
|
||||
local ALL_CMAKE_VARS=()
|
||||
[[ $CI_CMAKE_TOOLCHAIN_FILE ]] &&
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_TOOLCHAIN_FILE="$CI_CMAKE_TOOLCHAIN_FILE")
|
||||
[[ $CI_CC ]] &&
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_C_COMPILER="$CI_CC")
|
||||
[[ $ALL_CC_FLAGS ]] &&
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_C_FLAGS="$ALL_CC_FLAGS")
|
||||
[[ $CI_AR ]] && {
|
||||
# Use the full path of CI_AR to work around a CMake error.
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_AR="$(command -v "$CI_AR")")
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
# Use the full path of CI_RANLIB to work around a CMake error.
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_RANLIB="$(command -v "$CI_RANLIB")")
|
||||
}
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_BUILD_TYPE="$CI_CMAKE_BUILD_TYPE")
|
||||
ALL_CMAKE_VARS+=(-DCMAKE_VERBOSE_MAKEFILE=ON)
|
||||
ALL_CMAKE_VARS+=($CI_CMAKE_VARS)
|
||||
local ALL_CMAKE_BUILD_FLAGS=($CI_CMAKE_BUILD_FLAGS)
|
||||
local ALL_CTEST_FLAGS=($CI_CTEST_FLAGS)
|
||||
# Export the CMake environment variables.
|
||||
[[ $CI_CMAKE_GENERATOR ]] &&
|
||||
ci_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
|
||||
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] &&
|
||||
ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
|
||||
# Build!
|
||||
# Use $CI_BUILD_TO_SRC_RELDIR and $CI_BUILD_TO_INSTALL_RELDIR
|
||||
# instead of $CI_SRC_DIR and $CI_INSTALL_DIR from this point onwards.
|
||||
ci_spawn mkdir -p "$CI_BUILD_DIR"
|
||||
ci_spawn cd "$CI_BUILD_DIR"
|
||||
[[ $CI_BUILD_TO_SRC_RELDIR -ef $CI_SRC_DIR ]] ||
|
||||
ci_err_internal "bad or missing \$CI_BUILD_TO_SRC_RELDIR"
|
||||
ci_spawn mkdir -p "$CI_INSTALL_DIR"
|
||||
[[ $CI_BUILD_TO_INSTALL_RELDIR -ef $CI_INSTALL_DIR ]] ||
|
||||
ci_err_internal "bad or missing \$CI_BUILD_TO_INSTALL_RELDIR"
|
||||
# Spawn "cmake ...".
|
||||
ci_spawn "$CI_CMAKE" -DCMAKE_INSTALL_PREFIX="$CI_BUILD_TO_INSTALL_RELDIR" \
|
||||
"${ALL_CMAKE_VARS[@]}" \
|
||||
"$CI_BUILD_TO_SRC_RELDIR"
|
||||
# Spawn "cmake --build ...".
|
||||
ci_spawn "$CI_CMAKE" --build . \
|
||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
||||
"${ALL_CMAKE_BUILD_FLAGS[@]}"
|
||||
ci_expr $((CI_NO_TEST)) || {
|
||||
# Spawn "ctest" if testing is not disabled.
|
||||
ci_spawn "$CI_CTEST" --build-config "$CI_CMAKE_BUILD_TYPE" \
|
||||
"${ALL_CTEST_FLAGS[@]}"
|
||||
}
|
||||
ci_expr $((CI_NO_INSTALL)) || {
|
||||
# Spawn "cmake --build ... --target install" if installation is not disabled.
|
||||
ci_spawn "$CI_CMAKE" --build . \
|
||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
||||
--target install \
|
||||
"${ALL_CMAKE_BUILD_FLAGS[@]}"
|
||||
}
|
||||
ci_expr $((CI_NO_CLEAN)) || {
|
||||
# Spawn "make --build ... --target clean" if cleaning is not disabled.
|
||||
ci_spawn "$CI_CMAKE" --build . \
|
||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
||||
--target clean \
|
||||
"${ALL_CMAKE_BUILD_FLAGS[@]}"
|
||||
}
|
||||
ci_info "## END OF BUILD ##"
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help ]] && usage
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
ci_init_build
|
||||
ci_trace_build
|
||||
[[ $# -eq 0 ]] || {
|
||||
ci_info "note: this program accepts environment options only"
|
||||
ci_err "unexpected argument: '$1'"
|
||||
}
|
||||
ci_cleanup_old_build
|
||||
ci_build
|
||||
}
|
||||
|
||||
main "$@"
|
||||
148
ci/ci_verify_configure.sh
Executable file
148
ci/ci_verify_configure.sh
Executable file
@@ -0,0 +1,148 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Copyright (c) 2019-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source="ci/lib/ci.lib.sh"
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
||||
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
|
||||
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
|
||||
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
|
||||
|
||||
function ci_init_build {
|
||||
# Ensure that the mandatory variables are initialized.
|
||||
CI_MAKE="${CI_MAKE:-make}"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] || {
|
||||
# For native builds, set CI_CC to "cc" by default if the cc command is available.
|
||||
# The configure script defaults CC to "gcc", which is not always a good idea.
|
||||
[[ -x $(command -v cc) ]] && CI_CC="${CI_CC:-cc}"
|
||||
}
|
||||
# Ensure that the CI_ variables that cannot be customized reliably are not initialized.
|
||||
[[ ! $CI_CONFIGURE_VARS ]] ||
|
||||
ci_err "unsupported: \$CI_CONFIGURE_VARS='$CI_CONFIGURE_VARS'"
|
||||
[[ ! $CI_MAKE_VARS ]] ||
|
||||
ci_err "unsupported: \$CI_MAKE_VARS='$CI_MAKE_VARS'"
|
||||
}
|
||||
|
||||
function ci_trace_build {
|
||||
ci_info "## START OF CONFIGURATION ##"
|
||||
ci_info "build arch: $CI_BUILD_ARCH"
|
||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
||||
ci_info "target arch: $CI_TARGET_ARCH"
|
||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
||||
}
|
||||
ci_info "source directory: $CI_SRC_DIR"
|
||||
ci_info "build directory: $CI_BUILD_DIR"
|
||||
ci_info "install directory: $CI_INSTALL_DIR"
|
||||
ci_info "environment option: \$CI_CONFIGURE_FLAGS: '$CI_CONFIGURE_FLAGS'"
|
||||
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
|
||||
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
|
||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
||||
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
|
||||
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
|
||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
||||
ci_info "environment option: \$CI_LD: '$CI_LD'"
|
||||
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
|
||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
||||
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
||||
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
|
||||
[[ $CI_CC ]] &&
|
||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
||||
[[ $CI_CPP ]] &&
|
||||
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
|
||||
[[ $CI_AR ]] &&
|
||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
||||
[[ $CI_RANLIB ]] &&
|
||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
||||
[[ $CI_LD ]] &&
|
||||
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
|
||||
ci_info "## END OF CONFIGURATION ##"
|
||||
}
|
||||
|
||||
function ci_cleanup_old_build {
|
||||
if [[ -e $CI_BUILD_DIR || -e $CI_INSTALL_DIR ]]
|
||||
then
|
||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
||||
ci_spawn rm -fr "$CI_BUILD_DIR"
|
||||
ci_spawn rm -fr "$CI_INSTALL_DIR"
|
||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_build {
|
||||
ci_info "## START OF BUILD ##"
|
||||
# Export the configure build environment.
|
||||
[[ $CI_CC ]] && ci_spawn export CC="$CI_CC"
|
||||
[[ $CI_CC_FLAGS ]] && ci_spawn export CFLAGS="$CI_CC_FLAGS"
|
||||
[[ $CI_CPP ]] && ci_spawn export CPP="$CI_CPP"
|
||||
[[ $CI_CPP_FLAGS ]] && ci_spawn export CPPFLAGS="$CI_CPP_FLAGS"
|
||||
[[ $CI_AR ]] && ci_spawn export AR="$CI_AR"
|
||||
[[ $CI_RANLIB ]] && ci_spawn export RANLIB="$CI_RANLIB"
|
||||
[[ $CI_LD ]] && ci_spawn export LD="$CI_LD"
|
||||
[[ $CI_LD_FLAGS ]] && ci_spawn export LDFLAGS="$CI_LD_FLAGS"
|
||||
[[ $CI_SANITIZERS ]] && {
|
||||
ci_spawn export CFLAGS="-fsanitize=$CI_SANITIZERS ${CFLAGS:-"-O2"}"
|
||||
ci_spawn export LDFLAGS="-fsanitize=$CI_SANITIZERS $LDFLAGS"
|
||||
}
|
||||
# Build!
|
||||
ci_spawn mkdir -p "$CI_BUILD_DIR"
|
||||
ci_spawn cd "$CI_BUILD_DIR"
|
||||
# Spawn "configure".
|
||||
ci_spawn "$CI_SRC_DIR/configure" --prefix="$CI_INSTALL_DIR" $CI_CONFIGURE_FLAGS
|
||||
# Spawn "make".
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS
|
||||
ci_expr $((CI_NO_TEST)) || {
|
||||
# Spawn "make test" if testing is not disabled.
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS test
|
||||
}
|
||||
ci_expr $((CI_NO_INSTALL)) || {
|
||||
# Spawn "make install" if installation is not disabled.
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS install
|
||||
}
|
||||
ci_expr $((CI_NO_CLEAN)) || {
|
||||
# Spawn "make clean" and "make distclean" if cleaning is not disabled.
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS clean
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS distclean
|
||||
}
|
||||
ci_info "## END OF BUILD ##"
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help ]] && usage
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
# And... go!
|
||||
ci_init_build
|
||||
ci_trace_build
|
||||
[[ $# -eq 0 ]] || {
|
||||
ci_info "note: this program accepts environment options only"
|
||||
ci_err "unexpected argument: '$1'"
|
||||
}
|
||||
ci_cleanup_old_build
|
||||
ci_build
|
||||
}
|
||||
|
||||
main "$@"
|
||||
163
ci/ci_verify_makefiles.sh
Executable file
163
ci/ci_verify_makefiles.sh
Executable file
@@ -0,0 +1,163 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Copyright (c) 2019-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source="ci/lib/ci.lib.sh"
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
||||
|
||||
function ci_init_build {
|
||||
# Ensure that the mandatory variables are initialized.
|
||||
CI_MAKE="${CI_MAKE:-make}"
|
||||
case "$CI_CC" in
|
||||
( *clang* )
|
||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.clang"}" ;;
|
||||
( *gcc* )
|
||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.gcc"}" ;;
|
||||
( * )
|
||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.std"}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function ci_trace_build {
|
||||
ci_info "## START OF CONFIGURATION ##"
|
||||
ci_info "build arch: $CI_BUILD_ARCH"
|
||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
||||
ci_info "target arch: $CI_TARGET_ARCH"
|
||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
||||
}
|
||||
ci_info "source directory: $CI_SRC_DIR"
|
||||
ci_info "environment option: \$CI_MAKEFILES: '$CI_MAKEFILES'"
|
||||
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
|
||||
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
|
||||
ci_info "environment option: \$CI_MAKE_VARS: '$CI_MAKE_VARS'"
|
||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
||||
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
|
||||
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
|
||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
||||
ci_info "environment option: \$CI_LD: '$CI_LD'"
|
||||
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
|
||||
ci_info "environment option: \$CI_LIBS: '$CI_LIBS'"
|
||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
||||
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
|
||||
[[ $CI_CC ]] &&
|
||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
||||
[[ $CI_CPP ]] &&
|
||||
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
|
||||
[[ $CI_AR ]] &&
|
||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
||||
[[ $CI_RANLIB ]] &&
|
||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
||||
[[ $CI_LD ]] &&
|
||||
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
|
||||
ci_info "## END OF CONFIGURATION ##"
|
||||
}
|
||||
|
||||
function ci_cleanup_old_build {
|
||||
# Any old makefile-based build will most likely leave a mess
|
||||
# of object files behind if interrupted, e.g., via Ctrl+C.
|
||||
# There may be other files behind, depending on what makefile
|
||||
# had been used. We cannot easily enumerate all of those.
|
||||
# Fortunately, for a clean makefiles-based build, it should be
|
||||
# sufficient to remove the old object files only.
|
||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
||||
local MY_FILE
|
||||
find "$CI_SRC_DIR" -maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \) |
|
||||
while IFS="" read -r MY_FILE
|
||||
do
|
||||
ci_spawn rm -fr "$MY_FILE"
|
||||
done
|
||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
||||
}
|
||||
|
||||
function ci_build {
|
||||
ci_info "## START OF BUILD ##"
|
||||
# Initialize ALL_CC_FLAGS and ALL_LD_FLAGS as strings.
|
||||
local ALL_CC_FLAGS="$CI_CC_FLAGS"
|
||||
local ALL_LD_FLAGS="$CI_LD_FLAGS"
|
||||
[[ $CI_SANITIZERS ]] && {
|
||||
ALL_CC_FLAGS="-fsanitize=$CI_SANITIZERS ${ALL_CC_FLAGS:-"-O2"}"
|
||||
ALL_LD_FLAGS="-fsanitize=$CI_SANITIZERS $ALL_LD_FLAGS"
|
||||
}
|
||||
# Initialize ALL_MAKE_FLAGS and ALL_MAKE_VARS as arrays.
|
||||
local ALL_MAKE_FLAGS=($CI_MAKE_FLAGS)
|
||||
local ALL_MAKE_VARS=()
|
||||
[[ $CI_CC ]] && ALL_MAKE_VARS+=(CC="$CI_CC")
|
||||
[[ $ALL_CC_FLAGS ]] && ALL_MAKE_VARS+=(CFLAGS="$ALL_CC_FLAGS")
|
||||
[[ $CI_CPP ]] && ALL_MAKE_VARS+=(CPP="$CI_CPP")
|
||||
[[ $CI_CPP_FLAGS ]] && ALL_MAKE_VARS+=(CPPFLAGS="$CI_CPP_FLAGS")
|
||||
[[ $CI_AR ]] && ALL_MAKE_VARS+=(
|
||||
AR="${CI_AR:-ar}"
|
||||
AR_RC="${CI_AR:-ar} rc"
|
||||
)
|
||||
[[ $CI_RANLIB ]] && ALL_MAKE_VARS+=(RANLIB="$CI_RANLIB")
|
||||
[[ $CI_LD ]] && ALL_MAKE_VARS+=(LD="$CI_LD")
|
||||
[[ $ALL_LD_FLAGS ]] && ALL_MAKE_VARS+=(LDFLAGS="$ALL_LD_FLAGS")
|
||||
[[ $CI_LIBS ]] && ALL_MAKE_VARS+=(LIBS="$CI_LIBS")
|
||||
ALL_MAKE_VARS+=($CI_MAKE_VARS)
|
||||
# Build!
|
||||
local MY_MAKEFILE
|
||||
for MY_MAKEFILE in $CI_MAKEFILES
|
||||
do
|
||||
ci_info "using makefile: $MY_MAKEFILE"
|
||||
# Spawn "make".
|
||||
ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
|
||||
"${ALL_MAKE_FLAGS[@]}" \
|
||||
"${ALL_MAKE_VARS[@]}"
|
||||
ci_expr $((CI_NO_TEST)) || {
|
||||
# Spawn "make test" if testing is not disabled.
|
||||
ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
|
||||
"${ALL_MAKE_FLAGS[@]}" \
|
||||
"${ALL_MAKE_VARS[@]}" \
|
||||
test
|
||||
}
|
||||
ci_expr $((CI_NO_CLEAN)) || {
|
||||
# Spawn "make clean" if cleaning is not disabled.
|
||||
ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
|
||||
"${ALL_MAKE_FLAGS[@]}" \
|
||||
"${ALL_MAKE_VARS[@]}" \
|
||||
clean
|
||||
}
|
||||
done
|
||||
ci_info "## END OF BUILD ##"
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help ]] && usage
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
# And... go!
|
||||
ci_init_build
|
||||
ci_trace_build
|
||||
[[ $# -eq 0 ]] || {
|
||||
ci_info "note: this program accepts environment options only"
|
||||
ci_err "unexpected argument: '$1'"
|
||||
}
|
||||
ci_cleanup_old_build
|
||||
ci_build
|
||||
}
|
||||
|
||||
main "$@"
|
||||
90
ci/lib/ci.lib.sh
Normal file
90
ci/lib/ci.lib.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
# Copyright (c) 2019-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
test -f "$BASH_SOURCE" ||
|
||||
echo >&2 "warning: this module requires Bash version 3 or newer"
|
||||
test "${#BASH_SOURCE[@]}" -gt 1 ||
|
||||
echo >&2 "warning: this module should be sourced from a Bash script"
|
||||
|
||||
# Reset the locale to avoid surprises from locale-dependent commands.
|
||||
export LC_ALL=C
|
||||
export LANG=C
|
||||
export LANGUAGE=C
|
||||
|
||||
# Reset CDPATH to avoid surprises from the "cd" command.
|
||||
export CDPATH=""
|
||||
|
||||
# Initialize the global constants CI_SCRIPT_{NAME,DIR} and CI_TOPLEVEL_DIR.
|
||||
CI_SCRIPT_NAME="$(basename -- "$0")"
|
||||
CI_SCRIPT_DIR="$(cd "$(dirname -- "$0")" && pwd)"
|
||||
CI_TOPLEVEL_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
|
||||
# Initialize the global constants CI_BUILD_{...} for the host build platform.
|
||||
CI_BUILD_ARCH="${CI_BUILD_ARCH:-"$(uname -m | tr 'A-Z/\.-' 'a-z____')"}"
|
||||
CI_BUILD_SYSTEM="${CI_BUILD_SYSTEM:-"$(uname -s | tr 'A-Z/\.-' 'a-z____')"}"
|
||||
|
||||
# Initialize the global constants CI_TARGET_{...} for the target platform.
|
||||
CI_TARGET_ARCH="${CI_TARGET_ARCH:-"$CI_BUILD_ARCH"}"
|
||||
CI_TARGET_SYSTEM="${CI_TARGET_SYSTEM:-"$CI_BUILD_SYSTEM"}"
|
||||
|
||||
function ci_info {
|
||||
printf >&2 "%s: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
}
|
||||
|
||||
function ci_warn {
|
||||
printf >&2 "%s: warning: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
}
|
||||
|
||||
function ci_err {
|
||||
printf >&2 "%s: error: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
exit 2
|
||||
}
|
||||
|
||||
function ci_err_internal {
|
||||
printf >&2 "%s: internal error: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
printf >&2 "ABORTED\\n"
|
||||
# Exit with the conventional SIGABRT code.
|
||||
exit 134
|
||||
}
|
||||
|
||||
function ci_expr {
|
||||
if [[ ${*:-0} == [0-9] ]]
|
||||
then
|
||||
# This is the same as in the else-branch below, albeit much faster
|
||||
# for our intended use cases.
|
||||
return $((!$1))
|
||||
else
|
||||
# The funny-looking compound command "... && return $? || return $?"
|
||||
# allows the execution to continue uninterrupted under "set -e".
|
||||
expr >/dev/null "$@" && return $? || return $?
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_spawn {
|
||||
printf >&2 "%s: executing:" "$CI_SCRIPT_NAME"
|
||||
printf >&2 " %q" "$@"
|
||||
printf >&2 "\\n"
|
||||
"$@"
|
||||
}
|
||||
|
||||
# Ensure that the internal initialization is correct.
|
||||
[[ $CI_TOPLEVEL_DIR/ci/lib/ci.lib.sh -ef ${BASH_SOURCE[0]} ]] ||
|
||||
ci_err_internal "bad or missing \$CI_TOPLEVEL_DIR"
|
||||
[[ $CI_SCRIPT_DIR/$CI_SCRIPT_NAME -ef $0 ]] ||
|
||||
ci_err_internal "bad or missing \$CI_SCRIPT_DIR/\$CI_SCRIPT_NAME"
|
||||
[[ $CI_BUILD_ARCH && $CI_BUILD_SYSTEM ]] ||
|
||||
ci_err_internal "missing \$CI_BUILD_ARCH or \$CI_BUILD_SYSTEM"
|
||||
[[ $CI_TARGET_ARCH && $CI_TARGET_SYSTEM ]] ||
|
||||
ci_err_internal "missing \$CI_TARGET_ARCH or \$CI_TARGET_SYSTEM"
|
||||
|
||||
# Ensure that the user initialization is correct.
|
||||
[[ ${CI_NO_TEST:-0} == [01] ]] ||
|
||||
ci_err "bad boolean option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
[[ ${CI_NO_INSTALL:-0} == [01] ]] ||
|
||||
ci_err "bad boolean option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
||||
[[ ${CI_NO_CLEAN:-0} == [01] ]] ||
|
||||
ci_err "bad boolean option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
348
compile
Executable file
348
compile
Executable file
@@ -0,0 +1,348 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/* | msys/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
1807
config.guess
vendored
Executable file
1807
config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
135
config.h.in
Normal file
135
config.h.in
Normal file
@@ -0,0 +1,135 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the 'feenableexcept' function. */
|
||||
#undef HAVE_FEENABLEEXCEPT
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the 'm' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define to 1 if you have the 'z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the 'pow' function. */
|
||||
#undef HAVE_POW
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Turn on ARM Neon optimizations at run-time */
|
||||
#undef PNG_ARM_NEON_API_SUPPORTED
|
||||
|
||||
/* Check for ARM Neon support at run-time */
|
||||
#undef PNG_ARM_NEON_CHECK_SUPPORTED
|
||||
|
||||
/* Enable ARM Neon optimizations */
|
||||
#undef PNG_ARM_NEON_OPT
|
||||
|
||||
/* Enable Intel SSE optimizations */
|
||||
#undef PNG_INTEL_SSE_OPT
|
||||
|
||||
/* Enable LOONGARCH LSX optimizations */
|
||||
#undef PNG_LOONGARCH_LSX_OPT
|
||||
|
||||
/* Turn on MIPS MMI optimizations at run-time */
|
||||
#undef PNG_MIPS_MMI_API_SUPPORTED
|
||||
|
||||
/* Check for MIPS MMI support at run-time */
|
||||
#undef PNG_MIPS_MMI_CHECK_SUPPORTED
|
||||
|
||||
/* Enable MIPS MMI optimizations */
|
||||
#undef PNG_MIPS_MMI_OPT
|
||||
|
||||
/* Turn on MIPS MSA optimizations at run-time */
|
||||
#undef PNG_MIPS_MSA_API_SUPPORTED
|
||||
|
||||
/* Check for MIPS MSA support at run-time */
|
||||
#undef PNG_MIPS_MSA_CHECK_SUPPORTED
|
||||
|
||||
/* Enable MIPS MSA optimizations */
|
||||
#undef PNG_MIPS_MSA_OPT
|
||||
|
||||
/* Turn on POWERPC VSX optimizations at run-time */
|
||||
#undef PNG_POWERPC_VSX_API_SUPPORTED
|
||||
|
||||
/* Check for POWERPC VSX support at run-time */
|
||||
#undef PNG_POWERPC_VSX_CHECK_SUPPORTED
|
||||
|
||||
/* Enable POWERPC VSX optimizations */
|
||||
#undef PNG_POWERPC_VSX_OPT
|
||||
|
||||
/* Define to 1 if all of the C89 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
||||
nothing if this is not supported. Do not define if restrict is
|
||||
supported only directly. */
|
||||
#undef restrict
|
||||
/* Work around a bug in older versions of Sun C++, which did not
|
||||
#define __restrict__ or support _Restrict or __restrict__
|
||||
even though the corresponding Sun C compiler ended up with
|
||||
"#define restrict _Restrict" or "#define restrict __restrict__"
|
||||
in the previous line. This workaround can be removed once
|
||||
we assume Oracle Developer Studio 12.5 (2016) or later. */
|
||||
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
|
||||
# define _Restrict
|
||||
# define __restrict__
|
||||
#endif
|
||||
1960
config.sub
vendored
Executable file
1960
config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
667
configure.ac
Normal file
667
configure.ac
Normal file
@@ -0,0 +1,667 @@
|
||||
# configure.ac
|
||||
|
||||
# Copyright (c) 2018-2024 Cosmin Truta
|
||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl Minor upgrades (compatible ABI): increment the package version
|
||||
dnl (third field in two places below) and set the PNGLIB_RELEASE
|
||||
dnl variable.
|
||||
dnl
|
||||
dnl Major upgrades (incompatible ABI): increment the package major
|
||||
dnl version (second field, or first if desired), set the minor
|
||||
dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
|
||||
dnl Makefile.am to upgrade the package name.
|
||||
|
||||
dnl This is here to prevent earlier autoconf from being used, it
|
||||
dnl should not be necessary to regenerate configure if the time
|
||||
dnl stamps are correct
|
||||
AC_PREREQ([2.68])
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng],[1.6.41],[png-mng-implement@lists.sourceforge.net])
|
||||
AC_CONFIG_MACRO_DIR([scripts/autoconf])
|
||||
|
||||
# libpng does not follow GNU file name conventions (hence 'foreign')
|
||||
# color-tests requires automake 1.11 or later
|
||||
# silent-rules requires automake 1.11 or later
|
||||
# dist-xz requires automake 1.11 or later
|
||||
# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
|
||||
# 1.13 is required for parallel tests
|
||||
AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules subdir-objects])
|
||||
# The following line causes --disable-maintainer-mode to be the default to
|
||||
# configure. This is necessary because libpng distributions cannot rely on the
|
||||
# time stamps of the autotools generated files being correct
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
|
||||
dnl version; aclocal.m4 will generate a failure if you use a prior version of
|
||||
dnl automake, so the following is not necessary (and is not defined anyway):
|
||||
dnl AM_PREREQ([1.11.2])
|
||||
dnl stop configure from automagically running automake
|
||||
|
||||
PNGLIB_VERSION=1.6.41
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=6
|
||||
PNGLIB_RELEASE=41
|
||||
|
||||
dnl End of version number stuff
|
||||
|
||||
AC_CONFIG_SRCDIR([pngget.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
# Checks for programs.
|
||||
AC_LANG([C])
|
||||
AC_PROG_CC
|
||||
AM_PROG_AS
|
||||
LT_PATH_LD
|
||||
AC_PROG_CPP
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any
|
||||
dnl compatible later version may be used
|
||||
LT_INIT([win32-dll])
|
||||
LT_PREREQ([2.4.2])
|
||||
|
||||
# Some awks crash when confronted with pnglibconf.dfa, do a test run now
|
||||
# to make sure this doesn't happen
|
||||
AC_MSG_CHECKING([that AWK works])
|
||||
if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
|
||||
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
||||
${srcdir}/pngusr.dfa 1>&2
|
||||
then
|
||||
AC_MSG_RESULT([ok])
|
||||
else
|
||||
AC_MSG_FAILURE([failed], 1)
|
||||
fi
|
||||
|
||||
# This is a remnant of the old cc -E validation, where it may have been
|
||||
# necessary to use a different preprocessor for .dfn files
|
||||
DFNCPP="$CPP"
|
||||
AC_SUBST(DFNCPP)
|
||||
|
||||
AC_ARG_ENABLE([tests],
|
||||
AS_HELP_STRING([--disable-tests],
|
||||
[do not build the test programs (default is to build)]),
|
||||
[enable_tests="$enableval"],
|
||||
[enable_tests=yes])
|
||||
|
||||
AM_CONDITIONAL([ENABLE_TESTS],
|
||||
[test "$enable_tests" != "no"])
|
||||
|
||||
AC_ARG_ENABLE([tools],
|
||||
AS_HELP_STRING([--disable-tools],
|
||||
[do not build the auxiliary tools (default is to build)]),
|
||||
[enable_tools="$enableval"],
|
||||
[enable_tools=yes])
|
||||
|
||||
AM_CONDITIONAL([ENABLE_TOOLS],
|
||||
[test "$enable_tools" != "no"])
|
||||
|
||||
# -Werror cannot be passed to GCC in CFLAGS because configure will fail
|
||||
# (it checks the compiler with a program that generates a warning).
|
||||
# Add the following option to deal with this:
|
||||
AC_ARG_VAR(PNG_COPTS,
|
||||
[additional flags for the C compiler, use this for options that would]
|
||||
[cause configure itself to fail])
|
||||
AC_ARG_ENABLE(werror,
|
||||
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
|
||||
[Pass -Werror or the given argument to the compiler if it is supported]),
|
||||
[test "$enable_werror" = "yes" && enable_werror="-Werror"
|
||||
if test "$enable_werror" != "no"; then
|
||||
sav_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$enable_werror $CFLAGS"
|
||||
AC_MSG_CHECKING([if the compiler allows $enable_werror])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE([
|
||||
[int main(int argc, char **argv){]
|
||||
[return argv[argc-1][0];]
|
||||
[}]])],
|
||||
AC_MSG_RESULT(yes)
|
||||
PNG_COPTS="$PNG_COPTS $enable_werror",
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$sav_CFLAGS"
|
||||
fi],)
|
||||
|
||||
# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89.
|
||||
# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
|
||||
# _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
|
||||
# we test for that and force the "-std=c89" compiler option:
|
||||
AC_MSG_CHECKING([if we need to force back C standard to C89])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
[#define _POSIX_SOURCE 1]
|
||||
[#include <stdio.h>]
|
||||
])],
|
||||
AC_MSG_RESULT(no),[
|
||||
if test "x$GCC" != "xyes"; then
|
||||
AC_MSG_ERROR(
|
||||
[Forcing back to C89 is required but the flags are only known for GCC])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="$CFLAGS -std=c89"
|
||||
])
|
||||
|
||||
# Checks for structures and compiler characteristics.
|
||||
AC_STRUCT_TM
|
||||
AC_C_RESTRICT
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([pow], ,
|
||||
[AC_CHECK_LIB([m], [pow], , [AC_MSG_ERROR([cannot find pow])])])
|
||||
|
||||
# Some later POSIX 1003.1 functions are required for test programs, failure
|
||||
# here is soft (the corresponding test program is not built).
|
||||
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
|
||||
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
|
||||
|
||||
AC_ARG_WITH(zlib-prefix,
|
||||
AS_HELP_STRING([[[--with-zlib-prefix]]],
|
||||
[prefix that may have been used in installed zlib]),
|
||||
[ZPREFIX=${withval}],
|
||||
[ZPREFIX='z_'])
|
||||
AC_CHECK_LIB([z], [zlibVersion], ,
|
||||
[AC_CHECK_LIB([z], [${ZPREFIX}zlibVersion], ,
|
||||
[AC_MSG_ERROR([zlib not installed])])])
|
||||
|
||||
# The following is for pngvalid, to ensure it catches FP errors even on
|
||||
# platforms that don't enable FP exceptions, the function appears in the math
|
||||
# library (typically), it's not an error if it is not found.
|
||||
AC_CHECK_LIB([m], [feenableexcept])
|
||||
AC_CHECK_FUNCS([feenableexcept])
|
||||
|
||||
AC_MSG_CHECKING([if using Solaris linker])
|
||||
SLD=`$LD --version 2>&1 | grep Solaris`
|
||||
if test "$SLD"; then
|
||||
have_solaris_ld=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
have_solaris_ld=no
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes")
|
||||
|
||||
AC_MSG_CHECKING([if libraries can be versioned])
|
||||
# Special case for PE/COFF platforms: ld reports
|
||||
# support for version-script, but doesn't actually
|
||||
# DO anything with it.
|
||||
case $host in
|
||||
*cygwin* | *mingw32* | *interix* )
|
||||
have_ld_version_script=no
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
* )
|
||||
|
||||
if test "$have_solaris_ld" = "yes"; then
|
||||
GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'`
|
||||
else
|
||||
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
||||
fi
|
||||
|
||||
if test "$GLD"; then
|
||||
have_ld_version_script=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
have_ld_version_script=no
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN(*** You have not enabled versioned symbols.)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
||||
|
||||
if test "$have_ld_version_script" = "yes"; then
|
||||
AC_MSG_CHECKING([for symbol prefix])
|
||||
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
|
||||
| ${CPP-${CC-gcc} -E} - 2>&1 \
|
||||
| ${EGREP-grep} "^PREFIX=" \
|
||||
| ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
|
||||
AC_SUBST(SYMBOL_PREFIX)
|
||||
AC_MSG_RESULT($SYMBOL_PREFIX)
|
||||
fi
|
||||
|
||||
# Substitutions for .in files
|
||||
AC_SUBST(PNGLIB_VERSION)
|
||||
AC_SUBST(PNGLIB_MAJOR)
|
||||
AC_SUBST(PNGLIB_MINOR)
|
||||
AC_SUBST(PNGLIB_RELEASE)
|
||||
|
||||
# Additional arguments (and substitutions)
|
||||
# Allow the pkg-config directory to be set
|
||||
AC_ARG_WITH(pkgconfigdir,
|
||||
AS_HELP_STRING([[[--with-pkgconfigdir]]],
|
||||
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
|
||||
[pkgconfigdir=${withval}],
|
||||
[pkgconfigdir='${libdir}/pkgconfig'])
|
||||
|
||||
AC_SUBST([pkgconfigdir])
|
||||
AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
|
||||
|
||||
# Make the *-config binary config scripts optional
|
||||
AC_ARG_WITH(binconfigs,
|
||||
AS_HELP_STRING([[[--with-binconfigs]]],
|
||||
[Generate shell libpng-config scripts as well as pkg-config data]
|
||||
[@<:@default=yes@:>@]),
|
||||
[if test "${withval}" = no; then
|
||||
binconfigs=
|
||||
AC_MSG_NOTICE([[libpng-config scripts will not be built]])
|
||||
else
|
||||
binconfigs='${binconfigs}'
|
||||
fi],
|
||||
[binconfigs='${binconfigs}'])
|
||||
AC_SUBST([binconfigs])
|
||||
|
||||
# Support for prefixes to the API function names; this will generate defines
|
||||
# at the start of the build to rename exported library functions
|
||||
AC_ARG_WITH(libpng-prefix,
|
||||
AS_HELP_STRING([[[--with-libpng-prefix]]],
|
||||
[prefix libpng exported function (API) names with the given value]),
|
||||
[if test "${withval:-no}" != "no"; then
|
||||
AC_SUBST([PNG_PREFIX], [${withval}])
|
||||
fi])
|
||||
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
|
||||
|
||||
# Control over what links are made for installed files. Versioned files are
|
||||
# always installed, when the following options are turned on corresponding
|
||||
# unversioned links are also created (normally as symbolic links):
|
||||
AC_ARG_ENABLE([unversioned-links],
|
||||
AS_HELP_STRING([[[--enable-unversioned-links]]],
|
||||
[Installed libpng header files are placed in a versioned subdirectory]
|
||||
[and installed libpng library (including DLL) files are versioned.]
|
||||
[If this option is enabled unversioned links will be created pointing to]
|
||||
[the corresponding installed files. If you use libpng.pc or]
|
||||
[libpng-config for all builds you do not need these links, but if you]
|
||||
[compile programs directly they will typically #include <png.h> and]
|
||||
[link with -lpng; in that case you need the links.]
|
||||
[The links can be installed manually using 'make install-header-links']
|
||||
[and 'make install-library-links' and can be removed using the]
|
||||
[corresponding uninstall- targets. If you do enable this option every]
|
||||
[libpng 'make install' will recreate the links to point to the just]
|
||||
[installed version of libpng. The default is to create the links;]
|
||||
[use --disable-unversioned-links to change this]))
|
||||
|
||||
# The AM_CONDITIONAL test is written so that the default is enabled;
|
||||
# --disable-unversioned-links must be given to turn the option off.
|
||||
AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"])
|
||||
|
||||
AC_ARG_ENABLE([unversioned-libpng-pc],
|
||||
AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]],
|
||||
[Install the configuration file 'libpng.pc' as a link to the versioned]
|
||||
[version. This is done by default - use --disable-unversioned-libpng-pc]
|
||||
[to change this.]))
|
||||
AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC],
|
||||
[test "$enable_unversioned_libpng_pc" != "no"])
|
||||
|
||||
AC_ARG_ENABLE([unversioned-libpng-config],
|
||||
AS_HELP_STRING([[[--enable-unversioned-libpng-config]]],
|
||||
[Install the configuration file 'libpng-config' as a link to the]
|
||||
[versioned version. This is done by default - use]
|
||||
[--disable-unversioned-libpng-config to change this.]))
|
||||
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
|
||||
[test "$enable_unversioned_libpng_config" != "no"])
|
||||
|
||||
# HOST-SPECIFIC OPTIONS
|
||||
# =====================
|
||||
#
|
||||
# DEFAULT
|
||||
# =======
|
||||
#
|
||||
AC_ARG_ENABLE([hardware-optimizations],
|
||||
AS_HELP_STRING([[[--enable-hardware-optimizations]]],
|
||||
[Enable hardware optimizations: =no/off, yes/on:]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable hardware optimization on all systems:
|
||||
enable_arm_neon=no
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
|
||||
[Disable ARM_NEON optimizations])
|
||||
enable_mips_msa=no
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
|
||||
[Disable MIPS_MSA optimizations])
|
||||
enable_mips_mmi=no
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
|
||||
[Disable MIPS_MMI optimizations])
|
||||
enable_powerpc_vsx=no
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
||||
[Disable POWERPC VSX optimizations])
|
||||
enable_intel_sse=no
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
||||
[Disable INTEL_SSE optimizations])
|
||||
enable_loongarch_lsx=no
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
|
||||
[Disable LOONGARCH_LSX optimizations])
|
||||
;;
|
||||
*)
|
||||
# allow enabling hardware optimization on any system:
|
||||
case "$host_cpu" in
|
||||
arm*|aarch64*)
|
||||
enable_arm_neon=yes
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
|
||||
[Enable ARM_NEON optimizations])
|
||||
;;
|
||||
mipsel*|mips64el*)
|
||||
enable_mips_mmi=yes
|
||||
enable_mips_msa=yes
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
|
||||
[Enable MIPS_MMI optimizations])
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
|
||||
[Enable MIPS_MSA optimizations])
|
||||
;;
|
||||
i?86|x86_64)
|
||||
enable_intel_sse=yes
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
||||
[Enable Intel SSE optimizations])
|
||||
;;
|
||||
powerpc*|ppc64*)
|
||||
enable_powerpc_vsx=yes
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
|
||||
[Enable POWERPC VSX optimizations])
|
||||
;;
|
||||
loongarch*)
|
||||
enable_loongarch_lsx=yes
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
||||
[Enable LOONGARCH_LSX optimizations])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac])
|
||||
|
||||
# ARM
|
||||
# ===
|
||||
#
|
||||
# ARM NEON (SIMD) support.
|
||||
|
||||
AC_ARG_ENABLE([arm-neon],
|
||||
AS_HELP_STRING([[[--enable-arm-neon]]],
|
||||
[Enable ARM NEON optimizations: =no/off, check, api, yes/on:]
|
||||
[no/off: disable the optimizations; check: use internal checking code]
|
||||
[(deprecated and poorly supported); api: disable by default, enable by]
|
||||
[a call to png_set_option; yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __ARM_NEON__ systems:
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
|
||||
[Disable ARM Neon optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_arm_neon=no ;;
|
||||
check)
|
||||
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
|
||||
[Check for ARM Neon support at run-time]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
|
||||
[Turn on ARM Neon optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
|
||||
[Enable ARM Neon optimizations])
|
||||
AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if]
|
||||
[you want the optimizations unconditionally pass -mfpu=neon]
|
||||
[to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
|
||||
esac])
|
||||
|
||||
# Add ARM-specific files to all builds where $host_cpu is arm ('arm*') or
|
||||
# where ARM optimizations were explicitly requested (this allows a fallback
|
||||
# if a future host CPU does not match 'arm*')
|
||||
|
||||
AM_CONDITIONAL([PNG_ARM_NEON],
|
||||
[test "$enable_arm_neon" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
arm*|aarch64*) : ;;
|
||||
*) test "$enable_arm_neon" != '' ;;
|
||||
esac])
|
||||
|
||||
# MIPS
|
||||
# ====
|
||||
#
|
||||
# MIPS MSA (SIMD) support.
|
||||
|
||||
AC_ARG_ENABLE([mips-msa],
|
||||
AS_HELP_STRING([[[--enable-mips-msa]]],
|
||||
[Enable MIPS MSA optimizations: =no/off, check, api, yes/on:]
|
||||
[no/off: disable the optimizations; check: use internal checking code]
|
||||
[(deprecated and poorly supported); api: disable by default, enable by]
|
||||
[a call to png_set_option; yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __mips_msa systems:
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
|
||||
[Disable MIPS MSA optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_mips_msa=no ;;
|
||||
check)
|
||||
AC_DEFINE([PNG_MIPS_MSA_CHECK_SUPPORTED], [],
|
||||
[Check for MIPS MSA support at run-time]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_MIPS_MSA_API_SUPPORTED], [],
|
||||
[Turn on MIPS MSA optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
|
||||
[Enable MIPS MSA optimizations])
|
||||
AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api', if]
|
||||
[you want the optimizations unconditionally pass '-mmsa -mfp64']
|
||||
[to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value])
|
||||
esac])
|
||||
|
||||
# Add MIPS-specific files to all builds where $host_cpu is mips ('mips*') or
|
||||
# where MIPS optimizations were explicitly requested (this allows a fallback
|
||||
# if a future host CPU does not match 'mips*')
|
||||
|
||||
AM_CONDITIONAL([PNG_MIPS_MSA],
|
||||
[test "$enable_mips_msa" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
mipsel*|mips64el*) : ;;
|
||||
esac])
|
||||
|
||||
# MIPS
|
||||
# ===
|
||||
#
|
||||
# MIPS MMI (SIMD) support.
|
||||
|
||||
AC_ARG_ENABLE([mips-mmi],
|
||||
AS_HELP_STRING([[[--enable-mips-mmi]]],
|
||||
[Enable MIPS MMI optimizations: =no/off, check, api, yes/on:]
|
||||
[no/off: disable the optimizations; check: use internal checking code]
|
||||
[(deprecated and poorly supported); api: disable by default, enable by]
|
||||
[a call to png_set_option; yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __mips_mmi systems:
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
|
||||
[Disable MIPS MMI optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_mips_mmi=no;;
|
||||
check)
|
||||
AC_DEFINE([PNG_MIPS_MMI_CHECK_SUPPORTED], [],
|
||||
[Check for MIPS MMI support at run-time]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_MIPS_MMI_API_SUPPORTED], [],
|
||||
[Turn on MIPS MMI optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
|
||||
[Enable MIPS MMI optimizations])
|
||||
AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api', if]
|
||||
[you want the optimizations unconditionally pass '-mloongson-mmi -march=loongson3a']
|
||||
[to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}: invalid value])
|
||||
esac])
|
||||
|
||||
# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or
|
||||
# where MIPS optimizations were explicitly requested (this allows a fallback if a
|
||||
# future host CPU does not match 'mips*')
|
||||
|
||||
AM_CONDITIONAL([PNG_MIPS_MMI],
|
||||
[test "$enable_mips_mmi" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
mipsel*|mips64el*) :;;
|
||||
esac])
|
||||
|
||||
# INTEL
|
||||
# =====
|
||||
#
|
||||
# INTEL SSE (SIMD) support.
|
||||
|
||||
AC_ARG_ENABLE([intel-sse],
|
||||
AS_HELP_STRING([[[--enable-intel-sse]]],
|
||||
[Enable Intel SSE optimizations: =no/off, yes/on:]
|
||||
[no/off: disable the optimizations;]
|
||||
[yes/on: enable the optimizations.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling:
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
||||
[Disable Intel SSE optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_intel_sse=no ;;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
||||
[Enable Intel SSE optimizations]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
|
||||
esac])
|
||||
|
||||
# Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or
|
||||
# where Intel optimizations were explicitly requested (this allows a fallback
|
||||
# if a future host CPU does not match 'x86*')
|
||||
AM_CONDITIONAL([PNG_INTEL_SSE],
|
||||
[test "$enable_intel_sse" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
i?86|x86_64) : ;;
|
||||
*) test "$enable_intel_sse" != '' ;;
|
||||
esac])
|
||||
|
||||
# PowerPC
|
||||
# =======
|
||||
#
|
||||
# PowerPC VSX (SIMD) support.
|
||||
|
||||
AC_ARG_ENABLE([powerpc-vsx],
|
||||
AS_HELP_STRING([[[--enable-powerpc-vsx]]],
|
||||
[Enable POWERPC VSX optimizations: =no/off, check, api, yes/on:]
|
||||
[no/off: disable the optimizations; check: use internal checking code]
|
||||
[api: disable by default, enable by a call to png_set_option]
|
||||
[yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __ppc64__ systems:
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
||||
[Disable POWERPC VSX optimizations])
|
||||
# Prevent inclusion of the platform-specific files below:
|
||||
enable_powerpc_vsx=no ;;
|
||||
check)
|
||||
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
|
||||
[Check for POWERPC VSX support at run-time])
|
||||
AC_MSG_WARN([--enable-powerpc-vsx Please check contrib/powerpc/README file]
|
||||
[for the list of supported OSes.]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_POWERPC_VSX_API_SUPPORTED], [],
|
||||
[Turn on POWERPC VSX optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
|
||||
[Enable POWERPC VSX optimizations])
|
||||
AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api', if]
|
||||
[you want the optimizations unconditionally pass '-maltivec -mvsx']
|
||||
[or '-mcpu=power8' to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value])
|
||||
esac])
|
||||
|
||||
# Add PowerPC-specific files to all builds where $host_cpu is powerpc('powerpc*')
|
||||
# or where PowerPC optimizations were explicitly requested (this allows a fallback
|
||||
# if a future host CPU does not match 'powerpc*')
|
||||
|
||||
AM_CONDITIONAL([PNG_POWERPC_VSX],
|
||||
[test "$enable_powerpc_vsx" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
powerpc*|ppc64*) : ;;
|
||||
esac])
|
||||
|
||||
# LOONGARCH
|
||||
# ===
|
||||
#
|
||||
# LOONGARCH LSX (SIMD) support
|
||||
|
||||
if test "$LSX_CFLAGS" = ''; then
|
||||
LSX_CFLAGS="-mlsx"
|
||||
fi
|
||||
|
||||
compiler_support_loongarch_lsx=no
|
||||
AC_MSG_CHECKING(whether to use loongarch LSX intrinsics)
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS $LSX_CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include<lsxintrin.h>
|
||||
int main(){
|
||||
__m128i a, b, c;
|
||||
a = __lsx_vadd_w(b, c);
|
||||
return 0;
|
||||
}]])],compiler_support_loongarch_lsx=yes)
|
||||
CFLAGS=$save_CFLAGS
|
||||
AC_MSG_RESULT($compiler_support_loongarch_lsx)
|
||||
|
||||
AC_ARG_ENABLE([loongarch-lsx],
|
||||
AS_HELP_STRING([[[--enable-loongarch-lsx]]],
|
||||
[Enable LOONGARCH LSX optimizations: =no/off, yes/on:]
|
||||
[no/off: disable the optimizations;]
|
||||
[yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __loongarch_simd systems:
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
|
||||
[Disable LOONGARCH LSX optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_loongarch_lsx=no;;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
||||
[Enable LOONGARCH LSX optimizations])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}: invalid value])
|
||||
esac])
|
||||
|
||||
if test "$enable_loongarch_lsx" != 'no'; then
|
||||
if test $compiler_support_loongarch_lsx = yes; then
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1], [Enable LOONGARCH LSX optimizations])
|
||||
else
|
||||
AC_MSG_WARN([Compiler does not support loongarch LSX.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add LOONGARCH specific files to all builds where the host_cpu is loongarch ('loongarch*') or
|
||||
# where LOONGARCH optimizations were explicitly requested (this allows a fallback if a
|
||||
# future host CPU does not match 'loongarch*')
|
||||
|
||||
AM_CONDITIONAL([PNG_LOONGARCH_LSX],
|
||||
[test "$enable_loongarch_lsx" != 'no' && test $compiler_support_loongarch_lsx = yes &&
|
||||
case "$host_cpu" in
|
||||
loongarch*) :;;
|
||||
*) test "$enable_loongarch_lsx" != '';;
|
||||
esac])
|
||||
|
||||
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
||||
|
||||
# Config files, substituting as above
|
||||
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
|
||||
AC_CONFIG_FILES([libpng-config:libpng-config.in],
|
||||
[chmod +x libpng-config])
|
||||
|
||||
AC_OUTPUT
|
||||
5
contrib/README.txt
Normal file
5
contrib/README.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
This "contrib" directory contains contributions which are not necessarily under
|
||||
the libpng license, although all are open source. They are not part of
|
||||
libpng proper and are not used for building the library, although some are used
|
||||
for testing the library via "make check".
|
||||
83
contrib/arm-neon/README
Normal file
83
contrib/arm-neon/README
Normal file
@@ -0,0 +1,83 @@
|
||||
OPERATING SYSTEM SPECIFIC ARM NEON DETECTION
|
||||
--------------------------------------------
|
||||
|
||||
Detection of the ability to execute ARM NEON on an ARM processor requires
|
||||
operating system support. (The information is not available in user mode.)
|
||||
|
||||
HOW TO USE THIS
|
||||
---------------
|
||||
|
||||
This directory contains C code fragments that can be included in arm/arm_init.c
|
||||
by setting the macro PNG_ARM_NEON_FILE to the file name in "" or <> at build
|
||||
time. This setting is not recorded in pnglibconf.h and can be changed simply by
|
||||
rebuilding arm/arm_init.o with the required macro definition.
|
||||
|
||||
For any of this code to be used the ARM NEON code must be enabled and run time
|
||||
checks must be supported. I.e.:
|
||||
|
||||
#if PNG_ARM_NEON_OPT > 0
|
||||
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
|
||||
|
||||
This is done in a 'configure' build by passing configure the argument:
|
||||
|
||||
--enable-arm-neon=check
|
||||
|
||||
Apart from the basic Linux implementation in contrib/arm-neon/linux.c this code
|
||||
is unsupported. That means that it is not even compiled on a regular basis and
|
||||
may be broken in any given minor release.
|
||||
|
||||
FILE FORMAT
|
||||
-----------
|
||||
|
||||
Each file documents its testing status as of the last time it was tested (which
|
||||
may have been a long time ago):
|
||||
|
||||
STATUS: one of:
|
||||
SUPPORTED: This indicates that the file is included in the regularly
|
||||
performed test builds and bugs are fixed when discovered.
|
||||
COMPILED: This indicates that the code did compile at least once. See the
|
||||
more detailed description for the extent to which the result was
|
||||
successful.
|
||||
TESTED: This means the code was fully compiled into the libpng test programs
|
||||
and these were run at least once.
|
||||
|
||||
BUG REPORTS: an email address to which to send reports of problems
|
||||
|
||||
The file is a fragment of C code. It should not define any 'extern' symbols;
|
||||
everything should be static. It must define the function:
|
||||
|
||||
static int png_have_neon(png_structp png_ptr);
|
||||
|
||||
That function must return 1 if ARM NEON instructions are supported, 0 if not.
|
||||
It must not execute png_error unless it detects a bug. A png_error will prevent
|
||||
the reading of the PNG and in the future, writing too.
|
||||
|
||||
BUG REPORTS
|
||||
-----------
|
||||
|
||||
If you mail a bug report for any file that is not SUPPORTED there may only be
|
||||
limited response. Consider fixing it and sending a patch to fix the problem -
|
||||
this is more likely to result in action.
|
||||
|
||||
CONTRIBUTIONS
|
||||
-------------
|
||||
|
||||
You may send contributions of new implementations to
|
||||
png-mng-implement@sourceforge.net. Please write code in strict C90 C where
|
||||
possible. Obviously OS dependencies are to be expected. If you submit code you
|
||||
must have the authors permission and it must have a license that is acceptable
|
||||
to the current maintainer; in particular that license must permit modification
|
||||
and redistribution.
|
||||
|
||||
Please try to make the contribution a single file and give the file a clear and
|
||||
unambiguous name that identifies the target OS. If multiple files really are
|
||||
required put them all in a sub-directory.
|
||||
|
||||
You must also be prepared to handle bug reports from users of the code, either
|
||||
by joining the png-mng-implement mailing list or by providing an email for the
|
||||
"BUG REPORTS" entry or both. Please make sure that the header of the file
|
||||
contains the STATUS and BUG REPORTS fields as above.
|
||||
|
||||
Please list the OS requirements as precisely as possible. Ideally you should
|
||||
also list the environment in which the code has been tested and certainly list
|
||||
any environments where you suspect it might not work.
|
||||
39
contrib/arm-neon/android-ndk.c
Normal file
39
contrib/arm-neon/android-ndk.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/* contrib/arm-neon/android-ndk.c
|
||||
*
|
||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
||||
* Written by John Bowler, 2014.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* SEE contrib/arm-neon/README before reporting bugs
|
||||
*
|
||||
* STATUS: COMPILED, UNTESTED
|
||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
||||
*
|
||||
* png_have_neon implemented for the Android NDK, see:
|
||||
*
|
||||
* Documentation:
|
||||
* http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
|
||||
* https://code.google.com/p/android/issues/detail?id=49065
|
||||
*
|
||||
* NOTE: this requires that libpng is built against the Android NDK and linked
|
||||
* with an implementation of the Android ARM 'cpu-features' library. The code
|
||||
* has been compiled only, not linked: no version of the library has been found,
|
||||
* only the header files exist in the NDK.
|
||||
*/
|
||||
|
||||
#include <cpu-features.h>
|
||||
|
||||
static int
|
||||
png_have_neon(png_structp png_ptr)
|
||||
{
|
||||
/* This is a whole lot easier than the linux code, however it is probably
|
||||
* implemented as below, therefore it is better to cache the result (these
|
||||
* function calls may be slow!)
|
||||
*/
|
||||
PNG_UNUSED(png_ptr)
|
||||
return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
|
||||
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
|
||||
}
|
||||
120
contrib/arm-neon/linux-auxv.c
Normal file
120
contrib/arm-neon/linux-auxv.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/* contrib/arm-neon/linux-auxv.c
|
||||
*
|
||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
||||
* Written by Mans Rullgard, 2011.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* SEE contrib/arm-neon/README before reporting bugs
|
||||
*
|
||||
* STATUS: COMPILED, TESTED
|
||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
||||
*
|
||||
* png_have_neon implemented for Linux versions which allow access to
|
||||
* /proc/self/auxv. This is probably faster, cleaner and safer than the code to
|
||||
* read /proc/cpuinfo in contrib/arm-neon/linux, however it is yet another piece
|
||||
* of potentially untested code and has more complex dependencies than the code
|
||||
* to read cpuinfo.
|
||||
*
|
||||
* This generic __linux__ implementation requires reading /proc/self/auxv and
|
||||
* looking at each element for one that records NEON capabilities.
|
||||
*/
|
||||
|
||||
#include <unistd.h> /* for POSIX 1003.1 */
|
||||
#include <errno.h> /* for EINTR */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <elf.h>
|
||||
#include <asm/hwcap.h>
|
||||
|
||||
/* A read call may be interrupted, in which case it returns -1 and sets errno to
|
||||
* EINTR if nothing was done, otherwise (if something was done) a partial read
|
||||
* may result.
|
||||
*/
|
||||
static size_t
|
||||
safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
|
||||
{
|
||||
size_t ntotal = 0;
|
||||
char *buffer = png_voidcast(char*, buffer_in);
|
||||
|
||||
while (nbytes > 0)
|
||||
{
|
||||
unsigned int nread;
|
||||
int iread;
|
||||
|
||||
/* Passing nread > INT_MAX to read is implementation defined in POSIX
|
||||
* 1003.1, therefore despite the unsigned argument portable code must
|
||||
* limit the value to INT_MAX!
|
||||
*/
|
||||
if (nbytes > INT_MAX)
|
||||
nread = INT_MAX;
|
||||
|
||||
else
|
||||
nread = (unsigned int)/*SAFE*/nbytes;
|
||||
|
||||
iread = read(fd, buffer, nread);
|
||||
|
||||
if (iread == -1)
|
||||
{
|
||||
/* This is the devil in the details, a read can terminate early with 0
|
||||
* bytes read because of EINTR, yet it still returns -1 otherwise end
|
||||
* of file cannot be distinguished.
|
||||
*/
|
||||
if (errno != EINTR)
|
||||
{
|
||||
png_warning(png_ptr, "/proc read failed");
|
||||
return 0; /* I.e., a permanent failure */
|
||||
}
|
||||
}
|
||||
|
||||
else if (iread < 0)
|
||||
{
|
||||
/* Not a valid 'read' result: */
|
||||
png_warning(png_ptr, "OS /proc read bug");
|
||||
return 0;
|
||||
}
|
||||
|
||||
else if (iread > 0)
|
||||
{
|
||||
/* Continue reading until a permanent failure, or EOF */
|
||||
buffer += iread;
|
||||
nbytes -= (unsigned int)/*SAFE*/iread;
|
||||
ntotal += (unsigned int)/*SAFE*/iread;
|
||||
}
|
||||
|
||||
else
|
||||
return ntotal;
|
||||
}
|
||||
|
||||
return ntotal; /* nbytes == 0 */
|
||||
}
|
||||
|
||||
static int
|
||||
png_have_neon(png_structp png_ptr)
|
||||
{
|
||||
int fd = open("/proc/self/auxv", O_RDONLY);
|
||||
Elf32_auxv_t aux;
|
||||
|
||||
/* Failsafe: failure to open means no NEON */
|
||||
if (fd == -1)
|
||||
{
|
||||
png_warning(png_ptr, "/proc/self/auxv open failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux)
|
||||
{
|
||||
if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0)
|
||||
{
|
||||
close(fd);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
161
contrib/arm-neon/linux.c
Normal file
161
contrib/arm-neon/linux.c
Normal file
@@ -0,0 +1,161 @@
|
||||
/* contrib/arm-neon/linux.c
|
||||
*
|
||||
* Copyright (c) 2014, 2017 Glenn Randers-Pehrson
|
||||
* Written by John Bowler, 2014, 2017.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* SEE contrib/arm-neon/README before reporting bugs
|
||||
*
|
||||
* STATUS: SUPPORTED
|
||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
||||
*
|
||||
* png_have_neon implemented for Linux by reading the widely available
|
||||
* pseudo-file /proc/cpuinfo.
|
||||
*
|
||||
* This code is strict ANSI-C and is probably moderately portable; it does
|
||||
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static int
|
||||
png_have_neon(png_structp png_ptr)
|
||||
{
|
||||
FILE *f = fopen("/proc/cpuinfo", "rb");
|
||||
|
||||
if (f != NULL)
|
||||
{
|
||||
/* This is a simple state machine which reads the input byte-by-byte until
|
||||
* it gets a match on the 'neon' feature or reaches the end of the stream.
|
||||
*/
|
||||
static const char ch_feature[] = { 70, 69, 65, 84, 85, 82, 69, 83 };
|
||||
static const char ch_neon[] = { 78, 69, 79, 78 };
|
||||
|
||||
enum
|
||||
{
|
||||
StartLine, Feature, Colon, StartTag, Neon, HaveNeon, SkipTag, SkipLine
|
||||
} state;
|
||||
int counter;
|
||||
|
||||
for (state=StartLine, counter=0;;)
|
||||
{
|
||||
int ch = fgetc(f);
|
||||
|
||||
if (ch == EOF)
|
||||
{
|
||||
/* EOF means error or end-of-file, return false; neon at EOF is
|
||||
* assumed to be a mistake.
|
||||
*/
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case StartLine:
|
||||
/* Match spaces at the start of line */
|
||||
if (ch <= 32) /* skip control characters and space */
|
||||
break;
|
||||
|
||||
counter=0;
|
||||
state = Feature;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case Feature:
|
||||
/* Match 'FEATURE', ASCII case insensitive. */
|
||||
if ((ch & ~0x20) == ch_feature[counter])
|
||||
{
|
||||
if (++counter == (sizeof ch_feature))
|
||||
state = Colon;
|
||||
break;
|
||||
}
|
||||
|
||||
/* did not match 'feature' */
|
||||
state = SkipLine;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case SkipLine:
|
||||
skipLine:
|
||||
/* Skip everything until we see linefeed or carriage return */
|
||||
if (ch != 10 && ch != 13)
|
||||
break;
|
||||
|
||||
state = StartLine;
|
||||
break;
|
||||
|
||||
case Colon:
|
||||
/* Match any number of space or tab followed by ':' */
|
||||
if (ch == 32 || ch == 9)
|
||||
break;
|
||||
|
||||
if (ch == 58) /* i.e. ':' */
|
||||
{
|
||||
state = StartTag;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Either a bad line format or a 'feature' prefix followed by
|
||||
* other characters.
|
||||
*/
|
||||
state = SkipLine;
|
||||
goto skipLine;
|
||||
|
||||
case StartTag:
|
||||
/* Skip space characters before a tag */
|
||||
if (ch == 32 || ch == 9)
|
||||
break;
|
||||
|
||||
state = Neon;
|
||||
counter = 0;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case Neon:
|
||||
/* Look for 'neon' tag */
|
||||
if ((ch & ~0x20) == ch_neon[counter])
|
||||
{
|
||||
if (++counter == (sizeof ch_neon))
|
||||
state = HaveNeon;
|
||||
break;
|
||||
}
|
||||
|
||||
state = SkipTag;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case SkipTag:
|
||||
/* Skip non-space characters */
|
||||
if (ch == 10 || ch == 13)
|
||||
state = StartLine;
|
||||
|
||||
else if (ch == 32 || ch == 9)
|
||||
state = StartTag;
|
||||
break;
|
||||
|
||||
case HaveNeon:
|
||||
/* Have seen a 'neon' prefix, but there must be a space or new
|
||||
* line character to terminate it.
|
||||
*/
|
||||
if (ch == 10 || ch == 13 || ch == 32 || ch == 9)
|
||||
{
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
|
||||
state = SkipTag;
|
||||
break;
|
||||
|
||||
default:
|
||||
png_error(png_ptr, "png_have_neon: internal error (bug)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PNG_WARNINGS_SUPPORTED
|
||||
else
|
||||
png_warning(png_ptr, "/proc/cpuinfo open failed");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
49
contrib/conftest/README
Normal file
49
contrib/conftest/README
Normal file
@@ -0,0 +1,49 @@
|
||||
This directory contains test configuration files, currently always '.dfa' files
|
||||
intended to be used in the build by setting the make macro DFA_XTRA to the name
|
||||
of the file.
|
||||
|
||||
These files are used in release validation of the 'configure' builds of libpng
|
||||
by building 'make check', or 'make all-am' for cross-builds, with each .dfa
|
||||
file.
|
||||
|
||||
The files in this directory may change between minor releases, however
|
||||
contributions describing specific builds of libpng are welcomed. There is no
|
||||
guarantee that libpng will continue to build with such configurations; support
|
||||
for given configurations can be, and has been, dropped between successive minor
|
||||
releases. However if a .dfa file describing a configuration is not in this
|
||||
directory it is very unlikely that it will be tested before a minor release!
|
||||
|
||||
You can use these .dfa files as the basis of new configurations. Files in this
|
||||
directory should not have any use restrictions or restrictive licenses.
|
||||
|
||||
This directory is not included in the .zip and .7z distributions, which do
|
||||
not contain 'configure' scripts.
|
||||
|
||||
DOCUMENTATION
|
||||
=============
|
||||
|
||||
Examples:
|
||||
${srcdir}/pngusr.dfa
|
||||
${srcdir}/contrib/pngminim/*/pngusr.dfa
|
||||
|
||||
Documentation of the options:
|
||||
${srcdir}/scripts/pnglibconf.dfa
|
||||
|
||||
Documentation of the file format:
|
||||
${srcdir}/scripts/options.awk
|
||||
|
||||
FILE NAMING
|
||||
===========
|
||||
|
||||
File names in this directory may NOT contain any of the five characters:
|
||||
|
||||
- , + * ?
|
||||
|
||||
Neither may they contain any space character.
|
||||
|
||||
While other characters may be used it is strongly suggested that file names be
|
||||
limited to lower case Latiin alphabetic characters (a-z), digits (0-9) and, if
|
||||
necessary the underscore (_) character. File names should be about 8 characters
|
||||
long (excluding the .dfa extension). Submitted .dfa files should have names
|
||||
between 7 and 16 characters long, shorter names (6 characters or less) are
|
||||
reserved for standard tests.
|
||||
57
contrib/conftest/pngcp.dfa
Normal file
57
contrib/conftest/pngcp.dfa
Normal file
@@ -0,0 +1,57 @@
|
||||
# pngcp.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2016
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with support for pngcp. This means just png_read_png,
|
||||
# png_write_png and small number of configuration settings.
|
||||
#
|
||||
everything = off
|
||||
|
||||
# This option is specific to this configuration; it adds a #define to the
|
||||
# generated pnglibconf.h which turns on the (not portable) timing option for
|
||||
# pngcp. Note that any option is automatically preceded by PNG_; there is no
|
||||
# way round this and this is deliberate.
|
||||
option PNGCP_TIMING
|
||||
|
||||
# Because of the everything off above the option must also be turned on. This
|
||||
# may not be done in one step because it is safer and avoids mis-spelled options
|
||||
# in user .dfa files to error out if an unrecognized option is turned on.
|
||||
option PNGCP_TIMING on
|
||||
|
||||
# Options to turn on png_read_png and png_write_png:
|
||||
option INFO_IMAGE on
|
||||
option SEQUENTIAL_READ on
|
||||
option EASY_ACCESS on
|
||||
option WRITE on
|
||||
option WRITE_16BIT on
|
||||
option WRITE_FILTER on
|
||||
|
||||
# pngcp needs this to preserve unknown chunks, switching all these on means that
|
||||
# pngcp can work without explicit known chunk reading support
|
||||
option UNKNOWN_CHUNKS on
|
||||
option SET_UNKNOWN_CHUNKS on
|
||||
option HANDLE_AS_UNKNOWN on
|
||||
option SAVE_UNKNOWN_CHUNKS on
|
||||
option WRITE_UNKNOWN_CHUNKS on
|
||||
|
||||
# pngcp needs this to handle palette files with invalid indices:
|
||||
option CHECK_FOR_INVALID_INDEX on
|
||||
option GET_PALETTE_MAX on
|
||||
|
||||
# Pre-libpng 1.7 pngcp has to stash text chunks manually, post 1.7 without this
|
||||
# text chunks should be handled as unknown ok.
|
||||
option TEXT on
|
||||
|
||||
# this is used to turn off limits:
|
||||
option USER_LIMITS on
|
||||
option SET_USER_LIMITS on
|
||||
|
||||
# these are just required for specific customizations
|
||||
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
|
||||
option WRITE_CUSTOMIZE_COMPRESSION on
|
||||
58
contrib/conftest/read.dfa
Normal file
58
contrib/conftest/read.dfa
Normal file
@@ -0,0 +1,58 @@
|
||||
# read.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2013
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with basic read support. This enables the lowest level libpng
|
||||
# read API - the one where the calling code has to use a loop to read each row.
|
||||
# At present this is the API used by most programs.
|
||||
#
|
||||
# Support is enabled only for those chunks and transformations that are
|
||||
# typically required - others can be added easily.
|
||||
#
|
||||
|
||||
everything = off
|
||||
|
||||
# The sequential read code is enabled here; the progressive code can be used
|
||||
# instead but there is no point enabling both.
|
||||
|
||||
option SEQUENTIAL_READ on
|
||||
|
||||
# Likewise it is pointless enabling both fixed and floating point APIs. Choose
|
||||
# one or the other for both the API and the internal math.
|
||||
|
||||
#Fixed point:
|
||||
#option FIXED_POINT on
|
||||
#option FLOATING_ARITHMETIC off
|
||||
|
||||
#Floating point:
|
||||
option FLOATING_POINT on
|
||||
option FLOATING_ARITHMETIC on
|
||||
|
||||
# Basic error handling, IO and user memory support. The latter allows the
|
||||
# application program to provide its own implementations of 'malloc' and 'free'.
|
||||
option SETJMP on
|
||||
option STDIO on
|
||||
option USER_MEM on
|
||||
|
||||
# To read the full set of PNG images correctly interlace, transparency and
|
||||
# 16-bit support is required. The application can implement interlace itself,
|
||||
# but very few do and it's no longer possible to disable it when READ is
|
||||
# enabled.
|
||||
option READ_tRNS on
|
||||
option READ_16BIT on
|
||||
|
||||
# Everything else is application dependent. This file assumes the app handles
|
||||
# all the native PNG bit layouts, so it doesn't need any of layout change
|
||||
# transforms, but needs libpng to perform gamma correction. It doesn't do any
|
||||
# colorspace stuff and ignores the 'significant bit' information.
|
||||
#
|
||||
# If your app always expands the image to a limited set of bit layouts you
|
||||
# probably want to consider using the simplified API instead of the low level
|
||||
# one - see png.h and s_read.dfa.
|
||||
option READ_GAMMA on
|
||||
35
contrib/conftest/s_read.dfa
Normal file
35
contrib/conftest/s_read.dfa
Normal file
@@ -0,0 +1,35 @@
|
||||
# s_read.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2013
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with simplified read support (only). This builds a minimal
|
||||
# libpng able to read all PNG formats and convert them into a small number of
|
||||
# well understood memory formats.
|
||||
#
|
||||
|
||||
everything = off
|
||||
|
||||
option SIMPLIFIED_READ on
|
||||
|
||||
# It isn't necessary to chose fixed or floating point for the APIs because the
|
||||
# simplified API doesn't need fixed or floating point numbers. It is necessary
|
||||
# to chose an internal math implementation. The default (because of 'everything
|
||||
# = off') is fixed point - turn the floating point implementation on if you have
|
||||
# hardware floating point or prefer your software floating point implementation.
|
||||
option FLOATING_ARITHMETIC on
|
||||
|
||||
# This is not strictly necessary, but without it the message strings in the API
|
||||
# will not be filled in
|
||||
option ERROR_TEXT on
|
||||
|
||||
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
|
||||
# need this if you don't use them, they just allow the in-memory layout to be
|
||||
# changed to match common hardware formats.
|
||||
option SIMPLIFIED_READ_AFIRST on
|
||||
option SIMPLIFIED_READ_BGR on
|
||||
33
contrib/conftest/s_write.dfa
Normal file
33
contrib/conftest/s_write.dfa
Normal file
@@ -0,0 +1,33 @@
|
||||
# s_write.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2013
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with (just) simplified write support
|
||||
#
|
||||
|
||||
everything = off
|
||||
|
||||
option SIMPLIFIED_WRITE on
|
||||
|
||||
# It isn't necessary to chose fixed or floating point for the APIs because the
|
||||
# simplified API doesn't need fixed or floating point numbers. It is necessary
|
||||
# to chose an internal math implementation. The default (because of 'everything
|
||||
# = off') is fixed point - turn the floating point implementation on if you have
|
||||
# hardware floating point or prefer your software floating point implementation.
|
||||
option FLOATING_ARITHMETIC on
|
||||
|
||||
# This is not strictly necessary, but without it the message strings in the API
|
||||
# will not be filled in
|
||||
option ERROR_TEXT on
|
||||
|
||||
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
|
||||
# need this if you don't use them, they just allow the in-memory layout to be
|
||||
# changed to match common hardware formats.
|
||||
option SIMPLIFIED_WRITE_AFIRST on
|
||||
option SIMPLIFIED_WRITE_BGR on
|
||||
36
contrib/conftest/simple.dfa
Normal file
36
contrib/conftest/simple.dfa
Normal file
@@ -0,0 +1,36 @@
|
||||
# simple.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2013
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with just the simplified APIs (read and write).
|
||||
#
|
||||
|
||||
everything = off
|
||||
|
||||
option SIMPLIFIED_WRITE on
|
||||
option SIMPLIFIED_READ on
|
||||
|
||||
# It isn't necessary to chose fixed or floating point for the APIs because the
|
||||
# simplified API doesn't need fixed or floating point numbers. It is necessary
|
||||
# to chose an internal math implementation. The default (because of 'everything
|
||||
# = off') is fixed point - turn the floating point implementation on if you have
|
||||
# hardware floating point or prefer your software floating point implementation.
|
||||
option FLOATING_ARITHMETIC on
|
||||
|
||||
# This is not strictly necessary, but without it the message strings in the API
|
||||
# will not be filled in
|
||||
option ERROR_TEXT on
|
||||
|
||||
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
|
||||
# need this if you don't use them, they just allow the in-memory layout to be
|
||||
# changed to match common hardware formats.
|
||||
option SIMPLIFIED_READ_AFIRST on
|
||||
option SIMPLIFIED_READ_BGR on
|
||||
option SIMPLIFIED_WRITE_AFIRST on
|
||||
option SIMPLIFIED_WRITE_BGR on
|
||||
45
contrib/conftest/write.dfa
Normal file
45
contrib/conftest/write.dfa
Normal file
@@ -0,0 +1,45 @@
|
||||
# write.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2013
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with no read support and minimal write support.
|
||||
#
|
||||
|
||||
everything = off
|
||||
|
||||
# Switch on the write code - this makes a minimalist encoder
|
||||
|
||||
option WRITE on
|
||||
|
||||
# Choose fixed or floating point APIs and arithmetic. The choices are
|
||||
# independent but normally they will match. It is typically better to use the
|
||||
# floating point if you have floating point hardware. If you don't know, or
|
||||
# (perhaps) to make libpng smaller used fixed point throughout.
|
||||
|
||||
#Fixed point:
|
||||
#option FIXED_POINT on
|
||||
#option FLOATING_ARITHMETIC off
|
||||
|
||||
#Floating point:
|
||||
option FLOATING_POINT on
|
||||
option FLOATING_ARITHMETIC on
|
||||
|
||||
# Basic error handling, IO and user memory support. The latter allows the
|
||||
# application program to provide its own implementations of 'malloc' and 'free'.
|
||||
option SETJMP on
|
||||
option STDIO on
|
||||
option USER_MEM on
|
||||
|
||||
# Everything else is optional. Unlike the read code in libpng the write code
|
||||
# does not need to deal with arbitrary formats, so only add support for things
|
||||
# you really do write! For example you might only write sRGB images, sometimes
|
||||
# with transparency and never write 16 bit images, so:
|
||||
option WRITE_sRGB on
|
||||
option WRITE_tRNS on
|
||||
#option WRITE_16BIT off (this is the default with 'everything = off')
|
||||
24
contrib/examples/README.txt
Normal file
24
contrib/examples/README.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
This directory (contrib/examples) contains examples of libpng usage.
|
||||
|
||||
NO COPYRIGHT RIGHTS ARE CLAIMED TO ANY OF THE FILES IN THIS DIRECTORY.
|
||||
|
||||
To the extent possible under law, the authors have waived all copyright and
|
||||
related or neighboring rights to this work. This work is published from:
|
||||
United States.
|
||||
|
||||
The files may be used freely in any way. The intention is that appropriate
|
||||
parts of the files be used in other libpng-using programs without any need for
|
||||
the authors of the using code to seek copyright or license from the original
|
||||
authors.
|
||||
|
||||
The source code and comments in this directory are the original work of the
|
||||
people named below. No other person or organization has made contributions to
|
||||
the work in this directory.
|
||||
|
||||
ORIGINAL AUTHORS
|
||||
The following people have contributed to the code in this directory. None
|
||||
of the people below claim any rights with regard to the contents of this
|
||||
directory.
|
||||
|
||||
John Bowler <jbowler at acm.org>
|
||||
185
contrib/examples/iccfrompng.c
Normal file
185
contrib/examples/iccfrompng.c
Normal file
@@ -0,0 +1,185 @@
|
||||
/*- iccfrompng
|
||||
*
|
||||
* COPYRIGHT: Written by John Cunningham Bowler, 2011.
|
||||
* To the extent possible under law, the author has waived all copyright and
|
||||
* related or neighboring rights to this work. This work is published from:
|
||||
* United States.
|
||||
*
|
||||
* Extract any icc profiles found in the given PNG files. This is a simple
|
||||
* example of a program that extracts information from the header of a PNG file
|
||||
* without processing the image. Notice that some header information may occur
|
||||
* after the image data. Textual data and comments are an example; the approach
|
||||
* in this file won't work reliably for such data because it only looks for the
|
||||
* information in the section of the file that precedes the image data.
|
||||
*
|
||||
* Compile and link against libpng and zlib, plus anything else required on the
|
||||
* system you use.
|
||||
*
|
||||
* To use supply a list of PNG files containing iCCP chunks, the chunks will be
|
||||
* extracted to a similarly named file with the extension replaced by 'icc',
|
||||
* which will be overwritten without warning.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <png.h>
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) && \
|
||||
defined (PNG_iCCP_SUPPORTED)
|
||||
|
||||
|
||||
static int verbose = 1;
|
||||
static png_byte no_profile[] = "no profile";
|
||||
|
||||
static png_bytep
|
||||
extract(FILE *fp, png_uint_32 *proflen)
|
||||
{
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);
|
||||
png_infop info_ptr = NULL;
|
||||
png_bytep result = NULL;
|
||||
|
||||
/* Initialize for error or no profile: */
|
||||
*proflen = 0;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
{
|
||||
fprintf(stderr, "iccfrompng: version library mismatch?\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_init_io(png_ptr, fp);
|
||||
|
||||
info_ptr = png_create_info_struct(png_ptr);
|
||||
if (info_ptr == NULL)
|
||||
png_error(png_ptr, "OOM allocating info structure");
|
||||
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
{
|
||||
png_charp name;
|
||||
int compression_type;
|
||||
png_bytep profile;
|
||||
|
||||
if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile,
|
||||
proflen) & PNG_INFO_iCCP)
|
||||
{
|
||||
result = malloc(*proflen);
|
||||
if (result != NULL)
|
||||
memcpy(result, profile, *proflen);
|
||||
|
||||
else
|
||||
png_error(png_ptr, "OOM allocating profile buffer");
|
||||
}
|
||||
|
||||
else
|
||||
result = no_profile;
|
||||
}
|
||||
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
extract_one_file(const char *filename)
|
||||
{
|
||||
int result = 0;
|
||||
FILE *fp = fopen(filename, "rb");
|
||||
|
||||
if (fp != NULL)
|
||||
{
|
||||
png_uint_32 proflen = 0;
|
||||
png_bytep profile = extract(fp, &proflen);
|
||||
|
||||
if (profile != NULL && profile != no_profile)
|
||||
{
|
||||
size_t len;
|
||||
char *output;
|
||||
|
||||
{
|
||||
const char *ep = strrchr(filename, '.');
|
||||
|
||||
if (ep != NULL)
|
||||
len = ep-filename;
|
||||
|
||||
else
|
||||
len = strlen(filename);
|
||||
}
|
||||
|
||||
output = malloc(len + 5);
|
||||
if (output != NULL)
|
||||
{
|
||||
FILE *of;
|
||||
|
||||
memcpy(output, filename, len);
|
||||
strcpy(output+len, ".icc");
|
||||
|
||||
of = fopen(output, "wb");
|
||||
if (of != NULL)
|
||||
{
|
||||
if (fwrite(profile, proflen, 1, of) == 1 &&
|
||||
fflush(of) == 0 &&
|
||||
fclose(of) == 0)
|
||||
{
|
||||
if (verbose)
|
||||
printf("%s -> %s\n", filename, output);
|
||||
/* Success return */
|
||||
result = 1;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: error writing profile\n", output);
|
||||
if (remove(output))
|
||||
fprintf(stderr, "%s: could not remove file\n", output);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "%s: failed to open output file\n", output);
|
||||
|
||||
free(output);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "%s: OOM allocating string!\n", filename);
|
||||
|
||||
free(profile);
|
||||
}
|
||||
|
||||
else if (verbose && profile == no_profile)
|
||||
printf("%s has no profile\n", filename);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "%s: could not open file\n", filename);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int extracted = 0;
|
||||
|
||||
for (i=1; i<argc; ++i)
|
||||
{
|
||||
if (strcmp(argv[i], "-q") == 0)
|
||||
verbose = 0;
|
||||
|
||||
else if (extract_one_file(argv[i]))
|
||||
extracted = 1;
|
||||
}
|
||||
|
||||
/* Exit code is true if any extract succeeds */
|
||||
return extracted == 0;
|
||||
}
|
||||
#endif /* READ && STDIO && iCCP */
|
||||
371
contrib/examples/pngpixel.c
Normal file
371
contrib/examples/pngpixel.c
Normal file
@@ -0,0 +1,371 @@
|
||||
/*- pngpixel
|
||||
*
|
||||
* COPYRIGHT: Written by John Cunningham Bowler, 2011.
|
||||
* To the extent possible under law, the author has waived all copyright and
|
||||
* related or neighboring rights to this work. This work is published from:
|
||||
* United States.
|
||||
*
|
||||
* Read a single pixel value from a PNG file.
|
||||
*
|
||||
* This code illustrates basic 'by-row' reading of a PNG file using libpng.
|
||||
* Rows are read until a particular pixel is found; the value of this pixel is
|
||||
* then printed on stdout.
|
||||
*
|
||||
* The code illustrates how to do this on interlaced as well as non-interlaced
|
||||
* images. Normally you would call png_set_interlace_handling() to have libpng
|
||||
* deal with the interlace for you, but that obliges you to buffer half of the
|
||||
* image to assemble the interlaced rows. In this code
|
||||
* png_set_interlace_handling() is not called and, instead, the code handles the
|
||||
* interlace passes directly looking for the required pixel.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <setjmp.h> /* required for error handling */
|
||||
|
||||
/* Normally use <png.h> here to get the installed libpng, but this is done to
|
||||
* ensure the code picks up the local libpng implementation:
|
||||
*/
|
||||
#include "../../png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)
|
||||
|
||||
/* Return component 'c' of pixel 'x' from the given row. */
|
||||
static unsigned int
|
||||
component(png_const_bytep row, png_uint_32 x, unsigned int c,
|
||||
unsigned int bit_depth, unsigned int channels)
|
||||
{
|
||||
/* PNG images can be up to 2^31 pixels wide, but this means they can be up to
|
||||
* 2^37 bits wide (for a 64-bit pixel - the largest possible) and hence 2^34
|
||||
* bytes wide. Since the row fitted into memory, however, the following must
|
||||
* work:
|
||||
*/
|
||||
png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels);
|
||||
png_uint_32 bit_offset_lo = bit_depth * ((x & 0x3f) * channels + c);
|
||||
|
||||
row = (png_const_bytep)(((const png_byte (*)[8])row) + bit_offset_hi);
|
||||
row += bit_offset_lo >> 3;
|
||||
bit_offset_lo &= 0x07;
|
||||
|
||||
/* PNG pixels are packed into bytes to put the first pixel in the highest
|
||||
* bits of the byte and into two bytes for 16-bit values with the high 8 bits
|
||||
* first, so:
|
||||
*/
|
||||
switch (bit_depth)
|
||||
{
|
||||
case 1: return (row[0] >> (7-bit_offset_lo)) & 0x01;
|
||||
case 2: return (row[0] >> (6-bit_offset_lo)) & 0x03;
|
||||
case 4: return (row[0] >> (4-bit_offset_lo)) & 0x0f;
|
||||
case 8: return row[0];
|
||||
case 16: return (row[0] << 8) + row[1];
|
||||
default:
|
||||
/* This should never happen; it indicates a bug in this program or in
|
||||
* libpng itself:
|
||||
*/
|
||||
fprintf(stderr, "pngpixel: invalid bit depth %u\n", bit_depth);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Print a pixel from a row returned by libpng; determine the row format, find
|
||||
* the pixel, and print the relevant information to stdout.
|
||||
*/
|
||||
static void
|
||||
print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
png_uint_32 x)
|
||||
{
|
||||
unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
|
||||
|
||||
switch (png_get_color_type(png_ptr, info_ptr))
|
||||
{
|
||||
case PNG_COLOR_TYPE_GRAY:
|
||||
printf("GRAY %u\n", component(row, x, 0, bit_depth, 1));
|
||||
return;
|
||||
|
||||
/* The palette case is slightly more difficult - the palette and, if
|
||||
* present, the tRNS ('transparency', though the values are really
|
||||
* opacity) data must be read to give the full picture:
|
||||
*/
|
||||
case PNG_COLOR_TYPE_PALETTE:
|
||||
{
|
||||
int index = component(row, x, 0, bit_depth, 1);
|
||||
png_colorp palette = NULL;
|
||||
int num_palette = 0;
|
||||
|
||||
if ((png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) &
|
||||
PNG_INFO_PLTE) && num_palette > 0 && palette != NULL)
|
||||
{
|
||||
png_bytep trans_alpha = NULL;
|
||||
int num_trans = 0;
|
||||
if ((png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans,
|
||||
NULL) & PNG_INFO_tRNS) && num_trans > 0 &&
|
||||
trans_alpha != NULL)
|
||||
printf("INDEXED %u = %d %d %d %d\n", index,
|
||||
palette[index].red, palette[index].green,
|
||||
palette[index].blue,
|
||||
index < num_trans ? trans_alpha[index] : 255);
|
||||
|
||||
else /* no transparency */
|
||||
printf("INDEXED %u = %d %d %d\n", index,
|
||||
palette[index].red, palette[index].green,
|
||||
palette[index].blue);
|
||||
}
|
||||
|
||||
else
|
||||
printf("INDEXED %u = invalid index\n", index);
|
||||
}
|
||||
return;
|
||||
|
||||
case PNG_COLOR_TYPE_RGB:
|
||||
printf("RGB %u %u %u\n", component(row, x, 0, bit_depth, 3),
|
||||
component(row, x, 1, bit_depth, 3),
|
||||
component(row, x, 2, bit_depth, 3));
|
||||
return;
|
||||
|
||||
case PNG_COLOR_TYPE_GRAY_ALPHA:
|
||||
printf("GRAY+ALPHA %u %u\n", component(row, x, 0, bit_depth, 2),
|
||||
component(row, x, 1, bit_depth, 2));
|
||||
return;
|
||||
|
||||
case PNG_COLOR_TYPE_RGB_ALPHA:
|
||||
printf("RGBA %u %u %u %u\n", component(row, x, 0, bit_depth, 4),
|
||||
component(row, x, 1, bit_depth, 4),
|
||||
component(row, x, 2, bit_depth, 4),
|
||||
component(row, x, 3, bit_depth, 4));
|
||||
return;
|
||||
|
||||
default:
|
||||
png_error(png_ptr, "pngpixel: invalid color type");
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
/* This program uses the default, <setjmp.h> based, libpng error handling
|
||||
* mechanism, therefore any local variable that exists before the call to
|
||||
* setjmp and is changed after the call to setjmp returns successfully must
|
||||
* be declared with 'volatile' to ensure that their values don't get
|
||||
* destroyed by longjmp:
|
||||
*/
|
||||
volatile int result = 1/*fail*/;
|
||||
|
||||
if (argc == 4)
|
||||
{
|
||||
long x = atol(argv[1]);
|
||||
long y = atol(argv[2]);
|
||||
FILE *f = fopen(argv[3], "rb");
|
||||
volatile png_bytep row = NULL;
|
||||
|
||||
if (f != NULL)
|
||||
{
|
||||
/* libpng requires a callback function for handling errors; this
|
||||
* callback must not return. The default callback function uses a
|
||||
* stored <setjmp.h> style jmp_buf which is held in a png_struct and
|
||||
* writes error messages to stderr. Creating the png_struct is a
|
||||
* little tricky; just copy the following code.
|
||||
*/
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
|
||||
if (info_ptr != NULL)
|
||||
{
|
||||
/* Declare stack variables to hold pointers to locally allocated
|
||||
* data.
|
||||
*/
|
||||
|
||||
/* Initialize the error control buffer: */
|
||||
if (setjmp(png_jmpbuf(png_ptr)) == 0)
|
||||
{
|
||||
png_uint_32 width, height;
|
||||
int bit_depth, color_type, interlace_method,
|
||||
compression_method, filter_method;
|
||||
png_bytep row_tmp;
|
||||
|
||||
/* Now associate the recently opened (FILE*) with the default
|
||||
* libpng initialization functions. Sometimes libpng is
|
||||
* compiled without stdio support (it can be difficult to do
|
||||
* in some environments); in that case you will have to write
|
||||
* your own read callback to read data from the (FILE*).
|
||||
*/
|
||||
png_init_io(png_ptr, f);
|
||||
|
||||
/* And read the first part of the PNG file - the header and
|
||||
* all the information up to the first pixel.
|
||||
*/
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
/* This fills in enough information to tell us the width of
|
||||
* each row in bytes, allocate the appropriate amount of
|
||||
* space. In this case png_malloc is used - it will not
|
||||
* return if memory isn't available.
|
||||
*/
|
||||
row = png_malloc(png_ptr, png_get_rowbytes(png_ptr,
|
||||
info_ptr));
|
||||
|
||||
/* To avoid the overhead of using a volatile auto copy row_tmp
|
||||
* to a local here - just use row for the png_free below.
|
||||
*/
|
||||
row_tmp = row;
|
||||
|
||||
/* All the information we need is in the header is returned by
|
||||
* png_get_IHDR, if this fails we can now use 'png_error' to
|
||||
* signal the error and return control to the setjmp above.
|
||||
*/
|
||||
if (png_get_IHDR(png_ptr, info_ptr, &width, &height,
|
||||
&bit_depth, &color_type, &interlace_method,
|
||||
&compression_method, &filter_method))
|
||||
{
|
||||
int passes, pass;
|
||||
|
||||
/* png_set_interlace_handling returns the number of
|
||||
* passes required as well as turning on libpng's
|
||||
* handling, but since we do it ourselves this is
|
||||
* necessary:
|
||||
*/
|
||||
switch (interlace_method)
|
||||
{
|
||||
case PNG_INTERLACE_NONE:
|
||||
passes = 1;
|
||||
break;
|
||||
|
||||
case PNG_INTERLACE_ADAM7:
|
||||
passes = PNG_INTERLACE_ADAM7_PASSES;
|
||||
break;
|
||||
|
||||
default:
|
||||
png_error(png_ptr, "pngpixel: unknown interlace");
|
||||
}
|
||||
|
||||
/* Now read the pixels, pass-by-pass, row-by-row: */
|
||||
png_start_read_image(png_ptr);
|
||||
|
||||
for (pass=0; pass<passes; ++pass)
|
||||
{
|
||||
png_uint_32 ystart, xstart, ystep, xstep;
|
||||
png_uint_32 py;
|
||||
|
||||
if (interlace_method == PNG_INTERLACE_ADAM7)
|
||||
{
|
||||
/* Sometimes the whole pass is empty because the
|
||||
* image is too narrow or too short. libpng
|
||||
* expects to be called for each row that is
|
||||
* present in the pass, so it may be necessary to
|
||||
* skip the loop below (over py) if the image is
|
||||
* too narrow.
|
||||
*/
|
||||
if (PNG_PASS_COLS(width, pass) == 0)
|
||||
continue;
|
||||
|
||||
/* We need the starting pixel and the offset
|
||||
* between each pixel in this pass; use the macros
|
||||
* in png.h:
|
||||
*/
|
||||
xstart = PNG_PASS_START_COL(pass);
|
||||
ystart = PNG_PASS_START_ROW(pass);
|
||||
xstep = PNG_PASS_COL_OFFSET(pass);
|
||||
ystep = PNG_PASS_ROW_OFFSET(pass);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
ystart = xstart = 0;
|
||||
ystep = xstep = 1;
|
||||
}
|
||||
|
||||
/* To find the pixel, loop over 'py' for each pass
|
||||
* reading a row and then checking to see if it
|
||||
* contains the pixel.
|
||||
*/
|
||||
for (py = ystart; py < height; py += ystep)
|
||||
{
|
||||
png_uint_32 px, ppx;
|
||||
|
||||
/* png_read_row takes two pointers. When libpng
|
||||
* handles the interlace the first is filled in
|
||||
* pixel-by-pixel, and the second receives the same
|
||||
* pixels but they are replicated across the
|
||||
* unwritten pixels so far for each pass. When we
|
||||
* do the interlace, however, they just contain
|
||||
* the pixels from the interlace pass - giving
|
||||
* both is wasteful and pointless, so we pass a
|
||||
* NULL pointer.
|
||||
*/
|
||||
png_read_row(png_ptr, row_tmp, NULL);
|
||||
|
||||
/* Now find the pixel if it is in this row; there
|
||||
* are, of course, much better ways of doing this
|
||||
* than using a for loop:
|
||||
*/
|
||||
if (y == py) for (px = xstart, ppx = 0;
|
||||
px < width; px += xstep, ++ppx) if (x == px)
|
||||
{
|
||||
/* 'ppx' is the index of the pixel in the row
|
||||
* buffer.
|
||||
*/
|
||||
print_pixel(png_ptr, info_ptr, row_tmp, ppx);
|
||||
|
||||
/* Now terminate the loops early - we have
|
||||
* found and handled the required data.
|
||||
*/
|
||||
goto pass_loop_end;
|
||||
} /* x loop */
|
||||
} /* y loop */
|
||||
} /* pass loop */
|
||||
|
||||
/* Finally free the temporary buffer: */
|
||||
pass_loop_end:
|
||||
row = NULL;
|
||||
png_free(png_ptr, row_tmp);
|
||||
}
|
||||
|
||||
else
|
||||
png_error(png_ptr, "pngpixel: png_get_IHDR failed");
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Else libpng has raised an error. An error message has
|
||||
* already been output, so it is only necessary to clean up
|
||||
* locally allocated data:
|
||||
*/
|
||||
if (row != NULL)
|
||||
{
|
||||
/* The default implementation of png_free never errors out
|
||||
* (it just crashes if something goes wrong), but the safe
|
||||
* way of using it is still to clear 'row' before calling
|
||||
* png_free:
|
||||
*/
|
||||
png_bytep row_tmp = row;
|
||||
row = NULL;
|
||||
png_free(png_ptr, row_tmp);
|
||||
}
|
||||
}
|
||||
|
||||
png_destroy_info_struct(png_ptr, &info_ptr);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngpixel: out of memory allocating png_info\n");
|
||||
|
||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngpixel: out of memory allocating png_struct\n");
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngpixel: %s: could not open file\n", argv[3]);
|
||||
}
|
||||
|
||||
else
|
||||
/* Wrong number of arguments */
|
||||
fprintf(stderr, "pngpixel: usage: pngpixel x y png-file\n");
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* READ && SEQUENTIAL_READ */
|
||||
96
contrib/examples/pngtopng.c
Normal file
96
contrib/examples/pngtopng.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/*- pngtopng
|
||||
*
|
||||
* COPYRIGHT: Written by John Cunningham Bowler, 2011, 2017.
|
||||
* To the extent possible under law, the author has waived all copyright and
|
||||
* related or neighboring rights to this work. This work is published from:
|
||||
* United States.
|
||||
*
|
||||
* Read a PNG and write it out in a fixed format, using the 'simplified API'
|
||||
* that was introduced in libpng-1.6.0.
|
||||
*
|
||||
* This sample code is just the code from the top of 'example.c' with some error
|
||||
* handling added. See example.c for more comments.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Normally use <png.h> here to get the installed libpng, but this is done to
|
||||
* ensure the code picks up the local libpng implementation:
|
||||
*/
|
||||
#include "../../png.h"
|
||||
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) && \
|
||||
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int result = 1;
|
||||
|
||||
if (argc == 3)
|
||||
{
|
||||
png_image image;
|
||||
|
||||
/* Only the image structure version number needs to be set. */
|
||||
memset(&image, 0, sizeof image);
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
|
||||
if (png_image_begin_read_from_file(&image, argv[1]))
|
||||
{
|
||||
png_bytep buffer;
|
||||
|
||||
/* Change this to try different formats! If you set a colormap format
|
||||
* then you must also supply a colormap below.
|
||||
*/
|
||||
image.format = PNG_FORMAT_RGBA;
|
||||
|
||||
buffer = malloc(PNG_IMAGE_SIZE(image));
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
if (png_image_finish_read(&image, NULL/*background*/, buffer,
|
||||
0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */))
|
||||
{
|
||||
if (png_image_write_to_file(&image, argv[2],
|
||||
0/*convert_to_8bit*/, buffer, 0/*row_stride*/,
|
||||
NULL/*colormap*/))
|
||||
result = 0;
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngtopng: write %s: %s\n", argv[2],
|
||||
image.message);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngtopng: read %s: %s\n", argv[1],
|
||||
image.message);
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "pngtopng: out of memory: %lu bytes\n",
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
|
||||
/* This is the only place where a 'free' is required; libpng does
|
||||
* the cleanup on error and success, but in this case we couldn't
|
||||
* complete the read because of running out of memory and so libpng
|
||||
* has not got to the point where it can do cleanup.
|
||||
*/
|
||||
png_image_free(&image);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
/* Failed to read the first argument: */
|
||||
fprintf(stderr, "pngtopng: %s: %s\n", argv[1], image.message);
|
||||
}
|
||||
|
||||
else
|
||||
/* Wrong number of arguments */
|
||||
fprintf(stderr, "pngtopng: usage: pngtopng input-file output-file\n");
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* READ && WRITE */
|
||||
648
contrib/examples/simpleover.c
Normal file
648
contrib/examples/simpleover.c
Normal file
@@ -0,0 +1,648 @@
|
||||
/*- simpleover
|
||||
*
|
||||
* COPYRIGHT: Written by John Cunningham Bowler, 2015.
|
||||
* To the extent possible under law, the author has waived all copyright and
|
||||
* related or neighboring rights to this work. This work is published from:
|
||||
* United States.
|
||||
*
|
||||
* Read several PNG files, which should have an alpha channel or transparency
|
||||
* information, and composite them together to produce one or more 16-bit linear
|
||||
* RGBA intermediates. This involves doing the correct 'over' composition to
|
||||
* combine the alpha channels and corresponding data.
|
||||
*
|
||||
* Finally read an output (background) PNG using the 24-bit RGB format (the
|
||||
* PNG will be composited on green (#00ff00) by default if it has an alpha
|
||||
* channel), and apply the intermediate image generated above to specified
|
||||
* locations in the image.
|
||||
*
|
||||
* The command line has the general format:
|
||||
*
|
||||
* simpleover <background.png> [output.png]
|
||||
* {--sprite=width,height,name {[--at=x,y] {sprite.png}}}
|
||||
* {--add=name {x,y}}
|
||||
*
|
||||
* The --sprite and --add options may occur multiple times. They are executed
|
||||
* in order. --add may refer to any sprite already read.
|
||||
*
|
||||
* This code is intended to show how to composite multiple images together
|
||||
* correctly. Apart from the libpng Simplified API the only work done in here
|
||||
* is to combine multiple input PNG images into a single sprite; this involves
|
||||
* a Porter-Duff 'over' operation and the input PNG images may, as a result,
|
||||
* be regarded as being layered one on top of the other with the first (leftmost
|
||||
* on the command line) being at the bottom and the last on the top.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* Normally use <png.h> here to get the installed libpng, but this is done to
|
||||
* ensure the code picks up the local libpng implementation, so long as this
|
||||
* file is linked against a sufficiently recent libpng (1.6+) it is ok to
|
||||
* change this to <png.h>:
|
||||
*/
|
||||
#include "../../png.h"
|
||||
|
||||
#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
|
||||
|
||||
#define sprite_name_chars 15
|
||||
struct sprite {
|
||||
FILE *file;
|
||||
png_uint_16p buffer;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
char name[sprite_name_chars+1];
|
||||
};
|
||||
|
||||
#if 0 /* div by 65535 test program */
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
double err = 0;
|
||||
unsigned int xerr = 0;
|
||||
unsigned int r = 32769;
|
||||
{
|
||||
unsigned int x = 0;
|
||||
|
||||
do {
|
||||
unsigned int t = x + (x >> 16) /*+ (x >> 31)*/ + r;
|
||||
double v = x, errtest;
|
||||
|
||||
if (t < x) {
|
||||
fprintf(stderr, "overflow: %u+%u -> %u\n", x, r, t);
|
||||
return 1;
|
||||
}
|
||||
|
||||
v /= 65535;
|
||||
errtest = v;
|
||||
t >>= 16;
|
||||
errtest -= t;
|
||||
|
||||
if (errtest > err) {
|
||||
err = errtest;
|
||||
xerr = x;
|
||||
|
||||
if (errtest >= .5) {
|
||||
fprintf(stderr, "error: %u/65535 = %f, not %u, error %f\n",
|
||||
x, v, t, errtest);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} while (++x <= 65535U*65535U);
|
||||
}
|
||||
|
||||
printf("error %f @ %u\n", err, xerr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* div by 65535 test program */
|
||||
|
||||
static void
|
||||
sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
png_imagep image, const png_uint_16 *buffer)
|
||||
{
|
||||
/* This is where the Porter-Duff 'Over' operator is evaluated; change this
|
||||
* code to change the operator (this could be parameterized). Any other
|
||||
* image processing operation could be used here.
|
||||
*/
|
||||
|
||||
|
||||
/* Check for an x or y offset that pushes any part of the image beyond the
|
||||
* right or bottom of the sprite:
|
||||
*/
|
||||
if ((y_offset < 0 || (unsigned)/*SAFE*/y_offset < sprite->height) &&
|
||||
(x_offset < 0 || (unsigned)/*SAFE*/x_offset < sprite->width))
|
||||
{
|
||||
unsigned int y = 0;
|
||||
|
||||
if (y_offset < 0)
|
||||
y = -y_offset; /* Skip to first visible row */
|
||||
|
||||
do
|
||||
{
|
||||
unsigned int x = 0;
|
||||
|
||||
if (x_offset < 0)
|
||||
x = -x_offset;
|
||||
|
||||
do
|
||||
{
|
||||
/* In and out are RGBA values, so: */
|
||||
const png_uint_16 *in_pixel = buffer + (y * image->width + x)*4;
|
||||
png_uint_32 in_alpha = in_pixel[3];
|
||||
|
||||
/* This is the optimized Porter-Duff 'Over' operation, when the
|
||||
* input alpha is 0 the output is not changed.
|
||||
*/
|
||||
if (in_alpha > 0)
|
||||
{
|
||||
png_uint_16 *out_pixel = sprite->buffer +
|
||||
((y+y_offset) * sprite->width + (x+x_offset))*4;
|
||||
|
||||
/* This is the weight to apply to the output: */
|
||||
in_alpha = 65535-in_alpha;
|
||||
|
||||
if (in_alpha > 0)
|
||||
{
|
||||
/* The input must be composed onto the output. This means
|
||||
* multiplying the current output pixel value by the inverse
|
||||
* of the input alpha (1-alpha). A division is required but
|
||||
* it is by the constant 65535. Approximate this as:
|
||||
*
|
||||
* (x + (x >> 16) + 32769) >> 16;
|
||||
*
|
||||
* This is exact (and does not overflow) for all values of
|
||||
* x in the range 0..65535*65535. (Note that the calculation
|
||||
* produces the closest integer; the maximum error is <0.5).
|
||||
*/
|
||||
png_uint_32 tmp;
|
||||
|
||||
# define compose(c)\
|
||||
tmp = out_pixel[c] * in_alpha;\
|
||||
tmp = (tmp + (tmp >> 16) + 32769) >> 16;\
|
||||
out_pixel[c] = tmp + in_pixel[c]
|
||||
|
||||
/* The following is very vectorizable... */
|
||||
compose(0);
|
||||
compose(1);
|
||||
compose(2);
|
||||
compose(3);
|
||||
}
|
||||
|
||||
else
|
||||
out_pixel[0] = in_pixel[0],
|
||||
out_pixel[1] = in_pixel[1],
|
||||
out_pixel[2] = in_pixel[2],
|
||||
out_pixel[3] = in_pixel[3];
|
||||
}
|
||||
}
|
||||
while (++x < image->width);
|
||||
}
|
||||
while (++y < image->height);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
create_sprite(struct sprite *sprite, int *argc, const char ***argv)
|
||||
{
|
||||
/* Read the arguments and create this sprite. The sprite buffer has already
|
||||
* been allocated. This reads the input PNGs one by one in linear format,
|
||||
* composes them onto the sprite buffer (the code in the function above)
|
||||
* then saves the result, converting it on the fly to PNG RGBA 8-bit format.
|
||||
*/
|
||||
while (*argc > 0)
|
||||
{
|
||||
char tombstone;
|
||||
int x = 0, y = 0;
|
||||
|
||||
if ((*argv)[0][0] == '-' && (*argv)[0][1] == '-')
|
||||
{
|
||||
/* The only supported option is --at. */
|
||||
if (sscanf((*argv)[0], "--at=%d,%d%c", &x, &y, &tombstone) != 2)
|
||||
break; /* success; caller will parse this option */
|
||||
|
||||
++*argv, --*argc;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* The argument has to be a file name */
|
||||
png_image image;
|
||||
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
image.opaque = NULL;
|
||||
|
||||
if (png_image_begin_read_from_file(&image, (*argv)[0]))
|
||||
{
|
||||
png_uint_16p buffer;
|
||||
|
||||
image.format = PNG_FORMAT_LINEAR_RGB_ALPHA;
|
||||
|
||||
buffer = malloc(PNG_IMAGE_SIZE(image));
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
if (png_image_finish_read(&image, NULL/*background*/, buffer,
|
||||
0/*row_stride*/,
|
||||
NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/))
|
||||
{
|
||||
/* This is the place where the Porter-Duff 'Over' operator
|
||||
* needs to be done by this code. In fact, any image
|
||||
* processing required can be done here; the data is in
|
||||
* the correct format (linear, 16-bit) and source and
|
||||
* destination are in memory.
|
||||
*/
|
||||
sprite_op(sprite, x, y, &image, buffer);
|
||||
free(buffer);
|
||||
++*argv, --*argc;
|
||||
/* And continue to the next argument */
|
||||
continue;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
free(buffer);
|
||||
fprintf(stderr, "simpleover: read %s: %s\n", (*argv)[0],
|
||||
image.message);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: out of memory: %lu bytes\n",
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
|
||||
/* png_image_free must be called if we abort the Simplified API
|
||||
* read because of a problem detected in this code. If problems
|
||||
* are detected in the Simplified API it cleans up itself.
|
||||
*/
|
||||
png_image_free(&image);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Failed to read the first argument: */
|
||||
fprintf(stderr, "simpleover: %s: %s\n", (*argv)[0], image.message);
|
||||
}
|
||||
|
||||
return 0; /* failure */
|
||||
}
|
||||
}
|
||||
|
||||
/* All the sprite operations have completed successfully. Save the RGBA
|
||||
* buffer as a PNG using the simplified write API.
|
||||
*/
|
||||
sprite->file = tmpfile();
|
||||
|
||||
if (sprite->file != NULL)
|
||||
{
|
||||
png_image save;
|
||||
|
||||
memset(&save, 0, sizeof save);
|
||||
save.version = PNG_IMAGE_VERSION;
|
||||
save.opaque = NULL;
|
||||
save.width = sprite->width;
|
||||
save.height = sprite->height;
|
||||
save.format = PNG_FORMAT_LINEAR_RGB_ALPHA;
|
||||
save.flags = PNG_IMAGE_FLAG_FAST;
|
||||
save.colormap_entries = 0;
|
||||
|
||||
if (png_image_write_to_stdio(&save, sprite->file, 1/*convert_to_8_bit*/,
|
||||
sprite->buffer, 0/*row_stride*/, NULL/*colormap*/))
|
||||
{
|
||||
/* Success; the buffer is no longer needed: */
|
||||
free(sprite->buffer);
|
||||
sprite->buffer = NULL;
|
||||
return 1; /* ok */
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: write sprite %s: %s\n", sprite->name,
|
||||
save.message);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: sprite %s: could not allocate tmpfile: %s\n",
|
||||
sprite->name, strerror(errno));
|
||||
|
||||
return 0; /* fail */
|
||||
}
|
||||
|
||||
static int
|
||||
add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
int *argc, const char ***argv)
|
||||
{
|
||||
/* Given a --add argument naming this sprite, perform the operations listed
|
||||
* in the following arguments. The arguments are expected to have the form
|
||||
* (x,y), which is just an offset at which to add the sprite to the
|
||||
* output.
|
||||
*/
|
||||
while (*argc > 0)
|
||||
{
|
||||
char tombstone;
|
||||
int x, y;
|
||||
|
||||
if ((*argv)[0][0] == '-' && (*argv)[0][1] == '-')
|
||||
return 1; /* success */
|
||||
|
||||
if (sscanf((*argv)[0], "%d,%d%c", &x, &y, &tombstone) == 2)
|
||||
{
|
||||
/* Now add the new image into the sprite data, but only if it
|
||||
* will fit.
|
||||
*/
|
||||
if (x < 0 || y < 0 ||
|
||||
(unsigned)/*SAFE*/x >= output->width ||
|
||||
(unsigned)/*SAFE*/y >= output->height ||
|
||||
sprite->width > output->width-x ||
|
||||
sprite->height > output->height-y)
|
||||
{
|
||||
fprintf(stderr, "simpleover: sprite %s @ (%d,%d) outside image\n",
|
||||
sprite->name, x, y);
|
||||
/* Could just skip this, but for the moment it is an error */
|
||||
return 0; /* error */
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Since we know the sprite fits we can just read it into the
|
||||
* output using the simplified API.
|
||||
*/
|
||||
png_image in;
|
||||
|
||||
in.version = PNG_IMAGE_VERSION;
|
||||
rewind(sprite->file);
|
||||
|
||||
if (png_image_begin_read_from_stdio(&in, sprite->file))
|
||||
{
|
||||
in.format = PNG_FORMAT_RGB; /* force compose */
|
||||
|
||||
if (png_image_finish_read(&in, NULL/*background*/,
|
||||
out_buf + (y*output->width + x)*3/*RGB*/,
|
||||
output->width*3/*row_stride*/,
|
||||
NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/))
|
||||
{
|
||||
++*argv, --*argc;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* The read failed: */
|
||||
fprintf(stderr, "simpleover: add sprite %s: %s\n", sprite->name,
|
||||
in.message);
|
||||
return 0; /* error */
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: --add='%s': invalid position %s\n",
|
||||
sprite->name, (*argv)[0]);
|
||||
return 0; /* error */
|
||||
}
|
||||
}
|
||||
|
||||
return 1; /* ok */
|
||||
}
|
||||
|
||||
static int
|
||||
simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
const char **argv)
|
||||
{
|
||||
int result = 1; /* success */
|
||||
# define csprites 10/*limit*/
|
||||
# define str(a) #a
|
||||
int nsprites = 0;
|
||||
struct sprite sprites[csprites];
|
||||
|
||||
while (argc > 0)
|
||||
{
|
||||
result = 0; /* fail */
|
||||
|
||||
if (strncmp(argv[0], "--sprite=", 9) == 0)
|
||||
{
|
||||
char tombstone;
|
||||
|
||||
if (nsprites < csprites)
|
||||
{
|
||||
int n;
|
||||
|
||||
sprites[nsprites].width = sprites[nsprites].height = 0;
|
||||
sprites[nsprites].name[0] = 0;
|
||||
|
||||
n = sscanf(argv[0], "--sprite=%u,%u,%" str(sprite_name_chars) "s%c",
|
||||
&sprites[nsprites].width, &sprites[nsprites].height,
|
||||
sprites[nsprites].name, &tombstone);
|
||||
|
||||
if ((n == 2 || n == 3) &&
|
||||
sprites[nsprites].width > 0 && sprites[nsprites].height > 0)
|
||||
{
|
||||
size_t buf_size, tmp;
|
||||
|
||||
/* Default a name if not given. */
|
||||
if (sprites[nsprites].name[0] == 0)
|
||||
sprintf(sprites[nsprites].name, "sprite-%d", nsprites+1);
|
||||
|
||||
/* Allocate a buffer for the sprite and calculate the buffer
|
||||
* size:
|
||||
*/
|
||||
buf_size = sizeof (png_uint_16 [4]);
|
||||
buf_size *= sprites[nsprites].width;
|
||||
buf_size *= sprites[nsprites].height;
|
||||
|
||||
/* This can overflow a (size_t); check for this: */
|
||||
tmp = buf_size;
|
||||
tmp /= sprites[nsprites].width;
|
||||
tmp /= sprites[nsprites].height;
|
||||
|
||||
if (tmp == sizeof (png_uint_16 [4]))
|
||||
{
|
||||
sprites[nsprites].buffer = malloc(buf_size);
|
||||
/* This buffer must be initialized to transparent: */
|
||||
memset(sprites[nsprites].buffer, 0, buf_size);
|
||||
|
||||
if (sprites[nsprites].buffer != NULL)
|
||||
{
|
||||
sprites[nsprites].file = NULL;
|
||||
++argv, --argc;
|
||||
|
||||
if (create_sprite(sprites+nsprites++, &argc, &argv))
|
||||
{
|
||||
result = 1; /* still ok */
|
||||
continue;
|
||||
}
|
||||
|
||||
break; /* error */
|
||||
}
|
||||
}
|
||||
|
||||
/* Overflow, or OOM */
|
||||
fprintf(stderr, "simpleover: %s: sprite too large\n", argv[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: %s: invalid sprite (%u,%u)\n",
|
||||
argv[0], sprites[nsprites].width, sprites[nsprites].height);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: %s: too many sprites\n", argv[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (strncmp(argv[0], "--add=", 6) == 0)
|
||||
{
|
||||
const char *name = argv[0]+6;
|
||||
int isprite = nsprites;
|
||||
|
||||
++argv, --argc;
|
||||
|
||||
while (--isprite >= 0)
|
||||
{
|
||||
if (strcmp(sprites[isprite].name, name) == 0)
|
||||
{
|
||||
if (!add_sprite(output, out_buf, sprites+isprite, &argc, &argv))
|
||||
goto out; /* error in add_sprite */
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isprite < 0) /* sprite not found */
|
||||
{
|
||||
fprintf(stderr, "simpleover: --add='%s': sprite not found\n", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: %s: unrecognized operation\n", argv[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
result = 1; /* ok */
|
||||
}
|
||||
|
||||
/* Clean up the cache of sprites: */
|
||||
out:
|
||||
while (--nsprites >= 0)
|
||||
{
|
||||
if (sprites[nsprites].buffer != NULL)
|
||||
free(sprites[nsprites].buffer);
|
||||
|
||||
if (sprites[nsprites].file != NULL)
|
||||
(void)fclose(sprites[nsprites].file);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int result = 1; /* default to fail */
|
||||
|
||||
if (argc >= 2)
|
||||
{
|
||||
int argi = 2;
|
||||
const char *output = NULL;
|
||||
png_image image;
|
||||
|
||||
if (argc > 2 && argv[2][0] != '-'/*an operation*/)
|
||||
{
|
||||
output = argv[2];
|
||||
argi = 3;
|
||||
}
|
||||
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
image.opaque = NULL;
|
||||
|
||||
if (png_image_begin_read_from_file(&image, argv[1]))
|
||||
{
|
||||
png_bytep buffer;
|
||||
|
||||
image.format = PNG_FORMAT_RGB; /* 24-bit RGB */
|
||||
|
||||
buffer = malloc(PNG_IMAGE_SIZE(image));
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
png_color background = {0, 0xff, 0}; /* fully saturated green */
|
||||
|
||||
if (png_image_finish_read(&image, &background, buffer,
|
||||
0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */))
|
||||
{
|
||||
/* At this point png_image_finish_read has cleaned up the
|
||||
* allocated data in png_image, and only the buffer needs to be
|
||||
* freed.
|
||||
*
|
||||
* Perform the remaining operations:
|
||||
*/
|
||||
if (simpleover_process(&image, buffer, argc-argi, argv+argi))
|
||||
{
|
||||
/* Write the output: */
|
||||
if ((output != NULL &&
|
||||
png_image_write_to_file(&image, output,
|
||||
0/*convert_to_8bit*/, buffer, 0/*row_stride*/,
|
||||
NULL/*colormap*/)) ||
|
||||
(output == NULL &&
|
||||
png_image_write_to_stdio(&image, stdout,
|
||||
0/*convert_to_8bit*/, buffer, 0/*row_stride*/,
|
||||
NULL/*colormap*/)))
|
||||
result = 0;
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: write %s: %s\n",
|
||||
output == NULL ? "stdout" : output, image.message);
|
||||
}
|
||||
|
||||
/* else simpleover_process writes an error message */
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: read %s: %s\n", argv[1],
|
||||
image.message);
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: out of memory: %lu bytes\n",
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
|
||||
/* This is the only place where a 'free' is required; libpng does
|
||||
* the cleanup on error and success, but in this case we couldn't
|
||||
* complete the read because of running out of memory.
|
||||
*/
|
||||
png_image_free(&image);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Failed to read the first argument: */
|
||||
fprintf(stderr, "simpleover: %s: %s\n", argv[1], image.message);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Usage message */
|
||||
fprintf(stderr,
|
||||
"simpleover: usage: simpleover background.png [output.png]\n"
|
||||
" Output 'background.png' as a 24-bit RGB PNG file in 'output.png'\n"
|
||||
" or, if not given, stdout. 'background.png' will be composited\n"
|
||||
" on fully saturated green.\n"
|
||||
"\n"
|
||||
" Optionally, before output, process additional PNG files:\n"
|
||||
"\n"
|
||||
" --sprite=width,height,name {[--at=x,y] {sprite.png}}\n"
|
||||
" Produce a transparent sprite of size (width,height) and with\n"
|
||||
" name 'name'.\n"
|
||||
" For each sprite.png composite it using a Porter-Duff 'Over'\n"
|
||||
" operation at offset (x,y) in the sprite (defaulting to (0,0)).\n"
|
||||
" Input PNGs will be truncated to the area of the sprite.\n"
|
||||
"\n"
|
||||
" --add='name' {x,y}\n"
|
||||
" Optionally, before output, composite a sprite, 'name', which\n"
|
||||
" must have been previously produced using --sprite, at each\n"
|
||||
" offset (x,y) in the output image. Each sprite must fit\n"
|
||||
" completely within the output image.\n"
|
||||
"\n"
|
||||
" PNG files are processed in the order they occur on the command\n"
|
||||
" line and thus the first PNG processed appears as the bottommost\n"
|
||||
" in the output image.\n");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* SIMPLIFIED_READ */
|
||||
340
contrib/gregbook/COPYING
Normal file
340
contrib/gregbook/COPYING
Normal file
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
@@ -1,12 +1,19 @@
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -23,4 +30,21 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
131
contrib/gregbook/Makefile.mingw32
Normal file
131
contrib/gregbook/Makefile.mingw32
Normal file
@@ -0,0 +1,131 @@
|
||||
# Sample makefile for rpng-win / rpng2-win / wpng using mingw32-gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a DOS-prompt window via:
|
||||
#
|
||||
# make -f Makefile.mingw32
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are in subdirectories at the same level as the current subdirectory
|
||||
# (as indicated by the PNGDIR and ZDIR macros below). It makes no assumptions
|
||||
# at all about the mingw32 installation tree (W32DIR). Edit as appropriate.
|
||||
#
|
||||
# Note that the names of the dynamic and static libpng and zlib libraries
|
||||
# used below may change in later releases of the libraries. This makefile
|
||||
# builds both statically and dynamically linked executables by default.
|
||||
# (You need only one set, but for testing it can be handy to have both.)
|
||||
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
#PNGDIR = ../..# for libpng-x.y.z/contrib/gregbook builds
|
||||
PNGDIR = ../libpng-win32
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = $(PNGDIR)/libpng.dll.a # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
#ZDIR = ../../../zlib-win32# for libpng-x.y.z/contrib/gregbook builds
|
||||
ZDIR = ../zlib-win32
|
||||
ZINC = -I$(ZDIR)
|
||||
ZLIBd = $(ZDIR)/libzdll.a
|
||||
ZLIBs = $(ZDIR)/libz.a
|
||||
|
||||
# change this to be the path where mingw32 installs its stuff:
|
||||
W32DIR =
|
||||
#W32DIR = /usr/local/cross-tools/i386-mingw32msvc
|
||||
W32INC = -I$(W32DIR)/include
|
||||
W32LIB = $(W32DIR)/lib/libuser32.a $(W32DIR)/lib/libgdi32.a
|
||||
|
||||
CC = gcc
|
||||
#CC = i386-mingw32msvc-gcc # e.g., Linux -> Win32 cross-compilation
|
||||
LD = $(CC)
|
||||
RM = rm -f
|
||||
CPPFLAGS = $(INCS)
|
||||
CFLAGS = -O -Wall $(MINGW_CCFLAGS)
|
||||
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
|
||||
# [-ansi, -pedantic and -W can also be used]
|
||||
LDFLAGS = $(MINGW_LDFLAGS)
|
||||
O = .o
|
||||
E = .exe
|
||||
|
||||
INCS = $(PNGINC) $(ZINC) $(W32INC)
|
||||
RLIBSd = $(PNGLIBd) $(ZLIBd) $(W32LIB) -lm
|
||||
RLIBSs = $(PNGLIBs) $(ZLIBs) $(W32LIB) -lm
|
||||
WLIBSd = $(PNGLIBd) $(ZLIBd)
|
||||
WLIBSs = $(PNGLIBs) $(ZLIBs)
|
||||
|
||||
RPNG = rpng-win
|
||||
RPNG2 = rpng2-win
|
||||
WPNG = wpng
|
||||
|
||||
ROBJSd = $(RPNG)$(O) readpng.pic$(O)
|
||||
ROBJS2d = $(RPNG2)$(O) readpng2.pic$(O)
|
||||
WOBJSd = $(WPNG)$(O) writepng.pic$(O)
|
||||
|
||||
RPNGs = $(RPNG)-static
|
||||
RPNG2s = $(RPNG2)-static
|
||||
WPNGs = $(WPNG)-static
|
||||
|
||||
ROBJSs = $(RPNG)$(O) readpng$(O)
|
||||
ROBJS2s = $(RPNG2)$(O) readpng2$(O)
|
||||
WOBJSs = $(WPNG)$(O) writepng$(O)
|
||||
|
||||
STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E)
|
||||
DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
|
||||
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O):
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
%.pic$(O): %.c
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
|
||||
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
|
||||
all: $(EXES)
|
||||
|
||||
$(RPNGs)$(E): $(ROBJSs)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJSs) $(RLIBSs)
|
||||
|
||||
$(RPNG)$(E): $(ROBJSd)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJSd) $(RLIBSd)
|
||||
|
||||
$(RPNG2s)$(E): $(ROBJS2s)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2s) $(RLIBSs)
|
||||
|
||||
$(RPNG2)$(E): $(ROBJS2d)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2d) $(RLIBSd)
|
||||
|
||||
$(WPNGs)$(E): $(WOBJSs)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJSs) $(WLIBSs)
|
||||
|
||||
$(WPNG)$(E): $(WOBJSd)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJSd) $(WLIBSd)
|
||||
|
||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
||||
$(WPNG)$(O): $(WPNG).c writepng.h
|
||||
|
||||
readpng$(O) readpng.pic$(O): readpng.c readpng.h
|
||||
readpng2$(O) readpng2.pic$(O): readpng2.c readpng2.h
|
||||
writepng$(O) writepng.pic$(O): writepng.c writepng.h
|
||||
|
||||
|
||||
# maintenance ---------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
$(RM) $(EXES)
|
||||
$(RM) $(ROBJSs) $(ROBJS2s) $(WOBJSs)
|
||||
$(RM) $(ROBJSd) $(ROBJS2d) $(WOBJSd)
|
||||
@@ -1,6 +1,6 @@
|
||||
# Sample makefile for rpng-x / rpng2-x / wpng for SGI using cc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 16 January 1000
|
||||
# Last modified: 7 March 2002
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGINC = -I/usr/local/include
|
||||
PNGLIB = -L/usr/local/lib -lpng # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng.a # statically linked against libpng
|
||||
PNGINC = -I/usr/local/include/libpng16
|
||||
PNGLIB = -L/usr/local/lib -lpng16 # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng16.a # statically linked against libpng
|
||||
# or:
|
||||
#PNGINC = -I../..
|
||||
#PNGLIB = -L../.. -lpng
|
||||
@@ -52,8 +52,11 @@ WLIBS = $(PNGLIB) $(ZLIB)
|
||||
CC = cc
|
||||
LD = cc
|
||||
RM = rm -f
|
||||
CFLAGS = -O -fullwarn $(INCS)
|
||||
LDFLAGS =
|
||||
# ABI must be the same as that used to build libpng.
|
||||
ABI =
|
||||
CPPFLAGS =
|
||||
CFLAGS = $(ABI) -O -fullwarn $(INCS)
|
||||
LDFLAGS = $(ABI)
|
||||
O = .o
|
||||
E =
|
||||
|
||||
@@ -71,7 +74,7 @@ EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O):
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
|
||||
@@ -1,93 +1,123 @@
|
||||
# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 28 February 2000
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Buy some for friends
|
||||
# and family, too. (Not that this is a blatant plug or anything.)
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a shell prompt in the usual way; for example:
|
||||
#
|
||||
# make -f Makefile.unx
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are both installed in /usr/local/{include,lib} (as indicated by the
|
||||
# PNG* and Z* macros below). Edit as appropriate--choose only ONE each of
|
||||
# the PNGINC, PNGLIB, ZINC and ZLIB lines.
|
||||
# and are installed in /usr/local/{include,lib} or as otherwise indicated by
|
||||
# the PNG* and Z* macros below. Edit as appropriate--choose only ONE each of
|
||||
# the PNGINC, PNGLIBd, PNGLIBs, ZINC, ZLIBd and ZLIBs lines.
|
||||
#
|
||||
# This makefile builds statically linked executables (against libpng and zlib,
|
||||
# that is), but that can be changed by uncommenting the appropriate PNGLIB and
|
||||
# ZLIB lines.
|
||||
# This makefile builds both dynamically and statically linked executables
|
||||
# (against libpng and zlib, that is), but that can be changed by modifying
|
||||
# the "EXES =" line. (You need only one set, but for testing it can be handy
|
||||
# to have both.)
|
||||
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGINC = -I/usr/local/include
|
||||
#PNGLIB = -L/usr/local/lib -lpng # dynamically linked against libpng
|
||||
PNGLIB = /usr/local/lib/libpng.a # statically linked against libpng
|
||||
#PNGDIR = /usr/local/lib
|
||||
#PNGINC = -I/usr/local/include/libpng16
|
||||
#PNGLIBd = -L$(PNGDIR) -lpng16 # dynamically linked, installed libpng
|
||||
#PNGLIBs = $(PNGDIR)/libpng16.a # statically linked, installed libpng
|
||||
# or:
|
||||
#PNGINC = -I../..
|
||||
#PNGLIB = -L../.. -lpng
|
||||
#PNGLIB = ../../libpng.a
|
||||
PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds
|
||||
#PNGDIR = ../libpng
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng16 # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
ZDIR = /usr/local/lib
|
||||
#ZDIR = /usr/lib64
|
||||
ZINC = -I/usr/local/include
|
||||
#ZLIB = -L/usr/local/lib -lz # dynamically linked against zlib
|
||||
ZLIB = /usr/local/lib/libz.a # statically linked against zlib
|
||||
#ZINC = -I../zlib
|
||||
#ZLIB = -L../zlib -lz
|
||||
#ZLIB = ../../../zlib/libz.a
|
||||
ZLIBd = -L$(ZDIR) -lz # dynamically linked against zlib
|
||||
ZLIBs = $(ZDIR)/libz.a # statically linked against zlib
|
||||
# or:
|
||||
#ZDIR = ../zlib
|
||||
#ZINC = -I$(ZDIR)
|
||||
#ZLIBd = -Wl,-rpath,$(ZDIR) -L$(ZDIR) -lz # -rpath allows in-place testing
|
||||
#ZLIBs = $(ZDIR)/libz.a
|
||||
|
||||
#XINC = -I/usr/include/X11 # old-style, stock X distributions
|
||||
#XLIB = -L/usr/lib/X11 -lX11
|
||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||
#XINC = -I/usr/include # old-style, stock X distributions
|
||||
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
|
||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||
#XLIB = -L/usr/openwin/lib -lX11
|
||||
XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.)
|
||||
XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
|
||||
XLIB = -L/usr/X11R6/lib -lX11
|
||||
#XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
|
||||
|
||||
INCS = $(PNGINC) $(ZINC) $(XINC)
|
||||
RLIBS = $(PNGLIB) $(ZLIB) $(XLIB) -lm
|
||||
WLIBS = $(PNGLIB) $(ZLIB)
|
||||
RLIBSd = $(PNGLIBd) $(ZLIBd) $(XLIB) -lm
|
||||
RLIBSs = $(PNGLIBs) $(ZLIBs) $(XLIB) -lm
|
||||
WLIBSd = $(PNGLIBd) $(ZLIBd) -lm
|
||||
WLIBSs = $(PNGLIBs) $(ZLIBs) -lm
|
||||
|
||||
CC = gcc
|
||||
LD = gcc
|
||||
RM = rm -f
|
||||
CFLAGS = -O -Wall $(INCS)
|
||||
CPPFLAGS = $(INCS) -DFEATURE_LOOP
|
||||
CFLAGS = -O -Wall
|
||||
#CFLAGS = -O -W -Wall -Wextra -pedantic -ansi
|
||||
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
|
||||
# [-ansi, -pedantic and -W can also be used]
|
||||
# [-ansi, -pedantic, -Wextra, and -W can also be used]
|
||||
LDFLAGS =
|
||||
O = .o
|
||||
E =
|
||||
|
||||
RPNG = rpng-x
|
||||
RPNG2 = rpng2-x
|
||||
WPNG = wpng
|
||||
RPNG = rpng-x
|
||||
RPNG2 = rpng2-x
|
||||
WPNG = wpng
|
||||
|
||||
RPNGs = $(RPNG)-static
|
||||
RPNG2s = $(RPNG2)-static
|
||||
WPNGs = $(WPNG)-static
|
||||
|
||||
ROBJS = $(RPNG)$(O) readpng$(O)
|
||||
ROBJS2 = $(RPNG2)$(O) readpng2$(O)
|
||||
WOBJS = $(WPNG)$(O) writepng$(O)
|
||||
|
||||
EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E)
|
||||
DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
|
||||
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O):
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
|
||||
all: $(EXES)
|
||||
|
||||
$(RPNGs)$(E): $(ROBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSs)
|
||||
|
||||
$(RPNG)$(E): $(ROBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSd)
|
||||
|
||||
$(RPNG2s)$(E): $(ROBJS2)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSs)
|
||||
|
||||
$(RPNG2)$(E): $(ROBJS2)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSd)
|
||||
|
||||
$(WPNGs)$(E): $(WOBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSs)
|
||||
|
||||
$(WPNG)$(E): $(WOBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSd)
|
||||
|
||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# Sample makefile for rpng-win / rpng2-win / wpng using MSVC and NMAKE.
|
||||
# Greg Roelofs
|
||||
# Last modified: 16 February 1999
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Buy some for friends
|
||||
# and family, too. (Not that this is a blatant plug or anything.)
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a DOS prompt window via:
|
||||
#
|
||||
@@ -17,7 +18,7 @@
|
||||
# "c:\windows\command.com /e:4096" as the program command line and set the
|
||||
# working directory to this directory. Then double-click to open the new
|
||||
# DOS-prompt window with a bigger environment and retry the commands above.
|
||||
#
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are in subdirectories at the same level as the current subdirectory
|
||||
# (as indicated by the PNGPATH and ZPATH macros below). Edit as appropriate.
|
||||
@@ -32,12 +33,12 @@
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGPATH = ../..
|
||||
PNGPATH = ../libpng
|
||||
PNGINC = -I$(PNGPATH)
|
||||
#PNGLIB = $(PNGPATH)/pngdll.lib
|
||||
PNGLIB = $(PNGPATH)/libpng.lib
|
||||
|
||||
ZPATH = ../../../zlib
|
||||
ZPATH = ../zlib
|
||||
ZINC = -I$(ZPATH)
|
||||
#ZLIB = $(ZPATH)/zlibdll.lib
|
||||
ZLIB = $(ZPATH)/zlibstat.lib
|
||||
@@ -52,8 +53,9 @@ WLIBS = $(PNGLIB) $(ZLIB)
|
||||
CC = cl
|
||||
LD = link
|
||||
RM = del
|
||||
CFLAGS = -nologo -O -W3 $(INCS) $(cvars)
|
||||
# [note that -Wall is an MSVC-specific compilation flag ("all warnings on")]
|
||||
CPPFLAGS = $(INCS)
|
||||
CFLAGS = -nologo -O -W3 $(cvars)
|
||||
# [note that -W3 is an MSVC-specific compilation flag ("all warnings on")]
|
||||
# [see %devstudio%\vc\include\win32.mak for cvars macro definition]
|
||||
O = .obj
|
||||
E = .exe
|
||||
@@ -75,7 +77,7 @@ EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O):
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
|
||||
@@ -15,15 +15,15 @@ of PBMPLUS/NetPBM) and converts them to PNG.
|
||||
|
||||
The source code for all three demo programs currently compiles under
|
||||
Unix, OpenVMS, and 32-bit Windows. (Special thanks to Martin Zinser,
|
||||
zinser@decus.de, for making the necessary changes for OpenVMS and for
|
||||
providing an appropriate build script.) Build instructions can be
|
||||
found below.
|
||||
zinser at decus.de, for making the necessary changes for OpenVMS and for
|
||||
providing an appropriate build script.) Build instructions can be found
|
||||
below.
|
||||
|
||||
Files:
|
||||
|
||||
README this file
|
||||
README.w32 additional Windows-specific information
|
||||
LICENSE terms of distribution and reuse (BSD-like)
|
||||
LICENSE terms of distribution and reuse (BSD-like or GNU GPL)
|
||||
COPYING GNU General Public License (GPL)
|
||||
|
||||
Makefile.unx Unix makefile
|
||||
Makefile.w32 Windows (MSVC) makefile
|
||||
@@ -45,26 +45,27 @@ Files:
|
||||
|
||||
toucan.png transparent PNG for testing (by Stefan Schneider)
|
||||
|
||||
Note that the programs are designed to be functional, but their primary
|
||||
purpose is to demonstrate how to use libpng to add PNG support to other
|
||||
programs. As such, their user interfaces are crude and definitely not
|
||||
intended for everyday use.
|
||||
Note that, although the programs are designed to be functional, their
|
||||
primary purpose is to illustrate how to use libpng to add PNG support to
|
||||
other programs. As such, their user interfaces are crude and definitely
|
||||
are not intended for everyday use.
|
||||
|
||||
Please see http://www.cdrom.com/pub/png/pngbook.html for further infor-
|
||||
Please see http://www.libpng.org/pub/png/pngbook.html for further infor-
|
||||
mation and links to the latest version of the source code, and Chapters
|
||||
13-15 of the book for detailed discussion of the three programs.
|
||||
|
||||
Greg Roelofs
|
||||
19 March 2000
|
||||
https://pobox.com/~newt/greg_contact.html
|
||||
16 March 2008
|
||||
|
||||
|
||||
BUILD INSTRUCTIONS
|
||||
|
||||
- Prerequisites:
|
||||
- Prerequisites (in order of compilation):
|
||||
|
||||
- zlib ftp://ftp.cdrom.com/pub/infozip/zlib/zlib.html
|
||||
- libpng http://www.cdrom.com/pub/png/pngcode.html
|
||||
- pngbook http://www.cdrom.com/pub/png/book/sources.html
|
||||
- zlib https://zlib.net/
|
||||
- libpng http://www.libpng.org/pub/png/libpng.html
|
||||
- pngbook http://www.libpng.org/pub/png/book/sources.html
|
||||
|
||||
The pngbook demo programs are explicitly designed to demonstrate proper
|
||||
coding techniques for using the libpng reference library. As a result,
|
||||
@@ -103,7 +104,7 @@ BUILD INSTRUCTIONS
|
||||
unpacked the source code.
|
||||
|
||||
For MSVC, set up the necessary environment variables by invoking
|
||||
|
||||
|
||||
%devstudio%\vc\bin\vcvars32.bat
|
||||
|
||||
where where %devstudio% is the installation directory for MSVC /
|
||||
@@ -128,11 +129,13 @@ BUILD INSTRUCTIONS
|
||||
|
||||
The result should be three executables: rpng-win.exe, rpng2-win.exe,
|
||||
and wpng.exe. Copy them somewhere in your PATH or run them from the
|
||||
current folder. Unlike the Unix versions, the two windowed programs
|
||||
(rpng and rpng2) do not display a usage screen when invoked without
|
||||
command-line arguments; see README.w32 for brief help or the book for
|
||||
details. Note that the programs use the Unix-style "-" character to
|
||||
specify options, instead of the more common DOS/Windows "/" character.
|
||||
current folder. Like the Unix versions, the two windowed programs
|
||||
(rpng and rpng2) now display a usage screen in a console window when
|
||||
invoked without command-line arguments; this is new behavior as of
|
||||
the June 2001 release. Note that the programs use the Unix-style "-"
|
||||
character to specify options, instead of the more common DOS/Windows
|
||||
"/" character. (For example: "rpng2-win -bgpat 4 foo.png", not
|
||||
"rpng2-win /bgpat 4 foo.png")
|
||||
|
||||
|
||||
- OpenVMS:
|
||||
@@ -148,9 +151,9 @@ BUILD INSTRUCTIONS
|
||||
To run the programs, they probably first need to be set up as "foreign
|
||||
symbols," with "disk" and "dir" set appropriately:
|
||||
|
||||
$ rpng == "$disk:[dir]rpng-x.exe"
|
||||
$ rpng == "$disk:[dir]rpng-x.exe"
|
||||
$ rpng2 == "$disk:[dir]rpng2-x.exe"
|
||||
$ wpng == "$disk:[dir]wpng.exe"
|
||||
$ wpng == "$disk:[dir]wpng.exe"
|
||||
|
||||
All three will print a basic usage screen when run without any command-
|
||||
line arguments; see the book for more details. Note that the options
|
||||
@@ -162,19 +165,19 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
|
||||
rpng is a simple PNG viewer that can display transparent PNGs with a
|
||||
specified background color; for example,
|
||||
|
||||
rpng -bgcolor #ff0000 toucan.png
|
||||
rpng -bgcolor \#ff0000 toucan.png
|
||||
|
||||
would display the image with a red background. rpng2 is a progressive
|
||||
viewer that simulates a web browser in some respects; it can display
|
||||
images against either a background color or a dynamically generated
|
||||
background image. For example:
|
||||
|
||||
rpng2 -bgpat 16 toucan.png
|
||||
rpng2 -bgpat 16 toucan.png
|
||||
|
||||
wpng is a purely command-line image converter from binary PBMPLUS/NetPBM
|
||||
format (.pgm or .ppm) to PNG; for example,
|
||||
|
||||
wpng -time < toucan.ppm > toucan.png
|
||||
wpng -time < toucan-notrans.ppm > toucan-notrans.png
|
||||
|
||||
would convert the specified PPM file (using redirection) to PNG, auto-
|
||||
matically setting the PNG modification-time chunk.
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
See the main README file for basic instructions on compiling and running
|
||||
the programs. See http://www.cdrom.com/pub/png/pngbook.html for further
|
||||
information and links to the source code, and Chapters 13-15 of the book
|
||||
for detailed discussion of the three programs.
|
||||
|
||||
Since the two viewers, rpng and rpng2, are both designed to write infor-
|
||||
mation to the console (i.e., a DOS-window command line) while displaying
|
||||
the image in a graphical window--and since I haven't yet figured out how
|
||||
to do that under Windows--here are the usage screens for the two programs:
|
||||
|
||||
|
||||
rpng-win 1.02 of 19 March 2000: Simple PNG Viewer for Windows
|
||||
Compiled with libpng 1.0.5; using libpng 1.0.5.
|
||||
Compiled with zlib 1.1.3; using zlib 1.1.3.
|
||||
|
||||
Usage: rpng-win [-gamma exp] [-bgcolor bg] file.png
|
||||
exp transfer-function exponent (``gamma'') of the display
|
||||
system in floating-point format (e.g., ``2.2''); equal
|
||||
to the product of the lookup-table exponent (varies)
|
||||
and the CRT exponent (usually 2.2); must be positive
|
||||
bg desired background color in 7-character hex RGB format
|
||||
(e.g., ``#ff7f00'' for orange: same as HTML colors);
|
||||
used with transparent images
|
||||
|
||||
Press Q, Esc or mouse button 1 after image is displayed to quit.
|
||||
|
||||
|
||||
rpng2-win 1.04 of 19 March 2000: Progressive PNG Viewer for Windows
|
||||
Compiled with libpng 1.0.5; using libpng 1.0.5.
|
||||
Compiled with zlib 1.1.3; using zlib 1.1.3.
|
||||
|
||||
Usage: rpng2-win [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing] file.png
|
||||
|
||||
exp transfer-function exponent (``gamma'') of the display
|
||||
system in floating-point format (e.g., ``2.2''); equal
|
||||
to the product of the lookup-table exponent (varies)
|
||||
and the CRT exponent (usually 2.2); must be positive
|
||||
bg desired background color in 7-character hex RGB format
|
||||
(e.g., ``#ff7f00'' for orange: same as HTML colors);
|
||||
used with transparent images; overrides -bgpat
|
||||
pat desired background pattern number (1-16); used with
|
||||
transparent images; overrides -bgcolor
|
||||
-timing enables delay for every block read, to simulate modem
|
||||
download of image (~36 Kbps)
|
||||
|
||||
Press Q, Esc or mouse button 1 after image is displayed to quit.
|
||||
|
||||
|
||||
The usage screen for the third (non-windowed) program, wpng, can be seen
|
||||
simply by invoking it without any parameters (``wpng'').
|
||||
|
||||
Greg Roelofs
|
||||
19 March 2000
|
||||
@@ -9,23 +9,24 @@ $! Set locations where zlib and libpng sources live.
|
||||
$!
|
||||
$ zpath = ""
|
||||
$ pngpath = ""
|
||||
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
|
||||
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
|
||||
$!
|
||||
$ if f$search("[---.zlib]zlib.h").nes."" then zpath = "[---.zlib]"
|
||||
$ if f$search("[--]png.h").nes."" then pngpath = "[--]"
|
||||
$!
|
||||
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
|
||||
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
|
||||
$!
|
||||
$ if zpath .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Zlib include not found. Exiting..."
|
||||
$ write sys$output "zlib include not found. Exiting..."
|
||||
$ exit 2
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$ if pngpath .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Libpng include not found. Exiting..."
|
||||
$ write sys$output "libpng include not found. Exiting..."
|
||||
$ exit 2
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$! Look for the compiler used.
|
||||
$!
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007,2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -27,12 +34,30 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "png.h" /* libpng header; includes zlib.h */
|
||||
#include "png.h" /* libpng header */
|
||||
#include "readpng.h" /* typedefs, common macros, public prototypes */
|
||||
|
||||
/* future versions of libpng will provide this macro: */
|
||||
@@ -69,13 +94,14 @@ int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight)
|
||||
* have used slightly more general png_sig_cmp() function instead */
|
||||
|
||||
fread(sig, 1, 8, infile);
|
||||
if (!png_check_sig(sig, 8))
|
||||
if (png_sig_cmp(sig, 0, 8))
|
||||
return 1; /* bad signature */
|
||||
|
||||
|
||||
/* could pass pointers to user-defined error handlers instead of NULLs: */
|
||||
|
||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
png_ptr = png_create_read_struct(png_get_libpng_ver(NULL), NULL, NULL,
|
||||
NULL);
|
||||
if (!png_ptr)
|
||||
return 4; /* out of memory */
|
||||
|
||||
@@ -190,6 +216,10 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
* libpng function */
|
||||
|
||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||
free(image_data);
|
||||
image_data = NULL;
|
||||
free(row_pointers);
|
||||
row_pointers = NULL;
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return NULL;
|
||||
}
|
||||
@@ -205,8 +235,14 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
png_set_expand(png_ptr);
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||
png_set_expand(png_ptr);
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
if (bit_depth == 16)
|
||||
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
||||
png_set_scale_16(png_ptr);
|
||||
# else
|
||||
png_set_strip_16(png_ptr);
|
||||
# endif
|
||||
#endif
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
@@ -228,6 +264,12 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
*pRowbytes = rowbytes = png_get_rowbytes(png_ptr, info_ptr);
|
||||
*pChannels = (int)png_get_channels(png_ptr, info_ptr);
|
||||
|
||||
/* Guard against integer overflow */
|
||||
if (height > ((size_t)(-1))/rowbytes) {
|
||||
fprintf(stderr, "readpng: image_data buffer would be too large\n",
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) {
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return NULL;
|
||||
@@ -239,7 +281,8 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height));
|
||||
Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n",
|
||||
*pChannels, rowbytes, height));
|
||||
|
||||
|
||||
/* set the individual row_pointers to point at the correct offsets */
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2015 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -27,12 +34,37 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Changelog:
|
||||
2015-11-12 - Check return value of png_get_bKGD() (Glenn R-P)
|
||||
2017-04-22 - Guard against integer overflow (Glenn R-P)
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include <stdlib.h> /* for exit() prototype */
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "png.h" /* libpng header; includes zlib.h and setjmp.h */
|
||||
#include <zlib.h>
|
||||
#include "png.h" /* libpng header from the local directory */
|
||||
#include "readpng2.h" /* typedefs, common macros, public prototypes */
|
||||
|
||||
|
||||
@@ -43,16 +75,17 @@ static void readpng2_row_callback(png_structp png_ptr, png_bytep new_row,
|
||||
png_uint_32 row_num, int pass);
|
||||
static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr);
|
||||
static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg);
|
||||
static void readpng2_warning_handler(png_structp png_ptr, png_const_charp msg);
|
||||
|
||||
|
||||
|
||||
|
||||
void readpng2_version_info(void)
|
||||
{
|
||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
|
||||
fprintf(stderr, " Compiled with libpng %s; using libpng %s\n",
|
||||
PNG_LIBPNG_VER_STRING, png_libpng_ver);
|
||||
|
||||
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
|
||||
fprintf(stderr, " and with zlib %s; using zlib %s.\n",
|
||||
ZLIB_VERSION, zlib_version);
|
||||
}
|
||||
|
||||
@@ -61,7 +94,7 @@ void readpng2_version_info(void)
|
||||
|
||||
int readpng2_check_sig(uch *sig, int num)
|
||||
{
|
||||
return png_check_sig(sig, num);
|
||||
return !png_sig_cmp(sig, 0, num);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +110,8 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
|
||||
/* could also replace libpng warning-handler (final NULL), but no need: */
|
||||
|
||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr,
|
||||
readpng2_error_handler, NULL);
|
||||
png_ptr = png_create_read_struct(png_get_libpng_ver(NULL), mainprog_ptr,
|
||||
readpng2_error_handler, readpng2_warning_handler);
|
||||
if (!png_ptr)
|
||||
return 4; /* out of memory */
|
||||
|
||||
@@ -105,12 +138,39 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
}
|
||||
|
||||
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
/* prepare the reader to ignore all recognized chunks whose data won't be
|
||||
* used, i.e., all chunks recognized by libpng except for IHDR, PLTE, IDAT,
|
||||
* IEND, tRNS, bKGD, gAMA, and sRGB (small performance improvement) */
|
||||
{
|
||||
/* These byte strings were copied from png.h. If a future version
|
||||
* of readpng2.c recognizes more chunks, add them to this list.
|
||||
*/
|
||||
static const png_byte chunks_to_process[] = {
|
||||
98, 75, 71, 68, '\0', /* bKGD */
|
||||
103, 65, 77, 65, '\0', /* gAMA */
|
||||
115, 82, 71, 66, '\0', /* sRGB */
|
||||
};
|
||||
|
||||
/* Ignore all chunks except for IHDR, PLTE, tRNS, IDAT, and IEND */
|
||||
png_set_keep_unknown_chunks(png_ptr, -1 /* PNG_HANDLE_CHUNK_NEVER */,
|
||||
NULL, -1);
|
||||
|
||||
/* But do not ignore chunks in the "chunks_to_process" list */
|
||||
png_set_keep_unknown_chunks(png_ptr,
|
||||
0 /* PNG_HANDLE_CHUNK_AS_DEFAULT */, chunks_to_process,
|
||||
sizeof(chunks_to_process)/5);
|
||||
}
|
||||
#endif /* PNG_HANDLE_AS_UNKNOWN_SUPPORTED */
|
||||
|
||||
|
||||
/* instead of doing png_init_io() here, now we set up our callback
|
||||
* functions for progressive decoding */
|
||||
|
||||
png_set_progressive_read_fn(png_ptr, mainprog_ptr,
|
||||
readpng2_info_callback, readpng2_row_callback, readpng2_end_callback);
|
||||
|
||||
|
||||
/* make sure we save our pointers for use in readpng2_decode_data() */
|
||||
|
||||
mainprog_ptr->png_ptr = png_ptr;
|
||||
@@ -158,7 +218,12 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
mainprog_info *mainprog_ptr;
|
||||
int color_type, bit_depth;
|
||||
png_uint_32 width, height;
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
double gamma;
|
||||
#else
|
||||
png_fixed_point gamma;
|
||||
#endif
|
||||
|
||||
|
||||
/* setjmp() doesn't make sense here, because we'd either have to exit(),
|
||||
@@ -193,43 +258,47 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
/* this is just like in the non-progressive case */
|
||||
|
||||
png_get_IHDR(png_ptr, info_ptr, &mainprog_ptr->width,
|
||||
&mainprog_ptr->height, &bit_depth, &color_type, NULL, NULL, NULL);
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||
NULL, NULL, NULL);
|
||||
mainprog_ptr->width = (ulg)width;
|
||||
mainprog_ptr->height = (ulg)height;
|
||||
|
||||
|
||||
/* since we know we've read all of the PNG file's "header" (i.e., up
|
||||
* to IDAT), we can check for a background color here */
|
||||
|
||||
if (mainprog_ptr->need_bgcolor &&
|
||||
png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD))
|
||||
if (mainprog_ptr->need_bgcolor)
|
||||
{
|
||||
png_color_16p pBackground;
|
||||
|
||||
/* it is not obvious from the libpng documentation, but this function
|
||||
* takes a pointer to a pointer, and it always returns valid red,
|
||||
* green and blue values, regardless of color_type: */
|
||||
png_get_bKGD(png_ptr, info_ptr, &pBackground);
|
||||
if (png_get_bKGD(png_ptr, info_ptr, &pBackground))
|
||||
{
|
||||
|
||||
/* however, it always returns the raw bKGD data, regardless of any
|
||||
* bit-depth transformations, so check depth and adjust if necessary */
|
||||
if (bit_depth == 16) {
|
||||
mainprog_ptr->bg_red = pBackground->red >> 8;
|
||||
mainprog_ptr->bg_green = pBackground->green >> 8;
|
||||
mainprog_ptr->bg_blue = pBackground->blue >> 8;
|
||||
} else if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
|
||||
if (bit_depth == 1)
|
||||
mainprog_ptr->bg_red = mainprog_ptr->bg_green =
|
||||
mainprog_ptr->bg_blue = pBackground->gray? 255 : 0;
|
||||
else if (bit_depth == 2)
|
||||
mainprog_ptr->bg_red = mainprog_ptr->bg_green =
|
||||
mainprog_ptr->bg_blue = (255/3) * pBackground->gray;
|
||||
else /* bit_depth == 4 */
|
||||
mainprog_ptr->bg_red = mainprog_ptr->bg_green =
|
||||
mainprog_ptr->bg_blue = (255/15) * pBackground->gray;
|
||||
} else {
|
||||
mainprog_ptr->bg_red = (uch)pBackground->red;
|
||||
mainprog_ptr->bg_green = (uch)pBackground->green;
|
||||
mainprog_ptr->bg_blue = (uch)pBackground->blue;
|
||||
/* however, it always returns the raw bKGD data, regardless of any
|
||||
* bit-depth transformations, so check depth and adjust if necessary
|
||||
*/
|
||||
if (bit_depth == 16) {
|
||||
mainprog_ptr->bg_red = pBackground->red >> 8;
|
||||
mainprog_ptr->bg_green = pBackground->green >> 8;
|
||||
mainprog_ptr->bg_blue = pBackground->blue >> 8;
|
||||
} else if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
|
||||
if (bit_depth == 1)
|
||||
mainprog_ptr->bg_red = mainprog_ptr->bg_green =
|
||||
mainprog_ptr->bg_blue = pBackground->gray? 255 : 0;
|
||||
else if (bit_depth == 2)
|
||||
mainprog_ptr->bg_red = mainprog_ptr->bg_green =
|
||||
mainprog_ptr->bg_blue = (255/3) * pBackground->gray;
|
||||
else /* bit_depth == 4 */
|
||||
mainprog_ptr->bg_red = mainprog_ptr->bg_green =
|
||||
mainprog_ptr->bg_blue = (255/15) * pBackground->gray;
|
||||
} else {
|
||||
mainprog_ptr->bg_red = (uch)pBackground->red;
|
||||
mainprog_ptr->bg_green = (uch)pBackground->green;
|
||||
mainprog_ptr->bg_blue = (uch)pBackground->blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,8 +314,14 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
png_set_expand(png_ptr);
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||
png_set_expand(png_ptr);
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
if (bit_depth == 16)
|
||||
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
||||
png_set_scale_16(png_ptr);
|
||||
# else
|
||||
png_set_strip_16(png_ptr);
|
||||
# endif
|
||||
#endif
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
@@ -267,11 +342,19 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
* "gamma" value for the entire display system, i.e., the product of
|
||||
* LUT_exponent and CRT_exponent. */
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
if (png_get_gAMA(png_ptr, info_ptr, &gamma))
|
||||
png_set_gamma(png_ptr, mainprog_ptr->display_exponent, gamma);
|
||||
else
|
||||
png_set_gamma(png_ptr, mainprog_ptr->display_exponent, 0.45455);
|
||||
|
||||
#else
|
||||
if (png_get_gAMA_fixed(png_ptr, info_ptr, &gamma))
|
||||
png_set_gamma_fixed(png_ptr,
|
||||
(png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), gamma);
|
||||
else
|
||||
png_set_gamma_fixed(png_ptr,
|
||||
(png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), 45455);
|
||||
#endif
|
||||
|
||||
/* we'll let libpng expand interlaced images, too */
|
||||
|
||||
@@ -373,6 +456,8 @@ static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
/* all done */
|
||||
|
||||
(void)info_ptr; /* Unused */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -393,7 +478,12 @@ void readpng2_cleanup(mainprog_info *mainprog_ptr)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void readpng2_warning_handler(png_structp png_ptr, png_const_charp msg)
|
||||
{
|
||||
fprintf(stderr, "readpng2 libpng warning: %s\n", msg);
|
||||
fflush(stderr);
|
||||
(void)png_ptr; /* Unused */
|
||||
}
|
||||
|
||||
|
||||
static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg)
|
||||
@@ -420,5 +510,12 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg)
|
||||
exit(99);
|
||||
}
|
||||
|
||||
/* Now we have our data structure we can use the information in it
|
||||
* to return control to our own higher level code (all the points
|
||||
* where 'setjmp' is called in this file.) This will work with other
|
||||
* error handling mechanisms as well - libpng always calls png_error
|
||||
* when it can proceed no further, thus, so long as the error handler
|
||||
* is intercepted, application code can do its own error recovery.
|
||||
*/
|
||||
longjmp(mainprog_ptr->jmpbuf, 1);
|
||||
}
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
@@ -45,6 +69,12 @@
|
||||
# define Trace(x) ;
|
||||
#endif
|
||||
|
||||
enum rpng2_states {
|
||||
kPreInit = 0,
|
||||
kWindowInit,
|
||||
kDone
|
||||
};
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef unsigned short ush;
|
||||
typedef unsigned long ulg;
|
||||
@@ -66,12 +96,7 @@ typedef struct _mainprog_info {
|
||||
int rowbytes;
|
||||
int channels;
|
||||
int need_bgcolor;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
int nommxfilters;
|
||||
int nommxcombine;
|
||||
int nommxinterlace;
|
||||
#endif
|
||||
int done;
|
||||
int state;
|
||||
uch bg_red;
|
||||
uch bg_green;
|
||||
uch bg_blue;
|
||||
|
||||
188
contrib/gregbook/readppm.c
Normal file
188
contrib/gregbook/readppm.c
Normal file
@@ -0,0 +1,188 @@
|
||||
/*---------------------------------------------------------------------------
|
||||
|
||||
rpng - simple PNG display program readppm.c
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
This is a special-purpose replacement for readpng.c that allows binary
|
||||
PPM files to be used in place of PNG images.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2007,2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, disclaimer, and this list of conditions.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, disclaimer, and this list of conditions in the documenta-
|
||||
tion and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this
|
||||
software must display the following acknowledgment:
|
||||
|
||||
This product includes software developed by Greg Roelofs
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "readpng.h" /* typedefs, common macros, public prototypes */
|
||||
|
||||
|
||||
ulg width, height;
|
||||
int bit_depth, color_type, channels;
|
||||
uch *image_data = NULL;
|
||||
FILE *saved_infile;
|
||||
|
||||
|
||||
void readpng_version_info()
|
||||
{
|
||||
fprintf(stderr, " Compiled without libpng, zlib or PBMPLUS/NetPBM.\n");
|
||||
}
|
||||
|
||||
|
||||
/* return value = 0 for success, 1 for bad sig, 2 for bad IHDR, 4 for no mem */
|
||||
|
||||
int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight)
|
||||
{
|
||||
static uch ppmline[256];
|
||||
int maxval;
|
||||
|
||||
|
||||
saved_infile = infile;
|
||||
|
||||
fgets(ppmline, 256, infile);
|
||||
if (ppmline[0] != 'P' || ppmline[1] != '6') {
|
||||
fprintf(stderr, "ERROR: not a PPM file\n");
|
||||
return 1;
|
||||
}
|
||||
/* possible color types: P5 = grayscale (0), P6 = RGB (2), P8 = RGBA (6) */
|
||||
if (ppmline[1] == '6') {
|
||||
color_type = 2;
|
||||
channels = 3;
|
||||
} else if (ppmline[1] == '8') {
|
||||
color_type = 6;
|
||||
channels = 4;
|
||||
} else /* if (ppmline[1] == '5') */ {
|
||||
color_type = 0;
|
||||
channels = 1;
|
||||
}
|
||||
|
||||
do {
|
||||
fgets(ppmline, 256, infile);
|
||||
} while (ppmline[0] == '#');
|
||||
sscanf(ppmline, "%lu %lu", &width, &height);
|
||||
|
||||
do {
|
||||
fgets(ppmline, 256, infile);
|
||||
} while (ppmline[0] == '#');
|
||||
sscanf(ppmline, "%d", &maxval);
|
||||
if (maxval != 255) {
|
||||
fprintf(stderr, "ERROR: maxval = %d\n", maxval);
|
||||
return 2;
|
||||
}
|
||||
bit_depth = 8;
|
||||
|
||||
*pWidth = width;
|
||||
*pHeight = height;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* returns 0 if succeeds, 1 if fails due to no bKGD chunk, 2 if libpng error;
|
||||
* scales values to 8-bit if necessary */
|
||||
|
||||
int readpng_get_bgcolor(uch *red, uch *green, uch *blue)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* display_exponent == LUT_exponent * CRT_exponent */
|
||||
|
||||
uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
{
|
||||
ulg rowbytes;
|
||||
|
||||
|
||||
/* expand palette images to RGB, low-bit-depth grayscale images to 8 bits,
|
||||
* transparency chunks to full alpha channel; strip 16-bit-per-sample
|
||||
* images to 8 bits per sample; and convert grayscale to RGB[A] */
|
||||
|
||||
/* GRR WARNING: grayscale needs to be expanded and channels reset! */
|
||||
|
||||
*pRowbytes = rowbytes = channels*width;
|
||||
*pChannels = channels;
|
||||
|
||||
Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height));
|
||||
|
||||
/* Guard against integer overflow */
|
||||
if (height > ((size_t)(-1))/rowbytes) {
|
||||
fprintf(stderr, PROGNAME ": image_data buffer would be too large\n",
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* now we can go ahead and just read the whole image */
|
||||
|
||||
if (fread(image_data, 1L, rowbytes*height, saved_infile) <
|
||||
rowbytes*height) {
|
||||
free (image_data);
|
||||
image_data = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return image_data;
|
||||
}
|
||||
|
||||
|
||||
void readpng_cleanup(int free_image_data)
|
||||
{
|
||||
if (free_image_data && image_data) {
|
||||
free(image_data);
|
||||
image_data = NULL;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@
|
||||
with a little tweaking (or maybe not).
|
||||
|
||||
to do:
|
||||
- stdout/stderr don't work! need message window (maybe scrollable?)
|
||||
- handle quoted command-line args (especially filenames with spaces)
|
||||
- have minimum window width: oh well
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
@@ -22,16 +21,27 @@
|
||||
match; switched to png_jmpbuf() macro
|
||||
- 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: fixed improper display of usage screen on PNG error(s)
|
||||
- 2.02: check for integer overflow (Glenn R-P)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -48,17 +58,61 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng-win"
|
||||
#define LONGNAME "Simple PNG Viewer for Windows"
|
||||
#define VERSION "1.02 of 19 March 2000"
|
||||
#define VERSION "2.01 of 16 March 2008"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#ifdef __CYGWIN__
|
||||
/* getch replacement. Turns out, we don't really need this,
|
||||
* but leave it here if we ever enable any of the uses of
|
||||
* _getch in the main code
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <termio.h>
|
||||
#include <sys/ioctl.h>
|
||||
int repl_getch( void )
|
||||
{
|
||||
char ch;
|
||||
int fd = fileno(stdin);
|
||||
struct termio old_tty, new_tty;
|
||||
|
||||
ioctl(fd, TCGETA, &old_tty);
|
||||
new_tty = old_tty;
|
||||
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
|
||||
ioctl(fd, TCSETA, &new_tty);
|
||||
fread(&ch, 1, sizeof(ch), stdin);
|
||||
ioctl(fd, TCSETA, &old_tty);
|
||||
|
||||
return ch;
|
||||
}
|
||||
#define _getch repl_getch
|
||||
#else
|
||||
#include <conio.h> /* only for _getch() */
|
||||
#endif
|
||||
|
||||
/* #define DEBUG : this enables the Trace() macros */
|
||||
|
||||
@@ -84,10 +138,9 @@ static void rpng_win_cleanup(void);
|
||||
LRESULT CALLBACK rpng_win_wndproc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char titlebar[1024];
|
||||
static char *progname = PROGNAME;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME; /* GRR: not (yet) used */
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@@ -127,8 +180,19 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
|
||||
filename = (char *)NULL;
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
/* First reenable console output, which normally goes to the bit bucket
|
||||
* for windowed apps. Closing the console window will terminate the
|
||||
* app. Thanks to David.Geldreich at realviz.com for supplying the magical
|
||||
* incantation. */
|
||||
|
||||
/* First set the default value for our display-system exponent, i.e.,
|
||||
AllocConsole();
|
||||
freopen("CONOUT$", "a", stderr);
|
||||
freopen("CONOUT$", "a", stdout);
|
||||
#endif
|
||||
|
||||
|
||||
/* Next set the default value for our display-system exponent, i.e.,
|
||||
* the product of the CRT exponent and the exponent corresponding to
|
||||
* the frame-buffer's lookup table (LUT), if any. This is not an
|
||||
* exhaustive list of LUT values (e.g., OpenStep has a lot of weird
|
||||
@@ -236,9 +300,43 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
if (!filename)
|
||||
++error;
|
||||
} else if (!(infile = fopen(filename, "rb"))) {
|
||||
|
||||
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
#ifndef __CYGWIN__
|
||||
"Press Q or Esc to quit this usage screen.\n"
|
||||
#endif
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
@@ -251,8 +349,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n",
|
||||
filename);
|
||||
": [%s] has bad IHDR (libpng longjmp)\n", filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
@@ -269,23 +366,25 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
|
||||
|
||||
/* usage screen */
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(2);
|
||||
} else {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
exit(1);
|
||||
#ifndef __CYGWIN__
|
||||
fprintf(stderr,
|
||||
"\n [console window: closing this window will terminate %s]\n\n",
|
||||
PROGNAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -303,9 +402,14 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
* check for one in the PNG file--if not, the initialized values of 0
|
||||
* (black) will be used */
|
||||
|
||||
if (have_bg)
|
||||
sscanf(bgstr+1, "%2x%2x%2x", &bg_red, &bg_green, &bg_blue);
|
||||
else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {
|
||||
if (have_bg) {
|
||||
unsigned r, g, b; /* this approach quiets compiler warnings */
|
||||
|
||||
sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b);
|
||||
bg_red = (uch)r;
|
||||
bg_green = (uch)g;
|
||||
bg_blue = (uch)b;
|
||||
} else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {
|
||||
readpng_cleanup(TRUE);
|
||||
fprintf(stderr, PROGNAME
|
||||
": libpng error while checking for background color\n");
|
||||
@@ -353,7 +457,12 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
/* wait for the user to tell us when to quit */
|
||||
|
||||
printf(
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n");
|
||||
#ifndef __CYGWIN__
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
|
||||
#else
|
||||
"Done. Press mouse button 1 (within image window) to quit.\n"
|
||||
#endif
|
||||
);
|
||||
fflush(stdout);
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
||||
@@ -388,6 +497,12 @@ static int rpng_win_create_window(HINSTANCE hInst, int showmode)
|
||||
|
||||
wimage_rowbytes = ((3*image_width + 3L) >> 2) << 2;
|
||||
|
||||
/* Guard against integer overflow */
|
||||
if (image_height > ((size_t)(-1))/wimage_rowbytes) {
|
||||
fprintf(stderr, PROGNAME ": image_data buffer would be too large\n");
|
||||
return 4; /* fail */
|
||||
}
|
||||
|
||||
if (!(dib = (uch *)malloc(sizeof(BITMAPINFOHEADER) +
|
||||
wimage_rowbytes*image_height)))
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
by Martin Zinser under OpenVMS; may work under OS/2 with some tweaking).
|
||||
|
||||
to do:
|
||||
- 8-bit support
|
||||
- 8-bit (colormapped) X support
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
@@ -21,16 +21,31 @@
|
||||
- 1.10: added support for non-default visuals; fixed X pixel-conversion
|
||||
- 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.12: fixed some small X memory leaks (thanks to Fran<61>ois Petitjean)
|
||||
- 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche)
|
||||
- 1.14: added support for X resources (thanks to Gerhard Niklasch)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: fixed improper display of usage screen on PNG error(s)
|
||||
- 2.02: Added "void(argc);" statement to quiet pedantic compiler warnings
|
||||
about unused variable (GR-P)
|
||||
- 2.03: check for integer overflow (Glenn R-P)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -47,11 +62,30 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng-x"
|
||||
#define LONGNAME "Simple PNG Viewer for X"
|
||||
#define VERSION "1.11 of 19 March 2000"
|
||||
#define VERSION "2.02 of 15 June 2014"
|
||||
#define RESNAME "rpng" /* our X resource application name */
|
||||
#define RESCLASS "Rpng" /* our X resource class name */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -89,6 +123,8 @@ static int rpng_x_msb(ulg u32val);
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME;
|
||||
static char *res_name = RESNAME;
|
||||
static char *res_class = RESCLASS;
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@@ -117,6 +153,7 @@ static Colormap colormap;
|
||||
static int have_nondefault_visual = FALSE;
|
||||
static int have_colormap = FALSE;
|
||||
static int have_window = FALSE;
|
||||
static int have_gc = FALSE;
|
||||
/*
|
||||
ulg numcolors=0, pixels[256];
|
||||
ush reds[256], greens[256], blues[256];
|
||||
@@ -218,8 +255,8 @@ int main(int argc, char **argv)
|
||||
else {
|
||||
bgstr = *argv;
|
||||
if (strlen(bgstr) != 7 || bgstr[0] != '#')
|
||||
++error;
|
||||
else
|
||||
++error;
|
||||
else
|
||||
have_bg = TRUE;
|
||||
}
|
||||
} else {
|
||||
@@ -232,9 +269,35 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
if (!filename)
|
||||
++error;
|
||||
} else if (!(infile = fopen(filename, "rb"))) {
|
||||
|
||||
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n",
|
||||
PROGNAME, default_display_exponent);
|
||||
|
||||
fprintf(stderr, "\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||
"is displayed) to quit.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
@@ -247,8 +310,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n",
|
||||
filename);
|
||||
": [%s] has bad IHDR (libpng longjmp)\n", filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
@@ -273,25 +335,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
/* usage screen */
|
||||
|
||||
if (error) {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||
"is displayed) to quit.\n"
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
exit(1);
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -378,6 +424,8 @@ int main(int argc, char **argv)
|
||||
|
||||
rpng_x_cleanup();
|
||||
|
||||
(void)argc; /* Unused */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -396,11 +444,12 @@ static int rpng_x_create_window(void)
|
||||
XEvent e;
|
||||
XGCValues gcvalues;
|
||||
XSetWindowAttributes attr;
|
||||
XSizeHints *size_hints;
|
||||
XTextProperty windowName, *pWindowName = &windowName;
|
||||
XTextProperty iconName, *pIconName = &iconName;
|
||||
XVisualInfo visual_info;
|
||||
XSizeHints *size_hints;
|
||||
XWMHints *wm_hints;
|
||||
XClassHint *class_hints;
|
||||
|
||||
|
||||
screen = DefaultScreen(display);
|
||||
@@ -523,7 +572,7 @@ static int rpng_x_create_window(void)
|
||||
if (!XStringListToTextProperty(&icon_name, 1, pIconName))
|
||||
pIconName = NULL;
|
||||
|
||||
/* OK if either hints allocation fails; XSetWMProperties() allows NULLs */
|
||||
/* OK if any hints allocation fails; XSetWMProperties() allows NULLs */
|
||||
|
||||
if ((size_hints = XAllocSizeHints()) != NULL) {
|
||||
/* window will not be resizable */
|
||||
@@ -539,12 +588,30 @@ static int rpng_x_create_window(void)
|
||||
wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ;
|
||||
}
|
||||
|
||||
if ((class_hints = XAllocClassHint()) != NULL) {
|
||||
class_hints->res_name = res_name;
|
||||
class_hints->res_class = res_class;
|
||||
}
|
||||
|
||||
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
|
||||
size_hints, wm_hints, NULL);
|
||||
size_hints, wm_hints, class_hints);
|
||||
|
||||
/* various properties and hints no longer needed; free memory */
|
||||
if (pWindowName)
|
||||
XFree(pWindowName->value);
|
||||
if (pIconName)
|
||||
XFree(pIconName->value);
|
||||
if (size_hints)
|
||||
XFree(size_hints);
|
||||
if (wm_hints)
|
||||
XFree(wm_hints);
|
||||
if (class_hints)
|
||||
XFree(class_hints);
|
||||
|
||||
XMapWindow(display, window);
|
||||
|
||||
gc = XCreateGC(display, window, 0, &gcvalues);
|
||||
have_gc = TRUE;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Fill window with the specified background color.
|
||||
@@ -814,7 +881,8 @@ static void rpng_x_cleanup(void)
|
||||
ximage = NULL;
|
||||
}
|
||||
|
||||
XFreeGC(display, gc);
|
||||
if (have_gc)
|
||||
XFreeGC(display, gc);
|
||||
|
||||
if (have_window)
|
||||
XDestroyWindow(display, window);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
tweaking (or maybe not). Thanks to Adam Costello and Pieter S. van der
|
||||
Meulen for the "diamond" and "radial waves" patterns, respectively.
|
||||
|
||||
to do:
|
||||
to do (someday, maybe):
|
||||
- handle quoted command-line args (especially filenames with spaces)
|
||||
- finish resizable checkerboard-gradient (sizes 4-128?)
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
@@ -24,18 +24,33 @@
|
||||
- 1.03: modified to allow abbreviated options
|
||||
- 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?];
|
||||
fixed command-line parsing bug
|
||||
- 1.10: enabled "message window" (console), thanks to David Geldreich
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
||||
- 1.21: made minor tweak to usage screen to fit within 25-line console
|
||||
- 1.22: added AMD64/EM64T support (__x86_64__)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: fixed 64-bit typo in readpng2.c
|
||||
- 2.02: fixed improper display of usage screen on PNG error(s); fixed
|
||||
unexpected-EOF and file-read-error cases
|
||||
- 2.03: removed runtime MMX-enabling/disabling and obsolete -mmx* options
|
||||
- 2.04: check for integer overflow (Glenn R-P)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -52,11 +67,28 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng2-win"
|
||||
#define LONGNAME "Progressive PNG Viewer for Windows"
|
||||
#define VERSION "1.20 of 29 January 2001"
|
||||
#define VERSION "2.02 of 16 March 2008"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -65,7 +97,33 @@
|
||||
#include <time.h>
|
||||
#include <math.h> /* only for PvdM background code */
|
||||
#include <windows.h>
|
||||
#ifdef __CYGWIN__
|
||||
/* getch replacement. Turns out, we don't really need this,
|
||||
* but leave it here if we ever enable any of the uses of
|
||||
* _getch in the main code
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <termio.h>
|
||||
#include <sys/ioctl.h>
|
||||
int repl_getch( void )
|
||||
{
|
||||
char ch;
|
||||
int fd = fileno(stdin);
|
||||
struct termio old_tty, new_tty;
|
||||
|
||||
ioctl(fd, TCGETA, &old_tty);
|
||||
new_tty = old_tty;
|
||||
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
|
||||
ioctl(fd, TCSETA, &new_tty);
|
||||
fread(&ch, 1, sizeof(ch), stdin);
|
||||
ioctl(fd, TCSETA, &old_tty);
|
||||
|
||||
return ch;
|
||||
}
|
||||
#define _getch repl_getch
|
||||
#else
|
||||
#include <conio.h> /* only for _getch() */
|
||||
#endif
|
||||
|
||||
/* all for PvdM background code: */
|
||||
#ifndef PI
|
||||
@@ -118,10 +176,9 @@ static void rpng2_win_cleanup(void);
|
||||
LRESULT CALLBACK rpng2_win_wndproc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char titlebar[1024];
|
||||
static char *progname = PROGNAME;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME; /* GRR: not (yet) used */
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@@ -240,16 +297,16 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
filename = (char *)NULL;
|
||||
memset(&rpng2_info, 0, sizeof(mainprog_info));
|
||||
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
/* Next reenable console output, which normally goes to the bit bucket
|
||||
* for windowed apps. Closing the console window will terminate the
|
||||
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
|
||||
* app. Thanks to David.Geldreich at realviz.com for supplying the magical
|
||||
* incantation. */
|
||||
|
||||
AllocConsole();
|
||||
freopen("CONOUT$", "a", stderr);
|
||||
freopen("CONOUT$", "a", stdout);
|
||||
|
||||
#endif
|
||||
|
||||
/* Set the default value for our display-system exponent, i.e., the
|
||||
* product of the CRT exponent and the exponent corresponding to
|
||||
@@ -366,18 +423,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
} else if (!strncmp(*argv, "-timing", 2)) {
|
||||
timing = TRUE;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
} else if (!strncmp(*argv, "-nommxfilters", 7)) {
|
||||
rpng2_info.nommxfilters = TRUE;
|
||||
} else if (!strncmp(*argv, "-nommxcombine", 7)) {
|
||||
rpng2_info.nommxcombine = TRUE;
|
||||
} else if (!strncmp(*argv, "-nommxinterlace", 7)) {
|
||||
rpng2_info.nommxinterlace = TRUE;
|
||||
} else if (!strcmp(*argv, "-nommx")) {
|
||||
rpng2_info.nommxfilters = TRUE;
|
||||
rpng2_info.nommxcombine = TRUE;
|
||||
rpng2_info.nommxinterlace = TRUE;
|
||||
#endif
|
||||
} else {
|
||||
if (**argv != '-') {
|
||||
filename = *argv;
|
||||
@@ -388,9 +433,56 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
if (!filename)
|
||||
++error;
|
||||
} else if (!(infile = fopen(filename, "rb"))) {
|
||||
|
||||
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng2_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"
|
||||
" %*s file.png\n\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images; overrides -bgpat option\n"
|
||||
" pat \tdesired background pattern number (1-%d); used with\n"
|
||||
"\t\t transparent images; overrides -bgcolor option\n"
|
||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||
"\t\t download of image (~36 Kbps)\n"
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
#ifndef __CYGWIN__
|
||||
"Press Q or Esc to quit this usage screen. ",
|
||||
#else
|
||||
,
|
||||
#endif
|
||||
PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
|
||||
!(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
(int)strlen(PROGNAME), " ",
|
||||
#endif
|
||||
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fflush(stderr);
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
@@ -404,8 +496,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
switch (rc) {
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n",
|
||||
filename);
|
||||
": [%s] has bad IHDR (libpng longjmp)\n", filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
@@ -422,50 +513,26 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
|
||||
|
||||
/* usage screen */
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng2_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
" %*s [[-nommxfilters] [-nommxcombine] [-nommxinterlace] | -nommx]\n"
|
||||
#endif
|
||||
" %*s file.png\n\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images; overrides -bgpat option\n"
|
||||
" pat \tdesired background pattern number (1-%d); used with\n"
|
||||
"\t\t transparent images; overrides -bgcolor option\n"
|
||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||
"\t\t download of image (~36 Kbps)\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
" -nommx*\tdisable optimized MMX routines for decoding row filters,\n"
|
||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
||||
#endif
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"Press Q or Esc to quit this usage screen.\n"
|
||||
"\n", PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
strlen(PROGNAME), " ",
|
||||
#endif
|
||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
exit(1);
|
||||
#endif
|
||||
exit(2);
|
||||
} else {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
#ifndef __CYGWIN__
|
||||
fprintf(stderr,
|
||||
"\n [console window: closing this window will terminate %s]\n\n",
|
||||
PROGNAME);
|
||||
#endif
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
|
||||
@@ -491,7 +558,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
} else
|
||||
rpng2_info.need_bgcolor = TRUE;
|
||||
|
||||
rpng2_info.done = FALSE;
|
||||
rpng2_info.state = kPreInit;
|
||||
rpng2_info.mainprog_init = rpng2_win_init;
|
||||
rpng2_info.mainprog_display_row = rpng2_win_display_row;
|
||||
rpng2_info.mainprog_finish_display = rpng2_win_finish_display;
|
||||
@@ -511,10 +578,27 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
if (readpng2_decode_data(&rpng2_info, inbuf, incount))
|
||||
++error;
|
||||
Trace((stderr, "done with readpng2_decode_data()\n"))
|
||||
if (error || feof(infile) || rpng2_info.done)
|
||||
|
||||
if (error || incount != INBUFSIZE || rpng2_info.state == kDone) {
|
||||
if (rpng2_info.state == kDone) {
|
||||
Trace((stderr, "done decoding PNG image\n"))
|
||||
} else if (ferror(infile)) {
|
||||
fprintf(stderr, PROGNAME
|
||||
": error while reading PNG image file\n");
|
||||
exit(3);
|
||||
} else if (feof(infile)) {
|
||||
fprintf(stderr, PROGNAME ": end of file reached "
|
||||
"(unexpectedly) while reading PNG image file\n");
|
||||
exit(3);
|
||||
} else /* if (error) */ {
|
||||
/* will print error message below */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (timing)
|
||||
Sleep(1000L);
|
||||
|
||||
incount = fread(inbuf, 1, INBUFSIZE, infile);
|
||||
}
|
||||
|
||||
@@ -561,10 +645,17 @@ static void rpng2_win_init()
|
||||
ulg rowbytes = rpng2_info.rowbytes;
|
||||
|
||||
Trace((stderr, "beginning rpng2_win_init()\n"))
|
||||
Trace((stderr, " rowbytes = %ld\n", rpng2_info.rowbytes))
|
||||
Trace((stderr, " rowbytes = %d\n", rpng2_info.rowbytes))
|
||||
Trace((stderr, " width = %ld\n", rpng2_info.width))
|
||||
Trace((stderr, " height = %ld\n", rpng2_info.height))
|
||||
|
||||
/* Guard against integer overflow */
|
||||
if (rpng2_info.height > ((size_t)(-1))/rowbytes) {
|
||||
fprintf(stderr, PROGNAME ": image_data buffer would be too large\n",
|
||||
readpng2_cleanup(&rpng2_info);
|
||||
return;
|
||||
}
|
||||
|
||||
rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height);
|
||||
if (!rpng2_info.image_data) {
|
||||
readpng2_cleanup(&rpng2_info);
|
||||
@@ -591,6 +682,8 @@ static void rpng2_win_init()
|
||||
readpng2_cleanup(&rpng2_info);
|
||||
return;
|
||||
}
|
||||
|
||||
rpng2_info.state = kWindowInit;
|
||||
}
|
||||
|
||||
|
||||
@@ -1086,9 +1179,14 @@ static void rpng2_win_finish_display()
|
||||
* we have nothing to do here except set a flag and let the user know
|
||||
* that the image is done */
|
||||
|
||||
rpng2_info.done = TRUE;
|
||||
rpng2_info.state = kDone;
|
||||
printf(
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n");
|
||||
#ifndef __CYGWIN__
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
|
||||
#else
|
||||
"Done. Press mouse button 1 (within image window) to quit.\n"
|
||||
#endif
|
||||
);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,10 @@
|
||||
This program converts certain NetPBM binary files (grayscale and RGB,
|
||||
maxval = 255) to PNG. Non-interlaced PNGs are written progressively;
|
||||
interlaced PNGs are read and written in one memory-intensive blast.
|
||||
|
||||
Thanks to Jean-loup Gailly for providing the necessary trick to read
|
||||
interactive text from the keyboard while stdin is redirected.
|
||||
interactive text from the keyboard while stdin is redirected. Thanks
|
||||
to Cosmin Truta for Cygwin fixes.
|
||||
|
||||
NOTE: includes provisional support for PNM type "8" (portable alphamap)
|
||||
images, presumed to be a 32-bit interleaved RGBA format; no pro-
|
||||
@@ -24,16 +26,33 @@
|
||||
- 1.02: modified to allow abbreviated options
|
||||
- 1.03: removed extraneous character from usage screen; fixed bug in
|
||||
command-line parsing
|
||||
- 1.04: fixed DOS/OS2/Win32 detection, including partial Cygwin fix
|
||||
(see http://home.att.net/~perlspinr/diffs/GregBook_cygwin.diff)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: check for integer overflow (Glenn R-P)
|
||||
|
||||
[REPORTED BUG (win32 only): "contrib/gregbook/wpng.c - cmd line
|
||||
dose not work! In order to do something useful I needed to redirect
|
||||
both input and output, with cygwin and with bcc32 as well. Under
|
||||
Linux, the same wpng appears to work fine. I don't know what is
|
||||
the problem."]
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007, 2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -50,16 +69,35 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "wpng"
|
||||
#define VERSION "1.03 of 19 March 2000"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
#define APPNAME "Simple PGM/PPM/PAM to PNG Converter"
|
||||
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
# define DOS_OS2_W32
|
||||
#elif defined(_WIN32) || defined(__WIN32__)
|
||||
# define DOS_OS2_W32
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
# ifndef __GNUC__ /* treat Win32 native ports of gcc as Unix environments */
|
||||
# define DOS_OS2_W32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -665,7 +703,18 @@ int main(int argc, char **argv)
|
||||
if (wpng_info.interlaced) {
|
||||
long i;
|
||||
ulg bytes;
|
||||
ulg image_bytes = rowbytes * wpng_info.height; /* overflow? */
|
||||
ulg image_bytes;
|
||||
|
||||
/* Guard against integer overflow */
|
||||
if (wpng_info_height > ((size_t)(-1)/rowbytes ||
|
||||
wpng_info_height > ((ulg)(-1)/rowbytes) {
|
||||
fprintf(stderr, PROGNAME ": image_data buffer too large\n");
|
||||
writepng_cleanup(&wpng_info);
|
||||
wpng_cleanup();
|
||||
exit(5);
|
||||
}
|
||||
|
||||
image_bytes = rowbytes * wpng_info.height;
|
||||
|
||||
wpng_info.image_data = (uch *)malloc(image_bytes);
|
||||
wpng_info.row_pointers = (uch **)malloc(wpng_info.height*sizeof(uch *));
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007, 2017 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -27,12 +34,30 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include <stdlib.h> /* for exit() prototype */
|
||||
#include <zlib.h>
|
||||
|
||||
#include "png.h" /* libpng header; includes zlib.h and setjmp.h */
|
||||
#include "png.h" /* libpng header, includes setjmp.h */
|
||||
#include "writepng.h" /* typedefs, common macros, public prototypes */
|
||||
|
||||
|
||||
@@ -65,7 +90,7 @@ int writepng_init(mainprog_info *mainprog_ptr)
|
||||
|
||||
/* could also replace libpng warning-handler (final NULL), but no need: */
|
||||
|
||||
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr,
|
||||
png_ptr = png_create_write_struct(png_get_libpng_ver(NULL), mainprog_ptr,
|
||||
writepng_error_handler, NULL);
|
||||
if (!png_ptr)
|
||||
return 4; /* out of memory */
|
||||
@@ -80,7 +105,8 @@ int writepng_init(mainprog_info *mainprog_ptr)
|
||||
/* setjmp() must be called in every function that calls a PNG-writing
|
||||
* libpng function, unless an alternate error handler was installed--
|
||||
* but compatible error handlers must either use longjmp() themselves
|
||||
* (as in this program) or exit immediately, so here we go: */
|
||||
* (as in this program) or some other method to return control to
|
||||
* application code, so here we go: */
|
||||
|
||||
if (setjmp(mainprog_ptr->jmpbuf)) {
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
@@ -364,5 +390,12 @@ static void writepng_error_handler(png_structp png_ptr, png_const_charp msg)
|
||||
exit(99);
|
||||
}
|
||||
|
||||
/* Now we have our data structure we can use the information in it
|
||||
* to return control to our own higher level code (all the points
|
||||
* where 'setjmp' is called in this file.) This will work with other
|
||||
* error handling mechanisms as well - libpng always calls png_error
|
||||
* when it can proceed no further, thus, so long as the error handler
|
||||
* is intercepted, application code can do its own error recovery.
|
||||
*/
|
||||
longjmp(mainprog_ptr->jmpbuf, 1);
|
||||
}
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
|
||||
65
contrib/libtests/fakepng.c
Normal file
65
contrib/libtests/fakepng.c
Normal file
@@ -0,0 +1,65 @@
|
||||
/* Fake a PNG - just write it out directly.
|
||||
*
|
||||
* COPYRIGHT: Written by John Cunningham Bowler, 2014.
|
||||
* To the extent possible under law, the author has waived all copyright and
|
||||
* related or neighboring rights to this work. This work is published from:
|
||||
* United States.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <zlib.h> /* for crc32 */
|
||||
|
||||
void
|
||||
put_uLong(uLong val)
|
||||
{
|
||||
putchar(val >> 24);
|
||||
putchar(val >> 16);
|
||||
putchar(val >> 8);
|
||||
putchar(val >> 0);
|
||||
}
|
||||
|
||||
void
|
||||
put_chunk(const unsigned char *chunk, uInt length)
|
||||
{
|
||||
uLong crc;
|
||||
|
||||
put_uLong(length-4); /* Exclude the tag */
|
||||
|
||||
fwrite(chunk, length, 1, stdout);
|
||||
|
||||
crc = crc32(0, Z_NULL, 0);
|
||||
put_uLong(crc32(crc, chunk, length));
|
||||
}
|
||||
|
||||
const unsigned char signature[] =
|
||||
{
|
||||
137, 80, 78, 71, 13, 10, 26, 10
|
||||
};
|
||||
|
||||
const unsigned char IHDR[] =
|
||||
{
|
||||
73, 72, 68, 82, /* IHDR */
|
||||
0, 0, 0, 1, /* width */
|
||||
0, 0, 0, 1, /* height */
|
||||
1, /* bit depth */
|
||||
0, /* color type: greyscale */
|
||||
0, /* compression method */
|
||||
0, /* filter method */
|
||||
0 /* interlace method: none */
|
||||
};
|
||||
|
||||
const unsigned char unknown[] =
|
||||
{
|
||||
'u', 'n', 'K', 'n' /* "unKn" - private safe to copy */
|
||||
};
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
fwrite(signature, sizeof signature, 1, stdout);
|
||||
put_chunk(IHDR, sizeof IHDR);
|
||||
|
||||
for (;;)
|
||||
put_chunk(unknown, sizeof unknown);
|
||||
}
|
||||
100
contrib/libtests/gentests.sh
Executable file
100
contrib/libtests/gentests.sh
Executable file
@@ -0,0 +1,100 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013 John Cunningham Bowler
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
#
|
||||
# Generate a set of PNG test images. The images are generated in a
|
||||
# sub-directory called 'tests' by default, however a command line argument will
|
||||
# change that name. The generation requires a built version of makepng in the
|
||||
# current directory.
|
||||
#
|
||||
usage(){
|
||||
exec >&2
|
||||
echo "$0 [<directory>]"
|
||||
echo ' Generate a set of PNG test files in "directory" ("tests" by default)'
|
||||
exit 1
|
||||
}
|
||||
|
||||
mp="$PWD/makepng"
|
||||
test -x "$mp" || {
|
||||
exec >&2
|
||||
echo "$0: the 'makepng' program must exist"
|
||||
echo " in the directory within which this program:"
|
||||
echo " $mp"
|
||||
echo " is executed"
|
||||
usage
|
||||
}
|
||||
|
||||
# Just one argument: the directory
|
||||
testdir="tests"
|
||||
test $# -gt 1 && {
|
||||
testdir="$1"
|
||||
shift
|
||||
}
|
||||
test $# -eq 0 || usage
|
||||
|
||||
# Take care not to clobber something
|
||||
if test -e "$testdir"
|
||||
then
|
||||
test -d "$testdir" || usage
|
||||
else
|
||||
# mkdir -p isn't portable, so do the following
|
||||
mkdir "$testdir" 2>/dev/null || mkdir -p "$testdir" || usage
|
||||
fi
|
||||
|
||||
# This fails in a very satisfactory way if it's not accessible
|
||||
cd "$testdir"
|
||||
:>"test$$.png" || {
|
||||
exec >&2
|
||||
echo "$testdir: directory not writable"
|
||||
usage
|
||||
}
|
||||
rm "test$$.png" || {
|
||||
exec >&2
|
||||
echo "$testdir: you have create but not write privileges here."
|
||||
echo " This is unexpected. You have a spurion; "'"'"test$$.png"'"'"."
|
||||
echo " You need to remove this yourself. Try a different directory."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Now call makepng ($mp) to create every file we can think of with a
|
||||
# reasonable name
|
||||
doit(){
|
||||
for gamma in "" --sRGB --linear --1.8
|
||||
do
|
||||
case "$gamma" in
|
||||
"")
|
||||
gname=;;
|
||||
--sRGB)
|
||||
gname="-srgb";;
|
||||
--linear)
|
||||
gname="-lin";;
|
||||
--1.8)
|
||||
gname="-18";;
|
||||
*)
|
||||
gname="-$gamma";;
|
||||
esac
|
||||
"$mp" $gamma "$1" "$2" "test-$1-$2$gname.png"
|
||||
done
|
||||
}
|
||||
#
|
||||
for ct in gray palette
|
||||
do
|
||||
for bd in 1 2 4 8
|
||||
do
|
||||
doit "$ct" "$bd"
|
||||
done
|
||||
done
|
||||
#
|
||||
doit "gray" "16"
|
||||
#
|
||||
for ct in gray-alpha rgb rgb-alpha
|
||||
do
|
||||
for bd in 8 16
|
||||
do
|
||||
doit "$ct" "$bd"
|
||||
done
|
||||
done
|
||||
1948
contrib/libtests/makepng.c
Normal file
1948
contrib/libtests/makepng.c
Normal file
File diff suppressed because it is too large
Load Diff
1722
contrib/libtests/pngimage.c
Normal file
1722
contrib/libtests/pngimage.c
Normal file
File diff suppressed because it is too large
Load Diff
165
contrib/libtests/pngstest-errors.h
Normal file
165
contrib/libtests/pngstest-errors.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/* contrib/libtests/pngstest-errors.h
|
||||
*
|
||||
* BUILT USING: libpng version 1.6.19beta03 - September 25, 2015
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* THIS IS A MACHINE GENERATED FILE: do not edit it directly!
|
||||
* Instead run:
|
||||
*
|
||||
* pngstest --accumulate
|
||||
*
|
||||
* on as many PNG files as possible; at least PNGSuite and
|
||||
* contrib/libtests/testpngs.
|
||||
*/
|
||||
static png_uint_16 gpc_error[16/*in*/][16/*out*/][4/*a*/] =
|
||||
{
|
||||
{ /* input: sRGB-gray */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 372, 0 }, { 0, 0, 372, 0 }, { 0, 0, 372, 0 }, { 0, 0, 372, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: sRGB-gray+alpha */
|
||||
{ 0, 19, 0, 0 }, { 0, 0, 0, 0 }, { 0, 20, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 897, 788, 0 }, { 0, 897, 788, 0 }, { 0, 897, 788, 0 }, { 0, 897, 788, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: sRGB-rgb */
|
||||
{ 0, 0, 19, 0 }, { 0, 0, 19, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 893, 0 }, { 0, 0, 893, 0 }, { 0, 0, 811, 0 }, { 0, 0, 811, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: sRGB-rgb+alpha */
|
||||
{ 0, 16, 17, 0 }, { 0, 17, 17, 0 }, { 0, 19, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 850, 875, 0 }, { 0, 850, 875, 0 }, { 0, 897, 788, 0 }, { 0, 897, 788, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: linear-gray */
|
||||
{ 0, 0, 9, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: linear-gray+alpha */
|
||||
{ 0, 74, 9, 0 }, { 0, 20, 9, 0 }, { 0, 74, 9, 0 }, { 0, 20, 9, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 0, 0 }, { 0, 1, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: linear-rgb */
|
||||
{ 0, 0, 9, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 },
|
||||
{ 0, 0, 4, 0 }, { 0, 0, 4, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: linear-rgb+alpha */
|
||||
{ 0, 126, 143, 0 }, { 0, 11, 7, 0 }, { 0, 74, 9, 0 }, { 0, 17, 9, 0 },
|
||||
{ 0, 4, 4, 0 }, { 0, 5, 4, 0 }, { 0, 0, 0, 0 }, { 0, 1, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-sRGB-gray */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-sRGB-gray+alpha */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-sRGB-rgb */
|
||||
{ 0, 0, 13, 0 }, { 0, 0, 13, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 },
|
||||
{ 0, 0, 673, 0 }, { 0, 0, 673, 0 }, { 0, 0, 674, 0 }, { 0, 0, 674, 0 },
|
||||
{ 0, 0, 1, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 460, 0 }, { 0, 0, 460, 0 }, { 0, 0, 263, 0 }, { 0, 0, 263, 0 }
|
||||
}, { /* input: color-mapped-sRGB-rgb+alpha */
|
||||
{ 0, 6, 8, 0 }, { 0, 7, 8, 0 }, { 0, 75, 9, 0 }, { 0, 9, 9, 0 },
|
||||
{ 0, 585, 427, 0 }, { 0, 585, 427, 0 }, { 0, 717, 514, 0 }, { 0, 717, 514, 0 },
|
||||
{ 0, 1, 1, 0 }, { 0, 1, 1, 0 }, { 0, 1, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 13323, 460, 0 }, { 0, 427, 460, 0 }, { 0, 16480, 263, 0 }, { 0, 243, 263, 0 }
|
||||
}, { /* input: color-mapped-linear-gray */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 282, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-linear-gray+alpha */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 253, 282, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-linear-rgb */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 265, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-linear-rgb+alpha */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 243, 265, 0 }
|
||||
}
|
||||
};
|
||||
static png_uint_16 gpc_error_via_linear[16][4/*out*/][4] =
|
||||
{
|
||||
{ /* input: sRGB-gray */
|
||||
{ 0, 0, 7, 0 }, { 0, 0, 7, 0 }, { 0, 0, 7, 0 }, { 0, 0, 7, 0 }
|
||||
}, { /* input: sRGB-gray+alpha */
|
||||
{ 0, 15, 15, 0 }, { 0, 186, 15, 0 }, { 0, 15, 15, 0 }, { 0, 186, 15, 0 }
|
||||
}, { /* input: sRGB-rgb */
|
||||
{ 0, 0, 20, 0 }, { 0, 0, 20, 0 }, { 0, 0, 15, 0 }, { 0, 0, 15, 0 }
|
||||
}, { /* input: sRGB-rgb+alpha */
|
||||
{ 0, 16, 17, 0 }, { 0, 187, 17, 0 }, { 0, 15, 15, 0 }, { 0, 186, 15, 0 }
|
||||
}, { /* input: linear-gray */
|
||||
{ 0, 0, 1, 0 }, { 0, 0, 1, 0 }, { 0, 0, 1, 0 }, { 0, 0, 1, 0 }
|
||||
}, { /* input: linear-gray+alpha */
|
||||
{ 0, 1, 1, 0 }, { 0, 1, 1, 0 }, { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
|
||||
}, { /* input: linear-rgb */
|
||||
{ 0, 0, 1, 0 }, { 0, 0, 1, 0 }, { 0, 0, 1, 0 }, { 0, 0, 1, 0 }
|
||||
}, { /* input: linear-rgb+alpha */
|
||||
{ 0, 1, 1, 0 }, { 0, 9, 1, 0 }, { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
|
||||
}, { /* input: color-mapped-sRGB-gray */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-sRGB-gray+alpha */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-sRGB-rgb */
|
||||
{ 0, 0, 13, 0 }, { 0, 0, 13, 0 }, { 0, 0, 14, 0 }, { 0, 0, 14, 0 }
|
||||
}, { /* input: color-mapped-sRGB-rgb+alpha */
|
||||
{ 0, 4, 8, 0 }, { 0, 9, 8, 0 }, { 0, 9, 5, 0 }, { 0, 32, 5, 0 }
|
||||
}, { /* input: color-mapped-linear-gray */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-linear-gray+alpha */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-linear-rgb */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}, { /* input: color-mapped-linear-rgb+alpha */
|
||||
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
|
||||
}
|
||||
};
|
||||
static png_uint_16 gpc_error_to_colormap[8/*i*/][8/*o*/][4] =
|
||||
{
|
||||
{ /* input: sRGB-gray */
|
||||
{ 0, 0, 9, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 }, { 0, 0, 9, 0 },
|
||||
{ 0, 0, 560, 0 }, { 0, 0, 560, 0 }, { 0, 0, 560, 0 }, { 0, 0, 560, 0 }
|
||||
}, { /* input: sRGB-gray+alpha */
|
||||
{ 0, 19, 9, 0 }, { 0, 255, 9, 25 }, { 0, 88, 9, 0 }, { 0, 255, 9, 25 },
|
||||
{ 0, 1012, 928, 0 }, { 0, 16026, 928, 6425 }, { 0, 1012, 928, 0 }, { 0, 16026, 928, 6425 }
|
||||
}, { /* input: sRGB-rgb */
|
||||
{ 0, 0, 19, 0 }, { 0, 0, 19, 0 }, { 0, 0, 25, 0 }, { 0, 0, 25, 0 },
|
||||
{ 0, 0, 962, 0 }, { 0, 0, 962, 0 }, { 0, 0, 13677, 0 }, { 0, 0, 13677, 0 }
|
||||
}, { /* input: sRGB-rgb+alpha */
|
||||
{ 0, 63, 77, 0 }, { 0, 255, 19, 25 }, { 0, 225, 25, 0 }, { 0, 255, 25, 67 },
|
||||
{ 0, 17534, 18491, 0 }, { 0, 15736, 2824, 6425 }, { 0, 14019, 13677, 0 }, { 0, 50115, 13677, 17219 }
|
||||
}, { /* input: linear-gray */
|
||||
{ 0, 0, 73, 0 }, { 0, 0, 73, 0 }, { 0, 0, 73, 0 }, { 0, 0, 73, 0 },
|
||||
{ 0, 0, 18817, 0 }, { 0, 0, 18817, 0 }, { 0, 0, 18817, 0 }, { 0, 0, 18817, 0 }
|
||||
}, { /* input: linear-gray+alpha */
|
||||
{ 0, 74, 74, 0 }, { 0, 255, 74, 25 }, { 0, 99, 74, 0 }, { 0, 255, 74, 25 },
|
||||
{ 0, 18919, 18907, 0 }, { 0, 24549, 18907, 6553 }, { 0, 18919, 18907, 0 }, { 0, 24549, 18907, 6553 }
|
||||
}, { /* input: linear-rgb */
|
||||
{ 0, 0, 73, 0 }, { 0, 0, 73, 0 }, { 0, 0, 98, 0 }, { 0, 0, 98, 0 },
|
||||
{ 0, 0, 18664, 0 }, { 0, 0, 18664, 0 }, { 0, 0, 24998, 0 }, { 0, 0, 24998, 0 }
|
||||
}, { /* input: linear-rgb+alpha */
|
||||
{ 0, 181, 196, 0 }, { 0, 255, 61, 25 }, { 206, 187, 98, 0 }, { 0, 255, 98, 67 },
|
||||
{ 0, 18141, 18137, 0 }, { 0, 17494, 17504, 6553 }, { 0, 24979, 24992, 0 }, { 0, 49172, 24992, 17347 }
|
||||
}
|
||||
};
|
||||
/* END MACHINE GENERATED */
|
||||
3832
contrib/libtests/pngstest.c
Normal file
3832
contrib/libtests/pngstest.c
Normal file
File diff suppressed because it is too large
Load Diff
1305
contrib/libtests/pngunknown.c
Normal file
1305
contrib/libtests/pngunknown.c
Normal file
File diff suppressed because it is too large
Load Diff
12279
contrib/libtests/pngvalid.c
Normal file
12279
contrib/libtests/pngvalid.c
Normal file
File diff suppressed because it is too large
Load Diff
114
contrib/libtests/readpng.c
Normal file
114
contrib/libtests/readpng.c
Normal file
@@ -0,0 +1,114 @@
|
||||
|
||||
/* readpng.c
|
||||
*
|
||||
* Copyright (c) 2013 John Cunningham Bowler
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* Load an arbitrary number of PNG files (from the command line, or, if there
|
||||
* are no arguments on the command line, from stdin) then run a time test by
|
||||
* reading each file by row. The test does nothing with the read result and
|
||||
* does no transforms. The only output is a time as a floating point number of
|
||||
* seconds with 9 decimal digits.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Define the following to use this test against your installed libpng, rather
|
||||
* than the one being built here:
|
||||
*/
|
||||
#ifdef PNG_FREESTANDING_TESTS
|
||||
# include <png.h>
|
||||
#else
|
||||
# include "../../png.h"
|
||||
#endif
|
||||
|
||||
static int
|
||||
read_png(FILE *fp)
|
||||
{
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);
|
||||
png_infop info_ptr = NULL;
|
||||
png_bytep row = NULL, display = NULL;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return 0;
|
||||
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
if (row != NULL) free(row);
|
||||
if (display != NULL) free(display);
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_init_io(png_ptr, fp);
|
||||
|
||||
info_ptr = png_create_info_struct(png_ptr);
|
||||
if (info_ptr == NULL)
|
||||
png_error(png_ptr, "OOM allocating info structure");
|
||||
|
||||
png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_ALWAYS, NULL, 0);
|
||||
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
{
|
||||
size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
|
||||
|
||||
/* Failure to initialize these is harmless */
|
||||
row = malloc(rowbytes);
|
||||
display = malloc(rowbytes);
|
||||
|
||||
if (row == NULL || display == NULL)
|
||||
png_error(png_ptr, "OOM allocating row buffers");
|
||||
|
||||
{
|
||||
png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
|
||||
# ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
int passes = png_set_interlace_handling(png_ptr);
|
||||
# else /* !READ_INTERLACING */
|
||||
int passes = png_get_interlace_type(png_ptr, info_ptr) ==
|
||||
PNG_INTERLACE_ADAM7 ? PNG_INTERLACE_ADAM7_PASSES : 1;
|
||||
# endif /* !READ_INTERLACING */
|
||||
int pass;
|
||||
|
||||
png_start_read_image(png_ptr);
|
||||
|
||||
for (pass = 0; pass < passes; ++pass)
|
||||
{
|
||||
png_uint_32 y = height;
|
||||
|
||||
# ifndef PNG_READ_INTERLACING_SUPPORTED
|
||||
if (passes == PNG_INTERLACE_ADAM7_PASSES)
|
||||
y = PNG_PASS_ROWS(y, pass);
|
||||
# endif /* READ_INTERLACING */
|
||||
|
||||
/* NOTE: this trashes the row each time; interlace handling won't
|
||||
* work, but this avoids memory thrashing for speed testing.
|
||||
*/
|
||||
while (y-- > 0)
|
||||
png_read_row(png_ptr, row, display);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure to read to the end of the file: */
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
free(row);
|
||||
free(display);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
/* Exit code 0 on success. */
|
||||
return !read_png(stdin);
|
||||
}
|
||||
1011
contrib/libtests/tarith.c
Normal file
1011
contrib/libtests/tarith.c
Normal file
File diff suppressed because it is too large
Load Diff
607
contrib/libtests/timepng.c
Normal file
607
contrib/libtests/timepng.c
Normal file
@@ -0,0 +1,607 @@
|
||||
|
||||
/* timepng.c
|
||||
*
|
||||
* Copyright (c) 2013,2016 John Cunningham Bowler
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* Load an arbitrary number of PNG files (from the command line, or, if there
|
||||
* are no arguments on the command line, from stdin) then run a time test by
|
||||
* reading each file by row or by image (possibly with transforms in the latter
|
||||
* case). The only output is a time as a floating point number of seconds with
|
||||
* 9 decimal digits.
|
||||
*/
|
||||
#define _POSIX_C_SOURCE 199309L /* for clock_gettime */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Define the following to use this test against your installed libpng, rather
|
||||
* than the one being built here:
|
||||
*/
|
||||
#ifdef PNG_FREESTANDING_TESTS
|
||||
# include <png.h>
|
||||
#else
|
||||
# include "../../png.h"
|
||||
#endif
|
||||
|
||||
/* The following is to support direct compilation of this file as C++ */
|
||||
#ifdef __cplusplus
|
||||
# define voidcast(type, value) static_cast<type>(value)
|
||||
#else
|
||||
# define voidcast(type, value) (value)
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* 'CLOCK_PROCESS_CPUTIME_ID' is one of the clock timers for clock_gettime. It
|
||||
* need not be supported even when clock_gettime is available. It returns the
|
||||
* 'CPU' time the process has consumed. 'CPU' time is assumed to include time
|
||||
* when the CPU is actually blocked by a pending cache fill but not time
|
||||
* waiting for page faults. The attempt is to get a measure of the actual time
|
||||
* the implementation takes to read a PNG ignoring the potentially very large IO
|
||||
* overhead.
|
||||
*/
|
||||
#if defined (CLOCK_PROCESS_CPUTIME_ID) && defined(PNG_STDIO_SUPPORTED) &&\
|
||||
defined(PNG_EASY_ACCESS_SUPPORTED) &&\
|
||||
(PNG_LIBPNG_VER >= 10700 ? defined(PNG_READ_PNG_SUPPORTED) :\
|
||||
defined (PNG_SEQUENTIAL_READ_SUPPORTED) &&\
|
||||
defined(PNG_INFO_IMAGE_SUPPORTED))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FILE *input;
|
||||
FILE *output;
|
||||
} io_data;
|
||||
|
||||
static PNG_CALLBACK(void, read_and_copy,
|
||||
(png_structp png_ptr, png_bytep buffer, size_t cb))
|
||||
{
|
||||
io_data *io = (io_data*)png_get_io_ptr(png_ptr);
|
||||
|
||||
if (fread(buffer, cb, 1, io->input) != 1)
|
||||
png_error(png_ptr, strerror(errno));
|
||||
|
||||
if (fwrite(buffer, cb, 1, io->output) != 1)
|
||||
{
|
||||
perror("temporary file");
|
||||
fprintf(stderr, "temporary file PNG write failed\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void read_by_row(png_structp png_ptr, png_infop info_ptr,
|
||||
FILE *write_ptr, FILE *read_ptr)
|
||||
{
|
||||
/* These don't get freed on error, this is fine; the program immediately
|
||||
* exits.
|
||||
*/
|
||||
png_bytep row = NULL, display = NULL;
|
||||
io_data io_copy;
|
||||
|
||||
if (write_ptr != NULL)
|
||||
{
|
||||
/* Set up for a copy to the temporary file: */
|
||||
io_copy.input = read_ptr;
|
||||
io_copy.output = write_ptr;
|
||||
png_set_read_fn(png_ptr, &io_copy, read_and_copy);
|
||||
}
|
||||
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
{
|
||||
size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
|
||||
|
||||
row = voidcast(png_bytep,malloc(rowbytes));
|
||||
display = voidcast(png_bytep,malloc(rowbytes));
|
||||
|
||||
if (row == NULL || display == NULL)
|
||||
png_error(png_ptr, "OOM allocating row buffers");
|
||||
|
||||
{
|
||||
png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
|
||||
int passes = png_set_interlace_handling(png_ptr);
|
||||
int pass;
|
||||
|
||||
png_start_read_image(png_ptr);
|
||||
|
||||
for (pass = 0; pass < passes; ++pass)
|
||||
{
|
||||
png_uint_32 y = height;
|
||||
|
||||
/* NOTE: this trashes the row each time; interlace handling won't
|
||||
* work, but this avoids memory thrashing for speed testing and is
|
||||
* somewhat representative of an application that works row-by-row.
|
||||
*/
|
||||
while (y-- > 0)
|
||||
png_read_row(png_ptr, row, display);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure to read to the end of the file: */
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
|
||||
/* Free this up: */
|
||||
free(row);
|
||||
free(display);
|
||||
}
|
||||
|
||||
static PNG_CALLBACK(void, no_warnings, (png_structp png_ptr,
|
||||
png_const_charp warning))
|
||||
{
|
||||
(void)png_ptr;
|
||||
(void)warning;
|
||||
}
|
||||
|
||||
static int read_png(FILE *fp, png_int_32 transforms, FILE *write_file)
|
||||
{
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,
|
||||
no_warnings);
|
||||
png_infop info_ptr = NULL;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return 0;
|
||||
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
# ifdef PNG_BENIGN_ERRORS_SUPPORTED
|
||||
png_set_benign_errors(png_ptr, 1/*allowed*/);
|
||||
# endif
|
||||
png_init_io(png_ptr, fp);
|
||||
|
||||
info_ptr = png_create_info_struct(png_ptr);
|
||||
|
||||
if (info_ptr == NULL)
|
||||
png_error(png_ptr, "OOM allocating info structure");
|
||||
|
||||
if (transforms < 0)
|
||||
read_by_row(png_ptr, info_ptr, write_file, fp);
|
||||
|
||||
else
|
||||
png_read_png(png_ptr, info_ptr, transforms, NULL/*params*/);
|
||||
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int mytime(struct timespec *t)
|
||||
{
|
||||
/* Do the timing using clock_gettime and the per-process timer. */
|
||||
if (!clock_gettime(CLOCK_PROCESS_CPUTIME_ID, t))
|
||||
return 1;
|
||||
|
||||
perror("CLOCK_PROCESS_CPUTIME_ID");
|
||||
fprintf(stderr, "timepng: could not get the time\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int perform_one_test(FILE *fp, int nfiles, png_int_32 transforms)
|
||||
{
|
||||
int i;
|
||||
struct timespec before, after;
|
||||
|
||||
/* Clear out all errors: */
|
||||
rewind(fp);
|
||||
|
||||
if (mytime(&before))
|
||||
{
|
||||
for (i=0; i<nfiles; ++i)
|
||||
{
|
||||
if (read_png(fp, transforms, NULL/*write*/))
|
||||
{
|
||||
if (ferror(fp))
|
||||
{
|
||||
perror("temporary file");
|
||||
fprintf(stderr, "file %d: error reading PNG data\n", i);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
perror("temporary file");
|
||||
fprintf(stderr, "file %d: error from libpng\n", i);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (mytime(&after))
|
||||
{
|
||||
/* Work out the time difference and print it - this is the only output,
|
||||
* so flush it immediately.
|
||||
*/
|
||||
unsigned long s = after.tv_sec - before.tv_sec;
|
||||
long ns = after.tv_nsec - before.tv_nsec;
|
||||
|
||||
if (ns < 0)
|
||||
{
|
||||
--s;
|
||||
ns += 1000000000;
|
||||
|
||||
if (ns < 0)
|
||||
{
|
||||
fprintf(stderr, "timepng: bad clock from kernel\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
printf("%lu.%.9ld\n", s, ns);
|
||||
fflush(stdout);
|
||||
if (ferror(stdout))
|
||||
{
|
||||
fprintf(stderr, "timepng: error writing output\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Successful return */
|
||||
return 1;
|
||||
}
|
||||
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int add_one_file(FILE *fp, char *name)
|
||||
{
|
||||
FILE *ip = fopen(name, "rb");
|
||||
|
||||
if (ip != NULL)
|
||||
{
|
||||
/* Read the file using libpng; this detects errors and also deals with
|
||||
* files which contain data beyond the end of the file.
|
||||
*/
|
||||
int ok = 0;
|
||||
fpos_t pos;
|
||||
|
||||
if (fgetpos(fp, &pos))
|
||||
{
|
||||
/* Fatal error reading the start: */
|
||||
perror("temporary file");
|
||||
fprintf(stderr, "temporary file fgetpos error\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (read_png(ip, -1/*by row*/, fp/*output*/))
|
||||
{
|
||||
if (ferror(ip))
|
||||
{
|
||||
perror(name);
|
||||
fprintf(stderr, "%s: read error\n", name);
|
||||
}
|
||||
|
||||
else
|
||||
ok = 1; /* read ok */
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "%s: file not added\n", name);
|
||||
|
||||
(void)fclose(ip);
|
||||
|
||||
/* An error in the output is fatal; exit immediately: */
|
||||
if (ferror(fp))
|
||||
{
|
||||
perror("temporary file");
|
||||
fprintf(stderr, "temporary file write error\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ok)
|
||||
return 1;
|
||||
|
||||
/* Did not read the file successfully, simply rewind the temporary
|
||||
* file. This must happen after the ferror check above to avoid clearing
|
||||
* the error.
|
||||
*/
|
||||
if (fsetpos(fp, &pos))
|
||||
{
|
||||
perror("temporary file");
|
||||
fprintf(stderr, "temporary file fsetpos error\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* file open error: */
|
||||
perror(name);
|
||||
fprintf(stderr, "%s: open failed\n", name);
|
||||
}
|
||||
|
||||
return 0; /* file not added */
|
||||
}
|
||||
|
||||
static void
|
||||
usage(FILE *fp)
|
||||
{
|
||||
if (fp != NULL) fclose(fp);
|
||||
|
||||
fprintf(stderr,
|
||||
"Usage:\n"
|
||||
" timepng --assemble <assembly> {files}\n"
|
||||
" Read the files into <assembly>, output the count. Options are ignored.\n"
|
||||
" timepng --dissemble <assembly> <count> [options]\n"
|
||||
" Time <count> files from <assembly>, additional files may not be given.\n"
|
||||
" Otherwise:\n"
|
||||
" Read the files into a temporary file and time the decode\n"
|
||||
"Transforms:\n"
|
||||
" --by-image: read by image with png_read_png\n"
|
||||
" --<transform>: implies by-image, use PNG_TRANSFORM_<transform>\n"
|
||||
" Otherwise: read by row using png_read_row (to a single row buffer)\n"
|
||||
/* ISO C90 string length max 509 */);fprintf(stderr,
|
||||
"{files}:\n"
|
||||
" PNG files to copy into the assembly and time. Invalid files are skipped\n"
|
||||
" with appropriate error messages. If no files are given the list of files\n"
|
||||
" is read from stdin with each file name terminated by a newline\n"
|
||||
"Output:\n"
|
||||
" For --assemble the output is the name of the assembly file followed by the\n"
|
||||
" count of the files it contains; the arguments for --dissemble. Otherwise\n"
|
||||
" the output is the total decode time in seconds.\n");
|
||||
|
||||
exit(99);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ok = 0;
|
||||
int err = 0;
|
||||
int nfiles = 0;
|
||||
int transforms = -1; /* by row */
|
||||
const char *assembly = NULL;
|
||||
FILE *fp;
|
||||
|
||||
if (argc > 2 && strcmp(argv[1], "--assemble") == 0)
|
||||
{
|
||||
/* Just build the test file, argv[2] is the file name. */
|
||||
assembly = argv[2];
|
||||
fp = fopen(assembly, "wb");
|
||||
if (fp == NULL)
|
||||
{
|
||||
perror(assembly);
|
||||
fprintf(stderr, "timepng --assemble %s: could not open for write\n",
|
||||
assembly);
|
||||
usage(NULL);
|
||||
}
|
||||
|
||||
argv += 2;
|
||||
argc -= 2;
|
||||
}
|
||||
|
||||
else if (argc > 3 && strcmp(argv[1], "--dissemble") == 0)
|
||||
{
|
||||
fp = fopen(argv[2], "rb");
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
perror(argv[2]);
|
||||
fprintf(stderr, "timepng --dissemble %s: could not open for read\n",
|
||||
argv[2]);
|
||||
usage(NULL);
|
||||
}
|
||||
|
||||
nfiles = atoi(argv[3]);
|
||||
if (nfiles <= 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"timepng --dissemble <file> <count>: %s is not a count\n",
|
||||
argv[3]);
|
||||
exit(99);
|
||||
}
|
||||
#ifdef __COVERITY__
|
||||
else
|
||||
{
|
||||
nfiles &= PNG_UINT_31_MAX;
|
||||
}
|
||||
#endif
|
||||
|
||||
argv += 3;
|
||||
argc -= 3;
|
||||
}
|
||||
|
||||
else /* Else use a temporary file */
|
||||
{
|
||||
#ifndef __COVERITY__
|
||||
fp = tmpfile();
|
||||
#else
|
||||
/* Experimental. Coverity says tmpfile() is insecure because it
|
||||
* generates predictable names.
|
||||
*
|
||||
* It is possible to satisfy Coverity by using mkstemp(); however,
|
||||
* any platform supporting mkstemp() undoubtedly has a secure tmpfile()
|
||||
* implementation as well, and doesn't need the fix. Note that
|
||||
* the fix won't work on platforms that don't support mkstemp().
|
||||
*
|
||||
* https://www.securecoding.cert.org/confluence/display/c/
|
||||
* FIO21-C.+Do+not+create+temporary+files+in+shared+directories
|
||||
* says that most historic implementations of tmpfile() provide
|
||||
* only a limited number of possible temporary file names
|
||||
* (usually 26) before file names are recycled. That article also
|
||||
* provides a secure solution that unfortunately depends upon mkstemp().
|
||||
*/
|
||||
char tmpfile[] = "timepng-XXXXXX";
|
||||
int filedes;
|
||||
umask(0177);
|
||||
filedes = mkstemp(tmpfile);
|
||||
if (filedes < 0)
|
||||
fp = NULL;
|
||||
else
|
||||
{
|
||||
fp = fdopen(filedes,"w+");
|
||||
/* Hide the filename immediately and ensure that the file does
|
||||
* not exist after the program ends
|
||||
*/
|
||||
(void) unlink(tmpfile);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
perror("tmpfile");
|
||||
fprintf(stderr, "timepng: could not open the temporary file\n");
|
||||
exit(1); /* not a user error */
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle the transforms: */
|
||||
while (argc > 1 && argv[1][0] == '-' && argv[1][1] == '-')
|
||||
{
|
||||
const char *opt = *++argv + 2;
|
||||
|
||||
--argc;
|
||||
|
||||
/* Transforms turn on the by-image processing and maybe set some
|
||||
* transforms:
|
||||
*/
|
||||
if (transforms == -1)
|
||||
transforms = PNG_TRANSFORM_IDENTITY;
|
||||
|
||||
if (strcmp(opt, "by-image") == 0)
|
||||
{
|
||||
/* handled above */
|
||||
}
|
||||
|
||||
# define OPT(name) else if (strcmp(opt, #name) == 0)\
|
||||
transforms |= PNG_TRANSFORM_ ## name
|
||||
|
||||
OPT(STRIP_16);
|
||||
OPT(STRIP_ALPHA);
|
||||
OPT(PACKING);
|
||||
OPT(PACKSWAP);
|
||||
OPT(EXPAND);
|
||||
OPT(INVERT_MONO);
|
||||
OPT(SHIFT);
|
||||
OPT(BGR);
|
||||
OPT(SWAP_ALPHA);
|
||||
OPT(SWAP_ENDIAN);
|
||||
OPT(INVERT_ALPHA);
|
||||
OPT(STRIP_FILLER);
|
||||
OPT(STRIP_FILLER_BEFORE);
|
||||
OPT(STRIP_FILLER_AFTER);
|
||||
OPT(GRAY_TO_RGB);
|
||||
OPT(EXPAND_16);
|
||||
OPT(SCALE_16);
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "timepng %s: unrecognized transform\n", opt);
|
||||
usage(fp);
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle the files: */
|
||||
if (argc > 1 && nfiles > 0)
|
||||
usage(fp); /* Additional files not valid with --dissemble */
|
||||
|
||||
else if (argc > 1)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=1; i<argc; ++i)
|
||||
{
|
||||
if (nfiles == INT_MAX)
|
||||
{
|
||||
fprintf(stderr, "%s: skipped, too many files\n", argv[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
else if (add_one_file(fp, argv[i]))
|
||||
++nfiles;
|
||||
}
|
||||
}
|
||||
|
||||
else if (nfiles == 0) /* Read from stdin without --dissemble */
|
||||
{
|
||||
char filename[FILENAME_MAX+1];
|
||||
|
||||
while (fgets(filename, FILENAME_MAX+1, stdin))
|
||||
{
|
||||
size_t len = strlen(filename);
|
||||
|
||||
if (filename[len-1] == '\n')
|
||||
{
|
||||
filename[len-1] = 0;
|
||||
if (nfiles == INT_MAX)
|
||||
{
|
||||
fprintf(stderr, "%s: skipped, too many files\n", filename);
|
||||
break;
|
||||
}
|
||||
|
||||
else if (add_one_file(fp, filename))
|
||||
++nfiles;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "timepng: file name too long: ...%s\n",
|
||||
filename+len-32);
|
||||
err = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ferror(stdin))
|
||||
{
|
||||
fprintf(stderr, "timepng: stdin: read error\n");
|
||||
err = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform the test, or produce the --assemble output: */
|
||||
if (!err)
|
||||
{
|
||||
if (nfiles > 0)
|
||||
{
|
||||
if (assembly != NULL)
|
||||
{
|
||||
if (fflush(fp) && !ferror(fp) && fclose(fp))
|
||||
{
|
||||
perror(assembly);
|
||||
fprintf(stderr, "%s: close failed\n", assembly);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
printf("%s %d\n", assembly, nfiles);
|
||||
fflush(stdout);
|
||||
ok = !ferror(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
ok = perform_one_test(fp, nfiles, transforms);
|
||||
(void)fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
usage(fp);
|
||||
}
|
||||
|
||||
else
|
||||
(void)fclose(fp);
|
||||
|
||||
/* Exit code 0 on success. */
|
||||
return ok == 0;
|
||||
}
|
||||
#else /* !sufficient support */
|
||||
int main(void) { return 77; }
|
||||
#endif /* !sufficient support */
|
||||
142
contrib/mips-mmi/linux.c
Normal file
142
contrib/mips-mmi/linux.c
Normal file
@@ -0,0 +1,142 @@
|
||||
|
||||
/* contrib/mips-mmi/linux.c
|
||||
*
|
||||
* Copyright (c) 2024 Cosmin Truta
|
||||
* Written by guxiwei, 2023
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
/*
|
||||
* parse_r var, r - Helper assembler macro for parsing register names.
|
||||
*
|
||||
* This converts the register name in $n form provided in \r to the
|
||||
* corresponding register number, which is assigned to the variable \var. It is
|
||||
* needed to allow explicit encoding of instructions in inline assembly where
|
||||
* registers are chosen by the compiler in $n form, allowing us to avoid using
|
||||
* fixed register numbers.
|
||||
*
|
||||
* It also allows newer instructions (not implemented by the assembler) to be
|
||||
* transparently implemented using assembler macros, instead of needing separate
|
||||
* cases depending on toolchain support.
|
||||
*
|
||||
* Simple usage example:
|
||||
* __asm__ __volatile__("parse_r __rt, %0\n\t"
|
||||
* ".insn\n\t"
|
||||
* "# di %0\n\t"
|
||||
* ".word (0x41606000 | (__rt << 16))"
|
||||
* : "=r" (status);
|
||||
*/
|
||||
|
||||
/* Match an individual register number and assign to \var */
|
||||
#define _IFC_REG(n) \
|
||||
".ifc \\r, $" #n "\n\t" \
|
||||
"\\var = " #n "\n\t" \
|
||||
".endif\n\t"
|
||||
|
||||
__asm__(".macro parse_r var r\n\t"
|
||||
"\\var = -1\n\t"
|
||||
_IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3)
|
||||
_IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7)
|
||||
_IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11)
|
||||
_IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15)
|
||||
_IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19)
|
||||
_IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23)
|
||||
_IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27)
|
||||
_IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31)
|
||||
".iflt \\var\n\t"
|
||||
".error \"Unable to parse register name \\r\"\n\t"
|
||||
".endif\n\t"
|
||||
".endm");
|
||||
|
||||
#define HWCAP_LOONGSON_CPUCFG (1 << 14)
|
||||
|
||||
static int cpucfg_available(void)
|
||||
{
|
||||
return getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG;
|
||||
}
|
||||
|
||||
static int strstart(const char *str, const char *pfx, const char **ptr)
|
||||
{
|
||||
while (*pfx && *pfx == *str) {
|
||||
pfx++;
|
||||
str++;
|
||||
}
|
||||
if (!*pfx && ptr)
|
||||
*ptr = str;
|
||||
return !*pfx;
|
||||
}
|
||||
|
||||
/* Most toolchains have no CPUCFG support yet */
|
||||
static uint32_t read_cpucfg(uint32_t reg)
|
||||
{
|
||||
uint32_t __res;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"parse_r __res,%0\n\t"
|
||||
"parse_r reg,%1\n\t"
|
||||
".insn \n\t"
|
||||
".word (0xc8080118 | (reg << 21) | (__res << 11))\n\t"
|
||||
:"=r"(__res)
|
||||
:"r"(reg)
|
||||
:
|
||||
);
|
||||
return __res;
|
||||
}
|
||||
|
||||
#define LOONGSON_CFG1 0x1
|
||||
|
||||
#define LOONGSON_CFG1_MMI (1 << 4)
|
||||
|
||||
static int cpu_flags_cpucfg(void)
|
||||
{
|
||||
int flags = 0;
|
||||
uint32_t cfg1 = read_cpucfg(LOONGSON_CFG1);
|
||||
|
||||
if (cfg1 & LOONGSON_CFG1_MMI)
|
||||
flags = 1;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static int cpu_flags_cpuinfo(void)
|
||||
{
|
||||
FILE *f = fopen("/proc/cpuinfo", "r");
|
||||
char buf[200];
|
||||
int flags = 0;
|
||||
|
||||
if (!f)
|
||||
return flags;
|
||||
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
/* Legacy kernel may not export MMI in ASEs implemented */
|
||||
if (strstart(buf, "cpu model", NULL)) {
|
||||
if (strstr(buf, "Loongson-3 "))
|
||||
flags = 1;
|
||||
break;
|
||||
}
|
||||
if (strstart(buf, "ASEs implemented", NULL)) {
|
||||
if (strstr(buf, " loongson-mmi"))
|
||||
flags = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
return flags;
|
||||
}
|
||||
|
||||
static int png_have_mmi()
|
||||
{
|
||||
if (cpucfg_available())
|
||||
return cpu_flags_cpucfg();
|
||||
else
|
||||
return cpu_flags_cpuinfo();
|
||||
return 0;
|
||||
}
|
||||
83
contrib/mips-msa/README
Normal file
83
contrib/mips-msa/README
Normal file
@@ -0,0 +1,83 @@
|
||||
OPERATING SYSTEM SPECIFIC MIPS MSA DETECTION
|
||||
--------------------------------------------
|
||||
|
||||
Detection of the ability to execute MIPS MSA on an MIPS processor requires
|
||||
operating system support. (The information is not available in user mode.)
|
||||
|
||||
HOW TO USE THIS
|
||||
---------------
|
||||
|
||||
This directory contains C code fragments that can be included in mips/mips_init.c
|
||||
by setting the macro PNG_MIPS_MSA_FILE to the file name in "" or <> at build
|
||||
time. This setting is not recorded in pnglibconf.h and can be changed simply by
|
||||
rebuilding mips/msa_init.o with the required macro definition.
|
||||
|
||||
For any of this code to be used the MIPS MSA code must be enabled and run time
|
||||
checks must be supported. I.e.:
|
||||
|
||||
#if PNG_MIPS_MSA_OPT > 0
|
||||
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED
|
||||
|
||||
This is done in a 'configure' build by passing configure the argument:
|
||||
|
||||
--enable-mips-msa=check
|
||||
|
||||
Apart from the basic Linux implementation in contrib/mips-msa/linux.c this code
|
||||
is unsupported. That means that it is not even compiled on a regular basis and
|
||||
may be broken in any given minor release.
|
||||
|
||||
FILE FORMAT
|
||||
-----------
|
||||
|
||||
Each file documents its testing status as of the last time it was tested (which
|
||||
may have been a long time ago):
|
||||
|
||||
STATUS: one of:
|
||||
SUPPORTED: This indicates that the file is included in the regularly
|
||||
performed test builds and bugs are fixed when discovered.
|
||||
COMPILED: This indicates that the code did compile at least once. See the
|
||||
more detailed description for the extent to which the result was
|
||||
successful.
|
||||
TESTED: This means the code was fully compiled into the libpng test programs
|
||||
and these were run at least once.
|
||||
|
||||
BUG REPORTS: an email address to which to send reports of problems
|
||||
|
||||
The file is a fragment of C code. It should not define any 'extern' symbols;
|
||||
everything should be static. It must define the function:
|
||||
|
||||
static int png_have_msa(png_structp png_ptr);
|
||||
|
||||
That function must return 1 if MIPS MSA instructions are supported, 0 if not.
|
||||
It must not execute png_error unless it detects a bug. A png_error will prevent
|
||||
the reading of the PNG and in the future, writing too.
|
||||
|
||||
BUG REPORTS
|
||||
-----------
|
||||
|
||||
If you mail a bug report for any file that is not SUPPORTED there may only be
|
||||
limited response. Consider fixing it and sending a patch to fix the problem -
|
||||
this is more likely to result in action.
|
||||
|
||||
CONTRIBUTIONS
|
||||
-------------
|
||||
|
||||
You may send contributions of new implementations to
|
||||
png-mng-implement@sourceforge.net. Please write code in strict C90 C where
|
||||
possible. Obviously OS dependencies are to be expected. If you submit code you
|
||||
must have the authors permission and it must have a license that is acceptable
|
||||
to the current maintainer; in particular that license must permit modification
|
||||
and redistribution.
|
||||
|
||||
Please try to make the contribution a single file and give the file a clear and
|
||||
unambiguous name that identifies the target OS. If multiple files really are
|
||||
required put them all in a sub-directory.
|
||||
|
||||
You must also be prepared to handle bug reports from users of the code, either
|
||||
by joining the png-mng-implement mailing list or by providing an email for the
|
||||
"BUG REPORTS" entry or both. Please make sure that the header of the file
|
||||
contains the STATUS and BUG REPORTS fields as above.
|
||||
|
||||
Please list the OS requirements as precisely as possible. Ideally you should
|
||||
also list the environment in which the code has been tested and certainly list
|
||||
any environments where you suspect it might not work.
|
||||
55
contrib/mips-msa/linux.c
Normal file
55
contrib/mips-msa/linux.c
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
/* contrib/mips-msa/linux.c
|
||||
*
|
||||
* Copyright (c) 2020-2023 Cosmin Truta
|
||||
* Copyright (c) 2016 Glenn Randers-Pehrson
|
||||
* Written by Mandar Sahastrabuddhe, 2016.
|
||||
* Updated by Sui Jingfeng, 2021.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* On Linux, png_have_msa is implemented by reading the pseudo-file
|
||||
* "/proc/self/auxv".
|
||||
*
|
||||
* See contrib/mips-msa/README before reporting bugs.
|
||||
*
|
||||
* STATUS: SUPPORTED
|
||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
||||
*/
|
||||
|
||||
#include <elf.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int
|
||||
png_have_msa(png_structp png_ptr)
|
||||
{
|
||||
Elf64_auxv_t aux;
|
||||
int fd;
|
||||
int has_msa = 0;
|
||||
|
||||
fd = open("/proc/self/auxv", O_RDONLY);
|
||||
if (fd >= 0)
|
||||
{
|
||||
while (read(fd, &aux, sizeof(Elf64_auxv_t)) == sizeof(Elf64_auxv_t))
|
||||
{
|
||||
if (aux.a_type == AT_HWCAP)
|
||||
{
|
||||
uint64_t hwcap = aux.a_un.a_val;
|
||||
|
||||
has_msa = (hwcap >> 1) & 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
#ifdef PNG_WARNINGS_SUPPORTED
|
||||
else
|
||||
png_warning(png_ptr, "/proc/self/auxv open failed");
|
||||
#endif
|
||||
|
||||
return has_msa;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
Microsoft Developer Studio Build File, Format Version 6.00 for
|
||||
msvctest
|
||||
|
||||
Assumes that libpng DLLs and LIBs are in ..\..\projects\msvc\win32\libpng
|
||||
Assumes that zlib DLLs and LIBs are in ..\..\projects\msvc\win32\zlib
|
||||
|
||||
To build:
|
||||
|
||||
1) On the main menu Select "Build|Set Active configuration".
|
||||
Choose the configuration that corresponds to the library you want to test.
|
||||
This library must have been built using the libpng MS project located in
|
||||
the "mscv" subdirectory.
|
||||
|
||||
2) Select "Build|Clean"
|
||||
|
||||
3) Select "Build|Rebuild All"
|
||||
|
||||
4) The test results should appear in the "Build" pane of the Output Window.
|
||||
|
||||
|
||||
Simon-Pierre Cadieux
|
||||
Methodex Computer Systems Inc.
|
||||
@@ -1,247 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="msvctest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=msvctest - Win32 Debug DLL
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "msvctest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "msvctest.mak" CFG="msvctest - Win32 Debug DLL"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "msvctest - Win32 DLL" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "msvctest - Win32 Debug DLL" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "msvctest - Win32 ASM DLL" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "msvctest - Win32 Debug ASM DLL" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "msvctest - Win32 LIB" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "msvctest - Win32 Debug LIB" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "msvctest - Win32 DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "dll"
|
||||
# PROP BASE Intermediate_Dir "dll"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "dll"
|
||||
# PROP Intermediate_Dir "dll"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O1 /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll\libpng2.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=[Run Test]
|
||||
PostBuild_Cmds=set path=..\..\projects\msvc\win32\libpng\dll;..\..\projects\msvc\win32\zlib\dll; $(outdir)\msvctest.exe ..\..\pngtest.png
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "msvctest - Win32 Debug DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "dll_dbg"
|
||||
# PROP BASE Intermediate_Dir "dll_dbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "dll_dbg"
|
||||
# PROP Intermediate_Dir "dll_dbg"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\..\..\zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbg\libpng2d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_dbg
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=[Run Test]
|
||||
PostBuild_Cmds=set path=..\..\projects\msvc\win32\libpng\dll_dbg;..\..\projects\msvc\win32\zlib\dll_dbg; $(outdir)\msvctest.exe ..\..\pngtest.png
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "msvctest - Win32 ASM DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "dll_asm"
|
||||
# PROP BASE Intermediate_Dir "dll_asm"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "dll_asm"
|
||||
# PROP Intermediate_Dir "dll_asm"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O1 /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_asm\libpng2a.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_asm
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=[Run Test]
|
||||
PostBuild_Cmds=set path=..\..\projects\msvc\win32\libpng\dll_asm;..\..\projects\msvc\win32\zlib\dll_asm; $(outdir)\msvctest.exe ..\..\pngtest.png
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "msvctest - Win32 Debug ASM DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "dll_dbga"
|
||||
# PROP BASE Intermediate_Dir "dll_dbga"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "dll_dbga"
|
||||
# PROP Intermediate_Dir "dll_dbga"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\..\..\zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbga\libpng2b.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\dll_dbga
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=[Run Test]
|
||||
PostBuild_Cmds=set path=..\..\projects\msvc\win32\libpng\dll_dbga;..\..\projects\msvc\win32\zlib\dll_dbga; $(outdir)\msvctest.exe ..\..\pngtest.png
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "msvctest - Win32 LIB"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "lib"
|
||||
# PROP BASE Intermediate_Dir "lib"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "lib"
|
||||
# PROP Intermediate_Dir "lib"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\lib\libpng.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\lib
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=[Run Test]
|
||||
PostBuild_Cmds=$(outdir)\msvctest.exe ..\..\pngtest.png
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "msvctest - Win32 Debug LIB"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "lib_dbg"
|
||||
# PROP BASE Intermediate_Dir "lib_dbg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "lib_dbg"
|
||||
# PROP Intermediate_Dir "lib_dbg"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Zi /Od /I "..\..\..\zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\lib_dbg\libpng.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\lib_dbg
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=[Run Test]
|
||||
PostBuild_Cmds=$(outdir)\msvctest.exe ..\..\pngtest.png
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "msvctest - Win32 DLL"
|
||||
# Name "msvctest - Win32 Debug DLL"
|
||||
# Name "msvctest - Win32 ASM DLL"
|
||||
# Name "msvctest - Win32 Debug ASM DLL"
|
||||
# Name "msvctest - Win32 LIB"
|
||||
# Name "msvctest - Win32 Debug LIB"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\pngtest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\README.txt
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,29 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "msvctest"=.\msvctest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
25
contrib/oss-fuzz/Dockerfile
Normal file
25
contrib/oss-fuzz/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
# Copyright 2016 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
FROM gcr.io/oss-fuzz-base/base-builder
|
||||
MAINTAINER glennrp@gmail.com
|
||||
RUN apt-get update && \
|
||||
apt-get install -y make autoconf automake libtool
|
||||
|
||||
RUN git clone --depth 1 https://github.com/madler/zlib.git
|
||||
RUN git clone --depth 1 https://github.com/glennrp/libpng.git
|
||||
RUN cp libpng/contrib/oss-fuzz/build.sh $SRC
|
||||
WORKDIR libpng
|
||||
36
contrib/oss-fuzz/README.txt
Normal file
36
contrib/oss-fuzz/README.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
Copyright (c) 2017 Glenn Randers-Pehrson
|
||||
|
||||
This code is released under the libpng license.
|
||||
For conditions of distribution and use, see the disclaimer
|
||||
and license in png.h
|
||||
|
||||
Files in this directory are used by the oss-fuzz project
|
||||
(https://github.com/google/oss-fuzz/tree/master/projects/libpng).
|
||||
for "fuzzing" libpng.
|
||||
|
||||
They were licensed by Google Inc, using the BSD-like Chromium license,
|
||||
which may be found at https://cs.chromium.org/chromium/src/LICENSE, or, if
|
||||
noted in the source, under the Apache-2.0 license, which may
|
||||
be found at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
If they have been modified, the derivatives are copyright Glenn Randers-Pehrson
|
||||
and are released under the same licenses as the originals. Several of
|
||||
the original files (libpng_read_fuzzer.options, png.dict, project.yaml)
|
||||
had no licensing information; we assumed that these were under the Chromium
|
||||
license. Any new files are released under the libpng license (see png.h).
|
||||
|
||||
The files are
|
||||
Original
|
||||
Filename or derived Copyright License
|
||||
========================= ========== ================ ==========
|
||||
Dockerfile* derived 2017, Glenn R-P Apache 2.0
|
||||
build.sh derived 2017, Glenn R-P Apache 2.0
|
||||
libpng_read_fuzzer.cc derived 2017, Glenn R-P Chromium
|
||||
libpng_read_fuzzer.options original 2015, Chrome Devs Chromium
|
||||
png.dict original 2015, Chrome Devs Chromium
|
||||
README.txt (this file) original 2017, Glenn R-P libpng
|
||||
|
||||
* Dockerfile is a copy of the file used by oss-fuzz. build.sh,
|
||||
png.dict and libpng_read_fuzzer.* are the actual files used by oss-fuzz,
|
||||
which retrieves them from the libpng repository at Github.
|
||||
|
||||
To do: exercise the progressive reader and the png encoder.
|
||||
50
contrib/oss-fuzz/build.sh
Executable file
50
contrib/oss-fuzz/build.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
# Copyright 2017-2018 Glenn Randers-Pehrson
|
||||
# Copyright 2016 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Revisions by Glenn Randers-Pehrson, 2017:
|
||||
# 1. Build only the library, not the tools (changed "make -j$(nproc) all" to
|
||||
# "make -j$(nproc) libpng16.la").
|
||||
# 2. Disabled WARNING and WRITE options in pnglibconf.dfa.
|
||||
# 3. Build zlib alongside libpng
|
||||
################################################################################
|
||||
|
||||
# Disable logging via library build configuration control.
|
||||
cat scripts/pnglibconf.dfa | \
|
||||
sed -e "s/option STDIO/option STDIO disabled/" \
|
||||
-e "s/option WARNING /option WARNING disabled/" \
|
||||
-e "s/option WRITE enables WRITE_INT_FUNCTIONS/option WRITE disabled/" \
|
||||
> scripts/pnglibconf.dfa.temp
|
||||
mv scripts/pnglibconf.dfa.temp scripts/pnglibconf.dfa
|
||||
|
||||
# build the libpng library.
|
||||
autoreconf -f -i
|
||||
./configure --with-libpng-prefix=OSS_FUZZ_
|
||||
make -j$(nproc) clean
|
||||
make -j$(nproc) libpng16.la
|
||||
|
||||
# build libpng_read_fuzzer.
|
||||
$CXX $CXXFLAGS -std=c++11 -I. \
|
||||
$SRC/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc \
|
||||
-o $OUT/libpng_read_fuzzer \
|
||||
-lFuzzingEngine .libs/libpng16.a -lz
|
||||
|
||||
# add seed corpus.
|
||||
find $SRC/libpng -name "*.png" | grep -v crashers | \
|
||||
xargs zip $OUT/libpng_read_fuzzer_seed_corpus.zip
|
||||
|
||||
cp $SRC/libpng/contrib/oss-fuzz/*.dict \
|
||||
$SRC/libpng/contrib/oss-fuzz/*.options $OUT/
|
||||
208
contrib/oss-fuzz/libpng_read_fuzzer.cc
Normal file
208
contrib/oss-fuzz/libpng_read_fuzzer.cc
Normal file
@@ -0,0 +1,208 @@
|
||||
|
||||
// libpng_read_fuzzer.cc
|
||||
// Copyright 2017-2018 Glenn Randers-Pehrson
|
||||
// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that may
|
||||
// be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE
|
||||
|
||||
// The modifications in 2017 by Glenn Randers-Pehrson include
|
||||
// 1. addition of a PNG_CLEANUP macro,
|
||||
// 2. setting the option to ignore ADLER32 checksums,
|
||||
// 3. adding "#include <string.h>" which is needed on some platforms
|
||||
// to provide memcpy().
|
||||
// 4. adding read_end_info() and creating an end_info structure.
|
||||
// 5. adding calls to png_set_*() transforms commonly used by browsers.
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#define PNG_CLEANUP \
|
||||
if(png_handler.png_ptr) \
|
||||
{ \
|
||||
if (png_handler.row_ptr) \
|
||||
png_free(png_handler.png_ptr, png_handler.row_ptr); \
|
||||
if (png_handler.end_info_ptr) \
|
||||
png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
|
||||
&png_handler.end_info_ptr); \
|
||||
else if (png_handler.info_ptr) \
|
||||
png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
|
||||
nullptr); \
|
||||
else \
|
||||
png_destroy_read_struct(&png_handler.png_ptr, nullptr, nullptr); \
|
||||
png_handler.png_ptr = nullptr; \
|
||||
png_handler.row_ptr = nullptr; \
|
||||
png_handler.info_ptr = nullptr; \
|
||||
png_handler.end_info_ptr = nullptr; \
|
||||
}
|
||||
|
||||
struct BufState {
|
||||
const uint8_t* data;
|
||||
size_t bytes_left;
|
||||
};
|
||||
|
||||
struct PngObjectHandler {
|
||||
png_infop info_ptr = nullptr;
|
||||
png_structp png_ptr = nullptr;
|
||||
png_infop end_info_ptr = nullptr;
|
||||
png_voidp row_ptr = nullptr;
|
||||
BufState* buf_state = nullptr;
|
||||
|
||||
~PngObjectHandler() {
|
||||
if (row_ptr)
|
||||
png_free(png_ptr, row_ptr);
|
||||
if (end_info_ptr)
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
|
||||
else if (info_ptr)
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
|
||||
else
|
||||
png_destroy_read_struct(&png_ptr, nullptr, nullptr);
|
||||
delete buf_state;
|
||||
}
|
||||
};
|
||||
|
||||
void user_read_data(png_structp png_ptr, png_bytep data, size_t length) {
|
||||
BufState* buf_state = static_cast<BufState*>(png_get_io_ptr(png_ptr));
|
||||
if (length > buf_state->bytes_left) {
|
||||
png_error(png_ptr, "read error");
|
||||
}
|
||||
memcpy(data, buf_state->data, length);
|
||||
buf_state->bytes_left -= length;
|
||||
buf_state->data += length;
|
||||
}
|
||||
|
||||
void* limited_malloc(png_structp, png_alloc_size_t size) {
|
||||
// libpng may allocate large amounts of memory that the fuzzer reports as
|
||||
// an error. In order to silence these errors, make libpng fail when trying
|
||||
// to allocate a large amount. This allocator used to be in the Chromium
|
||||
// version of this fuzzer.
|
||||
// This number is chosen to match the default png_user_chunk_malloc_max.
|
||||
if (size > 8000000)
|
||||
return nullptr;
|
||||
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void default_free(png_structp, png_voidp ptr) {
|
||||
return free(ptr);
|
||||
}
|
||||
|
||||
static const int kPngHeaderSize = 8;
|
||||
|
||||
// Entry point for LibFuzzer.
|
||||
// Roughly follows the libpng book example:
|
||||
// http://www.libpng.org/pub/png/book/chapter13.html
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
if (size < kPngHeaderSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<unsigned char> v(data, data + size);
|
||||
if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
|
||||
// not a PNG.
|
||||
return 0;
|
||||
}
|
||||
|
||||
PngObjectHandler png_handler;
|
||||
png_handler.png_ptr = nullptr;
|
||||
png_handler.row_ptr = nullptr;
|
||||
png_handler.info_ptr = nullptr;
|
||||
png_handler.end_info_ptr = nullptr;
|
||||
|
||||
png_handler.png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
|
||||
if (!png_handler.png_ptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_handler.info_ptr = png_create_info_struct(png_handler.png_ptr);
|
||||
if (!png_handler.info_ptr) {
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_handler.end_info_ptr = png_create_info_struct(png_handler.png_ptr);
|
||||
if (!png_handler.end_info_ptr) {
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Use a custom allocator that fails for large allocations to avoid OOM.
|
||||
png_set_mem_fn(png_handler.png_ptr, nullptr, limited_malloc, default_free);
|
||||
|
||||
png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
|
||||
#ifdef PNG_IGNORE_ADLER32
|
||||
png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
|
||||
#endif
|
||||
|
||||
// Setting up reading from buffer.
|
||||
png_handler.buf_state = new BufState();
|
||||
png_handler.buf_state->data = data + kPngHeaderSize;
|
||||
png_handler.buf_state->bytes_left = size - kPngHeaderSize;
|
||||
png_set_read_fn(png_handler.png_ptr, png_handler.buf_state, user_read_data);
|
||||
png_set_sig_bytes(png_handler.png_ptr, kPngHeaderSize);
|
||||
|
||||
if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Reading.
|
||||
png_read_info(png_handler.png_ptr, png_handler.info_ptr);
|
||||
|
||||
// reset error handler to put png_deleter into scope.
|
||||
if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_uint_32 width, height;
|
||||
int bit_depth, color_type, interlace_type, compression_type;
|
||||
int filter_type;
|
||||
|
||||
if (!png_get_IHDR(png_handler.png_ptr, png_handler.info_ptr, &width,
|
||||
&height, &bit_depth, &color_type, &interlace_type,
|
||||
&compression_type, &filter_type)) {
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This is going to be too slow.
|
||||
if (width && height > 100000000 / width) {
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set several transforms that browsers typically use:
|
||||
png_set_gray_to_rgb(png_handler.png_ptr);
|
||||
png_set_expand(png_handler.png_ptr);
|
||||
png_set_packing(png_handler.png_ptr);
|
||||
png_set_scale_16(png_handler.png_ptr);
|
||||
png_set_tRNS_to_alpha(png_handler.png_ptr);
|
||||
|
||||
int passes = png_set_interlace_handling(png_handler.png_ptr);
|
||||
|
||||
png_read_update_info(png_handler.png_ptr, png_handler.info_ptr);
|
||||
|
||||
png_handler.row_ptr = png_malloc(
|
||||
png_handler.png_ptr, png_get_rowbytes(png_handler.png_ptr,
|
||||
png_handler.info_ptr));
|
||||
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
for (png_uint_32 y = 0; y < height; ++y) {
|
||||
png_read_row(png_handler.png_ptr,
|
||||
static_cast<png_bytep>(png_handler.row_ptr), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
png_read_end(png_handler.png_ptr, png_handler.end_info_ptr);
|
||||
|
||||
PNG_CLEANUP
|
||||
return 0;
|
||||
}
|
||||
2
contrib/oss-fuzz/libpng_read_fuzzer.options
Normal file
2
contrib/oss-fuzz/libpng_read_fuzzer.options
Normal file
@@ -0,0 +1,2 @@
|
||||
[libfuzzer]
|
||||
dict = png.dict
|
||||
39
contrib/oss-fuzz/png.dict
Normal file
39
contrib/oss-fuzz/png.dict
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# AFL dictionary for PNG images
|
||||
# -----------------------------
|
||||
#
|
||||
# Just the basic, standard-originating sections; does not include vendor
|
||||
# extensions.
|
||||
#
|
||||
# Created by Michal Zalewski <lcamtuf@google.com>
|
||||
#
|
||||
|
||||
header_png="\x89PNG\x0d\x0a\x1a\x0a"
|
||||
|
||||
section_IDAT="IDAT"
|
||||
section_IEND="IEND"
|
||||
section_IHDR="IHDR"
|
||||
section_PLTE="PLTE"
|
||||
section_bKGD="bKGD"
|
||||
section_cHRM="cHRM"
|
||||
section_eXIf="eXIf"
|
||||
section_fRAc="fRAc"
|
||||
section_gAMA="gAMA"
|
||||
section_gIFg="gIFg"
|
||||
section_gIFt="gIFt"
|
||||
section_gIFx="gIFx"
|
||||
section_hIST="hIST"
|
||||
section_iCCP="iCCP"
|
||||
section_iTXt="iTXt"
|
||||
section_oFFs="oFFs"
|
||||
section_pCAL="pCAL"
|
||||
section_pHYs="pHYs"
|
||||
section_sBIT="sBIT"
|
||||
section_sCAL="sCAL"
|
||||
section_sPLT="sPLT"
|
||||
section_sRGB="sRGB"
|
||||
section_sTER="sTER"
|
||||
section_tEXt="tEXt"
|
||||
section_tIME="tIME"
|
||||
section_tRNS="tRNS"
|
||||
section_zTXt="zTXt"
|
||||
5
contrib/pngminim/README
Normal file
5
contrib/pngminim/README
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa
|
||||
to build minimal decoder, encoder, and progressive reader applications.
|
||||
|
||||
See the individual README and pngusr.dfa files for more explanation.
|
||||
10
contrib/pngminim/decoder/README
Normal file
10
contrib/pngminim/decoder/README
Normal file
@@ -0,0 +1,10 @@
|
||||
This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa
|
||||
|
||||
The makefile builds a minimal read-only decoder with embedded libpng
|
||||
and zlib.
|
||||
|
||||
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
|
||||
on the make command line.
|
||||
|
||||
If you prefer to use the shared libraries, go to contrib/pngminus
|
||||
and build the png2pnm application there.
|
||||
151
contrib/pngminim/decoder/makefile
Normal file
151
contrib/pngminim/decoder/makefile
Normal file
@@ -0,0 +1,151 @@
|
||||
# Makefile for PngMinus (pngm2pnm)
|
||||
# Linux / Unix
|
||||
|
||||
#CC=cc
|
||||
CC=gcc
|
||||
LD=$(CC)
|
||||
|
||||
# If awk fails try
|
||||
# make AWK=nawk
|
||||
|
||||
# If cpp fails try
|
||||
# make CPP=/lib/cpp
|
||||
|
||||
RM=rm -f
|
||||
COPY=cp
|
||||
|
||||
CPPFLAGS=-I. -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DZ_SOLO -DNO_GZIP
|
||||
CFLAGS=-O1 -Wall
|
||||
|
||||
C=.c
|
||||
O=.o
|
||||
L=.a
|
||||
E=
|
||||
|
||||
# Where to find the source code:
|
||||
PNGSRC =../../..
|
||||
ZLIBSRC=$(PNGSRC)/../zlib
|
||||
PROGSRC=$(PNGSRC)/contrib/pngminus
|
||||
|
||||
# Zlib (minimal inflate requirements - crc32 is used by libpng)
|
||||
# zutil can be eliminated if you provide your own zcalloc and zcfree
|
||||
ZSRCS = adler32$(C) crc32$(C) \
|
||||
inffast$(C) inflate$(C) inftrees$(C) \
|
||||
zutil$(C)
|
||||
|
||||
# Standard headers
|
||||
ZH = zlib.h crc32.h inffast.h inffixed.h \
|
||||
inflate.h inftrees.h zutil.h
|
||||
|
||||
# Machine generated headers
|
||||
ZCONF = zconf.h
|
||||
|
||||
# Headers callers use
|
||||
ZINC = zlib.h $(ZCONF)
|
||||
|
||||
# Headers the Zlib source uses
|
||||
ZHDRS = $(ZH) $(ZCONF)
|
||||
|
||||
ZOBJS = adler32$(O) crc32$(O) \
|
||||
inffast$(O) inflate$(O) inftrees$(O) \
|
||||
zutil$(O)
|
||||
|
||||
# libpng
|
||||
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
|
||||
pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
|
||||
pngset$(C) pngtrans$(C)
|
||||
|
||||
# Standard headers
|
||||
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
|
||||
|
||||
# Machine generated headers
|
||||
PNGCONF=pnglibconf.h
|
||||
|
||||
# Headers callers use
|
||||
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
|
||||
|
||||
# Headers the PNG library uses
|
||||
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
|
||||
|
||||
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
|
||||
pngset$(O) pngtrans$(O)
|
||||
|
||||
PROGSRCS= pngm2pnm$(C)
|
||||
PROGHDRS=
|
||||
PROGDOCS=
|
||||
PROGOBJS= pngm2pnm$(O)
|
||||
|
||||
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
# note: dependencies do not work on implicit rule lines
|
||||
.c$(O):
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
all: pngm2pnm$(E)
|
||||
|
||||
pngm2pnm$(E): $(OBJS)
|
||||
$(LD) -o pngm2pnm$(E) $(OBJS)
|
||||
|
||||
# The DFA_XTRA setting turns all libpng options off then
|
||||
# turns on those required for this minimal build.
|
||||
# The CPP_FLAGS setting causes pngusr.h to be included in
|
||||
# both the build of pnglibconf.h and, subsequently, when
|
||||
# building libpng itself.
|
||||
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak $(ZH)\
|
||||
$(PNGSRC)/scripts/pnglibconf.dfa \
|
||||
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
|
||||
$(RM) pnglibconf.h pnglibconf.dfn
|
||||
$(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
|
||||
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG -I."\
|
||||
DFA_XTRA="pngusr.dfa" $@
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
|
||||
srcdir=$(PNGSRC) clean
|
||||
$(RM) pngm2pnm$(O)
|
||||
$(RM) pngm2pnm$(E)
|
||||
$(RM) $(OBJS)
|
||||
|
||||
# distclean also removes the copied source and headers
|
||||
distclean: clean
|
||||
$(RM) -r scripts # historical reasons
|
||||
$(RM) $(PNGSRCS) $(PNGH)
|
||||
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
|
||||
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
|
||||
|
||||
# Header file dependencies:
|
||||
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
|
||||
$(PNGOBJS): $(PNGHDRS) $(ZINC)
|
||||
$(ZOBJS): $(ZHDRS)
|
||||
|
||||
# Gather the source code from the respective directories
|
||||
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
|
||||
$(RM) $@
|
||||
$(COPY) $(PNGSRC)/$@ $@
|
||||
|
||||
# No dependency on the ZLIBSRC target so that it only needs
|
||||
# to be specified once.
|
||||
$(ZSRCS) $(ZH):
|
||||
$(RM) $@
|
||||
$(COPY) $(ZLIBSRC)/$@ $@
|
||||
|
||||
# The unconfigured zconf.h varies in name according to the
|
||||
# zlib release
|
||||
$(ZCONF):
|
||||
$(RM) $@
|
||||
@for f in zconf.h.in zconf.in.h zconf.h; do\
|
||||
test -r $(ZLIBSRC)/$$f &&\
|
||||
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
|
||||
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
|
||||
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
|
||||
|
||||
pngm2pnm.c: $(PROGSRC)/png2pnm.c
|
||||
$(RM) $@
|
||||
$(COPY) $(PROGSRC)/png2pnm.c $@
|
||||
|
||||
# End of makefile for pngm2pnm
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user