Compare commits
949 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e0bbbf7e6 | ||
|
|
49df783743 | ||
|
|
04e0a0293a | ||
|
|
bb9e147872 | ||
|
|
1d29c5f97b | ||
|
|
67bee8683d | ||
|
|
65d4a46d3b | ||
|
|
c6eedebc6a | ||
|
|
0c83e5af00 | ||
|
|
d8522a7587 | ||
|
|
01fdcc391a | ||
|
|
9ce1a21ea7 | ||
|
|
0bb37a5d5f | ||
|
|
4c17a453d1 | ||
|
|
ba923a8529 | ||
|
|
4578953843 | ||
|
|
d7a642b571 | ||
|
|
00400a0a58 | ||
|
|
441308cffa | ||
|
|
4b357abb6d | ||
|
|
94f7ac929a | ||
|
|
7175e51792 | ||
|
|
764e1e23aa | ||
|
|
0ddff3b059 | ||
|
|
7eced19feb | ||
|
|
08769b32f6 | ||
|
|
f32640e8cb | ||
|
|
6cd1ec4b09 | ||
|
|
7ed0aebdba | ||
|
|
5e96c9bfe0 | ||
|
|
5a84a0e1b3 | ||
|
|
fde862ba1d | ||
|
|
292fb8425e | ||
|
|
0bf58f2145 | ||
|
|
a35de7cc08 | ||
|
|
a2a2cd60e5 | ||
|
|
189ee81b58 | ||
|
|
0f7ff719a1 | ||
|
|
bdfcb74d50 | ||
|
|
5039d734d5 | ||
|
|
98ca1c35d7 | ||
|
|
2e22eb6ea2 | ||
|
|
6da61db278 | ||
|
|
dc4645d422 | ||
|
|
736fb06278 | ||
|
|
ab70623eb2 | ||
|
|
b87136c2c7 | ||
|
|
eff4f956fe | ||
|
|
e2394fc58a | ||
|
|
cb2036fd11 | ||
|
|
7c39e3a766 | ||
|
|
1f4cc446fe | ||
|
|
b87a0b4687 | ||
|
|
00c2cf3632 | ||
|
|
0f43551e08 | ||
|
|
c5052c7701 | ||
|
|
211d1e7463 | ||
|
|
5815699bff | ||
|
|
f29ffd3eed | ||
|
|
2f12d7a486 | ||
|
|
6f96153c67 | ||
|
|
e54d31affe | ||
|
|
6b638a6d58 | ||
|
|
d211effa01 | ||
|
|
dad4d2e76c | ||
|
|
d5e964c980 | ||
|
|
c168d9641c | ||
|
|
6a32d04d23 | ||
|
|
28701317d2 | ||
|
|
d7ca17b73d | ||
|
|
ac51438b66 | ||
|
|
966d8b77ef | ||
|
|
c137f0f1cf | ||
|
|
5829cb2398 | ||
|
|
c39ec149e8 | ||
|
|
a4ecaacde6 | ||
|
|
f18f81b7e2 | ||
|
|
989630f70c | ||
|
|
5996a25e2f | ||
|
|
1e247ac854 | ||
|
|
5ead57a34a | ||
|
|
489583f516 | ||
|
|
bc79e0680a | ||
|
|
a8b67c4fbb | ||
|
|
9ba2f5ed36 | ||
|
|
36a4ccccd3 | ||
|
|
f37e4daf94 | ||
|
|
251db636f8 | ||
|
|
a9d39ce09d | ||
|
|
e0634b15c3 | ||
|
|
8cbf8939bb | ||
|
|
f73a27ca5b | ||
|
|
b5f2e450ac | ||
|
|
b24a7228ed | ||
|
|
6d6e37df18 | ||
|
|
cf763c0cd8 | ||
|
|
03badeab66 | ||
|
|
84f7122ba6 | ||
|
|
a73e870ad0 | ||
|
|
0bfb78051d | ||
|
|
2dcd4b5353 | ||
|
|
152e4c5ee4 | ||
|
|
75cf49798d | ||
|
|
5e3bb3e9c8 | ||
|
|
de924b8587 | ||
|
|
bc2e66cb43 | ||
|
|
d9d1d67d7c | ||
|
|
fac3bea8da | ||
|
|
61e1341f11 | ||
|
|
29d8f253f8 | ||
|
|
8fd7221dc1 | ||
|
|
a394bf752a | ||
|
|
0a0f8d14e2 | ||
|
|
2186809a45 | ||
|
|
e0419b530b | ||
|
|
3367f407fe | ||
|
|
cc336e7bd2 | ||
|
|
73d74c132b | ||
|
|
e0a0151761 | ||
|
|
fd3aba3590 | ||
|
|
112a0bb968 | ||
|
|
ea505e777a | ||
|
|
5950c5d4f9 | ||
|
|
ea7bb7b651 | ||
|
|
98eecb8605 | ||
|
|
13c318da4f | ||
|
|
14e8225391 | ||
|
|
de37e07716 | ||
|
|
575317bb54 | ||
|
|
df0babcfc2 | ||
|
|
8126d0c5a5 | ||
|
|
316617faf4 | ||
|
|
66fe68b0b2 | ||
|
|
69799275be | ||
|
|
b2fc846e44 | ||
|
|
dc31f0bc41 | ||
|
|
f659f43f93 | ||
|
|
dd2b651243 | ||
|
|
e93d94b9ad | ||
|
|
4f24016bde | ||
|
|
4ef9c9549b | ||
|
|
ea3396a945 | ||
|
|
9ba64bbbcf | ||
|
|
afc06929e0 | ||
|
|
6dd6b3a74c | ||
|
|
d4c15e103c | ||
|
|
8ad24924ea | ||
|
|
2eda8212e4 | ||
|
|
fd407776ba | ||
|
|
f52682e277 | ||
|
|
0559e94c72 | ||
|
|
21cc62bccb | ||
|
|
7c6ae034da | ||
|
|
c2f89f131d | ||
|
|
68071bd2e4 | ||
|
|
8015a30308 | ||
|
|
6bc5938482 | ||
|
|
cac105133e | ||
|
|
ffe4fc182f | ||
|
|
a9b646c202 | ||
|
|
0586d41d1b | ||
|
|
09e4575789 | ||
|
|
69c1408e9d | ||
|
|
9e7eb27686 | ||
|
|
086c9ab549 | ||
|
|
0989088530 | ||
|
|
51d626ff9d | ||
|
|
ed839d5905 | ||
|
|
01bf9d9ccd | ||
|
|
c052646b34 | ||
|
|
ef49f790bd | ||
|
|
57bd84f435 | ||
|
|
99bebdd0aa | ||
|
|
02cd567fb9 | ||
|
|
20b734e1c4 | ||
|
|
bbaf4c94cd | ||
|
|
166c5ec0b9 | ||
|
|
a1647c8412 | ||
|
|
1fbae8467f | ||
|
|
f832eae5c2 | ||
|
|
1256fbade9 | ||
|
|
b39dfe7046 | ||
|
|
be6d424626 | ||
|
|
0f0fd75125 | ||
|
|
760ea8dfb3 | ||
|
|
44a97e8fe7 | ||
|
|
c3ba39fc3b | ||
|
|
7ed7b57203 | ||
|
|
3d40ad5f6e | ||
|
|
00b327b8f8 | ||
|
|
11a122b2d6 | ||
|
|
6916f87955 | ||
|
|
bdbcd14057 | ||
|
|
c8fb758bc2 | ||
|
|
be12e1dec5 | ||
|
|
cf775bf789 | ||
|
|
cb6157be7a | ||
|
|
0af8d67bd5 | ||
|
|
7ccb00701f | ||
|
|
4a2cdc26be | ||
|
|
3a5e362bd3 | ||
|
|
1d5b1cf320 | ||
|
|
66a69f04c6 | ||
|
|
ccd1bfdd31 | ||
|
|
866e6ffeca | ||
|
|
9cd4e4b026 | ||
|
|
7ab0364a37 | ||
|
|
fb6c27e4e2 | ||
|
|
6ebf110355 | ||
|
|
d65d99a9f5 | ||
|
|
ab2df6ea1b | ||
|
|
33eca7e4f2 | ||
|
|
e006f5c427 | ||
|
|
313a09b4b7 | ||
|
|
27fb3fc589 | ||
|
|
8660bcba72 | ||
|
|
8c8124bf51 | ||
|
|
bf0bdac1d3 | ||
|
|
30913542c0 | ||
|
|
ed5430ce9a | ||
|
|
b6b30676a3 | ||
|
|
d657ba6093 | ||
|
|
16c6e26e4b | ||
|
|
a5dcab663a | ||
|
|
12781cb555 | ||
|
|
a7466c9d86 | ||
|
|
2d4816591f | ||
|
|
307156de33 | ||
|
|
81a50f71a3 | ||
|
|
2c62da3c6c | ||
|
|
efe28cec4b | ||
|
|
b76c8404e3 | ||
|
|
67ce3b2352 | ||
|
|
ab64b62c6b | ||
|
|
80803ae5fe | ||
|
|
795e6ad334 | ||
|
|
c412184bd8 | ||
|
|
ebfe9e4a7b | ||
|
|
105f9a94ed | ||
|
|
0f905d35c2 | ||
|
|
1ca924a550 | ||
|
|
b56ae3d7fa | ||
|
|
77fee43a02 | ||
|
|
7bc3fb51e3 | ||
|
|
7080ea3c16 | ||
|
|
3c21b08ef1 | ||
|
|
a006fbab0b | ||
|
|
89c59dd669 | ||
|
|
94755ceb05 | ||
|
|
8e11a05bd6 | ||
|
|
20c7dbc64f | ||
|
|
06420c42c4 | ||
|
|
f69dc28888 | ||
|
|
4ad6003253 | ||
|
|
6b968b28ae | ||
|
|
870fd8f1bb | ||
|
|
f546711076 | ||
|
|
835b76fb65 | ||
|
|
c6fa5ba028 | ||
|
|
57a3736243 | ||
|
|
7bf04d399e | ||
|
|
9a4570a501 | ||
|
|
3fbf08bb61 | ||
|
|
d89e01f5ce | ||
|
|
c08e8c15bc | ||
|
|
b4570bbf8c | ||
|
|
f12bb305c2 | ||
|
|
22bfd9c40f | ||
|
|
36edad7a4e | ||
|
|
b071f01cbb | ||
|
|
ad6955d46a | ||
|
|
5129e3960f | ||
|
|
98a44fe07b | ||
|
|
ce4e3e8690 | ||
|
|
82bd52196d | ||
|
|
e5c6eb583f | ||
|
|
a2fdd0c9ab | ||
|
|
4b024a62b2 | ||
|
|
0dc7c82f35 | ||
|
|
3d0fe946e5 | ||
|
|
8a367177fa | ||
|
|
7a9376c114 | ||
|
|
2a47df6627 | ||
|
|
51cf51a41c | ||
|
|
0f65030297 | ||
|
|
b740054f3c | ||
|
|
9c4590e37b | ||
|
|
a9b35c965e | ||
|
|
1208d50fa6 | ||
|
|
68a086a147 | ||
|
|
2091870c9f | ||
|
|
e835ee3340 | ||
|
|
dc2697da3a | ||
|
|
868ca2b377 | ||
|
|
724c56b46a | ||
|
|
9b49f0e4c7 | ||
|
|
fa9ff8e88c | ||
|
|
bd1ef431b3 | ||
|
|
ffdb8f22f6 | ||
|
|
b7120ca547 | ||
|
|
eed08614a6 | ||
|
|
8c60d22ff5 | ||
|
|
c52c55670a | ||
|
|
e54b755ab8 | ||
|
|
4346f91fcb | ||
|
|
cf137ac46a | ||
|
|
b8c6ee38b0 | ||
|
|
0571e17c55 | ||
|
|
215aa8b78b | ||
|
|
ac906c5308 | ||
|
|
418dbdff66 | ||
|
|
bd86b76e94 | ||
|
|
7e3fd2faf5 | ||
|
|
e9f9ec4a4e | ||
|
|
4db92add1b | ||
|
|
94f0e03f90 | ||
|
|
296c71ba0f | ||
|
|
312cd79456 | ||
|
|
b8b359ae97 | ||
|
|
3185cb94f1 | ||
|
|
7f73d9b6ad | ||
|
|
565a5bd5f5 | ||
|
|
9a746ad485 | ||
|
|
44eb47ef2b | ||
|
|
9f5320fd6f | ||
|
|
18821f89a7 | ||
|
|
4348464a2f | ||
|
|
d441107013 | ||
|
|
6b76f75d2c | ||
|
|
90215cca0c | ||
|
|
67d1fc1f7c | ||
|
|
b5624ee8b6 | ||
|
|
81f5f7c110 | ||
|
|
be49b8c0cf | ||
|
|
cb6205a774 | ||
|
|
61d06e7133 | ||
|
|
ff78e37595 | ||
|
|
a29294a946 | ||
|
|
20c404d3b3 | ||
|
|
3a1bb35117 | ||
|
|
0fc884a811 | ||
|
|
9792ce8947 | ||
|
|
f962fbb44a | ||
|
|
007a42cda4 | ||
|
|
a8b8b472b9 | ||
|
|
25b995ad4d | ||
|
|
9b28defe6a | ||
|
|
f89dd1ec1a | ||
|
|
ba29357611 | ||
|
|
2bfdb5d4af | ||
|
|
2c289bfa9b | ||
|
|
34a8e35a4f | ||
|
|
e19f15e3f2 | ||
|
|
a27962bd9a | ||
|
|
750e078179 | ||
|
|
321e068601 | ||
|
|
56fb237472 | ||
|
|
e8738541c9 | ||
|
|
fd62eca284 | ||
|
|
5ee81f43cf | ||
|
|
fad469f51e | ||
|
|
4f81526385 | ||
|
|
c07f688aa8 | ||
|
|
ee269920c4 | ||
|
|
65e0cd3278 | ||
|
|
6bb57b7219 | ||
|
|
4852d283d7 | ||
|
|
83c8f14fa2 | ||
|
|
f165c2dfc5 | ||
|
|
d884011c17 | ||
|
|
049aef51d4 | ||
|
|
1f8b6010ea | ||
|
|
bc51580f28 | ||
|
|
c56a74cdac | ||
|
|
51705fb967 | ||
|
|
8071c391bc | ||
|
|
e43d21d57f | ||
|
|
9e6378c448 | ||
|
|
051d962318 | ||
|
|
62de12281a | ||
|
|
5c36465fd5 | ||
|
|
9026b37c0b | ||
|
|
254937b33b | ||
|
|
59f954b323 | ||
|
|
58454c74cc | ||
|
|
ddcd5a1979 | ||
|
|
98b8529d1f | ||
|
|
dc6f6a9c4e | ||
|
|
577ae78c30 | ||
|
|
926e01ffe1 | ||
|
|
d9ee65c24a | ||
|
|
2a33dfcaab | ||
|
|
b05ebcbcc4 | ||
|
|
2ffcb8eaf7 | ||
|
|
e7fde87ca5 | ||
|
|
7394e27b16 | ||
|
|
db42506734 | ||
|
|
59a58343ea | ||
|
|
df48945d2d | ||
|
|
279bd348ce | ||
|
|
a0f878a07b | ||
|
|
b0428a73c0 | ||
|
|
848f225e2f | ||
|
|
62c6f9811b | ||
|
|
58b6ec4580 | ||
|
|
b2f9415a63 | ||
|
|
86e51f2268 | ||
|
|
9db6bebe23 | ||
|
|
9e50fa7fbe | ||
|
|
957d623461 | ||
|
|
01fa031b85 | ||
|
|
88f54a4a5d | ||
|
|
dffd53da5d | ||
|
|
f2602ce567 | ||
|
|
b6ed7d347a | ||
|
|
04def09ea9 | ||
|
|
4f8c29572e | ||
|
|
ba6f457099 | ||
|
|
e44f8c0112 | ||
|
|
e08c05f6e8 | ||
|
|
1e14b47c22 | ||
|
|
bb83575b75 | ||
|
|
b97bafdfd7 | ||
|
|
a8eabfebd1 | ||
|
|
1da7858d24 | ||
|
|
b94f2de41d | ||
|
|
cd2e6946bb | ||
|
|
1c87e45cff | ||
|
|
539b288780 | ||
|
|
47aaf6fa15 | ||
|
|
328c4388b7 | ||
|
|
e6f597f28f | ||
|
|
bfa34cf143 | ||
|
|
5e091d4d1f | ||
|
|
95db4f48a5 | ||
|
|
1a79ede633 | ||
|
|
a6471c34ed | ||
|
|
f5c3bb38bc | ||
|
|
fe6a2ee5a1 | ||
|
|
ebf239d056 | ||
|
|
60de06ef7a | ||
|
|
df1c38df74 | ||
|
|
1f014c32e6 | ||
|
|
2c74e5124d | ||
|
|
92549de2c2 | ||
|
|
d932e58217 | ||
|
|
16958e823e | ||
|
|
7c99822efb | ||
|
|
16c7077887 | ||
|
|
1da67e18a3 | ||
|
|
23da0c0e41 | ||
|
|
e217b7ea54 | ||
|
|
2930fa8e9c | ||
|
|
6bd084afd2 | ||
|
|
e856eb0f8f | ||
|
|
15866ac1da | ||
|
|
31334415ae | ||
|
|
7d4b001665 | ||
|
|
bb0e0b57dd | ||
|
|
d0a813632b | ||
|
|
a3f68b4d2a | ||
|
|
e85730157e | ||
|
|
46531c3265 | ||
|
|
2e2358eae4 | ||
|
|
ad05754a87 | ||
|
|
d8ebb6b654 | ||
|
|
ddd728c6bd | ||
|
|
ba5ea5143e | ||
|
|
f2cef492b1 | ||
|
|
6a833a8ee0 | ||
|
|
3c2d7f21a4 | ||
|
|
9977e28a09 | ||
|
|
45358dd140 | ||
|
|
0a07969273 | ||
|
|
0a325197de | ||
|
|
a81d3101da | ||
|
|
da5220acdd | ||
|
|
e6ab539b1d | ||
|
|
43a29d2c17 | ||
|
|
6acf52b5f9 | ||
|
|
5528b55834 | ||
|
|
0f1f60d080 | ||
|
|
b15b7df690 | ||
|
|
f7f3ea404c | ||
|
|
20ec358b3c | ||
|
|
109a578e89 | ||
|
|
7166bb7b3a | ||
|
|
6ee5459459 | ||
|
|
438affe886 | ||
|
|
1a3dbe6fba | ||
|
|
23f2bbaeda | ||
|
|
5a9d6c3722 | ||
|
|
66df5eca03 | ||
|
|
ddb158c5c1 | ||
|
|
07122dd2fe | ||
|
|
0244061515 | ||
|
|
da58a91d1e | ||
|
|
890f1e0413 | ||
|
|
17ac3720f1 | ||
|
|
5d1e034a12 | ||
|
|
0769f505bf | ||
|
|
b4a50ceefb | ||
|
|
992611b689 | ||
|
|
98a7bdec4e | ||
|
|
89d11649a1 | ||
|
|
1b1e88674a | ||
|
|
361a637174 | ||
|
|
88534c50aa | ||
|
|
3484e0b160 | ||
|
|
e4d9b5b76a | ||
|
|
4f1580cc0e | ||
|
|
d5a69afa5a | ||
|
|
0a192aca50 | ||
|
|
8424160345 | ||
|
|
0745c0fb6a | ||
|
|
94476c648b | ||
|
|
0cc1279e03 | ||
|
|
6a1580f88c | ||
|
|
f8552faa09 | ||
|
|
9fa95594c2 | ||
|
|
10e3193373 | ||
|
|
eeab6957dd | ||
|
|
5cb1b68d39 | ||
|
|
0b11d1c815 | ||
|
|
582a46a59e | ||
|
|
6e51e19b1c | ||
|
|
0ad78a688c | ||
|
|
026f7cea77 | ||
|
|
b605cac79e | ||
|
|
84a1bcca6f | ||
|
|
3bad53fa04 | ||
|
|
cce6b43463 | ||
|
|
2ca3eb5660 | ||
|
|
7ffa0c85de | ||
|
|
404e82e070 | ||
|
|
601a433b1a | ||
|
|
e0d4d34f10 | ||
|
|
36336fcddc | ||
|
|
4e8ae08b00 | ||
|
|
b28fc5710a | ||
|
|
45bd1f2bd4 | ||
|
|
7d9d434826 | ||
|
|
f3cf973e8e | ||
|
|
035aac43b0 | ||
|
|
b67c2dce8b | ||
|
|
c4c304950d | ||
|
|
9cd2c42e84 | ||
|
|
c62cc7678d | ||
|
|
52c479d578 | ||
|
|
b4b31403c7 | ||
|
|
2a28599343 | ||
|
|
3e87c8b0a4 | ||
|
|
db8df01c85 | ||
|
|
240d82f8be | ||
|
|
8569c2f5a6 | ||
|
|
5d6f858235 | ||
|
|
0df25a7340 | ||
|
|
2ddcc6334b | ||
|
|
f3281e8275 | ||
|
|
0d2d965364 | ||
|
|
16e761e59c | ||
|
|
69e15442f3 | ||
|
|
da509e32c6 | ||
|
|
9af407729b | ||
|
|
4db36eb09e | ||
|
|
0700eab8a2 | ||
|
|
a49c4e5247 | ||
|
|
392e0483a3 | ||
|
|
c86663335b | ||
|
|
23ce65d25d | ||
|
|
f38eee0739 | ||
|
|
d24b276820 | ||
|
|
94a402305c | ||
|
|
c4ef01fc66 | ||
|
|
ab4db657db | ||
|
|
856fd82ea3 | ||
|
|
39f3aa0871 | ||
|
|
6514105007 | ||
|
|
6ca69537f1 | ||
|
|
f0a5ba7542 | ||
|
|
e1716b8507 | ||
|
|
7c1df0a430 | ||
|
|
bb4465f392 | ||
|
|
72abc29722 | ||
|
|
e2f3718d39 | ||
|
|
fc1970acef | ||
|
|
e1303ef099 | ||
|
|
942029fd93 | ||
|
|
4a3322df1e | ||
|
|
dae3ee9f67 | ||
|
|
dbf80031ae | ||
|
|
bc507f672d | ||
|
|
72b0f2b68e | ||
|
|
993bf0e515 | ||
|
|
8ed7b81403 | ||
|
|
8254df1a06 | ||
|
|
e9cf55cc94 | ||
|
|
91e86ba6cf | ||
|
|
f98553bae1 | ||
|
|
cfef7f1bd8 | ||
|
|
b306607ad6 | ||
|
|
b8cc52bf1a | ||
|
|
e27124ab39 | ||
|
|
c5a419970e | ||
|
|
2413cb8673 | ||
|
|
2e4e0c0779 | ||
|
|
2e4d044cab | ||
|
|
a3c3059fe2 | ||
|
|
8b38f49a8a | ||
|
|
389c47248b | ||
|
|
d00dea3052 | ||
|
|
0caa0b4ebf | ||
|
|
207a03b377 | ||
|
|
1b0c3b01de | ||
|
|
1421a264e4 | ||
|
|
218c0c1db3 | ||
|
|
f2214c2e6b | ||
|
|
ed6526f002 | ||
|
|
25c58709e3 | ||
|
|
285bbef159 | ||
|
|
063ab49603 | ||
|
|
9af1aedcdb | ||
|
|
5ccb982332 | ||
|
|
de3c86120c | ||
|
|
f8e0055a6a | ||
|
|
353477f47a | ||
|
|
af1ca9bcc1 | ||
|
|
daae6d966a | ||
|
|
958b2c0c9b | ||
|
|
4a1c2d9693 | ||
|
|
9dcb1af2f6 | ||
|
|
c4bce4857e | ||
|
|
b52e7334f6 | ||
|
|
a4efd4eec7 | ||
|
|
fa1d18385d | ||
|
|
79778f6588 | ||
|
|
a432ff43a2 | ||
|
|
2d94e261ec | ||
|
|
01e6909180 | ||
|
|
57423076e6 | ||
|
|
2a2e451ddc | ||
|
|
990e28dc96 | ||
|
|
49aedf4231 | ||
|
|
190d5495fe | ||
|
|
50c657bc09 | ||
|
|
cad1cfe17c | ||
|
|
1fe80f80f5 | ||
|
|
a6f4fca72c | ||
|
|
f9cf5c799d | ||
|
|
9e17f7d9bc | ||
|
|
ac08ef624c | ||
|
|
fbb674707e | ||
|
|
541e651e4c | ||
|
|
a46830b232 | ||
|
|
f0b7fefbf4 | ||
|
|
245cfdf3d6 | ||
|
|
e372004b4d | ||
|
|
66f97e6820 | ||
|
|
58842f9679 | ||
|
|
ec31193812 | ||
|
|
646e5a8a11 | ||
|
|
b8841f1ba2 | ||
|
|
d1c281a055 | ||
|
|
61c15bdefb | ||
|
|
e89bbaee14 | ||
|
|
e8ce2e0864 | ||
|
|
7a0478e1e4 | ||
|
|
7ab9d7cad9 | ||
|
|
09854f57dc | ||
|
|
98dbe91270 | ||
|
|
0f53df8f71 | ||
|
|
8515d3d58d | ||
|
|
c0a1cba11b | ||
|
|
efa618ecba | ||
|
|
3a606240f7 | ||
|
|
9ef93dbbdc | ||
|
|
68bf3f2846 | ||
|
|
81543310fd | ||
|
|
5559c900c0 | ||
|
|
b42a48cc44 | ||
|
|
1f80a10b4e | ||
|
|
e2befdef6a | ||
|
|
310f606b72 | ||
|
|
26658432fb | ||
|
|
7284c9a0cd | ||
|
|
6f4ba6144a | ||
|
|
1c73ce8eb5 | ||
|
|
b397bfd7db | ||
|
|
cc2437425b | ||
|
|
b09fde7723 | ||
|
|
2c0a4e1e74 | ||
|
|
d830d36074 | ||
|
|
378da4d61b | ||
|
|
c869c2c811 | ||
|
|
cd5f2ee23c | ||
|
|
a9d5b25304 | ||
|
|
e328bf25f0 | ||
|
|
cdd8f123cc | ||
|
|
eb2b9d6b96 | ||
|
|
846970366b | ||
|
|
efa4ddcc88 | ||
|
|
2edf19d601 | ||
|
|
77e3964ca9 | ||
|
|
766dc5c59d | ||
|
|
39ea562c07 | ||
|
|
ed16ad11ff | ||
|
|
12387ebc92 | ||
|
|
294079cbe0 | ||
|
|
2cdd2ae753 | ||
|
|
517e1c0525 | ||
|
|
1658c79eba | ||
|
|
9a648cc90b | ||
|
|
c04bd3cc97 | ||
|
|
c54275c6a7 | ||
|
|
49967cdb30 | ||
|
|
10acd811d0 | ||
|
|
553d868c25 | ||
|
|
a5ee9df541 | ||
|
|
eafbe8a056 | ||
|
|
36a6eec932 | ||
|
|
e5d7bc9f93 | ||
|
|
585a0172e7 | ||
|
|
5263a8044f | ||
|
|
50503c7ac3 | ||
|
|
c21e538bfb | ||
|
|
babb815cc0 | ||
|
|
c06073a949 | ||
|
|
bdb1288e9e | ||
|
|
ae7fe0b9ab | ||
|
|
025a279ce6 | ||
|
|
3da06c794e | ||
|
|
30959719ad | ||
|
|
231a43fc68 | ||
|
|
0fbb28ec39 | ||
|
|
bab2941338 | ||
|
|
575c3425ad | ||
|
|
f1372d29eb | ||
|
|
0dedd1ae9a | ||
|
|
df3337ce8a | ||
|
|
38ccf8532d | ||
|
|
7b99172528 | ||
|
|
13b0944e9b | ||
|
|
83f2144655 | ||
|
|
bdf7986e7c | ||
|
|
eadc3c0f91 | ||
|
|
ae79fdbc2d | ||
|
|
c773d10b65 | ||
|
|
2093c6380d | ||
|
|
3d1dd07d54 | ||
|
|
995c831c5e | ||
|
|
cbda81a01d | ||
|
|
4bf3b585ef | ||
|
|
e238603c37 | ||
|
|
45d48291f9 | ||
|
|
ff95aa6d36 | ||
|
|
d90c9a2564 | ||
|
|
8e2bba9e02 | ||
|
|
8c2b9fa744 | ||
|
|
64586cd185 | ||
|
|
e16eaed09c | ||
|
|
f12c7db429 | ||
|
|
bf5a12db42 | ||
|
|
12fc3eaf63 | ||
|
|
49597877a4 | ||
|
|
991c2fcae7 | ||
|
|
4ea16c0603 | ||
|
|
377add7ae9 | ||
|
|
a51ada6706 | ||
|
|
ef663e333e | ||
|
|
be09b20a40 | ||
|
|
9ca2364694 | ||
|
|
3dc1bc2ded | ||
|
|
1a2219ec26 | ||
|
|
b6f097f729 | ||
|
|
d3e320fee7 | ||
|
|
830d5fccf4 | ||
|
|
4132b1d552 | ||
|
|
f9bdeb62e2 | ||
|
|
e728ed7a36 | ||
|
|
a644fb05a7 | ||
|
|
86d8c0aa26 | ||
|
|
fb096fff78 | ||
|
|
14ecb539df | ||
|
|
09271951d9 | ||
|
|
7bac07bf12 | ||
|
|
0f413b2207 | ||
|
|
97f8ec4b60 | ||
|
|
1e6b5b4884 | ||
|
|
ae19bf6f15 | ||
|
|
e885a8bf41 | ||
|
|
0b7d4ed792 | ||
|
|
10a094f0e6 | ||
|
|
f8b77c44f1 | ||
|
|
048990944f | ||
|
|
d3c7eff53d | ||
|
|
0248dd9aeb | ||
|
|
7e0b499ee7 | ||
|
|
f19caa5e67 | ||
|
|
0a1f68edeb | ||
|
|
8f870c297d | ||
|
|
f66a2b08a2 | ||
|
|
485cd80811 | ||
|
|
a9a7b22443 | ||
|
|
3cd2e503c6 | ||
|
|
fe7936c603 | ||
|
|
252dbc9fad | ||
|
|
5df6c2372d | ||
|
|
ca3cebbaef | ||
|
|
4425702a6a | ||
|
|
968c8bbc00 | ||
|
|
8f0d62cb92 | ||
|
|
0c6a271f97 | ||
|
|
3bddd467c4 | ||
|
|
4df84bf859 | ||
|
|
748fda3834 | ||
|
|
aa91179eac | ||
|
|
03c3c9be67 | ||
|
|
c3f4ac0b6e | ||
|
|
a93881b109 | ||
|
|
4924e49ad0 | ||
|
|
687244b90e | ||
|
|
9abc855552 | ||
|
|
10d15cbe44 | ||
|
|
0fd8be5d0c | ||
|
|
26b208d8b7 | ||
|
|
8b014d7f5d | ||
|
|
ea1978896e | ||
|
|
c9327685dd | ||
|
|
65d05c1d92 | ||
|
|
ca5e7d184e | ||
|
|
b9b1ca30ca | ||
|
|
10e75a71da | ||
|
|
051dd5a4ab | ||
|
|
6afd256e98 | ||
|
|
d86e4d914c | ||
|
|
1e2f298f94 | ||
|
|
8a26fdea23 | ||
|
|
23071bcba5 | ||
|
|
68fef83ed9 | ||
|
|
2f272d519f | ||
|
|
6f8c66880e | ||
|
|
45ff6e2745 | ||
|
|
fb18e856e4 | ||
|
|
315123fa3e | ||
|
|
6a3477c29f | ||
|
|
6533b6e023 | ||
|
|
268ef884d8 | ||
|
|
4614871092 | ||
|
|
feb9dce665 | ||
|
|
52a19f25d5 | ||
|
|
f26914b93a | ||
|
|
079b4346bc | ||
|
|
6f52592267 | ||
|
|
8ff1f254f3 | ||
|
|
211de3b963 | ||
|
|
ec84a6bdbf | ||
|
|
0a945a1770 | ||
|
|
6aa6a0a768 | ||
|
|
4d5fc18f58 | ||
|
|
e7b699d653 | ||
|
|
327184fbee | ||
|
|
ce1546eb90 | ||
|
|
971d851844 | ||
|
|
bd17e2a5d6 | ||
|
|
101f09a3d1 | ||
|
|
bf0fab9aa1 | ||
|
|
f4253a7cdd | ||
|
|
34d59e71d6 | ||
|
|
60fa0600c0 | ||
|
|
60cddeb849 | ||
|
|
21d66837a0 | ||
|
|
411dcf5666 | ||
|
|
87581b8188 | ||
|
|
1bf1a14d71 | ||
|
|
4f4428185b | ||
|
|
2a46aeece8 | ||
|
|
83e9cd5e36 | ||
|
|
a1e9878b31 | ||
|
|
0c0f304e8d | ||
|
|
e54fb0bf95 | ||
|
|
1536192e92 | ||
|
|
321ad51314 | ||
|
|
132b5fdd6d | ||
|
|
fc5dc4fa19 | ||
|
|
021da085a7 | ||
|
|
e2816648d8 | ||
|
|
6c0e1fc72e | ||
|
|
0ba6826d20 | ||
|
|
a21a01c60d | ||
|
|
353332b015 | ||
|
|
adfd23393c | ||
|
|
dae4474117 | ||
|
|
8ece7fef15 | ||
|
|
62aaa7e7c1 | ||
|
|
8443e529e9 | ||
|
|
5d20b7e662 | ||
|
|
79ecd1b16e | ||
|
|
f1418c76a8 | ||
|
|
9a6b8dca7e | ||
|
|
db838bdb73 | ||
|
|
ba82ddf6ca | ||
|
|
1aea5fa182 | ||
|
|
afa937e62b | ||
|
|
73de982473 | ||
|
|
cdc8ac3eb1 | ||
|
|
3a63184474 | ||
|
|
61e51f98e2 | ||
|
|
720e161083 | ||
|
|
e673a1764a | ||
|
|
16ed1f5387 | ||
|
|
a2d19e1981 | ||
|
|
6e8b69d35f | ||
|
|
6e075fcfae | ||
|
|
2e7b76b28c | ||
|
|
f25c071eb7 | ||
|
|
59c1a252d5 | ||
|
|
c7fbf2961a | ||
|
|
3cba8db08f | ||
|
|
3a65ef478b | ||
|
|
8629988742 | ||
|
|
d07a0a6479 | ||
|
|
6a8b33d3cd | ||
|
|
995a3e14ee | ||
|
|
dc5db14a33 | ||
|
|
b28e287f93 | ||
|
|
99313388cc | ||
|
|
0747ad2b12 | ||
|
|
eea7215525 | ||
|
|
a2e6a9dd47 | ||
|
|
018fc42974 | ||
|
|
7311830680 | ||
|
|
35c4719638 | ||
|
|
65d0317346 | ||
|
|
5eb84ff97f | ||
|
|
dedc42e268 | ||
|
|
2ae181c7b8 | ||
|
|
59a3938b2e | ||
|
|
49dcbfbf13 | ||
|
|
5557fd2217 | ||
|
|
2fb0831aeb | ||
|
|
ba0ce39b70 | ||
|
|
b22e883a5f | ||
|
|
aa026fbf36 | ||
|
|
8a418b2bb8 | ||
|
|
5f33883e0e | ||
|
|
213a72aaea | ||
|
|
da5a1fe760 | ||
|
|
0ca44258fc | ||
|
|
c87530727a |
790
BUILDING.txt
Normal file
@@ -0,0 +1,790 @@
|
||||
*******************************************************************************
|
||||
** Building on Un*x Platforms (including Cygwin and OS X)
|
||||
*******************************************************************************
|
||||
|
||||
|
||||
==================
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- autoconf 2.56 or later
|
||||
-- automake 1.7 or later
|
||||
-- libtool 1.4 or later
|
||||
* If using Xcode 4.3 or later on OS X, autoconf and automake are no longer
|
||||
provided. The easiest way to obtain them is from MacPorts
|
||||
(http://www.macports.org/).
|
||||
|
||||
-- NASM (if building x86 or x86-64 SIMD extensions)
|
||||
* 0.98, or 2.01 or later is required for a 32-bit build
|
||||
* NASM 2.00 or later is required for a 64-bit build
|
||||
* NASM 2.07 or later is required for a 64-bit build on OS X. This can be
|
||||
obtained from MacPorts (http://www.macports.org/).
|
||||
|
||||
The binary RPMs released by the NASM project do not work on older Linux
|
||||
systems, such as Red Hat Enterprise Linux 4. On such systems, you can
|
||||
easily build and install NASM from a source RPM by downloading one of the
|
||||
SRPMs from
|
||||
|
||||
http://www.nasm.us/pub/nasm/releasebuilds
|
||||
|
||||
and executing the following as root:
|
||||
|
||||
ARCH=`uname -m`
|
||||
rpmbuild --rebuild nasm-{version}.src.rpm
|
||||
rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
|
||||
|
||||
NOTE: the NASM build will fail if texinfo is not installed.
|
||||
|
||||
-- GCC v4.1 or later recommended for best performance
|
||||
* Beginning with Xcode 4, Apple stopped distributing GCC and switched to
|
||||
the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end
|
||||
called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor
|
||||
the LLVM (clang) compiler produces optimal performance with libjpeg-turbo.
|
||||
Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance
|
||||
degradation when compressing using 64-bit code, relative to building
|
||||
libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang)
|
||||
results in a 20% performance degradation when compressing using 64-bit
|
||||
code, relative to building libjpeg-turbo with GCC v4.2. If you are
|
||||
running Snow Leopard or earlier, it is suggested that you continue to use
|
||||
Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it
|
||||
is suggested that you install Apple GCC v4.2 through MacPorts.
|
||||
|
||||
-- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
|
||||
required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
|
||||
Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and
|
||||
later, it will be necessary to install the Java Developer Package, which can
|
||||
be downloaded from http://connect.apple.com. For systems that do not have a
|
||||
JDK installed, you can obtain the Oracle Java Development Kit from
|
||||
http://www.java.com.
|
||||
|
||||
|
||||
==================
|
||||
Out-of-Tree Builds
|
||||
==================
|
||||
|
||||
Binary objects, libraries, and executables are generated in the same directory
|
||||
from which configure was executed (the "binary directory"), and this directory
|
||||
need not necessarily be the same as the libjpeg-turbo source directory. You
|
||||
can create multiple independent binary directories, in which different versions
|
||||
of libjpeg-turbo can be built from the same source tree using different
|
||||
compilers or settings. In the sections below, {build_directory} refers to the
|
||||
binary directory, whereas {source_directory} refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
======================
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and
|
||||
Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
|
||||
for 64-bit build instructions.)
|
||||
|
||||
cd {source_directory}
|
||||
autoreconf -fiv
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
NOTE: Running autoreconf in the source directory is usually only necessary if
|
||||
building libjpeg-turbo from the SVN repository.
|
||||
|
||||
This will generate the following files under .libs/
|
||||
|
||||
libjpeg.a
|
||||
Static link library for the libjpeg API
|
||||
|
||||
libjpeg.so.{version} (Linux, Unix)
|
||||
libjpeg.{version}.dylib (OS X)
|
||||
cygjpeg-{version}.dll (Cygwin)
|
||||
Shared library for the libjpeg API
|
||||
|
||||
By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether
|
||||
libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
|
||||
{version} is 62, 7, or 8.
|
||||
|
||||
libjpeg.so (Linux, Unix)
|
||||
libjpeg.dylib (OS X)
|
||||
Development symlink for the libjpeg API
|
||||
|
||||
libjpeg.dll.a (Cygwin)
|
||||
Import library for the libjpeg API
|
||||
|
||||
libturbojpeg.a
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
libturbojpeg.so.0.0.0 (Linux, Unix)
|
||||
libturbojpeg.0.0.0.dylib (OS X)
|
||||
cygturbojpeg-0.dll (Cygwin)
|
||||
Shared library for the TurboJPEG API
|
||||
|
||||
libturbojpeg.so (Linux, Unix)
|
||||
libturbojpeg.dylib (OS X)
|
||||
Development symlink for the TurboJPEG API
|
||||
|
||||
libturbojpeg.dll.a (Cygwin)
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
|
||||
libjpeg v7 or v8 API/ABI Emulation
|
||||
----------------------------------
|
||||
|
||||
Add --with-jpeg7 to the configure command line to build a version of
|
||||
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
|
||||
the configure command to build a version of libjpeg-turbo that is
|
||||
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
|
||||
on libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the
|
||||
configure command line to build a version of libjpeg-turbo that lacks the
|
||||
jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
|
||||
the original libjpeg v6b and v7 APIs, so removing them ensures strict
|
||||
conformance with those APIs. See README-turbo.txt for more information.
|
||||
|
||||
|
||||
Arithmetic Coding Support
|
||||
-------------------------
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add --without-arith-enc or --without-arith-dec to the configure command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
TurboJPEG Java Wrapper
|
||||
----------------------
|
||||
Add --with-java to the configure command line to incorporate an optional Java
|
||||
Native Interface wrapper into the TurboJPEG shared library and build the Java
|
||||
front-end classes to support it. This allows the TurboJPEG shared library to
|
||||
be used directly from Java applications. See java/README for more details.
|
||||
|
||||
You can set the JAVAC, JAR, and JAVA configure variables to specify
|
||||
alternate commands for javac, jar, and java (respectively.) You can also
|
||||
set the JAVACFLAGS configure variable to specify arguments that should be
|
||||
passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
|
||||
to specify arguments that should be passed to the C compiler when building the
|
||||
JNI wrapper. Run 'configure --help' for more details.
|
||||
|
||||
|
||||
========================
|
||||
Installing libjpeg-turbo
|
||||
========================
|
||||
|
||||
If you intend to install these libraries and the associated header files, then
|
||||
replace 'make' in the instructions above with
|
||||
|
||||
make install prefix={base dir} libdir={library directory}
|
||||
|
||||
For example,
|
||||
|
||||
make install prefix=/usr/local libdir=/usr/local/lib64
|
||||
|
||||
will install the header files in /usr/local/include and the library files in
|
||||
/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
|
||||
is to install the header files in /opt/libjpeg-turbo/include and the library
|
||||
files in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64
|
||||
(64-bit.)
|
||||
|
||||
NOTE: You can specify a prefix of /usr and a libdir of, for instance,
|
||||
/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
|
||||
however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
|
||||
overwriting it. It is recommended that you instead install libjpeg-turbo into
|
||||
a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
|
||||
to force applications to use libjpeg-turbo instead of libjpeg. See
|
||||
README-turbo.txt for more information.
|
||||
|
||||
|
||||
=============
|
||||
Build Recipes
|
||||
=============
|
||||
|
||||
|
||||
32-bit Build on 64-bit Linux
|
||||
----------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Build on 64-bit OS X
|
||||
---------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm
|
||||
|
||||
to the configure command line. NASM 2.07 or later from MacPorts must be
|
||||
installed.
|
||||
|
||||
|
||||
32-bit Build on 64-bit OS X
|
||||
---------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Backward-Compatible Build on 64-bit OS X
|
||||
-----------------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4'
|
||||
|
||||
to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
|
||||
MacPorts, must be installed.
|
||||
|
||||
|
||||
32-bit Backward-Compatible Build on OS X
|
||||
----------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3 -m32' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -m32'
|
||||
|
||||
to the configure command line. The OS X 10.4 SDK must be installed.
|
||||
|
||||
|
||||
64-bit Library Build on 64-bit Solaris
|
||||
--------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
32-bit Build on 64-bit FreeBSD
|
||||
------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
|
||||
LDFLAGS='-B/usr/lib32'
|
||||
|
||||
to the configure command line. NASM 2.07 or later from FreeBSD ports must be
|
||||
installed.
|
||||
|
||||
|
||||
Oracle Solaris Studio
|
||||
---------------------
|
||||
|
||||
Add
|
||||
|
||||
CC=cc
|
||||
|
||||
to the configure command line. libjpeg-turbo will automatically be built with
|
||||
the maximum optimization level (-xO5) unless you override CFLAGS.
|
||||
|
||||
To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add
|
||||
|
||||
--host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
MinGW Build on Cygwin
|
||||
---------------------
|
||||
|
||||
Use CMake (see recipes below)
|
||||
|
||||
|
||||
===========
|
||||
ARM Support
|
||||
===========
|
||||
|
||||
This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
|
||||
JPEG compression/decompression by approximately 2-4x on ARMv7 and later
|
||||
platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
|
||||
build system will automatically include the NEON SIMD routines, if they are
|
||||
supported.
|
||||
|
||||
|
||||
Building libjpeg-turbo for iOS
|
||||
------------------------------
|
||||
|
||||
iOS platforms, such as the iPhone and iPad, also use ARM processors, some of
|
||||
which support NEON instructions. Additional steps are required to build
|
||||
libjpeg-turbo for these platforms. The steps below assume iOS SDK v4.3. If
|
||||
you are using a different SDK version, then you will need to modify the
|
||||
examples accordingly.
|
||||
|
||||
Additional build requirements:
|
||||
|
||||
gas-preprocessor.pl (https://github.com/yuvi/gas-preprocessor) should be
|
||||
installed in your PATH.
|
||||
|
||||
Set the following shell variables for simplicity:
|
||||
|
||||
Xcode 3.2.x / iOS 4.3 SDK:
|
||||
IOS_PLATFORMDIR="/Developer/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk"
|
||||
IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
|
||||
|
||||
Xcode 4.5.x / iOS 6.0 SDK:
|
||||
IOS_PLATFORMDIR="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS6.0.sdk"
|
||||
IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
|
||||
|
||||
ARM v6 only (up to and including iPhone 3G):
|
||||
[NOTE: Requires Xcode 4.4.x or earlier]
|
||||
IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
|
||||
|
||||
ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
|
||||
IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
|
||||
|
||||
ARM v7s only (iPhone 5, iPad 4th Generation):
|
||||
[NOTE: Requires Xcode 4.5 or later]
|
||||
IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
|
||||
|
||||
Follow the procedure under "Building libjpeg-turbo" above, adding
|
||||
|
||||
--host arm-apple-darwin10 --enable-static --disable-shared \
|
||||
CC="$IOS_GCC" LD="$IOS_GCC" \
|
||||
CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
|
||||
LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
|
||||
|
||||
to the configure command line.
|
||||
|
||||
Once built, lipo can be used to combine the ARM v6, v7, and/or v7s variants
|
||||
into a universal library.
|
||||
|
||||
NOTE: If you are building libjpeg-turbo from the "official" project tarball,
|
||||
then it is highly likely that you will need to run 'autoreconf -fiv' in the
|
||||
source tree prior to building ARM v7 or v7s iOS binaries using the techniques
|
||||
described above. Otherwise, you may get a libtool error such as "unable to
|
||||
infer tagged configuration."
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Building on Windows (Visual C++ or MinGW)
|
||||
*******************************************************************************
|
||||
|
||||
|
||||
==================
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- CMake (http://www.cmake.org) v2.6 or later
|
||||
|
||||
-- Microsoft Visual C++ 2005 or later
|
||||
|
||||
If you don't already have Visual C++, then the easiest way to get it is by
|
||||
installing the Windows SDK:
|
||||
|
||||
http://msdn.microsoft.com/en-us/windows/bb980924.aspx
|
||||
|
||||
The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
|
||||
everything necessary to build libjpeg-turbo.
|
||||
|
||||
* For 32-bit builds, you can also use Microsoft Visual C++ Express
|
||||
Edition. Visual C++ Express Edition is a free download.
|
||||
* If you intend to build libjpeg-turbo from the command line, then add the
|
||||
appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
|
||||
environment variables. This is generally accomplished by executing
|
||||
vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
|
||||
vcvars64.bat are part of Visual C++ and are located in the same directory
|
||||
as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
|
||||
optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
|
||||
environment.
|
||||
|
||||
... OR ...
|
||||
|
||||
-- MinGW
|
||||
|
||||
GCC v4.1 or later recommended for best performance
|
||||
|
||||
-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
|
||||
a 64-bit build)
|
||||
|
||||
-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
|
||||
can be downloaded from http://www.java.com.
|
||||
|
||||
|
||||
==================
|
||||
Out-of-Tree Builds
|
||||
==================
|
||||
|
||||
Binary objects, libraries, and executables are generated in the same directory
|
||||
from which cmake was executed (the "binary directory"), and this directory need
|
||||
not necessarily be the same as the libjpeg-turbo source directory. You can
|
||||
create multiple independent binary directories, in which different versions of
|
||||
libjpeg-turbo can be built from the same source tree using different compilers
|
||||
or settings. In the sections below, {build_directory} refers to the binary
|
||||
directory, whereas {source_directory} refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
======================
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
|
||||
Visual C++ (Command Line)
|
||||
-------------------------
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
|
||||
nmake
|
||||
|
||||
This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
|
||||
on which version of cl.exe is in the PATH.
|
||||
|
||||
The following files will be generated under {build_directory}:
|
||||
|
||||
jpeg-static.lib
|
||||
Static link library for the libjpeg API
|
||||
sharedlib/jpeg{version}.dll
|
||||
DLL for the libjpeg API
|
||||
sharedlib/jpeg.lib
|
||||
Import library for the libjpeg API
|
||||
turbojpeg-static.lib
|
||||
Static link library for the TurboJPEG API
|
||||
turbojpeg.dll
|
||||
DLL for the TurboJPEG API
|
||||
turbojpeg.lib
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
Visual C++ (IDE)
|
||||
----------------
|
||||
|
||||
Choose the appropriate CMake generator option for your version of Visual Studio
|
||||
(run "cmake" with no arguments for a list of available generators.) For
|
||||
instance:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "Visual Studio 9 2008" {source_directory}
|
||||
|
||||
You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
|
||||
configurations in that project ("Debug", "Release", etc.) to generate a full
|
||||
build of libjpeg-turbo.
|
||||
|
||||
This will generate the following files under {build_directory}:
|
||||
|
||||
{configuration}/jpeg-static.lib
|
||||
Static link library for the libjpeg API
|
||||
sharedlib/{configuration}/jpeg{version}.dll
|
||||
DLL for the libjpeg API
|
||||
sharedlib/{configuration}/jpeg.lib
|
||||
Import library for the libjpeg API
|
||||
{configuration}/turbojpeg-static.lib
|
||||
Static link library for the TurboJPEG API
|
||||
{configuration}/turbojpeg.dll
|
||||
DLL for the TurboJPEG API
|
||||
{configuration}/turbojpeg.lib
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
|
||||
the configuration you built in the IDE, and {version} is 62, 7, or 8,
|
||||
depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
|
||||
|
||||
|
||||
MinGW
|
||||
-----
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "MSYS Makefiles" {source_directory}
|
||||
make
|
||||
|
||||
This will generate the following files under {build_directory}
|
||||
|
||||
libjpeg.a
|
||||
Static link library for the libjpeg API
|
||||
sharedlib/libjpeg-{version}.dll
|
||||
DLL for the libjpeg API
|
||||
sharedlib/libjpeg.dll.a
|
||||
Import library for the libjpeg API
|
||||
libturbojpeg.a
|
||||
Static link library for the TurboJPEG API
|
||||
libturbojpeg.dll
|
||||
DLL for the TurboJPEG API
|
||||
libturbojpeg.dll.a
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
Debug Build
|
||||
-----------
|
||||
|
||||
Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
|
||||
NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
|
||||
NMake.)
|
||||
|
||||
|
||||
libjpeg v7 or v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
|
||||
Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
|
||||
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
|
||||
to the cmake command to build a version of libjpeg-turbo that is
|
||||
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
|
||||
on libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
|
||||
CMake command line to build a version of libjpeg-turbo that lacks the
|
||||
jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
|
||||
the original libjpeg v6b and v7 APIs, so removing them ensures strict
|
||||
conformance with those APIs. See README-turbo.txt for more information.
|
||||
|
||||
|
||||
Arithmetic Coding Support
|
||||
-------------------------
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
TurboJPEG Java Wrapper
|
||||
----------------------
|
||||
Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
|
||||
Native Interface wrapper into the TurboJPEG shared library and build the Java
|
||||
front-end classes to support it. This allows the TurboJPEG shared library to
|
||||
be used directly from Java applications. See java/README for more details.
|
||||
|
||||
If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
|
||||
Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
|
||||
alternate commands or locations for javac, jar, and java (respectively.) If
|
||||
you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
|
||||
instead. You can also set the JAVACFLAGS CMake variable to specify arguments
|
||||
that should be passed to the Java compiler when building the front-end classes.
|
||||
|
||||
|
||||
========================
|
||||
Installing libjpeg-turbo
|
||||
========================
|
||||
|
||||
You can use the build system to install libjpeg-turbo into a directory of your
|
||||
choosing (as opposed to creating an installer.) To do this, add:
|
||||
|
||||
-DCMAKE_INSTALL_PREFIX={install_directory}
|
||||
|
||||
to the cmake command line.
|
||||
|
||||
For example,
|
||||
|
||||
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
|
||||
nmake install
|
||||
|
||||
will install the header files in c:\libjpeg-turbo\include, the library files
|
||||
in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
|
||||
documentation in c:\libjpeg-turbo\doc.
|
||||
|
||||
|
||||
=============
|
||||
Build Recipes
|
||||
=============
|
||||
|
||||
|
||||
64-bit MinGW Build on Cygwin
|
||||
----------------------------
|
||||
|
||||
cd {build_directory}
|
||||
CC=/usr/bin/x86_64-w64-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
|
||||
-DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
|
||||
make
|
||||
|
||||
This produces a 64-bit build of libjpeg-turbo that does not depend on
|
||||
cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
|
||||
mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
|
||||
|
||||
|
||||
32-bit MinGW Build on Cygwin
|
||||
----------------------------
|
||||
|
||||
cd {build_directory}
|
||||
CC=/usr/bin/i686-w64-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
|
||||
-DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
|
||||
make
|
||||
|
||||
This produces a 32-bit build of libjpeg-turbo that does not depend on
|
||||
cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
|
||||
mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
|
||||
|
||||
|
||||
MinGW-w64 Build on Windows
|
||||
--------------------------
|
||||
|
||||
This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
|
||||
toolchain (which is faster than the Cygwin version):
|
||||
|
||||
cd {build_directory}
|
||||
CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
|
||||
cmake -G "MSYS Makefiles" \
|
||||
-DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
|
||||
-DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
|
||||
MinGW Build on Linux
|
||||
--------------------
|
||||
|
||||
cd {build_directory}
|
||||
CC={mingw_binary_path}/i386-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
|
||||
-DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Creating Release Packages
|
||||
*******************************************************************************
|
||||
|
||||
The following commands can be used to create various types of release packages:
|
||||
|
||||
|
||||
Unix/Linux
|
||||
----------
|
||||
|
||||
make rpm
|
||||
|
||||
Create Red Hat-style binary RPM package. Requires RPM v4 or later.
|
||||
|
||||
make srpm
|
||||
|
||||
This runs 'make dist' to create a pristine source tarball, then creates a
|
||||
Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
|
||||
|
||||
make deb
|
||||
|
||||
Create Debian-style binary package. Requires dpkg.
|
||||
|
||||
make dmg
|
||||
|
||||
Create Macintosh package/disk image. This requires the PackageMaker
|
||||
application, which must be installed in /Developer/Applications/Utilities.
|
||||
Note that PackageMaker is not included in recent releases of Xcode, but it
|
||||
can be obtained by downloading the "Auxiliary Tools for Xcode" package from
|
||||
http://developer.apple.com/downloads.
|
||||
|
||||
make udmg [BUILDDIR32={32-bit build directory}]
|
||||
|
||||
On 64-bit OS X systems, this creates a Macintosh package and disk image that
|
||||
contains universal i386/x86-64 binaries. You should first configure a 32-bit
|
||||
out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
|
||||
build, then run 'make udmg' from the 64-bit build directory. The build
|
||||
system will look for the 32-bit build under {source_directory}/osxx86 by
|
||||
default, but you can override this by setting the BUILDDIR32 variable on the
|
||||
make command line as shown above.
|
||||
|
||||
make iosdmg [BUILDDIR32={32-bit build directory}] \
|
||||
[BUILDDIRARMV6={ARM v6 build directory}] \
|
||||
[BUILDDIRARMV7={ARM v7 build directory}] \
|
||||
[BUILDDIRARMV7S={ARM v7s build directory}]
|
||||
|
||||
On OS X systems, this creates a Macintosh package and disk image in which the
|
||||
libjpeg-turbo static libraries contain ARM architectures necessary to build
|
||||
iOS applications. If building on an x86-64 system, the binaries will also
|
||||
contain the i386 architecture, as with 'make udmg' above. You should first
|
||||
configure ARM v6, ARM v7, and/or ARM v7s out-of-tree builds of libjpeg-turbo
|
||||
(see "Building libjpeg-turbo for iOS" above.) If you are building an x86-64
|
||||
version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
|
||||
well. Next, build libjpeg-turbo as you would normally, using an out-of-tree
|
||||
build. When it is built, run 'make iosdmg' from the build directory. The
|
||||
build system will look for the ARM v6 build under {source_directory}/iosarmv6
|
||||
by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
|
||||
the ARM v7s build under {source_directory}/iosarmv7s by default, and (if
|
||||
applicable) the 32-bit build under {source_directory}/osxx86 by default, but
|
||||
you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
|
||||
BUILDDIRARMV7, and/or BUILDDIRARMV7S variables on the make command line as
|
||||
shown above.
|
||||
|
||||
make cygwinpkg
|
||||
|
||||
Build a Cygwin binary package.
|
||||
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If using NMake:
|
||||
|
||||
cd {build_directory}
|
||||
nmake installer
|
||||
|
||||
If using MinGW:
|
||||
|
||||
cd {build_directory}
|
||||
make installer
|
||||
|
||||
If using the Visual Studio IDE, build the "installer" project.
|
||||
|
||||
The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
|
||||
{build_directory}. If building using the Visual Studio IDE, then the installer
|
||||
package will be located in a subdirectory with the same name as the
|
||||
configuration you built (such as {build_directory}\Debug\ or
|
||||
{build_directory}\Release\).
|
||||
|
||||
Building a Windows installer requires the Nullsoft Install System
|
||||
(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Regression testing
|
||||
*******************************************************************************
|
||||
|
||||
The most common way to test libjpeg-turbo is by invoking 'make test' on
|
||||
Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
|
||||
completed. This runs a series of tests to ensure that mathematical
|
||||
compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
|
||||
also invokes the TurboJPEG unit tests, which ensure that the colorspace
|
||||
extensions, YUV encoding, decompression scaling, and other features of the
|
||||
TurboJPEG C and Java APIs are working properly (and, by extension, that the
|
||||
equivalent features of the underlying libjpeg API are also working.)
|
||||
|
||||
Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
|
||||
the 'testclean' target (if using the Visual Studio IDE) will clean up the
|
||||
output images generated by 'make test'.
|
||||
|
||||
On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java
|
||||
wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
|
||||
essentially iterate through all of the available features of the TurboJPEG APIs
|
||||
that are not covered by the TurboJPEG unit tests (this includes the lossless
|
||||
transform options) and compare the images generated by each feature to images
|
||||
generated using the equivalent feature in the libjpeg API. The extended
|
||||
TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
|
||||
not in the underlying libjpeg API library.
|
||||
146
CHANGELOG
@@ -1,146 +0,0 @@
|
||||
CHANGELOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 4A 18-Feb-93
|
||||
--------------------
|
||||
|
||||
Substantial speedup for grayscale output from color JPEG file (suppress
|
||||
processing of chrominance components). Lesser speedups in Huffman decoding
|
||||
and in compression quantization.
|
||||
|
||||
Can switch stdin/stdout to binary mode with either fdopen() or setmode();
|
||||
this allows use of one-file command line style on a wider range of systems.
|
||||
Also added -outfile switch so that makefile test scripts don't have to depend
|
||||
on the command line style.
|
||||
|
||||
New makefile.icc for Code Builder; makefile.sas is updated for SAS C 6.x.
|
||||
|
||||
Hook added to allow surrounding application to read and write COM (comment)
|
||||
blocks.
|
||||
|
||||
Bugfixes (DOS only): jmemdos.c code for accessing expanded memory only worked
|
||||
if struct fields are packed on byte boundaries. This is not true by default
|
||||
for Microsoft C. Furthermore, Microsoft C needs an _fheapmin() call to clean
|
||||
up the far heap correctly.
|
||||
|
||||
|
||||
Version 4 10-Dec-92
|
||||
--------------------
|
||||
|
||||
Revised user interface: switches now use names instead of single letters.
|
||||
(Old switch letters are acceptable abbreviations of new switch names, EXCEPT
|
||||
for djpeg's old -g, -D, -1 switches.) cjpeg has several new switches.
|
||||
|
||||
Provision for smoothing the input image added to cjpeg. This helps a lot with
|
||||
converting dithered GIFs to JPEG.
|
||||
|
||||
Decoder upsampling now uses interpolation instead of pixel replication; this
|
||||
improves rendering of sharp colored edges.
|
||||
|
||||
The decompressor will now try to continue after detecting an error in the
|
||||
compressed data, instead of just aborting. If the input file has restart
|
||||
markers, full synchronization will usually be regained at the next undamaged
|
||||
restart marker. (But you're still out of luck if any of the header markers
|
||||
are corrupt.)
|
||||
|
||||
Substantial improvements in speed; DCT accuracy improved too.
|
||||
|
||||
Numerous minor changes to improve portability. egetopt.c, which was by far
|
||||
the worst portability problem, is gone altogether.
|
||||
|
||||
A few bugfixes, sigh (mostly affecting DOS implementations only).
|
||||
Bugfix: on DOS machines, cjpeg -o would fail on grayscale input files.
|
||||
Bugfix: one-pass quantization to more than 64 color levels would fail on
|
||||
16-bit-int machines. This could only happen with quantized grayscale output.
|
||||
|
||||
A couple of changes affect code that calls the JPEG subroutine library:
|
||||
|
||||
1. The parameter struct tag names are now capitalized (Compress_info_struct,
|
||||
Compress_methods_struct, Decompress_info_struct, Decompress_methods_struct,
|
||||
and External_methods_struct). This makes it easier to live with brain-damaged
|
||||
compilers with short identifier lengths. (All identifiers used in the JPEG
|
||||
code are now unique within the first 16 characters.)
|
||||
|
||||
2. If you are not calling jselerror(), you need to initialize three new fields
|
||||
in the emethods structure, typically as follows:
|
||||
e_methods.num_warnings = 0; /* no warnings emitted yet */
|
||||
e_methods.first_warning_level = 0; /* display first corrupt-data warning */
|
||||
e_methods.more_warning_level = 3; /* but suppress additional ones */
|
||||
These fields control handling of corrupt-data warnings.
|
||||
|
||||
|
||||
Version 3 17-Mar-92
|
||||
--------------------
|
||||
|
||||
Memory manager is finally capable of swapping to temp files. There are
|
||||
separate versions of jmemsys.c for no temp files (same behavior as older
|
||||
versions), simple temp files with or without tmpfile(), and a DOS-specific
|
||||
version (including special code for EMS and XMS). This is probably much more
|
||||
system-dependent than any of the older code; some bugs may surface here.
|
||||
|
||||
Hooks added for user interface to install progress monitoring routine
|
||||
(percent-done bar, etc). See comments with dummy progress_monitor
|
||||
routines in jcdeflts.c, jddeflts.c.
|
||||
|
||||
Two-pass color quantization (finally!). This is now the default method when
|
||||
quantizing; say '-1' to djpeg for quick-and-ugly 1-pass method. There is
|
||||
a test file for checking 2-pass quantization and GIF output.
|
||||
|
||||
Fixed bug in jcopy_block_row that broke cjpeg -o option and djpeg -b option
|
||||
on MSDOS machines.
|
||||
|
||||
Miscellaneous small speedups; notably, DCT computation rearranged so that
|
||||
GCC "inline" feature is no longer needed for good code quality.
|
||||
|
||||
File config.c renamed ckconfig.c to avoid name conflict with /etc/config
|
||||
on Unix systems.
|
||||
|
||||
Added example.c to document usage of JPEG subroutines better.
|
||||
|
||||
Memory manager now knows how to release all storage during error exit ---
|
||||
avoids memory leak when using JPEG as subroutines. This implies a couple
|
||||
small changes to the subroutine interface: the old free_defaults subroutines
|
||||
are no longer needed, but if you have a replacement error_exit method then it
|
||||
must call the new free_all method. Also, jselvirtmem renamed to jselmemmgr.
|
||||
|
||||
Code for reading Targa files with 32-bit pixels was incorrect.
|
||||
|
||||
Colorspace conversion slightly faster and more accurate; because of
|
||||
this, old "test" files will no longer match bit-for-bit.
|
||||
|
||||
|
||||
Version 2 13-Dec-91
|
||||
--------------------
|
||||
|
||||
Documentation improved a little --- there are man pages now.
|
||||
Installation instructions moved from README to a separate file SETUP.
|
||||
|
||||
New program config.c is provided to help you get the configuration options
|
||||
right. This should make installation a lot more foolproof.
|
||||
|
||||
Sense of djpeg -D switch reversed: dithering is now ON by default.
|
||||
|
||||
RLE image file support added (thanks to Mike Lijewski).
|
||||
|
||||
Targa image file support added (thanks to Lee Crocker).
|
||||
|
||||
PPM input now accepts all PPM and PGM files.
|
||||
|
||||
Bug fix: on machines where 'int' is 16 bits, high-Q-setting JPEG files
|
||||
were not decoded correctly.
|
||||
|
||||
Numerous changes to improve portability. There should be few or no compiler
|
||||
warnings now.
|
||||
|
||||
Makefiles cleaned up; defaults now appropriate for production use rather than
|
||||
debugging.
|
||||
|
||||
Subroutine interface cleaned up. If you wrote code based on version 1's
|
||||
jcmain/jdmain, you'll need to change it, but it should get a little shorter
|
||||
and simpler.
|
||||
|
||||
|
||||
Version 1 7-Oct-91
|
||||
--------------------
|
||||
|
||||
Initial public release.
|
||||
493
CMakeLists.txt
Normal file
@@ -0,0 +1,493 @@
|
||||
#
|
||||
# Setup
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
project(libjpeg-turbo C)
|
||||
set(VERSION 1.3.0)
|
||||
|
||||
if(MINGW OR CYGWIN)
|
||||
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
|
||||
string(REGEX REPLACE "\n" "" BUILD ${BUILD})
|
||||
elseif(WIN32)
|
||||
execute_process(COMMAND "wmic.exe" "os" "get" "LocalDateTime" OUTPUT_VARIABLE
|
||||
BUILD)
|
||||
string(REGEX REPLACE "[^0-9]" "" BUILD "${BUILD}")
|
||||
if (BUILD STREQUAL "")
|
||||
execute_process(COMMAND "cmd.exe" "/C" "DATE" "/T" OUTPUT_VARIABLE BUILD)
|
||||
string(REGEX REPLACE ".*[ ]([0-9]*)[/.]([0-9]*)[/.]([0-9]*).*" "\\3\\2\\1" BUILD "${BUILD}")
|
||||
else()
|
||||
string(SUBSTRING "${BUILD}" 0 8 BUILD)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
|
||||
endif()
|
||||
|
||||
# This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning
|
||||
# in Visual Studio, and it always defaults to Debug when using NMake.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# This only works if building from the command line. There is currently no way
|
||||
# to set a variable's value based on the build type when using Visual Studio.
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(BUILD "${BUILD}d")
|
||||
endif()
|
||||
|
||||
message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||
|
||||
option(WITH_SIMD "Include SIMD extensions" TRUE)
|
||||
option(WITH_ARITH_ENC "Include arithmetic encoding support" TRUE)
|
||||
option(WITH_ARITH_DEC "Include arithmetic decoding support" TRUE)
|
||||
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
|
||||
option(WITH_JAVA "Build Java wrapper for the TurboJPEG library" FALSE)
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(C_ARITH_CODING_SUPPORTED 1)
|
||||
message(STATUS "Arithmetic encoding support enabled")
|
||||
else()
|
||||
message(STATUS "Arithmetic encoding support disabled")
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
set(D_ARITH_CODING_SUPPORTED 1)
|
||||
message(STATUS "Arithmetic decoding support enabled")
|
||||
else()
|
||||
message(STATUS "Arithmetic decoding support disabled")
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
message(STATUS "TurboJPEG Java wrapper enabled")
|
||||
else()
|
||||
message(STATUS "TurboJPEG Java wrapper disabled")
|
||||
endif()
|
||||
|
||||
set(SO_AGE 0)
|
||||
if(WITH_MEM_SRCDST)
|
||||
set(SO_AGE 1)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIB_VERSION 62)
|
||||
set(DLL_VERSION ${JPEG_LIB_VERSION})
|
||||
set(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0)
|
||||
if(WITH_JPEG8)
|
||||
set(JPEG_LIB_VERSION 80)
|
||||
set(DLL_VERSION 8)
|
||||
set(FULLVERSION ${DLL_VERSION}.0.2)
|
||||
message(STATUS "Emulating libjpeg v8 API/ABI")
|
||||
elseif(WITH_JPEG7)
|
||||
set(JPEG_LIB_VERSION 70)
|
||||
set(DLL_VERSION 7)
|
||||
set(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0)
|
||||
message(STATUS "Emulating libjpeg v7 API/ABI")
|
||||
endif(WITH_JPEG8)
|
||||
|
||||
if(WITH_MEM_SRCDST)
|
||||
set(MEM_SRCDST_SUPPORTED 1)
|
||||
message(STATUS "In-memory source/destination managers enabled")
|
||||
else()
|
||||
message(STATUS "In-memory source/destination managers disabled")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# Use the static C library for all build types
|
||||
foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
if(${var} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_definitions(-W3 -wd4996)
|
||||
endif()
|
||||
|
||||
# Detect whether compiler is 64-bit
|
||||
if(MSVC AND CMAKE_CL_64)
|
||||
set(SIMD_X86_64 1)
|
||||
set(64BIT 1)
|
||||
elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||
set(SIMD_X86_64 1)
|
||||
set(64BIT 1)
|
||||
endif()
|
||||
|
||||
if(64BIT)
|
||||
message(STATUS "64-bit build")
|
||||
else()
|
||||
message(STATUS "32-bit build")
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
if(MSVC)
|
||||
set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME})
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME}-gcc)
|
||||
endif()
|
||||
if(64BIT)
|
||||
set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX_DEFAULT}64)
|
||||
endif()
|
||||
set(CMAKE_INSTALL_PREFIX "c:/${CMAKE_INSTALL_PREFIX_DEFAULT}" CACHE PATH
|
||||
"Directory into which to install libjpeg-turbo (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
configure_file(win/jconfig.h.in jconfig.h)
|
||||
configure_file(win/config.h.in config.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
|
||||
|
||||
if(WITH_JAVA)
|
||||
find_package(Java)
|
||||
find_package(JNI)
|
||||
if(DEFINED JAVACFLAGS)
|
||||
message(STATUS "Java compiler flags = ${JAVACFLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Targets
|
||||
#
|
||||
|
||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
|
||||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
|
||||
endif()
|
||||
|
||||
if(WITH_SIMD)
|
||||
add_definitions(-DWITH_SIMD)
|
||||
add_subdirectory(simd)
|
||||
if(SIMD_X86_64)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_x86_64.c)
|
||||
else()
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_i386.c)
|
||||
endif()
|
||||
# This tells CMake that the "source" files haven't been generated yet
|
||||
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
|
||||
else()
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
|
||||
message(STATUS "Not using SIMD acceleration")
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
add_subdirectory(java)
|
||||
endif()
|
||||
|
||||
add_subdirectory(sharedlib)
|
||||
|
||||
add_library(jpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
if(NOT MSVC)
|
||||
set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg)
|
||||
endif()
|
||||
if(WITH_SIMD)
|
||||
add_dependencies(jpeg-static simd)
|
||||
endif()
|
||||
|
||||
set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(WITH_JAVA)
|
||||
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
|
||||
include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
|
||||
endif()
|
||||
|
||||
add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})
|
||||
set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)
|
||||
if(MINGW)
|
||||
set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)
|
||||
endif()
|
||||
target_link_libraries(turbojpeg jpeg-static)
|
||||
set_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
||||
|
||||
add_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}
|
||||
turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(NOT MSVC)
|
||||
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
|
||||
endif()
|
||||
if(WITH_SIMD)
|
||||
add_dependencies(turbojpeg-static simd)
|
||||
endif()
|
||||
|
||||
add_executable(tjunittest tjunittest.c tjutil.c)
|
||||
target_link_libraries(tjunittest turbojpeg)
|
||||
|
||||
add_executable(tjunittest-static tjunittest.c tjutil.c)
|
||||
target_link_libraries(tjunittest-static turbojpeg-static)
|
||||
|
||||
add_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
wrppm.c)
|
||||
target_link_libraries(tjbench turbojpeg jpeg-static)
|
||||
set_property(TARGET tjbench PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
|
||||
add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
wrppm.c)
|
||||
target_link_libraries(tjbench-static turbojpeg-static jpeg-static)
|
||||
set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
|
||||
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c
|
||||
rdtarga.c)
|
||||
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
target_link_libraries(cjpeg-static jpeg-static)
|
||||
|
||||
add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrbmp.c wrgif.c
|
||||
wrppm.c wrtarga.c)
|
||||
set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
target_link_libraries(djpeg-static jpeg-static)
|
||||
|
||||
add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c)
|
||||
target_link_libraries(jpegtran-static jpeg-static)
|
||||
set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "-DUSE_SETMODE")
|
||||
|
||||
add_executable(rdjpgcom rdjpgcom.c)
|
||||
|
||||
add_executable(wrjpgcom rdjpgcom.c)
|
||||
|
||||
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/")
|
||||
else()
|
||||
set(OBJDIR "")
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
set(MD5_JPEG_INT 9a68f56bc76e466aa7e52f415d0f4a5f)
|
||||
set(MD5_JPEG_FAST 0e1502e7fa421835e376a314fac2a39f)
|
||||
set(MD5_JPEG_FAST_100 7bf72a8e741d64eecb960c97323af77c)
|
||||
set(MD5_JPEG_FLOAT d1623885ffafcd40c684af09e3d65cd5)
|
||||
set(MD5_JPEG_FLOAT_NOSIMD fb4884c35f8273f498cb32879de5c455)
|
||||
set(MD5_JPEG_INT_GRAY 72b51f894b8f4a10b3ee3066770aa38d)
|
||||
set(MD5_PPM_INT d1ed0d11f076b842525271647716aeb8)
|
||||
set(MD5_PPM_FAST 048298a2d2410261c0533cb97bcfef23)
|
||||
set(MD5_PPM_FLOAT 7f5b446ee36b2630e06785b8d42af15f)
|
||||
set(MD5_PPM_FLOAT_NOSIMD 64072f1dbdc5b3a187777788604971a5)
|
||||
set(MD5_PPM_INT_2_1 9f9de8c0612f8d06869b960b05abf9c9)
|
||||
set(MD5_PPM_INT_15_8 b6875bc070720b899566cc06459b63b7)
|
||||
set(MD5_PPM_INT_7_4 06a177eae05f164fac57f7a2c346ee87)
|
||||
set(MD5_PPM_INT_13_8 bc3452573c8152f6ae552939ee19f82f)
|
||||
set(MD5_PPM_INT_3_2 f5a8b88a8a7f96016f04d259cf82ed67)
|
||||
set(MD5_PPM_INT_11_8 d8cc73c0aaacd4556569b59437ba00a5)
|
||||
set(MD5_PPM_INT_5_4 32775dd9ad2ab90f4c5b219b53e0c86c)
|
||||
set(MD5_PPM_INT_9_8 d25e61bc7eac0002f5b393aa223747b6)
|
||||
set(MD5_PPM_INT_7_8 ddb564b7c74a09494016d6cd7502a946)
|
||||
set(MD5_PPM_INT_3_4 8ed8e68808c3fbc4ea764fc9d2968646)
|
||||
set(MD5_PPM_INT_5_8 a3363274999da2366a024efae6d16c9b)
|
||||
set(MD5_PPM_INT_1_2 e692a315cea26b988c8e8b29a5dbcd81)
|
||||
set(MD5_PPM_INT_3_8 79eca9175652ced755155c90e785a996)
|
||||
set(MD5_PPM_INT_1_4 79cd778f8bf1a117690052cacdd54eca)
|
||||
set(MD5_PPM_INT_1_8 391b3d4aca640c8567d6f8745eb2142f)
|
||||
set(MD5_PPM_FAST_1_2 f30bcf6d32ccd44cbdd9aeaacbd9454f)
|
||||
set(MD5_BMP_256 4980185e3776e89bd931736e1cddeee6)
|
||||
set(MD5_JPEG_ARI e986fb0a637a8d833d96e8a6d6d84ea1)
|
||||
set(MD5_PPM_ARI 72b59a99bcf1de24c5b27d151bde2437)
|
||||
set(MD5_JPEG_PROG 1c4afddc05c0a43489ee54438a482d92)
|
||||
set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)
|
||||
|
||||
if(WITH_JAVA)
|
||||
add_test(TJUnitTest ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest)
|
||||
add_test(TJUnitTest-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -yuv)
|
||||
add_test(TJUnitTest-bi ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi)
|
||||
add_test(TJUnitTest-bi-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi -yuv)
|
||||
endif()
|
||||
add_test(tjunittest tjunittest)
|
||||
add_test(tjunittest-alloc tjunittest -alloc)
|
||||
add_test(tjunittest-yuv tjunittest -yuv)
|
||||
add_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutint.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-fast sharedlib/cjpeg -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST} -DFILE=testoutfst.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-fast-100 sharedlib/cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-fast-100-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST_100} -DFILE=testoutfst100.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-float sharedlib/cjpeg -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
if(WITH_SIMD)
|
||||
add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
else()
|
||||
add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT_NOSIMD} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
add_test(cjpeg-int-gray sharedlib/cjpeg -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-int-gray-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT_GRAY} -DFILE=testoutgray.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-int sharedlib/djpeg -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT} -DFILE=testoutint.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-fast sharedlib/djpeg -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST} -DFILE=testoutfst.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-float sharedlib/djpeg -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
if(WITH_SIMD)
|
||||
add_test(djpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
else()
|
||||
add_test(djpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT_NOSIMD} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
foreach(scale 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)
|
||||
string(REGEX REPLACE "_" "/" scalearg ${scale})
|
||||
add_test(djpeg-int-${scale} sharedlib/djpeg -dct int -nosmooth -scale ${scalearg} -ppm -outfile testoutint${scale}.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-int-${scale}-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT_${scale}} -DFILE=testoutint${scale}.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endforeach()
|
||||
add_test(djpeg-fast-1_2 sharedlib/djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-fast-1_2-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST_1_2} -DFILE=testoutfst1_2.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-256 sharedlib/djpeg -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-256-cmp ${CMAKE_COMMAND} -DMD5=${MD5_BMP_256} -DFILE=testout.bmp -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-prog sharedlib/cjpeg -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_PROG} -DFILE=testoutp.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(jpegtran-prog sharedlib/jpegtran -outfile testoutt.jpg testoutp.jpg)
|
||||
add_test(jpegtran-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
if(WITH_ARITH_ENC)
|
||||
add_test(cjpeg-ari sharedlib/cjpeg -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testoutari.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake )
|
||||
add_test(jpegtran-toari sharedlib/jpegtran -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)
|
||||
add_test(jpegtran-toari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg-ari sharedlib/djpeg -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
|
||||
add_test(djpeg-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_ARI} -DFILE=testoutari.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(jpegtran-fromari sharedlib/jpegtran -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
|
||||
add_test(jpegtran-fromari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
add_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(jpegtran-crop-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testoutcrop.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
|
||||
add_test(tjunittest-static tjunittest-static)
|
||||
add_test(tjunittest-static-alloc tjunittest-static -alloc)
|
||||
add_test(tjunittest-static-yuv tjunittest-static -yuv)
|
||||
add_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-static-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutint.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-static-fast cjpeg-static -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-static-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST} -DFILE=testoutfst.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-static-fast-100 cjpeg-static -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-static-fast-100-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST_100} -DFILE=testoutfst100.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-static-float cjpeg-static -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
if(WITH_SIMD)
|
||||
add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
else()
|
||||
add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT_NOSIMD} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
add_test(cjpeg-static-int-gray cjpeg-static -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-static-int-gray-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT_GRAY} -DFILE=testoutgray.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-static-int djpeg-static -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-static-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT} -DFILE=testoutint.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-static-fast djpeg-static -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-static-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST} -DFILE=testoutfst.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-static-float djpeg-static -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
if(WITH_SIMD)
|
||||
add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
else()
|
||||
add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT_NOSIMD} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
foreach(scale 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)
|
||||
string(REGEX REPLACE "_" "/" scalearg ${scale})
|
||||
add_test(djpeg-static-int-${scale} djpeg-static -dct int -nosmooth -scale ${scalearg} -ppm -outfile testoutint${scale}.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-static-int-${scale}-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT_${scale}} -DFILE=testoutint${scale}.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endforeach()
|
||||
add_test(djpeg-static-fast-1_2 djpeg-static -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-static-fast-1_2-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST_1_2} -DFILE=testoutfst1_2.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(djpeg-static-256 djpeg-static -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(djpeg-static-256-cmp ${CMAKE_COMMAND} -DMD5=${MD5_BMP_256} -DFILE=testout.bmp -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(cjpeg-static-prog cjpeg-static -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-static-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_PROG} -DFILE=testoutp.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(jpegtran-static-prog jpegtran-static -outfile testoutt.jpg testoutp.jpg)
|
||||
add_test(jpegtran-static-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
if(WITH_ARITH_ENC)
|
||||
add_test(cjpeg-static-ari cjpeg-static -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
add_test(cjpeg-static-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testoutari.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake )
|
||||
add_test(jpegtran-static-toari jpegtran-static -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)
|
||||
add_test(jpegtran-static-toari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg-static-ari djpeg-static -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
|
||||
add_test(djpeg-static-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_ARI} -DFILE=testoutari.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
add_test(jpegtran-static-fromari jpegtran-static -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
|
||||
add_test(jpegtran-static-fromari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
add_test(jpegtran-static-crop jpegtran-static -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
add_test(jpegtran-static-crop-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testoutcrop.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
|
||||
add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P
|
||||
${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake)
|
||||
|
||||
|
||||
#
|
||||
# Installer
|
||||
#
|
||||
|
||||
if(MSVC)
|
||||
set(INST_PLATFORM "Visual C++")
|
||||
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc)
|
||||
set(INST_REG_NAME ${CMAKE_PROJECT_NAME})
|
||||
elseif(MINGW)
|
||||
set(INST_PLATFORM GCC)
|
||||
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc)
|
||||
set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-gcc)
|
||||
set(INST_DEFS -DGCC)
|
||||
endif()
|
||||
|
||||
if(64BIT)
|
||||
set(INST_PLATFORM "${INST_PLATFORM} 64-bit")
|
||||
set(INST_NAME ${INST_NAME}64)
|
||||
set(INST_REG_NAME ${INST_DIR}64)
|
||||
set(INST_DEFS ${INST_DEFS} -DWIN64)
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
set(INST_DEFS ${INST_DEFS} -DJAVA)
|
||||
endif()
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\")
|
||||
else()
|
||||
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=")
|
||||
endif()
|
||||
|
||||
STRING(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
configure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY)
|
||||
|
||||
if(WITH_JAVA)
|
||||
set(JAVA_DEPEND java)
|
||||
endif()
|
||||
add_custom_target(installer
|
||||
makensis -nocd ${INST_DEFS} libjpeg-turbo.nsi
|
||||
DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom
|
||||
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
|
||||
SOURCES libjpeg-turbo.nsi)
|
||||
|
||||
install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt
|
||||
${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt
|
||||
${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt
|
||||
${CMAKE_SOURCE_DIR}/wizard.txt
|
||||
DESTINATION doc)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h
|
||||
${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h
|
||||
${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include)
|
||||
418
ChangeLog.txt
Normal file
@@ -0,0 +1,418 @@
|
||||
1.3.0
|
||||
=====
|
||||
|
||||
[1] 'make test' now works properly on FreeBSD, and it no longer requires the
|
||||
md5sum executable to be present on other Un*x platforms.
|
||||
|
||||
[2] Overhauled the packaging system:
|
||||
-- To avoid conflict with vendor-supplied libjpeg-turbo packages, the
|
||||
official RPMs and DEBs for libjpeg-turbo have been renamed to
|
||||
"libjpeg-turbo-official".
|
||||
-- The TurboJPEG libraries are now located under /opt/libjpeg-turbo in the
|
||||
official Linux and Mac packages, to avoid conflict with vendor-supplied
|
||||
packages and also to streamline the packaging system.
|
||||
-- Release packages are now created with the directory structure defined
|
||||
by the configure variables "prefix", "bindir", "libdir", etc. (Un*x) or by the
|
||||
CMAKE_INSTALL_PREFIX variable (Windows.) The exception is that the docs are
|
||||
always located under the system default documentation directory on Un*x and Mac
|
||||
systems, and on Windows, the TurboJPEG DLL is always located in the Windows
|
||||
system directory.
|
||||
-- To avoid confusion, official libjpeg-turbo packages on Linux/Unix platforms
|
||||
(except for Mac) will always install the 32-bit libraries in
|
||||
/opt/libjpeg-turbo/lib32 and the 64-bit libraries in /opt/libjpeg-turbo/lib64.
|
||||
-- Fixed an issue whereby, in some cases, the libjpeg-turbo executables on Un*x
|
||||
systems were not properly linking with the shared libraries installed by the
|
||||
same package.
|
||||
-- Fixed an issue whereby building the "installer" target on Windows when
|
||||
WITH_JAVA=1 would fail if the TurboJPEG JAR had not been previously built.
|
||||
-- Building the "install" target on Windows now installs files into the same
|
||||
places that the installer does.
|
||||
|
||||
[3] Fixed a Huffman encoder bug that prevented I/O suspension from working
|
||||
properly.
|
||||
|
||||
|
||||
1.2.90 (1.3 beta1)
|
||||
==================
|
||||
|
||||
[1] Added support for additional scaling factors (3/8, 5/8, 3/4, 7/8, 9/8, 5/4,
|
||||
11/8, 3/2, 13/8, 7/4, 15/8, and 2) when decompressing. Note that the IDCT will
|
||||
not be SIMD-accelerated when using any of these new scaling factors.
|
||||
|
||||
[2] The TurboJPEG dynamic library is now versioned. It was not strictly
|
||||
necessary to do so, because TurboJPEG uses versioned symbols, and if a function
|
||||
changes in an ABI-incompatible way, that function is renamed and a legacy
|
||||
function is provided to maintain backward compatibility. However, certain
|
||||
Linux distro maintainers have a policy against accepting any library that isn't
|
||||
versioned.
|
||||
|
||||
[3] Extended the TurboJPEG Java API so that it can be used to compress a JPEG
|
||||
image from and decompress a JPEG image to an arbitrary position in a large
|
||||
image buffer.
|
||||
|
||||
[4] The tjDecompressToYUV() function now supports the TJFLAG_FASTDCT flag.
|
||||
|
||||
[5] The 32-bit supplementary package for amd64 Debian systems now provides
|
||||
symlinks in /usr/lib/i386-linux-gnu for the TurboJPEG libraries in /usr/lib32.
|
||||
This allows those libraries to be used on MultiArch-compatible systems (such as
|
||||
Ubuntu 11 and later) without setting the linker path.
|
||||
|
||||
[6] The TurboJPEG Java wrapper should now find the JNI library on Mac systems
|
||||
without having to pass -Djava.library.path=/usr/lib to java.
|
||||
|
||||
[7] TJBench has been ported to Java to provide a convenient way of validating
|
||||
the performance of the TurboJPEG Java API. It can be run with
|
||||
'java -cp turbojpeg.jar TJBench'.
|
||||
|
||||
[8] cjpeg can now be used to generate JPEG files with the RGB colorspace
|
||||
(feature ported from jpeg-8d.)
|
||||
|
||||
[9] The width and height in the -crop argument passed to jpegtran can now be
|
||||
suffixed with "f" to indicate that, when the upper left corner of the cropping
|
||||
region is automatically moved to the nearest iMCU boundary, the bottom right
|
||||
corner should be moved by the same amount. In other words, this feature causes
|
||||
jpegtran to strictly honor the specified width/height rather than the specified
|
||||
bottom right corner (feature ported from jpeg-8d.)
|
||||
|
||||
[10] JPEG files using the RGB colorspace can now be decompressed into grayscale
|
||||
images (feature ported from jpeg-8d.)
|
||||
|
||||
[11] Fixed a regression caused by 1.2.1[7] whereby the build would fail with
|
||||
multiple "Mismatch in operand sizes" errors when attempting to build the x86
|
||||
SIMD code with NASM 0.98.
|
||||
|
||||
[12] The in-memory source/destination managers (jpeg_mem_src() and
|
||||
jpeg_mem_dest()) are now included by default when building libjpeg-turbo with
|
||||
libjpeg v6b or v7 emulation, so that programs can take advantage of these
|
||||
functions without requiring the use of the backward-incompatible libjpeg v8
|
||||
ABI. The "age number" of the libjpeg-turbo library on Un*x systems has been
|
||||
incremented by 1 to reflect this. You can disable this feature with a
|
||||
configure/CMake switch in order to retain strict API/ABI compatibility with the
|
||||
libjpeg v6b or v7 API/ABI (or with previous versions of libjpeg-turbo.) See
|
||||
README-turbo.txt for more details.
|
||||
|
||||
[13] Added ARM v7s architecture to libjpeg.a and libturbojpeg.a in the official
|
||||
libjpeg-turbo binary package for OS X, so that those libraries can be used to
|
||||
build applications that leverage the faster CPUs in the iPhone 5 and iPad 4.
|
||||
|
||||
|
||||
1.2.1
|
||||
=====
|
||||
|
||||
[1] Creating or decoding a JPEG file that uses the RGB colorspace should now
|
||||
properly work when the input or output colorspace is one of the libjpeg-turbo
|
||||
colorspace extensions.
|
||||
|
||||
[2] When libjpeg-turbo was built without SIMD support and merged (non-fancy)
|
||||
upsampling was used along with an alpha-enabled colorspace during
|
||||
decompression, the unused byte of the decompressed pixels was not being set to
|
||||
0xFF. This has been fixed. TJUnitTest has also been extended to test for the
|
||||
correct behavior of the colorspace extensions when merged upsampling is used.
|
||||
|
||||
[3] Fixed a bug whereby the libjpeg-turbo SSE2 SIMD code would not preserve the
|
||||
upper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64
|
||||
calling conventions.
|
||||
|
||||
[4] Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG
|
||||
images (specifically, images in which the component count was erroneously set
|
||||
to a large value) would cause libjpeg-turbo to segfault.
|
||||
|
||||
[5] Worked around a severe performance issue with "Bobcat" (AMD Embedded APU)
|
||||
processors. The MASKMOVDQU instruction, which was used by the libjpeg-turbo
|
||||
SSE2 SIMD code, is apparently implemented in microcode on AMD processors, and
|
||||
it is painfully slow on Bobcat processors in particular. Eliminating the use
|
||||
of this instruction improved performance by an order of magnitude on Bobcat
|
||||
processors and by a small amount (typically 5%) on AMD desktop processors.
|
||||
|
||||
[6] Added SIMD acceleration for performing 4:2:2 upsampling on NEON-capable ARM
|
||||
platforms. This speeds up the decompression of 4:2:2 JPEGs by 20-25% on such
|
||||
platforms.
|
||||
|
||||
[7] Fixed a regression caused by 1.2.0[2] whereby, on Linux/x86 platforms
|
||||
running the 32-bit SSE2 SIMD code in libjpeg-turbo, decompressing a 4:2:0 or
|
||||
4:2:2 JPEG image into a 32-bit (RGBX, BGRX, etc.) buffer without using fancy
|
||||
upsampling would produce several incorrect columns of pixels at the right-hand
|
||||
side of the output image if each row in the output image was not evenly
|
||||
divisible by 16 bytes.
|
||||
|
||||
[8] Fixed an issue whereby attempting to build the SIMD extensions with Xcode
|
||||
4.3 on OS X platforms would cause NASM to return numerous errors of the form
|
||||
"'%define' expects a macro identifier".
|
||||
|
||||
[9] Added flags to the TurboJPEG API that allow the caller to force the use of
|
||||
either the fast or the accurate DCT/IDCT algorithms in the underlying codec.
|
||||
|
||||
|
||||
1.2.0
|
||||
=====
|
||||
|
||||
[1] Fixed build issue with YASM on Unix systems (the libjpeg-turbo build system
|
||||
was not adding the current directory to the assembler include path, so YASM
|
||||
was not able to find jsimdcfg.inc.)
|
||||
|
||||
[2] Fixed out-of-bounds read in SSE2 SIMD code that occurred when decompressing
|
||||
a JPEG image to a bitmap buffer whose size was not a multiple of 16 bytes.
|
||||
This was more of an annoyance than an actual bug, since it did not cause any
|
||||
actual run-time problems, but the issue showed up when running libjpeg-turbo in
|
||||
valgrind. See http://crbug.com/72399 for more information.
|
||||
|
||||
[3] Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can be used to
|
||||
check the version of libjpeg-turbo against which an application was compiled.
|
||||
|
||||
[4] Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API)
|
||||
and pixel formats (TurboJPEG API), which allow applications to specify that,
|
||||
when decompressing to a 4-component RGB buffer, the unused byte should be set
|
||||
to 0xFF so that it can be interpreted as an opaque alpha channel.
|
||||
|
||||
[5] Fixed regression issue whereby DevIL failed to build against libjpeg-turbo
|
||||
because libjpeg-turbo's distributed version of jconfig.h contained an INLINE
|
||||
macro, which conflicted with a similar macro in DevIL. This macro is used only
|
||||
internally when building libjpeg-turbo, so it was moved into config.h.
|
||||
|
||||
[6] libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose
|
||||
K component is assigned a component ID of 1 instead of 4. Although these files
|
||||
are in violation of the spec, other JPEG implementations handle them
|
||||
correctly.
|
||||
|
||||
[7] Added ARM v6 and ARM v7 architectures to libjpeg.a and libturbojpeg.a in
|
||||
the official libjpeg-turbo binary package for OS X, so that those libraries can
|
||||
be used to build both OS X and iOS applications.
|
||||
|
||||
|
||||
1.1.90 (1.2 beta1)
|
||||
==================
|
||||
|
||||
[1] Added a Java wrapper for the TurboJPEG API. See java/README for more
|
||||
details.
|
||||
|
||||
[2] The TurboJPEG API can now be used to scale down images during
|
||||
decompression.
|
||||
|
||||
[3] Added SIMD routines for RGB-to-grayscale color conversion, which
|
||||
significantly improves the performance of grayscale JPEG compression from an
|
||||
RGB source image.
|
||||
|
||||
[4] Improved the performance of the C color conversion routines, which are used
|
||||
on platforms for which SIMD acceleration is not available.
|
||||
|
||||
[5] Added a function to the TurboJPEG API that performs lossless transforms.
|
||||
This function is implemented using the same back end as jpegtran, but it
|
||||
performs transcoding entirely in memory and allows multiple transforms and/or
|
||||
crop operations to be batched together, so the source coefficients only need to
|
||||
be read once. This is useful when generating image tiles from a single source
|
||||
JPEG.
|
||||
|
||||
[6] Added tests for the new TurboJPEG scaled decompression and lossless
|
||||
transform features to tjbench (the TurboJPEG benchmark, formerly called
|
||||
"jpgtest".)
|
||||
|
||||
[7] Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which
|
||||
was necessary in order for it to read 4:2:2 JPEG files that had been losslessly
|
||||
transposed or rotated 90 degrees.
|
||||
|
||||
[8] All legacy VirtualGL code has been re-factored, and this has allowed
|
||||
libjpeg-turbo, in its entirety, to be re-licensed under a BSD-style license.
|
||||
|
||||
[9] libjpeg-turbo can now be built with YASM.
|
||||
|
||||
[10] Added SIMD acceleration for ARM Linux and iOS platforms that support
|
||||
NEON instructions.
|
||||
|
||||
[11] Refactored the TurboJPEG C API and documented it using Doxygen. The
|
||||
TurboJPEG 1.2 API uses pixel formats to define the size and component order of
|
||||
the uncompressed source/destination images, and it includes a more efficient
|
||||
version of TJBUFSIZE() that computes a worst-case JPEG size based on the level
|
||||
of chrominance subsampling. The refactored implementation of the TurboJPEG API
|
||||
now uses the libjpeg memory source and destination managers, which allows the
|
||||
TurboJPEG compressor to grow the JPEG buffer as necessary.
|
||||
|
||||
[12] Eliminated errors in the output of jpegtran on Windows that occurred when
|
||||
the application was invoked using I/O redirection
|
||||
(jpegtran <input.jpg >output.jpg).
|
||||
|
||||
[13] The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding
|
||||
support in libjpeg-turbo v1.1.0 introduced several new error constants in
|
||||
jerror.h, and these were mistakenly enabled for all emulation modes, causing
|
||||
the error enum in libjpeg-turbo to sometimes have different values than the
|
||||
same enum in libjpeg. This represents an ABI incompatibility, and it caused
|
||||
problems with rare applications that took specific action based on a particular
|
||||
error value. The fix was to include the new error constants conditionally
|
||||
based on whether libjpeg v7 or v8 emulation was enabled.
|
||||
|
||||
[14] Fixed an issue whereby Windows applications that used libjpeg-turbo would
|
||||
fail to compile if the Windows system headers were included before jpeglib.h.
|
||||
This issue was caused by a conflict in the definition of the INT32 type.
|
||||
|
||||
[15] Fixed 32-bit supplementary package for amd64 Debian systems, which was
|
||||
broken by enhancements to the packaging system in 1.1.
|
||||
|
||||
[16] When decompressing a JPEG image using an output colorspace of
|
||||
JCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR, or JCS_EXT_XRGB, libjpeg-turbo will
|
||||
now set the unused byte to 0xFF, which allows applications to interpret that
|
||||
byte as an alpha channel (0xFF = opaque).
|
||||
|
||||
|
||||
1.1.1
|
||||
=====
|
||||
|
||||
[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated
|
||||
by tjEncodeYUV().
|
||||
|
||||
[2] libjpeg-turbo's accelerated Huffman decoder previously ignored unexpected
|
||||
markers found in the middle of the JPEG data stream during decompression. It
|
||||
will now hand off decoding of a particular block to the unaccelerated Huffman
|
||||
decoder if an unexpected marker is found, so that the unaccelerated Huffman
|
||||
decoder can generate an appropriate warning.
|
||||
|
||||
[3] Older versions of MinGW64 prefixed symbol names with underscores by
|
||||
default, which differed from the behavior of 64-bit Visual C++. MinGW64 1.0
|
||||
has adopted the behavior of 64-bit Visual C++ as the default, so to accommodate
|
||||
this, the libjpeg-turbo SIMD function names are no longer prefixed with an
|
||||
underscore when building with MinGW64. This means that, when building
|
||||
libjpeg-turbo with older versions of MinGW64, you will now have to add
|
||||
-fno-leading-underscore to the CFLAGS.
|
||||
|
||||
[4] Fixed a regression bug in the NSIS script that caused the Windows installer
|
||||
build to fail when using the Visual Studio IDE.
|
||||
|
||||
[5] Fixed a bug in jpeg_read_coefficients() whereby it would not initialize
|
||||
cinfo->image_width and cinfo->image_height if libjpeg v7 or v8 emulation was
|
||||
enabled. This specifically caused the jpegoptim program to fail if it was
|
||||
linked against a version of libjpeg-turbo that was built with libjpeg v7 or v8
|
||||
emulation.
|
||||
|
||||
[6] Eliminated excessive I/O overhead that occurred when reading BMP files in
|
||||
cjpeg.
|
||||
|
||||
[7] Eliminated errors in the output of cjpeg on Windows that occurred when the
|
||||
application was invoked using I/O redirection (cjpeg <inputfile >output.jpg).
|
||||
|
||||
|
||||
1.1.0
|
||||
=====
|
||||
|
||||
[1] The algorithm used by the SIMD quantization function cannot produce correct
|
||||
results when the JPEG quality is >= 98 and the fast integer forward DCT is
|
||||
used. Thus, the non-SIMD quantization function is now used for those cases,
|
||||
and libjpeg-turbo should now produce identical output to libjpeg v6b in all
|
||||
cases.
|
||||
|
||||
[2] Despite the above, the fast integer forward DCT still degrades somewhat for
|
||||
JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically
|
||||
use the slow integer forward DCT when generating JPEG images of quality 96 or
|
||||
greater. This reduces compression performance by as much as 15% for these
|
||||
high-quality images but is necessary to ensure that the images are perceptually
|
||||
lossless. It also ensures that the library can avoid the performance pitfall
|
||||
created by [1].
|
||||
|
||||
[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.
|
||||
|
||||
[4] Fixed visual artifacts in grayscale JPEG compression caused by a typo in
|
||||
the RGB-to-luminance lookup tables.
|
||||
|
||||
[5] The Windows distribution packages now include the libjpeg run-time programs
|
||||
(cjpeg, etc.)
|
||||
|
||||
[6] All packages now include jpgtest.
|
||||
|
||||
[7] The TurboJPEG dynamic library now uses versioned symbols.
|
||||
|
||||
[8] Added two new TurboJPEG API functions, tjEncodeYUV() and
|
||||
tjDecompressToYUV(), to replace the somewhat hackish TJ_YUV flag.
|
||||
|
||||
|
||||
1.0.90 (1.1 beta1)
|
||||
==================
|
||||
|
||||
[1] Added emulation of the libjpeg v7 and v8 APIs and ABIs. See
|
||||
README-turbo.txt for more details. This feature was sponsored by CamTrace SAS.
|
||||
|
||||
[2] Created a new CMake-based build system for the Visual C++ and MinGW builds.
|
||||
|
||||
[3] Grayscale bitmaps can now be compressed from/decompressed to using the
|
||||
TurboJPEG API.
|
||||
|
||||
[4] jpgtest can now be used to test decompression performance with existing
|
||||
JPEG images.
|
||||
|
||||
[5] If the default install prefix (/opt/libjpeg-turbo) is used, then
|
||||
'make install' now creates /opt/libjpeg-turbo/lib32 and
|
||||
/opt/libjpeg-turbo/lib64 sym links to duplicate the behavior of the binary
|
||||
packages.
|
||||
|
||||
[6] All symbols in the libjpeg-turbo dynamic library are now versioned, even
|
||||
when the library is built with libjpeg v6b emulation.
|
||||
|
||||
[7] Added arithmetic encoding and decoding support (can be disabled with
|
||||
configure or CMake options)
|
||||
|
||||
[8] Added a TJ_YUV flag to the TurboJPEG API, which causes both the compressor
|
||||
and decompressor to output planar YUV images.
|
||||
|
||||
[9] Added an extended version of tjDecompressHeader() to the TurboJPEG API,
|
||||
which allows the caller to determine the type of subsampling used in a JPEG
|
||||
image.
|
||||
|
||||
[10] Added further protections against invalid Huffman codes.
|
||||
|
||||
|
||||
1.0.1
|
||||
=====
|
||||
|
||||
[1] The Huffman decoder will now handle erroneous Huffman codes (for instance,
|
||||
from a corrupt JPEG image.) Previously, these would cause libjpeg-turbo to
|
||||
crash under certain circumstances.
|
||||
|
||||
[2] Fixed typo in SIMD dispatch routines that was causing 4:2:2 upsampling to
|
||||
be used instead of 4:2:0 when decompressing JPEG images using SSE2 code.
|
||||
|
||||
[3] configure script will now automatically determine whether the
|
||||
INCOMPLETE_TYPES_BROKEN macro should be defined.
|
||||
|
||||
|
||||
1.0.0
|
||||
=====
|
||||
|
||||
[1] 2983700: Further FreeBSD build tweaks (no longer necessary to specify
|
||||
--host when configuring on a 64-bit system)
|
||||
|
||||
[2] Created symlinks in the Unix/Linux packages so that the TurboJPEG
|
||||
include file can always be found in /opt/libjpeg-turbo/include, the 32-bit
|
||||
static libraries can always be found in /opt/libjpeg-turbo/lib32, and the
|
||||
64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64.
|
||||
|
||||
[3] The Unix/Linux distribution packages now include the libjpeg run-time
|
||||
programs (cjpeg, etc.) and man pages.
|
||||
|
||||
[4] Created a 32-bit supplementary package for amd64 Debian systems, which
|
||||
contains just the 32-bit libjpeg-turbo libraries.
|
||||
|
||||
[5] Moved the libraries from */lib32 to */lib in the i386 Debian package.
|
||||
|
||||
[6] Include distribution package for Cygwin
|
||||
|
||||
[7] No longer necessary to specify --without-simd on non-x86 architectures, and
|
||||
unit tests now work on those architectures.
|
||||
|
||||
|
||||
0.0.93
|
||||
======
|
||||
|
||||
[1] 2982659, Fixed x86-64 build on FreeBSD systems
|
||||
|
||||
[2] 2988188: Added support for Windows 64-bit systems
|
||||
|
||||
|
||||
0.0.91
|
||||
======
|
||||
|
||||
[1] Added documentation to .deb packages
|
||||
|
||||
[2] 2968313: Fixed data corruption issues when decompressing large JPEG images
|
||||
and/or using buffered I/O with the libjpeg-turbo decompressor
|
||||
|
||||
|
||||
0.0.90
|
||||
======
|
||||
|
||||
Initial release
|
||||
402
Makefile.am
Normal file
@@ -0,0 +1,402 @@
|
||||
lib_LTLIBRARIES = libjpeg.la
|
||||
libjpeg_la_LDFLAGS = -version-info ${LIBTOOL_CURRENT}:${SO_MINOR_VERSION}:${SO_AGE} -no-undefined
|
||||
include_HEADERS = jerror.h jmorecfg.h jpeglib.h
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
lib_LTLIBRARIES += libturbojpeg.la
|
||||
libturbojpeg_la_LDFLAGS = -version-info 0:0 -no-undefined
|
||||
include_HEADERS += turbojpeg.h
|
||||
endif
|
||||
|
||||
nodist_include_HEADERS = jconfig.h
|
||||
|
||||
|
||||
HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
|
||||
jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h
|
||||
|
||||
libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
|
||||
jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
|
||||
jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
|
||||
jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
|
||||
jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
|
||||
jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
|
||||
jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
|
||||
|
||||
if WITH_ARITH
|
||||
libjpeg_la_SOURCES += jaricom.c
|
||||
endif
|
||||
|
||||
if WITH_ARITH_ENC
|
||||
libjpeg_la_SOURCES += jcarith.c
|
||||
endif
|
||||
|
||||
if WITH_ARITH_DEC
|
||||
libjpeg_la_SOURCES += jdarith.c
|
||||
endif
|
||||
|
||||
|
||||
SUBDIRS = java
|
||||
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
|
||||
libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpeg.c turbojpeg.h \
|
||||
transupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c
|
||||
|
||||
if WITH_JAVA
|
||||
|
||||
libturbojpeg_la_SOURCES += turbojpeg-jni.c
|
||||
libturbojpeg_la_CFLAGS = ${JNI_CFLAGS}
|
||||
TJMAPFILE = turbojpeg-mapfile.jni
|
||||
|
||||
else
|
||||
|
||||
TJMAPFILE = turbojpeg-mapfile
|
||||
|
||||
endif
|
||||
|
||||
libturbojpeg_la_SOURCES += $(TJMAPFILE)
|
||||
|
||||
if VERSION_SCRIPT
|
||||
libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
if VERSION_SCRIPT
|
||||
libjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map
|
||||
endif
|
||||
|
||||
|
||||
if WITH_SIMD
|
||||
|
||||
SUBDIRS += simd
|
||||
libjpeg_la_LIBADD = simd/libsimd.la
|
||||
libturbojpeg_la_LIBADD = simd/libsimd.la
|
||||
|
||||
else
|
||||
|
||||
libjpeg_la_SOURCES += jsimd_none.c
|
||||
|
||||
endif
|
||||
|
||||
|
||||
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
noinst_PROGRAMS = jcstest
|
||||
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
|
||||
bin_PROGRAMS += tjbench
|
||||
|
||||
noinst_PROGRAMS += tjunittest
|
||||
|
||||
tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \
|
||||
wrbmp.c wrppm.c
|
||||
|
||||
tjbench_LDADD = libturbojpeg.la libjpeg.la -lm
|
||||
|
||||
tjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED
|
||||
|
||||
tjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c
|
||||
|
||||
tjunittest_LDADD = libturbojpeg.la
|
||||
|
||||
endif
|
||||
|
||||
|
||||
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
|
||||
rdppm.c rdswitch.c rdtarga.c
|
||||
|
||||
cjpeg_LDADD = libjpeg.la
|
||||
|
||||
cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
|
||||
djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
|
||||
wrbmp.c wrgif.c wrppm.c wrtarga.c
|
||||
|
||||
djpeg_LDADD = libjpeg.la
|
||||
|
||||
djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
|
||||
jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
|
||||
|
||||
jpegtran_LDADD = libjpeg.la
|
||||
|
||||
rdjpgcom_SOURCES = rdjpgcom.c
|
||||
|
||||
rdjpgcom_LDADD = libjpeg.la
|
||||
|
||||
wrjpgcom_SOURCES = wrjpgcom.c
|
||||
|
||||
wrjpgcom_LDADD = libjpeg.la
|
||||
|
||||
jcstest_SOURCES = jcstest.c
|
||||
|
||||
jcstest_LDADD = libjpeg.la
|
||||
|
||||
dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
|
||||
|
||||
DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.txt \
|
||||
ChangeLog.txt
|
||||
|
||||
docdir = $(datadir)/doc
|
||||
dist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \
|
||||
wizard.txt
|
||||
|
||||
exampledir = $(datadir)/doc
|
||||
dist_example_DATA = example.c
|
||||
|
||||
|
||||
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
|
||||
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
|
||||
jccolext.c jdcolext.c jdmrgext.c
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
|
||||
|
||||
SUBDIRS += md5
|
||||
|
||||
MD5_JPEG_INT = 9a68f56bc76e466aa7e52f415d0f4a5f
|
||||
MD5_JPEG_FAST = 0e1502e7fa421835e376a314fac2a39f
|
||||
MD5_JPEG_FAST_100 = 7bf72a8e741d64eecb960c97323af77c
|
||||
MD5_JPEG_FLOAT = d1623885ffafcd40c684af09e3d65cd5
|
||||
MD5_JPEG_FLOAT_NOSIMD = fb4884c35f8273f498cb32879de5c455
|
||||
MD5_JPEG_INT_GRAY = 72b51f894b8f4a10b3ee3066770aa38d
|
||||
MD5_PPM_INT = d1ed0d11f076b842525271647716aeb8
|
||||
MD5_PPM_FAST = 048298a2d2410261c0533cb97bcfef23
|
||||
MD5_PPM_FLOAT = 7f5b446ee36b2630e06785b8d42af15f
|
||||
MD5_PPM_FLOAT_NOSIMD = 64072f1dbdc5b3a187777788604971a5
|
||||
MD5_PPM_INT_2_1 = 9f9de8c0612f8d06869b960b05abf9c9
|
||||
MD5_PPM_INT_15_8 = b6875bc070720b899566cc06459b63b7
|
||||
MD5_PPM_INT_7_4 = 06a177eae05f164fac57f7a2c346ee87
|
||||
MD5_PPM_INT_13_8 = bc3452573c8152f6ae552939ee19f82f
|
||||
MD5_PPM_INT_3_2 = f5a8b88a8a7f96016f04d259cf82ed67
|
||||
MD5_PPM_INT_11_8 = d8cc73c0aaacd4556569b59437ba00a5
|
||||
MD5_PPM_INT_5_4 = 32775dd9ad2ab90f4c5b219b53e0c86c
|
||||
MD5_PPM_INT_9_8 = d25e61bc7eac0002f5b393aa223747b6
|
||||
MD5_PPM_INT_7_8 = ddb564b7c74a09494016d6cd7502a946
|
||||
MD5_PPM_INT_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646
|
||||
MD5_PPM_INT_5_8 = a3363274999da2366a024efae6d16c9b
|
||||
MD5_PPM_INT_1_2 = e692a315cea26b988c8e8b29a5dbcd81
|
||||
MD5_PPM_INT_3_8 = 79eca9175652ced755155c90e785a996
|
||||
MD5_PPM_INT_1_4 = 79cd778f8bf1a117690052cacdd54eca
|
||||
MD5_PPM_INT_1_8 = 391b3d4aca640c8567d6f8745eb2142f
|
||||
MD5_PPM_FAST_1_2 = f30bcf6d32ccd44cbdd9aeaacbd9454f
|
||||
MD5_BMP_256 = 4980185e3776e89bd931736e1cddeee6
|
||||
MD5_JPEG_ARI = e986fb0a637a8d833d96e8a6d6d84ea1
|
||||
MD5_PPM_ARI = 72b59a99bcf1de24c5b27d151bde2437
|
||||
MD5_JPEG_PROG = 1c4afddc05c0a43489ee54438a482d92
|
||||
MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d
|
||||
|
||||
test: testclean all
|
||||
if WITH_TURBOJPEG
|
||||
if WITH_JAVA
|
||||
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
|
||||
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi
|
||||
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv
|
||||
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi
|
||||
endif
|
||||
./tjunittest
|
||||
./tjunittest -alloc
|
||||
./tjunittest -yuv
|
||||
endif
|
||||
./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_INT) testoutint.jpg
|
||||
./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_FAST) testoutfst.jpg
|
||||
./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_FAST_100) testoutfst100.jpg
|
||||
./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm
|
||||
if WITH_SSE_FLOAT_DCT
|
||||
md5/md5cmp $(MD5_JPEG_FLOAT) testoutflt.jpg
|
||||
else
|
||||
md5/md5cmp $(MD5_JPEG_FLOAT_NOSIMD) testoutflt.jpg
|
||||
endif
|
||||
./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_INT_GRAY) testoutgray.jpg
|
||||
./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_PPM_INT) testoutint.ppm
|
||||
./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_PPM_FAST) testoutfst.ppm
|
||||
./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg
|
||||
if WITH_SSE_FLOAT_DCT
|
||||
md5/md5cmp $(MD5_PPM_FLOAT) testoutflt.ppm
|
||||
else
|
||||
md5/md5cmp $(MD5_PPM_FLOAT_NOSIMD) testoutflt.ppm
|
||||
endif
|
||||
./djpeg -dct int -nosmooth -scale 2/1 -ppm -outfile testoutint2_1.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_2_1) testoutint2_1.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 15/8 -ppm -outfile testoutint15_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_15_8) testoutint15_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 7/4 -ppm -outfile testoutint7_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_7_4) testoutint7_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 13/8 -ppm -outfile testoutint13_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_13_8) testoutint13_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 3/2 -ppm -outfile testoutint3_2.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_3_2) testoutint3_2.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 11/8 -ppm -outfile testoutint11_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_11_8) testoutint11_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 5/4 -ppm -outfile testoutint5_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_5_4) testoutint5_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 9/8 -ppm -outfile testoutint9_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_9_8) testoutint9_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 7/8 -ppm -outfile testoutint7_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_7_8) testoutint7_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 3/4 -ppm -outfile testoutint3_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_3_4) testoutint3_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 5/8 -ppm -outfile testoutint5_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_5_8) testoutint5_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_1_2) testoutint1_2.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 3/8 -ppm -outfile testoutint3_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_3_8) testoutint3_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_1_4) testoutint1_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_1_8) testoutint1_8.ppm;
|
||||
./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_PPM_FAST_1_2) testoutfst1_2.ppm
|
||||
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_BMP_256) testout.bmp
|
||||
if WITH_ARITH_ENC
|
||||
./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_ARI) testoutari.jpg
|
||||
./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg
|
||||
md5/md5cmp $(MD5_JPEG_ARI) testouta.jpg
|
||||
endif
|
||||
if WITH_ARITH_DEC
|
||||
./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_PPM_ARI) testoutari.ppm
|
||||
./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_JPEG_INT) testouta.jpg
|
||||
endif
|
||||
./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_PROG) testoutp.jpg
|
||||
./jpegtran -outfile testoutt.jpg testoutp.jpg
|
||||
md5/md5cmp $(MD5_JPEG_INT) testoutt.jpg
|
||||
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_JPEG_CROP) testoutcrop.jpg
|
||||
|
||||
|
||||
testclean:
|
||||
rm -f testout*
|
||||
rm -f *_GRAY_*.bmp
|
||||
rm -f *_GRAY_*.png
|
||||
rm -f *_GRAY_*.ppm
|
||||
rm -f *_GRAY_*.jpg
|
||||
rm -f *_GRAY.yuv
|
||||
rm -f *_420_*.bmp
|
||||
rm -f *_420_*.png
|
||||
rm -f *_420_*.ppm
|
||||
rm -f *_420_*.jpg
|
||||
rm -f *_420.yuv
|
||||
rm -f *_422_*.bmp
|
||||
rm -f *_422_*.png
|
||||
rm -f *_422_*.ppm
|
||||
rm -f *_422_*.jpg
|
||||
rm -f *_422.yuv
|
||||
rm -f *_444_*.bmp
|
||||
rm -f *_444_*.png
|
||||
rm -f *_444_*.ppm
|
||||
rm -f *_444_*.jpg
|
||||
rm -f *_444.yuv
|
||||
rm -f *_440_*.bmp
|
||||
rm -f *_440_*.png
|
||||
rm -f *_440_*.ppm
|
||||
rm -f *_440_*.jpg
|
||||
rm -f *_440.yuv
|
||||
|
||||
|
||||
tjtest:
|
||||
sh ./tjbenchtest
|
||||
if WITH_JAVA
|
||||
sh ./tjbenchtest.java
|
||||
endif
|
||||
|
||||
|
||||
pkgscripts/libjpeg-turbo.spec: pkgscripts/libjpeg-turbo.spec.tmpl
|
||||
cat pkgscripts/libjpeg-turbo.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
sed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \
|
||||
sed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \
|
||||
sed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \
|
||||
> pkgscripts/libjpeg-turbo.spec
|
||||
|
||||
rpm: all pkgscripts/libjpeg-turbo.spec
|
||||
TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
|
||||
mkdir -p $$TMPDIR/RPMS; \
|
||||
ln -fs `pwd` $$TMPDIR/BUILD; \
|
||||
rm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \
|
||||
rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
|
||||
--define "_topdir $$TMPDIR" \
|
||||
--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
|
||||
cp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
|
||||
${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \
|
||||
rm -rf $$TMPDIR
|
||||
|
||||
srpm: dist-gzip pkgscripts/libjpeg-turbo.spec
|
||||
TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
|
||||
mkdir -p $$TMPDIR/RPMS; \
|
||||
mkdir -p $$TMPDIR/SRPMS; \
|
||||
mkdir -p $$TMPDIR/BUILD; \
|
||||
mkdir -p $$TMPDIR/SOURCES; \
|
||||
mkdir -p $$TMPDIR/SPECS; \
|
||||
rm -f ${PKGNAME}-${VERSION}.src.rpm; \
|
||||
cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
|
||||
cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
|
||||
| sed s/#--\>//g \
|
||||
> $$TMPDIR/SPECS/libjpeg-turbo.spec; \
|
||||
rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
|
||||
cp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \
|
||||
${PKGNAME}-${VERSION}.src.rpm; \
|
||||
rm -rf $$TMPDIR
|
||||
|
||||
pkgscripts/makedpkg: pkgscripts/makedpkg.tmpl
|
||||
cat pkgscripts/makedpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
sed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \
|
||||
> pkgscripts/makedpkg
|
||||
|
||||
deb: all pkgscripts/makedpkg
|
||||
sh pkgscripts/makedpkg
|
||||
|
||||
pkgscripts/uninstall: pkgscripts/uninstall.tmpl
|
||||
cat pkgscripts/uninstall.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
sed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \
|
||||
sed s@%{__includedir}@$(includedir)@g | sed s@%{__libdir}@$(libdir)@g | \
|
||||
sed s@%{__mandir}@$(mandir)@g > pkgscripts/uninstall
|
||||
|
||||
pkgscripts/makemacpkg: pkgscripts/makemacpkg.tmpl
|
||||
cat pkgscripts/makemacpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
sed s@%{__bindir}@$(bindir)@g | sed s@%{__docdir}@$(docdir)@g | \
|
||||
sed s@%{__libdir}@$(libdir)@g > pkgscripts/makemacpkg
|
||||
|
||||
if X86_64
|
||||
|
||||
udmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32}
|
||||
|
||||
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}
|
||||
|
||||
else
|
||||
|
||||
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}
|
||||
|
||||
endif
|
||||
|
||||
dmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg
|
||||
|
||||
pkgscripts/makecygwinpkg: pkgscripts/makecygwinpkg.tmpl
|
||||
cat pkgscripts/makecygwinpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
sed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \
|
||||
> pkgscripts/makecygwinpkg
|
||||
|
||||
cygwinpkg: all pkgscripts/makecygwinpkg
|
||||
sh pkgscripts/makecygwinpkg
|
||||
547
README
@@ -1,335 +1,135 @@
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo, to wordsmith certain
|
||||
sections, and to remove impolitic language that existed in the libjpeg v8
|
||||
README. It is included only for reference. Please see README-turbo.txt for
|
||||
information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
README for release 4A of 18-Feb-93
|
||||
==================================
|
||||
This distribution contains a release of the Independent JPEG Group's free JPEG
|
||||
software. You are welcome to redistribute this software and to use it for any
|
||||
purpose, subject to the conditions under LEGAL ISSUES, below.
|
||||
|
||||
This distribution contains a BETA TEST release of the Independent JPEG
|
||||
Group's free JPEG software. You are welcome to redistribute this software and
|
||||
to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
|
||||
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
|
||||
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
|
||||
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
|
||||
and other members of the Independent JPEG Group.
|
||||
|
||||
For installation instructions, see file SETUP.
|
||||
|
||||
For usage instructions, see file USAGE (or the cjpeg.1 and djpeg.1 manual
|
||||
pages; but USAGE contains a "hints" section not found in the manual pages).
|
||||
Useful information can also be found in the JPEG FAQ (Frequently Asked
|
||||
Questions) article; see ARCHIVE LOCATIONS below to obtain the FAQ article.
|
||||
|
||||
This software is still undergoing revision. Updated versions may be obtained
|
||||
by FTP or UUCP to UUNET and other archive sites; see ARCHIVE LOCATIONS below
|
||||
for details.
|
||||
|
||||
Serious users of this software (particularly those incorporating it into
|
||||
larger programs) should contact jpeg-info@uunet.uu.net to be added to our
|
||||
electronic mailing list. Mailing list members are notified of updates and
|
||||
have a chance to participate in technical discussions, etc.
|
||||
|
||||
This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz, Lee
|
||||
Crocker, George Phillips, Ge' Weijers, and other members of the Independent
|
||||
JPEG Group.
|
||||
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
||||
(also known as JPEG, together with ITU-T SG16).
|
||||
|
||||
|
||||
DISCLAIMER
|
||||
==========
|
||||
DOCUMENTATION ROADMAP
|
||||
=====================
|
||||
|
||||
THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED. It is not guaranteed to be
|
||||
useful for anything, nor to be compatible with subsequent releases, nor to be
|
||||
an accurate implementation of the JPEG standard. (See LEGAL ISSUES for even
|
||||
more disclaimers.)
|
||||
This file contains the following sections:
|
||||
|
||||
Despite that, we believe that this software is pretty good, and if you find
|
||||
any problems with it, we'd like to know about them. Please report problems
|
||||
by e-mail to jpeg-info@uunet.uu.net.
|
||||
OVERVIEW General description of JPEG and the IJG software.
|
||||
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
|
||||
REFERENCES Where to learn more about JPEG.
|
||||
ARCHIVE LOCATIONS Where to find newer versions of this software.
|
||||
FILE FORMAT WARS Software *not* to get.
|
||||
TO DO Plans for future IJG releases.
|
||||
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
install.txt How to configure and install the IJG software.
|
||||
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
*.1 Unix-style man pages for programs (same info as usage.txt).
|
||||
wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
change.log Version-to-version change highlights.
|
||||
Programmer and internal documentation:
|
||||
libjpeg.txt How to use the JPEG library in your own programs.
|
||||
example.c Sample code for calling the JPEG library.
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
|
||||
Please read at least the files install.txt and usage.txt. Some information
|
||||
can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
|
||||
ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
|
||||
|
||||
If you want to understand how the JPEG code works, we suggest reading one or
|
||||
more of the REFERENCES, then looking at the documentation files (in roughly
|
||||
the order listed) before diving into the code.
|
||||
|
||||
|
||||
WHAT'S HERE
|
||||
===========
|
||||
OVERVIEW
|
||||
========
|
||||
|
||||
This distribution contains C software to implement JPEG image compression and
|
||||
decompression. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG is intended for compressing
|
||||
"real-world" scenes; cartoons and other non-realistic images are not its
|
||||
strong suit. JPEG is lossy, meaning that the output image is not necessarily
|
||||
identical to the input image. Hence you must not use JPEG if you have to have
|
||||
identical output bits. However, on typical images of real-world scenes, very
|
||||
good compression levels can be obtained with no visible change, and amazingly
|
||||
high compression levels are possible if you can tolerate a low-quality image.
|
||||
For more details, see the references, or just experiment with various
|
||||
compression settings.
|
||||
This package contains C software to implement JPEG image encoding, decoding,
|
||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG's strong suit is compressing
|
||||
photographic images or other types of images that have smooth color and
|
||||
brightness transitions between neighboring pixels. Images with sharp lines or
|
||||
other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
quality may have to be used to avoid visible compression artifacts with such
|
||||
images.
|
||||
|
||||
The software implements JPEG baseline and extended-sequential compression
|
||||
processes. Provision is made for supporting all variants of these processes,
|
||||
although some uncommon parameter settings aren't implemented yet. For legal
|
||||
reasons, we are not distributing code for the arithmetic-coding process; see
|
||||
LEGAL ISSUES. At present we have made no provision for supporting the
|
||||
progressive, hierarchical, or lossless processes defined in the standard.
|
||||
JPEG is lossy, meaning that the output pixels are not necessarily identical to
|
||||
the input pixels. However, on photographic content and other "smooth" images,
|
||||
very good compression ratios can be obtained with no visible compression
|
||||
artifacts, and extremely high compression ratios are possible if you are
|
||||
willing to sacrifice image quality (by reducing the "quality" setting in the
|
||||
compressor.)
|
||||
|
||||
This software implements JPEG baseline, extended-sequential, and progressive
|
||||
compression processes. Provision is made for supporting all variants of these
|
||||
processes, although some uncommon parameter settings aren't implemented yet.
|
||||
We have made no provision for supporting the hierarchical or lossless
|
||||
processes defined in the standard.
|
||||
|
||||
We provide a set of library routines for reading and writing JPEG image files,
|
||||
plus two sample applications "cjpeg" and "djpeg", which use the library to
|
||||
perform conversion between JPEG and some other popular image file formats.
|
||||
The library is intended to be reused in other applications.
|
||||
|
||||
In order to support file conversion and viewing software, we have included
|
||||
considerable functionality beyond the bare JPEG coding/decoding capability;
|
||||
for example, the color quantization modules are not strictly part of JPEG
|
||||
decoding, but they are essential for output to colormapped file formats or
|
||||
colormapped displays. These extra functions can be compiled out if not
|
||||
required for a particular application.
|
||||
colormapped displays. These extra functions can be compiled out of the
|
||||
library if not required for a particular application.
|
||||
|
||||
We have also included "jpegtran", a utility for lossless transcoding between
|
||||
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
|
||||
applications for inserting and extracting textual comments in JFIF files.
|
||||
|
||||
The emphasis in designing this software has been on achieving portability and
|
||||
flexibility, while also making it fast enough to be useful. In particular,
|
||||
the software is not intended to be read as a tutorial on JPEG. (See the
|
||||
REFERENCES section for introductory material.) While we hope that the entire
|
||||
package will someday be industrial-strength code, much remains to be done in
|
||||
performance tuning and in improving the capabilities of individual modules.
|
||||
REFERENCES section for introductory material.) Rather, it is intended to
|
||||
be reliable, portable, industrial-strength code. We do not claim to have
|
||||
achieved that goal in every aspect of the software, but we strive for it.
|
||||
|
||||
|
||||
This software can be used on several levels:
|
||||
|
||||
* As canned software for JPEG compression and decompression. Just edit the
|
||||
Makefile and configuration files as needed (see file SETUP), compile and go.
|
||||
Members of the Independent JPEG Group will improve the out-of-the-box
|
||||
functionality and speed as time goes on.
|
||||
|
||||
* As the basis for other JPEG programs. For example, you could incorporate
|
||||
the decompressor into a general image viewing package by replacing the
|
||||
output module with write-to-screen functions. For an implementation on
|
||||
specific hardware, you might want to replace some of the inner loops with
|
||||
assembly code. For a non-command-line-driven system, you might want a
|
||||
different user interface. (Members of the group will be producing Macintosh
|
||||
and Amiga versions with more appropriate user interfaces, for example.)
|
||||
|
||||
* As a toolkit for experimentation with JPEG and JPEG-like algorithms. Most
|
||||
of the individual decisions you might want to mess with are packaged up into
|
||||
separate modules. For example, the details of color-space conversion and
|
||||
subsampling techniques are each localized in one compressor and one
|
||||
decompressor module. You'd probably also want to extend the user interface
|
||||
to give you more detailed control over the JPEG compression parameters.
|
||||
|
||||
In particular, we welcome the use of this software as a component of commercial
|
||||
products; no royalty is required.
|
||||
|
||||
|
||||
ARCHIVE LOCATIONS
|
||||
=================
|
||||
|
||||
[Version 4A is a beta-test release and will not be publicly archived.
|
||||
The following paragraphs refer to the most recent official release.]
|
||||
|
||||
The "official" archive site for this software is ftp.uu.net (Internet
|
||||
address 137.39.1.9 or 192.48.96.9). The most recent released version can
|
||||
always be found there in directory graphics/jpeg. This particular version
|
||||
will be archived as jpegsrc.v4.tar.Z. If you are on the Internet, you can
|
||||
retrieve files from UUNET by anonymous FTP. If you don't have FTP access,
|
||||
UUNET's archives are also available via UUCP; contact postmaster@uunet.uu.net
|
||||
for information on retrieving files that way.
|
||||
|
||||
Numerous Internet sites maintain copies of the UUNET files; in particular,
|
||||
you can probably find a copy at any site that archives comp.sources.misc
|
||||
submissions. However, only ftp.uu.net is guaranteed to have the latest
|
||||
official version.
|
||||
|
||||
You can also obtain this software from CompuServe, in the GRAPHSUPPORT forum
|
||||
(GO PICS), library 15; this version will be file jpsrc4.zip. Again,
|
||||
CompuServe is not guaranteed to have the very latest version.
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a useful source of
|
||||
general information about JPEG. It is updated constantly and therefore
|
||||
is not included in this distribution. The FAQ is posted every two weeks
|
||||
to Usenet newsgroups comp.graphics, news.answers, and other groups. You
|
||||
can always obtain the latest version from the news.answers archive at
|
||||
rtfm.mit.edu (18.172.1.27). By FTP, fetch /pub/usenet/news.answers/jpeg-faq.
|
||||
If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu with body
|
||||
"send usenet/news.answers/jpeg-faq".
|
||||
|
||||
|
||||
SUPPORTING SOFTWARE
|
||||
===================
|
||||
|
||||
You will probably want Jef Poskanzer's PBMPLUS image software, which provides
|
||||
many useful operations on PPM-format image files. In particular, it can
|
||||
convert PPM images to and from a wide range of other formats. You can FTP
|
||||
this free software from export.lcs.mit.edu (contrib/pbmplus*.tar.Z) or
|
||||
ftp.ee.lbl.gov (pbmplus*.tar.Z). Unfortunately PBMPLUS is not nearly as
|
||||
portable as the JPEG software is; you are likely to have difficulty making it
|
||||
work on any non-Unix machine.
|
||||
|
||||
If you are using X Windows you might want to use the xv or xloadimage viewers
|
||||
to save yourself the trouble of converting PPM to some other format. Both of
|
||||
these can be found in the contrib directory at export.lcs.mit.edu. Actually,
|
||||
xv version 2.00 and up incorporates our software and thus can read and write
|
||||
JPEG files directly. (NOTE: since xv internally reduces all images to 8
|
||||
bits/pixel, a JPEG file written by xv will not be very high quality; and xv
|
||||
cannot fully exploit a 24-bit display. These problems are expected to go away
|
||||
in the next xv release, planned for early 1993. In the meantime, use
|
||||
xloadimage for 24-bit displays.)
|
||||
|
||||
For DOS machines, Lee Crocker's free Piclab program is a useful companion to
|
||||
the JPEG software. The latest version, currently 1.91, is available by FTP
|
||||
from SIMTEL20 and its various mirror sites, file <msdos.graphics>piclb191.zip.
|
||||
CompuServe also has it, in the same library as the JPEG software.
|
||||
|
||||
|
||||
SOFTWARE THAT'S NO HELP AT ALL
|
||||
==============================
|
||||
|
||||
Handmade Software's shareware PC program GIF2JPG produces files that are
|
||||
totally incompatible with our programs. They use a proprietary format that is
|
||||
an amalgam of GIF and JPEG representations. However, you can force GIF2JPG
|
||||
to produce compatible files with its -j switch, and their decompression
|
||||
program JPG2GIF can read our files (at least ones produced with our default
|
||||
option settings).
|
||||
|
||||
Some commercial JPEG implementations are also incompatible as of this writing,
|
||||
especially programs released before summer 1991. The root of the problem is
|
||||
that the ISO JPEG committee failed to specify a concrete file format. Some
|
||||
vendors "filled in the blanks" on their own, creating proprietary formats that
|
||||
no one else could read. (For example, none of the early commercial JPEG
|
||||
implementations for the Macintosh were able to exchange compressed files.)
|
||||
|
||||
The file format we have adopted is called JFIF (see REFERENCES). This format
|
||||
has been agreed to by a number of major commercial JPEG vendors, and we expect
|
||||
that it will become the de facto standard. JFIF is a minimal representation;
|
||||
work is also going forward to incorporate JPEG compression into the TIFF 6.0
|
||||
standard, for use in "high end" applications that need to record a lot of
|
||||
additional data about an image. We intend to support TIFF 6.0 in the future.
|
||||
We hope that these two formats will be sufficient and that other, incompatible
|
||||
JPEG file formats will not proliferate.
|
||||
|
||||
Indeed, part of the reason for developing and releasing this free software is
|
||||
to help force rapid convergence to de facto standards for JPEG file formats.
|
||||
SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or TIFF 6.0!
|
||||
|
||||
|
||||
USING JPEG AS A SUBROUTINE IN A LARGER PROGRAM
|
||||
==============================================
|
||||
|
||||
You can readily incorporate the JPEG compression and decompression routines in
|
||||
a larger program. The file example.c provides a skeleton of the interface
|
||||
routines you'll need for this purpose. Essentially, you replace jcmain.c (for
|
||||
compression) and/or jdmain.c (for decompression) with your own code. Note
|
||||
that the fewer JPEG options you allow the user to twiddle, the less code you
|
||||
need; all the default options are set up automatically. (Alternately, if you
|
||||
know a lot about JPEG or have a special application, you may want to twiddle
|
||||
the default options even more extensively than jcmain/jdmain do.)
|
||||
|
||||
Most likely, you will want the uncompressed image to come from memory (for
|
||||
compression) or go to memory or the screen (for decompression). For this
|
||||
purpose you must provide image reading or writing routines that match the
|
||||
interface used by the image file I/O modules (jrdXXX or jwrXXX); again,
|
||||
example.c shows a skeleton of what is required. In this situation, you
|
||||
won't need any of the non-JPEG image file I/O modules used by cjpeg and djpeg.
|
||||
|
||||
By default, any error detected inside the JPEG routines will cause a message
|
||||
to be printed on stderr, followed by exit(). You can override this behavior
|
||||
by supplying your own message-printing and/or error-exit routines; again,
|
||||
example.c shows how.
|
||||
|
||||
We recommend you create libjpeg.a as shown in the Makefile, then link that
|
||||
with your surrounding program. (If your linker is at all reasonable, only the
|
||||
code you actually need will get loaded.) Include the files jconfig.h and
|
||||
jpegdata.h in C files that need to call the JPEG routines.
|
||||
|
||||
CAUTION: some people have tried to compile JPEG and their surrounding code
|
||||
with different compilers, e.g., cc for JPEG and c++ or gcc for the rest. This
|
||||
is a Real Bad Move and you will deserve what happens to you if you try it.
|
||||
(Hint: the parameter structures can get laid out differently with no warning.)
|
||||
|
||||
Read our "architecture" file for more info. If it seems to you that the
|
||||
software structure doesn't accommodate what you want to do, please contact
|
||||
the authors.
|
||||
|
||||
Beginning with version 3, we will endeavor to hold the interface described by
|
||||
example.c constant, so that you can plug in updated versions of the JPEG code
|
||||
just by recompiling. However, we can't guarantee this, especially if you
|
||||
choose to twiddle any JPEG options not listed in example.c. Check the
|
||||
CHANGELOG when installing any new version, and compare example.c against the
|
||||
prior version. Recompile your calling software (don't just relink), as we may
|
||||
add or subtract fields in the parameter structures.
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
We highly recommend reading one or more of these references before trying to
|
||||
understand the innards of any JPEG software.
|
||||
|
||||
The best short technical introduction to the JPEG compression algorithm is
|
||||
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PostScript file containing a revised version of the article is
|
||||
available at ftp.uu.net, graphics/jpeg/wallace.ps.Z. The file (actually a
|
||||
preprint for an article to appear in IEEE Trans. Consumer Electronics) omits
|
||||
the sample images that appeared in CACM, but it includes corrections and some
|
||||
added material. Note: the Wallace article is copyright ACM and IEEE, and it
|
||||
may not be used for commercial purposes.
|
||||
|
||||
A somewhat less technical, more leisurely introduction to JPEG can be found in
|
||||
"The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood
|
||||
City, CA), 1991, ISBN 1-55851-216-0. This book provides good explanations and
|
||||
example C code for a multitude of compression methods including JPEG. It is
|
||||
an excellent source if you are comfortable reading C code but don't know much
|
||||
about data compression in general. The book's JPEG sample code is far from
|
||||
industrial-strength, but when you are ready to look at a full implementation,
|
||||
you've got one here...
|
||||
|
||||
A new textbook about JPEG is "JPEG Still Image Data Compression Standard" by
|
||||
William B. Pennebaker and Joan L. Mitchell, published by Van Nostrand
|
||||
Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95. This book includes the
|
||||
complete text of the ISO JPEG standards (DIS 10918-1 and draft DIS 10918-2).
|
||||
This is by far the most complete exposition of JPEG in existence, and I highly
|
||||
recommend it. If you read the entire book, you will probably know more about
|
||||
JPEG than I do.
|
||||
|
||||
The JPEG standard itself is not available electronically; you must order a
|
||||
paper copy through ISO. (Unless you are concerned about having a certified
|
||||
official copy, I recommend buying the Pennebaker and Mitchell book instead;
|
||||
it's much cheaper and includes a great deal of useful explanatory material.)
|
||||
In the US, copies of the standard may be ordered from ANSI Sales at (212)
|
||||
642-4900. It's not cheap: as of 1992, Part 1 is $95 and Part 2 is $47, plus
|
||||
7% shipping/handling. The standard is divided into two parts, Part 1 being
|
||||
the actual specification, while Part 2 covers compliance testing methods.
|
||||
As of early 1992, Part 1 has Draft International Standard status. It is
|
||||
titled "Digital Compression and Coding of Continuous-tone Still Images, Part
|
||||
1: Requirements and guidelines" and has document number ISO/IEC DIS 10918-1.
|
||||
Part 2 is still at Committee Draft status. It is titled "Digital Compression
|
||||
and Coding of Continuous-tone Still Images, Part 2: Compliance testing" and
|
||||
has document number ISO/IEC CD 10918-2. (NOTE: I'm told that the final
|
||||
version of Part 2 will differ considerably from the CD draft.)
|
||||
|
||||
The JPEG standard does not specify all details of an interchangeable file
|
||||
format. For the omitted details we follow the "JFIF" conventions, revision
|
||||
1.02. A copy of the JFIF spec is available from:
|
||||
Literature Department
|
||||
C-Cube Microsystems, Inc.
|
||||
399A West Trimble Road
|
||||
San Jose, CA 95131
|
||||
(408) 944-6300
|
||||
A PostScript version of this document is available at ftp.uu.net, file
|
||||
graphics/jpeg/jfif.ps.Z. It can also be obtained by e-mail from the C-Cube
|
||||
mail server, netlib@c3.pla.ca.us. Send the message "send jfif_ps from jpeg"
|
||||
to the server to obtain the JFIF document; send the message "help" if you have
|
||||
trouble.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from sgi.com
|
||||
(192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed copy
|
||||
from Aldus Corp. at (206) 628-6593. It should be noted that the TIFF 6.0 spec
|
||||
of 3-June-92 has a number of serious problems in its JPEG features. A
|
||||
clarification note will probably be needed to ensure that TIFF JPEG files are
|
||||
compatible across different implementations. The IJG does not intend to
|
||||
support TIFF 6.0 until these problems are resolved.
|
||||
|
||||
If you want to understand this implementation, start by reading the
|
||||
"architecture" documentation file. Please read "codingrules" if you want to
|
||||
contribute any code.
|
||||
We welcome the use of this software as a component of commercial products.
|
||||
No royalty is required, but we do ask for an acknowledgement in product
|
||||
documentation, as described under LEGAL ISSUES.
|
||||
|
||||
|
||||
LEGAL ISSUES
|
||||
============
|
||||
|
||||
In plain English:
|
||||
|
||||
1. We don't promise that this software works. (But if you find any bugs,
|
||||
please let us know!)
|
||||
2. You can use this software for whatever you want. You don't have to pay us.
|
||||
3. You may not pretend that you wrote this software. If you use it in a
|
||||
program, you must acknowledge somewhere in your documentation that
|
||||
you've used the IJG code.
|
||||
|
||||
In legalese:
|
||||
|
||||
The authors make NO WARRANTY or representation, either express or implied,
|
||||
with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991, 1992, Thomas G. Lane.
|
||||
This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
@@ -346,6 +146,10 @@ the Independent JPEG Group".
|
||||
full responsibility for any undesirable consequences; the authors accept
|
||||
NO LIABILITY for damages of any kind.
|
||||
|
||||
These conditions apply to any software derived from or based on the IJG code,
|
||||
not just to the unmodified library. If you use our work, you ought to
|
||||
acknowledge us.
|
||||
|
||||
Permission is NOT granted for the use of any IJG author's name or company name
|
||||
in advertising or publicity relating to this software or products derived from
|
||||
it. This software may be referred to only as "the Independent JPEG Group's
|
||||
@@ -356,27 +160,18 @@ commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
|
||||
sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
|
||||
ansi2knr.c is NOT covered by the above copyright and conditions, but instead
|
||||
by the usual distribution terms of the Free Software Foundation; principally,
|
||||
that you must include source code if you redistribute it. (See the file
|
||||
ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
|
||||
of any program generated from the JPEG code, this does not limit you more than
|
||||
the foregoing paragraphs do.
|
||||
|
||||
|
||||
It appears that the arithmetic coding option of the JPEG spec is covered by
|
||||
patents owned by IBM and AT&T, as well as a pending Japanese patent of
|
||||
Mitsubishi. Hence arithmetic coding cannot legally be used without obtaining
|
||||
one or more licenses. For this reason, support for arithmetic coding has been
|
||||
removed from the free JPEG software. (Since arithmetic coding provides only a
|
||||
marginal gain over the unpatented Huffman mode, it is unlikely that very many
|
||||
implementors will support it. If you do obtain the necessary licenses,
|
||||
contact jpeg-info@uunet.uu.net for a copy of our arithmetic coding modules.)
|
||||
So far as we are aware, there are no patent restrictions on the remaining
|
||||
code.
|
||||
The Unix configuration script "configure" was produced with GNU Autoconf.
|
||||
It is copyright by the Free Software Foundation but is freely distributable.
|
||||
The same holds for its supporting scripts (config.guess, config.sub,
|
||||
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
||||
but is also freely distributable.
|
||||
|
||||
The IJG distribution formerly included code to read and write GIF files.
|
||||
To avoid entanglement with the Unisys LZW patent, GIF reading support has
|
||||
been removed altogether, and the GIF writer has been simplified to produce
|
||||
"uncompressed GIFs". This technique does not use the LZW algorithm; the
|
||||
resulting GIF files are larger than usual, but are readable by all standard
|
||||
GIF decoders.
|
||||
|
||||
We are required to state that
|
||||
"The Graphics Interchange Format(c) is the Copyright property of
|
||||
@@ -384,22 +179,104 @@ We are required to state that
|
||||
CompuServe Incorporated."
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
We recommend reading one or more of these references before trying to
|
||||
understand the innards of the JPEG software.
|
||||
|
||||
The best short technical introduction to the JPEG compression algorithm is
|
||||
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PostScript file containing a revised version of Wallace's article is
|
||||
available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
|
||||
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
||||
omits the sample images that appeared in CACM, but it includes corrections
|
||||
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
||||
and it may not be used for commercial purposes.
|
||||
|
||||
A somewhat less technical, more leisurely introduction to JPEG can be found in
|
||||
"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
|
||||
M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
|
||||
good explanations and example C code for a multitude of compression methods
|
||||
including JPEG. It is an excellent source if you are comfortable reading C
|
||||
code but don't know much about data compression in general. The book's JPEG
|
||||
sample code is far from industrial-strength, but when you are ready to look
|
||||
at a full implementation, you've got one here...
|
||||
|
||||
The best currently available description of JPEG is the textbook "JPEG Still
|
||||
Image Data Compression Standard" by William B. Pennebaker and Joan L.
|
||||
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
|
||||
Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
|
||||
standards (DIS 10918-1 and draft DIS 10918-2).
|
||||
|
||||
The original JPEG standard is divided into two parts, Part 1 being the actual
|
||||
specification, while Part 2 covers compliance testing methods. Part 1 is
|
||||
titled "Digital Compression and Coding of Continuous-tone Still Images,
|
||||
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
|
||||
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
|
||||
Continuous-tone Still Images, Part 2: Compliance testing" and has document
|
||||
numbers ISO/IEC IS 10918-2, ITU-T T.83.
|
||||
|
||||
The JPEG standard does not specify all details of an interchangeable file
|
||||
format. For the omitted details we follow the "JFIF" conventions, revision
|
||||
1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
|
||||
and thus received a formal publication status. It is available as a free
|
||||
download in PDF format from
|
||||
http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
|
||||
A PostScript version of the JFIF document is available at
|
||||
http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
|
||||
http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
|
||||
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
|
||||
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
|
||||
(Compression tag 7). Copies of this Note can be obtained from
|
||||
http://www.ijg.org/files/. It is expected that the next revision
|
||||
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
|
||||
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
|
||||
uses our library to implement TIFF/JPEG per the Note.
|
||||
|
||||
|
||||
ARCHIVE LOCATIONS
|
||||
=================
|
||||
|
||||
The "official" archive site for this software is www.ijg.org.
|
||||
The most recent released version can always be found there in
|
||||
directory "files". This particular version will be archived as
|
||||
http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible
|
||||
"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip.
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
|
||||
and other news.answers archive sites, including the official news.answers
|
||||
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
|
||||
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
|
||||
with body
|
||||
send usenet/news.answers/jpeg-faq/part1
|
||||
send usenet/news.answers/jpeg-faq/part2
|
||||
|
||||
|
||||
FILE FORMAT WARS
|
||||
================
|
||||
|
||||
The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
|
||||
with ITU-T SG16) currently promotes different formats containing the name
|
||||
"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does
|
||||
not support these formats (see REFERENCES). Indeed, one of the original
|
||||
reasons for developing this free software was to help force convergence on
|
||||
common, interoperable format standards for JPEG files.
|
||||
Don't use an incompatible file format!
|
||||
(In any case, our decoder will remain capable of reading existing JPEG
|
||||
image files indefinitely.)
|
||||
|
||||
|
||||
TO DO
|
||||
=====
|
||||
|
||||
The next major release will probably be a significant rewrite to allow use of
|
||||
this code in conjunction with Sam Leffler's free TIFF library (assuming the
|
||||
bugs in the TIFF 6.0 specification get resolved).
|
||||
|
||||
Many of the modules need fleshing out to provide more complete
|
||||
implementations, or to provide faster paths for common cases.
|
||||
Speeding things up is still high on our priority list.
|
||||
|
||||
We'd appreciate it if people would compile and check out the code on as wide a
|
||||
variety of systems as possible, and report any portability problems
|
||||
encountered (with solutions, if possible). Checks of file compatibility with
|
||||
other JPEG implementations would also be of interest. Finally, we would
|
||||
appreciate code profiles showing where the most time is spent, especially on
|
||||
unusual systems.
|
||||
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
||||
|
||||
475
README-turbo.txt
Executable file
@@ -0,0 +1,475 @@
|
||||
*******************************************************************************
|
||||
** Background
|
||||
*******************************************************************************
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64,
|
||||
and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as
|
||||
libjpeg, all else being equal. On other types of systems, libjpeg-turbo can
|
||||
still outperform libjpeg by a significant amount, by virtue of its
|
||||
highly-optimized Huffman coding routines. In many cases, the performance of
|
||||
libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
colorspace extensions that allow it to compress from/decompress to 32-bit and
|
||||
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
|
||||
interface.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
|
||||
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** License
|
||||
*******************************************************************************
|
||||
|
||||
Most of libjpeg-turbo inherits the non-restrictive, BSD-style license used by
|
||||
libjpeg (see README.) The TurboJPEG wrapper (both C and Java versions) and
|
||||
associated test programs bear a similar license, which is reproduced below:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- 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.
|
||||
- Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
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 HOLDERS 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.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Using libjpeg-turbo
|
||||
*******************************************************************************
|
||||
|
||||
libjpeg-turbo includes two APIs that can be used to compress and decompress
|
||||
JPEG images:
|
||||
|
||||
TurboJPEG API: This API provides an easy-to-use interface for compressing
|
||||
and decompressing JPEG images in memory. It also provides some functionality
|
||||
that would not be straightforward to achieve using the underlying libjpeg
|
||||
API, such as generating planar YUV images and performing multiple
|
||||
simultaneous lossless transforms on an image. The Java interface for
|
||||
libjpeg-turbo is written on top of the TurboJPEG API.
|
||||
|
||||
libjpeg API: This is the de facto industry-standard API for compressing and
|
||||
decompressing JPEG images. It is more difficult to use than the TurboJPEG
|
||||
API but also more powerful. The libjpeg API implementation in libjpeg-turbo
|
||||
is both API/ABI-compatible and mathematically compatible with libjpeg v6b.
|
||||
It can also optionally be configured to be API/ABI-compatible with libjpeg v7
|
||||
and v8 (see below.)
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
======================
|
||||
Installation Directory
|
||||
======================
|
||||
|
||||
This document assumes that libjpeg-turbo will be installed in the default
|
||||
directory (/opt/libjpeg-turbo on Un*x and Mac systems and
|
||||
c:\libjpeg-turbo[-gcc][64] on Windows systems. If your installation of
|
||||
libjpeg-turbo resides in a different directory, then adjust the instructions
|
||||
accordingly.
|
||||
|
||||
=============================
|
||||
Replacing libjpeg at Run Time
|
||||
=============================
|
||||
|
||||
Un*x
|
||||
----
|
||||
|
||||
If a Un*x application is dynamically linked with libjpeg, then you can replace
|
||||
libjpeg with libjpeg-turbo at run time by manipulating LD_LIBRARY_PATH.
|
||||
For instance:
|
||||
|
||||
[Using libjpeg]
|
||||
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
|
||||
real 0m0.392s
|
||||
user 0m0.074s
|
||||
sys 0m0.020s
|
||||
|
||||
[Using libjpeg-turbo]
|
||||
> export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH
|
||||
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
|
||||
real 0m0.109s
|
||||
user 0m0.029s
|
||||
sys 0m0.010s
|
||||
|
||||
({lib} = lib32 or lib64, depending on whether you wish to use the 32-bit or the
|
||||
64-bit version of libjpeg-turbo.)
|
||||
|
||||
System administrators can also replace the libjpeg symlinks in /usr/lib* with
|
||||
links to the libjpeg-turbo dynamic library located in /opt/libjpeg-turbo/{lib}.
|
||||
This will effectively accelerate every application that uses the libjpeg
|
||||
dynamic library on the system.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If a Windows application is dynamically linked with libjpeg, then you can
|
||||
replace libjpeg with libjpeg-turbo at run time by backing up the application's
|
||||
copy of jpeg62.dll, jpeg7.dll, or jpeg8.dll (assuming the application has its
|
||||
own local copy of this library) and copying the corresponding DLL from
|
||||
libjpeg-turbo into the application's install directory. The official
|
||||
libjpeg-turbo binary packages only provide jpeg62.dll. If the application uses
|
||||
jpeg7.dll or jpeg8.dll instead, then it will be necessary to build
|
||||
libjpeg-turbo from source (see "libjpeg v7 and v8 API/ABI Emulation" below.)
|
||||
|
||||
The following information is specific to the official libjpeg-turbo binary
|
||||
packages for Visual C++:
|
||||
|
||||
-- jpeg62.dll requires the Visual C++ 2008 C run-time DLL (msvcr90.dll).
|
||||
msvcr90.dll ships with more recent versions of Windows, but users of older
|
||||
Windows releases can obtain it from the Visual C++ 2008 Redistributable
|
||||
Package, which is available as a free download from Microsoft's web site.
|
||||
|
||||
-- Features of the libjpeg API that require passing a C run-time structure,
|
||||
such as a file handle, from an application to the library will probably not
|
||||
work with jpeg62.dll, unless the application is also built to use the Visual
|
||||
C++ 2008 C run-time DLL. In particular, this affects jpeg_stdio_dest() and
|
||||
jpeg_stdio_src().
|
||||
|
||||
Mac
|
||||
---
|
||||
|
||||
Mac applications typically embed their own copies of the libjpeg dylib inside
|
||||
the (hidden) application bundle, so it is not possible to globally replace
|
||||
libjpeg on OS X systems. Replacing the application's version of the libjpeg
|
||||
dylib would generally involve copying libjpeg.*.dylib from libjpeg-turbo into
|
||||
the appropriate place in the application bundle and using install_name_tool to
|
||||
repoint the libjpeg-turbo dylib to its new directory. This requires an
|
||||
advanced knowledge of OS X and would not survive an upgrade or a re-install of
|
||||
the application. Thus, it is not recommended for most users.
|
||||
|
||||
========================================
|
||||
Using libjpeg-turbo in Your Own Programs
|
||||
========================================
|
||||
|
||||
For the most part, libjpeg-turbo should work identically to libjpeg, so in
|
||||
most cases, an application can be built against libjpeg and then run against
|
||||
libjpeg-turbo. On Un*x systems and Cygwin, you can build against libjpeg-turbo
|
||||
instead of libjpeg by setting
|
||||
|
||||
CPATH=/opt/libjpeg-turbo/include
|
||||
and
|
||||
LIBRARY_PATH=/opt/libjpeg-turbo/{lib}
|
||||
|
||||
({lib} = lib32 or lib64, depending on whether you are building a 32-bit or a
|
||||
64-bit application.)
|
||||
|
||||
If using MinGW, then set
|
||||
|
||||
CPATH=/c/libjpeg-turbo-gcc[64]/include
|
||||
and
|
||||
LIBRARY_PATH=/c/libjpeg-turbo-gcc[64]/lib
|
||||
|
||||
Building against libjpeg-turbo is useful, for instance, if you want to build an
|
||||
application that leverages the libjpeg-turbo colorspace extensions (see below.)
|
||||
On Un*x systems, you would still need to manipulate LD_LIBRARY_PATH or create
|
||||
appropriate symlinks to use libjpeg-turbo at run time. On such systems, you
|
||||
can pass -R /opt/libjpeg-turbo/{lib} to the linker to force the use of
|
||||
libjpeg-turbo at run time rather than libjpeg (also useful if you want to
|
||||
leverage the colorspace extensions), or you can link against the libjpeg-turbo
|
||||
static library.
|
||||
|
||||
To force a Un*x or MinGW application to link against the static version of
|
||||
libjpeg-turbo, you can use the following linker options:
|
||||
|
||||
-Wl,-Bstatic -ljpeg -Wl,-Bdynamic
|
||||
|
||||
On OS X, simply add /opt/libjpeg-turbo/lib/libjpeg.a to the linker command
|
||||
line.
|
||||
|
||||
To build Visual C++ applications using libjpeg-turbo, add
|
||||
c:\libjpeg-turbo[64]\include to the system or user INCLUDE environment
|
||||
variable and c:\libjpeg-turbo[64]\lib to the system or user LIB environment
|
||||
variable, and then link against either jpeg.lib (to use the DLL version of
|
||||
libjpeg-turbo) or jpeg-static.lib (to use the static version of libjpeg-turbo.)
|
||||
|
||||
=====================
|
||||
Colorspace Extensions
|
||||
=====================
|
||||
|
||||
libjpeg-turbo includes extensions that allow JPEG images to be compressed
|
||||
directly from (and decompressed directly to) buffers that use BGR, BGRX,
|
||||
RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new
|
||||
colorspace constants:
|
||||
|
||||
JCS_EXT_RGB /* red/green/blue */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
JCS_EXT_BGR /* blue/green/red */
|
||||
JCS_EXT_BGRX /* blue/green/red/x */
|
||||
JCS_EXT_XBGR /* x/blue/green/red */
|
||||
JCS_EXT_XRGB /* x/red/green/blue */
|
||||
JCS_EXT_RGBA /* red/green/blue/alpha */
|
||||
JCS_EXT_BGRA /* blue/green/red/alpha */
|
||||
JCS_EXT_ABGR /* alpha/blue/green/red */
|
||||
JCS_EXT_ARGB /* alpha/red/green/blue */
|
||||
|
||||
Setting cinfo.in_color_space (compression) or cinfo.out_color_space
|
||||
(decompression) to one of these values will cause libjpeg-turbo to read the
|
||||
red, green, and blue values from (or write them to) the appropriate position in
|
||||
the pixel when compressing from/decompressing to an RGB buffer.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a libjpeg implementation
|
||||
that does not support them will result in a "Bogus input colorspace" error.
|
||||
Applications can trap this error in order to test whether run-time support is
|
||||
available for the colorspace extensions.
|
||||
|
||||
When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
|
||||
X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
|
||||
can set that byte to whatever value it wishes. If an application expects the X
|
||||
byte to be used as an alpha channel, then it should specify JCS_EXT_RGBA,
|
||||
JCS_EXT_BGRA, JCS_EXT_ABGR, or JCS_EXT_ARGB. When these colorspace constants
|
||||
are used, the X byte is guaranteed to be 0xFF, which is interpreted as opaque.
|
||||
|
||||
Your application can check for the existence of the alpha channel colorspace
|
||||
extensions at compile time with:
|
||||
|
||||
#ifdef JCS_ALPHA_EXTENSIONS
|
||||
|
||||
jcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check
|
||||
for the existence of the colorspace extensions at compile time and run time.
|
||||
|
||||
===================================
|
||||
libjpeg v7 and v8 API/ABI Emulation
|
||||
===================================
|
||||
|
||||
With libjpeg v7 and v8, new features were added that necessitated extending the
|
||||
compression and decompression structures. Unfortunately, due to the exposed
|
||||
nature of those structures, extending them also necessitated breaking backward
|
||||
ABI compatibility with previous libjpeg releases. Thus, programs that were
|
||||
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
|
||||
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are still not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
|
||||
in libjpeg-turbo. It should be noted, however, that this feature was added
|
||||
primarily so that applications that had already been compiled to use libjpeg
|
||||
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
|
||||
without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (see below.)
|
||||
|
||||
By passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an
|
||||
argument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version
|
||||
of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that programs
|
||||
that are built against libjpeg v7 or v8 can be run with libjpeg-turbo. The
|
||||
following section describes which libjpeg v7+ features are supported and which
|
||||
aren't.
|
||||
|
||||
Support for libjpeg v7 and v8 Features:
|
||||
---------------------------------------
|
||||
|
||||
Fully supported:
|
||||
|
||||
-- libjpeg: IDCT scaling extensions in decompressor
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
-- libjpeg: arithmetic coding
|
||||
|
||||
-- libjpeg: In-memory source and destination managers
|
||||
See notes below.
|
||||
|
||||
-- cjpeg: Separate quality settings for luminance and chrominance
|
||||
Note that the libpjeg v7+ API was extended to accommodate this feature only
|
||||
for convenience purposes. It has always been possible to implement this
|
||||
feature with libjpeg v6b (see rdswitch.c for an example.)
|
||||
|
||||
-- cjpeg: 32-bit BMP support
|
||||
|
||||
-- cjpeg: -rgb option
|
||||
|
||||
-- jpegtran: lossless cropping
|
||||
|
||||
-- jpegtran: -perfect option
|
||||
|
||||
-- jpegtran: forcing width/height when performing lossless crop
|
||||
|
||||
-- rdjpgcom: -raw option
|
||||
|
||||
-- rdjpgcom: locale awareness
|
||||
|
||||
|
||||
Not supported:
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
http://www.libjpeg-turbo.org/About/SmartScale and draw his/her own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
-- libjpeg: DCT scaling in compressor
|
||||
cinfo.scale_num and cinfo.scale_denom are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, which is of limited usefulness.
|
||||
|
||||
-- libjpeg: SmartScale
|
||||
cinfo.block_size is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. Providing support for this new format would be
|
||||
feasible (particularly without full acceleration.) However, until/unless
|
||||
the format becomes either an official industry standard or, at minimum, an
|
||||
accepted solution in the community, we are hesitant to implement it, as
|
||||
there is no sense of whether or how it might change in the future. It is
|
||||
our belief that SmartScale has not demonstrated sufficient usefulness as a
|
||||
lossless format nor as a means of quality enhancement, and thus, our primary
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
-- libjpeg: Fancy downsampling in compressor
|
||||
cinfo.do_fancy_downsampling is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
-- jpegtran: Scaling
|
||||
This requires both the DCT scaling and SmartScale features, which are not
|
||||
supported.
|
||||
|
||||
-- Lossless RGB JPEG files
|
||||
This requires the SmartScale feature, which is not supported.
|
||||
|
||||
What About libjpeg v9?
|
||||
----------------------
|
||||
|
||||
libjpeg v9 introduced yet another field to the JPEG compression structure
|
||||
(color_transform), thus making the ABI backward incompatible with that of
|
||||
libjpeg v8. This new field was introduced solely for the purpose of supporting
|
||||
lossless SmartScale encoding. Further, there was actually no reason to extend
|
||||
the API in this manner, as the color transform could have just as easily been
|
||||
activated by way of a new JPEG colorspace constant, thus preserving backward
|
||||
ABI compatibility.
|
||||
|
||||
Our research (see link above) has shown that lossless SmartScale does not
|
||||
generally accomplish anything that can't already be accomplished better with
|
||||
existing, standard lossless formats. Thus, at this time, it is our belief that
|
||||
there is not sufficient technical justification for software to upgrade from
|
||||
libjpeg v8 to libjpeg v9, and therefore, not sufficient technical justification
|
||||
for us to emulate the libjpeg v9 ABI.
|
||||
|
||||
=====================================
|
||||
In-Memory Source/Destination Managers
|
||||
=====================================
|
||||
|
||||
By default, libjpeg-turbo 1.3 and later includes the jpeg_mem_src() and
|
||||
jpeg_mem_dest() functions, even when not emulating the libjpeg v8 API/ABI.
|
||||
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
|
||||
API/ABI emulation in order to use the in-memory source/destination managers,
|
||||
but several projects requested that those functions be included when emulating
|
||||
the libjpeg v6b API/ABI as well. This allows the use of those functions by
|
||||
programs that need them without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of --without-mem-srcdst to configure or
|
||||
an argument of -DWITH_MEM_SRCDST=0 to CMake prior to building libjpeg-turbo.
|
||||
This will restore the pre-1.3 behavior, in which jpeg_mem_src() and
|
||||
jpeg_mem_dest() are only included when emulating the libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.0.0 to 62.1.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.0.0 to 7.1.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses jpeg_mem_src() or jpeg_mem_dest(),
|
||||
that program will not fail if run against an older version of libjpeg-turbo or
|
||||
against libjpeg v7- until the program actually tries to call jpeg_mem_src() or
|
||||
jpeg_mem_dest(). Such is not the case on Windows. If a program is built
|
||||
against the libjpeg-turbo 1.3+ DLL and uses jpeg_mem_src() or jpeg_mem_dest(),
|
||||
then it must use the libjpeg-turbo 1.3+ DLL at run time.
|
||||
|
||||
Both cjpeg and djpeg have been extended to allow testing the in-memory
|
||||
source/destination manager functions. See their respective man pages for more
|
||||
details.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Mathematical Compatibility
|
||||
*******************************************************************************
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. The one exception to this is when using the floating point DCT/IDCT, in
|
||||
which case the outputs of libjpeg v6b and libjpeg-turbo are not guaranteed to
|
||||
be identical (the accuracy of the floating point DCT/IDCT is constant when
|
||||
using libjpeg-turbo's SIMD extensions, but otherwise, it can depend heavily on
|
||||
the compiler and compiler settings.)
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood, it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
cases in which libjpeg-turbo cannot be expected to produce the same output as
|
||||
libjpeg v8:
|
||||
|
||||
-- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
|
||||
implements those scaling algorithms a bit differently than libjpeg v6b does,
|
||||
and libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
|
||||
-- When using chrominance subsampling, because libjpeg v8 implements this
|
||||
with its DCT/IDCT scaling algorithms rather than with a separate
|
||||
downsampling/upsampling algorithm.
|
||||
|
||||
-- When using the floating point IDCT, for the reasons stated above and also
|
||||
because the floating point IDCT algorithm was modified in libjpeg v8a to
|
||||
improve accuracy.
|
||||
|
||||
-- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
|
||||
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
|
||||
merged upsampling with scaling factors > 1.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Performance Pitfalls
|
||||
*******************************************************************************
|
||||
|
||||
===============
|
||||
Restart Markers
|
||||
===============
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
has restart markers. This can cause the decompression performance to drop by
|
||||
as much as 20%, but the performance will still be much greater than that of
|
||||
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
===============================================
|
||||
Fast Integer Forward DCT at High Quality Levels
|
||||
===============================================
|
||||
|
||||
The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
550
SETUP
@@ -1,550 +0,0 @@
|
||||
SETUP instructions for the Independent JPEG Group's JPEG software
|
||||
=================================================================
|
||||
|
||||
This file explains how to configure and compile the JPEG software. We have
|
||||
tried to make this software extremely portable and flexible, so that it can be
|
||||
adapted to almost any environment. The downside of this decision is that the
|
||||
installation process is not very automatic; you will need at least a little
|
||||
familiarity with C programming and program build procedures for your system.
|
||||
|
||||
This file contains general instructions, then sections of specific hints for
|
||||
certain systems. You may save yourself considerable time if you scan the
|
||||
whole file before starting to do anything.
|
||||
|
||||
Before installing the software you must unpack the distributed source code.
|
||||
Since you are reading this file, you have probably already succeeded in this
|
||||
task. However, there is one potential trap if you are on a non-Unix system:
|
||||
you may need to convert these files to the local standard text file format
|
||||
(for example, if you are on MS-DOS you probably have to convert LF end-of-line
|
||||
to CR/LF). If so, apply the conversion to all the files EXCEPT those whose
|
||||
names begin with "test". The test files contain binary data; if you change
|
||||
them in any way then the self-test will give bad results.
|
||||
|
||||
|
||||
STEP 1: PREPARE A MAKEFILE
|
||||
==========================
|
||||
|
||||
First, select a makefile and copy it to "Makefile" (or whatever your version
|
||||
of make uses as the default makefile name; for example, "makefile.mak" for
|
||||
old versions of Borland C). We include several standard makefiles in the
|
||||
distribution:
|
||||
|
||||
makefile.ansi: for Unix systems with ANSI-compatible C compilers.
|
||||
makefile.unix: for Unix systems with non-ANSI C compilers.
|
||||
makefile.mc5: for Microsoft C 5.x under MS-DOS.
|
||||
makefile.mc6: for Microsoft C 6.x and up under MS-DOS.
|
||||
makefile.bcc: for Borland C (Turbo C) under MS-DOS.
|
||||
makefile.icc: for Intel's Code Builder C under MS-DOS.
|
||||
makefile.manx: for Manx Aztec C on Amigas.
|
||||
makefile.sas: for SAS C on Amigas.
|
||||
makcjpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
|
||||
makdjpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
|
||||
makljpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
|
||||
makefile.mms: for VAX/VMS systems with MMS.
|
||||
makefile.vms: for VAX/VMS systems without MMS.
|
||||
|
||||
If you don't see a makefile for your system, we recommend starting from either
|
||||
makefile.ansi or makefile.unix, depending on whether your compiler accepts
|
||||
ANSI C or not. Actually you should start with makefile.ansi whenever your
|
||||
compiler supports ANSI-style function definitions; you don't need full ANSI
|
||||
compatibility. The difference between the two makefiles is that makefile.unix
|
||||
preprocesses the source code to convert function definitions to old-style C.
|
||||
(Our thanks to Peter Deutsch of Aladdin Enterprises for the ansi2knr program.)
|
||||
|
||||
If you don't know whether your compiler supports ANSI-style function
|
||||
definitions, then take a look at ckconfig.c. It is a test program that will
|
||||
help you figure out this fact, as well as some other facts you'll need in
|
||||
later steps. You must compile and execute ckconfig.c by hand; the makefiles
|
||||
don't provide any support for this. ckconfig.c may not compile the first try
|
||||
(in fact, the whole idea is for it to fail if anything is going to). If you
|
||||
get compile errors, fix them by editing ckconfig.c according to the directions
|
||||
given in ckconfig.c. Once you get it to run, select a makefile according to
|
||||
the advice it prints out, and make any other changes it recommends.
|
||||
|
||||
Look over the selected Makefile and adjust options as needed. In particular
|
||||
you may want to change the CC and CFLAGS definitions. For instance, if you
|
||||
are using GCC, set CC=gcc. If you had to use any compiler switches to get
|
||||
ckconfig.c to work, make sure the same switches are in CFLAGS.
|
||||
|
||||
If you are on a system that doesn't use makefiles, you'll need to set up
|
||||
project files (or whatever you do use) to compile all the source files and
|
||||
link them into executable files cjpeg and djpeg. See the file lists in any of
|
||||
the makefiles to find out which files go into each program. As a last resort,
|
||||
you can make a batch script that just compiles everything and links it all
|
||||
together; makefile.vms is an example of this (it's for VMS systems that have
|
||||
no make-like utility).
|
||||
|
||||
|
||||
STEP 2: EDIT JCONFIG.H
|
||||
======================
|
||||
|
||||
Look over jconfig.h and adjust #defines to reflect the properties of your
|
||||
system and C compiler. If you prefer, you can usually leave jconfig.h
|
||||
unmodified and add -Dsymbol switches to the Makefile's CFLAGS definition.
|
||||
(This is already done if you used a compiler-specific makefile in step 1.)
|
||||
However, putting the switches in the Makefile is a bad idea if you are going
|
||||
to incorporate the JPEG software into other programs --- you'd need to include
|
||||
the same -D switches in the other programs' Makefiles. Better to change
|
||||
jconfig.h.
|
||||
|
||||
If you have an ANSI-compliant C compiler, no changes should be necessary
|
||||
except perhaps for RIGHT_SHIFT_IS_UNSIGNED and TWO_FILE_COMMANDLINE. For
|
||||
older compilers other changes may be needed, depending on what ANSI features
|
||||
are supported.
|
||||
|
||||
If you don't know enough about C programming to understand the questions in
|
||||
jconfig.h, then use ckconfig.c to figure out what to change. (See description
|
||||
of ckconfig.c in step 1.)
|
||||
|
||||
A note about TWO_FILE_COMMANDLINE: defining this selects the command line
|
||||
syntax in which the input and output files are both named on the command line.
|
||||
If it's not defined, the output image goes to standard output, and the input
|
||||
can optionally come from standard input. You MUST use two-file style on any
|
||||
system that doesn't cope well with binary data fed through stdin/stdout; this
|
||||
is true for most MS-DOS compilers, for example. If you're not on a Unix
|
||||
system, it's probably safest to assume you need two-file style. (But if your
|
||||
compiler provides either the Posix-standard fdopen() library routine or a
|
||||
Microsoft-compatible setmode() routine, you can use the Unix command line
|
||||
style, by defining USE_FDOPEN or USE_SETMODE respectively.)
|
||||
|
||||
|
||||
STEP 3: SELECT SYSTEM-DEPENDENT FILES
|
||||
=====================================
|
||||
|
||||
A few places in the JPEG software are so system-dependent that we have to
|
||||
provide several different implementations and let you select the one you need.
|
||||
|
||||
The only system-dependent file in the current version is jmemsys.c. This file
|
||||
controls use of temporary files for big images that won't fit in main memory.
|
||||
You'll notice there is no file named jmemsys.c in the distribution; you must
|
||||
select one of the provided versions and copy, rename, or link it to jmemsys.c.
|
||||
Here are the provided versions:
|
||||
|
||||
jmemansi.c This is a reasonably portable version that should
|
||||
work on most ANSI and near-ANSI C compilers. It uses
|
||||
the ANSI-standard library routine tmpfile(), which not
|
||||
all non-ANSI systems have. On some systems tmpfile()
|
||||
may put the temporary file in a non-optimal location;
|
||||
if you don't like what it does, use jmemname.c.
|
||||
|
||||
jmemname.c This version constructs the temp file name by itself.
|
||||
For anything except a Unix machine, you'll need to
|
||||
configure the select_file_name() routine appropriately;
|
||||
see the comments near the head of jmemname.c.
|
||||
If you use this version, define NEED_SIGNAL_CATCHER
|
||||
in jconfig.h or in the Makefile to make sure the temp
|
||||
files are removed if the program is aborted.
|
||||
|
||||
jmemnobs.c (That stands for No Backing Store :-). This will
|
||||
compile on almost any system, but it assumes you
|
||||
have enough main memory or virtual memory to hold
|
||||
the biggest images you need to work with.
|
||||
|
||||
jmemdos.c This should be used in most MS-DOS installations; see
|
||||
the system-specific notes about MS-DOS for more info.
|
||||
IMPORTANT: if you use this, also copy jmemdos.h to
|
||||
jmemsys.h, replacing the standard version. ALSO,
|
||||
include the assembly file jmemdosa.asm in the programs.
|
||||
(This last is already done if you used one of the
|
||||
supplied MS-DOS-specific makefiles.)
|
||||
|
||||
If you have plenty of (real or virtual) main memory, just use jmemnobs.c.
|
||||
"Plenty" means at least ten bytes for every pixel in the largest images
|
||||
you plan to process, so a lot of systems don't meet this criterion.
|
||||
If yours doesn't, try jmemansi.c first. If that doesn't compile, you'll have
|
||||
to use jmemname.c; be sure to adjust select_file_name() for local conditions.
|
||||
You may also need to change unlink() to remove() in close_backing_store().
|
||||
|
||||
Except with jmemnobs.c, you need to adjust the #define DEFAULT_MAX_MEM to a
|
||||
reasonable value for your system (either by editing jmemsys.c, or by adding
|
||||
a -D switch to the Makefile). This value limits the amount of data space the
|
||||
program will attempt to allocate. Code and static data space isn't counted,
|
||||
so the actual memory needs for cjpeg or djpeg are typically 100 to 150Kb more
|
||||
than the max-memory setting. Larger max-memory settings reduce the amount of
|
||||
I/O needed to process a large image, but too large a value can result in
|
||||
"insufficient memory" failures. On most Unix machines (and other systems with
|
||||
virtual memory), just set DEFAULT_MAX_MEM to several million and forget it.
|
||||
At the other end of the spectrum, for MS-DOS machines you probably can't go
|
||||
much above 300K to 400K. (On MS-DOS the value refers to conventional memory;
|
||||
extended/expanded memory is handled separately by jmemdos.c.)
|
||||
|
||||
|
||||
STEP 4: MAKE
|
||||
============
|
||||
|
||||
Now you should be able to "make" the software.
|
||||
|
||||
If you have trouble with missing system include files or inclusion of the
|
||||
wrong ones, look at jinclude.h (or use ckconfig.c, if you are not a C expert).
|
||||
|
||||
If your compiler complains about big_sarray_control and big_barray_control
|
||||
being undefined structures, you should be able to shut it up by adding
|
||||
-DINCOMPLETE_TYPES_BROKEN to CFLAGS (or add #define INCOMPLETE_TYPES_BROKEN
|
||||
to jconfig.h). If you don't have a getenv() library routine, define NO_GETENV.
|
||||
|
||||
There are a fair number of routines that do not use all of their parameters;
|
||||
some compilers will issue warnings about this, which you can ignore. Any
|
||||
other warning deserves investigation.
|
||||
|
||||
|
||||
STEP 5: TEST
|
||||
============
|
||||
|
||||
As a quick test of functionality we've included a small sample image in
|
||||
several forms:
|
||||
testorig.jpg A reduced section of the well-known Lenna picture.
|
||||
testimg.ppm The output of djpeg testorig.jpg
|
||||
testimg.gif The output of djpeg -gif testorig.jpg
|
||||
testimg.jpg The output of cjpeg testimg.ppm
|
||||
(The two .jpg files aren't identical since JPEG is lossy.) If you can
|
||||
generate duplicates of the testimg.* files then you probably have working
|
||||
programs.
|
||||
|
||||
With most of the makefiles, "make test" will perform the necessary
|
||||
comparisons. If you started with makefile.ansi or makefile.unix, and you
|
||||
defined TWO_FILE_COMMANDLINE, then change the makefile's test script to use
|
||||
two-file syntax (i.e., delete the ">" character from the invocations of cjpeg
|
||||
and djpeg). The other makefiles will work with either command-line syntax.
|
||||
|
||||
If you're using a makefile that doesn't provide the test option, run djpeg and
|
||||
cjpeg by hand to generate testout.ppm, testout.gif, and testout.jpg, then
|
||||
compare these to testimg.* with whatever binary file comparison tool you have.
|
||||
The files should be bit-for-bit identical.
|
||||
|
||||
If the cjpeg test run fails with "Missing Huffman code table entry", it's a
|
||||
good bet that you needed to define RIGHT_SHIFT_IS_UNSIGNED. Go back to step 2
|
||||
and run ckconfig.c. (This is a good plan for any other test failure, too.)
|
||||
|
||||
If you are using Unix (one-file) command line style on a non-Unix system,
|
||||
it's a good idea to check that binary I/O through stdin/stdout actually works.
|
||||
You should get the same results from "djpeg <testorig.jpg >out.ppm" as from
|
||||
"djpeg -outfile out.ppm testorig.jpg". Note that the non-Unix makefiles use
|
||||
the latter style and therefore do not exercise stdin/stdout. If this test
|
||||
fails, try recompiling jcmain.c & jdmain.c with USE_SETMODE and/or USE_FDOPEN.
|
||||
|
||||
If your choice of jmemsys.c was anything other than jmemnobs.c, you should
|
||||
test that temporary-file usage works. Try "djpeg -gif -max 0 testorig.jpg"
|
||||
and make sure its output matches testimg.gif. If you have any really large
|
||||
images handy, try compressing them with -optimize and/or decompressing with
|
||||
-gif to make sure your DEFAULT_MAX_MEM setting is not too large.
|
||||
|
||||
NOTE: this is far from an exhaustive test of the JPEG software; some modules,
|
||||
such as 1-pass color quantization, are not exercised at all. It's just a quick
|
||||
test to give you some confidence that you haven't missed something major.
|
||||
|
||||
|
||||
STEP 6: INSTALLATION
|
||||
====================
|
||||
|
||||
Once you're done with the above steps, you can install the software by copying
|
||||
the executable files (cjpeg and djpeg) to wherever you normally install
|
||||
programs. On Unix systems, you'll also want to put cjpeg.1 and djpeg.1 in the
|
||||
corresponding manual directory. (The makefiles don't support this step since
|
||||
there's such a wide variety of installation procedures on different systems.)
|
||||
|
||||
To learn to use the programs, read the file USAGE (or manual pages cjpeg(1)
|
||||
and djpeg(1) on Unix). Note that the man pages cjpeg.1/djpeg.1 only describe
|
||||
the Unix-style command line syntax; if you want to use these files with a
|
||||
version that uses two-file command line syntax, you'll have to modify the text
|
||||
accordingly. The USAGE file describes both styles.
|
||||
|
||||
|
||||
OPTIMIZATION
|
||||
============
|
||||
|
||||
Unless you own a Cray, you'll probably be interested in making the JPEG
|
||||
software go as fast as possible. This section covers some machine-dependent
|
||||
optimizations you may want to try. We suggest that before trying any of this,
|
||||
you first get the basic installation to pass the self-test (step 5 above).
|
||||
Repeat the self-test after any optimization to make sure that you haven't
|
||||
broken anything.
|
||||
|
||||
The JPEG DCT routines perform a lot of multiplications. These multiplications
|
||||
must yield 32-bit results, but none of their input values are more than 16
|
||||
bits wide. On many machines, notably the 680x0 and 80x86 CPUs, a 16x16=>32
|
||||
bit multiply instruction is faster than a full 32x32=>32 bit multiply.
|
||||
Unfortunately there is no portable way to specify such a multiplication in C,
|
||||
but some compilers can generate one when you use the right combination of
|
||||
casts. See the MULTIPLY macro definitions in jfwddct.c and jrevdct.c.
|
||||
If your compiler makes "int" be 32 bits and "short" be 16 bits, defining
|
||||
SHORTxSHORT_32 is fairly likely to work. When experimenting with alternate
|
||||
definitions, be sure to test not only whether the code still works (use the
|
||||
self-test step), but also whether it is actually faster --- on some compilers,
|
||||
alternate definitions may compute the right answer, yet be slower than the
|
||||
default. Timing cjpeg on a large PPM input file is the best way to check
|
||||
this, as the DCT will be the largest fraction of the runtime in that mode.
|
||||
(Note: some of the distributed compiler-specific makefiles already contain
|
||||
-D switches to select an appropriate MULTIPLY definition.)
|
||||
|
||||
If access to "short" arrays is slow on your machine, it may be a win to define
|
||||
type DCTELEM as int rather than as JCOEF (which is normally defined as short).
|
||||
This will cause the DCT routines to operate on int arrays instead of short
|
||||
arrays. If shorts are slow and you have lots of memory to burn, you might
|
||||
even make JCOEF itself be int.
|
||||
|
||||
If your compiler can compile function calls in-line, make sure the INLINE
|
||||
macro in jconfig.h is defined as the keyword that marks a function
|
||||
inline-able. Some compilers have a switch that tells the compiler to inline
|
||||
any function it thinks is profitable (e.g., -finline-functions for gcc).
|
||||
Enabling such a switch is likely to make the compiled code bigger but faster.
|
||||
|
||||
In general, it's worth trying the maximum optimization level of your compiler,
|
||||
and experimenting with any optional optimizations such as loop unrolling.
|
||||
(Unfortunately, far too many compilers have optimizer bugs ... be prepared to
|
||||
back off if the code fails self-test.) If you do any experimentation along
|
||||
these lines, please report the optimal settings to jpeg-info@uunet.uu.net so
|
||||
we can mention them in future releases. Be sure to specify your machine and
|
||||
compiler version.
|
||||
|
||||
|
||||
OPTIONAL STUFF
|
||||
==============
|
||||
|
||||
Progress monitor:
|
||||
|
||||
If you like, you can #define PROGRESS_REPORT (in jconfig.h or in the Makefile)
|
||||
to enable display of percent-done progress reports. The routines provided in
|
||||
jcmain.c/jdmain.c merely print percentages to stderr, but you can customize
|
||||
them to do something fancier.
|
||||
|
||||
Utah RLE file format support:
|
||||
|
||||
We distribute the software with support for RLE image files (Utah Raster
|
||||
Toolkit format) disabled, because the RLE support won't compile without the
|
||||
Utah library. If you have URT version 3.0, you can enable RLE support as
|
||||
follows:
|
||||
1. #define RLE_SUPPORTED in jconfig.h or in the Makefile.
|
||||
2. Add a -I option to CFLAGS in the Makefile for the directory
|
||||
containing the URT .h files (typically the "include"
|
||||
subdirectory of the URT distribution).
|
||||
3. Add -L... -lrle to LDLIBS in the Makefile, where ... specifies
|
||||
the directory containing the URT "librle.a" file (typically the
|
||||
"lib" subdirectory of the URT distribution).
|
||||
|
||||
JPEG library:
|
||||
|
||||
If you want to incorporate the JPEG code as subroutines in a larger program,
|
||||
we recommend that you make libjpeg.a, then link that into your surrounding
|
||||
program. See file README for more info.
|
||||
|
||||
CAUTION: When you use the JPEG code as subroutines, we recommend that you make
|
||||
any required configuration changes by modifying jconfig.h, not by adding -D
|
||||
switches to the Makefile. Otherwise you must be sure to provide the same -D
|
||||
switches when compiling any program that includes the JPEG .h files, to ensure
|
||||
that the parameter structures are interpreted the same way. (This is only
|
||||
critical for the first few symbols mentioned in jconfig.h, down through
|
||||
NEED_FAR_POINTERS.)
|
||||
|
||||
Removing code:
|
||||
|
||||
If you need to make a smaller version of the JPEG software, some optional
|
||||
functions can be removed at compile time. See the xxx_SUPPORTED #defines in
|
||||
jconfig.h. If at all possible, we recommend that you leave in decoder support
|
||||
for all valid JPEG files, to ensure that you can read anyone's output.
|
||||
Restricting your encoder, or removing optional functions like block smoothing,
|
||||
won't hurt compatibility. Taking out support for image file formats that you
|
||||
don't use is the most painless way to make the programs smaller.
|
||||
|
||||
|
||||
NOTES FOR SPECIFIC SYSTEMS
|
||||
==========================
|
||||
|
||||
We welcome reports on changes needed for systems not mentioned here.
|
||||
Submit 'em to jpeg-info@uunet.uu.net. Also, if ckconfig.c is wrong about
|
||||
how to configure the JPEG software for your system, please let us know.
|
||||
|
||||
|
||||
Amiga:
|
||||
|
||||
Makefiles are provided for Manx Aztec C and SAS C. I have also heard from
|
||||
people who have compiled with the free DICE compiler, using makefile.ansi as a
|
||||
starting point (set "CC= dcc" and "CFLAGS= -c -DAMIGA -DTWO_FILE_COMMANDLINE
|
||||
-DNEED_SIGNAL_CATCHER" in the makefile). For all compilers, we recommend you
|
||||
use jmemname.c as the system-dependent memory manager. Assuming you have
|
||||
-DAMIGA in the makefile, jmemname.c will put temporary files in JPEGTMP:.
|
||||
Change jmemname.c if you don't like this.
|
||||
|
||||
|
||||
Atari:
|
||||
|
||||
The project files provided should work as-is with Pure C. For Turbo C, change
|
||||
library filenames "PC..." to "TC..." in the project files for cjpeg.ttp and
|
||||
djpeg.ttp. Don't forget to select a jmemsys.c file, see Step 3 (we recommend
|
||||
jmemansi.c). Also adjust the DEFAULT_MAX_MEM setting --- you probably want it
|
||||
to be a couple hundred K less than your normal free memory. Note that you
|
||||
must make jpeg.lib before making cjpeg.ttp or cjpeg.ttp. You'll have to
|
||||
perform the self-test (Step 5) by hand.
|
||||
|
||||
There is a bug in some older versions of the Turbo C library which causes the
|
||||
space used by temporary files created with "tmpfile()" not to be freed after
|
||||
an abnormal program exit. If you check your disk afterwards, you will find
|
||||
cluster chains that are allocated but not used by a file. This should not
|
||||
happen in cjpeg or djpeg, since we enable a signal catcher to explicitly close
|
||||
temp files before exiting. But if you use the JPEG library with your own
|
||||
code, be sure to supply a signal catcher, or else use a different
|
||||
system-dependent memory manager.
|
||||
|
||||
|
||||
Cray:
|
||||
|
||||
Should you be so fortunate as to be running JPEG on a Cray YMP, there is a
|
||||
compiler bug in Cray's Standard C versions prior to 3.1. You'll need to
|
||||
insert a line reading "#pragma novector" just before the loop
|
||||
for (i = 1; i <= (int) htbl->bits[l]; i++)
|
||||
huffsize[p++] = (char) l;
|
||||
in fix_huff_tbl (in V4A, line 42 of jchuff.c and line 39 of jdhuff.c). The
|
||||
usual symptom of not adding this line is a core-dump. See Cray's SPR 48222.
|
||||
|
||||
|
||||
HP/Apollo DOMAIN:
|
||||
|
||||
With system release 10.4 or later, makefile.ansi should work OK. If you have
|
||||
version 10.3.anything, you need to figure out whether you have the ANSI C
|
||||
compiler (version 6.7 or later) and whether you've installed the ANSI C
|
||||
include files (if so, the first line of <stdio.h> will mention ANSI C).
|
||||
If you have the ANSI C compiler but not the ANSI C include files, use
|
||||
makefile.ansi and add -DNONANSI_INCLUDES to CFLAGS. If you have both,
|
||||
then makefile.ansi should work as is. If neither, use makefile.unix.
|
||||
|
||||
|
||||
HP-UX:
|
||||
|
||||
If you have HP-UX 7.05 or later with the "software development" C compiler,
|
||||
then you can use makefile.ansi. Add "-Aa" to the CFLAGS line in the makefile
|
||||
to make the compiler work in ANSI mode. If you have a pre-7.05 system, or if
|
||||
you are using the non-ANSI C compiler delivered with a minimum HP-UX 8.0
|
||||
system, then you must use makefile.unix (and do NOT add -Aa). Also, adding
|
||||
"-lmalloc" to LDLIBS is recommended if you have libmalloc.a (it seems not to
|
||||
be present in minimum 8.0).
|
||||
|
||||
On HP 9000 series 800 machines, the HP C compiler is buggy in revisions prior
|
||||
to A.08.07. If you get complaints about "not a typedef name", you'll have to
|
||||
convert the code to K&R style (i.e., use makefile.unix).
|
||||
|
||||
|
||||
Macintosh MPW:
|
||||
|
||||
We don't directly support MPW in the current release, but Larry Rosenstein
|
||||
reports that the JPEG code can be ported without very much trouble. There's
|
||||
useful notes and conversion scripts in his kit for porting PBMPLUS to MPW.
|
||||
You can obtain the kit by FTP to ftp.apple.com, file /pub/lsr/pbmplus-port*.
|
||||
|
||||
|
||||
Macintosh Think C:
|
||||
|
||||
You'll have to prepare project files for cjpeg and djpeg; we don't include
|
||||
those in the distribution since they are not text files. The COBJECTS and
|
||||
DOBJECTS lists in makefile.unix show which files should be included in each
|
||||
project. Also add the ANSI and Unix C libraries in a separate segment. You
|
||||
may need to divide the JPEG files into more than one segment; you can do this
|
||||
pretty much as you please.
|
||||
|
||||
If you have Think C version 5.0 you need not modify jconfig.h; instead you
|
||||
should turn on both the ANSI Settings and Language Extensions option buttons
|
||||
(so that both __STDC__ and THINK_C are predefined). With version 4.0 you must
|
||||
edit jconfig.h. (You can #define HAVE_STDC to do the right thing for all
|
||||
options except const; you must also #define const.)
|
||||
|
||||
jcmain and jdmain are set up to provide the usual command-line interface
|
||||
by means of Think's ccommand() library routine. A more Mac-like interface
|
||||
is in the works.
|
||||
|
||||
|
||||
MS-DOS, generic comments:
|
||||
|
||||
The JPEG code is designed to be compiled with 80x86 "small" or "medium" memory
|
||||
models (i.e., data pointers are 16 bits unless explicitly declared "far"; code
|
||||
pointers can be either size). You should be able to use small model to
|
||||
compile cjpeg or djpeg by itself, but you will probably have to go to medium
|
||||
model if you include the JPEG code in a larger application. This shouldn't
|
||||
hurt performance much. You *will* take a noticeable performance hit if you
|
||||
compile in a large-data memory model, and you should avoid "huge" model if at
|
||||
all possible. Be sure that NEED_FAR_POINTERS is defined by jconfig.h or by
|
||||
the Makefile if you use a small-data model; be sure it is NOT defined if you
|
||||
use a large-data memory model. (As distributed, jconfig.h defines
|
||||
NEED_FAR_POINTERS if MSDOS is defined.)
|
||||
|
||||
The DOS-specific memory manager, jmemdos.c, should be used if possible.
|
||||
(Be sure to install jmemdos.h and jmemdosa.asm along with it.) If you
|
||||
can't use jmemdos.c for some reason --- for example, because you don't have
|
||||
a Microsoft-compatible assembler to assemble jmemdosa.asm --- you'll have
|
||||
to fall back to jmemansi.c or jmemname.c. IMPORTANT: if you use either of
|
||||
the latter two files, you will have to compile in a large-data memory model
|
||||
in order to get the right stdio library. Too bad.
|
||||
|
||||
None of the above advice applies if you are using a 386 flat-memory-space
|
||||
environment, such as DJGPP or Watcom C. (And you should use one if you have
|
||||
it, as performance will be much better than 8086-compatible code!) For
|
||||
flat-memory-space compilers, do NOT define NEED_FAR_POINTERS, and do NOT use
|
||||
jmemdos.c. Use jmemnobs.c if the environment supplies adequate virtual
|
||||
memory, otherwise use jmemansi.c or jmemname.c.
|
||||
|
||||
Most MS-DOS compilers treat stdin/stdout as text files, so you must use
|
||||
two-file command line style. But if your compiler has either fdopen() or
|
||||
setmode(), you can use one-file style if you like. To do this, define
|
||||
USE_FDOPEN or USE_SETMODE so that stdin/stdout will be set to binary mode.
|
||||
(USE_SETMODE seems to work with more DOS compilers than USE_FDOPEN.) You
|
||||
should test that I/O through stdin/stdout produces the same results as I/O
|
||||
to explicitly named files... the "make test" procedures in the DOS-specific
|
||||
makefiles do NOT use stdin/stdout.
|
||||
|
||||
If you add more switches to CFLAGS in the DOS-specific makefiles, you are
|
||||
likely to run up against DOS' 128-byte command line length limit. In that
|
||||
case, remove some "-Dsymbol" switches from CFLAGS and instead put
|
||||
corresponding "#define symbol" lines at the head of jinclude.h.
|
||||
|
||||
|
||||
MS-DOS, Borland C:
|
||||
|
||||
Be sure to convert all the source files to DOS text format (CR/LF newlines).
|
||||
Although Borland C will often work OK with unmodified Unix (LF newlines)
|
||||
source files, sometimes it will give bogus compile errors.
|
||||
"Illegal character '#'" is the most common such error.
|
||||
|
||||
Some versions of Borland's MAKE erroneously display the warning message about
|
||||
creating jmemsys.c, even after you have done so. If this happens to you,
|
||||
delete the four lines beginning with "jmemsys.c:" from the Makefile.
|
||||
|
||||
If you want one-file command line style, define USE_SETMODE. fdopen() does
|
||||
not work correctly.
|
||||
|
||||
|
||||
MS-DOS, DJGPP:
|
||||
|
||||
Use makefile.ansi and jmemnobs.c, and put "-UMSDOS" in CFLAGS to undo the
|
||||
compiler's automatic definition of MSDOS. Also put either "-DUSE_SETMODE" or
|
||||
"-DTWO_FILE_COMMANDLINE" in CFLAGS, depending on whether you prefer one-file
|
||||
or two-file command line style. You'll also need to put the object-file lists
|
||||
into response files in order to circumvent DOS's 128-byte command line length
|
||||
limit at the final linking step.
|
||||
|
||||
|
||||
MS-DOS, Microsoft C:
|
||||
|
||||
Old versions of MS C fail with an "out of macro expansion space" error
|
||||
because they can't cope with the macro TRACEMS8 (defined in jpegdata.h).
|
||||
If this happens to you, the easiest solution is to change TRACEMS8 to
|
||||
expand to nothing. You'll lose the ability to dump out JPEG coefficient
|
||||
tables with djpeg -debug -debug, but at least you can compile.
|
||||
|
||||
Original MS C 6.0 is buggy; it compiles incorrect code unless you turn off
|
||||
optimization (remove -O from CFLAGS). That problem seems to have been fixed
|
||||
in 6.00A and later versions. 6.00A still generates a bogus "conditional
|
||||
expression is constant" warning in jrdppm.c, but the emitted code seems OK.
|
||||
|
||||
If you want one-file command line style, define USE_SETMODE. fdopen() does
|
||||
not work correctly, at least not in 6.00A.
|
||||
|
||||
|
||||
SGI:
|
||||
|
||||
Use makefile.ansi, but set "AR2= ar -ts" rather than "AR2= ranlib". Also
|
||||
make any changes recommended by ckconfig.c.
|
||||
|
||||
|
||||
Sun:
|
||||
|
||||
Don't forget to add -DBSD to CFLAGS. If you are using GCC on SunOS 4.0.1 or
|
||||
earlier, you will need to add -DNONANSI_INCLUDES to CFLAGS (your compiler may
|
||||
be ANSI, but your system include files aren't). I've gotten conflicting
|
||||
reports on whether this is still necessary on SunOS 4.1 or later.
|
||||
308
USAGE
@@ -1,308 +0,0 @@
|
||||
USAGE instructions for the Independent JPEG Group's JPEG software
|
||||
=================================================================
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
This distribution contains software to implement JPEG image compression and
|
||||
decompression. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG is designed to handle
|
||||
"real-world" scenes, for example scanned photographs. Cartoons, line
|
||||
drawings, and other non-realistic images are not JPEG's strong suit; on this
|
||||
sort of material you may get poor image quality and/or little compression.
|
||||
|
||||
JPEG is lossy, meaning that the output image is not necessarily identical to
|
||||
the input image. Hence you should not use JPEG if you have to have identical
|
||||
output bits. However, on typical real-world images, very good compression
|
||||
levels can be obtained with no visible change, and amazingly high compression
|
||||
is possible if you can tolerate a low-quality image. You can trade off image
|
||||
quality against file size by adjusting the compressor's "quality" setting.
|
||||
|
||||
This file describes usage of the standard programs "cjpeg" and "djpeg" that
|
||||
can be built directly from the distributed C code. See the README file for
|
||||
hints on incorporating the JPEG software into other programs.
|
||||
|
||||
If you are on a Unix machine you may prefer to read the Unix-style manual
|
||||
pages in files cjpeg.1 and djpeg.1. But also see the HINTS section below,
|
||||
which is not present in either manual page.
|
||||
|
||||
NOTE: the switch syntax has been redesigned since the v3 release of
|
||||
cjpeg/djpeg. Switch names are now words instead of single letters.
|
||||
|
||||
|
||||
GENERAL USAGE
|
||||
|
||||
We provide two programs, cjpeg to compress an image file into JPEG format,
|
||||
and djpeg to decompress a JPEG file back into a conventional image format.
|
||||
|
||||
On Unix-like systems, you say:
|
||||
cjpeg [switches] [imagefile] >jpegfile
|
||||
or
|
||||
djpeg [switches] [jpegfile] >imagefile
|
||||
The programs read the specified input file, or standard input if none is
|
||||
named. They always write to standard output (with trace/error messages to
|
||||
standard error). These conventions are handy for piping images between
|
||||
programs.
|
||||
|
||||
On most non-Unix systems, you say:
|
||||
cjpeg [switches] imagefile jpegfile
|
||||
or
|
||||
djpeg [switches] jpegfile imagefile
|
||||
i.e., both the input and output files are named on the command line. This
|
||||
style is a little more foolproof, and it loses no functionality if you don't
|
||||
have pipes. (You can get this style on Unix too, if you prefer, by defining
|
||||
TWO_FILE_COMMANDLINE when you compile the programs; see SETUP.)
|
||||
|
||||
You can also say:
|
||||
cjpeg [switches] -outfile jpegfile imagefile
|
||||
or
|
||||
djpeg [switches] -outfile imagefile jpegfile
|
||||
This syntax works on all systems, so it is useful for scripts.
|
||||
|
||||
The currently supported image file formats are: PPM (PBMPLUS color format),
|
||||
PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster Toolkit
|
||||
format). (RLE is supported only if the URT library is available.)
|
||||
cjpeg recognizes the input image format automatically, with the exception
|
||||
of some Targa-format files. You have to tell djpeg which format to generate.
|
||||
|
||||
The only JPEG file format currently supported is the JFIF format. Support for
|
||||
the TIFF 6.0 JPEG format will probably be added at some future date.
|
||||
|
||||
All switch names may be abbreviated; for example, -grayscale may be written
|
||||
-gray or -gr. Most of the "basic" switches can be abbreviated to as little as
|
||||
one letter. Upper and lower case are equivalent (-GIF is the same as -gif).
|
||||
British spellings are also accepted (e.g., -greyscale), though for brevity
|
||||
these are not mentioned below.
|
||||
|
||||
|
||||
CJPEG DETAILS
|
||||
|
||||
The basic command line switches for cjpeg are:
|
||||
|
||||
-quality N Scale quantization tables to adjust image quality.
|
||||
Quality is 0 (worst) to 100 (best); default is 75.
|
||||
(See below for more info.)
|
||||
|
||||
-grayscale Create monochrome JPEG file from color input.
|
||||
Be sure to use this switch when compressing a grayscale
|
||||
GIF file, because cjpeg isn't bright enough to notice
|
||||
whether a GIF file uses only shades of gray. By
|
||||
saying -grayscale, you'll get a smaller JPEG file that
|
||||
takes less time to process.
|
||||
|
||||
-optimize Perform optimization of entropy encoding parameters.
|
||||
Without this, default encoding parameters are used.
|
||||
-optimize usually makes the JPEG file a little smaller,
|
||||
but cjpeg runs somewhat slower and needs much more
|
||||
memory. Image quality and speed of decompression are
|
||||
unaffected by -optimize.
|
||||
|
||||
-targa Input file is Targa format. Targa files that contain
|
||||
an "identification" field will not be automatically
|
||||
recognized by cjpeg; for such files you must specify
|
||||
-targa to make cjpeg treat the input as Targa format.
|
||||
|
||||
The -quality switch lets you trade off compressed file size against quality of
|
||||
the reconstructed image: the higher the quality setting, the larger the JPEG
|
||||
file, and the closer the output image will be to the original input. Normally
|
||||
you want to use the lowest quality setting (smallest file) that decompresses
|
||||
into something visually indistinguishable from the original image. For this
|
||||
purpose the quality setting should be between 50 and 95; the default of 75 is
|
||||
often about right. If you see defects at -quality 75, then go up 5 or 10
|
||||
counts at a time until you are happy with the output image. (The optimal
|
||||
setting will vary from one image to another.)
|
||||
|
||||
-quality 100 will generate a quantization table of all 1's, eliminating loss
|
||||
in the quantization step (but there is still information loss in subsampling,
|
||||
as well as roundoff error). This setting is mainly of interest for
|
||||
experimental purposes. Quality values above about 95 are NOT recommended for
|
||||
normal use; the compressed file size goes up dramatically for hardly any gain
|
||||
in output image quality.
|
||||
|
||||
In the other direction, quality values below 50 will produce very small files
|
||||
of low image quality. Settings around 5 to 10 might be useful in preparing an
|
||||
index of a large image library, for example. Try -quality 2 (or so) for some
|
||||
amusing Cubist effects. (Note: quality values below about 25 generate 2-byte
|
||||
quantization tables, which are considered optional in the JPEG standard.
|
||||
cjpeg emits a warning message when you give such a quality value, because
|
||||
some commercial JPEG programs may be unable to decode the resulting file.)
|
||||
|
||||
Switches for advanced users:
|
||||
|
||||
-maxmemory N Set limit for amount of memory to use in processing
|
||||
large images. Value is in thousands of bytes, or
|
||||
millions of bytes if "M" is attached to the number.
|
||||
For example, -max 4m selects 4000000 bytes. If more
|
||||
space is needed, temporary files will be used.
|
||||
|
||||
-restart N Emit a JPEG restart marker every N MCU rows, or every
|
||||
N MCU blocks if "B" is attached to the number.
|
||||
-restart 0 (the default) means no restart markers.
|
||||
|
||||
-smooth N Smooth the input image to eliminate dithering noise.
|
||||
N, ranging from 1 to 100, indicates the strength of
|
||||
smoothing. 0 (the default) means no smoothing.
|
||||
|
||||
-verbose Enable debug printout. More -v's give more printout.
|
||||
or -debug Also, version information is printed at startup.
|
||||
|
||||
The -restart option inserts extra markers that allow a JPEG decoder to
|
||||
resynchronize after a transmission error. Without restart markers, any damage
|
||||
to a compressed file will usually ruin the image from the point of the error
|
||||
to the end of the image; with restart markers, the damage is usually confined
|
||||
to the portion of the image up to the next restart marker. Of course, the
|
||||
restart markers occupy extra space. We recommend -restart 1 for images that
|
||||
will be transmitted across unreliable networks such as Usenet.
|
||||
|
||||
The -smooth option filters the input to eliminate fine-scale noise. This is
|
||||
often useful when converting GIF files to JPEG: a moderate smoothing factor of
|
||||
10 to 50 gets rid of dithering patterns in the input file, resulting in a
|
||||
smaller JPEG file and a better-looking image. Too large a smoothing factor
|
||||
will visibly blur the image, however.
|
||||
|
||||
Switches for wizards:
|
||||
|
||||
-arithmetic Use arithmetic coding rather than Huffman coding.
|
||||
(Not currently supported for legal reasons.)
|
||||
|
||||
-nointerleave Generate noninterleaved JPEG file (not yet supported).
|
||||
|
||||
-qtables file Use the quantization tables given in the specified
|
||||
file. The file should contain one to four tables
|
||||
(64 values each) as plain text. Comments preceded by
|
||||
'#' may be included in the file. The tables are
|
||||
implicitly numbered 0,1,etc. If -quality N is also
|
||||
specified, the values in the file are scaled according
|
||||
to cjpeg's quality scaling curve.
|
||||
|
||||
-sample HxV[,...] Set JPEG sampling factors. If you specify
|
||||
fewer H/V pairs than there are components, the
|
||||
remaining components are set to 1x1 sampling. The
|
||||
default setting is equivalent to "-sample 2x2".
|
||||
|
||||
The "wizard" switches are intended for experimentation with JPEG. If you
|
||||
don't know what you are doing, DON'T USE THEM. You can easily produce files
|
||||
with worse image quality and/or poorer compression than you'll get from the
|
||||
default settings. Furthermore, these switches should not be used when making
|
||||
files intended for general use, because not all JPEG implementations will
|
||||
support unusual JPEG parameter settings.
|
||||
|
||||
|
||||
DJPEG DETAILS
|
||||
|
||||
The basic command line switches for djpeg are:
|
||||
|
||||
-colors N Reduce image to at most N colors. This reduces the
|
||||
or -quantize N number of colors used in the output image, so that it
|
||||
can be displayed on a colormapped display or stored in
|
||||
a colormapped file format. For example, if you have
|
||||
an 8-bit display, you'd need to reduce to 256 or fewer
|
||||
colors. (-colors is the recommended name, -quantize
|
||||
is provided only for backwards compatibility.)
|
||||
|
||||
-gif Select GIF output format. Since GIF does not support
|
||||
more than 256 colors, -colors 256 is assumed (unless
|
||||
you specify a smaller number of colors).
|
||||
|
||||
-pnm Select PBMPLUS (PPM/PGM) output format (this is the
|
||||
default format). PGM is emitted if the JPEG file is
|
||||
gray-scale or if -grayscale is specified; otherwise
|
||||
PPM is emitted.
|
||||
|
||||
-rle Select RLE output format. (Requires URT library.)
|
||||
|
||||
-targa Select Targa output format. Gray-scale format is
|
||||
emitted if the JPEG file is gray-scale or if
|
||||
-grayscale is specified; otherwise, colormapped format
|
||||
is emitted if -colors is specified; otherwise, 24-bit
|
||||
full-color format is emitted.
|
||||
|
||||
Switches for advanced users:
|
||||
|
||||
-blocksmooth Perform cross-block smoothing. This is slow, quite
|
||||
memory-intensive, and only seems to improve the image
|
||||
at very low quality settings (-quality 10 to 20 or so).
|
||||
At normal quality settings it may make things worse.
|
||||
|
||||
-grayscale Force gray-scale output even if JPEG file is color.
|
||||
Useful for viewing on monochrome displays.
|
||||
|
||||
-maxmemory N Set limit for amount of memory to use in processing
|
||||
large images. Value is in thousands of bytes, or
|
||||
millions of bytes if "M" is attached to the number.
|
||||
For example, -max 4m selects 4000000 bytes. If more
|
||||
space is needed, temporary files will be used.
|
||||
|
||||
-nodither Do not use dithering in color quantization.
|
||||
By default, Floyd-Steinberg dithering is applied when
|
||||
quantizing colors, but on some images dithering may
|
||||
result in objectionable "graininess". If that
|
||||
happens, you can turn off dithering with -nodither.
|
||||
-nodither is ignored unless you also say -colors N.
|
||||
|
||||
-onepass Use one-pass instead of two-pass color quantization.
|
||||
The one-pass method is faster and needs less memory,
|
||||
but it produces a lower-quality image. -onepass is
|
||||
ignored unless you also say -colors N. Also,
|
||||
the one-pass method is always used for gray-scale
|
||||
output (the two-pass method is no improvement then).
|
||||
|
||||
-verbose Enable debug printout. More -v's give more printout.
|
||||
or -debug Also, version information is printed at startup.
|
||||
|
||||
|
||||
HINTS
|
||||
|
||||
Color GIF files are not the ideal input for JPEG; JPEG is really intended for
|
||||
compressing full-color (24-bit) images. In particular, don't try to convert
|
||||
cartoons, line drawings, and other images that have only a few distinct
|
||||
colors. GIF works great on these, JPEG does not. If you want to convert a
|
||||
GIF to JPEG, you should experiment with cjpeg's -quality and -smooth options
|
||||
to get a satisfactory conversion. -smooth 10 or so is often helpful.
|
||||
|
||||
Avoid running an image through a series of JPEG compression/decompression
|
||||
cycles. Image quality loss will accumulate; after ten or so cycles the image
|
||||
may be noticeably worse than it was after one cycle. It's best to use a
|
||||
lossless format while manipulating an image, then convert to JPEG format when
|
||||
you are ready to file the image away.
|
||||
|
||||
The -optimize option to cjpeg is worth using when you are making a "final"
|
||||
version for posting or archiving. It's also a win when you are using low
|
||||
quality settings to make very small JPEG files; the percentage improvement
|
||||
is often a lot more than it is on larger files.
|
||||
|
||||
When making images to be posted on Usenet, we recommend using cjpeg's option
|
||||
-restart 1. This option limits the damage done to a compressed image by
|
||||
netnews transmission errors.
|
||||
|
||||
The default memory usage limit (-maxmemory) is set when the software is
|
||||
compiled. If you get an "insufficient memory" error, try specifying a smaller
|
||||
-maxmemory value, even -maxmemory 0 to use the absolute minimum space. You
|
||||
may want to recompile with a smaller default value if this happens often.
|
||||
|
||||
On machines that have "environment" variables, you can define the environment
|
||||
variable JPEGMEM to set the default memory limit. The value is specified as
|
||||
described for the -maxmemory switch. JPEGMEM overrides the default value
|
||||
specified when the program was compiled, and itself is overridden by an
|
||||
explicit -maxmemory switch.
|
||||
|
||||
On MS-DOS machines, -maxmemory is the amount of main (conventional) memory to
|
||||
use. (Extended or expanded memory is also used if available.) Most
|
||||
DOS-specific versions of this software do their own memory space estimation
|
||||
and do not need -maxmemory.
|
||||
|
||||
djpeg with two-pass color quantization requires a good deal of memory; on
|
||||
MS-DOS machines it may run out of memory even with -maxmemory 0. In that case
|
||||
you can still decompress, with some loss of image quality, by specifying
|
||||
-onepass for one-pass quantization.
|
||||
|
||||
If more space is needed than will fit in the available main memory (as
|
||||
determined by -maxmemory), temporary files will be used. (MS-DOS versions
|
||||
will try to get extended or expanded memory first.) The temporary files are
|
||||
often rather large: in typical cases they occupy three bytes per pixel, for
|
||||
example 3*800*600 = 1.44Mb for an 800x600 image. If you don't have enough
|
||||
free disk space, leave out -optimize (for cjpeg) or specify -onepass (for
|
||||
djpeg). On MS-DOS, the temporary files are created in the directory named by
|
||||
the TMP or TEMP environment variable, or in the current directory if neither
|
||||
of those exist. Amiga implementations put the temp files in the directory
|
||||
named by JPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with
|
||||
adequate free space.
|
||||
182
acinclude.m4
Normal file
@@ -0,0 +1,182 @@
|
||||
# AC_PROG_NASM
|
||||
# --------------------------
|
||||
# Check that NASM exists and determine flags
|
||||
AC_DEFUN([AC_PROG_NASM],[
|
||||
|
||||
AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
|
||||
test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])
|
||||
|
||||
AC_MSG_CHECKING([for object file format of host system])
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | interix*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='Win64-COFF'
|
||||
;;
|
||||
*)
|
||||
objfmt='Win32-COFF'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
msdosdjgpp* | go32*)
|
||||
objfmt='COFF'
|
||||
;;
|
||||
os2-emx*) # not tested
|
||||
objfmt='MSOMF' # obj
|
||||
;;
|
||||
linux*coff* | linux*oldld*)
|
||||
objfmt='COFF' # ???
|
||||
;;
|
||||
linux*aout*)
|
||||
objfmt='a.out'
|
||||
;;
|
||||
linux*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='ELF64'
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd* | netbsd* | openbsd*)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
|
||||
objfmt='BSD-a.out'
|
||||
else
|
||||
case "$host_cpu" in
|
||||
x86_64 | amd64)
|
||||
objfmt='ELF64'
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
solaris* | sunos* | sysv* | sco*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='ELF64'
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
darwin* | rhapsody* | nextstep* | openstep* | macos*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='Mach-O64'
|
||||
;;
|
||||
*)
|
||||
objfmt='Mach-O'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF ?'
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_RESULT([$objfmt])
|
||||
if test "$objfmt" = 'ELF ?'; then
|
||||
objfmt='ELF'
|
||||
AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
|
||||
case "$objfmt" in
|
||||
MSOMF) NAFLAGS='-fobj -DOBJ32';;
|
||||
Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
|
||||
Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
|
||||
COFF) NAFLAGS='-fcoff -DCOFF';;
|
||||
a.out) NAFLAGS='-faout -DAOUT';;
|
||||
BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
|
||||
ELF) NAFLAGS='-felf -DELF';;
|
||||
ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
|
||||
RDF) NAFLAGS='-frdf -DRDF';;
|
||||
Mach-O) NAFLAGS='-fmacho -DMACHO';;
|
||||
Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
|
||||
esac
|
||||
AC_MSG_RESULT([$NAFLAGS])
|
||||
AC_SUBST([NAFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
|
||||
cat > conftest.asm <<EOF
|
||||
[%line __oline__ "configure"
|
||||
section .text
|
||||
global _main,main
|
||||
_main:
|
||||
main: xor eax,eax
|
||||
ret
|
||||
]EOF
|
||||
try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
|
||||
if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.asm >&AC_FD_CC
|
||||
rm -rf conftest*
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether the linker accepts assembler output])
|
||||
try_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC'
|
||||
if AC_TRY_EVAL(try_nasm) && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
rm -rf conftest*
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([configuration problem: maybe object file format mismatch.])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
# AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE
|
||||
# --------------------------
|
||||
# Test whether the assembler is suitable and supports NEON instructions
|
||||
AC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[
|
||||
ac_good_gnu_arm_assembler=no
|
||||
ac_save_CC="$CC"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
|
||||
CC="$CCAS"
|
||||
AC_COMPILE_IFELSE([[
|
||||
.text
|
||||
.fpu neon
|
||||
.arch armv7a
|
||||
.object_arch armv4
|
||||
.arm
|
||||
pld [r0]
|
||||
vmovn.u16 d0, q0]], ac_good_gnu_arm_assembler=yes)
|
||||
|
||||
ac_use_gas_preprocessor=no
|
||||
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
|
||||
CC="gas-preprocessor.pl $CCAS"
|
||||
AC_COMPILE_IFELSE([[
|
||||
.text
|
||||
.fpu neon
|
||||
.arch armv7a
|
||||
.object_arch armv4
|
||||
.arm
|
||||
pld [r0]
|
||||
vmovn.u16 d0, q0]], ac_use_gas_preprocessor=yes)
|
||||
fi
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CC="$ac_save_CC"
|
||||
|
||||
if test "x$ac_use_gas_preprocessor" = "xyes" ; then
|
||||
CCAS="gas-preprocessor.pl $CCAS"
|
||||
AC_SUBST([CCAS])
|
||||
ac_good_gnu_arm_assembler=yes
|
||||
fi
|
||||
|
||||
if test "x$ac_good_gnu_arm_assembler" = "xyes" ; then
|
||||
$1
|
||||
else
|
||||
$2
|
||||
fi
|
||||
])
|
||||
477
ansi2knr.c
@@ -1,477 +0,0 @@
|
||||
/* Copyright (C) 1989, 1991 Aladdin Enterprises. All rights reserved.
|
||||
Distributed by Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Ghostscript.
|
||||
|
||||
Ghostscript is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
|
||||
to anyone for the consequences of using it or for whether it serves any
|
||||
particular purpose or works at all, unless he says so in writing. Refer
|
||||
to the Ghostscript General Public License for full details.
|
||||
|
||||
Everyone is granted permission to copy, modify and redistribute
|
||||
Ghostscript, but only under the conditions described in the Ghostscript
|
||||
General Public License. A copy of this license is supposed to have been
|
||||
given to you along with Ghostscript so you can know your rights and
|
||||
responsibilities. It should be in a file named COPYING. Among other
|
||||
things, the copyright notice and this notice must be preserved on all
|
||||
copies. */
|
||||
|
||||
/*
|
||||
---------- Here is the GhostScript file COPYING, referred to above ----------
|
||||
----- These terms do NOT apply to the JPEG software itself; see README ------
|
||||
|
||||
GHOSTSCRIPT GENERAL PUBLIC LICENSE
|
||||
(Clarified 11 Feb 1988)
|
||||
|
||||
Copyright (C) 1988 Richard M. Stallman
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license, but changing it is not allowed. You can also use this wording
|
||||
to make the terms for other programs.
|
||||
|
||||
The license agreements of most software companies keep you at the
|
||||
mercy of those companies. By contrast, our general public license is
|
||||
intended to give everyone the right to share Ghostscript. To make sure
|
||||
that you get the rights we want you to have, we need to make
|
||||
restrictions that forbid anyone to deny you these rights or to ask you
|
||||
to surrender the rights. Hence this license agreement.
|
||||
|
||||
Specifically, we want to make sure that you have the right to give
|
||||
away copies of Ghostscript, that you receive source code or else can get
|
||||
it if you want it, that you can change Ghostscript or use pieces of it
|
||||
in new free programs, and that you know you can do these things.
|
||||
|
||||
To make sure that everyone has such rights, we have to forbid you to
|
||||
deprive anyone else of these rights. For example, if you distribute
|
||||
copies of Ghostscript, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must tell them their rights.
|
||||
|
||||
Also, for our own protection, we must make certain that everyone finds
|
||||
out that there is no warranty for Ghostscript. If Ghostscript is
|
||||
modified by someone else and passed on, we want its recipients to know
|
||||
that what they have is not what we distributed, so that any problems
|
||||
introduced by others will not reflect on our reputation.
|
||||
|
||||
Therefore we (Richard M. Stallman and the Free Software Foundation,
|
||||
Inc.) make the following terms which say what you must do to be allowed
|
||||
to distribute or change Ghostscript.
|
||||
|
||||
|
||||
COPYING POLICIES
|
||||
|
||||
1. You may copy and distribute verbatim copies of Ghostscript source
|
||||
code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy a valid copyright and license
|
||||
notice "Copyright (C) 1989 Aladdin Enterprises. All rights reserved.
|
||||
Distributed by Free Software Foundation, Inc." (or with whatever year is
|
||||
appropriate); keep intact the notices on all files that refer to this
|
||||
License Agreement and to the absence of any warranty; and give any other
|
||||
recipients of the Ghostscript program a copy of this License Agreement
|
||||
along with the program. You may charge a distribution fee for the
|
||||
physical act of transferring a copy.
|
||||
|
||||
2. You may modify your copy or copies of Ghostscript or any portion of
|
||||
it, and copy and distribute such modifications under the terms of
|
||||
Paragraph 1 above, provided that you also do the following:
|
||||
|
||||
a) cause the modified files to carry prominent notices stating
|
||||
that you changed the files and the date of any change; and
|
||||
|
||||
b) cause the whole of any work that you distribute or publish,
|
||||
that in whole or in part contains or is a derivative of Ghostscript
|
||||
or any part thereof, to be licensed at no charge to all third
|
||||
parties on terms identical to those contained in this License
|
||||
Agreement (except that you may choose to grant more extensive
|
||||
warranty protection to some or all third parties, at your option).
|
||||
|
||||
c) You may charge a distribution fee for the physical act of
|
||||
transferring a copy, and you may at your option offer warranty
|
||||
protection in exchange for a fee.
|
||||
|
||||
Mere aggregation of another unrelated program with this program (or its
|
||||
derivative) on a volume of a storage or distribution medium does not bring
|
||||
the other program under the scope of these terms.
|
||||
|
||||
3. You may copy and distribute Ghostscript (or a portion or derivative
|
||||
of it, under Paragraph 2) in object code or executable form under the
|
||||
terms of Paragraphs 1 and 2 above provided that you also do one of the
|
||||
following:
|
||||
|
||||
a) accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
b) accompany it with a written offer, valid for at least three
|
||||
years, to give any third party free (except for a nominal
|
||||
shipping charge) a complete machine-readable copy of the
|
||||
corresponding source code, to be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
c) accompany it with the information you received as to where the
|
||||
corresponding source code may be obtained. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form alone.)
|
||||
|
||||
For an executable file, complete source code means all the source code for
|
||||
all modules it contains; but, as a special exception, it need not include
|
||||
source code for modules which are standard libraries that accompany the
|
||||
operating system on which the executable file runs.
|
||||
|
||||
4. You may not copy, sublicense, distribute or transfer Ghostscript
|
||||
except as expressly provided under this License Agreement. Any attempt
|
||||
otherwise to copy, sublicense, distribute or transfer Ghostscript is
|
||||
void and your rights to use the program under this License agreement
|
||||
shall be automatically terminated. However, parties who have received
|
||||
computer software programs from you with this License Agreement will not
|
||||
have their licenses terminated so long as such parties remain in full
|
||||
compliance.
|
||||
|
||||
5. If you wish to incorporate parts of Ghostscript into other free
|
||||
programs whose distribution conditions are different, write to the Free
|
||||
Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not
|
||||
yet worked out a simple rule that can be stated here, but we will often
|
||||
permit this. We will be guided by the two goals of preserving the free
|
||||
status of all derivatives of our free software and of promoting the
|
||||
sharing and reuse of software.
|
||||
|
||||
Your comments and suggestions about our licensing policies and our
|
||||
software are welcome! Please contact the Free Software Foundation,
|
||||
Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
|
||||
NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
|
||||
WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD
|
||||
M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES
|
||||
PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH
|
||||
YOU. SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
|
||||
STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN
|
||||
ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
|
||||
GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
|
||||
ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
||||
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
||||
INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
|
||||
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU
|
||||
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM
|
||||
BY ANY OTHER PARTY.
|
||||
-------------------- End of file COPYING ------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ansi2knr.c */
|
||||
/* Convert ANSI function declarations to K&R syntax */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef BSD
|
||||
#include <strings.h>
|
||||
#define strchr index
|
||||
#else
|
||||
#ifdef VMS
|
||||
extern char *strcat(), *strchr(), *strcpy(), *strupr();
|
||||
extern int strcmp(), strlen(), strncmp();
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#ifdef VMS
|
||||
extern char *malloc();
|
||||
extern void free();
|
||||
#else
|
||||
extern char *malloc();
|
||||
extern int free();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Usage:
|
||||
ansi2knr input_file output_file
|
||||
* If no output_file is supplied, output goes to stdout.
|
||||
* There are no error messages.
|
||||
*
|
||||
* ansi2knr recognizes functions by seeing a non-keyword identifier
|
||||
* at the left margin, followed by a left parenthesis,
|
||||
* with a right parenthesis as the last character on the line.
|
||||
* It will recognize a multi-line header if the last character
|
||||
* on each line but the last is a left parenthesis or comma.
|
||||
* These algorithms ignore whitespace and comments, except that
|
||||
* the function name must be the first thing on the line.
|
||||
* The following constructs will confuse it:
|
||||
- Any other construct that starts at the left margin and
|
||||
follows the above syntax (such as a macro or function call).
|
||||
- Macros that tinker with the syntax of the function header.
|
||||
*/
|
||||
|
||||
/* Scanning macros */
|
||||
#define isidchar(ch) (isalnum(ch) || (ch) == '_')
|
||||
#define isidfirstchar(ch) (isalpha(ch) || (ch) == '_')
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{ FILE *in, *out;
|
||||
#define bufsize 5000 /* arbitrary size */
|
||||
char *buf;
|
||||
char *line;
|
||||
switch ( argc )
|
||||
{
|
||||
default:
|
||||
printf("Usage: ansi2knr input_file [output_file]\n");
|
||||
exit(0);
|
||||
case 2:
|
||||
out = stdout; break;
|
||||
case 3:
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL )
|
||||
{ fprintf(stderr, "Cannot open %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL )
|
||||
{ fprintf(stderr, "Cannot open %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
|
||||
buf = malloc(bufsize);
|
||||
line = buf;
|
||||
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
||||
{ switch ( test1(buf) )
|
||||
{
|
||||
case 1: /* a function */
|
||||
convert1(buf, out);
|
||||
break;
|
||||
case -1: /* maybe the start of a function */
|
||||
line = buf + strlen(buf);
|
||||
if ( line != buf + (bufsize - 1) ) /* overflow check */
|
||||
continue;
|
||||
/* falls through */
|
||||
default: /* not a function */
|
||||
fputs(buf, out);
|
||||
break;
|
||||
}
|
||||
line = buf;
|
||||
}
|
||||
if ( line != buf ) fputs(buf, out);
|
||||
free(buf);
|
||||
fclose(out);
|
||||
fclose(in);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Skip over space and comments, in either direction. */
|
||||
char *
|
||||
skipspace(p, dir)
|
||||
register char *p;
|
||||
register int dir; /* 1 for forward, -1 for backward */
|
||||
{ for ( ; ; )
|
||||
{ while ( isspace(*p) ) p += dir;
|
||||
if ( !(*p == '/' && p[dir] == '*') ) break;
|
||||
p += dir; p += dir;
|
||||
while ( !(*p == '*' && p[dir] == '/') )
|
||||
{ if ( *p == 0 ) return p; /* multi-line comment?? */
|
||||
p += dir;
|
||||
}
|
||||
p += dir; p += dir;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write blanks over part of a string.
|
||||
*/
|
||||
int
|
||||
writeblanks(start, end)
|
||||
char *start;
|
||||
char *end;
|
||||
{ char *p;
|
||||
for ( p = start; p < end; p++ ) *p = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test whether the string in buf is a function definition.
|
||||
* The string may contain and/or end with a newline.
|
||||
* Return as follows:
|
||||
* 0 - definitely not a function definition;
|
||||
* 1 - definitely a function definition;
|
||||
* -1 - may be the beginning of a function definition,
|
||||
* append another line and look again.
|
||||
*/
|
||||
int
|
||||
test1(buf)
|
||||
char *buf;
|
||||
{ register char *p = buf;
|
||||
char *bend;
|
||||
char *endfn;
|
||||
int contin;
|
||||
if ( !isidfirstchar(*p) )
|
||||
return 0; /* no name at left margin */
|
||||
bend = skipspace(buf + strlen(buf) - 1, -1);
|
||||
switch ( *bend )
|
||||
{
|
||||
case ')': contin = 1; break;
|
||||
case '(':
|
||||
case ',': contin = -1; break;
|
||||
default: return 0; /* not a function */
|
||||
}
|
||||
while ( isidchar(*p) ) p++;
|
||||
endfn = p;
|
||||
p = skipspace(p, 1);
|
||||
if ( *p++ != '(' )
|
||||
return 0; /* not a function */
|
||||
p = skipspace(p, 1);
|
||||
if ( *p == ')' )
|
||||
return 0; /* no parameters */
|
||||
/* Check that the apparent function name isn't a keyword. */
|
||||
/* We only need to check for keywords that could be followed */
|
||||
/* by a left parenthesis (which, unfortunately, is most of them). */
|
||||
{ static char *words[] =
|
||||
{ "asm", "auto", "case", "char", "const", "double",
|
||||
"extern", "float", "for", "if", "int", "long",
|
||||
"register", "return", "short", "signed", "sizeof",
|
||||
"static", "switch", "typedef", "unsigned",
|
||||
"void", "volatile", "while", 0
|
||||
};
|
||||
char **key = words;
|
||||
char *kp;
|
||||
int len = endfn - buf;
|
||||
while ( (kp = *key) != 0 )
|
||||
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
|
||||
return 0; /* name is a keyword */
|
||||
key++;
|
||||
}
|
||||
}
|
||||
return contin;
|
||||
}
|
||||
|
||||
int
|
||||
convert1(buf, out)
|
||||
char *buf;
|
||||
FILE *out;
|
||||
{ char *endfn = strchr(buf, '(') + 1;
|
||||
register char *p;
|
||||
char **breaks;
|
||||
unsigned num_breaks = 2; /* for testing */
|
||||
char **btop;
|
||||
char **bp;
|
||||
char **ap;
|
||||
top: p = endfn;
|
||||
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
|
||||
if ( breaks == 0 )
|
||||
{ /* Couldn't allocate break table, give up */
|
||||
fprintf(stderr, "Unable to allocate break table!\n");
|
||||
fputs(buf, out);
|
||||
return -1;
|
||||
}
|
||||
btop = breaks + num_breaks * 2 - 2;
|
||||
bp = breaks;
|
||||
/* Parse the argument list */
|
||||
do
|
||||
{ int level = 0;
|
||||
char *end = NULL;
|
||||
if ( bp >= btop )
|
||||
{ /* Filled up break table. */
|
||||
/* Allocate a bigger one and start over. */
|
||||
free((char *)breaks);
|
||||
num_breaks <<= 1;
|
||||
goto top;
|
||||
}
|
||||
*bp++ = p;
|
||||
/* Find the end of the argument */
|
||||
for ( ; end == NULL; p++ )
|
||||
{ switch(*p)
|
||||
{
|
||||
case ',': if ( !level ) end = p; break;
|
||||
case '(': level++; break;
|
||||
case ')': if ( --level < 0 ) end = p; break;
|
||||
case '/': p = skipspace(p, 1) - 1; break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
p--; /* back up over terminator */
|
||||
/* Find the name being declared. */
|
||||
/* This is complicated because of procedure and */
|
||||
/* array modifiers. */
|
||||
for ( ; ; )
|
||||
{ p = skipspace(p - 1, -1);
|
||||
switch ( *p )
|
||||
{
|
||||
case ']': /* skip array dimension(s) */
|
||||
case ')': /* skip procedure args OR name */
|
||||
{ int level = 1;
|
||||
while ( level )
|
||||
switch ( *--p )
|
||||
{
|
||||
case ']': case ')': level++; break;
|
||||
case '[': case '(': level--; break;
|
||||
case '/': p = skipspace(p, -1) + 1; break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
|
||||
{ /* We found the name being declared */
|
||||
while ( !isidfirstchar(*p) )
|
||||
p = skipspace(p, 1) + 1;
|
||||
goto found;
|
||||
}
|
||||
break;
|
||||
default: goto found;
|
||||
}
|
||||
}
|
||||
found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
|
||||
{ p++;
|
||||
if ( bp == breaks + 1 ) /* sole argument */
|
||||
writeblanks(breaks[0], p);
|
||||
else
|
||||
writeblanks(bp[-1] - 1, p);
|
||||
bp--;
|
||||
}
|
||||
else
|
||||
{ while ( isidchar(*p) ) p--;
|
||||
*bp++ = p+1;
|
||||
}
|
||||
p = end;
|
||||
}
|
||||
while ( *p++ == ',' );
|
||||
*bp = p;
|
||||
/* Make a special check for 'void' arglist */
|
||||
if ( bp == breaks+2 )
|
||||
{ p = skipspace(breaks[0], 1);
|
||||
if ( !strncmp(p, "void", 4) )
|
||||
{ p = skipspace(p+4, 1);
|
||||
if ( p == breaks[2] - 1 )
|
||||
{ bp = breaks; /* yup, pretend arglist is empty */
|
||||
writeblanks(breaks[0], p + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Put out the function name */
|
||||
p = buf;
|
||||
while ( p != endfn ) putc(*p, out), p++;
|
||||
/* Put out the declaration */
|
||||
for ( ap = breaks+1; ap < bp; ap += 2 )
|
||||
{ p = *ap;
|
||||
while ( isidchar(*p) ) putc(*p, out), p++;
|
||||
if ( ap < bp - 1 ) fputs(", ", out);
|
||||
}
|
||||
fputs(") ", out);
|
||||
/* Put out the argument declarations */
|
||||
for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';';
|
||||
fputs(breaks[0], out);
|
||||
free((char *)breaks);
|
||||
return 0;
|
||||
}
|
||||
1195
architecture
274
bmp.c
Normal file
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - 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.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 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 HOLDERS 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 <setjmp.h>
|
||||
#include <errno.h>
|
||||
#include "cdjpeg.h"
|
||||
#include <jpeglib.h>
|
||||
#include <jpegint.h>
|
||||
#include "tjutil.h"
|
||||
#include "bmp.h"
|
||||
|
||||
|
||||
/* This duplicates the functionality of the VirtualGL bitmap library using
|
||||
the components from cjpeg and djpeg */
|
||||
|
||||
|
||||
/* Error handling (based on example in example.c) */
|
||||
|
||||
static char errStr[JMSG_LENGTH_MAX]="No error";
|
||||
|
||||
struct my_error_mgr
|
||||
{
|
||||
struct jpeg_error_mgr pub;
|
||||
jmp_buf setjmp_buffer;
|
||||
};
|
||||
typedef struct my_error_mgr *my_error_ptr;
|
||||
|
||||
static void my_error_exit(j_common_ptr cinfo)
|
||||
{
|
||||
my_error_ptr myerr=(my_error_ptr)cinfo->err;
|
||||
(*cinfo->err->output_message)(cinfo);
|
||||
longjmp(myerr->setjmp_buffer, 1);
|
||||
}
|
||||
|
||||
/* Based on output_message() in jerror.c */
|
||||
|
||||
static void my_output_message(j_common_ptr cinfo)
|
||||
{
|
||||
(*cinfo->err->format_message)(cinfo, errStr);
|
||||
}
|
||||
|
||||
#define _throw(m) {snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
|
||||
retval=-1; goto bailout;}
|
||||
#define _throwunix(m) {snprintf(errStr, JMSG_LENGTH_MAX, "%s\n%s", m, \
|
||||
strerror(errno)); retval=-1; goto bailout;}
|
||||
|
||||
|
||||
static void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup,
|
||||
unsigned char *dstbuf, int dstpf, int dstbottomup, int w, int h)
|
||||
{
|
||||
unsigned char *srcptr=srcbuf, *srcptr2;
|
||||
int srcps=tjPixelSize[srcpf];
|
||||
int srcstride=srcbottomup? -w*srcps:w*srcps;
|
||||
unsigned char *dstptr=dstbuf, *dstptr2;
|
||||
int dstps=tjPixelSize[dstpf];
|
||||
int dststride=dstbottomup? -w*dstps:w*dstps;
|
||||
int row, col;
|
||||
|
||||
if(srcbottomup) srcptr=&srcbuf[w*srcps*(h-1)];
|
||||
if(dstbottomup) dstptr=&dstbuf[w*dstps*(h-1)];
|
||||
for(row=0; row<h; row++, srcptr+=srcstride, dstptr+=dststride)
|
||||
{
|
||||
for(col=0, srcptr2=srcptr, dstptr2=dstptr; col<w; col++, srcptr2+=srcps,
|
||||
dstptr2+=dstps)
|
||||
{
|
||||
dstptr2[tjRedOffset[dstpf]]=srcptr2[tjRedOffset[srcpf]];
|
||||
dstptr2[tjGreenOffset[dstpf]]=srcptr2[tjGreenOffset[srcpf]];
|
||||
dstptr2[tjBlueOffset[dstpf]]=srcptr2[tjBlueOffset[srcpf]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int loadbmp(char *filename, unsigned char **buf, int *w, int *h,
|
||||
int dstpf, int bottomup)
|
||||
{
|
||||
int retval=0, dstps, srcpf, tempc;
|
||||
struct jpeg_compress_struct cinfo;
|
||||
struct my_error_mgr jerr;
|
||||
cjpeg_source_ptr src;
|
||||
FILE *file=NULL;
|
||||
|
||||
memset(&cinfo, 0, sizeof(struct jpeg_compress_struct));
|
||||
|
||||
if(!filename || !buf || !w || !h || dstpf<0 || dstpf>=TJ_NUMPF)
|
||||
_throw("loadbmp(): Invalid argument");
|
||||
|
||||
if((file=fopen(filename, "rb"))==NULL)
|
||||
_throwunix("loadbmp(): Cannot open input file");
|
||||
|
||||
cinfo.err=jpeg_std_error(&jerr.pub);
|
||||
jerr.pub.error_exit=my_error_exit;
|
||||
jerr.pub.output_message=my_output_message;
|
||||
|
||||
if(setjmp(jerr.setjmp_buffer))
|
||||
{
|
||||
/* If we get here, the JPEG code has signaled an error. */
|
||||
retval=-1; goto bailout;
|
||||
}
|
||||
|
||||
jpeg_create_compress(&cinfo);
|
||||
if((tempc=getc(file))<0 || ungetc(tempc, file)==EOF)
|
||||
_throwunix("loadbmp(): Could not read input file")
|
||||
else if(tempc==EOF) _throw("loadbmp(): Input file contains no data");
|
||||
|
||||
if(tempc=='B')
|
||||
{
|
||||
if((src=jinit_read_bmp(&cinfo))==NULL)
|
||||
_throw("loadbmp(): Could not initialize bitmap loader");
|
||||
}
|
||||
else if(tempc=='P')
|
||||
{
|
||||
if((src=jinit_read_ppm(&cinfo))==NULL)
|
||||
_throw("loadbmp(): Could not initialize bitmap loader");
|
||||
}
|
||||
else _throw("loadbmp(): Unsupported file type");
|
||||
|
||||
src->input_file=file;
|
||||
(*src->start_input)(&cinfo, src);
|
||||
(*cinfo.mem->realize_virt_arrays)((j_common_ptr)&cinfo);
|
||||
|
||||
*w=cinfo.image_width; *h=cinfo.image_height;
|
||||
|
||||
if(cinfo.input_components==1 && cinfo.in_color_space==JCS_RGB)
|
||||
srcpf=TJPF_GRAY;
|
||||
else srcpf=TJPF_RGB;
|
||||
|
||||
dstps=tjPixelSize[dstpf];
|
||||
if((*buf=(unsigned char *)malloc((*w)*(*h)*dstps))==NULL)
|
||||
_throw("loadbmp(): Memory allocation failure");
|
||||
|
||||
while(cinfo.next_scanline<cinfo.image_height)
|
||||
{
|
||||
int i, nlines=(*src->get_pixel_rows)(&cinfo, src);
|
||||
for(i=0; i<nlines; i++)
|
||||
{
|
||||
unsigned char *outbuf; int row;
|
||||
row=cinfo.next_scanline+i;
|
||||
if(bottomup) outbuf=&(*buf)[((*h)-row-1)*(*w)*dstps];
|
||||
else outbuf=&(*buf)[row*(*w)*dstps];
|
||||
pixelconvert(src->buffer[i], srcpf, 0, outbuf, dstpf, bottomup, *w,
|
||||
nlines);
|
||||
}
|
||||
cinfo.next_scanline+=nlines;
|
||||
}
|
||||
|
||||
(*src->finish_input)(&cinfo, src);
|
||||
|
||||
bailout:
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
if(file) fclose(file);
|
||||
if(retval<0 && buf && *buf) {free(*buf); *buf=NULL;}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int savebmp(char *filename, unsigned char *buf, int w, int h, int srcpf,
|
||||
int bottomup)
|
||||
{
|
||||
int retval=0, srcps, dstpf;
|
||||
struct jpeg_decompress_struct dinfo;
|
||||
struct my_error_mgr jerr;
|
||||
djpeg_dest_ptr dst;
|
||||
FILE *file=NULL;
|
||||
char *ptr=NULL;
|
||||
|
||||
memset(&dinfo, 0, sizeof(struct jpeg_decompress_struct));
|
||||
|
||||
if(!filename || !buf || w<1 || h<1 || srcpf<0 || srcpf>=TJ_NUMPF)
|
||||
_throw("savebmp(): Invalid argument");
|
||||
|
||||
if((file=fopen(filename, "wb"))==NULL)
|
||||
_throwunix("savebmp(): Cannot open output file");
|
||||
|
||||
dinfo.err=jpeg_std_error(&jerr.pub);
|
||||
jerr.pub.error_exit=my_error_exit;
|
||||
jerr.pub.output_message=my_output_message;
|
||||
|
||||
if(setjmp(jerr.setjmp_buffer))
|
||||
{
|
||||
/* If we get here, the JPEG code has signaled an error. */
|
||||
retval=-1; goto bailout;
|
||||
}
|
||||
|
||||
jpeg_create_decompress(&dinfo);
|
||||
if(srcpf==TJPF_GRAY)
|
||||
{
|
||||
dinfo.out_color_components=dinfo.output_components=1;
|
||||
dinfo.out_color_space=JCS_GRAYSCALE;
|
||||
}
|
||||
else
|
||||
{
|
||||
dinfo.out_color_components=dinfo.output_components=3;
|
||||
dinfo.out_color_space=JCS_RGB;
|
||||
}
|
||||
dinfo.image_width=w; dinfo.image_height=h;
|
||||
dinfo.global_state=DSTATE_READY;
|
||||
dinfo.scale_num=dinfo.scale_denom=1;
|
||||
|
||||
ptr=strrchr(filename, '.');
|
||||
if(ptr && !strcasecmp(ptr, ".bmp"))
|
||||
{
|
||||
if((dst=jinit_write_bmp(&dinfo, 0))==NULL)
|
||||
_throw("savebmp(): Could not initialize bitmap writer");
|
||||
}
|
||||
else
|
||||
{
|
||||
if((dst=jinit_write_ppm(&dinfo))==NULL)
|
||||
_throw("savebmp(): Could not initialize PPM writer");
|
||||
}
|
||||
|
||||
dst->output_file=file;
|
||||
(*dst->start_output)(&dinfo, dst);
|
||||
(*dinfo.mem->realize_virt_arrays)((j_common_ptr)&dinfo);
|
||||
|
||||
if(srcpf==TJPF_GRAY) dstpf=srcpf;
|
||||
else dstpf=TJPF_RGB;
|
||||
srcps=tjPixelSize[srcpf];
|
||||
|
||||
while(dinfo.output_scanline<dinfo.output_height)
|
||||
{
|
||||
int i, nlines=dst->buffer_height;
|
||||
for(i=0; i<nlines; i++)
|
||||
{
|
||||
unsigned char *inbuf; int row;
|
||||
row=dinfo.output_scanline+i;
|
||||
if(bottomup) inbuf=&buf[(h-row-1)*w*srcps];
|
||||
else inbuf=&buf[row*w*srcps];
|
||||
pixelconvert(inbuf, srcpf, bottomup, dst->buffer[i], dstpf, 0, w,
|
||||
nlines);
|
||||
}
|
||||
(*dst->put_pixel_rows)(&dinfo, dst, nlines);
|
||||
dinfo.output_scanline+=nlines;
|
||||
}
|
||||
|
||||
(*dst->finish_output)(&dinfo, dst);
|
||||
|
||||
bailout:
|
||||
jpeg_destroy_decompress(&dinfo);
|
||||
if(file) fclose(file);
|
||||
return retval;
|
||||
}
|
||||
|
||||
const char *bmpgeterr(void)
|
||||
{
|
||||
return errStr;
|
||||
}
|
||||
46
bmp.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - 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.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 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 HOLDERS 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 __BMP_H__
|
||||
#define __BMP_H__
|
||||
|
||||
#include "./turbojpeg.h"
|
||||
|
||||
int loadbmp(char *filename, unsigned char **buf, int *w, int *h, int pf,
|
||||
int bottomup);
|
||||
|
||||
int savebmp(char *filename, unsigned char *buf, int w, int h, int pf,
|
||||
int bottomup);
|
||||
|
||||
const char *bmpgeterr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
134
cderror.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* cderror.h
|
||||
*
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* Modified 2009 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file defines the error and message codes for the cjpeg/djpeg
|
||||
* applications. These strings are not needed as part of the JPEG library
|
||||
* proper.
|
||||
* Edit this file to add new codes, or to translate the message strings to
|
||||
* some other language.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To define the enum list of message codes, include this file without
|
||||
* defining macro JMESSAGE. To create a message string table, include it
|
||||
* again with a suitable JMESSAGE definition (see jerror.c for an example).
|
||||
*/
|
||||
#ifndef JMESSAGE
|
||||
#ifndef CDERROR_H
|
||||
#define CDERROR_H
|
||||
/* First time through, define the enum list */
|
||||
#define JMAKE_ENUM_LIST
|
||||
#else
|
||||
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
|
||||
#define JMESSAGE(code,string)
|
||||
#endif /* CDERROR_H */
|
||||
#endif /* JMESSAGE */
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
typedef enum {
|
||||
|
||||
#define JMESSAGE(code,string) code ,
|
||||
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
|
||||
|
||||
#ifdef BMP_SUPPORTED
|
||||
JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
|
||||
JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
|
||||
JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
|
||||
JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
|
||||
JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
|
||||
JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image")
|
||||
JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
|
||||
JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
|
||||
JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
|
||||
JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
|
||||
JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
|
||||
#endif /* BMP_SUPPORTED */
|
||||
|
||||
#ifdef GIF_SUPPORTED
|
||||
JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
|
||||
JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
|
||||
JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
|
||||
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
|
||||
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
|
||||
JMESSAGE(JTRC_GIF_BADVERSION,
|
||||
"Warning: unexpected GIF version number '%c%c%c'")
|
||||
JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
|
||||
JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
|
||||
JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
|
||||
JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
|
||||
JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
|
||||
JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
|
||||
#endif /* GIF_SUPPORTED */
|
||||
|
||||
#ifdef PPM_SUPPORTED
|
||||
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
|
||||
JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
|
||||
JMESSAGE(JTRC_PGM, "%ux%u PGM image")
|
||||
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
|
||||
JMESSAGE(JTRC_PPM, "%ux%u PPM image")
|
||||
JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
|
||||
#endif /* PPM_SUPPORTED */
|
||||
|
||||
#ifdef RLE_SUPPORTED
|
||||
JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
|
||||
JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
|
||||
JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
|
||||
JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
|
||||
JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
|
||||
JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
|
||||
JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
|
||||
JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
|
||||
JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
|
||||
JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
|
||||
JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
|
||||
JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
|
||||
JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
|
||||
#endif /* RLE_SUPPORTED */
|
||||
|
||||
#ifdef TARGA_SUPPORTED
|
||||
JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
|
||||
JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
|
||||
JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
|
||||
JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
|
||||
JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
|
||||
JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
|
||||
#else
|
||||
JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
|
||||
#endif /* TARGA_SUPPORTED */
|
||||
|
||||
JMESSAGE(JERR_BAD_CMAP_FILE,
|
||||
"Color map file is invalid or of unsupported format")
|
||||
JMESSAGE(JERR_TOO_MANY_COLORS,
|
||||
"Output file format cannot handle %d colormap entries")
|
||||
JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
|
||||
#ifdef TARGA_SUPPORTED
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT,
|
||||
"Unrecognized input file format --- perhaps you need -targa")
|
||||
#else
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
|
||||
#endif
|
||||
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
JMSG_LASTADDONCODE
|
||||
} ADDON_MESSAGE_CODE;
|
||||
|
||||
#undef JMAKE_ENUM_LIST
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
|
||||
#undef JMESSAGE
|
||||
181
cdjpeg.c
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* cdjpeg.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains common support routines used by the IJG application
|
||||
* programs (cjpeg, djpeg, jpegtran).
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include <ctype.h> /* to declare isupper(), tolower() */
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
#include <signal.h> /* to declare signal() */
|
||||
#endif
|
||||
#ifdef USE_SETMODE
|
||||
#include <fcntl.h> /* to declare setmode()'s parameter macros */
|
||||
/* If you have setmode() but not <io.h>, just delete this line: */
|
||||
#include <io.h> /* to declare setmode() */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Signal catcher to ensure that temporary files are removed before aborting.
|
||||
* NB: for Amiga Manx C this is actually a global routine named _abort();
|
||||
* we put "#define signal_catcher _abort" in jconfig.h. Talk about bogus...
|
||||
*/
|
||||
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
|
||||
static j_common_ptr sig_cinfo;
|
||||
|
||||
void /* must be global for Manx C */
|
||||
signal_catcher (int signum)
|
||||
{
|
||||
if (sig_cinfo != NULL) {
|
||||
if (sig_cinfo->err != NULL) /* turn off trace output */
|
||||
sig_cinfo->err->trace_level = 0;
|
||||
jpeg_destroy(sig_cinfo); /* clean up memory allocation & temp files */
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
enable_signal_catcher (j_common_ptr cinfo)
|
||||
{
|
||||
sig_cinfo = cinfo;
|
||||
#ifdef SIGINT /* not all systems have SIGINT */
|
||||
signal(SIGINT, signal_catcher);
|
||||
#endif
|
||||
#ifdef SIGTERM /* not all systems have SIGTERM */
|
||||
signal(SIGTERM, signal_catcher);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Optional progress monitor: display a percent-done figure on stderr.
|
||||
*/
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
|
||||
METHODDEF(void)
|
||||
progress_monitor (j_common_ptr cinfo)
|
||||
{
|
||||
cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress;
|
||||
int total_passes = prog->pub.total_passes + prog->total_extra_passes;
|
||||
int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit);
|
||||
|
||||
if (percent_done != prog->percent_done) {
|
||||
prog->percent_done = percent_done;
|
||||
if (total_passes > 1) {
|
||||
fprintf(stderr, "\rPass %d/%d: %3d%% ",
|
||||
prog->pub.completed_passes + prog->completed_extra_passes + 1,
|
||||
total_passes, percent_done);
|
||||
} else {
|
||||
fprintf(stderr, "\r %3d%% ", percent_done);
|
||||
}
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress)
|
||||
{
|
||||
/* Enable progress display, unless trace output is on */
|
||||
if (cinfo->err->trace_level == 0) {
|
||||
progress->pub.progress_monitor = progress_monitor;
|
||||
progress->completed_extra_passes = 0;
|
||||
progress->total_extra_passes = 0;
|
||||
progress->percent_done = -1;
|
||||
cinfo->progress = &progress->pub;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
end_progress_monitor (j_common_ptr cinfo)
|
||||
{
|
||||
/* Clear away progress display */
|
||||
if (cinfo->err->trace_level == 0) {
|
||||
fprintf(stderr, "\r \r");
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Case-insensitive matching of possibly-abbreviated keyword switches.
|
||||
* keyword is the constant keyword (must be lower case already),
|
||||
* minchars is length of minimum legal abbreviation.
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
keymatch (char * arg, const char * keyword, int minchars)
|
||||
{
|
||||
register int ca, ck;
|
||||
register int nmatched = 0;
|
||||
|
||||
while ((ca = *arg++) != '\0') {
|
||||
if ((ck = *keyword++) == '\0')
|
||||
return FALSE; /* arg longer than keyword, no good */
|
||||
if (isupper(ca)) /* force arg to lcase (assume ck is already) */
|
||||
ca = tolower(ca);
|
||||
if (ca != ck)
|
||||
return FALSE; /* no good */
|
||||
nmatched++; /* count matched characters */
|
||||
}
|
||||
/* reached end of argument; fail if it's too short for unique abbrev */
|
||||
if (nmatched < minchars)
|
||||
return FALSE;
|
||||
return TRUE; /* A-OK */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Routines to establish binary I/O mode for stdin and stdout.
|
||||
* Non-Unix systems often require some hacking to get out of text mode.
|
||||
*/
|
||||
|
||||
GLOBAL(FILE *)
|
||||
read_stdin (void)
|
||||
{
|
||||
FILE * input_file = stdin;
|
||||
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
setmode(fileno(stdin), O_BINARY);
|
||||
#endif
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "Cannot reopen stdin\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
return input_file;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(FILE *)
|
||||
write_stdout (void)
|
||||
{
|
||||
FILE * output_file = stdout;
|
||||
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
setmode(fileno(stdout), O_BINARY);
|
||||
#endif
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "Cannot reopen stdout\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
return output_file;
|
||||
}
|
||||
187
cdjpeg.h
Normal file
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* cdjpeg.h
|
||||
*
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains common declarations for the sample applications
|
||||
* cjpeg and djpeg. It is NOT used by the core JPEG library.
|
||||
*/
|
||||
|
||||
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
|
||||
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h" /* get library error codes too */
|
||||
#include "cderror.h" /* get application-specific error codes */
|
||||
|
||||
|
||||
/*
|
||||
* Object interface for cjpeg's source file decoding modules
|
||||
*/
|
||||
|
||||
typedef struct cjpeg_source_struct * cjpeg_source_ptr;
|
||||
|
||||
struct cjpeg_source_struct {
|
||||
JMETHOD(void, start_input, (j_compress_ptr cinfo,
|
||||
cjpeg_source_ptr sinfo));
|
||||
JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
|
||||
cjpeg_source_ptr sinfo));
|
||||
JMETHOD(void, finish_input, (j_compress_ptr cinfo,
|
||||
cjpeg_source_ptr sinfo));
|
||||
|
||||
FILE *input_file;
|
||||
|
||||
JSAMPARRAY buffer;
|
||||
JDIMENSION buffer_height;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Object interface for djpeg's output file encoding modules
|
||||
*/
|
||||
|
||||
typedef struct djpeg_dest_struct * djpeg_dest_ptr;
|
||||
|
||||
struct djpeg_dest_struct {
|
||||
/* start_output is called after jpeg_start_decompress finishes.
|
||||
* The color map will be ready at this time, if one is needed.
|
||||
*/
|
||||
JMETHOD(void, start_output, (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo));
|
||||
/* Emit the specified number of pixel rows from the buffer. */
|
||||
JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo,
|
||||
JDIMENSION rows_supplied));
|
||||
/* Finish up at the end of the image. */
|
||||
JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo));
|
||||
|
||||
/* Target file spec; filled in by djpeg.c after object is created. */
|
||||
FILE * output_file;
|
||||
|
||||
/* Output pixel-row buffer. Created by module init or start_output.
|
||||
* Width is cinfo->output_width * cinfo->output_components;
|
||||
* height is buffer_height.
|
||||
*/
|
||||
JSAMPARRAY buffer;
|
||||
JDIMENSION buffer_height;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* cjpeg/djpeg may need to perform extra passes to convert to or from
|
||||
* the source/destination file format. The JPEG library does not know
|
||||
* about these passes, but we'd like them to be counted by the progress
|
||||
* monitor. We use an expanded progress monitor object to hold the
|
||||
* additional pass count.
|
||||
*/
|
||||
|
||||
struct cdjpeg_progress_mgr {
|
||||
struct jpeg_progress_mgr pub; /* fields known to JPEG library */
|
||||
int completed_extra_passes; /* extra passes completed */
|
||||
int total_extra_passes; /* total extra */
|
||||
/* last printed percentage stored here to avoid multiple printouts */
|
||||
int percent_done;
|
||||
};
|
||||
|
||||
typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
|
||||
|
||||
|
||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||
|
||||
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
||||
#define jinit_read_bmp jIRdBMP
|
||||
#define jinit_write_bmp jIWrBMP
|
||||
#define jinit_read_gif jIRdGIF
|
||||
#define jinit_write_gif jIWrGIF
|
||||
#define jinit_read_ppm jIRdPPM
|
||||
#define jinit_write_ppm jIWrPPM
|
||||
#define jinit_read_rle jIRdRLE
|
||||
#define jinit_write_rle jIWrRLE
|
||||
#define jinit_read_targa jIRdTarga
|
||||
#define jinit_write_targa jIWrTarga
|
||||
#define read_quant_tables RdQTables
|
||||
#define read_scan_script RdScnScript
|
||||
#define set_quality_ratings SetQRates
|
||||
#define set_quant_slots SetQSlots
|
||||
#define set_sample_factors SetSFacts
|
||||
#define read_color_map RdCMap
|
||||
#define enable_signal_catcher EnSigCatcher
|
||||
#define start_progress_monitor StProgMon
|
||||
#define end_progress_monitor EnProgMon
|
||||
#define read_stdin RdStdin
|
||||
#define write_stdout WrStdout
|
||||
#endif /* NEED_SHORT_EXTERNAL_NAMES */
|
||||
|
||||
/* Module selection routines for I/O modules. */
|
||||
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
|
||||
boolean is_os2));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
|
||||
|
||||
/* cjpeg support routines (in rdswitch.c) */
|
||||
|
||||
EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
|
||||
boolean force_baseline));
|
||||
EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
|
||||
EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,
|
||||
boolean force_baseline));
|
||||
EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
|
||||
EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
|
||||
|
||||
/* djpeg support routines (in rdcolmap.c) */
|
||||
|
||||
EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
|
||||
|
||||
/* common support routines (in cdjpeg.c) */
|
||||
|
||||
EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
|
||||
EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
|
||||
cd_progress_ptr progress));
|
||||
EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
|
||||
EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
|
||||
EXTERN(FILE *) read_stdin JPP((void));
|
||||
EXTERN(FILE *) write_stdout JPP((void));
|
||||
|
||||
/* miscellaneous useful macros */
|
||||
|
||||
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
||||
#define READ_BINARY "r"
|
||||
#define WRITE_BINARY "w"
|
||||
#else
|
||||
#ifdef VMS /* VMS is very nonstandard */
|
||||
#define READ_BINARY "rb", "ctx=stm"
|
||||
#define WRITE_BINARY "wb", "ctx=stm"
|
||||
#else /* standard ANSI-compliant case */
|
||||
#define READ_BINARY "rb"
|
||||
#define WRITE_BINARY "wb"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
||||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
#ifndef EXIT_SUCCESS
|
||||
#ifdef VMS
|
||||
#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
|
||||
#else
|
||||
#define EXIT_SUCCESS 0
|
||||
#endif
|
||||
#endif
|
||||
#ifndef EXIT_WARNING
|
||||
#ifdef VMS
|
||||
#define EXIT_WARNING 1 /* VMS is very nonstandard */
|
||||
#else
|
||||
#define EXIT_WARNING 2
|
||||
#endif
|
||||
#endif
|
||||
296
change.log
Normal file
@@ -0,0 +1,296 @@
|
||||
NOTE: This file was modified by The libjpeg-turbo Project to include only
|
||||
information relevant to libjpeg-turbo.
|
||||
|
||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 8d 15-Jan-2012
|
||||
-----------------------
|
||||
|
||||
Add cjpeg -rgb option to create RGB JPEG files.
|
||||
Using this switch suppresses the conversion from RGB
|
||||
colorspace input to the default YCbCr JPEG colorspace.
|
||||
Thank to Michael Koch for the initial suggestion.
|
||||
|
||||
Add option to disable the region adjustment in the transupp crop code.
|
||||
Thank to Jeffrey Friedl for the suggestion.
|
||||
|
||||
|
||||
Version 8b 16-May-2010
|
||||
-----------------------
|
||||
|
||||
Repair problem in new memory source manager with corrupt JPEG data.
|
||||
Thank to Ted Campbell and Samuel Chun for the report.
|
||||
|
||||
|
||||
Version 8a 28-Feb-2010
|
||||
-----------------------
|
||||
|
||||
Writing tables-only datastreams via jpeg_write_tables works again.
|
||||
|
||||
Support 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.
|
||||
Thank to Brett Blackham for the suggestion.
|
||||
|
||||
|
||||
Version 8 10-Jan-2010
|
||||
----------------------
|
||||
|
||||
Add sanity check in BMP reader module to avoid cjpeg crash for empty input
|
||||
image (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).
|
||||
|
||||
Add data source and destination managers for read from and write to
|
||||
memory buffers. New API functions jpeg_mem_src and jpeg_mem_dest.
|
||||
Thank to Roberto Boni from Italy for the suggestion.
|
||||
|
||||
|
||||
Version 7 27-Jun-2009
|
||||
----------------------
|
||||
|
||||
New scaled DCTs implemented.
|
||||
djpeg now supports scalings N/8 with all N from 1 to 16.
|
||||
|
||||
cjpeg -quality option has been extended for support of separate quality
|
||||
settings for luminance and chrominance (or in general, for every provided
|
||||
quantization table slot).
|
||||
New API function jpeg_default_qtables() and q_scale_factor array in library.
|
||||
|
||||
Support arithmetic entropy encoding and decoding.
|
||||
Added files jaricom.c, jcarith.c, jdarith.c.
|
||||
|
||||
jpegtran has a new "lossless" cropping feature.
|
||||
|
||||
Implement -perfect option in jpegtran, new API function
|
||||
jtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)
|
||||
|
||||
Better error messages for jpegtran fopen failure.
|
||||
(DP 203_jpegtran_errmsg.dpatch)
|
||||
|
||||
Fix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:
|
||||
according to Netpbm, the de facto standard implementation of the PNM formats,
|
||||
the most significant byte is first. (DP 203_rdppm.dpatch)
|
||||
|
||||
Add -raw option to rdjpgcom not to mangle the output.
|
||||
(DP 205_rdjpgcom_raw.dpatch)
|
||||
|
||||
Make rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)
|
||||
|
||||
Add extern "C" to jpeglib.h.
|
||||
This avoids the need to put extern "C" { ... } around #include "jpeglib.h"
|
||||
in your C++ application. Defining the symbol DONT_USE_EXTERN_C in the
|
||||
configuration prevents this. (DP 202_jpeglib.h_c++.dpatch)
|
||||
|
||||
|
||||
Version 6b 27-Mar-1998
|
||||
-----------------------
|
||||
|
||||
jpegtran has new features for lossless image transformations (rotation
|
||||
and flipping) as well as "lossless" reduction to grayscale.
|
||||
|
||||
jpegtran now copies comments by default; it has a -copy switch to enable
|
||||
copying all APPn blocks as well, or to suppress comments. (Formerly it
|
||||
always suppressed comments and APPn blocks.) jpegtran now also preserves
|
||||
JFIF version and resolution information.
|
||||
|
||||
New decompressor library feature: COM and APPn markers found in the input
|
||||
file can be saved in memory for later use by the application. (Before,
|
||||
you had to code this up yourself with a custom marker processor.)
|
||||
|
||||
There is an unused field "void * client_data" now in compress and decompress
|
||||
parameter structs; this may be useful in some applications.
|
||||
|
||||
JFIF version number information is now saved by the decoder and accepted by
|
||||
the encoder. jpegtran uses this to copy the source file's version number,
|
||||
to ensure "jpegtran -copy all" won't create bogus files that contain JFXX
|
||||
extensions but claim to be version 1.01. Applications that generate their
|
||||
own JFXX extension markers also (finally) have a supported way to cause the
|
||||
encoder to emit JFIF version number 1.02.
|
||||
|
||||
djpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather
|
||||
than as unknown APP0 markers.
|
||||
|
||||
In -verbose mode, djpeg and rdjpgcom will try to print the contents of
|
||||
APP12 markers as text. Some digital cameras store useful text information
|
||||
in APP12 markers.
|
||||
|
||||
Handling of truncated data streams is more robust: blocks beyond the one in
|
||||
which the error occurs will be output as uniform gray, or left unchanged
|
||||
if decoding a progressive JPEG. The appearance no longer depends on the
|
||||
Huffman tables being used.
|
||||
|
||||
Huffman tables are checked for validity much more carefully than before.
|
||||
|
||||
To avoid the Unisys LZW patent, djpeg's GIF output capability has been
|
||||
changed to produce "uncompressed GIFs", and cjpeg's GIF input capability
|
||||
has been removed altogether. We're not happy about it either, but there
|
||||
seems to be no good alternative.
|
||||
|
||||
The configure script now supports building libjpeg as a shared library
|
||||
on many flavors of Unix (all the ones that GNU libtool knows how to
|
||||
build shared libraries for). Use "./configure --enable-shared" to
|
||||
try this out.
|
||||
|
||||
New jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.
|
||||
Also, a jconfig file and a build script for Metrowerks CodeWarrior
|
||||
on Apple Macintosh. makefile.dj has been updated for DJGPP v2, and there
|
||||
are miscellaneous other minor improvements in the makefiles.
|
||||
|
||||
jmemmac.c now knows how to create temporary files following Mac System 7
|
||||
conventions.
|
||||
|
||||
djpeg's -map switch is now able to read raw-format PPM files reliably.
|
||||
|
||||
cjpeg -progressive -restart no longer generates any unnecessary DRI markers.
|
||||
|
||||
Multiple calls to jpeg_simple_progression for a single JPEG object
|
||||
no longer leak memory.
|
||||
|
||||
|
||||
Version 6a 7-Feb-96
|
||||
--------------------
|
||||
|
||||
Library initialization sequence modified to detect version mismatches
|
||||
and struct field packing mismatches between library and calling application.
|
||||
This change requires applications to be recompiled, but does not require
|
||||
any application source code change.
|
||||
|
||||
All routine declarations changed to the style "GLOBAL(type) name ...",
|
||||
that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the
|
||||
routine's return type as an argument. This makes it possible to add
|
||||
Microsoft-style linkage keywords to all the routines by changing just
|
||||
these macros. Note that any application code that was using these macros
|
||||
will have to be changed.
|
||||
|
||||
DCT coefficient quantization tables are now stored in normal array order
|
||||
rather than zigzag order. Application code that calls jpeg_add_quant_table,
|
||||
or otherwise manipulates quantization tables directly, will need to be
|
||||
changed. If you need to make such code work with either older or newer
|
||||
versions of the library, a test like "#if JPEG_LIB_VERSION >= 61" is
|
||||
recommended.
|
||||
|
||||
djpeg's trace capability now dumps DQT tables in natural order, not zigzag
|
||||
order. This allows the trace output to be made into a "-qtables" file
|
||||
more easily.
|
||||
|
||||
New system-dependent memory manager module for use on Apple Macintosh.
|
||||
|
||||
Fix bug in cjpeg's -smooth option: last one or two scanlines would be
|
||||
duplicates of the prior line unless the image height mod 16 was 1 or 2.
|
||||
|
||||
Repair minor problems in VMS, BCC, MC6 makefiles.
|
||||
|
||||
New configure script based on latest GNU Autoconf.
|
||||
|
||||
Correct the list of include files needed by MetroWerks C for ccommand().
|
||||
|
||||
Numerous small documentation updates.
|
||||
|
||||
|
||||
Version 6 2-Aug-95
|
||||
-------------------
|
||||
|
||||
Progressive JPEG support: library can read and write full progressive JPEG
|
||||
files. A "buffered image" mode supports incremental decoding for on-the-fly
|
||||
display of progressive images. Simply recompiling an existing IJG-v5-based
|
||||
decoder with v6 should allow it to read progressive files, though of course
|
||||
without any special progressive display.
|
||||
|
||||
New "jpegtran" application performs lossless transcoding between different
|
||||
JPEG formats; primarily, it can be used to convert baseline to progressive
|
||||
JPEG and vice versa. In support of jpegtran, the library now allows lossless
|
||||
reading and writing of JPEG files as DCT coefficient arrays. This ability
|
||||
may be of use in other applications.
|
||||
|
||||
Notes for programmers:
|
||||
* We changed jpeg_start_decompress() to be able to suspend; this makes all
|
||||
decoding modes available to suspending-input applications. However,
|
||||
existing applications that use suspending input will need to be changed
|
||||
to check the return value from jpeg_start_decompress(). You don't need to
|
||||
do anything if you don't use a suspending data source.
|
||||
* We changed the interface to the virtual array routines: access_virt_array
|
||||
routines now take a count of the number of rows to access this time. The
|
||||
last parameter to request_virt_array routines is now interpreted as the
|
||||
maximum number of rows that may be accessed at once, but not necessarily
|
||||
the height of every access.
|
||||
|
||||
|
||||
Version 5b 15-Mar-95
|
||||
---------------------
|
||||
|
||||
Correct bugs with grayscale images having v_samp_factor > 1.
|
||||
|
||||
jpeg_write_raw_data() now supports output suspension.
|
||||
|
||||
Correct bugs in "configure" script for case of compiling in
|
||||
a directory other than the one containing the source files.
|
||||
|
||||
Repair bug in jquant1.c: sometimes didn't use as many colors as it could.
|
||||
|
||||
Borland C makefile and jconfig file work under either MS-DOS or OS/2.
|
||||
|
||||
Miscellaneous improvements to documentation.
|
||||
|
||||
|
||||
Version 5a 7-Dec-94
|
||||
--------------------
|
||||
|
||||
Changed color conversion roundoff behavior so that grayscale values are
|
||||
represented exactly. (This causes test image files to change.)
|
||||
|
||||
Make ordered dither use 16x16 instead of 4x4 pattern for a small quality
|
||||
improvement.
|
||||
|
||||
New configure script based on latest GNU Autoconf.
|
||||
Fix configure script to handle CFLAGS correctly.
|
||||
Rename *.auto files to *.cfg, so that configure script still works if
|
||||
file names have been truncated for DOS.
|
||||
|
||||
Fix bug in rdbmp.c: didn't allow for extra data between header and image.
|
||||
|
||||
Modify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.
|
||||
|
||||
Fix several bugs in rdrle.c.
|
||||
|
||||
NEED_SHORT_EXTERNAL_NAMES option was broken.
|
||||
|
||||
Revise jerror.h/jerror.c for more flexibility in message table.
|
||||
|
||||
Repair oversight in jmemname.c NO_MKTEMP case: file could be there
|
||||
but unreadable.
|
||||
|
||||
|
||||
Version 5 24-Sep-94
|
||||
--------------------
|
||||
|
||||
Version 5 represents a nearly complete redesign and rewrite of the IJG
|
||||
software. Major user-visible changes include:
|
||||
* Automatic configuration simplifies installation for most Unix systems.
|
||||
* A range of speed vs. image quality tradeoffs are supported.
|
||||
This includes resizing of an image during decompression: scaling down
|
||||
by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.
|
||||
* New programs rdjpgcom and wrjpgcom allow insertion and extraction
|
||||
of text comments in a JPEG file.
|
||||
|
||||
The application programmer's interface to the library has changed completely.
|
||||
Notable improvements include:
|
||||
* We have eliminated the use of callback routines for handling the
|
||||
uncompressed image data. The application now sees the library as a
|
||||
set of routines that it calls to read or write image data on a
|
||||
scanline-by-scanline basis.
|
||||
* The application image data is represented in a conventional interleaved-
|
||||
pixel format, rather than as a separate array for each color channel.
|
||||
This can save a copying step in many programs.
|
||||
* The handling of compressed data has been cleaned up: the application can
|
||||
supply routines to source or sink the compressed data. It is possible to
|
||||
suspend processing on source/sink buffer overrun, although this is not
|
||||
supported in all operating modes.
|
||||
* All static state has been eliminated from the library, so that multiple
|
||||
instances of compression or decompression can be active concurrently.
|
||||
* JPEG abbreviated datastream formats are supported, ie, quantization and
|
||||
Huffman tables can be stored separately from the image data.
|
||||
* And not only that, but the documentation of the library has improved
|
||||
considerably!
|
||||
|
||||
|
||||
The last widely used release before the version 5 rewrite was version 4A of
|
||||
18-Feb-93. Change logs before that point have been discarded, since they
|
||||
are not of much interest after the rewrite.
|
||||
248
cjpeg.1
@@ -1,46 +1,10 @@
|
||||
.TH CJPEG 1 "4 November 1992"
|
||||
.TH CJPEG 1 "18 January 2013"
|
||||
.SH NAME
|
||||
cjpeg \- compress an image file to a JPEG file
|
||||
.SH SYNOPSIS
|
||||
.B cjpeg
|
||||
[
|
||||
.BI \-quality " N"
|
||||
]
|
||||
[
|
||||
.B \-grayscale
|
||||
]
|
||||
[
|
||||
.B \-optimize
|
||||
]
|
||||
[
|
||||
.B \-targa
|
||||
]
|
||||
[
|
||||
.BI \-maxmemory " N"
|
||||
]
|
||||
[
|
||||
.BI \-restart " N"
|
||||
]
|
||||
[
|
||||
.BI \-smooth " N"
|
||||
]
|
||||
[
|
||||
.B \-verbose
|
||||
]
|
||||
[
|
||||
.B \-debug
|
||||
]
|
||||
[
|
||||
.B \-arithmetic
|
||||
]
|
||||
[
|
||||
.B \-nointerleave
|
||||
]
|
||||
[
|
||||
.BI \-qtables " file"
|
||||
]
|
||||
[
|
||||
.BI \-sample " HxV[,...]"
|
||||
.I options
|
||||
]
|
||||
[
|
||||
.I filename
|
||||
@@ -52,7 +16,7 @@ cjpeg \- compress an image file to a JPEG file
|
||||
compresses the named image file, or the standard input if no file is
|
||||
named, and produces a JPEG/JFIF file on the standard output.
|
||||
The currently supported input file formats are: PPM (PBMPLUS color
|
||||
format), PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster
|
||||
format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster
|
||||
Toolkit format). (RLE is supported only if the URT library is available.)
|
||||
.SH OPTIONS
|
||||
All switch names may be abbreviated; for example,
|
||||
@@ -63,28 +27,33 @@ or
|
||||
.BR \-gr .
|
||||
Most of the "basic" switches can be abbreviated to as little as one letter.
|
||||
Upper and lower case are equivalent (thus
|
||||
.B \-GIF
|
||||
.B \-BMP
|
||||
is the same as
|
||||
.BR \-gif ).
|
||||
.BR \-bmp ).
|
||||
British spellings are also accepted (e.g.,
|
||||
.BR \-greyscale ),
|
||||
though for brevity these are not mentioned below.
|
||||
.PP
|
||||
The basic switches are:
|
||||
.TP
|
||||
.BI \-quality " N"
|
||||
.BI \-quality " N[,...]"
|
||||
Scale quantization tables to adjust image quality. Quality is 0 (worst) to
|
||||
100 (best); default is 75. (See below for more info.)
|
||||
.TP
|
||||
.B \-grayscale
|
||||
Create monochrome JPEG file from color input. Be sure to use this switch when
|
||||
compressing a grayscale GIF file, because
|
||||
compressing a grayscale BMP file, because
|
||||
.B cjpeg
|
||||
isn't bright enough to notice whether a GIF file uses only shades of gray.
|
||||
isn't bright enough to notice whether a BMP file uses only shades of gray.
|
||||
By saying
|
||||
.BR \-grayscale ,
|
||||
you'll get a smaller JPEG file that takes less time to process.
|
||||
.TP
|
||||
.B \-rgb
|
||||
Create RGB JPEG file.
|
||||
Using this switch suppresses the conversion from RGB
|
||||
colorspace input to the default YCbCr JPEG colorspace.
|
||||
.TP
|
||||
.B \-optimize
|
||||
Perform optimization of entropy encoding parameters. Without this, default
|
||||
encoding parameters are used.
|
||||
@@ -95,6 +64,9 @@ runs somewhat slower and needs much more memory. Image quality and speed of
|
||||
decompression are unaffected by
|
||||
.BR \-optimize .
|
||||
.TP
|
||||
.B \-progressive
|
||||
Create progressive JPEG file (see below).
|
||||
.TP
|
||||
.B \-targa
|
||||
Input file is Targa format. Targa files that contain an "identification"
|
||||
field will not be automatically recognized by
|
||||
@@ -104,6 +76,7 @@ for such files you must specify
|
||||
to make
|
||||
.B cjpeg
|
||||
treat the input as Targa format.
|
||||
For most Targa files, you won't need this switch.
|
||||
.PP
|
||||
The
|
||||
.B \-quality
|
||||
@@ -119,7 +92,7 @@ often about right. If you see defects at
|
||||
image. (The optimal setting will vary from one image to another.)
|
||||
.PP
|
||||
.B \-quality
|
||||
100 will generate a quantization table of all 1's, eliminating loss in the
|
||||
100 will generate a quantization table of all 1's, minimizing loss in the
|
||||
quantization step (but there is still information loss in subsampling, as well
|
||||
as roundoff error). This setting is mainly of interest for experimental
|
||||
purposes. Quality values above about 95 are
|
||||
@@ -136,16 +109,71 @@ values below about 25 generate 2-byte quantization tables, which are
|
||||
considered optional in the JPEG standard.
|
||||
.B cjpeg
|
||||
emits a warning message when you give such a quality value, because some
|
||||
commercial JPEG programs may be unable to decode the resulting file.)
|
||||
other JPEG programs may be unable to decode the resulting file. Use
|
||||
.B \-baseline
|
||||
if you need to ensure compatibility at low quality values.)
|
||||
.PP
|
||||
The \fB-quality\fR option has been extended in this version of \fBcjpeg\fR to
|
||||
support separate quality settings for luminance and chrominance (or, in
|
||||
general, separate settings for every quantization table slot.) The principle
|
||||
is the same as chrominance subsampling: since the human eye is more sensitive
|
||||
to spatial changes in brightness than spatial changes in color, the chrominance
|
||||
components can be quantized more than the luminance components without
|
||||
incurring any visible image quality loss. However, unlike subsampling, this
|
||||
feature reduces data in the frequency domain instead of the spatial domain,
|
||||
which allows for more fine-grained control. This option is useful in
|
||||
quality-sensitive applications, for which the artifacts generated by
|
||||
subsampling may be unacceptable.
|
||||
.PP
|
||||
The \fB-quality\fR option accepts a comma-separated list of parameters, which
|
||||
respectively refer to the quality levels that should be assigned to the
|
||||
quantization table slots. If there are more q-table slots than parameters,
|
||||
then the last parameter is replicated. Thus, if only one quality parameter is
|
||||
given, this is used for both luminance and chrominance (slots 0 and 1,
|
||||
respectively), preserving the legacy behavior of cjpeg v6b and prior.
|
||||
More (or customized) quantization tables can be set with the \fB-qtables\fR
|
||||
option and assigned to components with the \fB-qslots\fR option (see the
|
||||
"wizard" switches below.)
|
||||
.PP
|
||||
JPEG files generated with separate luminance and chrominance quality are fully
|
||||
compliant with standard JPEG decoders.
|
||||
.PP
|
||||
.BR CAUTION:
|
||||
For this setting to be useful, be sure to pass an argument of \fB-sample 1x1\fR
|
||||
to \fBcjpeg\fR to disable chrominance subsampling. Otherwise, the default
|
||||
subsampling level (2x2, AKA "4:2:0") will be used.
|
||||
.PP
|
||||
The
|
||||
.B \-progressive
|
||||
switch creates a "progressive JPEG" file. In this type of JPEG file, the data
|
||||
is stored in multiple scans of increasing quality. If the file is being
|
||||
transmitted over a slow communications link, the decoder can use the first
|
||||
scan to display a low-quality image very quickly, and can then improve the
|
||||
display with each subsequent scan. The final image is exactly equivalent to a
|
||||
standard JPEG file of the same quality setting, and the total file size is
|
||||
about the same --- often a little smaller.
|
||||
.PP
|
||||
Switches for advanced users:
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
.B \-arithmetic
|
||||
Use arithmetic coding.
|
||||
.B Caution:
|
||||
arithmetic coded JPEG is not yet widely implemented, so many decoders will be
|
||||
unable to view an arithmetic coded JPEG file at all.
|
||||
.TP
|
||||
.B \-dct int
|
||||
Use integer DCT method (default).
|
||||
.TP
|
||||
.B \-dct fast
|
||||
Use fast integer DCT (less accurate).
|
||||
.TP
|
||||
.B \-dct float
|
||||
Use floating-point DCT method.
|
||||
The float method is very slightly more accurate than the int method, but is
|
||||
much slower unless your machine has very fast floating-point hardware. Also
|
||||
note that results of the floating-point method may vary slightly across
|
||||
machines, while the integer methods should give the same results everywhere.
|
||||
The fast integer method is much less accurate than the other two.
|
||||
.TP
|
||||
.BI \-restart " N"
|
||||
Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
|
||||
@@ -157,6 +185,21 @@ attached to the number.
|
||||
Smooth the input image to eliminate dithering noise. N, ranging from 1 to
|
||||
100, indicates the strength of smoothing. 0 (the default) means no smoothing.
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
.TP
|
||||
.BI \-outfile " name"
|
||||
Send output image to the named file, not to standard output.
|
||||
.TP
|
||||
.BI \-memdst
|
||||
Compress to memory instead of a file. This feature was implemented mainly as a
|
||||
way of testing the in-memory destination manager (jpeg_mem_dest()), but it is
|
||||
also useful for benchmarking, since it reduces the I/O overhead.
|
||||
.TP
|
||||
.B \-verbose
|
||||
Enable debug printout. More
|
||||
.BR \-v 's
|
||||
@@ -180,41 +223,38 @@ for images that will be transmitted across unreliable networks such as Usenet.
|
||||
The
|
||||
.B \-smooth
|
||||
option filters the input to eliminate fine-scale noise. This is often useful
|
||||
when converting GIF files to JPEG: a moderate smoothing factor of 10 to 50
|
||||
gets rid of dithering patterns in the input file, resulting in a smaller JPEG
|
||||
file and a better-looking image. Too large a smoothing factor will visibly
|
||||
blur the image, however.
|
||||
when converting dithered images to JPEG: a moderate smoothing factor of 10 to
|
||||
50 gets rid of dithering patterns in the input file, resulting in a smaller
|
||||
JPEG file and a better-looking image. Too large a smoothing factor will
|
||||
visibly blur the image, however.
|
||||
.PP
|
||||
Switches for wizards:
|
||||
.TP
|
||||
.B \-arithmetic
|
||||
Use arithmetic coding rather than Huffman coding. (Not currently
|
||||
supported for legal reasons.)
|
||||
.TP
|
||||
.B \-nointerleave
|
||||
Generate noninterleaved JPEG file (not yet supported).
|
||||
.B \-baseline
|
||||
Force baseline-compatible quantization tables to be generated. This clamps
|
||||
quantization values to 8 bits even at low quality settings. (This switch is
|
||||
poorly named, since it does not ensure that the output is actually baseline
|
||||
JPEG. For example, you can use
|
||||
.B \-baseline
|
||||
and
|
||||
.B \-progressive
|
||||
together.)
|
||||
.TP
|
||||
.BI \-qtables " file"
|
||||
Use the quantization tables given in the specified file. The file should
|
||||
contain one to four tables (64 values each) as plain text. Comments preceded
|
||||
by '#' may be included in the file. The tables are implicitly numbered
|
||||
0,1,etc. If
|
||||
.B \-quality
|
||||
N is also specified, the values in the file are scaled according to
|
||||
.BR cjpeg 's
|
||||
quality scaling curve.
|
||||
Use the quantization tables given in the specified text file.
|
||||
.TP
|
||||
.BI \-qslots " N[,...]"
|
||||
Select which quantization table to use for each color component.
|
||||
.TP
|
||||
.BI \-sample " HxV[,...]"
|
||||
Set JPEG sampling factors. If you specify fewer H/V pairs than there are
|
||||
components, the remaining components are set to 1x1 sampling. The default
|
||||
setting is equivalent to \fB\-sample 2x2\fR.
|
||||
Set JPEG sampling factors for each color component.
|
||||
.TP
|
||||
.BI \-scans " file"
|
||||
Use the scan script given in the specified text file.
|
||||
.PP
|
||||
The "wizard" switches are intended for experimentation with JPEG. If you
|
||||
don't know what you are doing, \fBdon't use them\fR. You can easily produce
|
||||
files with worse image quality and/or poorer compression than you'll get from
|
||||
the default settings. Furthermore, these switches should not be used when
|
||||
making files intended for general use, because not all JPEG implementations
|
||||
will support unusual JPEG parameter settings.
|
||||
don't know what you are doing, \fBdon't use them\fR. These switches are
|
||||
documented further in the file wizard.txt.
|
||||
.SH EXAMPLES
|
||||
.LP
|
||||
This example compresses the PPM file foo.ppm with a quality factor of
|
||||
@@ -224,6 +264,36 @@ This example compresses the PPM file foo.ppm with a quality factor of
|
||||
.I 60 foo.ppm
|
||||
.B >
|
||||
.I foo.jpg
|
||||
.SH HINTS
|
||||
Color GIF files are not the ideal input for JPEG; JPEG is really intended for
|
||||
compressing full-color (24-bit) images. In particular, don't try to convert
|
||||
cartoons, line drawings, and other images that have only a few distinct
|
||||
colors. GIF works great on these, JPEG does not. If you want to convert a
|
||||
GIF to JPEG, you should experiment with
|
||||
.BR cjpeg 's
|
||||
.B \-quality
|
||||
and
|
||||
.B \-smooth
|
||||
options to get a satisfactory conversion.
|
||||
.B \-smooth 10
|
||||
or so is often helpful.
|
||||
.PP
|
||||
Avoid running an image through a series of JPEG compression/decompression
|
||||
cycles. Image quality loss will accumulate; after ten or so cycles the image
|
||||
may be noticeably worse than it was after one cycle. It's best to use a
|
||||
lossless format while manipulating an image, then convert to JPEG format when
|
||||
you are ready to file the image away.
|
||||
.PP
|
||||
The
|
||||
.B \-optimize
|
||||
option to
|
||||
.B cjpeg
|
||||
is worth using when you are making a "final" version for posting or archiving.
|
||||
It's also a win when you are using low quality settings to make very small
|
||||
JPEG files; the percentage improvement is often a lot more than it is on
|
||||
larger files. (At present,
|
||||
.B \-optimize
|
||||
mode is always selected when generating progressive JPEG files.)
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B JPEGMEM
|
||||
@@ -236,7 +306,10 @@ overrides the default value specified when the program was compiled, and
|
||||
itself is overridden by an explicit
|
||||
.BR \-maxmemory .
|
||||
.SH SEE ALSO
|
||||
.BR djpeg (1)
|
||||
.BR djpeg (1),
|
||||
.BR jpegtran (1),
|
||||
.BR rdjpgcom (1),
|
||||
.BR wrjpgcom (1)
|
||||
.br
|
||||
.BR ppm (5),
|
||||
.BR pgm (5)
|
||||
@@ -245,14 +318,19 @@ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
|
||||
.SH AUTHOR
|
||||
Independent JPEG Group
|
||||
.SH BUGS
|
||||
Arithmetic coding and interleaved output not yet supported.
|
||||
.PP
|
||||
Not all variants of Targa file format are supported.
|
||||
This file was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
|
||||
features not present in libjpeg.
|
||||
.SH BUGS
|
||||
Support for GIF input files was removed in cjpeg v6b due to concerns over
|
||||
the Unisys LZW patent. Although this patent expired in 2006, cjpeg still
|
||||
lacks GIF support, for these historical reasons. (Conversion of GIF files to
|
||||
JPEG is usually a bad idea anyway.)
|
||||
.PP
|
||||
Not all variants of BMP and Targa file formats are supported.
|
||||
.PP
|
||||
The
|
||||
.B -targa
|
||||
.B \-targa
|
||||
switch is not a bug, it's a feature. (It would be a bug if the Targa format
|
||||
designers had not been clueless.)
|
||||
.PP
|
||||
Still not as fast as we'd like.
|
||||
|
||||
641
cjpeg.c
Normal file
@@ -0,0 +1,641 @@
|
||||
/*
|
||||
* cjpeg.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2011 by Guido Vollbeding.
|
||||
* Modifications:
|
||||
* Copyright (C) 2010, 2013, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains a command-line user interface for the JPEG compressor.
|
||||
* It should work on any system with Unix- or MS-DOS-style command lines.
|
||||
*
|
||||
* Two different command line styles are permitted, depending on the
|
||||
* compile-time switch TWO_FILE_COMMANDLINE:
|
||||
* cjpeg [options] inputfile outputfile
|
||||
* cjpeg [options] [inputfile]
|
||||
* In the second style, output is always to standard output, which you'd
|
||||
* normally redirect to a file or pipe to some other program. Input is
|
||||
* either from a named file or from standard input (typically redirected).
|
||||
* The second style is convenient on Unix but is unhelpful on systems that
|
||||
* don't support pipes. Also, you MUST use the first style if your system
|
||||
* doesn't do binary I/O to stdin/stdout.
|
||||
* To simplify script writing, the "-outfile" switch is provided. The syntax
|
||||
* cjpeg [options] -outfile outputfile inputfile
|
||||
* works regardless of which command line style is used.
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "config.h"
|
||||
|
||||
#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
|
||||
#ifdef __MWERKS__
|
||||
#include <SIOUX.h> /* Metrowerks needs this */
|
||||
#include <console.h> /* ... and this */
|
||||
#endif
|
||||
#ifdef THINK_C
|
||||
#include <console.h> /* Think declares it here */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Create the add-on message string table. */
|
||||
|
||||
#define JMESSAGE(code,string) string ,
|
||||
|
||||
static const char * const cdjpeg_message_table[] = {
|
||||
#include "cderror.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This routine determines what format the input file is,
|
||||
* and selects the appropriate input-reading module.
|
||||
*
|
||||
* To determine which family of input formats the file belongs to,
|
||||
* we may look only at the first byte of the file, since C does not
|
||||
* guarantee that more than one character can be pushed back with ungetc.
|
||||
* Looking at additional bytes would require one of these approaches:
|
||||
* 1) assume we can fseek() the input file (fails for piped input);
|
||||
* 2) assume we can push back more than one character (works in
|
||||
* some C implementations, but unportable);
|
||||
* 3) provide our own buffering (breaks input readers that want to use
|
||||
* stdio directly, such as the RLE library);
|
||||
* or 4) don't put back the data, and modify the input_init methods to assume
|
||||
* they start reading after the start of file (also breaks RLE library).
|
||||
* #1 is attractive for MS-DOS but is untenable on Unix.
|
||||
*
|
||||
* The most portable solution for file types that can't be identified by their
|
||||
* first byte is to make the user tell us what they are. This is also the
|
||||
* only approach for "raw" file types that contain only arbitrary values.
|
||||
* We presently apply this method for Targa files. Most of the time Targa
|
||||
* files start with 0x00, so we recognize that case. Potentially, however,
|
||||
* a Targa file could start with any byte value (byte 0 is the length of the
|
||||
* seldom-used ID field), so we provide a switch to force Targa input mode.
|
||||
*/
|
||||
|
||||
static boolean is_targa; /* records user -targa switch */
|
||||
|
||||
|
||||
LOCAL(cjpeg_source_ptr)
|
||||
select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (is_targa) {
|
||||
#ifdef TARGA_SUPPORTED
|
||||
return jinit_read_targa(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_TGA_NOTCOMP);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((c = getc(infile)) == EOF)
|
||||
ERREXIT(cinfo, JERR_INPUT_EMPTY);
|
||||
if (ungetc(c, infile) == EOF)
|
||||
ERREXIT(cinfo, JERR_UNGETC_FAILED);
|
||||
|
||||
switch (c) {
|
||||
#ifdef BMP_SUPPORTED
|
||||
case 'B':
|
||||
return jinit_read_bmp(cinfo);
|
||||
#endif
|
||||
#ifdef GIF_SUPPORTED
|
||||
case 'G':
|
||||
return jinit_read_gif(cinfo);
|
||||
#endif
|
||||
#ifdef PPM_SUPPORTED
|
||||
case 'P':
|
||||
return jinit_read_ppm(cinfo);
|
||||
#endif
|
||||
#ifdef RLE_SUPPORTED
|
||||
case 'R':
|
||||
return jinit_read_rle(cinfo);
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
case 0x00:
|
||||
return jinit_read_targa(cinfo);
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_UNKNOWN_FORMAT);
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL; /* suppress compiler warnings */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Argument-parsing code.
|
||||
* The switch parser is designed to be useful with DOS-style command line
|
||||
* syntax, ie, intermixed switches and file names, where only the switches
|
||||
* to the left of a given file name affect processing of that file.
|
||||
* The main program in this file doesn't actually use this capability...
|
||||
*/
|
||||
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
boolean memdst; /* for -memdst switch */
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
usage (void)
|
||||
/* complain about bad command line */
|
||||
{
|
||||
fprintf(stderr, "usage: %s [switches] ", progname);
|
||||
#ifdef TWO_FILE_COMMANDLINE
|
||||
fprintf(stderr, "inputfile outputfile\n");
|
||||
#else
|
||||
fprintf(stderr, "[inputfile]\n");
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "Switches (names may be abbreviated):\n");
|
||||
fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n");
|
||||
fprintf(stderr, " -grayscale Create monochrome JPEG file\n");
|
||||
fprintf(stderr, " -rgb Create RGB JPEG file\n");
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n");
|
||||
#endif
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
fprintf(stderr, " -progressive Create progressive JPEG file\n");
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
|
||||
#endif
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
|
||||
#endif
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
fprintf(stderr, " -dct int Use integer DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
|
||||
fprintf(stderr, " -outfile name Specify name for output file\n");
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
fprintf(stderr, " -memdst Compress to memory instead of file (useful for benchmarking)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, "Switches for wizards:\n");
|
||||
fprintf(stderr, " -baseline Force baseline quantization tables\n");
|
||||
fprintf(stderr, " -qtables file Use quantization tables given in file\n");
|
||||
fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
|
||||
fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n");
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(int)
|
||||
parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
/* Parse optional switches.
|
||||
* Returns argv[] index of first file-name argument (== argc if none).
|
||||
* Any file names with indexes <= last_file_arg_seen are ignored;
|
||||
* they have presumably been processed in a previous iteration.
|
||||
* (Pass 0 for last_file_arg_seen on the first or only iteration.)
|
||||
* for_real is FALSE on the first (dummy) pass; we may skip any expensive
|
||||
* processing.
|
||||
*/
|
||||
{
|
||||
int argn;
|
||||
char * arg;
|
||||
boolean force_baseline;
|
||||
boolean simple_progressive;
|
||||
char * qualityarg = NULL; /* saves -quality parm if any */
|
||||
char * qtablefile = NULL; /* saves -qtables filename if any */
|
||||
char * qslotsarg = NULL; /* saves -qslots parm if any */
|
||||
char * samplearg = NULL; /* saves -sample parm if any */
|
||||
char * scansarg = NULL; /* saves -scans parm if any */
|
||||
|
||||
/* Set up default JPEG parameters. */
|
||||
|
||||
force_baseline = FALSE; /* by default, allow 16-bit quantizers */
|
||||
simple_progressive = FALSE;
|
||||
is_targa = FALSE;
|
||||
outfilename = NULL;
|
||||
memdst = FALSE;
|
||||
cinfo->err->trace_level = 0;
|
||||
|
||||
/* Scan command line options, adjust parameters */
|
||||
|
||||
for (argn = 1; argn < argc; argn++) {
|
||||
arg = argv[argn];
|
||||
if (*arg != '-') {
|
||||
/* Not a switch, must be a file name argument */
|
||||
if (argn <= last_file_arg_seen) {
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
}
|
||||
break; /* else done parsing switches */
|
||||
}
|
||||
arg++; /* advance past switch marker character */
|
||||
|
||||
if (keymatch(arg, "arithmetic", 1)) {
|
||||
/* Use arithmetic coding. */
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
cinfo->arith_code = TRUE;
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "baseline", 1)) {
|
||||
/* Force baseline-compatible output (8-bit quantizer values). */
|
||||
force_baseline = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "dct", 2)) {
|
||||
/* Select DCT algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "int", 1)) {
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
} else if (keymatch(argv[argn], "fast", 2)) {
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
} else if (keymatch(argv[argn], "float", 2)) {
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
} else
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
|
||||
/* Enable debug printouts. */
|
||||
/* On first -d, print version identification */
|
||||
static boolean printed_version = FALSE;
|
||||
|
||||
if (! printed_version) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
}
|
||||
cinfo->err->trace_level++;
|
||||
|
||||
} else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
|
||||
/* Force a monochrome JPEG file to be generated. */
|
||||
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
|
||||
|
||||
} else if (keymatch(arg, "rgb", 3)) {
|
||||
/* Force an RGB JPEG file to be generated. */
|
||||
jpeg_set_colorspace(cinfo, JCS_RGB);
|
||||
|
||||
} else if (keymatch(arg, "maxmemory", 3)) {
|
||||
/* Maximum memory in Kb (or Mb with 'm'). */
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
if (ch == 'm' || ch == 'M')
|
||||
lval *= 1000L;
|
||||
cinfo->mem->max_memory_to_use = lval * 1000L;
|
||||
|
||||
} else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
|
||||
/* Enable entropy parm optimization. */
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
cinfo->optimize_coding = TRUE;
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, entropy optimization was not compiled in\n",
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "outfile", 4)) {
|
||||
/* Set output file name. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
|
||||
} else if (keymatch(arg, "progressive", 1)) {
|
||||
/* Select simple progressive mode. */
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
simple_progressive = TRUE;
|
||||
/* We must postpone execution until num_components is known. */
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, progressive output was not compiled in\n",
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "memdst", 2)) {
|
||||
/* Use in-memory destination manager */
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
memdst = TRUE;
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, in-memory destination manager was not compiled in\n",
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "quality", 1)) {
|
||||
/* Quality ratings (quantization table scaling factors). */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
qualityarg = argv[argn];
|
||||
|
||||
} else if (keymatch(arg, "qslots", 2)) {
|
||||
/* Quantization table slot numbers. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
qslotsarg = argv[argn];
|
||||
/* Must delay setting qslots until after we have processed any
|
||||
* colorspace-determining switches, since jpeg_set_colorspace sets
|
||||
* default quant table numbers.
|
||||
*/
|
||||
|
||||
} else if (keymatch(arg, "qtables", 2)) {
|
||||
/* Quantization tables fetched from file. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
qtablefile = argv[argn];
|
||||
/* We postpone actually reading the file in case -quality comes later. */
|
||||
|
||||
} else if (keymatch(arg, "restart", 1)) {
|
||||
/* Restart interval in MCU rows (or in MCUs with 'b'). */
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
if (lval < 0 || lval > 65535L)
|
||||
usage();
|
||||
if (ch == 'b' || ch == 'B') {
|
||||
cinfo->restart_interval = (unsigned int) lval;
|
||||
cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
|
||||
} else {
|
||||
cinfo->restart_in_rows = (int) lval;
|
||||
/* restart_interval will be computed during startup */
|
||||
}
|
||||
|
||||
} else if (keymatch(arg, "sample", 2)) {
|
||||
/* Set sampling factors. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
samplearg = argv[argn];
|
||||
/* Must delay setting sample factors until after we have processed any
|
||||
* colorspace-determining switches, since jpeg_set_colorspace sets
|
||||
* default sampling factors.
|
||||
*/
|
||||
|
||||
} else if (keymatch(arg, "scans", 4)) {
|
||||
/* Set scan script. */
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
scansarg = argv[argn];
|
||||
/* We must postpone reading the file in case -progressive appears. */
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, multi-scan output was not compiled in\n",
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "smooth", 2)) {
|
||||
/* Set input smoothing factor. */
|
||||
int val;
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d", &val) != 1)
|
||||
usage();
|
||||
if (val < 0 || val > 100)
|
||||
usage();
|
||||
cinfo->smoothing_factor = val;
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Input file is Targa format. */
|
||||
is_targa = TRUE;
|
||||
|
||||
} else {
|
||||
usage(); /* bogus switch */
|
||||
}
|
||||
}
|
||||
|
||||
/* Post-switch-scanning cleanup */
|
||||
|
||||
if (for_real) {
|
||||
|
||||
/* Set quantization tables for selected quality. */
|
||||
/* Some or all may be overridden if -qtables is present. */
|
||||
if (qualityarg != NULL) /* process -quality if it was present */
|
||||
if (! set_quality_ratings(cinfo, qualityarg, force_baseline))
|
||||
usage();
|
||||
|
||||
if (qtablefile != NULL) /* process -qtables if it was present */
|
||||
if (! read_quant_tables(cinfo, qtablefile, force_baseline))
|
||||
usage();
|
||||
|
||||
if (qslotsarg != NULL) /* process -qslots if it was present */
|
||||
if (! set_quant_slots(cinfo, qslotsarg))
|
||||
usage();
|
||||
|
||||
if (samplearg != NULL) /* process -sample if it was present */
|
||||
if (! set_sample_factors(cinfo, samplearg))
|
||||
usage();
|
||||
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
if (simple_progressive) /* process -progressive; -scans can override */
|
||||
jpeg_simple_progression(cinfo);
|
||||
#endif
|
||||
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
if (scansarg != NULL) /* process -scans if it was present */
|
||||
if (! read_scan_script(cinfo, scansarg))
|
||||
usage();
|
||||
#endif
|
||||
}
|
||||
|
||||
return argn; /* return index of next arg (file name) */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The main program.
|
||||
*/
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct jpeg_compress_struct cinfo;
|
||||
struct jpeg_error_mgr jerr;
|
||||
#ifdef PROGRESS_REPORT
|
||||
struct cdjpeg_progress_mgr progress;
|
||||
#endif
|
||||
int file_index;
|
||||
cjpeg_source_ptr src_mgr;
|
||||
FILE * input_file;
|
||||
FILE * output_file = NULL;
|
||||
unsigned char *outbuffer = NULL;
|
||||
unsigned long outsize = 0;
|
||||
JDIMENSION num_scanlines;
|
||||
|
||||
/* On Mac, fetch a command line. */
|
||||
#ifdef USE_CCOMMAND
|
||||
argc = ccommand(&argv);
|
||||
#endif
|
||||
|
||||
progname = argv[0];
|
||||
if (progname == NULL || progname[0] == 0)
|
||||
progname = "cjpeg"; /* in case C library doesn't provide it */
|
||||
|
||||
/* Initialize the JPEG compression object with default error handling. */
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
jpeg_create_compress(&cinfo);
|
||||
/* Add some application-specific error messages (from cderror.h) */
|
||||
jerr.addon_message_table = cdjpeg_message_table;
|
||||
jerr.first_addon_message = JMSG_FIRSTADDONCODE;
|
||||
jerr.last_addon_message = JMSG_LASTADDONCODE;
|
||||
|
||||
/* Now safe to enable signal catcher. */
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
enable_signal_catcher((j_common_ptr) &cinfo);
|
||||
#endif
|
||||
|
||||
/* Initialize JPEG parameters.
|
||||
* Much of this may be overridden later.
|
||||
* In particular, we don't yet know the input file's color space,
|
||||
* but we need to provide some value for jpeg_set_defaults() to work.
|
||||
*/
|
||||
|
||||
cinfo.in_color_space = JCS_RGB; /* arbitrary guess */
|
||||
jpeg_set_defaults(&cinfo);
|
||||
|
||||
/* Scan command line to find file names.
|
||||
* It is convenient to use just one switch-parsing routine, but the switch
|
||||
* values read here are ignored; we will rescan the switches after opening
|
||||
* the input file.
|
||||
*/
|
||||
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);
|
||||
|
||||
#ifdef TWO_FILE_COMMANDLINE
|
||||
if (!memdst) {
|
||||
/* Must have either -outfile switch or explicit output file name */
|
||||
if (outfilename == NULL) {
|
||||
if (file_index != argc-2) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
outfilename = argv[file_index+1];
|
||||
} else {
|
||||
if (file_index != argc-1) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Unix style: expect zero or one file name */
|
||||
if (file_index < argc-1) {
|
||||
fprintf(stderr, "%s: only one input file\n", progname);
|
||||
usage();
|
||||
}
|
||||
#endif /* TWO_FILE_COMMANDLINE */
|
||||
|
||||
/* Open the input file. */
|
||||
if (file_index < argc) {
|
||||
if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
/* default input file is stdin */
|
||||
input_file = read_stdin();
|
||||
}
|
||||
|
||||
/* Open the output file. */
|
||||
if (outfilename != NULL) {
|
||||
if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else if (!memdst) {
|
||||
/* default output file is stdout */
|
||||
output_file = write_stdout();
|
||||
}
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
start_progress_monitor((j_common_ptr) &cinfo, &progress);
|
||||
#endif
|
||||
|
||||
/* Figure out the input file format, and set up to read it. */
|
||||
src_mgr = select_file_type(&cinfo, input_file);
|
||||
src_mgr->input_file = input_file;
|
||||
|
||||
/* Read the input file header to obtain file size & colorspace. */
|
||||
(*src_mgr->start_input) (&cinfo, src_mgr);
|
||||
|
||||
/* Now that we know input colorspace, fix colorspace-dependent defaults */
|
||||
jpeg_default_colorspace(&cinfo);
|
||||
|
||||
/* Adjust default compression parameters by re-parsing the options */
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
|
||||
|
||||
/* Specify data destination for compression */
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
if (memdst)
|
||||
jpeg_mem_dest(&cinfo, &outbuffer, &outsize);
|
||||
else
|
||||
#endif
|
||||
jpeg_stdio_dest(&cinfo, output_file);
|
||||
|
||||
/* Start compressor */
|
||||
jpeg_start_compress(&cinfo, TRUE);
|
||||
|
||||
/* Process data */
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr);
|
||||
(void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);
|
||||
}
|
||||
|
||||
/* Finish compression and release memory */
|
||||
(*src_mgr->finish_input) (&cinfo, src_mgr);
|
||||
jpeg_finish_compress(&cinfo);
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
|
||||
/* Close files, if we opened them */
|
||||
if (input_file != stdin)
|
||||
fclose(input_file);
|
||||
if (output_file != stdout && output_file != NULL)
|
||||
fclose(output_file);
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
end_progress_monitor((j_common_ptr) &cinfo);
|
||||
#endif
|
||||
|
||||
if (memdst) {
|
||||
fprintf(stderr, "Compressed size: %lu bytes\n", outsize);
|
||||
if (outbuffer != NULL)
|
||||
free(outbuffer);
|
||||
}
|
||||
|
||||
/* All done. */
|
||||
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
}
|
||||
404
ckconfig.c
@@ -1,404 +0,0 @@
|
||||
/*
|
||||
* ckconfig.c
|
||||
*
|
||||
* Copyright (C) 1991, 1992, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is intended to help you determine how to configure the JPEG
|
||||
* software for installation on a particular system. The idea is to try to
|
||||
* compile and execute this program. If your compiler fails to compile the
|
||||
* program, make changes as indicated in the comments below. Once you can
|
||||
* compile the program, run it, and it will tell you how to set the various
|
||||
* switches in jconfig.h and in your Makefile.
|
||||
*
|
||||
* This could all be done automatically if we could assume we were on a Unix
|
||||
* system, but we don't want to assume that, so you'll have to edit and
|
||||
* recompile this program until it works.
|
||||
*
|
||||
* As a general rule, each time you try to compile this program,
|
||||
* pay attention only to the *first* error message you get from the compiler.
|
||||
* Many C compilers will issue lots of spurious error messages once they
|
||||
* have gotten confused. Go to the line indicated in the first error message,
|
||||
* and read the comments preceding that line to see what to change.
|
||||
*
|
||||
* Almost all of the edits you may need to make to this program consist of
|
||||
* changing a line that reads "#define SOME_SYMBOL" to "#undef SOME_SYMBOL",
|
||||
* or vice versa. This is called defining or undefining that symbol.
|
||||
*/
|
||||
|
||||
|
||||
/* First we must see if your system has the include files we need.
|
||||
* We start out with the assumption that your system follows the ANSI
|
||||
* conventions for include files. If you get any error in the next dozen
|
||||
* lines, undefine INCLUDES_ARE_ANSI.
|
||||
*/
|
||||
|
||||
#define INCLUDES_ARE_ANSI /* replace 'define' by 'undef' if error here */
|
||||
|
||||
#ifdef INCLUDES_ARE_ANSI /* this will be skipped if you undef... */
|
||||
#include <stdio.h> /* If you ain't got this, you ain't got C. */
|
||||
#ifdef __SASC /* Amiga SAS C provides size_t in stddef.h. */
|
||||
#include <stddef.h> /* (They are wrong...) */
|
||||
#endif
|
||||
#include <string.h> /* size_t might be here too. */
|
||||
typedef size_t my_size_t; /* The payoff: do we have size_t now? */
|
||||
#include <stdlib.h> /* Check other ANSI includes we use. */
|
||||
#endif
|
||||
|
||||
|
||||
/* If your system doesn't follow the ANSI conventions, we have to figure out
|
||||
* what it does follow. If you didn't get an error before this line, you can
|
||||
* ignore everything down to "#define HAVE_ANSI_DEFINITIONS".
|
||||
*/
|
||||
|
||||
#ifndef INCLUDES_ARE_ANSI /* skip these tests if INCLUDES_ARE_ANSI */
|
||||
|
||||
#include <stdio.h> /* If you ain't got this, you ain't got C. */
|
||||
|
||||
/* jinclude.h will try to include <sys/types.h> if you don't set
|
||||
* INCLUDES_ARE_ANSI. We need to test whether that include file is provided.
|
||||
* If you get an error here, undefine HAVE_TYPES_H.
|
||||
*/
|
||||
|
||||
#define HAVE_TYPES_H
|
||||
|
||||
#ifdef HAVE_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* We have to see if your string functions are defined by
|
||||
* strings.h (BSD convention) or string.h (everybody else).
|
||||
* We try the non-BSD convention first; define BSD if the compiler
|
||||
* says it can't find string.h.
|
||||
*/
|
||||
|
||||
#undef BSD
|
||||
|
||||
#ifdef BSD
|
||||
#include <strings.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Usually size_t is defined in stdio.h, sys/types.h, and/or string.h.
|
||||
* If not, you'll get an error on the "typedef size_t my_size_t;" line below.
|
||||
* In that case, you'll have to search through your system library to
|
||||
* figure out which include file defines "size_t". Look for a line that
|
||||
* says "typedef something-or-other size_t;" (stddef.h and stdlib.h are
|
||||
* good places to look first). Then, change the line below that says
|
||||
* "#include <someincludefile.h>" to instead include the file
|
||||
* you found size_t in, and define NEED_SPECIAL_INCLUDE.
|
||||
*/
|
||||
|
||||
#undef NEED_SPECIAL_INCLUDE /* assume we DON'T need it, for starters */
|
||||
|
||||
#ifdef NEED_SPECIAL_INCLUDE
|
||||
#include <someincludefile.h>
|
||||
#endif
|
||||
|
||||
typedef size_t my_size_t; /* The payoff: do we have size_t now? */
|
||||
|
||||
|
||||
#endif /* INCLUDES_ARE_ANSI */
|
||||
|
||||
|
||||
|
||||
/* The next question is whether your compiler supports ANSI-style function
|
||||
* definitions. You need to know this in order to choose between using
|
||||
* makefile.ansi and using makefile.unix.
|
||||
* The #define line below is set to assume you have ANSI function definitions.
|
||||
* If you get an error in this group of lines, undefine HAVE_ANSI_DEFINITIONS.
|
||||
*/
|
||||
|
||||
#define HAVE_ANSI_DEFINITIONS
|
||||
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
int testfunction (int arg1, int * arg2); /* check prototypes */
|
||||
|
||||
struct methods_struct { /* check method-pointer declarations */
|
||||
int (*error_exit) (char *msgtext);
|
||||
int (*trace_message) (char *msgtext);
|
||||
int (*another_method) (void);
|
||||
};
|
||||
|
||||
int testfunction (int arg1, int * arg2) /* check definitions */
|
||||
{
|
||||
return arg2[arg1];
|
||||
}
|
||||
|
||||
int testfunction1 (void) /* check void arg list */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "unsigned char" means.
|
||||
* If you get an error on the "unsigned char un_char;" line,
|
||||
* then undefine HAVE_UNSIGNED_CHAR.
|
||||
*/
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
unsigned char un_char;
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "unsigned short" means.
|
||||
* If you get an error on the "unsigned short un_short;" line,
|
||||
* then undefine HAVE_UNSIGNED_SHORT.
|
||||
*/
|
||||
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
unsigned short un_short;
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler understands type "void".
|
||||
* If you get an error anywhere in here, undefine HAVE_VOID.
|
||||
*/
|
||||
|
||||
#define HAVE_VOID
|
||||
|
||||
#ifdef HAVE_VOID
|
||||
typedef void * void_ptr; /* check void * */
|
||||
typedef void (*void_func) (); /* check ptr to function returning void */
|
||||
|
||||
void testfunction2 (arg1, arg2) /* check void function result */
|
||||
void_ptr arg1;
|
||||
void_func arg2;
|
||||
{
|
||||
char * locptr = (char *) arg1; /* check casting to and from void * */
|
||||
arg1 = (void *) locptr;
|
||||
(*arg2) (1, 2); /* check call of fcn returning void */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "const" means.
|
||||
* If you get an error here, undefine HAVE_CONST.
|
||||
*/
|
||||
|
||||
#define HAVE_CONST
|
||||
|
||||
#ifdef HAVE_CONST
|
||||
static const int carray[3] = {1, 2, 3};
|
||||
|
||||
int testfunction3 (arg1)
|
||||
const int arg1;
|
||||
{
|
||||
return carray[arg1];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* OK, that's it. You should not have to change anything beyond this
|
||||
* point in order to compile and execute this program. (You might get
|
||||
* some warnings, but you can ignore them.)
|
||||
* When you run the program, it will make a couple more tests that it
|
||||
* can do automatically, and then it will print out a summary of the changes
|
||||
* that you need to make to the makefile and jconfig.h.
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
static int any_changes = 0;
|
||||
|
||||
int new_change ()
|
||||
{
|
||||
if (! any_changes) {
|
||||
printf("\nMost of the changes recommended by this program can be made either\n");
|
||||
printf("by editing jconfig.h, or by adding -Dsymbol switches to the CFLAGS\n");
|
||||
printf("line in your Makefile. (Some PC compilers expect /Dsymbol instead.)\n");
|
||||
printf("The CFLAGS method is simpler, but if your compiler doesn't support -D,\n");
|
||||
printf("then you must change jconfig.h. Also, it's best to change jconfig.h\n");
|
||||
printf("if you plan to use the JPEG software as a library for other programs.\n");
|
||||
any_changes = 1;
|
||||
}
|
||||
printf("\n"); /* blank line before each problem report */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int test_char_sign (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == 189) { /* expected result for unsigned char */
|
||||
new_change();
|
||||
printf("You should add -DCHAR_IS_UNSIGNED to CFLAGS,\n");
|
||||
printf("or else remove the /* */ comment marks from the line\n");
|
||||
printf("/* #define CHAR_IS_UNSIGNED */ in jconfig.h.\n");
|
||||
printf("(Be sure to delete the space before the # character too.)\n");
|
||||
}
|
||||
else if (arg != -67) { /* expected result for signed char */
|
||||
new_change();
|
||||
printf("Hmm, it seems 'char' is less than eight bits wide on your machine.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int test_shifting (arg)
|
||||
long arg;
|
||||
/* See whether right-shift on a long is signed or not. */
|
||||
{
|
||||
long res = arg >> 4;
|
||||
|
||||
if (res == 0x80817F4L) { /* expected result for unsigned */
|
||||
new_change();
|
||||
printf("You must add -DRIGHT_SHIFT_IS_UNSIGNED to CFLAGS,\n");
|
||||
printf("or else remove the /* */ comment marks from the line\n");
|
||||
printf("/* #define RIGHT_SHIFT_IS_UNSIGNED */ in jconfig.h.\n");
|
||||
}
|
||||
else if (res != -0x7F7E80CL) { /* expected result for signed */
|
||||
new_change();
|
||||
printf("Right shift isn't acting as I expect it to.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main (argc, argv)
|
||||
int argc;
|
||||
char ** argv;
|
||||
{
|
||||
char signed_char_check = (char) (-67);
|
||||
|
||||
printf("Results of configuration check for Independent JPEG Group's software:\n");
|
||||
printf("\nIf there's not a specific makefile provided for your compiler,\n");
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
printf("you should use makefile.ansi as the starting point for your Makefile.\n");
|
||||
#else
|
||||
printf("you should use makefile.unix as the starting point for your Makefile.\n");
|
||||
#endif
|
||||
|
||||
/* Check whether we have all the ANSI features, */
|
||||
/* and whether this agrees with __STDC__ being predefined. */
|
||||
#ifdef __STDC__
|
||||
#define HAVE_STDC /* ANSI compilers won't allow redefining __STDC__ */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
#ifdef HAVE_CONST
|
||||
#define HAVE_ALL_ANSI_FEATURES
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ALL_ANSI_FEATURES
|
||||
#ifndef HAVE_STDC
|
||||
new_change();
|
||||
printf("Your compiler doesn't claim to be ANSI-compliant, but it is close enough\n");
|
||||
printf("for me. Either add -DHAVE_STDC to CFLAGS, or add #define HAVE_STDC at the\n");
|
||||
printf("beginning of jconfig.h.\n");
|
||||
#define HAVE_STDC
|
||||
#endif
|
||||
#else /* !HAVE_ALL_ANSI_FEATURES */
|
||||
#ifdef HAVE_STDC
|
||||
new_change();
|
||||
printf("Your compiler claims to be ANSI-compliant, but it is lying!\n");
|
||||
printf("Delete the line #define HAVE_STDC near the beginning of jconfig.h.\n");
|
||||
#undef HAVE_STDC
|
||||
#endif
|
||||
#endif /* HAVE_ALL_ANSI_FEATURES */
|
||||
|
||||
#ifndef HAVE_STDC
|
||||
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
new_change();
|
||||
printf("You should add -DPROTO to CFLAGS, or else take out the several\n");
|
||||
printf("#ifdef/#else/#endif lines surrounding #define PROTO in jconfig.h.\n");
|
||||
printf("(Leave only one #define PROTO line.)\n");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
new_change();
|
||||
printf("You should add -DHAVE_UNSIGNED_CHAR and -DHAVE_UNSIGNED_SHORT\n");
|
||||
printf("to CFLAGS, or else take out the #ifdef HAVE_STDC/#endif lines\n");
|
||||
printf("surrounding #define HAVE_UNSIGNED_CHAR and #define HAVE_UNSIGNED_SHORT\n");
|
||||
printf("in jconfig.h.\n");
|
||||
#else /* only unsigned char */
|
||||
new_change();
|
||||
printf("You should add -DHAVE_UNSIGNED_CHAR to CFLAGS,\n");
|
||||
printf("or else move #define HAVE_UNSIGNED_CHAR outside the\n");
|
||||
printf("#ifdef HAVE_STDC/#endif lines surrounding it in jconfig.h.\n");
|
||||
#endif
|
||||
#else /* !HAVE_UNSIGNED_CHAR */
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
new_change();
|
||||
printf("You should add -DHAVE_UNSIGNED_SHORT to CFLAGS,\n");
|
||||
printf("or else move #define HAVE_UNSIGNED_SHORT outside the\n");
|
||||
printf("#ifdef HAVE_STDC/#endif lines surrounding it in jconfig.h.\n");
|
||||
#endif
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
#ifdef HAVE_CONST
|
||||
new_change();
|
||||
printf("You should delete the #define const line from jconfig.h.\n");
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_STDC */
|
||||
|
||||
test_char_sign((int) signed_char_check);
|
||||
|
||||
test_shifting(-0x7F7E80B1L);
|
||||
|
||||
#ifndef HAVE_VOID
|
||||
new_change();
|
||||
printf("You should add -Dvoid=char to CFLAGS,\n");
|
||||
printf("or else remove the /* */ comment marks from the line\n");
|
||||
printf("/* #define void char */ in jconfig.h.\n");
|
||||
printf("(Be sure to delete the space before the # character too.)\n");
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDES_ARE_ANSI
|
||||
#ifndef __STDC__
|
||||
new_change();
|
||||
printf("You should add -DINCLUDES_ARE_ANSI to CFLAGS, or else add\n");
|
||||
printf("#define INCLUDES_ARE_ANSI at the beginning of jinclude.h (NOT jconfig.h).\n");
|
||||
#endif
|
||||
#else /* !INCLUDES_ARE_ANSI */
|
||||
#ifdef __STDC__
|
||||
new_change();
|
||||
printf("You should add -DNONANSI_INCLUDES to CFLAGS, or else add\n");
|
||||
printf("#define NONANSI_INCLUDES at the beginning of jinclude.h (NOT jconfig.h).\n");
|
||||
#endif
|
||||
#ifdef NEED_SPECIAL_INCLUDE
|
||||
new_change();
|
||||
printf("In jinclude.h, change the line reading #include <sys/types.h>\n");
|
||||
printf("to instead include the file you found size_t in.\n");
|
||||
#else /* !NEED_SPECIAL_INCLUDE */
|
||||
#ifndef HAVE_TYPES_H
|
||||
new_change();
|
||||
printf("In jinclude.h, delete the line reading #include <sys/types.h>.\n");
|
||||
#endif
|
||||
#endif /* NEED_SPECIAL_INCLUDE */
|
||||
#ifdef BSD
|
||||
new_change();
|
||||
printf("You should add -DBSD to CFLAGS, or else add\n");
|
||||
printf("#define BSD at the beginning of jinclude.h (NOT jconfig.h).\n");
|
||||
#endif
|
||||
#endif /* INCLUDES_ARE_ANSI */
|
||||
|
||||
if (any_changes) {
|
||||
printf("\nI think that's everything...\n");
|
||||
} else {
|
||||
printf("\nI think jconfig.h is OK as distributed.\n");
|
||||
}
|
||||
|
||||
return any_changes;
|
||||
}
|
||||
15
cmakescripts/md5cmp.cmake
Normal file
@@ -0,0 +1,15 @@
|
||||
if(NOT MD5)
|
||||
message(FATAL_ERROR "MD5 not specified")
|
||||
endif()
|
||||
|
||||
if(NOT FILE)
|
||||
message(FATAL_ERROR "FILE not specified")
|
||||
endif()
|
||||
|
||||
file(MD5 ${FILE} MD5FILE)
|
||||
|
||||
if(NOT MD5 STREQUAL MD5FILE)
|
||||
message(FATAL_ERROR "MD5 of ${FILE} should be ${MD5}, not ${MD5FILE}.")
|
||||
else()
|
||||
message(STATUS "${MD5}: OK")
|
||||
endif()
|
||||
34
cmakescripts/testclean.cmake
Normal file
@@ -0,0 +1,34 @@
|
||||
file(GLOB FILES
|
||||
testout*
|
||||
*_GRAY_*.bmp
|
||||
*_GRAY_*.png
|
||||
*_GRAY_*.ppm
|
||||
*_GRAY_*.jpg
|
||||
*_GRAY.yuv
|
||||
*_420_*.bmp
|
||||
*_420_*.png
|
||||
*_420_*.ppm
|
||||
*_420_*.jpg
|
||||
*_420.yuv
|
||||
*_422_*.bmp
|
||||
*_422_*.png
|
||||
*_422_*.ppm
|
||||
*_422_*.jpg
|
||||
*_422.yuv
|
||||
*_444_*.bmp
|
||||
*_444_*.png
|
||||
*_444_*.ppm
|
||||
*_444_*.jpg
|
||||
*_444.yuv
|
||||
*_440_*.bmp
|
||||
*_440_*.png
|
||||
*_440_*.ppm
|
||||
*_440_*.jpg
|
||||
*_440.yuv)
|
||||
|
||||
if(NOT FILES STREQUAL "")
|
||||
message(STATUS "Removing test files")
|
||||
file(REMOVE ${FILES})
|
||||
else()
|
||||
message(STATUS "No files to remove")
|
||||
endif()
|
||||
118
coderules.txt
Normal file
@@ -0,0 +1,118 @@
|
||||
IJG JPEG LIBRARY: CODING RULES
|
||||
|
||||
Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
This file is part of the Independent JPEG Group's software.
|
||||
For conditions of distribution and use, see the accompanying README file.
|
||||
|
||||
|
||||
Since numerous people will be contributing code and bug fixes, it's important
|
||||
to establish a common coding style. The goal of using similar coding styles
|
||||
is much more important than the details of just what that style is.
|
||||
|
||||
In general we follow the recommendations of "Recommended C Style and Coding
|
||||
Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and
|
||||
Brader). This document is available in the IJG FTP archive (see
|
||||
jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).
|
||||
|
||||
Block comments should be laid out thusly:
|
||||
|
||||
/*
|
||||
* Block comments in this style.
|
||||
*/
|
||||
|
||||
We indent statements in K&R style, e.g.,
|
||||
if (test) {
|
||||
then-part;
|
||||
} else {
|
||||
else-part;
|
||||
}
|
||||
with two spaces per indentation level. (This indentation convention is
|
||||
handled automatically by GNU Emacs and many other text editors.)
|
||||
|
||||
Multi-word names should be written in lower case with underscores, e.g.,
|
||||
multi_word_name (not multiWordName). Preprocessor symbols and enum constants
|
||||
are similar but upper case (MULTI_WORD_NAME). Names should be unique within
|
||||
the first fifteen characters. (On some older systems, global names must be
|
||||
unique within six characters. We accommodate this without cluttering the
|
||||
source code by using macros to substitute shorter names.)
|
||||
|
||||
We use function prototypes everywhere; we rely on automatic source code
|
||||
transformation to feed prototype-less C compilers. Transformation is done
|
||||
by the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript).
|
||||
ansi2knr is not very bright, so it imposes a format requirement on function
|
||||
declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions
|
||||
should be written in the following style:
|
||||
|
||||
LOCAL(int *)
|
||||
function_name (int a, char *b)
|
||||
{
|
||||
code...
|
||||
}
|
||||
|
||||
Note that each function definition must begin with GLOBAL(type), LOCAL(type),
|
||||
or METHODDEF(type). These macros expand to "static type" or just "type" as
|
||||
appropriate. They provide a readable indication of the routine's usage and
|
||||
can readily be changed for special needs. (For instance, special linkage
|
||||
keywords can be inserted for use in Windows DLLs.)
|
||||
|
||||
ansi2knr does not transform method declarations (function pointers in
|
||||
structs). We handle these with a macro JMETHOD, defined as
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
|
||||
#else
|
||||
#define JMETHOD(type,methodname,arglist) type (*methodname) ()
|
||||
#endif
|
||||
which is used like this:
|
||||
struct function_pointers {
|
||||
JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp));
|
||||
JMETHOD(void, term_entropy_encoder, (void));
|
||||
};
|
||||
Note the set of parentheses surrounding the parameter list.
|
||||
|
||||
A similar solution is used for forward and external function declarations
|
||||
(see the EXTERN and JPP macros).
|
||||
|
||||
If the code is to work on non-ANSI compilers, we cannot rely on a prototype
|
||||
declaration to coerce actual parameters into the right types. Therefore, use
|
||||
explicit casts on actual parameters whenever the actual parameter type is not
|
||||
identical to the formal parameter. Beware of implicit conversions to "int".
|
||||
|
||||
It seems there are some non-ANSI compilers in which the sizeof() operator
|
||||
is defined to return int, yet size_t is defined as long. Needless to say,
|
||||
this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(),
|
||||
so that the result is guaranteed to be of type size_t.
|
||||
|
||||
|
||||
The JPEG library is intended to be used within larger programs. Furthermore,
|
||||
we want it to be reentrant so that it can be used by applications that process
|
||||
multiple images concurrently. The following rules support these requirements:
|
||||
|
||||
1. Avoid direct use of file I/O, "malloc", error report printouts, etc;
|
||||
pass these through the common routines provided.
|
||||
|
||||
2. Minimize global namespace pollution. Functions should be declared static
|
||||
wherever possible. (Note that our method-based calling conventions help this
|
||||
a lot: in many modules only the initialization function will ever need to be
|
||||
called directly, so only that function need be externally visible.) All
|
||||
global function names should begin with "jpeg_", and should have an
|
||||
abbreviated name (unique in the first six characters) substituted by macro
|
||||
when NEED_SHORT_EXTERNAL_NAMES is set.
|
||||
|
||||
3. Don't use global variables; anything that must be used in another module
|
||||
should be in the common data structures.
|
||||
|
||||
4. Don't use static variables except for read-only constant tables. Variables
|
||||
that should be private to a module can be placed into private structures (see
|
||||
the system architecture document, structure.txt).
|
||||
|
||||
5. Source file names should begin with "j" for files that are part of the
|
||||
library proper; source files that are not part of the library, such as cjpeg.c
|
||||
and djpeg.c, do not begin with "j". Keep source file names to eight
|
||||
characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers. Keep
|
||||
compression and decompression code in separate source files --- some
|
||||
applications may want only one half of the library.
|
||||
|
||||
Note: these rules (particularly #4) are not followed religiously in the
|
||||
modules that are used in cjpeg/djpeg but are not part of the JPEG library
|
||||
proper. Those modules are not really intended to be used in other
|
||||
applications.
|
||||
99
codingrules
@@ -1,99 +0,0 @@
|
||||
|
||||
JPEG SYSTEM CODING RULES 27-SEP-91
|
||||
|
||||
Since numerous people will be contributing code and bug fixes, it's important
|
||||
to establish a common coding style. The goal of using similar coding styles
|
||||
is much more important than the details of just what that style is.
|
||||
|
||||
I suggest we follow the recommendations of "Recommended C Style and Coding
|
||||
Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and
|
||||
Brader). I have placed a copy of this document in the jpeg FTP archive (see
|
||||
jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).
|
||||
|
||||
Unless someone has a real strong objection, let's do block comments thusly:
|
||||
|
||||
/*
|
||||
* Block comments in this style.
|
||||
*/
|
||||
|
||||
and indent statements in K&R style, e.g.,
|
||||
|
||||
if (test) {
|
||||
then-part;
|
||||
} else {
|
||||
else-part;
|
||||
}
|
||||
|
||||
I suggest that multi-word names be written in the style multi_word_name
|
||||
rather than multiWordName, but I am open to argument on this.
|
||||
|
||||
|
||||
I would like to use function prototypes everywhere, and rely on automatic
|
||||
source code transformation to feed non-ANSI C compilers. The best tool
|
||||
I have so far found for this is 'ansi2knr.c', which is part of Ghostscript.
|
||||
ansi2knr is not very bright, so it imposes a format requirement on function
|
||||
declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions
|
||||
should be written in the following style:
|
||||
|
||||
static int *
|
||||
function_name (int a, char *b)
|
||||
{
|
||||
code...
|
||||
}
|
||||
|
||||
ansi2knr won't help with method declarations (function pointers in structs).
|
||||
I suggest we use a macro to declare method pointers, something like this:
|
||||
|
||||
#ifdef PROTO
|
||||
#define METHOD(type,methodname,arglist) type (*methodname) arglist
|
||||
#else
|
||||
#define METHOD(type,methodname,arglist) type (*methodname) ()
|
||||
#endif
|
||||
|
||||
which is used like this:
|
||||
|
||||
struct function_pointers {
|
||||
METHOD(void, init_entropy_encoder, (functptrs fptrs, jparms *jp));
|
||||
METHOD(void, term_entropy_encoder, (void));
|
||||
};
|
||||
|
||||
Note the set of parentheses surrounding the parameter list.
|
||||
|
||||
A similar solution is used for external function declarations (see the PP
|
||||
macro in jpegdata.h).
|
||||
|
||||
If the code is to work on non-ANSI compilers, you cannot rely on a prototype
|
||||
declaration to coerce actual parameters into the right types. Therefore, use
|
||||
explicit casts on actual parameters whenever the actual parameter type is not
|
||||
identical to the formal parameter. Beware of implicit conversions to "int".
|
||||
|
||||
It seems there are some non-ANSI compilers in which the sizeof() operator
|
||||
is defined to return int, while size_t is defined as long. Needless to say,
|
||||
this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(),
|
||||
so that the result is guaranteed to be of type size_t.
|
||||
|
||||
|
||||
We can expect that the JPEG compressor and decompressor will be incorporated
|
||||
into larger programs. Therefore, the following rules are important:
|
||||
|
||||
1. Avoid direct use of any file I/O, "malloc", error report printouts, etc;
|
||||
pass these through the common routines provided.
|
||||
|
||||
2. Assume that the JPEG code may be invoked more than once per program run;
|
||||
therefore, do not rely on static initialization of variables, and be careful
|
||||
to release all allocated storage at the end of processing.
|
||||
|
||||
3. Minimize global namespace pollution. Functions should be declared static
|
||||
wherever possible. (Note that our method-based calling conventions help this
|
||||
a lot: in many modules only the method-selector function will ever need to be
|
||||
called directly, so only that function need be externally visible.) All
|
||||
global function names should begin with "j", and should be unique in the first
|
||||
six characters for portability reasons.
|
||||
Don't use global variables at all; anything that must be used in another
|
||||
module should be put into parameters (there'll be some large structs passed
|
||||
around for this purpose).
|
||||
|
||||
4. Source file names should also begin with "j"; remember to keep them to
|
||||
eight characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers.
|
||||
Do not put code for both compression and decompression into the same source
|
||||
file.
|
||||
497
configure.ac
Normal file
@@ -0,0 +1,497 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.56])
|
||||
AC_INIT([libjpeg-turbo], [1.3.0])
|
||||
BUILD=`date +%Y%m%d`
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
||||
AC_PREFIX_DEFAULT(/opt/libjpeg-turbo)
|
||||
|
||||
# Always build with prototypes
|
||||
AC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes])
|
||||
|
||||
# Checks for programs.
|
||||
SAVED_CFLAGS=${CFLAGS}
|
||||
SAVED_CPPFLAGS=${CPPFLAGS}
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CC
|
||||
AM_PROG_AS
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_LN_S
|
||||
|
||||
# When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is
|
||||
# being created, and thus we install things into specific locations.
|
||||
|
||||
old_prefix=${prefix}
|
||||
if test "x$prefix" = "xNONE" -a "x$ac_default_prefix" != "x"; then
|
||||
prefix=$ac_default_prefix
|
||||
fi
|
||||
DATADIR=`eval echo ${datadir}`
|
||||
DATADIR=`eval echo $DATADIR`
|
||||
if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
|
||||
datadir='${prefix}'
|
||||
fi
|
||||
DATADIR=`eval echo ${datarootdir}`
|
||||
DATADIR=`eval echo $DATADIR`
|
||||
if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
|
||||
datarootdir='${prefix}'
|
||||
fi
|
||||
|
||||
old_exec_prefix=${exec_prefix}
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix=${prefix}
|
||||
fi
|
||||
|
||||
if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; then
|
||||
LIBDIR=`eval echo ${libdir}`
|
||||
LIBDIR=`eval echo $LIBDIR`
|
||||
if test "$LIBDIR" = "/opt/libjpeg-turbo/lib"; then
|
||||
case $host_os in
|
||||
darwin*)
|
||||
;;
|
||||
*)
|
||||
case "$host_cpu" in
|
||||
x86_64 | amd64)
|
||||
libdir='${exec_prefix}/lib64'
|
||||
;;
|
||||
i*86 | x86 | ia32)
|
||||
libdir='${exec_prefix}/lib32'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
exec_prefix=${old_exec_prefix}
|
||||
prefix=${old_prefix}
|
||||
|
||||
# Check whether compiler supports pointers to undefined structures
|
||||
AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
|
||||
AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], ,
|
||||
AC_MSG_RESULT(yes),
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
|
||||
[Compiler does not support pointers to undefined structures.])])
|
||||
|
||||
if test "x${GCC}" = "xyes"; then
|
||||
if test "x${SAVED_CFLAGS}" = "x"; then
|
||||
CFLAGS=-O3
|
||||
fi
|
||||
if test "x${SAVED_CPPFLAGS}" = "x"; then
|
||||
CPPFLAGS=-Wall
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
|
||||
if test "x${SUNCC}" = "xyes"; then
|
||||
if test "x${SAVED_CFLAGS}" = "x"; then
|
||||
CFLAGS=-xO5
|
||||
fi
|
||||
fi
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
|
||||
AC_CHECK_HEADER([sys/types.h],
|
||||
AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you have sys/types.h]))
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_CHAR_UNSIGNED
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_TYPES([unsigned char, unsigned short])
|
||||
|
||||
AC_MSG_CHECKING([if right shift is signed])
|
||||
AC_TRY_RUN(
|
||||
[#include <stdio.h>
|
||||
int is_shifting_signed (long arg) {
|
||||
long res = arg >> 4;
|
||||
|
||||
if (res == -0x7F7E80CL)
|
||||
return 1; /* right shift is signed */
|
||||
|
||||
/* see if unsigned-shift hack will fix it. */
|
||||
/* we can't just test exact value since it depends on width of long... */
|
||||
res |= (~0L) << (32-4);
|
||||
if (res == -0x7F7E80CL)
|
||||
return 0; /* right shift is unsigned */
|
||||
|
||||
printf("Right shift isn't acting as I expect it to.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n\n");
|
||||
return 0; /* try it with unsigned anyway */
|
||||
}
|
||||
int main (void) {
|
||||
exit(is_shifting_signed(-0x7F7E80B1L));
|
||||
}],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
|
||||
[AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
|
||||
|
||||
# test whether global names are unique to at least 15 chars
|
||||
AC_MSG_CHECKING([for short external names])
|
||||
AC_TRY_LINK(
|
||||
[int possibly_duplicate_function () { return 0; }
|
||||
int possibly_dupli_function () { return 1; }], [ ],
|
||||
[AC_MSG_RESULT(ok)],
|
||||
[AC_MSG_RESULT(short)
|
||||
AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1,
|
||||
[Define if you need short function names])])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([memset memcpy], [],
|
||||
[AC_DEFINE([NEED_BSD_STRINGS], 1,
|
||||
[Define if you have BSD-like bzero and bcopy])])
|
||||
|
||||
AC_MSG_CHECKING([libjpeg API version])
|
||||
AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
|
||||
if test "x$JPEG_LIB_VERSION" = "x"; then
|
||||
AC_ARG_WITH([jpeg7],
|
||||
AC_HELP_STRING([--with-jpeg7],
|
||||
[Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
|
||||
AC_ARG_WITH([jpeg8],
|
||||
AC_HELP_STRING([--with-jpeg8],
|
||||
[Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
|
||||
if test "x${with_jpeg8}" = "xyes"; then
|
||||
JPEG_LIB_VERSION=80
|
||||
else
|
||||
if test "x${with_jpeg7}" = "xyes"; then
|
||||
JPEG_LIB_VERSION=70
|
||||
else
|
||||
JPEG_LIB_VERSION=62
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
JPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`
|
||||
AC_SUBST(JPEG_LIB_VERSION_DECIMAL)
|
||||
AC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])
|
||||
AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],
|
||||
[libjpeg API version])
|
||||
|
||||
AC_ARG_VAR(SO_MAJOR_VERSION,
|
||||
[Major version of the libjpeg-turbo shared library (default is determined by the API version)])
|
||||
AC_ARG_VAR(SO_MINOR_VERSION,
|
||||
[Minor version of the libjpeg-turbo shared library (default is determined by the API version)])
|
||||
if test "x$SO_MAJOR_VERSION" = "x"; then
|
||||
case "$JPEG_LIB_VERSION" in
|
||||
62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
|
||||
*) SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;
|
||||
esac
|
||||
fi
|
||||
if test "x$SO_MINOR_VERSION" = "x"; then
|
||||
case "$JPEG_LIB_VERSION" in
|
||||
80) SO_MINOR_VERSION=2 ;;
|
||||
*) SO_MINOR_VERSION=0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
RPM_CONFIG_ARGS=
|
||||
|
||||
# Memory source/destination managers
|
||||
SO_AGE=0
|
||||
MEM_SRCDST_FUNCTIONS=
|
||||
if test "x${with_jpeg8}" != "xyes"; then
|
||||
AC_MSG_CHECKING([whether to include in-memory source/destination managers])
|
||||
AC_ARG_WITH([mem-srcdst],
|
||||
AC_HELP_STRING([--without-mem-srcdst],
|
||||
[Do not include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI]))
|
||||
if test "x$with_mem_srcdst" != "xno"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],
|
||||
[Support in-memory source/destination managers])
|
||||
SO_AGE=1
|
||||
MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;";
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-mem-srcdst"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([libjpeg shared library version])
|
||||
AC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])
|
||||
LIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`
|
||||
AC_SUBST(LIBTOOL_CURRENT)
|
||||
AC_SUBST(SO_MAJOR_VERSION)
|
||||
AC_SUBST(SO_MINOR_VERSION)
|
||||
AC_SUBST(SO_AGE)
|
||||
AC_SUBST(MEM_SRCDST_FUNCTIONS)
|
||||
|
||||
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
|
||||
|
||||
VERSION_SCRIPT=yes
|
||||
AC_ARG_ENABLE([ld-version-script],
|
||||
AS_HELP_STRING([--disable-ld-version-script],
|
||||
[Disable linker version script for libjpeg-turbo (default is to use linker version script if the linker supports it)]),
|
||||
[VERSION_SCRIPT=$enableval], [])
|
||||
|
||||
AC_MSG_CHECKING([whether the linker supports version scripts])
|
||||
SAVED_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -Wl,--version-script,conftest.map"
|
||||
cat > conftest.map <<EOF
|
||||
VERS_1 {
|
||||
global: *;
|
||||
};
|
||||
EOF
|
||||
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
|
||||
[VERSION_SCRIPT_FLAG=-Wl,--version-script,;
|
||||
AC_MSG_RESULT([yes (GNU style)])],
|
||||
[])
|
||||
if test "x$VERSION_SCRIPT_FLAG" = "x"; then
|
||||
LDFLAGS="$SAVED_LDFLAGS -Wl,-M,conftest.map"
|
||||
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
|
||||
[VERSION_SCRIPT_FLAG=-Wl,-M,;
|
||||
AC_MSG_RESULT([yes (Sun style)])],
|
||||
[])
|
||||
fi
|
||||
if test "x$VERSION_SCRIPT_FLAG" = "x"; then
|
||||
VERSION_SCRIPT=no
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
LDFLAGS="$SAVED_LDFLAGS"
|
||||
|
||||
AC_MSG_CHECKING([whether to use version script when building libjpeg-turbo])
|
||||
AC_MSG_RESULT($VERSION_SCRIPT)
|
||||
|
||||
AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
|
||||
AC_SUBST(VERSION_SCRIPT_FLAG)
|
||||
|
||||
# Check for non-broken inline under various spellings
|
||||
AC_MSG_CHECKING(for inline)
|
||||
ljt_cv_inline=""
|
||||
AC_TRY_COMPILE(, [} __attribute__((always_inline)) int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="__attribute__((always_inline))",
|
||||
AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="__inline__",
|
||||
AC_TRY_COMPILE(, [} __inline int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="__inline",
|
||||
AC_TRY_COMPILE(, [} inline int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="inline"))))
|
||||
AC_MSG_RESULT($ljt_cv_inline)
|
||||
AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
|
||||
|
||||
# Arithmetic coding support
|
||||
AC_MSG_CHECKING([whether to include arithmetic encoding support])
|
||||
AC_ARG_WITH([arith-enc],
|
||||
AC_HELP_STRING([--without-arith-enc],
|
||||
[Do not include arithmetic encoding support]))
|
||||
if test "x$with_arith_enc" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
|
||||
else
|
||||
AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
|
||||
|
||||
AC_MSG_CHECKING([whether to include arithmetic decoding support])
|
||||
AC_ARG_WITH([arith-dec],
|
||||
AC_HELP_STRING([--without-arith-dec],
|
||||
[Do not include arithmetic decoding support]))
|
||||
if test "x$with_arith_dec" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
|
||||
else
|
||||
AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
|
||||
|
||||
AM_CONDITIONAL([WITH_ARITH],
|
||||
[test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
|
||||
|
||||
# TurboJPEG support
|
||||
AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
|
||||
AC_ARG_WITH([turbojpeg],
|
||||
AC_HELP_STRING([--without-turbojpeg],
|
||||
[Do not include the TurboJPEG wrapper library and associated test programs]))
|
||||
if test "x$with_turbojpeg" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
|
||||
# Java support
|
||||
AC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])
|
||||
if test "x$JAVAC" = "x"; then
|
||||
JAVAC=javac
|
||||
fi
|
||||
AC_SUBST(JAVAC)
|
||||
AC_ARG_VAR(JAVACFLAGS, [Java compiler flags])
|
||||
AC_SUBST(JAVACFLAGS)
|
||||
AC_ARG_VAR(JAR, [Java archive command (default: jar)])
|
||||
if test "x$JAR" = "x"; then
|
||||
JAR=jar
|
||||
fi
|
||||
AC_SUBST(JAR)
|
||||
AC_ARG_VAR(JAVA, [Java runtime command (default: java)])
|
||||
if test "x$JAVA" = "x"; then
|
||||
JAVA=java
|
||||
fi
|
||||
AC_SUBST(JAVA)
|
||||
AC_ARG_VAR(JNI_CFLAGS,
|
||||
[C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])
|
||||
|
||||
AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
|
||||
AC_ARG_WITH([java],
|
||||
AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))
|
||||
if test "x$with_turbojpeg" = "xno"; then
|
||||
with_java=no
|
||||
fi
|
||||
|
||||
WITH_JAVA=0
|
||||
if test "x$with_java" = "xyes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
case $host_os in
|
||||
darwin*)
|
||||
DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
|
||||
;;
|
||||
solaris*)
|
||||
DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
|
||||
;;
|
||||
linux*)
|
||||
DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'
|
||||
;;
|
||||
esac
|
||||
if test "x$JNI_CFLAGS" = "x"; then
|
||||
JNI_CFLAGS=$DEFAULT_JNI_CFLAGS
|
||||
fi
|
||||
|
||||
SAVE_CPPFLAGS=${CPPFLAGS}
|
||||
CPPFLAGS="${CPPFLAGS} ${JNI_CFLAGS}"
|
||||
AC_CHECK_HEADERS([jni.h], [DUMMY=1],
|
||||
[AC_MSG_ERROR([Could not find JNI header file])])
|
||||
CPPFLAGS=${SAVE_CPPFLAGS}
|
||||
AC_SUBST(JNI_CFLAGS)
|
||||
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --with-java"
|
||||
JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'
|
||||
JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar
|
||||
WITH_JAVA=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_JAVA], [test "x$with_java" = "xyes"])
|
||||
AC_SUBST(WITH_JAVA)
|
||||
AC_SUBST(JAVA_RPM_CONTENTS_1)
|
||||
AC_SUBST(JAVA_RPM_CONTENTS_2)
|
||||
|
||||
# optionally force using gas-preprocessor.pl for compatibility testing
|
||||
AC_ARG_WITH([gas-preprocessor],
|
||||
AC_HELP_STRING([--with-gas-preprocessor],
|
||||
[Force using gas-preprocessor.pl on ARM.]))
|
||||
if test "x${with_gas_preprocessor}" = "xyes"; then
|
||||
case $host_os in
|
||||
darwin*)
|
||||
CCAS="gas-preprocessor.pl -fix-unreq $CC"
|
||||
;;
|
||||
*)
|
||||
CCAS="gas-preprocessor.pl -no-fix-unreq $CC"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([CCAS])
|
||||
fi
|
||||
|
||||
# SIMD is optional
|
||||
AC_ARG_WITH([simd],
|
||||
AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))
|
||||
if test "x${with_simd}" != "xno"; then
|
||||
# Check if we're on a supported CPU
|
||||
AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])
|
||||
case "$host_cpu" in
|
||||
x86_64 | amd64)
|
||||
AC_MSG_RESULT([yes (x86_64)])
|
||||
AC_PROG_NASM
|
||||
simd_arch=x86_64
|
||||
;;
|
||||
i*86 | x86 | ia32)
|
||||
AC_MSG_RESULT([yes (i386)])
|
||||
AC_PROG_NASM
|
||||
simd_arch=i386
|
||||
;;
|
||||
arm*)
|
||||
AC_MSG_RESULT([yes (arm)])
|
||||
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
|
||||
AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(
|
||||
[AC_MSG_RESULT([yes])
|
||||
simd_arch=arm],
|
||||
[AC_MSG_RESULT([no])
|
||||
with_simd=no
|
||||
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no ("$host_cpu")])
|
||||
AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.])
|
||||
with_simd=no;
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x${with_simd}" != "xno"; then
|
||||
AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])
|
||||
fi
|
||||
else
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-simd"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([WITH_SIMD], [test "x$with_simd" != "xno"])
|
||||
AM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test "x$simd_arch" = "xx86_64" -o "x$simd_arch" = "xi386"])
|
||||
AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
|
||||
AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
|
||||
AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
|
||||
AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"])
|
||||
AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"])
|
||||
|
||||
AC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)])
|
||||
if test "x$PKGNAME" = "x"; then
|
||||
PKGNAME=$PACKAGE_NAME
|
||||
fi
|
||||
AC_SUBST(PKGNAME)
|
||||
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
RPMARCH=x86_64
|
||||
DEBARCH=amd64
|
||||
;;
|
||||
i*86 | x86 | ia32)
|
||||
RPMARCH=i386
|
||||
DEBARCH=i386
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(RPMARCH)
|
||||
AC_SUBST(RPM_CONFIG_ARGS)
|
||||
AC_SUBST(DEBARCH)
|
||||
AC_SUBST(BUILD)
|
||||
AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [Build number])
|
||||
|
||||
# jconfig.h is the file we use, but we have another before that to
|
||||
# fool autoheader. the reason is that we include this header in our
|
||||
# API headers, which can screw things up for users of the lib.
|
||||
# jconfig.h is a minimal version that allows this package to be built
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_HEADERS([jconfig.h])
|
||||
AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in])
|
||||
AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
|
||||
AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
|
||||
AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
|
||||
AC_CONFIG_FILES([pkgscripts/Description.plist:release/Description.plist.in])
|
||||
AC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])
|
||||
AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
|
||||
if test "x$with_turbojpeg" != "xno"; then
|
||||
AC_CONFIG_FILES([tjbenchtest])
|
||||
fi
|
||||
if test "x$with_java" = "xyes"; then
|
||||
AC_CONFIG_FILES([tjbenchtest.java])
|
||||
AC_CONFIG_FILES([tjexampletest])
|
||||
fi
|
||||
AC_CONFIG_FILES([libjpeg.map])
|
||||
AC_CONFIG_FILES([Makefile simd/Makefile])
|
||||
AC_CONFIG_FILES([java/Makefile])
|
||||
AC_CONFIG_FILES([md5/Makefile])
|
||||
AC_OUTPUT
|
||||
211
djpeg.1
@@ -1,43 +1,10 @@
|
||||
.TH DJPEG 1 "17 February 1993"
|
||||
.TH DJPEG 1 "18 January 2013"
|
||||
.SH NAME
|
||||
djpeg \- decompress a JPEG file to an image file
|
||||
.SH SYNOPSIS
|
||||
.B djpeg
|
||||
[
|
||||
.BI \-colors " N"
|
||||
]
|
||||
[
|
||||
.B \-gif
|
||||
]
|
||||
[
|
||||
.B \-pnm
|
||||
]
|
||||
[
|
||||
.B \-rle
|
||||
]
|
||||
[
|
||||
.B \-targa
|
||||
]
|
||||
[
|
||||
.B \-blocksmooth
|
||||
]
|
||||
[
|
||||
.B \-grayscale
|
||||
]
|
||||
[
|
||||
.BI \-maxmemory " N"
|
||||
]
|
||||
[
|
||||
.B \-nodither
|
||||
]
|
||||
[
|
||||
.B \-onepass
|
||||
]
|
||||
[
|
||||
.B \-verbose
|
||||
]
|
||||
[
|
||||
.B \-debug
|
||||
.I options
|
||||
]
|
||||
[
|
||||
.I filename
|
||||
@@ -47,9 +14,9 @@ djpeg \- decompress a JPEG file to an image file
|
||||
.LP
|
||||
.B djpeg
|
||||
decompresses the named JPEG file, or the standard input if no file is named,
|
||||
and produces an image file on the standard output. PBMPLUS (PPM/PGM), GIF,
|
||||
Targa, or RLE (Utah Raster Toolkit) output format can be selected. (RLE is
|
||||
supported only if the URT library is available.)
|
||||
and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
|
||||
GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
|
||||
(RLE is supported only if the URT library is available.)
|
||||
.SH OPTIONS
|
||||
All switch names may be abbreviated; for example,
|
||||
.B \-grayscale
|
||||
@@ -59,9 +26,9 @@ or
|
||||
.BR \-gr .
|
||||
Most of the "basic" switches can be abbreviated to as little as one letter.
|
||||
Upper and lower case are equivalent (thus
|
||||
.B \-GIF
|
||||
.B \-BMP
|
||||
is the same as
|
||||
.BR \-gif ).
|
||||
.BR \-bmp ).
|
||||
British spellings are also accepted (e.g.,
|
||||
.BR \-greyscale ),
|
||||
though for brevity these are not mentioned below.
|
||||
@@ -82,11 +49,48 @@ is the recommended name,
|
||||
.B \-quantize
|
||||
is provided only for backwards compatibility.
|
||||
.TP
|
||||
.B \-fast
|
||||
Select recommended processing options for fast, low quality output. (The
|
||||
default options are chosen for highest quality output.) Currently, this is
|
||||
equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
|
||||
.TP
|
||||
.B \-grayscale
|
||||
Force gray-scale output even if JPEG file is color. Useful for viewing on
|
||||
monochrome displays; also,
|
||||
.B djpeg
|
||||
runs noticeably faster in this mode.
|
||||
.TP
|
||||
.BI \-scale " M/N"
|
||||
Scale the output image by a factor M/N. Currently the scale factor must be
|
||||
M/8, where M is an integer between 1 and 16 inclusive, or any reduced fraction
|
||||
thereof (such as 1/2, 3/4, etc.) Scaling is handy if the image is larger than
|
||||
your screen; also,
|
||||
.B djpeg
|
||||
runs much faster when scaling down the output.
|
||||
.TP
|
||||
.B \-bmp
|
||||
Select BMP output format (Windows flavor). 8-bit colormapped format is
|
||||
emitted if
|
||||
.B \-colors
|
||||
or
|
||||
.B \-grayscale
|
||||
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
|
||||
format is emitted.
|
||||
.TP
|
||||
.B \-gif
|
||||
Select GIF output format. Since GIF does not support more than 256 colors,
|
||||
.B \-colors 256
|
||||
is assumed (unless you specify a smaller number of colors).
|
||||
.TP
|
||||
.B \-os2
|
||||
Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is
|
||||
emitted if
|
||||
.B \-colors
|
||||
or
|
||||
.B \-grayscale
|
||||
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
|
||||
format is emitted.
|
||||
.TP
|
||||
.B \-pnm
|
||||
Select PBMPLUS (PPM/PGM) output format (this is the default format).
|
||||
PGM is emitted if the JPEG file is gray-scale or if
|
||||
@@ -106,32 +110,48 @@ is specified; otherwise, 24-bit full-color format is emitted.
|
||||
.PP
|
||||
Switches for advanced users:
|
||||
.TP
|
||||
.B \-blocksmooth
|
||||
Perform cross-block smoothing. This is slow, quite memory-intensive, and only
|
||||
seems to improve the image at very low quality settings (\fB\-quality\fR 10 to
|
||||
20 or so). At normal quality settings it may make the image worse.
|
||||
.B \-dct int
|
||||
Use integer DCT method (default).
|
||||
.TP
|
||||
.B \-grayscale
|
||||
Force gray-scale output even if JPEG file is color.
|
||||
Useful for viewing on monochrome displays.
|
||||
.B \-dct fast
|
||||
Use fast integer DCT (less accurate).
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
.B \-dct float
|
||||
Use floating-point DCT method.
|
||||
The float method is very slightly more accurate than the int method, but is
|
||||
much slower unless your machine has very fast floating-point hardware. Also
|
||||
note that results of the floating-point method may vary slightly across
|
||||
machines, while the integer methods should give the same results everywhere.
|
||||
The fast integer method is much less accurate than the other two.
|
||||
.TP
|
||||
.B \-nodither
|
||||
Do not use dithering in color quantization. By default, Floyd-Steinberg
|
||||
dithering is applied when quantizing colors, but on some images dithering may
|
||||
result in objectionable "graininess". If that happens, you can turn off
|
||||
dithering with
|
||||
.BR \-nodither .
|
||||
.B \-nodither
|
||||
is ignored unless you also say
|
||||
.B \-dither fs
|
||||
Use Floyd-Steinberg dithering in color quantization.
|
||||
.TP
|
||||
.B \-dither ordered
|
||||
Use ordered dithering in color quantization.
|
||||
.TP
|
||||
.B \-dither none
|
||||
Do not use dithering in color quantization.
|
||||
By default, Floyd-Steinberg dithering is applied when quantizing colors; this
|
||||
is slow but usually produces the best results. Ordered dither is a compromise
|
||||
between speed and quality; no dithering is fast but usually looks awful. Note
|
||||
that these switches have no effect unless color quantization is being done.
|
||||
Ordered dither is only available in
|
||||
.B \-onepass
|
||||
mode.
|
||||
.TP
|
||||
.BI \-map " file"
|
||||
Quantize to the colors used in the specified image file. This is useful for
|
||||
producing multiple files with identical color maps, or for forcing a
|
||||
predefined set of colors to be used. The
|
||||
.I file
|
||||
must be a GIF or PPM file. This option overrides
|
||||
.B \-colors
|
||||
.IR N .
|
||||
and
|
||||
.BR \-onepass .
|
||||
.TP
|
||||
.B \-nosmooth
|
||||
Use a faster, lower-quality upsampling routine.
|
||||
.TP
|
||||
.B \-onepass
|
||||
Use one-pass instead of two-pass color quantization. The one-pass method is
|
||||
@@ -143,6 +163,20 @@ is ignored unless you also say
|
||||
Also, the one-pass method is always used for gray-scale output (the two-pass
|
||||
method is no improvement then).
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
.TP
|
||||
.BI \-outfile " name"
|
||||
Send output image to the named file, not to standard output.
|
||||
.TP
|
||||
.BI \-memsrc
|
||||
Load input file into memory before decompressing. This feature was implemented
|
||||
mainly as a way of testing the in-memory source manager (jpeg_mem_src().)
|
||||
.TP
|
||||
.B \-verbose
|
||||
Enable debug printout. More
|
||||
.BR \-v 's
|
||||
@@ -153,13 +187,42 @@ Same as
|
||||
.BR \-verbose .
|
||||
.SH EXAMPLES
|
||||
.LP
|
||||
This example decompresses the JPEG file foo.jpg, automatically quantizes to
|
||||
256 colors, and saves the output in GIF format in foo.gif:
|
||||
This example decompresses the JPEG file foo.jpg, quantizes it to
|
||||
256 colors, and saves the output in 8-bit BMP format in foo.bmp:
|
||||
.IP
|
||||
.B djpeg \-gif
|
||||
.B djpeg \-colors 256 \-bmp
|
||||
.I foo.jpg
|
||||
.B >
|
||||
.I foo.gif
|
||||
.I foo.bmp
|
||||
.SH HINTS
|
||||
To get a quick preview of an image, use the
|
||||
.B \-grayscale
|
||||
and/or
|
||||
.B \-scale
|
||||
switches.
|
||||
.B \-grayscale \-scale 1/8
|
||||
is the fastest case.
|
||||
.PP
|
||||
Several options are available that trade off image quality to gain speed.
|
||||
.B \-fast
|
||||
turns on the recommended settings.
|
||||
.PP
|
||||
.B \-dct fast
|
||||
and/or
|
||||
.B \-nosmooth
|
||||
gain speed at a small sacrifice in quality.
|
||||
When producing a color-quantized image,
|
||||
.B \-onepass \-dither ordered
|
||||
is fast but much lower quality than the default behavior.
|
||||
.B \-dither none
|
||||
may give acceptable results in two-pass mode, but is seldom tolerable in
|
||||
one-pass mode.
|
||||
.PP
|
||||
If you are fortunate enough to have very fast floating point hardware,
|
||||
\fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most
|
||||
machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
|
||||
not worth using, because its theoretical accuracy advantage is too small to be
|
||||
significant in practice.
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B JPEGMEM
|
||||
@@ -172,7 +235,10 @@ overrides the default value specified when the program was compiled, and
|
||||
itself is overridden by an explicit
|
||||
.BR \-maxmemory .
|
||||
.SH SEE ALSO
|
||||
.BR cjpeg (1)
|
||||
.BR cjpeg (1),
|
||||
.BR jpegtran (1),
|
||||
.BR rdjpgcom (1),
|
||||
.BR wrjpgcom (1)
|
||||
.br
|
||||
.BR ppm (5),
|
||||
.BR pgm (5)
|
||||
@@ -181,7 +247,12 @@ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
|
||||
.SH AUTHOR
|
||||
Independent JPEG Group
|
||||
.SH BUGS
|
||||
Arithmetic coding is not supported for legal reasons.
|
||||
.PP
|
||||
Still not as fast as we'd like.
|
||||
This file was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
|
||||
features not present in libjpeg.
|
||||
.SH BUGS
|
||||
To avoid the Unisys LZW patent,
|
||||
.B djpeg
|
||||
produces uncompressed GIF files. These are larger than they should be, but
|
||||
are readable by standard GIF decoders.
|
||||
|
||||
672
djpeg.c
Normal file
@@ -0,0 +1,672 @@
|
||||
/*
|
||||
* djpeg.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modifications:
|
||||
* Copyright (C) 2010-2011, 2013, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains a command-line user interface for the JPEG decompressor.
|
||||
* It should work on any system with Unix- or MS-DOS-style command lines.
|
||||
*
|
||||
* Two different command line styles are permitted, depending on the
|
||||
* compile-time switch TWO_FILE_COMMANDLINE:
|
||||
* djpeg [options] inputfile outputfile
|
||||
* djpeg [options] [inputfile]
|
||||
* In the second style, output is always to standard output, which you'd
|
||||
* normally redirect to a file or pipe to some other program. Input is
|
||||
* either from a named file or from standard input (typically redirected).
|
||||
* The second style is convenient on Unix but is unhelpful on systems that
|
||||
* don't support pipes. Also, you MUST use the first style if your system
|
||||
* doesn't do binary I/O to stdin/stdout.
|
||||
* To simplify script writing, the "-outfile" switch is provided. The syntax
|
||||
* djpeg [options] -outfile outputfile inputfile
|
||||
* works regardless of which command line style is used.
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "config.h"
|
||||
|
||||
#include <ctype.h> /* to declare isprint() */
|
||||
|
||||
#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
|
||||
#ifdef __MWERKS__
|
||||
#include <SIOUX.h> /* Metrowerks needs this */
|
||||
#include <console.h> /* ... and this */
|
||||
#endif
|
||||
#ifdef THINK_C
|
||||
#include <console.h> /* Think declares it here */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Create the add-on message string table. */
|
||||
|
||||
#define JMESSAGE(code,string) string ,
|
||||
|
||||
static const char * const cdjpeg_message_table[] = {
|
||||
#include "cderror.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This list defines the known output image formats
|
||||
* (not all of which need be supported by a given version).
|
||||
* You can change the default output format by defining DEFAULT_FMT;
|
||||
* indeed, you had better do so if you undefine PPM_SUPPORTED.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
FMT_BMP, /* BMP format (Windows flavor) */
|
||||
FMT_GIF, /* GIF format */
|
||||
FMT_OS2, /* BMP format (OS/2 flavor) */
|
||||
FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
|
||||
FMT_RLE, /* RLE format */
|
||||
FMT_TARGA, /* Targa format */
|
||||
FMT_TIFF /* TIFF format */
|
||||
} IMAGE_FORMATS;
|
||||
|
||||
#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
|
||||
#define DEFAULT_FMT FMT_PPM
|
||||
#endif
|
||||
|
||||
static IMAGE_FORMATS requested_fmt;
|
||||
|
||||
|
||||
/*
|
||||
* Argument-parsing code.
|
||||
* The switch parser is designed to be useful with DOS-style command line
|
||||
* syntax, ie, intermixed switches and file names, where only the switches
|
||||
* to the left of a given file name affect processing of that file.
|
||||
* The main program in this file doesn't actually use this capability...
|
||||
*/
|
||||
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
boolean memsrc; /* for -memsrc switch */
|
||||
#define INPUT_BUF_SIZE 4096
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
usage (void)
|
||||
/* complain about bad command line */
|
||||
{
|
||||
fprintf(stderr, "usage: %s [switches] ", progname);
|
||||
#ifdef TWO_FILE_COMMANDLINE
|
||||
fprintf(stderr, "inputfile outputfile\n");
|
||||
#else
|
||||
fprintf(stderr, "[inputfile]\n");
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "Switches (names may be abbreviated):\n");
|
||||
fprintf(stderr, " -colors N Reduce image to no more than N colors\n");
|
||||
fprintf(stderr, " -fast Fast, low-quality processing\n");
|
||||
fprintf(stderr, " -grayscale Force grayscale output\n");
|
||||
fprintf(stderr, " -rgb Force RGB output\n");
|
||||
#ifdef IDCT_SCALING_SUPPORTED
|
||||
fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
|
||||
#endif
|
||||
#ifdef BMP_SUPPORTED
|
||||
fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n",
|
||||
(DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef GIF_SUPPORTED
|
||||
fprintf(stderr, " -gif Select GIF output format%s\n",
|
||||
(DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef BMP_SUPPORTED
|
||||
fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n",
|
||||
(DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef PPM_SUPPORTED
|
||||
fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n",
|
||||
(DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef RLE_SUPPORTED
|
||||
fprintf(stderr, " -rle Select Utah RLE output format%s\n",
|
||||
(DEFAULT_FMT == FMT_RLE ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
fprintf(stderr, " -targa Select Targa output format%s\n",
|
||||
(DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
fprintf(stderr, " -dct int Use integer DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, " -dither fs Use F-S dithering (default)\n");
|
||||
fprintf(stderr, " -dither none Don't use dithering in quantization\n");
|
||||
fprintf(stderr, " -dither ordered Use ordered dither (medium speed, quality)\n");
|
||||
#ifdef QUANT_2PASS_SUPPORTED
|
||||
fprintf(stderr, " -map FILE Map to colors used in named image file\n");
|
||||
#endif
|
||||
fprintf(stderr, " -nosmooth Don't use high-quality upsampling\n");
|
||||
#ifdef QUANT_1PASS_SUPPORTED
|
||||
fprintf(stderr, " -onepass Use 1-pass quantization (fast, low quality)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
|
||||
fprintf(stderr, " -outfile name Specify name for output file\n");
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
fprintf(stderr, " -memsrc Load input file into memory before decompressing\n");
|
||||
#endif
|
||||
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(int)
|
||||
parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
/* Parse optional switches.
|
||||
* Returns argv[] index of first file-name argument (== argc if none).
|
||||
* Any file names with indexes <= last_file_arg_seen are ignored;
|
||||
* they have presumably been processed in a previous iteration.
|
||||
* (Pass 0 for last_file_arg_seen on the first or only iteration.)
|
||||
* for_real is FALSE on the first (dummy) pass; we may skip any expensive
|
||||
* processing.
|
||||
*/
|
||||
{
|
||||
int argn;
|
||||
char * arg;
|
||||
|
||||
/* Set up default JPEG parameters. */
|
||||
requested_fmt = DEFAULT_FMT; /* set default output file format */
|
||||
outfilename = NULL;
|
||||
memsrc = FALSE;
|
||||
cinfo->err->trace_level = 0;
|
||||
|
||||
/* Scan command line options, adjust parameters */
|
||||
|
||||
for (argn = 1; argn < argc; argn++) {
|
||||
arg = argv[argn];
|
||||
if (*arg != '-') {
|
||||
/* Not a switch, must be a file name argument */
|
||||
if (argn <= last_file_arg_seen) {
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
}
|
||||
break; /* else done parsing switches */
|
||||
}
|
||||
arg++; /* advance past switch marker character */
|
||||
|
||||
if (keymatch(arg, "bmp", 1)) {
|
||||
/* BMP output format. */
|
||||
requested_fmt = FMT_BMP;
|
||||
|
||||
} else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
|
||||
keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
|
||||
/* Do color quantization. */
|
||||
int val;
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d", &val) != 1)
|
||||
usage();
|
||||
cinfo->desired_number_of_colors = val;
|
||||
cinfo->quantize_colors = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "dct", 2)) {
|
||||
/* Select IDCT algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "int", 1)) {
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
} else if (keymatch(argv[argn], "fast", 2)) {
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
} else if (keymatch(argv[argn], "float", 2)) {
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
} else
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "dither", 2)) {
|
||||
/* Select dithering algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "fs", 2)) {
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
} else if (keymatch(argv[argn], "none", 2)) {
|
||||
cinfo->dither_mode = JDITHER_NONE;
|
||||
} else if (keymatch(argv[argn], "ordered", 2)) {
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
} else
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
|
||||
/* Enable debug printouts. */
|
||||
/* On first -d, print version identification */
|
||||
static boolean printed_version = FALSE;
|
||||
|
||||
if (! printed_version) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
}
|
||||
cinfo->err->trace_level++;
|
||||
|
||||
} else if (keymatch(arg, "fast", 1)) {
|
||||
/* Select recommended processing options for quick-and-dirty output. */
|
||||
cinfo->two_pass_quantize = FALSE;
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
if (! cinfo->quantize_colors) /* don't override an earlier -colors */
|
||||
cinfo->desired_number_of_colors = 216;
|
||||
cinfo->dct_method = JDCT_FASTEST;
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "gif", 1)) {
|
||||
/* GIF output format. */
|
||||
requested_fmt = FMT_GIF;
|
||||
|
||||
} else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
|
||||
/* Force monochrome output. */
|
||||
cinfo->out_color_space = JCS_GRAYSCALE;
|
||||
|
||||
} else if (keymatch(arg, "rgb", 2)) {
|
||||
/* Force RGB output. */
|
||||
cinfo->out_color_space = JCS_RGB;
|
||||
|
||||
} else if (keymatch(arg, "map", 3)) {
|
||||
/* Quantize to a color map taken from an input file. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (for_real) { /* too expensive to do twice! */
|
||||
#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
|
||||
FILE * mapfile;
|
||||
|
||||
if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
read_color_map(cinfo, mapfile);
|
||||
fclose(mapfile);
|
||||
cinfo->quantize_colors = TRUE;
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
}
|
||||
|
||||
} else if (keymatch(arg, "maxmemory", 3)) {
|
||||
/* Maximum memory in Kb (or Mb with 'm'). */
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
if (ch == 'm' || ch == 'M')
|
||||
lval *= 1000L;
|
||||
cinfo->mem->max_memory_to_use = lval * 1000L;
|
||||
|
||||
} else if (keymatch(arg, "nosmooth", 3)) {
|
||||
/* Suppress fancy upsampling */
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "onepass", 3)) {
|
||||
/* Use fast one-pass quantization. */
|
||||
cinfo->two_pass_quantize = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "os2", 3)) {
|
||||
/* BMP output format (OS/2 flavor). */
|
||||
requested_fmt = FMT_OS2;
|
||||
|
||||
} else if (keymatch(arg, "outfile", 4)) {
|
||||
/* Set output file name. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
|
||||
} else if (keymatch(arg, "memsrc", 2)) {
|
||||
/* Use in-memory source manager */
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
memsrc = TRUE;
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, in-memory source manager was not compiled in\n",
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "pnm", 1) || keymatch(arg, "ppm", 1)) {
|
||||
/* PPM/PGM output format. */
|
||||
requested_fmt = FMT_PPM;
|
||||
|
||||
} else if (keymatch(arg, "rle", 1)) {
|
||||
/* RLE output format. */
|
||||
requested_fmt = FMT_RLE;
|
||||
|
||||
} else if (keymatch(arg, "scale", 1)) {
|
||||
/* Scale the output image by a fraction M/N. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d/%d",
|
||||
&cinfo->scale_num, &cinfo->scale_denom) != 2)
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Targa output format. */
|
||||
requested_fmt = FMT_TARGA;
|
||||
|
||||
} else {
|
||||
usage(); /* bogus switch */
|
||||
}
|
||||
}
|
||||
|
||||
return argn; /* return index of next arg (file name) */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Marker processor for COM and interesting APPn markers.
|
||||
* This replaces the library's built-in processor, which just skips the marker.
|
||||
* We want to print out the marker as text, to the extent possible.
|
||||
* Note this code relies on a non-suspending data source.
|
||||
*/
|
||||
|
||||
LOCAL(unsigned int)
|
||||
jpeg_getc (j_decompress_ptr cinfo)
|
||||
/* Read next byte */
|
||||
{
|
||||
struct jpeg_source_mgr * datasrc = cinfo->src;
|
||||
|
||||
if (datasrc->bytes_in_buffer == 0) {
|
||||
if (! (*datasrc->fill_input_buffer) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
datasrc->bytes_in_buffer--;
|
||||
return GETJOCTET(*datasrc->next_input_byte++);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(boolean)
|
||||
print_text_marker (j_decompress_ptr cinfo)
|
||||
{
|
||||
boolean traceit = (cinfo->err->trace_level >= 1);
|
||||
INT32 length;
|
||||
unsigned int ch;
|
||||
unsigned int lastch = 0;
|
||||
|
||||
length = jpeg_getc(cinfo) << 8;
|
||||
length += jpeg_getc(cinfo);
|
||||
length -= 2; /* discount the length word itself */
|
||||
|
||||
if (traceit) {
|
||||
if (cinfo->unread_marker == JPEG_COM)
|
||||
fprintf(stderr, "Comment, length %ld:\n", (long) length);
|
||||
else /* assume it is an APPn otherwise */
|
||||
fprintf(stderr, "APP%d, length %ld:\n",
|
||||
cinfo->unread_marker - JPEG_APP0, (long) length);
|
||||
}
|
||||
|
||||
while (--length >= 0) {
|
||||
ch = jpeg_getc(cinfo);
|
||||
if (traceit) {
|
||||
/* Emit the character in a readable form.
|
||||
* Nonprintables are converted to \nnn form,
|
||||
* while \ is converted to \\.
|
||||
* Newlines in CR, CR/LF, or LF form will be printed as one newline.
|
||||
*/
|
||||
if (ch == '\r') {
|
||||
fprintf(stderr, "\n");
|
||||
} else if (ch == '\n') {
|
||||
if (lastch != '\r')
|
||||
fprintf(stderr, "\n");
|
||||
} else if (ch == '\\') {
|
||||
fprintf(stderr, "\\\\");
|
||||
} else if (isprint(ch)) {
|
||||
putc(ch, stderr);
|
||||
} else {
|
||||
fprintf(stderr, "\\%03o", ch);
|
||||
}
|
||||
lastch = ch;
|
||||
}
|
||||
}
|
||||
|
||||
if (traceit)
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The main program.
|
||||
*/
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
struct jpeg_error_mgr jerr;
|
||||
#ifdef PROGRESS_REPORT
|
||||
struct cdjpeg_progress_mgr progress;
|
||||
#endif
|
||||
int file_index;
|
||||
djpeg_dest_ptr dest_mgr = NULL;
|
||||
FILE * input_file;
|
||||
FILE * output_file;
|
||||
unsigned char *inbuffer = NULL;
|
||||
unsigned long insize = 0;
|
||||
JDIMENSION num_scanlines;
|
||||
|
||||
/* On Mac, fetch a command line. */
|
||||
#ifdef USE_CCOMMAND
|
||||
argc = ccommand(&argv);
|
||||
#endif
|
||||
|
||||
progname = argv[0];
|
||||
if (progname == NULL || progname[0] == 0)
|
||||
progname = "djpeg"; /* in case C library doesn't provide it */
|
||||
|
||||
/* Initialize the JPEG decompression object with default error handling. */
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
jpeg_create_decompress(&cinfo);
|
||||
/* Add some application-specific error messages (from cderror.h) */
|
||||
jerr.addon_message_table = cdjpeg_message_table;
|
||||
jerr.first_addon_message = JMSG_FIRSTADDONCODE;
|
||||
jerr.last_addon_message = JMSG_LASTADDONCODE;
|
||||
|
||||
/* Insert custom marker processor for COM and APP12.
|
||||
* APP12 is used by some digital camera makers for textual info,
|
||||
* so we provide the ability to display it as text.
|
||||
* If you like, additional APPn marker types can be selected for display,
|
||||
* but don't try to override APP0 or APP14 this way (see libjpeg.txt).
|
||||
*/
|
||||
jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
|
||||
jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
|
||||
|
||||
/* Now safe to enable signal catcher. */
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
enable_signal_catcher((j_common_ptr) &cinfo);
|
||||
#endif
|
||||
|
||||
/* Scan command line to find file names. */
|
||||
/* It is convenient to use just one switch-parsing routine, but the switch
|
||||
* values read here are ignored; we will rescan the switches after opening
|
||||
* the input file.
|
||||
* (Exception: tracing level set here controls verbosity for COM markers
|
||||
* found during jpeg_read_header...)
|
||||
*/
|
||||
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);
|
||||
|
||||
#ifdef TWO_FILE_COMMANDLINE
|
||||
/* Must have either -outfile switch or explicit output file name */
|
||||
if (outfilename == NULL) {
|
||||
if (file_index != argc-2) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
outfilename = argv[file_index+1];
|
||||
} else {
|
||||
if (file_index != argc-1) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Unix style: expect zero or one file name */
|
||||
if (file_index < argc-1) {
|
||||
fprintf(stderr, "%s: only one input file\n", progname);
|
||||
usage();
|
||||
}
|
||||
#endif /* TWO_FILE_COMMANDLINE */
|
||||
|
||||
/* Open the input file. */
|
||||
if (file_index < argc) {
|
||||
if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
/* default input file is stdin */
|
||||
input_file = read_stdin();
|
||||
}
|
||||
|
||||
/* Open the output file. */
|
||||
if (outfilename != NULL) {
|
||||
if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
/* default output file is stdout */
|
||||
output_file = write_stdout();
|
||||
}
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
start_progress_monitor((j_common_ptr) &cinfo, &progress);
|
||||
#endif
|
||||
|
||||
/* Specify data source for decompression */
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
if (memsrc) {
|
||||
size_t nbytes;
|
||||
do {
|
||||
inbuffer = (unsigned char *)realloc(inbuffer, insize + INPUT_BUF_SIZE);
|
||||
if (inbuffer == NULL) {
|
||||
fprintf(stderr, "%s: memory allocation failure\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
nbytes = JFREAD(input_file, &inbuffer[insize], INPUT_BUF_SIZE);
|
||||
if (nbytes < 0) {
|
||||
if (file_index < argc)
|
||||
fprintf(stderr, "%s: can't read from %s\n", progname,
|
||||
argv[file_index]);
|
||||
else
|
||||
fprintf(stderr, "%s: can't read from stdin\n", progname);
|
||||
}
|
||||
insize += (unsigned long)nbytes;
|
||||
} while (nbytes == INPUT_BUF_SIZE);
|
||||
fprintf(stderr, "Compressed size: %lu bytes\n", insize);
|
||||
jpeg_mem_src(&cinfo, inbuffer, insize);
|
||||
} else
|
||||
#endif
|
||||
jpeg_stdio_src(&cinfo, input_file);
|
||||
|
||||
/* Read file header, set default decompression parameters */
|
||||
(void) jpeg_read_header(&cinfo, TRUE);
|
||||
|
||||
/* Adjust default decompression parameters by re-parsing the options */
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
|
||||
|
||||
/* Initialize the output module now to let it override any crucial
|
||||
* option settings (for instance, GIF wants to force color quantization).
|
||||
*/
|
||||
switch (requested_fmt) {
|
||||
#ifdef BMP_SUPPORTED
|
||||
case FMT_BMP:
|
||||
dest_mgr = jinit_write_bmp(&cinfo, FALSE);
|
||||
break;
|
||||
case FMT_OS2:
|
||||
dest_mgr = jinit_write_bmp(&cinfo, TRUE);
|
||||
break;
|
||||
#endif
|
||||
#ifdef GIF_SUPPORTED
|
||||
case FMT_GIF:
|
||||
dest_mgr = jinit_write_gif(&cinfo);
|
||||
break;
|
||||
#endif
|
||||
#ifdef PPM_SUPPORTED
|
||||
case FMT_PPM:
|
||||
dest_mgr = jinit_write_ppm(&cinfo);
|
||||
break;
|
||||
#endif
|
||||
#ifdef RLE_SUPPORTED
|
||||
case FMT_RLE:
|
||||
dest_mgr = jinit_write_rle(&cinfo);
|
||||
break;
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
case FMT_TARGA:
|
||||
dest_mgr = jinit_write_targa(&cinfo);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
|
||||
break;
|
||||
}
|
||||
dest_mgr->output_file = output_file;
|
||||
|
||||
/* Start decompressor */
|
||||
(void) jpeg_start_decompress(&cinfo);
|
||||
|
||||
/* Write output file header */
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
/* Hack: count final pass as done in case finish_output does an extra pass.
|
||||
* The library won't have updated completed_passes.
|
||||
*/
|
||||
progress.pub.completed_passes = progress.pub.total_passes;
|
||||
#endif
|
||||
|
||||
/* Finish decompression and release memory.
|
||||
* I must do it in this order because output module has allocated memory
|
||||
* of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.
|
||||
*/
|
||||
(*dest_mgr->finish_output) (&cinfo, dest_mgr);
|
||||
(void) jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
|
||||
/* Close files, if we opened them */
|
||||
if (input_file != stdin)
|
||||
fclose(input_file);
|
||||
if (output_file != stdout)
|
||||
fclose(output_file);
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
end_progress_monitor((j_common_ptr) &cinfo);
|
||||
#endif
|
||||
|
||||
if (memsrc && inbuffer != NULL)
|
||||
free(inbuffer);
|
||||
|
||||
/* All done. */
|
||||
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
}
|
||||
88
doc/html/annotated.html
Normal file
@@ -0,0 +1,88 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: Data Structures</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Data Structures</div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<div class="textblock">Here are the data structures with brief descriptions:</div><table>
|
||||
<tr><td class="indexkey"><a class="el" href="structtjregion.html">tjregion</a></td><td class="indexvalue">Cropping region </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a></td><td class="indexvalue">Scaling factor </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="structtjtransform.html">tjtransform</a></td><td class="indexvalue">Lossless transform </td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
doc/html/bc_s.png
Normal file
|
After Width: | Height: | Size: 677 B |
87
doc/html/classes.html
Normal file
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: Data Structure Index</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li class="current"><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Data Structure Index</div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
|
||||
<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr><td><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  T  </div></td></tr></table>
|
||||
</td><td><a class="el" href="structtjregion.html">tjregion</a>   </td><td><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>   </td><td><a class="el" href="structtjtransform.html">tjtransform</a>   </td></tr></table><div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
doc/html/closed.png
Normal file
|
After Width: | Height: | Size: 126 B |
835
doc/html/doxygen.css
Normal file
@@ -0,0 +1,835 @@
|
||||
/* The standard CSS for doxygen */
|
||||
|
||||
body, table, div, p, dl {
|
||||
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* @group Heading Levels */
|
||||
|
||||
h1 {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
margin: 10px 2px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.multicol {
|
||||
-moz-column-gap: 1em;
|
||||
-webkit-column-gap: 1em;
|
||||
-moz-column-count: 3;
|
||||
-webkit-column-count: 3;
|
||||
}
|
||||
|
||||
p.startli, p.startdd, p.starttd {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
p.endli {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
p.enddd {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
p.endtd {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
caption {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.legend {
|
||||
font-size: 70%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h3.version {
|
||||
font-size: 90%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.qindex, div.navtab{
|
||||
background-color: #EBEFF6;
|
||||
border: 1px solid #A3B4D7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
div.qindex, div.navpath {
|
||||
width: 100%;
|
||||
line-height: 140%;
|
||||
}
|
||||
|
||||
div.navtab {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
/* @group Link Styling */
|
||||
|
||||
a {
|
||||
color: #3D578C;
|
||||
font-weight: normal;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.contents a:visited {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a.qindex {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a.qindexHL {
|
||||
font-weight: bold;
|
||||
background-color: #9CAFD4;
|
||||
color: #ffffff;
|
||||
border: 1px double #869DCA;
|
||||
}
|
||||
|
||||
.contents a.qindexHL:visited {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
a.el {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a.elRef {
|
||||
}
|
||||
|
||||
a.code {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
a.codeRef {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
dl.el {
|
||||
margin-left: -1cm;
|
||||
}
|
||||
|
||||
.fragment {
|
||||
font-family: monospace, fixed;
|
||||
font-size: 105%;
|
||||
}
|
||||
|
||||
pre.fragment {
|
||||
border: 1px solid #C4CFE5;
|
||||
background-color: #FBFCFD;
|
||||
padding: 4px 6px;
|
||||
margin: 4px 8px 4px 2px;
|
||||
overflow: auto;
|
||||
word-wrap: break-word;
|
||||
font-size: 9pt;
|
||||
line-height: 125%;
|
||||
}
|
||||
|
||||
div.ah {
|
||||
background-color: black;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-bottom: 3px;
|
||||
margin-top: 3px;
|
||||
padding: 0.2em;
|
||||
border: solid thin #333;
|
||||
border-radius: 0.5em;
|
||||
-webkit-border-radius: .5em;
|
||||
-moz-border-radius: .5em;
|
||||
box-shadow: 2px 2px 3px #999;
|
||||
-webkit-box-shadow: 2px 2px 3px #999;
|
||||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
|
||||
background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
|
||||
}
|
||||
|
||||
div.groupHeader {
|
||||
margin-left: 16px;
|
||||
margin-top: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.groupText {
|
||||
margin-left: 16px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body {
|
||||
background: white;
|
||||
color: black;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.contents {
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
td.indexkey {
|
||||
background-color: #EBEFF6;
|
||||
font-weight: bold;
|
||||
border: 1px solid #C4CFE5;
|
||||
margin: 2px 0px 2px 0;
|
||||
padding: 2px 10px;
|
||||
}
|
||||
|
||||
td.indexvalue {
|
||||
background-color: #EBEFF6;
|
||||
border: 1px solid #C4CFE5;
|
||||
padding: 2px 10px;
|
||||
margin: 2px 0px;
|
||||
}
|
||||
|
||||
tr.memlist {
|
||||
background-color: #EEF1F7;
|
||||
}
|
||||
|
||||
p.formulaDsp {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
img.formulaDsp {
|
||||
|
||||
}
|
||||
|
||||
img.formulaInl {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.center {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div.center img {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
address.footer {
|
||||
text-align: right;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
img.footer {
|
||||
border: 0px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* @group Code Colorization */
|
||||
|
||||
span.keyword {
|
||||
color: #008000
|
||||
}
|
||||
|
||||
span.keywordtype {
|
||||
color: #604020
|
||||
}
|
||||
|
||||
span.keywordflow {
|
||||
color: #e08000
|
||||
}
|
||||
|
||||
span.comment {
|
||||
color: #800000
|
||||
}
|
||||
|
||||
span.preprocessor {
|
||||
color: #806020
|
||||
}
|
||||
|
||||
span.stringliteral {
|
||||
color: #002080
|
||||
}
|
||||
|
||||
span.charliteral {
|
||||
color: #008080
|
||||
}
|
||||
|
||||
span.vhdldigit {
|
||||
color: #ff00ff
|
||||
}
|
||||
|
||||
span.vhdlchar {
|
||||
color: #000000
|
||||
}
|
||||
|
||||
span.vhdlkeyword {
|
||||
color: #700070
|
||||
}
|
||||
|
||||
span.vhdllogic {
|
||||
color: #ff0000
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
/*
|
||||
.search {
|
||||
color: #003399;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
form.search {
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
input.search {
|
||||
font-size: 75%;
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
background-color: #e8eef2;
|
||||
}
|
||||
*/
|
||||
|
||||
td.tiny {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
.dirtab {
|
||||
padding: 4px;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid #A3B4D7;
|
||||
}
|
||||
|
||||
th.dirtab {
|
||||
background: #EBEFF6;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
hr {
|
||||
height: 0px;
|
||||
border: none;
|
||||
border-top: 1px solid #4A6AAA;
|
||||
}
|
||||
|
||||
hr.footer {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
/* @group Member Descriptions */
|
||||
|
||||
table.memberdecls {
|
||||
border-spacing: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.mdescLeft, .mdescRight,
|
||||
.memItemLeft, .memItemRight,
|
||||
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
|
||||
background-color: #F9FAFC;
|
||||
border: none;
|
||||
margin: 4px;
|
||||
padding: 1px 0 0 8px;
|
||||
}
|
||||
|
||||
.mdescLeft, .mdescRight {
|
||||
padding: 0px 8px 4px 8px;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.memItemLeft, .memItemRight, .memTemplParams {
|
||||
border-top: 1px solid #C4CFE5;
|
||||
}
|
||||
|
||||
.memItemLeft, .memTemplItemLeft {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.memItemRight {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.memTemplParams {
|
||||
color: #4665A2;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
/* @group Member Details */
|
||||
|
||||
/* Styles for detailed member documentation */
|
||||
|
||||
.memtemplate {
|
||||
font-size: 80%;
|
||||
color: #4665A2;
|
||||
font-weight: normal;
|
||||
margin-left: 9px;
|
||||
}
|
||||
|
||||
.memnav {
|
||||
background-color: #EBEFF6;
|
||||
border: 1px solid #A3B4D7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
margin-right: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.mempage {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.memitem {
|
||||
padding: 0;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.memname {
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.memproto {
|
||||
border-top: 1px solid #A8B8D9;
|
||||
border-left: 1px solid #A8B8D9;
|
||||
border-right: 1px solid #A8B8D9;
|
||||
padding: 6px 0px 6px 0px;
|
||||
color: #253555;
|
||||
font-weight: bold;
|
||||
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
|
||||
/* opera specific markup */
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
border-top-right-radius: 8px;
|
||||
border-top-left-radius: 8px;
|
||||
/* firefox specific markup */
|
||||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
|
||||
-moz-border-radius-topright: 8px;
|
||||
-moz-border-radius-topleft: 8px;
|
||||
/* webkit specific markup */
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
-webkit-border-top-right-radius: 8px;
|
||||
-webkit-border-top-left-radius: 8px;
|
||||
background-image:url('nav_f.png');
|
||||
background-repeat:repeat-x;
|
||||
background-color: #E2E8F2;
|
||||
|
||||
}
|
||||
|
||||
.memdoc {
|
||||
border-bottom: 1px solid #A8B8D9;
|
||||
border-left: 1px solid #A8B8D9;
|
||||
border-right: 1px solid #A8B8D9;
|
||||
padding: 2px 5px;
|
||||
background-color: #FBFCFD;
|
||||
border-top-width: 0;
|
||||
/* opera specific markup */
|
||||
border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
/* firefox specific markup */
|
||||
-moz-border-radius-bottomleft: 8px;
|
||||
-moz-border-radius-bottomright: 8px;
|
||||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
|
||||
background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
|
||||
/* webkit specific markup */
|
||||
-webkit-border-bottom-left-radius: 8px;
|
||||
-webkit-border-bottom-right-radius: 8px;
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
|
||||
}
|
||||
|
||||
.paramkey {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.paramtype {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.paramname {
|
||||
color: #602020;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.paramname em {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.params, .retval, .exception, .tparams {
|
||||
border-spacing: 6px 2px;
|
||||
}
|
||||
|
||||
.params .paramname, .retval .paramname {
|
||||
font-weight: bold;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.params .paramtype {
|
||||
font-style: italic;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.params .paramdir {
|
||||
font-family: "courier new",courier,monospace;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* @end */
|
||||
|
||||
/* @group Directory (tree) */
|
||||
|
||||
/* for the tree view */
|
||||
|
||||
.ftvtree {
|
||||
font-family: sans-serif;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/* these are for tree view when used as main index */
|
||||
|
||||
.directory {
|
||||
font-size: 9pt;
|
||||
font-weight: bold;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.directory h3 {
|
||||
margin: 0px;
|
||||
margin-top: 1em;
|
||||
font-size: 11pt;
|
||||
}
|
||||
|
||||
/*
|
||||
The following two styles can be used to replace the root node title
|
||||
with an image of your choice. Simply uncomment the next two styles,
|
||||
specify the name of your image and be sure to set 'height' to the
|
||||
proper pixel height of your image.
|
||||
*/
|
||||
|
||||
/*
|
||||
.directory h3.swap {
|
||||
height: 61px;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("yourimage.gif");
|
||||
}
|
||||
.directory h3.swap span {
|
||||
display: none;
|
||||
}
|
||||
*/
|
||||
|
||||
.directory > h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.directory p {
|
||||
margin: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.directory div {
|
||||
display: none;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.directory img {
|
||||
vertical-align: -30%;
|
||||
}
|
||||
|
||||
/* these are for tree view when not used as main index */
|
||||
|
||||
.directory-alt {
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.directory-alt h3 {
|
||||
margin: 0px;
|
||||
margin-top: 1em;
|
||||
font-size: 11pt;
|
||||
}
|
||||
|
||||
.directory-alt > h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.directory-alt p {
|
||||
margin: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.directory-alt div {
|
||||
display: none;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.directory-alt img {
|
||||
vertical-align: -30%;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
div.dynheader {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
address {
|
||||
font-style: normal;
|
||||
color: #2A3D61;
|
||||
}
|
||||
|
||||
table.doxtable {
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
table.doxtable td, table.doxtable th {
|
||||
border: 1px solid #2D4068;
|
||||
padding: 3px 7px 2px;
|
||||
}
|
||||
|
||||
table.doxtable th {
|
||||
background-color: #374F7F;
|
||||
color: #FFFFFF;
|
||||
font-size: 110%;
|
||||
padding-bottom: 4px;
|
||||
padding-top: 5px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
.tabsearch {
|
||||
top: 0px;
|
||||
left: 10px;
|
||||
height: 36px;
|
||||
background-image: url('tab_b.png');
|
||||
z-index: 101;
|
||||
overflow: hidden;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.navpath ul
|
||||
{
|
||||
font-size: 11px;
|
||||
background-image:url('tab_b.png');
|
||||
background-repeat:repeat-x;
|
||||
height:30px;
|
||||
line-height:30px;
|
||||
color:#8AA0CC;
|
||||
border:solid 1px #C2CDE4;
|
||||
overflow:hidden;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
.navpath li
|
||||
{
|
||||
list-style-type:none;
|
||||
float:left;
|
||||
padding-left:10px;
|
||||
padding-right:15px;
|
||||
background-image:url('bc_s.png');
|
||||
background-repeat:no-repeat;
|
||||
background-position:right;
|
||||
color:#364D7C;
|
||||
}
|
||||
|
||||
.navpath li.navelem a
|
||||
{
|
||||
height:32px;
|
||||
display:block;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.navpath li.navelem a:hover
|
||||
{
|
||||
color:#6884BD;
|
||||
}
|
||||
|
||||
.navpath li.footer
|
||||
{
|
||||
list-style-type:none;
|
||||
float:right;
|
||||
padding-left:10px;
|
||||
padding-right:15px;
|
||||
background-image:none;
|
||||
background-repeat:no-repeat;
|
||||
background-position:right;
|
||||
color:#364D7C;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
|
||||
div.summary
|
||||
{
|
||||
float: right;
|
||||
font-size: 8pt;
|
||||
padding-right: 5px;
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.summary a
|
||||
{
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.ingroups
|
||||
{
|
||||
font-size: 8pt;
|
||||
padding-left: 5px;
|
||||
width: 50%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.ingroups a
|
||||
{
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.header
|
||||
{
|
||||
background-image:url('nav_h.png');
|
||||
background-repeat:repeat-x;
|
||||
background-color: #F9FAFC;
|
||||
margin: 0px;
|
||||
border-bottom: 1px solid #C4CFE5;
|
||||
}
|
||||
|
||||
div.headertitle
|
||||
{
|
||||
padding: 5px 5px 5px 10px;
|
||||
}
|
||||
|
||||
dl
|
||||
{
|
||||
padding: 0 0 0 10px;
|
||||
}
|
||||
|
||||
dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
|
||||
{
|
||||
border-left:4px solid;
|
||||
padding: 0 0 0 6px;
|
||||
}
|
||||
|
||||
dl.note
|
||||
{
|
||||
border-color: #D0C000;
|
||||
}
|
||||
|
||||
dl.warning, dl.attention
|
||||
{
|
||||
border-color: #FF0000;
|
||||
}
|
||||
|
||||
dl.pre, dl.post, dl.invariant
|
||||
{
|
||||
border-color: #00D000;
|
||||
}
|
||||
|
||||
dl.deprecated
|
||||
{
|
||||
border-color: #505050;
|
||||
}
|
||||
|
||||
dl.todo
|
||||
{
|
||||
border-color: #00C0E0;
|
||||
}
|
||||
|
||||
dl.test
|
||||
{
|
||||
border-color: #3030E0;
|
||||
}
|
||||
|
||||
dl.bug
|
||||
{
|
||||
border-color: #C08050;
|
||||
}
|
||||
|
||||
#projectlogo
|
||||
{
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
#projectlogo img
|
||||
{
|
||||
border: 0px none;
|
||||
}
|
||||
|
||||
#projectname
|
||||
{
|
||||
font: 300% Tahoma, Arial,sans-serif;
|
||||
margin: 0px;
|
||||
padding: 2px 0px;
|
||||
}
|
||||
|
||||
#projectbrief
|
||||
{
|
||||
font: 120% Tahoma, Arial,sans-serif;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#projectnumber
|
||||
{
|
||||
font: 50% Tahoma, Arial,sans-serif;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#titlearea
|
||||
{
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #5373B4;
|
||||
}
|
||||
|
||||
.image
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dotgraph
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mscgraph
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.caption
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
BIN
doc/html/doxygen.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
120
doc/html/functions.html
Normal file
@@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: Data Fields</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li class="current"><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow3" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li class="current"><a href="functions.html"><span>All</span></a></li>
|
||||
<li><a href="functions_vars.html"><span>Variables</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div><ul>
|
||||
<li>customFilter
|
||||
: <a class="el" href="structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1">tjtransform</a>
|
||||
</li>
|
||||
<li>data
|
||||
: <a class="el" href="structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3">tjtransform</a>
|
||||
</li>
|
||||
<li>denom
|
||||
: <a class="el" href="structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3">tjscalingfactor</a>
|
||||
</li>
|
||||
<li>h
|
||||
: <a class="el" href="structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115">tjregion</a>
|
||||
</li>
|
||||
<li>num
|
||||
: <a class="el" href="structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec">tjscalingfactor</a>
|
||||
</li>
|
||||
<li>op
|
||||
: <a class="el" href="structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498">tjtransform</a>
|
||||
</li>
|
||||
<li>options
|
||||
: <a class="el" href="structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6">tjtransform</a>
|
||||
</li>
|
||||
<li>r
|
||||
: <a class="el" href="structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf">tjtransform</a>
|
||||
</li>
|
||||
<li>w
|
||||
: <a class="el" href="structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42">tjregion</a>
|
||||
</li>
|
||||
<li>x
|
||||
: <a class="el" href="structtjregion.html#a4b6a37a93997091b26a75831fa291ad9">tjregion</a>
|
||||
</li>
|
||||
<li>y
|
||||
: <a class="el" href="structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2">tjregion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
120
doc/html/functions_vars.html
Normal file
@@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: Data Fields - Variables</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li class="current"><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow3" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="functions.html"><span>All</span></a></li>
|
||||
<li class="current"><a href="functions_vars.html"><span>Variables</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
 <ul>
|
||||
<li>customFilter
|
||||
: <a class="el" href="structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1">tjtransform</a>
|
||||
</li>
|
||||
<li>data
|
||||
: <a class="el" href="structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3">tjtransform</a>
|
||||
</li>
|
||||
<li>denom
|
||||
: <a class="el" href="structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3">tjscalingfactor</a>
|
||||
</li>
|
||||
<li>h
|
||||
: <a class="el" href="structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115">tjregion</a>
|
||||
</li>
|
||||
<li>num
|
||||
: <a class="el" href="structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec">tjscalingfactor</a>
|
||||
</li>
|
||||
<li>op
|
||||
: <a class="el" href="structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498">tjtransform</a>
|
||||
</li>
|
||||
<li>options
|
||||
: <a class="el" href="structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6">tjtransform</a>
|
||||
</li>
|
||||
<li>r
|
||||
: <a class="el" href="structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf">tjtransform</a>
|
||||
</li>
|
||||
<li>w
|
||||
: <a class="el" href="structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42">tjregion</a>
|
||||
</li>
|
||||
<li>x
|
||||
: <a class="el" href="structtjregion.html#a4b6a37a93997091b26a75831fa291ad9">tjregion</a>
|
||||
</li>
|
||||
<li>y
|
||||
: <a class="el" href="structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2">tjregion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
1601
doc/html/group___turbo_j_p_e_g.html
Normal file
76
doc/html/index.html
Normal file
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: Main Page</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">TurboJPEG Documentation</div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
112
doc/html/installdox
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
%subst = ( );
|
||||
$quiet = 0;
|
||||
|
||||
while ( @ARGV ) {
|
||||
$_ = shift @ARGV;
|
||||
if ( s/^-// ) {
|
||||
if ( /^l(.*)/ ) {
|
||||
$v = ($1 eq "") ? shift @ARGV : $1;
|
||||
($v =~ /\/$/) || ($v .= "/");
|
||||
$_ = $v;
|
||||
if ( /(.+)\@(.+)/ ) {
|
||||
if ( exists $subst{$1} ) {
|
||||
$subst{$1} = $2;
|
||||
} else {
|
||||
print STDERR "Unknown tag file $1 given with option -l\n";
|
||||
&usage();
|
||||
}
|
||||
} else {
|
||||
print STDERR "Argument $_ is invalid for option -l\n";
|
||||
&usage();
|
||||
}
|
||||
}
|
||||
elsif ( /^q/ ) {
|
||||
$quiet = 1;
|
||||
}
|
||||
elsif ( /^\?|^h/ ) {
|
||||
&usage();
|
||||
}
|
||||
else {
|
||||
print STDERR "Illegal option -$_\n";
|
||||
&usage();
|
||||
}
|
||||
}
|
||||
else {
|
||||
push (@files, $_ );
|
||||
}
|
||||
}
|
||||
|
||||
foreach $sub (keys %subst)
|
||||
{
|
||||
if ( $subst{$sub} eq "" )
|
||||
{
|
||||
print STDERR "No substitute given for tag file `$sub'\n";
|
||||
&usage();
|
||||
}
|
||||
elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" )
|
||||
{
|
||||
print "Substituting $subst{$sub} for each occurrence of tag file $sub\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! @files ) {
|
||||
if (opendir(D,".")) {
|
||||
foreach $file ( readdir(D) ) {
|
||||
$match = ".html";
|
||||
next if ( $file =~ /^\.\.?$/ );
|
||||
($file =~ /$match/) && (push @files, $file);
|
||||
($file =~ /\.svg/) && (push @files, $file);
|
||||
($file =~ "navtree.js") && (push @files, $file);
|
||||
}
|
||||
closedir(D);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! @files ) {
|
||||
print STDERR "Warning: No input files given and none found!\n";
|
||||
}
|
||||
|
||||
foreach $f (@files)
|
||||
{
|
||||
if ( ! $quiet ) {
|
||||
print "Editing: $f...\n";
|
||||
}
|
||||
$oldf = $f;
|
||||
$f .= ".bak";
|
||||
unless (rename $oldf,$f) {
|
||||
print STDERR "Error: cannot rename file $oldf\n";
|
||||
exit 1;
|
||||
}
|
||||
if (open(F,"<$f")) {
|
||||
unless (open(G,">$oldf")) {
|
||||
print STDERR "Error: opening file $oldf for writing\n";
|
||||
exit 1;
|
||||
}
|
||||
if ($oldf ne "tree.js") {
|
||||
while (<F>) {
|
||||
s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (xlink:href|href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g;
|
||||
print G "$_";
|
||||
}
|
||||
}
|
||||
else {
|
||||
while (<F>) {
|
||||
s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g;
|
||||
print G "$_";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
print STDERR "Warning file $f does not exist\n";
|
||||
}
|
||||
unlink $f;
|
||||
}
|
||||
|
||||
sub usage {
|
||||
print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n";
|
||||
print STDERR "Options:\n";
|
||||
print STDERR " -l tagfile\@linkName tag file + URL or directory \n";
|
||||
print STDERR " -q Quiet mode\n\n";
|
||||
exit 1;
|
||||
}
|
||||
54
doc/html/jquery.js
vendored
Normal file
79
doc/html/modules.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: Modules</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li class="current"><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Modules</div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<div class="textblock">Here is a list of all modules:</div><ul>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html">TurboJPEG</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
doc/html/nav_f.png
Normal file
|
After Width: | Height: | Size: 159 B |
BIN
doc/html/nav_h.png
Normal file
|
After Width: | Height: | Size: 97 B |
BIN
doc/html/open.png
Normal file
|
After Width: | Height: | Size: 118 B |
26
doc/html/search/all_63.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_customfilter">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1" target="_parent">customFilter</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
32
doc/html/search/all_64.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_data">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3" target="_parent">data</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_denom">
|
||||
<div class="SREntry">
|
||||
<a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3" target="_parent">denom</a>
|
||||
<span class="SRScope">tjscalingfactor</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/all_68.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_h">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115" target="_parent">h</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/all_6e.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_num">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec" target="_parent">num</a>
|
||||
<span class="SRScope">tjscalingfactor</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
32
doc/html/search/all_6f.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_op">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498" target="_parent">op</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_options">
|
||||
<div class="SREntry">
|
||||
<a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6" target="_parent">options</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/all_72.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_r">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf" target="_parent">r</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
35
doc/html/search/all_74.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_tjregion">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html" target="_parent">tjregion</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_tjscalingfactor">
|
||||
<div class="SREntry">
|
||||
<a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../structtjscalingfactor.html" target="_parent">tjscalingfactor</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_tjtransform">
|
||||
<div class="SREntry">
|
||||
<a id="Item2" onkeydown="return searchResults.Nav(event,2)" onkeypress="return searchResults.Nav(event,2)" onkeyup="return searchResults.Nav(event,2)" class="SRSymbol" href="../structtjtransform.html" target="_parent">tjtransform</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/all_77.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_w">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42" target="_parent">w</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/all_78.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_x">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9" target="_parent">x</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/all_79.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_y">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2" target="_parent">y</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
35
doc/html/search/classes_74.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_tjregion">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html" target="_parent">tjregion</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_tjscalingfactor">
|
||||
<div class="SREntry">
|
||||
<a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../structtjscalingfactor.html" target="_parent">tjscalingfactor</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_tjtransform">
|
||||
<div class="SREntry">
|
||||
<a id="Item2" onkeydown="return searchResults.Nav(event,2)" onkeypress="return searchResults.Nav(event,2)" onkeyup="return searchResults.Nav(event,2)" class="SRSymbol" href="../structtjtransform.html" target="_parent">tjtransform</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
doc/html/search/close.png
Normal file
|
After Width: | Height: | Size: 273 B |
BIN
doc/html/search/mag_sel.png
Normal file
|
After Width: | Height: | Size: 563 B |
12
doc/html/search/nomatches.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
240
doc/html/search/search.css
Normal file
@@ -0,0 +1,240 @@
|
||||
/*---------------- Search Box */
|
||||
|
||||
#FSearchBox {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#searchli {
|
||||
float: right;
|
||||
display: block;
|
||||
width: 170px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
#MSearchBox {
|
||||
white-space : nowrap;
|
||||
position: absolute;
|
||||
float: none;
|
||||
display: inline;
|
||||
margin-top: 8px;
|
||||
right: 0px;
|
||||
width: 170px;
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
#MSearchBox .left
|
||||
{
|
||||
display:block;
|
||||
position:absolute;
|
||||
left:10px;
|
||||
width:20px;
|
||||
height:19px;
|
||||
background:url('search_l.png') no-repeat;
|
||||
background-position:right;
|
||||
}
|
||||
|
||||
#MSearchSelect {
|
||||
display:block;
|
||||
position:absolute;
|
||||
width:20px;
|
||||
height:19px;
|
||||
}
|
||||
|
||||
.left #MSearchSelect {
|
||||
left:4px;
|
||||
}
|
||||
|
||||
.right #MSearchSelect {
|
||||
right:5px;
|
||||
}
|
||||
|
||||
#MSearchField {
|
||||
display:block;
|
||||
position:absolute;
|
||||
height:19px;
|
||||
background:url('search_m.png') repeat-x;
|
||||
border:none;
|
||||
width:116px;
|
||||
margin-left:20px;
|
||||
padding-left:4px;
|
||||
color: #909090;
|
||||
outline: none;
|
||||
font: 9pt Arial, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
#FSearchBox #MSearchField {
|
||||
margin-left:15px;
|
||||
}
|
||||
|
||||
#MSearchBox .right {
|
||||
display:block;
|
||||
position:absolute;
|
||||
right:10px;
|
||||
top:0px;
|
||||
width:20px;
|
||||
height:19px;
|
||||
background:url('search_r.png') no-repeat;
|
||||
background-position:left;
|
||||
}
|
||||
|
||||
#MSearchClose {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
background : none;
|
||||
border: none;
|
||||
margin: 0px 4px 0px 0px;
|
||||
padding: 0px 0px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.left #MSearchClose {
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
.right #MSearchClose {
|
||||
right: 2px;
|
||||
}
|
||||
|
||||
.MSearchBoxActive #MSearchField {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
/*---------------- Search filter selection */
|
||||
|
||||
#MSearchSelectWindow {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
border: 1px solid #90A5CE;
|
||||
background-color: #F9FAFC;
|
||||
z-index: 1;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.SelectItem {
|
||||
font: 8pt Arial, Verdana, sans-serif;
|
||||
padding-left: 2px;
|
||||
padding-right: 12px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
span.SelectionMark {
|
||||
margin-right: 4px;
|
||||
font-family: monospace;
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.SelectItem {
|
||||
display: block;
|
||||
outline-style: none;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
padding-left: 6px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
a.SelectItem:focus,
|
||||
a.SelectItem:active {
|
||||
color: #000000;
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.SelectItem:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #3D578C;
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*---------------- Search results window */
|
||||
|
||||
iframe#MSearchResults {
|
||||
width: 60ex;
|
||||
height: 15em;
|
||||
}
|
||||
|
||||
#MSearchResultsWindow {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
border: 1px solid #000;
|
||||
background-color: #EEF1F7;
|
||||
}
|
||||
|
||||
/* ----------------------------------- */
|
||||
|
||||
|
||||
#SRIndex {
|
||||
clear:both;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.SREntry {
|
||||
font-size: 10pt;
|
||||
padding-left: 1ex;
|
||||
}
|
||||
|
||||
.SRPage .SREntry {
|
||||
font-size: 8pt;
|
||||
padding: 1px 5px;
|
||||
}
|
||||
|
||||
body.SRPage {
|
||||
margin: 5px 2px;
|
||||
}
|
||||
|
||||
.SRChildren {
|
||||
padding-left: 3ex; padding-bottom: .5em
|
||||
}
|
||||
|
||||
.SRPage .SRChildren {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.SRSymbol {
|
||||
font-weight: bold;
|
||||
color: #425E97;
|
||||
font-family: Arial, Verdana, sans-serif;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
a.SRScope {
|
||||
display: block;
|
||||
color: #425E97;
|
||||
font-family: Arial, Verdana, sans-serif;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
a.SRSymbol:focus, a.SRSymbol:active,
|
||||
a.SRScope:focus, a.SRScope:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.SRPage .SRStatus {
|
||||
padding: 2px 5px;
|
||||
font-size: 8pt;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.SRResult {
|
||||
display: none;
|
||||
}
|
||||
|
||||
DIV.searchresults {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
730
doc/html/search/search.js
Normal file
@@ -0,0 +1,730 @@
|
||||
// Search script generated by doxygen
|
||||
// Copyright (C) 2009 by Dimitri van Heesch.
|
||||
|
||||
// The code in this file is loosly based on main.js, part of Natural Docs,
|
||||
// which is Copyright (C) 2003-2008 Greg Valure
|
||||
// Natural Docs is licensed under the GPL.
|
||||
|
||||
var indexSectionsWithContent =
|
||||
{
|
||||
0: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100010000011001010011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100010000011001000011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
};
|
||||
|
||||
var indexSectionNames =
|
||||
{
|
||||
0: "all",
|
||||
1: "classes",
|
||||
2: "variables"
|
||||
};
|
||||
|
||||
function convertToId(search)
|
||||
{
|
||||
var result = '';
|
||||
for (i=0;i<search.length;i++)
|
||||
{
|
||||
var c = search.charAt(i);
|
||||
var cn = c.charCodeAt(0);
|
||||
if (c.match(/[a-z0-9]/))
|
||||
{
|
||||
result+=c;
|
||||
}
|
||||
else if (cn<16)
|
||||
{
|
||||
result+="_0"+cn.toString(16);
|
||||
}
|
||||
else
|
||||
{
|
||||
result+="_"+cn.toString(16);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getXPos(item)
|
||||
{
|
||||
var x = 0;
|
||||
if (item.offsetWidth)
|
||||
{
|
||||
while (item && item!=document.body)
|
||||
{
|
||||
x += item.offsetLeft;
|
||||
item = item.offsetParent;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
function getYPos(item)
|
||||
{
|
||||
var y = 0;
|
||||
if (item.offsetWidth)
|
||||
{
|
||||
while (item && item!=document.body)
|
||||
{
|
||||
y += item.offsetTop;
|
||||
item = item.offsetParent;
|
||||
}
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
/* A class handling everything associated with the search panel.
|
||||
|
||||
Parameters:
|
||||
name - The name of the global variable that will be
|
||||
storing this instance. Is needed to be able to set timeouts.
|
||||
resultPath - path to use for external files
|
||||
*/
|
||||
function SearchBox(name, resultsPath, inFrame, label)
|
||||
{
|
||||
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
|
||||
|
||||
// ---------- Instance variables
|
||||
this.name = name;
|
||||
this.resultsPath = resultsPath;
|
||||
this.keyTimeout = 0;
|
||||
this.keyTimeoutLength = 500;
|
||||
this.closeSelectionTimeout = 300;
|
||||
this.lastSearchValue = "";
|
||||
this.lastResultsPage = "";
|
||||
this.hideTimeout = 0;
|
||||
this.searchIndex = 0;
|
||||
this.searchActive = false;
|
||||
this.insideFrame = inFrame;
|
||||
this.searchLabel = label;
|
||||
|
||||
// ----------- DOM Elements
|
||||
|
||||
this.DOMSearchField = function()
|
||||
{ return document.getElementById("MSearchField"); }
|
||||
|
||||
this.DOMSearchSelect = function()
|
||||
{ return document.getElementById("MSearchSelect"); }
|
||||
|
||||
this.DOMSearchSelectWindow = function()
|
||||
{ return document.getElementById("MSearchSelectWindow"); }
|
||||
|
||||
this.DOMPopupSearchResults = function()
|
||||
{ return document.getElementById("MSearchResults"); }
|
||||
|
||||
this.DOMPopupSearchResultsWindow = function()
|
||||
{ return document.getElementById("MSearchResultsWindow"); }
|
||||
|
||||
this.DOMSearchClose = function()
|
||||
{ return document.getElementById("MSearchClose"); }
|
||||
|
||||
this.DOMSearchBox = function()
|
||||
{ return document.getElementById("MSearchBox"); }
|
||||
|
||||
// ------------ Event Handlers
|
||||
|
||||
// Called when focus is added or removed from the search field.
|
||||
this.OnSearchFieldFocus = function(isActive)
|
||||
{
|
||||
this.Activate(isActive);
|
||||
}
|
||||
|
||||
this.OnSearchSelectShow = function()
|
||||
{
|
||||
var searchSelectWindow = this.DOMSearchSelectWindow();
|
||||
var searchField = this.DOMSearchSelect();
|
||||
|
||||
if (this.insideFrame)
|
||||
{
|
||||
var left = getXPos(searchField);
|
||||
var top = getYPos(searchField);
|
||||
left += searchField.offsetWidth + 6;
|
||||
top += searchField.offsetHeight;
|
||||
|
||||
// show search selection popup
|
||||
searchSelectWindow.style.display='block';
|
||||
left -= searchSelectWindow.offsetWidth;
|
||||
searchSelectWindow.style.left = left + 'px';
|
||||
searchSelectWindow.style.top = top + 'px';
|
||||
}
|
||||
else
|
||||
{
|
||||
var left = getXPos(searchField);
|
||||
var top = getYPos(searchField);
|
||||
top += searchField.offsetHeight;
|
||||
|
||||
// show search selection popup
|
||||
searchSelectWindow.style.display='block';
|
||||
searchSelectWindow.style.left = left + 'px';
|
||||
searchSelectWindow.style.top = top + 'px';
|
||||
}
|
||||
|
||||
// stop selection hide timer
|
||||
if (this.hideTimeout)
|
||||
{
|
||||
clearTimeout(this.hideTimeout);
|
||||
this.hideTimeout=0;
|
||||
}
|
||||
return false; // to avoid "image drag" default event
|
||||
}
|
||||
|
||||
this.OnSearchSelectHide = function()
|
||||
{
|
||||
this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()",
|
||||
this.closeSelectionTimeout);
|
||||
}
|
||||
|
||||
// Called when the content of the search field is changed.
|
||||
this.OnSearchFieldChange = function(evt)
|
||||
{
|
||||
if (this.keyTimeout) // kill running timer
|
||||
{
|
||||
clearTimeout(this.keyTimeout);
|
||||
this.keyTimeout = 0;
|
||||
}
|
||||
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==40 || e.keyCode==13)
|
||||
{
|
||||
if (e.shiftKey==1)
|
||||
{
|
||||
this.OnSearchSelectShow();
|
||||
var win=this.DOMSearchSelectWindow();
|
||||
for (i=0;i<win.childNodes.length;i++)
|
||||
{
|
||||
var child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem')
|
||||
{
|
||||
child.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (window.frames.MSearchResults.searchResults)
|
||||
{
|
||||
var elem = window.frames.MSearchResults.searchResults.NavNext(0);
|
||||
if (elem) elem.focus();
|
||||
}
|
||||
}
|
||||
else if (e.keyCode==27) // Escape out of the search field
|
||||
{
|
||||
this.DOMSearchField().blur();
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.lastSearchValue = '';
|
||||
this.Activate(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// strip whitespaces
|
||||
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||
|
||||
if (searchValue != this.lastSearchValue) // search value has changed
|
||||
{
|
||||
if (searchValue != "") // non-empty search
|
||||
{
|
||||
// set timer for search update
|
||||
this.keyTimeout = setTimeout(this.name + '.Search()',
|
||||
this.keyTimeoutLength);
|
||||
}
|
||||
else // empty search field
|
||||
{
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.lastSearchValue = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.SelectItemCount = function(id)
|
||||
{
|
||||
var count=0;
|
||||
var win=this.DOMSearchSelectWindow();
|
||||
for (i=0;i<win.childNodes.length;i++)
|
||||
{
|
||||
var child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem')
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
this.SelectItemSet = function(id)
|
||||
{
|
||||
var i,j=0;
|
||||
var win=this.DOMSearchSelectWindow();
|
||||
for (i=0;i<win.childNodes.length;i++)
|
||||
{
|
||||
var child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem')
|
||||
{
|
||||
var node = child.firstChild;
|
||||
if (j==id)
|
||||
{
|
||||
node.innerHTML='•';
|
||||
}
|
||||
else
|
||||
{
|
||||
node.innerHTML=' ';
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when an search filter selection is made.
|
||||
// set item with index id as the active item
|
||||
this.OnSelectItem = function(id)
|
||||
{
|
||||
this.searchIndex = id;
|
||||
this.SelectItemSet(id);
|
||||
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||
if (searchValue!="" && this.searchActive) // something was found -> do a search
|
||||
{
|
||||
this.Search();
|
||||
}
|
||||
}
|
||||
|
||||
this.OnSearchSelectKey = function(evt)
|
||||
{
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
|
||||
{
|
||||
this.searchIndex++;
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
}
|
||||
else if (e.keyCode==38 && this.searchIndex>0) // Up
|
||||
{
|
||||
this.searchIndex--;
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
}
|
||||
else if (e.keyCode==13 || e.keyCode==27)
|
||||
{
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
this.CloseSelectionWindow();
|
||||
this.DOMSearchField().focus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------- Actions
|
||||
|
||||
// Closes the results window.
|
||||
this.CloseResultsWindow = function()
|
||||
{
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.Activate(false);
|
||||
}
|
||||
|
||||
this.CloseSelectionWindow = function()
|
||||
{
|
||||
this.DOMSearchSelectWindow().style.display = 'none';
|
||||
}
|
||||
|
||||
// Performs a search.
|
||||
this.Search = function()
|
||||
{
|
||||
this.keyTimeout = 0;
|
||||
|
||||
// strip leading whitespace
|
||||
var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
|
||||
|
||||
var code = searchValue.toLowerCase().charCodeAt(0);
|
||||
var hexCode;
|
||||
if (code<16)
|
||||
{
|
||||
hexCode="0"+code.toString(16);
|
||||
}
|
||||
else
|
||||
{
|
||||
hexCode=code.toString(16);
|
||||
}
|
||||
|
||||
var resultsPage;
|
||||
var resultsPageWithSearch;
|
||||
var hasResultsPage;
|
||||
|
||||
if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')
|
||||
{
|
||||
resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
|
||||
resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
|
||||
hasResultsPage = true;
|
||||
}
|
||||
else // nothing available for this search term
|
||||
{
|
||||
resultsPage = this.resultsPath + '/nomatches.html';
|
||||
resultsPageWithSearch = resultsPage;
|
||||
hasResultsPage = false;
|
||||
}
|
||||
|
||||
window.frames.MSearchResults.location.href = resultsPageWithSearch;
|
||||
var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
|
||||
|
||||
if (domPopupSearchResultsWindow.style.display!='block')
|
||||
{
|
||||
var domSearchBox = this.DOMSearchBox();
|
||||
this.DOMSearchClose().style.display = 'inline';
|
||||
if (this.insideFrame)
|
||||
{
|
||||
var domPopupSearchResults = this.DOMPopupSearchResults();
|
||||
domPopupSearchResultsWindow.style.position = 'relative';
|
||||
domPopupSearchResultsWindow.style.display = 'block';
|
||||
var width = document.body.clientWidth - 8; // the -8 is for IE :-(
|
||||
domPopupSearchResultsWindow.style.width = width + 'px';
|
||||
domPopupSearchResults.style.width = width + 'px';
|
||||
}
|
||||
else
|
||||
{
|
||||
var domPopupSearchResults = this.DOMPopupSearchResults();
|
||||
var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
|
||||
var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
|
||||
domPopupSearchResultsWindow.style.display = 'block';
|
||||
left -= domPopupSearchResults.offsetWidth;
|
||||
domPopupSearchResultsWindow.style.top = top + 'px';
|
||||
domPopupSearchResultsWindow.style.left = left + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
this.lastSearchValue = searchValue;
|
||||
this.lastResultsPage = resultsPage;
|
||||
}
|
||||
|
||||
// -------- Activation Functions
|
||||
|
||||
// Activates or deactivates the search panel, resetting things to
|
||||
// their default values if necessary.
|
||||
this.Activate = function(isActive)
|
||||
{
|
||||
if (isActive || // open it
|
||||
this.DOMPopupSearchResultsWindow().style.display == 'block'
|
||||
)
|
||||
{
|
||||
this.DOMSearchBox().className = 'MSearchBoxActive';
|
||||
|
||||
var searchField = this.DOMSearchField();
|
||||
|
||||
if (searchField.value == this.searchLabel) // clear "Search" term upon entry
|
||||
{
|
||||
searchField.value = '';
|
||||
this.searchActive = true;
|
||||
}
|
||||
}
|
||||
else if (!isActive) // directly remove the panel
|
||||
{
|
||||
this.DOMSearchBox().className = 'MSearchBoxInactive';
|
||||
this.DOMSearchField().value = this.searchLabel;
|
||||
this.searchActive = false;
|
||||
this.lastSearchValue = ''
|
||||
this.lastResultsPage = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// The class that handles everything on the search results page.
|
||||
function SearchResults(name)
|
||||
{
|
||||
// The number of matches from the last run of <Search()>.
|
||||
this.lastMatchCount = 0;
|
||||
this.lastKey = 0;
|
||||
this.repeatOn = false;
|
||||
|
||||
// Toggles the visibility of the passed element ID.
|
||||
this.FindChildElement = function(id)
|
||||
{
|
||||
var parentElement = document.getElementById(id);
|
||||
var element = parentElement.firstChild;
|
||||
|
||||
while (element && element!=parentElement)
|
||||
{
|
||||
if (element.nodeName == 'DIV' && element.className == 'SRChildren')
|
||||
{
|
||||
return element;
|
||||
}
|
||||
|
||||
if (element.nodeName == 'DIV' && element.hasChildNodes())
|
||||
{
|
||||
element = element.firstChild;
|
||||
}
|
||||
else if (element.nextSibling)
|
||||
{
|
||||
element = element.nextSibling;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
element = element.parentNode;
|
||||
}
|
||||
while (element && element!=parentElement && !element.nextSibling);
|
||||
|
||||
if (element && element!=parentElement)
|
||||
{
|
||||
element = element.nextSibling;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.Toggle = function(id)
|
||||
{
|
||||
var element = this.FindChildElement(id);
|
||||
if (element)
|
||||
{
|
||||
if (element.style.display == 'block')
|
||||
{
|
||||
element.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
element.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Searches for the passed string. If there is no parameter,
|
||||
// it takes it from the URL query.
|
||||
//
|
||||
// Always returns true, since other documents may try to call it
|
||||
// and that may or may not be possible.
|
||||
this.Search = function(search)
|
||||
{
|
||||
if (!search) // get search word from URL
|
||||
{
|
||||
search = window.location.search;
|
||||
search = search.substring(1); // Remove the leading '?'
|
||||
search = unescape(search);
|
||||
}
|
||||
|
||||
search = search.replace(/^ +/, ""); // strip leading spaces
|
||||
search = search.replace(/ +$/, ""); // strip trailing spaces
|
||||
search = search.toLowerCase();
|
||||
search = convertToId(search);
|
||||
|
||||
var resultRows = document.getElementsByTagName("div");
|
||||
var matches = 0;
|
||||
|
||||
var i = 0;
|
||||
while (i < resultRows.length)
|
||||
{
|
||||
var row = resultRows.item(i);
|
||||
if (row.className == "SRResult")
|
||||
{
|
||||
var rowMatchName = row.id.toLowerCase();
|
||||
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
|
||||
|
||||
if (search.length<=rowMatchName.length &&
|
||||
rowMatchName.substr(0, search.length)==search)
|
||||
{
|
||||
row.style.display = 'block';
|
||||
matches++;
|
||||
}
|
||||
else
|
||||
{
|
||||
row.style.display = 'none';
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
document.getElementById("Searching").style.display='none';
|
||||
if (matches == 0) // no results
|
||||
{
|
||||
document.getElementById("NoMatches").style.display='block';
|
||||
}
|
||||
else // at least one result
|
||||
{
|
||||
document.getElementById("NoMatches").style.display='none';
|
||||
}
|
||||
this.lastMatchCount = matches;
|
||||
return true;
|
||||
}
|
||||
|
||||
// return the first item with index index or higher that is visible
|
||||
this.NavNext = function(index)
|
||||
{
|
||||
var focusItem;
|
||||
while (1)
|
||||
{
|
||||
var focusName = 'Item'+index;
|
||||
focusItem = document.getElementById(focusName);
|
||||
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (!focusItem) // last element
|
||||
{
|
||||
break;
|
||||
}
|
||||
focusItem=null;
|
||||
index++;
|
||||
}
|
||||
return focusItem;
|
||||
}
|
||||
|
||||
this.NavPrev = function(index)
|
||||
{
|
||||
var focusItem;
|
||||
while (1)
|
||||
{
|
||||
var focusName = 'Item'+index;
|
||||
focusItem = document.getElementById(focusName);
|
||||
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (!focusItem) // last element
|
||||
{
|
||||
break;
|
||||
}
|
||||
focusItem=null;
|
||||
index--;
|
||||
}
|
||||
return focusItem;
|
||||
}
|
||||
|
||||
this.ProcessKeys = function(e)
|
||||
{
|
||||
if (e.type == "keydown")
|
||||
{
|
||||
this.repeatOn = false;
|
||||
this.lastKey = e.keyCode;
|
||||
}
|
||||
else if (e.type == "keypress")
|
||||
{
|
||||
if (!this.repeatOn)
|
||||
{
|
||||
if (this.lastKey) this.repeatOn = true;
|
||||
return false; // ignore first keypress after keydown
|
||||
}
|
||||
}
|
||||
else if (e.type == "keyup")
|
||||
{
|
||||
this.lastKey = 0;
|
||||
this.repeatOn = false;
|
||||
}
|
||||
return this.lastKey!=0;
|
||||
}
|
||||
|
||||
this.Nav = function(evt,itemIndex)
|
||||
{
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==13) return true;
|
||||
if (!this.ProcessKeys(e)) return false;
|
||||
|
||||
if (this.lastKey==38) // Up
|
||||
{
|
||||
var newIndex = itemIndex-1;
|
||||
var focusItem = this.NavPrev(newIndex);
|
||||
if (focusItem)
|
||||
{
|
||||
var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
|
||||
if (child && child.style.display == 'block') // children visible
|
||||
{
|
||||
var n=0;
|
||||
var tmpElem;
|
||||
while (1) // search for last child
|
||||
{
|
||||
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
|
||||
if (tmpElem)
|
||||
{
|
||||
focusItem = tmpElem;
|
||||
}
|
||||
else // found it!
|
||||
{
|
||||
break;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (focusItem)
|
||||
{
|
||||
focusItem.focus();
|
||||
}
|
||||
else // return focus to search field
|
||||
{
|
||||
parent.document.getElementById("MSearchField").focus();
|
||||
}
|
||||
}
|
||||
else if (this.lastKey==40) // Down
|
||||
{
|
||||
var newIndex = itemIndex+1;
|
||||
var focusItem;
|
||||
var item = document.getElementById('Item'+itemIndex);
|
||||
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem && elem.style.display == 'block') // children visible
|
||||
{
|
||||
focusItem = document.getElementById('Item'+itemIndex+'_c0');
|
||||
}
|
||||
if (!focusItem) focusItem = this.NavNext(newIndex);
|
||||
if (focusItem) focusItem.focus();
|
||||
}
|
||||
else if (this.lastKey==39) // Right
|
||||
{
|
||||
var item = document.getElementById('Item'+itemIndex);
|
||||
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem) elem.style.display = 'block';
|
||||
}
|
||||
else if (this.lastKey==37) // Left
|
||||
{
|
||||
var item = document.getElementById('Item'+itemIndex);
|
||||
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem) elem.style.display = 'none';
|
||||
}
|
||||
else if (this.lastKey==27) // Escape
|
||||
{
|
||||
parent.searchBox.CloseResultsWindow();
|
||||
parent.document.getElementById("MSearchField").focus();
|
||||
}
|
||||
else if (this.lastKey==13) // Enter
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
this.NavChild = function(evt,itemIndex,childIndex)
|
||||
{
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==13) return true;
|
||||
if (!this.ProcessKeys(e)) return false;
|
||||
|
||||
if (this.lastKey==38) // Up
|
||||
{
|
||||
if (childIndex>0)
|
||||
{
|
||||
var newIndex = childIndex-1;
|
||||
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
|
||||
}
|
||||
else // already at first child, jump to parent
|
||||
{
|
||||
document.getElementById('Item'+itemIndex).focus();
|
||||
}
|
||||
}
|
||||
else if (this.lastKey==40) // Down
|
||||
{
|
||||
var newIndex = childIndex+1;
|
||||
var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
|
||||
if (!elem) // last child, jump to parent next parent
|
||||
{
|
||||
elem = this.NavNext(itemIndex+1);
|
||||
}
|
||||
if (elem)
|
||||
{
|
||||
elem.focus();
|
||||
}
|
||||
}
|
||||
else if (this.lastKey==27) // Escape
|
||||
{
|
||||
parent.searchBox.CloseResultsWindow();
|
||||
parent.document.getElementById("MSearchField").focus();
|
||||
}
|
||||
else if (this.lastKey==13) // Enter
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
BIN
doc/html/search/search_l.png
Normal file
|
After Width: | Height: | Size: 604 B |
BIN
doc/html/search/search_m.png
Normal file
|
After Width: | Height: | Size: 158 B |
BIN
doc/html/search/search_r.png
Normal file
|
After Width: | Height: | Size: 612 B |
26
doc/html/search/variables_63.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_customfilter">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1" target="_parent">customFilter</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
32
doc/html/search/variables_64.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_data">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3" target="_parent">data</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_denom">
|
||||
<div class="SREntry">
|
||||
<a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3" target="_parent">denom</a>
|
||||
<span class="SRScope">tjscalingfactor</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/variables_68.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_h">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115" target="_parent">h</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/variables_6e.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_num">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec" target="_parent">num</a>
|
||||
<span class="SRScope">tjscalingfactor</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
32
doc/html/search/variables_6f.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_op">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498" target="_parent">op</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRResult" id="SR_options">
|
||||
<div class="SREntry">
|
||||
<a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6" target="_parent">options</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/variables_72.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_r">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf" target="_parent">r</a>
|
||||
<span class="SRScope">tjtransform</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/variables_77.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_w">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42" target="_parent">w</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/variables_78.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_x">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9" target="_parent">x</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
doc/html/search/variables_79.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html><head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||
<script type="text/javascript" src="search.js"></script>
|
||||
</head>
|
||||
<body class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRResult" id="SR_y">
|
||||
<div class="SREntry">
|
||||
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2" target="_parent">y</a>
|
||||
<span class="SRScope">tjregion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
<script type="text/javascript"><!--
|
||||
document.getElementById("Loading").style.display="none";
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
searchResults.Search();
|
||||
--></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
172
doc/html/structtjregion.html
Normal file
@@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: tjregion Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">tjregion Struct Reference<div class="ingroups"><a class="el" href="group___turbo_j_p_e_g.html">TurboJPEG</a></div></div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<!-- doxytag: class="tjregion" -->
|
||||
<p>Cropping region.
|
||||
<a href="structtjregion.html#details">More...</a></p>
|
||||
|
||||
<p><code>#include <turbojpeg.h></code></p>
|
||||
<table class="memberdecls">
|
||||
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjregion.html#a4b6a37a93997091b26a75831fa291ad9">x</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The left boundary of the cropping region. <a href="#a4b6a37a93997091b26a75831fa291ad9"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2">y</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The upper boundary of the cropping region. <a href="#a7b3e0c24cfe87acc80e334cafdcf22c2"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42">w</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The width of the cropping region. <a href="#ab6eb73ceef584fc23c8c8097926dce42"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115">h</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The height of the cropping region. <a href="#aecefc45a26f4d8b60dd4d825c1710115"></a><br/></td></tr>
|
||||
</table>
|
||||
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
|
||||
<div class="textblock"><p>Cropping region. </p>
|
||||
</div><hr/><h2>Field Documentation</h2>
|
||||
<a class="anchor" id="aecefc45a26f4d8b60dd4d825c1710115"></a><!-- doxytag: member="tjregion::h" ref="aecefc45a26f4d8b60dd4d825c1710115" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115">tjregion::h</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>The height of the cropping region. </p>
|
||||
<p>Setting this to 0 is the equivalent of setting it to the height of the source JPEG image - y. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ab6eb73ceef584fc23c8c8097926dce42"></a><!-- doxytag: member="tjregion::w" ref="ab6eb73ceef584fc23c8c8097926dce42" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42">tjregion::w</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>The width of the cropping region. </p>
|
||||
<p>Setting this to 0 is the equivalent of setting it to the width of the source JPEG image - x. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a4b6a37a93997091b26a75831fa291ad9"></a><!-- doxytag: member="tjregion::x" ref="a4b6a37a93997091b26a75831fa291ad9" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjregion.html#a4b6a37a93997091b26a75831fa291ad9">tjregion::x</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>The left boundary of the cropping region. </p>
|
||||
<p>This must be evenly divisible by the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>.) </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a7b3e0c24cfe87acc80e334cafdcf22c2"></a><!-- doxytag: member="tjregion::y" ref="a7b3e0c24cfe87acc80e334cafdcf22c2" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2">tjregion::y</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>The upper boundary of the cropping region. </p>
|
||||
<p>This must be evenly divisible by the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li>turbojpeg.h</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
134
doc/html/structtjscalingfactor.html
Normal file
@@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: tjscalingfactor Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">tjscalingfactor Struct Reference<div class="ingroups"><a class="el" href="group___turbo_j_p_e_g.html">TurboJPEG</a></div></div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<!-- doxytag: class="tjscalingfactor" -->
|
||||
<p>Scaling factor.
|
||||
<a href="structtjscalingfactor.html#details">More...</a></p>
|
||||
|
||||
<p><code>#include <turbojpeg.h></code></p>
|
||||
<table class="memberdecls">
|
||||
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec">num</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Numerator. <a href="#a9b011e57f981ee23083e2c1aa5e640ec"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3">denom</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Denominator. <a href="#aefbcdf3e9e62274b2d312c695f133ce3"></a><br/></td></tr>
|
||||
</table>
|
||||
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
|
||||
<div class="textblock"><p>Scaling factor. </p>
|
||||
</div><hr/><h2>Field Documentation</h2>
|
||||
<a class="anchor" id="aefbcdf3e9e62274b2d312c695f133ce3"></a><!-- doxytag: member="tjscalingfactor::denom" ref="aefbcdf3e9e62274b2d312c695f133ce3" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3">tjscalingfactor::denom</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>Denominator. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a9b011e57f981ee23083e2c1aa5e640ec"></a><!-- doxytag: member="tjscalingfactor::num" ref="a9b011e57f981ee23083e2c1aa5e640ec" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec">tjscalingfactor::num</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>Numerator. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li>turbojpeg.h</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
198
doc/html/structtjtransform.html
Normal file
@@ -0,0 +1,198 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>TurboJPEG: tjtransform Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<!-- Generated by Doxygen 1.7.4 -->
|
||||
<script type="text/javascript"><!--
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
--></script>
|
||||
<div id="top">
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG <span id="projectnumber">1.2.1</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li id="searchli">
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
|
||||
<li><a href="functions.html"><span>Data Fields</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">tjtransform Struct Reference<div class="ingroups"><a class="el" href="group___turbo_j_p_e_g.html">TurboJPEG</a></div></div> </div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<!-- doxytag: class="tjtransform" -->
|
||||
<p>Lossless transform.
|
||||
<a href="structtjtransform.html#details">More...</a></p>
|
||||
|
||||
<p><code>#include <turbojpeg.h></code></p>
|
||||
<table class="memberdecls">
|
||||
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structtjregion.html">tjregion</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf">r</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Cropping region. <a href="#ac324e5e442abec8a961e5bf219db12cf"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498">op</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">One of the <a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">transform operations</a>. <a href="#a2525aab4ba6978a1c273f74fef50e498"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6">options</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The bitwise OR of one of more of the <a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">transform options</a>. <a href="#ac0e74655baa4402209a21e1ae481c8f6"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3">data</a></td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Arbitrary data that can be accessed within the body of the callback function. <a href="#a688fe8f1a8ecc12a538d9e561cf338e3"></a><br/></td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1">customFilter</a> )(short *coeffs, <a class="el" href="structtjregion.html">tjregion</a> arrayRegion, <a class="el" href="structtjregion.html">tjregion</a> planeRegion, int componentIndex, int transformIndex, struct <a class="el" href="structtjtransform.html">tjtransform</a> *transform)</td></tr>
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG file. <a href="#a43ee1bcdd2a8d7249a756774f78793c1"></a><br/></td></tr>
|
||||
</table>
|
||||
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
|
||||
<div class="textblock"><p>Lossless transform. </p>
|
||||
</div><hr/><h2>Field Documentation</h2>
|
||||
<a class="anchor" id="a43ee1bcdd2a8d7249a756774f78793c1"></a><!-- doxytag: member="tjtransform::customFilter" ref="a43ee1bcdd2a8d7249a756774f78793c1" args=")(short *coeffs, tjregion arrayRegion, tjregion planeRegion, int componentIndex, int transformIndex, struct tjtransform *transform)" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int(* <a class="el" href="structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1">tjtransform::customFilter</a>)(short *coeffs, <a class="el" href="structtjregion.html">tjregion</a> arrayRegion, <a class="el" href="structtjregion.html">tjregion</a> planeRegion, int componentIndex, int transformIndex, struct <a class="el" href="structtjtransform.html">tjtransform</a> *transform)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG file. </p>
|
||||
<p>This allows for custom filters or other transformations to be applied in the frequency domain.</p>
|
||||
<dl><dt><b>Parameters:</b></dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">coeffs</td><td>pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.) </td></tr>
|
||||
<tr><td class="paramname">arrayRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the array pointed to by <code>coeffs</code> as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array. </td></tr>
|
||||
<tr><td class="paramname">planeRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the component plane to which <code>coeffs</code> belongs </td></tr>
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the component plane to which <code>coeffs</code> belongs (Y, U, and V have, respectively, ID's of 0, 1, and 2 in typical JPEG images.) </td></tr>
|
||||
<tr><td class="paramname">transformID</td><td>ID number of the transformed image to which <code>coeffs</code> belongs. This is the same as the index of the transform in the <code>transforms</code> array that was passed to <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>. </td></tr>
|
||||
<tr><td class="paramname">transform</td><td>a pointer to a <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structure that specifies the parameters and/or cropping region for this transform</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the callback was successful, or -1 if an error occurred. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a688fe8f1a8ecc12a538d9e561cf338e3"></a><!-- doxytag: member="tjtransform::data" ref="a688fe8f1a8ecc12a538d9e561cf338e3" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void* <a class="el" href="structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3">tjtransform::data</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>Arbitrary data that can be accessed within the body of the callback function. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a2525aab4ba6978a1c273f74fef50e498"></a><!-- doxytag: member="tjtransform::op" ref="a2525aab4ba6978a1c273f74fef50e498" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498">tjtransform::op</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>One of the <a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">transform operations</a>. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ac0e74655baa4402209a21e1ae481c8f6"></a><!-- doxytag: member="tjtransform::options" ref="ac0e74655baa4402209a21e1ae481c8f6" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int <a class="el" href="structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6">tjtransform::options</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>The bitwise OR of one of more of the <a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">transform options</a>. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ac324e5e442abec8a961e5bf219db12cf"></a><!-- doxytag: member="tjtransform::r" ref="ac324e5e442abec8a961e5bf219db12cf" args="" -->
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="structtjregion.html">tjregion</a> <a class="el" href="structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf">tjtransform::r</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="memdoc">
|
||||
|
||||
<p>Cropping region. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li>turbojpeg.h</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Variables</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
doc/html/tab_a.png
Normal file
|
After Width: | Height: | Size: 140 B |
BIN
doc/html/tab_b.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
doc/html/tab_h.png
Normal file
|
After Width: | Height: | Size: 192 B |
BIN
doc/html/tab_s.png
Normal file
|
After Width: | Height: | Size: 189 B |
59
doc/html/tabs.css
Normal file
@@ -0,0 +1,59 @@
|
||||
.tabs, .tabs2, .tabs3 {
|
||||
background-image: url('tab_b.png');
|
||||
width: 100%;
|
||||
z-index: 101;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.tabs2 {
|
||||
font-size: 10px;
|
||||
}
|
||||
.tabs3 {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.tablist {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.tablist li {
|
||||
float: left;
|
||||
display: table-cell;
|
||||
background-image: url('tab_b.png');
|
||||
line-height: 36px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.tablist a {
|
||||
display: block;
|
||||
padding: 0 20px;
|
||||
font-weight: bold;
|
||||
background-image:url('tab_s.png');
|
||||
background-repeat:no-repeat;
|
||||
background-position:right;
|
||||
color: #283A5D;
|
||||
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.tabs3 .tablist a {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.tablist a:hover {
|
||||
background-image: url('tab_h.png');
|
||||
background-repeat:repeat-x;
|
||||
color: #fff;
|
||||
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tablist li.current a {
|
||||
background-image: url('tab_a.png');
|
||||
background-repeat:repeat-x;
|
||||
color: #fff;
|
||||
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
|
||||
}
|
||||
14
doxygen.config
Normal file
@@ -0,0 +1,14 @@
|
||||
PROJECT_NAME = TurboJPEG
|
||||
PROJECT_NUMBER = 1.2.1
|
||||
OUTPUT_DIRECTORY = doc/
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
WARN_NO_PARAMDOC = YES
|
||||
GENERATE_LATEX = NO
|
||||
FILE_PATTERNS = turbojpeg.h
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
VERBATIM_HEADERS = NO
|
||||
EXTRACT_STATIC = YES
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MAX_INITIALIZER_LINES = 0
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
842
example.c
@@ -1,31 +1,29 @@
|
||||
/*
|
||||
* example.c
|
||||
*
|
||||
* This file is not actually part of the JPEG software. Rather, it provides
|
||||
* a skeleton that may be useful for constructing applications that use the
|
||||
* JPEG software as subroutines. This code will NOT do anything useful as is.
|
||||
* This file illustrates how to use the IJG code as a subroutine library
|
||||
* to read or write JPEG image files. You should look at this code in
|
||||
* conjunction with the documentation file libjpeg.txt.
|
||||
*
|
||||
* This file illustrates how to use the JPEG code as a subroutine library
|
||||
* to read or write JPEG image files. We assume here that you are not
|
||||
* merely interested in converting the image to yet another image file format
|
||||
* (if you are, you should be adding another I/O module to cjpeg/djpeg, not
|
||||
* constructing a new application). Instead, we show how to pass the
|
||||
* decompressed image data into or out of routines that you provide. For
|
||||
* example, a viewer program might use the JPEG decompressor together with
|
||||
* routines that write the decompressed image directly to a display.
|
||||
* This code will not do anything useful as-is, but it may be helpful as a
|
||||
* skeleton for constructing routines that call the JPEG library.
|
||||
*
|
||||
* We present these routines in the same coding style used in the JPEG code
|
||||
* (ANSI function definitions, etc); but you are of course free to code your
|
||||
* routines in a different style if you prefer.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* Include file for declaring JPEG data structures.
|
||||
* This file also includes some system headers like <stdio.h>;
|
||||
* if you prefer, you can include "jconfig.h" and "jpegdata.h" instead.
|
||||
* Include file for users of JPEG library.
|
||||
* You will need to have included system headers that define at least
|
||||
* the typedefs FILE and size_t before you can include jpeglib.h.
|
||||
* (stdio.h is sufficient on ANSI-conforming systems.)
|
||||
* You may also wish to include "jerror.h".
|
||||
*/
|
||||
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
/*
|
||||
* <setjmp.h> is used for the optional error recovery mechanism shown in
|
||||
@@ -45,587 +43,391 @@
|
||||
|
||||
|
||||
/*
|
||||
* To supply the image data for compression, you must define three routines
|
||||
* input_init, get_input_row, and input_term. These routines will be called
|
||||
* from the JPEG compressor via function pointer values that you store in the
|
||||
* cinfo data structure; hence they need not be globally visible and the exact
|
||||
* names don't matter. (In fact, the "METHODDEF" macro expands to "static" if
|
||||
* you use the unmodified JPEG include files.)
|
||||
* IMAGE DATA FORMATS:
|
||||
*
|
||||
* The input file reading modules (jrdppm.c, jrdgif.c, jrdtarga.c, etc) may be
|
||||
* useful examples of what these routines should actually do, although each of
|
||||
* them is encrusted with a lot of specialized code for its own file format.
|
||||
* The standard input image format is a rectangular array of pixels, with
|
||||
* each pixel having the same number of "component" values (color channels).
|
||||
* Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).
|
||||
* If you are working with color data, then the color values for each pixel
|
||||
* must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit
|
||||
* RGB color.
|
||||
*
|
||||
* For this example, we'll assume that this data structure matches the way
|
||||
* our application has stored the image in memory, so we can just pass a
|
||||
* pointer to our image buffer. In particular, let's say that the image is
|
||||
* RGB color and is described by:
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF void
|
||||
input_init (compress_info_ptr cinfo)
|
||||
/* Initialize for input; return image size and component data. */
|
||||
{
|
||||
/* This routine must return five pieces of information about the incoming
|
||||
* image, and must do any setup needed for the get_input_row routine.
|
||||
* The image information is returned in fields of the cinfo struct.
|
||||
* (If you don't care about modularity, you could initialize these fields
|
||||
* in the main JPEG calling routine, and make this routine be a no-op.)
|
||||
* We show some example values here.
|
||||
*/
|
||||
cinfo->image_width = 640; /* width in pixels */
|
||||
cinfo->image_height = 480; /* height in pixels */
|
||||
/* JPEG views an image as being a rectangular array of pixels, with each
|
||||
* pixel having the same number of "component" values (color channels).
|
||||
* You must specify how many components there are and the colorspace
|
||||
* interpretation of the components. Most applications will use RGB data or
|
||||
* grayscale data. If you want to use something else, you'll need to study
|
||||
* and perhaps modify jcdeflts.c, jccolor.c, and jdcolor.c.
|
||||
*/
|
||||
cinfo->input_components = 3; /* or 1 for grayscale */
|
||||
cinfo->in_color_space = CS_RGB; /* or CS_GRAYSCALE for grayscale */
|
||||
cinfo->data_precision = 8; /* bits per pixel component value */
|
||||
/* In the current JPEG software, data_precision must be set equal to
|
||||
* BITS_IN_JSAMPLE, which is 8 unless you twiddle jconfig.h. Future
|
||||
* versions might allow you to say either 8 or 12 if compiled with
|
||||
* 12-bit JSAMPLEs, or up to 16 in lossless mode. In any case,
|
||||
* it is up to you to scale incoming pixel values to the range
|
||||
* 0 .. (1<<data_precision)-1.
|
||||
* If your image data format is fixed at a byte per component,
|
||||
* then saying "8" is probably the best long-term solution.
|
||||
*/
|
||||
}
|
||||
extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */
|
||||
extern int image_height; /* Number of rows in image */
|
||||
extern int image_width; /* Number of columns in image */
|
||||
|
||||
|
||||
/*
|
||||
* This function is called repeatedly and must supply the next row of pixels
|
||||
* on each call. The rows MUST be returned in top-to-bottom order if you want
|
||||
* your JPEG files to be compatible with everyone else's. (If you cannot
|
||||
* readily read your data in that order, you'll need an intermediate array to
|
||||
* hold the image. See jrdtarga.c or jrdrle.c for examples of handling
|
||||
* bottom-to-top source data using the JPEG code's portable mechanisms.)
|
||||
* The data is to be returned into a 2-D array of JSAMPLEs, indexed as
|
||||
* JSAMPLE pixel_row[component][column]
|
||||
* where component runs from 0 to cinfo->input_components-1, and column runs
|
||||
* from 0 to cinfo->image_width-1 (column 0 is left edge of image). Note that
|
||||
* this is actually an array of pointers to arrays rather than a true 2D array,
|
||||
* since C does not support variable-size multidimensional arrays.
|
||||
* JSAMPLE is typically typedef'd as "unsigned char".
|
||||
* Sample routine for JPEG compression. We assume that the target file name
|
||||
* and a compression quality factor are passed in.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF void
|
||||
get_input_row (compress_info_ptr cinfo, JSAMPARRAY pixel_row)
|
||||
/* Read next row of pixels into pixel_row[][] */
|
||||
GLOBAL(void)
|
||||
write_JPEG_file (char * filename, int quality)
|
||||
{
|
||||
/* This example shows how you might read RGB data (3 components)
|
||||
* from an input file in which the data is stored 3 bytes per pixel
|
||||
* in left-to-right, top-to-bottom order.
|
||||
/* This struct contains the JPEG compression parameters and pointers to
|
||||
* working space (which is allocated as needed by the JPEG library).
|
||||
* It is possible to have several such structures, representing multiple
|
||||
* compression/decompression processes, in existence at once. We refer
|
||||
* to any one struct (and its associated working data) as a "JPEG object".
|
||||
*/
|
||||
register FILE * infile = cinfo->input_file;
|
||||
register JSAMPROW ptr0, ptr1, ptr2;
|
||||
register long col;
|
||||
|
||||
ptr0 = pixel_row[0];
|
||||
ptr1 = pixel_row[1];
|
||||
ptr2 = pixel_row[2];
|
||||
for (col = 0; col < cinfo->image_width; col++) {
|
||||
*ptr0++ = (JSAMPLE) getc(infile); /* red */
|
||||
*ptr1++ = (JSAMPLE) getc(infile); /* green */
|
||||
*ptr2++ = (JSAMPLE) getc(infile); /* blue */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF void
|
||||
input_term (compress_info_ptr cinfo)
|
||||
/* Finish up at the end of the input */
|
||||
{
|
||||
/* This termination routine will very often have no work to do, */
|
||||
/* but you must provide it anyway. */
|
||||
/* Note that the JPEG code will only call it during successful exit; */
|
||||
/* if you want it called during error exit, you gotta do that yourself. */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* That's it for the routines that deal with reading the input image data.
|
||||
* Now we have overall control and parameter selection routines.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This routine must determine what output JPEG file format is to be written,
|
||||
* and make any other compression parameter changes that are desirable.
|
||||
* This routine gets control after the input file header has been read
|
||||
* (i.e., right after input_init has been called). You could combine its
|
||||
* functions into input_init, or even into the main control routine, but
|
||||
* if you have several different input_init routines, it's a definite win
|
||||
* to keep this separate. You MUST supply this routine even if it's a no-op.
|
||||
*/
|
||||
|
||||
METHODDEF void
|
||||
c_ui_method_selection (compress_info_ptr cinfo)
|
||||
{
|
||||
/* If the input is gray scale, generate a monochrome JPEG file. */
|
||||
if (cinfo->in_color_space == CS_GRAYSCALE)
|
||||
j_monochrome_default(cinfo);
|
||||
/* For now, always select JFIF output format. */
|
||||
jselwjfif(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* OK, here is the main function that actually causes everything to happen.
|
||||
* We assume here that the target filename is supplied by the caller of this
|
||||
* routine, and that all JPEG compression parameters can be default values.
|
||||
*/
|
||||
|
||||
GLOBAL void
|
||||
write_JPEG_file (char * filename)
|
||||
{
|
||||
/* These three structs contain JPEG parameters and working data.
|
||||
* They must survive for the duration of parameter setup and one
|
||||
* call to jpeg_compress; typically, making them local data in the
|
||||
* calling routine is the best strategy.
|
||||
struct jpeg_compress_struct cinfo;
|
||||
/* This struct represents a JPEG error handler. It is declared separately
|
||||
* because applications often want to supply a specialized error handler
|
||||
* (see the second half of this file for an example). But here we just
|
||||
* take the easy way out and use the standard error handler, which will
|
||||
* print a message on stderr and call exit() if compression fails.
|
||||
* Note that this struct must live as long as the main JPEG parameter
|
||||
* struct, to avoid dangling-pointer problems.
|
||||
*/
|
||||
struct Compress_info_struct cinfo;
|
||||
struct Compress_methods_struct c_methods;
|
||||
struct External_methods_struct e_methods;
|
||||
struct jpeg_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * outfile; /* target file */
|
||||
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
|
||||
int row_stride; /* physical row width in image buffer */
|
||||
|
||||
/* Initialize the system-dependent method pointers. */
|
||||
cinfo.methods = &c_methods; /* links to method structs */
|
||||
cinfo.emethods = &e_methods;
|
||||
/* Here we use the default JPEG error handler, which will just print
|
||||
* an error message on stderr and call exit(). See the second half of
|
||||
* this file for an example of more graceful error recovery.
|
||||
*/
|
||||
jselerror(&e_methods); /* select std error/trace message routines */
|
||||
/* Here we use the standard memory manager provided with the JPEG code.
|
||||
* In some cases you might want to replace the memory manager, or at
|
||||
* least the system-dependent part of it, with your own code.
|
||||
*/
|
||||
jselmemmgr(&e_methods); /* select std memory allocation routines */
|
||||
/* If the compressor requires full-image buffers (for entropy-coding
|
||||
* optimization or a noninterleaved JPEG file), it will create temporary
|
||||
* files for anything that doesn't fit within the maximum-memory setting.
|
||||
* (Note that temp files are NOT needed if you use the default parameters.)
|
||||
* You can change the default maximum-memory setting by changing
|
||||
* e_methods.max_memory_to_use after jselmemmgr returns.
|
||||
* On some systems you may also need to set up a signal handler to
|
||||
* ensure that temporary files are deleted if the program is interrupted.
|
||||
* (This is most important if you are on MS-DOS and use the jmemdos.c
|
||||
* memory manager back end; it will try to grab extended memory for
|
||||
* temp files, and that space will NOT be freed automatically.)
|
||||
* See jcmain.c or jdmain.c for an example signal handler.
|
||||
*/
|
||||
/* Step 1: allocate and initialize JPEG compression object */
|
||||
|
||||
/* Here, set up pointers to your own routines for input data handling
|
||||
* and post-init parameter selection.
|
||||
/* We have to set up the error handler first, in case the initialization
|
||||
* step fails. (Unlikely, but it could happen if you are out of memory.)
|
||||
* This routine fills in the contents of struct jerr, and returns jerr's
|
||||
* address which we place into the link field in cinfo.
|
||||
*/
|
||||
c_methods.input_init = input_init;
|
||||
c_methods.get_input_row = get_input_row;
|
||||
c_methods.input_term = input_term;
|
||||
c_methods.c_ui_method_selection = c_ui_method_selection;
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
/* Now we can initialize the JPEG compression object. */
|
||||
jpeg_create_compress(&cinfo);
|
||||
|
||||
/* Set up default JPEG parameters in the cinfo data structure. */
|
||||
j_c_defaults(&cinfo, 75, FALSE);
|
||||
/* Note: 75 is the recommended default quality level; you may instead pass
|
||||
* a user-specified quality level. Be aware that values below 25 will cause
|
||||
* non-baseline JPEG files to be created (and a warning message to that
|
||||
* effect to be emitted on stderr). This won't bother our decoder, but some
|
||||
* commercial JPEG implementations may choke on non-baseline JPEG files.
|
||||
* If you want to force baseline compatibility, pass TRUE instead of FALSE.
|
||||
* (If non-baseline files are fine, but you could do without that warning
|
||||
* message, set e_methods.trace_level to -1.)
|
||||
*/
|
||||
/* Step 2: specify data destination (eg, a file) */
|
||||
/* Note: steps 2 and 3 can be done in either order. */
|
||||
|
||||
/* At this point you can modify the default parameters set by j_c_defaults
|
||||
* as needed. For a minimal implementation, you shouldn't need to change
|
||||
* anything. See jcmain.c for some examples of what you might change.
|
||||
*/
|
||||
|
||||
/* Select the input and output files.
|
||||
* Note that cinfo.input_file is only used if your input reading routines
|
||||
* use it; otherwise, you can just make it NULL.
|
||||
/* Here we use the library-supplied code to send compressed data to a
|
||||
* stdio stream. You can also write your own code to do something else.
|
||||
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
|
||||
* requires it in order to write binary files.
|
||||
*/
|
||||
|
||||
cinfo.input_file = NULL; /* if no actual input file involved */
|
||||
|
||||
if ((cinfo.output_file = fopen(filename, "wb")) == NULL) {
|
||||
if ((outfile = fopen(filename, "wb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
jpeg_stdio_dest(&cinfo, outfile);
|
||||
|
||||
/* Here we go! */
|
||||
jpeg_compress(&cinfo);
|
||||
/* Step 3: set parameters for compression */
|
||||
|
||||
/* That's it, son. Nothin' else to do, except close files. */
|
||||
/* Here we assume only the output file need be closed. */
|
||||
fclose(cinfo.output_file);
|
||||
|
||||
/* Note: if you want to compress more than one image, we recommend you
|
||||
* repeat this whole routine. You MUST repeat the j_c_defaults()/alter
|
||||
* parameters/jpeg_compress() sequence, as some data structures allocated
|
||||
* in j_c_defaults are freed upon exit from jpeg_compress.
|
||||
/* First we supply a description of the input image.
|
||||
* Four fields of the cinfo struct must be filled in:
|
||||
*/
|
||||
cinfo.image_width = image_width; /* image width and height, in pixels */
|
||||
cinfo.image_height = image_height;
|
||||
cinfo.input_components = 3; /* # of color components per pixel */
|
||||
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
|
||||
/* Now use the library's routine to set default compression parameters.
|
||||
* (You must set at least cinfo.in_color_space before calling this,
|
||||
* since the defaults depend on the source color space.)
|
||||
*/
|
||||
jpeg_set_defaults(&cinfo);
|
||||
/* Now you can set any non-default parameters you wish to.
|
||||
* Here we just illustrate the use of quality (quantization table) scaling:
|
||||
*/
|
||||
jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
|
||||
|
||||
/* Step 4: Start compressor */
|
||||
|
||||
/* TRUE ensures that we will write a complete interchange-JPEG file.
|
||||
* Pass TRUE unless you are very sure of what you're doing.
|
||||
*/
|
||||
jpeg_start_compress(&cinfo, TRUE);
|
||||
|
||||
/* Step 5: while (scan lines remain to be written) */
|
||||
/* jpeg_write_scanlines(...); */
|
||||
|
||||
/* Here we use the library's state variable cinfo.next_scanline as the
|
||||
* loop counter, so that we don't have to keep track ourselves.
|
||||
* To keep things simple, we pass one scanline per call; you can pass
|
||||
* more if you wish, though.
|
||||
*/
|
||||
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
|
||||
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
/* jpeg_write_scanlines expects an array of pointers to scanlines.
|
||||
* Here the array is only one element long, but you could pass
|
||||
* more than one scanline at a time if that's more convenient.
|
||||
*/
|
||||
row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
|
||||
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
|
||||
}
|
||||
|
||||
/* Step 6: Finish compression */
|
||||
|
||||
jpeg_finish_compress(&cinfo);
|
||||
/* After finish_compress, we can close the output file. */
|
||||
fclose(outfile);
|
||||
|
||||
/* Step 7: release JPEG compression object */
|
||||
|
||||
/* This is an important step since it will release a good deal of memory. */
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
|
||||
/* And we're done! */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SOME FINE POINTS:
|
||||
*
|
||||
* In the above loop, we ignored the return value of jpeg_write_scanlines,
|
||||
* which is the number of scanlines actually written. We could get away
|
||||
* with this because we were only relying on the value of cinfo.next_scanline,
|
||||
* which will be incremented correctly. If you maintain additional loop
|
||||
* variables then you should be careful to increment them properly.
|
||||
* Actually, for output to a stdio stream you needn't worry, because
|
||||
* then jpeg_write_scanlines will write all the lines passed (or else exit
|
||||
* with a fatal error). Partial writes can only occur if you use a data
|
||||
* destination module that can demand suspension of the compressor.
|
||||
* (If you don't know what that's for, you don't need it.)
|
||||
*
|
||||
* If the compressor requires full-image buffers (for entropy-coding
|
||||
* optimization or a multi-scan JPEG file), it will create temporary
|
||||
* files for anything that doesn't fit within the maximum-memory setting.
|
||||
* (Note that temp files are NOT needed if you use the default parameters.)
|
||||
* On some systems you may need to set up a signal handler to ensure that
|
||||
* temporary files are deleted if the program is interrupted. See libjpeg.txt.
|
||||
*
|
||||
* Scanlines MUST be supplied in top-to-bottom order if you want your JPEG
|
||||
* files to be compatible with everyone else's. If you cannot readily read
|
||||
* your data in that order, you'll need an intermediate array to hold the
|
||||
* image. See rdtarga.c or rdbmp.c for examples of handling bottom-to-top
|
||||
* source data using the JPEG code's internal virtual-array mechanisms.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/
|
||||
|
||||
/* This half of the example shows how to read data from the JPEG decompressor.
|
||||
* It's a little more refined than the above in that we show how to do your
|
||||
* own error recovery. If you don't care about that, you don't need these
|
||||
* next two routines.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* These routines replace the default trace/error routines included with the
|
||||
* JPEG code. The example trace_message routine shown here is actually the
|
||||
* same as the standard one, but you could modify it if you don't want messages
|
||||
* sent to stderr. The example error_exit routine is set up to return
|
||||
* control to read_JPEG_file() rather than calling exit(). You can use the
|
||||
* same routines for both compression and decompression error recovery.
|
||||
*/
|
||||
|
||||
/* These static variables are needed by the error routines. */
|
||||
static jmp_buf setjmp_buffer; /* for return to caller */
|
||||
static external_methods_ptr emethods; /* needed for access to message_parm */
|
||||
|
||||
|
||||
/* This routine is used for any and all trace, debug, or error printouts
|
||||
* from the JPEG code. The parameter is a printf format string; up to 8
|
||||
* integer data values for the format string have been stored in the
|
||||
* message_parm[] field of the external_methods struct.
|
||||
*/
|
||||
|
||||
METHODDEF void
|
||||
trace_message (const char *msgtext)
|
||||
{
|
||||
fprintf(stderr, msgtext,
|
||||
emethods->message_parm[0], emethods->message_parm[1],
|
||||
emethods->message_parm[2], emethods->message_parm[3],
|
||||
emethods->message_parm[4], emethods->message_parm[5],
|
||||
emethods->message_parm[6], emethods->message_parm[7]);
|
||||
fprintf(stderr, "\n"); /* there is no \n in the format string! */
|
||||
}
|
||||
|
||||
/*
|
||||
* The error_exit() routine should not return to its caller. The default
|
||||
* routine calls exit(), but here we assume that we want to return to
|
||||
* read_JPEG_file, which has set up a setjmp context for the purpose.
|
||||
* You should make sure that the free_all method is called, either within
|
||||
* error_exit or after the return to the outer-level routine.
|
||||
*/
|
||||
|
||||
METHODDEF void
|
||||
error_exit (const char *msgtext)
|
||||
{
|
||||
trace_message(msgtext); /* report the error message */
|
||||
(*emethods->free_all) (); /* clean up memory allocation & temp files */
|
||||
longjmp(setjmp_buffer, 1); /* return control to outer routine */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* To accept the image data from decompression, you must define four routines
|
||||
* output_init, put_color_map, put_pixel_rows, and output_term.
|
||||
* It's a bit more refined than the above, in that we show:
|
||||
* (a) how to modify the JPEG library's standard error-reporting behavior;
|
||||
* (b) how to allocate workspace using the library's memory manager.
|
||||
*
|
||||
* You must understand the distinction between full color output mode
|
||||
* (N independent color components) and colormapped output mode (a single
|
||||
* output component representing an index into a color map). You should use
|
||||
* colormapped mode to write to a colormapped display screen or output file.
|
||||
* Colormapped mode is also useful for reducing grayscale output to a small
|
||||
* number of gray levels: when using the 1-pass quantizer on grayscale data,
|
||||
* the colormap entries will be evenly spaced from 0 to MAX_JSAMPLE, so you
|
||||
* can regard the indexes as directly representing gray levels at reduced
|
||||
* precision. In any other case, you should not depend on the colormap
|
||||
* entries having any particular order.
|
||||
* To get colormapped output, set cinfo->quantize_colors to TRUE and set
|
||||
* cinfo->desired_number_of_colors to the maximum number of entries in the
|
||||
* colormap. This can be done either in your main routine or in
|
||||
* d_ui_method_selection. For grayscale quantization, also set
|
||||
* cinfo->two_pass_quantize to FALSE to ensure the 1-pass quantizer is used
|
||||
* (presently this is the default, but it may not be so in the future).
|
||||
*
|
||||
* The output file writing modules (jwrppm.c, jwrgif.c, jwrtarga.c, etc) may be
|
||||
* useful examples of what these routines should actually do, although each of
|
||||
* them is encrusted with a lot of specialized code for its own file format.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF void
|
||||
output_init (decompress_info_ptr cinfo)
|
||||
/* This routine should do any setup required */
|
||||
{
|
||||
/* This routine can initialize for output based on the data passed in cinfo.
|
||||
* Useful fields include:
|
||||
* image_width, image_height Pretty obvious, I hope.
|
||||
* data_precision bits per pixel value; typically 8.
|
||||
* out_color_space output colorspace previously requested
|
||||
* color_out_comps number of color components in same
|
||||
* final_out_comps number of components actually output
|
||||
* final_out_comps is 1 if quantize_colors is true, else it is equal to
|
||||
* color_out_comps.
|
||||
*
|
||||
* If you have requested color quantization, the colormap is NOT yet set.
|
||||
* You may wish to defer output initialization until put_color_map is called.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine is called if and only if you have set cinfo->quantize_colors
|
||||
* to TRUE. It is given the selected colormap and can complete any required
|
||||
* initialization. This call will occur after output_init and before any
|
||||
* calls to put_pixel_rows. Note that the colormap pointer is also placed
|
||||
* in a cinfo field, whence it can be used by put_pixel_rows or output_term.
|
||||
* num_colors will be less than or equal to desired_number_of_colors.
|
||||
*
|
||||
* The colormap data is supplied as a 2-D array of JSAMPLEs, indexed as
|
||||
* JSAMPLE colormap[component][indexvalue]
|
||||
* where component runs from 0 to cinfo->color_out_comps-1, and indexvalue
|
||||
* runs from 0 to num_colors-1. Note that this is actually an array of
|
||||
* pointers to arrays rather than a true 2D array, since C does not support
|
||||
* variable-size multidimensional arrays.
|
||||
* JSAMPLE is typically typedef'd as "unsigned char". If you want your code
|
||||
* to be as portable as the JPEG code proper, you should always access JSAMPLE
|
||||
* values with the GETJSAMPLE() macro, which will do the right thing if the
|
||||
* machine has only signed chars.
|
||||
*/
|
||||
|
||||
METHODDEF void
|
||||
put_color_map (decompress_info_ptr cinfo, int num_colors, JSAMPARRAY colormap)
|
||||
/* Write the color map */
|
||||
{
|
||||
/* You need not provide this routine if you always set cinfo->quantize_colors
|
||||
* FALSE; but a safer practice is to provide it and have it just print an
|
||||
* error message, like this:
|
||||
*/
|
||||
fprintf(stderr, "put_color_map called: there's a bug here somewhere!\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This function is called repeatedly, with a few more rows of pixels supplied
|
||||
* on each call. With the current JPEG code, some multiple of 8 rows will be
|
||||
* passed on each call except the last, but it is extremely bad form to depend
|
||||
* on this. You CAN assume num_rows > 0.
|
||||
* The data is supplied in top-to-bottom row order (the standard order within
|
||||
* a JPEG file). If you cannot readily use the data in that order, you'll
|
||||
* need an intermediate array to hold the image. See jwrrle.c for an example
|
||||
* of outputting data in bottom-to-top order.
|
||||
*
|
||||
* The data is supplied as a 3-D array of JSAMPLEs, indexed as
|
||||
* JSAMPLE pixel_data[component][row][column]
|
||||
* where component runs from 0 to cinfo->final_out_comps-1, row runs from 0 to
|
||||
* num_rows-1, and column runs from 0 to cinfo->image_width-1 (column 0 is
|
||||
* left edge of image). Note that this is actually an array of pointers to
|
||||
* pointers to arrays rather than a true 3D array, since C does not support
|
||||
* variable-size multidimensional arrays.
|
||||
* JSAMPLE is typically typedef'd as "unsigned char". If you want your code
|
||||
* to be as portable as the JPEG code proper, you should always access JSAMPLE
|
||||
* values with the GETJSAMPLE() macro, which will do the right thing if the
|
||||
* machine has only signed chars.
|
||||
*
|
||||
* If quantize_colors is true, then there is only one component, and its values
|
||||
* are indexes into the previously supplied colormap. Otherwise the values
|
||||
* are actual data in your selected output colorspace.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF void
|
||||
put_pixel_rows (decompress_info_ptr cinfo, int num_rows, JSAMPIMAGE pixel_data)
|
||||
/* Write some rows of output data */
|
||||
{
|
||||
/* This example shows how you might write full-color RGB data (3 components)
|
||||
* to an output file in which the data is stored 3 bytes per pixel.
|
||||
*/
|
||||
register FILE * outfile = cinfo->output_file;
|
||||
register JSAMPROW ptr0, ptr1, ptr2;
|
||||
register long col;
|
||||
register int row;
|
||||
|
||||
for (row = 0; row < num_rows; row++) {
|
||||
ptr0 = pixel_data[0][row];
|
||||
ptr1 = pixel_data[1][row];
|
||||
ptr2 = pixel_data[2][row];
|
||||
for (col = 0; col < cinfo->image_width; col++) {
|
||||
putc(GETJSAMPLE(*ptr0), outfile); /* red */
|
||||
ptr0++;
|
||||
putc(GETJSAMPLE(*ptr1), outfile); /* green */
|
||||
ptr1++;
|
||||
putc(GETJSAMPLE(*ptr2), outfile); /* blue */
|
||||
ptr2++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF void
|
||||
output_term (decompress_info_ptr cinfo)
|
||||
/* Finish up at the end of the output */
|
||||
{
|
||||
/* This termination routine may not need to do anything. */
|
||||
/* Note that the JPEG code will only call it during successful exit; */
|
||||
/* if you want it called during error exit, you gotta do that yourself. */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* That's it for the routines that deal with writing the output image.
|
||||
* Now we have overall control and parameter selection routines.
|
||||
* Just to make this example a little different from the first one, we'll
|
||||
* assume that we do not intend to put the whole image into an in-memory
|
||||
* buffer, but to send it line-by-line someplace else. We need a one-
|
||||
* scanline-high JSAMPLE array as a work buffer, and we will let the JPEG
|
||||
* memory manager allocate it for us. This approach is actually quite useful
|
||||
* because we don't need to remember to deallocate the buffer separately: it
|
||||
* will go away automatically when the JPEG object is cleaned up.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This routine gets control after the JPEG file header has been read;
|
||||
* at this point the image size and colorspace are known.
|
||||
* The routine must determine what output routines are to be used, and make
|
||||
* any decompression parameter changes that are desirable. For example,
|
||||
* if it is found that the JPEG file is grayscale, you might want to do
|
||||
* things differently than if it is color. You can also delay setting
|
||||
* quantize_colors and associated options until this point.
|
||||
* ERROR HANDLING:
|
||||
*
|
||||
* j_d_defaults initializes out_color_space to CS_RGB. If you want grayscale
|
||||
* output you should set out_color_space to CS_GRAYSCALE. Note that you can
|
||||
* force grayscale output from a color JPEG file (though not vice versa).
|
||||
* The JPEG library's standard error handler (jerror.c) is divided into
|
||||
* several "methods" which you can override individually. This lets you
|
||||
* adjust the behavior without duplicating a lot of code, which you might
|
||||
* have to update with each future release.
|
||||
*
|
||||
* Our example here shows how to override the "error_exit" method so that
|
||||
* control is returned to the library's caller when a fatal error occurs,
|
||||
* rather than calling exit() as the standard error_exit method does.
|
||||
*
|
||||
* We use C's setjmp/longjmp facility to return control. This means that the
|
||||
* routine which calls the JPEG library must first execute a setjmp() call to
|
||||
* establish the return point. We want the replacement error_exit to do a
|
||||
* longjmp(). But we need to make the setjmp buffer accessible to the
|
||||
* error_exit routine. To do this, we make a private extension of the
|
||||
* standard JPEG error handler object. (If we were using C++, we'd say we
|
||||
* were making a subclass of the regular error handler.)
|
||||
*
|
||||
* Here's the extended error handler struct:
|
||||
*/
|
||||
|
||||
METHODDEF void
|
||||
d_ui_method_selection (decompress_info_ptr cinfo)
|
||||
{
|
||||
/* if grayscale input, force grayscale output; */
|
||||
/* else leave the output colorspace as set by main routine. */
|
||||
if (cinfo->jpeg_color_space == CS_GRAYSCALE)
|
||||
cinfo->out_color_space = CS_GRAYSCALE;
|
||||
struct my_error_mgr {
|
||||
struct jpeg_error_mgr pub; /* "public" fields */
|
||||
|
||||
/* select output routines */
|
||||
cinfo->methods->output_init = output_init;
|
||||
cinfo->methods->put_color_map = put_color_map;
|
||||
cinfo->methods->put_pixel_rows = put_pixel_rows;
|
||||
cinfo->methods->output_term = output_term;
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
};
|
||||
|
||||
typedef struct my_error_mgr * my_error_ptr;
|
||||
|
||||
/*
|
||||
* Here's the routine that will replace the standard error_exit method:
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
my_error_exit (j_common_ptr cinfo)
|
||||
{
|
||||
/* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
|
||||
my_error_ptr myerr = (my_error_ptr) cinfo->err;
|
||||
|
||||
/* Always display the message. */
|
||||
/* We could postpone this until after returning, if we chose. */
|
||||
(*cinfo->err->output_message) (cinfo);
|
||||
|
||||
/* Return control to the setjmp point */
|
||||
longjmp(myerr->setjmp_buffer, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* OK, here is the main function that actually causes everything to happen.
|
||||
* We assume here that the JPEG filename is supplied by the caller of this
|
||||
* routine, and that all decompression parameters can be default values.
|
||||
* The routine returns 1 if successful, 0 if not.
|
||||
* Sample routine for JPEG decompression. We assume that the source file name
|
||||
* is passed in. We want to return 1 on success, 0 on error.
|
||||
*/
|
||||
|
||||
GLOBAL int
|
||||
|
||||
GLOBAL(int)
|
||||
read_JPEG_file (char * filename)
|
||||
{
|
||||
/* These three structs contain JPEG parameters and working data.
|
||||
* They must survive for the duration of parameter setup and one
|
||||
* call to jpeg_decompress; typically, making them local data in the
|
||||
* calling routine is the best strategy.
|
||||
/* This struct contains the JPEG decompression parameters and pointers to
|
||||
* working space (which is allocated as needed by the JPEG library).
|
||||
*/
|
||||
struct Decompress_info_struct cinfo;
|
||||
struct Decompress_methods_struct dc_methods;
|
||||
struct External_methods_struct e_methods;
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
/* We use our private extension JPEG error handler.
|
||||
* Note that this struct must live as long as the main JPEG parameter
|
||||
* struct, to avoid dangling-pointer problems.
|
||||
*/
|
||||
struct my_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * infile; /* source file */
|
||||
JSAMPARRAY buffer; /* Output row buffer */
|
||||
int row_stride; /* physical row width in output buffer */
|
||||
|
||||
/* Select the input and output files.
|
||||
* In this example we want to open the input file before doing anything else,
|
||||
/* In this example we want to open the input file before doing anything else,
|
||||
* so that the setjmp() error recovery below can assume the file is open.
|
||||
* Note that cinfo.output_file is only used if your output handling routines
|
||||
* use it; otherwise, you can just make it NULL.
|
||||
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
|
||||
* requires it in order to read binary files.
|
||||
*/
|
||||
|
||||
if ((cinfo.input_file = fopen(filename, "rb")) == NULL) {
|
||||
if ((infile = fopen(filename, "rb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cinfo.output_file = NULL; /* if no actual output file involved */
|
||||
/* Step 1: allocate and initialize JPEG decompression object */
|
||||
|
||||
/* Initialize the system-dependent method pointers. */
|
||||
cinfo.methods = &dc_methods; /* links to method structs */
|
||||
cinfo.emethods = &e_methods;
|
||||
/* Here we supply our own error handler; compare to use of standard error
|
||||
* handler in the previous write_JPEG_file example.
|
||||
*/
|
||||
emethods = &e_methods; /* save struct addr for possible access */
|
||||
e_methods.error_exit = error_exit; /* supply error-exit routine */
|
||||
e_methods.trace_message = trace_message; /* supply trace-message routine */
|
||||
e_methods.trace_level = 0; /* default = no tracing */
|
||||
e_methods.num_warnings = 0; /* no warnings emitted yet */
|
||||
e_methods.first_warning_level = 0; /* display first corrupt-data warning */
|
||||
e_methods.more_warning_level = 3; /* but suppress additional ones */
|
||||
|
||||
/* prepare setjmp context for possible exit from error_exit */
|
||||
if (setjmp(setjmp_buffer)) {
|
||||
/* We set up the normal JPEG error routines, then override error_exit. */
|
||||
cinfo.err = jpeg_std_error(&jerr.pub);
|
||||
jerr.pub.error_exit = my_error_exit;
|
||||
/* Establish the setjmp return context for my_error_exit to use. */
|
||||
if (setjmp(jerr.setjmp_buffer)) {
|
||||
/* If we get here, the JPEG code has signaled an error.
|
||||
* Memory allocation has already been cleaned up (see free_all call in
|
||||
* error_exit), but we need to close the input file before returning.
|
||||
* You might also need to close an output file, etc.
|
||||
* We need to clean up the JPEG object, close the input file, and return.
|
||||
*/
|
||||
fclose(cinfo.input_file);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(infile);
|
||||
return 0;
|
||||
}
|
||||
/* Now we can initialize the JPEG decompression object. */
|
||||
jpeg_create_decompress(&cinfo);
|
||||
|
||||
/* Here we use the standard memory manager provided with the JPEG code.
|
||||
* In some cases you might want to replace the memory manager, or at
|
||||
* least the system-dependent part of it, with your own code.
|
||||
*/
|
||||
jselmemmgr(&e_methods); /* select std memory allocation routines */
|
||||
/* If the decompressor requires full-image buffers (for two-pass color
|
||||
* quantization or a noninterleaved JPEG file), it will create temporary
|
||||
* files for anything that doesn't fit within the maximum-memory setting.
|
||||
* You can change the default maximum-memory setting by changing
|
||||
* e_methods.max_memory_to_use after jselmemmgr returns.
|
||||
* On some systems you may also need to set up a signal handler to
|
||||
* ensure that temporary files are deleted if the program is interrupted.
|
||||
* (This is most important if you are on MS-DOS and use the jmemdos.c
|
||||
* memory manager back end; it will try to grab extended memory for
|
||||
* temp files, and that space will NOT be freed automatically.)
|
||||
* See jcmain.c or jdmain.c for an example signal handler.
|
||||
/* Step 2: specify data source (eg, a file) */
|
||||
|
||||
jpeg_stdio_src(&cinfo, infile);
|
||||
|
||||
/* Step 3: read file parameters with jpeg_read_header() */
|
||||
|
||||
(void) jpeg_read_header(&cinfo, TRUE);
|
||||
/* We can ignore the return value from jpeg_read_header since
|
||||
* (a) suspension is not possible with the stdio data source, and
|
||||
* (b) we passed TRUE to reject a tables-only JPEG file as an error.
|
||||
* See libjpeg.txt for more info.
|
||||
*/
|
||||
|
||||
/* Here, set up the pointer to your own routine for post-header-reading
|
||||
* parameter selection. You could also initialize the pointers to the
|
||||
* output data handling routines here, if they are not dependent on the
|
||||
* image type.
|
||||
*/
|
||||
dc_methods.d_ui_method_selection = d_ui_method_selection;
|
||||
/* Step 4: set parameters for decompression */
|
||||
|
||||
/* Set up default decompression parameters. */
|
||||
j_d_defaults(&cinfo, TRUE);
|
||||
/* TRUE indicates that an input buffer should be allocated.
|
||||
* In unusual cases you may want to allocate the input buffer yourself;
|
||||
* see jddeflts.c for commentary.
|
||||
/* In this example, we don't need to change any of the defaults set by
|
||||
* jpeg_read_header(), so we do nothing here.
|
||||
*/
|
||||
|
||||
/* At this point you can modify the default parameters set by j_d_defaults
|
||||
* as needed; for example, you can request color quantization or force
|
||||
* grayscale output. See jdmain.c for examples of what you might change.
|
||||
/* Step 5: Start decompressor */
|
||||
|
||||
(void) jpeg_start_decompress(&cinfo);
|
||||
/* We can ignore the return value since suspension is not possible
|
||||
* with the stdio data source.
|
||||
*/
|
||||
|
||||
/* Set up to read a JFIF or baseline-JPEG file. */
|
||||
/* This is the only JPEG file format currently supported. */
|
||||
jselrjfif(&cinfo);
|
||||
/* We may need to do some setup of our own at this point before reading
|
||||
* the data. After jpeg_start_decompress() we have the correct scaled
|
||||
* output image dimensions available, as well as the output colormap
|
||||
* if we asked for color quantization.
|
||||
* In this example, we need to make an output work buffer of the right size.
|
||||
*/
|
||||
/* JSAMPLEs per row in output buffer */
|
||||
row_stride = cinfo.output_width * cinfo.output_components;
|
||||
/* Make a one-row-high sample array that will go away when done with image */
|
||||
buffer = (*cinfo.mem->alloc_sarray)
|
||||
((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
|
||||
/* Here we go! */
|
||||
jpeg_decompress(&cinfo);
|
||||
/* Step 6: while (scan lines remain to be read) */
|
||||
/* jpeg_read_scanlines(...); */
|
||||
|
||||
/* That's it, son. Nothin' else to do, except close files. */
|
||||
/* Here we assume only the input file need be closed. */
|
||||
fclose(cinfo.input_file);
|
||||
|
||||
/* You might want to test e_methods.num_warnings to see if bad data was
|
||||
* detected. In this example, we just blindly forge ahead.
|
||||
/* Here we use the library's state variable cinfo.output_scanline as the
|
||||
* loop counter, so that we don't have to keep track ourselves.
|
||||
*/
|
||||
return 1; /* indicate success */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
/* jpeg_read_scanlines expects an array of pointers to scanlines.
|
||||
* Here the array is only one element long, but you could ask for
|
||||
* more than one scanline at a time if that's more convenient.
|
||||
*/
|
||||
(void) jpeg_read_scanlines(&cinfo, buffer, 1);
|
||||
/* Assume put_scanline_someplace wants a pointer and sample count. */
|
||||
put_scanline_someplace(buffer[0], row_stride);
|
||||
}
|
||||
|
||||
/* Note: if you want to decompress more than one image, we recommend you
|
||||
* repeat this whole routine. You MUST repeat the j_d_defaults()/alter
|
||||
* parameters/jpeg_decompress() sequence, as some data structures allocated
|
||||
* in j_d_defaults are freed upon exit from jpeg_decompress.
|
||||
/* Step 7: Finish decompression */
|
||||
|
||||
(void) jpeg_finish_decompress(&cinfo);
|
||||
/* We can ignore the return value since suspension is not possible
|
||||
* with the stdio data source.
|
||||
*/
|
||||
|
||||
/* Step 8: Release JPEG decompression object */
|
||||
|
||||
/* This is an important step since it will release a good deal of memory. */
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
|
||||
/* After finish_decompress, we can close the input file.
|
||||
* Here we postpone it until after no more JPEG errors are possible,
|
||||
* so as to simplify the setjmp error logic above. (Actually, I don't
|
||||
* think that jpeg_destroy can do an error exit, but why assume anything...)
|
||||
*/
|
||||
fclose(infile);
|
||||
|
||||
/* At this point you may want to check to see whether any corrupt-data
|
||||
* warnings occurred (test whether jerr.pub.num_warnings is nonzero).
|
||||
*/
|
||||
|
||||
/* And we're done! */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SOME FINE POINTS:
|
||||
*
|
||||
* In the above code, we ignored the return value of jpeg_read_scanlines,
|
||||
* which is the number of scanlines actually read. We could get away with
|
||||
* this because we asked for only one line at a time and we weren't using
|
||||
* a suspending data source. See libjpeg.txt for more info.
|
||||
*
|
||||
* We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();
|
||||
* we should have done it beforehand to ensure that the space would be
|
||||
* counted against the JPEG max_memory setting. In some systems the above
|
||||
* code would risk an out-of-memory error. However, in general we don't
|
||||
* know the output image dimensions before jpeg_start_decompress(), unless we
|
||||
* call jpeg_calc_output_dimensions(). See libjpeg.txt for more about this.
|
||||
*
|
||||
* Scanlines are returned in the same order as they appear in the JPEG file,
|
||||
* which is standardly top-to-bottom. If you must emit data bottom-to-top,
|
||||
* you can use one of the virtual arrays provided by the JPEG memory manager
|
||||
* to invert the data. See wrbmp.c for an example.
|
||||
*
|
||||
* As with compression, some operating modes may require temporary files.
|
||||
* On some systems you may need to set up a signal handler to ensure that
|
||||
* temporary files are deleted if the program is interrupted. See libjpeg.txt.
|
||||
*/
|
||||
|
||||
153
jaricom.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* jaricom.c
|
||||
*
|
||||
* Developed 1997-2009 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains probability estimation tables for common use in
|
||||
* arithmetic entropy encoding and decoding routines.
|
||||
*
|
||||
* This data represents Table D.2 in the JPEG spec (ISO/IEC IS 10918-1
|
||||
* and CCITT Recommendation ITU-T T.81) and Table 24 in the JBIG spec
|
||||
* (ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82).
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
/* The following #define specifies the packing of the four components
|
||||
* into the compact INT32 representation.
|
||||
* Note that this formula must match the actual arithmetic encoder
|
||||
* and decoder implementation. The implementation has to be changed
|
||||
* if this formula is changed.
|
||||
* The current organization is leaned on Markus Kuhn's JBIG
|
||||
* implementation (jbig_tab.c).
|
||||
*/
|
||||
|
||||
#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)
|
||||
|
||||
const INT32 jpeg_aritab[113+1] = {
|
||||
/*
|
||||
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
|
||||
*/
|
||||
V( 0, 0x5a1d, 1, 1, 1 ),
|
||||
V( 1, 0x2586, 14, 2, 0 ),
|
||||
V( 2, 0x1114, 16, 3, 0 ),
|
||||
V( 3, 0x080b, 18, 4, 0 ),
|
||||
V( 4, 0x03d8, 20, 5, 0 ),
|
||||
V( 5, 0x01da, 23, 6, 0 ),
|
||||
V( 6, 0x00e5, 25, 7, 0 ),
|
||||
V( 7, 0x006f, 28, 8, 0 ),
|
||||
V( 8, 0x0036, 30, 9, 0 ),
|
||||
V( 9, 0x001a, 33, 10, 0 ),
|
||||
V( 10, 0x000d, 35, 11, 0 ),
|
||||
V( 11, 0x0006, 9, 12, 0 ),
|
||||
V( 12, 0x0003, 10, 13, 0 ),
|
||||
V( 13, 0x0001, 12, 13, 0 ),
|
||||
V( 14, 0x5a7f, 15, 15, 1 ),
|
||||
V( 15, 0x3f25, 36, 16, 0 ),
|
||||
V( 16, 0x2cf2, 38, 17, 0 ),
|
||||
V( 17, 0x207c, 39, 18, 0 ),
|
||||
V( 18, 0x17b9, 40, 19, 0 ),
|
||||
V( 19, 0x1182, 42, 20, 0 ),
|
||||
V( 20, 0x0cef, 43, 21, 0 ),
|
||||
V( 21, 0x09a1, 45, 22, 0 ),
|
||||
V( 22, 0x072f, 46, 23, 0 ),
|
||||
V( 23, 0x055c, 48, 24, 0 ),
|
||||
V( 24, 0x0406, 49, 25, 0 ),
|
||||
V( 25, 0x0303, 51, 26, 0 ),
|
||||
V( 26, 0x0240, 52, 27, 0 ),
|
||||
V( 27, 0x01b1, 54, 28, 0 ),
|
||||
V( 28, 0x0144, 56, 29, 0 ),
|
||||
V( 29, 0x00f5, 57, 30, 0 ),
|
||||
V( 30, 0x00b7, 59, 31, 0 ),
|
||||
V( 31, 0x008a, 60, 32, 0 ),
|
||||
V( 32, 0x0068, 62, 33, 0 ),
|
||||
V( 33, 0x004e, 63, 34, 0 ),
|
||||
V( 34, 0x003b, 32, 35, 0 ),
|
||||
V( 35, 0x002c, 33, 9, 0 ),
|
||||
V( 36, 0x5ae1, 37, 37, 1 ),
|
||||
V( 37, 0x484c, 64, 38, 0 ),
|
||||
V( 38, 0x3a0d, 65, 39, 0 ),
|
||||
V( 39, 0x2ef1, 67, 40, 0 ),
|
||||
V( 40, 0x261f, 68, 41, 0 ),
|
||||
V( 41, 0x1f33, 69, 42, 0 ),
|
||||
V( 42, 0x19a8, 70, 43, 0 ),
|
||||
V( 43, 0x1518, 72, 44, 0 ),
|
||||
V( 44, 0x1177, 73, 45, 0 ),
|
||||
V( 45, 0x0e74, 74, 46, 0 ),
|
||||
V( 46, 0x0bfb, 75, 47, 0 ),
|
||||
V( 47, 0x09f8, 77, 48, 0 ),
|
||||
V( 48, 0x0861, 78, 49, 0 ),
|
||||
V( 49, 0x0706, 79, 50, 0 ),
|
||||
V( 50, 0x05cd, 48, 51, 0 ),
|
||||
V( 51, 0x04de, 50, 52, 0 ),
|
||||
V( 52, 0x040f, 50, 53, 0 ),
|
||||
V( 53, 0x0363, 51, 54, 0 ),
|
||||
V( 54, 0x02d4, 52, 55, 0 ),
|
||||
V( 55, 0x025c, 53, 56, 0 ),
|
||||
V( 56, 0x01f8, 54, 57, 0 ),
|
||||
V( 57, 0x01a4, 55, 58, 0 ),
|
||||
V( 58, 0x0160, 56, 59, 0 ),
|
||||
V( 59, 0x0125, 57, 60, 0 ),
|
||||
V( 60, 0x00f6, 58, 61, 0 ),
|
||||
V( 61, 0x00cb, 59, 62, 0 ),
|
||||
V( 62, 0x00ab, 61, 63, 0 ),
|
||||
V( 63, 0x008f, 61, 32, 0 ),
|
||||
V( 64, 0x5b12, 65, 65, 1 ),
|
||||
V( 65, 0x4d04, 80, 66, 0 ),
|
||||
V( 66, 0x412c, 81, 67, 0 ),
|
||||
V( 67, 0x37d8, 82, 68, 0 ),
|
||||
V( 68, 0x2fe8, 83, 69, 0 ),
|
||||
V( 69, 0x293c, 84, 70, 0 ),
|
||||
V( 70, 0x2379, 86, 71, 0 ),
|
||||
V( 71, 0x1edf, 87, 72, 0 ),
|
||||
V( 72, 0x1aa9, 87, 73, 0 ),
|
||||
V( 73, 0x174e, 72, 74, 0 ),
|
||||
V( 74, 0x1424, 72, 75, 0 ),
|
||||
V( 75, 0x119c, 74, 76, 0 ),
|
||||
V( 76, 0x0f6b, 74, 77, 0 ),
|
||||
V( 77, 0x0d51, 75, 78, 0 ),
|
||||
V( 78, 0x0bb6, 77, 79, 0 ),
|
||||
V( 79, 0x0a40, 77, 48, 0 ),
|
||||
V( 80, 0x5832, 80, 81, 1 ),
|
||||
V( 81, 0x4d1c, 88, 82, 0 ),
|
||||
V( 82, 0x438e, 89, 83, 0 ),
|
||||
V( 83, 0x3bdd, 90, 84, 0 ),
|
||||
V( 84, 0x34ee, 91, 85, 0 ),
|
||||
V( 85, 0x2eae, 92, 86, 0 ),
|
||||
V( 86, 0x299a, 93, 87, 0 ),
|
||||
V( 87, 0x2516, 86, 71, 0 ),
|
||||
V( 88, 0x5570, 88, 89, 1 ),
|
||||
V( 89, 0x4ca9, 95, 90, 0 ),
|
||||
V( 90, 0x44d9, 96, 91, 0 ),
|
||||
V( 91, 0x3e22, 97, 92, 0 ),
|
||||
V( 92, 0x3824, 99, 93, 0 ),
|
||||
V( 93, 0x32b4, 99, 94, 0 ),
|
||||
V( 94, 0x2e17, 93, 86, 0 ),
|
||||
V( 95, 0x56a8, 95, 96, 1 ),
|
||||
V( 96, 0x4f46, 101, 97, 0 ),
|
||||
V( 97, 0x47e5, 102, 98, 0 ),
|
||||
V( 98, 0x41cf, 103, 99, 0 ),
|
||||
V( 99, 0x3c3d, 104, 100, 0 ),
|
||||
V( 100, 0x375e, 99, 93, 0 ),
|
||||
V( 101, 0x5231, 105, 102, 0 ),
|
||||
V( 102, 0x4c0f, 106, 103, 0 ),
|
||||
V( 103, 0x4639, 107, 104, 0 ),
|
||||
V( 104, 0x415e, 103, 99, 0 ),
|
||||
V( 105, 0x5627, 105, 106, 1 ),
|
||||
V( 106, 0x50e7, 108, 107, 0 ),
|
||||
V( 107, 0x4b85, 109, 103, 0 ),
|
||||
V( 108, 0x5597, 110, 109, 0 ),
|
||||
V( 109, 0x504f, 111, 107, 0 ),
|
||||
V( 110, 0x5a10, 110, 111, 1 ),
|
||||
V( 111, 0x5522, 112, 109, 0 ),
|
||||
V( 112, 0x59eb, 112, 111, 1 ),
|
||||
/*
|
||||
* This last entry is used for fixed probability estimate of 0.5
|
||||
* as recommended in Section 10.3 Table 5 of ITU-T Rec. T.851.
|
||||
*/
|
||||
V( 113, 0x5a1d, 113, 113, 0 )
|
||||
};
|
||||
55
java/CMakeLists.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
set(JAR_FILE turbojpeg.jar)
|
||||
set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.MF)
|
||||
|
||||
set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ
|
||||
org/libjpegturbo/turbojpeg/TJCompressor
|
||||
org/libjpegturbo/turbojpeg/TJCustomFilter
|
||||
org/libjpegturbo/turbojpeg/TJDecompressor
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor
|
||||
org/libjpegturbo/turbojpeg/TJTransform
|
||||
org/libjpegturbo/turbojpeg/TJTransformer
|
||||
TJUnitTest
|
||||
TJExample
|
||||
TJBench)
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/$(OutDir)")
|
||||
else()
|
||||
set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
set(TURBOJPEG_DLL_NAME "turbojpeg")
|
||||
if(MINGW)
|
||||
set(TURBOJPEG_DLL_NAME "libturbojpeg")
|
||||
endif()
|
||||
configure_file(org/libjpegturbo/turbojpeg/TJLoader.java.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
|
||||
|
||||
set(JAVA_SOURCES "")
|
||||
set(JAVA_CLASSES "")
|
||||
set(JAVA_CLASSES_FULL "")
|
||||
foreach(class ${JAVA_CLASSNAMES})
|
||||
set(JAVA_SOURCES ${JAVA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${class}.java)
|
||||
set(JAVA_CLASSES ${JAVA_CLASSES} ${class}.class)
|
||||
set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL} ${OBJDIR}/${class}.class)
|
||||
endforeach()
|
||||
|
||||
set(JAVA_SOURCES ${JAVA_SOURCES}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
|
||||
set(JAVA_CLASSES ${JAVA_CLASSES}
|
||||
org/libjpegturbo/turbojpeg/TJLoader.class)
|
||||
set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL}
|
||||
${OBJDIR}/org/libjpegturbo/turbojpeg/TJLoader.class)
|
||||
|
||||
string(REGEX REPLACE " " ";" JAVACFLAGS "${JAVACFLAGS}")
|
||||
add_custom_command(OUTPUT ${JAVA_CLASSES_FULL} DEPENDS ${JAVA_SOURCES}
|
||||
COMMAND ${JAVA_COMPILE} ARGS ${JAVACFLAGS} -d ${OBJDIR} ${JAVA_SOURCES})
|
||||
|
||||
add_custom_command(OUTPUT ${JAR_FILE} DEPENDS ${JAVA_CLASSES_FULL}
|
||||
${MANIFEST_FILE}
|
||||
COMMAND ${JAVA_ARCHIVE} cfm ${JAR_FILE} ${MANIFEST_FILE} ${JAVA_CLASSES}
|
||||
WORKING_DIRECTORY ${OBJDIR})
|
||||
|
||||
add_custom_target(java ALL DEPENDS ${JAR_FILE})
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${JAR_FILE} DESTINATION classes)
|
||||
2
java/MANIFEST.MF
Normal file
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: TJExample
|
||||
71
java/Makefile.am
Normal file
@@ -0,0 +1,71 @@
|
||||
JAVAROOT = .
|
||||
|
||||
org/libjpegturbo/turbojpeg/TJLoader.java: $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl
|
||||
mkdir -p org/libjpegturbo/turbojpeg; \
|
||||
cat $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl | \
|
||||
sed s@%{__libdir}@$(libdir)@g > org/libjpegturbo/turbojpeg/TJLoader.java
|
||||
|
||||
|
||||
JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \
|
||||
org/libjpegturbo/turbojpeg/TJCompressor.java \
|
||||
org/libjpegturbo/turbojpeg/TJCustomFilter.java \
|
||||
org/libjpegturbo/turbojpeg/TJDecompressor.java \
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor.java \
|
||||
org/libjpegturbo/turbojpeg/TJTransform.java \
|
||||
org/libjpegturbo/turbojpeg/TJTransformer.java \
|
||||
TJExample.java \
|
||||
TJUnitTest.java \
|
||||
TJBench.java
|
||||
|
||||
JNIHEADERS = org_libjpegturbo_turbojpeg_TJ.h \
|
||||
org_libjpegturbo_turbojpeg_TJCompressor.h \
|
||||
org_libjpegturbo_turbojpeg_TJDecompressor.h \
|
||||
org_libjpegturbo_turbojpeg_TJTransformer.h
|
||||
|
||||
if WITH_JAVA
|
||||
|
||||
nodist_noinst_JAVA = ${JAVASOURCES} org/libjpegturbo/turbojpeg/TJLoader.java
|
||||
|
||||
JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
|
||||
org/libjpegturbo/turbojpeg/TJCompressor.class \
|
||||
org/libjpegturbo/turbojpeg/TJCustomFilter.class \
|
||||
org/libjpegturbo/turbojpeg/TJDecompressor.class \
|
||||
org/libjpegturbo/turbojpeg/TJLoader.class \
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor.class \
|
||||
org/libjpegturbo/turbojpeg/TJTransform.class \
|
||||
org/libjpegturbo/turbojpeg/TJTransformer.class \
|
||||
TJExample.class \
|
||||
TJUnitTest.class \
|
||||
TJBench.class
|
||||
|
||||
all: all-am turbojpeg.jar
|
||||
|
||||
turbojpeg.jar: $(JAVA_CLASSES) ${srcdir}/MANIFEST.MF
|
||||
$(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES)
|
||||
|
||||
clean-local:
|
||||
rm -f turbojpeg.jar
|
||||
|
||||
install-exec-local: turbojpeg.jar
|
||||
mkdir -p $(DESTDIR)/$(datadir)/classes
|
||||
$(INSTALL) -m 644 turbojpeg.jar $(DESTDIR)/$(datadir)/classes/
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)/$(datadir)/classes/turbojpeg.jar
|
||||
if [ -d $(DESTDIR)/$(datadir)/classes ]; then rmdir $(DESTDIR)/$(datadir)/classes; fi
|
||||
|
||||
headers: all
|
||||
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJ; \
|
||||
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJCompressor; \
|
||||
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJDecompressor; \
|
||||
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJTransformer
|
||||
|
||||
docs: all
|
||||
mkdir -p ${srcdir}/doc; \
|
||||
javadoc -d ${srcdir}/doc -sourcepath ${srcdir} org.libjpegturbo.turbojpeg
|
||||
|
||||
endif
|
||||
|
||||
EXTRA_DIST = MANIFEST.MF ${JAVASOURCES} ${JNIHEADERS} doc CMakeLists.txt \
|
||||
org/libjpegturbo/turbojpeg/TJLoader.java.tmpl \
|
||||
org/libjpegturbo/turbojpeg/TJLoader.java.in
|
||||
52
java/README
Normal file
@@ -0,0 +1,52 @@
|
||||
TurboJPEG Java Wrapper
|
||||
======================
|
||||
|
||||
The TurboJPEG shared library can optionally be built with a Java Native
|
||||
Interface wrapper, which allows the library to be loaded and used directly from
|
||||
Java applications. The Java front end for this is defined in several classes
|
||||
located under org/libjpegturbo/turbojpeg. The source code for these Java
|
||||
classes is licensed under a BSD-style license, so the files can be incorporated
|
||||
directly into both open source and proprietary projects without restriction. A
|
||||
Java archive (JAR) file containing these classes is also shipped with the
|
||||
"official" distribution packages of libjpeg-turbo.
|
||||
|
||||
TJExample.java, which should also be located in the same directory as this
|
||||
README file, demonstrates how to use the TurboJPEG Java API to compress and
|
||||
decompress JPEG images in memory.
|
||||
|
||||
|
||||
Performance Pitfalls
|
||||
--------------------
|
||||
|
||||
The TurboJPEG Java API defines several convenience methods that can allocate
|
||||
image buffers or instantiate classes to hold the result of compress,
|
||||
decompress, or transform operations. However, if you use these methods, then
|
||||
be mindful of the amount of new data you are creating on the heap. It may be
|
||||
necessary to manually invoke the garbage collector to prevent heap exhaustion
|
||||
or to prevent performance degradation. Background garbage collection can kill
|
||||
performance, particularly in a multi-threaded environment (Java pauses all
|
||||
threads when the GC runs.)
|
||||
|
||||
The TurboJPEG Java API always gives you the option of pre-allocating your own
|
||||
source and destination buffers, which allows you to re-use those buffers for
|
||||
compressing/decompressing multiple images. If the image sequence you are
|
||||
compressing or decompressing consists of images of the same size, then
|
||||
pre-allocating the buffers is recommended.
|
||||
|
||||
|
||||
Installation Directory
|
||||
----------------------
|
||||
|
||||
The TurboJPEG Java Wrapper will look for the TurboJPEG JNI library
|
||||
(libturbojpeg.so, libturbojpeg.jnilib, or turbojpeg.dll) in the system library
|
||||
paths or in any paths specified in LD_LIBRARY_PATH (Un*x), DYLD_LIBRARY_PATH
|
||||
(Mac), or PATH (Windows.) Failing this, on Un*x and Mac systems, the wrapper
|
||||
will look for the JNI library under the library directory configured when
|
||||
libjpeg-turbo was built. If that library directory is
|
||||
/opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and
|
||||
vice versa.
|
||||
|
||||
If you installed the JNI library into another directory, then you will need
|
||||
to pass an argument of -Djava.library.path={path_to_JNI_library} to java, or
|
||||
manipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory
|
||||
containing the JNI library.
|
||||
853
java/TJBench.java
Normal file
@@ -0,0 +1,853 @@
|
||||
/*
|
||||
* Copyright (C)2009-2012 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - 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.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 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 HOLDERS 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.
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.awt.image.*;
|
||||
import javax.imageio.*;
|
||||
import java.util.*;
|
||||
import org.libjpegturbo.turbojpeg.*;
|
||||
|
||||
class TJBench {
|
||||
|
||||
static final int YUVENCODE = 1;
|
||||
static final int YUVDECODE = 2;
|
||||
|
||||
static int flags = 0, yuv = 0, quiet = 0, pf = TJ.PF_BGR;
|
||||
static boolean decompOnly, doTile;
|
||||
|
||||
static final String[] pixFormatStr = {
|
||||
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY"
|
||||
};
|
||||
|
||||
static final String[] subNameLong = {
|
||||
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0"
|
||||
};
|
||||
|
||||
static final String[] subName = {
|
||||
"444", "422", "420", "GRAY", "440"
|
||||
};
|
||||
|
||||
static TJScalingFactor sf;
|
||||
static int xformOp = TJTransform.OP_NONE, xformOpt = 0;
|
||||
static double benchTime = 5.0;
|
||||
|
||||
|
||||
static final double getTime() {
|
||||
return (double)System.nanoTime() / 1.0e9;
|
||||
}
|
||||
|
||||
|
||||
static String sigFig(double val, int figs) {
|
||||
String format;
|
||||
int digitsAfterDecimal = figs - (int)Math.ceil(Math.log10(Math.abs(val)));
|
||||
if (digitsAfterDecimal < 1)
|
||||
format = new String("%.0f");
|
||||
else
|
||||
format = new String("%." + digitsAfterDecimal + "f");
|
||||
return String.format(format, val);
|
||||
}
|
||||
|
||||
|
||||
static byte[] loadImage(String fileName, int[] w, int[] h, int pixelFormat)
|
||||
throws Exception {
|
||||
BufferedImage img = ImageIO.read(new File(fileName));
|
||||
if (img == null)
|
||||
throw new Exception("Could not read " + fileName);
|
||||
w[0] = img.getWidth();
|
||||
h[0] = img.getHeight();
|
||||
int[] rgb = img.getRGB(0, 0, w[0], h[0], null, 0, w[0]);
|
||||
int ps = TJ.getPixelSize(pixelFormat);
|
||||
int rindex = TJ.getRedOffset(pixelFormat);
|
||||
int gindex = TJ.getGreenOffset(pixelFormat);
|
||||
int bindex = TJ.getBlueOffset(pixelFormat);
|
||||
byte[] dstBuf = new byte[w[0] * h[0] * ps];
|
||||
int pixels = w[0] * h[0], dstPtr = 0, rgbPtr = 0;
|
||||
while (pixels-- > 0) {
|
||||
dstBuf[dstPtr + rindex] = (byte)((rgb[rgbPtr] >> 16) & 0xff);
|
||||
dstBuf[dstPtr + gindex] = (byte)((rgb[rgbPtr] >> 8) & 0xff);
|
||||
dstBuf[dstPtr + bindex] = (byte)(rgb[rgbPtr] & 0xff);
|
||||
dstPtr += ps;
|
||||
rgbPtr++;
|
||||
}
|
||||
return dstBuf;
|
||||
}
|
||||
|
||||
|
||||
static void saveImage(String fileName, byte[] srcBuf, int w, int h,
|
||||
int pixelFormat) throws Exception {
|
||||
BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
|
||||
int pixels = w * h, srcPtr = 0;
|
||||
int ps = TJ.getPixelSize(pixelFormat);
|
||||
int rindex = TJ.getRedOffset(pixelFormat);
|
||||
int gindex = TJ.getGreenOffset(pixelFormat);
|
||||
int bindex = TJ.getBlueOffset(pixelFormat);
|
||||
for (int y = 0; y < h; y++) {
|
||||
for (int x = 0; x < w; x++, srcPtr += ps) {
|
||||
int pixel = (srcBuf[srcPtr + rindex] & 0xff) << 16 |
|
||||
(srcBuf[srcPtr + gindex] & 0xff) << 8 |
|
||||
(srcBuf[srcPtr + bindex] & 0xff);
|
||||
img.setRGB(x, y, pixel);
|
||||
}
|
||||
}
|
||||
ImageIO.write(img, "bmp", new File(fileName));
|
||||
}
|
||||
|
||||
|
||||
/* Decompression test */
|
||||
static void decompTest(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize,
|
||||
byte[] dstBuf, int w, int h, int subsamp,
|
||||
int jpegQual, String fileName, int tilew, int tileh)
|
||||
throws Exception {
|
||||
String qualStr = new String(""), sizeStr, tempStr;
|
||||
TJDecompressor tjd;
|
||||
double start, elapsed;
|
||||
int ps = TJ.getPixelSize(pf), i;
|
||||
int yuvSize = TJ.bufSizeYUV(w, h, subsamp), bufsize;
|
||||
int scaledw = (yuv == YUVDECODE) ? w : sf.getScaled(w);
|
||||
int scaledh = (yuv == YUVDECODE) ? h : sf.getScaled(h);
|
||||
int pitch = scaledw * ps;
|
||||
|
||||
if (jpegQual > 0)
|
||||
qualStr = new String("_Q" + jpegQual);
|
||||
|
||||
tjd = new TJDecompressor();
|
||||
|
||||
int bufSize = (yuv == YUVDECODE ? yuvSize : pitch * scaledh);
|
||||
if (dstBuf == null)
|
||||
dstBuf = new byte[bufSize];
|
||||
|
||||
/* Set the destination buffer to gray so we know whether the decompressor
|
||||
attempted to write to it */
|
||||
Arrays.fill(dstBuf, (byte)127);
|
||||
|
||||
/* Execute once to preload cache */
|
||||
tjd.setJPEGImage(jpegBuf[0], jpegSize[0]);
|
||||
if (yuv == YUVDECODE)
|
||||
tjd.decompressToYUV(dstBuf, flags);
|
||||
else
|
||||
tjd.decompress(dstBuf, scaledw, pitch, scaledh, pf, flags);
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0, start = getTime(); (elapsed = getTime() - start) < benchTime;
|
||||
i++) {
|
||||
int tile = 0;
|
||||
if (yuv == YUVDECODE)
|
||||
tjd.decompressToYUV(dstBuf, flags);
|
||||
else {
|
||||
for (int y = 0; y < h; y += tileh) {
|
||||
for (int x = 0; x < w; x += tilew, tile++) {
|
||||
int width = doTile ? Math.min(tilew, w - x) : scaledw;
|
||||
int height = doTile ? Math.min(tileh, h - y) : scaledh;
|
||||
tjd.setJPEGImage(jpegBuf[tile], jpegSize[tile]);
|
||||
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tjd = null;
|
||||
System.gc();
|
||||
|
||||
if (quiet != 0)
|
||||
System.out.println(
|
||||
sigFig((double)(w * h) / 1000000. * (double)i / elapsed, 4));
|
||||
else {
|
||||
System.out.format("D--> Frame rate: %f fps\n",
|
||||
(double)i / elapsed);
|
||||
System.out.format(" Dest. throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)i / elapsed);
|
||||
}
|
||||
|
||||
if (yuv == YUVDECODE) {
|
||||
tempStr = fileName + "_" + subName[subsamp] + qualStr + ".yuv";
|
||||
FileOutputStream fos = new FileOutputStream(tempStr);
|
||||
fos.write(dstBuf, 0, yuvSize);
|
||||
fos.close();
|
||||
} else {
|
||||
if (sf.getNum() != 1 || sf.getDenom() != 1)
|
||||
sizeStr = new String(sf.getNum() + "_" + sf.getDenom());
|
||||
else if (tilew != w || tileh != h)
|
||||
sizeStr = new String(tilew + "x" + tileh);
|
||||
else
|
||||
sizeStr = new String("full");
|
||||
if (decompOnly)
|
||||
tempStr = new String(fileName + "_" + sizeStr + ".bmp");
|
||||
else
|
||||
tempStr = new String(fileName + "_" + subName[subsamp] + qualStr +
|
||||
"_" + sizeStr + ".bmp");
|
||||
saveImage(tempStr, dstBuf, scaledw, scaledh, pf);
|
||||
int ndx = tempStr.indexOf('.');
|
||||
tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp");
|
||||
if (srcBuf != null && sf.getNum() == 1 && sf.getDenom() == 1) {
|
||||
if (quiet == 0)
|
||||
System.out.println("Compression error written to " + tempStr + ".");
|
||||
if (subsamp == TJ.SAMP_GRAY) {
|
||||
for (int y = 0, index = 0; y < h; y++, index += pitch) {
|
||||
for (int x = 0, index2 = index; x < w; x++, index2 += ps) {
|
||||
int rindex = index2 + TJ.getRedOffset(pf);
|
||||
int gindex = index2 + TJ.getGreenOffset(pf);
|
||||
int bindex = index2 + TJ.getBlueOffset(pf);
|
||||
int lum = (int)((double)(srcBuf[rindex] & 0xff) * 0.299 +
|
||||
(double)(srcBuf[gindex] & 0xff) * 0.587 +
|
||||
(double)(srcBuf[bindex] & 0xff) * 0.114 + 0.5);
|
||||
if (lum > 255) lum = 255;
|
||||
if (lum < 0) lum = 0;
|
||||
dstBuf[rindex] = (byte)Math.abs((dstBuf[rindex] & 0xff) - lum);
|
||||
dstBuf[gindex] = (byte)Math.abs((dstBuf[gindex] & 0xff) - lum);
|
||||
dstBuf[bindex] = (byte)Math.abs((dstBuf[bindex] & 0xff) - lum);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int y = 0; y < h; y++)
|
||||
for (int x = 0; x < w * ps; x++)
|
||||
dstBuf[pitch * y + x] =
|
||||
(byte)Math.abs((dstBuf[pitch * y + x] & 0xff) -
|
||||
(srcBuf[pitch * y + x] & 0xff));
|
||||
}
|
||||
saveImage(tempStr, dstBuf, w, h, pf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void doTestYUV(byte[] srcBuf, int w, int h, int subsamp,
|
||||
String fileName) throws Exception {
|
||||
TJCompressor tjc;
|
||||
byte[] dstBuf;
|
||||
double start, elapsed;
|
||||
int ps = TJ.getPixelSize(pf), i;
|
||||
int yuvSize = 0;
|
||||
|
||||
yuvSize = TJ.bufSizeYUV(w, h, subsamp);
|
||||
dstBuf = new byte[yuvSize];
|
||||
|
||||
if (quiet == 0)
|
||||
System.out.format(">>>>> %s (%s) <--> YUV %s <<<<<\n",
|
||||
pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down",
|
||||
subNameLong[subsamp]);
|
||||
|
||||
if (quiet == 1)
|
||||
System.out.format("%s\t%s\t%s\tN/A\t", pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
|
||||
subNameLong[subsamp]);
|
||||
|
||||
tjc = new TJCompressor(srcBuf, w, 0, h, pf);
|
||||
tjc.setSubsamp(subsamp);
|
||||
|
||||
/* Execute once to preload cache */
|
||||
tjc.encodeYUV(dstBuf, flags);
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0, start = getTime();
|
||||
(elapsed = getTime() - start) < benchTime; i++)
|
||||
tjc.encodeYUV(dstBuf, flags);
|
||||
|
||||
if (quiet == 1)
|
||||
System.out.format("%-4d %-4d\t", w, h);
|
||||
if (quiet != 0) {
|
||||
System.out.format("%s%c%s%c",
|
||||
sigFig((double)(w * h) / 1000000. * (double) i / elapsed, 4),
|
||||
quiet == 2 ? '\n' : '\t',
|
||||
sigFig((double)(w * h * ps) / (double)yuvSize, 4),
|
||||
quiet == 2 ? '\n' : '\t');
|
||||
} else {
|
||||
System.out.format("\n%s size: %d x %d\n", "Image", w, h);
|
||||
System.out.format("C--> Frame rate: %f fps\n",
|
||||
(double)i / elapsed);
|
||||
System.out.format(" Output image size: %d bytes\n", yuvSize);
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)yuvSize);
|
||||
System.out.format(" Source throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)i / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)yuvSize * 8. / 1000000. * (double)i / elapsed);
|
||||
}
|
||||
String tempStr = fileName + "_" + subName[subsamp] + ".yuv";
|
||||
FileOutputStream fos = new FileOutputStream(tempStr);
|
||||
fos.write(dstBuf, 0, yuvSize);
|
||||
fos.close();
|
||||
if (quiet == 0)
|
||||
System.out.println("Reference image written to " + tempStr);
|
||||
}
|
||||
|
||||
|
||||
static void doTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual,
|
||||
String fileName) throws Exception {
|
||||
TJCompressor tjc;
|
||||
byte[] tmpBuf;
|
||||
byte[][] jpegBuf;
|
||||
int[] jpegSize;
|
||||
double start, elapsed;
|
||||
int totalJpegSize = 0, tilew, tileh, i;
|
||||
int ps = TJ.getPixelSize(pf), ntilesw = 1, ntilesh = 1, pitch = w * ps;
|
||||
|
||||
if (yuv == YUVENCODE) {
|
||||
doTestYUV(srcBuf, w, h, subsamp, fileName);
|
||||
return;
|
||||
}
|
||||
|
||||
tmpBuf = new byte[pitch * h];
|
||||
|
||||
if (quiet == 0)
|
||||
System.out.format(">>>>> %s (%s) <--> JPEG %s Q%d <<<<<\n",
|
||||
pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down",
|
||||
subNameLong[subsamp], jpegQual);
|
||||
|
||||
tjc = new TJCompressor();
|
||||
|
||||
for (tilew = doTile ? 8 : w, tileh = doTile ? 8 : h; ;
|
||||
tilew *= 2, tileh *= 2) {
|
||||
if (tilew > w)
|
||||
tilew = w;
|
||||
if (tileh > h)
|
||||
tileh = h;
|
||||
ntilesw = (w + tilew - 1) / tilew;
|
||||
ntilesh = (h + tileh - 1) / tileh;
|
||||
|
||||
jpegBuf = new byte[ntilesw * ntilesh][TJ.bufSize(tilew, tileh, subsamp)];
|
||||
jpegSize = new int[ntilesw * ntilesh];
|
||||
|
||||
/* Compression test */
|
||||
if (quiet == 1)
|
||||
System.out.format("%s\t%s\t%s\t%d\t", pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
|
||||
subNameLong[subsamp], jpegQual);
|
||||
for (i = 0; i < h; i++)
|
||||
System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps);
|
||||
tjc.setSourceImage(srcBuf, tilew, pitch, tileh, pf);
|
||||
tjc.setJPEGQuality(jpegQual);
|
||||
tjc.setSubsamp(subsamp);
|
||||
|
||||
/* Execute once to preload cache */
|
||||
tjc.compress(jpegBuf[0], flags);
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0, start = getTime();
|
||||
(elapsed = getTime() - start) < benchTime; i++) {
|
||||
int tile = 0;
|
||||
totalJpegSize = 0;
|
||||
for (int y = 0; y < h; y += tileh) {
|
||||
for (int x = 0; x < w; x += tilew, tile++) {
|
||||
int width = Math.min(tilew, w - x);
|
||||
int height = Math.min(tileh, h - y);
|
||||
tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf);
|
||||
tjc.compress(jpegBuf[tile], flags);
|
||||
jpegSize[tile] = tjc.getCompressedSize();
|
||||
totalJpegSize += jpegSize[tile];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (quiet == 1)
|
||||
System.out.format("%-4d %-4d\t", tilew, tileh);
|
||||
if (quiet != 0) {
|
||||
System.out.format("%s%c%s%c",
|
||||
sigFig((double)(w * h) / 1000000. * (double) i / elapsed, 4),
|
||||
quiet == 2 ? '\n' : '\t',
|
||||
sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),
|
||||
quiet == 2 ? '\n' : '\t');
|
||||
} else {
|
||||
System.out.format("\n%s size: %d x %d\n", doTile ? "Tile" : "Image",
|
||||
tilew, tileh);
|
||||
System.out.format("C--> Frame rate: %f fps\n",
|
||||
(double)i / elapsed);
|
||||
System.out.format(" Output image size: %d bytes\n",
|
||||
totalJpegSize);
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)totalJpegSize);
|
||||
System.out.format(" Source throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)i / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)totalJpegSize * 8. / 1000000. * (double)i / elapsed);
|
||||
}
|
||||
if (tilew == w && tileh == h) {
|
||||
String tempStr = fileName + "_" + subName[subsamp] + "_" + "Q" +
|
||||
jpegQual + ".jpg";
|
||||
FileOutputStream fos = new FileOutputStream(tempStr);
|
||||
fos.write(jpegBuf[0], 0, jpegSize[0]);
|
||||
fos.close();
|
||||
if (quiet == 0)
|
||||
System.out.println("Reference image written to " + tempStr);
|
||||
}
|
||||
|
||||
/* Decompression test */
|
||||
decompTest(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual,
|
||||
fileName, tilew, tileh);
|
||||
|
||||
for (i = 0; i < ntilesw * ntilesh; i++)
|
||||
jpegBuf[i] = null;
|
||||
jpegBuf = null; jpegSize = null;
|
||||
System.gc();
|
||||
|
||||
if (tilew == w && tileh == h) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void doDecompTest(String fileName) throws Exception {
|
||||
TJTransformer tjt;
|
||||
byte[][] jpegBuf;
|
||||
byte[] srcBuf;
|
||||
int[] jpegSize;
|
||||
int totalJpegSize;
|
||||
int w = 0, h = 0, subsamp = -1, _w, _h, _tilew, _tileh,
|
||||
_ntilesw, _ntilesh, _subsamp, x, y;
|
||||
int ntilesw = 1, ntilesh = 1;
|
||||
double start, elapsed;
|
||||
int ps = TJ.getPixelSize(pf), tile;
|
||||
|
||||
FileInputStream fis = new FileInputStream(fileName);
|
||||
int srcSize = (int)fis.getChannel().size();
|
||||
srcBuf = new byte[srcSize];
|
||||
fis.read(srcBuf, 0, srcSize);
|
||||
fis.close();
|
||||
|
||||
int index = fileName.indexOf('.');
|
||||
if (index >= 0)
|
||||
fileName = new String(fileName.substring(0, index));
|
||||
|
||||
tjt = new TJTransformer();
|
||||
|
||||
tjt.setJPEGImage(srcBuf, srcSize);
|
||||
w = tjt.getWidth();
|
||||
h = tjt.getHeight();
|
||||
subsamp = tjt.getSubsamp();
|
||||
|
||||
if (quiet == 1) {
|
||||
System.out.println("All performance values in Mpixels/sec\n");
|
||||
System.out.format("Bitmap\tBitmap\tJPEG\t%s %s \tXform\tComp\tDecomp\n",
|
||||
(doTile ? "Tile " : "Image"),
|
||||
(doTile ? "Tile " : "Image"));
|
||||
System.out.println("Format\tOrder\tSubsamp\tWidth Height\tPerf \tRatio\tPerf\n");
|
||||
} else if (quiet == 0) {
|
||||
System.out.format(">>>>> JPEG %s --> %s (%s) <<<<<",
|
||||
subNameLong[subsamp], pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down");
|
||||
}
|
||||
|
||||
for (int tilew = doTile ? 16 : w, tileh = doTile ? 16 : h; ;
|
||||
tilew *= 2, tileh *= 2) {
|
||||
if (tilew > w)
|
||||
tilew = w;
|
||||
if (tileh > h)
|
||||
tileh = h;
|
||||
ntilesw = (w + tilew - 1) / tilew;
|
||||
ntilesh = (h + tileh - 1) / tileh;
|
||||
|
||||
_w = w; _h = h; _tilew = tilew; _tileh = tileh;
|
||||
if (quiet == 0) {
|
||||
System.out.format("\n%s size: %d x %d", (doTile ? "Tile" : "Image"),
|
||||
_tilew, _tileh);
|
||||
if (sf.getNum() != 1 || sf.getDenom() != 1)
|
||||
System.out.format(" --> %d x %d", sf.getScaled(_w),
|
||||
sf.getScaled(_h));
|
||||
System.out.println("");
|
||||
} else if (quiet == 1) {
|
||||
System.out.format("%s\t%s\t%s\t", pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
|
||||
subNameLong[subsamp]);
|
||||
System.out.format("%-4d %-4d\t", tilew, tileh);
|
||||
}
|
||||
|
||||
_subsamp = subsamp;
|
||||
if (doTile || xformOp != TJTransform.OP_NONE || xformOpt != 0) {
|
||||
if (xformOp == TJTransform.OP_TRANSPOSE ||
|
||||
xformOp == TJTransform.OP_TRANSVERSE ||
|
||||
xformOp == TJTransform.OP_ROT90 ||
|
||||
xformOp == TJTransform.OP_ROT270) {
|
||||
_w = h; _h = w; _tilew = tileh; _tileh = tilew;
|
||||
}
|
||||
|
||||
if ((xformOpt & TJTransform.OPT_GRAY) != 0)
|
||||
_subsamp = TJ.SAMP_GRAY;
|
||||
if (xformOp == TJTransform.OP_HFLIP ||
|
||||
xformOp == TJTransform.OP_ROT180)
|
||||
_w = _w - (_w % TJ.getMCUWidth(_subsamp));
|
||||
if (xformOp == TJTransform.OP_VFLIP ||
|
||||
xformOp == TJTransform.OP_ROT180)
|
||||
_h = _h - (_h % TJ.getMCUHeight(_subsamp));
|
||||
if (xformOp == TJTransform.OP_TRANSVERSE ||
|
||||
xformOp == TJTransform.OP_ROT90)
|
||||
_w = _w - (_w % TJ.getMCUHeight(_subsamp));
|
||||
if (xformOp == TJTransform.OP_TRANSVERSE ||
|
||||
xformOp == TJTransform.OP_ROT270)
|
||||
_h = _h - (_h % TJ.getMCUWidth(_subsamp));
|
||||
_ntilesw = (_w + _tilew - 1) / _tilew;
|
||||
_ntilesh = (_h + _tileh - 1) / _tileh;
|
||||
|
||||
TJTransform[] t = new TJTransform[_ntilesw * _ntilesh];
|
||||
jpegBuf = new byte[_ntilesw * _ntilesh][TJ.bufSize(_tilew, _tileh, subsamp)];
|
||||
|
||||
for (y = 0, tile = 0; y < _h; y += _tileh) {
|
||||
for (x = 0; x < _w; x += _tilew, tile++) {
|
||||
t[tile] = new TJTransform();
|
||||
t[tile].width = Math.min(_tilew, _w - x);
|
||||
t[tile].height = Math.min(_tileh, _h - y);
|
||||
t[tile].x = x;
|
||||
t[tile].y = y;
|
||||
t[tile].op = xformOp;
|
||||
t[tile].options = xformOpt | TJTransform.OPT_TRIM;
|
||||
if ((t[tile].options & TJTransform.OPT_NOOUTPUT) != 0 &&
|
||||
jpegBuf[tile] != null)
|
||||
jpegBuf[tile] = null;
|
||||
}
|
||||
}
|
||||
|
||||
start = getTime();
|
||||
tjt.transform(jpegBuf, t, flags);
|
||||
jpegSize = tjt.getTransformedSizes();
|
||||
elapsed = getTime() - start;
|
||||
|
||||
t = null;
|
||||
|
||||
for (tile = 0, totalJpegSize = 0; tile < _ntilesw * _ntilesh; tile++)
|
||||
totalJpegSize += jpegSize[tile];
|
||||
|
||||
if (quiet != 0) {
|
||||
System.out.format("%s%c%s%c",
|
||||
sigFig((double)(w * h) / 1000000. / elapsed, 4),
|
||||
quiet == 2 ? '\n' : '\t',
|
||||
sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),
|
||||
quiet == 2 ? '\n' : '\t');
|
||||
} else if (quiet == 0) {
|
||||
System.out.format("X--> Frame rate: %f fps\n",
|
||||
1.0 / elapsed);
|
||||
System.out.format(" Output image size: %lu bytes\n",
|
||||
totalJpegSize);
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)totalJpegSize);
|
||||
System.out.format(" Source throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)totalJpegSize * 8. / 1000000. / elapsed);
|
||||
}
|
||||
} else {
|
||||
if (quiet == 1)
|
||||
System.out.print("N/A\tN/A\t");
|
||||
jpegBuf = new byte[1][TJ.bufSize(_tilew, _tileh, subsamp)];
|
||||
jpegSize = new int[1];
|
||||
jpegSize[0] = srcSize;
|
||||
System.arraycopy(srcBuf, 0, jpegBuf[0], 0, srcSize);
|
||||
}
|
||||
|
||||
if (w == tilew)
|
||||
_tilew = _w;
|
||||
if (h == tileh)
|
||||
_tileh = _h;
|
||||
if ((xformOpt & TJTransform.OPT_NOOUTPUT) == 0)
|
||||
decompTest(null, jpegBuf, jpegSize, null, _w, _h, _subsamp, 0,
|
||||
fileName, _tilew, _tileh);
|
||||
else if (quiet == 1)
|
||||
System.out.println("N/A");
|
||||
|
||||
jpegBuf = null;
|
||||
jpegSize = null;
|
||||
|
||||
if (tilew == w && tileh == h) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void usage() throws Exception {
|
||||
int i;
|
||||
TJScalingFactor[] scalingFactors = TJ.getScalingFactors();
|
||||
int nsf = scalingFactors.length;
|
||||
String className = new TJBench().getClass().getName();
|
||||
|
||||
System.out.println("\nUSAGE: java " + className);
|
||||
System.out.println(" <Inputfile (BMP)> <Quality> [options]\n");
|
||||
System.out.println(" java " + className);
|
||||
System.out.println(" <Inputfile (JPG)> [options]\n");
|
||||
System.out.println("Options:\n");
|
||||
System.out.println("-alloc = Dynamically allocate JPEG image buffers");
|
||||
System.out.println("-bottomup = Test bottom-up compression/decompression");
|
||||
System.out.println("-tile = Test performance of the codec when the image is encoded as separate");
|
||||
System.out.println(" tiles of varying sizes.");
|
||||
System.out.println("-forcemmx, -forcesse, -forcesse2, -forcesse3 =");
|
||||
System.out.println(" Force MMX, SSE, SSE2, or SSE3 code paths in the underlying codec");
|
||||
System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =");
|
||||
System.out.println(" Test the specified color conversion path in the codec (default: BGR)");
|
||||
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
|
||||
System.out.println(" the underlying codec");
|
||||
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
|
||||
System.out.println(" codec");
|
||||
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
|
||||
System.out.println(" underlying codec");
|
||||
System.out.println("-quiet = Output results in tabular rather than verbose format");
|
||||
System.out.println("-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG");
|
||||
System.out.println("-yuvdecode = Decode JPEG image to planar YUV rather than RGB");
|
||||
System.out.println("-scale M/N = scale down the width/height of the decompressed JPEG image by a");
|
||||
System.out.print (" factor of M/N (M/N = ");
|
||||
for (i = 0; i < nsf; i++) {
|
||||
System.out.format("%d/%d", scalingFactors[i].getNum(),
|
||||
scalingFactors[i].getDenom());
|
||||
if (nsf == 2 && i != nsf - 1)
|
||||
System.out.print(" or ");
|
||||
else if (nsf > 2) {
|
||||
if (i != nsf - 1)
|
||||
System.out.print(", ");
|
||||
if (i == nsf - 2)
|
||||
System.out.print("or ");
|
||||
}
|
||||
if (i % 8 == 0 && i != 0)
|
||||
System.out.print("\n ");
|
||||
}
|
||||
System.out.println(")");
|
||||
System.out.println("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =");
|
||||
System.out.println(" Perform the corresponding lossless transform prior to");
|
||||
System.out.println(" decompression (these options are mutually exclusive)");
|
||||
System.out.println("-grayscale = Perform lossless grayscale conversion prior to decompression");
|
||||
System.out.println(" test (can be combined with the other transforms above)");
|
||||
System.out.println("-benchTime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\n");
|
||||
System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate");
|
||||
System.out.println("test will be performed for all quality values in the range.\n");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] argv) {
|
||||
byte[] srcBuf = null; int w = 0, h = 0;
|
||||
int minQual = -1, maxQual = -1;
|
||||
int minArg = 1; int retval = 0;
|
||||
|
||||
try {
|
||||
|
||||
if (argv.length < minArg)
|
||||
usage();
|
||||
|
||||
String tempStr = argv[0].toLowerCase();
|
||||
if (tempStr.endsWith(".jpg") || tempStr.endsWith(".jpeg"))
|
||||
decompOnly = true;
|
||||
|
||||
System.out.println("");
|
||||
|
||||
if (argv.length > minArg) {
|
||||
for (int i = minArg; i < argv.length; i++) {
|
||||
if (argv[i].equalsIgnoreCase("-yuvencode")) {
|
||||
System.out.println("Testing YUV planar encoding\n");
|
||||
yuv = YUVENCODE; maxQual = minQual = 100;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-yuvdecode")) {
|
||||
System.out.println("Testing YUV planar decoding\n");
|
||||
yuv = YUVDECODE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!decompOnly && yuv != YUVENCODE) {
|
||||
minArg = 2;
|
||||
if (argv.length < minArg)
|
||||
usage();
|
||||
try {
|
||||
minQual = Integer.parseInt(argv[1]);
|
||||
} catch (NumberFormatException e) {}
|
||||
if (minQual < 1 || minQual > 100)
|
||||
throw new Exception("Quality must be between 1 and 100.");
|
||||
int dashIndex = argv[1].indexOf('-');
|
||||
if (dashIndex > 0 && argv[1].length() > dashIndex + 1) {
|
||||
try {
|
||||
maxQual = Integer.parseInt(argv[1].substring(dashIndex + 1));
|
||||
} catch (NumberFormatException e) {}
|
||||
}
|
||||
if (maxQual < 1 || maxQual > 100)
|
||||
maxQual = minQual;
|
||||
}
|
||||
|
||||
if (argv.length > minArg) {
|
||||
for (int i = minArg; i < argv.length; i++) {
|
||||
if (argv[i].equalsIgnoreCase("-tile")) {
|
||||
doTile = true; xformOpt |= TJTransform.OPT_CROP;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcesse3")) {
|
||||
System.out.println("Forcing SSE3 code\n");
|
||||
flags |= TJ.FLAG_FORCESSE3;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcesse2")) {
|
||||
System.out.println("Forcing SSE2 code\n");
|
||||
flags |= TJ.FLAG_FORCESSE2;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcesse")) {
|
||||
System.out.println("Forcing SSE code\n");
|
||||
flags |= TJ.FLAG_FORCESSE;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcemmx")) {
|
||||
System.out.println("Forcing MMX code\n");
|
||||
flags |= TJ.FLAG_FORCEMMX;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-fastupsample")) {
|
||||
System.out.println("Using fast upsampling code\n");
|
||||
flags |= TJ.FLAG_FASTUPSAMPLE;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-fastdct")) {
|
||||
System.out.println("Using fastest DCT/IDCT algorithm\n");
|
||||
flags |= TJ.FLAG_FASTDCT;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-accuratedct")) {
|
||||
System.out.println("Using most accurate DCT/IDCT algorithm\n");
|
||||
flags |= TJ.FLAG_ACCURATEDCT;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-rgb"))
|
||||
pf = TJ.PF_RGB;
|
||||
if (argv[i].equalsIgnoreCase("-rgbx"))
|
||||
pf = TJ.PF_RGBX;
|
||||
if (argv[i].equalsIgnoreCase("-bgr"))
|
||||
pf = TJ.PF_BGR;
|
||||
if (argv[i].equalsIgnoreCase("-bgrx"))
|
||||
pf = TJ.PF_BGRX;
|
||||
if (argv[i].equalsIgnoreCase("-xbgr"))
|
||||
pf = TJ.PF_XBGR;
|
||||
if (argv[i].equalsIgnoreCase("-xrgb"))
|
||||
pf = TJ.PF_XRGB;
|
||||
if (argv[i].equalsIgnoreCase("-bottomup"))
|
||||
flags |= TJ.FLAG_BOTTOMUP;
|
||||
if (argv[i].equalsIgnoreCase("-quiet"))
|
||||
quiet = 1;
|
||||
if (argv[i].equalsIgnoreCase("-qq"))
|
||||
quiet = 2;
|
||||
if (argv[i].equalsIgnoreCase("-scale") && i < argv.length - 1) {
|
||||
int temp1 = 0, temp2 = 0;
|
||||
boolean match = false, scanned = true;
|
||||
Scanner scanner = new Scanner(argv[++i]).useDelimiter("/");
|
||||
try {
|
||||
temp1 = scanner.nextInt();
|
||||
temp2 = scanner.nextInt();
|
||||
} catch(Exception e) {}
|
||||
if (temp2 <= 0) temp2 = 1;
|
||||
if (temp1 > 0) {
|
||||
TJScalingFactor[] scalingFactors = TJ.getScalingFactors();
|
||||
for (int j = 0; j < scalingFactors.length; j++) {
|
||||
if ((double)temp1 / (double)temp2 ==
|
||||
(double)scalingFactors[j].getNum() /
|
||||
(double)scalingFactors[j].getDenom()) {
|
||||
sf = scalingFactors[j];
|
||||
match = true; break;
|
||||
}
|
||||
}
|
||||
if (!match) usage();
|
||||
} else
|
||||
usage();
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-hflip"))
|
||||
xformOp = TJTransform.OP_HFLIP;
|
||||
if (argv[i].equalsIgnoreCase("-vflip"))
|
||||
xformOp = TJTransform.OP_VFLIP;
|
||||
if (argv[i].equalsIgnoreCase("-transpose"))
|
||||
xformOp = TJTransform.OP_TRANSPOSE;
|
||||
if (argv[i].equalsIgnoreCase("-transverse"))
|
||||
xformOp = TJTransform.OP_TRANSVERSE;
|
||||
if (argv[i].equalsIgnoreCase("-rot90"))
|
||||
xformOp = TJTransform.OP_ROT90;
|
||||
if (argv[i].equalsIgnoreCase("-rot180"))
|
||||
xformOp = TJTransform.OP_ROT180;
|
||||
if (argv[i].equalsIgnoreCase("-rot270"))
|
||||
xformOp = TJTransform.OP_ROT270;
|
||||
if (argv[i].equalsIgnoreCase("-grayscale"))
|
||||
xformOpt |= TJTransform.OPT_GRAY;
|
||||
if (argv[i].equalsIgnoreCase("-nooutput"))
|
||||
xformOpt |= TJTransform.OPT_NOOUTPUT;
|
||||
if (argv[i].equalsIgnoreCase("-benchtime") && i < argv.length - 1) {
|
||||
double temp = -1;
|
||||
try {
|
||||
temp = Double.parseDouble(argv[++i]);
|
||||
} catch (NumberFormatException e) {}
|
||||
if (temp > 0.0)
|
||||
benchTime = temp;
|
||||
else
|
||||
usage();
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-?"))
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (sf == null)
|
||||
sf = new TJScalingFactor(1, 1);
|
||||
|
||||
if ((sf.getNum() != 1 || sf.getDenom() != 1) && doTile) {
|
||||
System.out.println("Disabling tiled compression/decompression tests, because those tests do not");
|
||||
System.out.println("work when scaled decompression is enabled.");
|
||||
doTile = false;
|
||||
}
|
||||
|
||||
if (yuv != 0 && doTile) {
|
||||
System.out.println("Disabling tiled compression/decompression tests, because those tests do not");
|
||||
System.out.println("work when YUV encoding or decoding is enabled.\n");
|
||||
doTile = false;
|
||||
}
|
||||
|
||||
if (!decompOnly) {
|
||||
int[] width = new int[1], height = new int[1];
|
||||
srcBuf = loadImage(argv[0], width, height, pf);
|
||||
w = width[0]; h = height[0];
|
||||
int index = -1;
|
||||
if ((index = argv[0].indexOf('.')) >= 0)
|
||||
argv[0] = argv[0].substring(0, index);
|
||||
}
|
||||
|
||||
if (quiet == 1 && !decompOnly) {
|
||||
System.out.println("All performance values in Mpixels/sec\n");
|
||||
System.out.format("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tComp\tComp\tDecomp\n",
|
||||
(doTile ? "Tile " : "Image"), (doTile ? "Tile " : "Image"));
|
||||
System.out.println("Format\tOrder\tSubsamp\tQual\tWidth Height\tPerf \tRatio\tPerf\n");
|
||||
}
|
||||
|
||||
if (decompOnly) {
|
||||
doDecompTest(argv[0]);
|
||||
System.out.println("");
|
||||
System.exit(retval);
|
||||
}
|
||||
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]);
|
||||
System.out.println("");
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]);
|
||||
System.out.println("");
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]);
|
||||
System.out.println("");
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]);
|
||||
System.out.println("");
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("ERROR: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
retval = -1;
|
||||
}
|
||||
|
||||
System.exit(retval);
|
||||
}
|
||||
|
||||
}
|
||||
361
java/TJExample.java
Normal file
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - 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.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 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 HOLDERS 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program demonstrates how to compress and decompress JPEG files using
|
||||
* the TurboJPEG JNI wrapper
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.awt.*;
|
||||
import java.awt.image.*;
|
||||
import java.nio.*;
|
||||
import javax.imageio.*;
|
||||
import javax.swing.*;
|
||||
import org.libjpegturbo.turbojpeg.*;
|
||||
|
||||
public class TJExample implements TJCustomFilter {
|
||||
|
||||
public static final String classname = new TJExample().getClass().getName();
|
||||
|
||||
private static void usage() throws Exception {
|
||||
System.out.println("\nUSAGE: java " + classname + " <Input file> <Output file> [options]\n");
|
||||
System.out.println("Input and output files can be any image format that the Java Image I/O");
|
||||
System.out.println("extensions understand. If either filename ends in a .jpg extension, then");
|
||||
System.out.println("TurboJPEG will be used to compress or decompress the file.\n");
|
||||
System.out.println("Options:\n");
|
||||
System.out.println("-scale M/N = if the input image is a JPEG file, scale the width/height of the");
|
||||
System.out.print(" output image by a factor of M/N (M/N = ");
|
||||
for (int i = 0; i < sf.length; i++) {
|
||||
System.out.print(sf[i].getNum() + "/" + sf[i].getDenom());
|
||||
if (sf.length == 2 && i != sf.length - 1)
|
||||
System.out.print(" or ");
|
||||
else if (sf.length > 2) {
|
||||
if (i != sf.length - 1)
|
||||
System.out.print(", ");
|
||||
if (i == sf.length - 2)
|
||||
System.out.print("or ");
|
||||
}
|
||||
}
|
||||
System.out.println(")\n");
|
||||
System.out.println("-samp <444|422|420|gray> = If the output image is a JPEG file, this specifies");
|
||||
System.out.println(" the level of chrominance subsampling to use when");
|
||||
System.out.println(" recompressing it. Default is to use the same level");
|
||||
System.out.println(" of subsampling as the input, if the input is a JPEG");
|
||||
System.out.println(" file, or 4:4:4 otherwise.\n");
|
||||
System.out.println("-q <1-100> = If the output image is a JPEG file, this specifies the JPEG");
|
||||
System.out.println(" quality to use when recompressing it (default = 95).\n");
|
||||
System.out.println("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =");
|
||||
System.out.println(" If the input image is a JPEG file, perform the corresponding lossless");
|
||||
System.out.println(" transform prior to decompression (these options are mutually exclusive)\n");
|
||||
System.out.println("-grayscale = If the input image is a JPEG file, perform lossless grayscale");
|
||||
System.out.println(" conversion prior to decompression (can be combined with the other");
|
||||
System.out.println(" transforms above)\n");
|
||||
System.out.println("-crop X,Y,WxH = If the input image is a JPEG file, perform lossless cropping");
|
||||
System.out.println(" prior to decompression. X,Y specifies the upper left corner of the");
|
||||
System.out.println(" cropping region, and WxH specifies its width and height. X,Y must be");
|
||||
System.out.println(" evenly divible by the MCU block size (8x8 if the source image was");
|
||||
System.out.println(" compressed using no subsampling or grayscale, or 16x8 for 4:2:2 or 16x16");
|
||||
System.out.println(" for 4:2:0.)\n");
|
||||
System.out.println("-display = Display output image (Output file need not be specified in this");
|
||||
System.out.println(" case.)\n");
|
||||
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
|
||||
System.out.println(" the underlying codec\n");
|
||||
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
|
||||
System.out.println(" codec\n");
|
||||
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
|
||||
System.out.println(" underlying codec\n");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
private static final String[] sampName = {
|
||||
"4:4:4", "4:2:2", "4:2:0", "Grayscale", "4:4:0"
|
||||
};
|
||||
|
||||
public static void main(String[] argv) {
|
||||
|
||||
BufferedImage img = null;
|
||||
byte[] bmpBuf = null;
|
||||
TJTransform xform = new TJTransform();
|
||||
int flags = 0;
|
||||
|
||||
try {
|
||||
|
||||
sf = TJ.getScalingFactors();
|
||||
|
||||
if (argv.length < 2) {
|
||||
usage();
|
||||
}
|
||||
|
||||
TJScalingFactor scaleFactor = new TJScalingFactor(1, 1);
|
||||
String inFormat = "jpg", outFormat = "jpg";
|
||||
int outSubsamp = -1, outQual = 95;
|
||||
boolean display = false;
|
||||
|
||||
if (argv.length > 1) {
|
||||
for (int i = 1; i < argv.length; i++) {
|
||||
if (argv[i].length() < 2)
|
||||
continue;
|
||||
if (argv[i].length() > 2 &&
|
||||
argv[i].substring(0, 3).equalsIgnoreCase("-sc")) {
|
||||
int match = 0;
|
||||
if (i < argv.length - 1) {
|
||||
String[] scaleArg = argv[++i].split("/");
|
||||
if (scaleArg.length == 2) {
|
||||
TJScalingFactor tempsf =
|
||||
new TJScalingFactor(Integer.parseInt(scaleArg[0]),
|
||||
Integer.parseInt(scaleArg[1]));
|
||||
for (int j = 0; j < sf.length; j++) {
|
||||
if (tempsf.equals(sf[j])) {
|
||||
scaleFactor = sf[j];
|
||||
match = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (match != 1) usage();
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-h") || argv[i].equalsIgnoreCase("-?"))
|
||||
usage();
|
||||
if (argv[i].length() > 2 &&
|
||||
argv[i].substring(0, 3).equalsIgnoreCase("-sa")) {
|
||||
if (i < argv.length - 1) {
|
||||
i++;
|
||||
if (argv[i].substring(0, 1).equalsIgnoreCase("g"))
|
||||
outSubsamp = TJ.SAMP_GRAY;
|
||||
else if (argv[i].equals("444"))
|
||||
outSubsamp = TJ.SAMP_444;
|
||||
else if (argv[i].equals("422"))
|
||||
outSubsamp = TJ.SAMP_422;
|
||||
else if (argv[i].equals("420"))
|
||||
outSubsamp = TJ.SAMP_420;
|
||||
else
|
||||
usage();
|
||||
} else
|
||||
usage();
|
||||
}
|
||||
if (argv[i].substring(0, 2).equalsIgnoreCase("-q")) {
|
||||
if (i < argv.length - 1) {
|
||||
int qual = Integer.parseInt(argv[++i]);
|
||||
if (qual >= 1 && qual <= 100)
|
||||
outQual = qual;
|
||||
else
|
||||
usage();
|
||||
} else
|
||||
usage();
|
||||
}
|
||||
if (argv[i].substring(0, 2).equalsIgnoreCase("-g"))
|
||||
xform.options |= TJTransform.OPT_GRAY;
|
||||
if (argv[i].equalsIgnoreCase("-hflip"))
|
||||
xform.op = TJTransform.OP_HFLIP;
|
||||
if (argv[i].equalsIgnoreCase("-vflip"))
|
||||
xform.op = TJTransform.OP_VFLIP;
|
||||
if (argv[i].equalsIgnoreCase("-transpose"))
|
||||
xform.op = TJTransform.OP_TRANSPOSE;
|
||||
if (argv[i].equalsIgnoreCase("-transverse"))
|
||||
xform.op = TJTransform.OP_TRANSVERSE;
|
||||
if (argv[i].equalsIgnoreCase("-rot90"))
|
||||
xform.op = TJTransform.OP_ROT90;
|
||||
if (argv[i].equalsIgnoreCase("-rot180"))
|
||||
xform.op = TJTransform.OP_ROT180;
|
||||
if (argv[i].equalsIgnoreCase("-rot270"))
|
||||
xform.op = TJTransform.OP_ROT270;
|
||||
if (argv[i].equalsIgnoreCase("-custom"))
|
||||
xform.cf = new TJExample();
|
||||
else if (argv[i].length() > 2 &&
|
||||
argv[i].substring(0, 2).equalsIgnoreCase("-c")) {
|
||||
if (i >= argv.length - 1)
|
||||
usage();
|
||||
String[] cropArg = argv[++i].split(",");
|
||||
if (cropArg.length != 3)
|
||||
usage();
|
||||
String[] dimArg = cropArg[2].split("[xX]");
|
||||
if (dimArg.length != 2)
|
||||
usage();
|
||||
int tempx = Integer.parseInt(cropArg[0]);
|
||||
int tempy = Integer.parseInt(cropArg[1]);
|
||||
int tempw = Integer.parseInt(dimArg[0]);
|
||||
int temph = Integer.parseInt(dimArg[1]);
|
||||
if (tempx < 0 || tempy < 0 || tempw < 0 || temph < 0)
|
||||
usage();
|
||||
xform.x = tempx;
|
||||
xform.y = tempy;
|
||||
xform.width = tempw;
|
||||
xform.height = temph;
|
||||
xform.options |= TJTransform.OPT_CROP;
|
||||
}
|
||||
if (argv[i].substring(0, 2).equalsIgnoreCase("-d"))
|
||||
display = true;
|
||||
if (argv[i].equalsIgnoreCase("-fastupsample")) {
|
||||
System.out.println("Using fast upsampling code");
|
||||
flags |= TJ.FLAG_FASTUPSAMPLE;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-fastdct")) {
|
||||
System.out.println("Using fastest DCT/IDCT algorithm");
|
||||
flags |= TJ.FLAG_FASTDCT;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-accuratedct")) {
|
||||
System.out.println("Using most accurate DCT/IDCT algorithm");
|
||||
flags |= TJ.FLAG_ACCURATEDCT;
|
||||
}
|
||||
}
|
||||
}
|
||||
String[] inFileTokens = argv[0].split("\\.");
|
||||
if (inFileTokens.length > 1)
|
||||
inFormat = inFileTokens[inFileTokens.length - 1];
|
||||
String[] outFileTokens;
|
||||
if (display)
|
||||
outFormat = "bmp";
|
||||
else {
|
||||
outFileTokens = argv[1].split("\\.");
|
||||
if (outFileTokens.length > 1)
|
||||
outFormat = outFileTokens[outFileTokens.length - 1];
|
||||
}
|
||||
|
||||
File file = new File(argv[0]);
|
||||
int width, height;
|
||||
|
||||
if (inFormat.equalsIgnoreCase("jpg")) {
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
int inputSize = fis.available();
|
||||
if (inputSize < 1) {
|
||||
System.out.println("Input file contains no data");
|
||||
System.exit(1);
|
||||
}
|
||||
byte[] inputBuf = new byte[inputSize];
|
||||
fis.read(inputBuf);
|
||||
fis.close();
|
||||
|
||||
TJDecompressor tjd;
|
||||
if (xform.op != TJTransform.OP_NONE || xform.options != 0 ||
|
||||
xform.cf != null) {
|
||||
TJTransformer tjt = new TJTransformer(inputBuf);
|
||||
TJTransform[] t = new TJTransform[1];
|
||||
t[0] = xform;
|
||||
t[0].options |= TJTransform.OPT_TRIM;
|
||||
TJDecompressor[] tjdx = tjt.transform(t, 0);
|
||||
tjd = tjdx[0];
|
||||
} else
|
||||
tjd = new TJDecompressor(inputBuf);
|
||||
|
||||
width = tjd.getWidth();
|
||||
height = tjd.getHeight();
|
||||
int inSubsamp = tjd.getSubsamp();
|
||||
System.out.println("Source Image: " + width + " x " + height +
|
||||
" pixels, " + sampName[inSubsamp] + " subsampling");
|
||||
if (outSubsamp < 0)
|
||||
outSubsamp = inSubsamp;
|
||||
|
||||
if (outFormat.equalsIgnoreCase("jpg") &&
|
||||
(xform.op != TJTransform.OP_NONE || xform.options != 0) &&
|
||||
scaleFactor.isOne()) {
|
||||
file = new File(argv[1]);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize());
|
||||
fos.close();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
width = scaleFactor.getScaled(width);
|
||||
height = scaleFactor.getScaled(height);
|
||||
|
||||
if (!outFormat.equalsIgnoreCase("jpg"))
|
||||
img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB,
|
||||
flags);
|
||||
else
|
||||
bmpBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, flags);
|
||||
tjd.close();
|
||||
} else {
|
||||
img = ImageIO.read(file);
|
||||
if (img == null)
|
||||
throw new Exception("Input image type not supported.");
|
||||
width = img.getWidth();
|
||||
height = img.getHeight();
|
||||
if (outSubsamp < 0) {
|
||||
if (img.getType() == BufferedImage.TYPE_BYTE_GRAY)
|
||||
outSubsamp = TJ.SAMP_GRAY;
|
||||
else
|
||||
outSubsamp = TJ.SAMP_444;
|
||||
}
|
||||
}
|
||||
System.gc();
|
||||
if (!display)
|
||||
System.out.print("Dest. Image (" + outFormat + "): " + width + " x " +
|
||||
height + " pixels");
|
||||
|
||||
if (display) {
|
||||
ImageIcon icon = new ImageIcon(img);
|
||||
JLabel label = new JLabel(icon, JLabel.CENTER);
|
||||
JOptionPane.showMessageDialog(null, label, "Output Image",
|
||||
JOptionPane.PLAIN_MESSAGE);
|
||||
} else if (outFormat.equalsIgnoreCase("jpg")) {
|
||||
System.out.println(", " + sampName[outSubsamp] +
|
||||
" subsampling, quality = " + outQual);
|
||||
TJCompressor tjc = new TJCompressor();
|
||||
int jpegSize;
|
||||
byte[] jpegBuf;
|
||||
|
||||
tjc.setSubsamp(outSubsamp);
|
||||
tjc.setJPEGQuality(outQual);
|
||||
if (img != null)
|
||||
jpegBuf = tjc.compress(img, flags);
|
||||
else {
|
||||
tjc.setSourceImage(bmpBuf, width, 0, height, TJ.PF_BGRX);
|
||||
jpegBuf = tjc.compress(flags);
|
||||
}
|
||||
jpegSize = tjc.getCompressedSize();
|
||||
tjc.close();
|
||||
|
||||
file = new File(argv[1]);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
fos.write(jpegBuf, 0, jpegSize);
|
||||
fos.close();
|
||||
} else {
|
||||
System.out.print("\n");
|
||||
file = new File(argv[1]);
|
||||
ImageIO.write(img, outFormat, file);
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
public void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,
|
||||
Rectangle planeRegion, int componentIndex,
|
||||
int transformIndex, TJTransform transform)
|
||||
throws Exception {
|
||||
for (int i = 0; i < bufferRegion.width * bufferRegion.height; i++) {
|
||||
coeffBuffer.put(i, (short)(-coeffBuffer.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
static TJScalingFactor[] sf = null;
|
||||
};
|
||||
914
java/TJUnitTest.java
Normal file
@@ -0,0 +1,914 @@
|
||||
/*
|
||||
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - 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.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 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 HOLDERS 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program tests the various code paths in the TurboJPEG JNI Wrapper
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.awt.image.*;
|
||||
import javax.imageio.*;
|
||||
import java.nio.*;
|
||||
import org.libjpegturbo.turbojpeg.*;
|
||||
|
||||
public class TJUnitTest {
|
||||
|
||||
private static final String classname =
|
||||
new TJUnitTest().getClass().getName();
|
||||
|
||||
private static void usage() {
|
||||
System.out.println("\nUSAGE: java " + classname + " [options]\n");
|
||||
System.out.println("Options:\n");
|
||||
System.out.println("-yuv = test YUV encoding/decoding support\n");
|
||||
System.out.println("-bi = test BufferedImage support\n");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
private static final String[] subNameLong = {
|
||||
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0"
|
||||
};
|
||||
private static final String[] subName = {
|
||||
"444", "422", "420", "GRAY", "440"
|
||||
};
|
||||
|
||||
private static final String[] pixFormatStr = {
|
||||
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale",
|
||||
"RGBA", "BGRA", "ABGR", "ARGB"
|
||||
};
|
||||
|
||||
private static final int[] alphaOffset = {
|
||||
-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0
|
||||
};
|
||||
|
||||
private static final int[] _3byteFormats = {
|
||||
TJ.PF_RGB, TJ.PF_BGR
|
||||
};
|
||||
private static final int[] _3byteFormatsBI = {
|
||||
BufferedImage.TYPE_3BYTE_BGR
|
||||
};
|
||||
private static final int[] _4byteFormats = {
|
||||
TJ.PF_RGBX, TJ.PF_BGRX, TJ.PF_XBGR, TJ.PF_XRGB
|
||||
};
|
||||
private static final int[] _4byteFormatsBI = {
|
||||
BufferedImage.TYPE_INT_BGR, BufferedImage.TYPE_INT_RGB,
|
||||
BufferedImage.TYPE_4BYTE_ABGR, BufferedImage.TYPE_4BYTE_ABGR_PRE,
|
||||
BufferedImage.TYPE_INT_ARGB, BufferedImage.TYPE_INT_ARGB_PRE
|
||||
};
|
||||
private static final int[] onlyGray = {
|
||||
TJ.PF_GRAY
|
||||
};
|
||||
private static final int[] onlyGrayBI = {
|
||||
BufferedImage.TYPE_BYTE_GRAY
|
||||
};
|
||||
private static final int[] onlyRGB = {
|
||||
TJ.PF_RGB
|
||||
};
|
||||
|
||||
private static final int YUVENCODE = 1;
|
||||
private static final int YUVDECODE = 2;
|
||||
private static int yuv = 0;
|
||||
private static boolean bi = false;
|
||||
|
||||
private static int exitStatus = 0;
|
||||
|
||||
private static int biTypePF(int biType) {
|
||||
ByteOrder byteOrder = ByteOrder.nativeOrder();
|
||||
switch(biType) {
|
||||
case BufferedImage.TYPE_3BYTE_BGR:
|
||||
return TJ.PF_BGR;
|
||||
case BufferedImage.TYPE_4BYTE_ABGR:
|
||||
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
|
||||
return TJ.PF_XBGR;
|
||||
case BufferedImage.TYPE_BYTE_GRAY:
|
||||
return TJ.PF_GRAY;
|
||||
case BufferedImage.TYPE_INT_BGR:
|
||||
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
||||
return TJ.PF_XBGR;
|
||||
else
|
||||
return TJ.PF_RGBX;
|
||||
case BufferedImage.TYPE_INT_RGB:
|
||||
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
||||
return TJ.PF_XRGB;
|
||||
else
|
||||
return TJ.PF_BGRX;
|
||||
case BufferedImage.TYPE_INT_ARGB:
|
||||
case BufferedImage.TYPE_INT_ARGB_PRE:
|
||||
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
||||
return TJ.PF_ARGB;
|
||||
else
|
||||
return TJ.PF_BGRA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static String biTypeStr(int biType) {
|
||||
switch(biType) {
|
||||
case BufferedImage.TYPE_3BYTE_BGR:
|
||||
return "3BYTE_BGR";
|
||||
case BufferedImage.TYPE_4BYTE_ABGR:
|
||||
return "4BYTE_ABGR";
|
||||
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
|
||||
return "4BYTE_ABGR_PRE";
|
||||
case BufferedImage.TYPE_BYTE_GRAY:
|
||||
return "BYTE_GRAY";
|
||||
case BufferedImage.TYPE_INT_BGR:
|
||||
return "INT_BGR";
|
||||
case BufferedImage.TYPE_INT_RGB:
|
||||
return "INT_RGB";
|
||||
case BufferedImage.TYPE_INT_ARGB:
|
||||
return "INT_ARGB";
|
||||
case BufferedImage.TYPE_INT_ARGB_PRE:
|
||||
return "INT_ARGB_PRE";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
private static double getTime() {
|
||||
return (double)System.nanoTime() / 1.0e9;
|
||||
}
|
||||
|
||||
private static void initBuf(byte[] buf, int w, int pitch, int h, int pf,
|
||||
int flags) throws Exception {
|
||||
int roffset = TJ.getRedOffset(pf);
|
||||
int goffset = TJ.getGreenOffset(pf);
|
||||
int boffset = TJ.getBlueOffset(pf);
|
||||
int aoffset = alphaOffset[pf];
|
||||
int ps = TJ.getPixelSize(pf);
|
||||
int index, row, col, halfway = 16;
|
||||
|
||||
Arrays.fill(buf, (byte)0);
|
||||
if (pf == TJ.PF_GRAY) {
|
||||
for (row = 0; row < h; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
index = pitch * (h - row - 1) + col;
|
||||
else
|
||||
index = pitch * row + col;
|
||||
if (((row / 8) + (col / 8)) % 2 == 0)
|
||||
buf[index] = (row < halfway) ? (byte)255 : 0;
|
||||
else
|
||||
buf[index] = (row < halfway) ? 76 : (byte)226;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (row = 0; row < h; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
index = pitch * (h - row - 1) + col * ps;
|
||||
else
|
||||
index = pitch * row + col * ps;
|
||||
if (((row / 8) + (col / 8)) % 2 == 0) {
|
||||
if (row < halfway) {
|
||||
buf[index + roffset] = (byte)255;
|
||||
buf[index + goffset] = (byte)255;
|
||||
buf[index + boffset] = (byte)255;
|
||||
}
|
||||
} else {
|
||||
buf[index + roffset] = (byte)255;
|
||||
if (row >= halfway)
|
||||
buf[index + goffset] = (byte)255;
|
||||
}
|
||||
if (aoffset >= 0)
|
||||
buf[index + aoffset] = (byte)255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void initIntBuf(int[] buf, int w, int pitch, int h, int pf,
|
||||
int flags) throws Exception {
|
||||
int rshift = TJ.getRedOffset(pf) * 8;
|
||||
int gshift = TJ.getGreenOffset(pf) * 8;
|
||||
int bshift = TJ.getBlueOffset(pf) * 8;
|
||||
int ashift = alphaOffset[pf] * 8;
|
||||
int index, row, col, halfway = 16;
|
||||
|
||||
Arrays.fill(buf, 0);
|
||||
for (row = 0; row < h; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
index = pitch * (h - row - 1) + col;
|
||||
else
|
||||
index = pitch * row + col;
|
||||
if (((row / 8) + (col / 8)) % 2 == 0) {
|
||||
if (row < halfway) {
|
||||
buf[index] |= (255 << rshift);
|
||||
buf[index] |= (255 << gshift);
|
||||
buf[index] |= (255 << bshift);
|
||||
}
|
||||
} else {
|
||||
buf[index] |= (255 << rshift);
|
||||
if (row >= halfway)
|
||||
buf[index] |= (255 << gshift);
|
||||
}
|
||||
if (ashift >= 0)
|
||||
buf[index] |= (255 << ashift);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void initImg(BufferedImage img, int pf, int flags)
|
||||
throws Exception {
|
||||
WritableRaster wr = img.getRaster();
|
||||
int imgType = img.getType();
|
||||
if (imgType == BufferedImage.TYPE_INT_RGB ||
|
||||
imgType == BufferedImage.TYPE_INT_BGR ||
|
||||
imgType == BufferedImage.TYPE_INT_ARGB ||
|
||||
imgType == BufferedImage.TYPE_INT_ARGB_PRE) {
|
||||
SinglePixelPackedSampleModel sm =
|
||||
(SinglePixelPackedSampleModel)img.getSampleModel();
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
||||
int[] buf = db.getData();
|
||||
initIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, flags);
|
||||
} else {
|
||||
ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel();
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
byte[] buf = db.getData();
|
||||
initBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, flags);
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkVal(int row, int col, int v, String vname, int cv)
|
||||
throws Exception {
|
||||
v = (v < 0) ? v + 256 : v;
|
||||
if (v < cv - 1 || v > cv + 1) {
|
||||
throw new Exception("Comp. " + vname + " at " + row + "," + col +
|
||||
" should be " + cv + ", not " + v);
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkVal0(int row, int col, int v, String vname)
|
||||
throws Exception {
|
||||
v = (v < 0) ? v + 256 : v;
|
||||
if (v > 1) {
|
||||
throw new Exception("Comp. " + vname + " at " + row + "," + col +
|
||||
" should be 0, not " + v);
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkVal255(int row, int col, int v, String vname)
|
||||
throws Exception {
|
||||
v = (v < 0) ? v + 256 : v;
|
||||
if (v < 254) {
|
||||
throw new Exception("Comp. " + vname + " at " + row + "," + col +
|
||||
" should be 255, not " + v);
|
||||
}
|
||||
}
|
||||
|
||||
private static int checkBuf(byte[] buf, int w, int pitch, int h, int pf,
|
||||
int subsamp, TJScalingFactor sf, int flags)
|
||||
throws Exception {
|
||||
int roffset = TJ.getRedOffset(pf);
|
||||
int goffset = TJ.getGreenOffset(pf);
|
||||
int boffset = TJ.getBlueOffset(pf);
|
||||
int aoffset = alphaOffset[pf];
|
||||
int ps = TJ.getPixelSize(pf);
|
||||
int index, row, col, retval = 1;
|
||||
int halfway = 16 * sf.getNum() / sf.getDenom();
|
||||
int blockSize = 8 * sf.getNum() / sf.getDenom();
|
||||
|
||||
try {
|
||||
for (row = 0; row < halfway; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
index = pitch * (h - row - 1) + col * ps;
|
||||
else
|
||||
index = pitch * row + col * ps;
|
||||
byte r = buf[index + roffset];
|
||||
byte g = buf[index + goffset];
|
||||
byte b = buf[index + boffset];
|
||||
byte a = aoffset >= 0 ? buf[index + aoffset] : (byte)255;
|
||||
if (((row / blockSize) + (col / blockSize)) % 2 == 0) {
|
||||
if (row < halfway) {
|
||||
checkVal255(row, col, r, "R");
|
||||
checkVal255(row, col, g, "G");
|
||||
checkVal255(row, col, b, "B");
|
||||
} else {
|
||||
checkVal0(row, col, r, "R");
|
||||
checkVal0(row, col, g, "G");
|
||||
checkVal0(row, col, b, "B");
|
||||
}
|
||||
} else {
|
||||
if (subsamp == TJ.SAMP_GRAY) {
|
||||
if (row < halfway) {
|
||||
checkVal(row, col, r, "R", 76);
|
||||
checkVal(row, col, g, "G", 76);
|
||||
checkVal(row, col, b, "B", 76);
|
||||
} else {
|
||||
checkVal(row, col, r, "R", 226);
|
||||
checkVal(row, col, g, "G", 226);
|
||||
checkVal(row, col, b, "B", 226);
|
||||
}
|
||||
} else {
|
||||
checkVal255(row, col, r, "R");
|
||||
if (row < halfway) {
|
||||
checkVal0(row, col, g, "G");
|
||||
} else {
|
||||
checkVal255(row, col, g, "G");
|
||||
}
|
||||
checkVal0(row, col, b, "B");
|
||||
}
|
||||
}
|
||||
checkVal255(row, col, a, "A");
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("\n" + e.getMessage());
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
if (retval == 0) {
|
||||
for (row = 0; row < h; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
int r = buf[pitch * row + col * ps + roffset];
|
||||
int g = buf[pitch * row + col * ps + goffset];
|
||||
int b = buf[pitch * row + col * ps + boffset];
|
||||
if (r < 0) r += 256;
|
||||
if (g < 0) g += 256;
|
||||
if (b < 0) b += 256;
|
||||
System.out.format("%3d/%3d/%3d ", r, g, b);
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
private static int checkIntBuf(int[] buf, int w, int pitch, int h, int pf,
|
||||
int subsamp, TJScalingFactor sf, int flags)
|
||||
throws Exception {
|
||||
int rshift = TJ.getRedOffset(pf) * 8;
|
||||
int gshift = TJ.getGreenOffset(pf) * 8;
|
||||
int bshift = TJ.getBlueOffset(pf) * 8;
|
||||
int ashift = alphaOffset[pf] * 8;
|
||||
int index, row, col, retval = 1;
|
||||
int halfway = 16 * sf.getNum() / sf.getDenom();
|
||||
int blockSize = 8 * sf.getNum() / sf.getDenom();
|
||||
|
||||
try {
|
||||
for (row = 0; row < halfway; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
index = pitch * (h - row - 1) + col;
|
||||
else
|
||||
index = pitch * row + col;
|
||||
int r = (buf[index] >> rshift) & 0xFF;
|
||||
int g = (buf[index] >> gshift) & 0xFF;
|
||||
int b = (buf[index] >> bshift) & 0xFF;
|
||||
int a = ashift >= 0 ? (buf[index] >> ashift) & 0xFF : 255;
|
||||
if (((row / blockSize) + (col / blockSize)) % 2 == 0) {
|
||||
if (row < halfway) {
|
||||
checkVal255(row, col, r, "R");
|
||||
checkVal255(row, col, g, "G");
|
||||
checkVal255(row, col, b, "B");
|
||||
} else {
|
||||
checkVal0(row, col, r, "R");
|
||||
checkVal0(row, col, g, "G");
|
||||
checkVal0(row, col, b, "B");
|
||||
}
|
||||
} else {
|
||||
if (subsamp == TJ.SAMP_GRAY) {
|
||||
if (row < halfway) {
|
||||
checkVal(row, col, r, "R", 76);
|
||||
checkVal(row, col, g, "G", 76);
|
||||
checkVal(row, col, b, "B", 76);
|
||||
} else {
|
||||
checkVal(row, col, r, "R", 226);
|
||||
checkVal(row, col, g, "G", 226);
|
||||
checkVal(row, col, b, "B", 226);
|
||||
}
|
||||
} else {
|
||||
checkVal255(row, col, r, "R");
|
||||
if (row < halfway) {
|
||||
checkVal0(row, col, g, "G");
|
||||
} else {
|
||||
checkVal255(row, col, g, "G");
|
||||
}
|
||||
checkVal0(row, col, b, "B");
|
||||
}
|
||||
}
|
||||
checkVal255(row, col, a, "A");
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("\n" + e.getMessage());
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
if (retval == 0) {
|
||||
for (row = 0; row < h; row++) {
|
||||
for (col = 0; col < w; col++) {
|
||||
int r = (buf[pitch * row + col] >> rshift) & 0xFF;
|
||||
int g = (buf[pitch * row + col] >> gshift) & 0xFF;
|
||||
int b = (buf[pitch * row + col] >> bshift) & 0xFF;
|
||||
if (r < 0) r += 256;
|
||||
if (g < 0) g += 256;
|
||||
if (b < 0) b += 256;
|
||||
System.out.format("%3d/%3d/%3d ", r, g, b);
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
private static int checkImg(BufferedImage img, int pf, int subsamp,
|
||||
TJScalingFactor sf, int flags) throws Exception {
|
||||
WritableRaster wr = img.getRaster();
|
||||
int imgType = img.getType();
|
||||
if (imgType == BufferedImage.TYPE_INT_RGB ||
|
||||
imgType == BufferedImage.TYPE_INT_BGR ||
|
||||
imgType == BufferedImage.TYPE_INT_ARGB ||
|
||||
imgType == BufferedImage.TYPE_INT_ARGB_PRE) {
|
||||
SinglePixelPackedSampleModel sm =
|
||||
(SinglePixelPackedSampleModel)img.getSampleModel();
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
||||
int[] buf = db.getData();
|
||||
return checkIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf,
|
||||
subsamp, sf, flags);
|
||||
} else {
|
||||
ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel();
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
byte[] buf = db.getData();
|
||||
return checkBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, subsamp,
|
||||
sf, flags);
|
||||
}
|
||||
}
|
||||
|
||||
private static int PAD(int v, int p) {
|
||||
return ((v + (p) - 1) & (~((p) - 1)));
|
||||
}
|
||||
|
||||
private static int checkBufYUV(byte[] buf, int size, int w, int h,
|
||||
int subsamp) throws Exception {
|
||||
int row, col;
|
||||
int hsf = TJ.getMCUWidth(subsamp) / 8, vsf = TJ.getMCUHeight(subsamp) / 8;
|
||||
int pw = PAD(w, hsf), ph = PAD(h, vsf);
|
||||
int cw = pw / hsf, ch = ph / vsf;
|
||||
int ypitch = PAD(pw, 4), uvpitch = PAD(cw, 4);
|
||||
int retval = 1;
|
||||
int correctsize = ypitch * ph +
|
||||
(subsamp == TJ.SAMP_GRAY ? 0 : uvpitch * ch * 2);
|
||||
int halfway = 16;
|
||||
|
||||
try {
|
||||
if (size != correctsize)
|
||||
throw new Exception("Incorrect size " + size + ". Should be " +
|
||||
correctsize);
|
||||
|
||||
for (row = 0; row < ph; row++) {
|
||||
for (col = 0; col < pw; col++) {
|
||||
byte y = buf[ypitch * row + col];
|
||||
if (((row / 8) + (col / 8)) % 2 == 0) {
|
||||
if (row < halfway)
|
||||
checkVal255(row, col, y, "Y");
|
||||
else
|
||||
checkVal0(row, col, y, "Y");
|
||||
} else {
|
||||
if (row < halfway)
|
||||
checkVal(row, col, y, "Y", 76);
|
||||
else
|
||||
checkVal(row, col, y, "Y", 226);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (subsamp != TJ.SAMP_GRAY) {
|
||||
halfway = 16 / vsf;
|
||||
for (row = 0; row < ch; row++) {
|
||||
for (col = 0; col < cw; col++) {
|
||||
byte u = buf[ypitch * ph + (uvpitch * row + col)],
|
||||
v = buf[ypitch * ph + uvpitch * ch + (uvpitch * row + col)];
|
||||
if (((row * vsf / 8) + (col * hsf / 8)) % 2 == 0) {
|
||||
checkVal(row, col, u, "U", 128);
|
||||
checkVal(row, col, v, "V", 128);
|
||||
} else {
|
||||
if (row < halfway) {
|
||||
checkVal(row, col, u, "U", 85);
|
||||
checkVal255(row, col, v, "V");
|
||||
} else {
|
||||
checkVal0(row, col, u, "U");
|
||||
checkVal(row, col, v, "V", 149);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("\n" + e.getMessage());
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
if (retval == 0) {
|
||||
for (row = 0; row < ph; row++) {
|
||||
for (col = 0; col < pw; col++) {
|
||||
int y = buf[ypitch * row + col];
|
||||
if (y < 0) y += 256;
|
||||
System.out.format("%3d ", y);
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
System.out.print("\n");
|
||||
for (row = 0; row < ch; row++) {
|
||||
for (col = 0; col < cw; col++) {
|
||||
int u = buf[ypitch * ph + (uvpitch * row + col)];
|
||||
if (u < 0) u += 256;
|
||||
System.out.format("%3d ", u);
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
System.out.print("\n");
|
||||
for (row = 0; row < ch; row++) {
|
||||
for (col = 0; col < cw; col++) {
|
||||
int v = buf[ypitch * ph + uvpitch * ch + (uvpitch * row + col)];
|
||||
if (v < 0) v += 256;
|
||||
System.out.format("%3d ", v);
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
private static void writeJPEG(byte[] jpegBuf, int jpegBufSize,
|
||||
String filename) throws Exception {
|
||||
File file = new File(filename);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
fos.write(jpegBuf, 0, jpegBufSize);
|
||||
fos.close();
|
||||
}
|
||||
|
||||
private static int compTest(TJCompressor tjc, byte[] dstBuf, int w,
|
||||
int h, int pf, String baseName, int subsamp,
|
||||
int jpegQual, int flags) throws Exception {
|
||||
String tempstr;
|
||||
byte[] srcBuf = null;
|
||||
BufferedImage img = null;
|
||||
String pfStr;
|
||||
double t;
|
||||
int size = 0, ps, imgType = pf;
|
||||
|
||||
if (bi) {
|
||||
pf = biTypePF(imgType);
|
||||
pfStr = biTypeStr(imgType);
|
||||
} else
|
||||
pfStr = pixFormatStr[pf];
|
||||
ps = TJ.getPixelSize(pf);
|
||||
|
||||
System.out.print(pfStr + " ");
|
||||
if (bi)
|
||||
System.out.print("(" + pixFormatStr[pf] + ") ");
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
System.out.print("Bottom-Up");
|
||||
else
|
||||
System.out.print("Top-Down ");
|
||||
System.out.print(" -> " + subNameLong[subsamp] + " ");
|
||||
if (yuv == YUVENCODE)
|
||||
System.out.print("YUV ... ");
|
||||
else
|
||||
System.out.print("Q" + jpegQual + " ... ");
|
||||
|
||||
if (bi) {
|
||||
img = new BufferedImage(w, h, imgType);
|
||||
initImg(img, pf, flags);
|
||||
tempstr = baseName + "_enc_" + pfStr + "_" +
|
||||
(((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" +
|
||||
subName[subsamp] + "_Q" + jpegQual + ".png";
|
||||
File file = new File(tempstr);
|
||||
ImageIO.write(img, "png", file);
|
||||
} else {
|
||||
srcBuf = new byte[w * h * ps + 1];
|
||||
initBuf(srcBuf, w, w * ps, h, pf, flags);
|
||||
}
|
||||
Arrays.fill(dstBuf, (byte)0);
|
||||
|
||||
t = getTime();
|
||||
tjc.setSubsamp(subsamp);
|
||||
tjc.setJPEGQuality(jpegQual);
|
||||
if (bi) {
|
||||
if (yuv == YUVENCODE)
|
||||
tjc.encodeYUV(img, dstBuf, flags);
|
||||
else
|
||||
tjc.compress(img, dstBuf, flags);
|
||||
} else {
|
||||
tjc.setSourceImage(srcBuf, w, 0, h, pf);
|
||||
if (yuv == YUVENCODE)
|
||||
tjc.encodeYUV(dstBuf, flags);
|
||||
else
|
||||
tjc.compress(dstBuf, flags);
|
||||
}
|
||||
size = tjc.getCompressedSize();
|
||||
t = getTime() - t;
|
||||
|
||||
if (yuv == YUVENCODE)
|
||||
tempstr = baseName + "_enc_" + pfStr + "_" +
|
||||
(((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" +
|
||||
subName[subsamp] + ".yuv";
|
||||
else
|
||||
tempstr = baseName + "_enc_" + pfStr + "_" +
|
||||
(((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" +
|
||||
subName[subsamp] + "_Q" + jpegQual + ".jpg";
|
||||
writeJPEG(dstBuf, size, tempstr);
|
||||
|
||||
if (yuv == YUVENCODE) {
|
||||
if (checkBufYUV(dstBuf, size, w, h, subsamp) == 1)
|
||||
System.out.print("Passed.");
|
||||
else {
|
||||
System.out.print("FAILED!");
|
||||
exitStatus = -1;
|
||||
}
|
||||
} else
|
||||
System.out.print("Done.");
|
||||
System.out.format(" %.6f ms\n", t * 1000.);
|
||||
System.out.println(" Result in " + tempstr);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,
|
||||
int jpegSize, int w, int h, int pf,
|
||||
String baseName, int subsamp, int flags,
|
||||
TJScalingFactor sf) throws Exception {
|
||||
String pfStr, tempstr;
|
||||
double t;
|
||||
int scaledWidth = sf.getScaled(w);
|
||||
int scaledHeight = sf.getScaled(h);
|
||||
int temp1, temp2, imgType = pf;
|
||||
BufferedImage img = null;
|
||||
byte[] dstBuf = null;
|
||||
|
||||
if (yuv == YUVENCODE) return;
|
||||
|
||||
if (bi) {
|
||||
pf = biTypePF(imgType);
|
||||
pfStr = biTypeStr(imgType);
|
||||
} else
|
||||
pfStr = pixFormatStr[pf];
|
||||
|
||||
System.out.print("JPEG -> ");
|
||||
if (yuv == YUVDECODE)
|
||||
System.out.print("YUV " + subNameLong[subsamp] + " ... ");
|
||||
else {
|
||||
System.out.print(pfStr + " ");
|
||||
if (bi)
|
||||
System.out.print("(" + pixFormatStr[pf] + ") ");
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
System.out.print("Bottom-Up ");
|
||||
else
|
||||
System.out.print("Top-Down ");
|
||||
if (!sf.isOne())
|
||||
System.out.print(sf.getNum() + "/" + sf.getDenom() + " ... ");
|
||||
else
|
||||
System.out.print("... ");
|
||||
}
|
||||
|
||||
t = getTime();
|
||||
tjd.setJPEGImage(jpegBuf, jpegSize);
|
||||
if (tjd.getWidth() != w || tjd.getHeight() != h ||
|
||||
tjd.getSubsamp() != subsamp)
|
||||
throw new Exception("Incorrect JPEG header");
|
||||
|
||||
temp1 = scaledWidth;
|
||||
temp2 = scaledHeight;
|
||||
temp1 = tjd.getScaledWidth(temp1, temp2);
|
||||
temp2 = tjd.getScaledHeight(temp1, temp2);
|
||||
if (temp1 != scaledWidth || temp2 != scaledHeight)
|
||||
throw new Exception("Scaled size mismatch");
|
||||
|
||||
if (yuv == YUVDECODE)
|
||||
dstBuf = tjd.decompressToYUV(flags);
|
||||
else {
|
||||
if (bi)
|
||||
img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags);
|
||||
else
|
||||
dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags);
|
||||
}
|
||||
t = getTime() - t;
|
||||
|
||||
if (bi) {
|
||||
tempstr = baseName + "_dec_" + pfStr + "_" +
|
||||
(((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" +
|
||||
subName[subsamp] + "_" +
|
||||
(double)sf.getNum() / (double)sf.getDenom() + "x" + ".png";
|
||||
File file = new File(tempstr);
|
||||
ImageIO.write(img, "png", file);
|
||||
}
|
||||
|
||||
if (yuv == YUVDECODE) {
|
||||
if (checkBufYUV(dstBuf, dstBuf.length, w, h, subsamp) == 1)
|
||||
System.out.print("Passed.");
|
||||
else {
|
||||
System.out.print("FAILED!"); exitStatus = -1;
|
||||
}
|
||||
} else {
|
||||
if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) ||
|
||||
(!bi && checkBuf(dstBuf, scaledWidth,
|
||||
scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf,
|
||||
subsamp, sf, flags) == 1))
|
||||
System.out.print("Passed.");
|
||||
else {
|
||||
System.out.print("FAILED!");
|
||||
exitStatus = -1;
|
||||
}
|
||||
}
|
||||
System.out.format(" %.6f ms\n", t * 1000.);
|
||||
}
|
||||
|
||||
private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,
|
||||
int jpegSize, int w, int h, int pf,
|
||||
String baseName, int subsamp,
|
||||
int flags) throws Exception {
|
||||
int i;
|
||||
if ((subsamp == TJ.SAMP_444 || subsamp == TJ.SAMP_GRAY) && yuv == 0) {
|
||||
TJScalingFactor[] sf = TJ.getScalingFactors();
|
||||
for (i = 0; i < sf.length; i++)
|
||||
decompTest(tjd, jpegBuf, jpegSize, w, h, pf, baseName, subsamp,
|
||||
flags, sf[i]);
|
||||
} else
|
||||
decompTest(tjd, jpegBuf, jpegSize, w, h, pf, baseName, subsamp,
|
||||
flags, new TJScalingFactor(1, 1));
|
||||
}
|
||||
|
||||
private static void doTest(int w, int h, int[] formats, int subsamp,
|
||||
String baseName) throws Exception {
|
||||
TJCompressor tjc = null;
|
||||
TJDecompressor tjd = null;
|
||||
int size;
|
||||
byte[] dstBuf;
|
||||
|
||||
if (yuv == YUVENCODE)
|
||||
dstBuf = new byte[TJ.bufSizeYUV(w, h, subsamp)];
|
||||
else
|
||||
dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
|
||||
try {
|
||||
tjc = new TJCompressor();
|
||||
tjd = new TJDecompressor();
|
||||
|
||||
for (int pf : formats) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
int flags = 0;
|
||||
if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420 ||
|
||||
subsamp == TJ.SAMP_440)
|
||||
flags |= TJ.FLAG_FASTUPSAMPLE;
|
||||
if (i == 1) {
|
||||
if (yuv == YUVDECODE) {
|
||||
tjc.close();
|
||||
tjd.close();
|
||||
return;
|
||||
} else
|
||||
flags |= TJ.FLAG_BOTTOMUP;
|
||||
}
|
||||
size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100,
|
||||
flags);
|
||||
decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags);
|
||||
if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi)
|
||||
decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX),
|
||||
baseName, subsamp, flags);
|
||||
System.out.print("\n");
|
||||
}
|
||||
}
|
||||
System.out.print("--------------------\n\n");
|
||||
} catch(Exception e) {
|
||||
if (tjc != null) tjc.close();
|
||||
if (tjd != null) tjd.close();
|
||||
throw e;
|
||||
}
|
||||
if (tjc != null) tjc.close();
|
||||
if (tjd != null) tjd.close();
|
||||
}
|
||||
|
||||
private static void bufSizeTest() throws Exception {
|
||||
int w, h, i, subsamp;
|
||||
byte[] srcBuf, jpegBuf;
|
||||
TJCompressor tjc = null;
|
||||
Random r = new Random();
|
||||
|
||||
try {
|
||||
tjc = new TJCompressor();
|
||||
System.out.println("Buffer size regression test");
|
||||
for (subsamp = 0; subsamp < TJ.NUMSAMP; subsamp++) {
|
||||
for (w = 1; w < 48; w++) {
|
||||
int maxh = (w == 1) ? 2048 : 48;
|
||||
for (h = 1; h < maxh; h++) {
|
||||
if (h % 100 == 0)
|
||||
System.out.format("%04d x %04d\b\b\b\b\b\b\b\b\b\b\b", w, h);
|
||||
srcBuf = new byte[w * h * 4];
|
||||
jpegBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
for (i = 0; i < w * h * 4; i++) {
|
||||
srcBuf[i] = (byte)(r.nextInt(2) * 255);
|
||||
}
|
||||
tjc.setSourceImage(srcBuf, w, 0, h, TJ.PF_BGRX);
|
||||
tjc.setSubsamp(subsamp);
|
||||
tjc.setJPEGQuality(100);
|
||||
tjc.compress(jpegBuf, 0);
|
||||
|
||||
srcBuf = new byte[h * w * 4];
|
||||
jpegBuf = new byte[TJ.bufSize(h, w, subsamp)];
|
||||
for (i = 0; i < h * w * 4; i++) {
|
||||
srcBuf[i] = (byte)(r.nextInt(2) * 255);
|
||||
}
|
||||
tjc.setSourceImage(srcBuf, h, 0, w, TJ.PF_BGRX);
|
||||
tjc.compress(jpegBuf, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("Done. ");
|
||||
} catch(Exception e) {
|
||||
if (tjc != null) tjc.close();
|
||||
throw e;
|
||||
}
|
||||
if (tjc != null) tjc.close();
|
||||
}
|
||||
|
||||
public static void main(String[] argv) {
|
||||
try {
|
||||
String testName = "javatest";
|
||||
boolean doyuv = false;
|
||||
for (int i = 0; i < argv.length; i++) {
|
||||
if (argv[i].equalsIgnoreCase("-yuv"))
|
||||
doyuv = true;
|
||||
if (argv[i].substring(0, 1).equalsIgnoreCase("-h") ||
|
||||
argv[i].equalsIgnoreCase("-?"))
|
||||
usage();
|
||||
if (argv[i].equalsIgnoreCase("-bi")) {
|
||||
bi = true;
|
||||
testName = "javabitest";
|
||||
}
|
||||
}
|
||||
if (doyuv) yuv = YUVENCODE;
|
||||
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444,
|
||||
testName);
|
||||
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444,
|
||||
testName);
|
||||
doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_422,
|
||||
testName);
|
||||
doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_422,
|
||||
testName);
|
||||
doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_420,
|
||||
testName);
|
||||
doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_420,
|
||||
testName);
|
||||
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_440,
|
||||
testName);
|
||||
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_440,
|
||||
testName);
|
||||
doTest(35, 39, bi ? onlyGrayBI : onlyGray, TJ.SAMP_GRAY, testName);
|
||||
doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_GRAY,
|
||||
testName);
|
||||
doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_GRAY,
|
||||
testName);
|
||||
if (!doyuv && !bi)
|
||||
bufSizeTest();
|
||||
if (doyuv && !bi) {
|
||||
yuv = YUVDECODE;
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_444, "javatest_yuv0");
|
||||
doTest(35, 39, onlyRGB, TJ.SAMP_444, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_422, "javatest_yuv0");
|
||||
doTest(39, 41, onlyRGB, TJ.SAMP_422, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_420, "javatest_yuv0");
|
||||
doTest(41, 35, onlyRGB, TJ.SAMP_420, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_440, "javatest_yuv0");
|
||||
doTest(35, 39, onlyRGB, TJ.SAMP_440, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv0");
|
||||
doTest(35, 39, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv1");
|
||||
doTest(48, 48, onlyGray, TJ.SAMP_GRAY, "javatest_yuv0");
|
||||
doTest(39, 41, onlyGray, TJ.SAMP_GRAY, "javatest_yuv1");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
exitStatus = -1;
|
||||
}
|
||||
System.exit(exitStatus);
|
||||
}
|
||||
}
|
||||
43
java/doc/allclasses-frame.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
All Classes
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||
<B>All Classes</B></FONT>
|
||||
<BR>
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><I>TJCustomFilter</I></A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A>
|
||||
<BR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
43
java/doc/allclasses-noframe.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
All Classes
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||
<B>All Classes</B></FONT>
|
||||
<BR>
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><I>TJCustomFilter</I></A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<BR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
416
java/doc/constant-values.html
Normal file
@@ -0,0 +1,416 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
Constant Field Values
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="Constant Field Values";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>
|
||||
Constant Field Values</H1>
|
||||
</CENTER>
|
||||
<HR SIZE="4" NOSHADE>
|
||||
<B>Contents</B><UL>
|
||||
<LI><A HREF="#org.libjpegturbo">org.libjpegturbo.*</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="org.libjpegturbo"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left"><FONT SIZE="+2">
|
||||
org.libjpegturbo.*</FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4096</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2048</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>256</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>16</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>32</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>128</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMPF"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>11</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMSAMP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ABGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>9</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ARGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>10</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>6</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>7</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_XBGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_XRGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_420"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_422"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_440"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_444"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<P>
|
||||
|
||||
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.NUMOP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_NONE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>6</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>7</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>16</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
164
java/doc/deprecated-list.html
Normal file
@@ -0,0 +1,164 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
Deprecated List
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="Deprecated List";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H2>
|
||||
<B>Deprecated API</B></H2>
|
||||
</CENTER>
|
||||
<HR SIZE="4" NOSHADE>
|
||||
<B>Contents</B><UL>
|
||||
<LI><A HREF="#method">Deprecated Methods</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="method"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Deprecated Methods</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</A>
|
||||
<BR>
|
||||
<I>Use
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</CODE></A> instead.</I> </TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</A>
|
||||
<BR>
|
||||
<I>Use
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
209
java/doc/help-doc.html
Normal file
@@ -0,0 +1,209 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:35 CDT 2013 -->
|
||||
<TITLE>
|
||||
API Help
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="API Help";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>
|
||||
How This API Document Is Organized</H1>
|
||||
</CENTER>
|
||||
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3>
|
||||
Package</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL>
|
||||
<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Class/Interface</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL>
|
||||
<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description
|
||||
<P>
|
||||
<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary
|
||||
<P>
|
||||
<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL>
|
||||
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Annotation Type</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each annotation type has its own separate page with the following sections:<UL>
|
||||
<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL>
|
||||
</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Enum</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each enum has its own separate page with the following sections:<UL>
|
||||
<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Tree (Class Hierarchy)</H3>
|
||||
<BLOCKQUOTE>
|
||||
There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL>
|
||||
<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Deprecated API</H3>
|
||||
<BLOCKQUOTE>
|
||||
The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Index</H3>
|
||||
<BLOCKQUOTE>
|
||||
The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Prev/Next</H3>
|
||||
These links take you to the next or previous class, interface, package, or related page.<H3>
|
||||
Frames/No Frames</H3>
|
||||
These links show and hide the HTML frames. All pages are available with or without frames.
|
||||
<P>
|
||||
<H3>
|
||||
Serialized Form</H3>
|
||||
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
|
||||
<P>
|
||||
<H3>
|
||||
Constant Field Values</H3>
|
||||
The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.
|
||||
<P>
|
||||
<FONT SIZE="-1">
|
||||
<EM>
|
||||
This help file applies to API documentation generated using the standard doclet.</EM>
|
||||
</FONT>
|
||||
<BR>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
615
java/doc/index-all.html
Normal file
@@ -0,0 +1,615 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
Index
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="Index";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_J_">J</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <HR>
|
||||
<A NAME="_B_"><!-- --></A><H2>
|
||||
<B>B</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><B>bufSize(int, int, int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width, height, and level of chrominance subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><B>bufSizeYUV(int, int, int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_C_"><!-- --></A><H2>
|
||||
<B>C</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#cf"><B>cf</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Custom filter instance
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#close()"><B>close()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Free the native structures associated with this compressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#close()"><B>close()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Free the native structures associated with this decompressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)"><B>compress(byte[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><B>compress(int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Compress the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a JPEG image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)"><B>compress(BufferedImage, byte[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
and output a JPEG image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)"><B>compress(BufferedImage, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
and return a buffer containing a JPEG image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)"><B>customFilter(ShortBuffer, Rectangle, Rectangle, int, int, TJTransform)</B></A> -
|
||||
Method in interface org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</A>
|
||||
<DD>A callback function that can be used to modify the DCT coefficients after
|
||||
they are losslessly transformed but before they are transcoded to a new
|
||||
JPEG file.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_D_"><!-- --></A><H2>
|
||||
<B>D</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><B>decompress(byte[], int, int, int, int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and output a decompressed image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)"><B>decompress(byte[], int, int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD><B>Deprecated.</B> <I>Use
|
||||
<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</CODE></A> instead.</I>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)"><B>decompress(int, int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and return a buffer containing the decompressed image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)"><B>decompress(int[], int, int, int, int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and output a decompressed image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)"><B>decompress(BufferedImage, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and output a decompressed image to the given
|
||||
<code>BufferedImage</code> instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)"><B>decompress(int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and return a <code>BufferedImage</code> instance containing the
|
||||
decompressed image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)"><B>decompressToYUV(byte[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and output a YUV planar image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)"><B>decompressToYUV(int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Decompress the JPEG source image associated with this decompressor
|
||||
instance and return a buffer containing a YUV planar image.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_E_"><!-- --></A><H2>
|
||||
<B>E</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><B>encodeYUV(byte[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Encode the uncompressed source image associated with this compressor
|
||||
instance and output a YUV planar image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)"><B>encodeYUV(int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Encode the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a YUV planar image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)"><B>encodeYUV(BufferedImage, byte[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
and output a YUV planar image to the given destination buffer.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)"><B>encodeYUV(BufferedImage, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
and return a buffer containing a YUV planar image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)"><B>equals(TJScalingFactor)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<DD>Returns true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_F_"><!-- --></A><H2>
|
||||
<B>F</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()"><B>finalize()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()"><B>finalize()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT"><B>FLAG_ACCURATEDCT</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Use the most accurate DCT/IDCT algorithm available in the underlying
|
||||
codec.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><B>FLAG_BOTTOMUP</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>The uncompressed source/destination image is stored in bottom-up (Windows,
|
||||
OpenGL) order, not top-down (X11) order.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT"><B>FLAG_FASTDCT</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Use the fastest DCT/IDCT algorithm available in the underlying codec.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE"><B>FLAG_FASTUPSAMPLE</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>When decompressing an image that was compressed using chrominance
|
||||
subsampling, use the fastest chrominance upsampling algorithm available in
|
||||
the underlying codec.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX"><B>FLAG_FORCEMMX</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Turn off CPU auto-detection and force TurboJPEG to use MMX code
|
||||
(if the underlying codec supports it.)
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE"><B>FLAG_FORCESSE</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE code
|
||||
(if the underlying codec supports it.)
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2"><B>FLAG_FORCESSE2</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
|
||||
(if the underlying codec supports it.)
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3"><B>FLAG_FORCESSE3</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
|
||||
(if the underlying codec supports it.)
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_G_"><!-- --></A><H2>
|
||||
<B>G</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getBlueOffset(int)"><B>getBlueOffset(int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>For the given pixel format, returns the number of bytes that the blue
|
||||
component is offset from the start of the pixel.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><B>getCompressedSize()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Returns the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()"><B>getDenom()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<DD>Returns denominator
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getGreenOffset(int)"><B>getGreenOffset(int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>For the given pixel format, returns the number of bytes that the green
|
||||
component is offset from the start of the pixel.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()"><B>getHeight()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the height of the JPEG image associated with this decompressor
|
||||
instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()"><B>getJPEGBuf()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the JPEG image buffer associated with this decompressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()"><B>getJPEGSize()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><B>getMCUHeight(int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the MCU block height for the given level of chrominance
|
||||
subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><B>getMCUWidth(int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the MCU block width for the given level of chrominance
|
||||
subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()"><B>getNum()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<DD>Returns numerator
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)"><B>getPixelSize(int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the pixel size (in bytes) for the given pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getRedOffset(int)"><B>getRedOffset(int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>For the given pixel format, returns the number of bytes that the red
|
||||
component is offset from the start of the pixel.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><B>getScaled(int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<DD>Returns the scaled value of <code>dimension</code>.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><B>getScaledHeight(int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the height of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)"><B>getScaledWidth(int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the width of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><B>getScalingFactors()</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns a list of fractional scaling factors that the JPEG decompressor in
|
||||
this implementation of TurboJPEG supports.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()"><B>getSubsamp()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the level of chrominance subsampling used in the JPEG image
|
||||
associated with this decompressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()"><B>getTransformedSizes()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<DD>Returns an array containing the sizes of the transformed JPEG images from
|
||||
the most recent call to <A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A>.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()"><B>getWidth()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Returns the width of the JPEG image associated with this decompressor
|
||||
instance.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_H_"><!-- --></A><H2>
|
||||
<B>H</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#handle"><B>handle</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_I_"><!-- --></A><H2>
|
||||
<B>I</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()"><B>isOne()</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<DD>Returns true or false, depending on whether this instance is equal to
|
||||
1/1.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_J_"><!-- --></A><H2>
|
||||
<B>J</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf"><B>jpegBuf</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize"><B>jpegBufSize</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight"><B>jpegHeight</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp"><B>jpegSubsamp</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth"><B>jpegWidth</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_N_"><!-- --></A><H2>
|
||||
<B>N</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP"><B>NUMOP</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>The number of lossless transform operations
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#NUMPF"><B>NUMPF</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>The number of pixel formats
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP"><B>NUMSAMP</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>The number of chrominance subsampling options
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_O_"><!-- --></A><H2>
|
||||
<B>O</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#op"><B>op</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Transform operation (one of <code>OP_*</code>)
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP"><B>OP_HFLIP</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Flip (mirror) image horizontally.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE"><B>OP_NONE</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Do not transform the position of the image pixels.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180"><B>OP_ROT180</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Rotate image 180 degrees.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270"><B>OP_ROT270</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Rotate image counter-clockwise by 90 degrees.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90"><B>OP_ROT90</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Rotate image clockwise by 90 degrees.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE"><B>OP_TRANSPOSE</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Transpose image (flip/mirror along upper left to lower right axis).
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE"><B>OP_TRANSVERSE</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Transverse transpose image (flip/mirror along upper right to lower left
|
||||
axis).
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP"><B>OP_VFLIP</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Flip (mirror) image vertically.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP"><B>OPT_CROP</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>This option will enable lossless cropping.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY"><B>OPT_GRAY</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>This option will discard the color data in the input image and produce
|
||||
a grayscale output image.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT"><B>OPT_NOOUTPUT</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>This option will prevent <A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>TJTransformer.transform()</CODE></A> from outputting a JPEG image for this
|
||||
particular transform.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><B>OPT_PERFECT</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>This option will cause <A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>TJTransformer.transform()</CODE></A> to throw an exception if the transform is not
|
||||
perfect.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM"><B>OPT_TRIM</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>This option will discard any partial MCU blocks that cannot be
|
||||
transformed.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#options"><B>options</B></A> -
|
||||
Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Transform options (bitwise OR of one or more of <code>OPT_*</code>)
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/package-summary.html"><B>org.libjpegturbo.turbojpeg</B></A> - package org.libjpegturbo.turbojpeg<DD> </DL>
|
||||
<HR>
|
||||
<A NAME="_P_"><!-- --></A><H2>
|
||||
<B>P</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR"><B>PF_ABGR</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>ABGR pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB"><B>PF_ARGB</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>ARGB pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGR"><B>PF_BGR</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>BGR pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA"><B>PF_BGRA</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>BGRA pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX"><B>PF_BGRX</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>BGRX pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY"><B>PF_GRAY</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Grayscale pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><B>PF_RGB</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>RGB pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA"><B>PF_RGBA</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>RGBA pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX"><B>PF_RGBX</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>RGBX pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR"><B>PF_XBGR</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>XBGR pixel format.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB"><B>PF_XRGB</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>XRGB pixel format.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_S_"><!-- --></A><H2>
|
||||
<B>S</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_420"><B>SAMP_420</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>4:2:0 chrominance subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_422"><B>SAMP_422</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>4:2:2 chrominance subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_440"><B>SAMP_440</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>4:4:0 chrominance subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><B>SAMP_444</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>4:4:4 chrominance subsampling (no chrominance subsampling).
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY"><B>SAMP_GRAY</B></A> -
|
||||
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Grayscale.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)"><B>setJPEGImage(byte[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
||||
<code>jpegImage</code> with this decompressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)"><B>setJPEGQuality(int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Set the JPEG image quality level for subsequent compress operations.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><B>setSourceImage(byte[], int, int, int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Associate an uncompressed source image with this compressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)"><B>setSourceImage(byte[], int, int, int, int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD><B>Deprecated.</B> <I>Use
|
||||
<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)"><B>setSubsamp(int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Set the level of chrominance subsampling for subsequent compress/encode
|
||||
operations.
|
||||
</DL>
|
||||
<HR>
|
||||
<A NAME="_T_"><!-- --></A><H2>
|
||||
<B>T</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>TurboJPEG utility class (cannot be instantiated)<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#TJ()"><B>TJ()</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>TurboJPEG compressor<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()"><B>TJCompressor()</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Create a TurboJPEG compressor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)"><B>TJCompressor(byte[], int, int, int, int)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly-created
|
||||
instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)"><B>TJCompressor(byte[], int, int, int, int, int, int)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<DD>Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly-created
|
||||
instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>TJCustomFilter</B></A> - Interface in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>Custom filter callback interface<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>TurboJPEG decompressor<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor()"><B>TJDecompressor()</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Create a TurboJPEG decompresssor instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[])"><B>TJDecompressor(byte[])</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Create a TurboJPEG decompressor instance and associate the JPEG image
|
||||
stored in <code>jpegImage</code> with the newly-created instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[], int)"><B>TJDecompressor(byte[], int)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<DD>Create a TurboJPEG decompressor instance and associate the JPEG image
|
||||
of length <code>imageSize</code> bytes stored in <code>jpegImage</code>
|
||||
with the newly-created instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>Fractional scaling factor<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)"><B>TJScalingFactor(int, int)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<DD>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>Lossless transform parameters<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform()"><B>TJTransform()</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Create a new lossless transform instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)"><B>TJTransform(int, int, int, int, int, int, TJCustomFilter)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Create a new lossless transform instance with the given parameters.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)"><B>TJTransform(Rectangle, int, int, TJCustomFilter)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<DD>Create a new lossless transform instance with the given parameters.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>TurboJPEG lossless transformer<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()"><B>TJTransformer()</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<DD>Create a TurboJPEG lossless transformer instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])"><B>TJTransformer(byte[])</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<DD>Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image stored in <code>jpegImage</code> with the newly-created instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[], int)"><B>TJTransformer(byte[], int)</B></A> -
|
||||
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<DD>Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
<code>jpegImage</code> with the newly-created instance.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><B>transform(byte[][], TJTransform[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<DD>Losslessly transform the JPEG image associated with this transformer
|
||||
instance into one or more JPEG images stored in the given destination
|
||||
buffers.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[], int)"><B>transform(TJTransform[], int)</B></A> -
|
||||
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<DD>Losslessly transform the JPEG image associated with this transformer
|
||||
instance and return an array of <A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJDecompressor</CODE></A> instances, each of
|
||||
which has a transformed JPEG image associated with it.
|
||||
</DL>
|
||||
<HR>
|
||||
<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_J_">J</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A>
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
36
java/doc/index.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Fri Apr 26 20:05:34 CDT 2013-->
|
||||
<TITLE>
|
||||
Generated Documentation (Untitled)
|
||||
</TITLE>
|
||||
<SCRIPT type="text/javascript">
|
||||
targetPage = "" + window.location.search;
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
targetPage = targetPage.substring(1);
|
||||
if (targetPage.indexOf(":") != -1)
|
||||
targetPage = "undefined";
|
||||
function loadFrames() {
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
top.classFrame.location = top.targetPage;
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
</HEAD>
|
||||
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
|
||||
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
|
||||
<FRAME src="org/libjpegturbo/turbojpeg/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
|
||||
<NOFRAMES>
|
||||
<H2>
|
||||
Frame Alert</H2>
|
||||
|
||||
<P>
|
||||
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
|
||||
<BR>
|
||||
Link to<A HREF="org/libjpegturbo/turbojpeg/package-summary.html">Non-frame version.</A>
|
||||
</NOFRAMES>
|
||||
</FRAMESET>
|
||||
</HTML>
|
||||
1095
java/doc/org/libjpegturbo/turbojpeg/TJ.html
Normal file
777
java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
Normal file
@@ -0,0 +1,777 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
TJCompressor
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="TJCompressor";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJCompressor.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<H2>
|
||||
<FONT SIZE="-1">
|
||||
org.libjpegturbo.turbojpeg</FONT>
|
||||
<BR>
|
||||
Class TJCompressor</H2>
|
||||
<PRE>
|
||||
java.lang.Object
|
||||
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJCompressor</B>
|
||||
</PRE>
|
||||
<HR>
|
||||
<DL>
|
||||
<DT><PRE>public class <B>TJCompressor</B><DT>extends java.lang.Object</DL>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
TurboJPEG compressor
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
|
||||
<A NAME="constructor_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Constructor Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()">TJCompressor</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Create a TurboJPEG compressor instance.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">TJCompressor</A></B>(byte[] srcImage,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)</CODE>
|
||||
|
||||
<BR>
|
||||
Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly-created
|
||||
instance.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)">TJCompressor</A></B>(byte[] srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)</CODE>
|
||||
|
||||
<BR>
|
||||
Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly-created
|
||||
instance.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Method Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#close()">close</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Free the native structures associated with this compressor instance.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)">compress</A></B>(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
and output a JPEG image to the given destination buffer.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> byte[]</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)">compress</A></B>(java.awt.image.BufferedImage srcImage,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
and return a buffer containing a JPEG image.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)">compress</A></B>(byte[] dstBuf,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> byte[]</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)">compress</A></B>(int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Compress the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a JPEG image.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)">encodeYUV</A></B>(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
and output a YUV planar image to the given destination buffer.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> byte[]</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)">encodeYUV</A></B>(java.awt.image.BufferedImage srcImage,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
and return a buffer containing a YUV planar image.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">encodeYUV</A></B>(byte[] dstBuf,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Encode the uncompressed source image associated with this compressor
|
||||
instance and output a YUV planar image to the given destination buffer.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> byte[]</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV</A></B>(int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Encode the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a YUV planar image.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>protected void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()">finalize</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> int</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Returns the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality</A></B>(int quality)</CODE>
|
||||
|
||||
<BR>
|
||||
Set the JPEG image quality level for subsequent compress operations.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">setSourceImage</A></B>(byte[] srcImage,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)</CODE>
|
||||
|
||||
<BR>
|
||||
<B>Deprecated.</B> <I>Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)">setSourceImage</A></B>(byte[] srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)</CODE>
|
||||
|
||||
<BR>
|
||||
Associate an uncompressed source image with this compressor instance.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)">setSubsamp</A></B>(int newSubsamp)</CODE>
|
||||
|
||||
<BR>
|
||||
Set the level of chrominance subsampling for subsequent compress/encode
|
||||
operations.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
|
||||
<A NAME="constructor_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Constructor Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="TJCompressor()"><!-- --></A><H3>
|
||||
TJCompressor</H3>
|
||||
<PRE>
|
||||
public <B>TJCompressor</B>()
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Create a TurboJPEG compressor instance.
|
||||
<P>
|
||||
<DL>
|
||||
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="TJCompressor(byte[], int, int, int, int)"><!-- --></A><H3>
|
||||
TJCompressor</H3>
|
||||
<PRE>
|
||||
public <B>TJCompressor</B>(byte[] srcImage,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly-created
|
||||
instance.
|
||||
<P>
|
||||
<DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="TJCompressor(byte[], int, int, int, int, int, int)"><!-- --></A><H3>
|
||||
TJCompressor</H3>
|
||||
<PRE>
|
||||
public <B>TJCompressor</B>(byte[] srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly-created
|
||||
instance.
|
||||
<P>
|
||||
<DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>x</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>y</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
|
||||
<!-- ============ METHOD DETAIL ========== -->
|
||||
|
||||
<A NAME="method_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Method Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="setSourceImage(byte[], int, int, int, int, int, int)"><!-- --></A><H3>
|
||||
setSourceImage</H3>
|
||||
<PRE>
|
||||
public void <B>setSourceImage</B>(byte[] srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Associate an uncompressed source image with this compressor instance.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - image buffer containing RGB or grayscale pixels to be
|
||||
compressed<DD><CODE>x</CODE> - x offset (in pixels) of the region from which the JPEG image
|
||||
should be compressed, relative to the start of <code>srcImage</code>.<DD><CODE>y</CODE> - y offset (in pixels) of the region from which the JPEG image
|
||||
should be compressed, relative to the start of <code>srcImage</code>.<DD><CODE>width</CODE> - width (in pixels) of the region in the source image from
|
||||
which the JPEG image should be compressed.<DD><CODE>pitch</CODE> - bytes per line of the source image. Normally, this should be
|
||||
<code>width * TJ.pixelSize(pixelFormat)</code> if the source image is
|
||||
unpadded, but you can use this parameter to, for instance, specify that
|
||||
the scanlines in the source image are padded to a 4-byte boundary or to
|
||||
compress a JPEG image from a region of a larger source image. You can
|
||||
also be clever and use this parameter to skip lines, etc. Setting this
|
||||
parameter to 0 is the equivalent of setting it to <code>width *
|
||||
TJ.pixelSize(pixelFormat)</code>.<DD><CODE>height</CODE> - height (in pixels) of the region in the source image from
|
||||
which the JPEG image should be compressed.<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="setSourceImage(byte[], int, int, int, int)"><!-- --></A><H3>
|
||||
setSourceImage</H3>
|
||||
<PRE>
|
||||
public void <B>setSourceImage</B>(byte[] srcImage,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD><B>Deprecated.</B> <I>Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I>
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="setSubsamp(int)"><!-- --></A><H3>
|
||||
setSubsamp</H3>
|
||||
<PRE>
|
||||
public void <B>setSubsamp</B>(int newSubsamp)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Set the level of chrominance subsampling for subsequent compress/encode
|
||||
operations.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>newSubsamp</CODE> - the new level of chrominance subsampling (one of
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.SAMP_*</CODE></A>)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="setJPEGQuality(int)"><!-- --></A><H3>
|
||||
setJPEGQuality</H3>
|
||||
<PRE>
|
||||
public void <B>setJPEGQuality</B>(int quality)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Set the JPEG image quality level for subsequent compress operations.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>quality</CODE> - the new JPEG image quality level (1 to 100, 1 = worst,
|
||||
100 = best)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="compress(byte[], int)"><!-- --></A><H3>
|
||||
compress</H3>
|
||||
<PRE>
|
||||
public void <B>compress</B>(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the maximum size for this buffer based on
|
||||
the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="compress(int)"><!-- --></A><H3>
|
||||
compress</H3>
|
||||
<PRE>
|
||||
public byte[] <B>compress</B>(int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Compress the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a JPEG image.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Returns:</B><DD>a buffer containing a JPEG image. The length of this buffer will
|
||||
not be equal to the size of the JPEG image. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><CODE>getCompressedSize()</CODE></A> to obtain the size of the JPEG image.
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="compress(java.awt.image.BufferedImage, byte[], int)"><!-- --></A><H3>
|
||||
compress</H3>
|
||||
<PRE>
|
||||
public void <B>compress</B>(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
and output a JPEG image to the given destination buffer.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
|
||||
grayscale pixels to be compressed<DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the maximum size for this buffer based on
|
||||
the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="compress(java.awt.image.BufferedImage, int)"><!-- --></A><H3>
|
||||
compress</H3>
|
||||
<PRE>
|
||||
public byte[] <B>compress</B>(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
and return a buffer containing a JPEG image.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
|
||||
grayscale pixels to be compressed<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Returns:</B><DD>a buffer containing a JPEG image. The length of this buffer will
|
||||
not be equal to the size of the JPEG image. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><CODE>getCompressedSize()</CODE></A> to obtain the size of the JPEG image.
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="encodeYUV(byte[], int)"><!-- --></A><H3>
|
||||
encodeYUV</H3>
|
||||
<PRE>
|
||||
public void <B>encodeYUV</B>(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Encode the uncompressed source image associated with this compressor
|
||||
instance and output a YUV planar image to the given destination buffer.
|
||||
This method uses the accelerated color conversion routines in
|
||||
TurboJPEG's underlying codec to produce a planar YUV image that is
|
||||
suitable for direct video display. Specifically, if the chrominance
|
||||
components are subsampled along the horizontal dimension, then the width
|
||||
of the luminance plane is padded to the nearest multiple of 2 in the
|
||||
output image (same goes for the height of the luminance plane, if the
|
||||
chrominance components are subsampled along the vertical dimension.)
|
||||
Also, each line of each plane in the output image is padded to 4 bytes.
|
||||
Although this will work with any subsampling option, it is really only
|
||||
useful in combination with <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_420"><CODE>TJ.SAMP_420</CODE></A>, which produces an image
|
||||
compatible with the I420 (AKA "YUV420P") format.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int)</CODE></A> to determine the appropriate size for this buffer
|
||||
based on the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="encodeYUV(int)"><!-- --></A><H3>
|
||||
encodeYUV</H3>
|
||||
<PRE>
|
||||
public byte[] <B>encodeYUV</B>(int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Encode the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a YUV planar image. See
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>encodeYUV(byte[], int)</CODE></A> for more detail.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Returns:</B><DD>a buffer containing a YUV planar image
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="encodeYUV(java.awt.image.BufferedImage, byte[], int)"><!-- --></A><H3>
|
||||
encodeYUV</H3>
|
||||
<PRE>
|
||||
public void <B>encodeYUV</B>(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
and output a YUV planar image to the given destination buffer. See
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>encodeYUV(byte[], int)</CODE></A> for more detail.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
|
||||
grayscale pixels to be encoded<DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int)</CODE></A> to determine the appropriate size for this buffer
|
||||
based on the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="encodeYUV(java.awt.image.BufferedImage, int)"><!-- --></A><H3>
|
||||
encodeYUV</H3>
|
||||
<PRE>
|
||||
public byte[] <B>encodeYUV</B>(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
and return a buffer containing a YUV planar image. See
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>encodeYUV(byte[], int)</CODE></A> for more detail.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
|
||||
grayscale pixels to be encoded<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Returns:</B><DD>a buffer containing a YUV planar image
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="getCompressedSize()"><!-- --></A><H3>
|
||||
getCompressedSize</H3>
|
||||
<PRE>
|
||||
public int <B>getCompressedSize</B>()</PRE>
|
||||
<DL>
|
||||
<DD>Returns the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation.
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="close()"><!-- --></A><H3>
|
||||
close</H3>
|
||||
<PRE>
|
||||
public void <B>close</B>()
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Free the native structures associated with this compressor instance.
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="finalize()"><!-- --></A><H3>
|
||||
finalize</H3>
|
||||
<PRE>
|
||||
protected void <B>finalize</B>()
|
||||
throws java.lang.Throwable</PRE>
|
||||
<DL>
|
||||
<DD><DL>
|
||||
<DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
||||
</DD>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Throwable</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJCompressor.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
240
java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
Normal file
@@ -0,0 +1,240 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_43) on Fri Apr 26 20:05:34 CDT 2013 -->
|
||||
<TITLE>
|
||||
TJCustomFilter
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-04-26">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="TJCustomFilter";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJCustomFilter.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<H2>
|
||||
<FONT SIZE="-1">
|
||||
org.libjpegturbo.turbojpeg</FONT>
|
||||
<BR>
|
||||
Interface TJCustomFilter</H2>
|
||||
<HR>
|
||||
<DL>
|
||||
<DT><PRE>public interface <B>TJCustomFilter</B></DL>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Custom filter callback interface
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Method Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">customFilter</A></B>(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
int componentID,
|
||||
int transformID,
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A> transform)</CODE>
|
||||
|
||||
<BR>
|
||||
A callback function that can be used to modify the DCT coefficients after
|
||||
they are losslessly transformed but before they are transcoded to a new
|
||||
JPEG file.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<!-- ============ METHOD DETAIL ========== -->
|
||||
|
||||
<A NAME="method_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Method Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)"><!-- --></A><H3>
|
||||
customFilter</H3>
|
||||
<PRE>
|
||||
void <B>customFilter</B>(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
int componentID,
|
||||
int transformID,
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A> transform)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>A callback function that can be used to modify the DCT coefficients after
|
||||
they are losslessly transformed but before they are transcoded to a new
|
||||
JPEG file. This allows for custom filters or other transformations to be
|
||||
applied in the frequency domain.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>coeffBuffer</CODE> - a buffer containing transformed DCT coefficients.
|
||||
(NOTE: this buffer is not guaranteed to be valid once the callback
|
||||
returns, so applications wishing to hand off the DCT coefficients to
|
||||
another function or library should make a copy of them within the body of
|
||||
the callback.)<DD><CODE>bufferRegion</CODE> - rectangle containing the width and height of
|
||||
<code>coeffBuffer</code> as well as its offset relative to the component
|
||||
plane. TurboJPEG implementations may choose to split each component plane
|
||||
into multiple DCT coefficient buffers and call the callback function once
|
||||
for each buffer.<DD><CODE>planeRegion</CODE> - rectangle containing the width and height of the
|
||||
component plane to which <code>coeffBuffer</code> belongs<DD><CODE>componentID</CODE> - ID number of the component plane to which
|
||||
<code>coeffBuffer</code> belongs (Y, U, and V have, respectively, ID's of
|
||||
0, 1, and 2 in typical JPEG images.)<DD><CODE>transformID</CODE> - ID number of the transformed image to which
|
||||
<code>coeffBuffer</code> belongs. This is the same as the index of the
|
||||
transform in the <code>transforms</code> array that was passed to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>TJTransformer.transform()</CODE></A>.<DD><CODE>transform</CODE> - a <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instance that specifies the
|
||||
parameters and/or cropping region for this transform
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJCustomFilter.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||