Reactivate the opjviewer in cmake

This commit is contained in:
Mathieu Malaterre 2011-12-20 18:33:45 +00:00
parent 00b479cb79
commit 02d9f43802
6 changed files with 50 additions and 18 deletions

View File

@ -179,6 +179,8 @@ ADD_SUBDIRECTORY(libopenjpeg)
OPTION(BUILD_CODEC "Build the CODEC executables" ON) OPTION(BUILD_CODEC "Build the CODEC executables" ON)
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF) OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF)
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF) OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF)
OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
MARK_AS_ADVANCED(BUILD_VIEWER)
IF(BUILD_JPIP) IF(BUILD_JPIP)
FIND_PACKAGE(CURL) FIND_PACKAGE(CURL)

View File

@ -11,3 +11,7 @@ ENDIF(BUILD_MJ2)
IF(BUILD_JPIP) IF(BUILD_JPIP)
ADD_SUBDIRECTORY(jpip) ADD_SUBDIRECTORY(jpip)
ENDIF(BUILD_JPIP) ENDIF(BUILD_JPIP)
IF(BUILD_VIEWER)
ADD_SUBDIRECTORY(OPJViewer)
ENDIF(BUILD_VIEWER)

View File

@ -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)

View File

@ -360,6 +360,22 @@ wxPanel* OPJDecoderDialog::CreatePart11SettingsPage(wxWindow* parent)
return panel; 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) void OPJDecoderDialog::OnEnableDeco(wxCommandEvent& event)
{ {
size_t pp; 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

View File

@ -1373,6 +1373,8 @@ void OPJFrame::OnFileSaveAs(wxCommandEvent& WXUNUSED(event))
wxT("JPEG 2000 codestream (*.j2k)|*.j2k") wxT("JPEG 2000 codestream (*.j2k)|*.j2k")
wxT("|JPEG 2000 file format (*.jp2)|*.jp2"); wxT("|JPEG 2000 file format (*.jp2)|*.jp2");
#endif #endif
#else
wxT("Houston we have a problem");
#endif #endif
wxFileDialog dialog(this, _T("Save image file"), wxFileDialog dialog(this, _T("Save image file"),

View File

@ -214,8 +214,8 @@ class OPJViewerApp: public wxApp
#ifdef USE_JPWL #ifdef USE_JPWL
bool m_enablejpwl, m_enablejpwle; bool m_enablejpwl, m_enablejpwle;
int m_expcomps, m_maxtiles; int m_expcomps, m_maxtiles;
int m_framewidth, m_frameheight;
#endif // USE_JPWL #endif // USE_JPWL
int m_framewidth, m_frameheight;
// encoding engine parameters // encoding engine parameters
wxString m_subsampling, m_origin, m_rates, m_comment, m_index, m_quality; wxString m_subsampling, m_origin, m_rates, m_comment, m_index, m_quality;
@ -782,9 +782,10 @@ public:
#ifdef USE_JPWL #ifdef USE_JPWL
void OnEnableJPWL(wxCommandEvent& event); void OnEnableJPWL(wxCommandEvent& event);
wxPanel* CreatePart11SettingsPage(wxWindow* parent); wxPanel* CreatePart11SettingsPage(wxWindow* parent);
wxSpinCtrl *m_expcompsCtrl, *m_framenumCtrl, *m_maxtilesCtrl; wxSpinCtrl *m_expcompsCtrl, *m_maxtilesCtrl;
wxCheckBox *m_enablejpwlCheck; wxCheckBox *m_enablejpwlCheck;
#endif // USE_JPWL #endif // USE_JPWL
wxSpinCtrl *m_framenumCtrl;
protected: protected: