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
31namespace MediaStation {
32
33enum BitmapCompressionType {
34 kUncompressedBitmap = 0,
35 kRle8BitmapCompression = 1,
36 kCccBitmapCompression = 5,
37 kCccTransparentBitmapCompression = 6,
38 kUncompressedTransparentBitmap = 7,
39};
40
41class ImageInfo {
42public:
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
53public:
54 PixMapImage(Chunk &chunk, const ImageInfo &imageInfo, bool decompressInPlace = false);
55 PixMapImage(const ImageInfo &imageInfo, bool decompressInPlace = false);
56 virtual ~PixMapImage();
57
58 bool isCompressed() const;
59 BitmapCompressionType getCompressionType() const { return _imageInfo._compressionType; }
60 void setCompressionType(BitmapCompressionType compressionType) { _imageInfo._compressionType = compressionType; }
61 int16 width() const { return _imageInfo._dimensions.x; }
62 int16 height() const { return _imageInfo._dimensions.y; }
63 int16 stride() const { return _imageInfo._stride; }
64
65 Common::SeekableReadStream *_compressedStream = nullptr;
67
68private:
69 ImageInfo _imageInfo;
70 void decompress();
71};
72
73} // End of namespace MediaStation
74
75#endif
Definition: stream.h:745
Definition: managed_surface.h:51
Definition: datafile.h:99
Definition: bitmap.h:41
Definition: bitmap.h:52
T y
Definition: rect.h:49
T x
Definition: rect.h:48
Definition: rect.h:144