ScummVM API documentation
images.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_IMAGES_H
23 #define DIRECTOR_IMAGES_H
24 
25 #include "graphics/palette.h"
26 #include "image/image_decoder.h"
27 
28 namespace Common {
29 class SeekableReadStream;
30 struct Rect;
31 }
32 
33 namespace Graphics {
34 struct Surface;
35 }
36 
37 namespace Image {
38 class Codec;
39 }
40 
41 namespace Director {
42 
44 public:
45  DIBDecoder();
46  ~DIBDecoder() override;
47 
48  // ImageDecoder API
49  void destroy() override;
50  bool loadStream(Common::SeekableReadStream &stream) override;
51  const Graphics::Surface *getSurface() const override { return _surface; }
52  const Graphics::Palette &getPalette() const override { return _palette; }
53  void loadPalette(Common::SeekableReadStream &stream);
54 
55 private:
56  Image::Codec *_codec;
57  const Graphics::Surface *_surface;
58  Graphics::Palette _palette;
59  uint16 _bitsPerPixel;
60 };
61 
63 public:
64  BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const byte *palette, uint16 version);
65  ~BITDDecoder() override;
66 
67  // ImageDecoder API
68  void destroy() override;
69  bool loadStream(Common::SeekableReadStream &stream) override;
70  const Graphics::Surface *getSurface() const override { return _surface; }
71  const Graphics::Palette &getPalette() const override { return _palette; }
72  void loadPalette(Common::SeekableReadStream &stream);
73 
74 private:
75  Graphics::Surface *_surface;
76  Graphics::Palette _palette;
77  uint16 _bitsPerPixel;
78  uint16 _version;
79  uint16 _pitch;
80 };
81 
82 void copyStretchImg(const Graphics::Surface *srcSurface, Graphics::Surface *targetSurface, const Common::Rect &srcRect, const Common::Rect &targetRect, const byte *pal = 0);
83 
84 } // End of namespace Director
85 
86 #endif
Definition: image_decoder.h:53
Definition: surface.h:67
const Graphics::Palette & getPalette() const override
Definition: images.h:52
Definition: rect.h:524
Definition: images.h:62
Definition: stream.h:745
Definition: archive.h:36
Definition: codec.h:57
const Graphics::Palette & getPalette() const override
Definition: images.h:71
Definition: algorithm.h:29
Definition: formatinfo.h:28
const Graphics::Surface * getSurface() const override
Definition: images.h:70
Definition: images.h:43
const Graphics::Surface * getSurface() const override
Definition: images.h:51
Simple class for handling a palette data.
Definition: palette.h:55
Definition: movie_decoder.h:32