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