ScummVM API documentation
pod_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  * Copyright 2020 Google
21  *
22  */
23 #ifndef HADESCH_POD_IMAGE_H
24 #define HADESCH_POD_IMAGE_H
25 
26 #include "hadesch/pod_file.h"
27 #include "common/ptr.h"
28 #include "common/rect.h"
29 #include "common/hashmap.h"
30 #include "hadesch/gfx_context.h"
31 #include "graphics/cursor.h"
32 
33 namespace Hadesch {
34 
35 class PodImage : public Graphics::Cursor {
36 public:
37  PodImage();
38  bool loadImage(const PodFile &col, int index);
39  void render(Common::SharedPtr<GfxContext>, Common::Point offset,
40  int colourScale = 0x100, int scale = 100) const;
41  bool isValid() const;
42  void setHotspot(Common::Point pnt);
43  Common::Point getOffset() const;
44 
45  uint16 getWidth() const override;
46  uint16 getHeight() const override;
47  uint16 getHotspotX() const override;
48  uint16 getHotspotY() const override;
49  byte getKeyColor() const override;
50  const byte *getSurface() const override;
51  const byte *getPalette() const override;
52  byte getPaletteStartIndex() const override;
53  uint16 getPaletteCount() const override;
54 
55  ~PodImage();
56 private:
57  struct ScaledVersion {
59  int _w, _h;
60  };
61  void makeScale(int scale) const;
62 
64  int _w, _h;
65  Common::Point _pos, _hotspot;
66  int _ncolors;
68  Common::SharedPtr<byte> _palette;
69  Common::SharedPtr<byte> _paletteCursor;
70 };
71 }
72 
73 #endif
Definition: ambient.h:30
uint16 getPaletteCount() const override
uint16 getHotspotY() const override
Definition: pod_image.h:35
uint16 getHotspotX() const override
uint16 getWidth() const override
byte getPaletteStartIndex() const override
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: pod_file.h:41
const byte * getPalette() const override
Definition: cursor.h:42
byte getKeyColor() const override
Definition: rect.h:45
uint16 getHeight() const override
const byte * getSurface() const override
Definition: ptr.h:159