summaryrefslogtreecommitdiff
path: root/applications
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2011-12-20 18:33:45 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2011-12-20 18:33:45 +0000
commit02d9f438027038877d74824966bce8819d0c3cc9 (patch)
treed8f7f401f32d52ce5e6149881607db469fb45186 /applications
parent00b479cb7927668f0fbd74c9a84a9d8d1679d465 (diff)
Reactivate the opjviewer in cmake
Diffstat (limited to 'applications')
-rw-r--r--applications/CMakeLists.txt4
-rw-r--r--applications/OPJViewer/CMakeLists.txt23
-rw-r--r--applications/OPJViewer/source/OPJDialogs.cpp32
-rw-r--r--applications/OPJViewer/source/OPJViewer.cpp2
-rw-r--r--applications/OPJViewer/source/OPJViewer.h5
5 files changed, 48 insertions, 18 deletions
diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt
index d26e26db..9c0bbb20 100644
--- a/applications/CMakeLists.txt
+++ b/applications/CMakeLists.txt
@@ -11,3 +11,7 @@ ENDIF(BUILD_MJ2)
IF(BUILD_JPIP)
ADD_SUBDIRECTORY(jpip)
ENDIF(BUILD_JPIP)
+
+IF(BUILD_VIEWER)
+ ADD_SUBDIRECTORY(OPJViewer)
+ENDIF(BUILD_VIEWER)
diff --git a/applications/OPJViewer/CMakeLists.txt b/applications/OPJViewer/CMakeLists.txt
new file mode 100644
index 00000000..a03b370d
--- /dev/null
+++ b/applications/OPJViewer/CMakeLists.txt
@@ -0,0 +1,23 @@
+PROJECT(viewer CXX)
+
+FIND_PACKAGE(wxWidgets REQUIRED)
+INCLUDE(${wxWidgets_USE_FILE})
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../..
+ ${CMAKE_CURRENT_SOURCE_DIR}/..
+ )
+
+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)
diff --git a/applications/OPJViewer/source/OPJDialogs.cpp b/applications/OPJViewer/source/OPJDialogs.cpp
index ed68ef3f..36490d40 100644
--- a/applications/OPJViewer/source/OPJDialogs.cpp
+++ b/applications/OPJViewer/source/OPJDialogs.cpp
@@ -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
-
diff --git a/applications/OPJViewer/source/OPJViewer.cpp b/applications/OPJViewer/source/OPJViewer.cpp
index 8f2c86e8..1bc170b4 100644
--- a/applications/OPJViewer/source/OPJViewer.cpp
+++ b/applications/OPJViewer/source/OPJViewer.cpp
@@ -1373,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"),
diff --git a/applications/OPJViewer/source/OPJViewer.h b/applications/OPJViewer/source/OPJViewer.h
index 3574dac1..e0e615bf 100644
--- a/applications/OPJViewer/source/OPJViewer.h
+++ b/applications/OPJViewer/source/OPJViewer.h
@@ -214,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;
@@ -782,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: