summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-03-02 09:47:55 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-03-02 09:47:55 +0000
commit7abbe1e8d8923375e63cf403d2194ea528ad1740 (patch)
treeb1f1a7b34f6b4bbcbd9c2b76fd51a028bc5ad224
parent004b6ed60f17ef2cc64c6eb3918cfbeaafecf9fd (diff)
[trunk] Backport from OPJViewer version 1.5 over to trunk
-rw-r--r--applications/OPJViewer/CMakeLists.txt25
-rw-r--r--applications/OPJViewer/source/OPJDialogs.cpp32
-rw-r--r--applications/OPJViewer/source/OPJViewer.cpp2
-rw-r--r--applications/OPJViewer/source/OPJViewer.h5
-rw-r--r--applications/OPJViewer/source/wxj2kparser.cpp4
5 files changed, 48 insertions, 20 deletions
diff --git a/applications/OPJViewer/CMakeLists.txt b/applications/OPJViewer/CMakeLists.txt
new file mode 100644
index 00000000..f382b14a
--- /dev/null
+++ b/applications/OPJViewer/CMakeLists.txt
@@ -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)
diff --git a/applications/OPJViewer/source/OPJDialogs.cpp b/applications/OPJViewer/source/OPJDialogs.cpp
index 2c6fa6e0..ff96da9c 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 056a8a1d..8476d919 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 15d7477b..a484e2ea 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:
diff --git a/applications/OPJViewer/source/wxj2kparser.cpp b/applications/OPJViewer/source/wxj2kparser.cpp
index 844eae97..284c568a 100644
--- a/applications/OPJViewer/source/wxj2kparser.cpp
+++ b/applications/OPJViewer/source/wxj2kparser.cpp
@@ -93,7 +93,7 @@ unsigned short int marker_val[] = {
};
// Marker names
-char *marker_name[] = {
+static const char *marker_name[] = {
"SOC", "SOT", "SOD", "EOC",
"SIZ",
"COD", "COC", "RGN", "QCD", "QCC", "POD",
@@ -109,7 +109,7 @@ char *marker_name[] = {
};
// Marker descriptions
-char *marker_descr[] = {
+static const char *marker_descr[] = {
"Start of codestream", "Start of tile-part", "Start of data", "End of codestream",
"Image and tile size",
"Coding style default", "Coding style component", "Region-of-interest", "Quantization default",