2011-02-02 15:43:45 +00:00
|
|
|
/* 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.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2011-02-02 15:43:45 +00:00
|
|
|
* 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.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2011-02-02 15:43:45 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PNG decoder used in engines:
|
|
|
|
* - sword25
|
2012-10-23 19:48:27 +00:00
|
|
|
* - wintermute
|
2011-05-13 17:34:25 +00:00
|
|
|
* Dependencies:
|
2012-08-12 21:50:25 +00:00
|
|
|
* - libpng
|
2011-02-02 15:43:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GRAPHICS_PNG_H
|
|
|
|
#define GRAPHICS_PNG_H
|
|
|
|
|
2011-04-24 08:34:27 +00:00
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/textconsole.h"
|
2012-01-28 22:55:56 +00:00
|
|
|
#include "graphics/decoders/image_decoder.h"
|
2011-04-24 08:34:27 +00:00
|
|
|
|
2011-02-02 15:43:45 +00:00
|
|
|
namespace Common {
|
|
|
|
class SeekableReadStream;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Graphics {
|
|
|
|
|
2011-04-24 08:34:27 +00:00
|
|
|
struct Surface;
|
2011-02-02 15:43:45 +00:00
|
|
|
struct PixelFormat;
|
|
|
|
|
2012-01-28 22:55:56 +00:00
|
|
|
class PNGDecoder : public ImageDecoder {
|
2011-02-02 15:43:45 +00:00
|
|
|
public:
|
2012-01-28 22:55:56 +00:00
|
|
|
PNGDecoder();
|
|
|
|
~PNGDecoder();
|
|
|
|
|
|
|
|
bool loadStream(Common::SeekableReadStream &stream);
|
|
|
|
void destroy();
|
|
|
|
const Graphics::Surface *getSurface() const { return _outputSurface; }
|
|
|
|
const byte *getPalette() const { return _palette; }
|
2012-08-12 21:50:25 +00:00
|
|
|
uint16 getPaletteColorCount() const { return _paletteColorCount; }
|
2011-02-02 15:43:45 +00:00
|
|
|
private:
|
|
|
|
Common::SeekableReadStream *_stream;
|
2012-08-12 21:50:25 +00:00
|
|
|
byte *_palette;
|
|
|
|
uint16 _paletteColorCount;
|
2011-02-02 15:43:45 +00:00
|
|
|
|
2012-01-28 22:55:56 +00:00
|
|
|
Graphics::Surface *_outputSurface;
|
2011-02-02 15:43:45 +00:00
|
|
|
};
|
|
|
|
|
2012-01-28 22:55:56 +00:00
|
|
|
} // End of namespace Graphics
|
2011-02-02 15:43:45 +00:00
|
|
|
|
|
|
|
#endif // GRAPHICS_PNG_H
|