Possibility to disable parsing in OPJViewer; also, saves common settings to the regis...
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>
Sat, 16 Jun 2007 17:28:47 +0000 (17:28 +0000)
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>
Sat, 16 Jun 2007 17:28:47 +0000 (17:28 +0000)
12 files changed:
ChangeLog
OPJViewer/OPJViewer.dsp
OPJViewer/OPJViewer.iss
OPJViewer/Readme.txt
OPJViewer/buildupdate.bat [new file with mode: 0644]
OPJViewer/source/OPJViewer.cpp
OPJViewer/source/OPJViewer.h
OPJViewer/source/about_htm.h
OPJViewer/source/build.h [new file with mode: 0644]
OPJViewer/source/imagjpeg2000.cpp
OPJViewer/source/imagmj2.cpp
OPJViewer/source/wxjp2parser.cpp

index ed4ec633fec130f065ca246339a9263ebdac754b..cfc8f683c48330561b6c5b391d102dd70ae46188 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ What's New for OpenJPEG
 ! : changed
 + : added
 
+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 
 
index c882690d83c5c37843aec9d72a19096bc51174e5..31f4c1eb4ec42e3b6a467a9f2704cc4181cdf17e 100644 (file)
@@ -42,7 +42,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /G6 /MD /W3 /GX /O2 /I "c:\programmi\wxWidgets-2.8.0\lib\vc_lib\msw" /I "c:\programmi\wxWidgets-2.8.0\include" /I ".." /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 "OPJ_HTMLABOUT" /D "OPJ_MANYFORMATS" /FR /FD /c\r
+# ADD CPP /nologo /G6 /MD /W3 /GX /O2 /I "c:\programmi\wxWidgets-2.8.0\lib\vc_lib\msw" /I "c:\programmi\wxWidgets-2.8.0\include" /I ".." /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 "OPJ_HTMLABOUT" /D "OPJ_MANYFORMATS" /D "OPJ_INICONFIG" /FR /FD /c\r
 # ADD BASE RSC /l 0x410 /d "NDEBUG"\r
 # ADD RSC /l 0x409 /i "c:\programmi\wxWidgets-2.8.0\include" /d "NDEBUG"\r
 BSC32=bscmake.exe\r
@@ -67,15 +67,15 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "d:\Programmi\wxWidgets-2.8.0\INCLUDE" /I "d:\programmi\wxWidgets-2.8.0\lib\vc_lib\msw" /I "d:\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\r
+# 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 "d:\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\r
 # ADD BASE RSC /l 0x410 /d "_DEBUG"\r
-# ADD RSC /l 0x410 /i "d:\programmi\wxWidgets-2.8.0\include" /d "_DEBUG"\r
+# ADD RSC /l 0x410 /i "c:\programmi\wxWidgets-2.8.0\include" /d "_DEBUG"\r
 BSC32=bscmake.exe\r
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # 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\r
-# 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:"d:\programmi\wxWidgets-2.8.0\lib\vc_lib" /libpath:"..\jpwl\Debug"\r
+# 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"\r
 # SUBTRACT LINK32 /pdb:none\r
 \r
 !ENDIF \r
index 1467e288055c2f66fa5bd7f3568500759ee64aeb..a45bde6f2fd5e5bd8d2b51e0f57649dd38ffad89 100644 (file)
@@ -42,3 +42,7 @@ Name: {userdesktop}\OPJViewer; Filename: {app}\OPJViewer.exe; Tasks: desktopicon
 \r
 [Run]\r
 Filename: {app}\OPJViewer.exe; Description: {cm:LaunchProgram,OPJViewer}; Flags: nowait postinstall skipifsilent; WorkingDir: {app}\r
+\r
+[Registry]\r
+Root: HKCU; Subkey: Software\OpenJPEG; ValueType: none; ValueData: 1; Flags: uninsdeletekey; Tasks: ; Languages: \r
+Root: HKCU; Subkey: Software\OpenJPEG\OPJViewer; ValueType: none; ValueData: 1; Flags: uninsdeletekey; Tasks: ; Languages: \r
index bc29075e0bc03977023cc1f96df264fe9ea5b774..469ee15bf1898e225e29a6f4376c3abd5dbf9c19 100644 (file)
@@ -52,8 +52,7 @@ The porting is possible and under way.
 3. General information on the viewer\r
 ====================================\r
 \r
-This viewer is conceived to open and display information and image content of J2K, JP2,\r
-and MJ2 files.\r
+This viewer is conceived to open and display information and image content of J2K, JP2, and MJ2 files.\r
 The viewer application interface is divided into three main panels:\r
 - a browsing pane;\r
 - a viewing pane;\r
diff --git a/OPJViewer/buildupdate.bat b/OPJViewer/buildupdate.bat
new file mode 100644 (file)
index 0000000..6ff0d42
--- /dev/null
@@ -0,0 +1,15 @@
+::== buildupdate.bat\r
+@echo off\r
+setLocal EnableDelayedExpansion\r
+\r
+for /f "tokens=2,* delims=^(^) " %%a in ('find /v "" ^< .\source\build.h') do (\r
+rem echo %%a\r
+set /A M = %%a + 1\r
+echo Build !M!\r
+echo wxT^("!M!"^) > buildtemp283746825t347\r
+)\r
+\r
+if exist buildtemp283746825t347 move /Y buildtemp283746825t347 .\source\build.h\r
+if exist buildtemp283746825t347 del /F /Q buildtemp283746825t347\r
+\r
+::==
\ No newline at end of file
index 356c28e88928242397cb4a91940fb28805930ae2..2d1e3ac6ef9d784bac03556ff5e997bbdf8fad84 100644 (file)
@@ -207,8 +207,30 @@ bool OPJViewerApp::OnInit(void)
        // memory file system\r
     wxFileSystem::AddHandler(new wxMemoryFSHandler);\r
 \r
+#ifdef OPJ_INICONFIG\r
+       //load decoding engine parameters\r
+       OPJconfig = new wxConfig(OPJ_APPLICATION, OPJ_APPLICATION_VENDOR);\r
+\r
+       OPJconfig->Read(wxT("enabledeco"), &m_enabledeco, (bool) true);\r
+       OPJconfig->Read(wxT("enableparse"), &m_enableparse, (bool) true);\r
+       OPJconfig->Read(wxT("resizemethod"), &m_resizemethod, (long) 0);\r
+       OPJconfig->Read(wxT("reducefactor"), &m_reducefactor, (long) 0);\r
+       OPJconfig->Read(wxT("qualitylayers"), &m_qualitylayers, (long) 0);\r
+       OPJconfig->Read(wxT("components"), &m_components, (long) 0);\r
+       OPJconfig->Read(wxT("framenum"), &m_framenum, (long) 0);\r
+#ifdef USE_JPWL\r
+       OPJconfig->Read(wxT("enablejpwl"), &m_enablejpwl, (bool) true);\r
+       OPJconfig->Read(wxT("expcomps"), &m_expcomps, (long) JPWL_EXPECTED_COMPONENTS);\r
+       OPJconfig->Read(wxT("maxtiles"), &m_maxtiles, (long) JPWL_MAXIMUM_TILES);\r
+#endif // USE_JPWL\r
+\r
+       OPJconfig->Write(wxT("teststring"), wxT("This is a test value"));\r
+       OPJconfig->Write(wxT("testbool"), (bool) true);\r
+       OPJconfig->Write(wxT("testlong"), (long) 245);\r
+#else\r
        // set decoding engine parameters\r
        m_enabledeco = true;\r
+       m_enableparse = true;\r
        m_resizemethod = 0;\r
        m_reducefactor = 0;\r
        m_qualitylayers = 0;\r
@@ -219,6 +241,7 @@ bool OPJViewerApp::OnInit(void)
        m_expcomps = JPWL_EXPECTED_COMPONENTS;\r
        m_maxtiles = JPWL_MAXIMUM_TILES;\r
 #endif // USE_JPWL\r
+#endif // OPJ_INICONFIG\r
 \r
        // Create the main frame window\r
   OPJFrame *frame = new OPJFrame(NULL, wxID_ANY, OPJ_APPLICATION_TITLEBAR,\r
@@ -250,6 +273,26 @@ bool OPJViewerApp::OnInit(void)
   return true;\r
 }\r
 \r
+int OPJViewerApp::OnExit()\r
+{\r
+#ifdef OPJ_INICONFIG\r
+       OPJconfig->Write(wxT("enabledeco"), m_enabledeco);\r
+       OPJconfig->Write(wxT("enableparse"), m_enableparse);\r
+       OPJconfig->Write(wxT("resizemethod"), m_resizemethod);\r
+       OPJconfig->Write(wxT("reducefactor"), m_reducefactor);\r
+       OPJconfig->Write(wxT("qualitylayers"), m_qualitylayers);\r
+       OPJconfig->Write(wxT("components"), m_components);\r
+       OPJconfig->Write(wxT("framenum"), m_framenum);\r
+#ifdef USE_JPWL\r
+       OPJconfig->Write(wxT("enablejpwl"), m_enablejpwl);\r
+       OPJconfig->Write(wxT("expcomps"), m_expcomps);\r
+       OPJconfig->Write(wxT("maxtiles"), m_maxtiles);\r
+#endif // USE_JPWL\r
+#endif // OPJ_INICONFIG\r
+\r
+       return 1;\r
+}\r
+\r
 void OPJViewerApp::ShowCmdLine(const wxCmdLineParser& parser)\r
 {\r
     wxString s = wxT("Command line parsed successfully:\nInput files: ");\r
@@ -472,7 +515,8 @@ void OPJFrame::OnSetsDeco(wxCommandEvent& event)
 \r
                // load settings\r
                wxGetApp().m_enabledeco = dialog.m_enabledecoCheck->GetValue();\r
-               wxGetApp().m_resizemethod = dialog.m_resizeBox->GetSelection();\r
+               wxGetApp().m_enableparse = dialog.m_enableparseCheck->GetValue();\r
+               wxGetApp().m_resizemethod = dialog.m_resizeBox->GetSelection() - 1;\r
                wxGetApp().m_reducefactor = dialog.m_reduceCtrl->GetValue();\r
                wxGetApp().m_qualitylayers = dialog.m_layerCtrl->GetValue();\r
                wxGetApp().m_components = dialog.m_numcompsCtrl->GetValue();\r
@@ -548,16 +592,23 @@ void OPJFrame::OnZoom(wxCommandEvent& WXUNUSED(event))
 void OPJFrame::Rescale(int zooml, OPJChildFrame *currframe)\r
 {\r
        wxImage new_image = currframe->m_canvas->m_image100.ConvertToImage();\r
+\r
+       // resizing enabled?\r
+       if (wxGetApp().m_resizemethod == -1) {\r
+               zooml = 100;\r
+       }\r
+\r
        if (zooml != 100)\r
                new_image.Rescale((int) ((double) zooml * (double) new_image.GetWidth() / 100.0),\r
                        (int) ((double) zooml * (double) new_image.GetHeight() / 100.0),\r
                        wxGetApp().m_resizemethod ? wxIMAGE_QUALITY_HIGH : wxIMAGE_QUALITY_NORMAL);\r
-    currframe->m_canvas->m_image = wxBitmap(new_image);\r
+       currframe->m_canvas->m_image = wxBitmap(new_image);\r
        currframe->m_canvas->SetScrollbars(20,\r
                                                                                20,\r
                                                                                (int)(0.5 + (double) new_image.GetWidth() / 20.0),\r
                                                                                (int)(0.5 + (double) new_image.GetHeight() / 20.0)\r
                                                                                );\r
+\r
        currframe->m_canvas->Refresh();\r
 \r
        // update zoom\r
@@ -1125,32 +1176,39 @@ void OPJParseThread::LoadFile(wxFileName fname)
        // open the file\r
        wxFile m_file(fname.GetFullPath().c_str(), wxFile::read);\r
 \r
-       // what is the extension?\r
-       if ((fname.GetExt() == wxT("j2k")) || (fname.GetExt() == wxT("j2c"))) {\r
+       // parsing enabled?\r
+       if (wxGetApp().m_enableparse) {\r
 \r
-               // parse the file\r
-               ParseJ2KFile(&m_file, 0, m_file.Length(), rootid);\r
+               // what is the extension?\r
+               if ((fname.GetExt() == wxT("j2k")) || (fname.GetExt() == wxT("j2c"))) {\r
 \r
-       } else if ((fname.GetExt() == wxT("jp2")) || (fname.GetExt() == wxT("mj2"))) {\r
+                       // parse the file\r
+                       ParseJ2KFile(&m_file, 0, m_file.Length(), rootid);\r
 \r
-               // parse the file\r
-               if (this->m_parentid) {\r
-                       //WriteText(wxT("Only a subsection of jp2"));\r
-                       OPJMarkerData *data = (OPJMarkerData *) m_tree->GetItemData(rootid);\r
-                       ParseJ2KFile(&m_file, data->m_start, data->m_length, rootid);\r
-                       m_tree->Expand(rootid);\r
+               } else if ((fname.GetExt() == wxT("jp2")) || (fname.GetExt() == wxT("mj2"))) {\r
 \r
-               } else\r
-                       // as usual\r
-                       ParseJP2File(&m_file, 0, m_file.Length(), rootid);\r
+                       // parse the file\r
+                       if (this->m_parentid) {\r
+                               //WriteText(wxT("Only a subsection of jp2"));\r
+                               OPJMarkerData *data = (OPJMarkerData *) m_tree->GetItemData(rootid);\r
+                               ParseJ2KFile(&m_file, data->m_start, data->m_length, rootid);\r
+                               m_tree->Expand(rootid);\r
 \r
-       } else {\r
+                       } else {\r
+                               // as usual\r
+                               ParseJP2File(&m_file, 0, m_file.Length(), rootid);\r
+                       }\r
+\r
+               } else {\r
 \r
-               // unknown extension\r
-               WriteText(wxT("Unknown file format!"));\r
+                       // unknown extension\r
+                       WriteText(wxT("Unknown file format!"));\r
+\r
+               }\r
 \r
        }\r
 \r
+\r
        // this is the root node\r
        if (this->m_parentid)\r
                m_tree->SetItemText(rootid, wxT("Codestream"));\r
@@ -2131,8 +2189,14 @@ wxPanel* OPJDecoderDialog::CreateMainSettingsPage(wxWindow* parent)
                        0, wxGROW | wxALL, 5);\r
                m_enabledecoCheck->SetValue(wxGetApp().m_enabledeco);\r
 \r
+               // add parsing enabling check box\r
+               subtopSizer->Add(\r
+                       m_enableparseCheck = new wxCheckBox(panel, OPJDECO_ENABLEPARSE, wxT("Enable parsing"), wxDefaultPosition, wxDefaultSize),\r
+                       0, wxGROW | wxALL, 5);\r
+               m_enableparseCheck->SetValue(wxGetApp().m_enableparse);\r
+\r
                        // resize settings, column\r
-                       wxString choices[] = {wxT("Low quality"), wxT("High quality")};\r
+                       wxString choices[] = {wxT("Don't resize"), wxT("Low quality"), wxT("High quality")};\r
                        m_resizeBox = new wxRadioBox(panel, OPJDECO_RESMETHOD,\r
                                wxT("Resize method"),\r
                                wxDefaultPosition, wxDefaultSize,\r
@@ -2140,7 +2204,7 @@ wxPanel* OPJDecoderDialog::CreateMainSettingsPage(wxWindow* parent)
                                choices,\r
                                1,\r
                                wxRA_SPECIFY_ROWS);\r
-                       m_resizeBox->SetSelection(wxGetApp().m_resizemethod);\r
+                       m_resizeBox->SetSelection(wxGetApp().m_resizemethod + 1);\r
 \r
                subtopSizer->Add(m_resizeBox, 0, wxGROW | wxALL, 5);\r
 \r
index 7757ec73b81eba7792634d8a77ce69de8bfb2348..c69c55db4abb14202f4b548f7361e81cb1380b87 100644 (file)
@@ -128,6 +128,7 @@ typedef unsigned long long int8byte;
 #define OPJ_APPLICATION_VERSION                wxT("0.3 alpha")\r
 #define OPJ_APPLICATION_TITLEBAR       OPJ_APPLICATION_NAME wxT(" ") OPJ_APPLICATION_VERSION\r
 #define OPJ_APPLICATION_COPYRIGHT      wxT("(C) 2007, Giuseppe Baruffa")\r
+#define OPJ_APPLICATION_VENDOR      wxT("OpenJPEG")\r
 \r
 #ifdef __WXMSW__\r
 #define OPJ_APPLICATION_PLATFORM    wxT("Windows")\r
@@ -158,6 +159,7 @@ class OPJViewerApp: public wxApp
 \r
                // other methods\r
                bool OnInit(void);\r
+               int OnExit(void);\r
                void SetShowImages(bool show) { m_showImages = show; }\r
                bool ShowImages() const { return m_showImages; }\r
                void ShowCmdLine(const wxCmdLineParser& parser);\r
@@ -183,13 +185,16 @@ class OPJViewerApp: public wxApp
                int m_resizemethod;\r
 \r
                // decoding engine parameters\r
-               bool m_enabledeco;\r
+               bool m_enabledeco, m_enableparse;\r
                int m_reducefactor, m_qualitylayers, m_components, m_framenum;\r
 #ifdef USE_JPWL\r
                bool m_enablejpwl;\r
                int m_expcomps, m_maxtiles;\r
 #endif // USE_JPWL\r
 \r
+               // application configuration\r
+               wxConfig *OPJconfig; \r
+\r
        // private methods and variables\r
        private:\r
                bool m_showImages, m_showButtons;\r
@@ -619,7 +624,7 @@ public:
     ~OPJDecoderDialog();\r
 \r
        wxBookCtrlBase* m_settingsNotebook;\r
-       wxCheckBox *m_enabledecoCheck;\r
+       wxCheckBox *m_enabledecoCheck, *m_enableparseCheck;\r
        wxSpinCtrl *m_reduceCtrl, *m_layerCtrl, *m_numcompsCtrl;\r
        wxRadioBox* m_resizeBox;\r
 \r
@@ -644,6 +649,7 @@ protected:
                OPJDECO_QUALITYLAYERS,\r
                OPJDECO_NUMCOMPS,\r
                OPJDECO_ENABLEDECO,\r
+               OPJDECO_ENABLEPARSE,\r
                OPJDECO_ENABLEJPWL,\r
                OPJDECO_EXPCOMPS,\r
                OPJDECO_MAXTILES,\r
index c0c0c280ab87b1565b742e601b2830b66326b1b5..d37db13fc4171da6a0256544652a50a9a649319f 100644 (file)
@@ -1,29 +1,31 @@
 wxString htmlaboutpage = wxT(\r
 "<html>"\r
 "<body bgcolor=#FFFFFF>"\r
-"<table cellspacing=7 cellpadding=1 border=0 width=100%>"\r
+"<table cellspacing=7 cellpadding=1 border=0 width=100%>"   \r
 "<tr>"\r
 "<td rowspan=3 valign=top align=center width=70>"\r
-"<img src=\"memory:opj_logo.xpm\"><br><br>"\r
+"<img src=\"memory:opj_logo.xpm\"><br><br>" \r
 "</td>"\r
 "<td align=center>"\r
-"<font size=+0 color=#000000><b>"\r
-OPJ_APPLICATION " " OPJ_APPLICATION_VERSION\r
+"<font size=+0 color=#000000><b>" \r
+OPJ_APPLICATION " " OPJ_APPLICATION_VERSION \r
 "</b></font><br>"\r
-"<font size=-1 color=#000000><b>A JPEG 2000 image viewer</b></font><br>"\r
-"<font size=-2 color=#000000><b>" OPJ_APPLICATION_PLATFORM " version</b></font>"\r
+"<font size=-1 color=#000000><b>A JPEG 2000 image viewer</b></font><br>"  \r
+"<font size=-2 color=#000000><b>" OPJ_APPLICATION_PLATFORM " version</b></font>"  \r
 "</td>"\r
 "</tr>"\r
-"<tr height=3 valign=center>"\r
-"<td valign=center  bgcolor=#cc3300></td>"\r
+"<tr height=3 valign=center>"  \r
+"<td valign=center  bgcolor=#cc3300></td>"   \r
 "</tr>"\r
 "<tr>"\r
 "<td align=justify>"\r
 "<center><font size=+0 color=#000000><a href=\"http://www.openjpeg.org/\">OpenJPEG</a></font></center>"\r
 "<font size=-1 color=#000000>The OpenJPEG library is an open-source JPEG 2000 codec written in C language. "\r
 "In addition to the basic codec, various other features are under development.</font><br>"\r
-"<font size=-2 color=red>* Build: " wxVERSION_STRING ", " __DATE__ ", " __TIME__ "</font><br>"\r
-)\r
+"<font size=-2 color=red>* Build: ")\r
+#include "build.h"\r
+wxT("</font><br>")\r
+wxT("<font size=-2 color=red>* " wxVERSION_STRING ", " __DATE__ ", " __TIME__ "</font><br>")\r
 #ifdef USE_JPWL\r
 wxT("<font size=-2 color=green>- Compiled with JPWL support</font><br>")\r
 #endif // USE_JPWL\r
@@ -33,7 +35,7 @@ wxT("<font size=-2 color=green>- Compiled with JPSEC support</font>")
 wxT("</td>"\r
 "</tr>"\r
 "<tr>"\r
-"<td colspan=2 bgcolor=#CC3300 height=3 valign=center></td>"\r
+"<td colspan=2 bgcolor=#CC3300 height=3 valign=center></td>" \r
 "</tr>"\r
 "<tr>"\r
 "<td colspan=2>"\r
diff --git a/OPJViewer/source/build.h b/OPJViewer/source/build.h
new file mode 100644 (file)
index 0000000..d944e63
--- /dev/null
@@ -0,0 +1 @@
+wxT("20") \r
index 967bbad3033f8ccfc81f27a228aa9606e1289593..78734b17cdc53bc537555df2cdb6970bee757005 100644 (file)
        }\r
 \r
 \r
-}
\ No newline at end of file
+}\r
index e0fa2d4e384735dc2b0ad822d498db447cf12234..1cd7244faf7a3a8cda0fbe21ebaca11aede517ed 100644 (file)
@@ -130,10 +130,18 @@ void mj2_info_callback(const char *msg, void *client_data) {
 /* From little endian to big endian, 2 and 4 bytes */\r
 #define        BYTE_SWAP2(X)   ((X & 0x00FF) << 8) | ((X & 0xFF00) >> 8)\r
 #define        BYTE_SWAP4(X)   ((X & 0x000000FF) << 24) | ((X & 0x0000FF00) << 8) | ((X & 0x00FF0000) >> 8) | ((X & 0xFF000000) >> 24)\r
+\r
+#ifdef __WXGTK__\r
+#define        BYTE_SWAP8(X)   ((X & 0x00000000000000FFULL) << 56) | ((X & 0x000000000000FF00ULL) << 40) | \\r
+                        ((X & 0x0000000000FF0000ULL) << 24) | ((X & 0x00000000FF000000ULL) << 8) | \\r
+                                               ((X & 0x000000FF00000000ULL) >> 8)  | ((X & 0x0000FF0000000000ULL) >> 24) | \\r
+                                               ((X & 0x00FF000000000000ULL) >> 40) | ((X & 0xFF00000000000000ULL) >> 56)\r
+#else\r
 #define        BYTE_SWAP8(X)   ((X & 0x00000000000000FF) << 56) | ((X & 0x000000000000FF00) << 40) | \\r
                         ((X & 0x0000000000FF0000) << 24) | ((X & 0x00000000FF000000) << 8) | \\r
                                                ((X & 0x000000FF00000000) >> 8)  | ((X & 0x0000FF0000000000) >> 24) | \\r
                                                ((X & 0x00FF000000000000) >> 40) | ((X & 0xFF00000000000000) >> 56)\r
+#endif\r
 \r
 /* From codestream to int values */\r
 #define STREAM_TO_UINT32(C, P) (((unsigned long int) (C)[(P) + 0] << 24) + \\r
index 4832870f1da62acffcf7c579b81e43b8d5907066..afacd394d4477e39e1f4191e4b067e07a17142e1 100644 (file)
@@ -303,10 +303,18 @@ struct boxdef j22box[] =
 /* From little endian to big endian, 2 and 4 bytes */\r
 #define        BYTE_SWAP2(X)   ((X & 0x00FF) << 8) | ((X & 0xFF00) >> 8)\r
 #define        BYTE_SWAP4(X)   ((X & 0x000000FF) << 24) | ((X & 0x0000FF00) << 8) | ((X & 0x00FF0000) >> 8) | ((X & 0xFF000000) >> 24)\r
-#define        BYTE_SWAP8(X)   (((X & 0x00000000000000FF) << 56) | ((X & 0x000000000000FF00) << 40) | \\r
+\r
+#ifdef __WXGTK__\r
+#define        BYTE_SWAP8(X)   ((X & 0x00000000000000FFULL) << 56) | ((X & 0x000000000000FF00ULL) << 40) | \\r
+                        ((X & 0x0000000000FF0000ULL) << 24) | ((X & 0x00000000FF000000ULL) << 8) | \\r
+                                               ((X & 0x000000FF00000000ULL) >> 8)  | ((X & 0x0000FF0000000000ULL) >> 24) | \\r
+                                               ((X & 0x00FF000000000000ULL) >> 40) | ((X & 0xFF00000000000000ULL) >> 56)\r
+#else\r
+#define        BYTE_SWAP8(X)   ((X & 0x00000000000000FF) << 56) | ((X & 0x000000000000FF00) << 40) | \\r
                         ((X & 0x0000000000FF0000) << 24) | ((X & 0x00000000FF000000) << 8) | \\r
                                                ((X & 0x000000FF00000000) >> 8)  | ((X & 0x0000FF0000000000) >> 24) | \\r
-                                               ((X & 0x00FF000000000000) >> 40) | ((X & 0xFF00000000000000) >> 56))\r
+                                               ((X & 0x00FF000000000000) >> 40) | ((X & 0xFF00000000000000) >> 56)\r
+#endif\r
 \r
 /* From codestream to int values */\r
 #define STREAM_TO_UINT32(C, P) (((unsigned long int) (C)[(P) + 0] << 24) + \\r