summaryrefslogtreecommitdiff
path: root/OPJViewer/source/imagj2k.cpp
diff options
context:
space:
mode:
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2007-03-27 12:48:17 +0000
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2007-03-27 12:48:17 +0000
commit3f36196dfdd740417d5dfd7d7d313dd179d4a304 (patch)
tree43642e9862b196e034de375fbd408a0936630e2c /OPJViewer/source/imagj2k.cpp
parentf7c9b01800446213919cac9246c9bd66eb3701ad (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/imagj2k.cpp')
-rw-r--r--OPJViewer/source/imagj2k.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/OPJViewer/source/imagj2k.cpp b/OPJViewer/source/imagj2k.cpp
index 2442aa4e..9f972095 100644
--- a/OPJViewer/source/imagj2k.cpp
+++ b/OPJViewer/source/imagj2k.cpp
@@ -233,14 +233,26 @@ bool wxJ2KHandler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
}
}
- } else {
+
+ } else if (shiftbpp < 0) {
for (row = 0; row < opjimage->comps[0].h; row++) {
for (col = 0; col < opjimage->comps[0].w; col++) {
+ *(ptr++) = (*(r++)) << -shiftbpp;
+ *(ptr++) = (*(g++)) << -shiftbpp;
+ *(ptr++) = (*(b++)) << -shiftbpp;
+
+ }
+ }
+
+ } else {
+ for (row = 0; row < opjimage->comps[0].h; row++) {
+ for (col = 0; col < opjimage->comps[0].w; col++) {
+
*(ptr++) = *(r++);
*(ptr++) = *(g++);
*(ptr++) = *(b++);
-
+
}
}
}
@@ -260,6 +272,16 @@ bool wxJ2KHandler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
}
}
+ } else if (shiftbpp < 0) {
+ for (row = 0; row < opjimage->comps[0].h; row++) {
+ for (col = 0; col < opjimage->comps[0].w; col++) {
+
+ *(ptr++) = (*(y)) << -shiftbpp;
+ *(ptr++) = (*(y)) << -shiftbpp;
+ *(ptr++) = (*(y++)) << -shiftbpp;
+
+ }
+ }
} else {
for (row = 0; row < opjimage->comps[0].h; row++) {
for (col = 0; col < opjimage->comps[0].w; col++) {