diff options
author | Matthew Hoops | 2014-02-27 21:27:23 -0500 |
---|---|---|
committer | Matthew Hoops | 2014-02-28 00:27:36 -0500 |
commit | c432b96cf667a1b7f1386cc4c97fcf5411690f7d (patch) | |
tree | d4cdab5ce30eb4c014b5445a8895059da7ef8cf3 /image/jpeg.cpp | |
parent | b568ac73b9d2e063eb04693e4610a9932035b696 (diff) | |
download | scummvm-rg350-c432b96cf667a1b7f1386cc4c97fcf5411690f7d.tar.gz scummvm-rg350-c432b96cf667a1b7f1386cc4c97fcf5411690f7d.tar.bz2 scummvm-rg350-c432b96cf667a1b7f1386cc4c97fcf5411690f7d.zip |
IMAGE: Merge the JPEG codec into the ImageDecoder
Diffstat (limited to 'image/jpeg.cpp')
-rw-r--r-- | image/jpeg.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/image/jpeg.cpp b/image/jpeg.cpp index 9d4b0a7cfe..3602d501be 100644 --- a/image/jpeg.cpp +++ b/image/jpeg.cpp @@ -44,7 +44,7 @@ extern "C" { namespace Image { -JPEGDecoder::JPEGDecoder() : ImageDecoder(), _surface(), _colorSpace(kColorSpaceRGBA) { +JPEGDecoder::JPEGDecoder() : _surface(), _colorSpace(kColorSpaceRGBA) { } JPEGDecoder::~JPEGDecoder() { @@ -59,6 +59,17 @@ void JPEGDecoder::destroy() { _surface.free(); } +const Graphics::Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream *stream) { + if (!loadStream(*stream)) + return 0; + + return getSurface(); +} + +Graphics::PixelFormat JPEGDecoder::getPixelFormat() const { + return _surface.format; +} + #ifdef USE_JPEG namespace { |