ScummVM API documentation
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 
31 #ifndef IMAGE_BMP_H
32 #define IMAGE_BMP_H
33 
34 #include "common/scummsys.h"
35 #include "common/str.h"
36 #include "image/image_decoder.h"
37 
38 namespace Common {
39 class SeekableReadStream;
40 class WriteStream;
41 }
42 
43 namespace Graphics {
44 struct Surface;
45 }
46 
47 namespace Image {
48 
65 class Codec;
66 
67 class BitmapDecoder : public ImageDecoder {
68 public:
69  BitmapDecoder();
70  virtual ~BitmapDecoder();
71 
72  // ImageDecoder API
73  void destroy();
74  virtual bool loadStream(Common::SeekableReadStream &stream);
75  virtual const Graphics::Surface *getSurface() const { return _surface; }
76  const byte *getPalette() const { return _palette; }
77  uint16 getPaletteColorCount() const { return _paletteColorCount; }
78 
79 private:
80  Codec *_codec;
81  const Graphics::Surface *_surface;
82  byte *_palette;
83  uint16 _paletteColorCount;
84 };
85 
89 bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette = nullptr);
91 } // End of namespace Image
92 
93 #endif
Definition: image_decoder.h:52
Definition: surface.h:66
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:75
Definition: stream.h:745
Definition: codec.h:55
const byte * getPalette() const
Definition: bmp.h:76
Definition: algorithm.h:29
Definition: formatinfo.h:28
uint16 getPaletteColorCount() const
Definition: bmp.h:77
Definition: movie_decoder.h:32
Definition: bmp.h:67