Some coding style adaptations for compiling the OPJViewer GUI under Linux. It compiles, but does not yet display images.
This commit is contained in:
parent
5a3c1ffe7d
commit
a1fe5809a4
|
@ -136,8 +136,9 @@ bool OPJViewerApp::OnInit(void)
|
|||
|
||||
wxChar **wxArgv = new wxChar *[argc + 1];
|
||||
|
||||
for (int n = 0; n < argc; n++ ) {
|
||||
wxMB2WXbuf warg = wxConvertMB2WX(argv[n]);
|
||||
int n;
|
||||
for (n = 0; n < argc; n++ ) {
|
||||
wxMB2WXbuf warg = wxConvertMB2WX((char *) argv[n]);
|
||||
wxArgv[n] = wxStrdup(warg);
|
||||
}
|
||||
|
||||
|
@ -570,7 +571,7 @@ void OPJFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|||
wxHtmlWindow *html;
|
||||
wxDialog dlg(this, wxID_ANY, wxString(_("About")));
|
||||
|
||||
wxMemoryFSHandler::AddFile("opj_logo.xpm", wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);
|
||||
wxMemoryFSHandler::AddFile(wxT("opj_logo.xpm"), wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);
|
||||
|
||||
topsizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
@ -1304,7 +1305,7 @@ void OPJMarkerTree::OnItemExpanding(wxTreeEvent& event)
|
|||
else
|
||||
text = wxT("invalid item");
|
||||
|
||||
if (strcmp(data->GetDesc1(), wxT("INFO-CSTREAM")))
|
||||
if (wxStrcmp(data->GetDesc1(), wxT("INFO-CSTREAM")))
|
||||
return;
|
||||
|
||||
wxLogMessage(wxT("Expanding... (%s -> %s, %s, %d, %d)"),
|
||||
|
@ -1364,7 +1365,7 @@ void OPJMarkerTree::OnSelChanged(wxTreeEvent& event)
|
|||
text << wxT(" ");
|
||||
|
||||
if (pos < max_read) {
|
||||
text << wxString::Format(wxT("%02X "), wxT(buffer[pos]));
|
||||
text << wxString::Format(wxT("%02X "), buffer[pos]);
|
||||
} else
|
||||
text << wxT(" ");
|
||||
pos++;
|
||||
|
|
|
@ -96,8 +96,9 @@
|
|||
#include "wx/statline.h"
|
||||
#include <wx/fs_mem.h>
|
||||
|
||||
#include <wx/imaglist.h>
|
||||
|
||||
#include "libopenjpeg\openjpeg.h"
|
||||
#include "libopenjpeg/openjpeg.h"
|
||||
|
||||
#include "imagj2k.h"
|
||||
#include "imagjp2.h"
|
||||
|
|
|
@ -30,16 +30,15 @@ wxT("<font size=-2 color=green>- Compiled with JPWL support</font><br>")
|
|||
#ifdef USE_JPSEC
|
||||
wxT("<font size=-2 color=green>- Compiled with JPSEC support</font>")
|
||||
#endif // USE_JPSEC
|
||||
wxT(
|
||||
"</td>"
|
||||
wxT("</td>"
|
||||
"</tr>"
|
||||
"<tr>"
|
||||
"<td colspan=2 bgcolor=#CC3300 height=3 valign=center></td>"
|
||||
"</tr>"
|
||||
"<tr>"
|
||||
"<td colspan=2>"
|
||||
"<font size=-2 color=#444444>OpenJPEG is © 2002-2007 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Université Catholique de Louvain</a></font><br>"
|
||||
"<font size=-2 color=#444444>OPJViewer is also © 2007 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universitŕ degli studi di Perugia</a></font>"
|
||||
"<font size=-2 color=#444444>OpenJPEG is © 2002-2007 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universite' Catholique de Louvain</a></font><br>"
|
||||
"<font size=-2 color=#444444>OPJViewer is also © 2007 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universita' degli studi di Perugia</a></font>"
|
||||
"</td>"
|
||||
"</tr>"
|
||||
"</table>"
|
||||
|
|
|
@ -82,35 +82,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxJ2KHandler,wxImageHandler)
|
|||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void j2k_error_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[ERROR] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
/* sample warning callback expecting a FILE* client object */
|
||||
void j2k_warning_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[WARNING] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
/* sample debug callback expecting no client object */
|
||||
void j2k_info_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[INFO] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
|
||||
|
|
|
@ -86,35 +86,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxJP2Handler,wxImageHandler)
|
|||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void jp2_error_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[ERROR] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
/* sample warning callback expecting a FILE* client object */
|
||||
void jp2_warning_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[WARNING] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
/* sample debug callback expecting no client object */
|
||||
void jp2_info_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[INFO] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
|
||||
|
|
|
@ -86,35 +86,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxMJ2Handler,wxImageHandler)
|
|||
|
||||
/* sample error callback expecting a FILE* client object */
|
||||
void mj2_error_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[ERROR] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
/* sample warning callback expecting a FILE* client object */
|
||||
void mj2_warning_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[WARNING] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
/* sample debug callback expecting no client object */
|
||||
void mj2_info_callback(const char *msg, void *client_data) {
|
||||
char m_msg[MAX_MESSAGE_LEN];
|
||||
int message_len = strlen(msg) - 1;
|
||||
if (msg[message_len] != '\n')
|
||||
message_len = MAX_MESSAGE_LEN;
|
||||
sprintf(m_msg, "[INFO] %.*s", message_len, msg);
|
||||
wxMutexGuiEnter();
|
||||
wxLogMessage(m_msg);
|
||||
wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
|
||||
wxMutexGuiLeave();
|
||||
}
|
||||
|
||||
|
@ -396,6 +390,14 @@ int
|
|||
my_box_handler_function(my_j2boxtype boxtype, wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
|
||||
char *scansign, unsigned long int *scanpoint);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
typedef unsigned __int64 int8byte;
|
||||
#endif // __WXMSW__
|
||||
|
||||
#ifdef __WXGTK__
|
||||
typedef unsigned long long int8byte;
|
||||
#endif // __WXGTK__
|
||||
|
||||
/* internal mini-search for a box signature */
|
||||
int
|
||||
my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
|
||||
|
@ -405,7 +407,7 @@ my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned lo
|
|||
//int LBox_read;
|
||||
char TBox[5] = "\0\0\0\0";
|
||||
//int TBox_read;
|
||||
__int64 XLBox = 0x0000000000000000;
|
||||
int8byte XLBox = 0x0000000000000000;
|
||||
//int XLBox_read;
|
||||
unsigned long int box_length = 0;
|
||||
int last_box = 0, box_num = 0;
|
||||
|
@ -514,7 +516,7 @@ searchjp2c(wxInputStream& stream, unsigned long int fsize, int number)
|
|||
wxLogMessage(wxT("MJ2: not found"));
|
||||
else {
|
||||
|
||||
wxLogMessage(wxString::Format("MJ2: found at byte %d", scanpoint));
|
||||
wxLogMessage(wxString::Format(wxT("MJ2: found at byte %d"), scanpoint));
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -554,6 +554,8 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
|
|||
/////////
|
||||
case SIZ_VAL:
|
||||
{
|
||||
int c;
|
||||
|
||||
if (m_file->Read(twobytes, 2) != 2)
|
||||
break;
|
||||
unsigned short int rsiz = STREAM_TO_UINT16(twobytes, 0);
|
||||
|
@ -603,7 +605,7 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
|
|||
unsigned char *xrsiz = new unsigned char(csiz);
|
||||
unsigned char *yrsiz = new unsigned char(csiz);
|
||||
|
||||
for (int c = 0; c < csiz; c++) {
|
||||
for (c = 0; c < csiz; c++) {
|
||||
|
||||
if (m_file->Read(&ssiz[c], 1) != 1)
|
||||
break;
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef enum {
|
|||
} j2filetype;
|
||||
|
||||
/* enumeration for the box types */
|
||||
#define J2BOXNUM 23
|
||||
#define j22boxNUM 23
|
||||
typedef enum {
|
||||
|
||||
FILE_BOX,
|
||||
|
@ -70,7 +70,7 @@ typedef enum {
|
|||
ANY_BOX,
|
||||
UNK_BOX
|
||||
|
||||
} j2boxtype;
|
||||
} j22boxtype;
|
||||
|
||||
/* the box structure itself */
|
||||
struct boxdef {
|
||||
|
@ -80,12 +80,224 @@ struct boxdef {
|
|||
char descr[LONG_DESCR_LEN]; /* long description */
|
||||
int sbox; /* is it a superbox? */
|
||||
int req[J2FILENUM]; /* mandatory box */
|
||||
j2boxtype ins; /* contained in box... */
|
||||
j22boxtype ins; /* contained in box... */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* jp2 family box signatures */
|
||||
#define FILE_SIGN ""
|
||||
#define JP_SIGN "jP\040\040"
|
||||
#define FTYP_SIGN "ftyp"
|
||||
#define JP2H_SIGN "jp2h"
|
||||
#define IHDR_SIGN "ihdr"
|
||||
#define COLR_SIGN "colr"
|
||||
#define JP2C_SIGN "jp2c"
|
||||
#define JP2I_SIGN "jp2i"
|
||||
#define XML_SIGN "xml\040"
|
||||
#define UUID_SIGN "uuid"
|
||||
#define UINF_SIGN "uinf"
|
||||
#define MOOV_SIGN "moov"
|
||||
#define MVHD_SIGN "mvhd"
|
||||
#define TRAK_SIGN "trak"
|
||||
#define TKHD_SIGN "tkhd"
|
||||
#define MDIA_SIGN "mdia"
|
||||
#define MINF_SIGN "minf"
|
||||
#define VMHD_SIGN "vmhd"
|
||||
#define STBL_SIGN "stbl"
|
||||
#define STSD_SIGN "stsd"
|
||||
#define STSZ_SIGN "stsz"
|
||||
#define MJP2_SIGN "mjp2"
|
||||
#define MDAT_SIGN "mdat"
|
||||
#define ANY_SIGN ""
|
||||
#define UNK_SIGN ""
|
||||
|
||||
/* the possible boxes */
|
||||
struct boxdef j2box[];
|
||||
struct boxdef j22box[] =
|
||||
{
|
||||
/* sign */ {FILE_SIGN,
|
||||
/* short */ "placeholder for nothing",
|
||||
/* long */ "Nothing to say",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP_SIGN,
|
||||
/* short */ "JPEG 2000 Signature box",
|
||||
/* long */ "This box uniquely identifies the file as being part of the JPEG 2000 family of files",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {FTYP_SIGN,
|
||||
/* short */ "File Type box",
|
||||
/* long */ "This box specifies file type, version and compatibility information, including specifying if this file "
|
||||
"is a conforming JP2 file or if it can be read by a conforming JP2 reader",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP2H_SIGN,
|
||||
/* short */ "JP2 Header box",
|
||||
/* long */ "This box contains a series of boxes that contain header-type information about the file",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {IHDR_SIGN,
|
||||
/* short */ "Image Header box",
|
||||
/* long */ "This box specifies the size of the image and other related fields",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ JP2H_BOX},
|
||||
|
||||
/* sign */ {COLR_SIGN,
|
||||
/* short */ "Colour Specification box",
|
||||
/* long */ "This box specifies the colourspace of the image",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ JP2H_BOX},
|
||||
|
||||
/* sign */ {JP2C_SIGN,
|
||||
/* short */ "Contiguous Codestream box",
|
||||
/* long */ "This box contains the codestream as defined by Annex A",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP2I_SIGN,
|
||||
/* short */ "Intellectual Property box",
|
||||
/* long */ "This box contains intellectual property information about the image",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {XML_SIGN,
|
||||
/* short */ "XML box",
|
||||
/* long */ "This box provides a tool by which vendors can add XML formatted information to a JP2 file",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UUID_SIGN,
|
||||
/* short */ "UUID box",
|
||||
/* long */ "This box provides a tool by which vendors can add additional information to a file "
|
||||
"without risking conflict with other vendors",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UINF_SIGN,
|
||||
/* short */ "UUID Info box",
|
||||
/* long */ "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {MOOV_SIGN,
|
||||
/* short */ "Movie box",
|
||||
/* long */ "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {MVHD_SIGN,
|
||||
/* short */ "Movie Header box",
|
||||
/* long */ "This box defines overall information which is media-independent, and relevant to the entire presentation "
|
||||
"considered as a whole",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MOOV_BOX},
|
||||
|
||||
/* sign */ {TRAK_SIGN,
|
||||
/* short */ "Track box",
|
||||
/* long */ "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MOOV_BOX},
|
||||
|
||||
/* sign */ {TKHD_SIGN,
|
||||
/* short */ "Track Header box",
|
||||
/* long */ "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ TRAK_BOX},
|
||||
|
||||
/* sign */ {MDIA_SIGN,
|
||||
/* short */ "Media box",
|
||||
/* long */ "The media declaration container contains all the objects which declare information about the media data "
|
||||
"within a track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ TRAK_BOX},
|
||||
|
||||
/* sign */ {MINF_SIGN,
|
||||
/* short */ "Media Information box",
|
||||
/* long */ "This box contains all the objects which declare characteristic information of the media in the track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MDIA_BOX},
|
||||
|
||||
/* sign */ {VMHD_SIGN,
|
||||
/* short */ "Video Media Header box",
|
||||
/* long */ "The video media header contains general presentation information, independent of the coding, for video media",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STBL_SIGN,
|
||||
/* short */ "Sample Table box",
|
||||
/* long */ "The sample table contains all the time and data indexing of the media samples in a track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STSD_SIGN,
|
||||
/* short */ "STSD Sample Description box",
|
||||
/* long */ "The sample description table gives detailed information about the coding type used, and any initialization "
|
||||
"information needed for that coding",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STSZ_SIGN,
|
||||
/* short */ "Sample Size box",
|
||||
/* long */ "This box contains the sample count and a table giving the size of each sample",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ STBL_BOX},
|
||||
|
||||
/* sign */ {MJP2_SIGN,
|
||||
/* short */ "MJP2 Sample Description box",
|
||||
/* long */ "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "
|
||||
"information needed for that coding",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {MDAT_SIGN,
|
||||
/* short */ "Media Data box",
|
||||
/* long */ "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {ANY_SIGN,
|
||||
/* short */ "Any box",
|
||||
/* long */ "All the existing boxes",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UNK_SIGN,
|
||||
/* short */ "Unknown Type box",
|
||||
/* long */ "The signature is not recognised to be that of an existing box",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ ANY_BOX}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* macro functions */
|
||||
/* From little endian to big endian, 2 and 4 bytes */
|
||||
|
@ -131,7 +343,7 @@ void indprint(wxString printout, int level)
|
|||
int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,
|
||||
wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint)
|
||||
{
|
||||
switch ((j2boxtype) boxtype) {
|
||||
switch ((j22boxtype) boxtype) {
|
||||
|
||||
|
||||
/* JPEG 2000 Signature box */
|
||||
|
@ -325,7 +537,7 @@ int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffs
|
|||
|
||||
if (METH != 1)
|
||||
currid = m_tree->AppendItem(parentid,
|
||||
wxString::Format("ICC profile: there is one"),
|
||||
wxString::Format(wxT("ICC profile: there is one")),
|
||||
m_tree->TreeCtrlIcon_File, m_tree->TreeCtrlIcon_File + 1,
|
||||
new OPJMarkerData(wxT("INFO"))
|
||||
);
|
||||
|
@ -611,218 +823,6 @@ int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffs
|
|||
return (0);
|
||||
}
|
||||
|
||||
/* jp2 family box signatures */
|
||||
#define FILE_SIGN ""
|
||||
#define JP_SIGN "jP\040\040"
|
||||
#define FTYP_SIGN "ftyp"
|
||||
#define JP2H_SIGN "jp2h"
|
||||
#define IHDR_SIGN "ihdr"
|
||||
#define COLR_SIGN "colr"
|
||||
#define JP2C_SIGN "jp2c"
|
||||
#define JP2I_SIGN "jp2i"
|
||||
#define XML_SIGN "xml\040"
|
||||
#define UUID_SIGN "uuid"
|
||||
#define UINF_SIGN "uinf"
|
||||
#define MOOV_SIGN "moov"
|
||||
#define MVHD_SIGN "mvhd"
|
||||
#define TRAK_SIGN "trak"
|
||||
#define TKHD_SIGN "tkhd"
|
||||
#define MDIA_SIGN "mdia"
|
||||
#define MINF_SIGN "minf"
|
||||
#define VMHD_SIGN "vmhd"
|
||||
#define STBL_SIGN "stbl"
|
||||
#define STSD_SIGN "stsd"
|
||||
#define STSZ_SIGN "stsz"
|
||||
#define MJP2_SIGN "mjp2"
|
||||
#define MDAT_SIGN "mdat"
|
||||
#define ANY_SIGN ""
|
||||
#define UNK_SIGN ""
|
||||
|
||||
/* the possible boxes */
|
||||
struct boxdef j2box[] =
|
||||
{
|
||||
/* sign */ {FILE_SIGN,
|
||||
/* short */ "placeholder for nothing",
|
||||
/* long */ "Nothing to say",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP_SIGN,
|
||||
/* short */ "JPEG 2000 Signature box",
|
||||
/* long */ "This box uniquely identifies the file as being part of the JPEG 2000 family of files",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {FTYP_SIGN,
|
||||
/* short */ "File Type box",
|
||||
/* long */ "This box specifies file type, version and compatibility information, including specifying if this file "
|
||||
"is a conforming JP2 file or if it can be read by a conforming JP2 reader",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP2H_SIGN,
|
||||
/* short */ "JP2 Header box",
|
||||
/* long */ "This box contains a series of boxes that contain header-type information about the file",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {IHDR_SIGN,
|
||||
/* short */ "Image Header box",
|
||||
/* long */ "This box specifies the size of the image and other related fields",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ JP2H_BOX},
|
||||
|
||||
/* sign */ {COLR_SIGN,
|
||||
/* short */ "Colour Specification box",
|
||||
/* long */ "This box specifies the colourspace of the image",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ JP2H_BOX},
|
||||
|
||||
/* sign */ {JP2C_SIGN,
|
||||
/* short */ "Contiguous Codestream box",
|
||||
/* long */ "This box contains the codestream as defined by Annex A",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {JP2I_SIGN,
|
||||
/* short */ "Intellectual Property box",
|
||||
/* long */ "This box contains intellectual property information about the image",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {XML_SIGN,
|
||||
/* short */ "XML box",
|
||||
/* long */ "This box provides a tool by which vendors can add XML formatted information to a JP2 file",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UUID_SIGN,
|
||||
/* short */ "UUID box",
|
||||
/* long */ "This box provides a tool by which vendors can add additional information to a file "
|
||||
"without risking conflict with other vendors",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UINF_SIGN,
|
||||
/* short */ "UUID Info box",
|
||||
/* long */ "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {MOOV_SIGN,
|
||||
/* short */ "Movie box",
|
||||
/* long */ "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {MVHD_SIGN,
|
||||
/* short */ "Movie Header box",
|
||||
/* long */ "This box defines overall information which is media-independent, and relevant to the entire presentation "
|
||||
"considered as a whole",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MOOV_BOX},
|
||||
|
||||
/* sign */ {TRAK_SIGN,
|
||||
/* short */ "Track box",
|
||||
/* long */ "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MOOV_BOX},
|
||||
|
||||
/* sign */ {TKHD_SIGN,
|
||||
/* short */ "Track Header box",
|
||||
/* long */ "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ TRAK_BOX},
|
||||
|
||||
/* sign */ {MDIA_SIGN,
|
||||
/* short */ "Media box",
|
||||
/* long */ "The media declaration container contains all the objects which declare information about the media data "
|
||||
"within a track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ TRAK_BOX},
|
||||
|
||||
/* sign */ {MINF_SIGN,
|
||||
/* short */ "Media Information box",
|
||||
/* long */ "This box contains all the objects which declare characteristic information of the media in the track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MDIA_BOX},
|
||||
|
||||
/* sign */ {VMHD_SIGN,
|
||||
/* short */ "Video Media Header box",
|
||||
/* long */ "The video media header contains general presentation information, independent of the coding, for video media",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STBL_SIGN,
|
||||
/* short */ "Sample Table box",
|
||||
/* long */ "The sample table contains all the time and data indexing of the media samples in a track",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STSD_SIGN,
|
||||
/* short */ "STSD Sample Description box",
|
||||
/* long */ "The sample description table gives detailed information about the coding type used, and any initialization "
|
||||
"information needed for that coding",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {STSZ_SIGN,
|
||||
/* short */ "Sample Size box",
|
||||
/* long */ "This box contains the sample count and a table giving the size of each sample",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ STBL_BOX},
|
||||
|
||||
/* sign */ {MJP2_SIGN,
|
||||
/* short */ "MJP2 Sample Description box",
|
||||
/* long */ "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "
|
||||
"information needed for that coding",
|
||||
/* sbox */ 0,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ MINF_BOX},
|
||||
|
||||
/* sign */ {MDAT_SIGN,
|
||||
/* short */ "Media Data box",
|
||||
/* long */ "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",
|
||||
/* sbox */ 1,
|
||||
/* req */ {1, 1, 1},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {ANY_SIGN,
|
||||
/* short */ "Any box",
|
||||
/* long */ "All the existing boxes",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ FILE_BOX},
|
||||
|
||||
/* sign */ {UNK_SIGN,
|
||||
/* short */ "Unknown Type box",
|
||||
/* long */ "The signature is not recognised to be that of an existing box",
|
||||
/* sbox */ 0,
|
||||
/* req */ {0, 0, 0},
|
||||
/* ins */ ANY_BOX}
|
||||
|
||||
};
|
||||
|
||||
void OPJParseThread::ParseJP2File(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit, wxTreeItemId parentid)
|
||||
{
|
||||
|
@ -893,7 +893,7 @@ int OPJParseThread::jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFile
|
|||
|
||||
/* determine the box type */
|
||||
for (box_type = JP_BOX; box_type < UNK_BOX; box_type++)
|
||||
if (memcmp(TBox, j2box[box_type].value, 4) == 0)
|
||||
if (memcmp(TBox, j22box[box_type].value, 4) == 0)
|
||||
break;
|
||||
|
||||
/* read the optional XLBox, 8 bytes */
|
||||
|
@ -936,7 +936,7 @@ int OPJParseThread::jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFile
|
|||
|
||||
// box name
|
||||
wxTreeItemId subcurrid1 = m_tree->AppendItem(currid,
|
||||
wxT("*** ") + wxString(j2box[box_type].name) + wxT(" ***"),
|
||||
wxT("*** ") + wxString::Format(wxT("%s"), j22box[box_type].name) + wxT(" ***"),
|
||||
image, imageSel,
|
||||
new OPJMarkerData(wxT("INFO"))
|
||||
);
|
||||
|
@ -955,7 +955,7 @@ int OPJParseThread::jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFile
|
|||
currid, level, scansign, scanpoint);
|
||||
|
||||
/* if it's a superbox go inside it */
|
||||
if (j2box[box_type].sbox)
|
||||
if (j22box[box_type].sbox)
|
||||
jpeg2000parse(fileid, (LBox == 1) ? (filepoint + 16) : (filepoint + 8), filepoint + box_length,
|
||||
currid, level + 1, scansign, scanpoint);
|
||||
|
||||
|
|
Loading…
Reference in New Issue