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
28namespace Common {
29class SeekableReadStream;
30struct Rect;
31}
32
33namespace Graphics {
34struct Surface;
35}
36
37namespace Image {
38class Codec;
39}
40
41namespace Director {
42
44public:
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
55private:
56 Image::Codec *_codec;
57 const Graphics::Surface *_surface;
58 Graphics::Palette _palette;
59 uint16 _bitsPerPixel;
60};
61
63public:
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
74private:
75 Graphics::Surface *_surface;
76 Graphics::Palette _palette;
77 uint16 _bitsPerPixel;
78 uint16 _version;
79 uint16 _pitch;
80};
81
82void 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: stream.h:745
Definition: images.h:62
const Graphics::Palette & getPalette() const override
Definition: images.h:71
bool loadStream(Common::SeekableReadStream &stream) override
const Graphics::Surface * getSurface() const override
Definition: images.h:70
void destroy() override
Definition: images.h:43
const Graphics::Palette & getPalette() const override
Definition: images.h:52
bool loadStream(Common::SeekableReadStream &stream) override
const Graphics::Surface * getSurface() const override
Definition: images.h:51
void destroy() override
Simple class for handling a palette data.
Definition: palette.h:61
Definition: codec.h:57
Definition: image_decoder.h:53
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: rect.h:536
Definition: surface.h:67