ScummVM API documentation
bitmap.h
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 
22 #ifndef STARK_GFX_BITMAP_H
23 #define STARK_GFX_BITMAP_H
24 
25 #include "common/hash-str.h"
26 
27 namespace Graphics {
28  struct PixelFormat;
29  struct Surface;
30 }
31 
32 namespace Stark {
33 namespace Gfx {
34 
38 class Bitmap {
39 public:
40  Bitmap() : _width(0), _height(0) {}
41  virtual ~Bitmap() {}
42 
43  enum SamplingFilter {
44  kNearest,
45  kLinear
46  };
47 
49  virtual void bind() const = 0;
50 
52  virtual void update(const Graphics::Surface *surface, const byte *palette = nullptr) = 0;
53 
55  virtual void setSamplingFilter(SamplingFilter filter) = 0;
56 
58  virtual Graphics::PixelFormat getBestPixelFormat() const = 0;
59 
61  uint32 width() const { return _width; }
62 
64  uint32 height() const { return _height; }
65 
66 protected:
67  uint32 _width;
68  uint32 _height;
69 };
70 
71 } // End of namespace Gfx
72 } // End of namespace Stark
73 
74 #endif // STARK_GFX_BITMAP_H
Definition: surface.h:67
Definition: pixelformat.h:138
uint32 width() const
Definition: bitmap.h:61
Definition: console.h:27
Definition: bitmap.h:38
Definition: formatinfo.h:28
uint32 height() const
Definition: bitmap.h:64