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
This commit is contained in:
@@ -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++);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,6 +270,16 @@ bool wxJ2KHandler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose,
|
||||
*(ptr++) = (*(y)) >> shiftbpp;
|
||||
*(ptr++) = (*(y++)) >> shiftbpp;
|
||||
|
||||
}
|
||||
}
|
||||
} 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 {
|
||||
|
Reference in New Issue
Block a user