Compare commits
1581 Commits
openjpeg-1
...
coverity_s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6dd524822 | ||
|
|
b21a8317e5 | ||
|
|
5fb81d986e | ||
|
|
ef01f18dfc | ||
|
|
e078172b1c | ||
|
|
acfb307df4 | ||
|
|
275aad4df8 | ||
|
|
734d57d5f7 | ||
|
|
c16bc057ba | ||
|
|
ea320dab8b | ||
|
|
d7e6b7de8a | ||
|
|
ccd9ced49e | ||
|
|
9f24b078c7 | ||
|
|
51155950eb | ||
|
|
23cee22286 | ||
|
|
4a2a8693e5 | ||
|
|
1509ccc51f | ||
|
|
5bb919a30e | ||
|
|
b8bd1b0e07 | ||
|
|
e40c28c2e8 | ||
|
|
18da6155b2 | ||
|
|
b3c422654f | ||
|
|
9db62b2011 | ||
|
|
7948d83340 | ||
|
|
132c4a248b | ||
|
|
ed294598ea | ||
|
|
fef144283f | ||
|
|
4c5a1cc825 | ||
|
|
bd96ed8353 | ||
|
|
f4a708ba0f | ||
|
|
2372cb78a0 | ||
|
|
9d5002f8fd | ||
|
|
e4c74f5364 | ||
|
|
cb72c08472 | ||
|
|
898ca6f522 | ||
|
|
86698be6e9 | ||
|
|
cdcb77e796 | ||
|
|
954dad66de | ||
|
|
48744a1342 | ||
|
|
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 | ||
|
|
666f71b2a1 | ||
|
|
2b7d5b18f3 | ||
|
|
18d5d25cb6 | ||
|
|
492d8ab7d9 | ||
|
|
2b93727bea | ||
|
|
18c5be69e9 | ||
|
|
5a70e97f51 | ||
|
|
f4707da97a | ||
|
|
51ab074d50 | ||
|
|
6d9e8a5a63 | ||
|
|
008de86533 | ||
|
|
ae49fd1aa9 | ||
|
|
79d18f7fd0 | ||
|
|
99d1859a44 | ||
|
|
866cd28ad4 | ||
|
|
71a9f498b5 | ||
|
|
b607da8ae9 | ||
|
|
a43d206b93 | ||
|
|
15863e7170 | ||
|
|
5e91877636 | ||
|
|
7e1d012161 | ||
|
|
de74605777 | ||
|
|
e8abf1fb25 | ||
|
|
b7fe7d25e1 | ||
|
|
138a65d6c1 | ||
|
|
9d0bdf69e5 | ||
|
|
9194dfb94b | ||
|
|
b7ebf54a29 | ||
|
|
3a80b72ac8 | ||
|
|
3e33012bd9 | ||
|
|
fd3f7ca2bb | ||
|
|
6e22c4f68a | ||
|
|
565ef29ae3 | ||
|
|
68398b2a5a | ||
|
|
5624e4a25f | ||
|
|
92e07f3b74 | ||
|
|
8447f0a323 | ||
|
|
f0a2fdd508 | ||
|
|
320784659d | ||
|
|
51ab8cd67d | ||
|
|
237253d83b | ||
|
|
fe100fb490 | ||
|
|
c7b646e23a | ||
|
|
41add6882b | ||
|
|
dd0d2c2f0a | ||
|
|
d38e32c036 | ||
|
|
73315c2edc | ||
|
|
6b51d11d08 | ||
|
|
59270c39a7 | ||
|
|
db82cf7778 | ||
|
|
ddb1d57766 | ||
|
|
5dd770746b | ||
|
|
fa436eb368 | ||
|
|
fcc658f106 | ||
|
|
2e7b8fb9a1 | ||
|
|
1778e2576e | ||
|
|
73c9e85642 | ||
|
|
76557d2eb3 | ||
|
|
9095c7361e | ||
|
|
c02c1432e8 | ||
|
|
8411ed4f80 | ||
|
|
4de95f320f | ||
|
|
aea18173d1 | ||
|
|
856fc0652f | ||
|
|
b01c1240cf | ||
|
|
836ec05920 | ||
|
|
9a52b30c3d | ||
|
|
76af73bc72 | ||
|
|
f7bc0b49cb | ||
|
|
9155e98911 | ||
|
|
7aee50de97 | ||
|
|
24966ffbda | ||
|
|
666ef53fd2 | ||
|
|
e02ba05034 | ||
|
|
b478912910 | ||
|
|
2001932c56 | ||
|
|
f54de95802 | ||
|
|
fa1c2454e6 | ||
|
|
6b94237679 | ||
|
|
aedff8a000 | ||
|
|
a0aa8dd851 | ||
|
|
440ef4873b | ||
|
|
ffad2fbe55 | ||
|
|
cc1354ebfa | ||
|
|
581d2ba8b4 | ||
|
|
61348b20b4 | ||
|
|
e619e06078 | ||
|
|
4f84d1693a | ||
|
|
71d244a5b6 | ||
|
|
f9a0f869e3 | ||
|
|
33c472d734 | ||
|
|
a8eb122c1f | ||
|
|
956b1a7697 | ||
|
|
472ce19183 | ||
|
|
740924fa61 | ||
|
|
01b4bb5447 | ||
|
|
ee3b02932a | ||
|
|
2a07d3d26b | ||
|
|
e238148d42 | ||
|
|
9d21695476 | ||
|
|
22d11a9ccb | ||
|
|
fc9248ea2b | ||
|
|
c302979738 | ||
|
|
e4d077bc98 | ||
|
|
76cd9b7f72 | ||
|
|
e71431ec78 | ||
|
|
7b335eb635 | ||
|
|
c0c086388b | ||
|
|
048c8302fe | ||
|
|
a7b051b172 | ||
|
|
5f7ad58f48 | ||
|
|
016b9fc052 | ||
|
|
99b40e8257 | ||
|
|
a734e447b5 | ||
|
|
37128c34a9 | ||
|
|
f5630ab88e | ||
|
|
6790587db8 | ||
|
|
445f696dc6 | ||
|
|
dd5c3a9c8e | ||
|
|
0f45e38b52 | ||
|
|
93bc3cb628 | ||
|
|
79faedfb9b | ||
|
|
17d9caae83 | ||
|
|
eea18e856e | ||
|
|
7e64eb5414 | ||
|
|
8a959bb1f4 | ||
|
|
8d3ef0729c | ||
|
|
275680bdb7 | ||
|
|
4d5d1f0f66 | ||
|
|
1ef677f264 | ||
|
|
07193e2a34 | ||
|
|
f7da94610d | ||
|
|
872368d25c | ||
|
|
36320b4bf4 | ||
|
|
7185faa857 | ||
|
|
0c80fcff2a | ||
|
|
51caff5dcf | ||
|
|
d643ff5dbc | ||
|
|
44ca89eff7 | ||
|
|
7afad19c77 | ||
|
|
765c4ab4f4 | ||
|
|
24eca792ff | ||
|
|
b1b17ee264 | ||
|
|
74600cfb14 | ||
|
|
171ec1583d | ||
|
|
80c5106015 | ||
|
|
e92fe4c1a4 | ||
|
|
11f402b44a | ||
|
|
18049fe3e0 | ||
|
|
b330c10492 | ||
|
|
25255c4ed1 | ||
|
|
16febebd28 | ||
|
|
339952c2af | ||
|
|
75715635e8 | ||
|
|
9863d8d1d2 | ||
|
|
3ecccb7410 | ||
|
|
3c7a7a1675 | ||
|
|
d14c475de7 | ||
|
|
a68a3feb60 | ||
|
|
43382a9b9c | ||
|
|
a149502c01 | ||
|
|
decace60da | ||
|
|
2c876b6765 | ||
|
|
6d0785a78f | ||
|
|
ec593a2549 | ||
|
|
978de6fb97 | ||
|
|
c53e2960a0 | ||
|
|
cf91ebf278 | ||
|
|
fd5f21af00 | ||
|
|
1b93cb8c0a | ||
|
|
a9e6268766 | ||
|
|
fc855084a0 | ||
|
|
b7bccf86c3 | ||
|
|
6ee2a51edc | ||
|
|
d2dc1597fe | ||
|
|
82647e79c7 | ||
|
|
ecbebe2847 | ||
|
|
816db977fd | ||
|
|
cbe77e2412 | ||
|
|
1eb67ca49d | ||
|
|
7a89d731f7 | ||
|
|
65503dad73 | ||
|
|
a347262468 | ||
|
|
6a6fa7027a | ||
|
|
86cdc91180 | ||
|
|
094465a710 | ||
|
|
6ae56f302e | ||
|
|
ad895fadb1 | ||
|
|
7c120281c7 | ||
|
|
8a4095b405 | ||
|
|
a7cc5b6a5d | ||
|
|
ac1dfd4662 | ||
|
|
abf2f7f05e | ||
|
|
1c209d711e | ||
|
|
91f521ef92 | ||
|
|
9ac3ae1270 | ||
|
|
d74579aa38 | ||
|
|
6deb1a83b5 | ||
|
|
6f3a7ef3c8 | ||
|
|
9f3687f917 | ||
|
|
5e77c4e936 | ||
|
|
97c376e06d | ||
|
|
8f4d674442 | ||
|
|
7f277fea94 | ||
|
|
52440cc2e6 | ||
|
|
3fe9243e1c | ||
|
|
05dae25a22 | ||
|
|
23ea270881 | ||
|
|
7247543da3 | ||
|
|
37a8d2acc1 | ||
|
|
4a7ba87d99 | ||
|
|
51e3764519 | ||
|
|
533d92aa8e | ||
|
|
19887b7b8c | ||
|
|
005e75bdc3 | ||
|
|
5f3470fcd0 | ||
|
|
adb237cfa8 | ||
|
|
29a29d6210 | ||
|
|
3a155ceda6 | ||
|
|
7195a23a9d | ||
|
|
0ae6ff8018 | ||
|
|
241769dc2f | ||
|
|
4a39ee9bbc | ||
|
|
1dedf7f0cd | ||
|
|
70ede09310 | ||
|
|
3da30304fc | ||
|
|
820c04c679 | ||
|
|
9d848e3f5e | ||
|
|
d5f71c2e1d | ||
|
|
36a7d23273 | ||
|
|
c4317177f3 | ||
|
|
e231a84b2f | ||
|
|
b56fb96b1b | ||
|
|
163c7e3460 | ||
|
|
4c1023dac6 | ||
|
|
563d238fa0 | ||
|
|
9021776963 | ||
|
|
18771f1b6a | ||
|
|
ed2af11102 | ||
|
|
7dd65e84e6 | ||
|
|
e260ec6e9d | ||
|
|
7ce3f3c1a6 | ||
|
|
a466755bbb | ||
|
|
901c9d8ae0 | ||
|
|
6145c82804 | ||
|
|
876c02206d | ||
|
|
3ca312033f | ||
|
|
1378475573 | ||
|
|
00b049866b | ||
|
|
d847e477f0 | ||
|
|
c55e164e87 | ||
|
|
531cd5dd14 | ||
|
|
ff0a9f763e | ||
|
|
228e0a3d79 | ||
|
|
f38e29d00a | ||
|
|
963283d7d0 | ||
|
|
c91044a4a7 | ||
|
|
f42c26adbd | ||
|
|
9efad43509 | ||
|
|
33d8f08964 | ||
|
|
e826e9281e | ||
|
|
780120c9a2 | ||
|
|
d6c0c85125 | ||
|
|
c81fb397bb | ||
|
|
caf4e46e06 | ||
|
|
ff1a30d80a | ||
|
|
d143f49a66 | ||
|
|
58698b789a | ||
|
|
ee3f2ffa19 | ||
|
|
c59124dfe2 | ||
|
|
7b14cf8558 | ||
|
|
05f796d2fa | ||
|
|
bd8c91b37d | ||
|
|
7294cdef3e | ||
|
|
4d7b6374c8 | ||
|
|
5855da5a15 | ||
|
|
34fd493512 | ||
|
|
da4bd9b110 | ||
|
|
7fbf6df09e | ||
|
|
68415d040f | ||
|
|
8ee74f6bff | ||
|
|
bf0fa4089f | ||
|
|
07ae149955 | ||
|
|
ecb93d97a5 | ||
|
|
f769d5e27f | ||
|
|
1e414c8f37 | ||
|
|
07e6994be1 | ||
|
|
0abf4f8fbb | ||
|
|
a13e4a77e0 | ||
|
|
6de2271e2a | ||
|
|
021e255282 | ||
|
|
92b1e038c1 | ||
|
|
a8c33ae219 | ||
|
|
e7bc30b409 | ||
|
|
efaefa21fc | ||
|
|
42bd417acf | ||
|
|
af58e8e8f9 | ||
|
|
4bf4a7668e | ||
|
|
c03ca9c73c | ||
|
|
d5884afcf3 | ||
|
|
a2aeafe85b | ||
|
|
0109b39f58 | ||
|
|
752e978d56 | ||
|
|
8b36a11f2b | ||
|
|
ccd448d626 | ||
|
|
44fb38949b | ||
|
|
ad1532ed57 | ||
|
|
caaec3bb05 | ||
|
|
df47fae287 | ||
|
|
b65bf48369 | ||
|
|
4c02acb728 | ||
|
|
8c9151c86b | ||
|
|
c075742bc8 | ||
|
|
b42cf317d6 | ||
|
|
f5429e4ce8 | ||
|
|
82dad8e629 | ||
|
|
59aa37fe2b | ||
|
|
0adb43f06e | ||
|
|
87e09a09da | ||
|
|
ba630816bc | ||
|
|
863fdafcd5 | ||
|
|
be5e6941bf | ||
|
|
7980115412 | ||
|
|
cab86a0deb | ||
|
|
be3a1da14a | ||
|
|
650c587875 | ||
|
|
d29c5760bd | ||
|
|
ee9d777d69 | ||
|
|
59582bafa3 | ||
|
|
1ad85ac9ee | ||
|
|
999a84c77a | ||
|
|
48e0d167aa | ||
|
|
f14da66ce5 | ||
|
|
14ab311d2f | ||
|
|
02ab4363b6 | ||
|
|
e1f7c73324 | ||
|
|
3042fc2a29 | ||
|
|
a622c1c2fe | ||
|
|
b3e467dcba | ||
|
|
c0259255b0 | ||
|
|
9398bc1764 | ||
|
|
fcf9fa3651 | ||
|
|
583df79be9 | ||
|
|
0e0b892493 | ||
|
|
78a8d64a92 | ||
|
|
5433e4dab8 | ||
|
|
c3c59b010b | ||
|
|
8eb481b6c6 | ||
|
|
d5efeb7df5 | ||
|
|
f663042893 | ||
|
|
f07c1a11a0 | ||
|
|
ce297bfa9e | ||
|
|
ba1682c120 | ||
|
|
e212154d8d | ||
|
|
ec0fe09138 | ||
|
|
8562ed3018 | ||
|
|
21b0ccf859 | ||
|
|
84c93c2fea | ||
|
|
e3c2305ff4 | ||
|
|
0e3c467a5b | ||
|
|
94880d8f36 | ||
|
|
7307bb6e9a | ||
|
|
4263410fe8 | ||
|
|
cb0eb855ca | ||
|
|
569d0ec7cc | ||
|
|
1021e87522 | ||
|
|
dc34cf362f | ||
|
|
e71749428c | ||
|
|
8f58b776b0 | ||
|
|
fb0a11636f | ||
|
|
7bf09734d7 | ||
|
|
853bcb3c64 | ||
|
|
4d32395fe1 | ||
|
|
a6a141d326 | ||
|
|
e0161e03db | ||
|
|
82d29d4c2a | ||
|
|
1a5791750b | ||
|
|
482d9b58b3 | ||
|
|
5903dd7d82 | ||
|
|
301b1ffbc7 | ||
|
|
759be64115 | ||
|
|
ece2a2d6c2 | ||
|
|
f31957c502 | ||
|
|
fb69541cfa | ||
|
|
e189679ebc | ||
|
|
18e7fcc37f | ||
|
|
1c8a657044 | ||
|
|
cdea5c8eef | ||
|
|
bcc386e3bb | ||
|
|
a2bd3bb75b | ||
|
|
b63d618e48 | ||
|
|
8864c2d59b | ||
|
|
c75073fbf4 | ||
|
|
cf4529d058 | ||
|
|
9b6900b058 | ||
|
|
7f7ef068fc | ||
|
|
a41790ce8a | ||
|
|
06615a556d | ||
|
|
94a69c2b31 | ||
|
|
425ff2f81d | ||
|
|
2257166e61 | ||
|
|
56cf5f4f67 | ||
|
|
668484ba8f | ||
|
|
f824078c14 | ||
|
|
3250833a62 | ||
|
|
8bc24912d1 | ||
|
|
52f6f7e0c7 | ||
|
|
ee8ee69c30 | ||
|
|
4941ebcc91 | ||
|
|
9adbea785b | ||
|
|
fd19413196 | ||
|
|
6300a8a0a2 | ||
|
|
66c1228c95 | ||
|
|
4585b23552 | ||
|
|
23a624f73a | ||
|
|
f3d7d2f7b1 | ||
|
|
0358983ee6 | ||
|
|
a0977266b4 | ||
|
|
76947f0074 | ||
|
|
f649754018 | ||
|
|
b1c5ce2517 | ||
|
|
f2db5ec4fb | ||
|
|
db08494776 | ||
|
|
9166d595e6 | ||
|
|
f1061c8763 | ||
|
|
fca9803bee | ||
|
|
0d841b5e05 | ||
|
|
216791c3fb | ||
|
|
12c4e68058 | ||
|
|
b4b451863d | ||
|
|
f2808de855 | ||
|
|
9b2897ccd9 | ||
|
|
3c4698435c | ||
|
|
98682e1073 | ||
|
|
d6bcb8b7e0 | ||
|
|
a501237ae3 | ||
|
|
f6622c2fbb | ||
|
|
b08b90d71c | ||
|
|
b46ed8c7a3 | ||
|
|
45869ce843 | ||
|
|
dff377a741 | ||
|
|
b24cf8d157 | ||
|
|
2ad90b7c41 | ||
|
|
a40fc41988 | ||
|
|
3416c6d91b | ||
|
|
54c2bcb60f | ||
|
|
44a5108e1d | ||
|
|
d8715871fa | ||
|
|
772fcc963c | ||
|
|
75b7104724 | ||
|
|
fe3c1f9061 | ||
|
|
e30818ce39 | ||
|
|
2e30886a0d | ||
|
|
b18ffbd08a | ||
|
|
16d2dc662f | ||
|
|
9832c911b3 | ||
|
|
23f5eeec20 | ||
|
|
16106b2978 | ||
|
|
c66e6be4a4 | ||
|
|
eda4c26d24 | ||
|
|
4b140e060b | ||
|
|
1fefa03329 | ||
|
|
37ff9b029c | ||
|
|
e798fe37e1 | ||
|
|
f4a8f7165c | ||
|
|
2d52e409c2 | ||
|
|
1b5e677d0c | ||
|
|
c508923f04 | ||
|
|
6c4024796e | ||
|
|
bd2c6cfa55 | ||
|
|
bd74db932e | ||
|
|
439337fb1b | ||
|
|
5ffe6f5acf | ||
|
|
f281f8cb75 | ||
|
|
3a46e2d86b | ||
|
|
6a84a1788b | ||
|
|
df870e5241 | ||
|
|
82afd3a891 | ||
|
|
514fc72050 | ||
|
|
4dba9aed22 | ||
|
|
a46dbe6941 | ||
|
|
394db7b738 | ||
|
|
3ad58ee1f5 | ||
|
|
00aa77f2d9 | ||
|
|
60fc79c717 | ||
|
|
f501186b18 | ||
|
|
fe6d9ed9ba | ||
|
|
c450d418ef | ||
|
|
c3b1af023b | ||
|
|
bf37be46b8 | ||
|
|
4466c31fc2 | ||
|
|
b2bebcf5ce | ||
|
|
de33ba029b | ||
|
|
465db44499 | ||
|
|
abdb8ee3f7 | ||
|
|
aa6b4b4970 | ||
|
|
25cbfcf34a | ||
|
|
cffc33a51c | ||
|
|
5db7b01fa2 | ||
|
|
1ca5ca8392 | ||
|
|
93761d9ab5 | ||
|
|
bb16d8816c | ||
|
|
e1cd500ac5 | ||
|
|
2d09cbfd21 | ||
|
|
d84b16caf9 | ||
|
|
95f06f0591 | ||
|
|
3bf4d635f2 | ||
|
|
a4fa18e92d | ||
|
|
f71af2a2ef | ||
|
|
3e62f8d9b7 | ||
|
|
028720c9ec | ||
|
|
d518970039 | ||
|
|
8363a6ab1e | ||
|
|
a540dcd2e2 | ||
|
|
58b2c6c4a5 | ||
|
|
34ffde6799 | ||
|
|
e7cd945000 | ||
|
|
ccf0f05e98 | ||
|
|
36672ad50e | ||
|
|
8bee3d89c5 | ||
|
|
cf212e55ac | ||
|
|
a00f61bd5d | ||
|
|
dca76de872 | ||
|
|
70540f9563 | ||
|
|
a545cb7cff | ||
|
|
9a86a3bd23 | ||
|
|
69673635ef | ||
|
|
77e6971bbb | ||
|
|
a9a1336502 | ||
|
|
9103674950 | ||
|
|
2af39ac017 | ||
|
|
d47b8fef18 | ||
|
|
f8fc214b11 | ||
|
|
7861bfa45e | ||
|
|
02734264a1 | ||
|
|
4a845f3d04 | ||
|
|
0452ebdfcd | ||
|
|
c8b8c4cf30 | ||
|
|
1ff1401ff1 | ||
|
|
3991bbe595 | ||
|
|
20beb093a1 | ||
|
|
3135642ff5 | ||
|
|
d5bb3b0039 | ||
|
|
f16216e270 | ||
|
|
de9e1a0693 | ||
|
|
47b18d89f6 | ||
|
|
3f5b474b16 | ||
|
|
b103fec939 | ||
|
|
728be68bfe | ||
|
|
5820e97abe | ||
|
|
4e81ea2a8a | ||
|
|
7bfdb31c77 | ||
|
|
44cec04294 | ||
|
|
c60a84b6f5 | ||
|
|
3b953cc763 | ||
|
|
859ce39666 | ||
|
|
7c6ea4ed00 | ||
|
|
3dab3be859 | ||
|
|
062ed99894 | ||
|
|
d275fc90cf | ||
|
|
dbc4c47b15 | ||
|
|
e6d97ce928 | ||
|
|
b7473285ec | ||
|
|
8b7107b81f | ||
|
|
d1251b2850 | ||
|
|
e972589554 | ||
|
|
0f19c958da | ||
|
|
2935fbc089 | ||
|
|
f47fc4f111 | ||
|
|
01c95cb07e | ||
|
|
1f94541732 | ||
|
|
ff43b4dca0 | ||
|
|
5d494e940f | ||
|
|
30de580afe | ||
|
|
0c13350ea4 | ||
|
|
83a661c360 | ||
|
|
38ec1325c4 | ||
|
|
2ca2e83ce5 | ||
|
|
a9908ba7bd | ||
|
|
9f874c00aa | ||
|
|
b52cdf6a95 | ||
|
|
40e637d9e1 | ||
|
|
21c76d97bb | ||
|
|
4b3147ede7 | ||
|
|
a037a66ea4 | ||
|
|
c071819c26 | ||
|
|
28e018de8a | ||
|
|
65102c0ba5 | ||
|
|
ff8e97310d | ||
|
|
2546661aeb | ||
|
|
fdeed49637 | ||
|
|
fab7693da5 | ||
|
|
582323d63c | ||
|
|
a6522d3706 | ||
|
|
28a0028762 | ||
|
|
ec19c32b63 | ||
|
|
ec9aceb96f | ||
|
|
0e1c2e3378 | ||
|
|
094b952d70 | ||
|
|
3821a4e054 | ||
|
|
d24404ca9a | ||
|
|
fb2d6e8870 | ||
|
|
e421cbac2a | ||
|
|
a71310f58b | ||
|
|
43c392626b | ||
|
|
d286573958 | ||
|
|
ff889c40da | ||
|
|
0ecdbe8614 | ||
|
|
8b3500a2a9 | ||
|
|
c5fd56606d | ||
|
|
dd86b85664 | ||
|
|
3ec9f5fa0b | ||
|
|
3bf3ce06f7 | ||
|
|
cc1d601722 | ||
|
|
e8c1b849b7 | ||
|
|
de44b71b12 | ||
|
|
df70c7136d | ||
|
|
bf2b9ea539 | ||
|
|
b0b46c331e | ||
|
|
b3269581ea | ||
|
|
699edd4393 | ||
|
|
9128c6c17b | ||
|
|
f121223ed8 | ||
|
|
3c0e360df1 | ||
|
|
1de6f5fcf6 | ||
|
|
5bf4b718d4 | ||
|
|
f912007fe8 | ||
|
|
377809a35b | ||
|
|
f0f981b80d | ||
|
|
2b9302632c | ||
|
|
a59a1552ad | ||
|
|
4a80e821df | ||
|
|
6822291f91 | ||
|
|
863aacaee3 | ||
|
|
00a2bf7120 | ||
|
|
6ac5acf765 | ||
|
|
ce7583f173 | ||
|
|
24b10ac585 | ||
|
|
706371e24f | ||
|
|
5de8639685 | ||
|
|
d42e26d59c | ||
|
|
6ea06e87bb | ||
|
|
5eb8a44317 | ||
|
|
c89fb0b828 | ||
|
|
52e111dbb7 | ||
|
|
36b5109387 | ||
|
|
c07b085c81 | ||
|
|
065c442141 | ||
|
|
83b570d981 | ||
|
|
2afdee9c7d | ||
|
|
a7e809e1f7 | ||
|
|
deb7cb708f | ||
|
|
fcd7db6cd1 | ||
|
|
68adbd2e05 | ||
|
|
b6258d612b | ||
|
|
93cb76a292 | ||
|
|
6191f69f0c | ||
|
|
d416e6c854 | ||
|
|
3a63d978dd | ||
|
|
d2a78c33df | ||
|
|
679f91482e | ||
|
|
d380a8554d | ||
|
|
4f36ad0cc1 | ||
|
|
90ba7fbf1f | ||
|
|
76658477af | ||
|
|
ffb6a9c74b | ||
|
|
21d334389f | ||
|
|
94a5e081e5 | ||
|
|
5e78d72ef2 | ||
|
|
5c303e2bb5 | ||
|
|
4c1cb388af | ||
|
|
144bd4a878 | ||
|
|
91737aff68 | ||
|
|
2391b40f47 | ||
|
|
6a8aff5a74 | ||
|
|
c0ec5d404b | ||
|
|
10e9a6b6cd | ||
|
|
a51aed7ce2 | ||
|
|
71e0106846 | ||
|
|
3ce9af7fce | ||
|
|
05e8aae95e | ||
|
|
381de6b7cb | ||
|
|
c077645f77 | ||
|
|
ebc3263987 | ||
|
|
cf6e5bf01f | ||
|
|
958c615a83 | ||
|
|
8e5070f469 | ||
|
|
4397b675cb | ||
|
|
9ed88f6a8d | ||
|
|
f12fde9132 | ||
|
|
1c4ea6d246 | ||
|
|
a6d76b3c48 | ||
|
|
5d0ace0577 | ||
|
|
7b88544d46 | ||
|
|
6767ea2456 | ||
|
|
459db3d64b | ||
|
|
d009cf618a | ||
|
|
9a9897a9de | ||
|
|
3f9fb13df6 | ||
|
|
52f414669a | ||
|
|
b34215906c | ||
|
|
fb768ac792 | ||
|
|
35289bffe2 | ||
|
|
ef00fdf472 | ||
|
|
3de7e8358f | ||
|
|
28ac2f49dc | ||
|
|
c38b5d5eb9 | ||
|
|
180d06613a | ||
|
|
c3ee4212f0 | ||
|
|
efafbe9a5c | ||
|
|
e38680a4df | ||
|
|
f28fc6f2e1 | ||
|
|
5ba8d36687 | ||
|
|
178236cc5f | ||
|
|
79a0533c69 | ||
|
|
64363995be | ||
|
|
426ad6e3a3 | ||
|
|
0d0e7a1008 | ||
|
|
806545df34 | ||
|
|
b8cc257ac5 | ||
|
|
bdb4d96678 | ||
|
|
0c5fb4a81b | ||
|
|
3ff48f27cf | ||
|
|
f0c732452f | ||
|
|
a4d1b1ba21 | ||
|
|
0447ea94c1 | ||
|
|
38fd7a84c7 | ||
|
|
ee17910ec5 | ||
|
|
717a7dbfde | ||
|
|
0fb6576511 | ||
|
|
383495c863 | ||
|
|
b55abf5730 | ||
|
|
3e1aa456b9 | ||
|
|
00558adda8 | ||
|
|
1c3273aab2 | ||
|
|
589b247926 | ||
|
|
6965e3e03c | ||
|
|
202d5ab754 | ||
|
|
1023be33fb | ||
|
|
595c00f55c | ||
|
|
5aaa5eab70 | ||
|
|
70b24b021a | ||
|
|
af96c721c4 | ||
|
|
a9b653db26 | ||
|
|
80c23d4519 | ||
|
|
821d7a8941 | ||
|
|
e7c8a22c67 | ||
|
|
5652ccc780 | ||
|
|
055d429ae1 | ||
|
|
8231897b26 | ||
|
|
df7e656034 | ||
|
|
d045409b9f | ||
|
|
7f3f4cfdd0 | ||
|
|
ef044d9f17 | ||
|
|
9642c7f990 | ||
|
|
0c5193c588 | ||
|
|
f2c2b3fc7a | ||
|
|
1228e0e925 | ||
|
|
3a3820bedc | ||
|
|
91ee6ed60f | ||
|
|
7e28fdc176 | ||
|
|
569bc02649 | ||
|
|
178309be47 | ||
|
|
2fb7ac9a58 | ||
|
|
2e493cb89a | ||
|
|
cdf0d77b20 | ||
|
|
ccdfaa9115 | ||
|
|
34af05ec30 | ||
|
|
6bd41e47ac | ||
|
|
45d11c53f0 | ||
|
|
50a68d7d59 | ||
|
|
cc47b5a78c | ||
|
|
34b4ec3624 | ||
|
|
86ed364dc0 | ||
|
|
438cde4e70 | ||
|
|
3b268d1656 | ||
|
|
0a97782339 | ||
|
|
1cf1d6146c | ||
|
|
f3217ac170 | ||
|
|
c8125f8710 | ||
|
|
1e3bc7c069 | ||
|
|
34df9f3dbf | ||
|
|
72bb159a7e | ||
|
|
afe4e345d2 | ||
|
|
855b5b513d | ||
|
|
b9d271c1a8 | ||
|
|
b3931741ef | ||
|
|
ede48e285f | ||
|
|
8890539f47 | ||
|
|
ff72dd8d2c | ||
|
|
e07b265009 | ||
|
|
8d0e5899b9 | ||
|
|
e6f8b59010 | ||
|
|
8e65846f32 | ||
|
|
96d4d3f3be | ||
|
|
811c01cc2e | ||
|
|
e24127771e | ||
|
|
b3f00d05a8 | ||
|
|
652d34b0a8 | ||
|
|
7539577b46 | ||
|
|
41ee6006c4 | ||
|
|
813ba42cfc | ||
|
|
80076276e1 | ||
|
|
3a78e8010d | ||
|
|
d9940f416b | ||
|
|
dd998e7fd3 | ||
|
|
747db4d940 | ||
|
|
ecd5c523dc | ||
|
|
3de14fc63e | ||
|
|
7f166eaee7 | ||
|
|
ab7b5e48c4 | ||
|
|
345b5cfc5c | ||
|
|
1ac93c3a72 | ||
|
|
4b8c29a708 | ||
|
|
04b057d22c | ||
|
|
fcfb8dd2ed | ||
|
|
4a2673772a | ||
|
|
b9e216ac6f | ||
|
|
e78e2885fe | ||
|
|
777f2e7547 | ||
|
|
27e494d25c | ||
|
|
d88156d998 | ||
|
|
44a3af51f0 | ||
|
|
79f090d92b | ||
|
|
54c65fdad0 | ||
|
|
e917802316 | ||
|
|
6a19a31171 | ||
|
|
a06b7f2ae0 | ||
|
|
405b1067e2 | ||
|
|
10cb93283a | ||
|
|
d28e8f537a | ||
|
|
24d7f54662 | ||
|
|
687a43e199 | ||
|
|
07ef7d750b | ||
|
|
ea2b1d36aa | ||
|
|
c7540fba94 | ||
|
|
3d9198592b | ||
|
|
d6357bacdd | ||
|
|
647551b8e4 | ||
|
|
b158c25dc3 | ||
|
|
bc8a3c5b6f | ||
|
|
c149db2205 | ||
|
|
b5495ec972 | ||
|
|
472c390e75 | ||
|
|
3d9a41e4b4 | ||
|
|
9f77b065d3 | ||
|
|
7abbe1e8d8 | ||
|
|
004b6ed60f | ||
|
|
d12f30f90c | ||
|
|
c433c2f2e2 | ||
|
|
9e52c330ae | ||
|
|
564deec2c4 | ||
|
|
6fd0ffccbf | ||
|
|
ee957a4285 | ||
|
|
c63331a303 | ||
|
|
4d2c44ca87 | ||
|
|
596b5cd732 | ||
|
|
8ff1ba325d | ||
|
|
a19d7e3680 | ||
|
|
90eeb25770 | ||
|
|
bfe8b81d18 | ||
|
|
ec71c19be7 | ||
|
|
cce1fc9c65 | ||
|
|
79fee501af | ||
|
|
12dfaa2d74 | ||
|
|
d4e5366fe6 | ||
|
|
d7388d7e80 | ||
|
|
5c363b76ee | ||
|
|
440adddcde | ||
|
|
af9ad1580a | ||
|
|
d569430cc6 | ||
|
|
c39bea2017 | ||
|
|
a361f618a1 | ||
|
|
8c2d8bc85f | ||
|
|
563b56e09c | ||
|
|
455f675806 | ||
|
|
3932e860ca | ||
|
|
b3368a85da | ||
|
|
defe0b25dd | ||
|
|
b68ed904b1 | ||
|
|
2eba4fb96b | ||
|
|
27ba604ad7 | ||
|
|
769982d058 | ||
|
|
674d702257 | ||
|
|
c974cb1b8e | ||
|
|
20c05a3add | ||
|
|
c27322ff04 | ||
|
|
6e624946d2 | ||
|
|
ab9a63bbea | ||
|
|
3a8438e1f8 | ||
|
|
0e49c6affd | ||
|
|
8bcf78cd78 | ||
|
|
ffc944976b | ||
|
|
1b52be6246 | ||
|
|
e7e1ec6e84 | ||
|
|
ff3c441023 | ||
|
|
aaf6e84373 | ||
|
|
380a357b08 | ||
|
|
8026d0b2e7 | ||
|
|
b41cad58cb | ||
|
|
39e12244cc | ||
|
|
c4c01b61e6 | ||
|
|
eb3cd22aa3 | ||
|
|
5b35f5fb69 | ||
|
|
11d875d043 | ||
|
|
ac946a4602 | ||
|
|
815e2f3d03 | ||
|
|
bd8bca87b2 | ||
|
|
9110aa09a4 | ||
|
|
fe085a631d | ||
|
|
c7489af844 | ||
|
|
32a653e67e | ||
|
|
d16c93aa08 | ||
|
|
46367a7a7b | ||
|
|
83a25c06ef | ||
|
|
db7db67851 | ||
|
|
8d7073abf6 | ||
|
|
f1c8dd887b | ||
|
|
08bc3b0386 | ||
|
|
2808de6084 | ||
|
|
028088f5f0 | ||
|
|
21178c3571 | ||
|
|
b8214e260c | ||
|
|
45d813b62c | ||
|
|
73b3e0e50e | ||
|
|
255fcbc3a5 | ||
|
|
47d93279ff | ||
|
|
5b93ae8628 | ||
|
|
436318a8c8 | ||
|
|
57a328c7a9 | ||
|
|
2cd3f046e5 | ||
|
|
5c88c1376c | ||
|
|
2d39e5d7a5 | ||
|
|
27e255fa75 | ||
|
|
195190b612 | ||
|
|
aeabfaf417 | ||
|
|
f62201ba9d | ||
|
|
5cf331d881 | ||
|
|
28c90cce6c | ||
|
|
ca5b10938a | ||
|
|
acd4cc6f5c | ||
|
|
7ac3a36229 | ||
|
|
a6178c1de6 | ||
|
|
990dd18474 | ||
|
|
c4642d4fda | ||
|
|
c7d3b83164 | ||
|
|
7c87bb35c4 | ||
|
|
f20530dce2 | ||
|
|
5d5adf7c7e | ||
|
|
fc01873d60 | ||
|
|
81b9e78565 | ||
|
|
cee4505172 | ||
|
|
4d4b29ea94 | ||
|
|
efd780f82a | ||
|
|
cc0ff6b0bf | ||
|
|
35e13cf5e8 | ||
|
|
238652b36c | ||
|
|
e4b728ccb9 | ||
|
|
68967aef72 | ||
|
|
fd67d46be7 | ||
|
|
ee0e8a3aad | ||
|
|
f4734d6b4d | ||
|
|
656628e69b | ||
|
|
6b1bca80ee | ||
|
|
537a50214a | ||
|
|
67d04dd9ba | ||
|
|
b8efd02c7f | ||
|
|
a600d8f4e2 | ||
|
|
de7793e918 | ||
|
|
a5e442d490 | ||
|
|
51513c4e6b | ||
|
|
5d0b813cec | ||
|
|
ba0c271774 | ||
|
|
7062c01b68 | ||
|
|
c0bad42eb1 | ||
|
|
af7ebd96a0 | ||
|
|
ac59fd1476 | ||
|
|
6561d70664 | ||
|
|
1a5c59326a | ||
|
|
d44375aece | ||
|
|
cf37058d7c | ||
|
|
dcb3fcbfa7 | ||
|
|
6ece3f6792 | ||
|
|
3b30e42551 | ||
|
|
b0ef524b9e | ||
|
|
b138aaae08 | ||
|
|
3953661078 | ||
|
|
b551844cc2 | ||
|
|
93f3e2b007 | ||
|
|
0a42a8bc46 | ||
|
|
8097b07661 | ||
|
|
1475cabfa0 | ||
|
|
6a1573c228 | ||
|
|
d26e1d783f | ||
|
|
fa720c1858 | ||
|
|
bc7c3e44d5 | ||
|
|
480ca88b68 | ||
|
|
aba0e602ed | ||
|
|
22a2f98ced | ||
|
|
aaa47850c3 | ||
|
|
7c2feb78d2 | ||
|
|
0c65d2cc0c | ||
|
|
13c5f806c6 | ||
|
|
84d3b4de46 | ||
|
|
925a772dce | ||
|
|
95015f1104 | ||
|
|
dcbc727813 | ||
|
|
3b9d4c8d50 | ||
|
|
40fe9e6d67 | ||
|
|
4da816e459 | ||
|
|
9c475467d5 | ||
|
|
0310cbad0a | ||
|
|
ef258914b2 | ||
|
|
c025f363f5 | ||
|
|
51187d06b3 | ||
|
|
8210b3c873 | ||
|
|
883e0826e2 | ||
|
|
003f9f7953 | ||
|
|
2880a679f0 | ||
|
|
4d6cff7eb8 | ||
|
|
d8806649ab | ||
|
|
dc9a65923a | ||
|
|
751d2a0fe7 |
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,4 +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
|
||||||
|
|
||||||
CMakeLists.txt.user
|
# Ignore directories made by `make`.
|
||||||
|
/bin/
|
||||||
*.bak
|
|
||||||
|
|||||||
21
.travis.yml
Normal file
21
.travis.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
language: c
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- secure: "Tx8C7AkTwGDiPEzEaS6t3emevQMYzlcDGilbGWXT7vnSKbftH6lr/9djoKhD2Y2xA62XEfHr9fho9FzUGYuuTADz05qYIdc5m1lILRWok8SFwDt27DS0CpaSpvDYzzCPe70zBdEq1VZ05U+kXA2a4bS+R0xDA8q8vRx4jOl9LjpHvt8R2K7qHkx9LH5YmBz42PjbXdmxJPdFTY8SgWUy7dOMsnPMq0UzTLS54DMlOxSRaCrVw6qv15uIBrgTQiy+XtNft2qe5J+61w6WEhaWhbofuaxuc86jiryA8XUv04WuafoYxaErgf5+nw2/CfMAP2k5TFsNDN/F07xlCj/0aL/kVJGmVsKHUlDBbzEDhkQjw8C6hANOfagBSfRgWvko0E5o0bo0sRrIsbg1feVby7zkfX2a73fTDNC30Z3SSkzTWz37VNJLUMF14LmRDaq4/0DtIAjJDy4qaUwh4RCLcCPlbAf9nmBZn8asIFswPLd4gnktk9n42AyPHNDLExKCwe3+LsVO8ruAlejlnZyEU91vpVMF14j6WeQm2mnYb9CBdOVsBmrskyuTZ4oENDAx14CoxgL6lvxhf+gnZMhvIft1ybM+wQTdfBIl6cqlOMmU9uC8IecQx1Rz/ek17cR3PQXOWQu/jNiU2nJt1WGpBfzYSBjg/e1cVzRvIi+eI5k="
|
||||||
|
|
||||||
|
addons:
|
||||||
|
coverity_scan:
|
||||||
|
project:
|
||||||
|
name: "uclouvain/openjpeg"
|
||||||
|
description: "Build submitted via Travis CI"
|
||||||
|
notification_email: info@openjpeg.org
|
||||||
|
build_command_prepend: "mkdir build && cd build && cmake -G 'Unix Makefiles' -DBUILD_CODEC=ON -DBUILD_THIRDPARTY=ON .."
|
||||||
|
build_command: "make -j 4"
|
||||||
|
branch_pattern: coverity_scan
|
||||||
|
|
||||||
|
install:
|
||||||
|
- echo "Coverity scan build"
|
||||||
|
|
||||||
|
script:
|
||||||
|
- echo "Coverity scan build"
|
||||||
13
AUTHORS
13
AUTHORS
@@ -1,13 +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.
|
|
||||||
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.
|
||||||
|
|
||||||
391
CHANGELOG.md
Normal file
391
CHANGELOG.md
Normal file
@@ -0,0 +1,391 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [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)*
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# Look for the header file.
|
|
||||||
FIND_PATH(FCGI_INCLUDE_DIR NAMES fastcgi.h)
|
|
||||||
|
|
||||||
# Look for the library.
|
|
||||||
FIND_LIBRARY(FCGI_LIBRARY NAMES fcgi)
|
|
||||||
|
|
||||||
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
|
|
||||||
|
|
||||||
# Copy the results to the output variables.
|
|
||||||
IF(FCGI_FOUND)
|
|
||||||
SET(FCGI_LIBRARIES ${FCGI_LIBRARY})
|
|
||||||
SET(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
|
|
||||||
ELSE(FCGI_FOUND)
|
|
||||||
SET(FCGI_LIBRARIES)
|
|
||||||
SET(FCGI_INCLUDE_DIRS)
|
|
||||||
ENDIF(FCGI_FOUND)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(FCGI_INCLUDE_DIR FCGI_LIBRARY)
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#-----------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# OPENJPEGConfig.cmake - CMake configuration file for external projects.
|
|
||||||
#
|
|
||||||
# This file is configured by OPENJPEG and used by the UseOPENJPEG.cmake
|
|
||||||
# module to load OPENJPEG's settings for an external project.
|
|
||||||
@OPENJPEG_CONFIG_INSTALL_ONLY@
|
|
||||||
# The OPENJPEG version number.
|
|
||||||
SET(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@")
|
|
||||||
SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@")
|
|
||||||
SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
|
|
||||||
|
|
||||||
# The libraries.
|
|
||||||
SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@")
|
|
||||||
|
|
||||||
# The CMake macros dir.
|
|
||||||
SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@")
|
|
||||||
|
|
||||||
# The configuration options.
|
|
||||||
SET(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
|
|
||||||
|
|
||||||
# The "use" file.
|
|
||||||
SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
|
|
||||||
|
|
||||||
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
||||||
# The following is inspired from:
|
|
||||||
# http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Packaging_and_Exporting
|
|
||||||
# However the following is difficult to handle:
|
|
||||||
# get_filename_component(myproj_INCLUDE_DIRS "${SELF_DIR}/../../include/myproj" ABSOLUTE)
|
|
||||||
# it asssumes a non multi-arch system, where 'include' is located '../include' from lib
|
|
||||||
# therefore we need to take into account the number of subdirs in OPENJPEG_INSTALL_LIB_DIR
|
|
||||||
if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
|
||||||
# This is an install tree
|
|
||||||
include(${SELF_DIR}/OpenJPEGTargets.cmake)
|
|
||||||
get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/@relative_parent@/@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
|
|
||||||
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
|
|
||||||
|
|
||||||
else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
|
||||||
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
|
||||||
# This is a build tree
|
|
||||||
SET( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@)
|
|
||||||
|
|
||||||
include(${SELF_DIR}/OpenJPEGExports.cmake)
|
|
||||||
|
|
||||||
else(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
|
||||||
message(FATAL_ERROR "ooops")
|
|
||||||
endif(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
|
||||||
endif(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
|
||||||
|
|
||||||
set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)
|
|
||||||
|
|
||||||
# Backward compatible part:
|
|
||||||
SET(OPENJPEG_FOUND TRUE)
|
|
||||||
|
|
||||||
386
CMakeLists.txt
386
CMakeLists.txt
@@ -6,40 +6,41 @@
|
|||||||
# you will eventually like to prefix the library to avoid linking confusion
|
# you will eventually like to prefix the library to avoid linking confusion
|
||||||
# For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
|
# For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
|
||||||
# e.g.:
|
# e.g.:
|
||||||
# SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
|
# set(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.8.2)
|
||||||
|
|
||||||
IF(COMMAND CMAKE_POLICY)
|
if(COMMAND CMAKE_POLICY)
|
||||||
CMAKE_POLICY(SET CMP0003 NEW)
|
cmake_policy(SET CMP0003 NEW)
|
||||||
if (NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
|
if (NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
|
||||||
cmake_policy(SET CMP0042 NEW)
|
cmake_policy(SET CMP0042 NEW)
|
||||||
endif()
|
endif()
|
||||||
ENDIF(COMMAND CMAKE_POLICY)
|
endif()
|
||||||
|
|
||||||
IF(NOT OPENJPEG_NAMESPACE)
|
if(NOT OPENJPEG_NAMESPACE)
|
||||||
SET(OPENJPEG_NAMESPACE "OPENJPEG")
|
set(OPENJPEG_NAMESPACE "OPENJPEG")
|
||||||
SET(OPENJPEG_STANDALONE 1)
|
set(OPENJPEG_STANDALONE 1)
|
||||||
ENDIF(NOT OPENJPEG_NAMESPACE)
|
endif()
|
||||||
# In all cases:
|
# In all cases:
|
||||||
STRING(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
|
#string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
|
||||||
|
set(OPENJPEG_LIBRARY_NAME openjp2)
|
||||||
|
|
||||||
PROJECT(${OPENJPEG_NAMESPACE} C)
|
project(${OPENJPEG_NAMESPACE} C)
|
||||||
|
|
||||||
# Do full dependency headers.
|
# Do full dependency headers.
|
||||||
INCLUDE_REGULAR_EXPRESSION("^.*$")
|
include_regular_expression("^.*$")
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# OPENJPEG version number, useful for packaging and doxygen doc:
|
# OPENJPEG version number, useful for packaging and doxygen doc:
|
||||||
SET(OPENJPEG_VERSION_MAJOR 1)
|
set(OPENJPEG_VERSION_MAJOR 2)
|
||||||
SET(OPENJPEG_VERSION_MINOR 5)
|
set(OPENJPEG_VERSION_MINOR 1)
|
||||||
SET(OPENJPEG_VERSION_BUILD 3)
|
set(OPENJPEG_VERSION_BUILD 1)
|
||||||
SET(OPENJPEG_VERSION
|
set(OPENJPEG_VERSION
|
||||||
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||||
SET(PACKAGE_VERSION
|
set(PACKAGE_VERSION
|
||||||
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||||
|
|
||||||
# Because autotools does not support X.Y notation for SOVERSION, we have to use
|
# Because autotools does not support X.Y notation for SOVERSION, we have to use
|
||||||
# two numerorations, one for the openjpeg version and one for openjpeg soversion
|
# two numbering, one for the openjpeg version and one for openjpeg soversion
|
||||||
# version | soversion
|
# version | soversion
|
||||||
# 1.0 | 0
|
# 1.0 | 0
|
||||||
# 1.1 | 1
|
# 1.1 | 1
|
||||||
@@ -49,32 +50,35 @@ SET(PACKAGE_VERSION
|
|||||||
# 1.5 | 5
|
# 1.5 | 5
|
||||||
# 1.5.1 | 5
|
# 1.5.1 | 5
|
||||||
# 2.0 | 6
|
# 2.0 | 6
|
||||||
|
# 2.0.1 | 6
|
||||||
|
# 2.1 | 7
|
||||||
|
# 2.1.1 | 7
|
||||||
# above is the recommendation by the OPJ team. If you really need to override this default,
|
# 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:
|
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
|
||||||
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
|
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
|
||||||
if(NOT OPENJPEG_SOVERSION)
|
if(NOT OPENJPEG_SOVERSION)
|
||||||
SET(OPENJPEG_SOVERSION 5)
|
set(OPENJPEG_SOVERSION 7)
|
||||||
endif(NOT OPENJPEG_SOVERSION)
|
endif(NOT OPENJPEG_SOVERSION)
|
||||||
SET(OPENJPEG_LIBRARY_PROPERTIES
|
set(OPENJPEG_LIBRARY_PROPERTIES
|
||||||
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
|
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
|
||||||
SOVERSION "${OPENJPEG_SOVERSION}"
|
SOVERSION "${OPENJPEG_SOVERSION}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Path to additional CMake modules
|
# Path to additional CMake modules
|
||||||
SET(CMAKE_MODULE_PATH
|
set(CMAKE_MODULE_PATH
|
||||||
${CMAKE_SOURCE_DIR}/CMake
|
${CMAKE_SOURCE_DIR}/cmake
|
||||||
${CMAKE_MODULE_PATH})
|
${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
|
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
|
||||||
# warnings
|
# warnings
|
||||||
IF(WIN32)
|
if(WIN32)
|
||||||
IF(NOT BORLAND)
|
if(NOT BORLAND)
|
||||||
IF(NOT CYGWIN)
|
if(NOT CYGWIN)
|
||||||
IF(NOT MINGW)
|
if(NOT MINGW)
|
||||||
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
||||||
ADD_DEFINITIONS(
|
add_definitions(
|
||||||
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
|
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
|
||||||
-D_CRT_IS_WCTYPE_NO_DEPRECATE
|
-D_CRT_IS_WCTYPE_NO_DEPRECATE
|
||||||
-D_CRT_MANAGED_FP_NO_DEPRECATE
|
-D_CRT_MANAGED_FP_NO_DEPRECATE
|
||||||
@@ -86,58 +90,50 @@ IF(WIN32)
|
|||||||
-D_CRT_VCCLRIT_NO_DEPRECATE
|
-D_CRT_VCCLRIT_NO_DEPRECATE
|
||||||
-D_SCL_SECURE_NO_DEPRECATE
|
-D_SCL_SECURE_NO_DEPRECATE
|
||||||
)
|
)
|
||||||
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
endif()
|
||||||
ENDIF(NOT MINGW)
|
endif()
|
||||||
ENDIF(NOT CYGWIN)
|
endif()
|
||||||
ENDIF(NOT BORLAND)
|
endif()
|
||||||
ENDIF(WIN32)
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Install directories
|
# 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)
|
string(TOLOWER ${PROJECT_NAME} projectname)
|
||||||
SET(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
|
set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_BIN_DIR)
|
if(NOT OPENJPEG_INSTALL_BIN_DIR)
|
||||||
SET(OPENJPEG_INSTALL_BIN_DIR "bin")
|
set(OPENJPEG_INSTALL_BIN_DIR "bin")
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_BIN_DIR)
|
endif()
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_LIB_DIR)
|
if(NOT OPENJPEG_INSTALL_LIB_DIR)
|
||||||
SET(OPENJPEG_INSTALL_LIB_DIR "lib")
|
set(OPENJPEG_INSTALL_LIB_DIR "lib")
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR)
|
endif()
|
||||||
|
|
||||||
# The following will compute the amount of parent dir to go
|
if(NOT OPENJPEG_INSTALL_SHARE_DIR)
|
||||||
# from include to lib. it works nicely with
|
set(OPENJPEG_INSTALL_SHARE_DIR "share")
|
||||||
# OPENJPEG_INSTALL_LIB_DIR=lib
|
endif()
|
||||||
# OPENJPEG_INSTALL_LIB_DIR=lib/
|
|
||||||
# OPENJPEG_INSTALL_LIB_DIR=/lib
|
|
||||||
# OPENJPEG_INSTALL_LIB_DIR=lib/gnu-linux-x64
|
|
||||||
STRING(REPLACE "/" ";" relative_to_lib ${OPENJPEG_INSTALL_LIB_DIR})
|
|
||||||
set(relative_parent "..")
|
|
||||||
foreach( elem ${relative_to_lib})
|
|
||||||
set( relative_parent "${relative_parent}/.." )
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_SHARE_DIR)
|
if(NOT OPENJPEG_INSTALL_DATA_DIR)
|
||||||
SET(OPENJPEG_INSTALL_SHARE_DIR "share")
|
set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_SHARE_DIR)
|
endif()
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_DATA_DIR)
|
if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
|
||||||
SET(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_DATA_DIR)
|
endif()
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
|
if(BUILD_DOC)
|
||||||
SET(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
|
if(NOT OPENJPEG_INSTALL_MAN_DIR)
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
|
set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
|
||||||
|
endif()
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_MAN_DIR)
|
if(NOT OPENJPEG_INSTALL_DOC_DIR)
|
||||||
SET(OPENJPEG_INSTALL_MAN_DIR "share/man/")
|
set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_MAN_DIR)
|
endif()
|
||||||
|
endif()
|
||||||
IF(NOT OPENJPEG_INSTALL_DOC_DIR)
|
|
||||||
SET(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
|
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_DOC_DIR)
|
|
||||||
|
|
||||||
if(NOT OPENJPEG_INSTALL_JNI_DIR)
|
if(NOT OPENJPEG_INSTALL_JNI_DIR)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@@ -147,163 +143,243 @@ if(NOT OPENJPEG_INSTALL_JNI_DIR)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
|
if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
|
||||||
# We could install *.cmake files in share/ however those files contains
|
# We could install *.cmake files in share/ however those files contains
|
||||||
# hardcoded path to libraries on a multi-arch system (fedora/debian) those
|
# hardcoded path to libraries on a multi-arch system (fedora/debian) those
|
||||||
# path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu)
|
# path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu)
|
||||||
SET(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
||||||
ENDIF(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
|
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:
|
# Big endian test:
|
||||||
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
|
include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
|
||||||
TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
|
TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Setup file for setting custom ctest vars
|
# Setup file for setting custom ctest vars
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in
|
${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/CTestCustom.cmake
|
${CMAKE_BINARY_DIR}/CTestCustom.cmake
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# OpenJPEG build configuration options.
|
# OpenJPEG build configuration options.
|
||||||
OPTION(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON)
|
option(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON)
|
||||||
SET (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
|
set (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
|
||||||
SET (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
|
set (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
|
||||||
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
|
mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# configure name mangling to allow multiple libraries to coexist
|
# configure name mangling to allow multiple libraries to coexist
|
||||||
# peacefully
|
# peacefully
|
||||||
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
|
||||||
SET(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
|
set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
|
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
|
||||||
@ONLY)
|
@ONLY)
|
||||||
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
# pkgconfig support
|
|
||||||
IF(UNIX)
|
|
||||||
# install in lib and not share (see multi-arch note above)
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg1.pc.cmake
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc @ONLY)
|
|
||||||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION
|
|
||||||
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
|
|
||||||
INSTALL( CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink
|
|
||||||
\"libopenjpeg1.pc\"
|
|
||||||
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")")
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Compiler specific flags:
|
# Compiler specific flags:
|
||||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
# For all builds, make sure openjpeg is std99 compliant:
|
# 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.
|
# 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:
|
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
|
||||||
SET(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
|
set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# opj_config.h generation (1/2)
|
# opj_config.h generation (1/2)
|
||||||
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
|
||||||
|
# Check if some include files are provided by the system
|
||||||
|
include(EnsureFileInclude)
|
||||||
|
# These files are mandatory
|
||||||
|
ensure_file_include("string.h" HAVE_STRING_H YES)
|
||||||
|
ensure_file_include("memory.h" HAVE_MEMORY_H YES)
|
||||||
|
ensure_file_include("stdlib.h" HAVE_STDLIB_H YES)
|
||||||
|
ensure_file_include("stdio.h" HAVE_STDIO_H YES)
|
||||||
|
ensure_file_include("math.h" HAVE_MATH_H YES)
|
||||||
|
ensure_file_include("float.h" HAVE_FLOAT_H YES)
|
||||||
|
ensure_file_include("time.h" HAVE_TIME_H YES)
|
||||||
|
ensure_file_include("stdarg.h" HAVE_STDARG_H YES)
|
||||||
|
ensure_file_include("ctype.h" HAVE_CTYPE_H YES)
|
||||||
|
ensure_file_include("assert.h" HAVE_ASSERT_H YES)
|
||||||
|
|
||||||
|
# For the following files, we provide an alternative, they are not mandatory
|
||||||
|
ensure_file_include("stdint.h" OPJ_HAVE_STDINT_H NO)
|
||||||
|
ensure_file_include("inttypes.h" OPJ_HAVE_INTTYPES_H NO)
|
||||||
|
|
||||||
|
# why check this one ? for openjpip ?
|
||||||
|
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
||||||
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||||
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
|
|
||||||
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
|
|
||||||
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
|
|
||||||
CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
|
|
||||||
CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
|
|
||||||
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
|
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
|
||||||
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
|
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
|
||||||
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
||||||
|
|
||||||
|
# Enable Large file support
|
||||||
|
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
|
# Build Library
|
||||||
INCLUDE_DIRECTORIES(BEFORE ${OPENJPEG_BINARY_DIR})
|
if(BUILD_JPIP_SERVER)
|
||||||
ADD_SUBDIRECTORY(libopenjpeg)
|
find_package(CURL REQUIRED)
|
||||||
|
find_package(FCGI REQUIRED)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
if(NOT CMAKE_USE_PTHREADS_INIT)
|
||||||
|
message(FATAL_ERROR "Only pthread are supported")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
add_subdirectory(src/lib)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Build Applications
|
# Build Applications
|
||||||
OPTION(BUILD_CODEC "Build the CODEC executables" ON)
|
option(BUILD_CODEC "Build the CODEC executables" ON)
|
||||||
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF)
|
option(BUILD_MJ2 "Build the MJ2 executables." OFF)
|
||||||
OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF)
|
option(BUILD_JPWL "Build the JPWL library and executables" OFF)
|
||||||
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF)
|
option(BUILD_JPIP "Build the JPIP library and executables." OFF)
|
||||||
IF(BUILD_JPIP)
|
if(BUILD_JPIP)
|
||||||
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
|
option(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
|
||||||
ENDIF(BUILD_JPIP)
|
endif()
|
||||||
OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
|
option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
|
||||||
OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
|
option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
|
||||||
OPTION(USE_SYSTEM_GETOPT "Prefer system installed getopt()" OFF)
|
option(BUILD_JP3D "Build the JP3D comp" OFF)
|
||||||
MARK_AS_ADVANCED(USE_SYSTEM_GETOPT)
|
mark_as_advanced(BUILD_VIEWER)
|
||||||
MARK_AS_ADVANCED(BUILD_VIEWER)
|
mark_as_advanced(BUILD_JAVA)
|
||||||
MARK_AS_ADVANCED(BUILD_JAVA)
|
mark_as_advanced(BUILD_JP3D)
|
||||||
|
|
||||||
IF(BUILD_CODEC OR BUILD_MJ2)
|
if(BUILD_CODEC OR BUILD_MJ2)
|
||||||
# OFF: It will only build 3rd party libs if they are not found on the system
|
# OFF: It will only build 3rd party libs if they are not found on the system
|
||||||
# ON: 3rd party libs will ALWAYS be build, and used
|
# ON: 3rd party libs will ALWAYS be build, and used
|
||||||
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
|
option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
|
||||||
ADD_SUBDIRECTORY(thirdparty)
|
add_subdirectory(thirdparty)
|
||||||
ADD_SUBDIRECTORY(applications)
|
add_subdirectory(src/bin)
|
||||||
ENDIF (BUILD_CODEC OR BUILD_MJ2)
|
endif ()
|
||||||
|
add_subdirectory(wrapping)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# opj_config.h generation (2/2)
|
# opj_config.h generation (2/2)
|
||||||
CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in"
|
configure_file(
|
||||||
"${OPENJPEG_BINARY_DIR}/opj_config.h"
|
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config.h
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config_private.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config_private.h
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
# build documentation in doc subdir:
|
||||||
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
if(BUILD_DOC)
|
||||||
IF(BUILD_DOC)
|
add_subdirectory(doc)
|
||||||
ADD_SUBDIRECTORY(doc)
|
endif()
|
||||||
ENDIF(BUILD_DOC)
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Buld Testing
|
# Buld Testing
|
||||||
OPTION(BUILD_TESTING "Build the tests." OFF)
|
option(BUILD_TESTING "Build the tests." OFF)
|
||||||
IF(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
IF(BUILD_CODEC)
|
if(BUILD_CODEC)
|
||||||
ENABLE_TESTING()
|
enable_testing()
|
||||||
INCLUDE(CTest)
|
include(CTest)
|
||||||
|
|
||||||
# Search openjpeg data needed for the tests
|
# Search openjpeg data needed for the tests
|
||||||
# They could be found via svn on the OpenJPEG google code project
|
# They could be found via git on the OpenJPEG GitHub code project
|
||||||
# svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo)
|
# git clone https://github.com/uclouvain/openjpeg-data.git
|
||||||
FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data
|
find_path(OPJ_DATA_ROOT README-OPJ-Data
|
||||||
PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../data
|
PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../data
|
||||||
${CMAKE_SOURCE_DIR}/../../data
|
|
||||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add repository where to find tests
|
# Add repository where to find tests
|
||||||
ADD_SUBDIRECTORY(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
ELSE(BUILD_CODEC)
|
else()
|
||||||
message(FATAL_ERROR "You need build codec to run the tests")
|
message(FATAL_ERROR "You need build codec to run the tests")
|
||||||
ENDIF(BUILD_CODEC)
|
endif()
|
||||||
ENDIF(BUILD_TESTING)
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# install all targets referenced as OPENJPEGTargets
|
# install all targets referenced as OPENJPEGTargets
|
||||||
INSTALL(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
|
install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
|
||||||
CONFIGURE_FILE( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in
|
configure_file( ${OPENJPEG_SOURCE_DIR}/cmake/OpenJPEGConfig.cmake.in
|
||||||
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
INSTALL( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||||
DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}
|
DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# install CHANGES and LICENSE
|
# install CHANGES and LICENSE
|
||||||
IF(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
|
if(BUILD_DOC)
|
||||||
INSTALL(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
|
if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
|
||||||
ENDIF(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
|
install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
|
||||||
INSTALL(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
|
endif()
|
||||||
|
|
||||||
INCLUDE (CMake/OpenJPEGCPack.cmake)
|
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)
|
||||||
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION
|
||||||
|
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
|
||||||
|
#
|
||||||
|
if(BUILD_JPWL)
|
||||||
|
# install in lib and not share (see multi-arch note above)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpwl/libopenjpwl.pc.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc @ONLY)
|
||||||
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc DESTINATION
|
||||||
|
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
if(BUILD_JPIP)
|
||||||
|
# install in lib and not share (see multi-arch note above)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpip/libopenjpip.pc.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc @ONLY)
|
||||||
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc DESTINATION
|
||||||
|
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
if(BUILD_JP3D)
|
||||||
|
# install in lib and not share (see multi-arch note above)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp3d/libopenjp3d.pc.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc @ONLY)
|
||||||
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc DESTINATION
|
||||||
|
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|||||||
114
INSTALL
114
INSTALL
@@ -1,114 +0,0 @@
|
|||||||
|
|
||||||
How to build and install openjpeg binaries
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
UNIX/LINUX similar systems
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
1) Using autotools
|
|
||||||
|
|
||||||
It is highly recommended that pkg-config is installed. If needed, you have to
|
|
||||||
properly set the environment variable PKG_CONFIG_PATH so that the .pc files
|
|
||||||
are found.
|
|
||||||
|
|
||||||
To build from top-level directory, you can simply type:
|
|
||||||
./bootstrap.sh
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
|
|
||||||
To keep all build files in a separate directory, you can type instead:
|
|
||||||
./bootstrap.sh
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
../configure
|
|
||||||
make
|
|
||||||
|
|
||||||
To install:
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
To clean:
|
|
||||||
make clean
|
|
||||||
make distclean
|
|
||||||
|
|
||||||
To build doc (requires 'doxygen' to be found on your system):
|
|
||||||
(this will create an html directory in TOP_LEVEL/doc)
|
|
||||||
make doc
|
|
||||||
|
|
||||||
Main './configure' options (type './configure --help' for more details)
|
|
||||||
'--enable-mj2'
|
|
||||||
'--enable-jpwl'
|
|
||||||
'--enable-jpip'
|
|
||||||
'--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
|
|
||||||
'--enable-debug' (default : disabled)
|
|
||||||
|
|
||||||
You can also specify your own CFLAGS and LDFLAGS with (for example):
|
|
||||||
CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
|
|
||||||
|
|
||||||
The (optional) dependencies of some binaries are libpng, libtiff, libcms 1 or 2
|
|
||||||
and FastCGI. Only libtiff and FastCGI have no .pc file. There should be some
|
|
||||||
automatic detection if they are installed in /usr, /usr/local or /opt/local.
|
|
||||||
Otherwise, you can tune their detection (as well as for libpng and libcms1 or 2
|
|
||||||
too) with the environment variables:
|
|
||||||
|
|
||||||
TIFF_CFLAGS
|
|
||||||
TIFF_LIBS
|
|
||||||
FCGI_CFLAGS
|
|
||||||
FCGI_LIBS
|
|
||||||
|
|
||||||
See './configure --help' output for more details.
|
|
||||||
|
|
||||||
|
|
||||||
2) 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 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 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 (autotools and cmake) 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
|
|
||||||
-------
|
|
||||||
|
|
||||||
If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used.
|
|
||||||
|
|
||||||
Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
|
|
||||||
Type 'cmake --help' for available generators on your platform.
|
|
||||||
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})
|
||||||
|
```
|
||||||
14
LICENSE
14
LICENSE
@@ -1,11 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
* Copyright (c) 2002-2012, Professor Benoit Macq
|
* BSD License, included below. This software may be subject to other third
|
||||||
* Copyright (c) 2003-2012, Antonin Descampe
|
* 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) 2003-2009, Francois-Olivier Devaux
|
||||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||||
* Copyright (c) 2001-2003, David Janssens
|
* Copyright (c) 2001-2003, David Janssens
|
||||||
|
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
|
||||||
|
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||||
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
75
Makefile.am
75
Makefile.am
@@ -1,75 +0,0 @@
|
|||||||
DISTCHECK_CONFIGURE_FLAGS = --enable-jpip=yes --enable-jpip-server=yes --enable-jpwl=yes --enable-mj2=yes
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
|
||||||
|
|
||||||
SUBDIRS = libopenjpeg applications doc
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
|
||||||
pkgconfig_DATA = libopenjpeg1.pc
|
|
||||||
|
|
||||||
if WANT_JPWL
|
|
||||||
pkgconfig_DATA += libopenjpeg-jpwl.pc
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = \
|
|
||||||
Makefile.in \
|
|
||||||
aclocal.m4 \
|
|
||||||
config.guess \
|
|
||||||
opj_config.h.in \
|
|
||||||
opj_config.h.in~ \
|
|
||||||
config.sub \
|
|
||||||
configure \
|
|
||||||
depcomp \
|
|
||||||
install-sh \
|
|
||||||
ltmain.sh \
|
|
||||||
missing
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CMake/CTestCustom.cmake.in \
|
|
||||||
CMake/FindFCGI.cmake \
|
|
||||||
CMake/FindLCMS2.cmake \
|
|
||||||
CMake/FindLCMS.cmake \
|
|
||||||
CMake/OpenJPEGConfig.cmake.in \
|
|
||||||
CMakeLists.txt \
|
|
||||||
CTestConfig.cmake \
|
|
||||||
AUTHORS \
|
|
||||||
CHANGES \
|
|
||||||
INSTALL \
|
|
||||||
LICENSE \
|
|
||||||
NEWS \
|
|
||||||
README \
|
|
||||||
THANKS \
|
|
||||||
bootstrap.sh \
|
|
||||||
libopenjpeg1.pc.cmake \
|
|
||||||
libopenjpeg1.pc.in \
|
|
||||||
libopenjpeg-jpwl.pc.in \
|
|
||||||
opj_config.h.cmake.in \
|
|
||||||
m4/opj_check_lib.m4 \
|
|
||||||
m4/opj_doxygen.m4 \
|
|
||||||
m4/pkg.m4
|
|
||||||
|
|
||||||
.PHONY: doc
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
doc:
|
|
||||||
@echo "entering doc/"
|
|
||||||
@cd doc && make doc
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
if HAVE_WIN32
|
|
||||||
$(LN_S) -f libopenjpeg1.pc $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
|
|
||||||
else
|
|
||||||
$(LN_S) -nf libopenjpeg1.pc $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
|
|
||||||
endif
|
|
||||||
@echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg1.pc" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (LN)\t$(pkgconfigdir)/libopenjpeg.pc" >> $(top_builddir)/report.txt
|
|
||||||
if WANT_JPWL
|
|
||||||
@echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg-jpwl.pc" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
@cat $(top_builddir)/report.txt
|
|
||||||
@rm $(top_builddir)/report.txt
|
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
rm -f $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
|
|
||||||
24
NEWS
24
NEWS
@@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
OpenJPEG NEWS - user visible changes
|
|
||||||
====================================
|
|
||||||
|
|
||||||
Changes from OpenJPEG 1.5.1 to OpenJPEG 1.5.0
|
|
||||||
----------------------------------------------
|
|
||||||
|
|
||||||
Security:
|
|
||||||
|
|
||||||
* Fixes: CVE-2012-3535
|
|
||||||
* Fixes: CVE-2012-3358
|
|
||||||
|
|
||||||
New Features:
|
|
||||||
|
|
||||||
* Use a new API scheme and solve the SOVERSIONing in OpenJPEG
|
|
||||||
* Allow better integration with multi-arch system
|
|
||||||
* Compile & Install Java bindings (CMake)
|
|
||||||
* Install required addXMLinJP2 (JPIP)
|
|
||||||
|
|
||||||
Misc:
|
|
||||||
|
|
||||||
* fix linker error by resolving all symbols (eg. missing -lm)
|
|
||||||
* fix some man page typos
|
|
||||||
* Huge amount of bug fixes. See CHANGES for details.
|
|
||||||
67
NEWS.md
Normal file
67
NEWS.md
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# OpenJPEG NEWS
|
||||||
|
|
||||||
|
More details in the [Changelog](https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md)
|
||||||
|
|
||||||
|
## 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.
|
||||||
25
README
25
README
@@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
OPENJPEG LIBRARY and APPLICATIONS
|
|
||||||
----------------------------------
|
|
||||||
|
|
||||||
Details on folders hierarchy:
|
|
||||||
|
|
||||||
* libopenjpeg: contains the sources of the openjpeg library
|
|
||||||
* jpwl: contains the additional sources if you want to build a JPWL-flavoured library.
|
|
||||||
* applications: contains all applications that use the openjpeg library
|
|
||||||
* common: common files to all applications
|
|
||||||
* codec: a basic codec
|
|
||||||
* mj2: motion jpeg 2000 executables
|
|
||||||
* JavaOpenJPEG: java jni to use openjpeg in a java program
|
|
||||||
* jpip: complete client-server architecture for remote browsing of jpeg 2000 images. See corresponding README for more details.
|
|
||||||
* OPJViewer: gui for displaying j2k files (based on wxWidget)
|
|
||||||
* 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
|
|
||||||
* m4: autotools 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.
|
|
||||||
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.
|
|
||||||
|
|
||||||
Mathieu Malaterre
|
|
||||||
Winfried Szukalski
|
|
||||||
Vincent Torri
|
|
||||||
Bob Friesenhahn
|
|
||||||
Callum Lerwick
|
|
||||||
Dzonatas Sol
|
|
||||||
Mickaël Savinaud
|
|
||||||
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
|
|
||||||
38
THANKS.md
Normal file
38
THANKS.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 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
|
||||||
|
* Glenn Pearson
|
||||||
|
* Even Rouault
|
||||||
|
* Dzonatas Sol
|
||||||
|
* Winfried Szukalski
|
||||||
|
* Vincent Torri
|
||||||
|
* Yannick Verschueren
|
||||||
|
* Peter Wimmer
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Build the each application if it needed
|
|
||||||
|
|
||||||
IF(BUILD_CODEC)
|
|
||||||
ADD_SUBDIRECTORY(codec)
|
|
||||||
ENDIF(BUILD_CODEC)
|
|
||||||
|
|
||||||
IF(BUILD_MJ2)
|
|
||||||
ADD_SUBDIRECTORY(mj2)
|
|
||||||
ENDIF(BUILD_MJ2)
|
|
||||||
|
|
||||||
# Client & Server:
|
|
||||||
IF(BUILD_JPIP)
|
|
||||||
ADD_SUBDIRECTORY(jpip)
|
|
||||||
ENDIF(BUILD_JPIP)
|
|
||||||
|
|
||||||
IF(BUILD_VIEWER)
|
|
||||||
ADD_SUBDIRECTORY(OPJViewer)
|
|
||||||
ENDIF(BUILD_VIEWER)
|
|
||||||
|
|
||||||
IF(BUILD_JAVA)
|
|
||||||
ADD_SUBDIRECTORY(JavaOpenJPEG)
|
|
||||||
ENDIF(BUILD_JAVA)
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
SUBDIRS = codec
|
|
||||||
|
|
||||||
if WANT_MJ2
|
|
||||||
SUBDIRS += mj2
|
|
||||||
endif
|
|
||||||
|
|
||||||
if WANT_JPIP_CODE
|
|
||||||
SUBDIRS += jpip
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CMakeLists.txt \
|
|
||||||
common/color.c \
|
|
||||||
common/color.h \
|
|
||||||
common/format_defs.h \
|
|
||||||
common/opj_getopt.c \
|
|
||||||
common/opj_getopt.h
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
# Build the demo app, small examples
|
|
||||||
|
|
||||||
# First thing define the common source:
|
|
||||||
SET(common_SRCS
|
|
||||||
convert.c
|
|
||||||
converttif.c
|
|
||||||
convertbmp.c
|
|
||||||
convertpng.c
|
|
||||||
index.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/applications/common/color.c
|
|
||||||
)
|
|
||||||
if(NOT USE_SYSTEM_GETOPT)
|
|
||||||
list(APPEND common_SRCS
|
|
||||||
${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Headers file are located here:
|
|
||||||
INCLUDE_DIRECTORIES(
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
|
||||||
${LCMS_INCLUDE_DIRNAME}
|
|
||||||
${OPENJPEG_SOURCE_DIR}/applications/common
|
|
||||||
${Z_INCLUDE_DIRNAME}
|
|
||||||
${PNG_INCLUDE_DIRNAME}
|
|
||||||
${TIFF_INCLUDE_DIRNAME}
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(WIN32)
|
|
||||||
IF(BUILD_SHARED_LIBS)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
|
||||||
ELSE(BUILD_SHARED_LIBS)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
|
||||||
ENDIF(BUILD_SHARED_LIBS)
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
# Loop over all executables:
|
|
||||||
FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
|
|
||||||
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
|
||||||
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}
|
|
||||||
${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
|
|
||||||
)
|
|
||||||
# To support universal exe:
|
|
||||||
IF(ZLIB_FOUND AND APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(${exe} z)
|
|
||||||
ELSe(ZLIB_FOUND AND APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(${exe} ${Z_LIBNAME})
|
|
||||||
ENDIF(ZLIB_FOUND AND APPLE)
|
|
||||||
|
|
||||||
# On unix you need to link to the math library:
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(${exe} m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
# Install exe
|
|
||||||
INSTALL(TARGETS ${exe}
|
|
||||||
EXPORT OpenJPEGTargets
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
||||||
)
|
|
||||||
ENDFOREACH(exe)
|
|
||||||
|
|
||||||
# Install man pages
|
|
||||||
INSTALL(
|
|
||||||
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/image_to_j2k.1
|
|
||||||
${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_dump.1
|
|
||||||
${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_to_image.1
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
|
|
||||||
#
|
|
||||||
|
|
||||||
IF(BUILD_JPWL)
|
|
||||||
ADD_EXECUTABLE(JPWL_j2k_to_image
|
|
||||||
j2k_to_image.c
|
|
||||||
${common_SRCS}
|
|
||||||
)
|
|
||||||
|
|
||||||
SET_PROPERTY(
|
|
||||||
TARGET JPWL_j2k_to_image
|
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
|
|
||||||
)
|
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
|
|
||||||
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
|
||||||
|
|
||||||
# To support universal exe:
|
|
||||||
IF(ZLIB_FOUND AND APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image z)
|
|
||||||
ELSe(ZLIB_FOUND AND APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${Z_LIBNAME})
|
|
||||||
ENDIF(ZLIB_FOUND AND APPLE)
|
|
||||||
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(JPWL_image_to_j2k
|
|
||||||
image_to_j2k.c
|
|
||||||
${common_SRCS}
|
|
||||||
)
|
|
||||||
|
|
||||||
SET_PROPERTY(
|
|
||||||
TARGET JPWL_image_to_j2k
|
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
|
|
||||||
)
|
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL
|
|
||||||
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
|
||||||
|
|
||||||
# To support universal exe:
|
|
||||||
IF(ZLIB_FOUND AND APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k z)
|
|
||||||
ELSe(ZLIB_FOUND AND APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${Z_LIBNAME})
|
|
||||||
ENDIF(ZLIB_FOUND AND APPLE)
|
|
||||||
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
INSTALL(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
||||||
)
|
|
||||||
ENDIF(BUILD_JPWL)
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
bin_PROGRAMS = j2k_to_image image_to_j2k j2k_dump
|
|
||||||
|
|
||||||
if WANT_JPWL
|
|
||||||
bin_PROGRAMS += JPWL_j2k_to_image JPWL_image_to_j2k
|
|
||||||
endif
|
|
||||||
|
|
||||||
j2k_to_image_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/codec \
|
|
||||||
-I$(top_builddir)/applications/codec \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
@PNG_CFLAGS@ \
|
|
||||||
@TIFF_CFLAGS@ \
|
|
||||||
@LCMS1_CFLAGS@ \
|
|
||||||
@LCMS2_CFLAGS@
|
|
||||||
j2k_to_image_CFLAGS =
|
|
||||||
j2k_to_image_LDADD = $(top_builddir)/libopenjpeg/libopenjpeg.la @LCMS1_LIBS@ @LCMS2_LIBS@ @TIFF_LIBS@ @PNG_LIBS@ -lm
|
|
||||||
j2k_to_image_SOURCES = \
|
|
||||||
../common/color.c \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
convert.c \
|
|
||||||
index.c \
|
|
||||||
j2k_to_image.c \
|
|
||||||
../common/color.h
|
|
||||||
|
|
||||||
image_to_j2k_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/codec \
|
|
||||||
-I$(top_builddir)/applications/codec \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
@PNG_CFLAGS@ \
|
|
||||||
@TIFF_CFLAGS@
|
|
||||||
image_to_j2k_CFLAGS =
|
|
||||||
image_to_j2k_LDADD = $(top_builddir)/libopenjpeg/libopenjpeg.la @TIFF_LIBS@ @PNG_LIBS@ -lm
|
|
||||||
image_to_j2k_SOURCES = \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
convert.c \
|
|
||||||
index.c \
|
|
||||||
image_to_j2k.c \
|
|
||||||
convert.h \
|
|
||||||
../common/format_defs.h \
|
|
||||||
index.h
|
|
||||||
|
|
||||||
j2k_dump_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/codec \
|
|
||||||
-I$(top_builddir)/applications/codec \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg
|
|
||||||
j2k_dump_CFLAGS =
|
|
||||||
j2k_dump_LDADD = $(top_builddir)/libopenjpeg/libopenjpeg.la -lm
|
|
||||||
j2k_dump_SOURCES = \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
index.c \
|
|
||||||
j2k_dump.c \
|
|
||||||
../common/opj_getopt.h \
|
|
||||||
index.h
|
|
||||||
|
|
||||||
JPWL_j2k_to_image_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-DUSE_JPWL \
|
|
||||||
@TIFF_CFLAGS@ \
|
|
||||||
@PNG_CFLAGS@ \
|
|
||||||
@LCMS1_CFLAGS@ \
|
|
||||||
@LCMS2_CFLAGS@
|
|
||||||
JPWL_j2k_to_image_CFLAGS =
|
|
||||||
JPWL_j2k_to_image_LDADD = $(top_builddir)/libopenjpeg/jpwl/libopenjpeg_JPWL.la @LCMS1_LIBS@ @LCMS2_LIBS@ @TIFF_LIBS@ @PNG_LIBS@ -lm
|
|
||||||
JPWL_j2k_to_image_SOURCES = \
|
|
||||||
../common/color.c \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
index.c \
|
|
||||||
convert.c \
|
|
||||||
j2k_to_image.c
|
|
||||||
|
|
||||||
JPWL_image_to_j2k_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-DUSE_JPWL \
|
|
||||||
@TIFF_CFLAGS@ \
|
|
||||||
@PNG_CFLAGS@
|
|
||||||
JPWL_image_to_j2k_CFLAGS =
|
|
||||||
JPWL_image_to_j2k_LDADD = $(top_builddir)/libopenjpeg/jpwl/libopenjpeg_JPWL.la @TIFF_LIBS@ @PNG_LIBS@ -lm
|
|
||||||
|
|
||||||
JPWL_image_to_j2k_SOURCES = \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
index.c \
|
|
||||||
convert.c \
|
|
||||||
image_to_j2k.c
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CMakeLists.txt \
|
|
||||||
windirent.h
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
@echo -e " (B)\t$(bindir)/j2k_to_image$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/image_to_j2k$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/j2k_dump$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
if WANT_JPWL
|
|
||||||
@echo -e " (B)\t$(bindir)/JPWL_j2k_to_image$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/JPWL_image_to_j2k$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Simple codec compilation
|
|
||||||
------------------------
|
|
||||||
Once you've built the library, you might want to test it with a basic codec. To do this, go to the codec directory and either use the provided Makefile or use one of the following commands to build an encoder and decoder respectively:
|
|
||||||
|
|
||||||
gcc index.c convert.c image_to_j2k.c -o image_to_j2k -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
|
||||||
gcc index.c convert.c j2k_to_image.c -o j2k_to_image -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
|
||||||
|
|
||||||
You should add '-L..' to those lines if you did not use the 'install' target when building the library.
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,633 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_config.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#ifndef HAVE_LIBTIFF
|
|
||||||
# error HAVE_LIBTIFF_NOT_DEFINED
|
|
||||||
#endif /* HAVE_LIBTIFF */
|
|
||||||
|
|
||||||
#include <tiffio.h>
|
|
||||||
#include "openjpeg.h"
|
|
||||||
#include "convert.h"
|
|
||||||
|
|
||||||
/* -->> -->> -->> -->>
|
|
||||||
|
|
||||||
TIFF IMAGE FORMAT
|
|
||||||
|
|
||||||
<<-- <<-- <<-- <<-- */
|
|
||||||
|
|
||||||
static void tif_32sto10u(const int32* pSrc, uint8* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < (length & ~(size_t)3U); i+=4U) {
|
|
||||||
uint32 src0 = (uint32)pSrc[i+0];
|
|
||||||
uint32 src1 = (uint32)pSrc[i+1];
|
|
||||||
uint32 src2 = (uint32)pSrc[i+2];
|
|
||||||
uint32 src3 = (uint32)pSrc[i+3];
|
|
||||||
|
|
||||||
*pDst++ = (uint8)(src0 >> 2);
|
|
||||||
*pDst++ = (uint8)(((src0 & 0x3U) << 6) | (src1 >> 4));
|
|
||||||
*pDst++ = (uint8)(((src1 & 0xFU) << 4) | (src2 >> 6));
|
|
||||||
*pDst++ = (uint8)(((src2 & 0x3FU) << 2) | (src3 >> 8));
|
|
||||||
*pDst++ = (uint8)(src3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length & 3U) {
|
|
||||||
uint32 src0 = (uint32)pSrc[i+0];
|
|
||||||
uint32 src1 = 0U;
|
|
||||||
uint32 src2 = 0U;
|
|
||||||
length = length & 3U;
|
|
||||||
|
|
||||||
if (length > 1U) {
|
|
||||||
src1 = (uint32)pSrc[i+1];
|
|
||||||
if (length > 2U) {
|
|
||||||
src2 = (uint32)pSrc[i+2];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*pDst++ = (uint8)(src0 >> 2);
|
|
||||||
*pDst++ = (uint8)(((src0 & 0x3U) << 6) | (src1 >> 4));
|
|
||||||
if (length > 1U) {
|
|
||||||
*pDst++ = (uint8)(((src1 & 0xFU) << 4) | (src2 >> 6));
|
|
||||||
if (length > 2U) {
|
|
||||||
*pDst++ = (uint8)(((src2 & 0x3FU) << 2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void tif_32sto12u(const int32* pSrc, uint8* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < (length & ~(size_t)1U); i+=2U) {
|
|
||||||
uint32 src0 = (uint32)pSrc[i+0];
|
|
||||||
uint32 src1 = (uint32)pSrc[i+1];
|
|
||||||
|
|
||||||
*pDst++ = (uint8)(src0 >> 4);
|
|
||||||
*pDst++ = (uint8)(((src0 & 0xFU) << 4) | (src1 >> 8));
|
|
||||||
*pDst++ = (uint8)(src1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length & 1U) {
|
|
||||||
uint32 src0 = (uint32)pSrc[i+0];
|
|
||||||
*pDst++ = (uint8)(src0 >> 4);
|
|
||||||
*pDst++ = (uint8)(((src0 & 0xFU) << 4));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void tif_32sto14u(const int32* pSrc, uint8* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < (length & ~(size_t)3U); i+=4U) {
|
|
||||||
uint32 src0 = (uint32)pSrc[i+0];
|
|
||||||
uint32 src1 = (uint32)pSrc[i+1];
|
|
||||||
uint32 src2 = (uint32)pSrc[i+2];
|
|
||||||
uint32 src3 = (uint32)pSrc[i+3];
|
|
||||||
|
|
||||||
*pDst++ = (uint8)(src0 >> 6);
|
|
||||||
*pDst++ = (uint8)(((src0 & 0x3FU) << 2) | (src1 >> 12));
|
|
||||||
*pDst++ = (uint8)(src1 >> 4);
|
|
||||||
*pDst++ = (uint8)(((src1 & 0xFU) << 4) | (src2 >> 10));
|
|
||||||
*pDst++ = (uint8)(src2 >> 2);
|
|
||||||
*pDst++ = (uint8)(((src2 & 0x3U) << 6) | (src3 >> 8));
|
|
||||||
*pDst++ = (uint8)(src3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length & 3U) {
|
|
||||||
uint32 src0 = (uint32)pSrc[i+0];
|
|
||||||
uint32 src1 = 0U;
|
|
||||||
uint32 src2 = 0U;
|
|
||||||
length = length & 3U;
|
|
||||||
|
|
||||||
if (length > 1U) {
|
|
||||||
src1 = (uint32)pSrc[i+1];
|
|
||||||
if (length > 2U) {
|
|
||||||
src2 = (uint32)pSrc[i+2];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*pDst++ = (uint8)(src0 >> 6);
|
|
||||||
*pDst++ = (uint8)(((src0 & 0x3FU) << 2) | (src1 >> 12));
|
|
||||||
if (length > 1U) {
|
|
||||||
*pDst++ = (uint8)(src1 >> 4);
|
|
||||||
*pDst++ = (uint8)(((src1 & 0xFU) << 4) | (src2 >> 10));
|
|
||||||
if (length > 2U) {
|
|
||||||
*pDst++ = (uint8)(src2 >> 2);
|
|
||||||
*pDst++ = (uint8)(((src2 & 0x3U) << 6));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void tif_32sto16u(const int32* pSrc, uint16* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < length; ++i) {
|
|
||||||
pDst[i] = (uint16)pSrc[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int imagetotif(opj_image_t * image, const char *outfile)
|
|
||||||
{
|
|
||||||
int width, height;
|
|
||||||
int bps,adjust, sgnd;
|
|
||||||
int tiPhoto;
|
|
||||||
TIFF *tif;
|
|
||||||
tdata_t buf;
|
|
||||||
tsize_t strip_size;
|
|
||||||
int32 i, numcomps;
|
|
||||||
size_t rowStride;
|
|
||||||
int32* buffer32s = NULL;
|
|
||||||
int32 const* planes[4];
|
|
||||||
convert_32s_PXCX cvtPxToCx = NULL;
|
|
||||||
convert_32sXXx_C1R cvt32sToTif = NULL;
|
|
||||||
|
|
||||||
bps = image->comps[0].prec;
|
|
||||||
planes[0] = image->comps[0].data;
|
|
||||||
|
|
||||||
numcomps = image->numcomps;
|
|
||||||
|
|
||||||
if (numcomps > 2) {
|
|
||||||
tiPhoto = PHOTOMETRIC_RGB;
|
|
||||||
if (numcomps > 4) {
|
|
||||||
numcomps = 4;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tiPhoto = PHOTOMETRIC_MINISBLACK;
|
|
||||||
}
|
|
||||||
for (i = 1; i < numcomps; ++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 != numcomps) {
|
|
||||||
fprintf(stderr,"imagetotif: All components shall have the same subsampling, same bit depth.\n");
|
|
||||||
fprintf(stderr,"\tAborting\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((bps > 16) || ((bps != 1) && (bps & 1))) bps = 0;
|
|
||||||
if(bps == 0)
|
|
||||||
{
|
|
||||||
fprintf(stderr,"imagetotif: Bits=%d, Only 1, 2, 4, 6, 8, 10, 12, 14 and 16 bits implemented\n",bps);
|
|
||||||
fprintf(stderr,"\tAborting\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
tif = TIFFOpen(outfile, "wb");
|
|
||||||
if (!tif)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "imagetotif:failed to open %s for writing\n", outfile);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
for (i = 0; i < numcomps; ++i) {
|
|
||||||
clip_component(&(image->comps[i]), image->comps[0].prec);
|
|
||||||
}
|
|
||||||
cvtPxToCx = convert_32s_PXCX_LUT[numcomps];
|
|
||||||
switch (bps) {
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
case 4:
|
|
||||||
case 6:
|
|
||||||
case 8:
|
|
||||||
cvt32sToTif = convert_32sXXu_C1R_LUT[bps];
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
cvt32sToTif = tif_32sto10u;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
cvt32sToTif = tif_32sto12u;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
cvt32sToTif = tif_32sto14u;
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
cvt32sToTif = (convert_32sXXx_C1R)tif_32sto16u;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* never here */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
sgnd = (int)image->comps[0].sgnd;
|
|
||||||
adjust = sgnd ? 1 << (image->comps[0].prec - 1) : 0;
|
|
||||||
width = (int)image->comps[0].w;
|
|
||||||
height = (int)image->comps[0].h;
|
|
||||||
|
|
||||||
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width);
|
|
||||||
TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height);
|
|
||||||
TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, numcomps);
|
|
||||||
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps);
|
|
||||||
TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
|
|
||||||
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
|
|
||||||
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, tiPhoto);
|
|
||||||
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
|
|
||||||
|
|
||||||
strip_size = TIFFStripSize(tif);
|
|
||||||
rowStride = ((size_t)width * numcomps * (size_t)bps + 7U) / 8U;
|
|
||||||
if (rowStride != (size_t)strip_size) {
|
|
||||||
fprintf(stderr, "Invalid TIFF strip size\n");
|
|
||||||
TIFFClose(tif);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
buf = _TIFFmalloc(strip_size);
|
|
||||||
if (buf == NULL) {
|
|
||||||
TIFFClose(tif);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
buffer32s = (int32 *)malloc((size_t)width * numcomps * sizeof(int32));
|
|
||||||
if (buffer32s == NULL) {
|
|
||||||
_TIFFfree(buf);
|
|
||||||
TIFFClose(tif);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < image->comps[0].h; ++i) {
|
|
||||||
cvtPxToCx(planes, buffer32s, (size_t)width, adjust);
|
|
||||||
cvt32sToTif(buffer32s, (uint8 *)buf, (size_t)width * numcomps);
|
|
||||||
(void)TIFFWriteEncodedStrip(tif, i, (void*)buf, strip_size);
|
|
||||||
planes[0] += width;
|
|
||||||
planes[1] += width;
|
|
||||||
planes[2] += width;
|
|
||||||
planes[3] += width;
|
|
||||||
}
|
|
||||||
_TIFFfree((void*)buf);
|
|
||||||
TIFFClose(tif);
|
|
||||||
free(buffer32s);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}/* imagetotif() */
|
|
||||||
|
|
||||||
static void tif_10uto32s(const uint8* pSrc, int32* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < (length & ~(size_t)3U); i+=4U) {
|
|
||||||
uint32 val0 = *pSrc++;
|
|
||||||
uint32 val1 = *pSrc++;
|
|
||||||
uint32 val2 = *pSrc++;
|
|
||||||
uint32 val3 = *pSrc++;
|
|
||||||
uint32 val4 = *pSrc++;
|
|
||||||
|
|
||||||
pDst[i+0] = (int32)((val0 << 2) | (val1 >> 6));
|
|
||||||
pDst[i+1] = (int32)(((val1 & 0x3FU) << 4) | (val2 >> 4));
|
|
||||||
pDst[i+2] = (int32)(((val2 & 0xFU) << 6) | (val3 >> 2));
|
|
||||||
pDst[i+3] = (int32)(((val3 & 0x3U) << 8) | val4);
|
|
||||||
|
|
||||||
}
|
|
||||||
if (length & 3U) {
|
|
||||||
uint32 val0 = *pSrc++;
|
|
||||||
uint32 val1 = *pSrc++;
|
|
||||||
length = length & 3U;
|
|
||||||
pDst[i+0] = (int32)((val0 << 2) | (val1 >> 6));
|
|
||||||
|
|
||||||
if (length > 1U) {
|
|
||||||
uint32 val2 = *pSrc++;
|
|
||||||
pDst[i+1] = (int32)(((val1 & 0x3FU) << 4) | (val2 >> 4));
|
|
||||||
if (length > 2U) {
|
|
||||||
uint32 val3 = *pSrc++;
|
|
||||||
pDst[i+2] = (int32)(((val2 & 0xFU) << 6) | (val3 >> 2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void tif_12uto32s(const uint8* pSrc, int32* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < (length & ~(size_t)1U); i+=2U) {
|
|
||||||
uint32 val0 = *pSrc++;
|
|
||||||
uint32 val1 = *pSrc++;
|
|
||||||
uint32 val2 = *pSrc++;
|
|
||||||
|
|
||||||
pDst[i+0] = (int32)((val0 << 4) | (val1 >> 4));
|
|
||||||
pDst[i+1] = (int32)(((val1 & 0xFU) << 8) | val2);
|
|
||||||
}
|
|
||||||
if (length & 1U) {
|
|
||||||
uint32 val0 = *pSrc++;
|
|
||||||
uint32 val1 = *pSrc++;
|
|
||||||
pDst[i+0] = (int32)((val0 << 4) | (val1 >> 4));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void tif_14uto32s(const uint8* pSrc, int32* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < (length & ~(size_t)3U); i+=4U) {
|
|
||||||
uint32 val0 = *pSrc++;
|
|
||||||
uint32 val1 = *pSrc++;
|
|
||||||
uint32 val2 = *pSrc++;
|
|
||||||
uint32 val3 = *pSrc++;
|
|
||||||
uint32 val4 = *pSrc++;
|
|
||||||
uint32 val5 = *pSrc++;
|
|
||||||
uint32 val6 = *pSrc++;
|
|
||||||
|
|
||||||
pDst[i+0] = (int32)((val0 << 6) | (val1 >> 2));
|
|
||||||
pDst[i+1] = (int32)(((val1 & 0x3U) << 12) | (val2 << 4) | (val3 >> 4));
|
|
||||||
pDst[i+2] = (int32)(((val3 & 0xFU) << 10) | (val4 << 2) | (val5 >> 6));
|
|
||||||
pDst[i+3] = (int32)(((val5 & 0x3FU) << 8) | val6);
|
|
||||||
|
|
||||||
}
|
|
||||||
if (length & 3U) {
|
|
||||||
uint32 val0 = *pSrc++;
|
|
||||||
uint32 val1 = *pSrc++;
|
|
||||||
length = length & 3U;
|
|
||||||
pDst[i+0] = (int32)((val0 << 6) | (val1 >> 2));
|
|
||||||
|
|
||||||
if (length > 1U) {
|
|
||||||
uint32 val2 = *pSrc++;
|
|
||||||
uint32 val3 = *pSrc++;
|
|
||||||
pDst[i+1] = (int32)(((val1 & 0x3U) << 12) | (val2 << 4) | (val3 >> 4));
|
|
||||||
if (length > 2U) {
|
|
||||||
uint32 val4 = *pSrc++;
|
|
||||||
uint32 val5 = *pSrc++;
|
|
||||||
pDst[i+2] = (int32)(((val3 & 0xFU) << 10) | (val4 << 2) | (val5 >> 6));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* seems that libtiff decodes this to machine endianness */
|
|
||||||
static void tif_16uto32s(const uint16* pSrc, int32* pDst, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < length; i++) {
|
|
||||||
pDst[i] = pSrc[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* libtiff/tif_getimage.c : 1,2,4,8,16 bitspersample accepted
|
|
||||||
* CINEMA : 12 bit precision
|
|
||||||
*/
|
|
||||||
opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
|
|
||||||
{
|
|
||||||
int subsampling_dx = parameters->subsampling_dx;
|
|
||||||
int subsampling_dy = parameters->subsampling_dy;
|
|
||||||
TIFF *tif;
|
|
||||||
tdata_t buf;
|
|
||||||
tstrip_t strip;
|
|
||||||
tsize_t strip_size;
|
|
||||||
int j, currentPlane, numcomps = 0, w, h;
|
|
||||||
OPJ_COLOR_SPACE color_space = CLRSPC_UNKNOWN;
|
|
||||||
opj_image_cmptparm_t cmptparm[4]; /* RGBA */
|
|
||||||
opj_image_t *image = NULL;
|
|
||||||
int has_alpha = 0;
|
|
||||||
unsigned short tiBps, tiPhoto, tiSf, tiSpp, tiPC;
|
|
||||||
unsigned int tiWidth, tiHeight;
|
|
||||||
opj_bool is_cinema = (parameters->cp_cinema != OFF) ? OPJ_TRUE : OPJ_FALSE;
|
|
||||||
convert_XXx32s_C1R cvtTifTo32s = NULL;
|
|
||||||
convert_32s_CXPX cvtCxToPx = NULL;
|
|
||||||
int32* buffer32s = NULL;
|
|
||||||
int32* planes[4];
|
|
||||||
size_t rowStride;
|
|
||||||
|
|
||||||
tif = TIFFOpen(filename, "r");
|
|
||||||
|
|
||||||
if(!tif)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "tiftoimage:Failed to open %s for reading\n", filename);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
tiBps = tiPhoto = tiSf = tiSpp = tiPC = 0;
|
|
||||||
tiWidth = tiHeight = 0;
|
|
||||||
|
|
||||||
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &tiWidth);
|
|
||||||
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &tiHeight);
|
|
||||||
TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &tiBps);
|
|
||||||
TIFFGetField(tif, TIFFTAG_SAMPLEFORMAT, &tiSf);
|
|
||||||
TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &tiSpp);
|
|
||||||
TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &tiPhoto);
|
|
||||||
TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &tiPC);
|
|
||||||
w= (int)tiWidth;
|
|
||||||
h= (int)tiHeight;
|
|
||||||
|
|
||||||
if((tiBps > 16U) || ((tiBps != 1U) && (tiBps & 1U))) {
|
|
||||||
fprintf(stderr,"tiftoimage: Bits=%d, Only 1, 2, 4, 6, 8, 10, 12, 14 and 16 bits implemented\n",tiBps);
|
|
||||||
fprintf(stderr,"\tAborting\n");
|
|
||||||
TIFFClose(tif);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if(tiPhoto != PHOTOMETRIC_MINISBLACK && tiPhoto != PHOTOMETRIC_RGB) {
|
|
||||||
fprintf(stderr,"tiftoimage: Bad color format %d.\n\tOnly RGB(A) and GRAY(A) has been implemented\n",(int) tiPhoto);
|
|
||||||
fprintf(stderr,"\tAborting\n");
|
|
||||||
TIFFClose(tif);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (tiBps) {
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
case 4:
|
|
||||||
case 6:
|
|
||||||
case 8:
|
|
||||||
cvtTifTo32s = convert_XXu32s_C1R_LUT[tiBps];
|
|
||||||
break;
|
|
||||||
/* others are specific to TIFF */
|
|
||||||
case 10:
|
|
||||||
cvtTifTo32s = tif_10uto32s;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
cvtTifTo32s = tif_12uto32s;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
cvtTifTo32s = tif_14uto32s;
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
cvtTifTo32s = (convert_XXx32s_C1R)tif_16uto32s;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* never here */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
{/* From: tiff-4.0.x/libtiff/tif_getimage.c : */
|
|
||||||
uint16* sampleinfo;
|
|
||||||
uint16 extrasamples;
|
|
||||||
|
|
||||||
TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES,
|
|
||||||
&extrasamples, &sampleinfo);
|
|
||||||
|
|
||||||
if(extrasamples >= 1)
|
|
||||||
{
|
|
||||||
switch(sampleinfo[0])
|
|
||||||
{
|
|
||||||
case EXTRASAMPLE_UNSPECIFIED:
|
|
||||||
/* Workaround for some images without correct info about alpha channel
|
|
||||||
*/
|
|
||||||
if(tiSpp > 3)
|
|
||||||
has_alpha = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EXTRASAMPLE_ASSOCALPHA: /* data pre-multiplied */
|
|
||||||
case EXTRASAMPLE_UNASSALPHA: /* data not pre-multiplied */
|
|
||||||
has_alpha = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else /* extrasamples == 0 */
|
|
||||||
if(tiSpp == 4 || tiSpp == 2) has_alpha = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize image components */
|
|
||||||
memset(&cmptparm[0], 0, 4 * sizeof(opj_image_cmptparm_t));
|
|
||||||
|
|
||||||
if ((tiPhoto == PHOTOMETRIC_RGB) && (is_cinema) && (tiBps != 12U)) {
|
|
||||||
fprintf(stdout,"WARNING:\n"
|
|
||||||
"Input image bitdepth is %d bits\n"
|
|
||||||
"TIF conversion has automatically rescaled to 12-bits\n"
|
|
||||||
"to comply with cinema profiles.\n",
|
|
||||||
tiBps);
|
|
||||||
} else {
|
|
||||||
is_cinema = 0U;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(tiPhoto == PHOTOMETRIC_RGB) /* RGB(A) */
|
|
||||||
{
|
|
||||||
numcomps = 3 + has_alpha;
|
|
||||||
color_space = CLRSPC_SRGB;
|
|
||||||
}
|
|
||||||
else if (tiPhoto == PHOTOMETRIC_MINISBLACK) /* GRAY(A) */
|
|
||||||
{
|
|
||||||
numcomps = 1 + has_alpha;
|
|
||||||
color_space = CLRSPC_GRAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
cvtCxToPx = convert_32s_CXPX_LUT[numcomps];
|
|
||||||
if (tiPC == PLANARCONFIG_SEPARATE) {
|
|
||||||
cvtCxToPx = convert_32s_CXPX_LUT[1]; /* override */
|
|
||||||
tiSpp = 1U; /* consider only one sample per plane */
|
|
||||||
}
|
|
||||||
|
|
||||||
for(j = 0; j < numcomps; j++)
|
|
||||||
{
|
|
||||||
cmptparm[j].prec = tiBps;
|
|
||||||
cmptparm[j].bpp = tiBps;
|
|
||||||
cmptparm[j].dx = (uint32)subsampling_dx;
|
|
||||||
cmptparm[j].dy = (uint32)subsampling_dy;
|
|
||||||
cmptparm[j].w = (uint32)w;
|
|
||||||
cmptparm[j].h = (uint32)h;
|
|
||||||
}
|
|
||||||
|
|
||||||
image = opj_image_create((uint32)numcomps, &cmptparm[0], color_space);
|
|
||||||
if(!image)
|
|
||||||
{
|
|
||||||
TIFFClose(tif);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
/* set image offset and reference grid */
|
|
||||||
image->x0 = (uint32)parameters->image_offset_x0;
|
|
||||||
image->y0 = (uint32)parameters->image_offset_y0;
|
|
||||||
image->x1 = !image->x0 ? (uint32)(w - 1) * (uint32)subsampling_dx + 1 :
|
|
||||||
image->x0 + (uint32)(w - 1) * (uint32)subsampling_dx + 1;
|
|
||||||
image->y1 = !image->y0 ? (uint32)(h - 1) * (uint32)subsampling_dy + 1 :
|
|
||||||
image->y0 + (uint32)(h - 1) * (uint32)subsampling_dy + 1;
|
|
||||||
|
|
||||||
for(j = 0; j < numcomps; j++)
|
|
||||||
{
|
|
||||||
planes[j] = image->comps[j].data;
|
|
||||||
}
|
|
||||||
/* image->comps[numcomps - 1].alpha = (uint16)(1 - (numcomps & 1)); */
|
|
||||||
|
|
||||||
strip_size = TIFFStripSize(tif);
|
|
||||||
|
|
||||||
buf = _TIFFmalloc(strip_size);
|
|
||||||
if (buf == NULL) {
|
|
||||||
TIFFClose(tif);
|
|
||||||
opj_image_destroy(image);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
rowStride = ((size_t)w * tiSpp * tiBps + 7U) / 8U;
|
|
||||||
buffer32s = (int32 *)malloc((size_t)w * tiSpp * sizeof(int32));
|
|
||||||
if (buffer32s == NULL) {
|
|
||||||
_TIFFfree(buf);
|
|
||||||
TIFFClose(tif);
|
|
||||||
opj_image_destroy(image);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
strip = 0;
|
|
||||||
currentPlane = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
planes[0] = image->comps[currentPlane].data; /* to manage planar data */
|
|
||||||
h= (int)tiHeight;
|
|
||||||
/* Read the Image components */
|
|
||||||
for(; (h > 0) && (strip < TIFFNumberOfStrips(tif)); strip++)
|
|
||||||
{
|
|
||||||
const uint8 *dat8;
|
|
||||||
size_t ssize;
|
|
||||||
|
|
||||||
ssize = (size_t)TIFFReadEncodedStrip(tif, strip, buf, strip_size);
|
|
||||||
dat8 = (const uint8*)buf;
|
|
||||||
|
|
||||||
while (ssize >= rowStride) {
|
|
||||||
cvtTifTo32s(dat8, buffer32s, (size_t)w * tiSpp);
|
|
||||||
cvtCxToPx(buffer32s, planes, (size_t)w);
|
|
||||||
planes[0] += w;
|
|
||||||
planes[1] += w;
|
|
||||||
planes[2] += w;
|
|
||||||
planes[3] += w;
|
|
||||||
dat8 += rowStride;
|
|
||||||
ssize -= rowStride;
|
|
||||||
h--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
currentPlane++;
|
|
||||||
} while ((tiPC == PLANARCONFIG_SEPARATE) && (currentPlane < numcomps));
|
|
||||||
|
|
||||||
free(buffer32s);
|
|
||||||
_TIFFfree(buf);
|
|
||||||
TIFFClose(tif);
|
|
||||||
|
|
||||||
if (is_cinema) {
|
|
||||||
for (j=0; j < numcomps; ++j) {
|
|
||||||
scale_component(&(image->comps[j]), 12);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return image;
|
|
||||||
|
|
||||||
}/* tiftoimage() */
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,537 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
|
||||||
* Copyright (c) 2002-2007, 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) 2005, Herve Drolon, FreeImage Team
|
|
||||||
* 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 <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "opj_config.h"
|
|
||||||
#include "openjpeg.h"
|
|
||||||
#include "color.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBLCMS2
|
|
||||||
#include <lcms2.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_LIBLCMS1
|
|
||||||
#include <lcms.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*--------------------------------------------------------
|
|
||||||
Matrix for sYCC, Amendment 1 to IEC 61966-2-1
|
|
||||||
|
|
||||||
Y : 0.299 0.587 0.114 :R
|
|
||||||
Cb: -0.1687 -0.3312 0.5 :G
|
|
||||||
Cr: 0.5 -0.4187 -0.0812 :B
|
|
||||||
|
|
||||||
Inverse:
|
|
||||||
|
|
||||||
R: 1 -3.68213e-05 1.40199 :Y
|
|
||||||
G: 1.00003 -0.344125 -0.714128 :Cb - 2^(prec - 1)
|
|
||||||
B: 0.999823 1.77204 -8.04142e-06 :Cr - 2^(prec - 1)
|
|
||||||
|
|
||||||
-----------------------------------------------------------*/
|
|
||||||
static void sycc_to_rgb(int offset, int upb, int y, int cb, int cr,
|
|
||||||
int *out_r, int *out_g, int *out_b)
|
|
||||||
{
|
|
||||||
int r, g, b;
|
|
||||||
|
|
||||||
cb -= offset; cr -= offset;
|
|
||||||
r = y + (int)(1.402 * (float)cr);
|
|
||||||
if(r < 0) r = 0; else if(r > upb) r = upb; *out_r = r;
|
|
||||||
|
|
||||||
g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr);
|
|
||||||
if(g < 0) g = 0; else if(g > upb) g = upb; *out_g = g;
|
|
||||||
|
|
||||||
b = y + (int)(1.772 * (float)cb);
|
|
||||||
if(b < 0) b = 0; else if(b > upb) b = upb; *out_b = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sycc444_to_rgb(opj_image_t *img)
|
|
||||||
{
|
|
||||||
int *d0, *d1, *d2, *r, *g, *b;
|
|
||||||
const int *y, *cb, *cr;
|
|
||||||
unsigned int maxw, maxh, max, i;
|
|
||||||
int offset, upb;
|
|
||||||
|
|
||||||
upb = (int)img->comps[0].prec;
|
|
||||||
offset = 1<<(upb - 1); upb = (1<<upb)-1;
|
|
||||||
|
|
||||||
maxw = (unsigned int)img->comps[0].w; maxh = (unsigned int)img->comps[0].h;
|
|
||||||
max = maxw * maxh;
|
|
||||||
|
|
||||||
y = img->comps[0].data;
|
|
||||||
cb = img->comps[1].data;
|
|
||||||
cr = img->comps[2].data;
|
|
||||||
|
|
||||||
d0 = r = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
d1 = g = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
d2 = b = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
|
|
||||||
for(i = 0U; i < max; ++i)
|
|
||||||
{
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++cb; ++cr; ++r; ++g; ++b;
|
|
||||||
}
|
|
||||||
free(img->comps[0].data); img->comps[0].data = d0;
|
|
||||||
free(img->comps[1].data); img->comps[1].data = d1;
|
|
||||||
free(img->comps[2].data); img->comps[2].data = d2;
|
|
||||||
|
|
||||||
}/* sycc444_to_rgb() */
|
|
||||||
|
|
||||||
static void sycc422_to_rgb(opj_image_t *img)
|
|
||||||
{
|
|
||||||
int *d0, *d1, *d2, *r, *g, *b;
|
|
||||||
const int *y, *cb, *cr;
|
|
||||||
unsigned int maxw, maxh, max;
|
|
||||||
int offset, upb;
|
|
||||||
unsigned int i, j;
|
|
||||||
|
|
||||||
upb = (int)img->comps[0].prec;
|
|
||||||
offset = 1<<(upb - 1); upb = (1<<upb)-1;
|
|
||||||
|
|
||||||
maxw = (unsigned int)img->comps[0].w; maxh = (unsigned int)img->comps[0].h;
|
|
||||||
max = maxw * maxh;
|
|
||||||
|
|
||||||
y = img->comps[0].data;
|
|
||||||
cb = img->comps[1].data;
|
|
||||||
cr = img->comps[2].data;
|
|
||||||
|
|
||||||
d0 = r = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
d1 = g = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
d2 = b = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
|
|
||||||
for(i=0U; i < maxh; ++i)
|
|
||||||
{
|
|
||||||
for(j=0U; j < (maxw & ~(unsigned int)1U); j += 2U)
|
|
||||||
{
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++r; ++g; ++b;
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++r; ++g; ++b; ++cb; ++cr;
|
|
||||||
}
|
|
||||||
if (j < maxw) {
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++r; ++g; ++b; ++cb; ++cr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free(img->comps[0].data); img->comps[0].data = d0;
|
|
||||||
free(img->comps[1].data); img->comps[1].data = d1;
|
|
||||||
free(img->comps[2].data); img->comps[2].data = d2;
|
|
||||||
|
|
||||||
img->comps[1].w = maxw; img->comps[1].h = maxh;
|
|
||||||
img->comps[2].w = maxw; img->comps[2].h = maxh;
|
|
||||||
img->comps[1].dx = img->comps[0].dx;
|
|
||||||
img->comps[2].dx = img->comps[0].dx;
|
|
||||||
img->comps[1].dy = img->comps[0].dy;
|
|
||||||
img->comps[2].dy = img->comps[0].dy;
|
|
||||||
}/* sycc422_to_rgb() */
|
|
||||||
|
|
||||||
static void sycc420_to_rgb(opj_image_t *img)
|
|
||||||
{
|
|
||||||
int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb;
|
|
||||||
const int *y, *cb, *cr, *ny;
|
|
||||||
unsigned int maxw, maxh, max;
|
|
||||||
int offset, upb;
|
|
||||||
unsigned int i, j;
|
|
||||||
|
|
||||||
upb = (int)img->comps[0].prec;
|
|
||||||
offset = 1<<(upb - 1); upb = (1<<upb)-1;
|
|
||||||
|
|
||||||
maxw = (unsigned int)img->comps[0].w; maxh = (unsigned int)img->comps[0].h;
|
|
||||||
max = maxw * maxh;
|
|
||||||
|
|
||||||
y = img->comps[0].data;
|
|
||||||
cb = img->comps[1].data;
|
|
||||||
cr = img->comps[2].data;
|
|
||||||
|
|
||||||
d0 = r = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
d1 = g = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
d2 = b = (int*)malloc(sizeof(int) * (size_t)max);
|
|
||||||
|
|
||||||
for(i=0U; i < (maxh & ~(unsigned int)1U); i += 2U)
|
|
||||||
{
|
|
||||||
ny = y + maxw;
|
|
||||||
nr = r + maxw; ng = g + maxw; nb = b + maxw;
|
|
||||||
|
|
||||||
for(j=0; j < (maxw & ~(unsigned int)1U); j += 2U)
|
|
||||||
{
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++r; ++g; ++b;
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++r; ++g; ++b;
|
|
||||||
|
|
||||||
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
|
||||||
++ny; ++nr; ++ng; ++nb;
|
|
||||||
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
|
||||||
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
|
|
||||||
}
|
|
||||||
if(j < maxw)
|
|
||||||
{
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
++y; ++r; ++g; ++b;
|
|
||||||
|
|
||||||
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
|
||||||
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
|
|
||||||
}
|
|
||||||
y += maxw; r += maxw; g += maxw; b += maxw;
|
|
||||||
}
|
|
||||||
if(i < maxh)
|
|
||||||
{
|
|
||||||
for(j=0U; j < (maxw & ~(unsigned int)1U); j += 2U)
|
|
||||||
{
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
|
|
||||||
++y; ++r; ++g; ++b;
|
|
||||||
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
|
|
||||||
++y; ++r; ++g; ++b; ++cb; ++cr;
|
|
||||||
}
|
|
||||||
if(j < maxw)
|
|
||||||
{
|
|
||||||
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
free(img->comps[0].data); img->comps[0].data = d0;
|
|
||||||
free(img->comps[1].data); img->comps[1].data = d1;
|
|
||||||
free(img->comps[2].data); img->comps[2].data = d2;
|
|
||||||
|
|
||||||
img->comps[1].w = maxw; img->comps[1].h = maxh;
|
|
||||||
img->comps[2].w = maxw; img->comps[2].h = maxh;
|
|
||||||
img->comps[1].dx = img->comps[0].dx;
|
|
||||||
img->comps[2].dx = img->comps[0].dx;
|
|
||||||
img->comps[1].dy = img->comps[0].dy;
|
|
||||||
img->comps[2].dy = img->comps[0].dy;
|
|
||||||
|
|
||||||
}/* sycc420_to_rgb() */
|
|
||||||
|
|
||||||
void color_sycc_to_rgb(opj_image_t *img)
|
|
||||||
{
|
|
||||||
if(img->numcomps < 3)
|
|
||||||
{
|
|
||||||
img->color_space = CLRSPC_GRAY;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((img->comps[0].dx == 1)
|
|
||||||
&& (img->comps[1].dx == 2)
|
|
||||||
&& (img->comps[2].dx == 2)
|
|
||||||
&& (img->comps[0].dy == 1)
|
|
||||||
&& (img->comps[1].dy == 2)
|
|
||||||
&& (img->comps[2].dy == 2))/* horizontal and vertical sub-sample */
|
|
||||||
{
|
|
||||||
sycc420_to_rgb(img);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if((img->comps[0].dx == 1)
|
|
||||||
&& (img->comps[1].dx == 2)
|
|
||||||
&& (img->comps[2].dx == 2)
|
|
||||||
&& (img->comps[0].dy == 1)
|
|
||||||
&& (img->comps[1].dy == 1)
|
|
||||||
&& (img->comps[2].dy == 1))/* horizontal sub-sample only */
|
|
||||||
{
|
|
||||||
sycc422_to_rgb(img);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if((img->comps[0].dx == 1)
|
|
||||||
&& (img->comps[1].dx == 1)
|
|
||||||
&& (img->comps[2].dx == 1)
|
|
||||||
&& (img->comps[0].dy == 1)
|
|
||||||
&& (img->comps[1].dy == 1)
|
|
||||||
&& (img->comps[2].dy == 1))/* no sub-sample */
|
|
||||||
{
|
|
||||||
sycc444_to_rgb(img);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fprintf(stderr,"%s:%d:color_sycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
img->color_space = CLRSPC_SRGB;
|
|
||||||
|
|
||||||
}/* color_sycc_to_rgb() */
|
|
||||||
|
|
||||||
#if defined(HAVE_LIBLCMS2) || defined(HAVE_LIBLCMS1)
|
|
||||||
#ifdef HAVE_LIBLCMS1
|
|
||||||
/* Bob Friesenhahn proposed:*/
|
|
||||||
#define cmsSigXYZData icSigXYZData
|
|
||||||
#define cmsSigLabData icSigLabData
|
|
||||||
#define cmsSigCmykData icSigCmykData
|
|
||||||
#define cmsSigYCbCrData icSigYCbCrData
|
|
||||||
#define cmsSigLuvData icSigLuvData
|
|
||||||
#define cmsSigGrayData icSigGrayData
|
|
||||||
#define cmsSigRgbData icSigRgbData
|
|
||||||
#define cmsUInt32Number DWORD
|
|
||||||
|
|
||||||
#define cmsColorSpaceSignature icColorSpaceSignature
|
|
||||||
#define cmsGetHeaderRenderingIntent cmsTakeRenderingIntent
|
|
||||||
|
|
||||||
#endif /* HAVE_LIBLCMS1 */
|
|
||||||
|
|
||||||
void color_apply_icc_profile(opj_image_t *image)
|
|
||||||
{
|
|
||||||
cmsHPROFILE in_prof, out_prof;
|
|
||||||
cmsHTRANSFORM transform;
|
|
||||||
cmsColorSpaceSignature in_space, out_space;
|
|
||||||
cmsUInt32Number intent, in_type, out_type, nr_samples;
|
|
||||||
int *r, *g, *b;
|
|
||||||
int prec, i, max, max_w, max_h;
|
|
||||||
OPJ_COLOR_SPACE oldspace;
|
|
||||||
|
|
||||||
in_prof =
|
|
||||||
cmsOpenProfileFromMem(image->icc_profile_buf, image->icc_profile_len);
|
|
||||||
#ifdef DEBUG_PROFILE
|
|
||||||
FILE *icm = fopen("debug.icm","wb");
|
|
||||||
fwrite( image->icc_profile_buf,1, image->icc_profile_len,icm);
|
|
||||||
fclose(icm);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(in_prof == NULL) return;
|
|
||||||
|
|
||||||
in_space = cmsGetPCS(in_prof);
|
|
||||||
out_space = cmsGetColorSpace(in_prof);
|
|
||||||
intent = cmsGetHeaderRenderingIntent(in_prof);
|
|
||||||
|
|
||||||
|
|
||||||
max_w = (int)image->comps[0].w;
|
|
||||||
max_h = (int)image->comps[0].h;
|
|
||||||
prec = (int)image->comps[0].prec;
|
|
||||||
oldspace = image->color_space;
|
|
||||||
|
|
||||||
if(out_space == cmsSigRgbData) /* enumCS 16 */
|
|
||||||
{
|
|
||||||
if( prec <= 8 )
|
|
||||||
{
|
|
||||||
in_type = TYPE_RGB_8;
|
|
||||||
out_type = TYPE_RGB_8;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
in_type = TYPE_RGB_16;
|
|
||||||
out_type = TYPE_RGB_16;
|
|
||||||
}
|
|
||||||
out_prof = cmsCreate_sRGBProfile();
|
|
||||||
image->color_space = CLRSPC_SRGB;
|
|
||||||
}
|
|
||||||
else if(out_space == cmsSigGrayData) /* enumCS 17 */
|
|
||||||
{
|
|
||||||
in_type = TYPE_GRAY_8;
|
|
||||||
out_type = TYPE_RGB_8;
|
|
||||||
out_prof = cmsCreate_sRGBProfile();
|
|
||||||
image->color_space = CLRSPC_SRGB;
|
|
||||||
}
|
|
||||||
else if(out_space == cmsSigYCbCrData) /* enumCS 18 */
|
|
||||||
{
|
|
||||||
in_type = TYPE_YCbCr_16;
|
|
||||||
out_type = TYPE_RGB_16;
|
|
||||||
out_prof = cmsCreate_sRGBProfile();
|
|
||||||
image->color_space = CLRSPC_SRGB;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_PROFILE
|
|
||||||
fprintf(stderr,"%s:%d: color_apply_icc_profile\n\tICC Profile has unknown "
|
|
||||||
"output colorspace(%#x)(%c%c%c%c)\n\tICC Profile ignored.\n",
|
|
||||||
__FILE__,__LINE__,out_space,
|
|
||||||
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
|
|
||||||
(out_space>>8) & 0xff, out_space & 0xff);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_PROFILE
|
|
||||||
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tchannels(%d) prec(%d) w(%d) h(%d)"
|
|
||||||
"\n\tprofile: in(%p) out(%p)\n",__FILE__,__LINE__,image->numcomps,prec,
|
|
||||||
max_w,max_h, (void*)in_prof,(void*)out_prof);
|
|
||||||
|
|
||||||
fprintf(stderr,"\trender_intent (%u)\n\t"
|
|
||||||
"color_space: in(%#x)(%c%c%c%c) out:(%#x)(%c%c%c%c)\n\t"
|
|
||||||
" type: in(%u) out:(%u)\n",
|
|
||||||
intent,
|
|
||||||
in_space,
|
|
||||||
(in_space>>24) & 0xff,(in_space>>16) & 0xff,
|
|
||||||
(in_space>>8) & 0xff, in_space & 0xff,
|
|
||||||
|
|
||||||
out_space,
|
|
||||||
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
|
|
||||||
(out_space>>8) & 0xff, out_space & 0xff,
|
|
||||||
|
|
||||||
in_type,out_type
|
|
||||||
);
|
|
||||||
#else
|
|
||||||
(void)prec;
|
|
||||||
(void)in_space;
|
|
||||||
#endif /* DEBUG_PROFILE */
|
|
||||||
|
|
||||||
transform = cmsCreateTransform(in_prof, in_type, out_prof, out_type, intent, 0);
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBLCMS2
|
|
||||||
/* Possible for: LCMS_VERSION >= 2000 :*/
|
|
||||||
cmsCloseProfile(in_prof);
|
|
||||||
cmsCloseProfile(out_prof);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(transform == NULL)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_PROFILE
|
|
||||||
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
|
|
||||||
"ICC Profile ignored.\n",__FILE__,__LINE__);
|
|
||||||
#endif
|
|
||||||
image->color_space = oldspace;
|
|
||||||
#ifdef HAVE_LIBLCMS1
|
|
||||||
cmsCloseProfile(in_prof);
|
|
||||||
cmsCloseProfile(out_prof);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(image->numcomps > 2)/* RGB, RGBA */
|
|
||||||
{
|
|
||||||
if( prec <= 8 )
|
|
||||||
{
|
|
||||||
unsigned char *inbuf, *outbuf, *in, *out;
|
|
||||||
max = max_w * max_h;
|
|
||||||
nr_samples = (cmsUInt32Number)max * 3 * (cmsUInt32Number)sizeof(unsigned char);
|
|
||||||
in = inbuf = (unsigned char*)malloc(nr_samples);
|
|
||||||
out = outbuf = (unsigned char*)malloc(nr_samples);
|
|
||||||
|
|
||||||
r = image->comps[0].data;
|
|
||||||
g = image->comps[1].data;
|
|
||||||
b = image->comps[2].data;
|
|
||||||
|
|
||||||
for(i = 0; i < max; ++i)
|
|
||||||
{
|
|
||||||
*in++ = (unsigned char)*r++;
|
|
||||||
*in++ = (unsigned char)*g++;
|
|
||||||
*in++ = (unsigned char)*b++;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
|
||||||
|
|
||||||
r = image->comps[0].data;
|
|
||||||
g = image->comps[1].data;
|
|
||||||
b = image->comps[2].data;
|
|
||||||
|
|
||||||
for(i = 0; i < max; ++i)
|
|
||||||
{
|
|
||||||
*r++ = (int)*out++;
|
|
||||||
*g++ = (int)*out++;
|
|
||||||
*b++ = (int)*out++;
|
|
||||||
}
|
|
||||||
free(inbuf); free(outbuf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned short *inbuf, *outbuf, *in, *out;
|
|
||||||
max = max_w * max_h;
|
|
||||||
nr_samples = (cmsUInt32Number)max * 3 * (cmsUInt32Number)sizeof(unsigned short);
|
|
||||||
in = inbuf = (unsigned short*)malloc(nr_samples);
|
|
||||||
out = outbuf = (unsigned short*)malloc(nr_samples);
|
|
||||||
|
|
||||||
r = image->comps[0].data;
|
|
||||||
g = image->comps[1].data;
|
|
||||||
b = image->comps[2].data;
|
|
||||||
|
|
||||||
for(i = 0; i < max; ++i)
|
|
||||||
{
|
|
||||||
*in++ = (unsigned short)*r++;
|
|
||||||
*in++ = (unsigned short)*g++;
|
|
||||||
*in++ = (unsigned short)*b++;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
|
||||||
|
|
||||||
r = image->comps[0].data;
|
|
||||||
g = image->comps[1].data;
|
|
||||||
b = image->comps[2].data;
|
|
||||||
|
|
||||||
for(i = 0; i < max; ++i)
|
|
||||||
{
|
|
||||||
*r++ = (int)*out++;
|
|
||||||
*g++ = (int)*out++;
|
|
||||||
*b++ = (int)*out++;
|
|
||||||
}
|
|
||||||
free(inbuf); free(outbuf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else /* GRAY, GRAYA */
|
|
||||||
{
|
|
||||||
unsigned char *in, *inbuf, *out, *outbuf;
|
|
||||||
max = max_w * max_h;
|
|
||||||
nr_samples = (cmsUInt32Number)max * 3 * sizeof(unsigned char);
|
|
||||||
in = inbuf = (unsigned char*)malloc(nr_samples);
|
|
||||||
out = outbuf = (unsigned char*)malloc(nr_samples);
|
|
||||||
|
|
||||||
image->comps = (opj_image_comp_t*)realloc(image->comps, (image->numcomps+2)*sizeof(opj_image_comp_t));
|
|
||||||
|
|
||||||
if(image->numcomps == 2)
|
|
||||||
image->comps[3] = image->comps[1];
|
|
||||||
|
|
||||||
image->comps[1] = image->comps[0];
|
|
||||||
image->comps[2] = image->comps[0];
|
|
||||||
|
|
||||||
image->comps[1].data = (int*)calloc((size_t)max, sizeof(int));
|
|
||||||
image->comps[2].data = (int*)calloc((size_t)max, sizeof(int));
|
|
||||||
|
|
||||||
image->numcomps += 2;
|
|
||||||
|
|
||||||
r = image->comps[0].data;
|
|
||||||
|
|
||||||
for(i = 0; i < max; ++i)
|
|
||||||
{
|
|
||||||
*in++ = (unsigned char)*r++;
|
|
||||||
}
|
|
||||||
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
|
||||||
|
|
||||||
r = image->comps[0].data;
|
|
||||||
g = image->comps[1].data;
|
|
||||||
b = image->comps[2].data;
|
|
||||||
|
|
||||||
for(i = 0; i < max; ++i)
|
|
||||||
{
|
|
||||||
*r++ = (int)*out++; *g++ = (int)*out++; *b++ = (int)*out++;
|
|
||||||
}
|
|
||||||
free(inbuf); free(outbuf);
|
|
||||||
|
|
||||||
}/* if(image->numcomps */
|
|
||||||
|
|
||||||
cmsDeleteTransform(transform);
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBLCMS1
|
|
||||||
cmsCloseProfile(in_prof);
|
|
||||||
cmsCloseProfile(out_prof);
|
|
||||||
#endif
|
|
||||||
}/* color_apply_icc_profile() */
|
|
||||||
|
|
||||||
#endif /* HAVE_LIBLCMS2 || HAVE_LIBLCMS1 */
|
|
||||||
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
What's New for OpenJPIP
|
|
||||||
|
|
||||||
* : fixed
|
|
||||||
- : removed
|
|
||||||
! : changed
|
|
||||||
+ : added
|
|
||||||
|
|
||||||
Feburary 28, 2012
|
|
||||||
+ [kaori] enabled the opj_server to reply the first query consisting with len request from kakadu client
|
|
||||||
|
|
||||||
February 9, 2012
|
|
||||||
* [kaori] fixed Doxygen configuration file to document the utilities
|
|
||||||
+ [kaori] added execution argument to set port number for opj_dec_server, opj_viewer*
|
|
||||||
|
|
||||||
January 26, 2012
|
|
||||||
! [kaori] unapplied auxtrans_manager to the local mode
|
|
||||||
|
|
||||||
December 24, 2011
|
|
||||||
* [kaori] additional modification for the warning
|
|
||||||
|
|
||||||
December 22, 2011
|
|
||||||
* [kaori] fixed auxtrans_manager to enable MAC
|
|
||||||
* [kaori] warnings due to disregarding return value are removed
|
|
||||||
|
|
||||||
November 30, 2011
|
|
||||||
+ [kaori] TCP return (http-tcp) implemented
|
|
||||||
|
|
||||||
November 16, 2011
|
|
||||||
* [kaori] fixed Region of Interest option, and memory leak of opj_dec_server
|
|
||||||
+ [kaori] new feature to target JP2 files from www (libcurl required)
|
|
||||||
* [kaori] fixed opj_server execusion error (instant terminating) with autotool, cmake still need to be fixed
|
|
||||||
|
|
||||||
November 8, 2011
|
|
||||||
! [kaori] updated main page of doxygen
|
|
||||||
|
|
||||||
November 3, 2011
|
|
||||||
* [kaori] solved memory leak of opj_server
|
|
||||||
! [kaori] removed redundant defines
|
|
||||||
|
|
||||||
November 2, 2011
|
|
||||||
* [antonin] additional patches for autotools and cmake
|
|
||||||
|
|
||||||
October 26, 2011
|
|
||||||
* [kaori] additional patches for autotool are applied
|
|
||||||
|
|
||||||
October 25, 2011
|
|
||||||
* [kaori] patches for cmake and autotool are applied
|
|
||||||
* [kaori] fixed client viewer to be compatible with server response header both Content-type and Content-Type
|
|
||||||
|
|
||||||
October 20, 2011
|
|
||||||
+ [added] API style in openJPIP library
|
|
||||||
! [kaori] rearranged directories, applications are all under util/ directory, currently only 'make -f Makefile.nix' works
|
|
||||||
|
|
||||||
October 18, 2011
|
|
||||||
! [kaori] rearranged opj_server, opj_dec_server directory
|
|
||||||
|
|
||||||
October 14, 2011
|
|
||||||
+ [kaori] enable all progression orders
|
|
||||||
|
|
||||||
October 12, 2011
|
|
||||||
+ [kaori] enable layers requests; restricting the number of codesream quality layers
|
|
||||||
|
|
||||||
October 11, 2011
|
|
||||||
+ [antonin] enable JPT-stream request from client viewer option (credit to kaori)
|
|
||||||
|
|
||||||
October 10, 2011
|
|
||||||
- [antonin] removed obsolete indexer utility (credit to kaori)
|
|
||||||
+ [antonin] enabled JPP-stream (credit to kaori)
|
|
||||||
|
|
||||||
September 16, 2011
|
|
||||||
+ [kaori] enabled stateless requests from the opj_viewers
|
|
||||||
|
|
||||||
Septempber 1, 2011
|
|
||||||
* [kaori] changed terminating status of opj_server in debug/non-server mode
|
|
||||||
|
|
||||||
August 27, 2011
|
|
||||||
* [antonin] fixed missing include directory in opj_client/opj_dec_server/CMakeLists.txt
|
|
||||||
|
|
||||||
August 26, 2011
|
|
||||||
* [antonin] fixed cmake and autotools files to reflect recent indexer changes in JPIP
|
|
||||||
! [kaori] indexer using the latest openjpeg library
|
|
||||||
* [antonin] fixed cmake and autotools files to reflect recent changes in JPIP
|
|
||||||
! [kaori] fixed Makefile.nix to load openjpeg library from this archive
|
|
||||||
|
|
||||||
August 25, 2011
|
|
||||||
+ [kaori] added tid request support to JPIP client
|
|
||||||
+ [kaori] added quit JPIP server request
|
|
||||||
|
|
||||||
August 24, 2011
|
|
||||||
+ [kaori] added cachemodel_manager, which had been managed in target_manager previously
|
|
||||||
+ [kaori] added tid request support to JPIP server
|
|
||||||
|
|
||||||
August 16, 2011
|
|
||||||
* [antonin] fixed cmake support for openjpip
|
|
||||||
|
|
||||||
August 12, 2011
|
|
||||||
+ [antonin] added cmake support to openjpip
|
|
||||||
|
|
||||||
July 6, 2011
|
|
||||||
* [antonin] JPIP : fixed autotools to work with recent name changes
|
|
||||||
|
|
||||||
July 5, 2011
|
|
||||||
! [kaori] changed parameter, file names, message names regarding JPT-stream to JPIP-stream, which handles also JPP-stream
|
|
||||||
|
|
||||||
May 26, 2011
|
|
||||||
! [antonin] changed Makefile to Makefile.nix to avoid having autotools overwrite them.
|
|
||||||
|
|
||||||
May 23, 2011
|
|
||||||
+ [antonin] added autotools for the 'tools' directory
|
|
||||||
+ [antonin] added autotools as a build method for jpip (credit to Vincent Torri)
|
|
||||||
|
|
||||||
May 10, 2011
|
|
||||||
! [kaori] opj_viewer removed the xml functions (for users without Xersus2)
|
|
||||||
+ [kaori] renamed opj_viewer to opj_viewer_xerces ( needs Xersus2)
|
|
||||||
! [kaori] Modification of opj_dec_server to be portable to windows
|
|
||||||
|
|
||||||
May 9, 2011
|
|
||||||
* [kaori] Removal of c99 from the compile option (to be compatible to win platform) and bool definition in libopenjpip/bool.h
|
|
||||||
|
|
||||||
May 9, 2011
|
|
||||||
* [antonin] OpenJPIP: small bug fixes to compile on win platform
|
|
||||||
|
|
||||||
May 8, 2011
|
|
||||||
* [antonin] OpenJPIP: fixed several bugs in opj_server (removal of strsep function, duplication of query string) + some changes to compile opj_server under windows (replacement of strcasecmp(), bzero()).
|
|
||||||
|
|
||||||
April 14, 2011
|
|
||||||
+ [antonin] initial commit of OpenJPIP 1.0, a JPIP client-server architecture based on OpenJPEG (see README file in jpip directory for more details)
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# required dep for server:
|
|
||||||
IF(BUILD_JPIP_SERVER)
|
|
||||||
FIND_PACKAGE(CURL REQUIRED)
|
|
||||||
FIND_PACKAGE(FCGI REQUIRED)
|
|
||||||
FIND_PACKAGE(Threads REQUIRED)
|
|
||||||
IF(NOT CMAKE_USE_PTHREADS_INIT)
|
|
||||||
MESSAGE(FATAL_ERROR "Only pthread are supported")
|
|
||||||
ENDIF(NOT CMAKE_USE_PTHREADS_INIT)
|
|
||||||
ENDIF(BUILD_JPIP_SERVER)
|
|
||||||
|
|
||||||
# JPIP library:
|
|
||||||
ADD_SUBDIRECTORY(libopenjpip)
|
|
||||||
|
|
||||||
# JPIP binaries:
|
|
||||||
ADD_SUBDIRECTORY(util)
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
SUBDIRS = libopenjpip util
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,151 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
includesdir = $(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)
|
|
||||||
includes_HEADERS =
|
|
||||||
|
|
||||||
lib_LTLIBRARIES =
|
|
||||||
|
|
||||||
if WANT_JPIP
|
|
||||||
lib_LTLIBRARIES += libopenjpip_local.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
if WANT_JPIP_SERVER
|
|
||||||
lib_LTLIBRARIES += libopenjpip_server.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
JPIP_SRC = \
|
|
||||||
openjpip.c \
|
|
||||||
query_parser.c \
|
|
||||||
channel_manager.c \
|
|
||||||
session_manager.c \
|
|
||||||
jpip_parser.c \
|
|
||||||
boxheader_manager.c \
|
|
||||||
codestream_manager.c \
|
|
||||||
imgreg_manager.c \
|
|
||||||
marker_manager.c \
|
|
||||||
msgqueue_manager.c \
|
|
||||||
box_manager.c \
|
|
||||||
faixbox_manager.c \
|
|
||||||
index_manager.c \
|
|
||||||
metadata_manager.c \
|
|
||||||
placeholder_manager.c \
|
|
||||||
byte_manager.c \
|
|
||||||
ihdrbox_manager.c \
|
|
||||||
manfbox_manager.c \
|
|
||||||
mhixbox_manager.c \
|
|
||||||
target_manager.c \
|
|
||||||
cachemodel_manager.c \
|
|
||||||
j2kheader_manager.c \
|
|
||||||
jp2k_encoder.c \
|
|
||||||
sock_manager.c \
|
|
||||||
openjpip.h \
|
|
||||||
bool.h \
|
|
||||||
boxheader_manager.h \
|
|
||||||
box_manager.h \
|
|
||||||
byte_manager.h \
|
|
||||||
codestream_manager.h \
|
|
||||||
faixbox_manager.h \
|
|
||||||
ihdrbox_manager.h \
|
|
||||||
imgreg_manager.h \
|
|
||||||
index_manager.h \
|
|
||||||
manfbox_manager.h \
|
|
||||||
marker_manager.h \
|
|
||||||
metadata_manager.h \
|
|
||||||
mhixbox_manager.h \
|
|
||||||
msgqueue_manager.h \
|
|
||||||
placeholder_manager.h \
|
|
||||||
target_manager.h \
|
|
||||||
cachemodel_manager.h \
|
|
||||||
j2kheader_manager.h \
|
|
||||||
jp2k_encoder.h \
|
|
||||||
query_parser.h \
|
|
||||||
channel_manager.h \
|
|
||||||
session_manager.h \
|
|
||||||
jpip_parser.h \
|
|
||||||
jp2k_decoder.h \
|
|
||||||
sock_manager.h
|
|
||||||
|
|
||||||
SERVER_SRC = auxtrans_manager.c \
|
|
||||||
auxtrans_manager.h
|
|
||||||
|
|
||||||
LOCAL_SRC = jp2k_decoder.c \
|
|
||||||
imgsock_manager.c \
|
|
||||||
jpipstream_manager.c \
|
|
||||||
cache_manager.c \
|
|
||||||
dec_clientmsg_handler.c \
|
|
||||||
imgsock_manager.h \
|
|
||||||
jpipstream_manager.h \
|
|
||||||
cache_manager.h \
|
|
||||||
dec_clientmsg_handler.h
|
|
||||||
|
|
||||||
libopenjpip_server_la_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip \
|
|
||||||
@FCGI_CFLAGS@ \
|
|
||||||
@LIBCURL_CFLAGS@ \
|
|
||||||
-DSERVER
|
|
||||||
libopenjpip_server_la_CFLAGS = @THREAD_CFLAGS@
|
|
||||||
libopenjpip_server_la_LIBADD = @FCGI_LIBS@ @LIBCURL_LIBS@ @THREAD_LIBS@ -lm
|
|
||||||
libopenjpip_server_la_LDFLAGS = -no-undefined -version-info @lt_version@
|
|
||||||
libopenjpip_server_la_SOURCES = $(JPIP_SRC) $(SERVER_SRC)
|
|
||||||
|
|
||||||
libopenjpip_local_la_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip \
|
|
||||||
@LIBCURL_CFLAGS@
|
|
||||||
libopenjpip_local_la_CFLAGS =
|
|
||||||
libopenjpip_local_la_LIBADD = $(top_builddir)/libopenjpeg/libopenjpeg.la -lm
|
|
||||||
libopenjpip_local_la_LDFLAGS = -no-undefined -version-info @lt_version@
|
|
||||||
libopenjpip_local_la_SOURCES = $(JPIP_SRC) $(LOCAL_SRC)
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
if WANT_JPIP_SERVER
|
|
||||||
@echo -e " (LA)\t$(libdir)/libopenjpip_server.la" >> $(top_builddir)/report.txt
|
|
||||||
if BUILD_SHARED
|
|
||||||
@( $(call solist_s) ) >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
if BUILD_STATIC
|
|
||||||
@echo -e " (A)\t$(base_s)/$(a_s)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if WANT_JPIP
|
|
||||||
@echo -e " (LA)\t$(libdir)/libopenjpip_local.la" >> $(top_builddir)/report.txt
|
|
||||||
if BUILD_SHARED
|
|
||||||
@( $(call solist_c) ) >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
if BUILD_STATIC
|
|
||||||
@echo -e " (A)\t$(base_c)/$(a_c)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
solist_s = $(foreach f, $(dll_s) $(so_s), echo -e ' $(SO_PREFIX)\t$(base_s)/$(f)' ;)
|
|
||||||
get_tok_s = $(shell grep -E "^$(1)=" libopenjpip_server.la | cut -d "'" -f 2)
|
|
||||||
base_s = $(call get_tok_s,libdir)
|
|
||||||
so_s = $(call get_tok_s,library_names)
|
|
||||||
a_s = $(call get_tok_s,old_library)
|
|
||||||
|
|
||||||
solist_c = $(foreach f, $(dll_c) $(so_c), echo -e ' $(SO_PREFIX)\t$(base_c)/$(f)' ;)
|
|
||||||
get_tok_c = $(shell grep -E "^$(1)=" libopenjpip_local.la | cut -d "'" -f 2)
|
|
||||||
base_c = $(call get_tok_c,libdir)
|
|
||||||
so_c = $(call get_tok_c,library_names)
|
|
||||||
a_c = $(call get_tok_c,old_library)
|
|
||||||
|
|
||||||
if HAVE_WIN32
|
|
||||||
SO_PREFIX = (DLL)
|
|
||||||
dll_s = $(call get_tok_s,dlname)
|
|
||||||
dll_c = $(call get_tok_c,dlname)
|
|
||||||
else
|
|
||||||
if HAVE_DARWIN
|
|
||||||
SO_PREFIX = (DY)
|
|
||||||
dll_s =
|
|
||||||
dll_c =
|
|
||||||
else
|
|
||||||
SO_PREFIX = (SO)
|
|
||||||
dll_s =
|
|
||||||
dll_c =
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
bin_PROGRAMS =
|
|
||||||
|
|
||||||
if WANT_JPIP
|
|
||||||
bin_PROGRAMS += opj_dec_server test_index jpip_to_j2k jpip_to_jp2
|
|
||||||
endif
|
|
||||||
|
|
||||||
if WANT_JPIP_SERVER
|
|
||||||
bin_PROGRAMS += opj_server
|
|
||||||
endif
|
|
||||||
|
|
||||||
opj_server_CPPFLAGS = \
|
|
||||||
@FCGI_CFLAGS@ \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip \
|
|
||||||
-DSERVER \
|
|
||||||
-DQUIT_SIGNAL=\"quitJPIP\"
|
|
||||||
#
|
|
||||||
opj_server_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_server.la @FCGI_LIBS@ -lm
|
|
||||||
#
|
|
||||||
opj_server_SOURCES = opj_server.c
|
|
||||||
|
|
||||||
#-------------
|
|
||||||
opj_dec_server_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip
|
|
||||||
#
|
|
||||||
opj_dec_server_CFLAGS =
|
|
||||||
opj_dec_server_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
|
|
||||||
opj_dec_server_SOURCES = opj_dec_server.c
|
|
||||||
|
|
||||||
#-------------
|
|
||||||
jpip_to_jp2_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip
|
|
||||||
#
|
|
||||||
jpip_to_jp2_CFLAGS =
|
|
||||||
jpip_to_jp2_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
|
|
||||||
jpip_to_jp2_SOURCES = jpip_to_jp2.c
|
|
||||||
|
|
||||||
#-------------
|
|
||||||
jpip_to_j2k_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip
|
|
||||||
#
|
|
||||||
jpip_to_j2k_CFLAGS =
|
|
||||||
jpip_to_j2k_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
|
|
||||||
jpip_to_j2k_SOURCES = jpip_to_j2k.c
|
|
||||||
|
|
||||||
#-------------
|
|
||||||
test_index_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/jpip/libopenjpip \
|
|
||||||
-I$(top_builddir)/applications/jpip/libopenjpip
|
|
||||||
#
|
|
||||||
test_index_CFLAGS =
|
|
||||||
test_index_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
|
|
||||||
test_index_SOURCES = test_index.c
|
|
||||||
|
|
||||||
#-------------
|
|
||||||
install-data-hook:
|
|
||||||
if WANT_JPIP_SERVER
|
|
||||||
@echo -e " (B)\t$(bindir)/opj_server$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
if WANT_JPIP
|
|
||||||
@echo -e " (B)\t$(bindir)/opj_dec_server$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/jpip_to_jp2$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/jpip_to_j2k$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/test_index$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
# Makefile for the MJ2 codecs of the OpenJPEG library: frames_to_mj2, mj2_to_frames, extract_j2k_from_mj2 and wrap_j2k_in_mj2
|
|
||||||
|
|
||||||
if(NOT USE_SYSTEM_GETOPT)
|
|
||||||
SET(common_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# While mj2 executables do not use the API correctly, we do not link with the library but rather compile the sources files.
|
|
||||||
SET(OPJ_SRCS
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/bio.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/cio.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/dwt.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/event.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/image.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/j2k.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/j2k_lib.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/jp2.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/jpt.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/mct.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/mqc.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/openjpeg.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/pi.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/raw.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/t1.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/t2.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tcd.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tgt.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/cidx_manager.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/phix_manager.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/ppix_manager.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/thix_manager.c
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tpix_manager.c
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(MJ2_SRCS mj2.c mj2_convert.c)
|
|
||||||
|
|
||||||
IF(WIN32)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
# Headers file are located here:
|
|
||||||
INCLUDE_DIRECTORIES(
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
|
||||||
${OPENJPEG_SOURCE_DIR}/applications/common
|
|
||||||
${LCMS_INCLUDE_DIRNAME}
|
|
||||||
)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(frames_to_mj2
|
|
||||||
frames_to_mj2.c
|
|
||||||
${common_SRCS}
|
|
||||||
${OPJ_SRCS}
|
|
||||||
${MJ2_SRCS}
|
|
||||||
)
|
|
||||||
TARGET_LINK_LIBRARIES(frames_to_mj2 ${LCMS_LIBNAME})
|
|
||||||
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(frames_to_mj2 m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(mj2_to_frames
|
|
||||||
mj2_to_frames.c
|
|
||||||
${common_SRCS}
|
|
||||||
${OPJ_SRCS}
|
|
||||||
${MJ2_SRCS}
|
|
||||||
${OPENJPEG_SOURCE_DIR}/applications/common/color.c
|
|
||||||
)
|
|
||||||
TARGET_LINK_LIBRARIES(mj2_to_frames ${LCMS_LIBNAME})
|
|
||||||
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(mj2_to_frames m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(extract_j2k_from_mj2
|
|
||||||
extract_j2k_from_mj2.c
|
|
||||||
${OPJ_SRCS}
|
|
||||||
${MJ2_SRCS}
|
|
||||||
)
|
|
||||||
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${LCMS_LIBNAME})
|
|
||||||
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(wrap_j2k_in_mj2
|
|
||||||
wrap_j2k_in_mj2.c
|
|
||||||
${OPJ_SRCS}
|
|
||||||
${MJ2_SRCS}
|
|
||||||
)
|
|
||||||
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${LCMS_LIBNAME})
|
|
||||||
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
INSTALL(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
OPJ_SRC = \
|
|
||||||
../../libopenjpeg/bio.c \
|
|
||||||
../../libopenjpeg/cio.c \
|
|
||||||
../../libopenjpeg/dwt.c \
|
|
||||||
../../libopenjpeg/event.c \
|
|
||||||
../../libopenjpeg/image.c \
|
|
||||||
../../libopenjpeg/j2k.c \
|
|
||||||
../../libopenjpeg/j2k_lib.c \
|
|
||||||
../../libopenjpeg/jp2.c \
|
|
||||||
../../libopenjpeg/jpt.c \
|
|
||||||
../../libopenjpeg/mct.c \
|
|
||||||
../../libopenjpeg/mqc.c \
|
|
||||||
../../libopenjpeg/openjpeg.c \
|
|
||||||
../../libopenjpeg/pi.c \
|
|
||||||
../../libopenjpeg/raw.c \
|
|
||||||
../../libopenjpeg/t1.c \
|
|
||||||
../../libopenjpeg/t2.c \
|
|
||||||
../../libopenjpeg/tcd.c \
|
|
||||||
../../libopenjpeg/tgt.c \
|
|
||||||
../../libopenjpeg/cidx_manager.c \
|
|
||||||
../../libopenjpeg/phix_manager.c \
|
|
||||||
../../libopenjpeg/ppix_manager.c \
|
|
||||||
../../libopenjpeg/thix_manager.c \
|
|
||||||
../../libopenjpeg/tpix_manager.c
|
|
||||||
|
|
||||||
bin_PROGRAMS = \
|
|
||||||
frames_to_mj2 \
|
|
||||||
mj2_to_frames \
|
|
||||||
extract_j2k_from_mj2 \
|
|
||||||
wrap_j2k_in_mj2
|
|
||||||
|
|
||||||
frames_to_mj2_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-DOPJ_STATIC
|
|
||||||
frames_to_mj2_CFLAGS =
|
|
||||||
frames_to_mj2_LDADD = -lm
|
|
||||||
frames_to_mj2_SOURCES = \
|
|
||||||
$(OPJ_SRC) \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
mj2_convert.c \
|
|
||||||
mj2.c \
|
|
||||||
frames_to_mj2.c \
|
|
||||||
mj2.h \
|
|
||||||
mj2_convert.h
|
|
||||||
|
|
||||||
mj2_to_frames_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
@LCMS2_CFLAGS@ \
|
|
||||||
@LCMS1_CFLAGS@ \
|
|
||||||
-DOPJ_STATIC
|
|
||||||
mj2_to_frames_CFLAGS =
|
|
||||||
mj2_to_frames_LDADD = @LCMS2_LIBS@ @LCMS1_LIBS@ -lm
|
|
||||||
mj2_to_frames_SOURCES = \
|
|
||||||
$(OPJ_SRC) \
|
|
||||||
../common/color.c \
|
|
||||||
../common/opj_getopt.c \
|
|
||||||
mj2_convert.c \
|
|
||||||
mj2.c \
|
|
||||||
mj2_to_frames.c \
|
|
||||||
mj2.h \
|
|
||||||
mj2_convert.h
|
|
||||||
|
|
||||||
extract_j2k_from_mj2_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-DOPJ_STATIC
|
|
||||||
extract_j2k_from_mj2_CFLAGS =
|
|
||||||
extract_j2k_from_mj2_LDADD = -lm
|
|
||||||
extract_j2k_from_mj2_SOURCES = \
|
|
||||||
$(OPJ_SRC) \
|
|
||||||
mj2.c \
|
|
||||||
extract_j2k_from_mj2.c \
|
|
||||||
mj2.h
|
|
||||||
|
|
||||||
wrap_j2k_in_mj2_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/applications/common \
|
|
||||||
-I$(top_builddir)/applications/common \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-DOPJ_STATIC
|
|
||||||
wrap_j2k_in_mj2_CFLAGS =
|
|
||||||
wrap_j2k_in_mj2_LDADD = -lm
|
|
||||||
wrap_j2k_in_mj2_SOURCES = \
|
|
||||||
$(OPJ_SRC) \
|
|
||||||
mj2.c \
|
|
||||||
wrap_j2k_in_mj2.c \
|
|
||||||
mj2.h
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CMakeLists.txt
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
@echo -e " (B)\t$(bindir)/frames_to_mj2$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/mj2_to_frames$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/extract_j2k_from_mj2$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (B)\t$(bindir)/wrap_j2k_in_mj2$(EXEEXT)" >> $(top_builddir)/report.txt
|
|
||||||
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
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
autoreconf --install --force
|
|
||||||
|
|
||||||
@@ -8,11 +8,11 @@
|
|||||||
#
|
#
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
|
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
|
||||||
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
|
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
|
||||||
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
|
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
|
||||||
|
|
||||||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
||||||
|
|
||||||
# Exclude files from the Testing directories
|
# Exclude files from the Testing directories
|
||||||
@@ -22,12 +22,18 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
|||||||
".*/thirdparty/.*"
|
".*/thirdparty/.*"
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(CTEST_CUSTOM_WARNING_EXCEPTION
|
set(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||||
${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
|
# Suppress warning caused by intentional messages about deprecation
|
||||||
".*warning,.* is deprecated"
|
".*warning,.* is deprecated"
|
||||||
# supress warnings caused by 3rd party libs:
|
# java also warns about deprecated API
|
||||||
|
".*java.*deprecation"
|
||||||
|
".*deprecation.*"
|
||||||
|
# suppress warnings caused by 3rd party libs:
|
||||||
".*thirdparty.*"
|
".*thirdparty.*"
|
||||||
"libtiff.*has no symbols"
|
"libtiff.*has no symbols"
|
||||||
"libpng.*has no symbols"
|
"libpng.*has no symbols"
|
||||||
26
cmake/EnsureFileInclude.cmake
Normal file
26
cmake/EnsureFileInclude.cmake
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Ensure that an include file is provided by the system
|
||||||
|
# Add the check about the mandatory status to the check_include_file macro
|
||||||
|
# provided by cmake
|
||||||
|
|
||||||
|
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
||||||
|
|
||||||
|
macro(ensure_file_include INCLUDE_FILENAME VARIABLE_NAME MANDATORY_STATUS)
|
||||||
|
|
||||||
|
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n"
|
||||||
|
# "VARIABLE_NAME=${VARIABLE_NAME} \n"
|
||||||
|
# "MANDATORY_STATUS=${MANDATORY_STATUS}")
|
||||||
|
|
||||||
|
CHECK_INCLUDE_FILE(${INCLUDE_FILENAME} ${VARIABLE_NAME})
|
||||||
|
|
||||||
|
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n"
|
||||||
|
# "VARIABLE_NAME=${VARIABLE_NAME} \n"
|
||||||
|
# "VARIABLE_NAME_VALUE=${${VARIABLE_NAME}} \n"
|
||||||
|
# "MANDATORY_STATUS=${MANDATORY_STATUS}")
|
||||||
|
|
||||||
|
if (NOT ${${VARIABLE_NAME}})
|
||||||
|
if (${MANDATORY_STATUS})
|
||||||
|
message(FATAL_ERROR "The file ${INCLUDE_FILENAME} is mandatory but not found on your system")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endmacro()
|
||||||
20
cmake/FindFCGI.cmake
Normal file
20
cmake/FindFCGI.cmake
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Look for the header file.
|
||||||
|
find_path(FCGI_INCLUDE_DIR NAMES fastcgi.h)
|
||||||
|
|
||||||
|
# Look for the library.
|
||||||
|
find_library(FCGI_LIBRARY NAMES fcgi)
|
||||||
|
|
||||||
|
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# Copy the results to the output variables.
|
||||||
|
if(FCGI_FOUND)
|
||||||
|
set(FCGI_LIBRARIES ${FCGI_LIBRARY})
|
||||||
|
set(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
set(FCGI_LIBRARIES)
|
||||||
|
set(FCGI_INCLUDE_DIRS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(FCGI_INCLUDE_DIR FCGI_LIBRARY)
|
||||||
@@ -1,19 +1,24 @@
|
|||||||
#
|
#
|
||||||
# this module looks for KAKADu
|
# this module looks for KAKADU
|
||||||
# http://www.kakadusoftware.com/
|
# http://www.kakadusoftware.com/
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
# Copyright (c) 2006-2014 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||||
#
|
#
|
||||||
# Redistribution and use is allowed according to the terms of the New
|
# Redistribution and use is allowed according to the terms of the New
|
||||||
# BSD license.
|
# BSD license.
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
#
|
#
|
||||||
|
|
||||||
FIND_PROGRAM(KDU_EXPAND_EXECUTABLE
|
find_program(KDU_EXPAND_EXECUTABLE
|
||||||
kdu_expand
|
kdu_expand
|
||||||
)
|
)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
find_program(KDU_COMPRESS_EXECUTABLE
|
||||||
KDU_EXPAND_EXECUTABLE
|
kdu_compress
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
KDU_EXPAND_EXECUTABLE
|
||||||
|
KDU_COMPRESS_EXECUTABLE
|
||||||
)
|
)
|
||||||
@@ -12,20 +12,20 @@
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
FIND_PATH(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
|
find_path(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
|
||||||
|
|
||||||
SET(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static)
|
set(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static)
|
||||||
|
|
||||||
FIND_LIBRARY(LCMS_LIBRARY NAMES ${LCMS_NAMES} )
|
find_library(LCMS_LIBRARY NAMES ${LCMS_NAMES} )
|
||||||
|
|
||||||
MARK_AS_ADVANCED(LCMS_INCLUDE_DIR LCMS_LIBRARY)
|
mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARY)
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR)
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR)
|
||||||
|
|
||||||
IF(LCMS_FOUND)
|
if(LCMS_FOUND)
|
||||||
SET( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR})
|
set( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR})
|
||||||
SET( LCMS_LIBRARIES ${LCMS_LIBRARY} )
|
set( LCMS_LIBRARIES ${LCMS_LIBRARY} )
|
||||||
ENDIF(LCMS_FOUND)
|
endif()
|
||||||
@@ -12,20 +12,20 @@
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
FIND_PATH(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
|
find_path(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
|
||||||
|
|
||||||
SET(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static)
|
set(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static)
|
||||||
|
|
||||||
FIND_LIBRARY(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
|
find_library(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
|
||||||
|
|
||||||
MARK_AS_ADVANCED(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
|
mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
|
||||||
|
|
||||||
IF(LCMS2_FOUND)
|
if(LCMS2_FOUND)
|
||||||
SET( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
|
set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
|
||||||
SET( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
|
set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
|
||||||
ENDIF(LCMS2_FOUND)
|
endif()
|
||||||
@@ -7,7 +7,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
|||||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||||
endif()
|
endif()
|
||||||
include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
|
include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
|
||||||
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
endif()
|
||||||
|
|
||||||
set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
|
set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
|
||||||
set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
|
set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
|
||||||
@@ -28,43 +28,45 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
|||||||
|
|
||||||
# Make this explicit here, rather than accepting the CPack default value,
|
# Make this explicit here, rather than accepting the CPack default value,
|
||||||
# so we can refer to it:
|
# so we can refer to it:
|
||||||
SET(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
|
set(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
|
||||||
|
|
||||||
IF(NOT DEFINED CPACK_SYSTEM_NAME)
|
if(NOT DEFINED CPACK_SYSTEM_NAME)
|
||||||
# make sure package is not Cygwin-unknown, for Cygwin just
|
# make sure package is not Cygwin-unknown, for Cygwin just
|
||||||
# cygwin is good for the system name
|
# cygwin is good for the system name
|
||||||
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||||
SET(CPACK_SYSTEM_NAME Cygwin)
|
set(CPACK_SYSTEM_NAME Cygwin)
|
||||||
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
else()
|
||||||
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
||||||
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
endif()
|
||||||
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
|
endif()
|
||||||
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
||||||
IF(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
SET(CPACK_SYSTEM_NAME win64-x64)
|
set(CPACK_SYSTEM_NAME win64-x64)
|
||||||
ELSE(CMAKE_CL_64)
|
else()
|
||||||
SET(CPACK_SYSTEM_NAME win32-x86)
|
set(CPACK_SYSTEM_NAME win32-x86)
|
||||||
ENDIF(CMAKE_CL_64)
|
endif()
|
||||||
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
||||||
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
||||||
# default to source package - system, on cygwin system is not
|
# default to source package - system, on cygwin system is not
|
||||||
# needed
|
# needed
|
||||||
IF(CYGWIN)
|
if(CYGWIN)
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
||||||
ELSE(CYGWIN)
|
else()
|
||||||
SET(CPACK_PACKAGE_FILE_NAME
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
||||||
ENDIF(CYGWIN)
|
endif()
|
||||||
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
endif()
|
||||||
|
|
||||||
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
||||||
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
|
if(APPLE)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
|
||||||
SET(CPACK_BUNDLE_PLIST
|
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
set(CPACK_BUNDLE_PLIST
|
||||||
#include(BundleUtilities)
|
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
||||||
|
#include(BundleUtilities)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
48
cmake/OpenJPEGConfig.cmake.in
Normal file
48
cmake/OpenJPEGConfig.cmake.in
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# OPENJPEGConfig.cmake - CMake configuration file for external projects.
|
||||||
|
#
|
||||||
|
# This file is configured by OPENJPEG and used by the UseOPENJPEG.cmake
|
||||||
|
# module to load OPENJPEG's settings for an external project.
|
||||||
|
@OPENJPEG_CONFIG_INSTALL_ONLY@
|
||||||
|
# The OPENJPEG version number.
|
||||||
|
set(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@")
|
||||||
|
set(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@")
|
||||||
|
set(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
|
||||||
|
|
||||||
|
# The libraries.
|
||||||
|
set(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@")
|
||||||
|
|
||||||
|
# The CMake macros dir.
|
||||||
|
set(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@")
|
||||||
|
|
||||||
|
# The configuration options.
|
||||||
|
set(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
|
||||||
|
|
||||||
|
# The "use" file.
|
||||||
|
set(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
|
||||||
|
|
||||||
|
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
||||||
|
# This is an install tree
|
||||||
|
include(${SELF_DIR}/OpenJPEGTargets.cmake)
|
||||||
|
get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
|
||||||
|
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
|
||||||
|
|
||||||
|
else()
|
||||||
|
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
||||||
|
# This is a build tree
|
||||||
|
set( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@)
|
||||||
|
|
||||||
|
include(${SELF_DIR}/OpenJPEGExports.cmake)
|
||||||
|
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "ooops")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)
|
||||||
|
|
||||||
|
# Backward compatible part:
|
||||||
|
set(OPENJPEG_FOUND TRUE)
|
||||||
|
|
||||||
11
cmake/TestFileOffsetBits.c
Normal file
11
cmake/TestFileOffsetBits.c
Normal file
@@ -0,0 +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)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
23
cmake/TestLargeFiles.c.cmake.in
Normal file
23
cmake/TestLargeFiles.c.cmake.in
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#cmakedefine _LARGEFILE_SOURCE
|
||||||
|
#cmakedefine _LARGE_FILES
|
||||||
|
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
/* Cause a compile-time error if off_t is smaller than 64 bits,
|
||||||
|
* and make sure we have ftello / fseeko.
|
||||||
|
*/
|
||||||
|
#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 ];
|
||||||
|
FILE *fp = fopen(argv[0],"r");
|
||||||
|
off_t offset = ftello( fp );
|
||||||
|
|
||||||
|
fseeko( fp, offset, SEEK_CUR );
|
||||||
|
fclose(fp);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
134
cmake/TestLargeFiles.cmake
Normal file
134
cmake/TestLargeFiles.cmake
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# - Define macro to check large file support
|
||||||
|
#
|
||||||
|
# OPJ_TEST_LARGE_FILES(VARIABLE)
|
||||||
|
#
|
||||||
|
# VARIABLE will be set to true if off_t is 64 bits, and fseeko/ftello present.
|
||||||
|
# This macro will also defines the necessary variable enable large file support, for instance
|
||||||
|
# _LARGE_FILES
|
||||||
|
# _LARGEFILE_SOURCE
|
||||||
|
# _FILE_OFFSET_BITS 64
|
||||||
|
# OPJ_HAVE_FSEEKO
|
||||||
|
#
|
||||||
|
# However, it is YOUR job to make sure these defines are set in a #cmakedefine so they
|
||||||
|
# end up in a config.h file that is included in your source if necessary!
|
||||||
|
#
|
||||||
|
# Adapted from Gromacs project (http://www.gromacs.org/)
|
||||||
|
# by Julien Malik
|
||||||
|
#
|
||||||
|
|
||||||
|
macro(OPJ_TEST_LARGE_FILES 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
|
||||||
|
# (ZFS), so it might be dangerous to indiscriminately set e.g. _FILE_OFFSET_BITS=64.
|
||||||
|
|
||||||
|
message(STATUS "Checking for 64-bit off_t")
|
||||||
|
|
||||||
|
# First check without any special flags
|
||||||
|
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
|
||||||
|
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c")
|
||||||
|
if(FILE64_OK)
|
||||||
|
message(STATUS "Checking for 64-bit off_t - present")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT FILE64_OK)
|
||||||
|
# Test with _FILE_OFFSET_BITS=64
|
||||||
|
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
|
||||||
|
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
|
||||||
|
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" )
|
||||||
|
if(FILE64_OK)
|
||||||
|
message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
|
||||||
|
set(_FILE_OFFSET_BITS 64)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT FILE64_OK)
|
||||||
|
# Test with _LARGE_FILES
|
||||||
|
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
|
||||||
|
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
|
||||||
|
COMPILE_DEFINITIONS "-D_LARGE_FILES" )
|
||||||
|
if(FILE64_OK)
|
||||||
|
message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
|
||||||
|
set(_LARGE_FILES 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT FILE64_OK)
|
||||||
|
# Test with _LARGEFILE_SOURCE
|
||||||
|
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
|
||||||
|
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
|
||||||
|
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
|
||||||
|
if(FILE64_OK)
|
||||||
|
message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
|
||||||
|
set(_LARGEFILE_SOURCE 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
#if(NOT FILE64_OK)
|
||||||
|
# # now check for Windows stuff
|
||||||
|
# try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
|
||||||
|
# "${PROJECT_SOURCE_DIR}/cmake/TestWindowsFSeek.c")
|
||||||
|
# if(FILE64_OK)
|
||||||
|
# message(STATUS "Checking for 64-bit off_t - present with _fseeki64")
|
||||||
|
# set(HAVE__FSEEKI64 1)
|
||||||
|
# endif()
|
||||||
|
#endif()
|
||||||
|
|
||||||
|
if(NOT FILE64_OK)
|
||||||
|
message(STATUS "Checking for 64-bit off_t - not present")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL "Result of test for needed _FILE_OFFSET_BITS=64")
|
||||||
|
set(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL "Result of test for needed _LARGE_FILES")
|
||||||
|
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
|
||||||
|
|
||||||
|
# Set the flags we might have determined to be required above
|
||||||
|
configure_file("${PROJECT_SOURCE_DIR}/cmake/TestLargeFiles.c.cmake.in"
|
||||||
|
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
|
||||||
|
|
||||||
|
message(STATUS "Checking for fseeko/ftello")
|
||||||
|
|
||||||
|
# Test if ftello/fseeko are available
|
||||||
|
try_compile(FSEEKO_COMPILE_OK
|
||||||
|
"${PROJECT_BINARY_DIR}"
|
||||||
|
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
|
||||||
|
|
||||||
|
if(FSEEKO_COMPILE_OK)
|
||||||
|
message(STATUS "Checking for fseeko/ftello - present")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT FSEEKO_COMPILE_OK)
|
||||||
|
# glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...)
|
||||||
|
try_compile(FSEEKO_COMPILE_OK
|
||||||
|
"${PROJECT_BINARY_DIR}"
|
||||||
|
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c"
|
||||||
|
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
|
||||||
|
|
||||||
|
if(FSEEKO_COMPILE_OK)
|
||||||
|
message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
|
||||||
|
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(FSEEKO_COMPILE_OK)
|
||||||
|
set(OPJ_HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello")
|
||||||
|
else()
|
||||||
|
message(STATUS "Checking for fseeko/ftello - not found")
|
||||||
|
set(OPJ_HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(FILE64_OK AND FSEEKO_COMPILE_OK)
|
||||||
|
message(STATUS "Large File support - found")
|
||||||
|
set(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support")
|
||||||
|
else()
|
||||||
|
message(STATUS "Large File support - not found")
|
||||||
|
set(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
cmake/TestWindowsFSeek.c
Normal file
11
cmake/TestWindowsFSeek.c
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
__int64 off=0;
|
||||||
|
|
||||||
|
_fseeki64(NULL, off, SEEK_SET);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
39
cmake/openjpeg_valgrind.supp
Normal file
39
cmake/openjpeg_valgrind.supp
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
<Appears with libpng uses with Ubuntu10.04 (hulk)>
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:deflate
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
fun:png_write_row
|
||||||
|
fun:imagetopng
|
||||||
|
fun:main
|
||||||
|
}
|
||||||
|
{
|
||||||
|
<Appears with libpng uses with Ubuntu10.04 (hulk)>
|
||||||
|
Memcheck:Value8
|
||||||
|
fun:crc32
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
fun:png_write_chunk
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
obj:/lib/libpng12.so.0.42.0
|
||||||
|
fun:png_write_row
|
||||||
|
fun:imagetopng
|
||||||
|
fun:main
|
||||||
|
}
|
||||||
|
{
|
||||||
|
<Appears with libpng uses with Ubuntu10.04 (hulk)>
|
||||||
|
Memcheck:Param
|
||||||
|
write(buf)
|
||||||
|
fun:__write_nocancel
|
||||||
|
fun:_IO_file_write@@GLIBC_2.2.5
|
||||||
|
fun:_IO_do_write@@GLIBC_2.2.5
|
||||||
|
fun:_IO_file_close_it@@GLIBC_2.2.5
|
||||||
|
fun:fclose@@GLIBC_2.2.5
|
||||||
|
fun:imagetopng
|
||||||
|
fun:main
|
||||||
|
}
|
||||||
545
configure.ac
545
configure.ac
@@ -1,545 +0,0 @@
|
|||||||
|
|
||||||
# According to http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info :
|
|
||||||
#
|
|
||||||
# 1) when bugs are fixed or internal code is changed: increase MICRO
|
|
||||||
# 2) if API is added, increase MINOR and set MICRO to 0
|
|
||||||
# 3) if API or ABI is broken (this case should (must) never happen as it's very bad for a library), or a new designed library, increase MAJOR and set MINOR and MICRO to 0
|
|
||||||
|
|
||||||
m4_define([OPJ_MAJOR], [1])
|
|
||||||
m4_define([OPJ_MINOR], [5])
|
|
||||||
m4_define([OPJ_MICRO], [2])
|
|
||||||
|
|
||||||
m4_define([lt_cur], m4_eval(OPJ_MAJOR + OPJ_MINOR))
|
|
||||||
m4_define([lt_rev], OPJ_MICRO)
|
|
||||||
m4_define([lt_age], OPJ_MINOR)
|
|
||||||
|
|
||||||
AC_PREREQ([2.62])
|
|
||||||
AC_INIT([OpenJPEG],
|
|
||||||
[OPJ_MAJOR.OPJ_MINOR.OPJ_MICRO],
|
|
||||||
[openjpeg@googlegroups.com],
|
|
||||||
[openjpeg],
|
|
||||||
[http://www.openjpeg.org])
|
|
||||||
AC_CONFIG_SRCDIR([configure.ac])
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
AC_CONFIG_HEADERS([opj_config.h])
|
|
||||||
|
|
||||||
AC_CANONICAL_HOST
|
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2 dist-xz dist-zip])
|
|
||||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
||||||
|
|
||||||
MAJOR_NR=OPJ_MAJOR
|
|
||||||
MINOR_NR=OPJ_MINOR
|
|
||||||
MICRO_NR=OPJ_MICRO
|
|
||||||
AC_SUBST([MAJOR_NR])
|
|
||||||
AC_SUBST([MINOR_NR])
|
|
||||||
AC_SUBST([MICRO_NR])
|
|
||||||
|
|
||||||
LT_PREREQ([2.0])
|
|
||||||
LT_INIT([win32-dll])
|
|
||||||
|
|
||||||
lt_version=lt_cur:lt_rev:lt_age
|
|
||||||
AC_SUBST([lt_version])
|
|
||||||
|
|
||||||
|
|
||||||
### Needed information
|
|
||||||
|
|
||||||
have_win32=no
|
|
||||||
have_darwin="no"
|
|
||||||
case "$host_os" in
|
|
||||||
mingw*)
|
|
||||||
have_win32="yes"
|
|
||||||
;;
|
|
||||||
darwin*)
|
|
||||||
have_darwin="yes"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
|
|
||||||
AM_CONDITIONAL([HAVE_DARWIN], [test "x${have_darwin}" = "xyes"])
|
|
||||||
|
|
||||||
|
|
||||||
### Additional options to configure
|
|
||||||
|
|
||||||
# debug
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([debug],
|
|
||||||
[AC_HELP_STRING([--enable-debug], [build with debug symbols @<:@default=disabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_debug="yes"
|
|
||||||
else
|
|
||||||
want_debug="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_debug="no"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build in debug mode])
|
|
||||||
AC_MSG_RESULT([${want_debug}])
|
|
||||||
|
|
||||||
# MJ2
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([mj2],
|
|
||||||
[AC_HELP_STRING([--enable-mj2], [build mj2 binaries @<:@default=disabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_mj2="yes"
|
|
||||||
else
|
|
||||||
want_mj2="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_mj2="no"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build the MJ2 binaries])
|
|
||||||
AC_MSG_RESULT([${want_mj2}])
|
|
||||||
|
|
||||||
if test "x${want_mj2}" = "xyes" ; then
|
|
||||||
AC_DEFINE(USE_MJ2, [1], [define to 1 if you use mj2])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([WANT_MJ2], [test "x${want_mj2}" = "xyes"])
|
|
||||||
|
|
||||||
# JPWL
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([jpwl],
|
|
||||||
[AC_HELP_STRING([--enable-jpwl], [build JPWL library @<:@default=disabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_jpwl="yes"
|
|
||||||
else
|
|
||||||
want_jpwl="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_jpwl="no"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build the JPWL library])
|
|
||||||
AC_MSG_RESULT([${want_jpwl}])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([WANT_JPWL], [test "x${want_jpwl}" = "xyes"])
|
|
||||||
|
|
||||||
# JPIP
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([jpip],
|
|
||||||
[AC_HELP_STRING([--enable-jpip], [build jpip library @<:@default=disabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_jpip="yes"
|
|
||||||
else
|
|
||||||
want_jpip="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_jpip="no"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build the JPIP library])
|
|
||||||
AC_MSG_RESULT([${want_jpip}])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([jpip-server],
|
|
||||||
[AC_HELP_STRING([--enable-jpip-server], [build jpip server @<:@default=disabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_jpip_server="yes"
|
|
||||||
else
|
|
||||||
want_jpip_server="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_jpip_server="no"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build the JPIP server])
|
|
||||||
AC_MSG_RESULT([${want_jpip_server}])
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for programs
|
|
||||||
|
|
||||||
AC_PROG_CC
|
|
||||||
|
|
||||||
# pkg-config
|
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG
|
|
||||||
|
|
||||||
# Check whether pkg-config supports Requires.private
|
|
||||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
|
|
||||||
pkgconfig_requires_private="Requires.private"
|
|
||||||
else
|
|
||||||
pkgconfig_requires_private="Requires"
|
|
||||||
fi
|
|
||||||
AC_SUBST([pkgconfig_requires_private])
|
|
||||||
AC_SUBST([requirements])
|
|
||||||
|
|
||||||
# doxygen
|
|
||||||
|
|
||||||
OPJ_CHECK_DOXYGEN
|
|
||||||
|
|
||||||
# ln -s
|
|
||||||
|
|
||||||
AC_PROG_LN_S
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for libraries
|
|
||||||
|
|
||||||
# libpng
|
|
||||||
|
|
||||||
have_libpng="no"
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([png],
|
|
||||||
[AC_HELP_STRING([--disable-png], [disable PNG support @<:@default=enabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_png="yes"
|
|
||||||
else
|
|
||||||
want_png="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_png="yes"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build with PNG support])
|
|
||||||
AC_MSG_RESULT([${want_png}])
|
|
||||||
|
|
||||||
if test "x${want_png}" = "xyes" ; then
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES([PNG], [libpng15 zlib],
|
|
||||||
[have_libpng="yes"],
|
|
||||||
[
|
|
||||||
PKG_CHECK_MODULES([PNG], [libpng14 zlib],
|
|
||||||
[have_libpng="yes"],
|
|
||||||
[
|
|
||||||
PKG_CHECK_MODULES([PNG], [libpng12 zlib],
|
|
||||||
[have_libpng="yes"],
|
|
||||||
[
|
|
||||||
PKG_CHECK_MODULES([PNG], [libpng zlib],
|
|
||||||
[have_libpng="yes"],
|
|
||||||
[have_libpng="no"])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
if ! test "x${have_libpng}" = "xyes" ; then
|
|
||||||
|
|
||||||
OPJ_CHECK_LIB([zlib.h],
|
|
||||||
[z],
|
|
||||||
[zlibVersion],
|
|
||||||
[
|
|
||||||
OPJ_CHECK_LIB([png.h],
|
|
||||||
[png],
|
|
||||||
[png_access_version_number],
|
|
||||||
[
|
|
||||||
have_libpng="yes"
|
|
||||||
PNG_CFLAGS="${PNG_CFLAGS} ${Z_CFLAGS}"
|
|
||||||
PNG_LIBS="${PNG_LIBS} ${Z_LIBS}"
|
|
||||||
],
|
|
||||||
[have_libpng="no"])
|
|
||||||
],
|
|
||||||
[have_libpng="no"])
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x${have_libpng}" = "xno" ; then
|
|
||||||
AC_MSG_WARN([Can not find a usuable PNG library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether PNG is available])
|
|
||||||
AC_MSG_RESULT([${have_libpng}])
|
|
||||||
|
|
||||||
if test "x${have_libpng}" = "xyes" ; then
|
|
||||||
AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([with_libpng], [test x${have_libpng} = "xyes"])
|
|
||||||
|
|
||||||
# libtiff
|
|
||||||
|
|
||||||
have_libtiff="no"
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([tiff],
|
|
||||||
[AC_HELP_STRING([--disable-tiff], [disable TIFF support @<:@default=enabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_tiff="yes"
|
|
||||||
else
|
|
||||||
want_tiff="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_tiff="yes"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build with TIFF support])
|
|
||||||
AC_MSG_RESULT([${want_tiff}])
|
|
||||||
|
|
||||||
if test "x${want_tiff}" = "xyes" ; then
|
|
||||||
|
|
||||||
OPJ_CHECK_LIB(
|
|
||||||
[tiff.h],
|
|
||||||
[tiff],
|
|
||||||
[TIFFOpen],
|
|
||||||
[have_libtiff="yes"],
|
|
||||||
[have_libtiff="no"])
|
|
||||||
|
|
||||||
if test "x${have_libtiff}" = "xno" ; then
|
|
||||||
AC_MSG_WARN([Can not find a usuable TIFF library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether TIFF is available])
|
|
||||||
AC_MSG_RESULT([${have_libtiff}])
|
|
||||||
|
|
||||||
if test "x${have_libtiff}" = "xyes" ; then
|
|
||||||
AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([with_libtiff], [test "x${have_libtiff}" = "xyes"])
|
|
||||||
|
|
||||||
# libcms2
|
|
||||||
|
|
||||||
lcms_output="no"
|
|
||||||
have_lcms2="no"
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([lcms2],
|
|
||||||
[AC_HELP_STRING([--disable-lcms2], [disable LCMS-2 support @<:@default=enabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_lcms2="yes"
|
|
||||||
else
|
|
||||||
want_lcms2="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_lcms2="yes"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build with LCMS-2 support])
|
|
||||||
AC_MSG_RESULT([${want_lcms2}])
|
|
||||||
|
|
||||||
if test "x${want_lcms2}" = "xyes" ; then
|
|
||||||
PKG_CHECK_MODULES([LCMS2], [lcms2],
|
|
||||||
[have_lcms2="yes"],
|
|
||||||
[have_lcms2="no"])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether LCMS-2 is available])
|
|
||||||
AC_MSG_RESULT([${have_lcms2}])
|
|
||||||
|
|
||||||
if test "x${have_lcms2}" = "xyes" ; then
|
|
||||||
AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
|
|
||||||
lcms_output="lcms version 2.x"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# libcms1
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([lcms1],
|
|
||||||
[AC_HELP_STRING([--disable-lcms1], [disable LCMS-1 support @<:@default=enabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_lcms1="yes"
|
|
||||||
else
|
|
||||||
want_lcms1="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_lcms1="yes"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build with LCMS-1 support])
|
|
||||||
AC_MSG_RESULT([${want_lcms1}])
|
|
||||||
|
|
||||||
if test "x${have_lcms2}" = "xno" ; then
|
|
||||||
|
|
||||||
if test "x${want_lcms1}" = "xyes" ; then
|
|
||||||
PKG_CHECK_MODULES([LCMS1], [lcms1],
|
|
||||||
[have_lcms1="yes"],
|
|
||||||
[PKG_CHECK_MODULES([LCMS1], [lcms],
|
|
||||||
[have_lcms1="yes"],
|
|
||||||
[have_lcms1="no"])])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether LCMS-1 is available])
|
|
||||||
AC_MSG_RESULT([${have_lcms1}])
|
|
||||||
|
|
||||||
if test "x${have_lcms1}" = "xyes" ; then
|
|
||||||
AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
|
|
||||||
lcms_output="lcms version 1.x"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# threads
|
|
||||||
|
|
||||||
if test "x${want_jpip_server}" = "xyes" ; then
|
|
||||||
|
|
||||||
if test "x${have_win32}" = "xno" ; then
|
|
||||||
|
|
||||||
SAVE_CFLAGS=${CFLAGS}
|
|
||||||
CFLAGS="${CFLAGS} -pthread"
|
|
||||||
SAVE_LIBS=${LIBS}
|
|
||||||
LIBS="${LIBS} -pthread"
|
|
||||||
AC_LINK_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([[
|
|
||||||
#include <pthread.h>
|
|
||||||
]],
|
|
||||||
[[
|
|
||||||
pthread_t id;
|
|
||||||
id = pthread_self();
|
|
||||||
]])],
|
|
||||||
[have_pthread="yes"],
|
|
||||||
[have_pthread="no"])
|
|
||||||
CFLAGS=${SAVE_CFLAGS}
|
|
||||||
LIBS=${SAVE_LIBS}
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether Pthread library is available])
|
|
||||||
AC_MSG_RESULT([${have_pthread}])
|
|
||||||
|
|
||||||
if ! test "x${have_pthread}" = "xyes" ; then
|
|
||||||
AC_MSG_WARN([Pthread library not found. OpenJPIP server will not be compiled.])
|
|
||||||
want_jpip_server="no"
|
|
||||||
else
|
|
||||||
THREAD_CFLAGS="-pthread"
|
|
||||||
THREAD_LIBS="-pthread"
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
THREAD_LIBS="-lws2_32"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_ARG_VAR([THREAD_CFLAGS], [compiler flag for the thread library])
|
|
||||||
AC_SUBST([THREAD_CFLAGS])
|
|
||||||
AC_ARG_VAR([THREAD_LIBS], [linker flags for thread library])
|
|
||||||
AC_SUBST([THREAD_LIBS])
|
|
||||||
|
|
||||||
# libfcgi
|
|
||||||
|
|
||||||
if test "x${want_jpip_server}" = "xyes" ; then
|
|
||||||
|
|
||||||
have_fcgi="no"
|
|
||||||
OPJ_CHECK_LIB(
|
|
||||||
[fcgi_stdio.h],
|
|
||||||
[fcgi],
|
|
||||||
[FCGI_Accept],
|
|
||||||
[have_fcgi="yes"],
|
|
||||||
[have_fcgi="no"])
|
|
||||||
|
|
||||||
if ! test "x${have_fcgi}" = "xyes" ; then
|
|
||||||
AC_MSG_WARN([FastCGI library not found. OpenJPIP server will not be compiled.])
|
|
||||||
want_jpip_server="no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# libcurl
|
|
||||||
|
|
||||||
if test "x${want_jpip_server}" = "xyes" ; then
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES([LIBCURL], [libcurl],
|
|
||||||
[have_libcurl="yes"],
|
|
||||||
[have_libcurl="no"])
|
|
||||||
|
|
||||||
if ! test "x${have_libcurl}" = "xyes" ; then
|
|
||||||
AC_MSG_WARN([libcurl library not found. OpenJPIP server will not be compiled.])
|
|
||||||
want_jpip_server="no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x${want_jpip}" = "xyes" ; then
|
|
||||||
AC_DEFINE(USE_JPIP, [1], [define to 1 if you use jpip])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([WANT_JPIP], [test "x${want_jpip}" = "xyes"])
|
|
||||||
|
|
||||||
if test "x${want_jpip_server}" = "xyes" ; then
|
|
||||||
AC_DEFINE(USE_JPIP_SERVER, [1], [define to 1 if you use jpip server])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([WANT_JPIP_SERVER], [test "x${want_jpip_server}" = "xyes"])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([WANT_JPIP_CODE], [test "x${want_jpip}" = "xyes" || test "x${want_jpip_server}" = "xyes"])
|
|
||||||
|
|
||||||
### Checks for header files
|
|
||||||
|
|
||||||
## FIXME: declarations must be fixed in source code. See autoconf manual
|
|
||||||
AC_HEADER_DIRENT
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for types
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for structures
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for compiler characteristics
|
|
||||||
|
|
||||||
AM_PROG_CC_C_O
|
|
||||||
ac_cv_c_big_endian=0
|
|
||||||
AC_C_BIGENDIAN([ac_cv_c_big_endian=yes], [ac_cv_c_big_endian=no],[])
|
|
||||||
#
|
|
||||||
if test "x${ac_cv_c_big_endian}" = "xyes" ; then
|
|
||||||
AC_DEFINE(OPJ_BIG_ENDIAN, [1], [define to 1 if your machine has BE])
|
|
||||||
AC_DEFINE(WORDS_BIGENDIAN, [1], [define to 1 if your machine has BE])
|
|
||||||
fi
|
|
||||||
#
|
|
||||||
#OPJ_COMPILER_FLAG([-Wall])
|
|
||||||
#OPJ_COMPILER_FLAG([-Wextra])
|
|
||||||
#OPJ_COMPILER_FLAG([-Wshadow])
|
|
||||||
#OPJ_COMPILER_FLAG([-Wpointer-arith])
|
|
||||||
OPJ_COMPILER_FLAG([-Wno-unused-result])
|
|
||||||
|
|
||||||
if test "x${want_debug}" = "xyes" ; then
|
|
||||||
OPJ_COMPILER_FLAG([-g])
|
|
||||||
OPJ_COMPILER_FLAG([-O0])
|
|
||||||
else
|
|
||||||
OPJ_COMPILER_FLAG([-O3])
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for linker characteristics
|
|
||||||
|
|
||||||
|
|
||||||
### Checks for library functions
|
|
||||||
|
|
||||||
|
|
||||||
### Post configuration
|
|
||||||
|
|
||||||
AM_CONDITIONAL([BUILD_SHARED], [test "x${enable_shared}" = "xyes"])
|
|
||||||
AM_CONDITIONAL([BUILD_STATIC], [test "x${enable_static}" = "xyes"])
|
|
||||||
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
|
||||||
Makefile
|
|
||||||
libopenjpeg1.pc
|
|
||||||
libopenjpeg-jpwl.pc
|
|
||||||
libopenjpeg/Makefile
|
|
||||||
libopenjpeg/jpwl/Makefile
|
|
||||||
applications/Makefile
|
|
||||||
applications/codec/Makefile
|
|
||||||
applications/mj2/Makefile
|
|
||||||
applications/jpip/Makefile
|
|
||||||
applications/jpip/libopenjpip/Makefile
|
|
||||||
applications/jpip/util/Makefile
|
|
||||||
doc/Makefile
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
|
||||||
|
|
||||||
### Summary
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "------------------------------------------------------------------------"
|
|
||||||
echo "$PACKAGE $VERSION"
|
|
||||||
echo "------------------------------------------------------------------------"
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "Configuration Options Summary:"
|
|
||||||
echo
|
|
||||||
echo " Debug...............: ${want_debug}"
|
|
||||||
echo
|
|
||||||
echo " Optional support:"
|
|
||||||
echo " libpng............: ${have_libpng}"
|
|
||||||
echo " libtiff...........: ${have_libtiff}"
|
|
||||||
echo " libcms............: ${lcms_output}"
|
|
||||||
echo
|
|
||||||
echo " Documentation.......: ${opj_have_doxygen}"
|
|
||||||
echo " Build.............: make doc"
|
|
||||||
echo
|
|
||||||
echo " mj2.................: ${want_mj2}"
|
|
||||||
echo " jpwl................: ${want_jpwl}"
|
|
||||||
echo " jpip................: ${want_jpip}"
|
|
||||||
echo " jpip server.........: ${want_jpip_server}"
|
|
||||||
echo
|
|
||||||
@@ -3,24 +3,50 @@
|
|||||||
# to generate the html documentation in the doc/html repository of the build folder.
|
# to generate the html documentation in the doc/html repository of the build folder.
|
||||||
|
|
||||||
# Try to find the doxygen tool
|
# Try to find the doxygen tool
|
||||||
FIND_PACKAGE(Doxygen)
|
find_package(Doxygen)
|
||||||
|
|
||||||
IF(DOXYGEN_FOUND)
|
if(DOXYGEN_FOUND)
|
||||||
# Configure the doxygen config file with variable from CMake and move it
|
# Configure the doxygen config file with variable from CMake and move it
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.cmake.in
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY)
|
${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY)
|
||||||
|
|
||||||
# Configure the html mainpage file of the doxygen documentation with variable
|
# Configure the html mainpage file of the doxygen documentation with variable
|
||||||
# from CMake and move it
|
# from CMake and move it
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.cmake
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.in
|
||||||
${CMAKE_BINARY_DIR}/doc/mainpage.dox @ONLY)
|
${CMAKE_BINARY_DIR}/doc/mainpage.dox @ONLY)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpip.dox.in
|
||||||
|
${CMAKE_BINARY_DIR}/doc/openjpip.dox @ONLY)
|
||||||
|
# copy png file to make local (binary tree) documentation valid:
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jpip_architect.png
|
||||||
|
${CMAKE_BINARY_DIR}/doc/html/jpip_architect.png COPYONLY)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jpip_protocol.png
|
||||||
|
${CMAKE_BINARY_DIR}/doc/html/jpip_protocol.png COPYONLY)
|
||||||
|
|
||||||
|
file(GLOB headers
|
||||||
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/*.h
|
||||||
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/*.c
|
||||||
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjpip/*.h
|
||||||
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjpip/*.c
|
||||||
|
)
|
||||||
# Generate new target to build the html documentation
|
# Generate new target to build the html documentation
|
||||||
ADD_CUSTOM_TARGET(doc ALL
|
add_custom_command(
|
||||||
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox)
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html
|
||||||
|
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox
|
||||||
|
DEPENDS ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox
|
||||||
|
${CMAKE_BINARY_DIR}/doc/mainpage.dox
|
||||||
|
${CMAKE_BINARY_DIR}/doc/openjpip.dox
|
||||||
|
${headers}
|
||||||
|
)
|
||||||
|
add_custom_target(doc ALL
|
||||||
|
DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html
|
||||||
|
COMMENT "Building doxygen documentation"
|
||||||
|
)
|
||||||
|
|
||||||
ELSE(DOXYGEN_FOUND)
|
# install HTML documentation (install png files too):
|
||||||
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html
|
||||||
MESSAGE(STATUS "Doxygen not found, we cannot generate the documentation")
|
DESTINATION share/doc
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
ENDIF(DOXYGEN_FOUND)
|
)
|
||||||
|
else()
|
||||||
|
message(STATUS "Doxygen not found, we cannot generate the documentation")
|
||||||
|
endif()
|
||||||
|
|||||||
290
doc/Doxyfile.dox
290
doc/Doxyfile.dox
@@ -1,290 +0,0 @@
|
|||||||
# Doxyfile 1.7.3
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Project related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
|
||||||
PROJECT_NAME = OpenJPEG
|
|
||||||
PROJECT_NUMBER =
|
|
||||||
PROJECT_BRIEF =
|
|
||||||
PROJECT_LOGO =
|
|
||||||
OUTPUT_DIRECTORY = .
|
|
||||||
CREATE_SUBDIRS = NO
|
|
||||||
OUTPUT_LANGUAGE = English
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
|
||||||
REPEAT_BRIEF = YES
|
|
||||||
ABBREVIATE_BRIEF = "The $name class" \
|
|
||||||
"The $name widget" \
|
|
||||||
"The $name file" \
|
|
||||||
is \
|
|
||||||
provides \
|
|
||||||
specifies \
|
|
||||||
contains \
|
|
||||||
represents \
|
|
||||||
a \
|
|
||||||
an \
|
|
||||||
the
|
|
||||||
ALWAYS_DETAILED_SEC = NO
|
|
||||||
INLINE_INHERITED_MEMB = NO
|
|
||||||
FULL_PATH_NAMES = NO
|
|
||||||
STRIP_FROM_PATH = C://
|
|
||||||
STRIP_FROM_INC_PATH =
|
|
||||||
SHORT_NAMES = NO
|
|
||||||
JAVADOC_AUTOBRIEF = YES
|
|
||||||
QT_AUTOBRIEF = NO
|
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
|
||||||
INHERIT_DOCS = YES
|
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
|
||||||
TAB_SIZE = 8
|
|
||||||
ALIASES =
|
|
||||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
|
||||||
OPTIMIZE_OUTPUT_JAVA = NO
|
|
||||||
OPTIMIZE_FOR_FORTRAN = NO
|
|
||||||
OPTIMIZE_OUTPUT_VHDL = NO
|
|
||||||
EXTENSION_MAPPING =
|
|
||||||
BUILTIN_STL_SUPPORT = NO
|
|
||||||
CPP_CLI_SUPPORT = NO
|
|
||||||
SIP_SUPPORT = NO
|
|
||||||
IDL_PROPERTY_SUPPORT = YES
|
|
||||||
DISTRIBUTE_GROUP_DOC = NO
|
|
||||||
SUBGROUPING = YES
|
|
||||||
TYPEDEF_HIDES_STRUCT = NO
|
|
||||||
SYMBOL_CACHE_SIZE = 0
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Build related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
EXTRACT_ALL = YES
|
|
||||||
EXTRACT_PRIVATE = YES
|
|
||||||
EXTRACT_STATIC = YES
|
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
|
||||||
EXTRACT_LOCAL_METHODS = NO
|
|
||||||
EXTRACT_ANON_NSPACES = NO
|
|
||||||
HIDE_UNDOC_MEMBERS = NO
|
|
||||||
HIDE_UNDOC_CLASSES = NO
|
|
||||||
HIDE_FRIEND_COMPOUNDS = NO
|
|
||||||
HIDE_IN_BODY_DOCS = NO
|
|
||||||
INTERNAL_DOCS = NO
|
|
||||||
CASE_SENSE_NAMES = NO
|
|
||||||
HIDE_SCOPE_NAMES = NO
|
|
||||||
SHOW_INCLUDE_FILES = YES
|
|
||||||
FORCE_LOCAL_INCLUDES = NO
|
|
||||||
INLINE_INFO = YES
|
|
||||||
SORT_MEMBER_DOCS = YES
|
|
||||||
SORT_BRIEF_DOCS = NO
|
|
||||||
SORT_MEMBERS_CTORS_1ST = NO
|
|
||||||
SORT_GROUP_NAMES = NO
|
|
||||||
SORT_BY_SCOPE_NAME = NO
|
|
||||||
STRICT_PROTO_MATCHING = NO
|
|
||||||
GENERATE_TODOLIST = YES
|
|
||||||
GENERATE_TESTLIST = YES
|
|
||||||
GENERATE_BUGLIST = YES
|
|
||||||
GENERATE_DEPRECATEDLIST= YES
|
|
||||||
ENABLED_SECTIONS =
|
|
||||||
MAX_INITIALIZER_LINES = 30
|
|
||||||
SHOW_USED_FILES = YES
|
|
||||||
SHOW_DIRECTORIES = NO
|
|
||||||
SHOW_FILES = YES
|
|
||||||
SHOW_NAMESPACES = YES
|
|
||||||
FILE_VERSION_FILTER =
|
|
||||||
LAYOUT_FILE =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to warning and progress messages
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
QUIET = NO
|
|
||||||
WARNINGS = YES
|
|
||||||
WARN_IF_UNDOCUMENTED = YES
|
|
||||||
WARN_IF_DOC_ERROR = YES
|
|
||||||
WARN_NO_PARAMDOC = NO
|
|
||||||
WARN_FORMAT = "$file:$line: $text"
|
|
||||||
WARN_LOGFILE =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the input files
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
INPUT = ../libopenjpeg \
|
|
||||||
../libopenjpeg/jpwl
|
|
||||||
INPUT_ENCODING = UTF-8
|
|
||||||
FILE_PATTERNS = *.h \
|
|
||||||
*.c
|
|
||||||
RECURSIVE = NO
|
|
||||||
EXCLUDE =
|
|
||||||
EXCLUDE_SYMLINKS = NO
|
|
||||||
EXCLUDE_PATTERNS =
|
|
||||||
EXCLUDE_SYMBOLS =
|
|
||||||
EXAMPLE_PATH =
|
|
||||||
EXAMPLE_PATTERNS = *
|
|
||||||
EXAMPLE_RECURSIVE = NO
|
|
||||||
IMAGE_PATH =
|
|
||||||
INPUT_FILTER =
|
|
||||||
FILTER_PATTERNS =
|
|
||||||
FILTER_SOURCE_FILES = NO
|
|
||||||
FILTER_SOURCE_PATTERNS =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to source browsing
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
SOURCE_BROWSER = NO
|
|
||||||
INLINE_SOURCES = NO
|
|
||||||
STRIP_CODE_COMMENTS = YES
|
|
||||||
REFERENCED_BY_RELATION = YES
|
|
||||||
REFERENCES_RELATION = YES
|
|
||||||
REFERENCES_LINK_SOURCE = YES
|
|
||||||
USE_HTAGS = NO
|
|
||||||
VERBATIM_HEADERS = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the alphabetical class index
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ALPHABETICAL_INDEX = NO
|
|
||||||
COLS_IN_ALPHA_INDEX = 5
|
|
||||||
IGNORE_PREFIX =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the HTML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_HTML = YES
|
|
||||||
HTML_OUTPUT = ./html
|
|
||||||
HTML_FILE_EXTENSION = .html
|
|
||||||
HTML_HEADER =
|
|
||||||
HTML_FOOTER =
|
|
||||||
HTML_STYLESHEET =
|
|
||||||
HTML_COLORSTYLE_HUE = 220
|
|
||||||
HTML_COLORSTYLE_SAT = 100
|
|
||||||
HTML_COLORSTYLE_GAMMA = 80
|
|
||||||
HTML_TIMESTAMP = NO
|
|
||||||
HTML_ALIGN_MEMBERS = YES
|
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
|
||||||
GENERATE_DOCSET = NO
|
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
|
||||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
|
||||||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
|
||||||
DOCSET_PUBLISHER_NAME = Publisher
|
|
||||||
GENERATE_HTMLHELP = NO
|
|
||||||
CHM_FILE =
|
|
||||||
HHC_LOCATION =
|
|
||||||
GENERATE_CHI = NO
|
|
||||||
CHM_INDEX_ENCODING =
|
|
||||||
BINARY_TOC = NO
|
|
||||||
TOC_EXPAND = NO
|
|
||||||
GENERATE_QHP = NO
|
|
||||||
QCH_FILE =
|
|
||||||
QHP_NAMESPACE = org.doxygen.Project
|
|
||||||
QHP_VIRTUAL_FOLDER = doc
|
|
||||||
QHP_CUST_FILTER_NAME =
|
|
||||||
QHP_CUST_FILTER_ATTRS =
|
|
||||||
QHP_SECT_FILTER_ATTRS =
|
|
||||||
QHG_LOCATION =
|
|
||||||
GENERATE_ECLIPSEHELP = NO
|
|
||||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
|
||||||
DISABLE_INDEX = NO
|
|
||||||
ENUM_VALUES_PER_LINE = 4
|
|
||||||
GENERATE_TREEVIEW = NO
|
|
||||||
USE_INLINE_TREES = NO
|
|
||||||
TREEVIEW_WIDTH = 250
|
|
||||||
EXT_LINKS_IN_WINDOW = NO
|
|
||||||
FORMULA_FONTSIZE = 10
|
|
||||||
FORMULA_TRANSPARENT = YES
|
|
||||||
USE_MATHJAX = NO
|
|
||||||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
|
||||||
SEARCHENGINE = NO
|
|
||||||
SERVER_BASED_SEARCH = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the LaTeX output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_LATEX = NO
|
|
||||||
LATEX_OUTPUT = latex
|
|
||||||
LATEX_CMD_NAME = latex
|
|
||||||
MAKEINDEX_CMD_NAME = makeindex
|
|
||||||
COMPACT_LATEX = NO
|
|
||||||
PAPER_TYPE = a4wide
|
|
||||||
EXTRA_PACKAGES =
|
|
||||||
LATEX_HEADER =
|
|
||||||
PDF_HYPERLINKS = NO
|
|
||||||
USE_PDFLATEX = NO
|
|
||||||
LATEX_BATCHMODE = NO
|
|
||||||
LATEX_HIDE_INDICES = NO
|
|
||||||
LATEX_SOURCE_CODE = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the RTF output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_RTF = NO
|
|
||||||
RTF_OUTPUT = rtf
|
|
||||||
COMPACT_RTF = NO
|
|
||||||
RTF_HYPERLINKS = NO
|
|
||||||
RTF_STYLESHEET_FILE =
|
|
||||||
RTF_EXTENSIONS_FILE =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the man page output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_MAN = NO
|
|
||||||
MAN_OUTPUT = man
|
|
||||||
MAN_EXTENSION = .3
|
|
||||||
MAN_LINKS = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the XML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_XML = NO
|
|
||||||
XML_OUTPUT = xml
|
|
||||||
XML_SCHEMA =
|
|
||||||
XML_DTD =
|
|
||||||
XML_PROGRAMLISTING = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options for the AutoGen Definitions output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_AUTOGEN_DEF = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the Perl module output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_PERLMOD = NO
|
|
||||||
PERLMOD_LATEX = NO
|
|
||||||
PERLMOD_PRETTY = YES
|
|
||||||
PERLMOD_MAKEVAR_PREFIX =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the preprocessor
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ENABLE_PREPROCESSING = YES
|
|
||||||
MACRO_EXPANSION = NO
|
|
||||||
EXPAND_ONLY_PREDEF = NO
|
|
||||||
SEARCH_INCLUDES = YES
|
|
||||||
INCLUDE_PATH =
|
|
||||||
INCLUDE_FILE_PATTERNS =
|
|
||||||
PREDEFINED = USE_JPWL \
|
|
||||||
USE_JPSEC
|
|
||||||
EXPAND_AS_DEFINED =
|
|
||||||
SKIP_FUNCTION_MACROS = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration::additions related to external references
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
TAGFILES =
|
|
||||||
GENERATE_TAGFILE =
|
|
||||||
ALLEXTERNALS = NO
|
|
||||||
EXTERNAL_GROUPS = YES
|
|
||||||
PERL_PATH = /usr/bin/perl
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the dot tool
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
CLASS_DIAGRAMS = YES
|
|
||||||
MSCGEN_PATH =
|
|
||||||
HIDE_UNDOC_RELATIONS = YES
|
|
||||||
HAVE_DOT = NO
|
|
||||||
DOT_NUM_THREADS = 0
|
|
||||||
DOT_FONTNAME = Helvetica
|
|
||||||
DOT_FONTSIZE = 10
|
|
||||||
DOT_FONTPATH =
|
|
||||||
CLASS_GRAPH = YES
|
|
||||||
COLLABORATION_GRAPH = YES
|
|
||||||
GROUP_GRAPHS = YES
|
|
||||||
UML_LOOK = NO
|
|
||||||
TEMPLATE_RELATIONS = NO
|
|
||||||
INCLUDE_GRAPH = YES
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
|
||||||
CALL_GRAPH = NO
|
|
||||||
CALLER_GRAPH = NO
|
|
||||||
GRAPHICAL_HIERARCHY = YES
|
|
||||||
DIRECTORY_GRAPH = YES
|
|
||||||
DOT_IMAGE_FORMAT = png
|
|
||||||
DOT_PATH =
|
|
||||||
DOTFILE_DIRS =
|
|
||||||
MSCFILE_DIRS =
|
|
||||||
DOT_GRAPH_MAX_NODES = 50
|
|
||||||
MAX_DOT_GRAPH_DEPTH = 1000
|
|
||||||
DOT_TRANSPARENT = NO
|
|
||||||
DOT_MULTI_TARGETS = NO
|
|
||||||
GENERATE_LEGEND = YES
|
|
||||||
DOT_CLEANUP = YES
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Doxyfile 1.7.3
|
# Doxyfile 1.7.1
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = OpenJPEG
|
PROJECT_NAME = OpenJPEG
|
||||||
PROJECT_NUMBER = @OPENJPEG_VERSION@
|
PROJECT_NUMBER = @OPENJPEG_VERSION@
|
||||||
PROJECT_BRIEF =
|
|
||||||
PROJECT_LOGO =
|
|
||||||
OUTPUT_DIRECTORY = @OPENJPEG_BINARY_DIR@/doc
|
OUTPUT_DIRECTORY = @OPENJPEG_BINARY_DIR@/doc
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
@@ -74,7 +72,6 @@ SORT_BRIEF_DOCS = NO
|
|||||||
SORT_MEMBERS_CTORS_1ST = NO
|
SORT_MEMBERS_CTORS_1ST = NO
|
||||||
SORT_GROUP_NAMES = NO
|
SORT_GROUP_NAMES = NO
|
||||||
SORT_BY_SCOPE_NAME = NO
|
SORT_BY_SCOPE_NAME = NO
|
||||||
STRICT_PROTO_MATCHING = NO
|
|
||||||
GENERATE_TODOLIST = YES
|
GENERATE_TODOLIST = YES
|
||||||
GENERATE_TESTLIST = YES
|
GENERATE_TESTLIST = YES
|
||||||
GENERATE_BUGLIST = YES
|
GENERATE_BUGLIST = YES
|
||||||
@@ -100,7 +97,8 @@ WARN_LOGFILE =
|
|||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to the input files
|
# configuration options related to the input files
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
INPUT = @OPENJPEG_SOURCE_DIR@/libopenjpeg \
|
INPUT = @OPENJPEG_SOURCE_DIR@/src/lib/openjp2 \
|
||||||
|
@OPENJPEG_SOURCE_DIR@/src/lib/openjpip \
|
||||||
@OPENJPEG_BINARY_DIR@/doc
|
@OPENJPEG_BINARY_DIR@/doc
|
||||||
INPUT_ENCODING = UTF-8
|
INPUT_ENCODING = UTF-8
|
||||||
FILE_PATTERNS = *.h \
|
FILE_PATTERNS = *.h \
|
||||||
@@ -109,16 +107,15 @@ FILE_PATTERNS = *.h \
|
|||||||
RECURSIVE = YES
|
RECURSIVE = YES
|
||||||
EXCLUDE =
|
EXCLUDE =
|
||||||
EXCLUDE_SYMLINKS = NO
|
EXCLUDE_SYMLINKS = NO
|
||||||
EXCLUDE_PATTERNS =
|
EXCLUDE_PATTERNS = */.svn/*
|
||||||
EXCLUDE_SYMBOLS =
|
EXCLUDE_SYMBOLS =
|
||||||
EXAMPLE_PATH =
|
EXAMPLE_PATH =
|
||||||
EXAMPLE_PATTERNS = *
|
EXAMPLE_PATTERNS = *
|
||||||
EXAMPLE_RECURSIVE = NO
|
EXAMPLE_RECURSIVE = NO
|
||||||
IMAGE_PATH =
|
IMAGE_PATH = @OPENJPEG_SOURCE_DIR@/doc
|
||||||
INPUT_FILTER =
|
INPUT_FILTER =
|
||||||
FILTER_PATTERNS =
|
FILTER_PATTERNS =
|
||||||
FILTER_SOURCE_FILES = NO
|
FILTER_SOURCE_FILES = NO
|
||||||
FILTER_SOURCE_PATTERNS =
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to source browsing
|
# configuration options related to source browsing
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@@ -148,7 +145,7 @@ HTML_STYLESHEET =
|
|||||||
HTML_COLORSTYLE_HUE = 220
|
HTML_COLORSTYLE_HUE = 220
|
||||||
HTML_COLORSTYLE_SAT = 100
|
HTML_COLORSTYLE_SAT = 100
|
||||||
HTML_COLORSTYLE_GAMMA = 80
|
HTML_COLORSTYLE_GAMMA = 80
|
||||||
HTML_TIMESTAMP = NO
|
HTML_TIMESTAMP = NO
|
||||||
HTML_ALIGN_MEMBERS = YES
|
HTML_ALIGN_MEMBERS = YES
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
HTML_DYNAMIC_SECTIONS = NO
|
||||||
GENERATE_DOCSET = NO
|
GENERATE_DOCSET = NO
|
||||||
@@ -181,8 +178,6 @@ TREEVIEW_WIDTH = 250
|
|||||||
EXT_LINKS_IN_WINDOW = NO
|
EXT_LINKS_IN_WINDOW = NO
|
||||||
FORMULA_FONTSIZE = 10
|
FORMULA_FONTSIZE = 10
|
||||||
FORMULA_TRANSPARENT = YES
|
FORMULA_TRANSPARENT = YES
|
||||||
USE_MATHJAX = NO
|
|
||||||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
|
||||||
SEARCHENGINE = NO
|
SEARCHENGINE = NO
|
||||||
SERVER_BASED_SEARCH = NO
|
SERVER_BASED_SEARCH = NO
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@@ -282,7 +277,6 @@ DIRECTORY_GRAPH = YES
|
|||||||
DOT_IMAGE_FORMAT = png
|
DOT_IMAGE_FORMAT = png
|
||||||
DOT_PATH =
|
DOT_PATH =
|
||||||
DOTFILE_DIRS =
|
DOTFILE_DIRS =
|
||||||
MSCFILE_DIRS =
|
|
||||||
DOT_GRAPH_MAX_NODES = 50
|
DOT_GRAPH_MAX_NODES = 50
|
||||||
MAX_DOT_GRAPH_DEPTH = 1000
|
MAX_DOT_GRAPH_DEPTH = 1000
|
||||||
DOT_TRANSPARENT = NO
|
DOT_TRANSPARENT = NO
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
.PHONY: doc
|
|
||||||
|
|
||||||
PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
|
|
||||||
|
|
||||||
if OPJ_BUILD_DOC
|
|
||||||
|
|
||||||
doc-clean:
|
|
||||||
rm -rf $(top_srcdir)/doc/html/ $(top_srcdir)/doc/$(PACKAGE_DOCNAME).tar*
|
|
||||||
|
|
||||||
doc: all
|
|
||||||
cd $(top_srcdir)/doc && \
|
|
||||||
$(opj_doxygen) Doxyfile.dox
|
|
||||||
rm -rf $(PACKAGE_DOCNAME).tar*
|
|
||||||
rm -rf $(top_srcdir)/doc/$(PACKAGE_DOCNAME).tar*
|
|
||||||
mkdir -p $(PACKAGE_DOCNAME)/doc
|
|
||||||
cp -R $(top_srcdir)/doc/html/ $(PACKAGE_DOCNAME)/doc
|
|
||||||
tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
|
|
||||||
bzip2 -9 $(PACKAGE_DOCNAME).tar
|
|
||||||
rm -rf $(PACKAGE_DOCNAME)/
|
|
||||||
if ! test -f $(top_srcdir)/doc/$(PACKAGE_DOCNAME).tar.bz2 ; then \
|
|
||||||
mv $(PACKAGE_DOCNAME).tar.bz2 $(top_srcdir)/doc; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
clean-local: doc-clean
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
doc:
|
|
||||||
@echo "Documentation not built. Run ./configure --help"
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
docsdir = $(docdir)-$(MAJOR_NR).$(MINOR_NR)
|
|
||||||
docs_DATA = $(top_builddir)/LICENSE
|
|
||||||
|
|
||||||
dist_man1_MANS = \
|
|
||||||
man/man1/image_to_j2k.1 \
|
|
||||||
man/man1/j2k_dump.1 \
|
|
||||||
man/man1/j2k_to_image.1
|
|
||||||
|
|
||||||
dist_man3_MANS = \
|
|
||||||
man/man3/libopenjpeg.3
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
@echo -e " (MAN)\t$(man1dir)/image_to_j2k.1" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (MAN)\t$(man1dir)/j2k_dump.1" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (MAN)\t$(man1dir)/j2k_to_image.1" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (MAN)\t$(man3dir)/libopenjpeg.3" >> $(top_builddir)/report.txt
|
|
||||||
if WANT_JPWL
|
|
||||||
cd $(DESTDIR)$(man1dir) && \
|
|
||||||
rm -f jpwl_image_to_j2k.1 && \
|
|
||||||
$(LN_S) image_to_j2k.1 jpwl_image_to_j2k.1
|
|
||||||
cd $(DESTDIR)$(man1dir) && \
|
|
||||||
rm -f jpwl_j2k_to_image.1 && \
|
|
||||||
$(LN_S) j2k_to_image.1 jpwl_j2k_to_image.1
|
|
||||||
cd $(DESTDIR)$(man3dir) && \
|
|
||||||
rm -f jpwl_libopenjpeg.3 && \
|
|
||||||
$(LN_S) libopenjpeg.3 jpwl_libopenjpeg.3
|
|
||||||
@echo -e " (LN)\t$(man1dir)/jpwl_image_to_j2k.1" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (LN)\t$(man1dir)//jpwl_j2k_to_image.1" >> $(top_builddir)/report.txt
|
|
||||||
@echo -e " (LN)\t$(man3dir)/jpwl_libopenjpeg.3" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
if WANT_JPWL
|
|
||||||
rm -f $(DESTDIR)$(man1dir)/jpwl_image_to_j2k.1
|
|
||||||
rm -f $(DESTDIR)$(man1dir)/jpwl_j2k_to_image.1
|
|
||||||
rm -f $(DESTDIR)$(man3dir)/jpwl_libopenjpeg.3
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CMakeLists.txt \
|
|
||||||
Doxyfile.dox
|
|
||||||
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: mainpage.dox.cmake 2011-09-21 Mickael Savinaud $
|
* $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>
|
* Copyright (c) 2011, Mickael Savinaud, Communications & Systemes <mickael.savinaud@c-s.fr>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -26,31 +26,31 @@
|
|||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \mainpage OpenJPEG v@OPENJPEG_VERSION@ Documentation
|
/*! \mainpage OpenJPEG v@OPENJPEG_VERSION@ Documentation
|
||||||
*
|
*
|
||||||
* \section intro Introduction
|
* \section intro Introduction
|
||||||
* This manual documents the low-level OpenJPEG C API.\n
|
* This manual documents the low-level OpenJPEG C API.\n
|
||||||
* The OpenJPEG library is an open-source JPEG 2000 library developed in order to promote the use of JPEG 2000.\n
|
* The OpenJPEG library is an open-source JPEG 2000 library developed in order to promote the use of JPEG 2000.\n
|
||||||
* This documents is focused on the main part of the library which try to implement Part 1 and Part 2 of the JPEG2000 norm.\n
|
* This documents is focused on the main part of the library which try to implement Part 1 and Part 2 of the JPEG2000 norm.\n
|
||||||
*
|
*
|
||||||
* \section home Home page
|
* \section home Home page
|
||||||
*
|
*
|
||||||
* The Home Page of the OpenJPEG library can be found at:
|
* The Home Page of the OpenJPEG project can be found at:
|
||||||
*
|
|
||||||
* http://code.google.com/p/openjpeg/
|
|
||||||
*
|
|
||||||
* More information about the OpenJPEG library is available here:
|
|
||||||
*
|
*
|
||||||
* http://www.openjpeg.org/
|
* http://www.openjpeg.org/
|
||||||
*
|
*
|
||||||
|
* The source code repository is available here:
|
||||||
|
*
|
||||||
|
* http://github.com/uclouvain/openjpeg
|
||||||
|
*
|
||||||
* The OpenJPEG mailing list is located here:
|
* The OpenJPEG mailing list is located here:
|
||||||
*
|
*
|
||||||
* http://groups.google.com/group/openjpeg
|
* 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
|
* \section license License
|
||||||
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
|
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
|
||||||
@@ -59,4 +59,4 @@
|
|||||||
*
|
*
|
||||||
* \author OpenJPEG Team
|
* \author OpenJPEG Team
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
.SP
|
.SP
|
||||||
.fi
|
.fi
|
||||||
..
|
..
|
||||||
.TH image_to_j2k 1 "Version 1.4.0" "image_to_j2k" "converts to jpeg2000 files"
|
.TH opj_compress 1 "Version 2.1.1" "opj_compress" "converts to jpeg2000 files"
|
||||||
.P
|
.P
|
||||||
.SH NAME
|
.SH NAME
|
||||||
image_to_j2k -
|
opj_compress -
|
||||||
This program reads in an image of a certain type and converts it to a
|
This program reads in an image of a certain type and converts it to a
|
||||||
jpeg2000 file. It is part of the OpenJPEG library.
|
jpeg2000 file. It is part of the OpenJPEG library.
|
||||||
.SP
|
.SP
|
||||||
@@ -43,13 +43,13 @@ Valid output image extensions are
|
|||||||
.B .j2k, .jp2
|
.B .j2k, .jp2
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.P
|
.P
|
||||||
.B image_to_j2k -i \fRinfile.bmp \fB-o \fRoutfile.j2k
|
.B opj_compress -i \fRinfile.bmp \fB-o \fRoutfile.j2k
|
||||||
.P
|
.P
|
||||||
.B image_to_j2k -ImgDir \fRdirectory_name \fB-OutFor \fRjp2
|
.B opj_compress -ImgDir \fRdirectory_name \fB-OutFor \fRjp2
|
||||||
.P
|
.P
|
||||||
.B image_to_j2k -h \fRPrint a help message and exit.
|
.B opj_compress -h \fRPrint a help message and exit.
|
||||||
.P
|
.P
|
||||||
See JPWL OPTIONS for special options
|
.R See JPWL OPTIONS for special options
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B \-\^b " n,n"
|
.B \-\^b " n,n"
|
||||||
@@ -194,18 +194,18 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
|
|||||||
.P
|
.P
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.P
|
.P
|
||||||
.B image_to_j2k -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
|
.P
|
||||||
.B image_to_j2k -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
|
.P
|
||||||
.B image_to_j2k -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
|
.P
|
||||||
.B image_to_j2k -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
|
.P
|
||||||
.SH AUTHORS
|
.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
|
.br
|
||||||
Copyright (c) 2002-2007, Professor Benoit Macq
|
Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
.br
|
.br
|
||||||
Copyright (c) 2001-2003, David Janssens
|
Copyright (c) 2001-2003, David Janssens
|
||||||
.br
|
.br
|
||||||
@@ -218,5 +218,5 @@ Copyright (c) 2005, Herve Drolon, FreeImage Team
|
|||||||
Copyright (c) 2006-2007, Parvatha Elangovan
|
Copyright (c) 2006-2007, Parvatha Elangovan
|
||||||
.P
|
.P
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
j2k_to_image(1) j2k_dump(1)
|
opj_decompress(1) opj_dump(1)
|
||||||
|
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
.SP
|
.SP
|
||||||
.fi
|
.fi
|
||||||
..
|
..
|
||||||
.TH j2k_to_image 1 "Version 1.4.0" "j2k_to_image" "converts jpeg2000 files"
|
.TH opj_decompress 1 "Version 2.1.1" "opj_decompress" "converts jpeg2000 files"
|
||||||
.P
|
.P
|
||||||
.SH NAME
|
.SH NAME
|
||||||
j2k_to_image -
|
opj_decompress -
|
||||||
This program reads in a jpeg2000 image and converts it to another
|
This program reads in a jpeg2000 image and converts it to another
|
||||||
image type. It is part of the OpenJPEG library.
|
image type. It is part of the OpenJPEG library.
|
||||||
.SP
|
.SP
|
||||||
@@ -43,13 +43,13 @@ 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 .
|
.B .bmp, .pgm, .pgx, .png, .pnm, .ppm, .raw, .tga, .tif \fR. For PNG resp. TIF it needs libpng resp. libtiff .
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.P
|
.P
|
||||||
.B j2k_to_image -i \fRinfile.j2k \fB-o \fRoutfile.png
|
.B opj_decompress -i \fRinfile.j2k \fB-o \fRoutfile.png
|
||||||
.P
|
.P
|
||||||
.B j2k_to_image -ImgDir \fRimages/ \fB-OutFor \fRbmp
|
.B opj_decompress -ImgDir \fRimages/ \fB-OutFor \fRbmp
|
||||||
.P
|
.P
|
||||||
.B j2k_to_image -h \fRPrint help message and exit
|
.B opj_decompress -h \fRPrint help message and exit
|
||||||
.P
|
.P
|
||||||
See JPWL OPTIONS for special options
|
.R See JPWL OPTIONS for special options
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B \-\^i "name"
|
.B \-\^i "name"
|
||||||
@@ -73,9 +73,19 @@ n is the maximum number of quality layers to decode. See LAYERS below)
|
|||||||
.B \-\^OutFor "ext"
|
.B \-\^OutFor "ext"
|
||||||
(extension for output files)
|
(extension for output files)
|
||||||
.P
|
.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
|
.SH JPWL OPTIONS
|
||||||
Options usable only if the library has been compiled with
|
Options usable only if the library has been compiled with
|
||||||
.B -DUSE_JPWL
|
.B BUILD_JPWL
|
||||||
.TP
|
.TP
|
||||||
.B -W c\fR[=Nc] (Nc is the number of expected components in the codestream; default:3)
|
.B -W c\fR[=Nc] (Nc is the number of expected components in the codestream; default:3)
|
||||||
.TP
|
.TP
|
||||||
@@ -91,9 +101,9 @@ Set the maximum number of quality layers to decode. If there are less quality la
|
|||||||
.P
|
.P
|
||||||
'\".SH BUGS
|
'\".SH BUGS
|
||||||
.SH AUTHORS
|
.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
|
.br
|
||||||
Copyright (c) 2002-2007, Professor Benoit Macq
|
Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
.br
|
.br
|
||||||
Copyright (c) 2001-2003, David Janssens
|
Copyright (c) 2001-2003, David Janssens
|
||||||
.br
|
.br
|
||||||
@@ -106,4 +116,4 @@ Copyright (c) 2005, Herve Drolon, FreeImage Team
|
|||||||
Copyright (c) 2006-2007, Parvatha Elangovan
|
Copyright (c) 2006-2007, Parvatha Elangovan
|
||||||
.P
|
.P
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
image_to_j2k(1) j2k_dump(1)
|
opj_compress(1) opj_dump(1)
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
.SP
|
.SP
|
||||||
.fi
|
.fi
|
||||||
..
|
..
|
||||||
.TH j2k_dump 1 "Version 1.4.0" "j2k_dump" "dumps jpeg2000 files"
|
.TH opj_dump 1 "Version 2.1.1" "opj_dump" "dumps jpeg2000 files"
|
||||||
.P
|
.P
|
||||||
.SH NAME
|
.SH NAME
|
||||||
j2k_dump -
|
opj_dump -
|
||||||
This program reads in a jpeg2000 image and dumps the contents to stdout. It is part of the OpenJPEG library.
|
This program reads in a jpeg2000 image and dumps the contents to stdout. It is part of the OpenJPEG library.
|
||||||
.SP
|
.SP
|
||||||
Valid input image extensions are
|
Valid input image extensions are
|
||||||
@@ -40,11 +40,11 @@ Valid input image extensions are
|
|||||||
.SP
|
.SP
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.P
|
.P
|
||||||
.B j2k_dump -i \fRinfile.j2k
|
.B opj_dump -i \fRinfile.j2k
|
||||||
.P
|
.P
|
||||||
.B j2k_dump -ImgDir \fRimages/ \fRDump all files in images/
|
.B opj_dump -ImgDir \fRimages/ \fRDump all files in images/
|
||||||
.P
|
.P
|
||||||
.B j2k_dump -h \fRPrint help message and exit
|
.B opj_dump -h \fRPrint help message and exit
|
||||||
.P
|
.P
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
@@ -56,7 +56,7 @@ Valid input image extensions are
|
|||||||
.P
|
.P
|
||||||
'\".SH BUGS
|
'\".SH BUGS
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Copyright (c) 20010, Mathieu Malaterre
|
Copyright (c) 2010, Mathieu Malaterre
|
||||||
.P
|
.P
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
image_to_j2k(1) j2k_to_image(1)
|
opj_compress(1) opj_decompress(1)
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
.SP
|
.SP
|
||||||
.fi
|
.fi
|
||||||
..
|
..
|
||||||
.TH libopenjpeg 3 "Oct 2010" "Version 1.4.0" "Oct 2010"
|
.TH libopenjp2 3 "Oct 2010" "Version 1.4.0" "Oct 2010"
|
||||||
.P
|
.P
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libopenjpeg -
|
libopenjp2 -
|
||||||
a library for reading and writing JPEG2000 image files.
|
a library for reading and writing JPEG2000 image files.
|
||||||
.SP
|
.SP
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -124,7 +124,7 @@ a library for reading and writing JPEG2000 image files.
|
|||||||
.B CLRSPC_UNKNOWN\fR or \fBCLRSPC_UNSPECIFIED\fR or \fBCLRSPC_SRGB\fR or \fBCLRSPC_GRAY\fR or \fBCLRSPC_SYCC
|
.B CLRSPC_UNKNOWN\fR or \fBCLRSPC_UNSPECIFIED\fR or \fBCLRSPC_SRGB\fR or \fBCLRSPC_GRAY\fR or \fBCLRSPC_SYCC
|
||||||
.P
|
.P
|
||||||
.SH DECOMPRESSION PARAMETERS
|
.SH DECOMPRESSION PARAMETERS
|
||||||
.P
|
.p
|
||||||
typedef struct opj_dparameters
|
typedef struct opj_dparameters
|
||||||
.br
|
.br
|
||||||
{
|
{
|
||||||
@@ -313,9 +313,9 @@ typedef struct opj_cparameters
|
|||||||
'\".SH OPTIONS
|
'\".SH OPTIONS
|
||||||
'\".SH BUGS
|
'\".SH BUGS
|
||||||
.SH AUTHORS
|
.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
|
Copyright (c) 2001-2003, David Janssens
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: mainpage.h 47 2011-02-17 16:57:49Z kaori $
|
* $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) 2002-2011, Professor Benoit Macq
|
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
* Copyright (c) 2010-2011, Kaori Hagihara
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \mainpage OpenJPIP v2.1 Documentation
|
/*! \page openjpippage OpenJPIP v@OPENJPEG_VERSION@ Documentation
|
||||||
*
|
*
|
||||||
* \section intro Introduction
|
* \section intro Introduction
|
||||||
* This manual documents the low-level OpenJPIP C API.\n
|
* This manual documents the low-level OpenJPIP C API.\n
|
||||||
@@ -36,12 +36,11 @@
|
|||||||
* ( For more info about JPIP, check the website: http://www.jpeg.org/jpeg2000/j2kpart9.html)\n
|
* ( For more info about JPIP, check the website: http://www.jpeg.org/jpeg2000/j2kpart9.html)\n
|
||||||
*
|
*
|
||||||
* This whole documents covers the following six programs.\n
|
* This whole documents covers the following six programs.\n
|
||||||
* - opj_server.c JPIP server supporting HTTP connection and JPT/JPP-stream
|
* - opj_server.c JPIP server supporting HTTP connection and JPT/JPP-stream
|
||||||
* - opj_dec_server.c Server to decode JPT/JPP-stream and communicate locally with JPIP client, which is coded in java
|
* - opj_dec_server.c Server to decode JPT/JPP-stream and communicate locally with JPIP client, which is coded in java
|
||||||
* - addXMLinJP2.c To Embed metadata into JP2 file
|
* - opj_jpip_addxml.c To Embed metadata into JP2 file
|
||||||
* - jpip_to_jp2.c To Convert JPT/JPP-stream to JP2
|
* - opj_jpip_transcode.c To Convert JPT/JPP-stream to JP2 or J2K
|
||||||
* - jpip_to_j2k.c To Convert JPT/JPP-stream to J2K
|
* - opj_jpip_test.c To test index code format of a JP2 file
|
||||||
* - test_index.c To test index code format of a JP2 file
|
|
||||||
*
|
*
|
||||||
* \section license License
|
* \section license License
|
||||||
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
|
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
|
||||||
@@ -65,7 +64,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* \section sysarchtect System Architecture
|
* \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
|
* Figure below represents the overview of our system architecture.\n
|
||||||
* The JPIP server parses JPIP query and sends corresponding JPT/JPP-stream.
|
* 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
|
* The JPIP client viewer is an image viewer with GUI to publish JPIP requests and receive JPT/JPP-stream.\n
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
prefix=@prefix@
|
|
||||||
exec_prefix=@exec_prefix@
|
|
||||||
libdir=@libdir@
|
|
||||||
includedir=@includedir@/openjpeg-@MAJOR_NR@.@MINOR_NR@
|
|
||||||
|
|
||||||
Name: openjpeg
|
|
||||||
Description: JPEG2000 Wireless (Part 11 - JPWL) library
|
|
||||||
URL: http://www.openjpeg.org/
|
|
||||||
Version: @VERSION@
|
|
||||||
@pkgconfig_requires_private@: @requirements@
|
|
||||||
Libs: -L${libdir} -lopenjpeg_JPWL
|
|
||||||
Libs.private: -lm
|
|
||||||
Cflags: -I${includedir}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
INCLUDE_REGULAR_EXPRESSION("^.*$")
|
|
||||||
# Defines the source code for the library
|
|
||||||
SET(OPENJPEG_SRCS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/bio.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cio.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/dwt.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/event.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/image.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/j2k.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/j2k_lib.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/jp2.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/jpt.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/mct.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/mqc.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/openjpeg.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/pi.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/raw.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/t1.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/t2.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/tcd.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/tgt.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cidx_manager.c
|
|
||||||
${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
|
|
||||||
)
|
|
||||||
|
|
||||||
# Build the library
|
|
||||||
IF(WIN32)
|
|
||||||
IF(BUILD_SHARED_LIBS)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
|
||||||
ELSE(BUILD_SHARED_LIBS)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
|
||||||
ENDIF(BUILD_SHARED_LIBS)
|
|
||||||
ENDIF(WIN32)
|
|
||||||
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
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()
|
|
||||||
# Build the JPWL library ?
|
|
||||||
IF(BUILD_JPWL)
|
|
||||||
ADD_SUBDIRECTORY(jpwl)
|
|
||||||
ENDIF(BUILD_JPWL)
|
|
||||||
|
|
||||||
# Install library
|
|
||||||
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}
|
|
||||||
EXPORT OpenJPEGTargets
|
|
||||||
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
||||||
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
||||||
ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
||||||
)
|
|
||||||
|
|
||||||
# Install includes files
|
|
||||||
INSTALL(FILES openjpeg.h
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers
|
|
||||||
)
|
|
||||||
|
|
||||||
# install man page of the library
|
|
||||||
INSTALL(
|
|
||||||
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjpeg.3
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)
|
|
||||||
|
|
||||||
# internal utilities to generate t1_luts.h
|
|
||||||
# no need to install:
|
|
||||||
ADD_EXECUTABLE(t1_generate_luts t1_generate_luts.c)
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(t1_generate_luts m)
|
|
||||||
ENDIF()
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
SUBDIRS = .
|
|
||||||
|
|
||||||
if WANT_JPWL
|
|
||||||
SUBDIRS += jpwl
|
|
||||||
endif
|
|
||||||
|
|
||||||
includesdir = $(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)
|
|
||||||
includes_HEADERS = openjpeg.h
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libopenjpeg.la
|
|
||||||
|
|
||||||
libopenjpeg_la_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg
|
|
||||||
libopenjpeg_la_CFLAGS =
|
|
||||||
libopenjpeg_la_LIBADD = -lm
|
|
||||||
libopenjpeg_la_LDFLAGS = -no-undefined -version-info @lt_version@
|
|
||||||
|
|
||||||
libopenjpeg_la_SOURCES = \
|
|
||||||
bio.c \
|
|
||||||
cio.c \
|
|
||||||
dwt.c \
|
|
||||||
event.c \
|
|
||||||
image.c \
|
|
||||||
j2k.c \
|
|
||||||
j2k_lib.c \
|
|
||||||
jp2.c \
|
|
||||||
jpt.c \
|
|
||||||
mct.c \
|
|
||||||
mqc.c \
|
|
||||||
openjpeg.c \
|
|
||||||
pi.c \
|
|
||||||
raw.c \
|
|
||||||
t1.c \
|
|
||||||
t2.c \
|
|
||||||
tcd.c \
|
|
||||||
tgt.c \
|
|
||||||
cidx_manager.c \
|
|
||||||
phix_manager.c \
|
|
||||||
ppix_manager.c \
|
|
||||||
thix_manager.c \
|
|
||||||
tpix_manager.c \
|
|
||||||
bio.h \
|
|
||||||
cio.h \
|
|
||||||
dwt.h \
|
|
||||||
event.h \
|
|
||||||
fix.h \
|
|
||||||
image.h \
|
|
||||||
indexbox_manager.h \
|
|
||||||
int.h \
|
|
||||||
j2k.h \
|
|
||||||
j2k_lib.h \
|
|
||||||
jp2.h \
|
|
||||||
jpt.h \
|
|
||||||
mct.h \
|
|
||||||
mqc.h \
|
|
||||||
opj_includes.h \
|
|
||||||
opj_malloc.h \
|
|
||||||
pi.h \
|
|
||||||
raw.h \
|
|
||||||
t1.h \
|
|
||||||
t1_luts.h \
|
|
||||||
t2.h \
|
|
||||||
tcd.h \
|
|
||||||
tgt.h \
|
|
||||||
cidx_manager.h
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CMakeLists.txt
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
cd $(DESTDIR)$(includedir) && rm -f openjpeg.h
|
|
||||||
@rm -rf $(top_builddir)/report.txt
|
|
||||||
@echo -e " (LA)\t$(libdir)/libopenjpeg.la" >> $(top_builddir)/report.txt
|
|
||||||
if BUILD_SHARED
|
|
||||||
@( $(call solist) ) >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
if BUILD_STATIC
|
|
||||||
@echo -e " (A)\t$(base)/$(a)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
@echo -e " (H)\t$(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h" >> $(top_builddir)/report.txt
|
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
rm -f $(DESTDIR)$(includedir)/openjpeg.h
|
|
||||||
|
|
||||||
solist = $(foreach f, $(dll) $(so), echo -e ' $(SO_PREFIX)\t$(base)/$(f)' ;)
|
|
||||||
get_tok = $(shell grep -E "^$(1)=" $(lib_LTLIBRARIES) | cut -d "'" -f 2)
|
|
||||||
base = $(call get_tok,libdir)
|
|
||||||
so = $(call get_tok,library_names)
|
|
||||||
a = $(call get_tok,old_library)
|
|
||||||
|
|
||||||
if HAVE_WIN32
|
|
||||||
SO_PREFIX = (DLL)
|
|
||||||
dll = $(call get_tok,dlname)
|
|
||||||
else
|
|
||||||
if HAVE_DARWIN
|
|
||||||
SO_PREFIX = (DY)
|
|
||||||
dll =
|
|
||||||
else
|
|
||||||
SO_PREFIX = (SO)
|
|
||||||
dll =
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
/*
|
|
||||||
* $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) 2003-2004, Yannick Verschueren
|
|
||||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
|
||||||
* 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_includes.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write CPTR Codestream finder box
|
|
||||||
*
|
|
||||||
* @param[in] coff offset of j2k codestream
|
|
||||||
* @param[in] clen length of j2k codestream
|
|
||||||
* @param[in] cio file output handle
|
|
||||||
*/
|
|
||||||
void write_cptr(int coff, int clen, opj_cio_t *cio);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write main header index table (box)
|
|
||||||
*
|
|
||||||
* @param[in] coff offset of j2k codestream
|
|
||||||
* @param[in] cstr_info codestream information
|
|
||||||
* @param[in] cio file output handle
|
|
||||||
* @return length of mainmhix box
|
|
||||||
*/
|
|
||||||
int write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if EPH option is used
|
|
||||||
*
|
|
||||||
* @param[in] coff offset of j2k codestream
|
|
||||||
* @param[in] markers marker information
|
|
||||||
* @param[in] marknum number of markers
|
|
||||||
* @param[in] cio file output handle
|
|
||||||
* @return true if EPH is used
|
|
||||||
*/
|
|
||||||
opj_bool check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_cio_t *cio);
|
|
||||||
|
|
||||||
|
|
||||||
int write_cidx( int offset, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t cstr_info, int j2klen)
|
|
||||||
{
|
|
||||||
int len, i, lenp;
|
|
||||||
opj_jp2_box_t *box;
|
|
||||||
int num_box = 0;
|
|
||||||
opj_bool EPHused;
|
|
||||||
(void)image; /* unused ? */
|
|
||||||
|
|
||||||
lenp = -1;
|
|
||||||
box = (opj_jp2_box_t *)opj_calloc( 32, sizeof(opj_jp2_box_t));
|
|
||||||
|
|
||||||
for (i=0;i<2;i++){
|
|
||||||
|
|
||||||
if(i)
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_CIDX, 4); /* CIDX */
|
|
||||||
write_cptr( offset, cstr_info.codestream_size, cio);
|
|
||||||
|
|
||||||
write_manf( i, num_box, box, cio);
|
|
||||||
|
|
||||||
num_box = 0;
|
|
||||||
box[num_box].length = write_mainmhix( offset, cstr_info, cio);
|
|
||||||
box[num_box].type = JPIP_MHIX;
|
|
||||||
num_box++;
|
|
||||||
|
|
||||||
box[num_box].length = write_tpix( offset, cstr_info, j2klen, cio);
|
|
||||||
box[num_box].type = JPIP_TPIX;
|
|
||||||
num_box++;
|
|
||||||
|
|
||||||
box[num_box].length = write_thix( offset, cstr_info, cio);
|
|
||||||
box[num_box].type = JPIP_THIX;
|
|
||||||
num_box++;
|
|
||||||
|
|
||||||
EPHused = check_EPHuse( offset, cstr_info.marker, cstr_info.marknum, cio);
|
|
||||||
|
|
||||||
box[num_box].length = write_ppix( offset, cstr_info, EPHused, j2klen, cio);
|
|
||||||
box[num_box].type = JPIP_PPIX;
|
|
||||||
num_box++;
|
|
||||||
|
|
||||||
box[num_box].length = write_phix( offset, cstr_info, EPHused, j2klen, cio);
|
|
||||||
box[num_box].type = JPIP_PHIX;
|
|
||||||
num_box++;
|
|
||||||
|
|
||||||
len = cio_tell( cio)-lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
}
|
|
||||||
|
|
||||||
opj_free( box);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_cptr(int coff, int clen, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp;
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_CPTR, 4); /* T */
|
|
||||||
cio_write( cio, 0, 2); /* DR A PRECISER !! */
|
|
||||||
cio_write( cio, 0, 2); /* CONT */
|
|
||||||
cio_write( cio, coff, 8); /* COFF A PRECISER !! */
|
|
||||||
cio_write( cio, clen, 8); /* CLEN */
|
|
||||||
len = cio_tell( cio) - lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_manf(int second, int v, opj_jp2_box_t *box, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp, i;
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_MANF,4); /* T */
|
|
||||||
|
|
||||||
if (second){ /* Write only during the second pass */
|
|
||||||
for( i=0; i<v; i++){
|
|
||||||
cio_write( cio, box[i].length, 4); /* Box length */
|
|
||||||
cio_write( cio, box[i].type, 4); /* Box type */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
len = cio_tell( cio) - lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
}
|
|
||||||
|
|
||||||
int write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int len, lenp;
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_MHIX, 4); /* MHIX */
|
|
||||||
|
|
||||||
cio_write( cio, cstr_info.main_head_end-cstr_info.main_head_start+1, 8); /* TLEN */
|
|
||||||
|
|
||||||
for(i = 1; i < cstr_info.marknum; i++){ /* Marker restricted to 1 apparition, skip SOC marker */
|
|
||||||
cio_write( cio, cstr_info.marker[i].type, 2);
|
|
||||||
cio_write( cio, 0, 2);
|
|
||||||
cio_write( cio, cstr_info.marker[i].pos-coff, 8);
|
|
||||||
cio_write( cio, cstr_info.marker[i].len, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
len = cio_tell( cio) - lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
opj_bool check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
opj_bool EPHused = OPJ_FALSE;
|
|
||||||
int i=0;
|
|
||||||
int org_pos;
|
|
||||||
unsigned int Scod;
|
|
||||||
|
|
||||||
for(i = 0; i < marknum; i++){
|
|
||||||
if( markers[i].type == J2K_MS_COD){
|
|
||||||
org_pos = cio_tell( cio);
|
|
||||||
cio_seek( cio, coff+markers[i].pos+2);
|
|
||||||
|
|
||||||
Scod = cio_read( cio, 1);
|
|
||||||
if( ((Scod >> 2) & 1))
|
|
||||||
EPHused = OPJ_TRUE;
|
|
||||||
cio_seek( cio, org_pos);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return EPHused;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
# Makefile for the main JPWL OpenJPEG codecs: JPWL_ j2k_to_image and JPWL_image_to_j2k
|
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DUSE_JPWL)
|
|
||||||
|
|
||||||
SET(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c)
|
|
||||||
IF(APPLE)
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(
|
|
||||||
rs.c
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS -fno-common)
|
|
||||||
ENDIF(APPLE)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(
|
|
||||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
|
||||||
)
|
|
||||||
|
|
||||||
# Build the library
|
|
||||||
IF(WIN32)
|
|
||||||
IF(BUILD_SHARED_LIBS)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
|
||||||
ELSE(BUILD_SHARED_LIBS)
|
|
||||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
|
||||||
ENDIF(BUILD_SHARED_LIBS)
|
|
||||||
ENDIF(WIN32)
|
|
||||||
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS})
|
|
||||||
IF(UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME}_JPWL m)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
|
||||||
IF(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
|
|
||||||
TARGET_COMPILE_OPTIONS(${OPENJPEG_LIBRARY_NAME}_JPWL PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# Install library
|
|
||||||
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL
|
|
||||||
EXPORT OpenJPEGTargets
|
|
||||||
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
||||||
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
||||||
ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
||||||
)
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libopenjpeg_JPWL.la
|
|
||||||
|
|
||||||
OPJ_SRC = \
|
|
||||||
../bio.c \
|
|
||||||
../cio.c \
|
|
||||||
../dwt.c \
|
|
||||||
../event.c \
|
|
||||||
../image.c \
|
|
||||||
../j2k.c \
|
|
||||||
../j2k_lib.c \
|
|
||||||
../jp2.c \
|
|
||||||
../jpt.c \
|
|
||||||
../mct.c \
|
|
||||||
../mqc.c \
|
|
||||||
../openjpeg.c \
|
|
||||||
../pi.c \
|
|
||||||
../raw.c \
|
|
||||||
../t1.c \
|
|
||||||
../t2.c \
|
|
||||||
../tcd.c \
|
|
||||||
../tgt.c \
|
|
||||||
../cidx_manager.c \
|
|
||||||
../phix_manager.c \
|
|
||||||
../ppix_manager.c \
|
|
||||||
../thix_manager.c \
|
|
||||||
../tpix_manager.c
|
|
||||||
|
|
||||||
libopenjpeg_JPWL_la_CPPFLAGS = \
|
|
||||||
-I. \
|
|
||||||
-I$(top_srcdir)/libopenjpeg \
|
|
||||||
-I$(top_builddir)/libopenjpeg \
|
|
||||||
-I$(top_srcdir)/libopenjpeg/jpwl \
|
|
||||||
-I$(top_builddir)/libopenjpeg/jpwl \
|
|
||||||
-DUSE_JPWL
|
|
||||||
libopenjpeg_JPWL_la_CFLAGS =
|
|
||||||
libopenjpeg_JPWL_la_LIBADD = -lm
|
|
||||||
libopenjpeg_JPWL_la_LDFLAGS = -no-undefined -version-info @lt_version@
|
|
||||||
libopenjpeg_JPWL_la_SOURCES = \
|
|
||||||
$(OPJ_SRC) \
|
|
||||||
crc.c \
|
|
||||||
jpwl.c \
|
|
||||||
jpwl_lib.c \
|
|
||||||
rs.c \
|
|
||||||
crc.h \
|
|
||||||
jpwl.h \
|
|
||||||
rs.h
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
@echo -e " (LA)\t$(libdir)/libopenjpeg_JPWL.la" >> $(top_builddir)/report.txt
|
|
||||||
if BUILD_SHARED
|
|
||||||
@( $(call solist) ) >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
if BUILD_STATIC
|
|
||||||
@echo -e " (A)\t$(base)/$(a)" >> $(top_builddir)/report.txt
|
|
||||||
endif
|
|
||||||
|
|
||||||
solist = $(foreach f, $(dll) $(so), echo -e ' $(SO_PREFIX)\t$(base)/$(f)' ;)
|
|
||||||
get_tok = $(shell grep -E "^$(1)=" $(lib_LTLIBRARIES) | cut -d "'" -f 2)
|
|
||||||
base = $(call get_tok,libdir)
|
|
||||||
so = $(call get_tok,library_names)
|
|
||||||
a = $(call get_tok,old_library)
|
|
||||||
|
|
||||||
if HAVE_WIN32
|
|
||||||
SO_PREFIX = (DLL)
|
|
||||||
dll = $(call get_tok,dlname)
|
|
||||||
else
|
|
||||||
if HAVE_DARWIN
|
|
||||||
SO_PREFIX = (DY)
|
|
||||||
dll =
|
|
||||||
else
|
|
||||||
SO_PREFIX = (SO)
|
|
||||||
dll =
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,170 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: phix_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) 2003-2004, Yannick Verschueren
|
|
||||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \file
|
|
||||||
* \brief Modification of jpip.c from 2KAN indexer
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include "opj_includes.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write faix box of phix
|
|
||||||
*
|
|
||||||
* @param[in] coff offset of j2k codestream
|
|
||||||
* @param[in] compno component number
|
|
||||||
* @param[in] cstr_info codestream information
|
|
||||||
* @param[in] EPHused true if if EPH option used
|
|
||||||
* @param[in] j2klen length of j2k codestream
|
|
||||||
* @param[in] cio file output handle
|
|
||||||
* @return length of faix box
|
|
||||||
*/
|
|
||||||
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio);
|
|
||||||
|
|
||||||
int write_phix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp=0, compno, i;
|
|
||||||
opj_jp2_box_t *box;
|
|
||||||
|
|
||||||
box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t));
|
|
||||||
|
|
||||||
for( i=0;i<2;i++){
|
|
||||||
if (i) cio_seek( cio, lenp);
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_PHIX, 4); /* PHIX */
|
|
||||||
|
|
||||||
write_manf( i, cstr_info.numcomps, box, cio);
|
|
||||||
|
|
||||||
for( compno=0; compno<cstr_info.numcomps; compno++){
|
|
||||||
box[compno].length = write_phixfaix( coff, compno, cstr_info, EPHused, j2klen, cio);
|
|
||||||
box[compno].type = JPIP_FAIX;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = cio_tell( cio)-lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
}
|
|
||||||
|
|
||||||
opj_free(box);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp, tileno, version, i, nmax, size_of_coding; /* 4 or 8 */
|
|
||||||
opj_tile_info_t *tile_Idx;
|
|
||||||
opj_packet_info_t packet;
|
|
||||||
int resno, precno, layno, num_packet;
|
|
||||||
int numOfres, numOfprec, numOflayers;
|
|
||||||
packet.end_ph_pos = packet.start_pos = -1;
|
|
||||||
(void)EPHused; /* unused ? */
|
|
||||||
|
|
||||||
if( j2klen > pow( 2, 32)){
|
|
||||||
size_of_coding = 8;
|
|
||||||
version = 1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
size_of_coding = 4;
|
|
||||||
version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_FAIX, 4); /* FAIX */
|
|
||||||
cio_write( cio, version,1); /* Version 0 = 4 bytes */
|
|
||||||
|
|
||||||
nmax = 0;
|
|
||||||
for( i=0; i<=cstr_info.numdecompos[compno]; i++)
|
|
||||||
nmax += cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * cstr_info.numlayers;
|
|
||||||
|
|
||||||
cio_write( cio, nmax, size_of_coding); /* NMAX */
|
|
||||||
cio_write( cio, cstr_info.tw*cstr_info.th, size_of_coding); /* M */
|
|
||||||
|
|
||||||
for( tileno=0; tileno<cstr_info.tw*cstr_info.th; tileno++){
|
|
||||||
tile_Idx = &cstr_info.tile[ tileno];
|
|
||||||
|
|
||||||
num_packet = 0;
|
|
||||||
numOfres = cstr_info.numdecompos[compno] + 1;
|
|
||||||
|
|
||||||
for( resno=0; resno<numOfres ; resno++){
|
|
||||||
numOfprec = tile_Idx->pw[resno]*tile_Idx->ph[resno];
|
|
||||||
for( precno=0; precno<numOfprec; precno++){
|
|
||||||
numOflayers = cstr_info.numlayers;
|
|
||||||
for( layno=0; layno<numOflayers; layno++){
|
|
||||||
|
|
||||||
switch ( cstr_info.prog){
|
|
||||||
case LRCP:
|
|
||||||
packet = tile_Idx->packet[ ((layno*numOfres+resno)*cstr_info.numcomps+compno)*numOfprec+precno];
|
|
||||||
break;
|
|
||||||
case RLCP:
|
|
||||||
packet = tile_Idx->packet[ ((resno*numOflayers+layno)*cstr_info.numcomps+compno)*numOfprec+precno];
|
|
||||||
break;
|
|
||||||
case RPCL:
|
|
||||||
packet = tile_Idx->packet[ ((resno*numOfprec+precno)*cstr_info.numcomps+compno)*numOflayers+layno];
|
|
||||||
break;
|
|
||||||
case PCRL:
|
|
||||||
packet = tile_Idx->packet[ ((precno*cstr_info.numcomps+compno)*numOfres+resno)*numOflayers + layno];
|
|
||||||
break;
|
|
||||||
case CPRL:
|
|
||||||
packet = tile_Idx->packet[ ((compno*numOfprec+precno)*numOfres+resno)*numOflayers + layno];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fprintf( stderr, "failed to ppix indexing\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
cio_write( cio, packet.start_pos-coff, size_of_coding); /* start position */
|
|
||||||
cio_write( cio, packet.end_ph_pos-packet.start_pos+1, size_of_coding); /* length */
|
|
||||||
|
|
||||||
num_packet++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* PADDING */
|
|
||||||
while( num_packet < nmax){
|
|
||||||
cio_write( cio, 0, size_of_coding); /* start position */
|
|
||||||
cio_write( cio, 0, size_of_coding); /* length */
|
|
||||||
num_packet++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
len = cio_tell( cio)-lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: thix_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) 2003-2004, Yannick Verschueren
|
|
||||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \file
|
|
||||||
* \brief Modification of jpip.c from 2KAN indexer
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "opj_includes.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write tile-part headers mhix box
|
|
||||||
*
|
|
||||||
* @param[in] coff offset of j2k codestream
|
|
||||||
* @param[in] cstr_info codestream information
|
|
||||||
* @param[in] tileno tile number
|
|
||||||
* @param[in] cio file output handle
|
|
||||||
* @return length of mhix box
|
|
||||||
*/
|
|
||||||
int write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_cio_t *cio);
|
|
||||||
|
|
||||||
int write_thix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp, i;
|
|
||||||
int tileno;
|
|
||||||
opj_jp2_box_t *box;
|
|
||||||
|
|
||||||
lenp = 0;
|
|
||||||
box = (opj_jp2_box_t *)opj_calloc( cstr_info.tw*cstr_info.th, sizeof(opj_jp2_box_t));
|
|
||||||
|
|
||||||
for ( i = 0; i < 2 ; i++ ){
|
|
||||||
if (i)
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_THIX, 4); /* THIX */
|
|
||||||
write_manf( i, cstr_info.tw*cstr_info.th, box, cio);
|
|
||||||
|
|
||||||
for (tileno = 0; tileno < cstr_info.tw*cstr_info.th; tileno++){
|
|
||||||
box[tileno].length = write_tilemhix( coff, cstr_info, tileno, cio);
|
|
||||||
box[tileno].type = JPIP_MHIX;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = cio_tell( cio)-lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
}
|
|
||||||
|
|
||||||
opj_free(box);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
int write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
opj_tile_info_t tile;
|
|
||||||
opj_tp_info_t tp;
|
|
||||||
int len, lenp;
|
|
||||||
opj_marker_info_t *marker;
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_MHIX, 4); /* MHIX */
|
|
||||||
|
|
||||||
tile = cstr_info.tile[tileno];
|
|
||||||
tp = tile.tp[0];
|
|
||||||
|
|
||||||
cio_write( cio, tp.tp_end_header-tp.tp_start_pos+1, 8); /* TLEN */
|
|
||||||
|
|
||||||
marker = cstr_info.tile[tileno].marker;
|
|
||||||
|
|
||||||
for( i=0; i<cstr_info.tile[tileno].marknum; i++){ /* Marker restricted to 1 apparition */
|
|
||||||
cio_write( cio, marker[i].type, 2);
|
|
||||||
cio_write( cio, 0, 2);
|
|
||||||
cio_write( cio, marker[i].pos-coff, 8);
|
|
||||||
cio_write( cio, marker[i].len, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free( marker);*/
|
|
||||||
|
|
||||||
len = cio_tell( cio) - lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: tpix_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) 2003-2004, Yannick Verschueren
|
|
||||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \file
|
|
||||||
* \brief Modification of jpip.c from 2KAN indexer
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include "opj_includes.h"
|
|
||||||
|
|
||||||
#define MAX(a,b) ((a)>(b)?(a):(b))
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write faix box of tpix
|
|
||||||
*
|
|
||||||
* @param[in] coff offset of j2k codestream
|
|
||||||
* @param[in] compno component number
|
|
||||||
* @param[in] cstr_info codestream information
|
|
||||||
* @param[in] j2klen length of j2k codestream
|
|
||||||
* @param[in] cio file output handle
|
|
||||||
* @return length of faix box
|
|
||||||
*/
|
|
||||||
int write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio);
|
|
||||||
|
|
||||||
|
|
||||||
int write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp;
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_TPIX, 4); /* TPIX */
|
|
||||||
|
|
||||||
write_tpixfaix( coff, 0, cstr_info, j2klen, cio);
|
|
||||||
|
|
||||||
len = cio_tell( cio)-lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get number of maximum tile parts per tile
|
|
||||||
*
|
|
||||||
* @param[in] cstr_info codestream information
|
|
||||||
* @return number of maximum tile parts per tile
|
|
||||||
*/
|
|
||||||
int get_num_max_tile_parts( opj_codestream_info_t cstr_info);
|
|
||||||
|
|
||||||
int write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio)
|
|
||||||
{
|
|
||||||
int len, lenp;
|
|
||||||
int i, j;
|
|
||||||
int Aux;
|
|
||||||
int num_max_tile_parts;
|
|
||||||
int size_of_coding; /* 4 or 8 */
|
|
||||||
opj_tp_info_t tp;
|
|
||||||
int version;
|
|
||||||
|
|
||||||
num_max_tile_parts = get_num_max_tile_parts( cstr_info);
|
|
||||||
|
|
||||||
if( j2klen > pow( 2, 32)){
|
|
||||||
size_of_coding = 8;
|
|
||||||
version = num_max_tile_parts == 1 ? 1:3;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
size_of_coding = 4;
|
|
||||||
version = num_max_tile_parts == 1 ? 0:2;
|
|
||||||
}
|
|
||||||
|
|
||||||
lenp = cio_tell( cio);
|
|
||||||
cio_skip( cio, 4); /* L [at the end] */
|
|
||||||
cio_write( cio, JPIP_FAIX, 4); /* FAIX */
|
|
||||||
cio_write( cio, version, 1); /* Version 0 = 4 bytes */
|
|
||||||
|
|
||||||
cio_write( cio, num_max_tile_parts, size_of_coding); /* NMAX */
|
|
||||||
cio_write( cio, cstr_info.tw*cstr_info.th, size_of_coding); /* M */
|
|
||||||
for (i = 0; i < cstr_info.tw*cstr_info.th; i++){
|
|
||||||
for (j = 0; j < cstr_info.tile[i].num_tps; j++){
|
|
||||||
tp = cstr_info.tile[i].tp[j];
|
|
||||||
cio_write( cio, tp.tp_start_pos-coff, size_of_coding); /* start position */
|
|
||||||
cio_write( cio, tp.tp_end_pos-tp.tp_start_pos+1, size_of_coding); /* length */
|
|
||||||
if (version & 0x02){
|
|
||||||
if( cstr_info.tile[i].num_tps == 1 && cstr_info.numdecompos[compno] > 1)
|
|
||||||
Aux = cstr_info.numdecompos[compno] + 1;
|
|
||||||
else
|
|
||||||
Aux = j + 1;
|
|
||||||
|
|
||||||
cio_write( cio, Aux,4);
|
|
||||||
/*cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4);*/ /* Aux_i,j : Auxiliary value */
|
|
||||||
/* fprintf(stderr,"AUX value %d\n",Aux);*/
|
|
||||||
}
|
|
||||||
/*cio_write(0,4);*/
|
|
||||||
}
|
|
||||||
/* PADDING */
|
|
||||||
while (j < num_max_tile_parts){
|
|
||||||
cio_write( cio, 0, size_of_coding); /* start position */
|
|
||||||
cio_write( cio, 0, size_of_coding); /* length */
|
|
||||||
if (version & 0x02)
|
|
||||||
cio_write( cio, 0,4); /* Aux_i,j : Auxiliary value */
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
len = cio_tell( cio)-lenp;
|
|
||||||
cio_seek( cio, lenp);
|
|
||||||
cio_write( cio, len, 4); /* L */
|
|
||||||
cio_seek( cio, lenp+len);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int get_num_max_tile_parts( opj_codestream_info_t cstr_info)
|
|
||||||
{
|
|
||||||
int num_max_tp = 0, i;
|
|
||||||
|
|
||||||
for( i=0; i<cstr_info.tw*cstr_info.th; i++)
|
|
||||||
num_max_tp = MAX( cstr_info.tile[i].num_tps, num_max_tp);
|
|
||||||
|
|
||||||
return num_max_tp;
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
prefix=@prefix@
|
|
||||||
exec_prefix=@exec_prefix@
|
|
||||||
libdir=@libdir@
|
|
||||||
includedir=@includedir@/openjpeg-@MAJOR_NR@.@MINOR_NR@
|
|
||||||
|
|
||||||
Name: openjpeg
|
|
||||||
Description: JPEG2000 library
|
|
||||||
URL: http://www.openjpeg.org/
|
|
||||||
Version: @VERSION@
|
|
||||||
@pkgconfig_requires_private@: @requirements@
|
|
||||||
Libs: -L${libdir} -lopenjpeg
|
|
||||||
Libs.private: -lm
|
|
||||||
Cflags: -I${includedir}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
|
|
||||||
dnl That code is public domain and can be freely used or copied.
|
|
||||||
|
|
||||||
dnl Macro that check if a library is in a specified directory.
|
|
||||||
|
|
||||||
dnl Usage: OPJ_CHECK_LIB_WITH_PREFIX(prefix, header, lib, func [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
||||||
dnl Call AC_SUBST(THELIB_CFLAGS)
|
|
||||||
dnl Call AC_SUBST(THELIB_LIBS)
|
|
||||||
dnl where THELIB is the uppercase value of 'lib'
|
|
||||||
|
|
||||||
AC_DEFUN([OPJ_CHECK_LIB_WITH_PREFIX],
|
|
||||||
[
|
|
||||||
|
|
||||||
m4_pushdef([UP], m4_toupper([$3]))
|
|
||||||
m4_pushdef([DOWN], m4_tolower([$3]))
|
|
||||||
|
|
||||||
__opj_prefix=$1
|
|
||||||
__opj_header=$2
|
|
||||||
__opj_lib=$3
|
|
||||||
__opj_func=$4
|
|
||||||
__opj_have_dep="no"
|
|
||||||
|
|
||||||
save_CPPFLAGS=${CPPFLAGS}
|
|
||||||
save_LIBS=${LIBS}
|
|
||||||
|
|
||||||
if test "x$UP[_CFLAGS]" != "x"; then
|
|
||||||
CPPFLAGS="${CPPFLAGS} $UP[_CFLAGS]"
|
|
||||||
else
|
|
||||||
if test "x${__opj_prefix}" != "x" ; then
|
|
||||||
__opj_CPPFLAGS="-I${__opj_prefix}/include"
|
|
||||||
else
|
|
||||||
__opj_CPPFLAGS=""
|
|
||||||
fi
|
|
||||||
CPPFLAGS="${CPPFLAGS} ${__opj_CPPFLAGS}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$UP[_LIBS]" != "x"; then
|
|
||||||
LIBS="${LIBS} $UP[_LIBS]"
|
|
||||||
else
|
|
||||||
if test "x${__opj_prefix}" != "x" ; then
|
|
||||||
__opj_LIBS="-L${__opj_prefix}/lib -l${__opj_lib}"
|
|
||||||
else
|
|
||||||
__opj_LIBS="-l${__opj_lib}"
|
|
||||||
fi
|
|
||||||
LIBS="${LIBS} ${__opj_LIBS}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_LINK_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
|
||||||
[[
|
|
||||||
#include <${__opj_header}>
|
|
||||||
]],
|
|
||||||
[[
|
|
||||||
${__opj_func}();
|
|
||||||
]])],
|
|
||||||
[__opj_have_dep="yes"],
|
|
||||||
[__opj_have_dep="no"])
|
|
||||||
|
|
||||||
CPPFLAGS=${save_CPPFLAGS}
|
|
||||||
LIBS=${save_LIBS}
|
|
||||||
|
|
||||||
if test "x${__opj_prefix}" = "x" ; then
|
|
||||||
AC_MSG_CHECKING([whether ]UP[ library is available in standard or predefined directories])
|
|
||||||
else
|
|
||||||
AC_MSG_CHECKING([whether ]UP[ library is available in ${__opj_prefix}])
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT([${__opj_have_dep}])
|
|
||||||
|
|
||||||
if test "x${__opj_have_dep}" = "xyes"; then
|
|
||||||
if test "x${UP[]_CFLAGS}" = "x" ; then
|
|
||||||
UP[]_CFLAGS="${__opj_CPPFLAGS}"
|
|
||||||
fi
|
|
||||||
if test "x${UP[]_LIBS}" = "x" ; then
|
|
||||||
UP[]_LIBS="${__opj_LIBS}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
AS_IF([test "x${__opj_have_dep}" = "xyes"], [$5], [$6])
|
|
||||||
|
|
||||||
m4_popdef([UP])
|
|
||||||
m4_popdef([DOWN])
|
|
||||||
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl Macro that check if a library is in a set of directories.
|
|
||||||
|
|
||||||
dnl Usage: OPJ_CHECK_LIB(header, lib, func [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
||||||
|
|
||||||
AC_DEFUN([OPJ_CHECK_LIB],
|
|
||||||
[
|
|
||||||
|
|
||||||
m4_pushdef([UP], m4_toupper([$2]))
|
|
||||||
|
|
||||||
__opj_have_dep="no"
|
|
||||||
|
|
||||||
OPJ_CHECK_LIB_WITH_PREFIX([],
|
|
||||||
[$1],
|
|
||||||
[$2],
|
|
||||||
[$3],
|
|
||||||
[__opj_have_dep="yes"],
|
|
||||||
[__opj_have_dep="no"])
|
|
||||||
|
|
||||||
if ! test "x${__opj_have_dep}" = "xyes" ; then
|
|
||||||
OPJ_CHECK_LIB_WITH_PREFIX([/usr],
|
|
||||||
[$1],
|
|
||||||
[$2],
|
|
||||||
[$3],
|
|
||||||
[__opj_have_dep="yes"],
|
|
||||||
[__opj_have_dep="no"])
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! test "x${__opj_have_dep}" = "xyes" ; then
|
|
||||||
OPJ_CHECK_LIB_WITH_PREFIX([/usr/local],
|
|
||||||
[$1],
|
|
||||||
[$2],
|
|
||||||
[$3],
|
|
||||||
[__opj_have_dep="yes"],
|
|
||||||
[__opj_have_dep="no"])
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! test "x${__opj_have_dep}" = "xyes" ; then
|
|
||||||
OPJ_CHECK_LIB_WITH_PREFIX([/opt/local],
|
|
||||||
[$1],
|
|
||||||
[$2],
|
|
||||||
[$3],
|
|
||||||
[__opj_have_dep="yes"],
|
|
||||||
[__opj_have_dep="no"])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_ARG_VAR(UP[_CFLAGS], [preprocessor flags for lib$2])
|
|
||||||
AC_SUBST(UP[_CFLAGS])
|
|
||||||
AC_ARG_VAR(UP[_LIBS], [linker flags for lib$2])
|
|
||||||
AC_SUBST(UP[_LIBS])
|
|
||||||
|
|
||||||
AS_IF([test "x${__opj_have_dep}" = "xyes"], [$4], [$5])
|
|
||||||
|
|
||||||
m4_popdef([UP])
|
|
||||||
|
|
||||||
])
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
|
|
||||||
dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
|
|
||||||
dnl That code is public domain and can be freely used or copied.
|
|
||||||
|
|
||||||
dnl Macro that checks if a compiler flag is supported by the compiler.
|
|
||||||
|
|
||||||
dnl Usage: OPJ_COMPILER_FLAG(flag)
|
|
||||||
dnl flag is added to CFLAGS if supported.
|
|
||||||
|
|
||||||
AC_DEFUN([OPJ_COMPILER_FLAG],
|
|
||||||
[
|
|
||||||
|
|
||||||
CFLAGS_save="${CFLAGS}"
|
|
||||||
CFLAGS="${CFLAGS} $1"
|
|
||||||
|
|
||||||
AC_LANG_PUSH([C])
|
|
||||||
AC_MSG_CHECKING([whether the compiler supports $1])
|
|
||||||
|
|
||||||
AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([[]])],
|
|
||||||
[have_flag="yes"],
|
|
||||||
[have_flag="no"])
|
|
||||||
AC_MSG_RESULT([${have_flag}])
|
|
||||||
|
|
||||||
if test "x${have_flag}" = "xno" ; then
|
|
||||||
CFLAGS="${CFLAGS_save}"
|
|
||||||
fi
|
|
||||||
AC_LANG_POP([C])
|
|
||||||
|
|
||||||
])
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
|
|
||||||
dnl That code is public domain and can be freely used or copied.
|
|
||||||
|
|
||||||
dnl Macro that check if doxygen is available or not.
|
|
||||||
|
|
||||||
dnl OPJ_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
||||||
dnl Test for the doxygen program
|
|
||||||
dnl Defines opj_doxygen
|
|
||||||
dnl Defines the automake conditionnal OPJ_BUILD_DOC
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([OPJ_CHECK_DOXYGEN],
|
|
||||||
[
|
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl Disable the build of the documentation
|
|
||||||
dnl
|
|
||||||
AC_ARG_ENABLE([doc],
|
|
||||||
[AC_HELP_STRING(
|
|
||||||
[--disable-doc],
|
|
||||||
[Disable documentation build @<:@default=enabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
opj_enable_doc="yes"
|
|
||||||
else
|
|
||||||
opj_enable_doc="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[opj_enable_doc="yes"])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build documentation])
|
|
||||||
AC_MSG_RESULT([${opj_enable_doc}])
|
|
||||||
|
|
||||||
if test "x${opj_enable_doc}" = "xyes" ; then
|
|
||||||
|
|
||||||
dnl Specify the file name, without path
|
|
||||||
|
|
||||||
opj_doxygen="doxygen"
|
|
||||||
|
|
||||||
AC_ARG_WITH([doxygen],
|
|
||||||
[AC_HELP_STRING(
|
|
||||||
[--with-doxygen=FILE],
|
|
||||||
[doxygen program to use @<:@default=doxygen@:>@])],
|
|
||||||
|
|
||||||
dnl Check the given doxygen program.
|
|
||||||
|
|
||||||
[opj_doxygen=${withval}
|
|
||||||
AC_CHECK_PROG([opj_have_doxygen],
|
|
||||||
[${opj_doxygen}],
|
|
||||||
[yes],
|
|
||||||
[no])
|
|
||||||
if test "x${opj_have_doxygen}" = "xno" ; then
|
|
||||||
echo "WARNING:"
|
|
||||||
echo "The doxygen program you specified:"
|
|
||||||
echo "${opj_doxygen}"
|
|
||||||
echo "was not found. Please check the path and make sure "
|
|
||||||
echo "the program exists and is executable."
|
|
||||||
AC_MSG_WARN([no doxygen detected. Documentation will not be built])
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[AC_CHECK_PROG([opj_have_doxygen],
|
|
||||||
[${opj_doxygen}],
|
|
||||||
[yes],
|
|
||||||
[no])
|
|
||||||
if test "x${opj_have_doxygen}" = "xno" ; then
|
|
||||||
echo "WARNING:"
|
|
||||||
echo "The doxygen program was not found in your execute path."
|
|
||||||
echo "You may have doxygen installed somewhere not covered by your path."
|
|
||||||
echo ""
|
|
||||||
echo "If this is the case make sure you have the packages installed, AND"
|
|
||||||
echo "that the doxygen program is in your execute path (see your"
|
|
||||||
echo "shell manual page on setting the \$PATH environment variable), OR"
|
|
||||||
echo "alternatively, specify the program to use with --with-doxygen."
|
|
||||||
AC_MSG_WARN([no doxygen detected. Documentation will not be built])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
else
|
|
||||||
opj_have_doxygen="no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl Substitution
|
|
||||||
dnl
|
|
||||||
AC_SUBST([opj_doxygen])
|
|
||||||
|
|
||||||
if ! test "x${opj_have_doxygen}" = "xyes" ; then
|
|
||||||
opj_enable_doc="no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL(OPJ_BUILD_DOC, test "x${opj_have_doxygen}" = "xyes")
|
|
||||||
|
|
||||||
AS_IF([test "x${opj_have_doxygen}" = "xyes"], [$1], [$2])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl End of opj_doxygen.m4
|
|
||||||
157
m4/pkg.m4
157
m4/pkg.m4
@@ -1,157 +0,0 @@
|
|||||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
|
||||||
# serial 1 (pkg-config-0.24)
|
|
||||||
#
|
|
||||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
|
||||||
# ----------------------------------
|
|
||||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
|
||||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
|
||||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
|
||||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
|
||||||
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
|
||||||
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
|
||||||
|
|
||||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
|
||||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
|
||||||
fi
|
|
||||||
if test -n "$PKG_CONFIG"; then
|
|
||||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
|
||||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
|
||||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
PKG_CONFIG=""
|
|
||||||
fi
|
|
||||||
fi[]dnl
|
|
||||||
])# PKG_PROG_PKG_CONFIG
|
|
||||||
|
|
||||||
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
||||||
#
|
|
||||||
# Check to see whether a particular set of modules exists. Similar
|
|
||||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
|
||||||
#
|
|
||||||
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
||||||
# only at the first occurence in configure.ac, so if the first place
|
|
||||||
# it's called might be skipped (such as if it is within an "if", you
|
|
||||||
# have to call PKG_CHECK_EXISTS manually
|
|
||||||
# --------------------------------------------------------------
|
|
||||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
|
||||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
||||||
if test -n "$PKG_CONFIG" && \
|
|
||||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
|
||||||
m4_default([$2], [:])
|
|
||||||
m4_ifvaln([$3], [else
|
|
||||||
$3])dnl
|
|
||||||
fi])
|
|
||||||
|
|
||||||
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
|
||||||
# ---------------------------------------------
|
|
||||||
m4_define([_PKG_CONFIG],
|
|
||||||
[if test -n "$$1"; then
|
|
||||||
pkg_cv_[]$1="$$1"
|
|
||||||
elif test -n "$PKG_CONFIG"; then
|
|
||||||
PKG_CHECK_EXISTS([$3],
|
|
||||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
|
||||||
[pkg_failed=yes])
|
|
||||||
else
|
|
||||||
pkg_failed=untried
|
|
||||||
fi[]dnl
|
|
||||||
])# _PKG_CONFIG
|
|
||||||
|
|
||||||
# _PKG_SHORT_ERRORS_SUPPORTED
|
|
||||||
# -----------------------------
|
|
||||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
|
||||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
||||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
|
||||||
_pkg_short_errors_supported=yes
|
|
||||||
else
|
|
||||||
_pkg_short_errors_supported=no
|
|
||||||
fi[]dnl
|
|
||||||
])# _PKG_SHORT_ERRORS_SUPPORTED
|
|
||||||
|
|
||||||
|
|
||||||
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
|
||||||
# [ACTION-IF-NOT-FOUND])
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Note that if there is a possibility the first call to
|
|
||||||
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
|
||||||
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# --------------------------------------------------------------
|
|
||||||
AC_DEFUN([PKG_CHECK_MODULES],
|
|
||||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
||||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
|
||||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
|
||||||
|
|
||||||
pkg_failed=no
|
|
||||||
AC_MSG_CHECKING([for $1])
|
|
||||||
|
|
||||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
|
||||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
|
||||||
|
|
||||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
|
||||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
|
||||||
See the pkg-config man page for more details.])
|
|
||||||
|
|
||||||
if test $pkg_failed = yes; then
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
_PKG_SHORT_ERRORS_SUPPORTED
|
|
||||||
if test $_pkg_short_errors_supported = yes; then
|
|
||||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
|
||||||
else
|
|
||||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
|
||||||
fi
|
|
||||||
# Put the nasty error message in config.log where it belongs
|
|
||||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
|
||||||
|
|
||||||
m4_default([$4], [AC_MSG_ERROR(
|
|
||||||
[Package requirements ($2) were not met:
|
|
||||||
|
|
||||||
$$1_PKG_ERRORS
|
|
||||||
|
|
||||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
|
||||||
installed software in a non-standard prefix.
|
|
||||||
|
|
||||||
_PKG_TEXT])dnl
|
|
||||||
])
|
|
||||||
elif test $pkg_failed = untried; then
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
m4_default([$4], [AC_MSG_FAILURE(
|
|
||||||
[The pkg-config script could not be found or is too old. Make sure it
|
|
||||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
|
||||||
path to pkg-config.
|
|
||||||
|
|
||||||
_PKG_TEXT
|
|
||||||
|
|
||||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
|
|
||||||
])
|
|
||||||
else
|
|
||||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
|
||||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
$3
|
|
||||||
fi[]dnl
|
|
||||||
])# PKG_CHECK_MODULES
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/* create config.h for CMake */
|
|
||||||
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
|
|
||||||
|
|
||||||
#cmakedefine HAVE_INTTYPES_H
|
|
||||||
#cmakedefine HAVE_MEMORY_H
|
|
||||||
#cmakedefine HAVE_STDINT_H
|
|
||||||
#cmakedefine HAVE_STDLIB_H
|
|
||||||
#cmakedefine HAVE_STRINGS_H
|
|
||||||
#cmakedefine HAVE_STRING_H
|
|
||||||
#cmakedefine HAVE_SYS_STAT_H
|
|
||||||
#cmakedefine HAVE_SYS_TYPES_H
|
|
||||||
#cmakedefine HAVE_UNISTD_H
|
|
||||||
#cmakedefine HAVE_LIBPNG
|
|
||||||
#cmakedefine HAVE_PNG_H
|
|
||||||
#cmakedefine HAVE_LIBTIFF
|
|
||||||
#cmakedefine HAVE_TIFF_H
|
|
||||||
|
|
||||||
#cmakedefine HAVE_LIBLCMS1
|
|
||||||
#cmakedefine HAVE_LIBLCMS2
|
|
||||||
#cmakedefine HAVE_LCMS1_H
|
|
||||||
#cmakedefine HAVE_LCMS2_H
|
|
||||||
#cmakedefine USE_SYSTEM_GETOPT
|
|
||||||
|
|
||||||
/* Byte order. */
|
|
||||||
/* All compilers that support Mac OS X define either __BIG_ENDIAN__ or
|
|
||||||
__LITTLE_ENDIAN__ to match the endianness of the architecture being
|
|
||||||
compiled for. This is not necessarily the same as the architecture of the
|
|
||||||
machine doing the building. In order to support Universal Binaries on
|
|
||||||
Mac OS X, we prefer those defines to decide the endianness.
|
|
||||||
On other platforms we use the result of the TRY_RUN. */
|
|
||||||
#if !defined(__APPLE__)
|
|
||||||
#cmakedefine OPJ_BIG_ENDIAN
|
|
||||||
#elif defined(__BIG_ENDIAN__)
|
|
||||||
# define OPJ_BIG_ENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
12
src/CMakeLists.txt
Normal file
12
src/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# required dep for server:
|
||||||
|
#if(BUILD_JPIP_SERVER)
|
||||||
|
# find_package(CURL REQUIRED)
|
||||||
|
# find_package(FCGI REQUIRED)
|
||||||
|
# find_package(Threads REQUIRED)
|
||||||
|
# if(NOT CMAKE_USE_PTHREADS_INIT)
|
||||||
|
# message(FATAL_ERROR "Only pthread are supported")
|
||||||
|
# endif()
|
||||||
|
#endif()
|
||||||
|
|
||||||
|
#add_subdirectory(lib)
|
||||||
|
#add_subdirectory(bin)
|
||||||
21
src/bin/CMakeLists.txt
Normal file
21
src/bin/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# source code for openjpeg apps:
|
||||||
|
add_subdirectory(common)
|
||||||
|
# Part 1 & 2:
|
||||||
|
add_subdirectory(jp2)
|
||||||
|
|
||||||
|
# optionals components:
|
||||||
|
if(BUILD_JPWL)
|
||||||
|
add_subdirectory(jpwl)
|
||||||
|
endif()
|
||||||
|
if(BUILD_MJ2)
|
||||||
|
add_subdirectory(mj2)
|
||||||
|
endif()
|
||||||
|
if(BUILD_JPIP)
|
||||||
|
add_subdirectory(jpip)
|
||||||
|
endif()
|
||||||
|
if(BUILD_JP3D)
|
||||||
|
add_subdirectory(jp3d)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# wx apps:
|
||||||
|
add_subdirectory(wx)
|
||||||
7
src/bin/common/CMakeLists.txt
Normal file
7
src/bin/common/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# opj_apps_config.h generation
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_apps_config.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/opj_apps_config.h
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
965
src/bin/common/color.c
Normal file
965
src/bin/common/color.c
Normal file
@@ -0,0 +1,965 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
* 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 <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "opj_apps_config.h"
|
||||||
|
#include "openjpeg.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS2
|
||||||
|
#include <lcms2.h>
|
||||||
|
#endif
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
#include <lcms.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPJ_USE_LEGACY
|
||||||
|
#define OPJ_CLRSPC_GRAY CLRSPC_GRAY
|
||||||
|
#define OPJ_CLRSPC_SRGB CLRSPC_SRGB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*--------------------------------------------------------
|
||||||
|
Matrix for sYCC, Amendment 1 to IEC 61966-2-1
|
||||||
|
|
||||||
|
Y : 0.299 0.587 0.114 :R
|
||||||
|
Cb: -0.1687 -0.3312 0.5 :G
|
||||||
|
Cr: 0.5 -0.4187 -0.0812 :B
|
||||||
|
|
||||||
|
Inverse:
|
||||||
|
|
||||||
|
R: 1 -3.68213e-05 1.40199 :Y
|
||||||
|
G: 1.00003 -0.344125 -0.714128 :Cb - 2^(prec - 1)
|
||||||
|
B: 0.999823 1.77204 -8.04142e-06 :Cr - 2^(prec - 1)
|
||||||
|
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
static void sycc_to_rgb(int offset, int upb, int y, int cb, int cr,
|
||||||
|
int *out_r, int *out_g, int *out_b)
|
||||||
|
{
|
||||||
|
int r, g, b;
|
||||||
|
|
||||||
|
cb -= offset; cr -= offset;
|
||||||
|
r = y + (int)(1.402 * (float)cr);
|
||||||
|
if(r < 0) r = 0; else if(r > upb) r = upb; *out_r = r;
|
||||||
|
|
||||||
|
g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr);
|
||||||
|
if(g < 0) g = 0; else if(g > upb) g = upb; *out_g = g;
|
||||||
|
|
||||||
|
b = y + (int)(1.772 * (float)cb);
|
||||||
|
if(b < 0) b = 0; else if(b > upb) b = upb; *out_b = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sycc444_to_rgb(opj_image_t *img)
|
||||||
|
{
|
||||||
|
int *d0, *d1, *d2, *r, *g, *b;
|
||||||
|
const int *y, *cb, *cr;
|
||||||
|
size_t maxw, maxh, max, i;
|
||||||
|
int offset, upb;
|
||||||
|
|
||||||
|
upb = (int)img->comps[0].prec;
|
||||||
|
offset = 1<<(upb - 1); upb = (1<<upb)-1;
|
||||||
|
|
||||||
|
maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;
|
||||||
|
max = maxw * maxh;
|
||||||
|
|
||||||
|
y = img->comps[0].data;
|
||||||
|
cb = img->comps[1].data;
|
||||||
|
cr = img->comps[2].data;
|
||||||
|
|
||||||
|
d0 = r = (int*)malloc(sizeof(int) * max);
|
||||||
|
d1 = g = (int*)malloc(sizeof(int) * max);
|
||||||
|
d2 = b = (int*)malloc(sizeof(int) * max);
|
||||||
|
|
||||||
|
if(r == NULL || g == NULL || b == NULL) goto fails;
|
||||||
|
|
||||||
|
for(i = 0U; i < max; ++i)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++cb; ++cr; ++r; ++g; ++b;
|
||||||
|
}
|
||||||
|
free(img->comps[0].data); img->comps[0].data = d0;
|
||||||
|
free(img->comps[1].data); img->comps[1].data = d1;
|
||||||
|
free(img->comps[2].data); img->comps[2].data = d2;
|
||||||
|
img->color_space = OPJ_CLRSPC_SRGB;
|
||||||
|
return;
|
||||||
|
|
||||||
|
fails:
|
||||||
|
free(r);
|
||||||
|
free(g);
|
||||||
|
free(b);
|
||||||
|
}/* sycc444_to_rgb() */
|
||||||
|
|
||||||
|
static void sycc422_to_rgb(opj_image_t *img)
|
||||||
|
{
|
||||||
|
int *d0, *d1, *d2, *r, *g, *b;
|
||||||
|
const int *y, *cb, *cr;
|
||||||
|
size_t maxw, maxh, max, offx, loopmaxw;
|
||||||
|
int offset, upb;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
upb = (int)img->comps[0].prec;
|
||||||
|
offset = 1<<(upb - 1); upb = (1<<upb)-1;
|
||||||
|
|
||||||
|
maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;
|
||||||
|
max = maxw * maxh;
|
||||||
|
|
||||||
|
y = img->comps[0].data;
|
||||||
|
cb = img->comps[1].data;
|
||||||
|
cr = img->comps[2].data;
|
||||||
|
|
||||||
|
d0 = r = (int*)malloc(sizeof(int) * max);
|
||||||
|
d1 = g = (int*)malloc(sizeof(int) * max);
|
||||||
|
d2 = b = (int*)malloc(sizeof(int) * max);
|
||||||
|
|
||||||
|
if(r == NULL || g == NULL || b == NULL) goto fails;
|
||||||
|
|
||||||
|
/* if img->x0 is odd, then first column shall use Cb/Cr = 0 */
|
||||||
|
offx = img->x0 & 1U;
|
||||||
|
loopmaxw = maxw - offx;
|
||||||
|
|
||||||
|
for(i=0U; i < maxh; ++i)
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
|
||||||
|
if (offx > 0U) {
|
||||||
|
sycc_to_rgb(offset, upb, *y, 0, 0, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(j=0U; j < (loopmaxw & ~(size_t)1U); j += 2U)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b; ++cb; ++cr;
|
||||||
|
}
|
||||||
|
if (j < loopmaxw) {
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b; ++cb; ++cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(img->comps[0].data); img->comps[0].data = d0;
|
||||||
|
free(img->comps[1].data); img->comps[1].data = d1;
|
||||||
|
free(img->comps[2].data); img->comps[2].data = d2;
|
||||||
|
|
||||||
|
img->comps[1].w = img->comps[2].w = img->comps[0].w;
|
||||||
|
img->comps[1].h = img->comps[2].h = img->comps[0].h;
|
||||||
|
img->comps[1].dx = img->comps[2].dx = img->comps[0].dx;
|
||||||
|
img->comps[1].dy = img->comps[2].dy = img->comps[0].dy;
|
||||||
|
img->color_space = OPJ_CLRSPC_SRGB;
|
||||||
|
return;
|
||||||
|
|
||||||
|
fails:
|
||||||
|
free(r);
|
||||||
|
free(g);
|
||||||
|
free(b);
|
||||||
|
}/* sycc422_to_rgb() */
|
||||||
|
|
||||||
|
static void sycc420_to_rgb(opj_image_t *img)
|
||||||
|
{
|
||||||
|
int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb;
|
||||||
|
const int *y, *cb, *cr, *ny;
|
||||||
|
size_t maxw, maxh, max, offx, loopmaxw, offy, loopmaxh;
|
||||||
|
int offset, upb;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
upb = (int)img->comps[0].prec;
|
||||||
|
offset = 1<<(upb - 1); upb = (1<<upb)-1;
|
||||||
|
|
||||||
|
maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;
|
||||||
|
max = maxw * maxh;
|
||||||
|
|
||||||
|
y = img->comps[0].data;
|
||||||
|
cb = img->comps[1].data;
|
||||||
|
cr = img->comps[2].data;
|
||||||
|
|
||||||
|
d0 = r = (int*)malloc(sizeof(int) * max);
|
||||||
|
d1 = g = (int*)malloc(sizeof(int) * max);
|
||||||
|
d2 = b = (int*)malloc(sizeof(int) * max);
|
||||||
|
|
||||||
|
if (r == NULL || g == NULL || b == NULL) goto fails;
|
||||||
|
|
||||||
|
/* if img->x0 is odd, then first column shall use Cb/Cr = 0 */
|
||||||
|
offx = img->x0 & 1U;
|
||||||
|
loopmaxw = maxw - offx;
|
||||||
|
/* if img->y0 is odd, then first line shall use Cb/Cr = 0 */
|
||||||
|
offy = img->y0 & 1U;
|
||||||
|
loopmaxh = maxh - offy;
|
||||||
|
|
||||||
|
if (offy > 0U) {
|
||||||
|
size_t j;
|
||||||
|
|
||||||
|
for(j=0; j < maxw; ++j)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, 0, 0, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i=0U; i < (loopmaxh & ~(size_t)1U); i += 2U)
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
|
||||||
|
ny = y + maxw;
|
||||||
|
nr = r + maxw; ng = g + maxw; nb = b + maxw;
|
||||||
|
|
||||||
|
if (offx > 0U) {
|
||||||
|
sycc_to_rgb(offset, upb, *y, 0, 0, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
||||||
|
++ny; ++nr; ++ng; ++nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(j=0; j < (loopmaxw & ~(size_t)1U); j += 2U)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
|
||||||
|
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
||||||
|
++ny; ++nr; ++ng; ++nb;
|
||||||
|
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
||||||
|
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
|
||||||
|
}
|
||||||
|
if(j < loopmaxw)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
|
||||||
|
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
|
||||||
|
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
|
||||||
|
}
|
||||||
|
y += maxw; r += maxw; g += maxw; b += maxw;
|
||||||
|
}
|
||||||
|
if(i < loopmaxh)
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
|
||||||
|
for(j=0U; j < (maxw & ~(size_t)1U); j += 2U)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
|
||||||
|
++y; ++r; ++g; ++b;
|
||||||
|
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
|
||||||
|
++y; ++r; ++g; ++b; ++cb; ++cr;
|
||||||
|
}
|
||||||
|
if(j < maxw)
|
||||||
|
{
|
||||||
|
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(img->comps[0].data); img->comps[0].data = d0;
|
||||||
|
free(img->comps[1].data); img->comps[1].data = d1;
|
||||||
|
free(img->comps[2].data); img->comps[2].data = d2;
|
||||||
|
|
||||||
|
img->comps[1].w = img->comps[2].w = img->comps[0].w;
|
||||||
|
img->comps[1].h = img->comps[2].h = img->comps[0].h;
|
||||||
|
img->comps[1].dx = img->comps[2].dx = img->comps[0].dx;
|
||||||
|
img->comps[1].dy = img->comps[2].dy = img->comps[0].dy;
|
||||||
|
img->color_space = OPJ_CLRSPC_SRGB;
|
||||||
|
return;
|
||||||
|
|
||||||
|
fails:
|
||||||
|
free(r);
|
||||||
|
free(g);
|
||||||
|
free(b);
|
||||||
|
}/* sycc420_to_rgb() */
|
||||||
|
|
||||||
|
void color_sycc_to_rgb(opj_image_t *img)
|
||||||
|
{
|
||||||
|
if(img->numcomps < 3)
|
||||||
|
{
|
||||||
|
img->color_space = OPJ_CLRSPC_GRAY;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((img->comps[0].dx == 1)
|
||||||
|
&& (img->comps[1].dx == 2)
|
||||||
|
&& (img->comps[2].dx == 2)
|
||||||
|
&& (img->comps[0].dy == 1)
|
||||||
|
&& (img->comps[1].dy == 2)
|
||||||
|
&& (img->comps[2].dy == 2))/* horizontal and vertical sub-sample */
|
||||||
|
{
|
||||||
|
sycc420_to_rgb(img);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if((img->comps[0].dx == 1)
|
||||||
|
&& (img->comps[1].dx == 2)
|
||||||
|
&& (img->comps[2].dx == 2)
|
||||||
|
&& (img->comps[0].dy == 1)
|
||||||
|
&& (img->comps[1].dy == 1)
|
||||||
|
&& (img->comps[2].dy == 1))/* horizontal sub-sample only */
|
||||||
|
{
|
||||||
|
sycc422_to_rgb(img);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if((img->comps[0].dx == 1)
|
||||||
|
&& (img->comps[1].dx == 1)
|
||||||
|
&& (img->comps[2].dx == 1)
|
||||||
|
&& (img->comps[0].dy == 1)
|
||||||
|
&& (img->comps[1].dy == 1)
|
||||||
|
&& (img->comps[2].dy == 1))/* no sub-sample */
|
||||||
|
{
|
||||||
|
sycc444_to_rgb(img);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr,"%s:%d:color_sycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}/* color_sycc_to_rgb() */
|
||||||
|
|
||||||
|
#if defined(OPJ_HAVE_LIBLCMS2) || defined(OPJ_HAVE_LIBLCMS1)
|
||||||
|
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
/* Bob Friesenhahn proposed:*/
|
||||||
|
#define cmsSigXYZData icSigXYZData
|
||||||
|
#define cmsSigLabData icSigLabData
|
||||||
|
#define cmsSigCmykData icSigCmykData
|
||||||
|
#define cmsSigYCbCrData icSigYCbCrData
|
||||||
|
#define cmsSigLuvData icSigLuvData
|
||||||
|
#define cmsSigGrayData icSigGrayData
|
||||||
|
#define cmsSigRgbData icSigRgbData
|
||||||
|
#define cmsUInt32Number DWORD
|
||||||
|
|
||||||
|
#define cmsColorSpaceSignature icColorSpaceSignature
|
||||||
|
#define cmsGetHeaderRenderingIntent cmsTakeRenderingIntent
|
||||||
|
|
||||||
|
#endif /* OPJ_HAVE_LIBLCMS1 */
|
||||||
|
|
||||||
|
/*#define DEBUG_PROFILE*/
|
||||||
|
void color_apply_icc_profile(opj_image_t *image)
|
||||||
|
{
|
||||||
|
cmsHPROFILE in_prof, out_prof;
|
||||||
|
cmsHTRANSFORM transform;
|
||||||
|
cmsColorSpaceSignature in_space, out_space;
|
||||||
|
cmsUInt32Number intent, in_type, out_type;
|
||||||
|
int *r, *g, *b;
|
||||||
|
size_t nr_samples, i, max, max_w, max_h;
|
||||||
|
int prec, ok = 0;
|
||||||
|
OPJ_COLOR_SPACE new_space;
|
||||||
|
|
||||||
|
in_prof = cmsOpenProfileFromMem(image->icc_profile_buf, image->icc_profile_len);
|
||||||
|
#ifdef DEBUG_PROFILE
|
||||||
|
FILE *icm = fopen("debug.icm","wb");
|
||||||
|
fwrite( image->icc_profile_buf,1, image->icc_profile_len,icm);
|
||||||
|
fclose(icm);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(in_prof == NULL) return;
|
||||||
|
|
||||||
|
in_space = cmsGetPCS(in_prof);
|
||||||
|
out_space = cmsGetColorSpace(in_prof);
|
||||||
|
intent = cmsGetHeaderRenderingIntent(in_prof);
|
||||||
|
|
||||||
|
|
||||||
|
max_w = image->comps[0].w;
|
||||||
|
max_h = image->comps[0].h;
|
||||||
|
prec = (int)image->comps[0].prec;
|
||||||
|
|
||||||
|
if(out_space == cmsSigRgbData) /* enumCS 16 */
|
||||||
|
{
|
||||||
|
if( prec <= 8 )
|
||||||
|
{
|
||||||
|
in_type = TYPE_RGB_8;
|
||||||
|
out_type = TYPE_RGB_8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
in_type = TYPE_RGB_16;
|
||||||
|
out_type = TYPE_RGB_16;
|
||||||
|
}
|
||||||
|
out_prof = cmsCreate_sRGBProfile();
|
||||||
|
new_space = OPJ_CLRSPC_SRGB;
|
||||||
|
}
|
||||||
|
else if(out_space == cmsSigGrayData) /* enumCS 17 */
|
||||||
|
{
|
||||||
|
in_type = TYPE_GRAY_8;
|
||||||
|
out_type = TYPE_RGB_8;
|
||||||
|
out_prof = cmsCreate_sRGBProfile();
|
||||||
|
new_space = OPJ_CLRSPC_SRGB;
|
||||||
|
}
|
||||||
|
else if(out_space == cmsSigYCbCrData) /* enumCS 18 */
|
||||||
|
{
|
||||||
|
in_type = TYPE_YCbCr_16;
|
||||||
|
out_type = TYPE_RGB_16;
|
||||||
|
out_prof = cmsCreate_sRGBProfile();
|
||||||
|
new_space = OPJ_CLRSPC_SRGB;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef DEBUG_PROFILE
|
||||||
|
fprintf(stderr,"%s:%d: color_apply_icc_profile\n\tICC Profile has unknown "
|
||||||
|
"output colorspace(%#x)(%c%c%c%c)\n\tICC Profile ignored.\n",
|
||||||
|
__FILE__,__LINE__,out_space,
|
||||||
|
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
|
||||||
|
(out_space>>8) & 0xff, out_space & 0xff);
|
||||||
|
#endif
|
||||||
|
cmsCloseProfile(in_prof);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(out_prof == NULL)
|
||||||
|
{
|
||||||
|
cmsCloseProfile(in_prof);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_PROFILE
|
||||||
|
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tchannels(%d) prec(%d) w(%d) h(%d)"
|
||||||
|
"\n\tprofile: in(%p) out(%p)\n",__FILE__,__LINE__,image->numcomps,prec,
|
||||||
|
max_w,max_h, (void*)in_prof,(void*)out_prof);
|
||||||
|
|
||||||
|
fprintf(stderr,"\trender_intent (%u)\n\t"
|
||||||
|
"color_space: in(%#x)(%c%c%c%c) out:(%#x)(%c%c%c%c)\n\t"
|
||||||
|
" type: in(%u) out:(%u)\n",
|
||||||
|
intent,
|
||||||
|
in_space,
|
||||||
|
(in_space>>24) & 0xff,(in_space>>16) & 0xff,
|
||||||
|
(in_space>>8) & 0xff, in_space & 0xff,
|
||||||
|
|
||||||
|
out_space,
|
||||||
|
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
|
||||||
|
(out_space>>8) & 0xff, out_space & 0xff,
|
||||||
|
|
||||||
|
in_type,out_type
|
||||||
|
);
|
||||||
|
#else
|
||||||
|
(void)prec;
|
||||||
|
(void)in_space;
|
||||||
|
#endif /* DEBUG_PROFILE */
|
||||||
|
|
||||||
|
transform = cmsCreateTransform(in_prof, in_type, out_prof, out_type, intent, 0);
|
||||||
|
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS2
|
||||||
|
/* Possible for: LCMS_VERSION >= 2000 :*/
|
||||||
|
cmsCloseProfile(in_prof);
|
||||||
|
cmsCloseProfile(out_prof);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(transform == NULL)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG_PROFILE
|
||||||
|
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
|
||||||
|
"ICC Profile ignored.\n",__FILE__,__LINE__);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
cmsCloseProfile(in_prof);
|
||||||
|
cmsCloseProfile(out_prof);
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(image->numcomps > 2)/* RGB, RGBA */
|
||||||
|
{
|
||||||
|
if( prec <= 8 )
|
||||||
|
{
|
||||||
|
unsigned char *inbuf, *outbuf, *in, *out;
|
||||||
|
|
||||||
|
max = max_w * max_h;
|
||||||
|
nr_samples = (size_t)(max * 3U * sizeof(unsigned char));
|
||||||
|
in = inbuf = (unsigned char*)malloc(nr_samples);
|
||||||
|
out = outbuf = (unsigned char*)malloc(nr_samples);
|
||||||
|
|
||||||
|
if(inbuf == NULL || outbuf == NULL) goto fails0;
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
g = image->comps[1].data;
|
||||||
|
b = image->comps[2].data;
|
||||||
|
|
||||||
|
for(i = 0U; i < max; ++i)
|
||||||
|
{
|
||||||
|
*in++ = (unsigned char)*r++;
|
||||||
|
*in++ = (unsigned char)*g++;
|
||||||
|
*in++ = (unsigned char)*b++;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
g = image->comps[1].data;
|
||||||
|
b = image->comps[2].data;
|
||||||
|
|
||||||
|
for(i = 0U; i < max; ++i)
|
||||||
|
{
|
||||||
|
*r++ = (int)*out++;
|
||||||
|
*g++ = (int)*out++;
|
||||||
|
*b++ = (int)*out++;
|
||||||
|
}
|
||||||
|
ok = 1;
|
||||||
|
|
||||||
|
fails0:
|
||||||
|
free(inbuf);
|
||||||
|
free(outbuf);
|
||||||
|
}
|
||||||
|
else /* prec > 8 */
|
||||||
|
{
|
||||||
|
unsigned short *inbuf, *outbuf, *in, *out;
|
||||||
|
|
||||||
|
max = max_w * max_h;
|
||||||
|
nr_samples = (size_t)(max * 3U * sizeof(unsigned short));
|
||||||
|
in = inbuf = (unsigned short*)malloc(nr_samples);
|
||||||
|
out = outbuf = (unsigned short*)malloc(nr_samples);
|
||||||
|
|
||||||
|
if(inbuf == NULL || outbuf == NULL) goto fails1;
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
g = image->comps[1].data;
|
||||||
|
b = image->comps[2].data;
|
||||||
|
|
||||||
|
for(i = 0U ; i < max; ++i)
|
||||||
|
{
|
||||||
|
*in++ = (unsigned short)*r++;
|
||||||
|
*in++ = (unsigned short)*g++;
|
||||||
|
*in++ = (unsigned short)*b++;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
g = image->comps[1].data;
|
||||||
|
b = image->comps[2].data;
|
||||||
|
|
||||||
|
for(i = 0; i < max; ++i)
|
||||||
|
{
|
||||||
|
*r++ = (int)*out++;
|
||||||
|
*g++ = (int)*out++;
|
||||||
|
*b++ = (int)*out++;
|
||||||
|
}
|
||||||
|
ok = 1;
|
||||||
|
|
||||||
|
fails1:
|
||||||
|
free(inbuf);
|
||||||
|
free(outbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else /* image->numcomps <= 2 : GRAY, GRAYA */
|
||||||
|
{
|
||||||
|
if(prec <= 8)
|
||||||
|
{
|
||||||
|
unsigned char *in, *inbuf, *out, *outbuf;
|
||||||
|
opj_image_comp_t *new_comps;
|
||||||
|
|
||||||
|
max = max_w * max_h;
|
||||||
|
nr_samples = (size_t)(max * 3 * sizeof(unsigned char));
|
||||||
|
in = inbuf = (unsigned char*)malloc(nr_samples);
|
||||||
|
out = outbuf = (unsigned char*)malloc(nr_samples);
|
||||||
|
g = (int*)calloc((size_t)max, sizeof(int));
|
||||||
|
b = (int*)calloc((size_t)max, sizeof(int));
|
||||||
|
|
||||||
|
if(inbuf == NULL || outbuf == NULL || g == NULL || b == NULL) goto fails2;
|
||||||
|
|
||||||
|
new_comps = (opj_image_comp_t*)realloc(image->comps, (image->numcomps+2)*sizeof(opj_image_comp_t));
|
||||||
|
|
||||||
|
if(new_comps == NULL) goto fails2;
|
||||||
|
|
||||||
|
image->comps = new_comps;
|
||||||
|
|
||||||
|
if(image->numcomps == 2)
|
||||||
|
image->comps[3] = image->comps[1];
|
||||||
|
|
||||||
|
image->comps[1] = image->comps[0];
|
||||||
|
image->comps[2] = image->comps[0];
|
||||||
|
|
||||||
|
image->comps[1].data = g;
|
||||||
|
image->comps[2].data = b;
|
||||||
|
|
||||||
|
image->numcomps += 2;
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
|
||||||
|
for(i = 0U; i < max; ++i)
|
||||||
|
{
|
||||||
|
*in++ = (unsigned char)*r++;
|
||||||
|
}
|
||||||
|
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
g = image->comps[1].data;
|
||||||
|
b = image->comps[2].data;
|
||||||
|
|
||||||
|
for(i = 0U; i < max; ++i)
|
||||||
|
{
|
||||||
|
*r++ = (int)*out++; *g++ = (int)*out++; *b++ = (int)*out++;
|
||||||
|
}
|
||||||
|
r = g = b = NULL;
|
||||||
|
ok = 1;
|
||||||
|
|
||||||
|
fails2:
|
||||||
|
free(inbuf);
|
||||||
|
free(outbuf);
|
||||||
|
free(g);
|
||||||
|
free(b);
|
||||||
|
}
|
||||||
|
else /* prec > 8 */
|
||||||
|
{
|
||||||
|
unsigned short *in, *inbuf, *out, *outbuf;
|
||||||
|
opj_image_comp_t *new_comps;
|
||||||
|
|
||||||
|
max = max_w * max_h;
|
||||||
|
nr_samples = (size_t)(max * 3U * sizeof(unsigned short));
|
||||||
|
in = inbuf = (unsigned short*)malloc(nr_samples);
|
||||||
|
out = outbuf = (unsigned short*)malloc(nr_samples);
|
||||||
|
g = (int*)calloc((size_t)max, sizeof(int));
|
||||||
|
b = (int*)calloc((size_t)max, sizeof(int));
|
||||||
|
|
||||||
|
if(inbuf == NULL || outbuf == NULL || g == NULL || b == NULL) goto fails3;
|
||||||
|
|
||||||
|
new_comps = (opj_image_comp_t*)realloc(image->comps, (image->numcomps+2)*sizeof(opj_image_comp_t));
|
||||||
|
|
||||||
|
if(new_comps == NULL) goto fails3;
|
||||||
|
|
||||||
|
image->comps = new_comps;
|
||||||
|
|
||||||
|
if(image->numcomps == 2)
|
||||||
|
image->comps[3] = image->comps[1];
|
||||||
|
|
||||||
|
image->comps[1] = image->comps[0];
|
||||||
|
image->comps[2] = image->comps[0];
|
||||||
|
|
||||||
|
image->comps[1].data = g;
|
||||||
|
image->comps[2].data = b;
|
||||||
|
|
||||||
|
image->numcomps += 2;
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
|
||||||
|
for(i = 0U; i < max; ++i)
|
||||||
|
{
|
||||||
|
*in++ = (unsigned short)*r++;
|
||||||
|
}
|
||||||
|
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
|
||||||
|
|
||||||
|
r = image->comps[0].data;
|
||||||
|
g = image->comps[1].data;
|
||||||
|
b = image->comps[2].data;
|
||||||
|
|
||||||
|
for(i = 0; i < max; ++i)
|
||||||
|
{
|
||||||
|
*r++ = (int)*out++; *g++ = (int)*out++; *b++ = (int)*out++;
|
||||||
|
}
|
||||||
|
r = g = b = NULL;
|
||||||
|
ok = 1;
|
||||||
|
|
||||||
|
fails3:
|
||||||
|
free(inbuf);
|
||||||
|
free(outbuf);
|
||||||
|
free(g);
|
||||||
|
free(b);
|
||||||
|
}
|
||||||
|
}/* if(image->numcomps > 2) */
|
||||||
|
|
||||||
|
cmsDeleteTransform(transform);
|
||||||
|
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
cmsCloseProfile(in_prof);
|
||||||
|
cmsCloseProfile(out_prof);
|
||||||
|
#endif
|
||||||
|
if(ok)
|
||||||
|
{
|
||||||
|
image->color_space = new_space;
|
||||||
|
}
|
||||||
|
}/* color_apply_icc_profile() */
|
||||||
|
|
||||||
|
void color_cielab_to_rgb(opj_image_t *image)
|
||||||
|
{
|
||||||
|
int *row;
|
||||||
|
int enumcs, numcomps;
|
||||||
|
OPJ_COLOR_SPACE new_space;
|
||||||
|
|
||||||
|
numcomps = (int)image->numcomps;
|
||||||
|
|
||||||
|
if(numcomps != 3)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"%s:%d:\n\tnumcomps %d not handled. Quitting.\n",
|
||||||
|
__FILE__,__LINE__,numcomps);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
row = (int*)image->icc_profile_buf;
|
||||||
|
enumcs = row[0];
|
||||||
|
|
||||||
|
if(enumcs == 14) /* CIELab */
|
||||||
|
{
|
||||||
|
int *L, *a, *b, *red, *green, *blue;
|
||||||
|
int *src0, *src1, *src2, *dst0, *dst1, *dst2;
|
||||||
|
double rl, ol, ra, oa, rb, ob, prec0, prec1, prec2;
|
||||||
|
double minL, maxL, mina, maxa, minb, maxb;
|
||||||
|
unsigned int default_type;
|
||||||
|
unsigned int i, max;
|
||||||
|
cmsHPROFILE in, out;
|
||||||
|
cmsHTRANSFORM transform;
|
||||||
|
cmsUInt16Number RGB[3];
|
||||||
|
cmsCIELab Lab;
|
||||||
|
|
||||||
|
in = cmsCreateLab4Profile(NULL);
|
||||||
|
if(in == NULL){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
out = cmsCreate_sRGBProfile();
|
||||||
|
if(out == NULL){
|
||||||
|
cmsCloseProfile(in);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
transform = cmsCreateTransform(in, TYPE_Lab_DBL, out, TYPE_RGB_16, INTENT_PERCEPTUAL, 0);
|
||||||
|
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS2
|
||||||
|
cmsCloseProfile(in);
|
||||||
|
cmsCloseProfile(out);
|
||||||
|
#endif
|
||||||
|
if(transform == NULL)
|
||||||
|
{
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
cmsCloseProfile(in);
|
||||||
|
cmsCloseProfile(out);
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
new_space = OPJ_CLRSPC_SRGB;
|
||||||
|
|
||||||
|
prec0 = (double)image->comps[0].prec;
|
||||||
|
prec1 = (double)image->comps[1].prec;
|
||||||
|
prec2 = (double)image->comps[2].prec;
|
||||||
|
|
||||||
|
default_type = (unsigned int)row[1];
|
||||||
|
|
||||||
|
if(default_type == 0x44454600)/* DEF : default */
|
||||||
|
{
|
||||||
|
rl = 100; ra = 170; rb = 200;
|
||||||
|
ol = 0;
|
||||||
|
oa = pow(2, prec1 - 1);
|
||||||
|
ob = pow(2, prec2 - 2) + pow(2, prec2 - 3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rl = row[2]; ra = row[4]; rb = row[6];
|
||||||
|
ol = row[3]; oa = row[5]; ob = row[7];
|
||||||
|
}
|
||||||
|
|
||||||
|
L = src0 = image->comps[0].data;
|
||||||
|
a = src1 = image->comps[1].data;
|
||||||
|
b = src2 = image->comps[2].data;
|
||||||
|
|
||||||
|
max = image->comps[0].w * image->comps[0].h;
|
||||||
|
|
||||||
|
red = dst0 = (int*)malloc(max * sizeof(int));
|
||||||
|
green = dst1 = (int*)malloc(max * sizeof(int));
|
||||||
|
blue = dst2 = (int*)malloc(max * sizeof(int));
|
||||||
|
|
||||||
|
if(red == NULL || green == NULL || blue == NULL) goto fails;
|
||||||
|
|
||||||
|
minL = -(rl * ol)/(pow(2, prec0)-1);
|
||||||
|
maxL = minL + rl;
|
||||||
|
|
||||||
|
mina = -(ra * oa)/(pow(2, prec1)-1);
|
||||||
|
maxa = mina + ra;
|
||||||
|
|
||||||
|
minb = -(rb * ob)/(pow(2, prec2)-1);
|
||||||
|
maxb = minb + rb;
|
||||||
|
|
||||||
|
for(i = 0; i < max; ++i)
|
||||||
|
{
|
||||||
|
Lab.L = minL + (double)(*L) * (maxL - minL)/(pow(2, prec0)-1); ++L;
|
||||||
|
Lab.a = mina + (double)(*a) * (maxa - mina)/(pow(2, prec1)-1); ++a;
|
||||||
|
Lab.b = minb + (double)(*b) * (maxb - minb)/(pow(2, prec2)-1); ++b;
|
||||||
|
|
||||||
|
cmsDoTransform(transform, &Lab, RGB, 1);
|
||||||
|
|
||||||
|
*red++ = RGB[0];
|
||||||
|
*green++ = RGB[1];
|
||||||
|
*blue++ = RGB[2];
|
||||||
|
}
|
||||||
|
cmsDeleteTransform(transform);
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
cmsCloseProfile(in);
|
||||||
|
cmsCloseProfile(out);
|
||||||
|
#endif
|
||||||
|
free(src0); image->comps[0].data = dst0;
|
||||||
|
free(src1); image->comps[1].data = dst1;
|
||||||
|
free(src2); image->comps[2].data = dst2;
|
||||||
|
|
||||||
|
image->color_space = new_space;
|
||||||
|
image->comps[0].prec = 16;
|
||||||
|
image->comps[1].prec = 16;
|
||||||
|
image->comps[2].prec = 16;
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
fails:
|
||||||
|
cmsDeleteTransform(transform);
|
||||||
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
|
cmsCloseProfile(in);
|
||||||
|
cmsCloseProfile(out);
|
||||||
|
#endif
|
||||||
|
if(red) free(red);
|
||||||
|
if(green) free(green);
|
||||||
|
if(blue) free(blue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s:%d:\n\tenumCS %d not handled. Ignoring.\n", __FILE__,__LINE__, enumcs);
|
||||||
|
}/* color_cielab_to_rgb() */
|
||||||
|
|
||||||
|
#endif /* OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1 */
|
||||||
|
|
||||||
|
void color_cmyk_to_rgb(opj_image_t *image)
|
||||||
|
{
|
||||||
|
float C, M, Y, K;
|
||||||
|
float sC, sM, sY, sK;
|
||||||
|
unsigned int w, h, max, i;
|
||||||
|
|
||||||
|
w = image->comps[0].w;
|
||||||
|
h = image->comps[0].h;
|
||||||
|
|
||||||
|
if (
|
||||||
|
(image->numcomps < 4)
|
||||||
|
|| (image->comps[0].dx != image->comps[1].dx) || (image->comps[0].dx != image->comps[2].dx) || (image->comps[0].dx != image->comps[3].dx)
|
||||||
|
|| (image->comps[0].dy != image->comps[1].dy) || (image->comps[0].dy != image->comps[2].dy) || (image->comps[0].dy != image->comps[3].dy)
|
||||||
|
) {
|
||||||
|
fprintf(stderr,"%s:%d:color_cmyk_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
max = w * h;
|
||||||
|
|
||||||
|
sC = 1.0F / (float)((1 << image->comps[0].prec) - 1);
|
||||||
|
sM = 1.0F / (float)((1 << image->comps[1].prec) - 1);
|
||||||
|
sY = 1.0F / (float)((1 << image->comps[2].prec) - 1);
|
||||||
|
sK = 1.0F / (float)((1 << image->comps[3].prec) - 1);
|
||||||
|
|
||||||
|
for(i = 0; i < max; ++i)
|
||||||
|
{
|
||||||
|
/* CMYK values from 0 to 1 */
|
||||||
|
C = (float)(image->comps[0].data[i]) * sC;
|
||||||
|
M = (float)(image->comps[1].data[i]) * sM;
|
||||||
|
Y = (float)(image->comps[2].data[i]) * sY;
|
||||||
|
K = (float)(image->comps[3].data[i]) * sK;
|
||||||
|
|
||||||
|
/* Invert all CMYK values */
|
||||||
|
C = 1.0F - C;
|
||||||
|
M = 1.0F - M;
|
||||||
|
Y = 1.0F - Y;
|
||||||
|
K = 1.0F - K;
|
||||||
|
|
||||||
|
/* CMYK -> RGB : RGB results from 0 to 255 */
|
||||||
|
image->comps[0].data[i] = (int)(255.0F * C * K); /* R */
|
||||||
|
image->comps[1].data[i] = (int)(255.0F * M * K); /* G */
|
||||||
|
image->comps[2].data[i] = (int)(255.0F * Y * K); /* B */
|
||||||
|
}
|
||||||
|
|
||||||
|
free(image->comps[3].data); image->comps[3].data = NULL;
|
||||||
|
image->comps[0].prec = 8;
|
||||||
|
image->comps[1].prec = 8;
|
||||||
|
image->comps[2].prec = 8;
|
||||||
|
image->numcomps -= 1;
|
||||||
|
image->color_space = OPJ_CLRSPC_SRGB;
|
||||||
|
|
||||||
|
for (i = 3; i < image->numcomps; ++i) {
|
||||||
|
memcpy(&(image->comps[i]), &(image->comps[i+1]), sizeof(image->comps[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
}/* color_cmyk_to_rgb() */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This code has been adopted from sjpx_openjpeg.c of ghostscript
|
||||||
|
*/
|
||||||
|
void color_esycc_to_rgb(opj_image_t *image)
|
||||||
|
{
|
||||||
|
int y, cb, cr, sign1, sign2, val;
|
||||||
|
unsigned int w, h, max, i;
|
||||||
|
int flip_value = (1 << (image->comps[0].prec-1));
|
||||||
|
int max_value = (1 << image->comps[0].prec) - 1;
|
||||||
|
|
||||||
|
if (
|
||||||
|
(image->numcomps < 3)
|
||||||
|
|| (image->comps[0].dx != image->comps[1].dx) || (image->comps[0].dx != image->comps[2].dx)
|
||||||
|
|| (image->comps[0].dy != image->comps[1].dy) || (image->comps[0].dy != image->comps[2].dy)
|
||||||
|
) {
|
||||||
|
fprintf(stderr,"%s:%d:color_esycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
w = image->comps[0].w;
|
||||||
|
h = image->comps[0].h;
|
||||||
|
|
||||||
|
sign1 = (int)image->comps[1].sgnd;
|
||||||
|
sign2 = (int)image->comps[2].sgnd;
|
||||||
|
|
||||||
|
max = w * h;
|
||||||
|
|
||||||
|
for(i = 0; i < max; ++i)
|
||||||
|
{
|
||||||
|
|
||||||
|
y = image->comps[0].data[i]; cb = image->comps[1].data[i]; cr = image->comps[2].data[i];
|
||||||
|
|
||||||
|
if( !sign1) cb -= flip_value;
|
||||||
|
if( !sign2) cr -= flip_value;
|
||||||
|
|
||||||
|
val = (int)
|
||||||
|
((float)y - (float)0.0000368 * (float)cb
|
||||||
|
+ (float)1.40199 * (float)cr + (float)0.5);
|
||||||
|
|
||||||
|
if(val > max_value) val = max_value; else if(val < 0) val = 0;
|
||||||
|
image->comps[0].data[i] = val;
|
||||||
|
|
||||||
|
val = (int)
|
||||||
|
((float)1.0003 * (float)y - (float)0.344125 * (float)cb
|
||||||
|
- (float)0.7141128 * (float)cr + (float)0.5);
|
||||||
|
|
||||||
|
if(val > max_value) val = max_value; else if(val < 0) val = 0;
|
||||||
|
image->comps[1].data[i] = val;
|
||||||
|
|
||||||
|
val = (int)
|
||||||
|
((float)0.999823 * (float)y + (float)1.77204 * (float)cb
|
||||||
|
- (float)0.000008 *(float)cr + (float)0.5);
|
||||||
|
|
||||||
|
if(val > max_value) val = max_value; else if(val < 0) val = 0;
|
||||||
|
image->comps[2].data[i] = val;
|
||||||
|
}
|
||||||
|
image->color_space = OPJ_CLRSPC_SRGB;
|
||||||
|
|
||||||
|
}/* color_esycc_to_rgb() */
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
* 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) 2001-2003, David Janssens
|
||||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
* 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) 2005, Herve Drolon, FreeImage Team
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -34,5 +40,8 @@
|
|||||||
|
|
||||||
extern void color_sycc_to_rgb(opj_image_t *img);
|
extern void color_sycc_to_rgb(opj_image_t *img);
|
||||||
extern void color_apply_icc_profile(opj_image_t *image);
|
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_ */
|
#endif /* _OPJ_COLOR_H_ */
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
* 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) 2001-2003, David Janssens
|
||||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
* 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) 2005, Herve Drolon, FreeImage Team
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -41,8 +47,9 @@
|
|||||||
#define BMP_DFMT 12
|
#define BMP_DFMT 12
|
||||||
#define YUV_DFMT 13
|
#define YUV_DFMT 13
|
||||||
#define TIF_DFMT 14
|
#define TIF_DFMT 14
|
||||||
#define RAW_DFMT 15
|
#define RAW_DFMT 15 /* MSB / Big Endian */
|
||||||
#define TGA_DFMT 16
|
#define TGA_DFMT 16
|
||||||
#define PNG_DFMT 17
|
#define PNG_DFMT 17
|
||||||
|
#define RAWL_DFMT 18 /* LSB / Little Endian */
|
||||||
|
|
||||||
#endif /* _OPJ_FORMAT_DEFS_H_ */
|
#endif /* _OPJ_FORMAT_DEFS_H_ */
|
||||||
15
src/bin/common/opj_apps_config.h.cmake.in
Normal file
15
src/bin/common/opj_apps_config.h.cmake.in
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include "opj_config_private.h"
|
||||||
|
|
||||||
|
/* create opj_apps_config.h for CMake */
|
||||||
|
|
||||||
|
#cmakedefine OPJ_HAVE_LIBPNG @HAVE_LIBPNG@
|
||||||
|
#cmakedefine OPJ_HAVE_PNG_H @HAVE_PNG_H@
|
||||||
|
#cmakedefine OPJ_HAVE_LIBTIFF @HAVE_LIBTIFF@
|
||||||
|
#cmakedefine OPJ_HAVE_TIFF_H @HAVE_TIFF_H@
|
||||||
|
|
||||||
|
#cmakedefine OPJ_HAVE_LIBLCMS1
|
||||||
|
#cmakedefine OPJ_HAVE_LIBLCMS2
|
||||||
|
#cmakedefine OPJ_HAVE_LCMS1_H
|
||||||
|
#cmakedefine OPJ_HAVE_LCMS2_H
|
||||||
|
|
||||||
|
|
||||||
@@ -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
|
* Copyright (c) 1987, 1993, 1994
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -38,10 +43,6 @@ static char sccsid[] = "@(#)opj_getopt.c 8.3 (Berkeley) 4/27/95";
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "opj_getopt.h"
|
#include "opj_getopt.h"
|
||||||
|
|
||||||
#ifdef USE_SYSTEM_GETOPT
|
|
||||||
#error
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int opj_opterr = 1, /* if error message should be printed */
|
int opj_opterr = 1, /* if error message should be printed */
|
||||||
opj_optind = 1, /* index into parent argv vector */
|
opj_optind = 1, /* index into parent argv vector */
|
||||||
opj_optopt, /* character checked for validity */
|
opj_optopt, /* character checked for validity */
|
||||||
@@ -53,7 +54,7 @@ int opj_opterr = 1, /* if error message should be printed */
|
|||||||
static char EMSG[]={""};
|
static char EMSG[]={""};
|
||||||
|
|
||||||
/* As this class remembers its values from one Java call to the other, reset the values before each use */
|
/* 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_opterr = 1;
|
||||||
opj_optind = 1;
|
opj_optind = 1;
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,7 @@ void reset_options_reading(void) {
|
|||||||
int opj_getopt(int nargc, char *const *nargv, const char *ostr) {
|
int opj_getopt(int nargc, char *const *nargv, const char *ostr) {
|
||||||
# define __progname nargv[0]
|
# define __progname nargv[0]
|
||||||
static char *place = EMSG; /* option letter processing */
|
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 */
|
if (opj_optreset || !*place) { /* update scanning pointer */
|
||||||
opj_optreset = 0;
|
opj_optreset = 0;
|
||||||
@@ -124,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,
|
int opj_getopt_long(int argc, char * const argv[], const char *optstring,
|
||||||
const opj_option_t *longopts, int totlen) {
|
const opj_option_t *longopts, int totlen) {
|
||||||
static int lastidx,lastofs;
|
static int lastidx,lastofs;
|
||||||
char *tmp;
|
const char *tmp;
|
||||||
int i,len;
|
int i,len;
|
||||||
char param = 1;
|
char param = 1;
|
||||||
|
|
||||||
@@ -1,26 +1,5 @@
|
|||||||
/* last review : october 29th, 2002 */
|
/* last review : october 29th, 2002 */
|
||||||
|
|
||||||
#include "opj_config.h"
|
|
||||||
|
|
||||||
#ifdef USE_SYSTEM_GETOPT
|
|
||||||
#include <getopt.h>
|
|
||||||
|
|
||||||
#define opj_opterr opterr
|
|
||||||
#define opj_optind optind
|
|
||||||
#define opj_optopt optopt
|
|
||||||
#define opj_optreset optreset
|
|
||||||
#define opj_optarg optarg
|
|
||||||
|
|
||||||
typedef struct option opj_option_t;
|
|
||||||
|
|
||||||
#define NO_ARG no_argument
|
|
||||||
#define REQ_ARG required_argument
|
|
||||||
#define OPT_ARG optional_argument
|
|
||||||
|
|
||||||
#define opj_getopt getopt
|
|
||||||
#define opj_getopt_long getopt_long
|
|
||||||
|
|
||||||
#else
|
|
||||||
#ifndef _GETOPT_H_
|
#ifndef _GETOPT_H_
|
||||||
#define _GETOPT_H_
|
#define _GETOPT_H_
|
||||||
|
|
||||||
@@ -30,7 +9,7 @@ typedef struct opj_option
|
|||||||
int has_arg;
|
int has_arg;
|
||||||
int *flag;
|
int *flag;
|
||||||
int val;
|
int val;
|
||||||
} opj_option_t;
|
}opj_option_t;
|
||||||
|
|
||||||
#define NO_ARG 0
|
#define NO_ARG 0
|
||||||
#define REQ_ARG 1
|
#define REQ_ARG 1
|
||||||
@@ -45,7 +24,6 @@ extern char *opj_optarg;
|
|||||||
extern int opj_getopt(int nargc, char *const *nargv, const char *ostr);
|
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,
|
extern int opj_getopt_long(int argc, char * const argv[], const char *optstring,
|
||||||
const opj_option_t *longopts, int totlen);
|
const opj_option_t *longopts, int totlen);
|
||||||
extern void reset_options_reading(void);
|
extern void opj_reset_options_reading(void);
|
||||||
|
|
||||||
#endif /* _GETOPT_H_ */
|
#endif /* _GETOPT_H_ */
|
||||||
#endif /* USE_SYSTEM_GETOPT */
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* $Id$
|
* 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-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
* Copyright (c) 2015, Matthieu Darbois
|
||||||
* Copyright (c) 2002-2011, Professor Benoit Macq
|
|
||||||
* Copyright (c) 2010-2011, Kaori Hagihara
|
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -28,45 +29,44 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \file
|
#ifndef OPJ_STRING_H
|
||||||
* \brief jpip_to_jp2 is a program to convert JPT- JPP- stream to JP2 file
|
#define OPJ_STRING_H
|
||||||
*
|
|
||||||
* \section impinst Implementing instructions
|
|
||||||
* This program takes two arguments. \n
|
|
||||||
* -# Input JPT or JPP file
|
|
||||||
* -# Output JP2 file\n
|
|
||||||
* % ./jpip_to_jp2 input.jpt output.jp2
|
|
||||||
* or
|
|
||||||
* % ./jpip_to_jp2 input.jpp output.jp2
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <errno.h>
|
||||||
#include "openjpip.h"
|
#include <string.h>
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
/* 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)
|
||||||
{
|
{
|
||||||
jpip_dec_param_t *dec;
|
size_t len;
|
||||||
|
|
||||||
if( argc < 3){
|
if (src == NULL) {
|
||||||
fprintf( stderr, "Too few arguments:\n");
|
return 0U;
|
||||||
fprintf( stderr, " - input jpt or jpp file\n");
|
}
|
||||||
fprintf( stderr, " - output jp2 file\n");
|
for (len = 0U; (*src != '\0') && (len < max_len); src++, len++);
|
||||||
return -1;
|
return len;
|
||||||
}
|
|
||||||
|
|
||||||
dec = init_jpipdecoder( true);
|
|
||||||
|
|
||||||
if(!( fread_jpip( argv[1], dec)))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
decode_jpip( dec);
|
|
||||||
|
|
||||||
if(!(fwrite_jp2k( argv[2], dec)))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
output_log( true, false, true, dec);
|
|
||||||
|
|
||||||
destroy_jpipdecoder( &dec);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
||||||
82
src/bin/jp2/CMakeLists.txt
Normal file
82
src/bin/jp2/CMakeLists.txt
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
# Build the demo app, small examples
|
||||||
|
|
||||||
|
# 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
|
||||||
|
${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
|
||||||
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
|
||||||
|
${OPENJPEG_SOURCE_DIR}/src/bin/common
|
||||||
|
${LCMS_INCLUDE_DIRNAME}
|
||||||
|
${Z_INCLUDE_DIRNAME}
|
||||||
|
${PNG_INCLUDE_DIRNAME}
|
||||||
|
${TIFF_INCLUDE_DIRNAME}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
add_definitions(-DOPJ_EXPORTS)
|
||||||
|
else()
|
||||||
|
add_definitions(-DOPJ_STATIC)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Loop over all executables:
|
||||||
|
foreach(exe opj_decompress opj_compress opj_dump)
|
||||||
|
add_executable(${exe} ${exe}.c ${common_SRCS})
|
||||||
|
target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
|
||||||
|
${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
|
||||||
|
)
|
||||||
|
# To support universal exe:
|
||||||
|
if(ZLIB_FOUND AND APPLE)
|
||||||
|
target_link_libraries(${exe} z)
|
||||||
|
else(ZLIB_FOUND AND APPLE)
|
||||||
|
target_link_libraries(${exe} ${Z_LIBNAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# On unix you need to link to the math library:
|
||||||
|
if(UNIX)
|
||||||
|
target_link_libraries(${exe} m)
|
||||||
|
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
|
||||||
|
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
|
||||||
|
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
|
||||||
|
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
|
||||||
|
#
|
||||||
|
endif()
|
||||||
2276
src/bin/jp2/convert.c
Normal file
2276
src/bin/jp2/convert.c
Normal file
File diff suppressed because it is too large
Load Diff
119
src/bin/jp2/convert.h
Normal file
119
src/bin/jp2/convert.h
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
* 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 __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 {
|
||||||
|
/** width of the raw image */
|
||||||
|
int rawWidth;
|
||||||
|
/** height of the raw image */
|
||||||
|
int rawHeight;
|
||||||
|
/** number of components of the raw image */
|
||||||
|
int rawComp;
|
||||||
|
/** 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);
|
||||||
|
|
||||||
|
/* BMP conversion */
|
||||||
|
opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters);
|
||||||
|
int imagetobmp(opj_image_t *image, const char *outfile);
|
||||||
|
|
||||||
|
/* TIFF conversion*/
|
||||||
|
opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters);
|
||||||
|
int imagetotif(opj_image_t *image, const char *outfile);
|
||||||
|
/**
|
||||||
|
Load a single image component encoded in PGX file format
|
||||||
|
@param filename Name of the PGX file to load
|
||||||
|
@param parameters *List ?*
|
||||||
|
@return Returns a greyscale image if successful, returns NULL otherwise
|
||||||
|
*/
|
||||||
|
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 force_split);
|
||||||
|
|
||||||
|
/* RAW conversion */
|
||||||
|
int imagetoraw(opj_image_t * image, const char *outfile);
|
||||||
|
int imagetorawl(opj_image_t * image, const char *outfile);
|
||||||
|
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
|
||||||
|
opj_image_t* rawltoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
|
||||||
|
|
||||||
|
/* PNG conversion*/
|
||||||
|
extern int imagetopng(opj_image_t *image, const char *write_idf);
|
||||||
|
extern opj_image_t* pngtoimage(const char *filename, opj_cparameters_t *parameters);
|
||||||
|
|
||||||
|
#endif /* __J2K_CONVERT_H */
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -45,72 +45,55 @@
|
|||||||
#include "openjpeg.h"
|
#include "openjpeg.h"
|
||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
|
|
||||||
#ifdef HAVE_STDINT_H
|
|
||||||
#include <stdint.h>
|
|
||||||
#else
|
|
||||||
#if defined(_WIN32)
|
|
||||||
typedef signed __int8 int8_t;
|
|
||||||
typedef unsigned __int8 uint8_t;
|
|
||||||
typedef signed __int16 int16_t;
|
|
||||||
typedef unsigned __int16 uint16_t;
|
|
||||||
typedef signed __int32 int32_t;
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
typedef signed __int64 int64_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
#else
|
|
||||||
#error unsupported platform
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t bfType; /* 'BM' for Bitmap (19776) */
|
OPJ_UINT16 bfType; /* 'BM' for Bitmap (19776) */
|
||||||
uint32_t bfSize; /* Size of the file */
|
OPJ_UINT32 bfSize; /* Size of the file */
|
||||||
uint16_t bfReserved1; /* Reserved : 0 */
|
OPJ_UINT16 bfReserved1; /* Reserved : 0 */
|
||||||
uint16_t bfReserved2; /* Reserved : 0 */
|
OPJ_UINT16 bfReserved2; /* Reserved : 0 */
|
||||||
uint32_t bfOffBits; /* Offset */
|
OPJ_UINT32 bfOffBits; /* Offset */
|
||||||
} OPJ_BITMAPFILEHEADER;
|
} OPJ_BITMAPFILEHEADER;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t biSize; /* Size of the structure in bytes */
|
OPJ_UINT32 biSize; /* Size of the structure in bytes */
|
||||||
uint32_t biWidth; /* Width of the image in pixels */
|
OPJ_UINT32 biWidth; /* Width of the image in pixels */
|
||||||
uint32_t biHeight; /* Heigth of the image in pixels */
|
OPJ_UINT32 biHeight; /* Heigth of the image in pixels */
|
||||||
uint16_t biPlanes; /* 1 */
|
OPJ_UINT16 biPlanes; /* 1 */
|
||||||
uint16_t biBitCount; /* Number of color bits by pixels */
|
OPJ_UINT16 biBitCount; /* Number of color bits by pixels */
|
||||||
uint32_t biCompression; /* Type of encoding 0: none 1: RLE8 2: RLE4 */
|
OPJ_UINT32 biCompression; /* Type of encoding 0: none 1: RLE8 2: RLE4 */
|
||||||
uint32_t biSizeImage; /* Size of the image in bytes */
|
OPJ_UINT32 biSizeImage; /* Size of the image in bytes */
|
||||||
uint32_t biXpelsPerMeter; /* Horizontal (X) resolution in pixels/meter */
|
OPJ_UINT32 biXpelsPerMeter; /* Horizontal (X) resolution in pixels/meter */
|
||||||
uint32_t biYpelsPerMeter; /* Vertical (Y) resolution in pixels/meter */
|
OPJ_UINT32 biYpelsPerMeter; /* Vertical (Y) resolution in pixels/meter */
|
||||||
uint32_t biClrUsed; /* Number of color used in the image (0: ALL) */
|
OPJ_UINT32 biClrUsed; /* Number of color used in the image (0: ALL) */
|
||||||
uint32_t biClrImportant; /* Number of important color (0: ALL) */
|
OPJ_UINT32 biClrImportant; /* Number of important color (0: ALL) */
|
||||||
uint32_t biRedMask; /* Red channel bit mask */
|
OPJ_UINT32 biRedMask; /* Red channel bit mask */
|
||||||
uint32_t biGreenMask; /* Green channel bit mask */
|
OPJ_UINT32 biGreenMask; /* Green channel bit mask */
|
||||||
uint32_t biBlueMask; /* Blue channel bit mask */
|
OPJ_UINT32 biBlueMask; /* Blue channel bit mask */
|
||||||
uint32_t biAlphaMask; /* Alpha channel bit mask */
|
OPJ_UINT32 biAlphaMask; /* Alpha channel bit mask */
|
||||||
uint32_t biColorSpaceType; /* Color space type */
|
OPJ_UINT32 biColorSpaceType; /* Color space type */
|
||||||
uint8_t biColorSpaceEP[36]; /* Color space end points */
|
OPJ_UINT8 biColorSpaceEP[36]; /* Color space end points */
|
||||||
uint32_t biRedGamma; /* Red channel gamma */
|
OPJ_UINT32 biRedGamma; /* Red channel gamma */
|
||||||
uint32_t biGreenGamma; /* Green channel gamma */
|
OPJ_UINT32 biGreenGamma; /* Green channel gamma */
|
||||||
uint32_t biBlueGamma; /* Blue channel gamma */
|
OPJ_UINT32 biBlueGamma; /* Blue channel gamma */
|
||||||
uint32_t biIntent; /* Intent */
|
OPJ_UINT32 biIntent; /* Intent */
|
||||||
uint32_t biIccProfileData; /* ICC profile data */
|
OPJ_UINT32 biIccProfileData; /* ICC profile data */
|
||||||
uint32_t biIccProfileSize; /* ICC profile size */
|
OPJ_UINT32 biIccProfileSize; /* ICC profile size */
|
||||||
uint32_t biReserved; /* Reserved */
|
OPJ_UINT32 biReserved; /* Reserved */
|
||||||
} OPJ_BITMAPINFOHEADER;
|
} OPJ_BITMAPINFOHEADER;
|
||||||
|
|
||||||
static void opj_applyLUT8u_8u32s_C1R(
|
static void opj_applyLUT8u_8u32s_C1R(
|
||||||
uint8_t const* pSrc, int32_t srcStride,
|
OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride,
|
||||||
int32_t* pDst, int32_t dstStride,
|
OPJ_INT32* pDst, OPJ_INT32 dstStride,
|
||||||
uint8_t const* pLUT,
|
OPJ_UINT8 const* pLUT,
|
||||||
uint32_t width, uint32_t height)
|
OPJ_UINT32 width, OPJ_UINT32 height)
|
||||||
{
|
{
|
||||||
uint32_t y;
|
OPJ_UINT32 y;
|
||||||
|
|
||||||
for (y = height; y != 0U; --y) {
|
for (y = height; y != 0U; --y) {
|
||||||
uint32_t x;
|
OPJ_UINT32 x;
|
||||||
|
|
||||||
for(x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
pDst[x] = (int32_t)pLUT[pSrc[x]];
|
pDst[x] = (OPJ_INT32)pLUT[pSrc[x]];
|
||||||
}
|
}
|
||||||
pSrc += srcStride;
|
pSrc += srcStride;
|
||||||
pDst += dstStride;
|
pDst += dstStride;
|
||||||
@@ -118,28 +101,28 @@ static void opj_applyLUT8u_8u32s_C1R(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void opj_applyLUT8u_8u32s_C1P3R(
|
static void opj_applyLUT8u_8u32s_C1P3R(
|
||||||
uint8_t const* pSrc, int32_t srcStride,
|
OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride,
|
||||||
int32_t* const* pDst, int32_t const* pDstStride,
|
OPJ_INT32* const* pDst, OPJ_INT32 const* pDstStride,
|
||||||
uint8_t const* const* pLUT,
|
OPJ_UINT8 const* const* pLUT,
|
||||||
uint32_t width, uint32_t height)
|
OPJ_UINT32 width, OPJ_UINT32 height)
|
||||||
{
|
{
|
||||||
uint32_t y;
|
OPJ_UINT32 y;
|
||||||
int32_t* pR = pDst[0];
|
OPJ_INT32* pR = pDst[0];
|
||||||
int32_t* pG = pDst[1];
|
OPJ_INT32* pG = pDst[1];
|
||||||
int32_t* pB = pDst[2];
|
OPJ_INT32* pB = pDst[2];
|
||||||
uint8_t const* pLUT_R = pLUT[0];
|
OPJ_UINT8 const* pLUT_R = pLUT[0];
|
||||||
uint8_t const* pLUT_G = pLUT[1];
|
OPJ_UINT8 const* pLUT_G = pLUT[1];
|
||||||
uint8_t const* pLUT_B = pLUT[2];
|
OPJ_UINT8 const* pLUT_B = pLUT[2];
|
||||||
|
|
||||||
for (y = height; y != 0U; --y) {
|
for (y = height; y != 0U; --y) {
|
||||||
uint32_t x;
|
OPJ_UINT32 x;
|
||||||
|
|
||||||
for(x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
uint8_t idx = pSrc[x];
|
OPJ_UINT8 idx = pSrc[x];
|
||||||
pR[x] = (int32_t)pLUT_R[idx];
|
pR[x] = (OPJ_INT32)pLUT_R[idx];
|
||||||
pG[x] = (int32_t)pLUT_G[idx];
|
pG[x] = (OPJ_INT32)pLUT_G[idx];
|
||||||
pB[x] = (int32_t)pLUT_B[idx];
|
pB[x] = (OPJ_INT32)pLUT_B[idx];
|
||||||
}
|
}
|
||||||
pSrc += srcStride;
|
pSrc += srcStride;
|
||||||
pR += pDstStride[0];
|
pR += pDstStride[0];
|
||||||
@@ -148,12 +131,12 @@ static void opj_applyLUT8u_8u32s_C1P3R(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bmp24toimage(const uint8_t* pData, uint32_t stride, opj_image_t* image)
|
static void bmp24toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image)
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
uint32_t width, height;
|
OPJ_UINT32 width, height;
|
||||||
uint32_t x, y;
|
OPJ_UINT32 x, y;
|
||||||
const uint8_t *pSrc = NULL;
|
const OPJ_UINT8 *pSrc = NULL;
|
||||||
|
|
||||||
width = image->comps[0].w;
|
width = image->comps[0].w;
|
||||||
height = image->comps[0].h;
|
height = image->comps[0].h;
|
||||||
@@ -164,18 +147,18 @@ static void bmp24toimage(const uint8_t* pData, uint32_t stride, opj_image_t* ima
|
|||||||
{
|
{
|
||||||
for(x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
image->comps[0].data[index] = (int32_t)pSrc[3*x+2]; /* R */
|
image->comps[0].data[index] = (OPJ_INT32)pSrc[3*x+2]; /* R */
|
||||||
image->comps[1].data[index] = (int32_t)pSrc[3*x+1]; /* G */
|
image->comps[1].data[index] = (OPJ_INT32)pSrc[3*x+1]; /* G */
|
||||||
image->comps[2].data[index] = (int32_t)pSrc[3*x+0]; /* B */
|
image->comps[2].data[index] = (OPJ_INT32)pSrc[3*x+0]; /* B */
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
pSrc -= stride;
|
pSrc -= stride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bmp_mask_get_shift_and_prec(uint32_t mask, uint32_t* shift, uint32_t* prec)
|
static void bmp_mask_get_shift_and_prec(OPJ_UINT32 mask, OPJ_UINT32* shift, OPJ_UINT32* prec)
|
||||||
{
|
{
|
||||||
uint32_t l_shift, l_prec;
|
OPJ_UINT32 l_shift, l_prec;
|
||||||
|
|
||||||
l_shift = l_prec = 0U;
|
l_shift = l_prec = 0U;
|
||||||
|
|
||||||
@@ -192,17 +175,17 @@ static void bmp_mask_get_shift_and_prec(uint32_t mask, uint32_t* shift, uint32_t
|
|||||||
*shift = l_shift; *prec = l_prec;
|
*shift = l_shift; *prec = l_prec;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bmpmask32toimage(const uint8_t* pData, uint32_t stride, opj_image_t* image, uint32_t redMask, uint32_t greenMask, uint32_t blueMask, uint32_t alphaMask)
|
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;
|
int index;
|
||||||
uint32_t width, height;
|
OPJ_UINT32 width, height;
|
||||||
uint32_t x, y;
|
OPJ_UINT32 x, y;
|
||||||
const uint8_t *pSrc = NULL;
|
const OPJ_UINT8 *pSrc = NULL;
|
||||||
opj_bool hasAlpha = OPJ_FALSE;
|
OPJ_BOOL hasAlpha;
|
||||||
uint32_t redShift, redPrec;
|
OPJ_UINT32 redShift, redPrec;
|
||||||
uint32_t greenShift, greenPrec;
|
OPJ_UINT32 greenShift, greenPrec;
|
||||||
uint32_t blueShift, bluePrec;
|
OPJ_UINT32 blueShift, bluePrec;
|
||||||
uint32_t alphaShift, alphaPrec;
|
OPJ_UINT32 alphaShift, alphaPrec;
|
||||||
|
|
||||||
width = image->comps[0].w;
|
width = image->comps[0].w;
|
||||||
height = image->comps[0].h;
|
height = image->comps[0].h;
|
||||||
@@ -231,18 +214,18 @@ static void bmpmask32toimage(const uint8_t* pData, uint32_t stride, opj_image_t*
|
|||||||
{
|
{
|
||||||
for(x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
uint32_t value = 0U;
|
OPJ_UINT32 value = 0U;
|
||||||
|
|
||||||
value |= ((uint32_t)pSrc[4*x+0]) << 0;
|
value |= ((OPJ_UINT32)pSrc[4*x+0]) << 0;
|
||||||
value |= ((uint32_t)pSrc[4*x+1]) << 8;
|
value |= ((OPJ_UINT32)pSrc[4*x+1]) << 8;
|
||||||
value |= ((uint32_t)pSrc[4*x+2]) << 16;
|
value |= ((OPJ_UINT32)pSrc[4*x+2]) << 16;
|
||||||
value |= ((uint32_t)pSrc[4*x+3]) << 24;
|
value |= ((OPJ_UINT32)pSrc[4*x+3]) << 24;
|
||||||
|
|
||||||
image->comps[0].data[index] = (int32_t)((value & redMask) >> redShift); /* R */
|
image->comps[0].data[index] = (OPJ_INT32)((value & redMask) >> redShift); /* R */
|
||||||
image->comps[1].data[index] = (int32_t)((value & greenMask) >> greenShift); /* G */
|
image->comps[1].data[index] = (OPJ_INT32)((value & greenMask) >> greenShift); /* G */
|
||||||
image->comps[2].data[index] = (int32_t)((value & blueMask) >> blueShift); /* B */
|
image->comps[2].data[index] = (OPJ_INT32)((value & blueMask) >> blueShift); /* B */
|
||||||
if (hasAlpha) {
|
if (hasAlpha) {
|
||||||
image->comps[3].data[index] = (int32_t)((value & alphaMask) >> alphaShift); /* A */
|
image->comps[3].data[index] = (OPJ_INT32)((value & alphaMask) >> alphaShift); /* A */
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
@@ -250,17 +233,17 @@ static void bmpmask32toimage(const uint8_t* pData, uint32_t stride, opj_image_t*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bmpmask16toimage(const uint8_t* pData, uint32_t stride, opj_image_t* image, uint32_t redMask, uint32_t greenMask, uint32_t blueMask, uint32_t alphaMask)
|
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;
|
int index;
|
||||||
uint32_t width, height;
|
OPJ_UINT32 width, height;
|
||||||
uint32_t x, y;
|
OPJ_UINT32 x, y;
|
||||||
const uint8_t *pSrc = NULL;
|
const OPJ_UINT8 *pSrc = NULL;
|
||||||
opj_bool hasAlpha = OPJ_FALSE;
|
OPJ_BOOL hasAlpha;
|
||||||
uint32_t redShift, redPrec;
|
OPJ_UINT32 redShift, redPrec;
|
||||||
uint32_t greenShift, greenPrec;
|
OPJ_UINT32 greenShift, greenPrec;
|
||||||
uint32_t blueShift, bluePrec;
|
OPJ_UINT32 blueShift, bluePrec;
|
||||||
uint32_t alphaShift, alphaPrec;
|
OPJ_UINT32 alphaShift, alphaPrec;
|
||||||
|
|
||||||
width = image->comps[0].w;
|
width = image->comps[0].w;
|
||||||
height = image->comps[0].h;
|
height = image->comps[0].h;
|
||||||
@@ -289,16 +272,16 @@ static void bmpmask16toimage(const uint8_t* pData, uint32_t stride, opj_image_t*
|
|||||||
{
|
{
|
||||||
for(x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
uint32_t value = 0U;
|
OPJ_UINT32 value = 0U;
|
||||||
|
|
||||||
value |= ((uint32_t)pSrc[2*x+0]) << 0;
|
value |= ((OPJ_UINT32)pSrc[2*x+0]) << 0;
|
||||||
value |= ((uint32_t)pSrc[2*x+1]) << 8;
|
value |= ((OPJ_UINT32)pSrc[2*x+1]) << 8;
|
||||||
|
|
||||||
image->comps[0].data[index] = (int32_t)((value & redMask) >> redShift); /* R */
|
image->comps[0].data[index] = (OPJ_INT32)((value & redMask) >> redShift); /* R */
|
||||||
image->comps[1].data[index] = (int32_t)((value & greenMask) >> greenShift); /* G */
|
image->comps[1].data[index] = (OPJ_INT32)((value & greenMask) >> greenShift); /* G */
|
||||||
image->comps[2].data[index] = (int32_t)((value & blueMask) >> blueShift); /* B */
|
image->comps[2].data[index] = (OPJ_INT32)((value & blueMask) >> blueShift); /* B */
|
||||||
if (hasAlpha) {
|
if (hasAlpha) {
|
||||||
image->comps[3].data[index] = (int32_t)((value & alphaMask) >> alphaShift); /* A */
|
image->comps[3].data[index] = (OPJ_INT32)((value & alphaMask) >> alphaShift); /* A */
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
@@ -306,33 +289,33 @@ static void bmpmask16toimage(const uint8_t* pData, uint32_t stride, opj_image_t*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static opj_image_t* bmp8toimage(const uint8_t* pData, uint32_t stride, opj_image_t* image, uint8_t const* const* pLUT)
|
static opj_image_t* bmp8toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT8 const* const* pLUT)
|
||||||
{
|
{
|
||||||
uint32_t width, height;
|
OPJ_UINT32 width, height;
|
||||||
const uint8_t *pSrc = NULL;
|
const OPJ_UINT8 *pSrc = NULL;
|
||||||
|
|
||||||
width = image->comps[0].w;
|
width = image->comps[0].w;
|
||||||
height = image->comps[0].h;
|
height = image->comps[0].h;
|
||||||
|
|
||||||
pSrc = pData + (height - 1U) * stride;
|
pSrc = pData + (height - 1U) * stride;
|
||||||
if (image->numcomps == 1U) {
|
if (image->numcomps == 1U) {
|
||||||
opj_applyLUT8u_8u32s_C1R(pSrc, -(int32_t)stride, image->comps[0].data, (int32_t)width, pLUT[0], width, height);
|
opj_applyLUT8u_8u32s_C1R(pSrc, -(OPJ_INT32)stride, image->comps[0].data, (OPJ_INT32)width, pLUT[0], width, height);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int32_t* pDst[3];
|
OPJ_INT32* pDst[3];
|
||||||
int32_t pDstStride[3];
|
OPJ_INT32 pDstStride[3];
|
||||||
|
|
||||||
pDst[0] = image->comps[0].data; pDst[1] = image->comps[1].data; pDst[2] = image->comps[2].data;
|
pDst[0] = image->comps[0].data; pDst[1] = image->comps[1].data; pDst[2] = image->comps[2].data;
|
||||||
pDstStride[0] = (int32_t)width; pDstStride[1] = (int32_t)width; pDstStride[2] = (int32_t)width;
|
pDstStride[0] = (OPJ_INT32)width; pDstStride[1] = (OPJ_INT32)width; pDstStride[2] = (OPJ_INT32)width;
|
||||||
opj_applyLUT8u_8u32s_C1P3R(pSrc, -(int32_t)stride, pDst, pDstStride, pLUT, width, height);
|
opj_applyLUT8u_8u32s_C1P3R(pSrc, -(OPJ_INT32)stride, pDst, pDstStride, pLUT, width, height);
|
||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
static opj_bool bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
|
static OPJ_BOOL bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
|
||||||
{
|
{
|
||||||
header->bfType = (uint16_t)getc(IN);
|
header->bfType = (OPJ_UINT16)getc(IN);
|
||||||
header->bfType |= (uint16_t)((uint32_t)getc(IN) << 8);
|
header->bfType |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||||
|
|
||||||
if (header->bfType != 19778) {
|
if (header->bfType != 19778) {
|
||||||
fprintf(stderr,"Error, not a BMP file!\n");
|
fprintf(stderr,"Error, not a BMP file!\n");
|
||||||
@@ -341,32 +324,32 @@ static opj_bool bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
|
|||||||
|
|
||||||
/* FILE HEADER */
|
/* FILE HEADER */
|
||||||
/* ------------- */
|
/* ------------- */
|
||||||
header->bfSize = (uint32_t)getc(IN);
|
header->bfSize = (OPJ_UINT32)getc(IN);
|
||||||
header->bfSize |= (uint32_t)getc(IN) << 8;
|
header->bfSize |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->bfSize |= (uint32_t)getc(IN) << 16;
|
header->bfSize |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->bfSize |= (uint32_t)getc(IN) << 24;
|
header->bfSize |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->bfReserved1 = (uint16_t)getc(IN);
|
header->bfReserved1 = (OPJ_UINT16)getc(IN);
|
||||||
header->bfReserved1 |= (uint16_t)((uint32_t)getc(IN) << 8);
|
header->bfReserved1 |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||||
|
|
||||||
header->bfReserved2 = (uint16_t)getc(IN);
|
header->bfReserved2 = (OPJ_UINT16)getc(IN);
|
||||||
header->bfReserved2 |= (uint16_t)((uint32_t)getc(IN) << 8);
|
header->bfReserved2 |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||||
|
|
||||||
header->bfOffBits = (uint32_t)getc(IN);
|
header->bfOffBits = (OPJ_UINT32)getc(IN);
|
||||||
header->bfOffBits |= (uint32_t)getc(IN) << 8;
|
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->bfOffBits |= (uint32_t)getc(IN) << 16;
|
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->bfOffBits |= (uint32_t)getc(IN) << 24;
|
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
return OPJ_TRUE;
|
return OPJ_TRUE;
|
||||||
}
|
}
|
||||||
static opj_bool bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
|
static OPJ_BOOL bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
|
||||||
{
|
{
|
||||||
memset(header, 0, sizeof(*header));
|
memset(header, 0, sizeof(*header));
|
||||||
/* INFO HEADER */
|
/* INFO HEADER */
|
||||||
/* ------------- */
|
/* ------------- */
|
||||||
header->biSize = (uint32_t)getc(IN);
|
header->biSize = (OPJ_UINT32)getc(IN);
|
||||||
header->biSize |= (uint32_t)getc(IN) << 8;
|
header->biSize |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biSize |= (uint32_t)getc(IN) << 16;
|
header->biSize |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biSize |= (uint32_t)getc(IN) << 24;
|
header->biSize |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
switch (header->biSize) {
|
switch (header->biSize) {
|
||||||
case 12U: /* BITMAPCOREHEADER */
|
case 12U: /* BITMAPCOREHEADER */
|
||||||
@@ -381,132 +364,132 @@ static opj_bool bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
|
|||||||
return OPJ_FALSE;
|
return OPJ_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
header->biWidth = (uint32_t)getc(IN);
|
header->biWidth = (OPJ_UINT32)getc(IN);
|
||||||
header->biWidth |= (uint32_t)getc(IN) << 8;
|
header->biWidth |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biWidth |= (uint32_t)getc(IN) << 16;
|
header->biWidth |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biWidth |= (uint32_t)getc(IN) << 24;
|
header->biWidth |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biHeight = (uint32_t)getc(IN);
|
header->biHeight = (OPJ_UINT32)getc(IN);
|
||||||
header->biHeight |= (uint32_t)getc(IN) << 8;
|
header->biHeight |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biHeight |= (uint32_t)getc(IN) << 16;
|
header->biHeight |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biHeight |= (uint32_t)getc(IN) << 24;
|
header->biHeight |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biPlanes = (uint16_t)getc(IN);
|
header->biPlanes = (OPJ_UINT16)getc(IN);
|
||||||
header->biPlanes |= (uint16_t)((uint32_t)getc(IN) << 8);
|
header->biPlanes |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||||
|
|
||||||
header->biBitCount = (uint16_t)getc(IN);
|
header->biBitCount = (OPJ_UINT16)getc(IN);
|
||||||
header->biBitCount |= (uint16_t)((uint32_t)getc(IN) << 8);
|
header->biBitCount |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
|
||||||
|
|
||||||
if(header->biSize >= 40U) {
|
if(header->biSize >= 40U) {
|
||||||
header->biCompression = (uint32_t)getc(IN);
|
header->biCompression = (OPJ_UINT32)getc(IN);
|
||||||
header->biCompression |= (uint32_t)getc(IN) << 8;
|
header->biCompression |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biCompression |= (uint32_t)getc(IN) << 16;
|
header->biCompression |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biCompression |= (uint32_t)getc(IN) << 24;
|
header->biCompression |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biSizeImage = (uint32_t)getc(IN);
|
header->biSizeImage = (OPJ_UINT32)getc(IN);
|
||||||
header->biSizeImage |= (uint32_t)getc(IN) << 8;
|
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biSizeImage |= (uint32_t)getc(IN) << 16;
|
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biSizeImage |= (uint32_t)getc(IN) << 24;
|
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biXpelsPerMeter = (uint32_t)getc(IN);
|
header->biXpelsPerMeter = (OPJ_UINT32)getc(IN);
|
||||||
header->biXpelsPerMeter |= (uint32_t)getc(IN) << 8;
|
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biXpelsPerMeter |= (uint32_t)getc(IN) << 16;
|
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biXpelsPerMeter |= (uint32_t)getc(IN) << 24;
|
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biYpelsPerMeter = (uint32_t)getc(IN);
|
header->biYpelsPerMeter = (OPJ_UINT32)getc(IN);
|
||||||
header->biYpelsPerMeter |= (uint32_t)getc(IN) << 8;
|
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biYpelsPerMeter |= (uint32_t)getc(IN) << 16;
|
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biYpelsPerMeter |= (uint32_t)getc(IN) << 24;
|
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biClrUsed = (uint32_t)getc(IN);
|
header->biClrUsed = (OPJ_UINT32)getc(IN);
|
||||||
header->biClrUsed |= (uint32_t)getc(IN) << 8;
|
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biClrUsed |= (uint32_t)getc(IN) << 16;
|
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biClrUsed |= (uint32_t)getc(IN) << 24;
|
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biClrImportant = (uint32_t)getc(IN);
|
header->biClrImportant = (OPJ_UINT32)getc(IN);
|
||||||
header->biClrImportant |= (uint32_t)getc(IN) << 8;
|
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biClrImportant |= (uint32_t)getc(IN) << 16;
|
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biClrImportant |= (uint32_t)getc(IN) << 24;
|
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(header->biSize >= 56U) {
|
if(header->biSize >= 56U) {
|
||||||
header->biRedMask = (uint32_t)getc(IN);
|
header->biRedMask = (OPJ_UINT32)getc(IN);
|
||||||
header->biRedMask |= (uint32_t)getc(IN) << 8;
|
header->biRedMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biRedMask |= (uint32_t)getc(IN) << 16;
|
header->biRedMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biRedMask |= (uint32_t)getc(IN) << 24;
|
header->biRedMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biGreenMask = (uint32_t)getc(IN);
|
header->biGreenMask = (OPJ_UINT32)getc(IN);
|
||||||
header->biGreenMask |= (uint32_t)getc(IN) << 8;
|
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biGreenMask |= (uint32_t)getc(IN) << 16;
|
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biGreenMask |= (uint32_t)getc(IN) << 24;
|
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biBlueMask = (uint32_t)getc(IN);
|
header->biBlueMask = (OPJ_UINT32)getc(IN);
|
||||||
header->biBlueMask |= (uint32_t)getc(IN) << 8;
|
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biBlueMask |= (uint32_t)getc(IN) << 16;
|
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biBlueMask |= (uint32_t)getc(IN) << 24;
|
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biAlphaMask = (uint32_t)getc(IN);
|
header->biAlphaMask = (OPJ_UINT32)getc(IN);
|
||||||
header->biAlphaMask |= (uint32_t)getc(IN) << 8;
|
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biAlphaMask |= (uint32_t)getc(IN) << 16;
|
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biAlphaMask |= (uint32_t)getc(IN) << 24;
|
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(header->biSize >= 108U) {
|
if(header->biSize >= 108U) {
|
||||||
header->biColorSpaceType = (uint32_t)getc(IN);
|
header->biColorSpaceType = (OPJ_UINT32)getc(IN);
|
||||||
header->biColorSpaceType |= (uint32_t)getc(IN) << 8;
|
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biColorSpaceType |= (uint32_t)getc(IN) << 16;
|
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biColorSpaceType |= (uint32_t)getc(IN) << 24;
|
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
if (fread(&(header->biColorSpaceEP), 1U, sizeof(header->biColorSpaceEP), IN) != sizeof(header->biColorSpaceEP)) {
|
if (fread(&(header->biColorSpaceEP), 1U, sizeof(header->biColorSpaceEP), IN) != sizeof(header->biColorSpaceEP)) {
|
||||||
fprintf(stderr,"Error, can't read BMP header\n");
|
fprintf(stderr,"Error, can't read BMP header\n");
|
||||||
return OPJ_FALSE;
|
return OPJ_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
header->biRedGamma = (uint32_t)getc(IN);
|
header->biRedGamma = (OPJ_UINT32)getc(IN);
|
||||||
header->biRedGamma |= (uint32_t)getc(IN) << 8;
|
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biRedGamma |= (uint32_t)getc(IN) << 16;
|
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biRedGamma |= (uint32_t)getc(IN) << 24;
|
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biGreenGamma = (uint32_t)getc(IN);
|
header->biGreenGamma = (OPJ_UINT32)getc(IN);
|
||||||
header->biGreenGamma |= (uint32_t)getc(IN) << 8;
|
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biGreenGamma |= (uint32_t)getc(IN) << 16;
|
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biGreenGamma |= (uint32_t)getc(IN) << 24;
|
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biBlueGamma = (uint32_t)getc(IN);
|
header->biBlueGamma = (OPJ_UINT32)getc(IN);
|
||||||
header->biBlueGamma |= (uint32_t)getc(IN) << 8;
|
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biBlueGamma |= (uint32_t)getc(IN) << 16;
|
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biBlueGamma |= (uint32_t)getc(IN) << 24;
|
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(header->biSize >= 124U) {
|
if(header->biSize >= 124U) {
|
||||||
header->biIntent = (uint32_t)getc(IN);
|
header->biIntent = (OPJ_UINT32)getc(IN);
|
||||||
header->biIntent |= (uint32_t)getc(IN) << 8;
|
header->biIntent |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biIntent |= (uint32_t)getc(IN) << 16;
|
header->biIntent |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biIntent |= (uint32_t)getc(IN) << 24;
|
header->biIntent |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biIccProfileData = (uint32_t)getc(IN);
|
header->biIccProfileData = (OPJ_UINT32)getc(IN);
|
||||||
header->biIccProfileData |= (uint32_t)getc(IN) << 8;
|
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biIccProfileData |= (uint32_t)getc(IN) << 16;
|
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biIccProfileData |= (uint32_t)getc(IN) << 24;
|
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biIccProfileSize = (uint32_t)getc(IN);
|
header->biIccProfileSize = (OPJ_UINT32)getc(IN);
|
||||||
header->biIccProfileSize |= (uint32_t)getc(IN) << 8;
|
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biIccProfileSize |= (uint32_t)getc(IN) << 16;
|
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biIccProfileSize |= (uint32_t)getc(IN) << 24;
|
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
|
|
||||||
header->biReserved = (uint32_t)getc(IN);
|
header->biReserved = (OPJ_UINT32)getc(IN);
|
||||||
header->biReserved |= (uint32_t)getc(IN) << 8;
|
header->biReserved |= (OPJ_UINT32)getc(IN) << 8;
|
||||||
header->biReserved |= (uint32_t)getc(IN) << 16;
|
header->biReserved |= (OPJ_UINT32)getc(IN) << 16;
|
||||||
header->biReserved |= (uint32_t)getc(IN) << 24;
|
header->biReserved |= (OPJ_UINT32)getc(IN) << 24;
|
||||||
}
|
}
|
||||||
return OPJ_TRUE;
|
return OPJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static opj_bool bmp_read_raw_data(FILE* IN, uint8_t* pData, uint32_t stride, uint32_t width, uint32_t height)
|
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);
|
OPJ_ARG_NOT_USED(width);
|
||||||
|
|
||||||
if ( fread(pData, sizeof(uint8_t), stride * height, IN) != (stride * height) )
|
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");
|
fprintf(stderr, "\nError: fread return a number of element different from the expected.\n");
|
||||||
return OPJ_FALSE;
|
return OPJ_FALSE;
|
||||||
@@ -514,11 +497,11 @@ static opj_bool bmp_read_raw_data(FILE* IN, uint8_t* pData, uint32_t stride, uin
|
|||||||
return OPJ_TRUE;
|
return OPJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static opj_bool bmp_read_rle8_data(FILE* IN, uint8_t* pData, uint32_t stride, uint32_t width, uint32_t height)
|
static OPJ_BOOL bmp_read_rle8_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
|
||||||
{
|
{
|
||||||
uint32_t x, y;
|
OPJ_UINT32 x, y;
|
||||||
uint8_t *pix;
|
OPJ_UINT8 *pix;
|
||||||
const uint8_t *beyond;
|
const OPJ_UINT8 *beyond;
|
||||||
|
|
||||||
beyond = pData + stride * height;
|
beyond = pData + stride * height;
|
||||||
pix = pData;
|
pix = pData;
|
||||||
@@ -530,9 +513,9 @@ static opj_bool bmp_read_rle8_data(FILE* IN, uint8_t* pData, uint32_t stride, ui
|
|||||||
|
|
||||||
if (c) {
|
if (c) {
|
||||||
int j;
|
int j;
|
||||||
uint8_t c1 = (uint8_t)getc(IN);
|
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
|
||||||
|
|
||||||
for (j = 0; (j < c) && (x < width) && ((size_t)pix < (size_t)beyond); j++, x++, pix++) {
|
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
|
||||||
*pix = c1;
|
*pix = c1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -548,20 +531,20 @@ static opj_bool bmp_read_rle8_data(FILE* IN, uint8_t* pData, uint32_t stride, ui
|
|||||||
}
|
}
|
||||||
else if (c == 0x02) { /* MOVE by dxdy */
|
else if (c == 0x02) { /* MOVE by dxdy */
|
||||||
c = getc(IN);
|
c = getc(IN);
|
||||||
x += (uint32_t)c;
|
x += (OPJ_UINT32)c;
|
||||||
c = getc(IN);
|
c = getc(IN);
|
||||||
y += (uint32_t)c;
|
y += (OPJ_UINT32)c;
|
||||||
pix = pData + y * stride + x;
|
pix = pData + y * stride + x;
|
||||||
}
|
}
|
||||||
else /* 03 .. 255 */
|
else /* 03 .. 255 */
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; (j < c) && (x < width) && ((size_t)pix < (size_t)beyond); j++, x++, pix++)
|
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++)
|
||||||
{
|
{
|
||||||
uint8_t c1 = (uint8_t)getc(IN);
|
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
|
||||||
*pix = c1;
|
*pix = c1;
|
||||||
}
|
}
|
||||||
if ((uint32_t)c & 1U) { /* skip padding byte */
|
if ((OPJ_UINT32)c & 1U) { /* skip padding byte */
|
||||||
getc(IN);
|
getc(IN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -570,11 +553,11 @@ static opj_bool bmp_read_rle8_data(FILE* IN, uint8_t* pData, uint32_t stride, ui
|
|||||||
return OPJ_TRUE;
|
return OPJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static opj_bool bmp_read_rle4_data(FILE* IN, uint8_t* pData, uint32_t stride, uint32_t width, uint32_t height)
|
static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
|
||||||
{
|
{
|
||||||
uint32_t x, y;
|
OPJ_UINT32 x, y;
|
||||||
uint8_t *pix;
|
OPJ_UINT8 *pix;
|
||||||
const uint8_t *beyond;
|
const OPJ_UINT8 *beyond;
|
||||||
|
|
||||||
beyond = pData + stride * height;
|
beyond = pData + stride * height;
|
||||||
pix = pData;
|
pix = pData;
|
||||||
@@ -586,10 +569,10 @@ static opj_bool bmp_read_rle4_data(FILE* IN, uint8_t* pData, uint32_t stride, ui
|
|||||||
|
|
||||||
if(c) {/* encoded mode */
|
if(c) {/* encoded mode */
|
||||||
int j;
|
int j;
|
||||||
uint8_t c1 = (uint8_t)getc(IN);
|
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
|
||||||
|
|
||||||
for (j = 0; (j < c) && (x < width) && ((size_t)pix < (size_t)beyond); j++, x++, pix++) {
|
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
|
||||||
*pix = (uint8_t)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
|
*pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { /* absolute mode */
|
else { /* absolute mode */
|
||||||
@@ -603,19 +586,19 @@ static opj_bool bmp_read_rle4_data(FILE* IN, uint8_t* pData, uint32_t stride, ui
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(c == 0x02) { /* MOVE by dxdy */
|
else if(c == 0x02) { /* MOVE by dxdy */
|
||||||
c = getc(IN); x += (uint32_t)c;
|
c = getc(IN); x += (OPJ_UINT32)c;
|
||||||
c = getc(IN); y += (uint32_t)c;
|
c = getc(IN); y += (OPJ_UINT32)c;
|
||||||
pix = pData + y * stride + x;
|
pix = pData + y * stride + x;
|
||||||
}
|
}
|
||||||
else { /* 03 .. 255 : absolute mode */
|
else { /* 03 .. 255 : absolute mode */
|
||||||
int j;
|
int j;
|
||||||
uint8_t c1 = 0U;
|
OPJ_UINT8 c1 = 0U;
|
||||||
|
|
||||||
for (j = 0; (j < c) && (x < width) && ((size_t)pix < (size_t)beyond); j++, x++, pix++) {
|
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
|
||||||
if((j&1) == 0) {
|
if((j&1) == 0) {
|
||||||
c1 = (uint8_t)getc(IN);
|
c1 = (OPJ_UINT8)getc(IN);
|
||||||
}
|
}
|
||||||
*pix = (uint8_t)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
|
*pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
|
||||||
}
|
}
|
||||||
if(((c&3) == 1) || ((c&3) == 2)) { /* skip padding byte */
|
if(((c&3) == 1) || ((c&3) == 2)) { /* skip padding byte */
|
||||||
getc(IN);
|
getc(IN);
|
||||||
@@ -629,16 +612,16 @@ static opj_bool bmp_read_rle4_data(FILE* IN, uint8_t* pData, uint32_t stride, ui
|
|||||||
opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
|
opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
|
||||||
{
|
{
|
||||||
opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
|
opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
|
||||||
uint8_t lut_R[256], lut_G[256], lut_B[256];
|
OPJ_UINT8 lut_R[256], lut_G[256], lut_B[256];
|
||||||
uint8_t const* pLUT[3];
|
OPJ_UINT8 const* pLUT[3];
|
||||||
opj_image_t * image = NULL;
|
opj_image_t * image = NULL;
|
||||||
FILE *IN;
|
FILE *IN;
|
||||||
OPJ_BITMAPFILEHEADER File_h;
|
OPJ_BITMAPFILEHEADER File_h;
|
||||||
OPJ_BITMAPINFOHEADER Info_h;
|
OPJ_BITMAPINFOHEADER Info_h;
|
||||||
uint32_t i, palette_len, numcmpts = 1U;
|
OPJ_UINT32 i, palette_len, numcmpts = 1U;
|
||||||
opj_bool l_result = OPJ_FALSE;
|
OPJ_BOOL l_result = OPJ_FALSE;
|
||||||
uint8_t* pData = NULL;
|
OPJ_UINT8* pData = NULL;
|
||||||
uint32_t stride;
|
OPJ_UINT32 stride;
|
||||||
|
|
||||||
pLUT[0] = lut_R; pLUT[1] = lut_G; pLUT[2] = lut_B;
|
pLUT[0] = lut_R; pLUT[1] = lut_G; pLUT[2] = lut_B;
|
||||||
|
|
||||||
@@ -673,11 +656,11 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
|
|||||||
palette_len = 256U;
|
palette_len = 256U;
|
||||||
}
|
}
|
||||||
if (palette_len > 0U) {
|
if (palette_len > 0U) {
|
||||||
uint8_t has_color = 0U;
|
OPJ_UINT8 has_color = 0U;
|
||||||
for (i = 0U; i < palette_len; i++) {
|
for (i = 0U; i < palette_len; i++) {
|
||||||
lut_B[i] = (uint8_t)getc(IN);
|
lut_B[i] = (OPJ_UINT8)getc(IN);
|
||||||
lut_G[i] = (uint8_t)getc(IN);
|
lut_G[i] = (OPJ_UINT8)getc(IN);
|
||||||
lut_R[i] = (uint8_t)getc(IN);
|
lut_R[i] = (OPJ_UINT8)getc(IN);
|
||||||
(void)getc(IN); /* padding */
|
(void)getc(IN); /* padding */
|
||||||
has_color |= (lut_B[i] ^ lut_G[i]) | (lut_G[i] ^ lut_R[i]);
|
has_color |= (lut_B[i] ^ lut_G[i]) | (lut_G[i] ^ lut_R[i]);
|
||||||
}
|
}
|
||||||
@@ -696,7 +679,7 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
|
|||||||
if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /* RLE 4 gets decoded as 8 bits data for now... */
|
if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /* RLE 4 gets decoded as 8 bits data for now... */
|
||||||
stride = ((Info_h.biWidth * 8U + 31U) / 32U) * 4U;
|
stride = ((Info_h.biWidth * 8U + 31U) / 32U) * 4U;
|
||||||
}
|
}
|
||||||
pData = (uint8_t *) calloc(1, stride * Info_h.biHeight * sizeof(uint8_t));
|
pData = (OPJ_UINT8 *) calloc(1, stride * Info_h.biHeight * sizeof(OPJ_UINT8));
|
||||||
if (pData == NULL) {
|
if (pData == NULL) {
|
||||||
fclose(IN);
|
fclose(IN);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -737,27 +720,27 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
|
|||||||
cmptparm[i].prec = 8;
|
cmptparm[i].prec = 8;
|
||||||
cmptparm[i].bpp = 8;
|
cmptparm[i].bpp = 8;
|
||||||
cmptparm[i].sgnd = 0;
|
cmptparm[i].sgnd = 0;
|
||||||
cmptparm[i].dx = parameters->subsampling_dx;
|
cmptparm[i].dx = (OPJ_UINT32)parameters->subsampling_dx;
|
||||||
cmptparm[i].dy = parameters->subsampling_dy;
|
cmptparm[i].dy = (OPJ_UINT32)parameters->subsampling_dy;
|
||||||
cmptparm[i].w = Info_h.biWidth;
|
cmptparm[i].w = Info_h.biWidth;
|
||||||
cmptparm[i].h = Info_h.biHeight;
|
cmptparm[i].h = Info_h.biHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
image = opj_image_create(numcmpts, &cmptparm[0], (numcmpts == 1U) ? CLRSPC_GRAY : CLRSPC_SRGB);
|
image = opj_image_create(numcmpts, &cmptparm[0], (numcmpts == 1U) ? OPJ_CLRSPC_GRAY : OPJ_CLRSPC_SRGB);
|
||||||
if(!image) {
|
if(!image) {
|
||||||
fclose(IN);
|
fclose(IN);
|
||||||
free(pData);
|
free(pData);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* if (numcmpts == 4U) {
|
if (numcmpts == 4U) {
|
||||||
image->comps[3].alpha = 1;
|
image->comps[3].alpha = 1;
|
||||||
} */
|
}
|
||||||
|
|
||||||
/* set image offset and reference grid */
|
/* set image offset and reference grid */
|
||||||
image->x0 = (uint32_t)parameters->image_offset_x0;
|
image->x0 = (OPJ_UINT32)parameters->image_offset_x0;
|
||||||
image->y0 = (uint32_t)parameters->image_offset_y0;
|
image->y0 = (OPJ_UINT32)parameters->image_offset_y0;
|
||||||
image->x1 = image->x0 + (Info_h.biWidth - 1U) * (uint32_t)parameters->subsampling_dx + 1U;
|
image->x1 = image->x0 + (Info_h.biWidth - 1U) * (OPJ_UINT32)parameters->subsampling_dx + 1U;
|
||||||
image->y1 = image->y0 + (Info_h.biHeight - 1U) * (uint32_t)parameters->subsampling_dy + 1U;
|
image->y1 = image->y0 + (Info_h.biHeight - 1U) * (OPJ_UINT32)parameters->subsampling_dy + 1U;
|
||||||
|
|
||||||
/* Read the data */
|
/* Read the data */
|
||||||
if (Info_h.biBitCount == 24 && Info_h.biCompression == 0) { /*RGB */
|
if (Info_h.biBitCount == 24 && Info_h.biCompression == 0) { /*RGB */
|
||||||
@@ -834,31 +817,31 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
|
|||||||
/* FILE HEADER */
|
/* FILE HEADER */
|
||||||
/* ------------- */
|
/* ------------- */
|
||||||
fprintf(fdest, "%c%c%c%c",
|
fprintf(fdest, "%c%c%c%c",
|
||||||
(uint8_t) (h * w * 3 + 3 * h * (w % 2) + 54) & 0xff,
|
(OPJ_UINT8) (h * w * 3 + 3 * h * (w % 2) + 54) & 0xff,
|
||||||
(uint8_t) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 8) & 0xff,
|
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 8) & 0xff,
|
||||||
(uint8_t) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 16) & 0xff,
|
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 16) & 0xff,
|
||||||
(uint8_t) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 24) & 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", (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);
|
fprintf(fdest, "%c%c%c%c", (54) & 0xff, ((54) >> 8) & 0xff,((54) >> 16) & 0xff, ((54) >> 24) & 0xff);
|
||||||
|
|
||||||
/* INFO HEADER */
|
/* 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", (40) & 0xff, ((40) >> 8) & 0xff, ((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) ((w) & 0xff),
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
|
||||||
(uint8_t) ((w) >> 8) & 0xff,
|
(OPJ_UINT8) ((w) >> 8) & 0xff,
|
||||||
(uint8_t) ((w) >> 16) & 0xff,
|
(OPJ_UINT8) ((w) >> 16) & 0xff,
|
||||||
(uint8_t) ((w) >> 24) & 0xff);
|
(OPJ_UINT8) ((w) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) ((h) & 0xff),
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
|
||||||
(uint8_t) ((h) >> 8) & 0xff,
|
(OPJ_UINT8) ((h) >> 8) & 0xff,
|
||||||
(uint8_t) ((h) >> 16) & 0xff,
|
(OPJ_UINT8) ((h) >> 16) & 0xff,
|
||||||
(uint8_t) ((h) >> 24) & 0xff);
|
(OPJ_UINT8) ((h) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
|
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
|
||||||
fprintf(fdest, "%c%c", (24) & 0xff, ((24) >> 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", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) (3 * h * w + 3 * h * (w % 2)) & 0xff,
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (3 * h * w + 3 * h * (w % 2)) & 0xff,
|
||||||
(uint8_t) ((h * w * 3 + 3 * h * (w % 2)) >> 8) & 0xff,
|
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 8) & 0xff,
|
||||||
(uint8_t) ((h * w * 3 + 3 * h * (w % 2)) >> 16) & 0xff,
|
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 16) & 0xff,
|
||||||
(uint8_t) ((h * w * 3 + 3 * h * (w % 2)) >> 24) & 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", (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);
|
||||||
@@ -884,31 +867,31 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
|
|||||||
adjustB = 0;
|
adjustB = 0;
|
||||||
|
|
||||||
for (i = 0; i < w * h; i++) {
|
for (i = 0; i < w * h; i++) {
|
||||||
uint8_t rc, gc, bc;
|
OPJ_UINT8 rc, gc, bc;
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
|
|
||||||
r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
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 += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
|
||||||
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
|
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
|
||||||
if(r > 255) r = 255; else if(r < 0) r = 0;
|
if(r > 255) r = 255; else if(r < 0) r = 0;
|
||||||
rc = (uint8_t)r;
|
rc = (OPJ_UINT8)r;
|
||||||
|
|
||||||
g = image->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
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 += (image->comps[1].sgnd ? 1 << (image->comps[1].prec - 1) : 0);
|
||||||
g = ((g >> adjustG)+((g >> (adjustG-1))%2));
|
g = ((g >> adjustG)+((g >> (adjustG-1))%2));
|
||||||
if(g > 255) g = 255; else if(g < 0) g = 0;
|
if(g > 255) g = 255; else if(g < 0) g = 0;
|
||||||
gc = (uint8_t)g;
|
gc = (OPJ_UINT8)g;
|
||||||
|
|
||||||
b = image->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
|
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 += (image->comps[2].sgnd ? 1 << (image->comps[2].prec - 1) : 0);
|
||||||
b = ((b >> adjustB)+((b >> (adjustB-1))%2));
|
b = ((b >> adjustB)+((b >> (adjustB-1))%2));
|
||||||
if(b > 255) b = 255; else if(b < 0) b = 0;
|
if(b > 255) b = 255; else if(b < 0) b = 0;
|
||||||
bc = (uint8_t)b;
|
bc = (OPJ_UINT8)b;
|
||||||
|
|
||||||
fprintf(fdest, "%c%c%c", bc, gc, rc);
|
fprintf(fdest, "%c%c%c", bc, gc, rc);
|
||||||
|
|
||||||
if ((i + 1) % w == 0) {
|
if ((i + 1) % w == 0) {
|
||||||
for (pad = (3 * w) % 4 ? 4 - (3 * w) % 4 : 0; pad > 0; pad--) /* ADD */
|
for (pad = ((3 * w) % 4) ? (4 - (3 * w) % 4) : 0; pad > 0; pad--) /* ADD */
|
||||||
fprintf(fdest, "%c", 0);
|
fprintf(fdest, "%c", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -931,10 +914,10 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
|
|||||||
|
|
||||||
/* FILE HEADER */
|
/* FILE HEADER */
|
||||||
/* ------------- */
|
/* ------------- */
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) (h * w + 54 + 1024 + h * (w % 2)) & 0xff,
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + 54 + 1024 + h * (w % 2)) & 0xff,
|
||||||
(uint8_t) ((h * w + 54 + 1024 + h * (w % 2)) >> 8) & 0xff,
|
(OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 8) & 0xff,
|
||||||
(uint8_t) ((h * w + 54 + 1024 + h * (w % 2)) >> 16) & 0xff,
|
(OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 16) & 0xff,
|
||||||
(uint8_t) ((h * w + 54 + 1024 + w * (w % 2)) >> 24) & 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", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (54 + 1024) & 0xff, ((54 + 1024) >> 8) & 0xff,
|
fprintf(fdest, "%c%c%c%c", (54 + 1024) & 0xff, ((54 + 1024) >> 8) & 0xff,
|
||||||
((54 + 1024) >> 16) & 0xff,
|
((54 + 1024) >> 16) & 0xff,
|
||||||
@@ -943,21 +926,21 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
|
|||||||
/* INFO HEADER */
|
/* 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", (40) & 0xff, ((40) >> 8) & 0xff, ((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) ((w) & 0xff),
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
|
||||||
(uint8_t) ((w) >> 8) & 0xff,
|
(OPJ_UINT8) ((w) >> 8) & 0xff,
|
||||||
(uint8_t) ((w) >> 16) & 0xff,
|
(OPJ_UINT8) ((w) >> 16) & 0xff,
|
||||||
(uint8_t) ((w) >> 24) & 0xff);
|
(OPJ_UINT8) ((w) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) ((h) & 0xff),
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
|
||||||
(uint8_t) ((h) >> 8) & 0xff,
|
(OPJ_UINT8) ((h) >> 8) & 0xff,
|
||||||
(uint8_t) ((h) >> 16) & 0xff,
|
(OPJ_UINT8) ((h) >> 16) & 0xff,
|
||||||
(uint8_t) ((h) >> 24) & 0xff);
|
(OPJ_UINT8) ((h) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
|
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
|
||||||
fprintf(fdest, "%c%c", (8) & 0xff, ((8) >> 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", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
|
||||||
fprintf(fdest, "%c%c%c%c", (uint8_t) (h * w + h * (w % 2)) & 0xff,
|
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + h * (w % 2)) & 0xff,
|
||||||
(uint8_t) ((h * w + h * (w % 2)) >> 8) & 0xff,
|
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 8) & 0xff,
|
||||||
(uint8_t) ((h * w + h * (w % 2)) >> 16) & 0xff,
|
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 16) & 0xff,
|
||||||
(uint8_t) ((h * w + h * (w % 2)) >> 24) & 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", (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);
|
||||||
@@ -981,10 +964,10 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
|
|||||||
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
|
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
|
||||||
if(r > 255) r = 255; else if(r < 0) r = 0;
|
if(r > 255) r = 255; else if(r < 0) r = 0;
|
||||||
|
|
||||||
fprintf(fdest, "%c", (uint8_t)r);
|
fprintf(fdest, "%c", (OPJ_UINT8)r);
|
||||||
|
|
||||||
if ((i + 1) % w == 0) {
|
if ((i + 1) % w == 0) {
|
||||||
for (pad = w % 4 ? 4 - w % 4 : 0; pad > 0; pad--) /* ADD */
|
for (pad = (w % 4) ? (4 - w % 4) : 0; pad > 0; pad--) /* ADD */
|
||||||
fprintf(fdest, "%c", 0);
|
fprintf(fdest, "%c", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,11 +36,7 @@
|
|||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
|
|
||||||
#ifndef HAVE_LIBPNG
|
|
||||||
# error HAVE_LIBPNG_NOT_DEFINED
|
|
||||||
#endif /* HAVE_LIBPNG */
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -58,12 +54,12 @@
|
|||||||
/* PNG allows bits per sample: 1, 2, 4, 8, 16 */
|
/* PNG allows bits per sample: 1, 2, 4, 8, 16 */
|
||||||
|
|
||||||
|
|
||||||
static void convert_16u32s_C1R(const png_byte* pSrc, png_int_32* pDst, size_t length)
|
static void convert_16u32s_C1R(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length)
|
||||||
{
|
{
|
||||||
size_t i;
|
OPJ_SIZE_T i;
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
png_int_32 val0 = *pSrc++;
|
OPJ_INT32 val0 = *pSrc++;
|
||||||
png_int_32 val1 = *pSrc++;
|
OPJ_INT32 val1 = *pSrc++;
|
||||||
pDst[i] = val0 << 8 | val1;
|
pDst[i] = val0 << 8 | val1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,20 +70,20 @@ opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
|
|||||||
png_infop info = NULL;
|
png_infop info = NULL;
|
||||||
double gamma;
|
double gamma;
|
||||||
int bit_depth, interlace_type,compression_type, filter_type;
|
int bit_depth, interlace_type,compression_type, filter_type;
|
||||||
png_uint_32 i;
|
OPJ_UINT32 i;
|
||||||
png_uint_32 width, height = 0U;
|
png_uint_32 width, height = 0U;
|
||||||
int color_type;
|
int color_type;
|
||||||
FILE *reader = NULL;
|
FILE *reader = NULL;
|
||||||
png_byte** rows = NULL;
|
OPJ_BYTE** rows = NULL;
|
||||||
png_int_32* row32s = NULL;
|
OPJ_INT32* row32s = NULL;
|
||||||
/* j2k: */
|
/* j2k: */
|
||||||
opj_image_t *image = NULL;
|
opj_image_t *image = NULL;
|
||||||
opj_image_cmptparm_t cmptparm[4];
|
opj_image_cmptparm_t cmptparm[4];
|
||||||
png_uint_32 nr_comp;
|
OPJ_UINT32 nr_comp;
|
||||||
png_byte sigbuf[8];
|
OPJ_BYTE sigbuf[8];
|
||||||
convert_XXx32s_C1R cvtXXTo32s = NULL;
|
convert_XXx32s_C1R cvtXXTo32s = NULL;
|
||||||
convert_32s_CXPX cvtCxToPx = NULL;
|
convert_32s_CXPX cvtCxToPx = NULL;
|
||||||
png_int_32* planes[4];
|
OPJ_INT32* planes[4];
|
||||||
|
|
||||||
if((reader = fopen(read_idf, "rb")) == NULL)
|
if((reader = fopen(read_idf, "rb")) == NULL)
|
||||||
{
|
{
|
||||||
@@ -188,38 +184,46 @@ opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rows = (png_byte**)calloc(height+1, sizeof(png_byte*));
|
rows = (OPJ_BYTE**)calloc(height+1, sizeof(OPJ_BYTE*));
|
||||||
for(i = 0; i < height; ++i)
|
if(rows == NULL){
|
||||||
rows[i] = (png_byte*)malloc(png_get_rowbytes(png,info));
|
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);
|
png_read_image(png, rows);
|
||||||
|
|
||||||
/* Create image */
|
/* Create image */
|
||||||
memset(cmptparm, 0, sizeof(cmptparm));
|
memset(cmptparm, 0, sizeof(cmptparm));
|
||||||
for(i = 0; i < nr_comp; ++i)
|
for(i = 0; i < nr_comp; ++i)
|
||||||
{
|
{
|
||||||
cmptparm[i].prec = (png_uint_32)bit_depth;
|
cmptparm[i].prec = (OPJ_UINT32)bit_depth;
|
||||||
/* bits_per_pixel: 8 or 16 */
|
/* bits_per_pixel: 8 or 16 */
|
||||||
cmptparm[i].bpp = (png_uint_32)bit_depth;
|
cmptparm[i].bpp = (OPJ_UINT32)bit_depth;
|
||||||
cmptparm[i].sgnd = 0;
|
cmptparm[i].sgnd = 0;
|
||||||
cmptparm[i].dx = (png_uint_32)params->subsampling_dx;
|
cmptparm[i].dx = (OPJ_UINT32)params->subsampling_dx;
|
||||||
cmptparm[i].dy = (png_uint_32)params->subsampling_dy;
|
cmptparm[i].dy = (OPJ_UINT32)params->subsampling_dy;
|
||||||
cmptparm[i].w = (png_uint_32)width;
|
cmptparm[i].w = (OPJ_UINT32)width;
|
||||||
cmptparm[i].h = (png_uint_32)height;
|
cmptparm[i].h = (OPJ_UINT32)height;
|
||||||
}
|
}
|
||||||
|
|
||||||
image = opj_image_create(nr_comp, &cmptparm[0], (nr_comp > 2U) ? CLRSPC_SRGB : CLRSPC_GRAY);
|
image = opj_image_create(nr_comp, &cmptparm[0], (nr_comp > 2U) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_GRAY);
|
||||||
if(image == NULL) goto fin;
|
if(image == NULL) goto fin;
|
||||||
image->x0 = (png_uint_32)params->image_offset_x0;
|
image->x0 = (OPJ_UINT32)params->image_offset_x0;
|
||||||
image->y0 = (png_uint_32)params->image_offset_y0;
|
image->y0 = (OPJ_UINT32)params->image_offset_y0;
|
||||||
image->x1 = (png_uint_32)(image->x0 + (width - 1) * (png_uint_32)params->subsampling_dx + 1 + image->x0);
|
image->x1 = (OPJ_UINT32)(image->x0 + (width - 1) * (OPJ_UINT32)params->subsampling_dx + 1 + image->x0);
|
||||||
image->y1 = (png_uint_32)(image->y0 + (height - 1) * (png_uint_32)params->subsampling_dy + 1 + image->y0);
|
image->y1 = (OPJ_UINT32)(image->y0 + (height - 1) * (OPJ_UINT32)params->subsampling_dy + 1 + image->y0);
|
||||||
|
|
||||||
row32s = (png_int_32 *)malloc((size_t)width * nr_comp * sizeof(png_int_32));
|
row32s = (OPJ_INT32 *)malloc((size_t)width * nr_comp * sizeof(OPJ_INT32));
|
||||||
if(row32s == NULL) goto fin;
|
if(row32s == NULL) goto fin;
|
||||||
|
|
||||||
/* Set alpha channel */
|
/* Set alpha channel */
|
||||||
/* image->comps[nr_comp-1U].alpha = 1U - (nr_comp & 1U); */
|
image->comps[nr_comp-1U].alpha = 1U - (nr_comp & 1U);
|
||||||
|
|
||||||
for(i = 0; i < nr_comp; i++)
|
for(i = 0; i < nr_comp; i++)
|
||||||
{
|
{
|
||||||
@@ -228,7 +232,7 @@ opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
|
|||||||
|
|
||||||
for(i = 0; i < height; ++i)
|
for(i = 0; i < height; ++i)
|
||||||
{
|
{
|
||||||
cvtXXTo32s(rows[i], row32s, (size_t)width * nr_comp);
|
cvtXXTo32s(rows[i], row32s, (OPJ_SIZE_T)width * nr_comp);
|
||||||
cvtCxToPx(row32s, planes, width);
|
cvtCxToPx(row32s, planes, width);
|
||||||
planes[0] += width;
|
planes[0] += width;
|
||||||
planes[1] += width;
|
planes[1] += width;
|
||||||
@@ -239,7 +243,7 @@ fin:
|
|||||||
if(rows)
|
if(rows)
|
||||||
{
|
{
|
||||||
for(i = 0; i < height; ++i)
|
for(i = 0; i < height; ++i)
|
||||||
free(rows[i]);
|
if(rows[i]) free(rows[i]);
|
||||||
free(rows);
|
free(rows);
|
||||||
}
|
}
|
||||||
if (row32s) {
|
if (row32s) {
|
||||||
@@ -255,13 +259,13 @@ fin:
|
|||||||
}/* pngtoimage() */
|
}/* pngtoimage() */
|
||||||
|
|
||||||
|
|
||||||
static void convert_32s16u_C1R(const png_int_32* pSrc, png_byte* pDst, size_t length)
|
static void convert_32s16u_C1R(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length)
|
||||||
{
|
{
|
||||||
size_t i;
|
OPJ_SIZE_T i;
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
png_uint_32 val = (png_uint_32)pSrc[i];
|
OPJ_UINT32 val = (OPJ_UINT32)pSrc[i];
|
||||||
*pDst++ = (png_byte)(val >> 8);
|
*pDst++ = (OPJ_BYTE)(val >> 8);
|
||||||
*pDst++ = (png_byte)val;
|
*pDst++ = (OPJ_BYTE)val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int imagetopng(opj_image_t * image, const char *write_idf)
|
int imagetopng(opj_image_t * image, const char *write_idf)
|
||||||
@@ -273,9 +277,9 @@ int imagetopng(opj_image_t * image, const char *write_idf)
|
|||||||
int nr_comp, color_type;
|
int nr_comp, color_type;
|
||||||
volatile int prec;
|
volatile int prec;
|
||||||
png_color_8 sig_bit;
|
png_color_8 sig_bit;
|
||||||
png_int_32 const* planes[4];
|
OPJ_INT32 const* planes[4];
|
||||||
int i;
|
int i;
|
||||||
png_int_32* volatile buffer32s = NULL;
|
OPJ_INT32* volatile buffer32s = NULL;
|
||||||
|
|
||||||
volatile int fails = 1;
|
volatile int fails = 1;
|
||||||
|
|
||||||
@@ -330,7 +334,7 @@ int imagetopng(opj_image_t * image, const char *write_idf)
|
|||||||
prec++;
|
prec++;
|
||||||
}
|
}
|
||||||
for (i = 0; i < nr_comp; ++i) {
|
for (i = 0; i < nr_comp; ++i) {
|
||||||
scale_component(&(image->comps[i]), (png_uint_32)prec);
|
scale_component(&(image->comps[i]), (OPJ_UINT32)prec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,12 +420,12 @@ int imagetopng(opj_image_t * image, const char *write_idf)
|
|||||||
|
|
||||||
/* setup conversion */
|
/* setup conversion */
|
||||||
{
|
{
|
||||||
size_t rowStride;
|
OPJ_SIZE_T rowStride;
|
||||||
png_size_t png_row_size;
|
png_size_t png_row_size;
|
||||||
|
|
||||||
png_row_size = png_get_rowbytes(png, info);
|
png_row_size = png_get_rowbytes(png, info);
|
||||||
rowStride = ((size_t)image->comps[0].w * (size_t)nr_comp * (size_t)prec + 7U) / 8U;
|
rowStride = ((OPJ_SIZE_T)image->comps[0].w * (OPJ_SIZE_T)nr_comp * (OPJ_SIZE_T)prec + 7U) / 8U;
|
||||||
if (rowStride != (size_t)png_row_size) {
|
if (rowStride != (OPJ_SIZE_T)png_row_size) {
|
||||||
fprintf(stderr, "Invalid PNG row size\n");
|
fprintf(stderr, "Invalid PNG row size\n");
|
||||||
goto fin;
|
goto fin;
|
||||||
}
|
}
|
||||||
@@ -430,7 +434,7 @@ int imagetopng(opj_image_t * image, const char *write_idf)
|
|||||||
fprintf(stderr, "Can't allocate memory for PNG row\n");
|
fprintf(stderr, "Can't allocate memory for PNG row\n");
|
||||||
goto fin;
|
goto fin;
|
||||||
}
|
}
|
||||||
buffer32s = (png_int_32*)malloc((size_t)image->comps[0].w * (size_t)nr_comp * sizeof(png_int_32));
|
buffer32s = (OPJ_INT32*)malloc((OPJ_SIZE_T)image->comps[0].w * (OPJ_SIZE_T)nr_comp * sizeof(OPJ_INT32));
|
||||||
if (buffer32s == NULL) {
|
if (buffer32s == NULL) {
|
||||||
fprintf(stderr, "Can't allocate memory for interleaved 32s row\n");
|
fprintf(stderr, "Can't allocate memory for interleaved 32s row\n");
|
||||||
goto fin;
|
goto fin;
|
||||||
@@ -439,13 +443,13 @@ int imagetopng(opj_image_t * image, const char *write_idf)
|
|||||||
|
|
||||||
/* convert */
|
/* convert */
|
||||||
{
|
{
|
||||||
size_t width= image->comps[0].w;
|
OPJ_SIZE_T width= image->comps[0].w;
|
||||||
int y;
|
OPJ_UINT32 y;
|
||||||
convert_32s_PXCX cvtPxToCx = convert_32s_PXCX_LUT[nr_comp];
|
convert_32s_PXCX cvtPxToCx = convert_32s_PXCX_LUT[nr_comp];
|
||||||
convert_32sXXx_C1R cvt32sToPack = NULL;
|
convert_32sXXx_C1R cvt32sToPack = NULL;
|
||||||
png_int_32 adjust = image->comps[0].sgnd ? 1 << (prec - 1) : 0;
|
OPJ_INT32 adjust = image->comps[0].sgnd ? 1 << (prec - 1) : 0;
|
||||||
png_bytep row_buf_cpy = row_buf;
|
png_bytep row_buf_cpy = row_buf;
|
||||||
png_int_32* buffer32s_cpy = buffer32s;
|
OPJ_INT32* buffer32s_cpy = buffer32s;
|
||||||
|
|
||||||
switch (prec) {
|
switch (prec) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -465,7 +469,7 @@ int imagetopng(opj_image_t * image, const char *write_idf)
|
|||||||
for(y = 0; y < image->comps[0].h; ++y)
|
for(y = 0; y < image->comps[0].h; ++y)
|
||||||
{
|
{
|
||||||
cvtPxToCx(planes, buffer32s_cpy, width, adjust);
|
cvtPxToCx(planes, buffer32s_cpy, width, adjust);
|
||||||
cvt32sToPack(buffer32s_cpy, row_buf_cpy, width * (size_t)nr_comp);
|
cvt32sToPack(buffer32s_cpy, row_buf_cpy, width * (OPJ_SIZE_T)nr_comp);
|
||||||
png_write_row(png, row_buf_cpy);
|
png_write_row(png, row_buf_cpy);
|
||||||
planes[0] += width;
|
planes[0] += width;
|
||||||
planes[1] += width;
|
planes[1] += width;
|
||||||
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
397
src/bin/jp2/index.c
Normal file
397
src/bin/jp2/index.c
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* 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 <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "openjpeg.h"
|
||||||
|
#include "index.h"
|
||||||
|
#include "opj_inttypes.h"
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/**
|
||||||
|
Write a structured index to a file
|
||||||
|
@param cstr_info Codestream information
|
||||||
|
@param index Index filename
|
||||||
|
@return Returns 0 if successful, returns 1 otherwise
|
||||||
|
*/
|
||||||
|
int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
|
||||||
|
int tileno, compno, layno, resno, precno, pack_nb, x, y;
|
||||||
|
FILE *stream = NULL;
|
||||||
|
double total_disto = 0;
|
||||||
|
/* UniPG>> */
|
||||||
|
int tilepartno;
|
||||||
|
char disto_on, numpix_on;
|
||||||
|
|
||||||
|
#ifdef USE_JPWL
|
||||||
|
if (!strcmp(index, JPWL_PRIVATEINDEX_NAME))
|
||||||
|
return 0;
|
||||||
|
#endif /* USE_JPWL */
|
||||||
|
/* <<UniPG */
|
||||||
|
|
||||||
|
if (!cstr_info)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
stream = fopen(index, "w");
|
||||||
|
if (!stream) {
|
||||||
|
fprintf(stderr, "failed to open index file [%s] for writing\n", index);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cstr_info->tile[0].distotile > 0.0)
|
||||||
|
disto_on = 1;
|
||||||
|
else
|
||||||
|
disto_on = 0;
|
||||||
|
|
||||||
|
if (cstr_info->tile[0].numpix)
|
||||||
|
numpix_on = 1;
|
||||||
|
else
|
||||||
|
numpix_on = 0;
|
||||||
|
|
||||||
|
fprintf(stream, "%d %d\n", cstr_info->image_w, cstr_info->image_h);
|
||||||
|
fprintf(stream, "%d\n", cstr_info->prog);
|
||||||
|
fprintf(stream, "%d %d\n", cstr_info->tile_x, cstr_info->tile_y);
|
||||||
|
fprintf(stream, "%d %d\n", cstr_info->tw, cstr_info->th);
|
||||||
|
fprintf(stream, "%d\n", cstr_info->numcomps);
|
||||||
|
fprintf(stream, "%d\n", cstr_info->numlayers);
|
||||||
|
fprintf(stream, "%d\n", cstr_info->numdecompos[0]); /* based on component 0 */
|
||||||
|
|
||||||
|
for (resno = cstr_info->numdecompos[0]; resno >= 0; resno--) {
|
||||||
|
fprintf(stream, "[%d,%d] ",
|
||||||
|
(1 << cstr_info->tile[0].pdx[resno]), (1 << cstr_info->tile[0].pdx[resno])); /* based on tile 0 and component 0 */
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
/* UniPG>> */
|
||||||
|
fprintf(stream, "%d\n", cstr_info->main_head_start);
|
||||||
|
/* <<UniPG */
|
||||||
|
fprintf(stream, "%d\n", cstr_info->main_head_end);
|
||||||
|
fprintf(stream, "%d\n", cstr_info->codestream_size);
|
||||||
|
|
||||||
|
fprintf(stream, "\nINFO ON TILES\n");
|
||||||
|
fprintf(stream, "tileno start_pos end_hd end_tile nbparts");
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream," disto");
|
||||||
|
if (numpix_on)
|
||||||
|
fprintf(stream," nbpix");
|
||||||
|
if (disto_on && numpix_on)
|
||||||
|
fprintf(stream," disto/nbpix");
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
|
||||||
|
for (tileno = 0; tileno < cstr_info->tw * cstr_info->th; tileno++) {
|
||||||
|
fprintf(stream, "%4d %9d %9d %9d %9d",
|
||||||
|
cstr_info->tile[tileno].tileno,
|
||||||
|
cstr_info->tile[tileno].start_pos,
|
||||||
|
cstr_info->tile[tileno].end_header,
|
||||||
|
cstr_info->tile[tileno].end_pos,
|
||||||
|
cstr_info->tile[tileno].num_tps);
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream," %9e", cstr_info->tile[tileno].distotile);
|
||||||
|
if (numpix_on)
|
||||||
|
fprintf(stream," %9d", cstr_info->tile[tileno].numpix);
|
||||||
|
if (disto_on && numpix_on)
|
||||||
|
fprintf(stream," %9e", cstr_info->tile[tileno].distotile / cstr_info->tile[tileno].numpix);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (tileno = 0; tileno < cstr_info->tw * cstr_info->th; tileno++) {
|
||||||
|
OPJ_OFF_T start_pos, end_ph_pos, end_pos;
|
||||||
|
double disto = 0;
|
||||||
|
int max_numdecompos = 0;
|
||||||
|
pack_nb = 0;
|
||||||
|
|
||||||
|
for (compno = 0; compno < cstr_info->numcomps; compno++) {
|
||||||
|
if (max_numdecompos < cstr_info->numdecompos[compno])
|
||||||
|
max_numdecompos = cstr_info->numdecompos[compno];
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stream, "\nTILE %d DETAILS\n", tileno);
|
||||||
|
fprintf(stream, "part_nb tileno start_pack num_packs start_pos end_tph_pos end_pos\n");
|
||||||
|
for (tilepartno = 0; tilepartno < cstr_info->tile[tileno].num_tps; tilepartno++)
|
||||||
|
fprintf(stream, "%4d %9d %9d %9d %9d %11d %9d\n",
|
||||||
|
tilepartno, tileno,
|
||||||
|
cstr_info->tile[tileno].tp[tilepartno].tp_start_pack,
|
||||||
|
cstr_info->tile[tileno].tp[tilepartno].tp_numpacks,
|
||||||
|
cstr_info->tile[tileno].tp[tilepartno].tp_start_pos,
|
||||||
|
cstr_info->tile[tileno].tp[tilepartno].tp_end_header,
|
||||||
|
cstr_info->tile[tileno].tp[tilepartno].tp_end_pos
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cstr_info->prog == OPJ_LRCP) { /* LRCP */
|
||||||
|
fprintf(stream, "LRCP\npack_nb tileno layno resno compno precno start_pos end_ph_pos end_pos");
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " disto");
|
||||||
|
fprintf(stream,"\n");
|
||||||
|
|
||||||
|
for (layno = 0; layno < cstr_info->numlayers; layno++) {
|
||||||
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
|
for (compno = 0; compno < cstr_info->numcomps; compno++) {
|
||||||
|
int prec_max;
|
||||||
|
if (resno > cstr_info->numdecompos[compno])
|
||||||
|
break;
|
||||||
|
prec_max = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
for (precno = 0; precno < prec_max; precno++) {
|
||||||
|
start_pos = cstr_info->tile[tileno].packet[pack_nb].start_pos;
|
||||||
|
end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos;
|
||||||
|
end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos;
|
||||||
|
disto = cstr_info->tile[tileno].packet[pack_nb].disto;
|
||||||
|
fprintf(stream, "%4d %6d %7d %5d %6d %6d %6" PRId64 " %6" PRId64 " %7" PRId64,
|
||||||
|
pack_nb, tileno, layno, resno, compno, precno, start_pos, end_ph_pos, end_pos);
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " %8e", disto);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
total_disto += disto;
|
||||||
|
pack_nb++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* LRCP */
|
||||||
|
|
||||||
|
else if (cstr_info->prog == OPJ_RLCP) { /* RLCP */
|
||||||
|
fprintf(stream, "RLCP\npack_nb tileno resno layno compno precno start_pos end_ph_pos end_pos\n");
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " disto");
|
||||||
|
fprintf(stream,"\n");
|
||||||
|
|
||||||
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
|
for (layno = 0; layno < cstr_info->numlayers; layno++) {
|
||||||
|
for (compno = 0; compno < cstr_info->numcomps; compno++) {
|
||||||
|
int prec_max;
|
||||||
|
if (resno > cstr_info->numdecompos[compno])
|
||||||
|
break;
|
||||||
|
prec_max = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
for (precno = 0; precno < prec_max; precno++) {
|
||||||
|
start_pos = cstr_info->tile[tileno].packet[pack_nb].start_pos;
|
||||||
|
end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos;
|
||||||
|
end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos;
|
||||||
|
disto = cstr_info->tile[tileno].packet[pack_nb].disto;
|
||||||
|
fprintf(stream, "%4d %6d %5d %7d %6d %6d %9" PRId64 " %9" PRId64 " %7" PRId64,
|
||||||
|
pack_nb, tileno, resno, layno, compno, precno, start_pos, end_ph_pos, end_pos);
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " %8e", disto);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
total_disto += disto;
|
||||||
|
pack_nb++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* RLCP */
|
||||||
|
|
||||||
|
else if (cstr_info->prog == OPJ_RPCL) { /* RPCL */
|
||||||
|
|
||||||
|
fprintf(stream, "RPCL\npack_nb tileno resno precno compno layno start_pos end_ph_pos end_pos");
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " disto");
|
||||||
|
fprintf(stream,"\n");
|
||||||
|
|
||||||
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
for (precno = 0; precno < numprec; precno++) {
|
||||||
|
/* I suppose components have same XRsiz, YRsiz */
|
||||||
|
int x0 = cstr_info->tile_Ox + tileno - (int)floor((float)tileno/(float)cstr_info->tw ) * cstr_info->tw * cstr_info->tile_x;
|
||||||
|
int y0 = cstr_info->tile_Ox + (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tile_y;
|
||||||
|
int x1 = x0 + cstr_info->tile_x;
|
||||||
|
int y1 = y0 + cstr_info->tile_y;
|
||||||
|
for (compno = 0; compno < cstr_info->numcomps; compno++) {
|
||||||
|
int pcnx = cstr_info->tile[tileno].pw[resno];
|
||||||
|
int pcx = (int) pow( 2, cstr_info->tile[tileno].pdx[resno] + cstr_info->numdecompos[compno] - resno );
|
||||||
|
int pcy = (int) pow( 2, cstr_info->tile[tileno].pdy[resno] + cstr_info->numdecompos[compno] - resno );
|
||||||
|
int precno_x = precno - (int) floor( (float)precno/(float)pcnx ) * pcnx;
|
||||||
|
int precno_y = (int) floor( (float)precno/(float)pcnx );
|
||||||
|
if (resno > cstr_info->numdecompos[compno])
|
||||||
|
break;
|
||||||
|
for(y = y0; y < y1; y++) {
|
||||||
|
if (precno_y*pcy == y ) {
|
||||||
|
for (x = x0; x < x1; x++) {
|
||||||
|
if (precno_x*pcx == x ) {
|
||||||
|
for (layno = 0; layno < cstr_info->numlayers; layno++) {
|
||||||
|
start_pos = cstr_info->tile[tileno].packet[pack_nb].start_pos;
|
||||||
|
end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos;
|
||||||
|
end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos;
|
||||||
|
disto = cstr_info->tile[tileno].packet[pack_nb].disto;
|
||||||
|
fprintf(stream, "%4d %6d %5d %6d %6d %7d %9" PRId64 " %9" PRId64 " %7" PRId64,
|
||||||
|
pack_nb, tileno, resno, precno, compno, layno, start_pos, end_ph_pos, end_pos);
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " %8e", disto);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
total_disto += disto;
|
||||||
|
pack_nb++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}/* x = x0..x1 */
|
||||||
|
}
|
||||||
|
} /* y = y0..y1 */
|
||||||
|
} /* precno */
|
||||||
|
} /* compno */
|
||||||
|
} /* resno */
|
||||||
|
} /* RPCL */
|
||||||
|
|
||||||
|
else if (cstr_info->prog == OPJ_PCRL) { /* PCRL */
|
||||||
|
/* I suppose components have same XRsiz, YRsiz */
|
||||||
|
int x0 = cstr_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tw * cstr_info->tile_x;
|
||||||
|
int y0 = cstr_info->tile_Ox + (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tile_y;
|
||||||
|
int x1 = x0 + cstr_info->tile_x;
|
||||||
|
int y1 = y0 + cstr_info->tile_y;
|
||||||
|
|
||||||
|
/* Count the maximum number of precincts */
|
||||||
|
int max_numprec = 0;
|
||||||
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
if (numprec > max_numprec)
|
||||||
|
max_numprec = numprec;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stream, "PCRL\npack_nb tileno precno compno resno layno start_pos end_ph_pos end_pos");
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " disto");
|
||||||
|
fprintf(stream,"\n");
|
||||||
|
|
||||||
|
for (precno = 0; precno < max_numprec; precno++) {
|
||||||
|
for (compno = 0; compno < cstr_info->numcomps; compno++) {
|
||||||
|
for (resno = 0; resno < cstr_info->numdecompos[compno] + 1; resno++) {
|
||||||
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
int pcnx = cstr_info->tile[tileno].pw[resno];
|
||||||
|
int pcx = (int) pow( 2, cstr_info->tile[tileno].pdx[resno] + cstr_info->numdecompos[compno] - resno );
|
||||||
|
int pcy = (int) pow( 2, cstr_info->tile[tileno].pdy[resno] + cstr_info->numdecompos[compno] - resno );
|
||||||
|
int precno_x = precno - (int) floor( (float)precno/(float)pcnx ) * pcnx;
|
||||||
|
int precno_y = (int) floor( (float)precno/(float)pcnx );
|
||||||
|
if (precno >= numprec)
|
||||||
|
continue;
|
||||||
|
for(y = y0; y < y1; y++) {
|
||||||
|
if (precno_y*pcy == y ) {
|
||||||
|
for (x = x0; x < x1; x++) {
|
||||||
|
if (precno_x*pcx == x ) {
|
||||||
|
for (layno = 0; layno < cstr_info->numlayers; layno++) {
|
||||||
|
start_pos = cstr_info->tile[tileno].packet[pack_nb].start_pos;
|
||||||
|
end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos;
|
||||||
|
end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos;
|
||||||
|
disto = cstr_info->tile[tileno].packet[pack_nb].disto;
|
||||||
|
fprintf(stream, "%4d %6d %6d %6d %5d %7d %9" PRId64 " %9" PRId64 " %7" PRId64,
|
||||||
|
pack_nb, tileno, precno, compno, resno, layno, start_pos, end_ph_pos, end_pos);
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " %8e", disto);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
total_disto += disto;
|
||||||
|
pack_nb++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}/* x = x0..x1 */
|
||||||
|
}
|
||||||
|
} /* y = y0..y1 */
|
||||||
|
} /* resno */
|
||||||
|
} /* compno */
|
||||||
|
} /* precno */
|
||||||
|
} /* PCRL */
|
||||||
|
|
||||||
|
else { /* CPRL */
|
||||||
|
/* Count the maximum number of precincts */
|
||||||
|
int max_numprec = 0;
|
||||||
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
if (numprec > max_numprec)
|
||||||
|
max_numprec = numprec;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stream, "CPRL\npack_nb tileno compno precno resno layno start_pos end_ph_pos end_pos");
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " disto");
|
||||||
|
fprintf(stream,"\n");
|
||||||
|
|
||||||
|
for (compno = 0; compno < cstr_info->numcomps; compno++) {
|
||||||
|
/* I suppose components have same XRsiz, YRsiz */
|
||||||
|
int x0 = cstr_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tw * cstr_info->tile_x;
|
||||||
|
int y0 = cstr_info->tile_Ox + (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tile_y;
|
||||||
|
int x1 = x0 + cstr_info->tile_x;
|
||||||
|
int y1 = y0 + cstr_info->tile_y;
|
||||||
|
|
||||||
|
for (precno = 0; precno < max_numprec; precno++) {
|
||||||
|
for (resno = 0; resno < cstr_info->numdecompos[compno] + 1; resno++) {
|
||||||
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
int pcnx = cstr_info->tile[tileno].pw[resno];
|
||||||
|
int pcx = (int) pow( 2, cstr_info->tile[tileno].pdx[resno] + cstr_info->numdecompos[compno] - resno );
|
||||||
|
int pcy = (int) pow( 2, cstr_info->tile[tileno].pdy[resno] + cstr_info->numdecompos[compno] - resno );
|
||||||
|
int precno_x = precno - (int) floor( (float)precno/(float)pcnx ) * pcnx;
|
||||||
|
int precno_y = (int) floor( (float)precno/(float)pcnx );
|
||||||
|
if (precno >= numprec)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for(y = y0; y < y1; y++) {
|
||||||
|
if (precno_y*pcy == y ) {
|
||||||
|
for (x = x0; x < x1; x++) {
|
||||||
|
if (precno_x*pcx == x ) {
|
||||||
|
for (layno = 0; layno < cstr_info->numlayers; layno++) {
|
||||||
|
start_pos = cstr_info->tile[tileno].packet[pack_nb].start_pos;
|
||||||
|
end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos;
|
||||||
|
end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos;
|
||||||
|
disto = cstr_info->tile[tileno].packet[pack_nb].disto;
|
||||||
|
fprintf(stream, "%4d %6d %6d %6d %5d %7d %9" PRId64 " %9" PRId64 " %7" PRId64,
|
||||||
|
pack_nb, tileno, compno, precno, resno, layno, start_pos, end_ph_pos, end_pos);
|
||||||
|
if (disto_on)
|
||||||
|
fprintf(stream, " %8e", disto);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
total_disto += disto;
|
||||||
|
pack_nb++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}/* x = x0..x1 */
|
||||||
|
}
|
||||||
|
} /* y = y0..y1 */
|
||||||
|
} /* resno */
|
||||||
|
} /* precno */
|
||||||
|
} /* compno */
|
||||||
|
} /* CPRL */
|
||||||
|
} /* tileno */
|
||||||
|
|
||||||
|
if (disto_on) {
|
||||||
|
fprintf(stream, "%8e\n", cstr_info->D_max); /* SE max */
|
||||||
|
fprintf(stream, "%.8e\n", total_disto); /* SE totale */
|
||||||
|
}
|
||||||
|
/* UniPG>> */
|
||||||
|
/* print the markers' list */
|
||||||
|
if (cstr_info->marknum) {
|
||||||
|
fprintf(stream, "\nMARKER LIST\n");
|
||||||
|
fprintf(stream, "%d\n", cstr_info->marknum);
|
||||||
|
fprintf(stream, "type\tstart_pos length\n");
|
||||||
|
for (x = 0; x < cstr_info->marknum; x++)
|
||||||
|
fprintf(stream, "%X\t%9" PRId64 " %9d\n", cstr_info->marker[x].type, cstr_info->marker[x].pos, cstr_info->marker[x].len);
|
||||||
|
}
|
||||||
|
/* <<UniPG */
|
||||||
|
fclose(stream);
|
||||||
|
|
||||||
|
fprintf(stderr,"Generated index file %s\n", index);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
54
src/bin/jp2/index.h
Normal file
54
src/bin/jp2/index.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* 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 __J2K_INDEX_H
|
||||||
|
#define __J2K_INDEX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
Write a structured index to a file
|
||||||
|
@param cstr_info Codestream information
|
||||||
|
@param index Index filename
|
||||||
|
@return Returns 0 if successful, returns 1 otherwise
|
||||||
|
*/
|
||||||
|
int write_index_file(opj_codestream_info_t *cstr_info, char *index);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __J2K_INDEX_H */
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user