aboutsummaryrefslogtreecommitdiff
path: root/image/codecs
diff options
context:
space:
mode:
authorMatthew Hoops2014-02-27 21:27:23 -0500
committerMatthew Hoops2014-02-28 00:27:36 -0500
commitc432b96cf667a1b7f1386cc4c97fcf5411690f7d (patch)
treed4cdab5ce30eb4c014b5445a8895059da7ef8cf3 /image/codecs
parentb568ac73b9d2e063eb04693e4610a9932035b696 (diff)
downloadscummvm-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/codecs')
-rw-r--r--image/codecs/jpeg.cpp66
-rw-r--r--image/codecs/jpeg.h60
2 files changed, 0 insertions, 126 deletions
diff --git a/image/codecs/jpeg.cpp b/image/codecs/jpeg.cpp
deleted file mode 100644
index 9e8ba5a7d3..0000000000
--- a/image/codecs/jpeg.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/system.h"
-#include "common/textconsole.h"
-#include "graphics/surface.h"
-#include "image/jpeg.h"
-
-#include "image/codecs/jpeg.h"
-
-namespace Common {
-class SeekableReadStream;
-}
-
-namespace Image {
-
-JPEGCodec::JPEGCodec() : Codec() {
- _pixelFormat = g_system->getScreenFormat();
- _surface = NULL;
-}
-
-JPEGCodec::~JPEGCodec() {
- if (_surface) {
- _surface->free();
- delete _surface;
- }
-}
-
-const Graphics::Surface *JPEGCodec::decodeImage(Common::SeekableReadStream *stream) {
- JPEGDecoder jpeg;
-
- if (!jpeg.loadStream(*stream)) {
- warning("Failed to decode JPEG frame");
- return 0;
- }
-
- if (_surface) {
- _surface->free();
- delete _surface;
- }
-
- _surface = jpeg.getSurface()->convertTo(_pixelFormat);
-
- return _surface;
-}
-
-} // End of namespace Image
diff --git a/image/codecs/jpeg.h b/image/codecs/jpeg.h
deleted file mode 100644
index d48604b067..0000000000
--- a/image/codecs/jpeg.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef IMAGE_CODECS_JPEG_H
-#define IMAGE_CODECS_JPEG_H
-
-#include "image/codecs/codec.h"
-#include "graphics/pixelformat.h"
-
-namespace Common {
-class SeekableReadStream;
-}
-
-namespace Graphics {
-struct Surface;
-}
-
-namespace Image {
-
-/**
- * JPEG decoder.
- *
- * Used in video:
- * - QuickTimeDecoder
- */
-class JPEGCodec : public Codec {
-public:
- JPEGCodec();
- ~JPEGCodec();
-
- const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream);
- Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; }
-
-private:
- Graphics::PixelFormat _pixelFormat;
- Graphics::Surface *_surface;
-};
-
-} // End of namespace Image
-
-#endif