ScummVM API documentation
base_image.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 /*
23  * This file is based on WME Lite.
24  * http://dead-code.org/redir.php?target=wmelite
25  * Copyright (c) 2011 Jan Nedoma
26  */
27 
28 #ifndef WINTERMUTE_BASE_IMAGE_H
29 #define WINTERMUTE_BASE_IMAGE_H
30 
31 #include "graphics/surface.h"
32 #include "graphics/pixelformat.h"
33 
34 #include "common/endian.h"
35 #include "common/str.h"
36 #include "common/stream.h"
37 
38 namespace Image {
39 class ImageDecoder;
40 }
41 
42 namespace Wintermute {
43 class BaseSurface;
44 class BaseFileManager;
45 class BaseImage {
46 
47 public:
48  BaseImage();
49  ~BaseImage();
50 
51  bool loadFile(const Common::String &filename);
52  const Graphics::Surface *getSurface() const {
53  return _surface;
54  };
55  const byte *getPalette() const {
56  return _palette;
57  }
58  byte getAlphaAt(int x, int y) const;
59  bool writeBMPToStream(Common::WriteStream *stream) const;
60  bool resize(int newWidth, int newHeight);
61  bool saveBMPFile(const Common::String &filename) const;
62  bool copyFrom(BaseImage *origImage, int newWidth = 0, int newHeight = 0);
63  void copyFrom(const Graphics::Surface *surface);
64 private:
65  Common::String _filename;
66  Image::ImageDecoder *_decoder;
67  const Graphics::Surface *_surface;
68  Graphics::Surface *_deletableSurface;
69  const byte *_palette;
70  BaseFileManager *_fileManager;
71 };
72 
73 } // End of namespace Wintermute
74 
75 #endif
Definition: image_decoder.h:52
Definition: str.h:59
Definition: surface.h:67
Definition: base_image.h:45
Definition: stream.h:77
Definition: base_file_manager.h:39
Definition: movie_decoder.h:32
Definition: achievements_tables.h:27