Compare commits
612 Commits
version.2.
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7113c4e3bb | ||
![]() |
b8197de716 | ||
![]() |
b079198838 | ||
![]() |
110d31891b | ||
![]() |
cc0c71c30b | ||
![]() |
5695ac15ff | ||
![]() |
df5e8628f2 | ||
![]() |
b0c0f0ff04 | ||
![]() |
9afc1699f0 | ||
![]() |
34dae137a9 | ||
![]() |
4d5c5e7c48 | ||
![]() |
fac916f72a | ||
![]() |
8715ce2749 | ||
![]() |
045aa4d9f2 | ||
![]() |
da94042481 | ||
![]() |
31d44f0280 | ||
![]() |
3aaeea7ce8 | ||
![]() |
6e7616c83c | ||
![]() |
9a07ccb3d0 | ||
![]() |
f88c9974e2 | ||
![]() |
0954bc11e3 | ||
![]() |
1e69940955 | ||
![]() |
f66e120452 | ||
![]() |
d6d0f070e1 | ||
![]() |
f1f7c53308 | ||
![]() |
893143c8e1 | ||
![]() |
805972f4c8 | ||
![]() |
45ed017b1b | ||
![]() |
b21a8317e5 | ||
![]() |
5fb81d986e | ||
![]() |
48c16b2c19 | ||
![]() |
ab22c5bad5 | ||
![]() |
ef01f18dfc | ||
![]() |
e078172b1c | ||
![]() |
8750e183c6 | ||
![]() |
6c83f1468c | ||
![]() |
acfb307df4 | ||
![]() |
275aad4df8 | ||
![]() |
734d57d5f7 | ||
![]() |
c16bc057ba | ||
![]() |
ea320dab8b | ||
![]() |
d7e6b7de8a | ||
![]() |
ccd9ced49e | ||
![]() |
9f24b078c7 | ||
![]() |
51155950eb | ||
![]() |
23cee22286 | ||
![]() |
4f9abb9a45 | ||
![]() |
4a2a8693e5 | ||
![]() |
1509ccc51f | ||
![]() |
5bb919a30e | ||
![]() |
54874194a8 | ||
![]() |
d2d35bf6c2 | ||
![]() |
b8bd1b0e07 | ||
![]() |
e40c28c2e8 | ||
![]() |
18da6155b2 | ||
![]() |
b3c422654f | ||
![]() |
9db62b2011 | ||
![]() |
7948d83340 | ||
![]() |
132c4a248b | ||
![]() |
ed294598ea | ||
![]() |
fef144283f | ||
![]() |
4c5a1cc825 | ||
![]() |
bd96ed8353 | ||
![]() |
f4a708ba0f | ||
![]() |
2372cb78a0 | ||
![]() |
9d5002f8fd | ||
![]() |
e4c74f5364 | ||
![]() |
cb72c08472 | ||
![]() |
898ca6f522 | ||
![]() |
86698be6e9 | ||
![]() |
cdcb77e796 | ||
![]() |
954dad66de | ||
![]() |
48744a1342 | ||
![]() |
7d3c7a345f | ||
![]() |
69497d35c0 | ||
![]() |
d67cd2220a | ||
![]() |
e3eb0a206d | ||
![]() |
57b216bb58 | ||
![]() |
5fbb8b2645 | ||
![]() |
d4b7f03cfa | ||
![]() |
54179fe1d5 | ||
![]() |
7092f7ea11 | ||
![]() |
107eb31531 | ||
![]() |
8371491a99 | ||
![]() |
956c31d5a6 | ||
![]() |
93f7f90711 | ||
![]() |
1da397e94a | ||
![]() |
31882ad7f4 | ||
![]() |
ba1edf6cd4 | ||
![]() |
23a01dfdef | ||
![]() |
d8fef96f23 | ||
![]() |
c539808d09 | ||
![]() |
426bf8d337 | ||
![]() |
d0babeb6f6 | ||
![]() |
d1ca2b4f29 | ||
![]() |
8ba0de3e45 | ||
![]() |
2e0779e250 | ||
![]() |
e55130d3c5 | ||
![]() |
4d2b6a671a | ||
![]() |
aae066debc | ||
![]() |
6609719b40 | ||
![]() |
1a8318f6c2 | ||
![]() |
162f6199c0 | ||
![]() |
8f9cc62b3f | ||
![]() |
44a499f2ac | ||
![]() |
94cfb1b008 | ||
![]() |
17a0a8a195 | ||
![]() |
ba0cf122f6 | ||
![]() |
da56086e01 | ||
![]() |
04b8cbd27a | ||
![]() |
e1e018a8dc | ||
![]() |
b51d088267 | ||
![]() |
4f11e89c80 | ||
![]() |
9a20f8e8d1 | ||
![]() |
72deb588cb | ||
![]() |
cd77b6003b | ||
![]() |
f40a2ff2ad | ||
![]() |
be42e72d22 | ||
![]() |
15f081c896 | ||
![]() |
ad593c9e06 | ||
![]() |
319fc971fe | ||
![]() |
e166e4a209 | ||
![]() |
29313eb5f1 | ||
![]() |
e982d03966 | ||
![]() |
66fd497765 | ||
![]() |
20789fed4e | ||
![]() |
5947e10ff7 | ||
![]() |
e6881e7527 | ||
![]() |
2296dc9e68 | ||
![]() |
6f2ac3ee36 | ||
![]() |
c559c62853 | ||
![]() |
a9feb9addd | ||
![]() |
74e814358c | ||
![]() |
54393d9e38 | ||
![]() |
06e8dc9edd | ||
![]() |
f5446fdcfb | ||
![]() |
8611d127db | ||
![]() |
889bf16791 | ||
![]() |
6ea2ff0b06 | ||
![]() |
3436c4e9ba | ||
![]() |
e1a93d9e59 | ||
![]() |
a1c0ee9a86 | ||
![]() |
40b5a53d2f | ||
![]() |
e7797b97a1 | ||
![]() |
5e5f6999a8 | ||
![]() |
0069a2bd2f | ||
![]() |
e3100f714c | ||
![]() |
5c5ae1d51a | ||
![]() |
3767af52de | ||
![]() |
1b86fb6f48 | ||
![]() |
a42d03df79 | ||
![]() |
cb33ff43bb | ||
![]() |
6a1974d40d | ||
![]() |
87c0d7dc1e | ||
![]() |
0dd44e7dba | ||
![]() |
9cad6bc1f6 | ||
![]() |
79b1c4cc85 | ||
![]() |
c00ee8bff7 | ||
![]() |
a205f70328 | ||
![]() |
9c5b30005e | ||
![]() |
83e5e2703e | ||
![]() |
3a0253f4e2 | ||
![]() |
99c4f621bd | ||
![]() |
2e4fadf330 | ||
![]() |
8f9905936c | ||
![]() |
a834ab305f | ||
![]() |
51efe91971 | ||
![]() |
4ddc2627dd | ||
![]() |
5d56fb3115 | ||
![]() |
51cbcd5748 | ||
![]() |
f51d52f85a | ||
![]() |
c414d9c238 | ||
![]() |
e5ca873ab1 | ||
![]() |
601aa38c30 | ||
![]() |
fb4be3894e | ||
![]() |
c37d69b25e | ||
![]() |
a77717583e | ||
![]() |
968085190c | ||
![]() |
93a61459cd | ||
![]() |
38ffbbe42e | ||
![]() |
ce26e523dd | ||
![]() |
7dfcbf9d7b | ||
![]() |
4ac509182a | ||
![]() |
0ae66e891a | ||
![]() |
9f78c68953 | ||
![]() |
f080ab8ce0 | ||
![]() |
e975ca2832 | ||
![]() |
b06bed7b7b | ||
![]() |
b7a162348d | ||
![]() |
540aa58f6c | ||
![]() |
d48be27f5a | ||
![]() |
eaf55b677c | ||
![]() |
0967d64854 | ||
![]() |
5799672237 | ||
![]() |
a1fc83cc25 | ||
![]() |
ad7eb5630e | ||
![]() |
4831badeb4 | ||
![]() |
80be580d50 | ||
![]() |
05b3afd28f | ||
![]() |
e1122a8f50 | ||
![]() |
f9d47e28b9 | ||
![]() |
8034ffde8b | ||
![]() |
b3a15954f6 | ||
![]() |
83249c318f | ||
![]() |
b1a8e1adcb | ||
![]() |
ee04854e1a | ||
![]() |
b3c581760f | ||
![]() |
bd3959dc77 | ||
![]() |
fd424cfb66 | ||
![]() |
e734f0522a | ||
![]() |
9729405a8f | ||
![]() |
65f78eaa73 | ||
![]() |
08238dbed6 | ||
![]() |
c8d03fea9b | ||
![]() |
6721f8a53f | ||
![]() |
54a5860ee2 | ||
![]() |
372fead0d7 | ||
![]() |
98324bbd6b | ||
![]() |
522d13af2a | ||
![]() |
26dcb7c125 | ||
![]() |
51a67a9cbf | ||
![]() |
dd81b5892d | ||
![]() |
0cd240e2e3 | ||
![]() |
dac03fd168 | ||
![]() |
d02bf257a6 | ||
![]() |
0f1b1c63b4 | ||
![]() |
11a27e6d20 | ||
![]() |
ab8929262a | ||
![]() |
813121e688 | ||
![]() |
7a7901cd6d | ||
![]() |
c5a8732b0e | ||
![]() |
101a0034e2 | ||
![]() |
2c8ba10cc9 | ||
![]() |
30a0180d84 | ||
![]() |
99c4376aed | ||
![]() |
c3493063b9 | ||
![]() |
4042210416 | ||
![]() |
dc869c2985 | ||
![]() |
caeb91121a | ||
![]() |
891e7c298a | ||
![]() |
d60937922f | ||
![]() |
229d9cdb9c | ||
![]() |
f0a980ec16 | ||
![]() |
cc9bf1d557 | ||
![]() |
a01f7cdee0 | ||
![]() |
d753441028 | ||
![]() |
53d7f70c15 | ||
![]() |
70a16d80d9 | ||
![]() |
4560d270e0 | ||
![]() |
f33f50126c | ||
![]() |
8d2019ae73 | ||
![]() |
cf6db1641a | ||
![]() |
9df5546838 | ||
![]() |
b816ac185b | ||
![]() |
d92c2b2117 | ||
![]() |
d035952c52 | ||
![]() |
1ed6ede703 | ||
![]() |
d03c4770cb | ||
![]() |
50b561e911 | ||
![]() |
2d410fc74b | ||
![]() |
d5c460fc5f | ||
![]() |
62006e2b26 | ||
![]() |
d05b19072d | ||
![]() |
32ac092dec | ||
![]() |
27102f0b06 | ||
![]() |
87d44603a0 | ||
![]() |
74f71ec923 | ||
![]() |
5c3632b00e | ||
![]() |
a4eade843f | ||
![]() |
cba89a62a1 | ||
![]() |
4123c0ba86 | ||
![]() |
1a9cb9aef7 | ||
![]() |
0dc4914b4e | ||
![]() |
e224dee4b8 | ||
![]() |
d2ddf006a6 | ||
![]() |
a7ae153a46 | ||
![]() |
de0a9ed103 | ||
![]() |
553714a87a | ||
![]() |
1b2ebfc69a | ||
![]() |
3259fe2ff8 | ||
![]() |
bbef2a9da3 | ||
![]() |
5b6ff103bd | ||
![]() |
c86827952f | ||
![]() |
9b437b0c6a | ||
![]() |
c8ae3c5225 | ||
![]() |
07f65540b5 | ||
![]() |
8414870ca7 | ||
![]() |
2dab5fed59 | ||
![]() |
26b2728c49 | ||
![]() |
e526d435cc | ||
![]() |
f8c8222660 | ||
![]() |
d6b51b7041 | ||
![]() |
987f96004f | ||
![]() |
0b6a592372 | ||
![]() |
83c9e0b1f2 | ||
![]() |
db23831d57 | ||
![]() |
0cfe2ca4a9 | ||
![]() |
cf352af089 | ||
![]() |
c59f464a3f | ||
![]() |
05235963d9 | ||
![]() |
99fc1ab306 | ||
![]() |
f7dbcf1512 | ||
![]() |
838dfb8058 | ||
![]() |
4da7e9617f | ||
![]() |
b9ca882749 | ||
![]() |
f9df8ba19a | ||
![]() |
09c35dcb84 | ||
![]() |
f82d7f3a63 | ||
![]() |
faf63fddad | ||
![]() |
281537851b | ||
![]() |
55dbf8acff | ||
![]() |
c16c91797f | ||
![]() |
a4e93c3b0a | ||
![]() |
4bb5e24d23 | ||
![]() |
6cb56b36f6 | ||
![]() |
9c911c0e1e | ||
![]() |
3ea4486bed | ||
![]() |
6e11b55441 | ||
![]() |
c6b2fdf572 | ||
![]() |
700f8cb4f8 | ||
![]() |
7d32f11a6f | ||
![]() |
b4e8a425ae | ||
![]() |
c8a3117659 | ||
![]() |
49cbc11a19 | ||
![]() |
3d295431e6 | ||
![]() |
c08bd89739 | ||
![]() |
1621df453d | ||
![]() |
0b611c5250 | ||
![]() |
b8ba5a8357 | ||
![]() |
9add0fe298 | ||
![]() |
ecb00ea4e4 | ||
![]() |
cde7423958 | ||
![]() |
6c157b60f2 | ||
![]() |
fc131a1339 | ||
![]() |
4f157f3cf0 | ||
![]() |
41730e8cc6 | ||
![]() |
82c238f504 | ||
![]() |
52c36b4955 | ||
![]() |
b7069ce2b2 | ||
![]() |
cc2ae75450 | ||
![]() |
b97aadcf3e | ||
![]() |
1e2dcaf7b3 | ||
![]() |
175eceb020 | ||
![]() |
7981908754 | ||
![]() |
9258f8f6a7 | ||
![]() |
41a96aee5a | ||
![]() |
897d2c0b75 | ||
![]() |
e3579b6c1d | ||
![]() |
8d46ac19ff | ||
![]() |
4b02d246a4 | ||
![]() |
47b7b2787b | ||
![]() |
c31a28fcd1 | ||
![]() |
cd10f46572 | ||
![]() |
29ce132df4 | ||
![]() |
5d953558de | ||
![]() |
bac2c9e0a3 | ||
![]() |
ee0f313848 | ||
![]() |
ccdce606f1 | ||
![]() |
d7d9f84707 | ||
![]() |
4cde646cd7 | ||
![]() |
5f02757eef | ||
![]() |
4f5ec07c31 | ||
![]() |
0a27667878 | ||
![]() |
66d890bf22 | ||
![]() |
dd00120e96 | ||
![]() |
e71247bb90 | ||
![]() |
a024980007 | ||
![]() |
dc46d267f0 | ||
![]() |
c32809d464 | ||
![]() |
5be56d582c | ||
![]() |
bd291ae5a8 | ||
![]() |
f1ba09f690 | ||
![]() |
4eabbc8661 | ||
![]() |
e4be47279d | ||
![]() |
29c644ec49 | ||
![]() |
940100c28a | ||
![]() |
c31fb68ccc | ||
![]() |
15d07f33d1 | ||
![]() |
c5dd6035c9 | ||
![]() |
2eb97a851d | ||
![]() |
8a95efcd3f | ||
![]() |
38770403d4 | ||
![]() |
589cc547b9 | ||
![]() |
a521472427 | ||
![]() |
d4ac2f613d | ||
![]() |
fa9142b7e4 | ||
![]() |
f98df1c715 | ||
![]() |
3109759fd7 | ||
![]() |
0a4ac0852a | ||
![]() |
dc34a6cc8c | ||
![]() |
238f4419ab | ||
![]() |
60301842c7 | ||
![]() |
acbb297a0a | ||
![]() |
4fc1073809 | ||
![]() |
7c688c3453 | ||
![]() |
372c887aad | ||
![]() |
0df90afdf7 | ||
![]() |
75a33de3bc | ||
![]() |
f026c0541e | ||
![]() |
e4735c703d | ||
![]() |
ae7953849b | ||
![]() |
1947323329 | ||
![]() |
c3d9719cd4 | ||
![]() |
2263b6bacc | ||
![]() |
5b66156be4 | ||
![]() |
b0035538af | ||
![]() |
45ccf501f0 | ||
![]() |
15e4168ee2 | ||
![]() |
2452bb7c45 | ||
![]() |
85904a3291 | ||
![]() |
012f22958a | ||
![]() |
f3dad25c77 | ||
![]() |
e6cf1744d4 | ||
![]() |
db9b3400e5 | ||
![]() |
c423cc84e7 | ||
![]() |
d87de3a88d | ||
![]() |
6007ac5c56 | ||
![]() |
335e972554 | ||
![]() |
8c4afeff40 | ||
![]() |
ffd9db9700 | ||
![]() |
b190a91ab5 | ||
![]() |
f6843d5511 | ||
![]() |
a56819eaab | ||
![]() |
d6f2d26430 | ||
![]() |
9ac3a1572e | ||
![]() |
0905cab40a | ||
![]() |
2fc9d4956a | ||
![]() |
28c6f54798 | ||
![]() |
2c7dab7655 | ||
![]() |
96ae1b8dfc | ||
![]() |
1bbb607069 | ||
![]() |
fd1f7cf297 | ||
![]() |
5bb074611a | ||
![]() |
46c1dd22fc | ||
![]() |
06f6911d7b | ||
![]() |
ae4799ad07 | ||
![]() |
b88025b38f | ||
![]() |
b59085db0c | ||
![]() |
8048bbc7a2 | ||
![]() |
d1591be3d7 | ||
![]() |
6b7ad74e26 | ||
![]() |
635a358962 | ||
![]() |
8f798864a9 | ||
![]() |
ac9fb5a302 | ||
![]() |
775ee87776 | ||
![]() |
0b1f8eb6f7 | ||
![]() |
c887df12a3 | ||
![]() |
d1b053afe2 | ||
![]() |
5e1474cc92 | ||
![]() |
dc43ebf96c | ||
![]() |
a7060dae1c | ||
![]() |
ba05549b0f | ||
![]() |
fb0e397330 | ||
![]() |
35ddb3abc7 | ||
![]() |
237ddd72f1 | ||
![]() |
c999b6c0f0 | ||
![]() |
4e0de649bd | ||
![]() |
6b0a8e3a0f | ||
![]() |
eadfad7a50 | ||
![]() |
14361eee24 | ||
![]() |
c9e231508b | ||
![]() |
6347686385 | ||
![]() |
1a8f929111 | ||
![]() |
56d3f5af6e | ||
![]() |
c665e81a39 | ||
![]() |
c6c49865fe | ||
![]() |
52d27be5c2 | ||
![]() |
6e0118231a | ||
![]() |
da3786d2d1 | ||
![]() |
8d770ece9a | ||
![]() |
0a0cb190da | ||
![]() |
79b079bdc0 | ||
![]() |
dbb67194b2 | ||
![]() |
c255e0140c | ||
![]() |
2bd6aa54d6 | ||
![]() |
c7535d084e | ||
![]() |
c0d7afe15c | ||
![]() |
6def7e38b4 | ||
![]() |
73881d0e52 | ||
![]() |
e3291c4e1f | ||
![]() |
0fa5a17c98 | ||
![]() |
757f9394bf | ||
![]() |
daed8cc919 | ||
![]() |
d1a941ea50 | ||
![]() |
00a47c1e06 | ||
![]() |
1fb24aba4b | ||
![]() |
2d24b6000d | ||
![]() |
8b5e2a5143 | ||
![]() |
3ed5858902 | ||
![]() |
7a8cdc4bb0 | ||
![]() |
4c0ed02806 | ||
![]() |
5d00b719f4 | ||
![]() |
42132ed6b5 | ||
![]() |
31f5efe453 | ||
![]() |
78a7762e3f | ||
![]() |
33f52fb611 | ||
![]() |
81abe5b3bb | ||
![]() |
4a09296771 | ||
![]() |
6922124c4c | ||
![]() |
59b844347c | ||
![]() |
bde5ba6ae8 | ||
![]() |
16240e21f9 | ||
![]() |
33a0e66eb1 | ||
![]() |
f7ff08de5a | ||
![]() |
f1bae45c76 | ||
![]() |
65c07b42e3 | ||
![]() |
3888daac6a | ||
![]() |
e966fef3eb | ||
![]() |
a504edf724 | ||
![]() |
dde788b59e | ||
![]() |
58fc86452d | ||
![]() |
c0cb119c0e | ||
![]() |
9a21e1eef0 | ||
![]() |
a0688a9874 | ||
![]() |
d0ce2ced53 | ||
![]() |
e05d2901ec | ||
![]() |
c0710f557c | ||
![]() |
f095027329 | ||
![]() |
8d320bbdf8 | ||
![]() |
776b83ddbc | ||
![]() |
04ace2a558 | ||
![]() |
46afb746f0 | ||
![]() |
570dd13f55 | ||
![]() |
63f877769c | ||
![]() |
04c6bb4a72 | ||
![]() |
131cc98491 | ||
![]() |
13bcb63b73 | ||
![]() |
0ba5d15b58 | ||
![]() |
7e38446075 | ||
![]() |
548aff34f4 | ||
![]() |
8397eac382 | ||
![]() |
a2c2d86d3d | ||
![]() |
3bc360fc9d | ||
![]() |
ae1da37558 | ||
![]() |
f57f59b10d | ||
![]() |
b65e3ebdb6 | ||
![]() |
50acc339c5 | ||
![]() |
f123ce8f8a | ||
![]() |
c3629e37a2 | ||
![]() |
cf5153c518 | ||
![]() |
3b7dced8e6 | ||
![]() |
03a410e03d | ||
![]() |
0a6eaaa605 | ||
![]() |
7f8f284ee5 | ||
![]() |
09fb8b6989 | ||
![]() |
9e6c62199a | ||
![]() |
d47f7a249d | ||
![]() |
7280263988 | ||
![]() |
3e1fad2da4 | ||
![]() |
d72940c56b | ||
![]() |
ad4fad0965 | ||
![]() |
aff9cb39ed | ||
![]() |
0a3f234df7 | ||
![]() |
efb70af001 | ||
![]() |
e65303b903 | ||
![]() |
413de4fbfa | ||
![]() |
984351f86f | ||
![]() |
f8796711e8 | ||
![]() |
0b540067b1 | ||
![]() |
3df347eded | ||
![]() |
eb7c6d295a | ||
![]() |
f126eb0d41 | ||
![]() |
7256e43c48 | ||
![]() |
a0a3af1dee | ||
![]() |
48832d944f | ||
![]() |
06bd61b571 | ||
![]() |
a1c754c737 | ||
![]() |
fef1276901 | ||
![]() |
45f33cdbd6 | ||
![]() |
1acfa211ae | ||
![]() |
2f3fd1194e | ||
![]() |
f08af3ed82 | ||
![]() |
2720a1a405 | ||
![]() |
31fd8d3fe8 | ||
![]() |
6868ee373e | ||
![]() |
b9a247b559 | ||
![]() |
50a205d20f | ||
![]() |
b0072bf658 | ||
![]() |
2c810567dd | ||
![]() |
0a1a29a7fe | ||
![]() |
7d21871ed8 | ||
![]() |
a38b97fae0 | ||
![]() |
45313a8dfa | ||
![]() |
b08135e7c1 | ||
![]() |
4bac8488df | ||
![]() |
de04302c15 | ||
![]() |
997758f91c | ||
![]() |
763214f7c0 | ||
![]() |
77e8dad503 | ||
![]() |
1758445a75 | ||
![]() |
7a77a8047d | ||
![]() |
d8767cbcb7 | ||
![]() |
7924d3a456 | ||
![]() |
ec84bafcd8 | ||
![]() |
08c09b74cf | ||
![]() |
7aece5e8e7 | ||
![]() |
8d93eae64a | ||
![]() |
9a3d660d1b | ||
![]() |
7199d9b5d3 | ||
![]() |
d19a4ab676 | ||
![]() |
f105cb5471 | ||
![]() |
4db4198722 | ||
![]() |
616a3345c4 | ||
![]() |
1f8d84a562 | ||
![]() |
a54d757a3e | ||
![]() |
b5eb374fb9 | ||
![]() |
f1d69068c7 | ||
![]() |
ee130e2306 | ||
![]() |
9ba6bc6042 | ||
![]() |
5e1a0fad08 | ||
![]() |
c05118dc49 | ||
![]() |
1adf89d5d2 |
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
# Ignore files and directories made by `cmake .`.
|
||||
CMakeFiles/
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
/CMakeCache.txt
|
||||
/CPackConfig.cmake
|
||||
/CPackSourceConfig.cmake
|
||||
/CTestCustom.cmake
|
||||
/LICENSE.txt
|
||||
/OpenJPEGConfig.cmake
|
||||
/libopenjp2.pc
|
||||
/src/bin/common/opj_apps_config.h
|
||||
/src/lib/openjp2/opj_config.h
|
||||
/src/lib/openjp2/opj_config_private.h
|
||||
|
||||
# Ignore directories made by `make`.
|
||||
/bin/
|
93
.travis.yml
Normal file
93
.travis.yml
Normal file
@ -0,0 +1,93 @@
|
||||
language: c
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_NUM_THREADS=2
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-multilib
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1
|
||||
- os: linux
|
||||
compiler: clang-3.8
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-precise-3.8
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- clang-3.8
|
||||
- os: linux
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-x86-64
|
||||
- gcc-mingw-w64-x86-64
|
||||
- gcc-mingw-w64
|
||||
- os: linux
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-i686
|
||||
- gcc-mingw-w64-i686
|
||||
- gcc-mingw-w64
|
||||
- os: linux
|
||||
compiler: gcc-4.8
|
||||
env: OPJ_CI_ABI_CHECK=1
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-4.8
|
||||
- libelf-dev
|
||||
- elfutils
|
||||
- texinfo
|
||||
- exuberant-ctags
|
||||
|
||||
install:
|
||||
- ./tools/travis-ci/install.sh
|
||||
|
||||
script:
|
||||
- ./tools/travis-ci/run.sh
|
||||
- ./tools/travis-ci/abi-check.sh
|
||||
|
||||
before_deploy:
|
||||
- export OPJ_RELEASE_PKG_FILE=$(ls build/openjpeg-${TRAVIS_TAG}*)
|
||||
- echo "deploying $OPJ_RELEASE_PKG_FILE to GitHub releases"
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: Npi13uOffALCVNwea4p4q8v85Lo/WsRqaeZQcWrAkt8MxRnfvWQtmnuwmHnVB6Cig+T1lVUHrklOaJIApIb6nkGq3CS/9bD8+SCS2NEdAAP/QYWnBi0ubWXVMRyDLypmwRpzLNSZ0xLYGFUl2PjieZYKRcz1dd/J7S+FnXhPtdjXweq0FS63zTcMe7ggjfmzSOWUCEFmMjZPaM0Be+3PweieCO1dxlHuy7ugCkx2S7d+5hNsicIhQmTADjqtJAkHoMhYqu6/yLFxhjO/+f938PATFULdODTvjCsUwdN/ySWi1Oj4uPAntfytZP7H6YrzLh8dS73QCsdkhhDJIgJskHIBSbRyyEVUnOvQgD9VaBVGHtc1KtZQTwc41OUO3BGPHl97s3oX6bqWqo/L53dB3TPHGx+1+2HL/F0zaDZuHhAKMkPwe8LFPMPB/ur65zXMHjnWb2ZTVVdoIvkbQ7nu8ApI60ejxocYBsEyAuC2CPXU2ki4jdEhm0E1hIziWNE9/LTuM17ziQuJ6WpXOSMrfP4o5aVDmLp5ZGBSocrspOksgyI9XogHaO/r+Y6N3exy+giObFfMHkZVUpsKrKmtOJ7TC1Vg5HsYGlWW8RN8dkJV47bUXm9K4sMos9eYMUt/czykPAs+132cogpII3QxXpFZQqZg6SEPVfOiyqQzTUI=
|
||||
file_glob: true
|
||||
file: "${OPJ_RELEASE_PKG_FILE}"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: uclouvain/openjpeg
|
||||
tags: true
|
||||
condition: "$OPJ_CI_INCLUDE_IF_DEPLOY = 1"
|
||||
|
15
AUTHORS
15
AUTHORS
@ -1,15 +0,0 @@
|
||||
Authors of OpenJPEG
|
||||
See also the files THANKS and CHANGES
|
||||
|
||||
David Janssens designed and implemented the first version of OpenJPEG.
|
||||
Kaori Hagihara designed and implemented the first version of OpenJPIP.
|
||||
Jerome Fimes implemented the alpha version of OpenJPEG v2.
|
||||
Giuseppe Baruffa added the JPWL functionalities.
|
||||
Mickaël Savinaud implemented the final OpenJPEG v2 version based on a big merge between 1.5 version and alpha version of v2.
|
||||
Mathieu Malaterre participate to the OpenJPEG v2 version and release the OpenJPEG 1.5 and 1.5.1 version.
|
||||
Yannick Verschueren,
|
||||
Herve Drolon,
|
||||
Francois-Olivier Devaux,
|
||||
Antonin Descampe
|
||||
improved the libraries and utilities.
|
||||
|
21
AUTHORS.md
Normal file
21
AUTHORS.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Authors of OpenJPEG
|
||||
See also [THANKS](https://github.com/uclouvain/openjpeg/blob/master/THANKS.md)
|
||||
|
||||
David Janssens designed and implemented the first version of OpenJPEG.
|
||||
|
||||
Kaori Hagihara designed and implemented the first version of OpenJPIP.
|
||||
|
||||
Jerome Fimes implemented the alpha version of OpenJPEG 2.0.
|
||||
|
||||
Giuseppe Baruffa added the JPWL functionalities.
|
||||
|
||||
Mickaël Savinaud implemented the final OpenJPEG 2.0 version based on a big merge between 1.5 version and alpha version of 2.0.
|
||||
|
||||
Mathieu Malaterre participated to the OpenJPEG 2.0 version and improved the libraries and utilities.
|
||||
|
||||
Yannick Verschueren,
|
||||
Herve Drolon,
|
||||
Francois-Olivier Devaux,
|
||||
Antonin Descampe
|
||||
improved the libraries and utilities.
|
||||
|
446
CHANGELOG.md
Normal file
446
CHANGELOG.md
Normal file
@ -0,0 +1,446 @@
|
||||
# Changelog
|
||||
|
||||
## [v2.1.2](https://github.com/uclouvain/openjpeg/releases/v2.1.2) (2016-09-28)
|
||||
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.1.1...v2.1.2)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- null ptr dereference in convert.c:1331 [\#843](https://github.com/uclouvain/openjpeg/issues/843)
|
||||
- Out-of-Bounds Read in function bmp24toimage of convertbmp.c [\#833](https://github.com/uclouvain/openjpeg/issues/833)
|
||||
- Disable automatic compilation of t1\_generate\_luts in CMakeLists.txt [\#831](https://github.com/uclouvain/openjpeg/issues/831)
|
||||
- CVE-2016-7163 Integer overflow in opj\_pi\_create\_decode [\#826](https://github.com/uclouvain/openjpeg/issues/826)
|
||||
- Security Advisory for OpenJPEG [\#810](https://github.com/uclouvain/openjpeg/issues/810)
|
||||
- Add dashboard with static lib [\#804](https://github.com/uclouvain/openjpeg/issues/804)
|
||||
- hidden visibility for the static library / building with -DOPJ\_STATIC against shared lib [\#802](https://github.com/uclouvain/openjpeg/issues/802)
|
||||
- Optimization when building library from source [\#799](https://github.com/uclouvain/openjpeg/issues/799)
|
||||
- unsigned int16 on Solaris 11.2/sparc [\#796](https://github.com/uclouvain/openjpeg/issues/796)
|
||||
- appveyor [\#793](https://github.com/uclouvain/openjpeg/issues/793)
|
||||
- Please make a new release [\#782](https://github.com/uclouvain/openjpeg/issues/782)
|
||||
- FFMpeg will not link to 2.1.1 release built as shared library [\#766](https://github.com/uclouvain/openjpeg/issues/766)
|
||||
- API change since v2: opj\_event\_mgr\_t not available [\#754](https://github.com/uclouvain/openjpeg/issues/754)
|
||||
- openjpeg.h needs dependencies [\#673](https://github.com/uclouvain/openjpeg/issues/673)
|
||||
- "master" does not build on ubuntu [\#658](https://github.com/uclouvain/openjpeg/issues/658)
|
||||
- Package 'openjp2', required by 'libopenjpip', not found [\#594](https://github.com/uclouvain/openjpeg/issues/594)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix PNM file reading [\#847](https://github.com/uclouvain/openjpeg/pull/847) ([mayeut](https://github.com/mayeut))
|
||||
- Fix some issues reported by Coverity Scan [\#846](https://github.com/uclouvain/openjpeg/pull/846) ([stweil](https://github.com/stweil))
|
||||
- Fix potential out-of-bounds read \(coverity\) [\#844](https://github.com/uclouvain/openjpeg/pull/844) ([stweil](https://github.com/stweil))
|
||||
- Remove TODO for overflow check [\#842](https://github.com/uclouvain/openjpeg/pull/842) ([mayeut](https://github.com/mayeut))
|
||||
- Add overflow checks for opj\_aligned\_malloc [\#841](https://github.com/uclouvain/openjpeg/pull/841) ([mayeut](https://github.com/mayeut))
|
||||
- Flags in T1 shall be unsigned [\#840](https://github.com/uclouvain/openjpeg/pull/840) ([mayeut](https://github.com/mayeut))
|
||||
- Fix some warnings [\#838](https://github.com/uclouvain/openjpeg/pull/838) ([mayeut](https://github.com/mayeut))
|
||||
- Fix issue 833. [\#834](https://github.com/uclouvain/openjpeg/pull/834) ([trylab](https://github.com/trylab))
|
||||
- Add overflow checks for opj\_aligned\_malloc [\#832](https://github.com/uclouvain/openjpeg/pull/832) ([mayeut](https://github.com/mayeut))
|
||||
- Add test for issue 820 [\#829](https://github.com/uclouvain/openjpeg/pull/829) ([mayeut](https://github.com/mayeut))
|
||||
- Add test for issue 826 [\#827](https://github.com/uclouvain/openjpeg/pull/827) ([mayeut](https://github.com/mayeut))
|
||||
- Fix coverity 113065 \(CWE-484\) [\#824](https://github.com/uclouvain/openjpeg/pull/824) ([mayeut](https://github.com/mayeut))
|
||||
- Add sanity check for tile coordinates [\#823](https://github.com/uclouvain/openjpeg/pull/823) ([mayeut](https://github.com/mayeut))
|
||||
- Add test for PR 818 [\#822](https://github.com/uclouvain/openjpeg/pull/822) ([mayeut](https://github.com/mayeut))
|
||||
- Update to libpng 1.6.25 [\#821](https://github.com/uclouvain/openjpeg/pull/821) ([mayeut](https://github.com/mayeut))
|
||||
- CVE-2016-8332: fix incrementing of "l\_tcp-\>m\_nb\_mcc\_records" in opj\_j2k\_read\_mcc [\#820](https://github.com/uclouvain/openjpeg/pull/820) ([mayeut](https://github.com/mayeut))
|
||||
- Add overflow check in opj\_tcd\_init\_tile [\#819](https://github.com/uclouvain/openjpeg/pull/819) ([mayeut](https://github.com/mayeut))
|
||||
- Fix leak & invalid behavior of opj\_jp2\_read\_ihdr [\#818](https://github.com/uclouvain/openjpeg/pull/818) ([mayeut](https://github.com/mayeut))
|
||||
- Add overflow check in opj\_j2k\_update\_image\_data [\#817](https://github.com/uclouvain/openjpeg/pull/817) ([mayeut](https://github.com/mayeut))
|
||||
- Change 'restrict' define to 'OPJ\_RESTRICT' [\#816](https://github.com/uclouvain/openjpeg/pull/816) ([mayeut](https://github.com/mayeut))
|
||||
- Switch to clang 3.8 [\#814](https://github.com/uclouvain/openjpeg/pull/814) ([mayeut](https://github.com/mayeut))
|
||||
- Fix an integer overflow issue [\#809](https://github.com/uclouvain/openjpeg/pull/809) ([trylab](https://github.com/trylab))
|
||||
- Update to lcms 2.8 [\#808](https://github.com/uclouvain/openjpeg/pull/808) ([mayeut](https://github.com/mayeut))
|
||||
- Update to libpng 1.6.24 [\#807](https://github.com/uclouvain/openjpeg/pull/807) ([mayeut](https://github.com/mayeut))
|
||||
- Reenable clang-3.9 build on travis [\#806](https://github.com/uclouvain/openjpeg/pull/806) ([mayeut](https://github.com/mayeut))
|
||||
- Bit fields type [\#805](https://github.com/uclouvain/openjpeg/pull/805) ([smuehlst](https://github.com/smuehlst))
|
||||
- Add compilation test for standalone inclusion of openjpeg.h [\#798](https://github.com/uclouvain/openjpeg/pull/798) ([mayeut](https://github.com/mayeut))
|
||||
- jpwl: Remove non-portable data type u\_int16\_t \(fix issue \#796\) [\#797](https://github.com/uclouvain/openjpeg/pull/797) ([stweil](https://github.com/stweil))
|
||||
- Fix dependency for pkg-config \(issue \#594\) [\#795](https://github.com/uclouvain/openjpeg/pull/795) ([stweil](https://github.com/stweil))
|
||||
- Add .gitignore [\#787](https://github.com/uclouvain/openjpeg/pull/787) ([stweil](https://github.com/stweil))
|
||||
|
||||
## [v2.1.1](https://github.com/uclouvain/openjpeg/releases/tag/v2.1.1) (2016-07-05)
|
||||
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.1...v2.1.1)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- opj\_malloc replacement [\#625](https://github.com/uclouvain/openjpeg/issues/625)
|
||||
- backport "-p" and "-force-rgb" options in 1.5 [\#606](https://github.com/uclouvain/openjpeg/issues/606)
|
||||
- Use travis-ci matrix build [\#581](https://github.com/uclouvain/openjpeg/issues/581)
|
||||
- Add Coverity Scan analysis [\#580](https://github.com/uclouvain/openjpeg/issues/580)
|
||||
- Unnecessary rate distortion calculations [\#479](https://github.com/uclouvain/openjpeg/issues/479)
|
||||
- Add images from various security issues to test suite [\#415](https://github.com/uclouvain/openjpeg/issues/415)
|
||||
- Coding speed for 9/7 on 32bits platforms \(x86/ARM\) can be improved with a quick fix [\#220](https://github.com/uclouvain/openjpeg/issues/220)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Out-of-Bounds Access in function opj\_tgt\_reset of tgt.c [\#775](https://github.com/uclouvain/openjpeg/issues/775)
|
||||
- Heap Buffer Overflow in function color\_cmyk\_to\_rgb of color.c [\#774](https://github.com/uclouvain/openjpeg/issues/774)
|
||||
- division-by-zero \(SIGFPE\) error in opj\_tcd\_init\_tile function \(line 730 of tcd.c\) [\#733](https://github.com/uclouvain/openjpeg/issues/733)
|
||||
- Out-Of-Bounds Read in sycc422\_to\_rgb function [\#726](https://github.com/uclouvain/openjpeg/issues/726)
|
||||
- Heap Corruption in opj\_free function [\#725](https://github.com/uclouvain/openjpeg/issues/725)
|
||||
- Out-Of-Bounds Read in opj\_tcd\_free\_tile function [\#724](https://github.com/uclouvain/openjpeg/issues/724)
|
||||
- Cannot handle box of undefined size [\#653](https://github.com/uclouvain/openjpeg/issues/653)
|
||||
- Compilation fails without platform-supplied aligned malloc [\#642](https://github.com/uclouvain/openjpeg/issues/642)
|
||||
- HP compiler warns about redeclaration of static function [\#640](https://github.com/uclouvain/openjpeg/issues/640)
|
||||
- Implementation-defined behavior of malloc causes different behavior on Linux and AIX [\#635](https://github.com/uclouvain/openjpeg/issues/635)
|
||||
- Build on AIX fails because "opj\_includes.h" is included after system headers [\#633](https://github.com/uclouvain/openjpeg/issues/633)
|
||||
- Compiling with SSE2 on Linux 32-bit causes crashes in OpenJPEG [\#624](https://github.com/uclouvain/openjpeg/issues/624)
|
||||
- Build on AIX fails because of "restrict" pointers [\#620](https://github.com/uclouvain/openjpeg/issues/620)
|
||||
- bug in new tif conversion code [\#609](https://github.com/uclouvain/openjpeg/issues/609)
|
||||
- bin/jp2/convert.c line 1085 Resource leak [\#607](https://github.com/uclouvain/openjpeg/issues/607)
|
||||
- bin/jp2/convert.c memory leak [\#601](https://github.com/uclouvain/openjpeg/issues/601)
|
||||
- Resource leak in opj\_j2k\_create\_cstr\_index in case of failure [\#599](https://github.com/uclouvain/openjpeg/issues/599)
|
||||
- Resource leak in opj\_j2k\_encode in case of failure [\#598](https://github.com/uclouvain/openjpeg/issues/598)
|
||||
- Resource leak in opj\_j2k\_decode\_one\_tile in case of failure [\#597](https://github.com/uclouvain/openjpeg/issues/597)
|
||||
- Resource Leak [\#573](https://github.com/uclouvain/openjpeg/issues/573)
|
||||
- opj\_compress fails to compress lossless on gcc/x86 \(-m32\) [\#571](https://github.com/uclouvain/openjpeg/issues/571)
|
||||
- Use-after-free in opj\_j2k\_write\_mco [\#563](https://github.com/uclouvain/openjpeg/issues/563)
|
||||
- openjpeg-master-2015-07-30 failed to compile on LINUX [\#556](https://github.com/uclouvain/openjpeg/issues/556)
|
||||
- PNG images are always read as RGB\(A\) images [\#536](https://github.com/uclouvain/openjpeg/issues/536)
|
||||
- g4\_colr.j2c not handled properly [\#532](https://github.com/uclouvain/openjpeg/issues/532)
|
||||
- Bigendian: opj\_compress + opj\_decompress fails [\#518](https://github.com/uclouvain/openjpeg/issues/518)
|
||||
- Suspicious code in j2k.c [\#517](https://github.com/uclouvain/openjpeg/issues/517)
|
||||
- Decode times almost double\(!!\) on Visual Studio 2013, 2015 [\#505](https://github.com/uclouvain/openjpeg/issues/505)
|
||||
- opj\_data/input/nonregression/issue226.j2k [\#500](https://github.com/uclouvain/openjpeg/issues/500)
|
||||
- opj\_setup\_encoder always returns true [\#497](https://github.com/uclouvain/openjpeg/issues/497)
|
||||
- Double free in j2k\_read\_ppm\_v3 parsing \(\(presumably invalid\) image. [\#496](https://github.com/uclouvain/openjpeg/issues/496)
|
||||
- Invalid write in opj\_j2k\_update\_image\_data [\#495](https://github.com/uclouvain/openjpeg/issues/495)
|
||||
- Undefined printf format specifier %ud used in code [\#494](https://github.com/uclouvain/openjpeg/issues/494)
|
||||
- Potential double free on malloc failure in opj\_j2k\_copy\_default\_tcp\_and\_create\_tcp\(\) [\#492](https://github.com/uclouvain/openjpeg/issues/492)
|
||||
- Do not link with -ffast-math [\#488](https://github.com/uclouvain/openjpeg/issues/488)
|
||||
- Heap-buffer-overflow in opj\_dwt\_decode [\#486](https://github.com/uclouvain/openjpeg/issues/486)
|
||||
- opj\_dump fails on Windows 7, 64 bits [\#482](https://github.com/uclouvain/openjpeg/issues/482)
|
||||
- SIGSEGV in opj\_j2k\_update\_image\_data via pdfium\_test [\#481](https://github.com/uclouvain/openjpeg/issues/481)
|
||||
- Heap-buffer-overflow in opj\_j2k\_tcp\_destroy [\#477](https://github.com/uclouvain/openjpeg/issues/477)
|
||||
- Invalid image causes write past end of heap buffer [\#476](https://github.com/uclouvain/openjpeg/issues/476)
|
||||
- Assertion `l\_res-\>x0 \>= 0' fails when parsing invalid images [\#475](https://github.com/uclouvain/openjpeg/issues/475)
|
||||
- Bug on opj\_write\_bytes\_BE function [\#472](https://github.com/uclouvain/openjpeg/issues/472)
|
||||
- Refactor j2k\_read\_ppm\_v3 function [\#470](https://github.com/uclouvain/openjpeg/issues/470)
|
||||
- compression: strange precinct dimensions [\#466](https://github.com/uclouvain/openjpeg/issues/466)
|
||||
- \(:- Console message in opj\_decompress -:\) [\#465](https://github.com/uclouvain/openjpeg/issues/465)
|
||||
- opj\_decompress fails to decompress any files [\#463](https://github.com/uclouvain/openjpeg/issues/463)
|
||||
- bio-\>ct is unnecessarily set to zero in opj\_bio\_flush method [\#461](https://github.com/uclouvain/openjpeg/issues/461)
|
||||
- Maximal unsigned short is 65535, not 65536 [\#460](https://github.com/uclouvain/openjpeg/issues/460)
|
||||
- OpenJpeg fails to encode components with different precision properly [\#459](https://github.com/uclouvain/openjpeg/issues/459)
|
||||
- component precision upscaling isn't correct in opj\_decompress [\#458](https://github.com/uclouvain/openjpeg/issues/458)
|
||||
- Multiple precision components won't get encoded to jp2 if 1 component is unsigned 1 bit [\#457](https://github.com/uclouvain/openjpeg/issues/457)
|
||||
- Incorrect code in ../bin/jp2/convert.c, function rawtoimage\_common\(...\) [\#456](https://github.com/uclouvain/openjpeg/issues/456)
|
||||
- \[OpenJPEG-trunk\] opj\_stream\_get\_number\_byte\_left throws assert [\#455](https://github.com/uclouvain/openjpeg/issues/455)
|
||||
- NR-DEC-kodak\_2layers\_lrcp.j2c-31-decode-md5 fails randomly when running tests in parallel [\#454](https://github.com/uclouvain/openjpeg/issues/454)
|
||||
- compare\_raw\_files doesn't report an error on invalid arguments / missing input files [\#453](https://github.com/uclouvain/openjpeg/issues/453)
|
||||
- Forward discrete wavelet transform: implement periodic symmetric extension at boundaries [\#452](https://github.com/uclouvain/openjpeg/issues/452)
|
||||
- Bug in tiff reading method in convert.c [\#449](https://github.com/uclouvain/openjpeg/issues/449)
|
||||
- Image in pdf don't display [\#447](https://github.com/uclouvain/openjpeg/issues/447)
|
||||
- Multiple issues causing opj\_decompress to segfault [\#446](https://github.com/uclouvain/openjpeg/issues/446)
|
||||
- opj\_compress: 40% of encode time is spent freeing data [\#445](https://github.com/uclouvain/openjpeg/issues/445)
|
||||
- Multiple warnings when configuring OpenJPEG on MacOS with CMake 3.x \(trunk\) [\#443](https://github.com/uclouvain/openjpeg/issues/443)
|
||||
- valgrind memleak found [\#437](https://github.com/uclouvain/openjpeg/issues/437)
|
||||
- global-buffer-overflow src/lib/openjp2/t1.c:1146 opj\_t1\_getwmsedec [\#436](https://github.com/uclouvain/openjpeg/issues/436)
|
||||
- Warning introduced on trunk r2923 & r2924 [\#435](https://github.com/uclouvain/openjpeg/issues/435)
|
||||
- heap-buffer-overflow in opj\_t1\_decode\_cblks [\#432](https://github.com/uclouvain/openjpeg/issues/432)
|
||||
- Heap-buffer-overflow in opj\_tcd\_init\_decode\_tile [\#431](https://github.com/uclouvain/openjpeg/issues/431)
|
||||
- Heap-buffer-overflow in opj\_j2k\_tcp\_destroy [\#430](https://github.com/uclouvain/openjpeg/issues/430)
|
||||
- Heap-buffer-overflow in opj\_jp2\_apply\_pclr [\#429](https://github.com/uclouvain/openjpeg/issues/429)
|
||||
- issue412 revisited [\#428](https://github.com/uclouvain/openjpeg/issues/428)
|
||||
- Image distorted \(sides look cankered\) [\#423](https://github.com/uclouvain/openjpeg/issues/423)
|
||||
- openjpeg-2.x-trunk-r2918 is broken in color.c [\#422](https://github.com/uclouvain/openjpeg/issues/422)
|
||||
- Heap-buffer-overflow in opj\_tcd\_init\_decode\_tile [\#420](https://github.com/uclouvain/openjpeg/issues/420)
|
||||
- Heap-use-after-free in opj\_t1\_decode\_cblks [\#418](https://github.com/uclouvain/openjpeg/issues/418)
|
||||
- UNKNOWN in opj\_read\_bytes\_LE [\#417](https://github.com/uclouvain/openjpeg/issues/417)
|
||||
- Transparency problem [\#416](https://github.com/uclouvain/openjpeg/issues/416)
|
||||
- Image with per channel alpha \(cdef\) does not decode properly [\#414](https://github.com/uclouvain/openjpeg/issues/414)
|
||||
- OpenJPEG crashes with attached image [\#413](https://github.com/uclouvain/openjpeg/issues/413)
|
||||
- Palette image with cdef fails to decompress [\#412](https://github.com/uclouvain/openjpeg/issues/412)
|
||||
- Invalid member values from opj\_read\_header or opj\_decode ? [\#411](https://github.com/uclouvain/openjpeg/issues/411)
|
||||
- MD5 Checksum hangs under valgrind on MacOS X [\#410](https://github.com/uclouvain/openjpeg/issues/410)
|
||||
- Heap-buffer-overflow in opj\_tcd\_get\_decoded\_tile\_size [\#408](https://github.com/uclouvain/openjpeg/issues/408)
|
||||
- C++ style comments in trunk/src/lib/openjp2/j2k.c [\#407](https://github.com/uclouvain/openjpeg/issues/407)
|
||||
- Backport bugfixes from trunk to 2.1 branch [\#405](https://github.com/uclouvain/openjpeg/issues/405)
|
||||
- Heap-buffer-overflow in parse\_cmdline\_encoder [\#403](https://github.com/uclouvain/openjpeg/issues/403)
|
||||
- Heap-buffer-overflow in opj\_v4dwt\_interleave\_h [\#400](https://github.com/uclouvain/openjpeg/issues/400)
|
||||
- Heap-buffer-overflow in opj\_dwt\_decode [\#399](https://github.com/uclouvain/openjpeg/issues/399)
|
||||
- Heap-use-after-free in opj\_t1\_decode\_cblks [\#398](https://github.com/uclouvain/openjpeg/issues/398)
|
||||
- Heap-buffer-overflow in opj\_jp2\_apply\_cdef [\#397](https://github.com/uclouvain/openjpeg/issues/397)
|
||||
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#396](https://github.com/uclouvain/openjpeg/issues/396)
|
||||
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#395](https://github.com/uclouvain/openjpeg/issues/395)
|
||||
- Heap-buffer-overflow in opj\_dwt\_decode\_1 [\#394](https://github.com/uclouvain/openjpeg/issues/394)
|
||||
- Heap-double-free in j2k\_read\_ppm\_v3 [\#393](https://github.com/uclouvain/openjpeg/issues/393)
|
||||
- Security hole in j2k.c [\#392](https://github.com/uclouvain/openjpeg/issues/392)
|
||||
- Security: double-free in opj\_tcd\_code\_block\_dec\_deallocate [\#391](https://github.com/uclouvain/openjpeg/issues/391)
|
||||
- check for negative-size params in code [\#390](https://github.com/uclouvain/openjpeg/issues/390)
|
||||
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#389](https://github.com/uclouvain/openjpeg/issues/389)
|
||||
- Heap overflow in OpenJpeg 1.5.2 [\#388](https://github.com/uclouvain/openjpeg/issues/388)
|
||||
- openjpip.so.6 file too short [\#387](https://github.com/uclouvain/openjpeg/issues/387)
|
||||
- Corrupted JP3D file [\#386](https://github.com/uclouvain/openjpeg/issues/386)
|
||||
- variable assigned to itself [\#383](https://github.com/uclouvain/openjpeg/issues/383)
|
||||
- Null pointer dereferencing [\#382](https://github.com/uclouvain/openjpeg/issues/382)
|
||||
- bad use of case statement [\#381](https://github.com/uclouvain/openjpeg/issues/381)
|
||||
- Release 2.1 as a Ubuntu package [\#380](https://github.com/uclouvain/openjpeg/issues/380)
|
||||
- Bug in libopenjpwl.pc [\#374](https://github.com/uclouvain/openjpeg/issues/374)
|
||||
- inconsistent tile numbering in decode output message [\#370](https://github.com/uclouvain/openjpeg/issues/370)
|
||||
- error in code block calculations [\#369](https://github.com/uclouvain/openjpeg/issues/369)
|
||||
- r2872 fails to compile due to "attempt to use poisoned malloc" error in j2k.c [\#368](https://github.com/uclouvain/openjpeg/issues/368)
|
||||
- OSX build gives libopenjp2.6.dylib with not-absolute install name id [\#367](https://github.com/uclouvain/openjpeg/issues/367)
|
||||
- opj\_decompress gives error but successfully decompress in OPJ 2.1 [\#366](https://github.com/uclouvain/openjpeg/issues/366)
|
||||
- pngtoimage\(\) and imagetopng\(\) have wrong byte order for 16-Bit image [\#365](https://github.com/uclouvain/openjpeg/issues/365)
|
||||
- PDF crash in chrome - part2 \(due to attachment limit\) [\#364](https://github.com/uclouvain/openjpeg/issues/364)
|
||||
- PDF crash in chrome - part1 [\#363](https://github.com/uclouvain/openjpeg/issues/363)
|
||||
- PDF crash in chrome - part0 [\#362](https://github.com/uclouvain/openjpeg/issues/362)
|
||||
- Compilation fails on Windows with mingw32 gcc4.8 [\#361](https://github.com/uclouvain/openjpeg/issues/361)
|
||||
- security issue [\#360](https://github.com/uclouvain/openjpeg/issues/360)
|
||||
- improve memory management [\#359](https://github.com/uclouvain/openjpeg/issues/359)
|
||||
- how to compress a yuv420 raw data using opj\_compress [\#357](https://github.com/uclouvain/openjpeg/issues/357)
|
||||
- Some memory allocation are not checked [\#355](https://github.com/uclouvain/openjpeg/issues/355)
|
||||
- Static library symbols shall be marked as hidden [\#354](https://github.com/uclouvain/openjpeg/issues/354)
|
||||
- opj\_compress rejects valid bmp files [\#353](https://github.com/uclouvain/openjpeg/issues/353)
|
||||
- opj\_compress crashes when number of resolutions is set to zero [\#352](https://github.com/uclouvain/openjpeg/issues/352)
|
||||
- Compilation error under Visual Studio 2003 [\#351](https://github.com/uclouvain/openjpeg/issues/351)
|
||||
- opj\_compress description example error \[Low priority\] [\#350](https://github.com/uclouvain/openjpeg/issues/350)
|
||||
- opj\_write\_bytes\_BE is wrong in trunk [\#345](https://github.com/uclouvain/openjpeg/issues/345)
|
||||
- PART1ONLY option in release.sh doesn't work properly [\#332](https://github.com/uclouvain/openjpeg/issues/332)
|
||||
- openjpeg crash error [\#330](https://github.com/uclouvain/openjpeg/issues/330)
|
||||
- openjpeg decompress error [\#329](https://github.com/uclouvain/openjpeg/issues/329)
|
||||
- openjpeg decompress issue [\#326](https://github.com/uclouvain/openjpeg/issues/326)
|
||||
- limited tif support [\#322](https://github.com/uclouvain/openjpeg/issues/322)
|
||||
- asoc value of 65536 is allowed [\#321](https://github.com/uclouvain/openjpeg/issues/321)
|
||||
- opj\_skip\_from\_file error [\#314](https://github.com/uclouvain/openjpeg/issues/314)
|
||||
- Heavy quota usage in openjpeg [\#309](https://github.com/uclouvain/openjpeg/issues/309)
|
||||
- Verify -help actually match letter [\#307](https://github.com/uclouvain/openjpeg/issues/307)
|
||||
- g3\_colr.j2c not handled [\#288](https://github.com/uclouvain/openjpeg/issues/288)
|
||||
- reopen/fix issue 165 [\#280](https://github.com/uclouvain/openjpeg/issues/280)
|
||||
- kakadu conformance tests [\#279](https://github.com/uclouvain/openjpeg/issues/279)
|
||||
- missing break after case statement in opj\_dwt\_decode\_real [\#274](https://github.com/uclouvain/openjpeg/issues/274)
|
||||
- Run Coverity on trunk [\#270](https://github.com/uclouvain/openjpeg/issues/270)
|
||||
- NR-ENC-random-issue-0005.tif-12-encode [\#259](https://github.com/uclouvain/openjpeg/issues/259)
|
||||
- Use new add\_test signature to handle cross compilation [\#258](https://github.com/uclouvain/openjpeg/issues/258)
|
||||
- Loss decoding quality in 2.0.0 [\#254](https://github.com/uclouvain/openjpeg/issues/254)
|
||||
- Decompress that worked in 1.5.1 fails in 2.0 [\#252](https://github.com/uclouvain/openjpeg/issues/252)
|
||||
- Expected endianness with raw input is not documented leading to SEGFAULT [\#251](https://github.com/uclouvain/openjpeg/issues/251)
|
||||
- OpenJPEG writes to stderr [\#246](https://github.com/uclouvain/openjpeg/issues/246)
|
||||
- Inconsistent logging of tile index [\#245](https://github.com/uclouvain/openjpeg/issues/245)
|
||||
- patch for openjpeg-trunk-r2347 and BIG\_ENDIAN [\#242](https://github.com/uclouvain/openjpeg/issues/242)
|
||||
- CMAP: MTYP == 0 \(direct use\) not handled properly [\#235](https://github.com/uclouvain/openjpeg/issues/235)
|
||||
- Black Pixel [\#233](https://github.com/uclouvain/openjpeg/issues/233)
|
||||
- opj\_compress runtime error after fresh Linux install due to apparent failure to execute ldconfig [\#219](https://github.com/uclouvain/openjpeg/issues/219)
|
||||
- openjp2 debug works, release build does not [\#217](https://github.com/uclouvain/openjpeg/issues/217)
|
||||
- openjpeg-branch15-r2299 and openjpeg-trunk-r2299 fail to decode a JP2 file [\#212](https://github.com/uclouvain/openjpeg/issues/212)
|
||||
- openjpeg-trunk issue with Win7 [\#201](https://github.com/uclouvain/openjpeg/issues/201)
|
||||
- undefined reference to `opj\_version' [\#200](https://github.com/uclouvain/openjpeg/issues/200)
|
||||
- In tgt.c we used fprintf not the openjpeg message reporter [\#184](https://github.com/uclouvain/openjpeg/issues/184)
|
||||
- Windows binaries not working under WinXP [\#176](https://github.com/uclouvain/openjpeg/issues/176)
|
||||
- add ability to use intel ipp \(performance primitive\) within OpenJPEG [\#164](https://github.com/uclouvain/openjpeg/issues/164)
|
||||
- Migration guide v2 [\#160](https://github.com/uclouvain/openjpeg/issues/160)
|
||||
- Cannot decompress JPEG2000Aware3.18.7.3Win32\_kdutranscode6.3.1.j2k [\#158](https://github.com/uclouvain/openjpeg/issues/158)
|
||||
- Cannot decompress JPEG2000Aware3.18.7.3Win32.j2k [\#157](https://github.com/uclouvain/openjpeg/issues/157)
|
||||
- openjpeg@googlegroups.com has disappeard [\#153](https://github.com/uclouvain/openjpeg/issues/153)
|
||||
- OpenJPEG 1.5.0 crashes on a ridiculously big file... [\#151](https://github.com/uclouvain/openjpeg/issues/151)
|
||||
- opj\_image vs free [\#146](https://github.com/uclouvain/openjpeg/issues/146)
|
||||
- Windows .dll file invalid [\#140](https://github.com/uclouvain/openjpeg/issues/140)
|
||||
- Problem with second layer of a 2 layer coded LRCP \(with precincts\) [\#135](https://github.com/uclouvain/openjpeg/issues/135)
|
||||
- version 1.4 crashes when opening PDF file with JPEG2000 images [\#133](https://github.com/uclouvain/openjpeg/issues/133)
|
||||
- Setup a win64 dashboard [\#132](https://github.com/uclouvain/openjpeg/issues/132)
|
||||
- J2KP4files/codestreams\_profile0/p0\_13.j2k question jpeg2000 [\#131](https://github.com/uclouvain/openjpeg/issues/131)
|
||||
- Out of memory: Kill process 11204 \(opj\_server\) score 917 or sacrifice child [\#123](https://github.com/uclouvain/openjpeg/issues/123)
|
||||
- FILE\* in opj API is unsafe [\#120](https://github.com/uclouvain/openjpeg/issues/120)
|
||||
- third-party lib order [\#119](https://github.com/uclouvain/openjpeg/issues/119)
|
||||
- openjpeg-1.5.0-Darwin-powerpc.dmg is huge ! [\#113](https://github.com/uclouvain/openjpeg/issues/113)
|
||||
- misleading info in JP2 box lead to wrong number of components [\#110](https://github.com/uclouvain/openjpeg/issues/110)
|
||||
- Image\_to\_j2k says that j2k files is generated but no file is on the HDD [\#109](https://github.com/uclouvain/openjpeg/issues/109)
|
||||
- Error in openjpegV1.4 on compiling image\_to\_j2k: crash on reading bmp file [\#108](https://github.com/uclouvain/openjpeg/issues/108)
|
||||
- Update to abi-compliance-checker 1.96 [\#106](https://github.com/uclouvain/openjpeg/issues/106)
|
||||
- Decode error on the attached JPEG...works in KDU and with JASPER...please help! [\#101](https://github.com/uclouvain/openjpeg/issues/101)
|
||||
- Mac binaries v1.4 is broken [\#95](https://github.com/uclouvain/openjpeg/issues/95)
|
||||
- jp2\_read\_boxhdr\(\) has size bug in version 1 [\#92](https://github.com/uclouvain/openjpeg/issues/92)
|
||||
- Support for Java JAI Imageio [\#90](https://github.com/uclouvain/openjpeg/issues/90)
|
||||
- encoding test failing [\#86](https://github.com/uclouvain/openjpeg/issues/86)
|
||||
- source archive on demand [\#85](https://github.com/uclouvain/openjpeg/issues/85)
|
||||
- CMakeLists.txt and Makefile.am for JPIP are buggy [\#84](https://github.com/uclouvain/openjpeg/issues/84)
|
||||
- pclr-cmap-cdef [\#82](https://github.com/uclouvain/openjpeg/issues/82)
|
||||
- Error when compiling openjpeg\_v1\_4\_sources\_r697 [\#79](https://github.com/uclouvain/openjpeg/issues/79)
|
||||
- J2K codec issue on Windows Mobile [\#77](https://github.com/uclouvain/openjpeg/issues/77)
|
||||
- image\_to\_j2k.exe crashes on large .bmp file [\#75](https://github.com/uclouvain/openjpeg/issues/75)
|
||||
- fatal error C1900 building the project on windows [\#65](https://github.com/uclouvain/openjpeg/issues/65)
|
||||
- same option but different size [\#54](https://github.com/uclouvain/openjpeg/issues/54)
|
||||
- Missing openjpegConfigure.h [\#38](https://github.com/uclouvain/openjpeg/issues/38)
|
||||
- Not an issue in openjpeg, but ... [\#37](https://github.com/uclouvain/openjpeg/issues/37)
|
||||
- OpenJPEG-1.3.0 pclr, cmap and cdef [\#27](https://github.com/uclouvain/openjpeg/issues/27)
|
||||
- realloc maybe too big \(t2.c\) [\#26](https://github.com/uclouvain/openjpeg/issues/26)
|
||||
- libopenjpeg/opj\_malloc.h breaks on FreeBSD/Darwin systems [\#20](https://github.com/uclouvain/openjpeg/issues/20)
|
||||
- image\_to\_j2k not outputting to win32 console properly [\#18](https://github.com/uclouvain/openjpeg/issues/18)
|
||||
- \[OpenJPEG\] OpenJPEG\_v13: tiled image part 2 [\#17](https://github.com/uclouvain/openjpeg/issues/17)
|
||||
- JP2 Color Space modification by Matteo Italia [\#13](https://github.com/uclouvain/openjpeg/issues/13)
|
||||
- Patch submission \( exotic video formats, and a few things \) [\#12](https://github.com/uclouvain/openjpeg/issues/12)
|
||||
- 16 bits lossy compression [\#10](https://github.com/uclouvain/openjpeg/issues/10)
|
||||
- pnm file formats not accepting bitdepth greater than 8 bpp [\#8](https://github.com/uclouvain/openjpeg/issues/8)
|
||||
- Heap corruption in j2k encoder [\#5](https://github.com/uclouvain/openjpeg/issues/5)
|
||||
- JPWL crash in marker reallocation\(+patch\), segfault while decoding image with main header protection [\#4](https://github.com/uclouvain/openjpeg/issues/4)
|
||||
- a couple of small errors in libopenjpeg detected by coverity [\#1](https://github.com/uclouvain/openjpeg/issues/1)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Shared library build broken on ubuntu [\#728](https://github.com/uclouvain/openjpeg/issues/728)
|
||||
- opj\_includes.h shouldn't define `\_\_attribute\_\_` [\#727](https://github.com/uclouvain/openjpeg/issues/727)
|
||||
- Possible website problems due to Jekyll upgrade [\#713](https://github.com/uclouvain/openjpeg/issues/713)
|
||||
- Stable Release? [\#712](https://github.com/uclouvain/openjpeg/issues/712)
|
||||
- Meta Issue : try to fix some of these critical bugs before thinking about optimizing the library [\#710](https://github.com/uclouvain/openjpeg/issues/710)
|
||||
- Tiled encoding broken for images with non power of 2 dimensions [\#702](https://github.com/uclouvain/openjpeg/issues/702)
|
||||
- install\_name \(still\) not set on OS X [\#700](https://github.com/uclouvain/openjpeg/issues/700)
|
||||
- Add section in wiki describing where one can get test images [\#699](https://github.com/uclouvain/openjpeg/issues/699)
|
||||
- Make EvenManager into singleton [\#698](https://github.com/uclouvain/openjpeg/issues/698)
|
||||
- Remove old branches from repo [\#696](https://github.com/uclouvain/openjpeg/issues/696)
|
||||
- MQ Coder encode: Conditional jump or move depends on uninitialised value\(s\) [\#695](https://github.com/uclouvain/openjpeg/issues/695)
|
||||
- Can we add these files to our test suite ? [\#688](https://github.com/uclouvain/openjpeg/issues/688)
|
||||
- -t and -d command line flags for decode are not documented on OpenJPEG website [\#685](https://github.com/uclouvain/openjpeg/issues/685)
|
||||
- Decoding at the precinct level [\#676](https://github.com/uclouvain/openjpeg/issues/676)
|
||||
- Support unscaled 10 bit data for 2K cinema @ 48 FPS, as per DCI standard [\#671](https://github.com/uclouvain/openjpeg/issues/671)
|
||||
- Use parallel jobs in ctest [\#664](https://github.com/uclouvain/openjpeg/issues/664)
|
||||
- \[Security\]Multiple Memory error [\#663](https://github.com/uclouvain/openjpeg/issues/663)
|
||||
- lossy encoding a 16 bit TIF file : severe artifiacts in decompressed image [\#660](https://github.com/uclouvain/openjpeg/issues/660)
|
||||
- opj\_compress and opj\_decompress : get\_next\_file method uses hard-coded unix path separator [\#630](https://github.com/uclouvain/openjpeg/issues/630)
|
||||
- Uninitialized variable [\#629](https://github.com/uclouvain/openjpeg/issues/629)
|
||||
- Use of enum variable for bit flags prevents compilation as C++ source [\#619](https://github.com/uclouvain/openjpeg/issues/619)
|
||||
- Serious problem with quantization during lossy encoding [\#615](https://github.com/uclouvain/openjpeg/issues/615)
|
||||
- Decompression does not work with sequential data source [\#613](https://github.com/uclouvain/openjpeg/issues/613)
|
||||
- potential overflow in opj\_tcd\_tile\_t [\#605](https://github.com/uclouvain/openjpeg/issues/605)
|
||||
- Logical condition [\#596](https://github.com/uclouvain/openjpeg/issues/596)
|
||||
- file9.jp2 does not dump correctly on 1.5 [\#595](https://github.com/uclouvain/openjpeg/issues/595)
|
||||
- opj\_compress man page is missing documentation of -jpip option [\#593](https://github.com/uclouvain/openjpeg/issues/593)
|
||||
- opj\_compress fails to compress lossless on gcc/x86 \(-m32\) in 1.5 branch [\#591](https://github.com/uclouvain/openjpeg/issues/591)
|
||||
- Example: opj\_compress -i image.j2k -o image.pgm [\#577](https://github.com/uclouvain/openjpeg/issues/577)
|
||||
- Mismatching delete [\#575](https://github.com/uclouvain/openjpeg/issues/575)
|
||||
- Compilation fails on Win7 [\#546](https://github.com/uclouvain/openjpeg/issues/546)
|
||||
- NR-JP2-file5.jp2-compare2base fails with third party libcms [\#540](https://github.com/uclouvain/openjpeg/issues/540)
|
||||
- CTest spits out an error at the end of the test run [\#516](https://github.com/uclouvain/openjpeg/issues/516)
|
||||
- opj\_uint\_adds\(\) is questionable [\#515](https://github.com/uclouvain/openjpeg/issues/515)
|
||||
- Might consider renaming this method: [\#491](https://github.com/uclouvain/openjpeg/issues/491)
|
||||
- opj\_compress run twice gives different fiile sizes for same file [\#490](https://github.com/uclouvain/openjpeg/issues/490)
|
||||
- Android Support [\#483](https://github.com/uclouvain/openjpeg/issues/483)
|
||||
- Add SSE2/SSE41 implementations for mct.c [\#451](https://github.com/uclouvain/openjpeg/issues/451)
|
||||
- Reduce encoder code block memory usage for non 64x64 code block sizes [\#444](https://github.com/uclouvain/openjpeg/issues/444)
|
||||
- valgrind "Uninitialized Memory Read" & "Uninitialized Memory Conditional" found [\#438](https://github.com/uclouvain/openjpeg/issues/438)
|
||||
- No way to debug opj\_tcd\_init\_encode\_tile or opj\_tcd\_init\_decode\_tile [\#433](https://github.com/uclouvain/openjpeg/issues/433)
|
||||
- Add option to call dsymutil on built binaries [\#409](https://github.com/uclouvain/openjpeg/issues/409)
|
||||
- Allow opj\_compress and opj\_decompress to read/write images over stdin/stdout [\#379](https://github.com/uclouvain/openjpeg/issues/379)
|
||||
- reduce memory significantly for single tile RGB encoding [\#375](https://github.com/uclouvain/openjpeg/issues/375)
|
||||
- Switch code repo to github and start using pull request workflow [\#373](https://github.com/uclouvain/openjpeg/issues/373)
|
||||
- This is a BigTIFF file. This format not supported [\#125](https://github.com/uclouvain/openjpeg/issues/125)
|
||||
- Add a test suite to check the convert functions [\#99](https://github.com/uclouvain/openjpeg/issues/99)
|
||||
- Add build config to the dashboard to verify the autotools build [\#88](https://github.com/uclouvain/openjpeg/issues/88)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Correct abi-check.sh for PR [\#791](https://github.com/uclouvain/openjpeg/pull/791) ([mayeut](https://github.com/mayeut))
|
||||
- Update tcd.c [\#790](https://github.com/uclouvain/openjpeg/pull/790) ([maddin200](https://github.com/maddin200))
|
||||
- Update lcms2 [\#773](https://github.com/uclouvain/openjpeg/pull/773) ([mayeut](https://github.com/mayeut))
|
||||
- Use lowercase for cmake commands consistenly [\#769](https://github.com/uclouvain/openjpeg/pull/769) ([julienmalik](https://github.com/julienmalik))
|
||||
- Ignore clang's summary warning [\#768](https://github.com/uclouvain/openjpeg/pull/768) ([julienmalik](https://github.com/julienmalik))
|
||||
- Fix UBSan gcc warning for first arg to memset non null [\#767](https://github.com/uclouvain/openjpeg/pull/767) ([julienmalik](https://github.com/julienmalik))
|
||||
- Update to libtiff-4.0.6 [\#764](https://github.com/uclouvain/openjpeg/pull/764) ([mayeut](https://github.com/mayeut))
|
||||
- Fix warnings [\#763](https://github.com/uclouvain/openjpeg/pull/763) ([mayeut](https://github.com/mayeut))
|
||||
- Check SSIZ is valid in opj\_j2k\_read\_siz [\#762](https://github.com/uclouvain/openjpeg/pull/762) ([mayeut](https://github.com/mayeut))
|
||||
- Fix unsigned int overflow reported by UBSan [\#761](https://github.com/uclouvain/openjpeg/pull/761) ([mayeut](https://github.com/mayeut))
|
||||
- Fix unsigned int overflow reported by UBSan [\#759](https://github.com/uclouvain/openjpeg/pull/759) ([mayeut](https://github.com/mayeut))
|
||||
- Fix negative shift left reported by UBSan [\#758](https://github.com/uclouvain/openjpeg/pull/758) ([mayeut](https://github.com/mayeut))
|
||||
- Fix negative shift left reported by UBSan [\#757](https://github.com/uclouvain/openjpeg/pull/757) ([mayeut](https://github.com/mayeut))
|
||||
- Add clang 3.9 build to Travis matrix [\#753](https://github.com/uclouvain/openjpeg/pull/753) ([julienmalik](https://github.com/julienmalik))
|
||||
- Fix implicit floating bool conversion [\#752](https://github.com/uclouvain/openjpeg/pull/752) ([julienmalik](https://github.com/julienmalik))
|
||||
- Do not define \_\_attribute\_\_ in opj\_includes.h [\#751](https://github.com/uclouvain/openjpeg/pull/751) ([mayeut](https://github.com/mayeut))
|
||||
- Allow to read/write 3/5/7/9/11/13/15 bpp TIF files [\#750](https://github.com/uclouvain/openjpeg/pull/750) ([mayeut](https://github.com/mayeut))
|
||||
- Fix heap-buffer-overflow in color\_esycc\_to\_rgb [\#748](https://github.com/uclouvain/openjpeg/pull/748) ([mayeut](https://github.com/mayeut))
|
||||
- update libpng to from 1.6.17 to 1.6.21 [\#747](https://github.com/uclouvain/openjpeg/pull/747) ([julienmalik](https://github.com/julienmalik))
|
||||
- Update cmake & jpylyzer for travis builds [\#746](https://github.com/uclouvain/openjpeg/pull/746) ([julienmalik](https://github.com/julienmalik))
|
||||
- Fix Out-Of-Bounds Read in sycc42x\_to\_rgb function [\#745](https://github.com/uclouvain/openjpeg/pull/745) ([mayeut](https://github.com/mayeut))
|
||||
- cppcheck fix for openjp2 [\#740](https://github.com/uclouvain/openjpeg/pull/740) ([julienmalik](https://github.com/julienmalik))
|
||||
- Fix uninitialized variable reported by cppcheck [\#735](https://github.com/uclouvain/openjpeg/pull/735) ([julienmalik](https://github.com/julienmalik))
|
||||
- Remove dead code in opj\_dump [\#734](https://github.com/uclouvain/openjpeg/pull/734) ([julienmalik](https://github.com/julienmalik))
|
||||
- issue \#695 MQ Encode: ensure that bp pointer never points to uninitialized memory [\#708](https://github.com/uclouvain/openjpeg/pull/708) ([boxerab](https://github.com/boxerab))
|
||||
- Fix issue 135 [\#706](https://github.com/uclouvain/openjpeg/pull/706) ([mayeut](https://github.com/mayeut))
|
||||
- Fix implementation of opj\_calloc [\#705](https://github.com/uclouvain/openjpeg/pull/705) ([stweil](https://github.com/stweil))
|
||||
- \[git/2.1 regression\] Fix opj\_write\_tile\(\) failure when numresolutions=1 [\#690](https://github.com/uclouvain/openjpeg/pull/690) ([rouault](https://github.com/rouault))
|
||||
- Fix fatal crash on 64 bit Linux [\#687](https://github.com/uclouvain/openjpeg/pull/687) ([stweil](https://github.com/stweil))
|
||||
- \[libtiff\] Add missing include statement for ssize\_t [\#686](https://github.com/uclouvain/openjpeg/pull/686) ([mayeut](https://github.com/mayeut))
|
||||
- Fix duplicate article in comments [\#684](https://github.com/uclouvain/openjpeg/pull/684) ([stweil](https://github.com/stweil))
|
||||
- Fix grammar in comment [\#679](https://github.com/uclouvain/openjpeg/pull/679) ([stweil](https://github.com/stweil))
|
||||
- Remove whitespace and CR at line endings [\#678](https://github.com/uclouvain/openjpeg/pull/678) ([stweil](https://github.com/stweil))
|
||||
- Fix typos [\#665](https://github.com/uclouvain/openjpeg/pull/665) ([jwilk](https://github.com/jwilk))
|
||||
- Add missing source for the JPIP library and executables \(issue \#658\) [\#659](https://github.com/uclouvain/openjpeg/pull/659) ([stweil](https://github.com/stweil))
|
||||
- Fix undefined size jp2 box handling [\#654](https://github.com/uclouvain/openjpeg/pull/654) ([mayeut](https://github.com/mayeut))
|
||||
- opj\_decompress: Update error message [\#651](https://github.com/uclouvain/openjpeg/pull/651) ([stweil](https://github.com/stweil))
|
||||
- Fix support of posix\_memalloc for Linux [\#648](https://github.com/uclouvain/openjpeg/pull/648) ([stweil](https://github.com/stweil))
|
||||
- Fix typo in comments [\#647](https://github.com/uclouvain/openjpeg/pull/647) ([stweil](https://github.com/stweil))
|
||||
- Avoid pointer arithmetic with \(void \*\) pointers [\#644](https://github.com/uclouvain/openjpeg/pull/644) ([smuehlst](https://github.com/smuehlst))
|
||||
- Fix HP compiler warning about redeclaration of function \(\#640\) [\#641](https://github.com/uclouvain/openjpeg/pull/641) ([smuehlst](https://github.com/smuehlst))
|
||||
- Fix format strings and unneeded assignment [\#638](https://github.com/uclouvain/openjpeg/pull/638) ([stweil](https://github.com/stweil))
|
||||
- Fix repository for JPEG2000 test data [\#637](https://github.com/uclouvain/openjpeg/pull/637) ([stweil](https://github.com/stweil))
|
||||
- Update allocation functions [\#636](https://github.com/uclouvain/openjpeg/pull/636) ([mayeut](https://github.com/mayeut))
|
||||
- Fix OpenJPEG GitHub issue \#633. [\#634](https://github.com/uclouvain/openjpeg/pull/634) ([smuehlst](https://github.com/smuehlst))
|
||||
- travis-ci: Include add ons in matrix [\#632](https://github.com/uclouvain/openjpeg/pull/632) ([mayeut](https://github.com/mayeut))
|
||||
- Add Appveyor [\#627](https://github.com/uclouvain/openjpeg/pull/627) ([mayeut](https://github.com/mayeut))
|
||||
- Use Travis-ci to run ABI check [\#626](https://github.com/uclouvain/openjpeg/pull/626) ([mayeut](https://github.com/mayeut))
|
||||
- Fix warnings for C++ [\#623](https://github.com/uclouvain/openjpeg/pull/623) ([stweil](https://github.com/stweil))
|
||||
- Fixed problem that C++ compilation failed because of enum variable. [\#622](https://github.com/uclouvain/openjpeg/pull/622) ([smuehlst](https://github.com/smuehlst))
|
||||
- Added missing casts for return values of opj\_malloc\(\)/opj\_calloc\(\). [\#618](https://github.com/uclouvain/openjpeg/pull/618) ([smuehlst](https://github.com/smuehlst))
|
||||
- Add check for seek support before trying TPsot==TNsot workaround [\#617](https://github.com/uclouvain/openjpeg/pull/617) ([mayeut](https://github.com/mayeut))
|
||||
- Fix some typos found by codespell [\#610](https://github.com/uclouvain/openjpeg/pull/610) ([stweil](https://github.com/stweil))
|
||||
- Correct leak in color\_cielab\_to\_rgb [\#590](https://github.com/uclouvain/openjpeg/pull/590) ([mayeut](https://github.com/mayeut))
|
||||
- Add Travis-ci build matrix [\#584](https://github.com/uclouvain/openjpeg/pull/584) ([mayeut](https://github.com/mayeut))
|
||||
- Correct lossless issue on linux x86 [\#579](https://github.com/uclouvain/openjpeg/pull/579) ([mayeut](https://github.com/mayeut))
|
||||
- Travis-ci update [\#578](https://github.com/uclouvain/openjpeg/pull/578) ([mayeut](https://github.com/mayeut))
|
||||
- Correct CMake version requirements [\#572](https://github.com/uclouvain/openjpeg/pull/572) ([mayeut](https://github.com/mayeut))
|
||||
- Add tests for CMYK/esYCC/CIELab [\#567](https://github.com/uclouvain/openjpeg/pull/567) ([mayeut](https://github.com/mayeut))
|
||||
- Add support for CIELab, EYCC and CMYK [\#559](https://github.com/uclouvain/openjpeg/pull/559) ([szukw000](https://github.com/szukw000))
|
||||
- Remove printf/fprintf to stdout/stderr throughout openjp2 lib [\#558](https://github.com/uclouvain/openjpeg/pull/558) ([mayeut](https://github.com/mayeut))
|
||||
- better -ffast-math handling [\#555](https://github.com/uclouvain/openjpeg/pull/555) ([rdieter](https://github.com/rdieter))
|
||||
- Add jpylyzer tests for JP2 compression [\#552](https://github.com/uclouvain/openjpeg/pull/552) ([mayeut](https://github.com/mayeut))
|
||||
- Add COC/QCC in main header when needed [\#551](https://github.com/uclouvain/openjpeg/pull/551) ([mayeut](https://github.com/mayeut))
|
||||
- Use \_\_emul under msvc x86 for fast 64 = 32 \* 32 [\#550](https://github.com/uclouvain/openjpeg/pull/550) ([mayeut](https://github.com/mayeut))
|
||||
- Update convert for PNG output [\#549](https://github.com/uclouvain/openjpeg/pull/549) ([mayeut](https://github.com/mayeut))
|
||||
- Remove some warnings when building [\#548](https://github.com/uclouvain/openjpeg/pull/548) ([mayeut](https://github.com/mayeut))
|
||||
- Switch to libpng-1.6.17 [\#547](https://github.com/uclouvain/openjpeg/pull/547) ([mayeut](https://github.com/mayeut))
|
||||
- Add some missing static keywords [\#545](https://github.com/uclouvain/openjpeg/pull/545) ([mayeut](https://github.com/mayeut))
|
||||
- Switch to libcms2 mm2/Little-CMS@0e8234e090d6aab33f90e2eb0296f30aa0705e57 [\#544](https://github.com/uclouvain/openjpeg/pull/544) ([mayeut](https://github.com/mayeut))
|
||||
- Prevent overflow when coding 16 bits images [\#543](https://github.com/uclouvain/openjpeg/pull/543) ([mayeut](https://github.com/mayeut))
|
||||
- Switch to libcms2-2.6 [\#542](https://github.com/uclouvain/openjpeg/pull/542) ([mayeut](https://github.com/mayeut))
|
||||
- Update PNG support [\#538](https://github.com/uclouvain/openjpeg/pull/538) ([mayeut](https://github.com/mayeut))
|
||||
- Various Minor fixes [\#537](https://github.com/uclouvain/openjpeg/pull/537) ([mayeut](https://github.com/mayeut))
|
||||
- Update TIFF conversion to support more bit depth. [\#535](https://github.com/uclouvain/openjpeg/pull/535) ([mayeut](https://github.com/mayeut))
|
||||
- Add checks for odd looking cmap & for cmap outside jp2h box [\#534](https://github.com/uclouvain/openjpeg/pull/534) ([mayeut](https://github.com/mayeut))
|
||||
- Refactor opj\_j2k\_read\_ppm & opj\_j2k\_read\_ppt [\#533](https://github.com/uclouvain/openjpeg/pull/533) ([mayeut](https://github.com/mayeut))
|
||||
- Add option to force component splitting in imagetopnm [\#531](https://github.com/uclouvain/openjpeg/pull/531) ([mayeut](https://github.com/mayeut))
|
||||
- fix Suspicious code in j2k.c \#517 [\#529](https://github.com/uclouvain/openjpeg/pull/529) ([renevanderark](https://github.com/renevanderark))
|
||||
- Update zlib to version 1.2.8 [\#528](https://github.com/uclouvain/openjpeg/pull/528) ([mayeut](https://github.com/mayeut))
|
||||
- Fix opj\_write\_bytes\_BE \(\#518\) [\#521](https://github.com/uclouvain/openjpeg/pull/521) ([manisandro](https://github.com/manisandro))
|
||||
- Correctly decode files with incorrect tile-part header fields \(TPsot==TNsot\) [\#514](https://github.com/uclouvain/openjpeg/pull/514) ([mayeut](https://github.com/mayeut))
|
||||
- Fixed typos [\#510](https://github.com/uclouvain/openjpeg/pull/510) ([radarhere](https://github.com/radarhere))
|
||||
- Formatted the readme file [\#507](https://github.com/uclouvain/openjpeg/pull/507) ([htmfilho](https://github.com/htmfilho))
|
||||
|
||||
## [version.2.1](https://github.com/uclouvain/openjpeg/releases/tag/version.2.1) (2014-04-29)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.0.1...version.2.1)
|
||||
|
||||
## [version.2.0.1](https://github.com/uclouvain/openjpeg/releases/tag/version.2.0.1) (2014-04-22)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5.2...version.2.0.1)
|
||||
|
||||
## [version.1.5.2](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5.2) (2014-03-28)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.0...version.1.5.2)
|
||||
|
||||
## [version.2.0](https://github.com/uclouvain/openjpeg/releases/tag/version.2.0) (2014-03-28)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5.1...version.2.0)
|
||||
|
||||
## [version.1.5.1](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5.1) (2012-09-13)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5...version.1.5.1)
|
||||
|
||||
## [version.1.5](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5) (2012-02-07)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.3...version.1.5)
|
||||
|
||||
## [version.1.3](https://github.com/uclouvain/openjpeg/releases/tag/version.1.3) (2011-07-03)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.4...version.1.3)
|
||||
|
||||
## [version.1.4](https://github.com/uclouvain/openjpeg/releases/tag/version.1.4) (2011-07-03)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.2...version.1.4)
|
||||
|
||||
## [version.1.2](https://github.com/uclouvain/openjpeg/releases/tag/version.1.2) (2007-06-04)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.1...version.1.2)
|
||||
|
||||
## [version.1.1](https://github.com/uclouvain/openjpeg/releases/tag/version.1.1) (2007-01-31)
|
||||
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.0...version.1.1)
|
||||
|
||||
|
||||
|
||||
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
@ -11,6 +11,9 @@ cmake_minimum_required(VERSION 2.8.2)
|
||||
|
||||
if(COMMAND CMAKE_POLICY)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
if (NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OPENJPEG_NAMESPACE)
|
||||
@ -29,7 +32,7 @@ include_regular_expression("^.*$")
|
||||
#-----------------------------------------------------------------------------
|
||||
# OPENJPEG version number, useful for packaging and doxygen doc:
|
||||
set(OPENJPEG_VERSION_MAJOR 2)
|
||||
set(OPENJPEG_VERSION_MINOR 1)
|
||||
set(OPENJPEG_VERSION_MINOR 2)
|
||||
set(OPENJPEG_VERSION_BUILD 0)
|
||||
set(OPENJPEG_VERSION
|
||||
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||
@ -47,12 +50,16 @@ set(PACKAGE_VERSION
|
||||
# 1.5 | 5
|
||||
# 1.5.1 | 5
|
||||
# 2.0 | 6
|
||||
# 2.0.1 | 6
|
||||
# 2.1 | 7
|
||||
# 2.1.1 | 7
|
||||
# 2.1.2 | 7
|
||||
# 2.2.0 | 8
|
||||
# above is the recommendation by the OPJ team. If you really need to override this default,
|
||||
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
|
||||
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
|
||||
if(NOT OPENJPEG_SOVERSION)
|
||||
SET(OPENJPEG_SOVERSION 7)
|
||||
set(OPENJPEG_SOVERSION 7)
|
||||
endif(NOT OPENJPEG_SOVERSION)
|
||||
set(OPENJPEG_LIBRARY_PROPERTIES
|
||||
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
|
||||
@ -62,7 +69,7 @@ set(OPENJPEG_LIBRARY_PROPERTIES
|
||||
# --------------------------------------------------------------------------
|
||||
# Path to additional CMake modules
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_SOURCE_DIR}/cmake
|
||||
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
|
||||
${CMAKE_MODULE_PATH})
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
@ -94,6 +101,8 @@ endif()
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Install directories
|
||||
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
||||
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
||||
|
||||
string(TOLOWER ${PROJECT_NAME} projectname)
|
||||
set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
|
||||
@ -118,6 +127,7 @@ if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
|
||||
set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
|
||||
endif()
|
||||
|
||||
if(BUILD_DOC)
|
||||
if(NOT OPENJPEG_INSTALL_MAN_DIR)
|
||||
set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
|
||||
endif()
|
||||
@ -125,6 +135,7 @@ endif()
|
||||
if(NOT OPENJPEG_INSTALL_DOC_DIR)
|
||||
set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OPENJPEG_INSTALL_JNI_DIR)
|
||||
if(WIN32)
|
||||
@ -141,6 +152,11 @@ if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
|
||||
set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
list(APPEND OPENJPEG_LIBRARY_PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_LIB_DIR}")
|
||||
option(OPJ_USE_DSYMUTIL "Call dsymutil on binaries after build." OFF)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Big endian test:
|
||||
include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
|
||||
@ -149,8 +165,8 @@ TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup file for setting custom ctest vars
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in
|
||||
${CMAKE_BINARY_DIR}/CTestCustom.cmake
|
||||
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake/CTestCustom.cmake.in
|
||||
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/CTestCustom.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
@ -177,7 +193,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
# For all builds, make sure openjpeg is std99 compliant:
|
||||
# set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
|
||||
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
|
||||
set(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
|
||||
set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -212,6 +228,18 @@ CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
||||
include(TestLargeFiles)
|
||||
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
|
||||
|
||||
# Allocating Aligned Memory Blocks
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files(malloc.h OPJ_HAVE_MALLOC_H)
|
||||
include(CheckSymbolExists)
|
||||
# _aligned_alloc https://msdn.microsoft.com/en-us/library/8z34s9c6.aspx
|
||||
check_symbol_exists(_aligned_malloc malloc.h OPJ_HAVE__ALIGNED_MALLOC)
|
||||
# posix_memalign (needs _POSIX_C_SOURCE >= 200112L on Linux)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200112L)
|
||||
check_symbol_exists(posix_memalign stdlib.h OPJ_HAVE_POSIX_MEMALIGN)
|
||||
unset(CMAKE_REQUIRED_DEFINITIONS)
|
||||
# memalign (obsolete)
|
||||
check_symbol_exists(memalign malloc.h OPJ_HAVE_MEMALIGN)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build Library
|
||||
if(BUILD_JPIP_SERVER)
|
||||
@ -223,6 +251,7 @@ if(BUILD_JPIP_SERVER)
|
||||
endif()
|
||||
endif()
|
||||
add_subdirectory(src/lib)
|
||||
option(BUILD_LUTS_GENERATOR "Build utility to generate t1_luts.h" OFF)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build Applications
|
||||
@ -264,8 +293,7 @@ configure_file(
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
||||
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
||||
# build documentation in doc subdir:
|
||||
if(BUILD_DOC)
|
||||
add_subdirectory(doc)
|
||||
endif()
|
||||
@ -279,8 +307,8 @@ if(BUILD_TESTING)
|
||||
include(CTest)
|
||||
|
||||
# Search openjpeg data needed for the tests
|
||||
# They could be found via svn on the OpenJPEG google code project
|
||||
# svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo)
|
||||
# They could be found via git on the OpenJPEG GitHub code project
|
||||
# git clone https://github.com/uclouvain/openjpeg-data.git
|
||||
find_path(OPJ_DATA_ROOT README-OPJ-Data
|
||||
PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../data
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
@ -297,8 +325,8 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# install all targets referenced as OPENJPEGTargets
|
||||
install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
|
||||
configure_file( ${OPENJPEG_SOURCE_DIR}/cmake/OpenJPEGConfig.cmake.in
|
||||
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||
configure_file( ${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake/OpenJPEGConfig.cmake.in
|
||||
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||
@ONLY
|
||||
)
|
||||
install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||
@ -307,16 +335,25 @@ install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# install CHANGES and LICENSE
|
||||
if(BUILD_DOC)
|
||||
if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
|
||||
install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
|
||||
endif()
|
||||
|
||||
install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
|
||||
endif()
|
||||
|
||||
include (cmake/OpenJPEGCPack.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# pkgconfig support
|
||||
# enabled by default on Unix, disabled by default on other platforms
|
||||
if(UNIX)
|
||||
option(BUILD_PKGCONFIG_FILES "Build and install pkg-config files" ON)
|
||||
else()
|
||||
option(BUILD_PKGCONFIG_FILES "Build and install pkg-config files" OFF)
|
||||
endif()
|
||||
if(BUILD_PKGCONFIG_FILES)
|
||||
# install in lib and not share (see multi-arch note above)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/libopenjp2.pc.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY)
|
||||
|
69
INSTALL
69
INSTALL
@ -1,69 +0,0 @@
|
||||
|
||||
How to build and install openjpeg binaries
|
||||
==========================================
|
||||
|
||||
UNIX/LINUX/MacOSX/Windows systems
|
||||
--------------------------
|
||||
|
||||
Using cmake (see www.cmake.org)
|
||||
|
||||
Type:
|
||||
cmake .
|
||||
make
|
||||
|
||||
If you are root:
|
||||
make install
|
||||
|
||||
else if you have sudo power:
|
||||
sudo make install
|
||||
|
||||
else
|
||||
DESTDIR=$HOME/local make install
|
||||
|
||||
To build the Doxygen documentation (Doxygen needs to be found on the system):
|
||||
(A 'html' directory is generated in the 'doc' directory)
|
||||
make doc
|
||||
|
||||
Binaries are located in the 'bin' directory.
|
||||
|
||||
Main available cmake flags:
|
||||
* To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path', or use DESTDIR env variable (see above)
|
||||
* To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
|
||||
Note: when using this option, static libraries are not built and executables are dynamically linked.
|
||||
* To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
|
||||
* To build the documentation: '-DBUILD_DOC:bool=on' (default: 'OFF')
|
||||
* To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
|
||||
* To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
|
||||
* To build the JPIP library and utilities: '-DBUILD_JPIP:bool=on' (default: 'OFF')
|
||||
** To build the JPIP server: '-DBUILD_JPIP_SERVER:bool=on' (default: 'OFF')
|
||||
* To build the JP3D library and utilities: '-DBUILD_JP3D:bool=on' (default: 'OFF') (experimental)
|
||||
* To build the Java binding: '-DBUILD_JAVA:bool=on' (default: 'OFF') (experimental).
|
||||
** to choose which java implementation, you can set your JAVA_HOME env var.
|
||||
* To build the wxWidgets/C++ viewer: 'BUILD_VIEWER:BOOL=ON' (default OFF) (experimental)
|
||||
* To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
|
||||
cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory'
|
||||
make
|
||||
make Experimental
|
||||
Note : JPEG2000 test files are available with 'svn checkout http://openjpeg.googlecode.com/svn/data' (about 70 Mo).
|
||||
If '-DOPJ_DATA_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE_SOURCE_DIR}/../data',
|
||||
corresponding to the location of the data directory when compiling from the trunk (and assuming the data directory has
|
||||
been checked out of course).
|
||||
|
||||
MACOSX
|
||||
------
|
||||
|
||||
The same building procedures as above work for MACOSX.
|
||||
The xcode project file can also be used.
|
||||
|
||||
If it does not work, try adding the following flag to the cmake command :
|
||||
'-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
|
||||
|
||||
WINDOWS
|
||||
-------
|
||||
|
||||
You can use cmake to generate project files for the IDE you are using (VS2010, NMake, etc).
|
||||
Type 'cmake --help' for available generators on your platform.
|
||||
|
||||
Make sure to build the third party libs (png, zlib ...):
|
||||
|
||||
'-DBUILD_THIRDPARTY:BOOL=ON'
|
75
INSTALL.md
Normal file
75
INSTALL.md
Normal file
@ -0,0 +1,75 @@
|
||||
|
||||
# OpenJPEG installation
|
||||
|
||||
The build method maintained by OpenJPEG is [CMake](https://cmake.org/).
|
||||
|
||||
## UNIX/LINUX - MacOS (terminal) - WINDOWS (cygwin, MinGW)
|
||||
|
||||
To build the library, type from source tree directory:
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
Binaries are then located in the 'bin' directory.
|
||||
|
||||
To install the library, type with root privileges:
|
||||
```
|
||||
make install
|
||||
make clean
|
||||
```
|
||||
|
||||
To build the html documentation, you need doxygen to be installed on your system.
|
||||
It will create an "html" directory in TOP\_LEVEL/build/doc)
|
||||
```
|
||||
make doc
|
||||
```
|
||||
|
||||
Main available cmake flags:
|
||||
* To specify the install path: '-DCMAKE\_INSTALL\_PREFIX=/path'
|
||||
* To build the shared libraries and links the executables against it: '-DBUILD\_SHARED\_LIBS:bool=on' (default: 'ON')
|
||||
> Note: when using this option, static libraries are not built and executables are dynamically linked.
|
||||
* To build the CODEC executables: '-DBUILD\_CODEC:bool=on' (default: 'ON')
|
||||
* [OBSOLETE] To build the MJ2 executables: '-DBUILD\_MJ2:bool=on' (default: 'OFF')
|
||||
* [OBSOLETE] To build the JPWL executables and JPWL library: '-DBUILD\_JPWL:bool=on' (default: 'OFF')
|
||||
* [OBSOLETE] To build the JPIP client (java compiler recommended) library and executables: '-DBUILD\_JPIP:bool=on' (default: 'OFF')
|
||||
* [OBSOLETE] To build the JPIP server (need fcgi) library and executables: '-DBUILD\_JPIP\_SERVER:bool=on' (default: 'OFF')
|
||||
* To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
|
||||
```
|
||||
cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory' -DBUILDNAME:STRING='name_of_the_build'
|
||||
make
|
||||
make Experimental
|
||||
```
|
||||
Note : test data is available on the following github repo: https://github.com/uclouvain/openjpeg-data
|
||||
|
||||
If '-DOPJ\_DATA\_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE\_SOURCE\_DIR}/../data'.
|
||||
|
||||
Note 2 : to execute the encoding test suite, kakadu binaries are needed to decode encoded image and compare it to the baseline. Kakadu binaries are freely available for non-commercial purposes at http://www.kakadusoftware.com. kdu\_expand will need to be in your PATH for cmake to find it.
|
||||
|
||||
Note 3 : OpenJPEG encoder and decoder (not the library itself !) depends on several libraries: png, tiff, lcms, z. If these libraries are not found on the system, they are automatically built from the versions available in the source tree. You can force the use of these embedded version with BUILD\_THIRDPARTY:BOOL=ON. On a Debian-like system you can also simply install these libraries with:
|
||||
```
|
||||
sudo apt-get install liblcms2-dev libtiff-dev libpng-dev libz-dev
|
||||
```
|
||||
|
||||
Note 4 : On MacOS, if it does not work, try adding the following flag to the cmake command :
|
||||
```
|
||||
-DCMAKE_OSX_ARCHITECTURES:STRING=i386
|
||||
```
|
||||
|
||||
## MacOS (XCode) - WINDOWS (VisualStudio, etc)
|
||||
|
||||
You can use cmake to generate the project files for the IDE you are using (VC2010, XCode, etc).
|
||||
Type 'cmake --help' for available generators on your platform.
|
||||
|
||||
# Using OpenJPEG
|
||||
|
||||
To use openjpeg exported cmake file, simply create your application doing:
|
||||
|
||||
```
|
||||
$ cat CMakeLists.txt
|
||||
find_package(OpenJPEG REQUIRED)
|
||||
include_directories(${OPENJPEG_INCLUDE_DIRS})
|
||||
add_executable(myapp myapp.c)
|
||||
target_link_libraries(myapp ${OPENJPEG_LIBRARIES})
|
||||
```
|
11
LICENSE
11
LICENSE
@ -1,7 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2012, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2012, Antonin Descampe
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2003-2009, Francois-Olivier Devaux
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
|
21
NEWS
21
NEWS
@ -1,21 +0,0 @@
|
||||
|
||||
OpenJPEG NEWS - user visible changes
|
||||
====================================
|
||||
|
||||
Changes from OpenJPEG 1.5.x to OpenJPEG 2.0.0
|
||||
----------------------------------------------
|
||||
|
||||
New Features:
|
||||
|
||||
* streaming capabilities
|
||||
* merge JP3D
|
||||
|
||||
API modifications:
|
||||
|
||||
* Use a 64bits capable API
|
||||
|
||||
Misc:
|
||||
|
||||
* removed autotools build system
|
||||
* folders hierarchies reorganisation
|
||||
* Huge amount of bug fixes. See CHANGES for details.
|
72
NEWS.md
Normal file
72
NEWS.md
Normal file
@ -0,0 +1,72 @@
|
||||
# OpenJPEG NEWS
|
||||
|
||||
More details in the [Changelog](https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md)
|
||||
|
||||
## OpenJPEG 2.1.2
|
||||
|
||||
* Bug fixes (including security fixes)
|
||||
* No API/ABI break compared to v2.1.1
|
||||
|
||||
## OpenJPEG 2.1.1
|
||||
|
||||
* Huge amount of critical bugfixes
|
||||
* Speed improvements
|
||||
* No API/ABI break compared to v2.1
|
||||
|
||||
## OpenJPEG 2.1.0
|
||||
|
||||
### New Features
|
||||
|
||||
* Digital Cinema profiles have been fixed and updated
|
||||
* New option to disable MCT if needed
|
||||
* extended RAW support: it is now possible to input raw images
|
||||
with subsampled color components (422, 420, etc)
|
||||
* New way to deal with profiles
|
||||
|
||||
### API/ABI modifications
|
||||
(see [here](http://www.openjpeg.org/abi-check/timeline/openjpeg/) for details)
|
||||
|
||||
* Removed deprecated functions
|
||||
* opj_stream_create_default_file_stream(FILE*,...)
|
||||
* opj_stream_create_file_stream(FILE*,...)
|
||||
* opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data)
|
||||
* Added
|
||||
* opj_stream_create_default_file_stream(char*,...)
|
||||
* opj_stream_create_file_stream(char*,...)
|
||||
* opj_stream_destroy(opj_stream_t*)
|
||||
* opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data,
|
||||
... opj_stream_free_user_data_fn p_function)
|
||||
* JPEG 2000 profiles and Part-2 extensions defined through '#define'
|
||||
* Changed
|
||||
* 'alpha' field added to 'opj_image_comp' structure
|
||||
* 'OPJ_CLRSPC_EYCC' added to enum COLOR_SPACE
|
||||
* 'OPJ_CLRSPC_CMYK' added to enum COLOR_SPACE
|
||||
* 'OPJ_CODEC_JPP' and 'OPJ_CODEC_JPX' added to CODEC_FORMAT
|
||||
(not yet used in use)
|
||||
* 'max_cs_size' and 'rsiz' fields added to opj_cparameters_t
|
||||
|
||||
### Misc
|
||||
|
||||
* OpenJPEG is now officially conformant with JPEG 2000 Part-1
|
||||
and will soon become official reference software at the
|
||||
JPEG committee.
|
||||
* Huge amount of bug fixes. See CHANGES for details.
|
||||
|
||||
|
||||
## OpenJPEG 2.0.0
|
||||
|
||||
### New Features
|
||||
|
||||
* streaming capabilities
|
||||
* merge JP3D
|
||||
|
||||
### API modifications
|
||||
(see [here](http://www.openjpeg.org/abi-check/timeline/openjpeg/) for details)
|
||||
|
||||
* Use a 64bits capable API
|
||||
|
||||
### Misc
|
||||
|
||||
* removed autotools build system
|
||||
* folders hierarchies reorganisation
|
||||
* Huge amount of bug fixes. See CHANGES for details.
|
47
README
47
README
@ -1,47 +0,0 @@
|
||||
|
||||
OPENJPEG LIBRARY and APPLICATIONS
|
||||
----------------------------------
|
||||
|
||||
Details on folders hierarchy:
|
||||
|
||||
* src
|
||||
* lib
|
||||
* openjp2: contains the sources of the openjp2 library (Part 1 & 2)
|
||||
* openjpwl: contains the additional sources if you want to build a JPWL-flavoured library.
|
||||
* openjpip: complete client-server architecture for remote browsing of jpeg 2000 images.
|
||||
* openjp3d: JP3D implementation
|
||||
* openmj2: MJ2 implementation
|
||||
* bin: contains all applications that use the openjpeg library
|
||||
* common: common files to all applications
|
||||
* jp2: a basic codec
|
||||
* mj2: motion jpeg 2000 executables
|
||||
* jpip: OpenJPIP applications (server and dec server)
|
||||
* java: a Java client viewer for JPIP
|
||||
* jp3d: JP3D applications
|
||||
* tcltk: a test tool for JP3D
|
||||
* wx
|
||||
* OPJViewer: gui for displaying j2k files (based on wxWidget)
|
||||
* wrapping
|
||||
* java: java jni to use openjpeg in a java program
|
||||
* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
|
||||
* doc: doxygen documentation setup file and man pages
|
||||
* tests: configuration files and utilities for the openjpeg test suite. All test images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
|
||||
* cmake: cmake related files
|
||||
|
||||
see LICENSE for license and copyright information.
|
||||
see INSTALL for installation procedures.
|
||||
see NEWS for user visible changes in successive releases.
|
||||
see CHANGES for per-revision changes.
|
||||
|
||||
----------------
|
||||
API/ABI
|
||||
|
||||
OpenJPEG strives to provide a stable API/ABI for your applications. As such it
|
||||
only exposes a limited subset of its functions. It uses a mecanism of
|
||||
exporting/hiding functions. If you are unsure which functions you can use in
|
||||
your applications, you should compile OpenJPEG using something similar to gcc:
|
||||
-fvisibility=hidden compilation flag.
|
||||
See also: http://gcc.gnu.org/wiki/Visibility
|
||||
|
||||
On windows, MSVC directly supports export/hidding function and as such the only
|
||||
API available is the one supported by OpenJPEG.
|
82
README.md
Normal file
82
README.md
Normal file
@ -0,0 +1,82 @@
|
||||
|
||||
# OPENJPEG Library and Applications
|
||||
|
||||
## What is OpenJPEG ?
|
||||
|
||||
OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of [JPEG 2000](http://www.jpeg.org/jpeg2000), a still-image compression standard from the Joint Photographic Experts Group ([JPEG](http://www.jpeg.org)). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a [JPEG 2000 Reference Software](http://www.itu.int/rec/T-REC-T.804-201504-I!Amd2).
|
||||
|
||||
## Who can use the code ?
|
||||
[![badge-license]][link-license]
|
||||
|
||||
Anyone. As the OpenJPEG code is released under the [BSD 2-clause "Simplified" License][link-license], anyone can use or modify the code, even for commercial applications. The only restriction is to retain the copyright in the sources or in the binaries documentation. Of course, if you modified the code in a way that might be of interest for other users, you are encouraged to share it (through a [github pull request](https://github.com/uclouvain/openjpeg/pulls) or by filling an [issue](https://github.com/uclouvain/openjpeg/issues)) but this is not a requirement.
|
||||
|
||||
## How to install and use OpenJPEG ?
|
||||
API Documentation needs a major refactoring. Meanwhile, you can check [installation](https://github.com/uclouvain/openjpeg/wiki/Installation) instructions and [codec documentation](https://github.com/uclouvain/openjpeg/wiki/DocJ2KCodec).
|
||||
|
||||
## Current Status
|
||||
[![badge-build]][link-build]
|
||||
|
||||
[![badge-msvc-build]][link-msvc-build]
|
||||
|
||||
[![badge-coverity]][link-coverity]
|
||||
|
||||
## Who are the developers ?
|
||||
|
||||
The library is developed and maintained by the Image and Signal Processing Group ([ISPGroup](http://sites.uclouvain.be/ispgroup/)), in the Université catholique de Louvain ([UCL](http://www.uclouvain.be/en-index.html), with the support of the [CNES](https://cnes.fr/), the [CS](http://www.c-s.fr/) company and the [intoPIX](http://www.intopix.com) company. The JPWL module has been developed by the Digital Signal Processing Lab ([DSPLab](http://dsplab.diei.unipg.it/)) of the University of Perugia, Italy ([UNIPG](http://www.unipg.it/)).
|
||||
|
||||
## Details on folders hierarchy
|
||||
|
||||
* src
|
||||
* lib
|
||||
* openjp2: contains the sources of the openjp2 library (Part 1 & 2)
|
||||
* openjpwl: contains the additional sources if you want to build a JPWL-flavoured library.
|
||||
* openjpip: complete client-server architecture for remote browsing of jpeg 2000 images.
|
||||
* openjp3d: JP3D implementation
|
||||
* openmj2: MJ2 implementation
|
||||
* bin: contains all applications that use the openjpeg library
|
||||
* common: common files to all applications
|
||||
* jp2: a basic codec
|
||||
* mj2: motion jpeg 2000 executables
|
||||
* jpip: OpenJPIP applications (server and dec server)
|
||||
* java: a Java client viewer for JPIP
|
||||
* jp3d: JP3D applications
|
||||
* tcltk: a test tool for JP3D
|
||||
* wx
|
||||
* OPJViewer: gui for displaying j2k files (based on wxWidget)
|
||||
* wrapping
|
||||
* java: java jni to use openjpeg in a java program
|
||||
* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
|
||||
* doc: doxygen documentation setup file and man pages
|
||||
* tests: configuration files and utilities for the openjpeg test suite. All test images are located in [openjpeg-data](https://github.com/uclouvain/openjpeg-data) repository.
|
||||
* cmake: cmake related files
|
||||
|
||||
See [LICENSE][link-license] for license and copyright information.
|
||||
|
||||
See [INSTALL](https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md) for installation procedures.
|
||||
|
||||
See [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) for user visible changes in successive releases.
|
||||
|
||||
## API/ABI
|
||||
|
||||
An API/ABI timeline is automatically updated [here][link-api-timeline].
|
||||
|
||||
OpenJPEG strives to provide a stable API/ABI for your applications. As such it
|
||||
only exposes a limited subset of its functions. It uses a mechanism of
|
||||
exporting/hiding functions. If you are unsure which functions you can use in
|
||||
your applications, you should compile OpenJPEG using something similar to gcc:
|
||||
`-fvisibility=hidden` compilation flag.
|
||||
See also: http://gcc.gnu.org/wiki/Visibility
|
||||
|
||||
On windows, MSVC directly supports export/hiding function and as such the only
|
||||
API available is the one supported by OpenJPEG.
|
||||
|
||||
[comment-license]: https://img.shields.io/github/license/uclouvain/openjpeg.svg "https://img.shields.io/badge/license-BSD--2--Clause-blue.svg"
|
||||
[badge-license]: https://img.shields.io/badge/license-BSD--2--Clause-blue.svg "BSD 2-clause "Simplified" License"
|
||||
[link-license]: https://github.com/uclouvain/openjpeg/blob/master/LICENSE "BSD 2-clause "Simplified" License"
|
||||
[badge-build]: https://travis-ci.org/uclouvain/openjpeg.svg?branch=master "Build Status"
|
||||
[link-build]: https://travis-ci.org/uclouvain/openjpeg "Build Status"
|
||||
[badge-msvc-build]: https://ci.appveyor.com/api/projects/status/github/uclouvain/openjpeg?branch=master&svg=true "Windows Build Status"
|
||||
[link-msvc-build]: https://ci.appveyor.com/project/detonin/openjpeg/branch/master "Windows Build Status"
|
||||
[badge-coverity]: https://scan.coverity.com/projects/6383/badge.svg "Coverity Scan Build Status"
|
||||
[link-coverity]: https://scan.coverity.com/projects/uclouvain-openjpeg "Coverity Scan Build Status"
|
||||
[link-api-timeline]: http://www.openjpeg.org/abi-check/timeline/openjpeg "OpenJPEG API/ABI timeline"
|
33
THANKS
33
THANKS
@ -1,33 +0,0 @@
|
||||
OpenJPEG THANKS file
|
||||
|
||||
Many people have contributed to OpenJPEG by reporting problems, suggesting various improvements,
|
||||
or submitting actual code. Here is a list of these people. Help me keep
|
||||
it complete and exempt of errors.
|
||||
|
||||
Winfried Szukalski
|
||||
Vincent Torri
|
||||
Bob Friesenhahn
|
||||
Callum Lerwick
|
||||
Dzonatas Sol
|
||||
Julien Malik
|
||||
Jerôme Fimes
|
||||
Herve Drolon
|
||||
Yannick Verschueren
|
||||
Sebastien Lugan
|
||||
Kaori Hagihara
|
||||
Peter Wimmer
|
||||
Francois-Olivier Devaux
|
||||
Antonin Descampe
|
||||
David Janssens
|
||||
Pr. Benoit Macq
|
||||
Luis Ibanez
|
||||
Ben Boeckel
|
||||
Vincent Nicolas
|
||||
Glenn Pearson
|
||||
Giuseppe Baruffa
|
||||
Arnaud Maye
|
||||
Rex Dieter
|
||||
David Burken
|
||||
Parvatha Elangovan
|
||||
Hans Johnson
|
||||
Luc Hermitte
|
39
THANKS.md
Normal file
39
THANKS.md
Normal file
@ -0,0 +1,39 @@
|
||||
# OpenJPEG THANKS file
|
||||
|
||||
Many people have contributed to OpenJPEG by reporting problems, suggesting various improvements,
|
||||
or submitting actual code. Here is a list of these people. Help me keep
|
||||
it complete and exempt of errors.
|
||||
|
||||
* Giuseppe Baruffa
|
||||
* Ben Boeckel
|
||||
* Aaron Boxer
|
||||
* David Burken
|
||||
* Matthieu Darbois
|
||||
* Rex Dieter
|
||||
* Herve Drolon
|
||||
* Antonin Descampe
|
||||
* Francois-Olivier Devaux
|
||||
* Parvatha Elangovan
|
||||
* Jerôme Fimes
|
||||
* Bob Friesenhahn
|
||||
* Kaori Hagihara
|
||||
* Luc Hermitte
|
||||
* Luis Ibanez
|
||||
* David Janssens
|
||||
* Hans Johnson
|
||||
* Callum Lerwick
|
||||
* Ke Liu (Tencent's Xuanwu LAB)
|
||||
* Sebastien Lugan
|
||||
* Benoit Macq
|
||||
* Mathieu Malaterre
|
||||
* Julien Malik
|
||||
* Arnaud Maye
|
||||
* Vincent Nicolas
|
||||
* Aleksander Nikolic (Cisco Talos)
|
||||
* Glenn Pearson
|
||||
* Even Rouault
|
||||
* Dzonatas Sol
|
||||
* Winfried Szukalski
|
||||
* Vincent Torri
|
||||
* Yannick Verschueren
|
||||
* Peter Wimmer
|
38
appveyor.yml
Normal file
38
appveyor.yml
Normal file
@ -0,0 +1,38 @@
|
||||
version: 2.1.1.{build}
|
||||
branches:
|
||||
except:
|
||||
- coverity_scan
|
||||
skip_tags: false
|
||||
clone_depth: 50
|
||||
environment:
|
||||
matrix:
|
||||
- OPJ_CI_ARCH: x86
|
||||
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
|
||||
OPJ_CI_INCLUDE_IF_DEPLOY: 1
|
||||
- OPJ_CI_ARCH: x64
|
||||
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
|
||||
OPJ_CI_INCLUDE_IF_DEPLOY: 1
|
||||
- OPJ_CI_ARCH: x86
|
||||
OPJ_CI_VSCOMNTOOLS: $(VS100COMNTOOLS)
|
||||
install:
|
||||
- cmd: c:\cygwin\bin\bash ./tools/travis-ci/install.sh
|
||||
build_script:
|
||||
- cmd: >-
|
||||
"%OPJ_CI_VSCOMNTOOLS%..\..\VC\vcvarsall.bat" %OPJ_CI_ARCH%
|
||||
|
||||
bash ./tools/travis-ci/run.sh
|
||||
test: off
|
||||
#before_deploy:
|
||||
#- cmd: c:\cygwin\bin\bash ./tools/travis-ci/before_deploy.sh
|
||||
deploy:
|
||||
#release: openjpeg-$(appveyor_repo_tag_name)
|
||||
description: 'OpenJPEG $(appveyor_repo_tag_name) has been released. More info [here](https://github.com/uclouvain/openjpeg/blob/$(appveyor_repo_tag_name)/NEWS) and a detailed view [here](https://github.com/uclouvain/openjpeg/blob/$(appveyor_repo_tag_name)/CHANGES).'
|
||||
provider: GitHub
|
||||
auth_token:
|
||||
secure: Huk03f1heCD/HMyA+4ZeVmICdmKn9rPxK5p8/KxzgL+FtJDHlqcllcCrtN9bDxRH # your encrypted token from GitHub
|
||||
artifact: /.*\.zip/ # upload all zip packages to release assets
|
||||
draft: false
|
||||
prerelease: false
|
||||
on:
|
||||
appveyor_repo_tag: true # deploy on tag push only
|
||||
OPJ_CI_INCLUDE_IF_DEPLOY: 1
|
@ -25,12 +25,15 @@ set(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||
set(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||
${CTEST_CUSTOM_WARNING_EXCEPTION}
|
||||
|
||||
# Ignore clang's summary warning, assuming prior text has matched some
|
||||
# other warning expression:
|
||||
"[0-9,]+ warnings? generated."
|
||||
# Suppress warning caused by intentional messages about deprecation
|
||||
".*warning,.* is deprecated"
|
||||
# java also warns about deprecated API
|
||||
".*java.*deprecation"
|
||||
".*deprecation.*"
|
||||
# supress warnings caused by 3rd party libs:
|
||||
# suppress warnings caused by 3rd party libs:
|
||||
".*thirdparty.*"
|
||||
"libtiff.*has no symbols"
|
||||
"libpng.*has no symbols"
|
||||
|
12
cmake/FindJPYLYZER.cmake
Normal file
12
cmake/FindJPYLYZER.cmake
Normal file
@ -0,0 +1,12 @@
|
||||
#
|
||||
# this module looks for JPYLYZER
|
||||
# http://jpylyzer.openpreservation.org
|
||||
#
|
||||
|
||||
find_program(JPYLYZER_EXECUTABLE
|
||||
jpylyzer
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
JPYLYZER_EXECUTABLE
|
||||
)
|
@ -1,10 +1,11 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Cause a compile-time error if off_t is smaller than 64 bits */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* Cause a compile-time error if off_t is smaller than 64 bits */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#
|
||||
|
||||
macro(OPJ_TEST_LARGE_FILES VARIABLE)
|
||||
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||
if(NOT DEFINED ${VARIABLE})
|
||||
|
||||
# On most platforms it is probably overkill to first test the flags for 64-bit off_t,
|
||||
# and then separately fseeko. However, in the future we might have 128-bit filesystems
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2011, Mickael Savinaud, Communications & Systemes <mickael.savinaud@c-s.fr>
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -36,21 +36,21 @@
|
||||
*
|
||||
* \section home Home page
|
||||
*
|
||||
* The Home Page of the OpenJPEG library can be found at:
|
||||
*
|
||||
* http://code.google.com/p/openjpeg/
|
||||
*
|
||||
* More information about the OpenJPEG library is available here:
|
||||
* The Home Page of the OpenJPEG project can be found at:
|
||||
*
|
||||
* http://www.openjpeg.org/
|
||||
*
|
||||
* The source code repository is available here:
|
||||
*
|
||||
* http://github.com/uclouvain/openjpeg
|
||||
*
|
||||
* The OpenJPEG mailing list is located here:
|
||||
*
|
||||
* http://groups.google.com/group/openjpeg
|
||||
*
|
||||
* All the source code is online and can be retrieved using svn from here:
|
||||
* The test files repository is available here:
|
||||
*
|
||||
* http://openjpeg.googlecode.com/svn/
|
||||
* http://github.com/uclouvain/openjpeg-data
|
||||
*
|
||||
* \section license License
|
||||
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
|
||||
|
@ -29,10 +29,10 @@
|
||||
.SP
|
||||
.fi
|
||||
..
|
||||
.TH opj_compress 1 "Version 1.4.0" "opj_compress" "converts to jpeg2000 files"
|
||||
.TH opj_compress 1 "Version 2.1.1" "opj_compress" "converts to jpeg2000 files"
|
||||
.P
|
||||
.SH NAME
|
||||
opj_compress -
|
||||
opj_compress \-
|
||||
This program reads in an image of a certain type and converts it to a
|
||||
jpeg2000 file. It is part of the OpenJPEG library.
|
||||
.SP
|
||||
@ -43,20 +43,20 @@ Valid output image extensions are
|
||||
.B .j2k, .jp2
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
.B opj_compress -i \fRinfile.bmp \fB-o \fRoutfile.j2k
|
||||
.B opj_compress \-i \fRinfile.bmp \fB-o \fRoutfile.j2k
|
||||
.P
|
||||
.B opj_compress -ImgDir \fRdirectory_name \fB-OutFor \fRjp2
|
||||
.B opj_compress \-ImgDir \fRdirectory_name \fB-OutFor \fRjp2
|
||||
.P
|
||||
.B opj_compress -h \fRPrint a help message and exit.
|
||||
.B opj_compress \-h \fRPrint a help message and exit.
|
||||
.P
|
||||
.R See JPWL OPTIONS for special options
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-\^b " n,n"
|
||||
(Size of code block (e.g. -b 32,32). Default: 64 x 64)
|
||||
(Size of code block (e.g. \-b 32,32). Default: 64 x 64)
|
||||
.TP
|
||||
.B \-\^c " n"
|
||||
(Size of precinct (e.g. -c 128,128). Default: 2^15 x 2^15)
|
||||
(Size of precinct (e.g. \-c 128,128). Default: 2^15 x 2^15)
|
||||
.TP
|
||||
.B \-\^cinema2K " fps"
|
||||
Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or 48.
|
||||
@ -65,7 +65,7 @@ Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or
|
||||
Digital Cinema 4K profile compliant codestream. Does not need an fps: default is 24 fps.
|
||||
.TP
|
||||
.B \-\^d " X,Y"
|
||||
(Offset of image origin (e.g. -d 150,300))
|
||||
(Offset of image origin (e.g. \-d 150,300))
|
||||
.TP
|
||||
.B \-\^h
|
||||
Print a help message and exit.
|
||||
@ -85,20 +85,20 @@ Progression order. \fBname\fR can be one out of:LRCP, RLCP, RPCL, PCRL, CPRL. De
|
||||
.B \-\^q " n"
|
||||
different psnr for successive layers
|
||||
.br
|
||||
.B Note: \fR(options -r and -q cannot be used together)
|
||||
.B Note: \fR(options \-r and \-q cannot be used together)
|
||||
.TP
|
||||
.B \-\^r " n"
|
||||
different compression ratio(s) for successive layers. The rate specified for each quality level is the desired compression factor.
|
||||
.br
|
||||
.B Note: \fR(options -r and -q cannot be used together)
|
||||
.B Note: \fR(options \-r and \-q cannot be used together)
|
||||
.TP
|
||||
.B \-\^s " X,Y"
|
||||
sub-sampling factor (e.g. -s 2,2). Default: No sub-sampling in x or y direction.
|
||||
sub-sampling factor (e.g. \-s 2,2). Default: No sub-sampling in x or y direction.
|
||||
.br
|
||||
.B Remark: \fRsub-sampling bigger than 2 can produce errors.
|
||||
.TP
|
||||
.B \-\^t " W,H"
|
||||
(Size of tile (e.g. -t 512,512) )
|
||||
(Size of tile (e.g. \-t 512,512) )
|
||||
.TP
|
||||
.B \-\^x " name"
|
||||
(Create index file and fill it. Default: no index file)
|
||||
@ -132,7 +132,7 @@ ERTERM(16)
|
||||
.br
|
||||
SEGMARK(32)
|
||||
.br
|
||||
Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38
|
||||
Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = \-M 38
|
||||
.TP
|
||||
.B \-\^OutFor "ext"
|
||||
(extension for output files)
|
||||
@ -149,7 +149,7 @@ e.g. \fB-ROI c=0,U=25\fR
|
||||
(Write SOP marker before each packet. Default: No SOP marker in the codestream.)
|
||||
.TP
|
||||
.B \-\^T "X,Y"
|
||||
(Offset of the origin of the tiles (e.g. -T 100,75) )
|
||||
(Offset of the origin of the tiles (e.g. \-T 100,75) )
|
||||
.TP
|
||||
.B \-\^W
|
||||
(see JPWL OPTIONS)
|
||||
@ -157,7 +157,7 @@ e.g. \fB-ROI c=0,U=25\fR
|
||||
.SH JPWL OPTIONS
|
||||
Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
|
||||
.P
|
||||
.B -W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type>
|
||||
.B \-W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type>
|
||||
.P
|
||||
.B h\fR selects the header error protection (EPB): \fBtype\fR can be
|
||||
[0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]
|
||||
@ -176,7 +176,7 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
|
||||
(max. 16 specs)
|
||||
.P
|
||||
.B s \fRenables sensitivity data insertion (ESD): \fBmethod\fR can be
|
||||
[-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR
|
||||
[\-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR
|
||||
4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]
|
||||
if \fBtilepart\fR is absent, it is for main header only
|
||||
if \fBtilepart\fR is present, it applies from that tile
|
||||
@ -194,18 +194,18 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
|
||||
.P
|
||||
.SH EXAMPLES
|
||||
.P
|
||||
.B opj_compress -i \fRfile.bmp \fB-o \fRfile.j2k \fB-r \fR20,10,1 (compress 20x, then 10x, then lossless).
|
||||
.B opj_compress \-i \fRfile.bmp \fB-o \fRfile.j2k \fB-r \fR20,10,1 (compress 20x, then 10x, then lossless).
|
||||
.P
|
||||
.B opj_compress -i \fRfile.ppm \fB-o \fRfile.j2k \fB-q \fR30,40,50
|
||||
.B opj_compress \-i \fRfile.ppm \fB-o \fRfile.j2k \fB-q \fR30,40,50
|
||||
.P
|
||||
.B opj_compress -i \fRfile.pgx \fB-o \fRfile.j2k \fB-POC \fRT1=0,0,1,5,3,CPRL
|
||||
.B opj_compress \-i \fRfile.pgx \fB-o \fRfile.j2k \fB-POC \fRT1=0,0,1,5,3,CPRL
|
||||
.P
|
||||
.B opj_compress -i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u
|
||||
.B opj_compress \-i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u
|
||||
.P
|
||||
.SH AUTHORS
|
||||
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
.br
|
||||
Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
.br
|
||||
Copyright (c) 2001-2003, David Janssens
|
||||
.br
|
||||
|
@ -29,10 +29,10 @@
|
||||
.SP
|
||||
.fi
|
||||
..
|
||||
.TH opj_decompress 1 "Version 1.4.0" "opj_decompress" "converts jpeg2000 files"
|
||||
.TH opj_decompress 1 "Version 2.1.1" "opj_decompress" "converts jpeg2000 files"
|
||||
.P
|
||||
.SH NAME
|
||||
opj_decompress -
|
||||
opj_decompress \-
|
||||
This program reads in a jpeg2000 image and converts it to another
|
||||
image type. It is part of the OpenJPEG library.
|
||||
.SP
|
||||
@ -43,11 +43,11 @@ Valid output image extensions are
|
||||
.B .bmp, .pgm, .pgx, .png, .pnm, .ppm, .raw, .tga, .tif \fR. For PNG resp. TIF it needs libpng resp. libtiff .
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
.B opj_decompress -i \fRinfile.j2k \fB-o \fRoutfile.png
|
||||
.B opj_decompress \-i \fRinfile.j2k \fB-o \fRoutfile.png
|
||||
.P
|
||||
.B opj_decompress -ImgDir \fRimages/ \fB-OutFor \fRbmp
|
||||
.B opj_decompress \-ImgDir \fRimages/ \fB-OutFor \fRbmp
|
||||
.P
|
||||
.B opj_decompress -h \fRPrint help message and exit
|
||||
.B opj_decompress \-h \fRPrint help message and exit
|
||||
.P
|
||||
.R See JPWL OPTIONS for special options
|
||||
.SH OPTIONS
|
||||
@ -73,9 +73,19 @@ n is the maximum number of quality layers to decode. See LAYERS below)
|
||||
.B \-\^OutFor "ext"
|
||||
(extension for output files)
|
||||
.P
|
||||
.SH JPIP OPTIONS
|
||||
Options usable only if the library has been compiled with
|
||||
.B BUILD_JPIP
|
||||
.TP
|
||||
.B -jpip
|
||||
Embed index table box into the output JP2 file (compulsory for JPIP)
|
||||
.TP
|
||||
.B -TP R
|
||||
Partition a tile into tile parts of different resolution levels (compulsory for JPT-stream)
|
||||
.P
|
||||
.SH JPWL OPTIONS
|
||||
Options usable only if the library has been compiled with
|
||||
.B -DUSE_JPWL
|
||||
.B BUILD_JPWL
|
||||
.TP
|
||||
.B -W c\fR[=Nc] (Nc is the number of expected components in the codestream; default:3)
|
||||
.TP
|
||||
@ -91,9 +101,9 @@ Set the maximum number of quality layers to decode. If there are less quality la
|
||||
.P
|
||||
'\".SH BUGS
|
||||
.SH AUTHORS
|
||||
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
.br
|
||||
Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
.br
|
||||
Copyright (c) 2001-2003, David Janssens
|
||||
.br
|
||||
|
@ -29,10 +29,10 @@
|
||||
.SP
|
||||
.fi
|
||||
..
|
||||
.TH opj_dump 1 "Version 1.4.0" "opj_dump" "dumps jpeg2000 files"
|
||||
.TH opj_dump 1 "Version 2.1.1" "opj_dump" "dumps jpeg2000 files"
|
||||
.P
|
||||
.SH NAME
|
||||
opj_dump -
|
||||
opj_dump \-
|
||||
This program reads in a jpeg2000 image and dumps the contents to stdout. It is part of the OpenJPEG library.
|
||||
.SP
|
||||
Valid input image extensions are
|
||||
@ -40,11 +40,11 @@ Valid input image extensions are
|
||||
.SP
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
.B opj_dump -i \fRinfile.j2k
|
||||
.B opj_dump \-i \fRinfile.j2k
|
||||
.P
|
||||
.B opj_dump -ImgDir \fRimages/ \fRDump all files in images/
|
||||
.B opj_dump \-ImgDir \fRimages/ \fRDump all files in images/
|
||||
.P
|
||||
.B opj_dump -h \fRPrint help message and exit
|
||||
.B opj_dump \-h \fRPrint help message and exit
|
||||
.P
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
|
@ -313,9 +313,9 @@ typedef struct opj_cparameters
|
||||
'\".SH OPTIONS
|
||||
'\".SH BUGS
|
||||
.SH AUTHORS
|
||||
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
|
||||
Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
|
||||
Copyright (c) 2001-2003, David Janssens
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -64,7 +64,7 @@
|
||||
*
|
||||
*
|
||||
* \section sysarchtect System Architecture
|
||||
* JPIP protocol is implimented between the JPIP server program (opj_server) and the JPIP client java program (opj_viewer).\n
|
||||
* JPIP protocol is implemented between the JPIP server program (opj_server) and the JPIP client java program (opj_viewer).\n
|
||||
* Figure below represents the overview of our system architecture.\n
|
||||
* The JPIP server parses JPIP query and sends corresponding JPT/JPP-stream.
|
||||
* The JPIP client viewer is an image viewer with GUI to publish JPIP requests and receive JPT/JPP-stream.\n
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -34,5 +40,8 @@
|
||||
|
||||
extern void color_sycc_to_rgb(opj_image_t *img);
|
||||
extern void color_apply_icc_profile(opj_image_t *image);
|
||||
extern void color_cielab_to_rgb(opj_image_t *image);
|
||||
|
||||
extern void color_cmyk_to_rgb(opj_image_t *image);
|
||||
extern void color_esycc_to_rgb(opj_image_t *image);
|
||||
#endif /* _OPJ_COLOR_H_ */
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "opj_config_private.h"
|
||||
|
||||
/* create opj_apps_config.h for CMake */
|
||||
|
||||
#cmakedefine OPJ_HAVE_LIBPNG @HAVE_LIBPNG@
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 3-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 1987, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -49,7 +54,7 @@ int opj_opterr = 1, /* if error message should be printed */
|
||||
static char EMSG[]={""};
|
||||
|
||||
/* As this class remembers its values from one Java call to the other, reset the values before each use */
|
||||
void reset_options_reading(void) {
|
||||
void opj_reset_options_reading(void) {
|
||||
opj_opterr = 1;
|
||||
opj_optind = 1;
|
||||
}
|
||||
@ -61,7 +66,7 @@ void reset_options_reading(void) {
|
||||
int opj_getopt(int nargc, char *const *nargv, const char *ostr) {
|
||||
# define __progname nargv[0]
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
char *oli = NULL; /* option letter list index */
|
||||
const char *oli = NULL; /* option letter list index */
|
||||
|
||||
if (opj_optreset || !*place) { /* update scanning pointer */
|
||||
opj_optreset = 0;
|
||||
@ -120,7 +125,7 @@ int opj_getopt(int nargc, char *const *nargv, const char *ostr) {
|
||||
int opj_getopt_long(int argc, char * const argv[], const char *optstring,
|
||||
const opj_option_t *longopts, int totlen) {
|
||||
static int lastidx,lastofs;
|
||||
char *tmp;
|
||||
const char *tmp;
|
||||
int i,len;
|
||||
char param = 1;
|
||||
|
||||
|
@ -24,6 +24,6 @@ extern char *opj_optarg;
|
||||
extern int opj_getopt(int nargc, char *const *nargv, const char *ostr);
|
||||
extern int opj_getopt_long(int argc, char * const argv[], const char *optstring,
|
||||
const opj_option_t *longopts, int totlen);
|
||||
extern void reset_options_reading(void);
|
||||
extern void opj_reset_options_reading(void);
|
||||
|
||||
#endif /* _GETOPT_H_ */
|
||||
|
72
src/bin/common/opj_string.h
Normal file
72
src/bin/common/opj_string.h
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2015, Matthieu Darbois
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef OPJ_STRING_H
|
||||
#define OPJ_STRING_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
/* strnlen is not standard, strlen_s is C11... */
|
||||
/* keep in mind there still is a buffer read overflow possible */
|
||||
static size_t opj_strnlen_s(const char *src, size_t max_len)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (src == NULL) {
|
||||
return 0U;
|
||||
}
|
||||
for (len = 0U; (*src != '\0') && (len < max_len); src++, len++);
|
||||
return len;
|
||||
}
|
||||
|
||||
/* should be equivalent to C11 function except for the handler */
|
||||
/* keep in mind there still is a buffer read overflow possible */
|
||||
static int opj_strcpy_s(char* dst, size_t dst_size, const char* src)
|
||||
{
|
||||
size_t src_len = 0U;
|
||||
if ((dst == NULL) || (dst_size == 0U)) {
|
||||
return EINVAL;
|
||||
}
|
||||
if (src == NULL) {
|
||||
dst[0] = '\0';
|
||||
return EINVAL;
|
||||
}
|
||||
src_len = opj_strnlen_s(src, dst_size);
|
||||
if (src_len >= dst_size) {
|
||||
return ERANGE;
|
||||
}
|
||||
memcpy(dst, src, src_len);
|
||||
dst[src_len] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* OPJ_STRING_H */
|
@ -3,11 +3,24 @@
|
||||
# First thing define the common source:
|
||||
set(common_SRCS
|
||||
convert.c
|
||||
convert.h
|
||||
convertbmp.c
|
||||
index.c
|
||||
index.h
|
||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
|
||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.h
|
||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
|
||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.h
|
||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_string.h
|
||||
)
|
||||
|
||||
if(OPJ_HAVE_LIBTIFF)
|
||||
list(APPEND common_SRCS converttif.c)
|
||||
endif()
|
||||
if(OPJ_HAVE_LIBPNG)
|
||||
list(APPEND common_SRCS convertpng.c)
|
||||
endif()
|
||||
|
||||
# Headers file are located here:
|
||||
include_directories(
|
||||
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
||||
@ -44,14 +57,24 @@ foreach(exe opj_decompress opj_compress opj_dump)
|
||||
# On unix you need to link to the math library:
|
||||
if(UNIX)
|
||||
target_link_libraries(${exe} m)
|
||||
IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||
target_link_libraries(${exe} rt)
|
||||
endif()
|
||||
endif()
|
||||
# Install exe
|
||||
install(TARGETS ${exe}
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
||||
if(OPJ_USE_DSYMUTIL)
|
||||
add_custom_command(TARGET ${exe} POST_BUILD
|
||||
COMMAND "dsymutil" "$<TARGET_FILE:${exe}>"
|
||||
COMMENT "dsymutil $<TARGET_FILE:${exe}>"
|
||||
DEPENDS ${exe})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(BUILD_DOC)
|
||||
# Install man pages
|
||||
install(
|
||||
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
|
||||
@ -59,3 +82,4 @@ install(
|
||||
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
|
||||
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
|
||||
#
|
||||
endif()
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -31,6 +37,16 @@
|
||||
#ifndef __J2K_CONVERT_H
|
||||
#define __J2K_CONVERT_H
|
||||
|
||||
/**@name RAW component encoding parameters */
|
||||
/*@{*/
|
||||
typedef struct raw_comp_cparameters {
|
||||
/** subsampling in X direction */
|
||||
int dx;
|
||||
/** subsampling in Y direction */
|
||||
int dy;
|
||||
/*@}*/
|
||||
} raw_comp_cparameters_t;
|
||||
|
||||
/**@name RAW image encoding parameters */
|
||||
/*@{*/
|
||||
typedef struct raw_cparameters {
|
||||
@ -38,15 +54,34 @@ typedef struct raw_cparameters {
|
||||
int rawWidth;
|
||||
/** height of the raw image */
|
||||
int rawHeight;
|
||||
/** components of the raw image */
|
||||
/** number of components of the raw image */
|
||||
int rawComp;
|
||||
/** bit depth of the raw image */
|
||||
int rawBitDepth;
|
||||
/** signed/unsigned raw image */
|
||||
OPJ_BOOL rawSigned;
|
||||
/** bit depth of the raw image */
|
||||
int rawBitDepth;
|
||||
/** signed/unsigned raw image */
|
||||
OPJ_BOOL rawSigned;
|
||||
/** raw components parameters */
|
||||
raw_comp_cparameters_t *rawComps;
|
||||
/*@}*/
|
||||
} raw_cparameters_t;
|
||||
|
||||
/* Component precision clipping */
|
||||
void clip_component(opj_image_comp_t* component, OPJ_UINT32 precision);
|
||||
/* Component precision scaling */
|
||||
void scale_component(opj_image_comp_t* component, OPJ_UINT32 precision);
|
||||
|
||||
/* planar / interleaved conversions */
|
||||
typedef void (* convert_32s_CXPX)(const OPJ_INT32* pSrc, OPJ_INT32* const* pDst, OPJ_SIZE_T length);
|
||||
extern const convert_32s_CXPX convert_32s_CXPX_LUT[5];
|
||||
typedef void (* convert_32s_PXCX)(OPJ_INT32 const* const* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length, OPJ_INT32 adjust);
|
||||
extern const convert_32s_PXCX convert_32s_PXCX_LUT[5];
|
||||
/* bit depth conversions */
|
||||
typedef void (* convert_XXx32s_C1R)(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length);
|
||||
extern const convert_XXx32s_C1R convert_XXu32s_C1R_LUT[9]; /* up to 8bpp */
|
||||
typedef void (* convert_32sXXx_C1R)(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length);
|
||||
extern const convert_32sXXx_C1R convert_32sXXu_C1R_LUT[9]; /* up to 8bpp */
|
||||
|
||||
|
||||
/* TGA conversion */
|
||||
opj_image_t* tgatoimage(const char *filename, opj_cparameters_t *parameters);
|
||||
int imagetotga(opj_image_t * image, const char *outfile);
|
||||
@ -68,7 +103,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters);
|
||||
int imagetopgx(opj_image_t *image, const char *outfile);
|
||||
|
||||
opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters);
|
||||
int imagetopnm(opj_image_t *image, const char *outfile);
|
||||
int imagetopnm(opj_image_t *image, const char *outfile, int force_split);
|
||||
|
||||
/* RAW conversion */
|
||||
int imagetoraw(opj_image_t * image, const char *outfile);
|
||||
|
996
src/bin/jp2/convertbmp.c
Normal file
996
src/bin/jp2/convertbmp.c
Normal file
@ -0,0 +1,996 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2006-2007, Parvatha Elangovan
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "opj_apps_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "openjpeg.h"
|
||||
#include "convert.h"
|
||||
|
||||
typedef struct {
|
||||
OPJ_UINT16 bfType; /* 'BM' for Bitmap (19776) */
|
||||
OPJ_UINT32 bfSize; /* Size of the file */
|
||||
OPJ_UINT16 bfReserved1; /* Reserved : 0 */
|
||||
OPJ_UINT16 bfReserved2; /* Reserved : 0 */
|
||||
OPJ_UINT32 bfOffBits; /* Offset */
|
||||
} OPJ_BITMAPFILEHEADER;
|
||||
|
||||
typedef struct {
|
||||
OPJ_UINT32 biSize; /* Size of the structure in bytes */
|
||||
OPJ_UINT32 biWidth; /* Width of the image in pixels */
|
||||
OPJ_UINT32 biHeight; /* Heigth of the image in pixels */
|
||||
OPJ_UINT16 biPlanes; /* 1 */
|
||||
OPJ_UINT16 biBitCount; /* Number of color bits by pixels */
|
||||
OPJ_UINT32 biCompression; /* Type of encoding 0: none 1: RLE8 2: RLE4 */
|
||||
OPJ_UINT32 biSizeImage; /* Size of the image in bytes */
|
||||
OPJ_UINT32 biXpelsPerMeter; /* Horizontal (X) resolution in pixels/meter */
|
||||
OPJ_UINT32 biYpelsPerMeter; /* Vertical (Y) resolution in pixels/meter */
|
||||
OPJ_UINT32 biClrUsed; /* Number of color used in the image (0: ALL) */
|
||||
OPJ_UINT32 biClrImportant; /* Number of important color (0: ALL) */
|
||||
OPJ_UINT32 biRedMask; /* Red channel bit mask */
|
||||
OPJ_UINT32 biGreenMask; /* Green channel bit mask */
|
||||
OPJ_UINT32 biBlueMask; /* Blue channel bit mask */
|
||||
OPJ_UINT32 biAlphaMask; /* Alpha channel bit mask */
|
||||
OPJ_UINT32 biColorSpaceType; /* Color space type */
|
||||
OPJ_UINT8 biColorSpaceEP[36]; /* Color space end points */
|
||||
OPJ_UINT32 biRedGamma; /* Red channel gamma */
|
||||
OPJ_UINT32 biGreenGamma; /* Green channel gamma */
|
||||
OPJ_UINT32 biBlueGamma; /* Blue channel gamma */
|
||||
OPJ_UINT32 biIntent; /* Intent */
|
||||
OPJ_UINT32 biIccProfileData; /* ICC profile data */
|
||||
OPJ_UINT32 biIccProfileSize; /* ICC profile size */
|
||||
OPJ_UINT32 biReserved; /* Reserved */
|
||||
} OPJ_BITMAPINFOHEADER;
|
||||
|
||||
static void opj_applyLUT8u_8u32s_C1R(
|
||||
OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride,
|
||||
OPJ_INT32* pDst, OPJ_INT32 dstStride,
|
||||
OPJ_UINT8 const* pLUT,
|
||||
OPJ_UINT32 width, OPJ_UINT32 height)
|
||||
{
|
||||
OPJ_UINT32 y;
|
||||
|
||||
for (y = height; y != 0U; --y) {
|
||||
OPJ_UINT32 x;
|
||||
|
||||
for(x = 0; x < width; x++)
|
||||
{
|
||||
pDst[x] = (OPJ_INT32)pLUT[pSrc[x]];
|
||||
}
|
||||
pSrc += srcStride;
|
||||
pDst += dstStride;
|
||||
}
|
||||
}
|
||||
|
||||
static void opj_applyLUT8u_8u32s_C1P3R(
|
||||
OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride,
|
||||
OPJ_INT32* const* pDst, OPJ_INT32 const* pDstStride,
|
||||
OPJ_UINT8 const* const* pLUT,
|
||||
OPJ_UINT32 width, OPJ_UINT32 height)
|
||||
{
|
||||
OPJ_UINT32 y;
|
||||
OPJ_INT32* pR = pDst[0];
|
||||
OPJ_INT32* pG = pDst[1];
|
||||
OPJ_INT32* pB = pDst[2];
|
||||
OPJ_UINT8 const* pLUT_R = pLUT[0];
|
||||
OPJ_UINT8 const* pLUT_G = pLUT[1];
|
||||
OPJ_UINT8 const* pLUT_B = pLUT[2];
|
||||
|
||||
for (y = height; y != 0U; --y) {
|
||||
OPJ_UINT32 x;
|
||||
|
||||
for(x = 0; x < width; x++)
|
||||
{
|
||||
OPJ_UINT8 idx = pSrc[x];
|
||||
pR[x] = (OPJ_INT32)pLUT_R[idx];
|
||||
pG[x] = (OPJ_INT32)pLUT_G[idx];
|
||||
pB[x] = (OPJ_INT32)pLUT_B[idx];
|
||||
}
|
||||
pSrc += srcStride;
|
||||
pR += pDstStride[0];
|
||||
pG += pDstStride[1];
|
||||
pB += pDstStride[2];
|
||||
}
|
||||
}
|
||||
|
||||
static void bmp24toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image)
|
||||
{
|
||||
int index;
|
||||
OPJ_UINT32 width, height;
|
||||
OPJ_UINT32 x, y;
|
||||
const OPJ_UINT8 *pSrc = NULL;
|
||||
|
||||
width = image->comps[0].w;
|
||||
height = image->comps[0].h;
|
||||
|
||||
index = 0;
|
||||
pSrc = pData + (height - 1U) * stride;
|
||||
for(y = 0; y < height; y++)
|
||||
{
|
||||
for(x = 0; x < width; x++)
|
||||
{
|
||||
image->comps[0].data[index] = (OPJ_INT32)pSrc[3*x+2]; /* R */
|
||||
image->comps[1].data[index] = (OPJ_INT32)pSrc[3*x+1]; /* G */
|
||||
image->comps[2].data[index] = (OPJ_INT32)pSrc[3*x+0]; /* B */
|
||||
index++;
|
||||
}
|
||||
pSrc -= stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void bmp_mask_get_shift_and_prec(OPJ_UINT32 mask, OPJ_UINT32* shift, OPJ_UINT32* prec)
|
||||
{
|
||||
OPJ_UINT32 l_shift, l_prec;
|
||||
|
||||
l_shift = l_prec = 0U;
|
||||
|
||||
if (mask != 0U) {
|
||||
while ((mask & 1U) == 0U) {
|
||||
mask >>= 1;
|
||||
l_shift++;
|
||||
}
|
||||
while (mask & 1U) {
|
||||
mask >>= 1;
|
||||
l_prec++;
|
||||
}
|
||||
}
|
||||
*shift = l_shift; *prec = l_prec;
|
||||
}
|
||||
|
||||
static void bmpmask32toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT32 redMask, OPJ_UINT32 greenMask, OPJ_UINT32 blueMask, OPJ_UINT32 alphaMask)
|
||||
{
|
||||
int index;
|
||||
OPJ_UINT32 width, height;
|
||||
OPJ_UINT32 x, y;
|
||||
const OPJ_UINT8 *pSrc = NULL;
|
||||
OPJ_BOOL hasAlpha;
|
||||
OPJ_UINT32 redShift, redPrec;
|
||||
OPJ_UINT32 greenShift, greenPrec;
|
||||
OPJ_UINT32 blueShift, bluePrec;
|
||||
OPJ_UINT32 alphaShift, alphaPrec;
|
||||
|
||||
width = image->comps[0].w;
|
||||
height = image->comps[0].h;
|
||||
|
||||
hasAlpha = image->numcomps > 3U;
|
||||
|
||||
bmp_mask_get_shift_and_prec(redMask, &redShift, &redPrec);
|
||||
bmp_mask_get_shift_and_prec(greenMask, &greenShift, &greenPrec);
|
||||
bmp_mask_get_shift_and_prec(blueMask, &blueShift, &bluePrec);
|
||||
bmp_mask_get_shift_and_prec(alphaMask, &alphaShift, &alphaPrec);
|
||||
|
||||
image->comps[0].bpp = redPrec;
|
||||
image->comps[0].prec = redPrec;
|
||||
image->comps[1].bpp = greenPrec;
|
||||
image->comps[1].prec = greenPrec;
|
||||
image->comps[2].bpp = bluePrec;
|
||||
image->comps[2].prec = bluePrec;
|
||||
if (hasAlpha) {
|
||||
image->comps[3].bpp = alphaPrec;
|
||||
image->comps[3].prec = alphaPrec;
|
||||
}
|
||||
|
||||
index = 0;
|
||||
pSrc = pData + (height - 1U) * stride;
|
||||
for(y = 0; y < height; y++)
|
||||
{
|
||||
for(x = 0; x < width; x++)
|
||||
{
|
||||
OPJ_UINT32 value = 0U;
|
||||
|
||||
value |= ((OPJ_UINT32)pSrc[4*x+0]) << 0;
|
||||
value |= ((OPJ_UINT32)pSrc[4*x+1]) << 8;
|
||||
value |= ((OPJ_UINT32)pSrc[4*x+2]) << 16;
|
||||
value |= ((OPJ_UINT32)pSrc[4*x+3]) << 24;
|
||||
|
||||
image->comps[0].data[index] = (OPJ_INT32)((value & redMask) >> redShift); /* R */
|
||||
image->comps[1].data[index] = (OPJ_INT32)((value & greenMask) >> greenShift); /* G */
|
||||
image->comps[2].data[index] = (OPJ_INT32)((value & blueMask) >> blueShift); /* B */
|
||||
if (hasAlpha) {
|
||||
image->comps[3].data[index] = (OPJ_INT32)((value & alphaMask) >> alphaShift); /* A */
|
||||
}
|
||||
index++;
|
||||
}
|
||||
pSrc -= stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void bmpmask16toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT32 redMask, OPJ_UINT32 greenMask, OPJ_UINT32 blueMask, OPJ_UINT32 alphaMask)
|
||||
{
|
||||
int index;
|
||||
OPJ_UINT32 width, height;
|
||||
OPJ_UINT32 x, y;
|
||||
const OPJ_UINT8 *pSrc = NULL;
|
||||
OPJ_BOOL hasAlpha;
|
||||
OPJ_UINT32 redShift, redPrec;
|
||||
OPJ_UINT32 greenShift, greenPrec;
|
||||
OPJ_UINT32 blueShift, bluePrec;
|
||||
OPJ_UINT32 alphaShift, alphaPrec;
|
||||
|
||||
width = image->comps[0].w;
|
||||
height = image->comps[0].h;
|
||||
|
||||
hasAlpha = image->numcomps > 3U;
|
||||
|
||||
bmp_mask_get_shift_and_prec(redMask, &redShift, &redPrec);
|
||||
bmp_mask_get_shift_and_prec(greenMask, &greenShift, &greenPrec);
|
||||
bmp_mask_get_shift_and_prec(blueMask, &blueShift, &bluePrec);
|
||||
bmp_mask_get_shift_and_prec(alphaMask, &alphaShift, &alphaPrec);
|
||||
|
||||
image->comps[0].bpp = redPrec;
|
||||
image->comps[0].prec = redPrec;
|
||||
image->comps[1].bpp = greenPrec;
|
||||
image->comps[1].prec = greenPrec;
|
||||
image->comps[2].bpp = bluePrec;
|
||||
image->comps[2].prec = bluePrec;
|
||||
if (hasAlpha) {
|
||||
image->comps[3].bpp = alphaPrec;
|
||||
image->comps[3].prec = alphaPrec;
|
||||
}
|
||||
|
||||
index = 0;
|
||||
pSrc = pData + (height - 1U) * stride;
|
||||
for(y = 0; y < height; y++)
|
||||
{
|
||||
for(x = 0; x < width; x++)
|
||||
{
|
||||
OPJ_UINT32 value = 0U;
|
||||
|
||||
value |= ((OPJ_UINT32)pSrc[2*x+0]) << 0;
|
||||
value |= ((OPJ_UINT32)pSrc[2*x+1]) << 8;
|
||||
|
||||
image->comps[0].data[index] = (OPJ_INT32)((value & redMask) >> redShift); /* R */
|
||||
image->comps[1].data[index] = (OPJ_INT32)((value & greenMask) >> greenShift); /* G */
|
||||
image->comps[2].data[index] = (OPJ_INT32)((value & blueMask) >> blueShift); /* B */
|
||||
if (hasAlpha) {
|
||||
image->comps[3].data[index] = (OPJ_INT32)((value & alphaMask) >> alphaShift); /* A */
|
||||
}
|
||||
index++;
|
||||
}
|
||||
pSrc -= stride;
|
||||
}
|
||||
}
|
||||
|
||||
static opj_image_t* bmp8toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT8 const* const* pLUT)
|
||||
{
|
||||
OPJ_UINT32 width, height;
|
||||
const OPJ_UINT8 *pSrc = NULL;
|
||||
|
||||
width = image->comps[0].w;
|
||||
height = image->comps[0].h;
|
||||
|
||||
pSrc = pData + (height - 1U) * stride;
|
||||
if (image->numcomps == 1U) {
|
||||
opj_applyLUT8u_8u32s_C1R(pSrc, -(OPJ_INT32)stride, image->comps[0].data, (OPJ_INT32)width, pLUT[0], width, height);
|
||||
}
|
||||
else {
|
||||
OPJ_INT32* pDst[3];
|
||||
OPJ_INT32 pDstStride[3];
|
||||
|
||||
pDst[0] = image->comps[0].data; pDst[1] = image->comps[1].data; pDst[2] = image->comps[2].data;
|
||||
pDstStride[0] = (OPJ_INT32)width; pDstStride[1] = (OPJ_INT32)width; pDstStride[2] = (OPJ_INT32)width;
|
||||
opj_applyLUT8u_8u32s_C1P3R(pSrc, -(OPJ_INT32)stride, pDst, pDstStride, pLUT, width, height);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
static OPJ_BOOL bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
|
||||
{
|
||||
header->bfType = (OPJ_UINT16)getc(IN);
|
||||
header->bfType |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||
|
||||
if (header->bfType != 19778) {
|
||||
fprintf(stderr,"Error, not a BMP file!\n");
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
|
||||
/* FILE HEADER */
|
||||
/* ------------- */
|
||||
header->bfSize = (OPJ_UINT32)getc(IN);
|
||||
header->bfSize |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->bfSize |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->bfSize |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->bfReserved1 = (OPJ_UINT16)getc(IN);
|
||||
header->bfReserved1 |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||
|
||||
header->bfReserved2 = (OPJ_UINT16)getc(IN);
|
||||
header->bfReserved2 |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||
|
||||
header->bfOffBits = (OPJ_UINT32)getc(IN);
|
||||
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 24;
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
static OPJ_BOOL bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
|
||||
{
|
||||
memset(header, 0, sizeof(*header));
|
||||
/* INFO HEADER */
|
||||
/* ------------- */
|
||||
header->biSize = (OPJ_UINT32)getc(IN);
|
||||
header->biSize |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biSize |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biSize |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
switch (header->biSize) {
|
||||
case 12U: /* BITMAPCOREHEADER */
|
||||
case 40U: /* BITMAPINFOHEADER */
|
||||
case 52U: /* BITMAPV2INFOHEADER */
|
||||
case 56U: /* BITMAPV3INFOHEADER */
|
||||
case 108U: /* BITMAPV4HEADER */
|
||||
case 124U: /* BITMAPV5HEADER */
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"Error, unknown BMP header size %d\n", header->biSize);
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
|
||||
header->biWidth = (OPJ_UINT32)getc(IN);
|
||||
header->biWidth |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biWidth |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biWidth |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biHeight = (OPJ_UINT32)getc(IN);
|
||||
header->biHeight |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biHeight |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biHeight |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biPlanes = (OPJ_UINT16)getc(IN);
|
||||
header->biPlanes |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||
|
||||
header->biBitCount = (OPJ_UINT16)getc(IN);
|
||||
header->biBitCount |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||
|
||||
if(header->biSize >= 40U) {
|
||||
header->biCompression = (OPJ_UINT32)getc(IN);
|
||||
header->biCompression |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biCompression |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biCompression |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biSizeImage = (OPJ_UINT32)getc(IN);
|
||||
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biXpelsPerMeter = (OPJ_UINT32)getc(IN);
|
||||
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biYpelsPerMeter = (OPJ_UINT32)getc(IN);
|
||||
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biClrUsed = (OPJ_UINT32)getc(IN);
|
||||
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biClrImportant = (OPJ_UINT32)getc(IN);
|
||||
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 24;
|
||||
}
|
||||
|
||||
if(header->biSize >= 56U) {
|
||||
header->biRedMask = (OPJ_UINT32)getc(IN);
|
||||
header->biRedMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biRedMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biRedMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biGreenMask = (OPJ_UINT32)getc(IN);
|
||||
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biBlueMask = (OPJ_UINT32)getc(IN);
|
||||
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biAlphaMask = (OPJ_UINT32)getc(IN);
|
||||
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||
}
|
||||
|
||||
if(header->biSize >= 108U) {
|
||||
header->biColorSpaceType = (OPJ_UINT32)getc(IN);
|
||||
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
if (fread(&(header->biColorSpaceEP), 1U, sizeof(header->biColorSpaceEP), IN) != sizeof(header->biColorSpaceEP)) {
|
||||
fprintf(stderr,"Error, can't read BMP header\n");
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
|
||||
header->biRedGamma = (OPJ_UINT32)getc(IN);
|
||||
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biGreenGamma = (OPJ_UINT32)getc(IN);
|
||||
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biBlueGamma = (OPJ_UINT32)getc(IN);
|
||||
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 24;
|
||||
}
|
||||
|
||||
if(header->biSize >= 124U) {
|
||||
header->biIntent = (OPJ_UINT32)getc(IN);
|
||||
header->biIntent |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biIntent |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biIntent |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biIccProfileData = (OPJ_UINT32)getc(IN);
|
||||
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biIccProfileSize = (OPJ_UINT32)getc(IN);
|
||||
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 24;
|
||||
|
||||
header->biReserved = (OPJ_UINT32)getc(IN);
|
||||
header->biReserved |= (OPJ_UINT32)getc(IN) << 8;
|
||||
header->biReserved |= (OPJ_UINT32)getc(IN) << 16;
|
||||
header->biReserved |= (OPJ_UINT32)getc(IN) << 24;
|
||||
}
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
static OPJ_BOOL bmp_read_raw_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
|
||||
{
|
||||
OPJ_ARG_NOT_USED(width);
|
||||
|
||||
if ( fread(pData, sizeof(OPJ_UINT8), stride * height, IN) != (stride * height) )
|
||||
{
|
||||
fprintf(stderr, "\nError: fread return a number of element different from the expected.\n");
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
static OPJ_BOOL bmp_read_rle8_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
|
||||
{
|
||||
OPJ_UINT32 x, y;
|
||||
OPJ_UINT8 *pix;
|
||||
const OPJ_UINT8 *beyond;
|
||||
|
||||
beyond = pData + stride * height;
|
||||
pix = pData;
|
||||
|
||||
x = y = 0U;
|
||||
while (y < height)
|
||||
{
|
||||
int c = getc(IN);
|
||||
|
||||
if (c) {
|
||||
int j;
|
||||
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
|
||||
|
||||
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
|
||||
*pix = c1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
c = getc(IN);
|
||||
if (c == 0x00) { /* EOL */
|
||||
x = 0;
|
||||
++y;
|
||||
pix = pData + y * stride + x;
|
||||
}
|
||||
else if (c == 0x01) { /* EOP */
|
||||
break;
|
||||
}
|
||||
else if (c == 0x02) { /* MOVE by dxdy */
|
||||
c = getc(IN);
|
||||
x += (OPJ_UINT32)c;
|
||||
c = getc(IN);
|
||||
y += (OPJ_UINT32)c;
|
||||
pix = pData + y * stride + x;
|
||||
}
|
||||
else /* 03 .. 255 */
|
||||
{
|
||||
int j;
|
||||
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++)
|
||||
{
|
||||
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
|
||||
*pix = c1;
|
||||
}
|
||||
if ((OPJ_UINT32)c & 1U) { /* skip padding byte */
|
||||
getc(IN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}/* while() */
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
|
||||
{
|
||||
OPJ_UINT32 x, y;
|
||||
OPJ_UINT8 *pix;
|
||||
const OPJ_UINT8 *beyond;
|
||||
|
||||
beyond = pData + stride * height;
|
||||
pix = pData;
|
||||
x = y = 0U;
|
||||
while(y < height)
|
||||
{
|
||||
int c = getc(IN);
|
||||
if(c == EOF) break;
|
||||
|
||||
if(c) {/* encoded mode */
|
||||
int j;
|
||||
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
|
||||
|
||||
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
|
||||
*pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
|
||||
}
|
||||
}
|
||||
else { /* absolute mode */
|
||||
c = getc(IN);
|
||||
if(c == EOF) break;
|
||||
|
||||
if(c == 0x00) { /* EOL */
|
||||
x = 0; y++; pix = pData + y * stride;
|
||||
}
|
||||
else if(c == 0x01) { /* EOP */
|
||||
break;
|
||||
}
|
||||
else if(c == 0x02) { /* MOVE by dxdy */
|
||||
c = getc(IN); x += (OPJ_UINT32)c;
|
||||
c = getc(IN); y += (OPJ_UINT32)c;
|
||||
pix = pData + y * stride + x;
|
||||
}
|
||||
else { /* 03 .. 255 : absolute mode */
|
||||
int j;
|
||||
OPJ_UINT8 c1 = 0U;
|
||||
|
||||
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
|
||||
if((j&1) == 0) {
|
||||
c1 = (OPJ_UINT8)getc(IN);
|
||||
}
|
||||
*pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
|
||||
}
|
||||
if(((c&3) == 1) || ((c&3) == 2)) { /* skip padding byte */
|
||||
getc(IN);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* while(y < height) */
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
|
||||
{
|
||||
opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
|
||||
OPJ_UINT8 lut_R[256], lut_G[256], lut_B[256];
|
||||
OPJ_UINT8 const* pLUT[3];
|
||||
opj_image_t * image = NULL;
|
||||
FILE *IN;
|
||||
OPJ_BITMAPFILEHEADER File_h;
|
||||
OPJ_BITMAPINFOHEADER Info_h;
|
||||
OPJ_UINT32 i, palette_len, numcmpts = 1U;
|
||||
OPJ_BOOL l_result = OPJ_FALSE;
|
||||
OPJ_UINT8* pData = NULL;
|
||||
OPJ_UINT32 stride;
|
||||
|
||||
pLUT[0] = lut_R; pLUT[1] = lut_G; pLUT[2] = lut_B;
|
||||
|
||||
IN = fopen(filename, "rb");
|
||||
if (!IN)
|
||||
{
|
||||
fprintf(stderr, "Failed to open %s for reading !!\n", filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!bmp_read_file_header(IN, &File_h)) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
if (!bmp_read_info_header(IN, &Info_h)) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Load palette */
|
||||
if (Info_h.biBitCount <= 8U)
|
||||
{
|
||||
memset(&lut_R[0], 0, sizeof(lut_R));
|
||||
memset(&lut_G[0], 0, sizeof(lut_G));
|
||||
memset(&lut_B[0], 0, sizeof(lut_B));
|
||||
|
||||
palette_len = Info_h.biClrUsed;
|
||||
if((palette_len == 0U) && (Info_h.biBitCount <= 8U)) {
|
||||
palette_len = (1U << Info_h.biBitCount);
|
||||
}
|
||||
if (palette_len > 256U) {
|
||||
palette_len = 256U;
|
||||
}
|
||||
if (palette_len > 0U) {
|
||||
OPJ_UINT8 has_color = 0U;
|
||||
for (i = 0U; i < palette_len; i++) {
|
||||
lut_B[i] = (OPJ_UINT8)getc(IN);
|
||||
lut_G[i] = (OPJ_UINT8)getc(IN);
|
||||
lut_R[i] = (OPJ_UINT8)getc(IN);
|
||||
(void)getc(IN); /* padding */
|
||||
has_color |= (lut_B[i] ^ lut_G[i]) | (lut_G[i] ^ lut_R[i]);
|
||||
}
|
||||
if(has_color) {
|
||||
numcmpts = 3U;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
numcmpts = 3U;
|
||||
if ((Info_h.biCompression == 3) && (Info_h.biAlphaMask != 0U)) {
|
||||
numcmpts++;
|
||||
}
|
||||
}
|
||||
|
||||
if (Info_h.biWidth == 0 || Info_h.biHeight == 0) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (Info_h.biBitCount > (((OPJ_UINT32)-1) - 31) / Info_h.biWidth) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
stride = ((Info_h.biWidth * Info_h.biBitCount + 31U) / 32U) * 4U; /* rows are aligned on 32bits */
|
||||
if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /* RLE 4 gets decoded as 8 bits data for now... */
|
||||
if (8 > (((OPJ_UINT32)-1) - 31) / Info_h.biWidth) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
stride = ((Info_h.biWidth * 8U + 31U) / 32U) * 4U;
|
||||
}
|
||||
|
||||
if (stride > ((OPJ_UINT32)-1) / sizeof(OPJ_UINT8) / Info_h.biHeight) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
pData = (OPJ_UINT8 *) calloc(1, stride * Info_h.biHeight * sizeof(OPJ_UINT8));
|
||||
if (pData == NULL) {
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
/* Place the cursor at the beginning of the image information */
|
||||
fseek(IN, 0, SEEK_SET);
|
||||
fseek(IN, (long)File_h.bfOffBits, SEEK_SET);
|
||||
|
||||
switch (Info_h.biCompression) {
|
||||
case 0:
|
||||
case 3:
|
||||
/* read raw data */
|
||||
l_result = bmp_read_raw_data(IN, pData, stride, Info_h.biWidth, Info_h.biHeight);
|
||||
break;
|
||||
case 1:
|
||||
/* read rle8 data */
|
||||
l_result = bmp_read_rle8_data(IN, pData, stride, Info_h.biWidth, Info_h.biHeight);
|
||||
break;
|
||||
case 2:
|
||||
/* read rle4 data */
|
||||
l_result = bmp_read_rle4_data(IN, pData, stride, Info_h.biWidth, Info_h.biHeight);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unsupported BMP compression\n");
|
||||
l_result = OPJ_FALSE;
|
||||
break;
|
||||
}
|
||||
if (!l_result) {
|
||||
free(pData);
|
||||
fclose(IN);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* create the image */
|
||||
memset(&cmptparm[0], 0, sizeof(cmptparm));
|
||||
for(i = 0; i < 4U; i++)
|
||||
{
|
||||
cmptparm[i].prec = 8;
|
||||
cmptparm[i].bpp = 8;
|
||||
cmptparm[i].sgnd = 0;
|
||||
cmptparm[i].dx = (OPJ_UINT32)parameters->subsampling_dx;
|
||||
cmptparm[i].dy = (OPJ_UINT32)parameters->subsampling_dy;
|
||||
cmptparm[i].w = Info_h.biWidth;
|
||||
cmptparm[i].h = Info_h.biHeight;
|
||||
}
|
||||
|
||||
image = opj_image_create(numcmpts, &cmptparm[0], (numcmpts == 1U) ? OPJ_CLRSPC_GRAY : OPJ_CLRSPC_SRGB);
|
||||
if(!image) {
|
||||
fclose(IN);
|
||||
free(pData);
|
||||
return NULL;
|
||||
}
|
||||
if (numcmpts == 4U) {
|
||||
image->comps[3].alpha = 1;
|
||||
}
|
||||
|
||||
/* set image offset and reference grid */
|
||||
image->x0 = (OPJ_UINT32)parameters->image_offset_x0;
|
||||
image->y0 = (OPJ_UINT32)parameters->image_offset_y0;
|
||||
image->x1 = image->x0 + (Info_h.biWidth - 1U) * (OPJ_UINT32)parameters->subsampling_dx + 1U;
|
||||
image->y1 = image->y0 + (Info_h.biHeight - 1U) * (OPJ_UINT32)parameters->subsampling_dy + 1U;
|
||||
|
||||
/* Read the data */
|
||||
if (Info_h.biBitCount == 24 && Info_h.biCompression == 0) { /*RGB */
|
||||
bmp24toimage(pData, stride, image);
|
||||
}
|
||||
else if (Info_h.biBitCount == 8 && Info_h.biCompression == 0) { /* RGB 8bpp Indexed */
|
||||
bmp8toimage(pData, stride, image, pLUT);
|
||||
}
|
||||
else if (Info_h.biBitCount == 8 && Info_h.biCompression == 1) { /*RLE8*/
|
||||
bmp8toimage(pData, stride, image, pLUT);
|
||||
}
|
||||
else if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /*RLE4*/
|
||||
bmp8toimage(pData, stride, image, pLUT); /* RLE 4 gets decoded as 8 bits data for now */
|
||||
}
|
||||
else if (Info_h.biBitCount == 32 && Info_h.biCompression == 0) { /* RGBX */
|
||||
bmpmask32toimage(pData, stride, image, 0x00FF0000U, 0x0000FF00U, 0x000000FFU, 0x00000000U);
|
||||
}
|
||||
else if (Info_h.biBitCount == 32 && Info_h.biCompression == 3) { /* bitmask */
|
||||
bmpmask32toimage(pData, stride, image, Info_h.biRedMask, Info_h.biGreenMask, Info_h.biBlueMask, Info_h.biAlphaMask);
|
||||
}
|
||||
else if (Info_h.biBitCount == 16 && Info_h.biCompression == 0) { /* RGBX */
|
||||
bmpmask16toimage(pData, stride, image, 0x7C00U, 0x03E0U, 0x001FU, 0x0000U);
|
||||
}
|
||||
else if (Info_h.biBitCount == 16 && Info_h.biCompression == 3) { /* bitmask */
|
||||
if ((Info_h.biRedMask == 0U) && (Info_h.biGreenMask == 0U) && (Info_h.biBlueMask == 0U)) {
|
||||
Info_h.biRedMask = 0xF800U;
|
||||
Info_h.biGreenMask = 0x07E0U;
|
||||
Info_h.biBlueMask = 0x001FU;
|
||||
}
|
||||
bmpmask16toimage(pData, stride, image, Info_h.biRedMask, Info_h.biGreenMask, Info_h.biBlueMask, Info_h.biAlphaMask);
|
||||
}
|
||||
else {
|
||||
opj_image_destroy(image);
|
||||
image = NULL;
|
||||
fprintf(stderr, "Other system than 24 bits/pixels or 8 bits (no RLE coding) is not yet implemented [%d]\n", Info_h.biBitCount);
|
||||
}
|
||||
free(pData);
|
||||
fclose(IN);
|
||||
return image;
|
||||
}
|
||||
|
||||
int imagetobmp(opj_image_t * image, const char *outfile) {
|
||||
int w, h;
|
||||
int i, pad;
|
||||
FILE *fdest = NULL;
|
||||
int adjustR, adjustG, adjustB;
|
||||
|
||||
if (image->comps[0].prec < 8) {
|
||||
fprintf(stderr, "Unsupported number of components: %d\n", image->comps[0].prec);
|
||||
return 1;
|
||||
}
|
||||
if (image->numcomps >= 3 && image->comps[0].dx == image->comps[1].dx
|
||||
&& image->comps[1].dx == image->comps[2].dx
|
||||
&& image->comps[0].dy == image->comps[1].dy
|
||||
&& image->comps[1].dy == image->comps[2].dy
|
||||
&& image->comps[0].prec == image->comps[1].prec
|
||||
&& image->comps[1].prec == image->comps[2].prec) {
|
||||
|
||||
/* -->> -->> -->> -->>
|
||||
24 bits color
|
||||
<<-- <<-- <<-- <<-- */
|
||||
|
||||
fdest = fopen(outfile, "wb");
|
||||
if (!fdest) {
|
||||
fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
|
||||
return 1;
|
||||
}
|
||||
|
||||
w = (int)image->comps[0].w;
|
||||
h = (int)image->comps[0].h;
|
||||
|
||||
fprintf(fdest, "BM");
|
||||
|
||||
/* FILE HEADER */
|
||||
/* ------------- */
|
||||
fprintf(fdest, "%c%c%c%c",
|
||||
(OPJ_UINT8) (h * w * 3 + 3 * h * (w % 2) + 54) & 0xff,
|
||||
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (54) & 0xff, ((54) >> 8) & 0xff,((54) >> 16) & 0xff, ((54) >> 24) & 0xff);
|
||||
|
||||
/* INFO HEADER */
|
||||
/* ------------- */
|
||||
fprintf(fdest, "%c%c%c%c", (40) & 0xff, ((40) >> 8) & 0xff, ((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
|
||||
(OPJ_UINT8) ((w) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((w) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((w) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
|
||||
(OPJ_UINT8) ((h) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((h) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((h) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
|
||||
fprintf(fdest, "%c%c", (24) & 0xff, ((24) >> 8) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (3 * h * w + 3 * h * (w % 2)) & 0xff,
|
||||
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||
|
||||
if (image->comps[0].prec > 8) {
|
||||
adjustR = (int)image->comps[0].prec - 8;
|
||||
printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
|
||||
}
|
||||
else
|
||||
adjustR = 0;
|
||||
if (image->comps[1].prec > 8) {
|
||||
adjustG = (int)image->comps[1].prec - 8;
|
||||
printf("BMP CONVERSION: Truncating component 1 from %d bits to 8 bits\n", image->comps[1].prec);
|
||||
}
|
||||
else
|
||||
adjustG = 0;
|
||||
if (image->comps[2].prec > 8) {
|
||||
adjustB = (int)image->comps[2].prec - 8;
|
||||
printf("BMP CONVERSION: Truncating component 2 from %d bits to 8 bits\n", image->comps[2].prec);
|
||||
}
|
||||
else
|
||||
adjustB = 0;
|
||||
|
||||
for (i = 0; i < w * h; i++) {
|
||||
OPJ_UINT8 rc, gc, bc;
|
||||
int r, g, b;
|
||||
|
||||
r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
||||
r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
|
||||
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
|
||||
if(r > 255) r = 255; else if(r < 0) r = 0;
|
||||
rc = (OPJ_UINT8)r;
|
||||
|
||||
g = image->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
||||
g += (image->comps[1].sgnd ? 1 << (image->comps[1].prec - 1) : 0);
|
||||
g = ((g >> adjustG)+((g >> (adjustG-1))%2));
|
||||
if(g > 255) g = 255; else if(g < 0) g = 0;
|
||||
gc = (OPJ_UINT8)g;
|
||||
|
||||
b = image->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
||||
b += (image->comps[2].sgnd ? 1 << (image->comps[2].prec - 1) : 0);
|
||||
b = ((b >> adjustB)+((b >> (adjustB-1))%2));
|
||||
if(b > 255) b = 255; else if(b < 0) b = 0;
|
||||
bc = (OPJ_UINT8)b;
|
||||
|
||||
fprintf(fdest, "%c%c%c", bc, gc, rc);
|
||||
|
||||
if ((i + 1) % w == 0) {
|
||||
for (pad = ((3 * w) % 4) ? (4 - (3 * w) % 4) : 0; pad > 0; pad--) /* ADD */
|
||||
fprintf(fdest, "%c", 0);
|
||||
}
|
||||
}
|
||||
fclose(fdest);
|
||||
} else { /* Gray-scale */
|
||||
|
||||
/* -->> -->> -->> -->>
|
||||
8 bits non code (Gray scale)
|
||||
<<-- <<-- <<-- <<-- */
|
||||
|
||||
fdest = fopen(outfile, "wb");
|
||||
if (!fdest) {
|
||||
fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
|
||||
return 1;
|
||||
}
|
||||
w = (int)image->comps[0].w;
|
||||
h = (int)image->comps[0].h;
|
||||
|
||||
fprintf(fdest, "BM");
|
||||
|
||||
/* FILE HEADER */
|
||||
/* ------------- */
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + 54 + 1024 + h * (w % 2)) & 0xff,
|
||||
(OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((h * w + 54 + 1024 + w * (w % 2)) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (54 + 1024) & 0xff, ((54 + 1024) >> 8) & 0xff,
|
||||
((54 + 1024) >> 16) & 0xff,
|
||||
((54 + 1024) >> 24) & 0xff);
|
||||
|
||||
/* INFO HEADER */
|
||||
/* ------------- */
|
||||
fprintf(fdest, "%c%c%c%c", (40) & 0xff, ((40) >> 8) & 0xff, ((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
|
||||
(OPJ_UINT8) ((w) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((w) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((w) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
|
||||
(OPJ_UINT8) ((h) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((h) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((h) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
|
||||
fprintf(fdest, "%c%c", (8) & 0xff, ((8) >> 8) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + h * (w % 2)) & 0xff,
|
||||
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 8) & 0xff,
|
||||
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 16) & 0xff,
|
||||
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff);
|
||||
fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff);
|
||||
|
||||
if (image->comps[0].prec > 8) {
|
||||
adjustR = (int)image->comps[0].prec - 8;
|
||||
printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
|
||||
}else
|
||||
adjustR = 0;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
fprintf(fdest, "%c%c%c%c", i, i, i, 0);
|
||||
}
|
||||
|
||||
for (i = 0; i < w * h; i++) {
|
||||
int r;
|
||||
|
||||
r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
||||
r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
|
||||
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
|
||||
if(r > 255) r = 255; else if(r < 0) r = 0;
|
||||
|
||||
fprintf(fdest, "%c", (OPJ_UINT8)r);
|
||||
|
||||
if ((i + 1) % w == 0) {
|
||||
for (pad = (w % 4) ? (4 - w % 4) : 0; pad > 0; pad--) /* ADD */
|
||||
fprintf(fdest, "%c", 0);
|
||||
}
|
||||
}
|
||||
fclose(fdest);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
500
src/bin/jp2/convertpng.c
Normal file
500
src/bin/jp2/convertpng.c
Normal file
@ -0,0 +1,500 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2006-2007, Parvatha Elangovan
|
||||
* Copyright (c) 2015, Matthieu Darbois
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "opj_apps_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <zlib.h>
|
||||
#include <png.h>
|
||||
|
||||
#include "openjpeg.h"
|
||||
#include "convert.h"
|
||||
|
||||
#define PNG_MAGIC "\x89PNG\x0d\x0a\x1a\x0a"
|
||||
#define MAGIC_SIZE 8
|
||||
/* PNG allows bits per sample: 1, 2, 4, 8, 16 */
|
||||
|
||||
|
||||
static void convert_16u32s_C1R(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length)
|
||||
{
|
||||
OPJ_SIZE_T i;
|
||||
for (i = 0; i < length; i++) {
|
||||
OPJ_INT32 val0 = *pSrc++;
|
||||
OPJ_INT32 val1 = *pSrc++;
|
||||
pDst[i] = val0 << 8 | val1;
|
||||
}
|
||||
}
|
||||
|
||||
opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
|
||||
{
|
||||
png_structp png = NULL;
|
||||
png_infop info = NULL;
|
||||
double gamma;
|
||||
int bit_depth, interlace_type,compression_type, filter_type;
|
||||
OPJ_UINT32 i;
|
||||
png_uint_32 width, height = 0U;
|
||||
int color_type;
|
||||
FILE *reader = NULL;
|
||||
OPJ_BYTE** rows = NULL;
|
||||
OPJ_INT32* row32s = NULL;
|
||||
/* j2k: */
|
||||
opj_image_t *image = NULL;
|
||||
opj_image_cmptparm_t cmptparm[4];
|
||||
OPJ_UINT32 nr_comp;
|
||||
OPJ_BYTE sigbuf[8];
|
||||
convert_XXx32s_C1R cvtXXTo32s = NULL;
|
||||
convert_32s_CXPX cvtCxToPx = NULL;
|
||||
OPJ_INT32* planes[4];
|
||||
|
||||
if((reader = fopen(read_idf, "rb")) == NULL)
|
||||
{
|
||||
fprintf(stderr,"pngtoimage: can not open %s\n",read_idf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(fread(sigbuf, 1, MAGIC_SIZE, reader) != MAGIC_SIZE
|
||||
|| memcmp(sigbuf, PNG_MAGIC, MAGIC_SIZE) != 0)
|
||||
{
|
||||
fprintf(stderr,"pngtoimage: %s is no valid PNG file\n",read_idf);
|
||||
goto fin;
|
||||
}
|
||||
|
||||
if((png = png_create_read_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL)) == NULL)
|
||||
goto fin;
|
||||
if((info = png_create_info_struct(png)) == NULL)
|
||||
goto fin;
|
||||
|
||||
if(setjmp(png_jmpbuf(png)))
|
||||
goto fin;
|
||||
|
||||
png_init_io(png, reader);
|
||||
png_set_sig_bytes(png, MAGIC_SIZE);
|
||||
|
||||
png_read_info(png, info);
|
||||
|
||||
if(png_get_IHDR(png, info, &width, &height,
|
||||
&bit_depth, &color_type, &interlace_type,
|
||||
&compression_type, &filter_type) == 0)
|
||||
goto fin;
|
||||
|
||||
/* png_set_expand():
|
||||
* expand paletted images to RGB, expand grayscale images of
|
||||
* less than 8-bit depth to 8-bit depth, and expand tRNS chunks
|
||||
* to alpha channels.
|
||||
*/
|
||||
if(color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||
png_set_expand(png);
|
||||
}
|
||||
|
||||
if(png_get_valid(png, info, PNG_INFO_tRNS)) {
|
||||
png_set_expand(png);
|
||||
}
|
||||
/* We might wan't to expand background */
|
||||
/*
|
||||
if(png_get_valid(png, info, PNG_INFO_bKGD)) {
|
||||
png_color_16p bgnd;
|
||||
png_get_bKGD(png, info, &bgnd);
|
||||
png_set_background(png, bgnd, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
|
||||
}
|
||||
*/
|
||||
|
||||
if( !png_get_gAMA(png, info, &gamma))
|
||||
gamma = 1.0;
|
||||
|
||||
/* we're not displaying but converting, screen gamma == 1.0 */
|
||||
png_set_gamma(png, 1.0, gamma);
|
||||
|
||||
png_read_update_info(png, info);
|
||||
|
||||
color_type = png_get_color_type(png, info);
|
||||
|
||||
switch (color_type) {
|
||||
case PNG_COLOR_TYPE_GRAY:
|
||||
nr_comp = 1;
|
||||
break;
|
||||
case PNG_COLOR_TYPE_GRAY_ALPHA:
|
||||
nr_comp = 2;
|
||||
break;
|
||||
case PNG_COLOR_TYPE_RGB:
|
||||
nr_comp = 3;
|
||||
break;
|
||||
case PNG_COLOR_TYPE_RGB_ALPHA:
|
||||
nr_comp = 4;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"pngtoimage: colortype %d is not supported\n", color_type);
|
||||
goto fin;
|
||||
}
|
||||
cvtCxToPx = convert_32s_CXPX_LUT[nr_comp];
|
||||
bit_depth = png_get_bit_depth(png, info);
|
||||
|
||||
switch (bit_depth) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 8:
|
||||
cvtXXTo32s = convert_XXu32s_C1R_LUT[bit_depth];
|
||||
break;
|
||||
case 16: /* 16 bpp is specific to PNG */
|
||||
cvtXXTo32s = convert_16u32s_C1R;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"pngtoimage: bit depth %d is not supported\n", bit_depth);
|
||||
goto fin;
|
||||
}
|
||||
|
||||
|
||||
rows = (OPJ_BYTE**)calloc(height+1, sizeof(OPJ_BYTE*));
|
||||
if(rows == NULL){
|
||||
fprintf(stderr, "pngtoimage: memory out\n");
|
||||
goto fin;
|
||||
}
|
||||
for(i = 0; i < height; ++i){
|
||||
rows[i] = (OPJ_BYTE*)malloc(png_get_rowbytes(png,info));
|
||||
if(rows[i] == NULL){
|
||||
fprintf(stderr,"pngtoimage: memory out\n");
|
||||
goto fin;
|
||||
}
|
||||
}
|
||||
png_read_image(png, rows);
|
||||
|
||||
/* Create image */
|
||||
memset(cmptparm, 0, sizeof(cmptparm));
|
||||
for(i = 0; i < nr_comp; ++i)
|
||||
{
|
||||
cmptparm[i].prec = (OPJ_UINT32)bit_depth;
|
||||
/* bits_per_pixel: 8 or 16 */
|
||||
cmptparm[i].bpp = (OPJ_UINT32)bit_depth;
|
||||
cmptparm[i].sgnd = 0;
|
||||
cmptparm[i].dx = (OPJ_UINT32)params->subsampling_dx;
|
||||
cmptparm[i].dy = (OPJ_UINT32)params->subsampling_dy;
|
||||
cmptparm[i].w = (OPJ_UINT32)width;
|
||||
cmptparm[i].h = (OPJ_UINT32)height;
|
||||
}
|
||||
|
||||
image = opj_image_create(nr_comp, &cmptparm[0], (nr_comp > 2U) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_GRAY);
|
||||
if(image == NULL) goto fin;
|
||||
image->x0 = (OPJ_UINT32)params->image_offset_x0;
|
||||
image->y0 = (OPJ_UINT32)params->image_offset_y0;
|
||||
image->x1 = (OPJ_UINT32)(image->x0 + (width - 1) * (OPJ_UINT32)params->subsampling_dx + 1 + image->x0);
|
||||
image->y1 = (OPJ_UINT32)(image->y0 + (height - 1) * (OPJ_UINT32)params->subsampling_dy + 1 + image->y0);
|
||||
|
||||
row32s = (OPJ_INT32 *)malloc((size_t)width * nr_comp * sizeof(OPJ_INT32));
|
||||
if(row32s == NULL) goto fin;
|
||||
|
||||
/* Set alpha channel */
|
||||
image->comps[nr_comp-1U].alpha = 1U - (nr_comp & 1U);
|
||||
|
||||
for(i = 0; i < nr_comp; i++)
|
||||
{
|
||||
planes[i] = image->comps[i].data;
|
||||
}
|
||||
|
||||
for(i = 0; i < height; ++i)
|
||||
{
|
||||
cvtXXTo32s(rows[i], row32s, (OPJ_SIZE_T)width * nr_comp);
|
||||
cvtCxToPx(row32s, planes, width);
|
||||
planes[0] += width;
|
||||
planes[1] += width;
|
||||
planes[2] += width;
|
||||
planes[3] += width;
|
||||
}
|
||||
fin:
|
||||
if(rows)
|
||||
{
|
||||
for(i = 0; i < height; ++i)
|
||||
if(rows[i]) free(rows[i]);
|
||||
free(rows);
|
||||
}
|
||||
if (row32s) {
|
||||
free(row32s);
|
||||
}
|
||||
if(png)
|
||||
png_destroy_read_struct(&png, &info, NULL);
|
||||
|
||||
fclose(reader);
|
||||
|
||||
return image;
|
||||
|
||||
}/* pngtoimage() */
|
||||
|
||||
|
||||
static void convert_32s16u_C1R(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length)
|
||||
{
|
||||
OPJ_SIZE_T i;
|
||||
for (i = 0; i < length; i++) {
|
||||
OPJ_UINT32 val = (OPJ_UINT32)pSrc[i];
|
||||
*pDst++ = (OPJ_BYTE)(val >> 8);
|
||||
*pDst++ = (OPJ_BYTE)val;
|
||||
}
|
||||
}
|
||||
int imagetopng(opj_image_t * image, const char *write_idf)
|
||||
{
|
||||
FILE * volatile writer = NULL;
|
||||
png_structp png = NULL;
|
||||
png_infop info = NULL;
|
||||
png_bytep volatile row_buf = NULL;
|
||||
int nr_comp, color_type;
|
||||
volatile int prec;
|
||||
png_color_8 sig_bit;
|
||||
OPJ_INT32 const* planes[4];
|
||||
int i;
|
||||
OPJ_INT32* volatile buffer32s = NULL;
|
||||
|
||||
volatile int fails = 1;
|
||||
|
||||
memset(&sig_bit, 0, sizeof(sig_bit));
|
||||
prec = (int)image->comps[0].prec;
|
||||
planes[0] = image->comps[0].data;
|
||||
nr_comp = (int)image->numcomps;
|
||||
|
||||
if (nr_comp > 4) {
|
||||
nr_comp = 4;
|
||||
}
|
||||
for (i = 1; i < nr_comp; ++i) {
|
||||
if (image->comps[0].dx != image->comps[i].dx) {
|
||||
break;
|
||||
}
|
||||
if (image->comps[0].dy != image->comps[i].dy) {
|
||||
break;
|
||||
}
|
||||
if (image->comps[0].prec != image->comps[i].prec) {
|
||||
break;
|
||||
}
|
||||
if (image->comps[0].sgnd != image->comps[i].sgnd) {
|
||||
break;
|
||||
}
|
||||
planes[i] = image->comps[i].data;
|
||||
}
|
||||
if (i != nr_comp) {
|
||||
fprintf(stderr,"imagetopng: All components shall have the same subsampling, same bit depth, same sign.\n");
|
||||
fprintf(stderr,"\tAborting\n");
|
||||
return 1;
|
||||
}
|
||||
for (i = 0; i < nr_comp; ++i) {
|
||||
clip_component(&(image->comps[i]), image->comps[0].prec);
|
||||
}
|
||||
if(prec > 8 && prec < 16)
|
||||
{
|
||||
for (i = 0; i < nr_comp; ++i) {
|
||||
scale_component(&(image->comps[i]), 16);
|
||||
}
|
||||
prec = 16;
|
||||
}
|
||||
else if(prec < 8 && nr_comp > 1)/* GRAY_ALPHA, RGB, RGB_ALPHA */
|
||||
{
|
||||
for (i = 0; i < nr_comp; ++i) {
|
||||
scale_component(&(image->comps[i]), 8);
|
||||
}
|
||||
prec = 8;
|
||||
} else if((prec > 1) && (prec < 8) && ((prec == 6) || ((prec & 1)==1))) { /* GRAY with non native precision */
|
||||
if ((prec == 5) || (prec == 6)) {
|
||||
prec = 8;
|
||||
} else {
|
||||
prec++;
|
||||
}
|
||||
for (i = 0; i < nr_comp; ++i) {
|
||||
scale_component(&(image->comps[i]), (OPJ_UINT32)prec);
|
||||
}
|
||||
}
|
||||
|
||||
if(prec != 1 && prec != 2 && prec != 4 && prec != 8 && prec != 16)
|
||||
{
|
||||
fprintf(stderr,"imagetopng: can not create %s\n\twrong bit_depth %d\n", write_idf, prec);
|
||||
return fails;
|
||||
}
|
||||
|
||||
writer = fopen(write_idf, "wb");
|
||||
|
||||
if(writer == NULL) return fails;
|
||||
|
||||
/* Create and initialize the png_struct with the desired error handler
|
||||
* functions. If you want to use the default stderr and longjump method,
|
||||
* you can supply NULL for the last three parameters. We also check that
|
||||
* the library version is compatible with the one used at compile time,
|
||||
* in case we are using dynamically linked libraries. REQUIRED.
|
||||
*/
|
||||
png = png_create_write_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL);
|
||||
/*png_voidp user_error_ptr, user_error_fn, user_warning_fn); */
|
||||
|
||||
if(png == NULL) goto fin;
|
||||
|
||||
/* Allocate/initialize the image information data. REQUIRED
|
||||
*/
|
||||
info = png_create_info_struct(png);
|
||||
|
||||
if(info == NULL) goto fin;
|
||||
|
||||
/* Set error handling. REQUIRED if you are not supplying your own
|
||||
* error handling functions in the png_create_write_struct() call.
|
||||
*/
|
||||
if(setjmp(png_jmpbuf(png))) goto fin;
|
||||
|
||||
/* I/O initialization functions is REQUIRED
|
||||
*/
|
||||
png_init_io(png, writer);
|
||||
|
||||
/* Set the image information here. Width and height are up to 2^31,
|
||||
* bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
|
||||
* the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
|
||||
* PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
|
||||
* or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or
|
||||
* PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST
|
||||
* currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE.
|
||||
* REQUIRED
|
||||
*
|
||||
* ERRORS:
|
||||
*
|
||||
* color_type == PNG_COLOR_TYPE_PALETTE && bit_depth > 8
|
||||
* color_type == PNG_COLOR_TYPE_RGB && bit_depth < 8
|
||||
* color_type == PNG_COLOR_TYPE_GRAY_ALPHA && bit_depth < 8
|
||||
* color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8
|
||||
*
|
||||
*/
|
||||
png_set_compression_level(png, Z_BEST_COMPRESSION);
|
||||
|
||||
if(nr_comp >= 3) /* RGB(A) */
|
||||
{
|
||||
color_type = PNG_COLOR_TYPE_RGB;
|
||||
sig_bit.red = sig_bit.green = sig_bit.blue = (png_byte)prec;
|
||||
}
|
||||
else /* GRAY(A) */
|
||||
{
|
||||
color_type = PNG_COLOR_TYPE_GRAY;
|
||||
sig_bit.gray = (png_byte)prec;
|
||||
}
|
||||
if((nr_comp & 1) == 0) /* ALPHA */
|
||||
{
|
||||
color_type |= PNG_COLOR_MASK_ALPHA;
|
||||
sig_bit.alpha = (png_byte)prec;
|
||||
}
|
||||
|
||||
png_set_IHDR(png, info, image->comps[0].w, image->comps[0].h, prec, color_type,
|
||||
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||
|
||||
png_set_sBIT(png, info, &sig_bit);
|
||||
/* png_set_gamma(png, 2.2, 1./2.2); */
|
||||
/* png_set_sRGB(png, info, PNG_sRGB_INTENT_PERCEPTUAL); */
|
||||
png_write_info(png, info);
|
||||
|
||||
/* setup conversion */
|
||||
{
|
||||
OPJ_SIZE_T rowStride;
|
||||
png_size_t png_row_size;
|
||||
|
||||
png_row_size = png_get_rowbytes(png, info);
|
||||
rowStride = ((OPJ_SIZE_T)image->comps[0].w * (OPJ_SIZE_T)nr_comp * (OPJ_SIZE_T)prec + 7U) / 8U;
|
||||
if (rowStride != (OPJ_SIZE_T)png_row_size) {
|
||||
fprintf(stderr, "Invalid PNG row size\n");
|
||||
goto fin;
|
||||
}
|
||||
row_buf = (png_bytep)malloc(png_row_size);
|
||||
if (row_buf == NULL) {
|
||||
fprintf(stderr, "Can't allocate memory for PNG row\n");
|
||||
goto fin;
|
||||
}
|
||||
buffer32s = (OPJ_INT32*)malloc((OPJ_SIZE_T)image->comps[0].w * (OPJ_SIZE_T)nr_comp * sizeof(OPJ_INT32));
|
||||
if (buffer32s == NULL) {
|
||||
fprintf(stderr, "Can't allocate memory for interleaved 32s row\n");
|
||||
goto fin;
|
||||
}
|
||||
}
|
||||
|
||||
/* convert */
|
||||
{
|
||||
OPJ_SIZE_T width= image->comps[0].w;
|
||||
OPJ_UINT32 y;
|
||||
convert_32s_PXCX cvtPxToCx = convert_32s_PXCX_LUT[nr_comp];
|
||||
convert_32sXXx_C1R cvt32sToPack = NULL;
|
||||
OPJ_INT32 adjust = image->comps[0].sgnd ? 1 << (prec - 1) : 0;
|
||||
png_bytep row_buf_cpy = row_buf;
|
||||
OPJ_INT32* buffer32s_cpy = buffer32s;
|
||||
|
||||
switch (prec) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 8:
|
||||
cvt32sToPack = convert_32sXXu_C1R_LUT[prec];
|
||||
break;
|
||||
case 16:
|
||||
cvt32sToPack = convert_32s16u_C1R;
|
||||
break;
|
||||
default:
|
||||
/* never here */
|
||||
break;
|
||||
}
|
||||
|
||||
for(y = 0; y < image->comps[0].h; ++y)
|
||||
{
|
||||
cvtPxToCx(planes, buffer32s_cpy, width, adjust);
|
||||
cvt32sToPack(buffer32s_cpy, row_buf_cpy, width * (OPJ_SIZE_T)nr_comp);
|
||||
png_write_row(png, row_buf_cpy);
|
||||
planes[0] += width;
|
||||
planes[1] += width;
|
||||
planes[2] += width;
|
||||
planes[3] += width;
|
||||
}
|
||||
}
|
||||
|
||||
png_write_end(png, info);
|
||||
|
||||
fails = 0;
|
||||
|
||||
fin:
|
||||
if(png) {
|
||||
png_destroy_write_struct(&png, &info);
|
||||
}
|
||||
if(row_buf) {
|
||||
free(row_buf);
|
||||
}
|
||||
if(buffer32s) {
|
||||
free(buffer32s);
|
||||
}
|
||||
fclose(writer);
|
||||
|
||||
if(fails) (void)remove(write_idf); /* ignore return value */
|
||||
|
||||
return fails;
|
||||
}/* imagetopng() */
|
1457
src/bin/jp2/converttif.c
Normal file
1457
src/bin/jp2/converttif.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -64,7 +69,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (cstr_info->tile[0].distotile)
|
||||
if (cstr_info->tile[0].distotile > 0.0)
|
||||
disto_on = 1;
|
||||
else
|
||||
disto_on = 0;
|
||||
|
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* All rights reserved.
|
||||
*
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2010, Mathieu Malaterre, GDCM
|
||||
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
|
||||
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||
@ -52,6 +57,7 @@
|
||||
#include "index.h"
|
||||
|
||||
#include "format_defs.h"
|
||||
#include "opj_string.h"
|
||||
|
||||
typedef struct dircnt{
|
||||
/** Buffer for holding images read from Directory*/
|
||||
@ -86,19 +92,14 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
static void decode_help_display(void) {
|
||||
fprintf(stdout,"HELP for opj_dump\n----\n\n");
|
||||
fprintf(stdout,"- the -h option displays this help information on screen\n\n");
|
||||
fprintf(stdout,"\nThis is the opj_dump utility from the OpenJPEG project.\n"
|
||||
"It dumps JPEG 2000 codestream info to stdout or a given file.\n"
|
||||
"It has been compiled against openjp2 library v%s.\n\n",opj_version());
|
||||
|
||||
/* UniPG>> */
|
||||
fprintf(stdout,"List of parameters for the JPEG 2000 "
|
||||
#ifdef USE_JPWL
|
||||
"+ JPWL "
|
||||
#endif /* USE_JPWL */
|
||||
"decoder:\n");
|
||||
/* <<UniPG */
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout," -ImgDir \n");
|
||||
fprintf(stdout,"Parameters:\n");
|
||||
fprintf(stdout,"-----------\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout," -ImgDir <directory>\n");
|
||||
fprintf(stdout," Image file Directory path \n");
|
||||
fprintf(stdout," -i <compressed file>\n");
|
||||
fprintf(stdout," REQUIRED only if an Input image directory not specified\n");
|
||||
@ -108,10 +109,10 @@ static void decode_help_display(void) {
|
||||
fprintf(stdout," OPTIONAL\n");
|
||||
fprintf(stdout," Output file where file info will be dump.\n");
|
||||
fprintf(stdout," By default it will be in the stdout.\n");
|
||||
fprintf(stdout," -v "); /* FIXME WIP_MSD */
|
||||
fprintf(stdout," -v "); /* FIXME WIP_MSD */
|
||||
fprintf(stdout," OPTIONAL\n");
|
||||
fprintf(stdout," Activate or not the verbose mode (display info and warning message)\n");
|
||||
fprintf(stdout," By default verbose mode is off.\n");
|
||||
fprintf(stdout," Enable informative messages\n");
|
||||
fprintf(stdout," By default verbose mode is off.\n");
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
@ -134,6 +135,7 @@ static int get_num_images(char *imgdirpath){
|
||||
continue;
|
||||
num_images++;
|
||||
}
|
||||
closedir(dir);
|
||||
return num_images;
|
||||
}
|
||||
|
||||
@ -160,6 +162,7 @@ static int load_images(dircnt_t *dirptr, char *imgdirpath){
|
||||
strcpy(dirptr->filename[i],content->d_name);
|
||||
i++;
|
||||
}
|
||||
closedir(dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -168,7 +171,7 @@ static int get_file_format(const char *filename) {
|
||||
unsigned int i;
|
||||
static const char *extension[] = {"pgx", "pnm", "pgm", "ppm", "bmp","tif", "raw", "tga", "png", "j2k", "jp2", "jpt", "j2c", "jpc" };
|
||||
static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, TIF_DFMT, RAW_DFMT, TGA_DFMT, PNG_DFMT, J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT };
|
||||
char * ext = strrchr(filename, '.');
|
||||
const char *ext = strrchr(filename, '.');
|
||||
if (ext == NULL)
|
||||
return -1;
|
||||
ext++;
|
||||
@ -194,7 +197,9 @@ static char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_d
|
||||
if (parameters->decod_format == -1)
|
||||
return 1;
|
||||
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
||||
strncpy(parameters->infile, infilename, sizeof(infilename));
|
||||
if (opj_strcpy_s(parameters->infile, sizeof(parameters->infile), infilename) != 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*Set output file*/
|
||||
strcpy(temp_ofname,strtok(image_filename,"."));
|
||||
@ -204,7 +209,9 @@ static char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_d
|
||||
}
|
||||
if(img_fol->set_out_format==1){
|
||||
sprintf(outfilename,"%s/%s.%s",img_fol->imgdirpath,temp_ofname,img_fol->out_format);
|
||||
strncpy(parameters->outfile, outfilename, sizeof(outfilename));
|
||||
if (opj_strcpy_s(parameters->outfile, sizeof(parameters->outfile), outfilename) != 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -272,9 +279,9 @@ static int infile_format(const char *fname)
|
||||
static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,img_fol_t *img_fol) {
|
||||
int totlen, c;
|
||||
opj_option_t long_option[]={
|
||||
{"ImgDir",REQ_ARG, NULL ,'y'},
|
||||
{"ImgDir",REQ_ARG, NULL ,'y'}
|
||||
};
|
||||
const char optlist[] = "i:o:f:hv";
|
||||
const char optlist[] = "i:o:f:hv";
|
||||
|
||||
totlen=sizeof(long_option);
|
||||
img_fol->set_out_format = 0;
|
||||
@ -293,14 +300,18 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
|
||||
case JP2_CFMT:
|
||||
break;
|
||||
case JPT_CFMT:
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,
|
||||
"!! Unrecognized format for infile : %s [accept only *.j2k, *.jp2, *.jpc or *.jpt] !!\n\n",
|
||||
infile);
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,
|
||||
"[ERROR] Unknown input file format: %s \n"
|
||||
" Known file formats are *.j2k, *.jp2, *.jpc or *.jpt\n",
|
||||
infile);
|
||||
return 1;
|
||||
}
|
||||
if (opj_strcpy_s(parameters->infile, sizeof(parameters->infile), infile) != 0) {
|
||||
fprintf(stderr, "[ERROR] Path is too long\n");
|
||||
return 1;
|
||||
}
|
||||
strncpy(parameters->infile, infile, sizeof(parameters->infile)-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -308,8 +319,10 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
|
||||
|
||||
case 'o': /* output file */
|
||||
{
|
||||
char *outfile = opj_optarg;
|
||||
strncpy(parameters->outfile, outfile, sizeof(parameters->outfile)-1);
|
||||
if (opj_strcpy_s(parameters->outfile, sizeof(parameters->outfile), opj_optarg) != 0) {
|
||||
fprintf(stderr, "[ERROR] Path is too long\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -328,6 +341,9 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
|
||||
case 'y': /* Image Directory path */
|
||||
{
|
||||
img_fol->imgdirpath = (char*)malloc(strlen(opj_optarg) + 1);
|
||||
if(img_fol->imgdirpath == NULL){
|
||||
return 1;
|
||||
}
|
||||
strcpy(img_fol->imgdirpath,opj_optarg);
|
||||
img_fol->set_imgdir=1;
|
||||
}
|
||||
@ -335,38 +351,40 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
|
||||
|
||||
/* ----------------------------------------------------- */
|
||||
|
||||
case 'v': /* Verbose mode */
|
||||
case 'v': /* Verbose mode */
|
||||
{
|
||||
parameters->m_verbose = 1;
|
||||
parameters->m_verbose = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
/* ----------------------------------------------------- */
|
||||
default:
|
||||
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, opj_optarg);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
fprintf(stderr, "[WARNING] An invalid option has been ignored.\n");
|
||||
break;
|
||||
}
|
||||
}while(c != -1);
|
||||
|
||||
/* check for possible errors */
|
||||
if(img_fol->set_imgdir==1){
|
||||
if(!(parameters->infile[0]==0)){
|
||||
fprintf(stderr, "Error: options -ImgDir and -i cannot be used together !!\n");
|
||||
fprintf(stderr, "[ERROR] options -ImgDir and -i cannot be used together.\n");
|
||||
return 1;
|
||||
}
|
||||
if(img_fol->set_out_format == 0){
|
||||
fprintf(stderr, "Error: When -ImgDir is used, -OutFor <FORMAT> must be used !!\n");
|
||||
fprintf(stderr, "Only one format allowed! Valid format PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA!!\n");
|
||||
fprintf(stderr, "[ERROR] When -ImgDir is used, -OutFor <FORMAT> must be used.\n");
|
||||
fprintf(stderr, "Only one format allowed.\n"
|
||||
"Valid format are PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA.\n");
|
||||
return 1;
|
||||
}
|
||||
if(!(parameters->outfile[0] == 0)){
|
||||
fprintf(stderr, "Error: options -ImgDir and -o cannot be used together !!\n");
|
||||
fprintf(stderr, "[ERROR] options -ImgDir and -o cannot be used together\n");
|
||||
return 1;
|
||||
}
|
||||
}else{
|
||||
if(parameters->infile[0] == 0) {
|
||||
fprintf(stderr, "[ERROR] Required parameter is missing\n");
|
||||
fprintf(stderr, "Example: %s -i image.j2k\n",argv[0]);
|
||||
fprintf(stderr, " Try: %s -h\n",argv[0]);
|
||||
fprintf(stderr, " Help: %s -h\n",argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -418,12 +436,6 @@ int main(int argc, char *argv[])
|
||||
img_fol_t img_fol;
|
||||
dircnt_t *dirptr = NULL;
|
||||
|
||||
#ifdef MSD
|
||||
OPJ_BOOL l_go_on = OPJ_TRUE;
|
||||
OPJ_UINT32 l_max_data_size = 1000;
|
||||
OPJ_BYTE * l_data = (OPJ_BYTE *) malloc(1000);
|
||||
#endif
|
||||
|
||||
/* Set decoding parameters to default values */
|
||||
opj_set_default_decoder_parameters(¶meters);
|
||||
|
||||
@ -433,6 +445,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Parse input and get user encoding parameters */
|
||||
if(parse_cmdline_decoder(argc, argv, ¶meters,&img_fol) == 1) {
|
||||
if(img_fol.imgdirpath) free(img_fol.imgdirpath);
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -442,25 +456,31 @@ int main(int argc, char *argv[])
|
||||
num_images=get_num_images(img_fol.imgdirpath);
|
||||
|
||||
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
||||
if(dirptr){
|
||||
dirptr->filename_buf = (char*)malloc((size_t)num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
|
||||
dirptr->filename = (char**) malloc((size_t)num_images*sizeof(char*));
|
||||
|
||||
if(!dirptr->filename_buf){
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
for(it_image=0;it_image<num_images;it_image++){
|
||||
dirptr->filename[it_image] = dirptr->filename_buf + it_image*OPJ_PATH_LEN;
|
||||
}
|
||||
}
|
||||
if(load_images(dirptr,img_fol.imgdirpath)==1){
|
||||
if(!dirptr){
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
dirptr->filename_buf = (char*)malloc((size_t)num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
|
||||
if(!dirptr->filename_buf){
|
||||
free(dirptr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
dirptr->filename = (char**) malloc((size_t)num_images*sizeof(char*));
|
||||
|
||||
if(!dirptr->filename){
|
||||
goto fails;
|
||||
}
|
||||
|
||||
for(it_image=0;it_image<num_images;it_image++){
|
||||
dirptr->filename[it_image] = dirptr->filename_buf + it_image*OPJ_PATH_LEN;
|
||||
}
|
||||
|
||||
if(load_images(dirptr,img_fol.imgdirpath)==1){
|
||||
goto fails;
|
||||
}
|
||||
|
||||
if (num_images==0){
|
||||
fprintf(stdout,"Folder is empty\n");
|
||||
return EXIT_FAILURE;
|
||||
goto fails;
|
||||
}
|
||||
}else{
|
||||
num_images=1;
|
||||
@ -471,7 +491,7 @@ int main(int argc, char *argv[])
|
||||
fout = fopen(parameters.outfile,"w");
|
||||
if (!fout){
|
||||
fprintf(stderr, "ERROR -> failed to open %s for writing\n", parameters.outfile);
|
||||
return EXIT_FAILURE;
|
||||
goto fails;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -492,10 +512,10 @@ int main(int argc, char *argv[])
|
||||
/* Read the input file and put it in memory */
|
||||
/* ---------------------------------------- */
|
||||
|
||||
l_stream = opj_stream_create_default_file_stream_v3(parameters.infile,1);
|
||||
l_stream = opj_stream_create_default_file_stream(parameters.infile,1);
|
||||
if (!l_stream){
|
||||
fprintf(stderr, "ERROR -> failed to create the stream from the file %s\n",parameters.infile);
|
||||
return EXIT_FAILURE;
|
||||
goto fails;
|
||||
}
|
||||
|
||||
/* Read the JPEG2000 stream */
|
||||
@ -522,7 +542,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
default:
|
||||
fprintf(stderr, "skipping file..\n");
|
||||
opj_stream_destroy_v3(l_stream);
|
||||
opj_stream_destroy(l_stream);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -534,20 +554,20 @@ int main(int argc, char *argv[])
|
||||
/* Setup the decoder decoding parameters using user parameters */
|
||||
if ( !opj_setup_decoder(l_codec, ¶meters) ){
|
||||
fprintf(stderr, "ERROR -> opj_dump: failed to setup the decoder\n");
|
||||
opj_stream_destroy_v3(l_stream);
|
||||
opj_stream_destroy(l_stream);
|
||||
opj_destroy_codec(l_codec);
|
||||
fclose(fout);
|
||||
return EXIT_FAILURE;
|
||||
goto fails;
|
||||
}
|
||||
|
||||
/* Read the main header of the codestream and if necessary the JP2 boxes*/
|
||||
if(! opj_read_header(l_stream, l_codec, &image)){
|
||||
fprintf(stderr, "ERROR -> opj_dump: failed to read the header\n");
|
||||
opj_stream_destroy_v3(l_stream);
|
||||
opj_stream_destroy(l_stream);
|
||||
opj_destroy_codec(l_codec);
|
||||
opj_image_destroy(image);
|
||||
fclose(fout);
|
||||
return EXIT_FAILURE;
|
||||
goto fails;
|
||||
}
|
||||
|
||||
opj_dump_codec(l_codec, img_fol.flag, fout );
|
||||
@ -557,7 +577,7 @@ int main(int argc, char *argv[])
|
||||
cstr_index = opj_get_cstr_index(l_codec);
|
||||
|
||||
/* close the byte stream */
|
||||
opj_stream_destroy_v3(l_stream);
|
||||
opj_stream_destroy(l_stream);
|
||||
|
||||
/* free remaining structures */
|
||||
if (l_codec) {
|
||||
@ -579,4 +599,12 @@ int main(int argc, char *argv[])
|
||||
fclose(fout);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
fails:
|
||||
if(dirptr){
|
||||
if(dirptr->filename) free(dirptr->filename);
|
||||
if(dirptr->filename_buf) free(dirptr->filename_buf);
|
||||
free(dirptr);
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -243,7 +243,7 @@
|
||||
* Substitute for real dirent structure. Note that `d_name' field is a
|
||||
* true character array although we have it copied in the implementation
|
||||
* dependent data. We could save some memory if we had declared `d_name'
|
||||
* as a pointer refering the name within implementation dependent data.
|
||||
* as a pointer referring the name within implementation dependent data.
|
||||
* We have not done that since some code may rely on sizeof(d_name) to be
|
||||
* something other than four. Besides, directory entries are typically so
|
||||
* small that it takes virtually no time to copy them from place to place.
|
||||
@ -411,7 +411,7 @@ static DIR *opendir(const char *dirname)
|
||||
* capacity of d_name with different macros and some systems do not define
|
||||
* capacity at all (besides actual declaration of the field). If you really
|
||||
* need to find out storage capacity of d_name then you might want to try
|
||||
* NAME_MAX macro. The NAME_MAX is defined in POSIX standard althought
|
||||
* NAME_MAX macro. The NAME_MAX is defined in POSIX standard although
|
||||
* there are many MS-DOS and MS-Windows implementations those do not define
|
||||
* it. There are also systems that declare d_name as "char d_name[1]" and
|
||||
* then allocate suitable amount of memory at run-time. Thanks to Alain
|
||||
@ -466,7 +466,7 @@ readdir (DIR *dirp)
|
||||
/* fill in entry and return that */
|
||||
#if defined(DIRENT_WIN32_INTERFACE)
|
||||
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
|
||||
/* Last file has been processed or an error occured */
|
||||
/* Last file has been processed or an error occurred */
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
errno = ENOENT;
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Build the demo app, small examples
|
||||
|
||||
# First thing define the common source:
|
||||
SET(common_SRCS
|
||||
set(common_SRCS
|
||||
convert.c
|
||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
|
||||
)
|
||||
@ -26,15 +26,15 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
# Loop over all executables:
|
||||
FOREACH(exe opj_jp3d_compress opj_jp3d_decompress)
|
||||
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
||||
TARGET_LINK_LIBRARIES(${exe} openjp3d)
|
||||
foreach(exe opj_jp3d_compress opj_jp3d_decompress)
|
||||
add_executable(${exe} ${exe}.c ${common_SRCS})
|
||||
target_link_libraries(${exe} openjp3d)
|
||||
# On unix you need to link to the math library:
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(${exe} m)
|
||||
ENDIF(UNIX)
|
||||
if(UNIX)
|
||||
target_link_libraries(${exe} m)
|
||||
endif(UNIX)
|
||||
# Install exe
|
||||
INSTALL(TARGETS ${exe}
|
||||
install(TARGETS ${exe}
|
||||
EXPORT OpenJP3DTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
|
||||
|
@ -242,7 +242,7 @@
|
||||
* Substitute for real dirent structure. Note that `d_name' field is a
|
||||
* true character array although we have it copied in the implementation
|
||||
* dependent data. We could save some memory if we had declared `d_name'
|
||||
* as a pointer refering the name within implementation dependent data.
|
||||
* as a pointer referring the name within implementation dependent data.
|
||||
* We have not done that since some code may rely on sizeof(d_name) to be
|
||||
* something other than four. Besides, directory entries are typically so
|
||||
* small that it takes virtually no time to copy them from place to place.
|
||||
@ -410,7 +410,7 @@ static DIR *opendir(const char *dirname)
|
||||
* capacity of d_name with different macros and some systems do not define
|
||||
* capacity at all (besides actual declaration of the field). If you really
|
||||
* need to find out storage capacity of d_name then you might want to try
|
||||
* NAME_MAX macro. The NAME_MAX is defined in POSIX standard althought
|
||||
* NAME_MAX macro. The NAME_MAX is defined in POSIX standard although
|
||||
* there are many MS-DOS and MS-Windows implementations those do not define
|
||||
* it. There are also systems that declare d_name as "char d_name[1]" and
|
||||
* then allocate suitable amount of memory at run-time. Thanks to Alain
|
||||
@ -465,7 +465,7 @@ readdir (DIR *dirp)
|
||||
/* fill in entry and return that */
|
||||
#if defined(DIRENT_WIN32_INTERFACE)
|
||||
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
|
||||
/* Last file has been processed or an error occured */
|
||||
/* Last file has been processed or an error occurred */
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
errno = ENOENT;
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id: opj_dec_server.c 54 2011-05-10 13:22:47Z kaori $
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id: addXMLinJP2.c 46 2011-02-17 14:50:55Z kaori $
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id: test_index.c 46 2011-02-17 14:50:55Z kaori $
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id: opj_server.c 53 2011-05-09 16:55:39Z kaori $
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* Copyright (c) 2011, Lucian Corlaciu, GSoC
|
||||
* All rights reserved.
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2006-2007, Parvatha Elangovan
|
||||
* All rights reserved.
|
||||
@ -181,10 +187,9 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,
|
||||
|
||||
#ifdef OPJ_BIG_ENDIAN
|
||||
|
||||
static inline int16_t swap16(int16_t x)
|
||||
static inline uint16_t swap16(uint16_t x)
|
||||
{
|
||||
return((((u_int16_t)x & 0x00ffU) << 8) |
|
||||
(((u_int16_t)x & 0xff00U) >> 8));
|
||||
return(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -1430,7 +1435,7 @@ int imagetopgx(opj_image_t * image, const char *outfile) {
|
||||
fprintf(stderr, "ERROR -> failed to open %s for writing\n", name);
|
||||
return 1;
|
||||
}
|
||||
/* dont need name anymore */
|
||||
/* don't need name anymore */
|
||||
if( total > 256 ) {
|
||||
free(name);
|
||||
}
|
||||
@ -2852,6 +2857,7 @@ opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw
|
||||
for (i = 0; i < w * h; i++) {
|
||||
if (!fread(&value, 1, 1, f)) {
|
||||
fprintf(stderr,"Error reading raw file. End of file probably reached.\n");
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
image->comps[compno].data[i] = raw_cp->rawSigned?(char)value:value;
|
||||
@ -2866,11 +2872,13 @@ opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw
|
||||
unsigned char temp;
|
||||
if (!fread(&temp, 1, 1, f)) {
|
||||
fprintf(stderr,"Error reading raw file. End of file probably reached.\n");
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
value = temp << 8;
|
||||
if (!fread(&temp, 1, 1, f)) {
|
||||
fprintf(stderr,"Error reading raw file. End of file probably reached.\n");
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
value += temp;
|
||||
@ -2880,6 +2888,7 @@ opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"OpenJPEG cannot encode raw components with bit depth higher than 16 bits.\n");
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2006-2007, Parvatha Elangovan
|
||||
* All rights reserved.
|
||||
@ -193,7 +199,7 @@ static void encode_help_display(void) {
|
||||
fprintf(stdout," Indicate multiple modes by adding their values. \n");
|
||||
fprintf(stdout," ex: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-TP : devide packets of every tile into tile-parts (-TP R) [R, L, C]\n");
|
||||
fprintf(stdout,"-TP : divide packets of every tile into tile-parts (-TP R) [R, L, C]\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-x : create an index file *.Idx (-x index_name.Idx) \n");
|
||||
fprintf(stdout,"\n");
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2006-2007, Parvatha Elangovan
|
||||
* All rights reserved.
|
||||
|
@ -243,7 +243,7 @@
|
||||
* Substitute for real dirent structure. Note that `d_name' field is a
|
||||
* true character array although we have it copied in the implementation
|
||||
* dependent data. We could save some memory if we had declared `d_name'
|
||||
* as a pointer refering the name within implementation dependent data.
|
||||
* as a pointer referring the name within implementation dependent data.
|
||||
* We have not done that since some code may rely on sizeof(d_name) to be
|
||||
* something other than four. Besides, directory entries are typically so
|
||||
* small that it takes virtually no time to copy them from place to place.
|
||||
@ -411,7 +411,7 @@ static DIR *opendir(const char *dirname)
|
||||
* capacity of d_name with different macros and some systems do not define
|
||||
* capacity at all (besides actual declaration of the field). If you really
|
||||
* need to find out storage capacity of d_name then you might want to try
|
||||
* NAME_MAX macro. The NAME_MAX is defined in POSIX standard althought
|
||||
* NAME_MAX macro. The NAME_MAX is defined in POSIX standard although
|
||||
* there are many MS-DOS and MS-Windows implementations those do not define
|
||||
* it. There are also systems that declare d_name as "char d_name[1]" and
|
||||
* then allocate suitable amount of memory at run-time. Thanks to Alain
|
||||
@ -466,7 +466,7 @@ readdir (DIR *dirp)
|
||||
/* fill in entry and return that */
|
||||
#if defined(DIRENT_WIN32_INTERFACE)
|
||||
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
|
||||
/* Last file has been processed or an error occured */
|
||||
/* Last file has been processed or an error occurred */
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
errno = ENOENT;
|
||||
|
@ -375,7 +375,7 @@ void xml_write_free_and_skip(FILE* xmlout, opj_mj2_t * movie) {
|
||||
}
|
||||
|
||||
void xml_write_uuid(FILE* xmlout, opj_mj2_t * movie) {
|
||||
/* Univeral Unique IDs of 16 bytes. */
|
||||
/* Universal Unique IDs of 16 bytes. */
|
||||
#ifdef NOTYET
|
||||
/* NO-OP so far. There can be zero or more instances of private uuid boxes in a file.
|
||||
This function supports the top level of the file, but uuid may be elsewhere [not yet supported].
|
||||
@ -962,7 +962,7 @@ int xml_out_frame(FILE* file, FILE* xmlout, mj2_sample_t *sample, unsigned int s
|
||||
fprintf(xmlout, " <JP2_Frame Num=\"%d\">\n", snum+1);
|
||||
fprintf(xmlout, " <MainHeader>\n");
|
||||
/* There can be multiple codestreams; a particular image is entirely within a single codestream */
|
||||
/* TO DO: A frame can be represented by two I-guess-contigious codestreams if its interleaved. */
|
||||
/* TO DO: A frame can be represented by two I-guess-contiguous codestreams if its interleaved. */
|
||||
fprintf(xmlout, " <StartOfCodestream Marker=\"SOC\" />\n");
|
||||
/* "cp" stands for "coding parameter"; "tcp" is tile coding parameters, "tccp" is tile-component coding parameters */
|
||||
xml_out_frame_siz(xmlout, img, cp); /* reqd in main */
|
||||
|
@ -64,7 +64,7 @@ void help_display()
|
||||
fprintf(stdout,"----------\n");
|
||||
fprintf(stdout,"The metadata includes the jp2 image and tile headers of the first frame.\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"Metadata values are shown in 'raw' form (e.g., hexidecimal) as stored in the\n");
|
||||
fprintf(stdout,"Metadata values are shown in 'raw' form (e.g., hexadecimal) as stored in the\n");
|
||||
fprintf(stdout,"file, and, if apt, in a 'derived' form that is more quickly grasped.\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"Notes explaining the XML are embedded as terse comments. These include\n");
|
||||
|
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -351,7 +356,7 @@ static void setparams(opj_mj2_t *movie, opj_image_t *image) {
|
||||
movie->tk[0].jp2_struct.enumcs = 18; /* YUV */
|
||||
|
||||
else
|
||||
movie->tk[0].jp2_struct.enumcs = 0; /* Unkown profile */
|
||||
movie->tk[0].jp2_struct.enumcs = 0; /* Unknown profile */
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita' degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita' degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita' degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -884,7 +889,7 @@ void OPJMarkerTree::OnSelChanged(wxTreeEvent& event)
|
||||
|
||||
m_peektextCtrl->WriteText(text);
|
||||
|
||||
delete buffer;
|
||||
delete [] buffer;
|
||||
}
|
||||
|
||||
/*void LogKeyEvent(const wxChar *name, const wxKeyEvent& event)
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita' degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Università degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Università degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
Copyright (c) 2001-2003, David Janssens
|
||||
Copyright (c) 2002-2003, Yannick Verschueren
|
||||
Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
|
@ -8,4 +8,4 @@ Anybody. As the OpenJPEG library is released under the BSD license, anybody can
|
||||
|
||||
Who is developing the library ?
|
||||
===============================
|
||||
The library is developed by the Communications and Remote Sensing Lab (TELE), in the Université Catholique de Louvain (UCL). The JPWL module is developped and maintained by the Digital Signal Processing Lab (DSPLab) of the University of Perugia, Italy (UNIPG). As our purpose is to make OpenJPEG really useful for those interested in the image compression field, any feedback/advices are obviously welcome ! We will do our best to handle them quickly.
|
||||
The library is developed by the Communications and Remote Sensing Lab (TELE), in the Université Catholique de Louvain (UCL). The JPWL module is developed and maintained by the Digital Signal Processing Lab (DSPLab) of the University of Perugia, Italy (UNIPG). As our purpose is to make OpenJPEG really useful for those interested in the image compression field, any feedback/advices are obviously welcome ! We will do our best to handle them quickly.
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Università degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,4 +1,9 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Università degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -5,42 +5,82 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
|
||||
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers)
|
||||
|
||||
include_directories(
|
||||
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h
|
||||
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h
|
||||
)
|
||||
# Defines the source code for the library
|
||||
set(OPENJPEG_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thread.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thread.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bio.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bio.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cio.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cio.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dwt.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dwt.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/event.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/event.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/image.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/image.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/invert.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/invert.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/j2k.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/j2k.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jp2.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jp2.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mct.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mct.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mqc.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mqc.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mqc_inl.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openjpeg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openjpeg.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_clock.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_clock.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pi.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pi.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/raw.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/raw.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/t1.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/t1.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/t2.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/t2.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tcd.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tcd.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tgt.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tgt.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/function_list.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/function_list.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_codec.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_includes.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_intmath.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_malloc.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_malloc.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_stdint.h
|
||||
)
|
||||
if(BUILD_JPIP)
|
||||
add_definitions(-DUSE_JPIP)
|
||||
set(OPENJPEG_SRCS
|
||||
${OPENJPEG_SRCS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cidx_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cidx_manager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/phix_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ppix_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thix_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tpix_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/indexbox_manager.h
|
||||
)
|
||||
endif()
|
||||
|
||||
option(OPJ_DISABLE_TPSOT_FIX "Disable TPsot==TNsot fix. See https://github.com/uclouvain/openjpeg/issues/254." OFF)
|
||||
if(OPJ_DISABLE_TPSOT_FIX)
|
||||
add_definitions(-DOPJ_DISABLE_TPSOT_FIX)
|
||||
endif()
|
||||
|
||||
# Special case for old i586-mingw32msvc-gcc cross compiler
|
||||
if(NOT WIN32 AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER MATCHES ".*mingw32msvc.*" )
|
||||
set(WIN32 YES)
|
||||
endif()
|
||||
|
||||
# Build the library
|
||||
if(WIN32)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
@ -54,6 +94,9 @@ if(UNIX)
|
||||
target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
|
||||
endif()
|
||||
set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||
if(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
|
||||
target_compile_options(${OPENJPEG_LIBRARY_NAME} PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
||||
endif()
|
||||
|
||||
# Install library
|
||||
install(TARGETS ${OPENJPEG_LIBRARY_NAME}
|
||||
@ -68,21 +111,25 @@ install(FILES openjpeg.h opj_stdint.h
|
||||
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers
|
||||
)
|
||||
|
||||
if(BUILD_DOC)
|
||||
# install man page of the library
|
||||
install(
|
||||
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjp2.3
|
||||
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)
|
||||
endif()
|
||||
|
||||
# internal utilities to generate t1_luts.h (part of the jp2 lib)
|
||||
if(BUILD_LUTS_GENERATOR)
|
||||
# internal utility to generate t1_luts.h (part of the jp2 lib)
|
||||
# no need to install:
|
||||
add_executable(t1_generate_luts t1_generate_luts.c)
|
||||
if(UNIX)
|
||||
target_link_libraries(t1_generate_luts m)
|
||||
add_executable(t1_generate_luts t1_generate_luts.c)
|
||||
if(UNIX)
|
||||
target_link_libraries(t1_generate_luts m)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Experimental option; let's how cppcheck performs
|
||||
# Implementation details:
|
||||
# I could not figure out how to easily upload a file to CDash. Instead simply
|
||||
# I could not figure out how to easily upload a file to CDash. Instead simply
|
||||
# pretend cppcheck is part of the Build step. Technically cppcheck can even
|
||||
# output gcc formatted error/warning report
|
||||
# Another implementation detail: I could not redirect error to the error
|
||||
@ -96,3 +143,45 @@ if(OPENJPEG_CPPCHECK)
|
||||
COMMAND ${CPPCHECK_EXECUTABLE} -DWIN32 ${f})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(OPJ_USE_DSYMUTIL)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_custom_command(TARGET ${OPENJPEG_LIBRARY_NAME} POST_BUILD
|
||||
COMMAND "dsymutil" "$<TARGET_SONAME_FILE:${OPENJPEG_LIBRARY_NAME}>"
|
||||
COMMENT "dsymutil $<TARGET_SONAME_FILE:${OPENJPEG_LIBRARY_NAME}>"
|
||||
DEPENDS ${OPENJPEG_LIBRARY_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#################################################################################
|
||||
# threading configuration
|
||||
#################################################################################
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
|
||||
option(OPJ_USE_THREAD "Build with thread/mutex support " ON)
|
||||
if(NOT OPJ_USE_THREAD)
|
||||
add_definitions( -DMUTEX_stub)
|
||||
endif(NOT OPJ_USE_THREAD)
|
||||
|
||||
find_package(Threads QUIET)
|
||||
|
||||
if(OPJ_USE_THREAD AND WIN32 AND NOT Threads_FOUND )
|
||||
add_definitions( -DMUTEX_win32)
|
||||
set(Threads_FOUND YES)
|
||||
endif()
|
||||
|
||||
if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_WIN32_THREADS_INIT )
|
||||
add_definitions( -DMUTEX_win32)
|
||||
endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_WIN32_THREADS_INIT )
|
||||
|
||||
if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
|
||||
add_definitions( -DMUTEX_pthread)
|
||||
endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
|
||||
|
||||
if(OPJ_USE_THREAD AND NOT Threads_FOUND)
|
||||
message(FATAL_ERROR "No thread library found and thread/mutex support is required by OPJ_USE_THREAD option")
|
||||
endif(OPJ_USE_THREAD AND NOT Threads_FOUND)
|
||||
|
||||
if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
|
||||
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -72,27 +78,27 @@ static OPJ_BOOL opj_bio_bytein(opj_bio_t *bio);
|
||||
==========================================================
|
||||
*/
|
||||
|
||||
OPJ_BOOL opj_bio_byteout(opj_bio_t *bio) {
|
||||
static OPJ_BOOL opj_bio_byteout(opj_bio_t *bio) {
|
||||
bio->buf = (bio->buf << 8) & 0xffff;
|
||||
bio->ct = bio->buf == 0xff00 ? 7 : 8;
|
||||
if (bio->bp >= bio->end) {
|
||||
if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) {
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
*bio->bp++ = (OPJ_BYTE)(bio->buf >> 8);
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
OPJ_BOOL opj_bio_bytein(opj_bio_t *bio) {
|
||||
static OPJ_BOOL opj_bio_bytein(opj_bio_t *bio) {
|
||||
bio->buf = (bio->buf << 8) & 0xffff;
|
||||
bio->ct = bio->buf == 0xff00 ? 7 : 8;
|
||||
if (bio->bp >= bio->end) {
|
||||
if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) {
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
bio->buf |= *bio->bp++;
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b) {
|
||||
static void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b) {
|
||||
if (bio->ct == 0) {
|
||||
opj_bio_byteout(bio); /* MSD: why not check the return value of this function ? */
|
||||
}
|
||||
@ -100,7 +106,7 @@ void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b) {
|
||||
bio->buf |= b << bio->ct;
|
||||
}
|
||||
|
||||
OPJ_UINT32 opj_bio_getbit(opj_bio_t *bio) {
|
||||
static OPJ_UINT32 opj_bio_getbit(opj_bio_t *bio) {
|
||||
if (bio->ct == 0) {
|
||||
opj_bio_bytein(bio); /* MSD: why not check the return value of this function ? */
|
||||
}
|
||||
@ -145,30 +151,40 @@ void opj_bio_init_dec(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len) {
|
||||
bio->ct = 0;
|
||||
}
|
||||
|
||||
OPJ_NOSANITIZE("unsigned-integer-overflow")
|
||||
void opj_bio_write(opj_bio_t *bio, OPJ_UINT32 v, OPJ_UINT32 n) {
|
||||
OPJ_UINT32 i;
|
||||
for (i = n - 1; i < n; i--) {
|
||||
|
||||
assert((n > 0U) && (n <= 32U));
|
||||
for (i = n - 1; i < n; i--) { /* overflow used for end-loop condition */
|
||||
opj_bio_putbit(bio, (v >> i) & 1);
|
||||
}
|
||||
}
|
||||
|
||||
OPJ_NOSANITIZE("unsigned-integer-overflow")
|
||||
OPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n) {
|
||||
OPJ_UINT32 i;
|
||||
OPJ_UINT32 v;
|
||||
v = 0;
|
||||
for (i = n - 1; i < n; i--) {
|
||||
v += opj_bio_getbit(bio) << i;
|
||||
OPJ_UINT32 v;
|
||||
|
||||
assert((n > 0U) /* && (n <= 32U)*/);
|
||||
#ifdef OPJ_UBSAN_BUILD
|
||||
/* This assert fails for some corrupted images which are gracefully rejected */
|
||||
/* Add this assert only for ubsan build. */
|
||||
/* This is the condition for overflow not to occur below which is needed because of OPJ_NOSANITIZE */
|
||||
assert(n <= 32U);
|
||||
#endif
|
||||
v = 0U;
|
||||
for (i = n - 1; i < n; i--) { /* overflow used for end-loop condition */
|
||||
v |= opj_bio_getbit(bio) << i; /* can't overflow, opj_bio_getbit returns 0 or 1 */
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
OPJ_BOOL opj_bio_flush(opj_bio_t *bio) {
|
||||
bio->ct = 0;
|
||||
if (! opj_bio_byteout(bio)) {
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
if (bio->ct == 7) {
|
||||
bio->ct = 0;
|
||||
if (! opj_bio_byteout(bio)) {
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
@ -177,12 +193,11 @@ OPJ_BOOL opj_bio_flush(opj_bio_t *bio) {
|
||||
}
|
||||
|
||||
OPJ_BOOL opj_bio_inalign(opj_bio_t *bio) {
|
||||
bio->ct = 0;
|
||||
if ((bio->buf & 0xff) == 0xff) {
|
||||
if (! opj_bio_bytein(bio)) {
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
bio->ct = 0;
|
||||
}
|
||||
bio->ct = 0;
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id: cidx_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2004, Yannick Verschueren
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
@ -60,7 +60,9 @@ int opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t
|
||||
|
||||
lenp = -1;
|
||||
box = (opj_jp2_box_t *)opj_calloc( 32, sizeof(opj_jp2_box_t));
|
||||
|
||||
if(box == NULL){
|
||||
return 0;
|
||||
}
|
||||
for (i=0;i<2;i++){
|
||||
|
||||
if(i)
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* $Id: cidx_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
|
||||
*
|
||||
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2004, Yannick Verschueren
|
||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||
* All rights reserved.
|
||||
|
@ -1,11 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
|
||||
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
|
||||
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -40,7 +46,7 @@
|
||||
|
||||
void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)
|
||||
{
|
||||
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes;
|
||||
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value)+sizeof(OPJ_UINT32)-p_nb_bytes;
|
||||
|
||||
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
|
||||
|
||||
@ -66,7 +72,7 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
|
||||
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
|
||||
|
||||
*p_value = 0;
|
||||
memcpy(l_data_ptr+4-p_nb_bytes,p_buffer,p_nb_bytes);
|
||||
memcpy(l_data_ptr+sizeof(OPJ_UINT32)-p_nb_bytes,p_buffer,p_nb_bytes);
|
||||
}
|
||||
|
||||
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes)
|
||||
@ -145,12 +151,11 @@ void opj_read_float_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value)
|
||||
opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,OPJ_BOOL l_is_input)
|
||||
{
|
||||
opj_stream_private_t * l_stream = 00;
|
||||
l_stream = (opj_stream_private_t*) opj_malloc(sizeof(opj_stream_private_t));
|
||||
l_stream = (opj_stream_private_t*) opj_calloc(1,sizeof(opj_stream_private_t));
|
||||
if (! l_stream) {
|
||||
return 00;
|
||||
}
|
||||
|
||||
memset(l_stream,0,sizeof(opj_stream_private_t));
|
||||
l_stream->m_buffer_size = p_buffer_size;
|
||||
l_stream->m_stored_data = (OPJ_BYTE *) opj_malloc(p_buffer_size);
|
||||
if (! l_stream->m_stored_data) {
|
||||
@ -161,12 +166,12 @@ opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,OPJ_BOOL l
|
||||
l_stream->m_current_data = l_stream->m_stored_data;
|
||||
|
||||
if (l_is_input) {
|
||||
l_stream->m_status |= opj_stream_e_input;
|
||||
l_stream->m_status |= OPJ_STREAM_STATUS_INPUT;
|
||||
l_stream->m_opj_skip = opj_stream_read_skip;
|
||||
l_stream->m_opj_seek = opj_stream_read_seek;
|
||||
}
|
||||
else {
|
||||
l_stream->m_status |= opj_stream_e_output;
|
||||
l_stream->m_status |= OPJ_STREAM_STATUS_OUTPUT;
|
||||
l_stream->m_opj_skip = opj_stream_write_skip;
|
||||
l_stream->m_opj_seek = opj_stream_write_seek;
|
||||
}
|
||||
@ -198,16 +203,11 @@ void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream)
|
||||
}
|
||||
}
|
||||
|
||||
void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream)
|
||||
{
|
||||
opj_stream_destroy(p_stream);
|
||||
}
|
||||
|
||||
void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function)
|
||||
{
|
||||
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||
|
||||
if ((!l_stream) || (! (l_stream->m_status & opj_stream_e_input))) {
|
||||
if ((!l_stream) || (! (l_stream->m_status & OPJ_STREAM_STATUS_INPUT))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream, opj_stre
|
||||
{
|
||||
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||
|
||||
if ((!l_stream )|| (! (l_stream->m_status & opj_stream_e_output))) {
|
||||
if ((!l_stream )|| (! (l_stream->m_status & OPJ_STREAM_STATUS_OUTPUT))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -246,15 +246,7 @@ void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_strea
|
||||
l_stream->m_skip_fn = p_function;
|
||||
}
|
||||
|
||||
void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data)
|
||||
{
|
||||
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||
if (!l_stream)
|
||||
return;
|
||||
l_stream->m_user_data = p_data;
|
||||
}
|
||||
|
||||
void OPJ_CALLCONV opj_stream_set_user_data_v3(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)
|
||||
void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)
|
||||
{
|
||||
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||
if (!l_stream)
|
||||
@ -284,7 +276,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
|
||||
}
|
||||
|
||||
/* we are now in the case when the remaining data if not sufficient */
|
||||
if (p_stream->m_status & opj_stream_e_end) {
|
||||
if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
|
||||
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
|
||||
memcpy(p_buffer,p_stream->m_current_data,p_stream->m_bytes_in_buffer);
|
||||
p_stream->m_current_data += p_stream->m_bytes_in_buffer;
|
||||
@ -310,7 +302,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
|
||||
p_stream->m_current_data = p_stream->m_stored_data;
|
||||
}
|
||||
|
||||
while(1){
|
||||
for (;;) {
|
||||
/* we should read less than a chunk -> read a chunk */
|
||||
if (p_size < p_stream->m_buffer_size) {
|
||||
/* we should do an actual read on the media */
|
||||
@ -321,7 +313,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
|
||||
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||
|
||||
p_stream->m_bytes_in_buffer = 0;
|
||||
p_stream->m_status |= opj_stream_e_end;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||
/* end of stream */
|
||||
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;
|
||||
}
|
||||
@ -353,7 +345,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
|
||||
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||
|
||||
p_stream->m_bytes_in_buffer = 0;
|
||||
p_stream->m_status |= opj_stream_e_end;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||
/* end of stream */
|
||||
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;
|
||||
}
|
||||
@ -386,11 +378,11 @@ OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,
|
||||
OPJ_SIZE_T l_remaining_bytes = 0;
|
||||
OPJ_SIZE_T l_write_nb_bytes = 0;
|
||||
|
||||
if (p_stream->m_status & opj_stream_e_error) {
|
||||
if (p_stream->m_status & OPJ_STREAM_STATUS_ERROR) {
|
||||
return (OPJ_SIZE_T)-1;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
for (;;) {
|
||||
l_remaining_bytes = p_stream->m_buffer_size - p_stream->m_bytes_in_buffer;
|
||||
|
||||
/* we have more memory than required */
|
||||
@ -440,7 +432,7 @@ OPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, opj_event_mgr_t * p_
|
||||
p_stream->m_user_data);
|
||||
|
||||
if (l_current_write_nb_bytes == (OPJ_SIZE_T)-1) {
|
||||
p_stream->m_status |= opj_stream_e_error;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||
opj_event_msg(p_event_mgr, EVT_INFO, "Error on writing stream!\n");
|
||||
|
||||
return OPJ_FALSE;
|
||||
@ -473,7 +465,7 @@ OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
|
||||
}
|
||||
|
||||
/* we are now in the case when the remaining data if not sufficient */
|
||||
if (p_stream->m_status & opj_stream_e_end) {
|
||||
if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
|
||||
l_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||
p_stream->m_current_data += p_stream->m_bytes_in_buffer;
|
||||
p_stream->m_bytes_in_buffer = 0;
|
||||
@ -495,7 +487,7 @@ OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
|
||||
if (l_current_skip_nb_bytes == (OPJ_OFF_T) -1) {
|
||||
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||
|
||||
p_stream->m_status |= opj_stream_e_end;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||
/* end if stream */
|
||||
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) -1;
|
||||
@ -515,14 +507,14 @@ OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_si
|
||||
OPJ_OFF_T l_current_skip_nb_bytes = 0;
|
||||
OPJ_OFF_T l_skip_nb_bytes = 0;
|
||||
|
||||
if (p_stream->m_status & opj_stream_e_error) {
|
||||
if (p_stream->m_status & OPJ_STREAM_STATUS_ERROR) {
|
||||
return (OPJ_OFF_T) -1;
|
||||
}
|
||||
|
||||
/* we should flush data */
|
||||
l_is_written = opj_stream_flush (p_stream, p_event_mgr);
|
||||
if (! l_is_written) {
|
||||
p_stream->m_status |= opj_stream_e_error;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||
p_stream->m_bytes_in_buffer = 0;
|
||||
return (OPJ_OFF_T) -1;
|
||||
}
|
||||
@ -535,7 +527,7 @@ OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_si
|
||||
if (l_current_skip_nb_bytes == (OPJ_OFF_T)-1) {
|
||||
opj_event_msg(p_event_mgr, EVT_INFO, "Stream error!\n");
|
||||
|
||||
p_stream->m_status |= opj_stream_e_error;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||
/* end if stream */
|
||||
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T)-1;
|
||||
@ -576,12 +568,12 @@ OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size
|
||||
p_stream->m_bytes_in_buffer = 0;
|
||||
|
||||
if( !(p_stream->m_seek_fn(p_size,p_stream->m_user_data)) ) {
|
||||
p_stream->m_status |= opj_stream_e_end;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
else {
|
||||
/* reset stream status */
|
||||
p_stream->m_status &= (~opj_stream_e_end);
|
||||
p_stream->m_status &= (~OPJ_STREAM_STATUS_END);
|
||||
p_stream->m_byte_offset = p_size;
|
||||
|
||||
}
|
||||
@ -592,7 +584,7 @@ OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size
|
||||
OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)
|
||||
{
|
||||
if (! opj_stream_flush(p_stream,p_event_mgr)) {
|
||||
p_stream->m_status |= opj_stream_e_error;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
|
||||
@ -600,7 +592,7 @@ OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
|
||||
p_stream->m_bytes_in_buffer = 0;
|
||||
|
||||
if (! p_stream->m_seek_fn(p_size,p_stream->m_user_data)) {
|
||||
p_stream->m_status |= opj_stream_e_error;
|
||||
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
else {
|
||||
|
@ -1,11 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
|
||||
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
|
||||
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -43,7 +49,7 @@ The functions in CIO.C have for goal to realize a byte input / output process.
|
||||
/** @defgroup CIO CIO - byte input-output stream */
|
||||
/*@{*/
|
||||
|
||||
#include "opj_config.h"
|
||||
#include "opj_config_private.h"
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
@ -64,16 +70,10 @@ The functions in CIO.C have for goal to realize a byte input / output process.
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
opj_signed_sentinel = -1, /* do not use in code */
|
||||
opj_stream_e_output = 0x1,
|
||||
opj_stream_e_input = 0x2,
|
||||
opj_stream_e_end = 0x4,
|
||||
opj_stream_e_error = 0x8
|
||||
}
|
||||
opj_stream_flag ;
|
||||
#define OPJ_STREAM_STATUS_OUTPUT 0x1U
|
||||
#define OPJ_STREAM_STATUS_INPUT 0x2U
|
||||
#define OPJ_STREAM_STATUS_END 0x4U
|
||||
#define OPJ_STREAM_STATUS_ERROR 0x8U
|
||||
|
||||
/**
|
||||
Byte input-output stream.
|
||||
@ -156,8 +156,9 @@ typedef struct opj_stream_private
|
||||
|
||||
/**
|
||||
* Flags to tell the status of the stream.
|
||||
* Used with OPJ_STREAM_STATUS_* defines.
|
||||
*/
|
||||
opj_stream_flag m_status;
|
||||
OPJ_UINT32 m_status;
|
||||
|
||||
}
|
||||
opj_stream_private_t;
|
||||
@ -178,7 +179,7 @@ void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
|
||||
* @param p_buffer pointer the data buffer to read data from.
|
||||
* @param p_value pointer to the value that will store the data.
|
||||
* @param p_nb_bytes the nb bytes to read.
|
||||
* @return the number of bytes read or -1 if an error occured.
|
||||
* @return the number of bytes read or -1 if an error occurred.
|
||||
*/
|
||||
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
|
||||
|
||||
@ -187,7 +188,7 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
|
||||
* @param p_buffer pointer the data buffer to write data to.
|
||||
* @param p_value the value to write
|
||||
* @param p_nb_bytes the number of bytes to write
|
||||
* @return the number of bytes written or -1 if an error occured
|
||||
* @return the number of bytes written or -1 if an error occurred
|
||||
*/
|
||||
void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
|
||||
|
||||
@ -196,7 +197,7 @@ void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
|
||||
* @param p_buffer pointer the data buffer to read data from.
|
||||
* @param p_value pointer to the value that will store the data.
|
||||
* @param p_nb_bytes the nb bytes to read.
|
||||
* @return the number of bytes read or -1 if an error occured.
|
||||
* @return the number of bytes read or -1 if an error occurred.
|
||||
*/
|
||||
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
|
||||
|
||||
@ -263,7 +264,7 @@ void opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value);
|
||||
* @param p_buffer pointer to the data buffer that will receive the data.
|
||||
* @param p_size number of bytes to read.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return the number of bytes read, or -1 if an error occured or if the stream is at the end.
|
||||
* @return the number of bytes read, or -1 if an error occurred or if the stream is at the end.
|
||||
*/
|
||||
OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
@ -273,7 +274,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
|
||||
* @param p_buffer pointer to the data buffer holds the data to be writtent.
|
||||
* @param p_size number of bytes to write.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return the number of bytes writtent, or -1 if an error occured.
|
||||
* @return the number of bytes writtent, or -1 if an error occurred.
|
||||
*/
|
||||
OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
@ -290,7 +291,7 @@ OPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr
|
||||
* @param p_stream the stream to skip data from.
|
||||
* @param p_size the number of bytes to skip.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return the number of bytes skipped, or -1 if an error occured.
|
||||
* @return the number of bytes skipped, or -1 if an error occurred.
|
||||
*/
|
||||
OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
@ -318,7 +319,7 @@ OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream
|
||||
* @param p_stream the stream to skip data from.
|
||||
* @param p_size the number of bytes to skip.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return the number of bytes skipped, or -1 if an error occured.
|
||||
* @return the number of bytes skipped, or -1 if an error occurred.
|
||||
*/
|
||||
OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
@ -327,7 +328,7 @@ OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_si
|
||||
* @param p_stream the stream to skip data from.
|
||||
* @param p_size the number of bytes to skip.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return the number of bytes skipped, or -1 if an error occured.
|
||||
* @return the number of bytes skipped, or -1 if an error occurred.
|
||||
*/
|
||||
OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
@ -336,7 +337,7 @@ OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
|
||||
* @param p_stream the stream to skip data from.
|
||||
* @param p_size the number of bytes to skip.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return OPJ_TRUE if success, or OPJ_FALSE if an error occured.
|
||||
* @return OPJ_TRUE if success, or OPJ_FALSE if an error occurred.
|
||||
*/
|
||||
OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
@ -345,7 +346,7 @@ OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size
|
||||
* @param p_stream the stream to skip data from.
|
||||
* @param p_size the number of bytes to skip.
|
||||
* @param p_event_mgr the user event manager to be notified of special events.
|
||||
* @return the number of bytes skipped, or -1 if an error occured.
|
||||
* @return the number of bytes skipped, or -1 if an error occurred.
|
||||
*/
|
||||
OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
|
||||
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2007, Jonathan Ballard <dzonatas@dzonux.net>
|
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
|
||||
@ -118,21 +124,21 @@ static void opj_dwt_encode_stepsize(OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_st
|
||||
/**
|
||||
Inverse wavelet transform in 2-D.
|
||||
*/
|
||||
static OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 i, DWT1DFN fn);
|
||||
static OPJ_BOOL opj_dwt_decode_tile(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec, OPJ_UINT32 i, DWT1DFN fn);
|
||||
|
||||
static OPJ_BOOL opj_dwt_encode_procedure( opj_tcd_tilecomp_t * tilec,
|
||||
void (*p_function)(OPJ_INT32 *, OPJ_INT32,OPJ_INT32,OPJ_INT32) );
|
||||
|
||||
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i);
|
||||
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* OPJ_RESTRICT r, OPJ_UINT32 i);
|
||||
|
||||
/* <summary> */
|
||||
/* Inverse 9-7 wavelet transform in 1-D. */
|
||||
/* </summary> */
|
||||
static void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt);
|
||||
static void opj_v4dwt_decode(opj_v4dwt_t* OPJ_RESTRICT dwt);
|
||||
|
||||
static void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OPJ_INT32 x, OPJ_INT32 size);
|
||||
static void opj_v4dwt_interleave_h(opj_v4dwt_t* OPJ_RESTRICT w, OPJ_FLOAT32* OPJ_RESTRICT a, OPJ_INT32 x, OPJ_INT32 size);
|
||||
|
||||
static void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read);
|
||||
static void opj_v4dwt_interleave_v(opj_v4dwt_t* OPJ_RESTRICT v , OPJ_FLOAT32* OPJ_RESTRICT a , OPJ_INT32 x, OPJ_INT32 nb_elts_read);
|
||||
|
||||
#ifdef __SSE__
|
||||
static void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c);
|
||||
@ -187,7 +193,7 @@ static const OPJ_FLOAT64 opj_dwt_norms_real[4][10] = {
|
||||
/* <summary> */
|
||||
/* Forward lazy transform (horizontal). */
|
||||
/* </summary> */
|
||||
void opj_dwt_deinterleave_h(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
static void opj_dwt_deinterleave_h(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
OPJ_INT32 i;
|
||||
OPJ_INT32 * l_dest = b;
|
||||
OPJ_INT32 * l_src = a+cas;
|
||||
@ -209,7 +215,7 @@ void opj_dwt_deinterleave_h(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32
|
||||
/* <summary> */
|
||||
/* Forward lazy transform (vertical). */
|
||||
/* </summary> */
|
||||
void opj_dwt_deinterleave_v(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 x, OPJ_INT32 cas) {
|
||||
static void opj_dwt_deinterleave_v(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 x, OPJ_INT32 cas) {
|
||||
OPJ_INT32 i = sn;
|
||||
OPJ_INT32 * l_dest = b;
|
||||
OPJ_INT32 * l_src = a+cas;
|
||||
@ -234,7 +240,7 @@ void opj_dwt_deinterleave_v(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32
|
||||
/* <summary> */
|
||||
/* Inverse lazy transform (horizontal). */
|
||||
/* </summary> */
|
||||
void opj_dwt_interleave_h(opj_dwt_t* h, OPJ_INT32 *a) {
|
||||
static void opj_dwt_interleave_h(opj_dwt_t* h, OPJ_INT32 *a) {
|
||||
OPJ_INT32 *ai = a;
|
||||
OPJ_INT32 *bi = h->mem + h->cas;
|
||||
OPJ_INT32 i = h->sn;
|
||||
@ -254,7 +260,7 @@ void opj_dwt_interleave_h(opj_dwt_t* h, OPJ_INT32 *a) {
|
||||
/* <summary> */
|
||||
/* Inverse lazy transform (vertical). */
|
||||
/* </summary> */
|
||||
void opj_dwt_interleave_v(opj_dwt_t* v, OPJ_INT32 *a, OPJ_INT32 x) {
|
||||
static void opj_dwt_interleave_v(opj_dwt_t* v, OPJ_INT32 *a, OPJ_INT32 x) {
|
||||
OPJ_INT32 *ai = a;
|
||||
OPJ_INT32 *bi = v->mem + v->cas;
|
||||
OPJ_INT32 i = v->sn;
|
||||
@ -277,7 +283,7 @@ void opj_dwt_interleave_v(opj_dwt_t* v, OPJ_INT32 *a, OPJ_INT32 x) {
|
||||
/* <summary> */
|
||||
/* Forward 5-3 wavelet transform in 1-D. */
|
||||
/* </summary> */
|
||||
void opj_dwt_encode_1(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
static void opj_dwt_encode_1(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
OPJ_INT32 i;
|
||||
|
||||
if (!cas) {
|
||||
@ -298,7 +304,7 @@ void opj_dwt_encode_1(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
/* <summary> */
|
||||
/* Inverse 5-3 wavelet transform in 1-D. */
|
||||
/* </summary> */
|
||||
void opj_dwt_decode_1_(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
static void opj_dwt_decode_1_(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
OPJ_INT32 i;
|
||||
|
||||
if (!cas) {
|
||||
@ -319,14 +325,14 @@ void opj_dwt_decode_1_(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas)
|
||||
/* <summary> */
|
||||
/* Inverse 5-3 wavelet transform in 1-D. */
|
||||
/* </summary> */
|
||||
void opj_dwt_decode_1(opj_dwt_t *v) {
|
||||
static void opj_dwt_decode_1(opj_dwt_t *v) {
|
||||
opj_dwt_decode_1_(v->mem, v->dn, v->sn, v->cas);
|
||||
}
|
||||
|
||||
/* <summary> */
|
||||
/* Forward 9-7 wavelet transform in 1-D. */
|
||||
/* </summary> */
|
||||
void opj_dwt_encode_1_real(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
static void opj_dwt_encode_1_real(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {
|
||||
OPJ_INT32 i;
|
||||
if (!cas) {
|
||||
if ((dn > 0) || (sn > 1)) { /* NEW : CASE ONE ELEMENT */
|
||||
@ -361,7 +367,7 @@ void opj_dwt_encode_1_real(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 c
|
||||
}
|
||||
}
|
||||
|
||||
void opj_dwt_encode_stepsize(OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_stepsize_t *bandno_stepsize) {
|
||||
static void opj_dwt_encode_stepsize(OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_stepsize_t *bandno_stepsize) {
|
||||
OPJ_INT32 p, n;
|
||||
p = opj_int_floorlog2(stepsize) - 13;
|
||||
n = 11 - opj_int_floorlog2(stepsize);
|
||||
@ -379,7 +385,7 @@ void opj_dwt_encode_stepsize(OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_stepsize_
|
||||
/* <summary> */
|
||||
/* Forward 5-3 wavelet transform in 2-D. */
|
||||
/* </summary> */
|
||||
INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void (*p_function)(OPJ_INT32 *, OPJ_INT32,OPJ_INT32,OPJ_INT32) )
|
||||
static INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void (*p_function)(OPJ_INT32 *, OPJ_INT32,OPJ_INT32,OPJ_INT32) )
|
||||
{
|
||||
OPJ_INT32 i, j, k;
|
||||
OPJ_INT32 *a = 00;
|
||||
@ -389,7 +395,7 @@ INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void (*p_fun
|
||||
|
||||
OPJ_INT32 rw; /* width of the resolution level computed */
|
||||
OPJ_INT32 rh; /* height of the resolution level computed */
|
||||
OPJ_UINT32 l_data_size;
|
||||
size_t l_data_size;
|
||||
|
||||
opj_tcd_resolution_t * l_cur_res = 0;
|
||||
opj_tcd_resolution_t * l_last_res = 0;
|
||||
@ -401,9 +407,17 @@ INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void (*p_fun
|
||||
l_cur_res = tilec->resolutions + l;
|
||||
l_last_res = l_cur_res - 1;
|
||||
|
||||
l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);
|
||||
bj = (OPJ_INT32*)opj_malloc((size_t)l_data_size);
|
||||
if (! bj) {
|
||||
l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions);
|
||||
/* overflow check */
|
||||
if (l_data_size > (SIZE_MAX / sizeof(OPJ_INT32))) {
|
||||
/* FIXME event manager error callback */
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
l_data_size *= sizeof(OPJ_INT32);
|
||||
bj = (OPJ_INT32*)opj_malloc(l_data_size);
|
||||
/* l_data_size is equal to 0 when numresolutions == 1 but bj is not used */
|
||||
/* in that case, so do not error out */
|
||||
if (l_data_size != 0 && ! bj) {
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
i = l;
|
||||
@ -465,8 +479,8 @@ OPJ_BOOL opj_dwt_encode(opj_tcd_tilecomp_t * tilec)
|
||||
/* <summary> */
|
||||
/* Inverse 5-3 wavelet transform in 2-D. */
|
||||
/* </summary> */
|
||||
OPJ_BOOL opj_dwt_decode(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres) {
|
||||
return opj_dwt_decode_tile(tilec, numres, &opj_dwt_decode_1);
|
||||
OPJ_BOOL opj_dwt_decode(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres) {
|
||||
return opj_dwt_decode_tile(tp, tilec, numres, &opj_dwt_decode_1);
|
||||
}
|
||||
|
||||
|
||||
@ -535,7 +549,7 @@ void opj_dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, OPJ_UINT32 prec) {
|
||||
/* <summary> */
|
||||
/* Determine maximum computed resolution level for inverse wavelet transform */
|
||||
/* </summary> */
|
||||
OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i) {
|
||||
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* OPJ_RESTRICT r, OPJ_UINT32 i) {
|
||||
OPJ_UINT32 mr = 0;
|
||||
OPJ_UINT32 w;
|
||||
while( --i ) {
|
||||
@ -548,10 +562,73 @@ OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i
|
||||
return mr ;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
opj_dwt_t h;
|
||||
DWT1DFN dwt_1D;
|
||||
OPJ_UINT32 rw;
|
||||
OPJ_UINT32 w;
|
||||
OPJ_INT32 * OPJ_RESTRICT tiledp;
|
||||
OPJ_UINT32 min_j;
|
||||
OPJ_UINT32 max_j;
|
||||
} opj_dwd_decode_h_job_t;
|
||||
|
||||
static void opj_dwt_decode_h_func(void* user_data, opj_tls_t* tls)
|
||||
{
|
||||
OPJ_UINT32 j;
|
||||
opj_dwd_decode_h_job_t* job;
|
||||
(void)tls;
|
||||
|
||||
job = (opj_dwd_decode_h_job_t*)user_data;
|
||||
for( j = job->min_j; j < job->max_j; j++ )
|
||||
{
|
||||
opj_dwt_interleave_h(&job->h, &job->tiledp[j*job->w]);
|
||||
(job->dwt_1D)(&job->h);
|
||||
memcpy(&job->tiledp[j*job->w], job->h.mem, job->rw * sizeof(OPJ_INT32));
|
||||
}
|
||||
|
||||
opj_aligned_free(job->h.mem);
|
||||
opj_free(job);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
opj_dwt_t v;
|
||||
DWT1DFN dwt_1D;
|
||||
OPJ_UINT32 rh;
|
||||
OPJ_UINT32 w;
|
||||
OPJ_INT32 * OPJ_RESTRICT tiledp;
|
||||
OPJ_UINT32 min_j;
|
||||
OPJ_UINT32 max_j;
|
||||
} opj_dwd_decode_v_job_t;
|
||||
|
||||
static void opj_dwt_decode_v_func(void* user_data, opj_tls_t* tls)
|
||||
{
|
||||
OPJ_UINT32 j;
|
||||
opj_dwd_decode_v_job_t* job;
|
||||
(void)tls;
|
||||
|
||||
job = (opj_dwd_decode_v_job_t*)user_data;
|
||||
for( j = job->min_j; j < job->max_j; j++ )
|
||||
{
|
||||
OPJ_UINT32 k;
|
||||
opj_dwt_interleave_v(&job->v, &job->tiledp[j], (OPJ_INT32)job->w);
|
||||
(job->dwt_1D)(&job->v);
|
||||
for(k = 0; k < job->rh; ++k) {
|
||||
job->tiledp[k * job->w + j] = job->v.mem[k];
|
||||
}
|
||||
}
|
||||
|
||||
opj_aligned_free(job->v.mem);
|
||||
opj_free(job);
|
||||
}
|
||||
|
||||
|
||||
/* <summary> */
|
||||
/* Inverse wavelet transform in 2-D. */
|
||||
/* Inverse wavelet transform in 2-D. */
|
||||
/* </summary> */
|
||||
OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres, DWT1DFN dwt_1D) {
|
||||
static OPJ_BOOL opj_dwt_decode_tile(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres, DWT1DFN dwt_1D)
|
||||
{
|
||||
opj_dwt_t h;
|
||||
opj_dwt_t v;
|
||||
|
||||
@ -561,17 +638,30 @@ OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres, DWT1D
|
||||
OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 - tr->y0); /* height of the resolution level computed */
|
||||
|
||||
OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);
|
||||
size_t h_mem_size;
|
||||
int num_threads;
|
||||
|
||||
h.mem = (OPJ_INT32*)
|
||||
opj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32));
|
||||
if (numres == 1U) {
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
num_threads = opj_thread_pool_get_thread_count(tp);
|
||||
h_mem_size = opj_dwt_max_resolution(tr, numres);
|
||||
/* overflow check */
|
||||
if (h_mem_size > (SIZE_MAX / sizeof(OPJ_INT32))) {
|
||||
/* FIXME event manager error callback */
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
h_mem_size *= sizeof(OPJ_INT32);
|
||||
h.mem = (OPJ_INT32*)opj_aligned_malloc(h_mem_size);
|
||||
if (! h.mem){
|
||||
/* FIXME event manager error callback */
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
|
||||
v.mem = h.mem;
|
||||
|
||||
while( --numres) {
|
||||
OPJ_INT32 * restrict tiledp = tilec->data;
|
||||
OPJ_INT32 * OPJ_RESTRICT tiledp = tilec->data;
|
||||
OPJ_UINT32 j;
|
||||
|
||||
++tr;
|
||||
@ -584,30 +674,134 @@ OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres, DWT1D
|
||||
h.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);
|
||||
h.cas = tr->x0 % 2;
|
||||
|
||||
for(j = 0; j < rh; ++j) {
|
||||
opj_dwt_interleave_h(&h, &tiledp[j*w]);
|
||||
(dwt_1D)(&h);
|
||||
memcpy(&tiledp[j*w], h.mem, rw * sizeof(OPJ_INT32));
|
||||
if( num_threads <= 1 || rh <= 1 )
|
||||
{
|
||||
for(j = 0; j < rh; ++j) {
|
||||
opj_dwt_interleave_h(&h, &tiledp[j*w]);
|
||||
(dwt_1D)(&h);
|
||||
memcpy(&tiledp[j*w], h.mem, rw * sizeof(OPJ_INT32));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OPJ_UINT32 num_jobs = (OPJ_UINT32)num_threads;
|
||||
OPJ_UINT32 step_j;
|
||||
|
||||
if( rh < num_jobs ) {
|
||||
num_jobs = rh;
|
||||
}
|
||||
step_j = (rh / num_jobs);
|
||||
|
||||
for(j = 0; j < num_jobs; j++)
|
||||
{
|
||||
opj_dwd_decode_h_job_t* job;
|
||||
|
||||
job = (opj_dwd_decode_h_job_t*) opj_malloc(sizeof(opj_dwd_decode_h_job_t));
|
||||
if( !job )
|
||||
{
|
||||
/* It would be nice to fallback to single thread case, but */
|
||||
/* unfortunately some jobs may be launched and have modified */
|
||||
/* tiledp, so it is not practical to recover from that error */
|
||||
/* FIXME event manager error callback */
|
||||
opj_thread_pool_wait_completion(tp, 0);
|
||||
opj_aligned_free(h.mem);
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
job->h = h;
|
||||
job->dwt_1D = dwt_1D;
|
||||
job->rw = rw;
|
||||
job->w = w;
|
||||
job->tiledp = tiledp;
|
||||
job->min_j = j * step_j;
|
||||
job->max_j = (j + 1U) * step_j; /* this can overflow */
|
||||
if( j == (num_jobs - 1U) ) { /* this will take care of the overflow */
|
||||
job->max_j = rh;
|
||||
}
|
||||
job->h.mem = (OPJ_INT32*)opj_aligned_malloc(h_mem_size);
|
||||
if (!job->h.mem)
|
||||
{
|
||||
/* FIXME event manager error callback */
|
||||
opj_thread_pool_wait_completion(tp, 0);
|
||||
opj_free(job);
|
||||
opj_aligned_free(h.mem);
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
opj_thread_pool_submit_job( tp, opj_dwt_decode_h_func, job );
|
||||
}
|
||||
opj_thread_pool_wait_completion(tp, 0);
|
||||
}
|
||||
|
||||
v.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);
|
||||
v.cas = tr->y0 % 2;
|
||||
|
||||
for(j = 0; j < rw; ++j){
|
||||
OPJ_UINT32 k;
|
||||
opj_dwt_interleave_v(&v, &tiledp[j], (OPJ_INT32)w);
|
||||
(dwt_1D)(&v);
|
||||
for(k = 0; k < rh; ++k) {
|
||||
tiledp[k * w + j] = v.mem[k];
|
||||
if( num_threads <= 1 || rw <= 1 )
|
||||
{
|
||||
for(j = 0; j < rw; ++j){
|
||||
OPJ_UINT32 k;
|
||||
|
||||
opj_dwt_interleave_v(&v, &tiledp[j], (OPJ_INT32)w);
|
||||
(dwt_1D)(&v);
|
||||
for(k = 0; k < rh; ++k) {
|
||||
tiledp[k * w + j] = v.mem[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OPJ_UINT32 num_jobs = (OPJ_UINT32)num_threads;
|
||||
OPJ_UINT32 step_j;
|
||||
|
||||
if( rw < num_jobs ) {
|
||||
num_jobs = rw;
|
||||
}
|
||||
step_j = (rw / num_jobs);
|
||||
|
||||
for( j = 0; j < num_jobs; j++ )
|
||||
{
|
||||
opj_dwd_decode_v_job_t* job;
|
||||
|
||||
job = (opj_dwd_decode_v_job_t*) opj_malloc(sizeof(opj_dwd_decode_v_job_t));
|
||||
if( !job )
|
||||
{
|
||||
/* It would be nice to fallback to single thread case, but */
|
||||
/* unfortunately some jobs may be launched and have modified */
|
||||
/* tiledp, so it is not practical to recover from that error */
|
||||
/* FIXME event manager error callback */
|
||||
opj_thread_pool_wait_completion(tp, 0);
|
||||
opj_aligned_free(v.mem);
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
job->v = v;
|
||||
job->dwt_1D = dwt_1D;
|
||||
job->rh = rh;
|
||||
job->w = w;
|
||||
job->tiledp = tiledp;
|
||||
job->min_j = j * step_j;
|
||||
job->max_j = (j + 1U) * step_j; /* this can overflow */
|
||||
if( j == (num_jobs - 1U) ) { /* this will take care of the overflow */
|
||||
job->max_j = rw;
|
||||
}
|
||||
job->v.mem = (OPJ_INT32*)opj_aligned_malloc(h_mem_size);
|
||||
if (!job->v.mem)
|
||||
{
|
||||
/* FIXME event manager error callback */
|
||||
opj_thread_pool_wait_completion(tp, 0);
|
||||
opj_free(job);
|
||||
opj_aligned_free(v.mem);
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
opj_thread_pool_submit_job( tp, opj_dwt_decode_v_func, job );
|
||||
}
|
||||
opj_thread_pool_wait_completion(tp, 0);
|
||||
}
|
||||
}
|
||||
opj_aligned_free(h.mem);
|
||||
return OPJ_TRUE;
|
||||
}
|
||||
|
||||
void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OPJ_INT32 x, OPJ_INT32 size){
|
||||
OPJ_FLOAT32* restrict bi = (OPJ_FLOAT32*) (w->wavelet + w->cas);
|
||||
static void opj_v4dwt_interleave_h(opj_v4dwt_t* OPJ_RESTRICT w, OPJ_FLOAT32* OPJ_RESTRICT a, OPJ_INT32 x, OPJ_INT32 size)
|
||||
{
|
||||
OPJ_FLOAT32* OPJ_RESTRICT bi = (OPJ_FLOAT32*) (w->wavelet + w->cas);
|
||||
OPJ_INT32 count = w->sn;
|
||||
OPJ_INT32 i, k;
|
||||
|
||||
@ -649,8 +843,8 @@ void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OP
|
||||
}
|
||||
}
|
||||
|
||||
void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read){
|
||||
opj_v4_t* restrict bi = v->wavelet + v->cas;
|
||||
static void opj_v4dwt_interleave_v(opj_v4dwt_t* OPJ_RESTRICT v , OPJ_FLOAT32* OPJ_RESTRICT a , OPJ_INT32 x, OPJ_INT32 nb_elts_read){
|
||||
opj_v4_t* OPJ_RESTRICT bi = v->wavelet + v->cas;
|
||||
OPJ_INT32 i;
|
||||
|
||||
for(i = 0; i < v->sn; ++i){
|
||||
@ -667,8 +861,8 @@ void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a ,
|
||||
|
||||
#ifdef __SSE__
|
||||
|
||||
void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c){
|
||||
__m128* restrict vw = (__m128*) w;
|
||||
static void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c){
|
||||
__m128* OPJ_RESTRICT vw = (__m128*) w;
|
||||
OPJ_INT32 i;
|
||||
/* 4x unrolled loop */
|
||||
for(i = 0; i < count >> 2; ++i){
|
||||
@ -689,8 +883,8 @@ void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c){
|
||||
}
|
||||
|
||||
void opj_v4dwt_decode_step2_sse(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, __m128 c){
|
||||
__m128* restrict vl = (__m128*) l;
|
||||
__m128* restrict vw = (__m128*) w;
|
||||
__m128* OPJ_RESTRICT vl = (__m128*) l;
|
||||
__m128* OPJ_RESTRICT vw = (__m128*) w;
|
||||
OPJ_INT32 i;
|
||||
__m128 tmp1, tmp2, tmp3;
|
||||
tmp1 = vl[0];
|
||||
@ -716,9 +910,9 @@ void opj_v4dwt_decode_step2_sse(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32
|
||||
|
||||
#else
|
||||
|
||||
void opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT32 c)
|
||||
static void opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT32 c)
|
||||
{
|
||||
OPJ_FLOAT32* restrict fw = (OPJ_FLOAT32*) w;
|
||||
OPJ_FLOAT32* OPJ_RESTRICT fw = (OPJ_FLOAT32*) w;
|
||||
OPJ_INT32 i;
|
||||
for(i = 0; i < count; ++i){
|
||||
OPJ_FLOAT32 tmp1 = fw[i*8 ];
|
||||
@ -732,10 +926,10 @@ void opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT32 c)
|
||||
}
|
||||
}
|
||||
|
||||
void opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, OPJ_FLOAT32 c)
|
||||
static void opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, OPJ_FLOAT32 c)
|
||||
{
|
||||
OPJ_FLOAT32* restrict fl = (OPJ_FLOAT32*) l;
|
||||
OPJ_FLOAT32* restrict fw = (OPJ_FLOAT32*) w;
|
||||
OPJ_FLOAT32* fl = (OPJ_FLOAT32*) l;
|
||||
OPJ_FLOAT32* fw = (OPJ_FLOAT32*) w;
|
||||
OPJ_INT32 i;
|
||||
for(i = 0; i < m; ++i){
|
||||
OPJ_FLOAT32 tmp1_1 = fl[0];
|
||||
@ -786,7 +980,7 @@ void opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m,
|
||||
/* <summary> */
|
||||
/* Inverse 9-7 wavelet transform in 1-D. */
|
||||
/* </summary> */
|
||||
void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt)
|
||||
static void opj_v4dwt_decode(opj_v4dwt_t* OPJ_RESTRICT dwt)
|
||||
{
|
||||
OPJ_INT32 a, b;
|
||||
if(dwt->cas == 0) {
|
||||
@ -823,7 +1017,7 @@ void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt)
|
||||
/* <summary> */
|
||||
/* Inverse 9-7 wavelet transform in 2-D. */
|
||||
/* </summary> */
|
||||
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numres)
|
||||
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, OPJ_UINT32 numres)
|
||||
{
|
||||
opj_v4dwt_t h;
|
||||
opj_v4dwt_t v;
|
||||
@ -835,11 +1029,29 @@ OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numr
|
||||
|
||||
OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);
|
||||
|
||||
h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res, numres)+5) * sizeof(opj_v4_t));
|
||||
size_t l_data_size;
|
||||
|
||||
l_data_size = opj_dwt_max_resolution(res, numres);
|
||||
/* overflow check */
|
||||
if (l_data_size > (SIZE_MAX - 5U)) {
|
||||
/* FIXME event manager error callback */
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
l_data_size += 5U;
|
||||
/* overflow check */
|
||||
if (l_data_size > (SIZE_MAX / sizeof(opj_v4_t))) {
|
||||
/* FIXME event manager error callback */
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
h.wavelet = (opj_v4_t*) opj_aligned_malloc(l_data_size * sizeof(opj_v4_t));
|
||||
if (!h.wavelet) {
|
||||
/* FIXME event manager error callback */
|
||||
return OPJ_FALSE;
|
||||
}
|
||||
v.wavelet = h.wavelet;
|
||||
|
||||
while( --numres) {
|
||||
OPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data;
|
||||
OPJ_FLOAT32 * OPJ_RESTRICT aj = (OPJ_FLOAT32*) tilec->data;
|
||||
OPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0));
|
||||
OPJ_INT32 j;
|
||||
|
||||
|
@ -1,9 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||
* Copyright (c) 2003-2014, Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -48,19 +54,20 @@ DWT.C are used by some function in TCD.C.
|
||||
/*@{*/
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/**
|
||||
Forward 5-3 wavelet tranform in 2-D.
|
||||
Forward 5-3 wavelet transform in 2-D.
|
||||
Apply a reversible DWT transform to a component of an image.
|
||||
@param tilec Tile component information (current tile)
|
||||
*/
|
||||
OPJ_BOOL opj_dwt_encode(opj_tcd_tilecomp_t * tilec);
|
||||
|
||||
/**
|
||||
Inverse 5-3 wavelet tranform in 2-D.
|
||||
Inverse 5-3 wavelet transform in 2-D.
|
||||
Apply a reversible inverse DWT transform to a component of an image.
|
||||
@param tp Thread pool
|
||||
@param tilec Tile component information (current tile)
|
||||
@param numres Number of resolution levels to decode
|
||||
*/
|
||||
OPJ_BOOL opj_dwt_decode(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres);
|
||||
OPJ_BOOL opj_dwt_decode(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres);
|
||||
|
||||
/**
|
||||
Get the gain of a subband for the reversible 5-3 DWT.
|
||||
@ -87,7 +94,7 @@ Apply an irreversible inverse DWT transform to a component of an image.
|
||||
@param tilec Tile component information (current tile)
|
||||
@param numres Number of resolution levels to decode
|
||||
*/
|
||||
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numres);
|
||||
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, OPJ_UINT32 numres);
|
||||
|
||||
/**
|
||||
Get the gain of a subband for the irreversible 9-7 DWT.
|
||||
|
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses
|
||||
* BSD License, included below. This software may be subject to other third
|
||||
* party and contributor rights, including patent rights, and no such rights
|
||||
* are granted under this license.
|
||||
*
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
|
||||
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
|
||||
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||
* All rights reserved.
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user