ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bmp.h
Go to the documentation of this file.
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
32 #ifndef IMAGE_BMP_H
33 #define IMAGE_BMP_H
34 
35 #include "common/scummsys.h"
36 #include "common/str.h"
37 #include "graphics/palette.h"
38 #include "image/image_decoder.h"
39 
40 namespace Common {
41 class SeekableReadStream;
42 class WriteStream;
43 }
44 
45 namespace Graphics {
46 struct Surface;
47 }
48 
49 namespace Image {
50 
67 class Codec;
68 
69 class BitmapDecoder : public ImageDecoder {
70 public:
71  BitmapDecoder();
72  virtual ~BitmapDecoder();
73 
74  // ImageDecoder API
75  void destroy();
76  virtual bool loadStream(Common::SeekableReadStream &stream);
77  virtual const Graphics::Surface *getSurface() const { return _surface; }
78  const byte *getPalette() const { return _palette.data(); }
79  uint16 getPaletteColorCount() const { return _palette.size(); }
80 
81 private:
82  Codec *_codec;
83  const Graphics::Surface *_surface;
84  Graphics::Palette _palette;
85 };
86 
90 bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette = nullptr);
92 } // End of namespace Image
93 
94 #endif
Definition: image_decoder.h:52
Definition: surface.h:67
Definition: stream.h:77
bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette=nullptr)
virtual const Graphics::Surface * getSurface() const
Definition: bmp.h:77
Definition: stream.h:745
Definition: codec.h:57
const byte * getPalette() const
Definition: bmp.h:78
Definition: algorithm.h:29
Definition: formatinfo.h:28
uint16 getPaletteColorCount() const
Definition: bmp.h:79
Simple class for handling a palette data.
Definition: palette.h:51
Definition: movie_decoder.h:32
Definition: bmp.h:69