ScummVM API documentation
scalebit.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 contains an example implementation of the Scale effect
24  * applied to a generic bitmap.
25  *
26  * You can find a high-level description of the effect at:
27  *
28  * https://www.scale2x.it
29  *
30  * Alternatively at the previous license terms, you are allowed to use this
31  * code in your program with these conditions:
32  * - the program is not used in commercial activities.
33  * - the whole source code of the program is released with the binary.
34  * - derivative works of the program are allowed.
35  */
36 
37 #ifndef SCALER_SCALEBIT_H
38 #define SCALER_SCALEBIT_H
39 
40 #include "graphics/scalerplugin.h"
41 
42 int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned height);
43 void scale(unsigned scale, void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height);
44 
45 class AdvMameScaler : public Scaler {
46 public:
47  AdvMameScaler(const Graphics::PixelFormat &format) : Scaler(format) { _factor = 2; }
48  uint increaseFactor() override;
49  uint decreaseFactor() override;
50 protected:
51  virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
52  uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
53 };
54 
55 #endif
Definition: scalebit.h:45
Definition: pixelformat.h:138
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: scalerplugin.h:28
uint decreaseFactor() override
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override
uint increaseFactor() override