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/actor.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 ImageInfo {
42 public:
43  ImageInfo() = default;
44  ImageInfo(Chunk &chunk);
45 
46  Common::Point _dimensions;
47  BitmapCompressionType _compressionType = kUncompressedBitmap;
48  int16 _stride = 0;
49  uint _imageDataStartOffset = 0;
50 };
51 
52 class PixMapImage {
53 public:
54  PixMapImage(Chunk &chunk, const ImageInfo &imageInfo);
55  PixMapImage(const ImageInfo &imageInfo);
56  virtual ~PixMapImage();
57 
58  bool isCompressed() const;
59  BitmapCompressionType getCompressionType() const { return _imageInfo._compressionType; }
60  int16 width() const { return _imageInfo._dimensions.x; }
61  int16 height() const { return _imageInfo._dimensions.y; }
62  int16 stride() const { return _imageInfo._stride; }
63 
64  Common::SeekableReadStream *_compressedStream = nullptr;
66 
67 private:
68  ImageInfo _imageInfo;
69 };
70 
71 } // End of namespace MediaStation
72 
73 #endif
Definition: managed_surface.h:51
Definition: actor.h:33
Definition: datafile.h:102
Definition: stream.h:745
Definition: bitmap.h:41
Definition: bitmap.h:52
Definition: rect.h:144