From c432b96cf667a1b7f1386cc4c97fcf5411690f7d Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 27 Feb 2014 21:27:23 -0500 Subject: IMAGE: Merge the JPEG codec into the ImageDecoder --- image/jpeg.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'image/jpeg.cpp') 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 { -- cgit v1.2.3