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 MEDIASTATION_BITMAP_H
23 #define MEDIASTATION_BITMAP_H
24 
25 #include "common/rect.h"
26 #include "graphics/managed_surface.h"
27 
28 #include "mediastation/datafile.h"
29 #include "mediastation/asset.h"
30 
31 namespace MediaStation {
32 
33 enum BitmapCompressionType {
34  kUncompressedBitmap = 0,
35  kRle8BitmapCompression = 1,
36  kCccBitmapCompression = 5,
37  kCccTransparentBitmapCompression = 6,
38  kUncompressedTransparentBitmap = 7,
39 };
40 
41 class BitmapHeader {
42 public:
43  BitmapHeader(Chunk &chunk);
44 
45  Common::Point _dimensions;
46  BitmapCompressionType _compressionType = kUncompressedBitmap;
47  int16 _stride = 0;
48 };
49 
50 class Bitmap {
51 public:
52  Bitmap(Chunk &chunk, BitmapHeader *bitmapHeader);
53  virtual ~Bitmap();
54 
55  bool isCompressed() const;
56  BitmapCompressionType getCompressionType() const { return _bitmapHeader->_compressionType; }
57  int16 width() const { return _bitmapHeader->_dimensions.x; }
58  int16 height() const { return _bitmapHeader->_dimensions.y; }
59  int16 stride() const { return _bitmapHeader->_stride; }
60 
61  Common::SeekableReadStream *_compressedStream = nullptr;
63 
64 private:
65  BitmapHeader *_bitmapHeader = nullptr;
66  uint _unk1 = 0;
67 };
68 
69 } // End of namespace MediaStation
70 
71 #endif
Definition: managed_surface.h:51
Definition: asset.h:32
Definition: datafile.h:103
Definition: bitmap.h:41
Definition: stream.h:745
Definition: bitmap.h:50
Definition: rect.h:144