1 /*
2  * imagesource_lanczossinc.h - Interpolated scaling filter
3  * Implements Sinc interpolation with Lanczos Window:
4  * sin(pi*x)/(pi*x)*sample*sin(pi*x/windowsize)/(pi*x/windowsize)
5  *
6  * Supports all colourspaces
7  * Doesn't (yet) support random access
8  *
9  * Copyright (c) 2004,2008 by Alastair M. Robinson
10  * Distributed under the terms of the GNU General Public License -
11  * see the file named "COPYING" for more details.
12  *
13  */
14 
15 #ifndef IMAGESOURCE_LANCZOSSINC_H
16 #define IMAGESOURCE_LANCZOSSINC_H
17 
18 #include "imagesource.h"
19 
20 class ISLanczosSinc_RowCache;
21 
22 
23 class ImageSource_LanczosSinc : public ImageSource
24 {
25 	public:
26 	ImageSource_LanczosSinc(ImageSource *source,int width,int height,int windowsize=6);
27 	~ImageSource_LanczosSinc();
28 	ISDataType *GetRow(int row);
29 	protected:
30 	ImageSource *source;
31 };
32 
33 
34 class ImageSource_VLanczosSinc : public ImageSource
35 {
36 	public:
37 	ImageSource_VLanczosSinc(ImageSource *source,int height,int windowsize=6);
38 	~ImageSource_VLanczosSinc();
39 	ISDataType *GetRow(int row);
40 	protected:
41 	void PreCalc();
42 	int support;
43 	ImageSource *source;
44 	int windowsize;
45 	double *coeff;
46 	ISLanczosSinc_RowCache *cache;
47 	friend class ISLanczosSinc_RowCache;
48 };
49 
50 
51 class ImageSource_HLanczosSinc : public ImageSource
52 {
53 	public:
54 	ImageSource_HLanczosSinc(ImageSource *source,int width,int windowsize=6);
55 	~ImageSource_HLanczosSinc();
56 	ISDataType *GetRow(int row);
57 	protected:
58 	void PreCalc();
59 	int support;
60 	ImageSource *source;
61 	int windowsize;
62 	double *coeff;
63 };
64 
65 #endif
66