]> granicus.if.org Git - openjpeg/commitdiff
[trunk] Backport from OPJViewer version 1.5 over to trunk
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 2 Mar 2012 09:47:55 +0000 (09:47 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 2 Mar 2012 09:47:55 +0000 (09:47 +0000)
applications/OPJViewer/CMakeLists.txt [new file with mode: 0644]
applications/OPJViewer/source/OPJDialogs.cpp
applications/OPJViewer/source/OPJViewer.cpp
applications/OPJViewer/source/OPJViewer.h
applications/OPJViewer/source/wxj2kparser.cpp

diff --git a/applications/OPJViewer/CMakeLists.txt b/applications/OPJViewer/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f382b14
--- /dev/null
@@ -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)
index 2c6fa6e0c5c33f98382adf82b62553174e11234b..ff96da9cf9758fa2ab3a741fbc9074459e6e542b 100644 (file)
@@ -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
-
 
 
 
index 056a8a1d723e15a0ddfabb0ac4155d4efc32d8ae..8476d9190731839a31adb1fb3a18b7ab1d5187e8 100644 (file)
@@ -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"),
index 15d7477b944408c6b0204b11d88198511536be06..a484e2eaa0fd638507991c17f16aff63d6856255 100644 (file)
@@ -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:
index 844eae9750602ce4959de97e2b876b77ad927644..284c568a3636817798af968f6d9a76e955e74f49 100644 (file)
@@ -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",