1 ////////////////////////////////////////////////////////////////////////////////////////
2 //
3 // Nestopia - NES/Famicom emulator written in C++
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004 Andrea Mazzoleni
6 // Copyright (C) 2003-2008 Martin Freij
7 //
8 // This file is part of Nestopia.
9 //
10 // Nestopia is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 2 of the License, or
13 // (at your option) any later version.
14 //
15 // Nestopia is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Nestopia; if not, write to the Free Software
22 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23 //
24 ////////////////////////////////////////////////////////////////////////////////////////
25 
26 #ifndef NST_VIDEO_FILTER_SCALEX_H
27 #define NST_VIDEO_FILTER_SCALEX_H
28 
29 #ifdef NST_PRAGMA_ONCE
30 #pragma once
31 #endif
32 
33 namespace Nes
34 {
35 	namespace Core
36 	{
37 		namespace Video
38 		{
39 			class Renderer::FilterScaleX : public Renderer::Filter
40 			{
41 			public:
42 
43 				explicit FilterScaleX(const RenderState&);
44 
45 				static bool Check(const RenderState&);
46 
47 			private:
48 
~FilterScaleX()49 				~FilterScaleX() {}
50 
51 				typedef void (*Path)(const Input&,const Output&);
52 
53 				static Path GetPath(const RenderState&);
54 
55 				void Blit(const Input&,const Output&,uint);
56 
57 				template<typename T,int PREV,int NEXT>
58 				static NST_FORCE_INLINE T* Blit2xBorder(T* NST_RESTRICT,const Input::Pixel* NST_RESTRICT,const Input::Palette&);
59 
60 				template<typename T,int PREV,int NEXT>
61 				static NST_FORCE_INLINE T* Blit3xBorder(T* NST_RESTRICT,const Input::Pixel* NST_RESTRICT,const Input::Palette&);
62 
63 				template<typename T>
64 				static NST_FORCE_INLINE T* Blit3xCenter(T* NST_RESTRICT,const Input::Pixel* NST_RESTRICT,const Input::Palette&);
65 
66 				template<typename T,int PREV,int NEXT>
67 				static NST_FORCE_INLINE T* Blit2xLine(T*,const Input::Pixel*,const Input::Palette&,long);
68 
69 				template<typename T,int PREV,int NEXT>
70 				static NST_FORCE_INLINE T* Blit3xLine(T*,const Input::Pixel*,const Input::Palette&,long);
71 
72 				template<typename T>
73 				static void Blit2x(const Input&,const Output&);
74 
75 				template<typename T>
76 				static void Blit3x(const Input&,const Output&);
77 
78 				const Path path;
79 			};
80 		}
81 	}
82 }
83 
84 #endif
85