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