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 DIRECTOR_CASTMEMBER_BITMAP_H
23 #define DIRECTOR_CASTMEMBER_BITMAP_H
24 
25 #include "director/castmember/castmember.h"
26 
27 namespace Image {
28 class ImageDecoder;
29 }
30 
31 namespace Director {
32 
33 class BitmapCastMember : public CastMember {
34 public:
35  BitmapCastMember(Cast *cast, uint16 castId, Common::SeekableReadStreamEndian &stream, uint32 castTag, uint16 version, uint8 flags1 = 0);
36  BitmapCastMember(Cast *cast, uint16 castId, Image::ImageDecoder *img, uint8 flags1 = 0);
37  BitmapCastMember(Cast *cast, uint16 castId, BitmapCastMember &source);
39 
40  CastMember *duplicate(Cast *cast, uint16 castId) override { return (CastMember *)(new BitmapCastMember(cast, castId, *this)); }
41 
42  Graphics::MacWidget *createWidget(Common::Rect &bbox, Channel *channel, SpriteType spriteType) override;
43 
44  bool isModified() override;
45  void createMatte(const Common::Rect &bbox);
46  Graphics::Surface *getMatte(const Common::Rect &bbox);
47  Graphics::Surface *getDitherImg();
48 
49  bool hasField(int field) override;
50  Datum getField(int field) override;
51  bool setField(int field, const Datum &value) override;
52 
53  Common::String formatInfo() override;
54 
55  void load() override;
56  void unload() override;
57 
58  PictureReference *getPicture() const;
59  void setPicture(PictureReference &picture);
60  void setPicture(Image::ImageDecoder &image, bool adjustSize);
61 
62  Common::Point getRegistrationOffset() override;
63  Common::Point getRegistrationOffset(int16 width, int16 height) override;
64 
65  CollisionTest isWithin(const Common::Rect &bbox, const Common::Point &pos, InkType ink) override;
66 
67  void writeCastData(Common::SeekableWriteStream *writeStream) override;
68  uint32 writeBITDResource(Common::SeekableWriteStream *writeStream, uint32 offset);
69 
70  uint32 getCastDataSize() override; // This is the size of the data in the 'CASt' resource
71  uint32 getBITDResourceSize();
72 
73  Picture *_picture = nullptr;
74  Graphics::Surface *_ditheredImg;
75  Graphics::Surface *_matte;
76 
77  uint16 _pitch;
78  int16 _regX;
79  int16 _regY;
80  uint16 _flags2;
81  uint16 _bytes;
82  CastMemberID _clut;
83  CastMemberID _ditheredTargetClut;
84 
85  uint8 _bitsPerPixel;
86 
87  uint32 _tag;
88  bool _noMatte;
89  bool _external;
90 };
91 
92 } // End of namespace Director
93 
94 #endif
Definition: cast.h:87
Definition: image_decoder.h:53
Definition: str.h:59
Definition: surface.h:67
Definition: channel.h:40
Definition: picture.h:33
Definition: rect.h:524
Definition: archive.h:36
Definition: lingo.h:214
Definition: rect.h:144
Definition: macwidget.h:39
Definition: lingo.h:130
Definition: stream.h:351
Definition: stream.h:944
Definition: bitmap.h:33
Definition: movie_decoder.h:32
Definition: castmember.h:48
Definition: types.h:411