summaryrefslogtreecommitdiff
path: root/OPJViewer/source/imagmj2.cpp
diff options
context:
space:
mode:
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2007-03-01 00:01:37 +0000
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2007-03-01 00:01:37 +0000
commitba423fe3d0b501ae9166e36514c01173b0ce04be (patch)
treeac0cbc5c0fdecfdb38f7908cdab2d04734284ab7 /OPJViewer/source/imagmj2.cpp
parente2a54d9ac6fe4bff3b54bb9669ffc00996fd18a2 (diff)
Zoom capability and decoder settings dialog in OPJViewer
Diffstat (limited to 'OPJViewer/source/imagmj2.cpp')
-rw-r--r--OPJViewer/source/imagmj2.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/OPJViewer/source/imagmj2.cpp b/OPJViewer/source/imagmj2.cpp
index 65c9ca73..2a4d2e58 100644
--- a/OPJViewer/source/imagmj2.cpp
+++ b/OPJViewer/source/imagmj2.cpp
@@ -199,6 +199,7 @@ typedef enum {
#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 MJP2_SIGN "mjp2"
@@ -503,14 +504,14 @@ searchfirstjp2c(wxInputStream& stream, unsigned long int fsize)
char scansign[] = "jp2c";
unsigned long int scanpoint = 0L;
- wxLogMessage("MJ2: searching jp2c box... ");
+ wxLogMessage(wxT("MJ2: searching jp2c box... "));
/* do the parsing */
if (my_jpeg2000parse(stream, 0, fsize, 0, scansign, &scanpoint) < 0)
- wxLogMessage("MJ2: Unrecoverable error during file parsing: stopping");
+ wxLogMessage(wxT("MJ2: Unrecoverable error during file parsing: stopping"));
if (strcmp(scansign, " "))
- wxLogMessage("MJ2: not found");
+ wxLogMessage(wxT("MJ2: not found"));
else {
wxLogMessage(wxString::Format("MJ2: found at byte %d", scanpoint));
@@ -528,16 +529,16 @@ searchjpegheaderbox(wxInputStream& stream, unsigned long int fsize)
char scansign[] = "jp2h";
unsigned long int scanpoint = 0L;
- wxLogMessage("MJ2: searching jp2h box... ");
+ wxLogMessage(wxT("MJ2: searching jp2h box... "));
/* do the parsing */
if (my_jpeg2000parse(stream, 0, fsize, 0, scansign, &scanpoint) < 0)
- wxLogMessage("Unrecoverable error during file parsing: stopping");
+ wxLogMessage(wxT("Unrecoverable error during file parsing: stopping"));
if (strcmp(scansign, " "))
- wxLogMessage("MJ2: not found");
+ 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));
return (scanpoint);
}
@@ -615,6 +616,19 @@ bool wxMJ2Handler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
strncpy(parameters.outfile, "", sizeof(parameters.outfile)-1);
parameters.decod_format = JP2_CFMT;
parameters.cod_format = BMP_DFMT;
+ if (m_reducefactor)
+ parameters.cp_reduce = m_reducefactor;
+ if (m_qualitylayers)
+ parameters.cp_layer = m_qualitylayers;
+ /*if (n_components)
+ parameters. = n_components;*/
+
+ /* JPWL only */
+#ifdef USE_JPWL
+ parameters.jpwl_exp_comps = m_expcomps;
+ parameters.jpwl_max_tiles = m_maxtiles;
+ parameters.jpwl_correct = m_enablejpwl;
+#endif /* USE_JPWL */
/* get a decoder handle */
dinfo = opj_create_decompress(CODEC_JP2);
@@ -664,7 +678,7 @@ bool wxMJ2Handler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
opjimage = opj_decode(dinfo, cio);
if (!opjimage) {
wxMutexGuiEnter();
- wxLogError("MJ2: failed to decode image!");
+ wxLogError(wxT("MJ2: failed to decode image!"));
wxMutexGuiLeave();
opj_destroy_decompress(dinfo);
opj_cio_close(cio);
@@ -678,7 +692,7 @@ bool wxMJ2Handler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
// check image size
if ((opjimage->numcomps != 1) && (opjimage->numcomps != 3)) {
wxMutexGuiEnter();
- wxLogError("MJ2: weird number of components");
+ wxLogError(wxT("MJ2: weird number of components"));
wxMutexGuiLeave();
opj_destroy_decompress(dinfo);
free(src);