ScummVM API documentation
larryScale.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#ifndef GRAPHICS_LARRYSCALE_H
23#define GRAPHICS_LARRYSCALE_H
24
25#include "common/scummsys.h"
26
27namespace Graphics {
28
29/*
30
31LarryScale is a bitmap scaler for cartoon images.
32
33Features:
34
35* Supports arbitrary scaling factors along both axes (but looks best between 50% and 200%).
36* When downscaling: preserves fine details.
37* When upscaling: keeps lines smooth, introducing very few block artifacts.
38* Does not introduce additional colors.
39
40Limitations:
41
42* Lines must not be anti-aliased and should be only one pixel wide.
43* Fills should be flat without gradients.
44
45*/
46
47typedef byte LarryScaleColor;
48
49class RowReader {
50public:
51 virtual const LarryScaleColor *readRow(int y) = 0;
52 virtual ~RowReader() {}
53};
54
55class RowWriter {
56public:
57 virtual void writeRow(int y, const LarryScaleColor *row) = 0;
58 virtual ~RowWriter() {}
59};
60
72 int srcWidth, int srcHeight,
73 LarryScaleColor transparentColor,
74 RowReader &rowReader,
75 int dstWidth, int dstHeight,
76 RowWriter &rowWriter
77);
78
79}
80
81#endif
Definition: larryScale.h:49
Definition: larryScale.h:55
Definition: formatinfo.h:28
void larryScale(int srcWidth, int srcHeight, LarryScaleColor transparentColor, RowReader &rowReader, int dstWidth, int dstHeight, RowWriter &rowWriter)