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 
27 namespace Graphics {
28 
29 /*
30 
31 LarryScale is a bitmap scaler for cartoon images.
32 
33 Features:
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 
40 Limitations:
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 
47 typedef byte LarryScaleColor;
48 
49 class RowReader {
50 public:
51  virtual const LarryScaleColor *readRow(int y) = 0;
52  virtual ~RowReader() {}
53 };
54 
55 class RowWriter {
56 public:
57  virtual void writeRow(int y, const LarryScaleColor *row) = 0;
58  virtual ~RowWriter() {}
59 };
60 
71 void larryScale(
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:55
Definition: larryScale.h:49
Definition: formatinfo.h:28