ScummVM API documentation
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 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/*
32 BS_Image
33 --------
34
35 Autor: Malte Thiesen
36*/
37
38#ifndef SWORD25_IMAGE_H
39#define SWORD25_IMAGE_H
40
41// Includes
42#include "sword25/kernel/common.h"
43#include "common/rect.h"
44#include "sword25/gfx/graphicengine.h"
45
46namespace Sword25 {
47
48class RectangleList;
49
50class Image {
51public:
52 virtual ~Image() {}
53
55
60 virtual int getWidth() const = 0;
61
65 virtual int getHeight() const = 0;
66
68
70
107 virtual bool blit(int posX = 0, int posY = 0,
108 int flipping = Graphics::FLIP_NONE,
109 Common::Rect *pPartRect = NULL,
110 uint color = BS_ARGB(255, 255, 255, 255),
111 int width = -1, int height = -1,
112 RectangleList *updateRects = 0) = 0;
113
123 virtual bool fill(const Common::Rect *pFillRect = 0, uint color = BS_RGB(0, 0, 0)) = 0;
124
135 virtual bool setContent(const byte *pixeldata, uint size, uint offset, uint stride) = 0;
136
144 virtual uint getPixel(int x, int y) = 0;
145
147
153 virtual bool isBlitSource() const = 0;
154
159 virtual bool isBlitTarget() const = 0;
160
164 virtual bool isScalingAllowed() const = 0;
165
169 virtual bool isFillingAllowed() const = 0;
170
174 virtual bool isAlphaAllowed() const = 0;
175
179 virtual bool isColorModulationAllowed() const = 0;
180
184 virtual bool isSetContentAllowed() const = 0;
185
186 virtual bool isSolid() const { return false; }
187
189};
190
191} // End of namespace Sword25
192
193#endif
Definition: image.h:50
virtual bool isAlphaAllowed() const =0
Returns true, if the BS_Image is allowed to be displayed with an alpha value.
virtual bool setContent(const byte *pixeldata, uint size, uint offset, uint stride)=0
Fills the content of the image with pixel data.
virtual bool isBlitSource() const =0
Checks, if it is allowed to call BS_Image Blit().
virtual int getWidth() const =0
Returns the width of the image in pixels.
virtual uint getPixel(int x, int y)=0
Reads out a pixel of the image.
virtual 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)=0
renders the image in the framebuffer
virtual bool isBlitTarget() const =0
Checks, if the BS_Image can be a target image for a Blit call.
virtual bool isScalingAllowed() const =0
Returns true, if the BS_Image is allowed to be scaled by a Blit() call.
virtual int getHeight() const =0
Returns the height of the image in pixels.
virtual bool fill(const Common::Rect *pFillRect=0, uint color=BS_RGB(0, 0, 0))=0
fills a rectangular section of the image with a color.
virtual bool isSetContentAllowed() const =0
Returns true, if the content of the BS_Image is allowed to be replaced by call of SetContent().
virtual bool isFillingAllowed() const =0
Returns true, if the BS_Image is allowed to be filled by a Fill() call.
virtual bool isColorModulationAllowed() const =0
Return true, if the BS_Image is allowed to be displayed with color modulation by a Blit() call.
Definition: microtiles.h:38
@ FLIP_NONE
The image will not be flipped.
Definition: transform_struct.h:49
Definition: console.h:27
Definition: rect.h:536