diff options
| author | Giuseppe Baruffa <gbaruffa@users.noreply.github.com> | 2007-03-27 12:48:17 +0000 |
|---|---|---|
| committer | Giuseppe Baruffa <gbaruffa@users.noreply.github.com> | 2007-03-27 12:48:17 +0000 |
| commit | 3f36196dfdd740417d5dfd7d7d313dd179d4a304 (patch) | |
| tree | 43642e9862b196e034de375fbd408a0936630e2c /OPJViewer/source/imagmj2.cpp | |
| parent | f7c9b01800446213919cac9246c9bd66eb3701ad (diff) | |
Improved parsing in OPJViewer, as well some aesthetic modifications; support for image rendering with bit depths lower than 8 bits; can display an arbitrary frame of an MJ2 file (only in B/W, though); can reload a file; better image resizing capabilities
Diffstat (limited to 'OPJViewer/source/imagmj2.cpp')
| -rw-r--r-- | OPJViewer/source/imagmj2.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/OPJViewer/source/imagmj2.cpp b/OPJViewer/source/imagmj2.cpp index 2a4d2e58..1a8e1ffb 100644 --- a/OPJViewer/source/imagmj2.cpp +++ b/OPJViewer/source/imagmj2.cpp @@ -402,15 +402,15 @@ my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned lo char *scansign, unsigned long int *scanpoint)
{
unsigned long int LBox = 0x00000000;
- int LBox_read;
+ //int LBox_read;
char TBox[5] = "\0\0\0\0";
- int TBox_read;
+ //int TBox_read;
__int64 XLBox = 0x0000000000000000;
- int XLBox_read;
+ //int XLBox_read;
unsigned long int box_length = 0;
int last_box = 0, box_num = 0;
int box_type = ANY_BOX;
- unsigned char onebyte[1], twobytes[2], fourbytes[4];
+ unsigned char /*onebyte[1], twobytes[2],*/ fourbytes[4];
int box_number = 0;
/* cycle all over the file */
@@ -499,7 +499,7 @@ my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned lo // search first contiguos codestream box in an mj2 file
unsigned long int
-searchfirstjp2c(wxInputStream& stream, unsigned long int fsize)
+searchjp2c(wxInputStream& stream, unsigned long int fsize, int number)
{
char scansign[] = "jp2c";
unsigned long int scanpoint = 0L;
@@ -507,7 +507,7 @@ searchfirstjp2c(wxInputStream& stream, unsigned long int fsize) wxLogMessage(wxT("MJ2: searching jp2c box... "));
/* do the parsing */
- if (my_jpeg2000parse(stream, 0, fsize, 0, scansign, &scanpoint) < 0)
+ if (my_jpeg2000parse(stream, 0, fsize, number, scansign, &scanpoint) < 0)
wxLogMessage(wxT("MJ2: Unrecoverable error during file parsing: stopping"));
if (strcmp(scansign, " "))
@@ -638,7 +638,7 @@ bool wxMJ2Handler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose, file_length = (int) stream.TellI();
/* search for the first codestream box and the movie header box */
- jp2c_point = searchfirstjp2c(stream, file_length);
+ jp2c_point = searchjp2c(stream, file_length, m_framenum);
jp2h_point = searchjpegheaderbox(stream, file_length);
// read the jp2h box and store it
|
