diff options
Diffstat (limited to 'OPJViewer/source/imagj2k.cpp')
| -rw-r--r-- | OPJViewer/source/imagj2k.cpp | 26 |
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++) {
|
