} j2filetype;\r
\r
/* enumeration for the box types */\r
-#define J2BOXNUM 23\r
+#define j22boxNUM 23\r
typedef enum {\r
\r
FILE_BOX,\r
ANY_BOX,\r
UNK_BOX\r
\r
-} j2boxtype;\r
+} j22boxtype;\r
\r
/* the box structure itself */\r
struct boxdef {\r
char descr[LONG_DESCR_LEN]; /* long description */\r
int sbox; /* is it a superbox? */\r
int req[J2FILENUM]; /* mandatory box */\r
- j2boxtype ins; /* contained in box... */\r
+ j22boxtype ins; /* contained in box... */\r
\r
};\r
\r
+\r
+/* jp2 family box signatures */\r
+#define FILE_SIGN ""\r
+#define JP_SIGN "jP\040\040"\r
+#define FTYP_SIGN "ftyp"\r
+#define JP2H_SIGN "jp2h"\r
+#define IHDR_SIGN "ihdr"\r
+#define COLR_SIGN "colr"\r
+#define JP2C_SIGN "jp2c"\r
+#define JP2I_SIGN "jp2i"\r
+#define XML_SIGN "xml\040"\r
+#define UUID_SIGN "uuid"\r
+#define UINF_SIGN "uinf"\r
+#define MOOV_SIGN "moov"\r
+#define MVHD_SIGN "mvhd"\r
+#define TRAK_SIGN "trak"\r
+#define TKHD_SIGN "tkhd"\r
+#define MDIA_SIGN "mdia"\r
+#define MINF_SIGN "minf"\r
+#define VMHD_SIGN "vmhd"\r
+#define STBL_SIGN "stbl"\r
+#define STSD_SIGN "stsd"\r
+#define STSZ_SIGN "stsz"\r
+#define MJP2_SIGN "mjp2"\r
+#define MDAT_SIGN "mdat"\r
+#define ANY_SIGN ""\r
+#define UNK_SIGN ""\r
+\r
/* the possible boxes */\r
-struct boxdef j2box[];\r
+struct boxdef j22box[] =\r
+{\r
+/* sign */ {FILE_SIGN,\r
+/* short */ "placeholder for nothing",\r
+/* long */ "Nothing to say",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {JP_SIGN,\r
+/* short */ "JPEG 2000 Signature box",\r
+/* long */ "This box uniquely identifies the file as being part of the JPEG 2000 family of files",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {FTYP_SIGN,\r
+/* short */ "File Type box",\r
+/* long */ "This box specifies file type, version and compatibility information, including specifying if this file "\r
+ "is a conforming JP2 file or if it can be read by a conforming JP2 reader",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {JP2H_SIGN,\r
+/* short */ "JP2 Header box",\r
+/* long */ "This box contains a series of boxes that contain header-type information about the file",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {IHDR_SIGN,\r
+/* short */ "Image Header box",\r
+/* long */ "This box specifies the size of the image and other related fields",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ JP2H_BOX},\r
+\r
+/* sign */ {COLR_SIGN,\r
+/* short */ "Colour Specification box",\r
+/* long */ "This box specifies the colourspace of the image",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ JP2H_BOX},\r
+\r
+/* sign */ {JP2C_SIGN,\r
+/* short */ "Contiguous Codestream box",\r
+/* long */ "This box contains the codestream as defined by Annex A",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {JP2I_SIGN,\r
+/* short */ "Intellectual Property box",\r
+/* long */ "This box contains intellectual property information about the image",\r
+/* sbox */ 0,\r
+/* req */ {0, 0, 0},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {XML_SIGN,\r
+/* short */ "XML box",\r
+/* long */ "This box provides a tool by which vendors can add XML formatted information to a JP2 file",\r
+/* sbox */ 0,\r
+/* req */ {0, 0, 0},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {UUID_SIGN,\r
+/* short */ "UUID box",\r
+/* long */ "This box provides a tool by which vendors can add additional information to a file "\r
+ "without risking conflict with other vendors",\r
+/* sbox */ 0,\r
+/* req */ {0, 0, 0},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {UINF_SIGN,\r
+/* short */ "UUID Info box",\r
+/* long */ "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",\r
+/* sbox */ 0,\r
+/* req */ {0, 0, 0},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {MOOV_SIGN,\r
+/* short */ "Movie box",\r
+/* long */ "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {MVHD_SIGN,\r
+/* short */ "Movie Header box",\r
+/* long */ "This box defines overall information which is media-independent, and relevant to the entire presentation "\r
+ "considered as a whole",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MOOV_BOX},\r
+\r
+/* sign */ {TRAK_SIGN,\r
+/* short */ "Track box",\r
+/* long */ "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MOOV_BOX},\r
+\r
+/* sign */ {TKHD_SIGN,\r
+/* short */ "Track Header box",\r
+/* long */ "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ TRAK_BOX},\r
+\r
+/* sign */ {MDIA_SIGN,\r
+/* short */ "Media box",\r
+/* long */ "The media declaration container contains all the objects which declare information about the media data "\r
+ "within a track",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ TRAK_BOX},\r
+\r
+/* sign */ {MINF_SIGN,\r
+/* short */ "Media Information box",\r
+/* long */ "This box contains all the objects which declare characteristic information of the media in the track",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MDIA_BOX},\r
+\r
+/* sign */ {VMHD_SIGN,\r
+/* short */ "Video Media Header box",\r
+/* long */ "The video media header contains general presentation information, independent of the coding, for video media",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MINF_BOX},\r
+\r
+/* sign */ {STBL_SIGN,\r
+/* short */ "Sample Table box",\r
+/* long */ "The sample table contains all the time and data indexing of the media samples in a track",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MINF_BOX},\r
+\r
+/* sign */ {STSD_SIGN,\r
+/* short */ "STSD Sample Description box",\r
+/* long */ "The sample description table gives detailed information about the coding type used, and any initialization "\r
+ "information needed for that coding",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MINF_BOX},\r
+\r
+/* sign */ {STSZ_SIGN,\r
+/* short */ "Sample Size box",\r
+/* long */ "This box contains the sample count and a table giving the size of each sample",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ STBL_BOX},\r
+\r
+/* sign */ {MJP2_SIGN,\r
+/* short */ "MJP2 Sample Description box",\r
+/* long */ "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "\r
+ "information needed for that coding",\r
+/* sbox */ 0,\r
+/* req */ {1, 1, 1},\r
+/* ins */ MINF_BOX},\r
+\r
+/* sign */ {MDAT_SIGN,\r
+/* short */ "Media Data box",\r
+/* long */ "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",\r
+/* sbox */ 1,\r
+/* req */ {1, 1, 1},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {ANY_SIGN,\r
+/* short */ "Any box",\r
+/* long */ "All the existing boxes",\r
+/* sbox */ 0,\r
+/* req */ {0, 0, 0},\r
+/* ins */ FILE_BOX},\r
+\r
+/* sign */ {UNK_SIGN,\r
+/* short */ "Unknown Type box",\r
+/* long */ "The signature is not recognised to be that of an existing box",\r
+/* sbox */ 0,\r
+/* req */ {0, 0, 0},\r
+/* ins */ ANY_BOX}\r
+\r
+};\r
+\r
\r
/* macro functions */\r
/* From little endian to big endian, 2 and 4 bytes */\r
int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,\r
wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint)\r
{\r
- switch ((j2boxtype) boxtype) {\r
+ switch ((j22boxtype) boxtype) {\r
\r
\r
/* JPEG 2000 Signature box */\r
\r
if (METH != 1)\r
currid = m_tree->AppendItem(parentid,\r
- wxString::Format("ICC profile: there is one"),\r
+ wxString::Format(wxT("ICC profile: there is one")),\r
m_tree->TreeCtrlIcon_File, m_tree->TreeCtrlIcon_File + 1,\r
new OPJMarkerData(wxT("INFO"))\r
);\r
return (0);\r
}\r
\r
-/* jp2 family box signatures */\r
-#define FILE_SIGN ""\r
-#define JP_SIGN "jP\040\040"\r
-#define FTYP_SIGN "ftyp"\r
-#define JP2H_SIGN "jp2h"\r
-#define IHDR_SIGN "ihdr"\r
-#define COLR_SIGN "colr"\r
-#define JP2C_SIGN "jp2c"\r
-#define JP2I_SIGN "jp2i"\r
-#define XML_SIGN "xml\040"\r
-#define UUID_SIGN "uuid"\r
-#define UINF_SIGN "uinf"\r
-#define MOOV_SIGN "moov"\r
-#define MVHD_SIGN "mvhd"\r
-#define TRAK_SIGN "trak"\r
-#define TKHD_SIGN "tkhd"\r
-#define MDIA_SIGN "mdia"\r
-#define MINF_SIGN "minf"\r
-#define VMHD_SIGN "vmhd"\r
-#define STBL_SIGN "stbl"\r
-#define STSD_SIGN "stsd"\r
-#define STSZ_SIGN "stsz"\r
-#define MJP2_SIGN "mjp2"\r
-#define MDAT_SIGN "mdat"\r
-#define ANY_SIGN ""\r
-#define UNK_SIGN ""\r
-\r
-/* the possible boxes */\r
-struct boxdef j2box[] =\r
-{\r
-/* sign */ {FILE_SIGN,\r
-/* short */ "placeholder for nothing",\r
-/* long */ "Nothing to say",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {JP_SIGN,\r
-/* short */ "JPEG 2000 Signature box",\r
-/* long */ "This box uniquely identifies the file as being part of the JPEG 2000 family of files",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {FTYP_SIGN,\r
-/* short */ "File Type box",\r
-/* long */ "This box specifies file type, version and compatibility information, including specifying if this file "\r
- "is a conforming JP2 file or if it can be read by a conforming JP2 reader",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {JP2H_SIGN,\r
-/* short */ "JP2 Header box",\r
-/* long */ "This box contains a series of boxes that contain header-type information about the file",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {IHDR_SIGN,\r
-/* short */ "Image Header box",\r
-/* long */ "This box specifies the size of the image and other related fields",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ JP2H_BOX},\r
-\r
-/* sign */ {COLR_SIGN,\r
-/* short */ "Colour Specification box",\r
-/* long */ "This box specifies the colourspace of the image",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ JP2H_BOX},\r
-\r
-/* sign */ {JP2C_SIGN,\r
-/* short */ "Contiguous Codestream box",\r
-/* long */ "This box contains the codestream as defined by Annex A",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {JP2I_SIGN,\r
-/* short */ "Intellectual Property box",\r
-/* long */ "This box contains intellectual property information about the image",\r
-/* sbox */ 0,\r
-/* req */ {0, 0, 0},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {XML_SIGN,\r
-/* short */ "XML box",\r
-/* long */ "This box provides a tool by which vendors can add XML formatted information to a JP2 file",\r
-/* sbox */ 0,\r
-/* req */ {0, 0, 0},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {UUID_SIGN,\r
-/* short */ "UUID box",\r
-/* long */ "This box provides a tool by which vendors can add additional information to a file "\r
- "without risking conflict with other vendors",\r
-/* sbox */ 0,\r
-/* req */ {0, 0, 0},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {UINF_SIGN,\r
-/* short */ "UUID Info box",\r
-/* long */ "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",\r
-/* sbox */ 0,\r
-/* req */ {0, 0, 0},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {MOOV_SIGN,\r
-/* short */ "Movie box",\r
-/* long */ "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {MVHD_SIGN,\r
-/* short */ "Movie Header box",\r
-/* long */ "This box defines overall information which is media-independent, and relevant to the entire presentation "\r
- "considered as a whole",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MOOV_BOX},\r
-\r
-/* sign */ {TRAK_SIGN,\r
-/* short */ "Track box",\r
-/* long */ "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MOOV_BOX},\r
-\r
-/* sign */ {TKHD_SIGN,\r
-/* short */ "Track Header box",\r
-/* long */ "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ TRAK_BOX},\r
-\r
-/* sign */ {MDIA_SIGN,\r
-/* short */ "Media box",\r
-/* long */ "The media declaration container contains all the objects which declare information about the media data "\r
- "within a track",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ TRAK_BOX},\r
-\r
-/* sign */ {MINF_SIGN,\r
-/* short */ "Media Information box",\r
-/* long */ "This box contains all the objects which declare characteristic information of the media in the track",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MDIA_BOX},\r
-\r
-/* sign */ {VMHD_SIGN,\r
-/* short */ "Video Media Header box",\r
-/* long */ "The video media header contains general presentation information, independent of the coding, for video media",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MINF_BOX},\r
-\r
-/* sign */ {STBL_SIGN,\r
-/* short */ "Sample Table box",\r
-/* long */ "The sample table contains all the time and data indexing of the media samples in a track",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MINF_BOX},\r
-\r
-/* sign */ {STSD_SIGN,\r
-/* short */ "STSD Sample Description box",\r
-/* long */ "The sample description table gives detailed information about the coding type used, and any initialization "\r
- "information needed for that coding",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MINF_BOX},\r
-\r
-/* sign */ {STSZ_SIGN,\r
-/* short */ "Sample Size box",\r
-/* long */ "This box contains the sample count and a table giving the size of each sample",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ STBL_BOX},\r
-\r
-/* sign */ {MJP2_SIGN,\r
-/* short */ "MJP2 Sample Description box",\r
-/* long */ "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "\r
- "information needed for that coding",\r
-/* sbox */ 0,\r
-/* req */ {1, 1, 1},\r
-/* ins */ MINF_BOX},\r
-\r
-/* sign */ {MDAT_SIGN,\r
-/* short */ "Media Data box",\r
-/* long */ "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",\r
-/* sbox */ 1,\r
-/* req */ {1, 1, 1},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {ANY_SIGN,\r
-/* short */ "Any box",\r
-/* long */ "All the existing boxes",\r
-/* sbox */ 0,\r
-/* req */ {0, 0, 0},\r
-/* ins */ FILE_BOX},\r
-\r
-/* sign */ {UNK_SIGN,\r
-/* short */ "Unknown Type box",\r
-/* long */ "The signature is not recognised to be that of an existing box",\r
-/* sbox */ 0,\r
-/* req */ {0, 0, 0},\r
-/* ins */ ANY_BOX}\r
-\r
-};\r
\r
void OPJParseThread::ParseJP2File(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit, wxTreeItemId parentid)\r
{\r
\r
/* determine the box type */\r
for (box_type = JP_BOX; box_type < UNK_BOX; box_type++)\r
- if (memcmp(TBox, j2box[box_type].value, 4) == 0)\r
+ if (memcmp(TBox, j22box[box_type].value, 4) == 0)\r
break; \r
\r
/* read the optional XLBox, 8 bytes */\r
\r
// box name\r
wxTreeItemId subcurrid1 = m_tree->AppendItem(currid,\r
- wxT("*** ") + wxString(j2box[box_type].name) + wxT(" ***"),\r
+ wxT("*** ") + wxString::Format(wxT("%s"), j22box[box_type].name) + wxT(" ***"),\r
image, imageSel,\r
new OPJMarkerData(wxT("INFO"))\r
);\r
currid, level, scansign, scanpoint);\r
\r
/* if it's a superbox go inside it */\r
- if (j2box[box_type].sbox)\r
+ if (j22box[box_type].sbox)\r
jpeg2000parse(fileid, (LBox == 1) ? (filepoint + 16) : (filepoint + 8), filepoint + box_length,\r
currid, level + 1, scansign, scanpoint);\r
\r