aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-12 00:53:34 +0200
committerJohannes Schickel2013-09-16 19:54:19 +0200
commit4809294b43e1c43957874bdfcdadfc299fd7ace4 (patch)
treea4f314e1b8011cdbc654ab7cfe2ee874350aae75 /engines
parentac66cc921904387518f2e0b2a14670e9598defe4 (diff)
downloadscummvm-rg350-4809294b43e1c43957874bdfcdadfc299fd7ace4.tar.gz
scummvm-rg350-4809294b43e1c43957874bdfcdadfc299fd7ace4.tar.bz2
scummvm-rg350-4809294b43e1c43957874bdfcdadfc299fd7ace4.zip
GRAPHICS: Make JPEGDecoder request RGB output from libjpeg by default.
This fixes loading of JPEG files which contain RGB color space instead of YUV. It is a pretty odd extension of JPEG files by Adobe which is indicated by this: http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html#Adobe To still support Groovie's need for YUV data I added some possibility to request direct YUV output.
Diffstat (limited to 'engines')
-rw-r--r--engines/groovie/roq.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index d9c682b98a..5592d848a9 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -435,17 +435,13 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
warning("Groovie::ROQ: JPEG frame (unfinished)");
Graphics::JPEGDecoder *jpg = new Graphics::JPEGDecoder();
+ jpg->setOutputColorSpace(Graphics::JPEGDecoder::kColorSpaceYUV);
jpg->loadStream(*_file);
- const byte *y = (const byte *)jpg->getYComponent().getPixels();
- const byte *u = (const byte *)jpg->getUComponent().getPixels();
- const byte *v = (const byte *)jpg->getVComponent().getPixels();
+ const Graphics::Surface *srcSurf = jpg->getSurface();
+ const byte *src = (const byte *)srcSurf->getPixels();
byte *ptr = (byte *)_currBuf->getPixels();
- for (int i = 0; i < _currBuf->w * _currBuf->h; i++) {
- *ptr++ = *y++;
- *ptr++ = *u++;
- *ptr++ = *v++;
- }
+ memcpy(ptr, src, _currBuf->w * _currBuf->h);
delete jpg;
return true;