Compare commits
413 Commits
version.1.
...
version.1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d97b181d3 | ||
|
|
d9b74ea6a8 | ||
|
|
166b42eb54 | ||
|
|
948dfd50c0 | ||
|
|
46da9f2294 | ||
|
|
995b145f09 | ||
|
|
451a41064e | ||
|
|
c6b02b10fe | ||
|
|
36b66a8796 | ||
|
|
f1e441596e | ||
|
|
d5fa5605c4 | ||
|
|
427b2427d4 | ||
|
|
09522e65af | ||
|
|
19cfaac52e | ||
|
|
21c38214ef | ||
|
|
577fdbc8a5 | ||
|
|
f93aed8031 | ||
|
|
326c58b4e1 | ||
|
|
ec0c69af7a | ||
|
|
21509a3955 | ||
|
|
5b2ca9caf6 | ||
|
|
529006f136 | ||
|
|
7d96e7c1c0 | ||
|
|
e2948acd92 | ||
|
|
6dc8635e28 | ||
|
|
7d0a419c87 | ||
|
|
0ea0e8b915 | ||
|
|
8e53bad7fb | ||
|
|
9c51a37dbf | ||
|
|
aa00142949 | ||
|
|
87b05f2885 | ||
|
|
baf01b98fd | ||
|
|
6dd7da0e05 | ||
|
|
4949b593be | ||
|
|
0ed7aa7c1b | ||
|
|
02b906f6ad | ||
|
|
6a03e3a438 | ||
|
|
ec33653961 | ||
|
|
133426ddfe | ||
|
|
aab317eb8c | ||
|
|
f3f86e1eb7 | ||
|
|
040c9a68b6 | ||
|
|
2b746a71cb | ||
|
|
ba01e855a3 | ||
|
|
d3c1a49246 | ||
|
|
85bbc6def8 | ||
|
|
5bd5d894eb | ||
|
|
452403d393 | ||
|
|
fc268dff90 | ||
|
|
180dd26df1 | ||
|
|
d27bc19d71 | ||
|
|
b7b72bbf97 | ||
|
|
e1340fe087 | ||
|
|
32e80bc4a7 | ||
|
|
8d18c77a7d | ||
|
|
f492f0a3d6 | ||
|
|
6b43ba091e | ||
|
|
5dfadb2eb1 | ||
|
|
30944454de | ||
|
|
0e7529c272 | ||
|
|
c9986d1b78 | ||
|
|
4bc00a40ca | ||
|
|
80f69364b0 | ||
|
|
2e3900780d | ||
|
|
d530d35024 | ||
|
|
e96f7a5f50 | ||
|
|
79ce6ccce5 | ||
|
|
b7e489c901 | ||
|
|
dbd60c1469 | ||
|
|
007409e2af | ||
|
|
b82b6cbd05 | ||
|
|
f26b96dd5c | ||
|
|
7e6c287d78 | ||
|
|
6b1e9d1b4e | ||
|
|
d88dfc3472 | ||
|
|
64f08e216b | ||
|
|
c9ae2a5fbc | ||
|
|
51ae8b7926 | ||
|
|
3280dc344f | ||
|
|
0b7e0166a7 | ||
|
|
5fe8eed4da | ||
|
|
9d4d3b2cd0 | ||
|
|
02d9f43802 | ||
|
|
00b479cb79 | ||
|
|
6219ad32b0 | ||
|
|
a3a161660a | ||
|
|
2643f79069 | ||
|
|
fba8f701c4 | ||
|
|
4bcd3a1e42 | ||
|
|
594148ae83 | ||
|
|
2a2f169b27 | ||
|
|
e576aa9f06 | ||
|
|
c469e1339f | ||
|
|
abf9809c22 | ||
|
|
3ebdd674d8 | ||
|
|
a13abdaf65 | ||
|
|
72867bc692 | ||
|
|
b081ff2813 | ||
|
|
9d1bd03be4 | ||
|
|
82e539d333 | ||
|
|
548a49bb7f | ||
|
|
dc9a8b03aa | ||
|
|
c6e0b71633 | ||
|
|
0c350f4908 | ||
|
|
01749cb8a2 | ||
|
|
49f1a5ff54 | ||
|
|
ff1f022d47 | ||
|
|
3459199eba | ||
|
|
544e8c9de0 | ||
|
|
735b40989d | ||
|
|
09f2926cd5 | ||
|
|
238b767917 | ||
|
|
49a0f0db8f | ||
|
|
6a1530e4b1 | ||
|
|
8d8841c84f | ||
|
|
1dc6eddf1c | ||
|
|
c1510793e3 | ||
|
|
d728868263 | ||
|
|
8a2af121a4 | ||
|
|
9e60c2f8e9 | ||
|
|
d35f647aaa | ||
|
|
adbccc2e56 | ||
|
|
642d09f5cb | ||
|
|
d1cb786dd8 | ||
|
|
182e4b1882 | ||
|
|
73106fe839 | ||
|
|
40b4ecfaec | ||
|
|
fb82b6d7d9 | ||
|
|
5d6ac5ea72 | ||
|
|
3d06f03072 | ||
|
|
5213675ba8 | ||
|
|
9a89e2f162 | ||
|
|
e89eb575ac | ||
|
|
d15f01b6e3 | ||
|
|
9ec5e8cf9a | ||
|
|
4c9acc22b8 | ||
|
|
6adb5f5070 | ||
|
|
d1d662768d | ||
|
|
4091882dfb | ||
|
|
61e0ed6a96 | ||
|
|
9c7899372b | ||
|
|
a098921d34 | ||
|
|
8ed4cb1a1e | ||
|
|
721904bc26 | ||
|
|
2724f85cad | ||
|
|
e3e2dc1f6e | ||
|
|
4f329cbb45 | ||
|
|
0e8995aa7e | ||
|
|
7812030886 | ||
|
|
6fb9794200 | ||
|
|
9e419fdaf7 | ||
|
|
e634cd0d62 | ||
|
|
676f8f189f | ||
|
|
40b989ce00 | ||
|
|
df44837b07 | ||
|
|
16998b4b6d | ||
|
|
f57c4fd0c2 | ||
|
|
5743cca5f8 | ||
|
|
e716a316f6 | ||
|
|
c2b0a8101b | ||
|
|
f88a57e5d7 | ||
|
|
1776120dba | ||
|
|
f4601aff8b | ||
|
|
14799e25c6 | ||
|
|
eea61ee5e4 | ||
|
|
ff6d246efd | ||
|
|
a7f08e9b36 | ||
|
|
3e1d8d6aef | ||
|
|
fda0cada0e | ||
|
|
06363c01e4 | ||
|
|
ec398229b1 | ||
|
|
a19c8a4ea3 | ||
|
|
f8de2fc8eb | ||
|
|
0380840348 | ||
|
|
9cd5752e38 | ||
|
|
65f7f8dc50 | ||
|
|
a58987d082 | ||
|
|
0f101066f2 | ||
|
|
cbe26cbb88 | ||
|
|
36c8d85f43 | ||
|
|
f753a1c36c | ||
|
|
c0ea54e518 | ||
|
|
d2bfeaa5e2 | ||
|
|
025bc9fbe1 | ||
|
|
c85e1a10cf | ||
|
|
acccedbbb7 | ||
|
|
6106e48397 | ||
|
|
0358177c3f | ||
|
|
875ac79d0e | ||
|
|
9350a47153 | ||
|
|
6230ec13b4 | ||
|
|
0a9cd082db | ||
|
|
3f5b6c7aca | ||
|
|
826fda959c | ||
|
|
a5130aebab | ||
|
|
fa6aea80f5 | ||
|
|
b09051fd79 | ||
|
|
1837d6efa0 | ||
|
|
74583409ec | ||
|
|
3da66d4d79 | ||
|
|
645d7cab86 | ||
|
|
d737981cfe | ||
|
|
dd51c25641 | ||
|
|
b7969ce657 | ||
|
|
5cee7cfc40 | ||
|
|
586581685c | ||
|
|
88f43b15fa | ||
|
|
0c9f6a3ac9 | ||
|
|
18cb325a8e | ||
|
|
ed71feac52 | ||
|
|
7fe3933faa | ||
|
|
9837e01971 | ||
|
|
5b1dc83382 | ||
|
|
42e5077688 | ||
|
|
081178cd9a | ||
|
|
fb29d47f0c | ||
|
|
1dc2654b54 | ||
|
|
2a5a6416a5 | ||
|
|
175fd6692c | ||
|
|
31dba0b4e9 | ||
|
|
27b894dd3f | ||
|
|
6aaaa3eae2 | ||
|
|
16f205d886 | ||
|
|
87e4c72ee4 | ||
|
|
5ef5fc65ae | ||
|
|
e93d5a683f | ||
|
|
91419e0e3e | ||
|
|
74626a17db | ||
|
|
1ab46eeff2 | ||
|
|
70177d55b0 | ||
|
|
1fd9603c55 | ||
|
|
279b67c838 | ||
|
|
19f9147e10 | ||
|
|
6bda73eeb2 | ||
|
|
9f349b0988 | ||
|
|
91ce5625b5 | ||
|
|
a3df1f5c5e | ||
|
|
86edc0a40e | ||
|
|
89456eed51 | ||
|
|
e023107e97 | ||
|
|
af71acb043 | ||
|
|
e12008a718 | ||
|
|
c9bae1fd46 | ||
|
|
3a73ff3bc2 | ||
|
|
99c3c5a4af | ||
|
|
a1920bc5c2 | ||
|
|
9a811cb52a | ||
|
|
55c8c2bc77 | ||
|
|
fbffea94a9 | ||
|
|
c7e17d06c8 | ||
|
|
75fa7a8d87 | ||
|
|
5e3290a486 | ||
|
|
90725df206 | ||
|
|
066bda52c0 | ||
|
|
2514c5b550 | ||
|
|
3f234ac21b | ||
|
|
420750f5ca | ||
|
|
51f7cc6874 | ||
|
|
c4252ed824 | ||
|
|
97c5fe052c | ||
|
|
5f1e13e770 | ||
|
|
d2d6e1fd6f | ||
|
|
08459fd944 | ||
|
|
985a163e33 | ||
|
|
7441340ab5 | ||
|
|
50b3b5c991 | ||
|
|
73a6ed7c21 | ||
|
|
56afd80506 | ||
|
|
398b3f08b0 | ||
|
|
1dd92890d7 | ||
|
|
436d2f4bb9 | ||
|
|
0264197f3f | ||
|
|
b487a3521c | ||
|
|
816d914c4e | ||
|
|
c0fd0c8f89 | ||
|
|
ebcda80583 | ||
|
|
407b95e35f | ||
|
|
d08a96e251 | ||
|
|
59d9b97ffe | ||
|
|
cf39198a9a | ||
|
|
02229c7c2d | ||
|
|
1c2ed5cc33 | ||
|
|
efc709578a | ||
|
|
eb5694ca2a | ||
|
|
389166e86e | ||
|
|
2b31495723 | ||
|
|
d5b44a98bc | ||
|
|
0e5551da99 | ||
|
|
3afd3b1afd | ||
|
|
223a39b51e | ||
|
|
8faf300b6e | ||
|
|
5c76f68168 | ||
|
|
ad970dd9df | ||
|
|
161891a06e | ||
|
|
709068ef5b | ||
|
|
2b7f6f82be | ||
|
|
005b1b1a4b | ||
|
|
3eab8f975e | ||
|
|
2a4563a677 | ||
|
|
af32de46a2 | ||
|
|
f35d25c674 | ||
|
|
0dc7f6a2d3 | ||
|
|
bb9232c9d9 | ||
|
|
87cb9efb99 | ||
|
|
4c9a60d4fd | ||
|
|
e36881487d | ||
|
|
56dd722fb4 | ||
|
|
c2f441840f | ||
|
|
a55ea39677 | ||
|
|
fc668f3ec3 | ||
|
|
c515199674 | ||
|
|
b6102e207c | ||
|
|
ddc9a278aa | ||
|
|
e65ef3a24f | ||
|
|
f4b08bacb0 | ||
|
|
ae6cf3da7d | ||
|
|
03133377fa | ||
|
|
106da2f51e | ||
|
|
72b6fdb04b | ||
|
|
453af11e2c | ||
|
|
eeefefd56c | ||
|
|
531c0cf26f | ||
|
|
b7208fb525 | ||
|
|
dc700d5d50 | ||
|
|
00f7af7748 | ||
|
|
9989de4bd0 | ||
|
|
fcbf45ca64 | ||
|
|
509f7a64ea | ||
|
|
e80d147957 | ||
|
|
2cea89dc7d | ||
|
|
1a79adb3a9 | ||
|
|
8dbd92f6c2 | ||
|
|
d22912349b | ||
|
|
26e8f3fd28 | ||
|
|
86864a2f6c | ||
|
|
7c65e4c14b | ||
|
|
a56fbe42a4 | ||
|
|
9427107b94 | ||
|
|
75c589958a | ||
|
|
3e8cad7e39 | ||
|
|
e4c4d146e1 | ||
|
|
34e592341c | ||
|
|
94b9942cd9 | ||
|
|
d5f9ea9fc2 | ||
|
|
f6ed93253b | ||
|
|
3479749499 | ||
|
|
89eafad589 | ||
|
|
8bb5a19905 | ||
|
|
84f77a71e5 | ||
|
|
da0d29e4ab | ||
|
|
f30f4c744e | ||
|
|
6621494d9d | ||
|
|
2374885ac0 | ||
|
|
784cf66dc2 | ||
|
|
6c641471b2 | ||
|
|
18c30c30d6 | ||
|
|
a1b6f1e096 | ||
|
|
a02c683572 | ||
|
|
8ecce4df3d | ||
|
|
9af159c200 | ||
|
|
b96b24ce8c | ||
|
|
fdf04af271 | ||
|
|
203a264f96 | ||
|
|
b5ff4ffedc | ||
|
|
6628a4df45 | ||
|
|
627f484bce | ||
|
|
d03779ee2a | ||
|
|
3e4b0ee509 | ||
|
|
54214fb65f | ||
|
|
3ecae15da2 | ||
|
|
c2da8234d9 | ||
|
|
20d5c4c1a8 | ||
|
|
34c485169e | ||
|
|
cb4702b4c5 | ||
|
|
c1a51d68a6 | ||
|
|
9324bc4cd4 | ||
|
|
449d7bedb6 | ||
|
|
bfd3fe8a4a | ||
|
|
9dbbc6ca13 | ||
|
|
83abf56736 | ||
|
|
a695c8eb51 | ||
|
|
a69db02b7f | ||
|
|
73d8401465 | ||
|
|
4a90f97639 | ||
|
|
4da178b0d8 | ||
|
|
f4bbad8615 | ||
|
|
cebdbda260 | ||
|
|
1d45d7514b | ||
|
|
846bd364be | ||
|
|
295ad6b112 | ||
|
|
f4d394d932 | ||
|
|
65e5ff0fb4 | ||
|
|
2f3dd4916f | ||
|
|
a92cc111a2 | ||
|
|
52296999f6 | ||
|
|
9652def4de | ||
|
|
6d1f3ecc9f | ||
|
|
396cb1e102 | ||
|
|
ac0cc6df62 | ||
|
|
29ea3dde47 | ||
|
|
e21d865440 | ||
|
|
04966097fc | ||
|
|
8c2ae8b03d | ||
|
|
9947453ea8 | ||
|
|
4514e333c6 | ||
|
|
daff186ceb | ||
|
|
8359fbd5e7 | ||
|
|
13209d2565 | ||
|
|
9a6f0596b0 | ||
|
|
901308cbc8 | ||
|
|
ea6d8f5aaf | ||
|
|
4051e87d06 | ||
|
|
4619a94ebf |
13
AUTHORS
Normal file
13
AUTHORS
Normal file
@@ -0,0 +1,13 @@
|
||||
Authors of OpenJPEG
|
||||
See also the files THANKS and CHANGES
|
||||
|
||||
David Janssens designed and implemented the first version of OpenJPEG.
|
||||
Kaori Hagihara designed and implemented the first version of OpenJPIP.
|
||||
Jerome Fimes implemented the alpha version of OpenJPEG v2.
|
||||
Giuseppe Baruffa added the JPWL functionalities.
|
||||
Yannick Verschueren,
|
||||
Herve Drolon,
|
||||
Francois-Olivier Devaux,
|
||||
Antonin Descampe
|
||||
improved the libraries and utilities.
|
||||
|
||||
32
CMake/CTestCustom.cmake.in
Normal file
32
CMake/CTestCustom.cmake.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#----------------------------------------------------------------------
|
||||
#
|
||||
# For further details regarding this file,
|
||||
# see http://www.cmake.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
|
||||
#
|
||||
# and
|
||||
# http://www.kitware.com/blog/home/post/27
|
||||
#
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
|
||||
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
|
||||
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
|
||||
|
||||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
||||
|
||||
# Exclude files from the Testing directories
|
||||
".*/tests/.*"
|
||||
|
||||
# Exclude files from the ThirdParty Utilities directories
|
||||
".*/thirdparty/.*"
|
||||
)
|
||||
|
||||
SET(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||
${CTEST_CUSTOM_WARNING_EXCEPTION}
|
||||
|
||||
# Suppress warning caused by intentional messages about deprecation
|
||||
".*warning,.* is deprecated"
|
||||
# supress warnings caused by 3rd party libs:
|
||||
".*/thirdparty/.*"
|
||||
)
|
||||
20
CMake/FindFCGI.cmake
Normal file
20
CMake/FindFCGI.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
# Look for the header file.
|
||||
FIND_PATH(FCGI_INCLUDE_DIR NAMES fastcgi.h)
|
||||
|
||||
# Look for the library.
|
||||
FIND_LIBRARY(FCGI_LIBRARY NAMES fcgi)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
|
||||
|
||||
# Copy the results to the output variables.
|
||||
IF(FCGI_FOUND)
|
||||
SET(FCGI_LIBRARIES ${FCGI_LIBRARY})
|
||||
SET(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
|
||||
ELSE(FCGI_FOUND)
|
||||
SET(FCGI_LIBRARIES)
|
||||
SET(FCGI_INCLUDE_DIRS)
|
||||
ENDIF(FCGI_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(FCGI_INCLUDE_DIRS FCGI_LIBRARIES)
|
||||
19
CMake/FindKAKADU.cmake
Normal file
19
CMake/FindKAKADU.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# this module looks for KAKADu
|
||||
# http://www.kakadusoftware.com/
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2006-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
FIND_PROGRAM(KDU_EXPAND_EXECUTABLE
|
||||
kdu_expand
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
KDU_EXPAND_EXECUTABLE
|
||||
)
|
||||
31
CMake/FindLCMS.cmake
Normal file
31
CMake/FindLCMS.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
# - Find LCMS library
|
||||
# Find the native LCMS includes and library
|
||||
# Once done this will define
|
||||
#
|
||||
# LCMS_INCLUDE_DIR - Where to find lcms.h, etc.
|
||||
# LCMS_LIBRARIES - Libraries to link against to use LCMS.
|
||||
# LCMS_FOUND - If false, do not try to use LCMS.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# LCMS_LIBRARY, where to find the LCMS library.
|
||||
|
||||
#=============================================================================
|
||||
#=============================================================================
|
||||
|
||||
FIND_PATH(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
|
||||
|
||||
SET(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static)
|
||||
|
||||
FIND_LIBRARY(LCMS_LIBRARY NAMES ${LCMS_NAMES} )
|
||||
|
||||
MARK_AS_ADVANCED(LCMS_INCLUDE_DIR LCMS_LIBRARY)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR)
|
||||
|
||||
IF(LCMS_FOUND)
|
||||
SET( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR})
|
||||
SET( LCMS_LIBRARIES ${LCMS_LIBRARY} )
|
||||
ENDIF(LCMS_FOUND)
|
||||
31
CMake/FindLCMS2.cmake
Normal file
31
CMake/FindLCMS2.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
# - Find LCMS2 library
|
||||
# Find the native LCMS2 includes and library
|
||||
# Once done this will define
|
||||
#
|
||||
# LCMS2_INCLUDE_DIR - Where to find lcms2.h, etc.
|
||||
# LCMS2_LIBRARIES - Libraries to link against to use LCMS2.
|
||||
# LCMS2_FOUND - If false, do not try to use LCMS2.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# LCMS2_LIBRARY - Where to find the LCMS2 library.
|
||||
|
||||
#=============================================================================
|
||||
#=============================================================================
|
||||
|
||||
FIND_PATH(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
|
||||
|
||||
SET(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static)
|
||||
|
||||
FIND_LIBRARY(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
|
||||
|
||||
MARK_AS_ADVANCED(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
|
||||
|
||||
IF(LCMS2_FOUND)
|
||||
SET( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
|
||||
SET( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
|
||||
ENDIF(LCMS2_FOUND)
|
||||
20
CMake/FindPTHREAD.cmake
Normal file
20
CMake/FindPTHREAD.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
# Look for the header file.
|
||||
FIND_PATH(PTHREAD_INCLUDE_DIR NAMES pthread.h)
|
||||
|
||||
# Look for the library.
|
||||
FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthread)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set PTHREAD_FOUND to TRUE if all listed variables are TRUE.
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PTHREAD DEFAULT_MSG PTHREAD_LIBRARY PTHREAD_INCLUDE_DIR)
|
||||
|
||||
# Copy the results to the output variables.
|
||||
IF(PTHREAD_FOUND)
|
||||
SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
|
||||
SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
|
||||
ELSE(PTHREAD_FOUND)
|
||||
SET(PTHREAD_LIBRARIES)
|
||||
SET(PTHREAD_INCLUDE_DIRS)
|
||||
ENDIF(PTHREAD_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(PTHREAD_INCLUDE_DIRS PTHREAD_LIBRARIES)
|
||||
9
CMake/JPIPTestDriver.cmake
Normal file
9
CMake/JPIPTestDriver.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
# JPIP test driver
|
||||
#message(STATUS "${D_URL}")
|
||||
file(DOWNLOAD
|
||||
"${D_URL}"
|
||||
"${D_FILE}"
|
||||
LOG log
|
||||
EXPECTED_MD5 "${EXPECTED_MD5}"
|
||||
)
|
||||
message(STATUS "LOG: ${log}")
|
||||
70
CMake/OpenJPEGCPack.cmake
Normal file
70
CMake/OpenJPEGCPack.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# package bundler
|
||||
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
||||
set(CMAKE_INSTALL_MFC_LIBRARIES 0)
|
||||
set(CMAKE_INSTALL_DEBUG_LIBRARIES 0)
|
||||
if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||
endif()
|
||||
include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
|
||||
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
||||
|
||||
set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
|
||||
set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
|
||||
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${OPJ_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
set(CPACK_PACKAGE_VENDOR "OpenJPEG Team")
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" COPYONLY
|
||||
)
|
||||
# For PackageMaker on MacOSX it is important to have a file extension:
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${OPENJPEG_VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${OPENJPEG_VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${OPENJPEG_VERSION_BUILD}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "openjpeg-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
# Make this explicit here, rather than accepting the CPack default value,
|
||||
# so we can refer to it:
|
||||
SET(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
|
||||
|
||||
IF(NOT DEFINED CPACK_SYSTEM_NAME)
|
||||
# make sure package is not Cygwin-unknown, for Cygwin just
|
||||
# cygwin is good for the system name
|
||||
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||
SET(CPACK_SYSTEM_NAME Cygwin)
|
||||
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
||||
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
|
||||
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(CPACK_SYSTEM_NAME win64-x64)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(CPACK_SYSTEM_NAME win32-x86)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
||||
|
||||
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
||||
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
||||
# default to source package - system, on cygwin system is not
|
||||
# needed
|
||||
IF(CYGWIN)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
||||
ELSE(CYGWIN)
|
||||
SET(CPACK_PACKAGE_FILE_NAME
|
||||
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
||||
ENDIF(CYGWIN)
|
||||
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
||||
|
||||
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
||||
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
|
||||
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
||||
SET(CPACK_BUNDLE_PLIST
|
||||
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
||||
#include(BundleUtilities)
|
||||
|
||||
include(CPack)
|
||||
endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
48
CMake/OpenJPEGConfig.cmake.in
Normal file
48
CMake/OpenJPEGConfig.cmake.in
Normal file
@@ -0,0 +1,48 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# OPENJPEGConfig.cmake - CMake configuration file for external projects.
|
||||
#
|
||||
# This file is configured by OPENJPEG and used by the UseOPENJPEG.cmake
|
||||
# module to load OPENJPEG's settings for an external project.
|
||||
@OPENJPEG_CONFIG_INSTALL_ONLY@
|
||||
# The OPENJPEG version number.
|
||||
SET(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@")
|
||||
SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@")
|
||||
SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
|
||||
|
||||
# The libraries.
|
||||
SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARIES@")
|
||||
|
||||
# The CMake macros dir.
|
||||
SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_CMAKE_DIR_CONFIG@")
|
||||
|
||||
# The configuration options.
|
||||
SET(OPENJPEG_BUILD_SHARED_LIBS "@OPENJPEG_BUILD_SHARED_LIBS@")
|
||||
|
||||
# The "use" file.
|
||||
SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
|
||||
|
||||
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
||||
# This is an install tree
|
||||
include(${SELF_DIR}/OpenJPEGTargets.cmake)
|
||||
get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
|
||||
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
|
||||
|
||||
else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
||||
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
||||
# This is a build tree
|
||||
SET( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@)
|
||||
|
||||
include(${SELF_DIR}/OpenJPEGExports.cmake)
|
||||
|
||||
else(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
||||
message(FATAL_ERROR "ooops")
|
||||
endif(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
|
||||
endif(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
|
||||
|
||||
set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)
|
||||
|
||||
# Backward compatible part:
|
||||
SET(OPENJPEG_FOUND TRUE)
|
||||
|
||||
272
CMakeLists.txt
272
CMakeLists.txt
@@ -7,7 +7,11 @@
|
||||
# For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
|
||||
# e.g.:
|
||||
# SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
|
||||
IF(NOT OPENJPEG_NAMESPACE)
|
||||
SET(OPENJPEG_NAMESPACE "OPENJPEG")
|
||||
@@ -24,103 +28,235 @@ INCLUDE_REGULAR_EXPRESSION("^.*$")
|
||||
#-----------------------------------------------------------------------------
|
||||
# OPENJPEG version number, useful for packaging and doxygen doc:
|
||||
SET(OPENJPEG_VERSION_MAJOR 1)
|
||||
SET(OPENJPEG_VERSION_MINOR 2)
|
||||
SET(OPENJPEG_VERSION_MINOR 5)
|
||||
SET(OPENJPEG_VERSION_BUILD 0)
|
||||
SET(OPENJPEG_VERSION
|
||||
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||
|
||||
# This setting of SOVERSION assumes that any API change
|
||||
# will increment either the minor or major version number of openjpeg
|
||||
SET(PACKAGE_VERSION
|
||||
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||
SET(OPENJPEG_LIBRARY_PROPERTIES
|
||||
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
|
||||
SOVERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}"
|
||||
SOVERSION "${OPENJPEG_VERSION_MAJOR}"
|
||||
)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Path to additional CMake modules
|
||||
SET(CMAKE_MODULE_PATH
|
||||
${CMAKE_SOURCE_DIR}/CMake
|
||||
${CMAKE_MODULE_PATH})
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
|
||||
# warnings
|
||||
IF(WIN32)
|
||||
IF(NOT BORLAND)
|
||||
IF(NOT CYGWIN)
|
||||
IF(NOT MINGW)
|
||||
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
||||
ADD_DEFINITIONS(
|
||||
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
|
||||
-D_CRT_IS_WCTYPE_NO_DEPRECATE
|
||||
-D_CRT_MANAGED_FP_NO_DEPRECATE
|
||||
-D_CRT_NONSTDC_NO_DEPRECATE
|
||||
-D_CRT_SECURE_NO_DEPRECATE
|
||||
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS
|
||||
-D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE
|
||||
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
|
||||
-D_CRT_VCCLRIT_NO_DEPRECATE
|
||||
-D_SCL_SECURE_NO_DEPRECATE
|
||||
)
|
||||
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
||||
ENDIF(NOT MINGW)
|
||||
ENDIF(NOT CYGWIN)
|
||||
ENDIF(NOT BORLAND)
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Install directories
|
||||
|
||||
STRING(TOLOWER ${PROJECT_NAME} projectname)
|
||||
SET(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_BIN_DIR)
|
||||
SET(OPENJPEG_INSTALL_BIN_DIR "bin")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_BIN_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_LIB_DIR)
|
||||
SET(OPENJPEG_INSTALL_LIB_DIR "lib")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_SHARE_DIR)
|
||||
SET(OPENJPEG_INSTALL_SHARE_DIR "share")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_SHARE_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_DATA_DIR)
|
||||
SET(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_DATA_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
|
||||
SET(OPENJPEG_INSTALL_INCLUDE_DIR "include/")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_MAN_DIR)
|
||||
SET(OPENJPEG_INSTALL_MAN_DIR "share/man/")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_MAN_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_DOC_DIR)
|
||||
SET(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_DOC_DIR)
|
||||
|
||||
IF(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
|
||||
SET(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
|
||||
ENDIF(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Big endian test:
|
||||
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
|
||||
TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup file for setting custom ctest vars
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in
|
||||
${CMAKE_BINARY_DIR}/CTestCustom.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenJPEG build configuration options.
|
||||
OPTION(BUILD_SHARED_LIBS "Build OpenJPEG with shared libraries." OFF)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON)
|
||||
SET (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
|
||||
SET (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
|
||||
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# For the codec...
|
||||
OPTION(BUILD_EXAMPLES "Build the Examples (codec...)." OFF)
|
||||
|
||||
|
||||
# configure name mangling to allow multiple libraries to coexist
|
||||
# peacefully
|
||||
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
|
||||
SET(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
|
||||
@ONLY IMMEDIATE)
|
||||
@ONLY)
|
||||
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Always build the library
|
||||
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
SUBDIRS(
|
||||
libopenjpeg
|
||||
mj2
|
||||
# cmake 2.4.5 has poor java support
|
||||
#j2kviewer/src
|
||||
)
|
||||
|
||||
IF(NOT UNIX)
|
||||
SUBDIRS(
|
||||
jpwl
|
||||
jp3d
|
||||
indexer_JPIP
|
||||
)
|
||||
ENDIF(NOT UNIX)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build example only if requested
|
||||
IF(BUILD_EXAMPLES)
|
||||
SUBDIRS(codec)
|
||||
ENDIF(BUILD_EXAMPLES)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# For the documentation
|
||||
OPTION(BUILD_DOCUMENTATION "Build the doxygen documentation" OFF)
|
||||
IF(BUILD_DOCUMENTATION)
|
||||
SUBDIRS(doc)
|
||||
ENDIF(BUILD_DOCUMENTATION)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# For openjpeg team if they ever want Dart+CMake
|
||||
IF(OPENJPEG_STANDALONE)
|
||||
INCLUDE(Dart)
|
||||
MARK_AS_ADVANCED(BUILD_TESTING DART_ROOT TCL_TCLSH)
|
||||
IF(BUILD_TESTING)
|
||||
ENABLE_TESTING()
|
||||
SET(BUILDNAME "OpenJPEG-${CMAKE_SYSTEM}-${CMAKE_C_COMPILER}" CACHE STRING "Name of build on the dashboard")
|
||||
MARK_AS_ADVANCED(BUILDNAME)
|
||||
ENDIF(BUILD_TESTING)
|
||||
ENDIF(OPENJPEG_STANDALONE)
|
||||
|
||||
# Adding test with dataset from:
|
||||
# http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
|
||||
# http://www.jpeg.org/jpeg2000guide/testimages/testimages.html
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Adding JPEG2000_CONFORMANCE_DATA_ROOT
|
||||
FIND_PATH(JPEG2000_CONFORMANCE_DATA_ROOT testimages.html
|
||||
${OPENJPEG_SOURCE_DIR}/../jpeg2000testimages
|
||||
$ENV{JPEG2000_CONFORMANCE_DATA_ROOT}
|
||||
)
|
||||
# pkgconfig support
|
||||
IF(UNIX)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg1.pc.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc @ONLY)
|
||||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION
|
||||
${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig )
|
||||
INSTALL( CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
\"libopenjpeg1.pc\"
|
||||
\"\$ENV{DESTDIR}${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig/libopenjpeg.pc\")")
|
||||
ENDIF(UNIX)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Compiler specific flags:
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
# For all builds, make sure openjpeg is std99 compliant:
|
||||
SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}")
|
||||
# SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
|
||||
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# opj_config.h generation (1/2)
|
||||
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
||||
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
|
||||
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
|
||||
CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build Library
|
||||
INCLUDE_DIRECTORIES(BEFORE ${OPENJPEG_BINARY_DIR})
|
||||
ADD_SUBDIRECTORY(libopenjpeg)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build Applications
|
||||
OPTION(BUILD_CODEC "Build the CODEC executables" ON)
|
||||
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF)
|
||||
OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF)
|
||||
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF)
|
||||
IF(BUILD_JPIP)
|
||||
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
|
||||
ENDIF(BUILD_JPIP)
|
||||
OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
|
||||
OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
|
||||
MARK_AS_ADVANCED(BUILD_VIEWER)
|
||||
MARK_AS_ADVANCED(BUILD_JAVA)
|
||||
|
||||
IF(BUILD_CODEC OR BUILD_MJ2)
|
||||
# OFF: It will only build 3rd party libs if they are not found on the system
|
||||
# ON: 3rd party libs will ALWAYS be build, and used
|
||||
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
|
||||
ADD_SUBDIRECTORY(thirdparty)
|
||||
ADD_SUBDIRECTORY(applications)
|
||||
ENDIF (BUILD_CODEC OR BUILD_MJ2)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# opj_config.h generation (2/2)
|
||||
CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in"
|
||||
"${OPENJPEG_BINARY_DIR}/opj_config.h"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
||||
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
||||
IF(BUILD_DOC)
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
ENDIF(BUILD_DOC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Buld Testing
|
||||
OPTION(BUILD_TESTING "Build the tests." OFF)
|
||||
IF(BUILD_TESTING)
|
||||
IF(BUILD_CODEC)
|
||||
ENABLE_TESTING()
|
||||
INCLUDE(CTest)
|
||||
|
||||
# Search openjpeg data needed for the tests
|
||||
# They could be found via svn on the OpenJPEG google code project
|
||||
# svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo)
|
||||
FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data
|
||||
PATHS
|
||||
$ENV{OPJ_DATA_ROOT}
|
||||
${CMAKE_SOURCE_DIR}/../data
|
||||
)
|
||||
|
||||
# Add repository where to find tests
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
|
||||
ELSE(BUILD_CODEC)
|
||||
message(FATAL_ERROR "You need build codec to run the tests")
|
||||
ENDIF(BUILD_CODEC)
|
||||
ENDIF(BUILD_TESTING)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# install all targets referenced as OPENJPEGTargets
|
||||
INSTALL(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
|
||||
CONFIGURE_FILE( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in
|
||||
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||
@ONLY
|
||||
)
|
||||
INSTALL( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
|
||||
DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# install CHANGES and LICENSE
|
||||
INSTALL(
|
||||
FILES CHANGES
|
||||
LICENSE
|
||||
DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
|
||||
|
||||
INCLUDE (CMake/OpenJPEGCPack.cmake)
|
||||
|
||||
7
CTestConfig.cmake
Normal file
7
CTestConfig.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
set(CTEST_PROJECT_NAME "OPENJPEG")
|
||||
set(CTEST_NIGHTLY_START_TIME "3:00:00 UTC")
|
||||
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "my.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=OPENJPEG")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# checkCtrlM checks source code for explicit ctrl-M's
|
||||
# checks only files with the following extensions: .c, .cxx, .txx, .html, .htm
|
||||
# exits with 0, if all commited files pass the test.
|
||||
# exits with 1, if any one of the tests fails
|
||||
#
|
||||
# checkCtrlM can be run as a cvs commitinfo command.
|
||||
# The following commitinfo line (without the #) will run the script
|
||||
# ALL $CVSROOT/CVSROOT/checkCtrlM
|
||||
#
|
||||
failed=0
|
||||
#
|
||||
# skip the first arg, the directory
|
||||
shift 1
|
||||
|
||||
for file in "$@"; do
|
||||
#
|
||||
# select files with extentions .txx, .cxx, .h, .html, .htm, .c, .txt, .cmake
|
||||
match=`echo $file | egrep \[\.\]txx\$\|\[\.\]cxx\$\|\[\.\]h\$\|\[\.\]html\$\|\[\.\]htm\$\|\[\.\]c\$\|\[\.\]txt\$\|\[\.\]cmake\$`
|
||||
if [ "x$match" != "x" ] ; then
|
||||
count=`grep -n
|
||||
\$ /dev/null $file|wc -c`
|
||||
results=`expr $count \| 0`
|
||||
if [ "$results" != "0" ]; then
|
||||
echo "=========================================================="
|
||||
if [ $results -lt 200 ]; then
|
||||
grep -n
|
||||
\$ /dev/null $file
|
||||
fi
|
||||
echo ""
|
||||
echo "$file has ^M's. They must be removed before you can commit."
|
||||
echo "The problem count was $results"
|
||||
echo "=========================================================="
|
||||
failed=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
exit $failed
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/tcsh
|
||||
#
|
||||
# checkTabs checks source code for explicit TABS
|
||||
# checks only files with the following extensions: .c, .cxx, .txx,
|
||||
# exits with 0, if all commited files pass the test.
|
||||
# exits with 1, if any one of the tests fails
|
||||
#
|
||||
# checkTabs can be run as a cvs commitinfo command.
|
||||
# The following commitinfo line (without the #) will run the script
|
||||
# ALL $CVSROOT/CVSROOT/checkTabs
|
||||
#
|
||||
set failed=0
|
||||
#
|
||||
# skip the first arg, the directory
|
||||
foreach file ( $argv[2-] )
|
||||
#
|
||||
# select files with extentions .txx, .cxx, .h, .html, .htm
|
||||
set match=`echo $file | egrep \[\.\]txx\$\|\[\.\]cxx\$\|\[\.\]h\$\|\[\.\]cpp\$\|\[\.\]htm\$\|\[\.\]html\$\|\[\.\]c\$\|\[\.\]mm\$\|\[\.\]h.in\$\|\[\.\]hxx.in\$\|CMakeLists.txt\$\|\[\.\]cmake\$\|\[\.\]cmake.in\$`
|
||||
if ( $match == "" ) continue;
|
||||
set count=`grep -n " " /dev/null $file|wc -c`
|
||||
set results=`expr $count \| 0`
|
||||
if ( "$results" != "0" ) then
|
||||
echo "=========================================================="
|
||||
grep -n " " /dev/null $file
|
||||
echo ""
|
||||
echo "$file has explicit TABSs."
|
||||
echo "They must be converted to SPACES(2 per TAB) before you can commit."
|
||||
echo "=========================================================="
|
||||
set failed=1
|
||||
endif
|
||||
end
|
||||
exit $failed
|
||||
@@ -1,15 +0,0 @@
|
||||
# The "checkoutlist" file is used to support additional version controlled
|
||||
# administrative files in $CVSROOT/CVSROOT, such as template files.
|
||||
#
|
||||
# The first entry on a line is a filename which will be checked out from
|
||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
|
||||
# The remainder of the line is an error message to use if the file cannot
|
||||
# be checked out.
|
||||
#
|
||||
# File format:
|
||||
#
|
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
checkCtrlM cannot check out checkCtrlM
|
||||
checkTabs cannot check out checkTabs
|
||||
@@ -1,18 +0,0 @@
|
||||
# The "commitinfo" file is used to control pre-commit checks.
|
||||
# The filter on the right is invoked with the repository and a list
|
||||
# of files to check. A non-zero exit of the filter program will
|
||||
# cause the commit to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
|
||||
ALL $CVSROOT/CVSROOT/checkCtrlM %r/%p %s
|
||||
# ALL $CVSROOT/CVSROOT/checkTabs %r/%p %s
|
||||
@@ -1,14 +0,0 @@
|
||||
# Set this to "no" if pserver shouldn't check system users/passwords
|
||||
#SystemAuth=no
|
||||
|
||||
# Put CVS lock files in this directory rather than directly in the repository.
|
||||
#LockDir=/var/lock/cvs
|
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
||||
# level of the new working directory when using the `cvs checkout'
|
||||
# command.
|
||||
#TopLevelAdmin=no
|
||||
|
||||
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
|
||||
# history file, or a subset as needed (ie `TMAR' logs all write operations)
|
||||
#LogHistory=TOFEWGCMAR
|
||||
@@ -1,23 +0,0 @@
|
||||
# This file affects handling of files based on their names.
|
||||
#
|
||||
# The -t/-f options allow one to treat directories of files
|
||||
# as a single file, or to transform a file in other ways on
|
||||
# its way in and out of CVS.
|
||||
#
|
||||
# The -m option specifies whether CVS attempts to merge files.
|
||||
#
|
||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
||||
#
|
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
||||
#
|
||||
# wildcard [option value][option value]...
|
||||
#
|
||||
# where option is one of
|
||||
# -f from cvs filter value: path to filter
|
||||
# -t to cvs filter value: path to filter
|
||||
# -m update methodology value: MERGE or COPY
|
||||
# -k expansion mode value: b, o, kkv, &c
|
||||
#
|
||||
# and value is a single-quote delimited value.
|
||||
# For example:
|
||||
#*.gif -k 'b'
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "editinfo" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,26 +0,0 @@
|
||||
# The "loginfo" file controls where "cvs commit" log information
|
||||
# is sent. The first entry on a line is a regular expression which must match
|
||||
# the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter
|
||||
# program that should expect log information on its standard input.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name ALL appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or DEFAULT.
|
||||
#
|
||||
# You may specify a format string as part of the
|
||||
# filter. The string is composed of a `%' followed
|
||||
# by a single format character, or followed by a set of format
|
||||
# characters surrounded by `{' and `}' as separators. The format
|
||||
# characters are:
|
||||
#
|
||||
# s = file name
|
||||
# V = old version number (pre-checkin)
|
||||
# v = new version number (post-checkin)
|
||||
#
|
||||
# For example:
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
@@ -1,29 +0,0 @@
|
||||
# Three different line formats are valid:
|
||||
# key -a aliases...
|
||||
# key [options] directory
|
||||
# key [options] directory files...
|
||||
#
|
||||
# Where "options" are composed of:
|
||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
||||
# -o prog Run "prog" on "cvs checkout" of module.
|
||||
# -e prog Run "prog" on "cvs export" of module.
|
||||
# -t prog Run "prog" on "cvs rtag" of module.
|
||||
# -u prog Run "prog" on "cvs update" of module.
|
||||
# -d dir Place module in directory "dir" instead of module name.
|
||||
# -l Top-level directory only -- do not recurse.
|
||||
#
|
||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
||||
# release and re-checkout any working directories of these modules.
|
||||
#
|
||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
||||
#
|
||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
||||
# everything on the right of the "-a" had been typed on the command line.
|
||||
#
|
||||
# You can encode a module within a module by using the special '&'
|
||||
# character to interpose another module into the current module. This
|
||||
# can be useful for creating a module that consists of many directories
|
||||
# spread out over the entire source repository.
|
||||
|
||||
opj-base -l -d . .
|
||||
openjpeg -a opj-base libopenjpeg codec doc
|
||||
@@ -1,12 +0,0 @@
|
||||
# The "notify" file controls where notifications from watches set by
|
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
||||
# a regular expression which is tested against the directory that the
|
||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
||||
# then the remainder of the line is a filter program that should contain
|
||||
# one occurrence of %s for the user to notify, and information on its
|
||||
# standard input.
|
||||
#
|
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
||||
#
|
||||
# For example:
|
||||
#ALL mail %s -s "CVS notification"
|
||||
@@ -1,13 +0,0 @@
|
||||
# The "rcsinfo" file is used to control templates with which the editor
|
||||
# is invoked on commit and import.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
||||
# line is the name of the file that contains the template.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,20 +0,0 @@
|
||||
# The "taginfo" file is used to control pre-tag checks.
|
||||
# The filter on the right is invoked with the following arguments:
|
||||
#
|
||||
# $1 -- tagname
|
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
||||
# $3 -- repository
|
||||
# $4-> file revision [file revision ...]
|
||||
#
|
||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "verifymsg" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
479
ChangeLog
479
ChangeLog
@@ -1,479 +0,0 @@
|
||||
What's New for OpenJPEG
|
||||
|
||||
* : fixed
|
||||
- : removed
|
||||
! : changed
|
||||
+ : added
|
||||
|
||||
December 21, 2007
|
||||
* [FOD] Bug fixed by David Bruken. Fixed memory allocation issue in opj_malloc.h
|
||||
! [FOD] Possible errors in pi_create_encode handled
|
||||
|
||||
December 19, 2007
|
||||
* [Antonin] changed variables names alpha, beta, gamma, delta in dwt.c to avoid re-declarations on Macosx
|
||||
! [Parvatha] In pi.c, removed the Recursive function pi_check_next_level() and modified the code.
|
||||
* [FOD] Fixed allocation problem in pi.c
|
||||
|
||||
December 19, 2007
|
||||
+ [FOD] In mqc.h, changed MQC_NUMCTXS from 32 to 19 as there are only 19 possible contexts
|
||||
|
||||
December 10, 2007
|
||||
+ [FOD] First import of JAVAOpenJPEG, a Java wrapper of OpenJPEG, developed by Patrick Piscaglia of Telemis (www.telemis.com).
|
||||
Thank you Patrick for this new module !
|
||||
|
||||
November 29, 2007
|
||||
! [GB] Added index.h and index.c in VC6 projects; wrapped index.h in the C++ preprocessor; modified OPJViewer project and some files.
|
||||
|
||||
November 14, 2007
|
||||
+ [FOD] Created the file index.c in the codec directory. This file handles the creation of index files,
|
||||
at encoding and decoding.
|
||||
* [FOD] Fixed bugs during the creation of the index (PCRL progression order)
|
||||
* [FOD] Fixed the maximum number of resolutions a user can discard while decoding.
|
||||
Added an error state in J2K_STATE (j2k.c)
|
||||
|
||||
November 14, 2007
|
||||
! [FOD] - First Patch by Callum Lerwick. Instead of reinventing realloc, j2k_read_sod now just uses opj_realloc in j2k.c
|
||||
- Second Patch by Callum Lerwick. This patch rearranges the largest memory allocations so they're allocated as
|
||||
late as possible, and freed as soon as possible. This cuts memory usage by about half on two large test images.
|
||||
- Third Patch by Callum Lerwick. The opj_tcd_cblk array is one of the largest allocations, because it
|
||||
contains a bunch of static buffers. This also makes it a major source of cache thrashing. This patch allocates
|
||||
the buffers from the heap, and dynamically sizes them in the decoder. I have not yet managed to dynamically size
|
||||
them in the encoder, getting the decoder to do it was tricky enough... I also split opj_tcd_cblk_t into separate
|
||||
encode and decode versions. A lot of fields were not used by both, so this cuts its size even further.
|
||||
|
||||
* [FOD] Avoided ABI breakage
|
||||
|
||||
November 13, 2007
|
||||
! [FOD] Patch by Dzonatas and Callum Lerwick.
|
||||
Fp/vectorization patch which basically converts most of the irreversible decode codepath to floating point,
|
||||
eliminating a few rounds of int/fp conversion, resulting in a vast performance improvement,
|
||||
and an increase in accuracy.
|
||||
|
||||
November 8, 2007
|
||||
! [FOD] In t1.c, small change to avoid calling twice t1_getwmsedec()
|
||||
Patches from Callum Lewick:
|
||||
- Basic gcc optimization flags in cmake and makefile match.
|
||||
- Fixed some spelling errors in dwt.c.
|
||||
|
||||
November 5, 2007
|
||||
*+ [GB] Fixed a bug which prevented JPWL from working on multi-tiled images; added some more fields in the interface info structures
|
||||
(keep a list of markers, save start packet number for each tile)
|
||||
|
||||
October 23, 2007
|
||||
* [GB] Improved success for the linux build; OPJViewer shows all the COM contents
|
||||
|
||||
October 18, 2007
|
||||
* [FOD] Changed the ROI parameter in the image_to_j2k codec to make it correspond to the documentation (i.e. -ROI c=0,U=25)
|
||||
* [FOD] Patch from Callum Lewick. Memset patch.
|
||||
The main idea of the patch is that currently opj_malloc clears all allocations, which unnecessarily
|
||||
dirties up the cache and eats bandwidth. This patch makes it no longer do so, and I've painstakingly determined which allocations actually need
|
||||
to be cleared and changed them to use opj_calloc() instead. I previously tried to just get rid of the opj_*alloc wrappers but that
|
||||
idea was nixed, so this time I'm trying it with macros. I also put in a gcc pragma that helps enforce their use. Which got messy. :) It caught a
|
||||
few places they weren't used but it also revealed that the mj2 tools are not very cleanly separated from the library. It includes all the
|
||||
internal headers, but it wasn't using the malloc wrappers. I figured the binaries should be "external" and have minimal knowledge of the
|
||||
internals of the library. I patched them to not include opj_includes.h, and include only the internal headers they actually need. However,
|
||||
they're using the opj_clock() function, which is in with the malloc wrappers. So I decided to move the malloc wrappers to their own header.
|
||||
But mj2.c seems to want to be "internal", so I patched it to use the wrappers. Note that this patch changes the semantics of opj_malloc, it no longer
|
||||
clears the memory it allocates. If you need it to be cleared, you must use opj_calloc instead, or memset it yourself. It is also somewhat
|
||||
invasive, please test it extensively. I've been pounding on it all summer with my test suite, Second Life, and valgrind, and it checks out clean.
|
||||
|
||||
October 12, 2007
|
||||
* [FOD] Changed the way the image structure is allocated when the decoding parameters include some resolutions to discard.
|
||||
This should have a significant impact for the decoding of huge images when some resolutions are discarder (-r parameter)
|
||||
Warning: The output image size is now reduced when discarding resolutions !
|
||||
|
||||
October 10, 2007
|
||||
* [FOD] Patch from Callum Lewick. Clean up of j2klib.h for the aligned malloc stuff.
|
||||
It makes it work right with mingw, as _mm_malloc() isn't a macro, attempts to pave the way to using cmake
|
||||
to check for this stuff and combines a patch from Dana Fagerstrom at Sun that makes it use memalign() on Solaris
|
||||
convert.c: Changed some error comments for TIFF images
|
||||
|
||||
September 27, 2007
|
||||
* [FOD] Patch from Callum Lewick. Fixed dwt.c where an alignment in buffer was problematic under x86_64.
|
||||
|
||||
September 25, 2007
|
||||
* [Mathieu Malaterre] BUG: Fix previous patch from Callum Lerwick. I have no
|
||||
clue what CMAKE_INSTALL_LIBDIR refers too. Bump up cmake 2.2 restriction to
|
||||
cmake 2.4 because of previous patch (not backward compatible). Properly set the SOVERSION in a cross plateform way (yes WIN32 is a platform)
|
||||
|
||||
September 19, 2007
|
||||
* [Parvatha] Fixed issues with generation of SOP marker.
|
||||
|
||||
September 18, 2007
|
||||
* [Parvatha] Fixed issues with Reading and Writing TIF images in convert.c to avoid segmentation fault.
|
||||
* [Parvatha] Fixed issues relating to using user specified rates for CINEMA option for multiple images.
|
||||
|
||||
September 17, 2007
|
||||
* [FOD] Fixed issues with cstr_info when codestream has components with different number of resolutions.
|
||||
! [FOD] OpenJPEG library interface modified to retain compatibility with version 1.2
|
||||
|
||||
September 12, 2007
|
||||
* [FOD] Patch from Callum Lerwick.
|
||||
Fixed the library linking so it links with the soversion properly set.
|
||||
Fixes up the install targets so that it interacts properly with RPM.
|
||||
Install target for MJ2. Sets some necessary and useful CFLAGS if gcc is in use.
|
||||
* [FOD] Updated the MJ2 codec to be compatible with the recent changes in the OpenJPEG library
|
||||
|
||||
September 11, 2007
|
||||
* [GB] JPWL encoding is finalized correctly into the JP2 file format; added an additional structure in opj_codestream_info, to keep a record of the written markers
|
||||
|
||||
September 8, 2007
|
||||
* [GB] Adapted the JPWL and OPJViewer code to new interface; fixed a samll bug in JPWL which created large EPBs even when null protection was specified
|
||||
|
||||
September 7, 2007
|
||||
+ [FOD] Indexes can now be generated when decoding J2K codestreams.
|
||||
* [Mathieu Malaterre] Upon failure, properly return error code (!=0).
|
||||
* [Mathieu Malaterre] CMake: Add cmake code to do testing if user has properly setup a testimages directory
|
||||
|
||||
September 6, 2007
|
||||
+ [Mathieu Malaterre] CMake: start compiling mj2, jpwl and jp3d
|
||||
+ [Mathieu Malaterre] CMake: output all executable/libs into one single directory
|
||||
+ [Mathieu Malaterre] CMake: start compiling index_create
|
||||
+ [Mathieu Malaterre] OpenJPEG.rc update copyright year
|
||||
+ [Mathieu Malaterre] CMake: add Java j2kviewer but do not compile it using cmake since cmake has too poor support for Java. Should create a custom command running ant instead.
|
||||
+ [Mathieu Malaterre] CMake: Add doxygen output
|
||||
+ [GB] One more field in the codestream_info struct for recording the number of packets per tile part; JPWL now distributes the EPBs in all the tile part headers
|
||||
+ [Mathieu Malaterre] CMake: Add very simple tests (simply run command line with no option)
|
||||
* [Mathieu Malaterre] Fix unitialized read in img_fol (we may need a smarter initialize than memset)
|
||||
|
||||
September 4, 2007
|
||||
+ [GB] Added some fields in the codestream_info structure: they are used to record the position of single tile parts.
|
||||
Changed also the write_index function in the codec, to reflect the presence of this new information.
|
||||
|
||||
September 3, 2007
|
||||
+ [GB] Added the knowledge of JPSEC SEC and INSEC markers (you have to compile the JPWL project). Management of these markers is limited to skipping them without crashing:
|
||||
no real security function at this stage. Deprecated USE_JPSEC will be removed next
|
||||
|
||||
August 31, 2007
|
||||
* [GB] Fixed save capabilities in OPJViewer due to recent code upgrade
|
||||
|
||||
August 30, 2007
|
||||
* [FOD] Changed the OpenJPEG library interface to enable users to access information regarding the codestream (also called codestream index).
|
||||
This index is usefull for all applications requiring to have a scalable acces to the codestream (like JPIP applications, ...)
|
||||
Currently, this information is only available when encoding an image.
|
||||
+ [FOD] Added the information regarding the end of packet position in the index
|
||||
|
||||
August 28, 2007
|
||||
* [FOD] Fixed wrong destructors called in openjpeg.c
|
||||
* [FOD] Fixed bug in j2k_decode_jpt_stream
|
||||
|
||||
August 24, 2007
|
||||
* [Parvatha] The end of main header is calculated after TLM and POC marker for Dcinema.
|
||||
|
||||
August 21, 2007
|
||||
+ [FOD] Added support for Visual Studio 2005
|
||||
* [FOD] Robustified MJ2 codecs
|
||||
* [Parvatha] Solved problems with codec reading from image file directory when filename had more than one "." in name
|
||||
* [Callum Lerwick] Minor cleanup patch, that gets rid of a bunch of "old style declaration" warnings from Intel's compiler
|
||||
* [Callum Lerwick] Aligned malloc using Intel's _mm_malloc(). Cleanup on the t1 memory allocation, getting rid of some leftover debug code
|
||||
* [Callum Lerwick] Memory leaks fixed
|
||||
* [Callum Lerwick] Reworks of t1_updateflags to get rid of the shift operation
|
||||
* [Callum Lerwick] mqc_setcurctx moved to the header to allow it to be inlined into the t1.
|
||||
* [Callum Lerwick] Consolidated some calls to mqc_setcurctx.
|
||||
* [Callum Lerwick] Cleaned up t1_generate_luts to output the proper types.
|
||||
* [Callum Lerwick] Replaced the large ctxno_mag lookup table with a small bit of inline-able branchless code
|
||||
* [Callum Lerwick] Moved the orient flipping into the ctxno_zc table.
|
||||
|
||||
August 20, 2007
|
||||
+ [FOD] Added support for the TGA file format in the codec
|
||||
|
||||
August 08, 2007
|
||||
* [Parvatha] Fixed the DCinema filesize allocation. It now includes the SOT marker size
|
||||
|
||||
August 02, 2007
|
||||
+ [GB] Added a basic saving capability to OPJViewer
|
||||
|
||||
July 18, 2007
|
||||
! [FOD] Updated libtiff library version to 3.8.2 (for WIN32)
|
||||
* [FOD] Updated BMP and PxM truncation when decoding J2K files with more than 8 bits
|
||||
|
||||
July 17, 2007
|
||||
* [FOD] Fixed raw option for images with more than three components
|
||||
|
||||
July 17, 2007
|
||||
+ [FOD] Added support for RAW images. This module has been developped by the University of Perugia team. Thanks to them ! [image_to_j2k.c j2k_to_image.c convert.c convert.h]
|
||||
|
||||
July 13, 2007
|
||||
! [FOD] Modified the memory allocation for codestreams containing multiple tiles. The memory is now allocated for each tile indenpendently,
|
||||
leading to an important decrease of the virtual memory needed. [j2k.c tcd.h tcd.c]
|
||||
! [FOD] Modified old comments about the ability to decode mega-images and comments about the disk size necessary to do this. [image_to_j2k.c and frames_to_mj2.c]
|
||||
* [FOD] Added 2000 bytes for the memory allocation in cio.c for the minimum size of headers (useful in case of very small images) [cio.c]
|
||||
|
||||
July 12, 2007
|
||||
* [GB] fixed a bug in JPWL module, which prevented to exploit the full error correction capability of RS codes (e.g. it gave up at 5 errors,
|
||||
even if 6 were correctable); defined a JPWL_MAXIMUM_EPB_ROOM for better customization of the maximum dimension of EPBs (the dimension
|
||||
is pre-calculated on an hypothesis, if it goes beyond 65535 there will be problems, thus we give a little less than the max, let's say 65450)
|
||||
|
||||
July 8, 2007
|
||||
* [ANTONIN] fixed the size of the memory allocation in cio.c (confusion between bits and bytes)
|
||||
|
||||
June 21, 2007
|
||||
* [FOD] Output image color space set when decoding a JP2 file in jp2.c
|
||||
+ [GB] Previous, home, and next frame buttons for exploring MJ2 files in OPJViewer
|
||||
|
||||
June 18, 2007
|
||||
* [GB] Reload image doesn't crash in OPJViewer; more settings saved to registry
|
||||
|
||||
June 16, 2007
|
||||
+ [GB] Possibility to disable parsing in OPJViewer; also, saves common settings to the registry
|
||||
|
||||
June 15, 2007
|
||||
* [FOD] Fixed the generation of index files
|
||||
|
||||
|
||||
----------------------
|
||||
MAY 4, 2007
|
||||
VERSION 1.2.0 RELEASED
|
||||
----------------------
|
||||
|
||||
May 4, 2007
|
||||
* [FOD] Bugs corrected in decoding of command line (getopt.c), in the handling of 16 bit files (t1.c and tcd.c) and the calculation of elapsed time for multiple tiles parts (tcd.c and tdc.h).
|
||||
|
||||
June 2, 2007
|
||||
+ [GB] OPJViewer opens now BMP, PNG, GIF, PNM, TIFF (with wxWidgets internals); added an encoder settings tab, for future integration with "save file as..." in JPEG 2000 format
|
||||
|
||||
May 31, 2007
|
||||
* [FOD] Fixed the handling of 16bit TIFF files for cinema compression. Modified "convert.c"
|
||||
* [FOD] Fixed the parameters used for cinema compression (9-7 transform used instead of 5-3). Modified "image_to_j2k.c"
|
||||
|
||||
May 24, 2007
|
||||
* [FOD] Bug fixed by Sylvain Munaut. Change in the reading of the POC marker. Since COD/COC can be anywhere in the header, the decoder cannot always know while decoding the POC marker
|
||||
the value of numlayers and numresolution.
|
||||
|
||||
May 23, 2007
|
||||
! [FOD] Patch suggested by Callum Lerwick <seg@haxxed.com>: "This makes the t1 data arrays dynamic, which greatly reduces cache thrashing. Also, some minor cleanup to prevent unnecessary casts"
|
||||
|
||||
May 22, 2007
|
||||
! [FOD] Patch suggested by Callum Lerwick <seg@haxxed.com>: "Some formatting cleanups,
|
||||
so that the long function definitions and calls fit on screen. Use of prefix increment which is theoretically faster, in practice any sane compiler can optimize a postfix
|
||||
increment but its best not to count on such things. Consolidation of some redundant calculations in the inner loops, which becomes very useful in the future autovectorize patch."
|
||||
! [FOD] Patch suggested by Callum Lerwick <seg@haxxed.com>: "This changes the flag code in t1 to use a flag_t type, which can then be changed to reduce RAM usage. It is now typedef to a short."
|
||||
! [FOD] Patch suggested by Callum Lerwick <seg@haxxed.com>: "This patch makes the t1 LUTs static. I actually intend this as a prelude to possibly eliminating some or all of the LUTs entirely."
|
||||
|
||||
May 11, 2007
|
||||
- [FOD] JP3D library Binaries removed from SVN.
|
||||
! [FOD] MJ2 codec updated from LibOpenJPEG version 0.97 to LibOpenJPEG version 1. Hence, the MJ2 codec will now take advantage of all the improvements and optimizations done on the LibOpenJPEG library.
|
||||
! [FOD] Possibility to choose to apply MCT (multiple component transform) enabled, and new decoding_limit: DECODE_ALL_BUT_PACKETS (openjpeg.h)
|
||||
|
||||
April 26, 2007
|
||||
+ [gdcm] Add basic steps on how to use CMake for building examples (README.cmake)
|
||||
|
||||
April 25, 2007
|
||||
+ [FOD] Modification of the openjpeg.h file to avoid and ABI break with v1.1, removed the dangerous #IFDEF JPWL and added tcp_mct in cparameters.
|
||||
|
||||
April 23, 2007
|
||||
+ [GB] Enable/disable image decoding in OPJViewer
|
||||
|
||||
April 12,2007
|
||||
* [Parvatha] Fixed Error in tiftoimage(). Modification in convert.c.
|
||||
|
||||
April 10,2007
|
||||
+ [Parvatha] Accepting "j2c" as format for Encoding and Decoding. Modification in image_to_j2k.c.
|
||||
* [Parvatha] Modified imagetotif() to read images with signed data. Modification in convert.c.
|
||||
|
||||
April 5, 2007
|
||||
! [FOD] fix.h optimized. Thanks a lot to Dzonatas <dzonatas at dzonux.net> !
|
||||
! [FOD] dwt.c optimized. Thanks a lot to Dzonatas <dzonatas at dzonux.net> !
|
||||
! [FOD] t1.c optimized. Thanks a lot to Callum Lerwick <seg at haxxed.com> !
|
||||
|
||||
April 4,2007
|
||||
+ [Parvatha] Digital cinema compliance for 4K chosen by "-cinema4K" option. Modification in image_to_j2k.c.
|
||||
+ [Parvatha] Bit rate limitation for each color component. Modification in image_to_j2k.c, t2.c.
|
||||
* [Parvatha] Modified and tested Progression order change "-POC" option. Modification in image_to_j2k.c, j2k.c, pi.c.
|
||||
+ [Parvatha] Function j2k_check_poc_val() to check for possible loss of packets in case of wrong POC declaration. Modification in j2k.c.
|
||||
+ [Parvatha] Structure T2_MODE. This tells if the t2_encode_packets() is called during Threshold calculation or in Final pass. Modification in j2k.h, tcd.c
|
||||
|
||||
March 30, 2007
|
||||
* [GB] OPJViewer should now work under Linux, at least with not big j2k files. Tested under Suse 10.1 64 bit.
|
||||
|
||||
March 29, 2007
|
||||
* [Parvatha] Enable accepting file names with `-<2D> symbol .Modification getopt.c
|
||||
* [Parvatha] Rsiz profile name generation to be STD_RSIZ for profiles which are not DCI compliant.Modification in image_to_j2k.c
|
||||
! [Parvatha] renamed convert_progression_order to j2k_convert_progression_order. Modification j2k.c
|
||||
* [Parvatha] Calculation of number of tile part in each tile in j2k_calculate_tp. Modification j2k.c
|
||||
! [Parvatha] j2k_setup_encoder to set bit rate limitation for digital cinema compliance with quality option. Modification in j2k.c
|
||||
* [Parvatha] Equation to check multiple tile precincts. Modification pi.c
|
||||
! [Parvatha] array size generation of pi->include in pi_initialise_encode().Modification in pi.c
|
||||
* [Parvatha] modification in pi_create_encode for tile part generation.Modification in pi.c
|
||||
+ [Parvatha] In tcd_rateallocate a variable stable_threshold which holds the valid threshold value.
|
||||
This is used to avoid error in case of a wrong threshold value in the last iteration. Modification in tcd.c.
|
||||
|
||||
March 28, 2007
|
||||
* [FOD] Fixed an historical bug in t1.c that leaded to the inclusion of useless 0xFF in the codestream. Thanks to Sylvain, Pascal and Parvatha !
|
||||
|
||||
March 27, 2007
|
||||
+ [GB] Improved parsing in OPJViewer, as well some minor aesthetic modifications; support for image rendering with bit depths lower than 8 bits;
|
||||
can display an arbitrary frame of an MJ2 file (only in B/W, though); can reload a file; better resizing capabilities
|
||||
* [GB] Following to Herv<72>'s suggestions, all the exit() calls, added by JPWL strict checking in t2.c and j2k.c,
|
||||
have been substituted with (object free'ing + opj_evt_message(EVT_ERROR) + return)
|
||||
+ [GB] Added linking to TIFF library in the JPWL VC6 workspaces
|
||||
|
||||
March 23, 2007
|
||||
* [antonin] Fixed Makefile.osx and changed Readme.osx accordingly
|
||||
|
||||
March 21, 2007
|
||||
* [Parvatha] Fixed j2k_prog_order_list[]. Modifications in j2k.c.
|
||||
* [Parvatha] Fixed t1_decode_cblks. Modifications in t1.c.
|
||||
|
||||
March 20, 2007
|
||||
+ [Parvatha] Added feature for generation of tile parts. Modifications in image_to_j2k.c, openjpeg.c, j2k.c, pi.c
|
||||
+ [Parvatha] Added function j2k_write_tlm(),to generate TLM marker for a Digital cinema compliant codestream. Modifications in j2k.c.
|
||||
|
||||
March 14, 2007
|
||||
* [FOD] Fixed linux makefile, with help from David Fries and Guido
|
||||
|
||||
March 7, 2007
|
||||
+ [Parvatha] Added option for Digital cinema profile compliant codestream. This can be chosen by "-cinema2K" or "-cinema4K" for a 2K and 4K compliance respectively. The feature for tileparts has not been implemented in this version. Modification in image_to_j2k.c
|
||||
+ [Parvatha] Added the Digital Cinema profiles (CINEMA2K and CINEMA4K) to the list of profiles recognized in the codestream SIZ marker segment. Modification in openjpeg.h,j2k.c
|
||||
+ [Parvatha] Added feature for constant quality within bitrate defined in Digital cinema standards. Modification in tcd.c
|
||||
! [Parvatha] Modified the method of generation of buffer length. Modification in cio.c
|
||||
|
||||
|
||||
March 1, 2007
|
||||
* [FOD] Modified codec projects (*.dsp) and makefile to include the tiff library (modified codec/image_to_j2k.dsp codec/j2k_to_image.dsp and codec/makefile)
|
||||
+ [GB] Zoom capability and decoder settings dialog in OPJViewer; modified JPWL library .dsp project in order to create a library with embedded JPWL functions
|
||||
|
||||
February 28, 2007
|
||||
+ [Parvatha] Enabled compression of TIF image format to j2k by tifftoimage() and decompression of codestream to TIF image format using imagetotif(). Modifications in image_to_j2k.c, j2k_to_image.c, convert.c, convert.h
|
||||
* [antonin] fixed a bug in context numerotation that prevented the RESET switch to work correctly : mqc_reset_enc in mqc.c
|
||||
* [Fod] Corrected codec Makefile by adding the compilation of "compat/getopt.c"
|
||||
|
||||
February 27, 2007
|
||||
* [Parvatha] Made get_file_format function more robust. Modifications in image_to_j2k.c, j2k_to_image.c, getopt.c, getopt.h
|
||||
|
||||
February 26, 2007
|
||||
+ [Parvatha] Option to read images from a Folder whose path is specified in the Input parameters by "-ImgDir" along with output decod format specified by "-OutFor" . Modifications in image_to_j2k.c, j2k_to_image.c, getopt.c, getopt.h
|
||||
+ [Parvatha] Enabling use of multi character input parameters in the codec. Modifications in image_to_j2k.c, j2k_to_image.c, getopt.c, getopt.h
|
||||
|
||||
----------------------
|
||||
February 23, 2007
|
||||
VERSION 1.1.1 RELEASED
|
||||
----------------------
|
||||
|
||||
February 23, 2007
|
||||
* [GB] Fixed a copy-and-paste type assignment error (bool instead of int) in the JPWL section of decoder parameters structure in openjpeg.h; minor type-casting in jpwl_lib.c.
|
||||
As a result, now OPJViewer should run correctly when built against the most current SVN trunk of LibOpenJPEG.lib
|
||||
+ [GB] Linux makefile for the JPWL module; newlines at end of JPWL files
|
||||
|
||||
February 22, 2007
|
||||
+ [FOD] Added the OPJViewer Module (/OPJViewer), developed by Giuseppe Baruffa of the university of Perugia
|
||||
|
||||
February 21, 2007
|
||||
+ [FOD] Algorithmic optimizations in t1.c, thanks to Guido J. !
|
||||
|
||||
February 19, 2007
|
||||
+ [FOD] Added OPJ_LIMIT_DECODING enabling us to limit the decoding to main header (modified openjpeg.c, openjpeg.h, j2k.c and j2k.h)
|
||||
|
||||
February 13, 2007
|
||||
! [FOD] David Fries suggestions. In image_to_j2k and j2k_to_image, strncpy() functions: instead of specifying the path size macro, let the compiler read the length out of the array entry.
|
||||
! [FOD] David Fries suggestions. Makefile modified. -fPIC flag used for 64-bit compilation. Move operation (rather than copy) for the dist library creation, and -p flag added.
|
||||
|
||||
January 31, 2007
|
||||
! [FOD] Extra tokens at the end of #endif directive corrected in openjpeg.c, j2k.c and image_to_j2k.c -> no more warnings in linux compilation
|
||||
! [FOD] Linux Makefile added for the codec
|
||||
|
||||
January 30, 2007
|
||||
! [FOD] Use of OPJ_PATH_LEN (defined as 4096) to be the maximum allowed size for filenames instead of MAX_PATH which is not always defined. This caused some programs using OpenJPEG to crash. Modifications in openjpeg.h j2k_to_image.c and image_to_j2k.c
|
||||
! [FOD] Correction of the syntax usage in MJ2_codec/mj2_to_frames.c
|
||||
|
||||
January 23, 2007
|
||||
! [FOD] Modification in the context numbers, to reflect what has been specified in standard, in libopenjpeg/t1.h
|
||||
|
||||
December 07, 2006
|
||||
+ [Giuseppe Baruffa] Antonin verified that the MacOS build suffered from a missing definition of the "min" macro; I've added this definition (properly #ifndef'ed) into both jpwl.h and rs.h
|
||||
|
||||
December 05, 2006
|
||||
* [Giuseppe Baruffa] Better fix of the TPH EPBs bug in JPWL module
|
||||
* [GB] Fixed the UEP bug in JPWL module; now, during a UEP specification, RS protection or CRC check can be switched off for selected range of packets, and consequently reswitched on without confusing the decoder
|
||||
+ [GB] Added some lines in the help of JPWL_image_to_j2k, specifying that when using error protection on data packets, this must be paired with header protection, i.e. there cannot be packet protection without header protection
|
||||
|
||||
December 04, 2006
|
||||
|
||||
+ [Francois-Olivier Devaux] New tag: version1.0 (includes codec and libopenjpeg directories)
|
||||
Total update of JPWL module
|
||||
- [FOD] removed directories jpwl/decoder, jpwl/encoder, jpwl/decoder_02, jpwl/encoder_02
|
||||
+ [FOD] added in JPWL directory crc.h, jpwl.h, rs.h, crc.c, jpwl.c, jpwl_lib.c, rs.c, JPWL_image_to_j2k.dsp, JPWL_j2k_to_image.dsp, LibOpenJPEG_JPWL.dsp, JPWL_image_to_j2k.dsw, JPWL_j2k_to_image.dsw
|
||||
! [FOD] Modifications of libopenjpeg to integrate JPWL module (in libopenjpeg directory): j2k.c, j2k.h, openjpeg.c, openjpeg.h, opj_includes.g, t2.c
|
||||
! [FOD] Modification of codec to integrate JPWL module (in codec directory): image_to_j2k.c, j2k_to_image.c
|
||||
* [FOD] Corrected incorrect fprintf() formatting in codec/convert.c
|
||||
* [FOD] Code optimization usinq vsprintf() command in libopenjpeg/event.c
|
||||
* [Giuseppe Baruffa] Fixed a bug in TPH EPBs parameters: now, "last in current header" information is correctly signaled
|
||||
|
||||
October 31, 2006
|
||||
* [Antonin] fixed a bug in the computation of the mantissa (mu)
|
||||
+ [Antonin] added the ability to specify the rate as "float" (before : integer)
|
||||
|
||||
August 18, 2006
|
||||
* [Antonin] fixed a bug in j2k_to_image.c, that prevented the -l option to work correctly.
|
||||
|
||||
August 4, 2006
|
||||
* [Antonin] fixed a bug in pi.c, line 473, that appeared when more than 100 precincts were generated in a resolution level.
|
||||
|
||||
July 28, 2006
|
||||
+ [Antonin Descampe] added a readme in /mj2 to warn people that it only works with opj0.97
|
||||
|
||||
July 21, 2006
|
||||
* [Mathieu Malaterre] Install exe and lib and include correctly
|
||||
* [Mathieu Malaterre] Fixed mem leaks and greyscale bmp
|
||||
* [Mathieu Malaterre] Fix pgx name length + random memory access
|
||||
! [Mathieu Malaterre] API is now const
|
||||
|
||||
March 19, 2006
|
||||
* [Antonin] fixed a bug in t1.c that prevented in some cases a true lossless compression (thanks to Don Mimlitch for reporting this bug)
|
||||
|
||||
February 12, 2006
|
||||
- [Herve Drolon] removed unneeded working variables in opj_tcd_t
|
||||
|
||||
February 04, 2006
|
||||
* [galt] fixed a bug in codec/convert.c::imagetobmp
|
||||
|
||||
February 01, 2006
|
||||
! [Herve Drolon] changed function definitions of INT and FIX modules to 'inline'
|
||||
+ [Herve Drolon] added a VERSION resource to the DLL version of OpenJPEG
|
||||
|
||||
January 31, 2006
|
||||
* [Mathieu Malaterre] Fix compilation using default openjpeg.dsw
|
||||
* [Herve Drolon] fixed various minor warnings occuring under icc9 and bcc32
|
||||
- [Mathieu Malaterre] Remove all references to OPJ_EXPORT, no declspec in header file anymore
|
||||
+ [Mathieu Malaterre] Add a def.in file which is a template for Module Definition
|
||||
+ [Herve Drolon] added MSVC project and compiler directives to build a 'standard' WIN32 DLL
|
||||
! [Mathieu Malaterre] Update CMake to match the new shared lib system (no more def file)
|
||||
|
||||
January 27, 2006
|
||||
* [Antonin Descampe] fixed a two initialization problems in t1.c and tcd.c
|
||||
|
||||
January 26, 2006
|
||||
* [Herve Drolon] fixed various minor warnings occuring under gcc
|
||||
* [__david__] fixed a segfault in codec/image_to_j2k.c & codec/j2k_to_image.c
|
||||
* [__david__] fixed help option in codec/j2k_to_image & codec/image_to_j2k
|
||||
|
||||
January 25, 2006
|
||||
! [Mathieu Malaterre] Sync with ITK repository, also add ref to doxygen
|
||||
! [Mathieu Malaterre] Add a lot of comments on the CMake build system
|
||||
! [Mathieu Malaterre] Fix MINGW32 and BORLAND compilation problems.
|
||||
|
||||
January 25, 2006
|
||||
* [Antonin Descampe] fixed a problem in convert.c when multiple comments
|
||||
+ [Antonin Descampe] added cmake files to the project
|
||||
! [Antonin Descampe] fix.c : replaced "WIN32" by "_MSC_VER" for int64
|
||||
+ [Antonin Descampe] added "OPJ_EXPORT" in openjpeg.h to generate shared lib with win32
|
||||
! [Antonin Descampe] removed all CtrlM from files
|
||||
|
||||
January 24, 2006
|
||||
! [Antonin Descampe] event.c : replaced "WIN32" by "_MSC_VER" for i2a
|
||||
|
||||
January 20, 2006
|
||||
* [Antonin Descampe] fixed various minor warnings with gdcm patches
|
||||
|
||||
January 19, 2006
|
||||
* [Herve Drolon] fixed a bug in jp2_read_ihdr (need to allocate jp2->comps)
|
||||
|
||||
January 18, 2006
|
||||
* [Herve Drolon] changed the name of j2k_realloc to opj_realloc
|
||||
* [Herve Drolon] fixed a bug in opj_cio_open when saving 48-bit images (wrong buffer size calculation)
|
||||
|
||||
December 8, 2005
|
||||
* [Antonin Descampe] fixed a bug when specifying a rate '-r' => no distortion info was available in the index
|
||||
* [Antonin Descampe] fixed a bug in t1_getwmsedec (stepsize was divided by 8192)
|
||||
|
||||
December 5, 2005 - 1.1.0
|
||||
273
DllOpenJPEG.dsp
273
DllOpenJPEG.dsp
@@ -1,273 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="DllOpenJPEG" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=DllOpenJPEG - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DllOpenJPEG.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DllOpenJPEG.mak" CFG="DllOpenJPEG - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DllOpenJPEG - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "DllOpenJPEG - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "DllOpenJPEG - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLLOPENJPEG_EXPORTS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPJ_EXPORTS" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/OpenJPEG.dll"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=if not exist dist mkdir dist copy libopenjpeg\openjpeg.h dist copy Release\OpenJPEG.dll dist copy Release\OpenJPEG.lib dist
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "DllOpenJPEG - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLLOPENJPEG_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPJ_EXPORTS" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/OpenJPEGd.dll" /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=if not exist dist mkdir dist copy libopenjpeg\openjpeg.h dist copy Debug\OpenJPEGd.dll dist copy Debug\OpenJPEGd.lib dist
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "DllOpenJPEG - Win32 Release"
|
||||
# Name "DllOpenJPEG - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\bio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\cio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\dwt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\event.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\image.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\j2k.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\j2k_lib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\jp2.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\jpt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\mct.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\mqc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\openjpeg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\pi.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\raw.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\t1.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\t2.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\tcd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\tgt.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\bio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\cio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\dwt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\event.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\fix.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\image.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\int.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\j2k.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\j2k_lib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\jp2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\jpt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\mct.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\mqc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\openjpeg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\opj_includes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\pi.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\raw.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\t1.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\t2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\tcd.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\tgt.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\OpenJPEG.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DllOpenJPEG", "DllOpenJPEG.vcproj", "{89AC992C-5E2C-4E6B-A453-61C1DF446216}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{89AC992C-5E2C-4E6B-A453-61C1DF446216}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{89AC992C-5E2C-4E6B-A453-61C1DF446216}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{89AC992C-5E2C-4E6B-A453-61C1DF446216}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{89AC992C-5E2C-4E6B-A453-61C1DF446216}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,670 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="DllOpenJPEG"
|
||||
ProjectGUID="{89AC992C-5E2C-4E6B-A453-61C1DF446216}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/DllOpenJPEG.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
WholeProgramOptimization="false"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OPJ_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/DllOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1036"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Release/OpenJPEG.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/OpenJPEG.pdb"
|
||||
LinkTimeCodeGeneration="0"
|
||||
ImportLibrary=".\Release/OpenJPEG.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/DllOpenJPEG.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="if not exist dist mkdir dist
copy libopenjpeg\openjpeg.h dist
copy Release\OpenJPEG.dll dist
copy Release\OpenJPEG.lib dist
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/DllOpenJPEG.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OPJ_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/DllOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1036"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/OpenJPEGd.dll"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/OpenJPEGd.pdb"
|
||||
ImportLibrary=".\Debug/OpenJPEGd.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/DllOpenJPEG.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="if not exist dist mkdir dist
copy libopenjpeg\openjpeg.h dist
copy Debug\OpenJPEGd.dll dist
copy Debug\OpenJPEGd.lib dist
"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="libopenjpeg\bio.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\cio.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\dwt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\event.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\image.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k_lib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jp2.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jpt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mct.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mqc.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\openjpeg.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\pi.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\raw.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t1.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t2.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tcd.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tgt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="libopenjpeg\bio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\cio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\dwt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\event.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\fix.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\image.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\int.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k_lib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jp2.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jpt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mct.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mqc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\openjpeg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\opj_includes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\pi.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\raw.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t1.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t2.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tcd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tgt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
113
INSTALL
Normal file
113
INSTALL
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
How to build and install openjpeg binaries
|
||||
==========================================
|
||||
|
||||
UNIX/LINUX similar systems
|
||||
--------------------------
|
||||
|
||||
1) Using autotools
|
||||
|
||||
It is highly recommended that pkg-config is installed. If needed, you have to
|
||||
properly set the environment variable PKG_CONFIG_PATH so that the .pc files
|
||||
are found.
|
||||
|
||||
To build from top-level directory, you can simply type:
|
||||
./bootstrap.sh
|
||||
./configure
|
||||
make
|
||||
|
||||
To keep all build files in a separate directory, you can type instead:
|
||||
./bootstrap.sh
|
||||
mkdir build
|
||||
cd build
|
||||
../configure
|
||||
make
|
||||
|
||||
To install:
|
||||
sudo make install
|
||||
|
||||
To clean:
|
||||
make clean
|
||||
make distclean
|
||||
|
||||
To build doc (requires 'doxygen' to be found on your system):
|
||||
(this will create an html directory in TOP_LEVEL/doc)
|
||||
make doc
|
||||
|
||||
Main './configure' options (type './configure --help' for more details)
|
||||
'--enable-mj2'
|
||||
'--enable-jpwl'
|
||||
'--enable-jpip'
|
||||
'--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
|
||||
'--enable-debug' (default : disabled)
|
||||
|
||||
You can also specify your own CFLAGS and LDFLAGS with (for example):
|
||||
CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
|
||||
|
||||
The (optional) dependencies of some binaries are libpng, libtiff, libcms 1 or 2
|
||||
and FastCGI. Only libtiff and FastCGI have no .pc file. There should be some
|
||||
automatic detection if they are installed in /usr, /usr/local or /opt/local.
|
||||
Otherwise, you can tune their detection (as well as for libpng and libcms1 or 2
|
||||
too) with the environment variables:
|
||||
|
||||
TIFF_CFLAGS
|
||||
TIFF_LIBS
|
||||
FCGI_CFLAGS
|
||||
FCGI_LIBS
|
||||
|
||||
See './configure --help' output for more details.
|
||||
|
||||
|
||||
2) Using cmake (see www.cmake.org)
|
||||
|
||||
Type:
|
||||
cmake .
|
||||
make
|
||||
|
||||
If you are root:
|
||||
make install
|
||||
make clean
|
||||
|
||||
else:
|
||||
sudo make install
|
||||
make clean
|
||||
|
||||
To build the Doxygen documentation (Doxygen needs to be found on the system):
|
||||
(A 'html' directory is generated in the 'doc' directory)
|
||||
make doc
|
||||
|
||||
Binaries are located in the 'bin' directory.
|
||||
|
||||
Main available cmake flags:
|
||||
* To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
|
||||
* To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
|
||||
Note: when using this option, static libraries are not built and executables are dynamically linked.
|
||||
* To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
|
||||
* To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
|
||||
* To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
|
||||
* To build the JPIP library and utilities: '-DBUILD_JPIP:bool=on' (default: 'OFF')
|
||||
* To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
|
||||
cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory'
|
||||
make
|
||||
make Experimental
|
||||
Note : JPEG2000 test files are available with 'svn checkout http://openjpeg.googlecode.com/svn/data' (about 70 Mo).
|
||||
If '-DOPJ_DATA_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE_SOURCE_DIR}/../data',
|
||||
corresponding to the location of the data directory when compiling from the trunk (and assuming the data directory has
|
||||
been checked out of course).
|
||||
|
||||
MACOSX
|
||||
------
|
||||
|
||||
The same building procedures as above (autotools and cmake) work for MACOSX.
|
||||
The xcode project file can also be used.
|
||||
|
||||
If it does not work, try adding the following flag to the cmake command :
|
||||
'-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
|
||||
|
||||
WINDOWS
|
||||
-------
|
||||
|
||||
If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used.
|
||||
|
||||
Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
|
||||
Type 'cmake --help' for available generators on your platform.
|
||||
@@ -1,53 +0,0 @@
|
||||
# Build the demo app, small examples
|
||||
|
||||
# First thing define the common source:
|
||||
SET(common_SRCS
|
||||
convert.c
|
||||
)
|
||||
# Then check if getopt is present:
|
||||
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
||||
SET(DONT_HAVE_GETOPT 1)
|
||||
IF(UNIX) #I am pretty sure only *nix sys have this anyway
|
||||
CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
|
||||
# Seems like we need the contrary:
|
||||
IF(CMAKE_HAVE_GETOPT_H)
|
||||
SET(DONT_HAVE_GETOPT 0)
|
||||
ENDIF(CMAKE_HAVE_GETOPT_H)
|
||||
ENDIF(UNIX)
|
||||
|
||||
# If not getopt was found then add it to the lib:
|
||||
IF(DONT_HAVE_GETOPT)
|
||||
ADD_DEFINITIONS(-DDONT_HAVE_GETOPT)
|
||||
SET(common_SRCS
|
||||
${common_SRCS}
|
||||
compat/getopt.c
|
||||
)
|
||||
ENDIF(DONT_HAVE_GETOPT)
|
||||
|
||||
|
||||
# Headers file are located here:
|
||||
INCLUDE_DIRECTORIES(
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
||||
)
|
||||
|
||||
# Do the proper thing when building static...if only there was configured
|
||||
# headers or def files instead
|
||||
IF(NOT BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
||||
ENDIF(NOT BUILD_SHARED_LIBS)
|
||||
|
||||
FIND_PACKAGE(TIFF REQUIRED)
|
||||
|
||||
# Loop over all executables:
|
||||
FOREACH(exe j2k_to_image image_to_j2k)
|
||||
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
||||
TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg ${TIFF_LIBRARIES})
|
||||
# On unix you need to link to the math library:
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(${exe} -lm)
|
||||
ENDIF(UNIX)
|
||||
# Install exe
|
||||
INSTALL_TARGETS(/bin/ ${exe})
|
||||
ENDFOREACH(exe)
|
||||
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="image_to_j2k" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=image_to_j2k - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "image_to_j2k.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "image_to_j2k.mak" CFG="image_to_j2k - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "image_to_j2k - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "image_to_j2k - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "image_to_j2k - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../libopenjpeg" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "OPJ_STATIC" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libs/libtiff/libtiff.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libc"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "image_to_j2k - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../libopenjpeg" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "OPJ_STATIC" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libs/libtiff/libtiff.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "image_to_j2k - Win32 Release"
|
||||
# Name "image_to_j2k - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\convert.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\convert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\compat\getopt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\compat\getopt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\image_to_j2k.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,44 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "LibOpenJPEG"=..\LibOpenJPEG.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "image_to_j2k"=.\image_to_j2k.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name LibOpenJPEG
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="JavaOpenJPEG"
|
||||
ProjectGUID="{9D538724-B030-464C-A419-C80B3BC0D020}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="C:\users\pp\telemis\working\projects\codecs\OpenJPEG2000\codec;../libopenjpeg;"../../../../3rdparty/windows/java-jni/include";"../../../../3rdparty/windows/java-jni/include/win32""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;OPJ_STATIC;CHECK_THRESHOLDS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
PrecompiledHeaderFile=".\Release/JavaOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ../libs/libtiff/libtiff.lib"
|
||||
OutputFile="../../dlls/win32/JavaOpenJPEG.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames="libc"
|
||||
ProgramDatabaseFile=".\Release/JavaOpenJPEG.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/JavaOpenJPEG.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1036"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
GlobalOptimizations="FALSE"
|
||||
InlineFunctionExpansion="0"
|
||||
FavorSizeOrSpeed="0"
|
||||
OptimizeForWindowsApplication="FALSE"
|
||||
AdditionalIncludeDirectories="../libopenjpeg,../../../../3rdparty/windows/java-jni/include,../../../../3rdparty/windows/java-jni/include/win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OPJ_STATIC"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/JavaOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ../libs/libtiff/libtiff.lib"
|
||||
OutputFile=".\Debug/JavaOpenJPEG.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames="libc"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/JavaOpenJPEG.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/JavaOpenJPEG.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1036"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release64|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="../libopenjpeg;../../../../3rdparty/windows/java-jni/include;../../../../3rdparty/windows/java-jni/include/win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;OPJ_STATIC"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
PrecompiledHeaderFile=".\Release64/JavaOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Release64/"
|
||||
ObjectFile=".\Release64/"
|
||||
ProgramDataBaseFileName=".\Release64/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/machine:AMD64"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib "C:\Program Files\Microsoft Platform SDK\Lib\AMD64\bufferoverflowu.lib""
|
||||
OutputFile="../../dlls/win32/JavaOpenJPEG.W64.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames="libc"
|
||||
ProgramDatabaseFile=".\Release64/JavaOpenJPEG.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="0"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/JavaOpenJPEG.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1036"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\codec\convert.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codec\convert.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codec\dirent.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codec\compat\getopt.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codec\compat\getopt.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codec\index.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codec\index.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="JavaOpenJPEG.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release64|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\JavaOpenJPEGDecoder.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\org_openJpeg_OpenJPEGJavaDecoder.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\org_openJpeg_OpenJPEGJavaEncoder.h">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,14 +0,0 @@
|
||||
# Makefile for the main OpenJPEG codecs: j2k_to_image and image_to_j2k
|
||||
|
||||
CFLAGS = -O3 -lstdc++ # -g -p -pg
|
||||
|
||||
all: j2k_to_image image_to_j2k
|
||||
|
||||
j2k_to_image: j2k_to_image.c ../libopenjpeg.a
|
||||
gcc $(CFLAGS) compat/getopt.c convert.c j2k_to_image.c -o j2k_to_image -L.. -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
||||
|
||||
image_to_j2k: image_to_j2k.c ../libopenjpeg.a
|
||||
gcc $(CFLAGS) compat/getopt.c convert.c image_to_j2k.c -o image_to_j2k -L.. -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
||||
|
||||
clean:
|
||||
rm -f j2k_to_image image_to_j2k
|
||||
@@ -1,7 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2002, David Janssens
|
||||
* Copyright (c) 2003-2004, Yannick Verschueren
|
||||
* Copyright (c) 2003-2004, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
|
||||
* Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2012, Professor Benoit Macq
|
||||
* Copyright (c) 2003-2012, Antonin Descampe
|
||||
* Copyright (c) 2003-2009, Francois-Olivier Devaux
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -25,14 +29,3 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __BIO_H
|
||||
#define __BIO_H
|
||||
|
||||
int bio_numbytes();
|
||||
void bio_init_dec(unsigned char *bp, int len);
|
||||
int bio_read(int n);
|
||||
int bio_flush();
|
||||
int bio_inalign();
|
||||
|
||||
#endif
|
||||
262
LibOpenJPEG.dsp
262
LibOpenJPEG.dsp
@@ -1,262 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="LibOpenJPEG" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=LibOpenJPEG - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "LibOpenJPEG.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "LibOpenJPEG.mak" CFG="LibOpenJPEG - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "LibOpenJPEG - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "LibOpenJPEG - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "LibOpenJPEG - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "OPJ_STATIC" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=if not exist dist mkdir dist copy Release\LibOpenJPEG.lib dist copy libopenjpeg\openjpeg.h dist
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "LibOpenJPEG - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "OPJ_STATIC" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"Debug\LibOpenJPEGd.lib"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=if not exist dist mkdir dist copy Debug\LibOpenJPEGd.lib dist copy libopenjpeg\openjpeg.h dist
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "LibOpenJPEG - Win32 Release"
|
||||
# Name "LibOpenJPEG - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\bio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\cio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\dwt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\event.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\image.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\j2k.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\j2k_lib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\jp2.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\jpt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\mct.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\mqc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\openjpeg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\pi.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\raw.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\t1.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\t2.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\tcd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\tgt.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\bio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\cio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\dwt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\event.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\fix.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\image.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\int.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\j2k.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\j2k_lib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\jp2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\jpt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\mct.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\mqc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\openjpeg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\opj_includes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\pi.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\raw.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\t1.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libopenjpeg\t1_luts.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\t2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\tcd.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=libopenjpeg\tgt.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,41 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "DllOpenJPEG"=.\DllOpenJPEG.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "LibOpenJPEG"=.\LibOpenJPEG.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibOpenJPEG", "LibOpenJPEG.vcproj", "{6A47DBE3-8F80-4ABE-8688-5F8DC620977C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6A47DBE3-8F80-4ABE-8688-5F8DC620977C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6A47DBE3-8F80-4ABE-8688-5F8DC620977C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6A47DBE3-8F80-4ABE-8688-5F8DC620977C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6A47DBE3-8F80-4ABE-8688-5F8DC620977C}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,642 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="LibOpenJPEG"
|
||||
ProjectGUID="{4F27AA53-4181-4A1A-8238-3931B0A41048}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
WholeProgramOptimization="false"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPJ_STATIC;_CRT_SECURE_NO_DEPRECATE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/LibOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1036"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\Release\LibOpenJPEG.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/LibOpenJPEG.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="if not exist dist mkdir dist
copy Release\LibOpenJPEG.lib dist
copy libopenjpeg\openjpeg.h dist
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
InlineFunctionExpansion="0"
|
||||
EnableIntrinsicFunctions="false"
|
||||
FavorSizeOrSpeed="1"
|
||||
WholeProgramOptimization="false"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPJ_STATIC;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/LibOpenJPEG.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1036"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="Debug\LibOpenJPEGd.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/LibOpenJPEG.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="if not exist dist mkdir dist
copy Debug\LibOpenJPEGd.lib dist
copy libopenjpeg\openjpeg.h dist
"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="libopenjpeg\bio.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\cio.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\dwt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\event.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\image.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k_lib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jp2.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jpt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mct.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mqc.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\openjpeg.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\pi.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\raw.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t1.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t2.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tcd.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tgt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="libopenjpeg\bio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\cio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\dwt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\event.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\fix.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\image.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\int.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\j2k_lib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jp2.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\jpt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mct.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\mqc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\openjpeg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\opj_includes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libopenjpeg\opj_malloc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\pi.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\raw.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t1.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t1_luts.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\t2.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tcd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="libopenjpeg\tgt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
78
Makefile
78
Makefile
@@ -1,78 +0,0 @@
|
||||
# Linux makefile for OpenJPEG
|
||||
|
||||
VER_MAJOR = 2
|
||||
VER_MINOR = 1.2.0
|
||||
|
||||
SRCS = ./libopenjpeg/bio.c ./libopenjpeg/cio.c ./libopenjpeg/dwt.c ./libopenjpeg/event.c ./libopenjpeg/image.c ./libopenjpeg/j2k.c ./libopenjpeg/j2k_lib.c ./libopenjpeg/jp2.c ./libopenjpeg/jpt.c ./libopenjpeg/mct.c ./libopenjpeg/mqc.c ./libopenjpeg/openjpeg.c ./libopenjpeg/pi.c ./libopenjpeg/raw.c ./libopenjpeg/t1.c ./libopenjpeg/t2.c ./libopenjpeg/tcd.c ./libopenjpeg/tgt.c
|
||||
INCLS = ./libopenjpeg/bio.h ./libopenjpeg/cio.h ./libopenjpeg/dwt.h ./libopenjpeg/event.h ./libopenjpeg/fix.h ./libopenjpeg/image.h ./libopenjpeg/int.h ./libopenjpeg/j2k.h ./libopenjpeg/j2k_lib.h ./libopenjpeg/jp2.h ./libopenjpeg/jpt.h ./libopenjpeg/mct.h ./libopenjpeg/mqc.h ./libopenjpeg/openjpeg.h ./libopenjpeg/pi.h ./libopenjpeg/raw.h ./libopenjpeg/t1.h ./libopenjpeg/t2.h ./libopenjpeg/tcd.h ./libopenjpeg/tgt.h ./libopenjpeg/opj_malloc.h ./libopenjpeg/opj_includes.h
|
||||
INCLUDE = -Ilibopenjpeg
|
||||
|
||||
# General configuration variables:
|
||||
CC = gcc
|
||||
AR = ar
|
||||
|
||||
PREFIX = /usr
|
||||
INSTALL_LIBDIR = $(PREFIX)/lib
|
||||
INSTALL_INCLUDE = $(PREFIX)/include
|
||||
|
||||
# Converts cr/lf to just lf
|
||||
DOS2UNIX = dos2unix
|
||||
|
||||
COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 -fPIC
|
||||
LIBRARIES = -lstdc++
|
||||
|
||||
MODULES = $(SRCS:.c=.o)
|
||||
CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
|
||||
|
||||
TARGET = openjpeg
|
||||
STATICLIB = lib$(TARGET).a
|
||||
SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
|
||||
LIBNAME = lib$(TARGET).so.$(VER_MAJOR)
|
||||
|
||||
|
||||
|
||||
default: all
|
||||
|
||||
all: OpenJPEG
|
||||
|
||||
dist: OpenJPEG
|
||||
install -d dist
|
||||
install -m 644 $(STATICLIB) dist
|
||||
install -m 755 $(SHAREDLIB) dist
|
||||
ln -sf $(SHAREDLIB) dist/$(LIBNAME)
|
||||
install libopenjpeg/openjpeg.h dist
|
||||
|
||||
dos2unix:
|
||||
@$(DOS2UNIX) $(SRCS) $(INCLS)
|
||||
|
||||
OpenJPEG: $(STATICLIB) $(SHAREDLIB)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(STATICLIB): $(MODULES)
|
||||
$(AR) r $@ $(MODULES)
|
||||
|
||||
$(SHAREDLIB): $(MODULES)
|
||||
$(CC) -s -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)
|
||||
|
||||
install: OpenJPEG
|
||||
install -d '$(DESTDIR)$(INSTALL_LIBDIR)' '$(DESTDIR)$(INSTALL_INCLUDE)'
|
||||
install -m 644 -o root -g root $(STATICLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
|
||||
ranlib '$(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB)'
|
||||
install -m 755 -o root -g root $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
|
||||
ln -sf $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)'
|
||||
install -m 644 -o root -g root libopenjpeg/openjpeg.h '$(DESTDIR)$(INSTALL_INCLUDE)'
|
||||
-ldconfig
|
||||
|
||||
clean:
|
||||
rm -rf core dist/ u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)
|
||||
|
||||
osx:
|
||||
make -f Makefile.osx
|
||||
|
||||
osxinstall:
|
||||
make -f Makefile.osx install
|
||||
|
||||
osxclean:
|
||||
make -f Makefile.osx clean
|
||||
75
Makefile.am
Normal file
75
Makefile.am
Normal file
@@ -0,0 +1,75 @@
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-jpip=yes --enable-jpip-server=yes --enable-jpwl=yes --enable-mj2=yes
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = libopenjpeg applications doc
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libopenjpeg1.pc
|
||||
|
||||
if WANT_JPWL
|
||||
pkgconfig_DATA += libopenjpeg-jpwl.pc
|
||||
endif
|
||||
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
Makefile.in \
|
||||
aclocal.m4 \
|
||||
config.guess \
|
||||
opj_config.h.in \
|
||||
opj_config.h.in~ \
|
||||
config.sub \
|
||||
configure \
|
||||
depcomp \
|
||||
install-sh \
|
||||
ltmain.sh \
|
||||
missing
|
||||
|
||||
EXTRA_DIST = \
|
||||
CMake/CTestCustom.cmake.in \
|
||||
CMake/FindFCGI.cmake \
|
||||
CMake/FindLCMS2.cmake \
|
||||
CMake/FindLCMS.cmake \
|
||||
CMake/OpenJPEGConfig.cmake.in \
|
||||
CMakeLists.txt \
|
||||
CTestConfig.cmake \
|
||||
AUTHORS \
|
||||
CHANGES \
|
||||
INSTALL \
|
||||
LICENSE \
|
||||
NEWS \
|
||||
README \
|
||||
THANKS \
|
||||
bootstrap.sh \
|
||||
libopenjpeg1.pc.cmake \
|
||||
libopenjpeg1.pc.in \
|
||||
libopenjpeg-jpwl.pc.in \
|
||||
opj_config.h.cmake.in \
|
||||
m4/opj_check_lib.m4 \
|
||||
m4/opj_doxygen.m4 \
|
||||
m4/pkg.m4
|
||||
|
||||
.PHONY: doc
|
||||
|
||||
# Documentation
|
||||
|
||||
doc:
|
||||
@echo "entering doc/"
|
||||
@cd doc && make doc
|
||||
|
||||
install-data-hook:
|
||||
if HAVE_WIN32
|
||||
$(LN_S) -f libopenjpeg1.pc $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
|
||||
else
|
||||
$(LN_S) -nf libopenjpeg1.pc $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
|
||||
endif
|
||||
@echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg1.pc" >> $(top_builddir)/report.txt
|
||||
@echo -e " (LN)\t$(pkgconfigdir)/libopenjpeg.pc" >> $(top_builddir)/report.txt
|
||||
if WANT_JPWL
|
||||
@echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg-jpwl.pc" >> $(top_builddir)/report.txt
|
||||
endif
|
||||
@cat $(top_builddir)/report.txt
|
||||
@rm $(top_builddir)/report.txt
|
||||
|
||||
uninstall-hook:
|
||||
rm -f $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
|
||||
66
Makefile.osx
66
Makefile.osx
@@ -1,66 +0,0 @@
|
||||
# MacOSX makefile for OpenJPEG
|
||||
|
||||
VER_MAJOR = 2
|
||||
VER_MINOR = 1.2.0
|
||||
|
||||
SRCS = ./libopenjpeg/bio.c ./libopenjpeg/cio.c ./libopenjpeg/dwt.c ./libopenjpeg/event.c ./libopenjpeg/image.c ./libopenjpeg/j2k.c ./libopenjpeg/j2k_lib.c ./libopenjpeg/jp2.c ./libopenjpeg/jpt.c ./libopenjpeg/mct.c ./libopenjpeg/mqc.c ./libopenjpeg/openjpeg.c ./libopenjpeg/pi.c ./libopenjpeg/raw.c ./libopenjpeg/t1.c ./libopenjpeg/t2.c ./libopenjpeg/tcd.c ./libopenjpeg/tgt.c
|
||||
INCLS = ./libopenjpeg/bio.h ./libopenjpeg/cio.h ./libopenjpeg/dwt.h ./libopenjpeg/event.h ./libopenjpeg/fix.h ./libopenjpeg/image.h ./libopenjpeg/int.h ./libopenjpeg/j2k.h ./libopenjpeg/j2k_lib.h ./libopenjpeg/jp2.h ./libopenjpeg/jpt.h ./libopenjpeg/mct.h ./libopenjpeg/mqc.h ./libopenjpeg/openjpeg.h ./libopenjpeg/pi.h ./libopenjpeg/raw.h ./libopenjpeg/t1.h ./libopenjpeg/t2.h ./libopenjpeg/tcd.h ./libopenjpeg/tgt.h ./libopenjpeg/opj_includes.h
|
||||
INCLUDE = -Ilibopenjpeg
|
||||
|
||||
# General configuration variables:
|
||||
CC = gcc
|
||||
LIBTOOLSTAT = libtool
|
||||
LIBTOOLDYN = gcc
|
||||
|
||||
PREFIX = /usr
|
||||
INSTALL_LIBDIR = $(PREFIX)/lib
|
||||
INSTALL_INCLUDE = $(PREFIX)/include
|
||||
|
||||
COMPILERFLAGS = -O3 -fPIC
|
||||
|
||||
MODULES = $(SRCS:.c=.o)
|
||||
CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
|
||||
|
||||
TARGET = openjpeg
|
||||
STATICLIB = lib$(TARGET).a
|
||||
SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).dylib
|
||||
LIBNAME = lib$(TARGET).dylib
|
||||
|
||||
|
||||
|
||||
default: all
|
||||
|
||||
all: OpenJPEG
|
||||
|
||||
dos2unix:
|
||||
@$(DOS2UNIX) $(SRCS) $(INCLS)
|
||||
|
||||
dist: OpenJPEG
|
||||
install -d dist
|
||||
install -m 644 $(STATICLIB) dist
|
||||
install -m 755 $(SHAREDLIB) dist
|
||||
ln -sf $(SHAREDLIB) dist/$(LIBNAME)
|
||||
install libopenjpeg/openjpeg.h dist
|
||||
|
||||
OpenJPEG: $(STATICLIB) $(SHAREDLIB)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(STATICLIB): $(MODULES)
|
||||
$(LIBTOOLSTAT) -o $@ $(MODULES)
|
||||
|
||||
$(SHAREDLIB): $(MODULES)
|
||||
$(LIBTOOLDYN) -dynamiclib -o $@ $(MODULES)
|
||||
|
||||
install:
|
||||
install -d '$(DESTDIR)$(INSTALL_LIBDIR)' '$(DESTDIR)$(INSTALL_INCLUDE)'
|
||||
install -m 644 -o root -g wheel $(STATICLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
|
||||
ranlib '$(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB)'
|
||||
install -m 755 -o root -g wheel $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
|
||||
ln -sf $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)'
|
||||
install -m 644 -o root -g wheel ./libopenjpeg/openjpeg.h '$(DESTDIR)$(INSTALL_INCLUDE)'
|
||||
|
||||
clean:
|
||||
rm -rf core dist/ u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)
|
||||
|
||||
34
NEWS
Normal file
34
NEWS
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
OpenJPEG NEWS - user visible changes
|
||||
====================================
|
||||
|
||||
Changes from OpenJPEG 1.4.0 to OpenJPEG 1.5.0
|
||||
----------------------------------------------
|
||||
|
||||
New Features:
|
||||
|
||||
* openjpip:
|
||||
- complete client-server architecture for remote browsing of jpeg 2000 images.
|
||||
- located in 'applications/jpip'.
|
||||
- see corresponding README for more details.
|
||||
|
||||
API modifications:
|
||||
|
||||
* 'bool' type has been replaced by 'opj_bool' type. 'stdbool.h' is no more required.
|
||||
|
||||
Misc:
|
||||
|
||||
* added this NEWS file.
|
||||
* improved cmake and autotools build methods.
|
||||
* removed manual makefiles, VS project files and XCode project files.
|
||||
* added a 'thirdparty' directory to contain all dependencies.
|
||||
- These libraries will be build only if there are not found on the system.
|
||||
- Note that libopenjpeg itself does not have any dependency.
|
||||
* changed the directory hierarchy of the whole project. See README files for details.
|
||||
* tests : a complete test suite has been setup.
|
||||
- both JPEG 2000 conformance tests and non-regressions tests are configured.
|
||||
- results are submitted to the OpenJPEG dashboard (http://my.cdash.org/index.php?project=OPENJPEG)
|
||||
- images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
|
||||
- configuration files and utilities are located in 'tests' folder.
|
||||
* OPJViewer re-activated (need wxWidgets)
|
||||
* Huge amount of bug fixes. See CHANGES for details.
|
||||
@@ -1,41 +0,0 @@
|
||||
# Makefile for OPJViewer
|
||||
|
||||
# General configuration variables:
|
||||
CC = $(shell wx-config-2.8 --cxx)
|
||||
AR = ar
|
||||
|
||||
CFLAGS = -DUSE_JPWL -DwxUSE_LIBOPENJPEG -DwxUSE_GUI=1 -DOPJ_STATIC -DOPJ_HTMLABOUT $(shell wx-config-2.8 --cxxflags) # -g -p -pg -DUSE_JPWL
|
||||
|
||||
OPJV_SRCS = source/imagj2k.cpp source/imagmj2.cpp source/wxj2kparser.cpp source/imagjp2.cpp source/OPJViewer.cpp source/wxjp2parser.cpp source/OPJViewer.cpp source/OPJThreads.cpp
|
||||
|
||||
MODULES = $(OPJV_SRCS:.cpp=.o)
|
||||
|
||||
all: opjviewer lib
|
||||
|
||||
.cpp.o:
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
lib:
|
||||
cd ../jpwl; make
|
||||
|
||||
opjviewer: $(OPJV_SRCS) lib
|
||||
$(CC) $(CFLAGS) -I .. $(OPJV_SRCS) -o OPJViewer -L ../jpwl -lopenjpeg_JPWL -lm -lstdc++ -ltiff $(shell wx-config-2.8 --libs)
|
||||
|
||||
|
||||
clean:
|
||||
rm -f OPJViewer *.o *.a
|
||||
cd ../libopenjpeg; rm -f *.o
|
||||
|
||||
|
||||
|
||||
|
||||
#.cpp.o :
|
||||
# $(CXX) -g -c `wx-config-2.8 --cxxflags` -I ../.. -D wxUSE_LIBOPENJPEG -D wxHACK_BOOLEAN -o $@ $<
|
||||
|
||||
#all: $(PROGRAM)
|
||||
|
||||
#$(PROGRAM): $(OBJECTS)
|
||||
# $(CXX) -o $(PROGRAM) $(OBJECTS) -lopenjpeg -L ../.. `wx-config-2.8 --libs`
|
||||
|
||||
#clean:
|
||||
# rm -f *.o $(PROGRAM)
|
||||
@@ -1,319 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="OPJViewer" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=OPJVIEWER - WIN32 RELEASE
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "OPJViewer.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "OPJViewer.mak" CFG="OPJVIEWER - WIN32 RELEASE"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "OPJViewer - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "OPJViewer - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "OPJViewer - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /G6 /MD /W3 /GX /O2 /I "d:\programmi\wxWidgets-2.8.0\lib\vc_lib\msw" /I "d:\programmi\wxWidgets-2.8.0\include" /I ".." /I "../libopenjpeg" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /D "wxUSE_LIBOPENJPEG" /D "OPJ_STATIC" /D "USE_JPWL" /D "USE_JPSEC" /D "USE_MXF" /D "OPJ_HTMLABOUT" /D "OPJ_MANYFORMATS" /D "OPJ_INICONFIG" /FR /FD /c
|
||||
# ADD BASE RSC /l 0x410 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /i "d:\programmi\wxWidgets-2.8.0\include" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxzlib.lib wxregex.lib wxpng.lib wxjpeg.lib wxbase28.lib wxmsw28_core.lib wxmsw28_html.lib wxmsw28_adv.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib LibOpenJPEG_JPWL.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libcmt.lib" /libpath:"d:\programmi\wxWidgets-2.8.0\lib\vc_lib" /libpath:"..\jpwl\Release" /IGNORE:4089
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=Update build number
|
||||
PostBuild_Cmds=buildupdate.bat
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "OPJViewer - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "OPJViewer___Win32_Debug"
|
||||
# PROP BASE Intermediate_Dir "OPJViewer___Win32_Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "c:\Programmi\wxWidgets-2.8.0\INCLUDE" /I "c:\programmi\wxWidgets-2.8.0\lib\vc_lib\msw" /I "c:\programmi\wxWidgets-2.8.0\include" /I ".." /D "_DEBUG" /D "__WXDEBUG__" /D WXDEBUG=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /D "wxUSE_LIBOPENJPEG" /D "OPJ_STATIC" /D "USE_JPWL" /D "OPJ_HTMLABOUT" /FR /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x410 /d "_DEBUG"
|
||||
# ADD RSC /l 0x410 /i "c:\programmi\wxWidgets-2.8.0\include" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxzlibd.lib wxregexd.lib wxpngd.lib wxjpegd.lib wxtiffd.lib wxbase28d.lib wxmsw28d_core.lib wxmsw28d_html.lib wxmsw28d_adv.lib LibOpenJPEG_JPWLd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /pdbtype:sept /libpath:"c:\programmi\wxWidgets-2.8.0\lib\vc_lib" /libpath:"..\jpwl\Debug"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "OPJViewer - Win32 Release"
|
||||
# Name "OPJViewer - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagj2k.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagjp2.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagjpeg2000.cpp
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagmj2.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagmxf.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\codec\index.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJAbout.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJDialogs.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJThreads.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJViewer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wxj2kparser.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wxjp2parser.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\about_htm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\build.h
|
||||
|
||||
!IF "$(CFG)" == "OPJViewer - Win32 Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "OPJViewer - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagj2k.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagjp2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagmj2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\imagmxf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\codec\index.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJViewer.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\blank.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\bullseye.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\cdrom.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\computer.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\cross.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\drive.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\file1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\floppy.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\folder1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\folder2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\hand.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\icon1.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\icon2.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\icon3.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\icon4.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\icon5.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\magnif1.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\opj_logo.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJChild.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJChild16.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJViewer.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJViewer.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\OPJViewer16.xpm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\pbrush.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\pencil.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\pntleft.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\pntright.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\removble.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\rightarr.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\roller.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\source\wx\msw\std.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,44 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "LibOpenJPEG_JPWL"=..\jpwl\LibOpenJPEG_JPWL.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "OPJViewer"=.\OPJViewer.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name LibOpenJPEG_JPWL
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
::== buildupdate.bat
|
||||
@echo off
|
||||
setLocal EnableDelayedExpansion
|
||||
|
||||
for /f "tokens=2,* delims=^(^) " %%a in ('find /v "" ^< .\source\build.h') do (
|
||||
rem echo %%a
|
||||
set /A M = %%a + 1
|
||||
echo Build %%a done^!
|
||||
echo wxT^("!M!"^) > buildtemp283746825t347
|
||||
)
|
||||
|
||||
if exist buildtemp283746825t347 move /Y buildtemp283746825t347 .\source\build.h
|
||||
if exist buildtemp283746825t347 del /F /Q buildtemp283746825t347
|
||||
|
||||
::==
|
||||
@@ -1 +0,0 @@
|
||||
wxT("404")
|
||||
@@ -1,721 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagj2k.cpp
|
||||
// Purpose: wxImage JPEG 2000 codestream handler
|
||||
// Author: Giuseppe Baruffa - based on imagjpeg.cpp, Vaclav Slavik
|
||||
// RCS-ID: $Id: imagj2k.cpp,v 0.00 2007/02/08 23:59:00 MW Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_LIBOPENJPEG
|
||||
|
||||
#include "imagj2k.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/module.h"
|
||||
#endif
|
||||
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/wfstream.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxJ2KHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxJ2KHandler,wxImageHandler)
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
|
||||
//------------- JPEG 2000 Data Source Manager
|
||||
|
||||
#define J2K_CFMT 0
|
||||
#define JP2_CFMT 1
|
||||
#define JPT_CFMT 2
|
||||
#define MJ2_CFMT 3
|
||||
#define PXM_DFMT 0
|
||||
#define PGX_DFMT 1
|
||||
#define BMP_DFMT 2
|
||||
#define YUV_DFMT 3
|
||||
|
||||
#define MAX_MESSAGE_LEN 200
|
||||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void j2k_error_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* sample warning callback expecting a FILE* client object */
|
||||
void j2k_warning_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* sample debug callback expecting no client object */
|
||||
void j2k_info_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
// load the j2k codestream
|
||||
bool wxJ2KHandler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose, int index)
|
||||
{
|
||||
opj_dparameters_t parameters; /* decompression parameters */
|
||||
opj_event_mgr_t event_mgr; /* event manager */
|
||||
opj_image_t *opjimage = NULL;
|
||||
unsigned char *src = NULL;
|
||||
unsigned char *ptr;
|
||||
int file_length;
|
||||
opj_codestream_info_t cstr_info; /* Codestream information structure */
|
||||
|
||||
// destroy the image
|
||||
image->Destroy();
|
||||
|
||||
/* handle to a decompressor */
|
||||
opj_dinfo_t* dinfo = NULL;
|
||||
opj_cio_t *cio = NULL;
|
||||
|
||||
|
||||
/* configure the event callbacks (not required) */
|
||||
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
|
||||
event_mgr.error_handler = j2k_error_callback;
|
||||
event_mgr.warning_handler = j2k_warning_callback;
|
||||
event_mgr.info_handler = j2k_info_callback;
|
||||
|
||||
/* set decoding parameters to default values */
|
||||
opj_set_default_decoder_parameters(¶meters);
|
||||
|
||||
/* prepare parameters */
|
||||
strncpy(parameters.infile, "", sizeof(parameters.infile)-1);
|
||||
strncpy(parameters.outfile, "", sizeof(parameters.outfile)-1);
|
||||
parameters.decod_format = J2K_CFMT;
|
||||
parameters.cod_format = BMP_DFMT;
|
||||
if (m_reducefactor)
|
||||
parameters.cp_reduce = m_reducefactor;
|
||||
if (m_qualitylayers)
|
||||
parameters.cp_layer = m_qualitylayers;
|
||||
|
||||
/* JPWL only */
|
||||
#ifdef USE_JPWL
|
||||
parameters.jpwl_exp_comps = m_expcomps;
|
||||
parameters.jpwl_max_tiles = m_maxtiles;
|
||||
parameters.jpwl_correct = m_enablejpwl;
|
||||
#endif /* USE_JPWL */
|
||||
|
||||
/* get a decoder handle */
|
||||
dinfo = opj_create_decompress(CODEC_J2K);
|
||||
|
||||
/* find length of the stream */
|
||||
stream.SeekI(0, wxFromEnd);
|
||||
file_length = (int) stream.TellI();
|
||||
|
||||
/* get data */
|
||||
stream.SeekI(0, wxFromStart);
|
||||
src = (unsigned char *) malloc(file_length);
|
||||
stream.Read(src, file_length);
|
||||
|
||||
/* catch events using our callbacks and give a local context */
|
||||
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
|
||||
|
||||
/* setup the decoder decoding parameters using user parameters */
|
||||
opj_setup_decoder(dinfo, ¶meters);
|
||||
|
||||
/* open a byte stream */
|
||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||
|
||||
/* decode the stream and fill the image structure */
|
||||
opjimage = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||
if (!opjimage) {
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogError(wxT("J2K: failed to decode image!"));
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_cio_close(cio);
|
||||
opj_image_destroy(opjimage);
|
||||
free(src);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* close the byte stream */
|
||||
opj_cio_close(cio);
|
||||
|
||||
/* common rendering method */
|
||||
#include "imagjpeg2000.cpp"
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("J2K: image loaded."));
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
/* close openjpeg structs */
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_image_destroy(opjimage);
|
||||
free(src);
|
||||
|
||||
if (!image->Ok())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
#define CINEMA_24_CS 1302083 /* Codestream length for 24fps */
|
||||
#define CINEMA_48_CS 651041 /* Codestream length for 48fps */
|
||||
#define COMP_24_CS 1041666 /* Maximum size per color component for 2K & 4K @ 24fps */
|
||||
#define COMP_48_CS 520833 /* Maximum size per color component for 2K @ 48fps */
|
||||
|
||||
// save the j2k codestream
|
||||
bool wxJ2KHandler::SaveFile( wxImage *wimage, wxOutputStream& stream, bool verbose )
|
||||
{
|
||||
opj_cparameters_t parameters; /* compression parameters */
|
||||
opj_event_mgr_t event_mgr; /* event manager */
|
||||
opj_image_t *oimage = NULL;
|
||||
opj_image_cmptparm_t *cmptparm;
|
||||
opj_cio_t *cio = NULL;
|
||||
opj_codestream_info_t cstr_info;
|
||||
int codestream_length;
|
||||
bool bSuccess;
|
||||
int i;
|
||||
char indexfilename[OPJ_PATH_LEN] = ""; /* index file name */
|
||||
|
||||
/*
|
||||
configure the event callbacks (not required)
|
||||
setting of each callback is optionnal
|
||||
*/
|
||||
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
|
||||
event_mgr.error_handler = j2k_error_callback;
|
||||
event_mgr.warning_handler = j2k_warning_callback;
|
||||
event_mgr.info_handler = j2k_info_callback;
|
||||
|
||||
/* set encoding parameters to default values */
|
||||
opj_set_default_encoder_parameters(¶meters);
|
||||
|
||||
/* load parameters */
|
||||
parameters.cp_cinema = OFF;
|
||||
|
||||
/* subsampling */
|
||||
if (sscanf(m_subsampling.ToAscii(), "%d,%d", &(parameters.subsampling_dx), &(parameters.subsampling_dy)) != 2) {
|
||||
wxLogError(wxT("Wrong sub-sampling encoder setting: dx,dy"));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* compression rates */
|
||||
if ((m_rates != wxT("")) && (!m_enablequality)) {
|
||||
const char *s1 = m_rates.ToAscii();
|
||||
wxLogMessage(wxT("rates %s"), s1);
|
||||
while (sscanf(s1, "%f", &(parameters.tcp_rates[parameters.tcp_numlayers])) == 1) {
|
||||
parameters.tcp_numlayers++;
|
||||
while (*s1 && *s1 != ',') {
|
||||
s1++;
|
||||
}
|
||||
if (!*s1)
|
||||
break;
|
||||
s1++;
|
||||
}
|
||||
wxLogMessage(wxT("%d layers"), parameters.tcp_numlayers);
|
||||
parameters.cp_disto_alloc = 1;
|
||||
}
|
||||
|
||||
/* image quality, dB */
|
||||
if ((m_quality != wxT("")) && (m_enablequality)) {
|
||||
const char *s2 = m_quality.ToAscii();
|
||||
wxLogMessage(wxT("qualities %s"), s2);
|
||||
while (sscanf(s2, "%f", ¶meters.tcp_distoratio[parameters.tcp_numlayers]) == 1) {
|
||||
parameters.tcp_numlayers++;
|
||||
while (*s2 && *s2 != ',') {
|
||||
s2++;
|
||||
}
|
||||
if (!*s2)
|
||||
break;
|
||||
s2++;
|
||||
}
|
||||
wxLogMessage(wxT("%d layers"), parameters.tcp_numlayers);
|
||||
parameters.cp_fixed_quality = 1;
|
||||
}
|
||||
|
||||
/* image origin */
|
||||
if (sscanf(m_origin.ToAscii(), "%d,%d", ¶meters.image_offset_x0, ¶meters.image_offset_y0) != 2) {
|
||||
wxLogError(wxT("bad coordinate of the image origin: x0,y0"));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Create comment for codestream */
|
||||
if(m_enablecomm) {
|
||||
parameters.cp_comment = (char *) malloc(strlen(m_comment.ToAscii()) + 1);
|
||||
if(parameters.cp_comment) {
|
||||
strcpy(parameters.cp_comment, m_comment.ToAscii());
|
||||
}
|
||||
} else {
|
||||
parameters.cp_comment = NULL;
|
||||
}
|
||||
|
||||
/* indexing file */
|
||||
if (m_enableidx) {
|
||||
strncpy(indexfilename, m_index.ToAscii(), OPJ_PATH_LEN);
|
||||
wxLogMessage(wxT("index file is %s"), indexfilename);
|
||||
}
|
||||
|
||||
/* if no rate entered, lossless by default */
|
||||
if (parameters.tcp_numlayers == 0) {
|
||||
parameters.tcp_rates[0] = 0; /* MOD antonin : losslessbug */
|
||||
parameters.tcp_numlayers++;
|
||||
parameters.cp_disto_alloc = 1;
|
||||
}
|
||||
|
||||
/* irreversible transform */
|
||||
parameters.irreversible = (m_irreversible == true) ? 1 : 0;
|
||||
|
||||
/* resolutions */
|
||||
parameters.numresolution = m_resolutions;
|
||||
|
||||
/* codeblocks size */
|
||||
if (m_cbsize != wxT("")) {
|
||||
int cblockw_init = 0, cblockh_init = 0;
|
||||
sscanf(m_cbsize.ToAscii(), "%d,%d", &cblockw_init, &cblockh_init);
|
||||
if (cblockw_init * cblockh_init > 4096 || cblockw_init > 1024 || cblockw_init < 4 || cblockh_init > 1024 || cblockh_init < 4) {
|
||||
wxLogError(wxT("!! Size of code_block error !! Restrictions:\n width*height<=4096\n 4<=width,height<= 1024"));
|
||||
return false;
|
||||
}
|
||||
parameters.cblockw_init = cblockw_init;
|
||||
parameters.cblockh_init = cblockh_init;
|
||||
}
|
||||
|
||||
/* precincts size */
|
||||
if (m_prsize != wxT("")) {
|
||||
char sep;
|
||||
int res_spec = 0;
|
||||
char *s = (char *) m_prsize.c_str();
|
||||
do {
|
||||
sep = 0;
|
||||
sscanf(s, "[%d,%d]%c", ¶meters.prcw_init[res_spec], ¶meters.prch_init[res_spec], &sep);
|
||||
parameters.csty |= 0x01;
|
||||
res_spec++;
|
||||
s = strpbrk(s, "]") + 2;
|
||||
} while (sep == ',');
|
||||
parameters.res_spec = res_spec;
|
||||
}
|
||||
|
||||
/* tiles */
|
||||
if (m_tsize != wxT("")) {
|
||||
sscanf(m_tsize.ToAscii(), "%d,%d", ¶meters.cp_tdx, ¶meters.cp_tdy);
|
||||
parameters.tile_size_on = true;
|
||||
}
|
||||
|
||||
/* tile origin */
|
||||
if (sscanf(m_torigin.ToAscii(), "%d,%d", ¶meters.cp_tx0, ¶meters.cp_ty0) != 2) {
|
||||
wxLogError(wxT("tile offset setting error: X0,Y0"));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* use SOP */
|
||||
if (m_enablesop)
|
||||
parameters.csty |= 0x02;
|
||||
|
||||
/* use EPH */
|
||||
if (m_enableeph)
|
||||
parameters.csty |= 0x04;
|
||||
|
||||
/* multiple component transform */
|
||||
if (m_multicomp)
|
||||
parameters.tcp_mct = 1;
|
||||
else
|
||||
parameters.tcp_mct = 0;
|
||||
|
||||
/* mode switch */
|
||||
parameters.mode = (m_enablebypass ? 1 : 0) + (m_enablereset ? 2 : 0)
|
||||
+ (m_enablerestart ? 4 : 0) + (m_enablevsc ? 8 : 0)
|
||||
+ (m_enableerterm ? 16 : 0) + (m_enablesegmark ? 32 : 0);
|
||||
|
||||
/* progression order */
|
||||
switch (m_progression) {
|
||||
|
||||
/* LRCP */
|
||||
case 0:
|
||||
parameters.prog_order = LRCP;
|
||||
break;
|
||||
|
||||
/* RLCP */
|
||||
case 1:
|
||||
parameters.prog_order = RLCP;
|
||||
break;
|
||||
|
||||
/* RPCL */
|
||||
case 2:
|
||||
parameters.prog_order = RPCL;
|
||||
break;
|
||||
|
||||
/* PCRL */
|
||||
case 3:
|
||||
parameters.prog_order = PCRL;
|
||||
break;
|
||||
|
||||
/* CPRL */
|
||||
case 4:
|
||||
parameters.prog_order = CPRL;
|
||||
break;
|
||||
|
||||
/* DCI2K24 */
|
||||
case 5:
|
||||
parameters.cp_cinema = CINEMA2K_24;
|
||||
parameters.cp_rsiz = CINEMA2K;
|
||||
break;
|
||||
|
||||
/* DCI2K48 */
|
||||
case 6:
|
||||
parameters.cp_cinema = CINEMA2K_48;
|
||||
parameters.cp_rsiz = CINEMA2K;
|
||||
break;
|
||||
|
||||
/* DCI4K */
|
||||
case 7:
|
||||
parameters.cp_cinema = CINEMA4K_24;
|
||||
parameters.cp_rsiz = CINEMA4K;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* check cinema */
|
||||
if (parameters.cp_cinema) {
|
||||
|
||||
/* set up */
|
||||
parameters.tile_size_on = false;
|
||||
parameters.cp_tdx=1;
|
||||
parameters.cp_tdy=1;
|
||||
|
||||
/*Tile part*/
|
||||
parameters.tp_flag = 'C';
|
||||
parameters.tp_on = 1;
|
||||
|
||||
/*Tile and Image shall be at (0,0)*/
|
||||
parameters.cp_tx0 = 0;
|
||||
parameters.cp_ty0 = 0;
|
||||
parameters.image_offset_x0 = 0;
|
||||
parameters.image_offset_y0 = 0;
|
||||
|
||||
/*Codeblock size= 32*32*/
|
||||
parameters.cblockw_init = 32;
|
||||
parameters.cblockh_init = 32;
|
||||
parameters.csty |= 0x01;
|
||||
|
||||
/*The progression order shall be CPRL*/
|
||||
parameters.prog_order = CPRL;
|
||||
|
||||
/* No ROI */
|
||||
parameters.roi_compno = -1;
|
||||
|
||||
parameters.subsampling_dx = 1;
|
||||
parameters.subsampling_dy = 1;
|
||||
|
||||
/* 9-7 transform */
|
||||
parameters.irreversible = 1;
|
||||
|
||||
}
|
||||
|
||||
/* convert wx image into opj image */
|
||||
cmptparm = (opj_image_cmptparm_t*) malloc(3 * sizeof(opj_image_cmptparm_t));
|
||||
|
||||
/* initialize opj image components */
|
||||
memset(&cmptparm[0], 0, 3 * sizeof(opj_image_cmptparm_t));
|
||||
for(i = 0; i < 3; i++) {
|
||||
cmptparm[i].prec = 8;
|
||||
cmptparm[i].bpp = 8;
|
||||
cmptparm[i].sgnd = false;
|
||||
cmptparm[i].dx = parameters.subsampling_dx;
|
||||
cmptparm[i].dy = parameters.subsampling_dy;
|
||||
cmptparm[i].w = wimage->GetWidth();
|
||||
cmptparm[i].h = wimage->GetHeight();
|
||||
}
|
||||
|
||||
/* create the image */
|
||||
oimage = opj_image_create(3, &cmptparm[0], CLRSPC_SRGB);
|
||||
if(!oimage) {
|
||||
if (cmptparm)
|
||||
free(cmptparm);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* set image offset and reference grid */
|
||||
oimage->x0 = parameters.image_offset_x0;
|
||||
oimage->y0 = parameters.image_offset_y0;
|
||||
oimage->x1 = parameters.image_offset_x0 + (wimage->GetWidth() - 1) * 1 + 1;
|
||||
oimage->y1 = parameters.image_offset_y0 + (wimage->GetHeight() - 1) * 1 + 1;
|
||||
|
||||
/* load image data */
|
||||
unsigned char *value = wimage->GetData();
|
||||
int area = wimage->GetWidth() * wimage->GetHeight();
|
||||
for (i = 0; i < area; i++) {
|
||||
oimage->comps[0].data[i] = *(value++);
|
||||
oimage->comps[1].data[i] = *(value++);
|
||||
oimage->comps[2].data[i] = *(value++);
|
||||
}
|
||||
|
||||
/* check cinema again */
|
||||
if (parameters.cp_cinema) {
|
||||
int i;
|
||||
float temp_rate;
|
||||
opj_poc_t *POC = NULL;
|
||||
|
||||
switch (parameters.cp_cinema) {
|
||||
|
||||
case CINEMA2K_24:
|
||||
case CINEMA2K_48:
|
||||
if (parameters.numresolution > 6) {
|
||||
parameters.numresolution = 6;
|
||||
}
|
||||
if (!((oimage->comps[0].w == 2048) | (oimage->comps[0].h == 1080))) {
|
||||
wxLogWarning(wxT("Image coordinates %d x %d is not 2K compliant. JPEG Digital Cinema Profile-3 "
|
||||
"(2K profile) compliance requires that at least one of coordinates match 2048 x 1080"),
|
||||
oimage->comps[0].w, oimage->comps[0].h);
|
||||
parameters.cp_rsiz = STD_RSIZ;
|
||||
}
|
||||
break;
|
||||
|
||||
case CINEMA4K_24:
|
||||
if (parameters.numresolution < 1) {
|
||||
parameters.numresolution = 1;
|
||||
} else if (parameters.numresolution > 7) {
|
||||
parameters.numresolution = 7;
|
||||
}
|
||||
if (!((oimage->comps[0].w == 4096) | (oimage->comps[0].h == 2160))) {
|
||||
wxLogWarning(wxT("Image coordinates %d x %d is not 4K compliant. JPEG Digital Cinema Profile-4"
|
||||
"(4K profile) compliance requires that at least one of coordinates match 4096 x 2160"),
|
||||
oimage->comps[0].w, oimage->comps[0].h);
|
||||
parameters.cp_rsiz = STD_RSIZ;
|
||||
}
|
||||
parameters.POC[0].tile = 1;
|
||||
parameters.POC[0].resno0 = 0;
|
||||
parameters.POC[0].compno0 = 0;
|
||||
parameters.POC[0].layno1 = 1;
|
||||
parameters.POC[0].resno1 = parameters.numresolution - 1;
|
||||
parameters.POC[0].compno1 = 3;
|
||||
parameters.POC[0].prg1 = CPRL;
|
||||
parameters.POC[1].tile = 1;
|
||||
parameters.POC[1].resno0 = parameters.numresolution - 1;
|
||||
parameters.POC[1].compno0 = 0;
|
||||
parameters.POC[1].layno1 = 1;
|
||||
parameters.POC[1].resno1 = parameters.numresolution;
|
||||
parameters.POC[1].compno1 = 3;
|
||||
parameters.POC[1].prg1 = CPRL;
|
||||
parameters.numpocs = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (parameters.cp_cinema) {
|
||||
case CINEMA2K_24:
|
||||
case CINEMA4K_24:
|
||||
for (i = 0 ; i < parameters.tcp_numlayers; i++) {
|
||||
temp_rate = 0;
|
||||
if (parameters.tcp_rates[i] == 0) {
|
||||
parameters.tcp_rates[0] = ((float) (oimage->numcomps * oimage->comps[0].w * oimage->comps[0].h * oimage->comps[0].prec)) /
|
||||
(CINEMA_24_CS * 8 * oimage->comps[0].dx * oimage->comps[0].dy);
|
||||
}else{
|
||||
temp_rate = ((float) (oimage->numcomps * oimage->comps[0].w * oimage->comps[0].h * oimage->comps[0].prec)) /
|
||||
(parameters.tcp_rates[i] * 8 * oimage->comps[0].dx * oimage->comps[0].dy);
|
||||
if (temp_rate > CINEMA_24_CS ) {
|
||||
parameters.tcp_rates[i]= ((float) (oimage->numcomps * oimage->comps[0].w * oimage->comps[0].h * oimage->comps[0].prec)) /
|
||||
(CINEMA_24_CS * 8 * oimage->comps[0].dx * oimage->comps[0].dy);
|
||||
} else {
|
||||
/* do nothing */
|
||||
}
|
||||
}
|
||||
}
|
||||
parameters.max_comp_size = COMP_24_CS;
|
||||
break;
|
||||
|
||||
case CINEMA2K_48:
|
||||
for (i = 0; i < parameters.tcp_numlayers; i++) {
|
||||
temp_rate = 0 ;
|
||||
if (parameters.tcp_rates[i] == 0) {
|
||||
parameters.tcp_rates[0] = ((float) (oimage->numcomps * oimage->comps[0].w * oimage->comps[0].h * oimage->comps[0].prec)) /
|
||||
(CINEMA_48_CS * 8 * oimage->comps[0].dx * oimage->comps[0].dy);
|
||||
}else{
|
||||
temp_rate =((float) (oimage->numcomps * oimage->comps[0].w * oimage->comps[0].h * oimage->comps[0].prec)) /
|
||||
(parameters.tcp_rates[i] * 8 * oimage->comps[0].dx * oimage->comps[0].dy);
|
||||
if (temp_rate > CINEMA_48_CS ){
|
||||
parameters.tcp_rates[0]= ((float) (oimage->numcomps * oimage->comps[0].w * oimage->comps[0].h * oimage->comps[0].prec)) /
|
||||
(CINEMA_48_CS * 8 * oimage->comps[0].dx * oimage->comps[0].dy);
|
||||
}else{
|
||||
/* do nothing */
|
||||
}
|
||||
}
|
||||
}
|
||||
parameters.max_comp_size = COMP_48_CS;
|
||||
break;
|
||||
}
|
||||
|
||||
parameters.cp_disto_alloc = 1;
|
||||
}
|
||||
|
||||
/* get a J2K compressor handle */
|
||||
opj_cinfo_t* cinfo = opj_create_compress(CODEC_J2K);
|
||||
|
||||
/* catch events using our callbacks and give a local context */
|
||||
opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr);
|
||||
|
||||
/* setup the encoder parameters using the current image and user parameters */
|
||||
opj_setup_encoder(cinfo, ¶meters, oimage);
|
||||
|
||||
/* open a byte stream for writing */
|
||||
/* allocate memory for all tiles */
|
||||
cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
|
||||
|
||||
/* encode the image */
|
||||
bSuccess = opj_encode_with_info(cinfo, cio, oimage, &cstr_info);
|
||||
if (!bSuccess) {
|
||||
|
||||
opj_cio_close(cio);
|
||||
opj_destroy_compress(cinfo);
|
||||
opj_image_destroy(oimage);
|
||||
if (cmptparm)
|
||||
free(cmptparm);
|
||||
if(parameters.cp_comment)
|
||||
free(parameters.cp_comment);
|
||||
if(parameters.cp_matrice)
|
||||
free(parameters.cp_matrice);
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
wxLogError(wxT("failed to encode image"));
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
return false;
|
||||
}
|
||||
codestream_length = cio_tell(cio);
|
||||
wxLogMessage(wxT("Codestream: %d bytes"), codestream_length);
|
||||
|
||||
/* write the buffer to stream */
|
||||
stream.Write(cio->buffer, codestream_length);
|
||||
|
||||
/* close and free the byte stream */
|
||||
opj_cio_close(cio);
|
||||
|
||||
/* Write the index to disk */
|
||||
if (*indexfilename) {
|
||||
if (write_index_file(&cstr_info, indexfilename)) {
|
||||
wxLogError(wxT("Failed to output index file"));
|
||||
}
|
||||
}
|
||||
|
||||
/* free remaining compression structures */
|
||||
opj_destroy_compress(cinfo);
|
||||
|
||||
/* free image data */
|
||||
opj_image_destroy(oimage);
|
||||
|
||||
if (cmptparm)
|
||||
free(cmptparm);
|
||||
if(parameters.cp_comment)
|
||||
free(parameters.cp_comment);
|
||||
if(parameters.cp_matrice)
|
||||
free(parameters.cp_matrice);
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
wxLogMessage(wxT("J2K: Image encoded!"));
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(default:4611)
|
||||
#endif /* VC++ */
|
||||
|
||||
// recognize the 0xFF4F JPEG 2000 SOC marker
|
||||
bool wxJ2KHandler::DoCanRead( wxInputStream& stream )
|
||||
{
|
||||
unsigned char hdr[2];
|
||||
|
||||
if ( !stream.Read(hdr, WXSIZEOF(hdr)) )
|
||||
return false;
|
||||
|
||||
return hdr[0] == 0xFF && hdr[1] == 0x4F;
|
||||
}
|
||||
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
@@ -1,279 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagjp2.cpp
|
||||
// Purpose: wxImage JPEG 2000 file format handler
|
||||
// Author: Giuseppe Baruffa - based on imagjpeg.cpp, Vaclav Slavik
|
||||
// RCS-ID: $Id: imagjp2.cpp,v 0.00 2007/02/08 23:59:00 MW Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_LIBOPENJPEG
|
||||
|
||||
#include "imagjp2.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/module.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/wfstream.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxJP2Handler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxJP2Handler,wxImageHandler)
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
|
||||
//------------- JPEG 2000 Data Source Manager
|
||||
|
||||
#define J2K_CFMT 0
|
||||
#define JP2_CFMT 1
|
||||
#define JPT_CFMT 2
|
||||
#define MJ2_CFMT 3
|
||||
#define PXM_DFMT 0
|
||||
#define PGX_DFMT 1
|
||||
#define BMP_DFMT 2
|
||||
#define YUV_DFMT 3
|
||||
|
||||
#define MAX_MESSAGE_LEN 200
|
||||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void jp2_error_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* sample warning callback expecting a FILE* client object */
|
||||
void jp2_warning_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* sample debug callback expecting no client object */
|
||||
void jp2_info_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
// load the jp2 file format
|
||||
bool wxJP2Handler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose, int index)
|
||||
{
|
||||
opj_dparameters_t parameters; /* decompression parameters */
|
||||
opj_event_mgr_t event_mgr; /* event manager */
|
||||
opj_image_t *opjimage = NULL;
|
||||
unsigned char *src = NULL;
|
||||
unsigned char *ptr;
|
||||
int file_length;
|
||||
opj_codestream_info_t cstr_info; /* Codestream information structure */
|
||||
|
||||
// destroy the image
|
||||
image->Destroy();
|
||||
|
||||
/* handle to a decompressor */
|
||||
opj_dinfo_t* dinfo = NULL;
|
||||
opj_cio_t *cio = NULL;
|
||||
|
||||
/* configure the event callbacks (not required) */
|
||||
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
|
||||
event_mgr.error_handler = jp2_error_callback;
|
||||
event_mgr.warning_handler = jp2_warning_callback;
|
||||
event_mgr.info_handler = jp2_info_callback;
|
||||
|
||||
/* set decoding parameters to default values */
|
||||
opj_set_default_decoder_parameters(¶meters);
|
||||
|
||||
/* prepare parameters */
|
||||
strncpy(parameters.infile, "", sizeof(parameters.infile)-1);
|
||||
strncpy(parameters.outfile, "", sizeof(parameters.outfile)-1);
|
||||
parameters.decod_format = JP2_CFMT;
|
||||
parameters.cod_format = BMP_DFMT;
|
||||
if (m_reducefactor)
|
||||
parameters.cp_reduce = m_reducefactor;
|
||||
if (m_qualitylayers)
|
||||
parameters.cp_layer = m_qualitylayers;
|
||||
/*if (n_components)
|
||||
parameters. = n_components;*/
|
||||
|
||||
/* JPWL only */
|
||||
#ifdef USE_JPWL
|
||||
parameters.jpwl_exp_comps = m_expcomps;
|
||||
parameters.jpwl_max_tiles = m_maxtiles;
|
||||
parameters.jpwl_correct = m_enablejpwl;
|
||||
#endif /* USE_JPWL */
|
||||
|
||||
/* get a decoder handle */
|
||||
dinfo = opj_create_decompress(CODEC_JP2);
|
||||
|
||||
/* find length of the stream */
|
||||
stream.SeekI(0, wxFromEnd);
|
||||
file_length = (int) stream.TellI();
|
||||
|
||||
/* get data */
|
||||
stream.SeekI(0, wxFromStart);
|
||||
src = (unsigned char *) malloc(file_length);
|
||||
stream.Read(src, file_length);
|
||||
|
||||
/* catch events using our callbacks and give a local context */
|
||||
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
|
||||
|
||||
/* setup the decoder decoding parameters using user parameters */
|
||||
opj_setup_decoder(dinfo, ¶meters);
|
||||
|
||||
/* open a byte stream */
|
||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||
|
||||
/* decode the stream and fill the image structure */
|
||||
opjimage = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||
if (!opjimage) {
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogError(wxT("JP2: failed to decode image!"));
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_cio_close(cio);
|
||||
free(src);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* close the byte stream */
|
||||
opj_cio_close(cio);
|
||||
|
||||
/* common rendering method */
|
||||
#include "imagjpeg2000.cpp"
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("JP2: image loaded."));
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
/* close openjpeg structs */
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_image_destroy(opjimage);
|
||||
free(src);
|
||||
|
||||
if (!image->Ok())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
// save the jp2 file format
|
||||
bool wxJP2Handler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
|
||||
{
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogError(wxT("JP2: Couldn't save image -> not implemented."));
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(default:4611)
|
||||
#endif /* VC++ */
|
||||
|
||||
// recognize the JPEG 2000 starting box
|
||||
bool wxJP2Handler::DoCanRead( wxInputStream& stream )
|
||||
{
|
||||
unsigned char hdr[23];
|
||||
|
||||
if ( !stream.Read(hdr, WXSIZEOF(hdr)) )
|
||||
return false;
|
||||
|
||||
return (hdr[0] == 0x00 &&
|
||||
hdr[1] == 0x00 &&
|
||||
hdr[2] == 0x00 &&
|
||||
hdr[3] == 0x0C &&
|
||||
hdr[4] == 0x6A &&
|
||||
hdr[5] == 0x50 &&
|
||||
hdr[6] == 0x20 &&
|
||||
hdr[7] == 0x20 &&
|
||||
hdr[20] == 0x6A &&
|
||||
hdr[21] == 0x70 &&
|
||||
hdr[22] == 0x32);
|
||||
}
|
||||
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagjp2.h
|
||||
// Purpose: wxImage JPEG 2000 file format handler
|
||||
// Author: G. Baruffa - based on imagjpeg.h, Vaclav Slavik
|
||||
// RCS-ID: $Id: imagjp2.h,v 0.0 2007/02/08 23:45:00 VZ Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_IMAGJP2_H_
|
||||
#define _WX_IMAGJP2_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxJP2Handler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LIBOPENJPEG
|
||||
|
||||
#include "wx/image.h"
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
#define wxBITMAP_TYPE_JP2 48
|
||||
|
||||
class WXDLLEXPORT wxJP2Handler: public wxImageHandler
|
||||
{
|
||||
public:
|
||||
inline wxJP2Handler()
|
||||
{
|
||||
m_name = wxT("JPEG 2000 file format");
|
||||
m_extension = wxT("jp2");
|
||||
m_type = wxBITMAP_TYPE_JP2;
|
||||
m_mime = wxT("image/jp2");
|
||||
|
||||
m_reducefactor = 0;
|
||||
m_qualitylayers = 0;
|
||||
m_components = 0;
|
||||
#ifdef USE_JPWL
|
||||
m_enablejpwl = true;
|
||||
m_expcomps = JPWL_EXPECTED_COMPONENTS;
|
||||
m_maxtiles = JPWL_MAXIMUM_TILES;
|
||||
#endif // USE_JPWL
|
||||
}
|
||||
|
||||
// decoding engine parameters
|
||||
int m_reducefactor, m_qualitylayers, m_components;
|
||||
#ifdef USE_JPWL
|
||||
bool m_enablejpwl;
|
||||
int m_expcomps, m_maxtiles;
|
||||
#endif // USE_JPWL
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
|
||||
protected:
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxJP2Handler)
|
||||
};
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
|
||||
#endif // _WX_IMAGJP2_H_
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagjpeg2000.cpp
|
||||
// Purpose: wxImage JPEG 2000 imagage rendering common functions
|
||||
// Author: Giuseppe Baruffa
|
||||
// RCS-ID: $Id: imagjpeg2000.cpp,v 0.00 2007/04/27 22:11:00 MW Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
|
||||
- At this point, we have the structure "opjimage" that is filled with decompressed
|
||||
data, as processed by the OpenJPEG decompression engine
|
||||
|
||||
- We need to fill the class "image" with the proper pixel sample values
|
||||
|
||||
*/
|
||||
{
|
||||
int shiftbpp;
|
||||
int c, tempcomps;
|
||||
|
||||
// check components number
|
||||
if (m_components > opjimage->numcomps)
|
||||
m_components = opjimage->numcomps;
|
||||
|
||||
// check image depth (only on the first one, for now)
|
||||
if (m_components)
|
||||
shiftbpp = opjimage->comps[m_components - 1].prec - 8;
|
||||
else
|
||||
shiftbpp = opjimage->comps[0].prec - 8;
|
||||
|
||||
// prepare image size
|
||||
if (m_components)
|
||||
image->Create(opjimage->comps[m_components - 1].w, opjimage->comps[m_components - 1].h, true);
|
||||
else
|
||||
image->Create(opjimage->comps[0].w, opjimage->comps[0].h, true);
|
||||
|
||||
// access image raw data
|
||||
image->SetMask(false);
|
||||
ptr = image->GetData();
|
||||
|
||||
// workaround for components different from 1 or 3
|
||||
if ((opjimage->numcomps != 1) && (opjimage->numcomps != 3)) {
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("JPEG2000: weird number of components"));
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
tempcomps = 1;
|
||||
} else
|
||||
tempcomps = opjimage->numcomps;
|
||||
|
||||
// workaround for subsampled components
|
||||
for (c = 1; c < tempcomps; c++) {
|
||||
if ((opjimage->comps[c].w != opjimage->comps[c - 1].w) || (opjimage->comps[c].h != opjimage->comps[c - 1].h)) {
|
||||
tempcomps = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// workaround for different precision components
|
||||
for (c = 1; c < tempcomps; c++) {
|
||||
if (opjimage->comps[c].bpp != opjimage->comps[c - 1].bpp) {
|
||||
tempcomps = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// only one component selected
|
||||
if (m_components)
|
||||
tempcomps = 1;
|
||||
|
||||
// RGB color picture
|
||||
if (tempcomps == 3) {
|
||||
int row, col;
|
||||
int *r = opjimage->comps[0].data;
|
||||
int *g = opjimage->comps[1].data;
|
||||
int *b = opjimage->comps[2].data;
|
||||
if (shiftbpp > 0) {
|
||||
for (row = 0; row < opjimage->comps[0].h; row++) {
|
||||
for (col = 0; col < opjimage->comps[0].w; col++) {
|
||||
|
||||
*(ptr++) = (*(r++)) >> shiftbpp;
|
||||
*(ptr++) = (*(g++)) >> shiftbpp;
|
||||
*(ptr++) = (*(b++)) >> shiftbpp;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else if (shiftbpp < 0) {
|
||||
for (row = 0; row < opjimage->comps[0].h; row++) {
|
||||
for (col = 0; col < opjimage->comps[0].w; col++) {
|
||||
|
||||
*(ptr++) = (*(r++)) << -shiftbpp;
|
||||
*(ptr++) = (*(g++)) << -shiftbpp;
|
||||
*(ptr++) = (*(b++)) << -shiftbpp;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
for (row = 0; row < opjimage->comps[0].h; row++) {
|
||||
for (col = 0; col < opjimage->comps[0].w; col++) {
|
||||
|
||||
*(ptr++) = *(r++);
|
||||
*(ptr++) = *(g++);
|
||||
*(ptr++) = *(b++);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// B/W picture
|
||||
if (tempcomps == 1) {
|
||||
int row, col;
|
||||
int selcomp;
|
||||
|
||||
if (m_components)
|
||||
selcomp = m_components - 1;
|
||||
else
|
||||
selcomp = 0;
|
||||
|
||||
int *y = opjimage->comps[selcomp].data;
|
||||
if (shiftbpp > 0) {
|
||||
for (row = 0; row < opjimage->comps[selcomp].h; row++) {
|
||||
for (col = 0; col < opjimage->comps[selcomp].w; col++) {
|
||||
|
||||
*(ptr++) = (*(y)) >> shiftbpp;
|
||||
*(ptr++) = (*(y)) >> shiftbpp;
|
||||
*(ptr++) = (*(y++)) >> shiftbpp;
|
||||
|
||||
}
|
||||
}
|
||||
} else if (shiftbpp < 0) {
|
||||
for (row = 0; row < opjimage->comps[selcomp].h; row++) {
|
||||
for (col = 0; col < opjimage->comps[selcomp].w; col++) {
|
||||
|
||||
*(ptr++) = (*(y)) << -shiftbpp;
|
||||
*(ptr++) = (*(y)) << -shiftbpp;
|
||||
*(ptr++) = (*(y++)) << -shiftbpp;
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (row = 0; row < opjimage->comps[selcomp].h; row++) {
|
||||
for (col = 0; col < opjimage->comps[selcomp].w; col++) {
|
||||
|
||||
*(ptr++) = *(y);
|
||||
*(ptr++) = *(y);
|
||||
*(ptr++) = *(y++);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,771 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagmj2.cpp
|
||||
// Purpose: wxImage Motion JPEG 2000 file format handler
|
||||
// Author: Giuseppe Baruffa - based on imagjpeg.cpp, Vaclav Slavik
|
||||
// RCS-ID: $Id: imagmj2.cpp,v 0.00 2007/02/18 23:59:00 MW Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_LIBOPENJPEG
|
||||
|
||||
#include "imagmj2.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/module.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/wfstream.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMJ2Handler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMJ2Handler,wxImageHandler)
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
|
||||
//------------- JPEG 2000 Data Source Manager
|
||||
|
||||
#define J2K_CFMT 0
|
||||
#define JP2_CFMT 1
|
||||
#define JPT_CFMT 2
|
||||
#define MJ2_CFMT 3
|
||||
#define PXM_DFMT 0
|
||||
#define PGX_DFMT 1
|
||||
#define BMP_DFMT 2
|
||||
#define YUV_DFMT 3
|
||||
|
||||
#define MAX_MESSAGE_LEN 200
|
||||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void mj2_error_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* sample warning callback expecting a FILE* client object */
|
||||
void mj2_warning_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* sample debug callback expecting no client object */
|
||||
void mj2_info_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
/* macro functions */
|
||||
/* From little endian to big endian, 2 and 4 bytes */
|
||||
#define BYTE_SWAP2(X) ((X & 0x00FF) << 8) | ((X & 0xFF00) >> 8)
|
||||
#define BYTE_SWAP4(X) ((X & 0x000000FF) << 24) | ((X & 0x0000FF00) << 8) | ((X & 0x00FF0000) >> 8) | ((X & 0xFF000000) >> 24)
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#define BYTE_SWAP8(X) ((X & 0x00000000000000FFULL) << 56) | ((X & 0x000000000000FF00ULL) << 40) | \
|
||||
((X & 0x0000000000FF0000ULL) << 24) | ((X & 0x00000000FF000000ULL) << 8) | \
|
||||
((X & 0x000000FF00000000ULL) >> 8) | ((X & 0x0000FF0000000000ULL) >> 24) | \
|
||||
((X & 0x00FF000000000000ULL) >> 40) | ((X & 0xFF00000000000000ULL) >> 56)
|
||||
#else
|
||||
#define BYTE_SWAP8(X) ((X & 0x00000000000000FF) << 56) | ((X & 0x000000000000FF00) << 40) | \
|
||||
((X & 0x0000000000FF0000) << 24) | ((X & 0x00000000FF000000) << 8) | \
|
||||
((X & 0x000000FF00000000) >> 8) | ((X & 0x0000FF0000000000) >> 24) | \
|
||||
((X & 0x00FF000000000000) >> 40) | ((X & 0xFF00000000000000) >> 56)
|
||||
#endif
|
||||
|
||||
/* From codestream to int values */
|
||||
#define STREAM_TO_UINT32(C, P) (((unsigned long int) (C)[(P) + 0] << 24) + \
|
||||
((unsigned long int) (C)[(P) + 1] << 16) + \
|
||||
((unsigned long int) (C)[(P) + 2] << 8) + \
|
||||
((unsigned long int) (C)[(P) + 3] << 0))
|
||||
|
||||
#define STREAM_TO_UINT16(C, P) (((unsigned long int) (C)[(P) + 0] << 8) + \
|
||||
((unsigned long int) (C)[(P) + 1] << 0))
|
||||
|
||||
/* defines */
|
||||
#define SHORT_DESCR_LEN 32
|
||||
#define LONG_DESCR_LEN 256
|
||||
|
||||
/* enumeration for file formats */
|
||||
#define J2FILENUM 4
|
||||
typedef enum {
|
||||
|
||||
JP2_FILE,
|
||||
J2K_FILE,
|
||||
MJ2_FILE,
|
||||
UNK_FILE
|
||||
|
||||
} my_j2filetype;
|
||||
|
||||
/* enumeration for the box types */
|
||||
#define J2BOXNUM 23
|
||||
typedef enum {
|
||||
|
||||
FILE_BOX,
|
||||
JP_BOX,
|
||||
FTYP_BOX,
|
||||
JP2H_BOX,
|
||||
IHDR_BOX,
|
||||
COLR_BOX,
|
||||
JP2C_BOX,
|
||||
JP2I_BOX,
|
||||
XML_BOX,
|
||||
UUID_BOX,
|
||||
UINF_BOX,
|
||||
MOOV_BOX,
|
||||
MVHD_BOX,
|
||||
TRAK_BOX,
|
||||
TKHD_BOX,
|
||||
MDIA_BOX,
|
||||
MINF_BOX,
|
||||
STBL_BOX,
|
||||
STSD_BOX,
|
||||
MJP2_BOX,
|
||||
MDAT_BOX,
|
||||
ANY_BOX,
|
||||
UNK_BOX
|
||||
|
||||
} my_j2boxtype;
|
||||
|
||||
/* jp2 family box signatures */
|
||||
#define FILE_SIGN ""
|
||||
#define JP_SIGN "jP\040\040"
|
||||
#define FTYP_SIGN "ftyp"
|
||||
#define JP2H_SIGN "jp2h"
|
||||
#define IHDR_SIGN "ihdr"
|
||||
#define COLR_SIGN "colr"
|
||||
#define JP2C_SIGN "jp2c"
|
||||
#define JP2I_SIGN "jp2i"
|
||||
#define XML_SIGN "xml\040"
|
||||
#define UUID_SIGN "uuid"
|
||||
#define UINF_SIGN "uinf"
|
||||
#define MOOV_SIGN "moov"
|
||||
#define MVHD_SIGN "mvhd"
|
||||
#define TRAK_SIGN "trak"
|
||||
#define TKHD_SIGN "tkhd"
|
||||
#define MDIA_SIGN "mdia"
|
||||
#define MINF_SIGN "minf"
|
||||
#define VMHD_SIGN "vmhd"
|
||||
#define STBL_SIGN "stbl"
|
||||
#define STSD_SIGN "stsd"
|
||||
#define MJP2_SIGN "mjp2"
|
||||
#define MDAT_SIGN "mdat"
|
||||
#define ANY_SIGN ""
|
||||
#define UNK_SIGN ""
|
||||
|
||||
/* the box structure itself */
|
||||
struct my_boxdef {
|
||||
|
||||
char value[5]; /* hexadecimal value/string*/
|
||||
char name[SHORT_DESCR_LEN]; /* short description */
|
||||
char descr[LONG_DESCR_LEN]; /* long description */
|
||||
int sbox; /* is it a superbox? */
|
||||
int req[J2FILENUM]; /* mandatory box */
|
||||
my_j2boxtype ins; /* contained in box... */
|
||||
|
||||
};
|
||||
|
||||
/* the possible boxes */
|
||||
struct my_boxdef j2box[] =
|
||||
{
|
||||
/* sign */ {FILE_SIGN,
|
||||
/* short */ "placeholder for nothing",
|
||||
/* long */ "Nothing to say",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP_SIGN,
|
||||
/* short */ "JPEG 2000 Signature box",
|
||||
/* long */ "This box uniquely identifies the file as being part of the JPEG 2000 family of files",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {FTYP_SIGN,
|
||||
/* short */ "File Type box",
|
||||
/* long */ "This box specifies file type, version and compatibility information, including specifying if this file "
|
||||
"is a conforming JP2 file or if it can be read by a conforming JP2 reader",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP2H_SIGN,
|
||||
/* short */ "JP2 Header box",
|
||||
/* long */ "This box contains a series of boxes that contain header-type information about the file",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {IHDR_SIGN,
|
||||
/* short */ "Image Header box",
|
||||
/* long */ "This box specifies the size of the image and other related fields",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ JP2H_BOX},
|
||||
|
||||
/* sign */ {COLR_SIGN,
|
||||
/* short */ "Colour Specification box",
|
||||
/* long */ "This box specifies the colourspace of the image",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ JP2H_BOX},
|
||||
|
||||
/* sign */ {JP2C_SIGN,
|
||||
/* short */ "Contiguous Codestream box",
|
||||
/* long */ "This box contains the codestream as defined by Annex A",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP2I_SIGN,
|
||||
/* short */ "Intellectual Property box",
|
||||
/* long */ "This box contains intellectual property information about the image",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {XML_SIGN,
|
||||
/* short */ "XML box",
|
||||
/* long */ "This box provides a tool by which vendors can add XML formatted information to a JP2 file",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UUID_SIGN,
|
||||
/* short */ "UUID box",
|
||||
/* long */ "This box provides a tool by which vendors can add additional information to a file "
|
||||
"without risking conflict with other vendors",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UINF_SIGN,
|
||||
/* short */ "UUID Info box",
|
||||
/* long */ "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {MOOV_SIGN,
|
||||
/* short */ "Movie box",
|
||||
/* long */ "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {MVHD_SIGN,
|
||||
/* short */ "Movie Header box",
|
||||
/* long */ "This box defines overall information which is media-independent, and relevant to the entire presentation "
|
||||
"considered as a whole",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MOOV_BOX},
|
||||
|
||||
/* sign */ {TRAK_SIGN,
|
||||
/* short */ "Track box",
|
||||
/* long */ "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MOOV_BOX},
|
||||
|
||||
/* sign */ {TKHD_SIGN,
|
||||
/* short */ "Track Header box",
|
||||
/* long */ "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ TRAK_BOX},
|
||||
|
||||
/* sign */ {MDIA_SIGN,
|
||||
/* short */ "Media box",
|
||||
/* long */ "The media declaration container contains all the objects which declare information about the media data "
|
||||
"within a track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ TRAK_BOX},
|
||||
|
||||
/* sign */ {MINF_SIGN,
|
||||
/* short */ "Media Information box",
|
||||
/* long */ "This box contains all the objects which declare characteristic information of the media in the track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MDIA_BOX},
|
||||
|
||||
/* sign */ {STBL_SIGN,
|
||||
/* short */ "Sample Table box",
|
||||
/* long */ "The sample table contains all the time and data indexing of the media samples in a track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STSD_SIGN,
|
||||
/* short */ "Sample Description box",
|
||||
/* long */ "The sample description table gives detailed information about the coding type used, and any initialization "
|
||||
"information needed for that coding",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {MJP2_SIGN,
|
||||
/* short */ "MJP2 Sample Description box",
|
||||
/* long */ "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "
|
||||
"information needed for that coding",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {MDAT_SIGN,
|
||||
/* short */ "Media Data box",
|
||||
/* long */ "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {ANY_SIGN,
|
||||
/* short */ "Any box",
|
||||
/* long */ "All the existing boxes",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UNK_SIGN,
|
||||
/* short */ "Unknown Type box",
|
||||
/* long */ "The signature is not recognised to be that of an existing box",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ ANY_BOX}
|
||||
|
||||
};
|
||||
|
||||
/* declaration */
|
||||
int
|
||||
my_box_handler_function(my_j2boxtype boxtype, wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
|
||||
char *scansign, unsigned long int *scanpoint);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
typedef unsigned __int64 int8byte;
|
||||
#endif // __WXMSW__
|
||||
|
||||
#ifdef __WXGTK__
|
||||
typedef unsigned long long int8byte;
|
||||
#endif // __WXGTK__
|
||||
|
||||
/* internal mini-search for a box signature */
|
||||
int
|
||||
my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
|
||||
char *scansign, unsigned long int *scanpoint)
|
||||
{
|
||||
unsigned long int LBox = 0x00000000;
|
||||
//int LBox_read;
|
||||
char TBox[5] = "\0\0\0\0";
|
||||
//int TBox_read;
|
||||
int8byte XLBox = 0x0000000000000000;
|
||||
//int XLBox_read;
|
||||
unsigned long int box_length = 0;
|
||||
int last_box = 0, box_num = 0;
|
||||
int box_type = ANY_BOX;
|
||||
unsigned char /*onebyte[1], twobytes[2],*/ fourbytes[4];
|
||||
int box_number = 0;
|
||||
|
||||
/* cycle all over the file */
|
||||
box_num = 0;
|
||||
last_box = 0;
|
||||
while (!last_box) {
|
||||
|
||||
/* do not exceed file limit */
|
||||
if (filepoint >= filelimit)
|
||||
return (0);
|
||||
|
||||
/* seek on file */
|
||||
if (stream.SeekI(filepoint, wxFromStart) == wxInvalidOffset)
|
||||
return (-1);
|
||||
|
||||
/* read the mandatory LBox, 4 bytes */
|
||||
if (!stream.Read(fourbytes, 4)) {
|
||||
(wxT("Problem reading LBox from the file (file ended?)"));
|
||||
return -1;
|
||||
};
|
||||
LBox = STREAM_TO_UINT32(fourbytes, 0);
|
||||
|
||||
/* read the mandatory TBox, 4 bytes */
|
||||
if (!stream.Read(TBox, 4)) {
|
||||
wxLogError(wxT("Problem reading TBox from the file (file ended?)"));
|
||||
return -1;
|
||||
};
|
||||
|
||||
/* look if scansign is got */
|
||||
if ((scansign != NULL) && (memcmp(TBox, scansign, 4) == 0)) {
|
||||
/* hack/exploit */
|
||||
// stop as soon as you find the level-th codebox
|
||||
if (box_number == level) {
|
||||
memcpy(scansign, " ", 4);
|
||||
*scanpoint = filepoint;
|
||||
return (0);
|
||||
} else
|
||||
box_number++;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* determine the box type */
|
||||
for (box_type = JP_BOX; box_type < UNK_BOX; box_type++)
|
||||
if (memcmp(TBox, j2box[box_type].value, 4) == 0)
|
||||
break;
|
||||
|
||||
/* read the optional XLBox, 8 bytes */
|
||||
if (LBox == 1) {
|
||||
|
||||
if (!stream.Read(&XLBox, 8)) {
|
||||
wxLogError(wxT("Problem reading XLBox from the file (file ended?)"));
|
||||
return -1;
|
||||
};
|
||||
box_length = (unsigned long int) BYTE_SWAP8(XLBox);
|
||||
|
||||
} else if (LBox == 0x00000000) {
|
||||
|
||||
/* last box in file */
|
||||
last_box = 1;
|
||||
box_length = filelimit - filepoint;
|
||||
|
||||
} else
|
||||
|
||||
box_length = LBox;
|
||||
|
||||
|
||||
/* go deep in the box */
|
||||
my_box_handler_function((my_j2boxtype) box_type, stream, (LBox == 1) ? (filepoint + 16) : (filepoint + 8), filepoint + box_length, level,
|
||||
scansign, scanpoint);
|
||||
|
||||
/* if it's a superbox go inside it */
|
||||
if (j2box[box_type].sbox)
|
||||
my_jpeg2000parse(stream, (LBox == 1) ? (filepoint + 16) : (filepoint + 8), filepoint + box_length,
|
||||
level, scansign, scanpoint);
|
||||
|
||||
/* increment box number and filepoint*/
|
||||
box_num++;
|
||||
filepoint += box_length;
|
||||
|
||||
};
|
||||
|
||||
/* all good */
|
||||
return (0);
|
||||
}
|
||||
|
||||
// search first contiguos codestream box in an mj2 file
|
||||
unsigned long int
|
||||
searchjp2c(wxInputStream& stream, unsigned long int fsize, int number)
|
||||
{
|
||||
char scansign[] = "jp2c";
|
||||
unsigned long int scanpoint = 0L;
|
||||
|
||||
wxLogMessage(wxT("MJ2: searching jp2c box... "));
|
||||
|
||||
/* do the parsing */
|
||||
if (my_jpeg2000parse(stream, 0, fsize, number, scansign, &scanpoint) < 0)
|
||||
wxLogMessage(wxT("MJ2: Unrecoverable error during file parsing: stopping"));
|
||||
|
||||
if (strcmp(scansign, " "))
|
||||
wxLogMessage(wxT("MJ2: not found"));
|
||||
else {
|
||||
|
||||
wxLogMessage(wxString::Format(wxT("MJ2: found at byte %d"), scanpoint));
|
||||
|
||||
};
|
||||
|
||||
|
||||
return (scanpoint);
|
||||
}
|
||||
|
||||
// search the jp2h box in the file
|
||||
unsigned long int
|
||||
searchjpegheaderbox(wxInputStream& stream, unsigned long int fsize)
|
||||
{
|
||||
char scansign[] = "jp2h";
|
||||
unsigned long int scanpoint = 0L;
|
||||
|
||||
wxLogMessage(wxT("MJ2: searching jp2h box... "));
|
||||
|
||||
/* do the parsing */
|
||||
if (my_jpeg2000parse(stream, 0, fsize, 0, scansign, &scanpoint) < 0)
|
||||
wxLogMessage(wxT("Unrecoverable error during file parsing: stopping"));
|
||||
|
||||
if (strcmp(scansign, " "))
|
||||
wxLogMessage(wxT("MJ2: not found"));
|
||||
else
|
||||
wxLogMessage(wxString::Format(wxT("MJ2: found at byte %d"), scanpoint));
|
||||
|
||||
return (scanpoint);
|
||||
}
|
||||
|
||||
/* handling functions */
|
||||
#define ITEM_PER_ROW 10
|
||||
|
||||
/* Box handler function */
|
||||
int
|
||||
my_box_handler_function(my_j2boxtype boxtype, wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
|
||||
char *scansign, unsigned long int *scanpoint)
|
||||
{
|
||||
switch (boxtype) {
|
||||
|
||||
/* Sample Description box */
|
||||
case (STSD_BOX):
|
||||
my_jpeg2000parse(stream, filepoint + 8, filelimit, level, scansign, scanpoint);
|
||||
break;
|
||||
|
||||
/* MJP2 Sample Description box */
|
||||
case (MJP2_BOX):
|
||||
my_jpeg2000parse(stream, filepoint + 78, filelimit, level, scansign, scanpoint);
|
||||
break;
|
||||
|
||||
/* not yet implemented */
|
||||
default:
|
||||
break;
|
||||
|
||||
};
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
// the jP and ftyp parts of the header
|
||||
#define my_jPheadSIZE 32
|
||||
unsigned char my_jPhead[my_jPheadSIZE] = {
|
||||
0x00, 0x00, 0x00, 0x0C, 'j', 'P', ' ', ' ',
|
||||
0x0D, 0x0A, 0x87, 0x0A, 0x00, 0x00, 0x00, 0x14,
|
||||
'f', 't', 'y', 'p', 'j', 'p', '2', ' ',
|
||||
0x00, 0x00, 0x00, 0x00, 'j', 'p', '2', ' '
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
// load the mj2 file format
|
||||
bool wxMJ2Handler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose, int index)
|
||||
{
|
||||
opj_dparameters_t parameters; /* decompression parameters */
|
||||
opj_event_mgr_t event_mgr; /* event manager */
|
||||
opj_image_t *opjimage = NULL;
|
||||
unsigned char *src = NULL;
|
||||
unsigned char *ptr;
|
||||
int file_length, jp2c_point, jp2h_point;
|
||||
unsigned long int jp2hboxlen, jp2cboxlen;
|
||||
opj_codestream_info_t cstr_info; /* Codestream information structure */
|
||||
|
||||
// destroy the image
|
||||
image->Destroy();
|
||||
|
||||
/* handle to a decompressor */
|
||||
opj_dinfo_t* dinfo = NULL;
|
||||
opj_cio_t *cio = NULL;
|
||||
|
||||
/* configure the event callbacks (not required) */
|
||||
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
|
||||
event_mgr.error_handler = mj2_error_callback;
|
||||
event_mgr.warning_handler = mj2_warning_callback;
|
||||
event_mgr.info_handler = mj2_info_callback;
|
||||
|
||||
/* set decoding parameters to default values */
|
||||
opj_set_default_decoder_parameters(¶meters);
|
||||
|
||||
/* prepare parameters */
|
||||
strncpy(parameters.infile, "", sizeof(parameters.infile)-1);
|
||||
strncpy(parameters.outfile, "", sizeof(parameters.outfile)-1);
|
||||
parameters.decod_format = JP2_CFMT;
|
||||
parameters.cod_format = BMP_DFMT;
|
||||
if (m_reducefactor)
|
||||
parameters.cp_reduce = m_reducefactor;
|
||||
if (m_qualitylayers)
|
||||
parameters.cp_layer = m_qualitylayers;
|
||||
/*if (n_components)
|
||||
parameters. = n_components;*/
|
||||
|
||||
/* JPWL only */
|
||||
#ifdef USE_JPWL
|
||||
parameters.jpwl_exp_comps = m_expcomps;
|
||||
parameters.jpwl_max_tiles = m_maxtiles;
|
||||
parameters.jpwl_correct = m_enablejpwl;
|
||||
#endif /* USE_JPWL */
|
||||
|
||||
/* get a decoder handle */
|
||||
dinfo = opj_create_decompress(CODEC_JP2);
|
||||
|
||||
/* find length of the stream */
|
||||
stream.SeekI(0, wxFromEnd);
|
||||
file_length = (int) stream.TellI();
|
||||
|
||||
/* search for the first codestream box and the movie header box */
|
||||
jp2c_point = searchjp2c(stream, file_length, m_framenum);
|
||||
jp2h_point = searchjpegheaderbox(stream, file_length);
|
||||
|
||||
// read the jp2h box and store it
|
||||
stream.SeekI(jp2h_point, wxFromStart);
|
||||
stream.Read(&jp2hboxlen, sizeof(unsigned long int));
|
||||
jp2hboxlen = BYTE_SWAP4(jp2hboxlen);
|
||||
|
||||
// read the jp2c box and store it
|
||||
stream.SeekI(jp2c_point, wxFromStart);
|
||||
stream.Read(&jp2cboxlen, sizeof(unsigned long int));
|
||||
jp2cboxlen = BYTE_SWAP4(jp2cboxlen);
|
||||
|
||||
// malloc memory source
|
||||
src = (unsigned char *) malloc(my_jPheadSIZE + jp2hboxlen + jp2cboxlen);
|
||||
|
||||
// copy the jP and ftyp
|
||||
memcpy(src, my_jPhead, my_jPheadSIZE);
|
||||
|
||||
// copy the jp2h
|
||||
stream.SeekI(jp2h_point, wxFromStart);
|
||||
stream.Read(&src[my_jPheadSIZE], jp2hboxlen);
|
||||
|
||||
// copy the jp2c
|
||||
stream.SeekI(jp2c_point, wxFromStart);
|
||||
stream.Read(&src[my_jPheadSIZE + jp2hboxlen], jp2cboxlen);
|
||||
|
||||
/* catch events using our callbacks and give a local context */
|
||||
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
|
||||
|
||||
/* setup the decoder decoding parameters using user parameters */
|
||||
opj_setup_decoder(dinfo, ¶meters);
|
||||
|
||||
/* open a byte stream */
|
||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, my_jPheadSIZE + jp2hboxlen + jp2cboxlen);
|
||||
|
||||
/* decode the stream and fill the image structure */
|
||||
opjimage = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||
if (!opjimage) {
|
||||
wxMutexGuiEnter();
|
||||
wxLogError(wxT("MJ2: failed to decode image!"));
|
||||
wxMutexGuiLeave();
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_cio_close(cio);
|
||||
free(src);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* close the byte stream */
|
||||
opj_cio_close(cio);
|
||||
|
||||
/* common rendering method */
|
||||
#include "imagjpeg2000.cpp"
|
||||
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(wxT("MJ2: image loaded."));
|
||||
wxMutexGuiLeave();
|
||||
|
||||
/* close openjpeg structs */
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_image_destroy(opjimage);
|
||||
free(src);
|
||||
|
||||
if (!image->Ok())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
// save the mj2 file format
|
||||
bool wxMJ2Handler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
|
||||
{
|
||||
wxLogError(wxT("MJ2: Couldn't save movie -> not implemented."));
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(default:4611)
|
||||
#endif /* VC++ */
|
||||
|
||||
// recognize the Motion JPEG 2000 starting box
|
||||
bool wxMJ2Handler::DoCanRead( wxInputStream& stream )
|
||||
{
|
||||
unsigned char hdr[24];
|
||||
|
||||
if ( !stream.Read(hdr, WXSIZEOF(hdr)) )
|
||||
return false;
|
||||
|
||||
return (hdr[0] == 0x00 &&
|
||||
hdr[1] == 0x00 &&
|
||||
hdr[2] == 0x00 &&
|
||||
hdr[3] == 0x0C &&
|
||||
hdr[4] == 0x6A &&
|
||||
hdr[5] == 0x50 &&
|
||||
hdr[6] == 0x20 &&
|
||||
hdr[7] == 0x20 &&
|
||||
hdr[20] == 0x6D &&
|
||||
hdr[21] == 0x6A &&
|
||||
hdr[22] == 0x70 &&
|
||||
hdr[23] == 0x32);
|
||||
}
|
||||
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagmj2.h
|
||||
// Purpose: wxImage Motion JPEG 2000 file format handler
|
||||
// Author: G. Baruffa - based on imagjpeg.h, Vaclav Slavik
|
||||
// RCS-ID: $Id: imagmj2.h,v 0.0 2007/02/18 23:45:00 VZ Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_IMAGMJ2_H_
|
||||
#define _WX_IMAGMJ2_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMJ2Handler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LIBOPENJPEG
|
||||
|
||||
#include "wx/image.h"
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
#define wxBITMAP_TYPE_MJ2 49
|
||||
|
||||
class WXDLLEXPORT wxMJ2Handler: public wxImageHandler
|
||||
{
|
||||
public:
|
||||
inline wxMJ2Handler()
|
||||
{
|
||||
m_name = wxT("Motion JPEG 2000 file format");
|
||||
m_extension = wxT("mj2");
|
||||
m_type = wxBITMAP_TYPE_MJ2;
|
||||
m_mime = wxT("image/mj2");
|
||||
|
||||
m_reducefactor = 0;
|
||||
m_qualitylayers = 0;
|
||||
m_components = 0;
|
||||
#ifdef USE_JPWL
|
||||
m_enablejpwl = true;
|
||||
m_expcomps = JPWL_EXPECTED_COMPONENTS;
|
||||
m_maxtiles = JPWL_MAXIMUM_TILES;
|
||||
#endif // USE_JPWL
|
||||
}
|
||||
|
||||
// decoding engine parameters
|
||||
int m_reducefactor, m_qualitylayers, m_components, m_framenum;
|
||||
#ifdef USE_JPWL
|
||||
bool m_enablejpwl;
|
||||
int m_expcomps, m_maxtiles;
|
||||
#endif // USE_JPWL
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
|
||||
protected:
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMJ2Handler)
|
||||
};
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
|
||||
#endif // _WX_IMAGMJ2_H_
|
||||
|
||||
109
OpenJPEG.rc
109
OpenJPEG.rc
@@ -1,109 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// French (France) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,1,0,0
|
||||
PRODUCTVERSION 1,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "The OpenJPEG library is an open-source JPEG 2000 codec. \0"
|
||||
VALUE "CompanyName", "OpenJPEG\0"
|
||||
VALUE "FileDescription", "OpenJPEG\0"
|
||||
VALUE "FileVersion", "1, 1, 0, 0\0"
|
||||
VALUE "InternalName", "OpenJPEG\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> 2002-2007, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium\0"
|
||||
VALUE "LegalTrademarks", "See http://www.openjpeg.org for details\0"
|
||||
VALUE "OriginalFilename", "OpenJPEG.dll\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "OpenJPEG\0"
|
||||
VALUE "ProductVersion", "1, 1, 0, 0\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // French (France) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
25
README
Normal file
25
README
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
OPENJPEG LIBRARY and APPLICATIONS
|
||||
----------------------------------
|
||||
|
||||
Details on folders hierarchy:
|
||||
|
||||
* libopenjpeg: contains the sources of the openjpeg library
|
||||
* jpwl: contains the additional sources if you want to build a JPWL-flavoured library.
|
||||
* applications: contains all applications that use the openjpeg library
|
||||
* common: common files to all applications
|
||||
* codec: a basic codec
|
||||
* mj2: motion jpeg 2000 executables
|
||||
* JavaOpenJPEG: java jni to use openjpeg in a java program
|
||||
* jpip: complete client-server architecture for remote browsing of jpeg 2000 images. See corresponding README for more details.
|
||||
* OPJViewer: gui for displaying j2k files (based on wxWidget)
|
||||
* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
|
||||
* doc: doxygen documentation setup file and man pages
|
||||
* tests: configuration files and utilities for the openjpeg test suite. All test images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
|
||||
* CMake: cmake related files
|
||||
* m4: autotools related files
|
||||
|
||||
see LICENSE for license and copyright information.
|
||||
see INSTALL for installation procedures.
|
||||
see NEWS for user visible changes in successive releases.
|
||||
see CHANGES for per-revision changes.
|
||||
@@ -1,9 +0,0 @@
|
||||
Basic instructions on how to build using CMake (CMake 2.4.5 or newer is required)
|
||||
|
||||
svn co http://www.openjpeg.org/svn/trunk
|
||||
cd trunk
|
||||
mkdir bin
|
||||
cd bin
|
||||
cmake .. -DBUILD_EXAMPLES:BOOL=ON
|
||||
make
|
||||
./bin/j2k_to_image
|
||||
33
README.linux
33
README.linux
@@ -1,33 +0,0 @@
|
||||
Release Notes
|
||||
--------------
|
||||
This version of the library has been tested under the following OS:
|
||||
- RedHat Linux 9.0
|
||||
|
||||
You should be able to link progams with the -lopenjpeg option after the library is compiled and installed.
|
||||
You can also statically link with libopenjpeg.a.
|
||||
If you use a really old version of gcc and it chokes on the CRs in the file, you can type 'make dos2unix'
|
||||
to run all of the files through dos2unix which converts CRLF to LF. This no longer appears to be required
|
||||
for RedHat 7.3 or 9.
|
||||
|
||||
Please let us know how this works for you under other Linux distributions or any other *nix.
|
||||
|
||||
Installation
|
||||
------------
|
||||
Note: You will need to have root privileges in order to install the library in
|
||||
/usr/include and /usr/lib directories.
|
||||
The installation process is as simple as this :
|
||||
1) Enter the OpenJPEG directory
|
||||
2) Build the distribution :
|
||||
make
|
||||
make install
|
||||
3) Clean all files produced during the build process
|
||||
make clean
|
||||
|
||||
Simple codec compilation
|
||||
------------------------
|
||||
Once you've built the library, you might want to test it with a basic codec. To do this, go to the codec directory and use one of the following commands to build an encoder and decoder respectively:
|
||||
|
||||
gcc convert.c image_to_j2k.c -o image_to_j2k -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
||||
gcc convert.c j2k_to_image.c -o j2k_to_image -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
||||
|
||||
You should add '-L..' to those lines if you did not use the 'install' target (and the 'clean' target neither...).
|
||||
40
README.msvc
40
README.msvc
@@ -1,40 +0,0 @@
|
||||
How to compile the library under MS VC++ 6.0
|
||||
--------------------------------------------
|
||||
|
||||
The library comes in two versions :
|
||||
- a static library that can be linked against any C/C++ program
|
||||
- a Dynamic Link Library (Windows DLL) that can be used in any C/C++ program and in most interpreted languages (e.g. VB, C#, ...).
|
||||
|
||||
In order to compile the library version *or* the DLL version, you will have to :
|
||||
|
||||
1) Open the MSVC workspace named LibOpenJPEG.dsw
|
||||
2) Set the choosen target as the active project, that means :
|
||||
a) Go to the Menu 'Build -> Set Active Configuration'
|
||||
b) Choose one of the following configuration :
|
||||
- DllOpenJPEG - Win32 Release => creates a DLL in release mode named OpenJPEG.dll
|
||||
- DllOpenJPEG - Win32 Debug => creates a DLL in debug mode named OpenJPEGd.dll
|
||||
- LibOpenJPEG - Win32 Release => creates a static library in release mode named LibOpenJPEG.lib
|
||||
- LibOpenJPEG - Win32 Debug => creates a static library in debug mode named LibOpenJPEGd.lib
|
||||
3) Build the project : Menu -> Build -> Rebuild All
|
||||
|
||||
The build process will create a directory named 'dist' that will contain all you need in order to use the library.
|
||||
|
||||
Simple codec compilation
|
||||
------------------------
|
||||
|
||||
Once you've built the library, you might want to test it with a basic codec. To do this, go to the codec directory and use one of the following projects to build an encoder and decoder respectively:
|
||||
- image_to_j2k.dsw
|
||||
- j2k_to_image.dsw
|
||||
|
||||
IMPORTANT NOTE :
|
||||
----------------
|
||||
|
||||
The encoder and decoder samples are configured to use the static version of the library. A link to the LibOpenJPEG static project is included in these projects so that you can build both a codec and the library in a single pass.
|
||||
|
||||
However, you MUST NOTE that in order to use LibOpenJPEG as a static library in your program, you NEED to add the following compiler directive to your project : OPJ_STATIC
|
||||
Look at the menu 'Project -> Settings -> C/C++ tab -> preprocessor definition' to see how this is configured.
|
||||
When using OpenJPEG as a DLL, this compiler directive MUST NOT be used.
|
||||
|
||||
|
||||
|
||||
|
||||
26
README.osx
26
README.osx
@@ -1,26 +0,0 @@
|
||||
Release Notes
|
||||
--------------
|
||||
This version of the library has been tested under OSX 10.3 using gcc 3.3.
|
||||
|
||||
While the makefiles will make a .dylib and a .a, it is recommended to simply staticly link with the .a file.
|
||||
|
||||
Installation
|
||||
------------
|
||||
Note: You will need to have root privileges in order to install the library in
|
||||
/usr/include and /usr/lib directories.
|
||||
The installation process is as simple as this :
|
||||
1) Enter the OpenJPEG directory
|
||||
2) Build the distribution :
|
||||
make osx
|
||||
make osxinstall
|
||||
3) Clean all files produced during the build process
|
||||
make osxclean
|
||||
|
||||
Simple codec compilation
|
||||
------------------------
|
||||
Once you've built the library, you might want to test it with a basic codec. To do this, go to the codec directory and use one of the following commands to build an encoder and decoder respectively:
|
||||
|
||||
gcc convert.c image_to_j2k.c -o image_to_j2k -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
||||
gcc convert.c j2k_to_image.c -o j2k_to_image -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
|
||||
|
||||
You should add '-L..' and to those lines if you did not use the 'install' target (and the 'clean' target neither...).
|
||||
33
THANKS
Normal file
33
THANKS
Normal file
@@ -0,0 +1,33 @@
|
||||
OpenJPEG THANKS file
|
||||
|
||||
Many people have contributed to OpenJPEG by reporting problems, suggesting various improvements,
|
||||
or submitting actual code. Here is a list of these people. Help me keep
|
||||
it complete and exempt of errors.
|
||||
|
||||
Mathieu Malaterre
|
||||
Winfried Szukalski
|
||||
Vincent Torri
|
||||
Bob Friesenhahn
|
||||
Callum Lerwick
|
||||
Dzonatas Sol
|
||||
Mickaël Savinaud
|
||||
Julien Malik
|
||||
Jerôme Fimes
|
||||
Herve Drolon
|
||||
Yannick Verschueren
|
||||
Sebastien Lugan
|
||||
Kaori Hagihara
|
||||
Peter Wimmer
|
||||
Francois-Olivier Devaux
|
||||
Antonin Descampe
|
||||
David Janssens
|
||||
Pr. Benoit Macq
|
||||
Luis Ibanez
|
||||
Ben Boeckel
|
||||
Vincent Nicolas
|
||||
Glenn Pearson
|
||||
Giuseppe Baruffa
|
||||
Arnaud Maye
|
||||
Rex Dieter
|
||||
David Burken
|
||||
Parvatha Elangovan
|
||||
22
applications/CMakeLists.txt
Normal file
22
applications/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# Build the each application if it needed
|
||||
|
||||
IF(BUILD_CODEC)
|
||||
ADD_SUBDIRECTORY(codec)
|
||||
ENDIF(BUILD_CODEC)
|
||||
|
||||
IF(BUILD_MJ2)
|
||||
ADD_SUBDIRECTORY(mj2)
|
||||
ENDIF(BUILD_MJ2)
|
||||
|
||||
# Client & Server:
|
||||
IF(BUILD_JPIP)
|
||||
ADD_SUBDIRECTORY(jpip)
|
||||
ENDIF(BUILD_JPIP)
|
||||
|
||||
IF(BUILD_VIEWER)
|
||||
ADD_SUBDIRECTORY(OPJViewer)
|
||||
ENDIF(BUILD_VIEWER)
|
||||
|
||||
IF(BUILD_JAVA)
|
||||
ADD_SUBDIRECTORY(JavaOpenJPEG)
|
||||
ENDIF(BUILD_JAVA)
|
||||
47
applications/JavaOpenJPEG/CMakeLists.txt
Normal file
47
applications/JavaOpenJPEG/CMakeLists.txt
Normal file
@@ -0,0 +1,47 @@
|
||||
#JavaOpenJPEG/CMakeLists.txt
|
||||
|
||||
# First thing define the common source:
|
||||
SET(openjpegjni_SRCS
|
||||
JavaOpenJPEGDecoder.c
|
||||
JavaOpenJPEG.c
|
||||
)
|
||||
|
||||
# JNI binding:
|
||||
find_package(JNI REQUIRED)
|
||||
include_directories(${JNI_INCLUDE_DIRS})
|
||||
|
||||
# required header file:
|
||||
include_directories(
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
||||
${OPENJPEG_SOURCE_DIR}/applications/common
|
||||
${OPENJPEG_SOURCE_DIR}/applications/codec
|
||||
)
|
||||
|
||||
add_library(openjpegjni MODULE
|
||||
${openjpegjni_SRCS}
|
||||
)
|
||||
|
||||
# build jar:
|
||||
FIND_PACKAGE(Java 1.5 REQUIRED) # javac, jar
|
||||
|
||||
# build dep list:
|
||||
file(GLOB java_srcs "java-sources/org/openJpeg/*.java")
|
||||
|
||||
# make sure target javac dir exists:
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes)
|
||||
# Build java
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
|
||||
COMMAND ${Java_JAVAC_EXECUTABLE} -sourcepath "${CMAKE_CURRENT_SOURCE_DIR}/java-sources"
|
||||
${java_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes
|
||||
COMMAND ${Java_JAR_EXECUTABLE} cvf ${LIBRARY_OUTPUT_PATH}/openjpeg.jar org
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes
|
||||
DEPENDS ${java_srcs}
|
||||
COMMENT "javac *.java; jar cvf -> openjpeg.jar"
|
||||
)
|
||||
|
||||
# name the target
|
||||
ADD_CUSTOM_TARGET(OpenJPEGJavaJar ALL
|
||||
DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
|
||||
COMMENT "building openjpeg.jar"
|
||||
)
|
||||
@@ -37,32 +37,19 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "openjpeg.h"
|
||||
#include "compat/getopt.h"
|
||||
#include "opj_getopt.h"
|
||||
#include "convert.h"
|
||||
#include "index.h"
|
||||
#include "dirent.h"
|
||||
#include "org_openJpeg_OpenJPEGJavaEncoder.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
#include "format_defs.h"
|
||||
|
||||
#define J2K_CFMT 0
|
||||
#define JP2_CFMT 1
|
||||
#define JPT_CFMT 2
|
||||
|
||||
#define PXM_DFMT 10
|
||||
#define PGX_DFMT 11
|
||||
#define BMP_DFMT 12
|
||||
#define YUV_DFMT 13
|
||||
#define TIF_DFMT 14
|
||||
#define RAW_DFMT 15
|
||||
#define TGA_DFMT 16
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
#define CINEMA_24_CS 1302083 /*Codestream length for 24fps*/
|
||||
#define CINEMA_48_CS 651041 /*Codestream length for 48fps*/
|
||||
#define COMP_24_CS 1041666 /*Maximum size per color component for 2K & 4K @ 24fps*/
|
||||
@@ -217,6 +204,8 @@ void encode_help_display() {
|
||||
fprintf(stdout," Indicate multiple modes by adding their values. \n");
|
||||
fprintf(stdout," ex: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-TP : devide packets of every tile into tile-parts (-TP R) [R, L, C]\n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-x : create an index file *.Idx (-x index_name.Idx) \n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-ROI : c=%%d,U=%%d : quantization indices upshifted \n");
|
||||
@@ -229,6 +218,9 @@ void encode_help_display() {
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-I : use the irreversible DWT 9-7 (-I) \n");
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"-jpip : write jpip codestream index box in JP2 output file\n");
|
||||
fprintf(stdout," NOTICE: currently supports only RPCL order\n");
|
||||
fprintf(stdout,"\n");
|
||||
/* UniPG>> */
|
||||
#ifdef USE_JPWL
|
||||
fprintf(stdout,"-W : adoption of JPWL (Part 11) capabilities (-W params)\n");
|
||||
@@ -388,7 +380,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres){
|
||||
}
|
||||
|
||||
void cinema_parameters(opj_cparameters_t *parameters){
|
||||
parameters->tile_size_on = false;
|
||||
parameters->tile_size_on = OPJ_FALSE;
|
||||
parameters->cp_tdx=1;
|
||||
parameters->cp_tdy=1;
|
||||
|
||||
@@ -505,21 +497,22 @@ void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_
|
||||
int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
img_fol_t *img_fol, char *indexfilename) {
|
||||
int i, j,totlen;
|
||||
option_t long_option[]={
|
||||
opj_option_t long_option[]={
|
||||
{"cinema2K",REQ_ARG, NULL ,'w'},
|
||||
{"cinema4K",NO_ARG, NULL ,'y'},
|
||||
{"ImgDir",REQ_ARG, NULL ,'z'},
|
||||
{"TP",REQ_ARG, NULL ,'v'},
|
||||
{"TP",REQ_ARG, NULL ,'u'},
|
||||
{"SOP",NO_ARG, NULL ,'S'},
|
||||
{"EPH",NO_ARG, NULL ,'E'},
|
||||
{"OutFor",REQ_ARG, NULL ,'O'},
|
||||
{"POC",REQ_ARG, NULL ,'P'},
|
||||
{"ROI",REQ_ARG, NULL ,'R'},
|
||||
{"jpip",NO_ARG, NULL, 'J'}
|
||||
};
|
||||
|
||||
/* parse the command line */
|
||||
/* UniPG>> */
|
||||
const char optlist[] = "i:o:hr:q:n:b:c:t:p:s:SEM:x:R:d:T:If:P:C:F:"
|
||||
const char optlist[] = "i:o:hr:q:n:b:c:t:p:s:SEM:x:R:d:T:If:P:C:F:u:J"
|
||||
#ifdef USE_JPWL
|
||||
"W:"
|
||||
#endif /* USE_JPWL */
|
||||
@@ -536,7 +529,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
reset_options_reading();
|
||||
|
||||
while (1) {
|
||||
int c = getopt_long(argc, argv, optlist,long_option,totlen);
|
||||
int c = opj_getopt_long(argc, argv, optlist,long_option,totlen);
|
||||
if (c == -1)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -545,7 +538,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'o': /* output file */
|
||||
{
|
||||
char *outfile = optarg;
|
||||
char *outfile = opj_optarg;
|
||||
parameters->cod_format = get_file_format(outfile);
|
||||
switch(parameters->cod_format) {
|
||||
case J2K_CFMT:
|
||||
@@ -563,14 +556,14 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
case 'O': /* output format */
|
||||
{
|
||||
char outformat[50];
|
||||
char *of = optarg;
|
||||
char *of = opj_optarg;
|
||||
sprintf(outformat,".%s",of);
|
||||
img_fol->set_out_format = 1;
|
||||
parameters->cod_format = get_file_format(outformat);
|
||||
switch(parameters->cod_format) {
|
||||
case J2K_CFMT:
|
||||
case JP2_CFMT:
|
||||
img_fol->out_format = optarg;
|
||||
img_fol->out_format = opj_optarg;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown output format image [only j2k, j2c, jp2]!! \n");
|
||||
@@ -585,7 +578,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'r': /* rates rates/distorsion */
|
||||
{
|
||||
char *s = optarg;
|
||||
char *s = opj_optarg;
|
||||
while (sscanf(s, "%f", ¶meters->tcp_rates[parameters->tcp_numlayers]) == 1) {
|
||||
parameters->tcp_numlayers++;
|
||||
while (*s && *s != ',') {
|
||||
@@ -603,7 +596,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'q': /* add fixed_quality */
|
||||
{
|
||||
char *s = optarg;
|
||||
char *s = opj_optarg;
|
||||
while (sscanf(s, "%f", ¶meters->tcp_distoratio[parameters->tcp_numlayers]) == 1) {
|
||||
parameters->tcp_numlayers++;
|
||||
while (*s && *s != ',') {
|
||||
@@ -625,7 +618,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
int *row = NULL, *col = NULL;
|
||||
int numlayers = 0, numresolution = 0, matrix_width = 0;
|
||||
|
||||
char *s = optarg;
|
||||
char *s = opj_optarg;
|
||||
sscanf(s, "%d", &numlayers);
|
||||
s++;
|
||||
if (numlayers > 9)
|
||||
@@ -669,8 +662,8 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 't': /* tiles */
|
||||
{
|
||||
sscanf(optarg, "%d,%d", ¶meters->cp_tdx, ¶meters->cp_tdy);
|
||||
parameters->tile_size_on = true;
|
||||
sscanf(opj_optarg, "%d,%d", ¶meters->cp_tdx, ¶meters->cp_tdy);
|
||||
parameters->tile_size_on = OPJ_TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -678,7 +671,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'n': /* resolution */
|
||||
{
|
||||
sscanf(optarg, "%d", ¶meters->numresolution);
|
||||
sscanf(opj_optarg, "%d", ¶meters->numresolution);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -688,7 +681,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
char sep;
|
||||
int res_spec = 0;
|
||||
|
||||
char *s = optarg;
|
||||
char *s = opj_optarg;
|
||||
do {
|
||||
sep = 0;
|
||||
sscanf(s, "[%d,%d]%c", ¶meters->prcw_init[res_spec],
|
||||
@@ -707,7 +700,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
case 'b': /* code-block dimension */
|
||||
{
|
||||
int cblockw_init = 0, cblockh_init = 0;
|
||||
sscanf(optarg, "%d,%d", &cblockw_init, &cblockh_init);
|
||||
sscanf(opj_optarg, "%d,%d", &cblockw_init, &cblockh_init);
|
||||
if (cblockw_init * cblockh_init > 4096 || cblockw_init > 1024
|
||||
|| cblockw_init < 4 || cblockh_init > 1024 || cblockh_init < 4) {
|
||||
fprintf(stderr,
|
||||
@@ -724,7 +717,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'x': /* creation of index file */
|
||||
{
|
||||
char *index = optarg;
|
||||
char *index = opj_optarg;
|
||||
strncpy(indexfilename, index, OPJ_PATH_LEN);
|
||||
}
|
||||
break;
|
||||
@@ -735,7 +728,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
{
|
||||
char progression[4];
|
||||
|
||||
strncpy(progression, optarg, 4);
|
||||
strncpy(progression, opj_optarg, 4);
|
||||
parameters->prog_order = give_progression(progression);
|
||||
if (parameters->prog_order == -1) {
|
||||
fprintf(stderr, "Unrecognized progression order "
|
||||
@@ -749,7 +742,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 's': /* subsampling factor */
|
||||
{
|
||||
if (sscanf(optarg, "%d,%d", ¶meters->subsampling_dx,
|
||||
if (sscanf(opj_optarg, "%d,%d", ¶meters->subsampling_dx,
|
||||
¶meters->subsampling_dy) != 2) {
|
||||
fprintf(stderr, "'-s' sub-sampling argument error ! [-s dx,dy]\n");
|
||||
return 1;
|
||||
@@ -761,7 +754,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'd': /* coordonnate of the reference grid */
|
||||
{
|
||||
if (sscanf(optarg, "%d,%d", ¶meters->image_offset_x0,
|
||||
if (sscanf(opj_optarg, "%d,%d", ¶meters->image_offset_x0,
|
||||
¶meters->image_offset_y0) != 2) {
|
||||
fprintf(stderr, "-d 'coordonnate of the reference grid' argument "
|
||||
"error !! [-d x0,y0]\n");
|
||||
@@ -783,7 +776,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
int numpocs = 0; /* number of progression order change (POC) default 0 */
|
||||
opj_poc_t *POC = NULL; /* POC : used in case of Progression order change */
|
||||
|
||||
char *s = optarg;
|
||||
char *s = opj_optarg;
|
||||
POC = parameters->POC;
|
||||
|
||||
while (sscanf(s, "T%d=%d,%d,%d,%d,%d,%4s", &POC[numpocs].tile,
|
||||
@@ -825,7 +818,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
case 'M': /* Mode switch pas tous au point !! */
|
||||
{
|
||||
int value = 0;
|
||||
if (sscanf(optarg, "%d", &value) == 1) {
|
||||
if (sscanf(opj_optarg, "%d", &value) == 1) {
|
||||
for (i = 0; i <= 5; i++) {
|
||||
int cache = value & (1 << i);
|
||||
if (cache)
|
||||
@@ -839,7 +832,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'R': /* ROI */
|
||||
{
|
||||
if (sscanf(optarg, "c=%d,U=%d", ¶meters->roi_compno,
|
||||
if (sscanf(opj_optarg, "c=%d,U=%d", ¶meters->roi_compno,
|
||||
¶meters->roi_shift) != 2) {
|
||||
fprintf(stderr, "ROI error !! [-ROI c='compno',U='shift']\n");
|
||||
return 1;
|
||||
@@ -851,7 +844,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'T': /* Tile offset */
|
||||
{
|
||||
if (sscanf(optarg, "%d,%d", ¶meters->cp_tx0, ¶meters->cp_ty0) != 2) {
|
||||
if (sscanf(opj_optarg, "%d,%d", ¶meters->cp_tx0, ¶meters->cp_ty0) != 2) {
|
||||
fprintf(stderr, "-T 'tile offset' argument error !! [-T X0,Y0]");
|
||||
return 1;
|
||||
}
|
||||
@@ -862,9 +855,9 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'C': /* add a comment */
|
||||
{
|
||||
parameters->cp_comment = (char*)malloc(strlen(optarg) + 1);
|
||||
parameters->cp_comment = (char*)malloc(strlen(opj_optarg) + 1);
|
||||
if(parameters->cp_comment) {
|
||||
strcpy(parameters->cp_comment, optarg);
|
||||
strcpy(parameters->cp_comment, opj_optarg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -880,9 +873,9 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
|
||||
case 'v': /* Tile part generation*/
|
||||
case 'u': /* Tile part generation*/
|
||||
{
|
||||
parameters->tp_flag = optarg[0];
|
||||
parameters->tp_flag = opj_optarg[0];
|
||||
parameters->tp_on = 1;
|
||||
}
|
||||
break;
|
||||
@@ -891,8 +884,8 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
|
||||
case 'z': /* Image Directory path */
|
||||
{
|
||||
img_fol->imgdirpath = (char*)malloc(strlen(optarg) + 1);
|
||||
strcpy(img_fol->imgdirpath,optarg);
|
||||
img_fol->imgdirpath = (char*)malloc(strlen(opj_optarg) + 1);
|
||||
strcpy(img_fol->imgdirpath,opj_optarg);
|
||||
img_fol->set_imgdir=1;
|
||||
}
|
||||
break;
|
||||
@@ -902,7 +895,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
case 'w': /* Digital Cinema 2K profile compliance*/
|
||||
{
|
||||
int fps=0;
|
||||
sscanf(optarg,"%d",&fps);
|
||||
sscanf(opj_optarg,"%d",&fps);
|
||||
if(fps == 24){
|
||||
parameters->cp_cinema = CINEMA2K_24;
|
||||
}else if(fps == 48 ){
|
||||
@@ -946,7 +939,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
/* search for different protection methods */
|
||||
|
||||
/* break the option in comma points and parse the result */
|
||||
token = strtok(optarg, ",");
|
||||
token = strtok(opj_optarg, ",");
|
||||
while(token != NULL) {
|
||||
|
||||
/* search header error protection method */
|
||||
@@ -1251,7 +1244,13 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
|
||||
break;
|
||||
#endif /* USE_JPWL */
|
||||
/* <<UniPG */
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
|
||||
case 'J': /* jpip on */
|
||||
{
|
||||
parameters->jpip_on = OPJ_TRUE;
|
||||
}
|
||||
break;
|
||||
/* ------------------------------------------------------ */
|
||||
|
||||
default:
|
||||
@@ -1629,7 +1628,7 @@ opj_image_t* loadImage(opj_cparameters_t *parameters, JNIEnv *env, jobject obj,
|
||||
jbyte *jbBody;
|
||||
jshort *jsBody;
|
||||
jint *jiBody;
|
||||
boolean isCopy;
|
||||
jboolean isCopy;
|
||||
|
||||
// Image width, height and depth
|
||||
fid = (*env)->GetFieldID(env, cls,"width", "I");
|
||||
@@ -1777,7 +1776,7 @@ opj_image_t* loadImage(opj_cparameters_t *parameters, JNIEnv *env, jobject obj,
|
||||
JNIEXPORT jlong JNICALL Java_org_openJpeg_OpenJPEGJavaEncoder_internalEncodeImageToJ2K(JNIEnv *env, jobject obj, jobjectArray javaParameters) {
|
||||
int argc; /* To simulate the command line parameters (taken from the javaParameters variable) and be able to re-use the */
|
||||
char **argv; /* 'parse_cmdline_decoder' method taken from the j2k_to_image project */
|
||||
bool bSuccess;
|
||||
opj_bool bSuccess;
|
||||
opj_cparameters_t parameters; /* compression parameters */
|
||||
img_fol_t img_fol;
|
||||
opj_event_mgr_t event_mgr; /* event manager */
|
||||
@@ -1911,7 +1910,7 @@ JNIEXPORT jlong JNICALL Java_org_openJpeg_OpenJPEGJavaEncoder_internalEncodeImag
|
||||
if (parameters.cod_format == J2K_CFMT) { /* J2K format output */
|
||||
cinfo = opj_create_compress(CODEC_J2K);
|
||||
} else { /* JP2 format output */
|
||||
cinfo = opj_create_compress(CODEC_JP2);
|
||||
cinfo = opj_create_compress(CODEC_JP2);
|
||||
}
|
||||
/* catch events using our callbacks and give a local context */
|
||||
opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, &msgErrorCallback_vars);
|
||||
@@ -37,31 +37,17 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "openjpeg.h"
|
||||
#include "compat/getopt.h"
|
||||
#include "opj_getopt.h"
|
||||
#include "convert.h"
|
||||
#include "dirent.h"
|
||||
#include "org_openJpeg_OpenJPEGJavaDecoder.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
#define J2K_CFMT 0
|
||||
#define JP2_CFMT 1
|
||||
#define JPT_CFMT 2
|
||||
|
||||
#define PXM_DFMT 10
|
||||
#define PGX_DFMT 11
|
||||
#define BMP_DFMT 12
|
||||
#define YUV_DFMT 13
|
||||
#define TIF_DFMT 14
|
||||
#define RAW_DFMT 15
|
||||
#define TGA_DFMT 16
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
#include "format_defs.h"
|
||||
|
||||
typedef struct callback_variables {
|
||||
JNIEnv *env;
|
||||
@@ -220,7 +206,7 @@ int get_file_format(char *filename) {
|
||||
int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,img_fol_t *img_fol) {
|
||||
/* parse the command line */
|
||||
int totlen;
|
||||
option_t long_option[]={
|
||||
opj_option_t long_option[]={
|
||||
{"ImgDir",REQ_ARG, NULL ,'y'},
|
||||
{"OutFor",REQ_ARG, NULL ,'O'},
|
||||
};
|
||||
@@ -243,13 +229,13 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
reset_options_reading();
|
||||
|
||||
while (1) {
|
||||
int c = getopt_long(argc, argv,optlist,long_option,totlen);
|
||||
int c = opj_getopt_long(argc, argv,optlist,long_option,totlen);
|
||||
if (c == -1)
|
||||
break;
|
||||
switch (c) {
|
||||
case 'i': /* input file */
|
||||
{
|
||||
char *infile = optarg;
|
||||
char *infile = opj_optarg;
|
||||
parameters->decod_format = get_file_format(infile);
|
||||
switch(parameters->decod_format) {
|
||||
case J2K_CFMT:
|
||||
@@ -270,7 +256,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
|
||||
case 'o': /* output file */
|
||||
{
|
||||
char *outfile = optarg;
|
||||
char *outfile = opj_optarg;
|
||||
parameters->cod_format = get_file_format(outfile);
|
||||
switch(parameters->cod_format) {
|
||||
case PGX_DFMT:
|
||||
@@ -293,7 +279,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
case 'O': /* output format */
|
||||
{
|
||||
char outformat[50];
|
||||
char *of = optarg;
|
||||
char *of = opj_optarg;
|
||||
sprintf(outformat,".%s",of);
|
||||
img_fol->set_out_format = 1;
|
||||
parameters->cod_format = get_file_format(outformat);
|
||||
@@ -329,7 +315,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
|
||||
case 'r': /* reduce option */
|
||||
{
|
||||
sscanf(optarg, "%d", ¶meters->cp_reduce);
|
||||
sscanf(opj_optarg, "%d", ¶meters->cp_reduce);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -338,7 +324,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
|
||||
case 'l': /* layering option */
|
||||
{
|
||||
sscanf(optarg, "%d", ¶meters->cp_layer);
|
||||
sscanf(opj_optarg, "%d", ¶meters->cp_layer);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -352,8 +338,8 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
|
||||
case 'y': /* Image Directory path */
|
||||
{
|
||||
img_fol->imgdirpath = (char*)malloc(strlen(optarg) + 1);
|
||||
strcpy(img_fol->imgdirpath,optarg);
|
||||
img_fol->imgdirpath = (char*)malloc(strlen(opj_optarg) + 1);
|
||||
strcpy(img_fol->imgdirpath,opj_optarg);
|
||||
img_fol->set_imgdir=1;
|
||||
}
|
||||
break;
|
||||
@@ -365,7 +351,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
{
|
||||
char *token = NULL;
|
||||
|
||||
token = strtok(optarg, ",");
|
||||
token = strtok(opj_optarg, ",");
|
||||
while(token != NULL) {
|
||||
|
||||
/* search expected number of components */
|
||||
@@ -432,7 +418,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
|
||||
/* ----------------------------------------------------- */
|
||||
|
||||
default:
|
||||
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, optarg);
|
||||
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, opj_optarg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -782,13 +768,13 @@ JNIEXPORT jint JNICALL Java_org_openJpeg_OpenJPEGJavaDecoder_internalDecodeJ2Kto
|
||||
ptr2 = image->comps[2].data;
|
||||
#ifdef CHECK_THRESHOLDS
|
||||
if (image->comps[0].sgnd) {
|
||||
min_value = 0;
|
||||
max_value = 255;
|
||||
} else {
|
||||
min_value = -128;
|
||||
max_value = 127;
|
||||
} else {
|
||||
min_value = 0;
|
||||
max_value = 255;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
// Get the pointer to the Java structure where the data must be copied
|
||||
fid = (*env)->GetFieldID(env, cls,"image24", "[I");
|
||||
jia = (*env)->GetObjectField(env, obj, fid);
|
||||
@@ -828,13 +814,13 @@ JNIEXPORT jint JNICALL Java_org_openJpeg_OpenJPEGJavaDecoder_internalDecodeJ2Kto
|
||||
ptrBBody = jbBody;
|
||||
#ifdef CHECK_THRESHOLDS
|
||||
if (image->comps[0].sgnd) {
|
||||
min_value = 0;
|
||||
max_value = 255;
|
||||
} else {
|
||||
min_value = -128;
|
||||
max_value = 127;
|
||||
} else {
|
||||
min_value = 0;
|
||||
max_value = 255;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
//printf("C: transfering %d shorts to Java image8 pointer = %d\n", wr*hr,ptrSBody);
|
||||
for (i=0; i<w*h; i++) {
|
||||
tempUC = (unsigned char) (ptr[i]);
|
||||
@@ -855,11 +841,11 @@ JNIEXPORT jint JNICALL Java_org_openJpeg_OpenJPEGJavaDecoder_internalDecodeJ2Kto
|
||||
ptrSBody = jsBody;
|
||||
#ifdef CHECK_THRESHOLDS
|
||||
if (image->comps[0].sgnd) {
|
||||
min_value = 0;
|
||||
max_value = 65535;
|
||||
} else {
|
||||
min_value = -32768;
|
||||
max_value = 32767;
|
||||
} else {
|
||||
min_value = 0;
|
||||
max_value = 65535;
|
||||
}
|
||||
printf("C: minValue = %d, maxValue = %d\n", min_value, max_value);
|
||||
#endif
|
||||
@@ -1,10 +1,30 @@
|
||||
/*
|
||||
* $Id: $
|
||||
*
|
||||
* Copyright (c) 1999-2007 Telemis SA. All Rights Reserved
|
||||
|
||||
* Author: Patrick Piscaglia, Telemis s.a.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2007, Patrick Piscaglia, Telemis s.a.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.openJpeg;
|
||||
|
||||
import java.util.Vector;
|
||||
@@ -1,10 +1,30 @@
|
||||
/*
|
||||
* $Id: $
|
||||
*
|
||||
* Copyright (c) 1999-2007 Telemis SA. All Rights Reserved
|
||||
*
|
||||
* Author: Patrick Piscaglia, Telemis s.a.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* Copyright (c) 2002-2007, Patrick Piscaglia, Telemis s.a.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.openJpeg;
|
||||
|
||||
import java.io.File;
|
||||
19
applications/Makefile.am
Normal file
19
applications/Makefile.am
Normal file
@@ -0,0 +1,19 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
SUBDIRS = codec
|
||||
|
||||
if WANT_MJ2
|
||||
SUBDIRS += mj2
|
||||
endif
|
||||
|
||||
if WANT_JPIP_CODE
|
||||
SUBDIRS += jpip
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
CMakeLists.txt \
|
||||
common/color.c \
|
||||
common/color.h \
|
||||
common/format_defs.h \
|
||||
common/opj_getopt.c \
|
||||
common/opj_getopt.h
|
||||
25
applications/OPJViewer/CMakeLists.txt
Normal file
25
applications/OPJViewer/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
PROJECT(viewer CXX)
|
||||
|
||||
FIND_PACKAGE(wxWidgets REQUIRED)
|
||||
INCLUDE(${wxWidgets_USE_FILE})
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
|
||||
# original flags:
|
||||
# -DUSE_JPWL -DwxUSE_LIBOPENJPEG -DwxUSE_GUI=1 -DOPJ_STATIC -DOPJ_HTMLABOUT -DOPJ_INICONFIG -DUSE_JPSEC -DOPJ_MANYFORMATS
|
||||
ADD_DEFINITIONS(-DwxUSE_LIBOPENJPEG -DOPENJPEG_VERSION="1.5.0")
|
||||
SET(OPJV_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/imagjpeg2000.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/wxj2kparser.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/OPJViewer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/wxjp2parser.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/OPJDialogs.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/OPJThreads.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/OPJAbout.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../codec/index.c
|
||||
)
|
||||
ADD_EXECUTABLE(opjviewer ${OPJV_SRCS})
|
||||
TARGET_LINK_LIBRARIES(opjviewer ${wxWidgets_LIBRARIES} openjpeg)
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[Setup]
|
||||
AppName=OPJViewer
|
||||
AppVerName=OPJViewer 0.3 alpha
|
||||
AppVerName=OPJViewer 0.4 beta
|
||||
AppPublisher=OpenJPEG
|
||||
AppPublisherURL=http://www.openjpeg.org
|
||||
AppSupportURL=http://www.openjpeg.org
|
||||
@@ -11,13 +11,13 @@ AppUpdatesURL=http://www.openjpeg.org
|
||||
DefaultDirName={pf}\OPJViewer
|
||||
DefaultGroupName=OPJViewer
|
||||
OutputDir=setup
|
||||
OutputBaseFilename=OPJViewer03alpha_setup
|
||||
OutputBaseFilename=OPJViewer04beta_setup
|
||||
Compression=lzma
|
||||
SolidCompression=true
|
||||
InfoBeforeFile=source\readmebefore.txt
|
||||
InfoAfterFile=source\readmeafter.txt
|
||||
LicenseFile=source\license.txt
|
||||
VersionInfoVersion=0.3.0.0
|
||||
VersionInfoVersion=0.4.0.0
|
||||
VersionInfoCompany=OpenJPEG
|
||||
VersionInfoDescription=JPEG 2000 viewer
|
||||
ShowLanguageDialog=yes
|
||||
@@ -1,7 +1,7 @@
|
||||
===============================================================================
|
||||
JPEG2000 Visualization Software - OPJViewer
|
||||
|
||||
Version 0.3 alpha
|
||||
Version 0.4 beta
|
||||
===============================================================================
|
||||
|
||||
|
||||
@@ -38,6 +38,11 @@ f) Build!
|
||||
g) Run!
|
||||
h) (OPTIONAL) Prepare an installer by compiling the InnoSetup script OPJViewer.iss (you need to download InnoSetup from http://www.jrsoftware.org/isinfo.php).
|
||||
|
||||
2.1.1 Additional libraries
|
||||
----------------------------
|
||||
|
||||
Since we are also working on the Digital Cinema JPEG 2000, we are integrating the viewer with the MXF library, which is used to prepare the DCPs for digital movies. You can enable its linking in the code by specifying the USE_MXF preprocessor directive but, remember, the integration is at a very early stage.
|
||||
|
||||
2.2. Compiling the source code in Unix-like systems
|
||||
-----------------------------------------------------
|
||||
|
||||
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
87
applications/OPJViewer/source/OPJAbout.cpp
Normal file
87
applications/OPJViewer/source/OPJAbout.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita'<27> degli studi di Perugia (UPG), Italy
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifdef USE_MXF
|
||||
#include "mxflib/mxflib.h"
|
||||
#endif // USE_MXF
|
||||
|
||||
#include "OPJViewer.h"
|
||||
|
||||
// about window for the frame
|
||||
void OPJFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
#ifdef OPJ_HTMLABOUT
|
||||
#include "about_htm.h"
|
||||
#include "opj_logo.xpm"
|
||||
|
||||
wxBoxSizer *topsizer;
|
||||
wxHtmlWindow *html;
|
||||
wxDialog dlg(this, wxID_ANY, wxString(_("About")));
|
||||
|
||||
wxMemoryFSHandler::AddFile(wxT("opj_logo.xpm"), wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);
|
||||
|
||||
topsizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(320, 250), wxHW_SCROLLBAR_NEVER);
|
||||
html->SetBorders(0);
|
||||
//html->LoadPage(wxT("about/about.htm"));
|
||||
//html->SetPage("<html><body>Hello, world!</body></html>");
|
||||
html->SetPage(htmlaboutpage);
|
||||
html->SetSize(html->GetInternalRepresentation()->GetWidth(),
|
||||
html->GetInternalRepresentation()->GetHeight());
|
||||
|
||||
topsizer->Add(html, 1, wxALL, 10);
|
||||
|
||||
topsizer->Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
|
||||
|
||||
wxButton *bu1 = new wxButton(&dlg, wxID_OK, wxT("OK"));
|
||||
bu1->SetDefault();
|
||||
|
||||
topsizer->Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);
|
||||
|
||||
dlg.SetSizer(topsizer);
|
||||
topsizer->Fit(&dlg);
|
||||
|
||||
dlg.ShowModal();
|
||||
|
||||
#else
|
||||
|
||||
wxMessageBox(wxString::Format(OPJ_APPLICATION_TITLEBAR
|
||||
wxT("\n\n")
|
||||
wxT("Built with %s and OpenJPEG ")
|
||||
wxT(OPENJPEG_VERSION)
|
||||
wxT("\non ") wxT(__DATE__) wxT(", ") wxT(__TIME__)
|
||||
wxT("\nRunning under %s\n\n")
|
||||
OPJ_APPLICATION_COPYRIGHT,
|
||||
wxVERSION_STRING,
|
||||
wxGetOsDescription().c_str()),
|
||||
wxT("About ") OPJ_APPLICATION_NAME,
|
||||
wxOK | wxICON_INFORMATION,
|
||||
this
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -360,6 +360,22 @@ wxPanel* OPJDecoderDialog::CreatePart11SettingsPage(wxWindow* parent)
|
||||
return panel;
|
||||
}
|
||||
|
||||
void OPJDecoderDialog::OnEnableJPWL(wxCommandEvent& event)
|
||||
{
|
||||
if (event.IsChecked()) {
|
||||
wxLogMessage(wxT("JPWL enabled"));
|
||||
m_expcompsCtrl->Enable(true);
|
||||
m_maxtilesCtrl->Enable(true);
|
||||
} else {
|
||||
wxLogMessage(wxT("JPWL disabled"));
|
||||
m_expcompsCtrl->Enable(false);
|
||||
m_maxtilesCtrl->Enable(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // USE_JPWL
|
||||
|
||||
void OPJDecoderDialog::OnEnableDeco(wxCommandEvent& event)
|
||||
{
|
||||
size_t pp;
|
||||
@@ -384,22 +400,6 @@ void OPJDecoderDialog::OnEnableDeco(wxCommandEvent& event)
|
||||
|
||||
}
|
||||
|
||||
void OPJDecoderDialog::OnEnableJPWL(wxCommandEvent& event)
|
||||
{
|
||||
if (event.IsChecked()) {
|
||||
wxLogMessage(wxT("JPWL enabled"));
|
||||
m_expcompsCtrl->Enable(true);
|
||||
m_maxtilesCtrl->Enable(true);
|
||||
} else {
|
||||
wxLogMessage(wxT("JPWL disabled"));
|
||||
m_expcompsCtrl->Enable(false);
|
||||
m_maxtilesCtrl->Enable(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // USE_JPWL
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -86,37 +86,37 @@ void *OPJEncoThread::Entry()
|
||||
WriteText(text);
|
||||
|
||||
// set handler properties
|
||||
wxJ2KHandler *j2kkkhandler = (wxJ2KHandler *) wxImage::FindHandler( wxBITMAP_TYPE_J2K);
|
||||
j2kkkhandler->m_subsampling = wxGetApp().m_subsampling;
|
||||
j2kkkhandler->m_origin = wxGetApp().m_origin;
|
||||
j2kkkhandler->m_rates = wxGetApp().m_rates;
|
||||
j2kkkhandler->m_quality = wxGetApp().m_quality;
|
||||
j2kkkhandler->m_enablequality = wxGetApp().m_enablequality;
|
||||
j2kkkhandler->m_multicomp = wxGetApp().m_multicomp;
|
||||
j2kkkhandler->m_irreversible = wxGetApp().m_irreversible;
|
||||
j2kkkhandler->m_resolutions = wxGetApp().m_resolutions;
|
||||
j2kkkhandler->m_progression = wxGetApp().m_progression;
|
||||
j2kkkhandler->m_cbsize = wxGetApp().m_cbsize;
|
||||
j2kkkhandler->m_prsize = wxGetApp().m_prsize;
|
||||
j2kkkhandler->m_tsize = wxGetApp().m_tsize;
|
||||
j2kkkhandler->m_torigin = wxGetApp().m_torigin;
|
||||
j2kkkhandler->m_enablesop = wxGetApp().m_enablesop;
|
||||
j2kkkhandler->m_enableeph = wxGetApp().m_enableeph;
|
||||
j2kkkhandler->m_enablebypass = wxGetApp().m_enablebypass;
|
||||
j2kkkhandler->m_enablerestart = wxGetApp().m_enablerestart;
|
||||
j2kkkhandler->m_enablereset = wxGetApp().m_enablereset;
|
||||
j2kkkhandler->m_enablesegmark = wxGetApp().m_enablesegmark;
|
||||
j2kkkhandler->m_enableerterm = wxGetApp().m_enableerterm;
|
||||
j2kkkhandler->m_enablevsc = wxGetApp().m_enablevsc;
|
||||
j2kkkhandler->m_enableidx = wxGetApp().m_enableidx;
|
||||
j2kkkhandler->m_index = m_canvas->m_savename.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + wxGetApp().m_index;
|
||||
j2kkkhandler->m_enablecomm = wxGetApp().m_enablecomm;
|
||||
j2kkkhandler->m_comment = wxGetApp().m_comment;
|
||||
j2kkkhandler->m_enablepoc = wxGetApp().m_enablepoc;
|
||||
j2kkkhandler->m_poc = wxGetApp().m_poc;
|
||||
wxJPEG2000Handler *jpeg2000handler = (wxJPEG2000Handler *) wxImage::FindHandler(wxBITMAP_TYPE_JPEG2000);
|
||||
jpeg2000handler->m_subsampling = wxGetApp().m_subsampling;
|
||||
jpeg2000handler->m_origin = wxGetApp().m_origin;
|
||||
jpeg2000handler->m_rates = wxGetApp().m_rates;
|
||||
jpeg2000handler->m_quality = wxGetApp().m_quality;
|
||||
jpeg2000handler->m_enablequality = wxGetApp().m_enablequality;
|
||||
jpeg2000handler->m_multicomp = wxGetApp().m_multicomp;
|
||||
jpeg2000handler->m_irreversible = wxGetApp().m_irreversible;
|
||||
jpeg2000handler->m_resolutions = wxGetApp().m_resolutions;
|
||||
jpeg2000handler->m_progression = wxGetApp().m_progression;
|
||||
jpeg2000handler->m_cbsize = wxGetApp().m_cbsize;
|
||||
jpeg2000handler->m_prsize = wxGetApp().m_prsize;
|
||||
jpeg2000handler->m_tsize = wxGetApp().m_tsize;
|
||||
jpeg2000handler->m_torigin = wxGetApp().m_torigin;
|
||||
jpeg2000handler->m_enablesop = wxGetApp().m_enablesop;
|
||||
jpeg2000handler->m_enableeph = wxGetApp().m_enableeph;
|
||||
jpeg2000handler->m_enablebypass = wxGetApp().m_enablebypass;
|
||||
jpeg2000handler->m_enablerestart = wxGetApp().m_enablerestart;
|
||||
jpeg2000handler->m_enablereset = wxGetApp().m_enablereset;
|
||||
jpeg2000handler->m_enablesegmark = wxGetApp().m_enablesegmark;
|
||||
jpeg2000handler->m_enableerterm = wxGetApp().m_enableerterm;
|
||||
jpeg2000handler->m_enablevsc = wxGetApp().m_enablevsc;
|
||||
jpeg2000handler->m_enableidx = wxGetApp().m_enableidx;
|
||||
jpeg2000handler->m_index = m_canvas->m_savename.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + wxGetApp().m_index;
|
||||
jpeg2000handler->m_enablecomm = wxGetApp().m_enablecomm;
|
||||
jpeg2000handler->m_comment = wxGetApp().m_comment;
|
||||
jpeg2000handler->m_enablepoc = wxGetApp().m_enablepoc;
|
||||
jpeg2000handler->m_poc = wxGetApp().m_poc;
|
||||
|
||||
// save the file
|
||||
if (!m_canvas->m_image100.SaveFile(m_canvas->m_savename.GetFullPath(), (wxBitmapType) wxBITMAP_TYPE_J2K)) {
|
||||
if (!m_canvas->m_image100.SaveFile(m_canvas->m_savename.GetFullPath(), (wxBitmapType) wxBITMAP_TYPE_JPEG2000)) {
|
||||
WriteText(wxT("Can't save image"));
|
||||
return NULL;
|
||||
}
|
||||
@@ -130,7 +130,6 @@ void *OPJEncoThread::Entry()
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Decoding thread class
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
OPJDecoThread::OPJDecoThread(OPJCanvas *canvas)
|
||||
: wxThread()
|
||||
{
|
||||
@@ -141,7 +140,15 @@ OPJDecoThread::OPJDecoThread(OPJCanvas *canvas)
|
||||
void OPJDecoThread::WriteText(const wxString& text)
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
// we use a fake event and post it for inter-thread gui communication
|
||||
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, OPJFRAME_THREADLOGMSG);
|
||||
event.SetInt(-1);
|
||||
msg << text;
|
||||
event.SetString(msg);
|
||||
wxPostEvent(this->m_canvas->m_childframe->m_frame, event);
|
||||
|
||||
/*
|
||||
// before doing any GUI calls we must ensure that this thread is the only
|
||||
// one doing it!
|
||||
|
||||
@@ -155,6 +162,7 @@ void OPJDecoThread::WriteText(const wxString& text)
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif // __WXGTK__
|
||||
*/
|
||||
}
|
||||
|
||||
void OPJDecoThread::OnExit()
|
||||
@@ -180,66 +188,63 @@ void *OPJDecoThread::Entry()
|
||||
|
||||
wxString text;
|
||||
|
||||
srand(GetId());
|
||||
//srand(GetId());
|
||||
//int m_countnum = rand() % 9;
|
||||
//text.Printf(wxT("Deco thread 0x%lx started (priority = %u, time = %d)."),
|
||||
// GetId(), GetPriority(), m_countnum);
|
||||
text.Printf(wxT("Deco thread %d started"), m_canvas->m_childframe->m_winnumber);
|
||||
|
||||
// we have started
|
||||
text.Printf(wxT("Deco thread %d started"), m_canvas->m_childframe->m_winnumber);
|
||||
WriteText(text);
|
||||
|
||||
// prepare dummy wximage
|
||||
wxBitmap bitmap(100, 100);
|
||||
wxImage image(100, 100, true); //= bitmap.ConvertToImage();
|
||||
image.Destroy();
|
||||
|
||||
// show image full name
|
||||
WriteText(m_canvas->m_fname.GetFullPath());
|
||||
|
||||
|
||||
// set handler properties
|
||||
wxJ2KHandler *j2kkkhandler = (wxJ2KHandler *) wxImage::FindHandler( wxBITMAP_TYPE_J2K);
|
||||
j2kkkhandler->m_reducefactor = wxGetApp().m_reducefactor;
|
||||
j2kkkhandler->m_qualitylayers = wxGetApp().m_qualitylayers;
|
||||
j2kkkhandler->m_components = wxGetApp().m_components;
|
||||
wxJPEG2000Handler *jpeg2000handler = (wxJPEG2000Handler *) wxImage::FindHandler(wxBITMAP_TYPE_JPEG2000);
|
||||
jpeg2000handler->m_reducefactor = wxGetApp().m_reducefactor;
|
||||
jpeg2000handler->m_qualitylayers = wxGetApp().m_qualitylayers;
|
||||
jpeg2000handler->m_components = wxGetApp().m_components;
|
||||
jpeg2000handler->m_framenum = wxGetApp().m_framenum;
|
||||
#ifdef USE_JPWL
|
||||
j2kkkhandler->m_enablejpwl = wxGetApp().m_enablejpwl;
|
||||
j2kkkhandler->m_expcomps = wxGetApp().m_expcomps;
|
||||
j2kkkhandler->m_maxtiles = wxGetApp().m_maxtiles;
|
||||
jpeg2000handler->m_enablejpwl = wxGetApp().m_enablejpwl;
|
||||
jpeg2000handler->m_expcomps = wxGetApp().m_expcomps;
|
||||
jpeg2000handler->m_maxtiles = wxGetApp().m_maxtiles;
|
||||
#endif // USE_JPWL
|
||||
|
||||
wxJP2Handler *jp222handler = (wxJP2Handler *) wxImage::FindHandler( wxBITMAP_TYPE_JP2);
|
||||
jp222handler->m_reducefactor = wxGetApp().m_reducefactor;
|
||||
jp222handler->m_qualitylayers = wxGetApp().m_qualitylayers;
|
||||
jp222handler->m_components = wxGetApp().m_components;
|
||||
#ifdef USE_MXF
|
||||
wxMXFHandler *mxfffhandler = (wxMXFHandler *) wxImage::FindHandler(wxBITMAP_TYPE_MXF);
|
||||
mxfffhandler->m_reducefactor = wxGetApp().m_reducefactor;
|
||||
mxfffhandler->m_qualitylayers = wxGetApp().m_qualitylayers;
|
||||
mxfffhandler->m_components = wxGetApp().m_components;
|
||||
mxfffhandler->m_framenum = wxGetApp().m_framenum;
|
||||
mxfffhandler->m_filename = m_canvas->m_fname;
|
||||
#ifdef USE_JPWL
|
||||
jp222handler->m_enablejpwl = wxGetApp().m_enablejpwl;
|
||||
jp222handler->m_expcomps = wxGetApp().m_expcomps;
|
||||
jp222handler->m_maxtiles = wxGetApp().m_maxtiles;
|
||||
#endif // USE_JPWL
|
||||
|
||||
wxMJ2Handler *mj222handler = (wxMJ2Handler *) wxImage::FindHandler( wxBITMAP_TYPE_MJ2);
|
||||
mj222handler->m_reducefactor = wxGetApp().m_reducefactor;
|
||||
mj222handler->m_qualitylayers = wxGetApp().m_qualitylayers;
|
||||
mj222handler->m_components = wxGetApp().m_components;
|
||||
mj222handler->m_framenum = wxGetApp().m_framenum;
|
||||
#ifdef USE_JPWL
|
||||
mj222handler->m_enablejpwl = wxGetApp().m_enablejpwl;
|
||||
mj222handler->m_expcomps = wxGetApp().m_expcomps;
|
||||
mj222handler->m_maxtiles = wxGetApp().m_maxtiles;
|
||||
mxfffhandler->m_enablejpwl = wxGetApp().m_enablejpwl;
|
||||
mxfffhandler->m_expcomps = wxGetApp().m_expcomps;
|
||||
mxfffhandler->m_maxtiles = wxGetApp().m_maxtiles;
|
||||
#endif // USE_JPWL
|
||||
#endif // USE_MXF
|
||||
|
||||
// if decoding is enabled...
|
||||
if (wxGetApp().m_enabledeco) {
|
||||
|
||||
// load the file
|
||||
if (!image.LoadFile(m_canvas->m_fname.GetFullPath(), wxBITMAP_TYPE_ANY, 0)) {
|
||||
WriteText(wxT("Can't load image"));
|
||||
WriteText(wxT("Can't load image!"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// display a macaron
|
||||
// display a warning
|
||||
if (!image.Create(300, 5, false)) {
|
||||
WriteText(wxT("Can't create image"));
|
||||
WriteText(wxT("Can't create image!"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -248,16 +253,22 @@ void *OPJDecoThread::Entry()
|
||||
// assign 100% image
|
||||
m_canvas->m_image100 = wxBitmap(image);
|
||||
|
||||
// signal the frame to refresh the canvas
|
||||
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, OPJFRAME_VIEWFIT);
|
||||
event.SetString(wxT("Fit me"));
|
||||
event.SetInt(m_canvas->m_childframe->m_winnumber);
|
||||
wxPostEvent(m_canvas->m_childframe->m_frame, event);
|
||||
|
||||
// find a fit-to-width zoom
|
||||
int zooml, wzooml, hzooml;
|
||||
/*int zooml, wzooml, hzooml;
|
||||
wxSize clientsize = m_canvas->GetClientSize();
|
||||
wzooml = (int) floor(100.0 * (double) clientsize.GetWidth() / (double) (2 * OPJ_CANVAS_BORDER + image.GetWidth()));
|
||||
hzooml = (int) floor(100.0 * (double) clientsize.GetHeight() / (double) (2 * OPJ_CANVAS_BORDER + image.GetHeight()));
|
||||
zooml = wxMin(100, wxMin(wzooml, hzooml));
|
||||
zooml = wxMin(100, wxMin(wzooml, hzooml));*/
|
||||
|
||||
// fit to width
|
||||
#ifndef __WXGTK__
|
||||
m_canvas->m_childframe->m_frame->Rescale(zooml, m_canvas->m_childframe);
|
||||
//m_canvas->m_childframe->m_frame->Rescale(zooml, m_canvas->m_childframe);
|
||||
#endif // __WXGTK__
|
||||
|
||||
//m_canvas->m_image = m_canvas->m_image100;
|
||||
@@ -286,8 +297,15 @@ OPJParseThread::OPJParseThread(OPJMarkerTree *tree, wxTreeItemId parentid)
|
||||
void OPJParseThread::WriteText(const wxString& text)
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
// we use a fake event and post it for inter-thread gui communication
|
||||
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, OPJFRAME_THREADLOGMSG);
|
||||
event.SetInt(-1);
|
||||
msg << text;
|
||||
event.SetString(msg);
|
||||
wxPostEvent(this->m_tree->m_childframe->m_frame, event);
|
||||
|
||||
// before doing any GUI calls we must ensure that this thread is the only
|
||||
/* // before doing any GUI calls we must ensure that this thread is the only
|
||||
// one doing it!
|
||||
|
||||
#ifndef __WXGTK__
|
||||
@@ -299,7 +317,7 @@ void OPJParseThread::WriteText(const wxString& text)
|
||||
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif // __WXGTK
|
||||
#endif // __WXGTK*/
|
||||
}
|
||||
|
||||
void OPJParseThread::OnExit()
|
||||
@@ -570,7 +588,6 @@ void OPJParseThread::LoadFile(wxFileName fname)
|
||||
|
||||
}
|
||||
|
||||
|
||||
// this is the root node
|
||||
if (this->m_parentid)
|
||||
m_tree->SetItemText(rootid, wxT("Codestream"));
|
||||
@@ -165,10 +165,6 @@ bool OPJViewerApp::OnInit(void)
|
||||
|
||||
wxCmdLineParser parser(cmdLineDesc, argc, wxArgv);
|
||||
|
||||
/*parser.AddOption(_T("project_name"), _T(""), _T("full path to project file"),
|
||||
wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_OPTION_MANDATORY | wxCMD_LINE_NEEDS_SEPARATOR);*/
|
||||
|
||||
switch (parser.Parse()) {
|
||||
case -1:
|
||||
wxLogMessage(wxT("Help was given, terminating."));
|
||||
@@ -189,14 +185,12 @@ bool OPJViewerApp::OnInit(void)
|
||||
#if wxUSE_LIBJPEG
|
||||
wxImage::AddHandler( new wxJPEGHandler );
|
||||
#endif
|
||||
#if wxUSE_LIBOPENJPEG
|
||||
wxImage::AddHandler( new wxJPEG2000Handler );
|
||||
#endif
|
||||
#if USE_MXF
|
||||
wxImage::AddHandler( new wxMXFHandler );
|
||||
#endif // USE_MXF
|
||||
#if wxUSE_LIBOPENJPEG
|
||||
wxImage::AddHandler( new wxJ2KHandler );
|
||||
wxImage::AddHandler( new wxJP2Handler );
|
||||
wxImage::AddHandler( new wxMJ2Handler );
|
||||
#endif
|
||||
#if OPJ_MANYFORMATS
|
||||
wxImage::AddHandler( new wxBMPHandler );
|
||||
wxImage::AddHandler( new wxPNGHandler );
|
||||
@@ -474,6 +468,8 @@ void OPJViewerApp::ShowCmdLine(const wxCmdLineParser& parser)
|
||||
}
|
||||
|
||||
// OPJFrame events
|
||||
|
||||
// Event class for sending text messages between worker and GUI threads
|
||||
BEGIN_EVENT_TABLE(OPJFrame, wxMDIParentFrame)
|
||||
EVT_MENU(OPJFRAME_HELPABOUT, OPJFrame::OnAbout)
|
||||
EVT_MENU(OPJFRAME_FILEOPEN, OPJFrame::OnFileOpen)
|
||||
@@ -504,6 +500,7 @@ BEGIN_EVENT_TABLE(OPJFrame, wxMDIParentFrame)
|
||||
EVT_MENU(OPJFRAME_SETSDECO, OPJFrame::OnSetsDeco)
|
||||
EVT_SASH_DRAGGED_RANGE(OPJFRAME_BROWSEWIN, OPJFRAME_LOGWIN, OPJFrame::OnSashDrag)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(LEFT_NOTEBOOK_ID, OPJFrame::OnNotebook)
|
||||
EVT_MENU(OPJFRAME_THREADLOGMSG, OPJFrame::OnThreadLogmsg)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// this is the frame constructor
|
||||
@@ -921,10 +918,21 @@ void OPJFrame::OnClose(wxCommandEvent& WXUNUSED(event))
|
||||
currframe->OnClose(e);
|
||||
}
|
||||
|
||||
void OPJFrame::OnFit(wxCommandEvent& WXUNUSED(event))
|
||||
void OPJFrame::OnFit(wxCommandEvent& event)
|
||||
{
|
||||
OPJChildFrame *currchild;
|
||||
wxString eventstring = event.GetString();
|
||||
|
||||
//wxLogMessage(wxT("OnFit:%d:%s"), event.GetInt(), eventstring);
|
||||
|
||||
// current child
|
||||
OPJChildFrame *currchild = (OPJChildFrame *) GetActiveChild();
|
||||
if (event.GetInt() >= 1) {
|
||||
currchild = m_childhash[event.GetInt()];
|
||||
} else {
|
||||
currchild = (OPJChildFrame *) GetActiveChild();
|
||||
}
|
||||
|
||||
// problems
|
||||
if (!currchild)
|
||||
return;
|
||||
|
||||
@@ -932,14 +940,14 @@ void OPJFrame::OnFit(wxCommandEvent& WXUNUSED(event))
|
||||
OPJCanvas *currcanvas = currchild->m_canvas;
|
||||
|
||||
// find a fit-to-width zoom
|
||||
int zooml, wzooml, hzooml;
|
||||
/*int zooml, wzooml, hzooml;
|
||||
wxSize clientsize = currcanvas->GetClientSize();
|
||||
wzooml = (int) ceil(100.0 * (double) (clientsize.GetWidth() - 2 * OPJ_CANVAS_BORDER) / (double) (currcanvas->m_image100.GetWidth()));
|
||||
hzooml = (int) ceil(100.0 * (double) (clientsize.GetHeight() - 2 * OPJ_CANVAS_BORDER) / (double) (currcanvas->m_image100.GetHeight()));
|
||||
zooml = wxMin(100, wxMin(wzooml, hzooml));
|
||||
zooml = wxMin(100, wxMin(wzooml, hzooml));*/
|
||||
|
||||
// fit to width
|
||||
Rescale(zooml, currchild);
|
||||
Rescale(-1, currchild);
|
||||
}
|
||||
|
||||
void OPJFrame::OnZoom(wxCommandEvent& WXUNUSED(event))
|
||||
@@ -969,7 +977,20 @@ void OPJFrame::Rescale(int zooml, OPJChildFrame *currframe)
|
||||
|
||||
// resizing enabled?
|
||||
if (wxGetApp().m_resizemethod == -1) {
|
||||
|
||||
zooml = 100;
|
||||
|
||||
} else {
|
||||
|
||||
if (zooml < 0) {
|
||||
// find a fit-to-width zoom
|
||||
int wzooml, hzooml;
|
||||
//wxSize clientsize = currframe->m_canvas->GetClientSize();
|
||||
wxSize clientsize = currframe->m_frame->GetActiveChild()->GetClientSize();
|
||||
wzooml = (int) floor(100.0 * (double) clientsize.GetWidth() / (double) (2 * OPJ_CANVAS_BORDER + currframe->m_canvas->m_image100.GetWidth()));
|
||||
hzooml = (int) floor(100.0 * (double) clientsize.GetHeight() / (double) (2 * OPJ_CANVAS_BORDER + currframe->m_canvas->m_image100.GetHeight()));
|
||||
zooml = wxMin(100, wxMin(wzooml, hzooml));
|
||||
}
|
||||
}
|
||||
|
||||
if (zooml != 100)
|
||||
@@ -985,6 +1006,8 @@ void OPJFrame::Rescale(int zooml, OPJChildFrame *currframe)
|
||||
|
||||
currframe->m_canvas->Refresh();
|
||||
|
||||
wxLogMessage(wxT("Rescale said %d%%"), zooml);
|
||||
|
||||
// update zoom
|
||||
currframe->m_canvas->m_zooml = zooml;
|
||||
}
|
||||
@@ -1192,6 +1215,36 @@ void OPJFrame::OnSashDrag(wxSashEvent& event)
|
||||
|
||||
}
|
||||
|
||||
void OPJFrame::OnThreadLogmsg(wxCommandEvent& event)
|
||||
{
|
||||
#if 1
|
||||
wxLogMessage(wxT("Frame got message from worker thread: %d"), event.GetInt());
|
||||
wxLogMessage(event.GetString());
|
||||
#else
|
||||
int n = event.GetInt();
|
||||
if ( n == -1 )
|
||||
{
|
||||
m_dlgProgress->Destroy();
|
||||
m_dlgProgress = (wxProgressDialog *)NULL;
|
||||
|
||||
// the dialog is aborted because the event came from another thread, so
|
||||
// we may need to wake up the main event loop for the dialog to be
|
||||
// really closed
|
||||
wxWakeUpIdle();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !m_dlgProgress->Update(n) )
|
||||
{
|
||||
wxCriticalSectionLocker lock(m_critsectWork);
|
||||
|
||||
m_cancelled = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// physically save the file
|
||||
void OPJFrame::SaveFile(wxArrayString paths, wxArrayString filenames)
|
||||
{
|
||||
@@ -1320,6 +1373,8 @@ void OPJFrame::OnFileSaveAs(wxCommandEvent& WXUNUSED(event))
|
||||
wxT("JPEG 2000 codestream (*.j2k)|*.j2k")
|
||||
wxT("|JPEG 2000 file format (*.jp2)|*.jp2");
|
||||
#endif
|
||||
#else
|
||||
wxT("Houston we have a problem");
|
||||
#endif
|
||||
|
||||
wxFileDialog dialog(this, _T("Save image file"),
|
||||
@@ -1357,6 +1412,7 @@ void OPJFrame::OnMemoryOpen(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
BEGIN_EVENT_TABLE(OPJCanvas, wxScrolledWindow)
|
||||
EVT_MOUSE_EVENTS(OPJCanvas::OnEvent)
|
||||
EVT_MENU(OPJCANVAS_THREADSIGNAL, OPJCanvas::OnThreadSignal)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// Define a constructor for my canvas
|
||||
@@ -1462,6 +1518,36 @@ void OPJFrame::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
layout.LayoutMDIFrame(this);
|
||||
}
|
||||
|
||||
void OPJCanvas::OnThreadSignal(wxCommandEvent& event)
|
||||
{
|
||||
#if 1
|
||||
wxLogMessage(wxT("Canvas got signal from deco thread: %d"), event.GetInt());
|
||||
wxLogMessage(event.GetString());
|
||||
#else
|
||||
int n = event.GetInt();
|
||||
if ( n == -1 )
|
||||
{
|
||||
m_dlgProgress->Destroy();
|
||||
m_dlgProgress = (wxProgressDialog *)NULL;
|
||||
|
||||
// the dialog is aborted because the event came from another thread, so
|
||||
// we may need to wake up the main event loop for the dialog to be
|
||||
// really closed
|
||||
wxWakeUpIdle();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !m_dlgProgress->Update(n) )
|
||||
{
|
||||
wxCriticalSectionLocker lock(m_critsectWork);
|
||||
|
||||
m_cancelled = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Note that OPJFRAME_FILEOPEN and OPJFRAME_HELPABOUT commands get passed
|
||||
// to the parent window for processing, so no need to
|
||||
// duplicate event handlers here.
|
||||
@@ -103,9 +103,10 @@
|
||||
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
#include "imagj2k.h"
|
||||
#include "imagjp2.h"
|
||||
#include "imagmj2.h"
|
||||
//#include "imagj2k.h"
|
||||
//#include "imagjp2.h"
|
||||
//#include "imagmj2.h"
|
||||
#include "imagjpeg2000.h"
|
||||
#ifdef USE_MXF
|
||||
#include "imagmxf.h"
|
||||
#endif // USE_MXF
|
||||
@@ -131,9 +132,9 @@ typedef unsigned long long int8byte;
|
||||
|
||||
#define OPJ_APPLICATION wxT("OPJViewer")
|
||||
#define OPJ_APPLICATION_NAME wxT("OpenJPEG Viewer")
|
||||
#define OPJ_APPLICATION_VERSION wxT("0.3 alpha")
|
||||
#define OPJ_APPLICATION_VERSION wxT("0.4 beta")
|
||||
#define OPJ_APPLICATION_TITLEBAR OPJ_APPLICATION_NAME wxT(" ") OPJ_APPLICATION_VERSION
|
||||
#define OPJ_APPLICATION_COPYRIGHT wxT("(C) 2007, Giuseppe Baruffa")
|
||||
#define OPJ_APPLICATION_COPYRIGHT wxT("(C) 2007-2008, Giuseppe Baruffa")
|
||||
#define OPJ_APPLICATION_VENDOR wxT("OpenJPEG")
|
||||
|
||||
#ifdef __WXMSW__
|
||||
@@ -213,8 +214,8 @@ class OPJViewerApp: public wxApp
|
||||
#ifdef USE_JPWL
|
||||
bool m_enablejpwl, m_enablejpwle;
|
||||
int m_expcomps, m_maxtiles;
|
||||
int m_framewidth, m_frameheight;
|
||||
#endif // USE_JPWL
|
||||
int m_framewidth, m_frameheight;
|
||||
|
||||
// encoding engine parameters
|
||||
wxString m_subsampling, m_origin, m_rates, m_comment, m_index, m_quality;
|
||||
@@ -268,8 +269,13 @@ class OPJCanvas: public wxScrolledWindow
|
||||
wxMutexGuiLeave();
|
||||
#endif //__WXGTK__
|
||||
}
|
||||
|
||||
void OnThreadSignal(wxCommandEvent& event);
|
||||
|
||||
OPJDecoThread *CreateDecoThread(void);
|
||||
OPJEncoThread *CreateEncoThread(void);
|
||||
|
||||
|
||||
OPJChildFrame *m_childframe;
|
||||
|
||||
wxBitmap m_image, m_image100;
|
||||
@@ -418,7 +424,7 @@ class OPJFrame: public wxMDIParentFrame
|
||||
void OnQuit(wxCommandEvent& WXUNUSED(event));
|
||||
void OnClose(wxCommandEvent& WXUNUSED(event));
|
||||
void OnZoom(wxCommandEvent& WXUNUSED(event));
|
||||
void OnFit(wxCommandEvent& WXUNUSED(event));
|
||||
void OnFit(wxCommandEvent& event);
|
||||
void OnToggleBrowser(wxCommandEvent& WXUNUSED(event));
|
||||
void OnTogglePeeker(wxCommandEvent& WXUNUSED(event));
|
||||
void OnToggleToolbar(wxCommandEvent& WXUNUSED(event));
|
||||
@@ -442,6 +448,7 @@ class OPJFrame: public wxMDIParentFrame
|
||||
void SaveFile(wxArrayString paths, wxArrayString filenames);
|
||||
void OnNotebook(wxNotebookEvent& event);
|
||||
void Rescale(int scale, OPJChildFrame *child);
|
||||
void OnThreadLogmsg(wxCommandEvent& event);
|
||||
|
||||
OPJMarkerTreeHash m_treehash;
|
||||
OPJChildFrameHash m_childhash;
|
||||
@@ -521,7 +528,10 @@ enum {
|
||||
|
||||
OPJFRAME_BROWSEWIN = 10000,
|
||||
OPJFRAME_LOGWIN,
|
||||
OPJFRAME_TOOLBAR
|
||||
OPJFRAME_TOOLBAR,
|
||||
|
||||
OPJFRAME_THREADLOGMSG,
|
||||
OPJCANVAS_THREADSIGNAL
|
||||
};
|
||||
|
||||
|
||||
@@ -772,9 +782,10 @@ public:
|
||||
#ifdef USE_JPWL
|
||||
void OnEnableJPWL(wxCommandEvent& event);
|
||||
wxPanel* CreatePart11SettingsPage(wxWindow* parent);
|
||||
wxSpinCtrl *m_expcompsCtrl, *m_framenumCtrl, *m_maxtilesCtrl;
|
||||
wxSpinCtrl *m_expcompsCtrl, *m_maxtilesCtrl;
|
||||
wxCheckBox *m_enablejpwlCheck;
|
||||
#endif // USE_JPWL
|
||||
wxSpinCtrl *m_framenumCtrl;
|
||||
|
||||
|
||||
protected:
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -20,18 +20,23 @@ OPJ_APPLICATION " " OPJ_APPLICATION_VERSION
|
||||
"<tr>"
|
||||
"<td align=justify>"
|
||||
"<center><font size=+0 color=#000000><a href=\"http://www.openjpeg.org/\">OpenJPEG</a></font></center>"
|
||||
"<font size=-1 color=#000000>The OpenJPEG library is an open-source JPEG 2000 codec written in C language. "
|
||||
"In addition to the basic codec, various other features are under development.</font><br>"
|
||||
"<p><font size=-1 color=#000000>The OpenJPEG library is an open-source JPEG 2000 codec written in C language. "
|
||||
"In addition to the basic codec, various other features are under development.</font></p><br>"
|
||||
"<font size=-2 color=red>* Build: ")
|
||||
#include "build.h"
|
||||
wxT(", " __DATE__ ", " __TIME__ "</font><br>")
|
||||
wxT("<font size=-2 color=red>* " wxVERSION_STRING "</font><br>")
|
||||
wxT("<font size=-2 color=red>* OpenJPEG " OPENJPEG_VERSION " (")
|
||||
#ifdef USE_JPWL
|
||||
wxT("<font size=-2 color=green>- Compiled with JPWL support</font><br>")
|
||||
wxT("<font size=-2 color=green>JPWL</font> ")
|
||||
#endif // USE_JPWL
|
||||
#ifdef USE_JPSEC
|
||||
wxT("<font size=-2 color=green>- Compiled with JPSEC support</font>")
|
||||
wxT("<font size=-2 color=green>JPSEC</font> ")
|
||||
#endif // USE_JPSEC
|
||||
wxT(")</font><br>")
|
||||
#ifdef USE_MXF
|
||||
wxT("<font size=-2 color=red>* MXFLib " MXFLIB_VERSION_MAJOR "." MXFLIB_VERSION_MINOR "." MXFLIB_VERSION_TWEAK " (" MXFLIB_VERSION_BUILD ")</font><br>")
|
||||
#endif // USE_MXF
|
||||
wxT("</td>"
|
||||
"</tr>"
|
||||
"<tr>"
|
||||
@@ -39,8 +44,8 @@ wxT("</td>"
|
||||
"</tr>"
|
||||
"<tr>"
|
||||
"<td colspan=2>"
|
||||
"<font size=-2 color=#444444>OpenJPEG is © 2002-2007 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universite' Catholique de Louvain</a></font><br>"
|
||||
"<font size=-2 color=#444444>OPJViewer is also © 2007 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universita' degli studi di Perugia</a></font>"
|
||||
"<font size=-2 color=#444444>OpenJPEG is © 2002-2008 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universite' Catholique de Louvain</a></font><br>"
|
||||
"<font size=-2 color=#444444>OPJViewer is © 2007-2008 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universita' degli studi di Perugia</a></font>"
|
||||
"</td>"
|
||||
"</tr>"
|
||||
"</table>"
|
||||
1
applications/OPJViewer/source/build.h
Normal file
1
applications/OPJViewer/source/build.h
Normal file
@@ -0,0 +1 @@
|
||||
wxT("491")
|
||||
@@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *icon1_xpm[] = {
|
||||
static const char *icon1_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 41 1",
|
||||
"> c #97C4E7",
|
||||
@@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *icon2_xpm[] = {
|
||||
static const char *icon2_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 15 1",
|
||||
". c Black",
|
||||
@@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *icon3_xpm[] = {
|
||||
static const char *icon3_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 41 1",
|
||||
"6 c #EDF2FB",
|
||||
@@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *icon4_xpm[] = {
|
||||
static const char *icon4_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 5 1",
|
||||
". c Black",
|
||||
@@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *icon5_xpm[] = {
|
||||
static const char *icon5_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 41 1",
|
||||
"0 c #AAC1E8",
|
||||
1464
applications/OPJViewer/source/imagjpeg2000.cpp
Normal file
1464
applications/OPJViewer/source/imagjpeg2000.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -24,21 +24,21 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imagj2k.h
|
||||
// Purpose: wxImage JPEG 2000 raw codestream handler
|
||||
// Name: imagalljpeg2000.h
|
||||
// Purpose: wxImage JPEG 2000 family file format handler
|
||||
// Author: G. Baruffa - based on imagjpeg.h, Vaclav Slavik
|
||||
// RCS-ID: $Id: imagj2k.h,v 0.0 2007/02/08 23:45:00 VZ Exp $
|
||||
// RCS-ID: $Id: imagalljpeg2000.h,v 0.0 2008/01/31 11:22:00 VZ Exp $
|
||||
// Copyright: (c) Giuseppe Baruffa
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_IMAGJ2K_H_
|
||||
#define _WX_IMAGJ2K_H_
|
||||
#ifndef _WX_IMAGJPEG2000_H_
|
||||
#define _WX_IMAGJPEG2000_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxJ2KHandler
|
||||
// wxJPEG2000Handler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LIBOPENJPEG
|
||||
@@ -47,26 +47,17 @@
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
#include "codec/index.h"
|
||||
|
||||
#define wxBITMAP_TYPE_J2K 47
|
||||
#define wxBITMAP_TYPE_JPEG2000 50
|
||||
|
||||
#define wxIMAGE_OPTION_REDUCEFACTOR wxString(_T("reducefactor"))
|
||||
#define wxIMAGE_OPTION_QUALITYLAYERS wxString(_T("qualitylayers"))
|
||||
#define wxIMAGE_OPTION_MAXCOMPS wxString(_T("maxcomps"))
|
||||
#ifdef USE_JPWL
|
||||
#define wxIMAGE_OPTION_ENABLEJPWL wxString(_T("enablejpwl"))
|
||||
#define wxIMAGE_OPTION_EXPCOMPS wxString(_T("expcomps"))
|
||||
#define wxIMAGE_OPTION_MAXTILES wxString(_T("maxtiles"))
|
||||
#endif // USE_JPWL
|
||||
|
||||
class WXDLLEXPORT wxJ2KHandler: public wxImageHandler
|
||||
class WXDLLEXPORT wxJPEG2000Handler: public wxImageHandler
|
||||
{
|
||||
public:
|
||||
inline wxJ2KHandler()
|
||||
inline wxJPEG2000Handler()
|
||||
{
|
||||
m_name = wxT("JPEG 2000 codestream file");
|
||||
m_extension = wxT("j2k");
|
||||
m_type = wxBITMAP_TYPE_J2K;
|
||||
m_mime = wxT("image/j2k");
|
||||
m_name = wxT("JPEG 2000 family file format");
|
||||
m_extension = wxT("mj2");
|
||||
m_type = wxBITMAP_TYPE_JPEG2000;
|
||||
m_mime = wxT("image/mj2");
|
||||
|
||||
/* decoding */
|
||||
m_reducefactor = 0;
|
||||
@@ -128,7 +119,7 @@ public:
|
||||
}
|
||||
|
||||
// decoding engine parameters
|
||||
int m_reducefactor, m_qualitylayers, m_components;
|
||||
int m_reducefactor, m_qualitylayers, m_components, m_framenum;
|
||||
#ifdef USE_JPWL
|
||||
bool m_enablejpwl;
|
||||
int m_expcomps, m_maxtiles;
|
||||
@@ -169,18 +160,18 @@ public:
|
||||
wxString m_poc;
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
|
||||
virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1);
|
||||
virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true);
|
||||
protected:
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
virtual bool DoCanRead(wxInputStream& stream);
|
||||
#endif
|
||||
|
||||
private:
|
||||
OPJ_PROG_ORDER give_progression(char progression[4]);
|
||||
DECLARE_DYNAMIC_CLASS(wxJ2KHandler)
|
||||
DECLARE_DYNAMIC_CLASS(wxJPEG2000Handler)
|
||||
};
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
|
||||
#endif // _WX_IMAGJ2K_H_
|
||||
#endif // _WX_IMAGJPEG2000_H_
|
||||
|
||||
@@ -34,6 +34,30 @@
|
||||
|
||||
#ifdef USE_MXF
|
||||
|
||||
#include "mxflib/mxflib.h"
|
||||
using namespace mxflib;
|
||||
|
||||
namespace
|
||||
{
|
||||
//! Structure holding information about the essence in each body stream
|
||||
struct EssenceInfo
|
||||
{
|
||||
UMIDPtr PackageID;
|
||||
PackagePtr Package;
|
||||
MDObjectPtr Descriptor;
|
||||
};
|
||||
//! Map of EssenceInfo structures indexed by BodySID
|
||||
typedef std::map<UInt32, EssenceInfo> EssenceInfoMap;
|
||||
|
||||
//! The map of essence info for this file
|
||||
EssenceInfoMap EssenceLookup;
|
||||
};
|
||||
|
||||
//! Build an EssenceInfoMap for the essence in a given file
|
||||
/*! \return True if al OK, else false
|
||||
*/
|
||||
bool BuildEssenceInfo(MXFFilePtr &File, EssenceInfoMap &EssenceLookup);
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
@@ -73,6 +97,81 @@ IMPLEMENT_DYNAMIC_CLASS(wxMXFHandler,wxImageHandler)
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
|
||||
#include <stdarg.h>
|
||||
#define MAX_MESSAGE_LEN 200
|
||||
|
||||
//------------- MXF Manager
|
||||
|
||||
// Debug and error messages
|
||||
|
||||
//! Display a warning message
|
||||
void mxflib::warning(const char *Fmt, ...)
|
||||
{
|
||||
char msg[MAX_MESSAGE_LEN];
|
||||
va_list args;
|
||||
|
||||
va_start(args, Fmt);
|
||||
_vsnprintf(msg, MAX_MESSAGE_LEN, Fmt, args);
|
||||
va_end(args);
|
||||
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[WARNING_MXF] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
//! Display an error message
|
||||
void mxflib::error(const char *Fmt, ...)
|
||||
{
|
||||
char msg[MAX_MESSAGE_LEN];
|
||||
va_list args;
|
||||
|
||||
va_start(args, Fmt);
|
||||
_vsnprintf(msg, MAX_MESSAGE_LEN, Fmt, args);
|
||||
va_end(args);
|
||||
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[ERROR_MXF] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
//! Display an error message
|
||||
void mxflib::debug(const char *Fmt, ...)
|
||||
{
|
||||
char msg[MAX_MESSAGE_LEN];
|
||||
va_list args;
|
||||
|
||||
va_start(args, Fmt);
|
||||
_vsnprintf(msg, MAX_MESSAGE_LEN, Fmt, args);
|
||||
va_end(args);
|
||||
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiEnter();
|
||||
#endif /* __WXGTK__ */
|
||||
wxLogMessage(wxT("[DEBUG_MXF] %.*s"), message_len, msg);
|
||||
#ifndef __WXGTK__
|
||||
wxMutexGuiLeave();
|
||||
#endif /* __WXGTK__ */
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------- JPEG 2000 Data Source Manager
|
||||
|
||||
#define J2K_CFMT 0
|
||||
@@ -84,8 +183,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxMXFHandler,wxImageHandler)
|
||||
#define BMP_DFMT 2
|
||||
#define YUV_DFMT 3
|
||||
|
||||
#define MAX_MESSAGE_LEN 200
|
||||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void mxf_error_callback(const char *msg, void *client_data) {
|
||||
int message_len = strlen(msg) - 1;
|
||||
@@ -142,7 +239,33 @@ bool wxMXFHandler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
|
||||
unsigned char *ptr;
|
||||
int file_length, j2k_point, j2k_len;
|
||||
opj_codestream_info_t cstr_info; /* Codestream information structure */
|
||||
|
||||
// simply display the version of the library
|
||||
wxLogMessage(wxT("Version of MXF: %s "), wxString::FromAscii(LibraryVersion().c_str()));
|
||||
//wxLogMessage(wxT("MXF file name: %s"), m_filename.GetFullPath());
|
||||
|
||||
// open MXF file
|
||||
MXFFilePtr TestFile = new MXFFile;
|
||||
if (! TestFile->Open(m_filename.GetFullPath().c_str(), true))
|
||||
{
|
||||
wxLogError(wxT("Could not find %s"), m_filename.GetFullPath().c_str());
|
||||
return false;
|
||||
} else
|
||||
wxLogMessage(wxT("Found %s"), m_filename.GetFullPath().c_str());
|
||||
|
||||
// Get the size
|
||||
TestFile->SeekEnd();
|
||||
wxLogMessage(wxT("Size is %d bytes"), TestFile->Tell());
|
||||
TestFile->Seek(0);
|
||||
|
||||
// essence information
|
||||
//BuildEssenceInfo(TestFile, EssenceLookup);
|
||||
|
||||
// close MXF file
|
||||
TestFile->Close();
|
||||
|
||||
return false;
|
||||
|
||||
// destroy the image
|
||||
image->Destroy();
|
||||
|
||||
@@ -266,6 +389,111 @@ bool wxMXFHandler::DoCanRead( wxInputStream& stream )
|
||||
hdr[3] == 0x34);
|
||||
}
|
||||
|
||||
//! Build an EssenceInfoMap for the essence in a given file
|
||||
/*! \return True if al OK, else false
|
||||
*/
|
||||
bool BuildEssenceInfo(MXFFilePtr &File, EssenceInfoMap &EssenceLookup)
|
||||
{
|
||||
// Empty any old data
|
||||
EssenceLookup.clear();
|
||||
|
||||
// Get the master metadata set (or the header if we must)
|
||||
PartitionPtr MasterPartition = File->ReadMasterPartition();
|
||||
if(!MasterPartition)
|
||||
{
|
||||
File->Seek(0);
|
||||
MasterPartition = File->ReadPartition();
|
||||
warning("File %s does not contain a cloased copy of header metadata - using the open copy in the file header\n", File->Name.c_str());
|
||||
}
|
||||
|
||||
if(!MasterPartition)
|
||||
{
|
||||
error("Could not read header metadata from file %s\n", File->Name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read and parse the metadata
|
||||
MasterPartition->ReadMetadata();
|
||||
MetadataPtr HMeta = MasterPartition->ParseMetadata();
|
||||
|
||||
if(!HMeta)
|
||||
{
|
||||
error("Could not read header metadata from file %s\n", File->Name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Scan the Essence container data sets to get PackageID to BodySID mapping */
|
||||
MDObjectPtr ECDSet = HMeta[ContentStorage_UL];
|
||||
if(ECDSet) ECDSet = ECDSet->GetLink();
|
||||
if(ECDSet) ECDSet = ECDSet[EssenceContainerDataBatch_UL];
|
||||
if(!ECDSet)
|
||||
{
|
||||
error("Header metadata in file %s does not contain an EssenceContainerData set\n", File->Name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
MDObject::iterator it = ECDSet->begin();
|
||||
while(it != ECDSet->end())
|
||||
{
|
||||
MDObjectPtr ThisECDSet = (*it).second->GetLink();
|
||||
MDObjectPtr PackageID;
|
||||
if(ThisECDSet) PackageID = ThisECDSet->Child(LinkedPackageUID_UL);
|
||||
if(PackageID)
|
||||
{
|
||||
EssenceInfo NewEI;
|
||||
NewEI.PackageID = new UMID(PackageID->PutData()->Data);
|
||||
|
||||
// Inset the basic essence info - but not if this is external essence (BodySID == 0)
|
||||
UInt32 BodySID = ThisECDSet->GetUInt(BodySID_UL);
|
||||
if(BodySID) EssenceLookup[BodySID] = NewEI;
|
||||
}
|
||||
it++;
|
||||
}
|
||||
|
||||
/* Now find the other items for the essence lookup map */
|
||||
if(EssenceLookup.size())
|
||||
{
|
||||
PackageList::iterator it = HMeta->Packages.begin();
|
||||
while(it != HMeta->Packages.end())
|
||||
{
|
||||
// Only Source Packages are of interest
|
||||
if((*it)->IsA(SourcePackage_UL))
|
||||
{
|
||||
MDObjectPtr Descriptor = (*it)->Child(Descriptor_UL);
|
||||
if(Descriptor) Descriptor = Descriptor->GetLink();
|
||||
|
||||
if(Descriptor)
|
||||
{
|
||||
MDObjectPtr PackageID = (*it)->Child(PackageUID_UL);
|
||||
if(PackageID)
|
||||
{
|
||||
UMIDPtr TheID = new UMID(PackageID->PutData()->Data);
|
||||
|
||||
/* Now do a lookup in the essence lookup map (it will need to be done the long way here */
|
||||
EssenceInfoMap::iterator EL_it = EssenceLookup.begin();
|
||||
while(EL_it != EssenceLookup.end())
|
||||
{
|
||||
if((*((*EL_it).second.PackageID)) == (*TheID))
|
||||
{
|
||||
// If found, set the missing items and stop searching
|
||||
(*EL_it).second.Package = (*it);
|
||||
(*EL_it).second.Descriptor = Descriptor;
|
||||
break;
|
||||
}
|
||||
EL_it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
#endif // wxUSE_LIBOPENJPEG
|
||||
@@ -38,6 +38,7 @@
|
||||
#ifdef USE_MXF
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/filename.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMXFHandler
|
||||
@@ -48,7 +49,7 @@
|
||||
#include "wx/image.h"
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
#define wxBITMAP_TYPE_MXF 50
|
||||
#define wxBITMAP_TYPE_MXF 51
|
||||
|
||||
class WXDLLEXPORT wxMXFHandler: public wxImageHandler
|
||||
{
|
||||
@@ -63,6 +64,7 @@ public:
|
||||
m_reducefactor = 0;
|
||||
m_qualitylayers = 0;
|
||||
m_components = 0;
|
||||
m_filename = wxT("");
|
||||
#ifdef USE_JPWL
|
||||
m_enablejpwl = true;
|
||||
m_expcomps = JPWL_EXPECTED_COMPONENTS;
|
||||
@@ -72,6 +74,7 @@ public:
|
||||
|
||||
// decoding engine parameters
|
||||
int m_reducefactor, m_qualitylayers, m_components, m_framenum;
|
||||
wxFileName m_filename;
|
||||
#ifdef USE_JPWL
|
||||
bool m_enablejpwl;
|
||||
int m_expcomps, m_maxtiles;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user