ScummVM API documentation
swimage.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 code is based on Broken Sword 2.5 engine
24 *
25 * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
26 *
27 * Licensed under GNU GPL v2
28 *
29 */
30
31#ifndef SWORD25_SWIMAGE_H
32#define SWORD25_SWIMAGE_H
33
34#include "sword25/kernel/common.h"
35#include "sword25/gfx/image/image.h"
36#include "sword25/gfx/graphicengine.h"
37
38
39namespace Sword25 {
40
41class SWImage : public Image {
42public:
43 SWImage(const Common::String &filename, bool &result);
44 ~SWImage() override;
45
46 int getWidth() const override {
47 return _image.w;
48 }
49 int getHeight() const override {
50 return _image.h;
51 }
52
53 bool blit(int posX = 0, int posY = 0,
54 int flipping = Graphics::FLIP_NONE,
55 Common::Rect *pPartRect = NULL,
56 uint color = BS_ARGB(255, 255, 255, 255),
57 int width = -1, int height = -1,
58 RectangleList *updateRects = 0) override;
59 bool fill(const Common::Rect *fillRectPtr, uint color) override;
60 bool setContent(const byte *pixeldata, uint size, uint offset, uint stride) override;
61 uint getPixel(int x, int y) override;
62
63 bool isBlitSource() const override {
64 return false;
65 }
66 bool isBlitTarget() const override {
67 return false;
68 }
69 bool isScalingAllowed() const override {
70 return false;
71 }
72 bool isFillingAllowed() const override {
73 return false;
74 }
75 bool isAlphaAllowed() const override {
76 return false;
77 }
78 bool isColorModulationAllowed() const override {
79 return false;
80 }
81 bool isSetContentAllowed() const override {
82 return false;
83 }
84private:
85 Graphics::Surface _image;
86};
87
88} // End of namespace Sword25
89
90#endif
Definition: str.h:59
Definition: image.h:50
Definition: microtiles.h:38
Definition: swimage.h:41
bool isFillingAllowed() const override
Returns true, if the BS_Image is allowed to be filled by a Fill() call.
Definition: swimage.h:72
bool isScalingAllowed() const override
Returns true, if the BS_Image is allowed to be scaled by a Blit() call.
Definition: swimage.h:69
bool setContent(const byte *pixeldata, uint size, uint offset, uint stride) override
Fills the content of the image with pixel data.
uint getPixel(int x, int y) override
Reads out a pixel of the image.
bool isColorModulationAllowed() const override
Return true, if the BS_Image is allowed to be displayed with color modulation by a Blit() call.
Definition: swimage.h:78
int getWidth() const override
Returns the width of the image in pixels.
Definition: swimage.h:46
bool isAlphaAllowed() const override
Returns true, if the BS_Image is allowed to be displayed with an alpha value.
Definition: swimage.h:75
bool isBlitTarget() const override
Checks, if the BS_Image can be a target image for a Blit call.
Definition: swimage.h:66
int getHeight() const override
Returns the height of the image in pixels.
Definition: swimage.h:49
bool fill(const Common::Rect *fillRectPtr, uint color) override
fills a rectangular section of the image with a color.
bool blit(int posX=0, int posY=0, int flipping=Graphics::FLIP_NONE, Common::Rect *pPartRect=NULL, uint color=BS_ARGB(255, 255, 255, 255), int width=-1, int height=-1, RectangleList *updateRects=0) override
renders the image in the framebuffer
bool isSetContentAllowed() const override
Returns true, if the content of the BS_Image is allowed to be replaced by call of SetContent().
Definition: swimage.h:81
bool isBlitSource() const override
Checks, if it is allowed to call BS_Image Blit().
Definition: swimage.h:63
@ FLIP_NONE
The image will not be flipped.
Definition: transform_struct.h:49
Definition: console.h:27
Definition: rect.h:536
Definition: surface.h:67
int16 h
Definition: surface.h:76
int16 w
Definition: surface.h:71