openMSX
Simple3xScaler.hh
Go to the documentation of this file.
1 #ifndef SIMPLE3XSCALER_HH
2 #define SIMPLE3XSCALER_HH
3 
4 #include "Scaler3.hh"
5 #include "PixelOperations.hh"
6 #include "Scanline.hh"
7 #include <memory>
8 
9 namespace openmsx {
10 
11 class RenderSettings;
12 template <class Pixel> class Blur_1on3;
13 template <class Pixel> class PolyLineScaler;
14 
15 template <class Pixel>
16 class Simple3xScaler final : public Scaler3<Pixel>
17 {
18 public:
19  Simple3xScaler(const PixelOperations<Pixel>& pixelOps,
20  const RenderSettings& settings);
21  ~Simple3xScaler() override;
22 
23 private:
24  void scaleImage(FrameSource& src, const RawFrame* superImpose,
25  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
26  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
27  void scaleBlank1to3(
28  FrameSource& src, unsigned srcStartY, unsigned srcEndY,
29  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
30  void scaleBlank2to3(
31  FrameSource& src, unsigned srcStartY, unsigned srcEndY,
32  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
33  void scale2x1to9x3(FrameSource& src,
34  unsigned srcstarty, unsigned srcendy, unsigned srcwidth,
35  ScalerOutput<Pixel>& dst, unsigned dststarty, unsigned dstendy) override;
36  void scale2x2to9x3(FrameSource& src,
37  unsigned srcstarty, unsigned srcendy, unsigned srcwidth,
38  ScalerOutput<Pixel>& dst, unsigned dststarty, unsigned dstendy) override;
39  void scale1x1to3x3(FrameSource& src,
40  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
41  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
42  void scale1x2to3x3(FrameSource& src,
43  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
44  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
45  void scale4x1to9x3(FrameSource& src,
46  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
47  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
48  void scale4x2to9x3(FrameSource& src,
49  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
50  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
51  void scale2x1to3x3(FrameSource& src,
52  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
53  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
54  void scale2x2to3x3(FrameSource& src,
55  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
56  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
57  void scale8x1to9x3(FrameSource& src,
58  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
59  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
60  void scale8x2to9x3(FrameSource& src,
61  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
62  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
63  void scale4x1to3x3(FrameSource& src,
64  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
65  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
66  void scale4x2to3x3(FrameSource& src,
67  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
68  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
69 
70  void doScale1(FrameSource& src,
71  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
72  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
74  void doScale2(FrameSource& src,
75  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
76  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
78 
79  PixelOperations<Pixel> pixelOps;
80  Scanline<Pixel> scanline;
81 
82  // in 16bpp calculation of LUTs can be expensive, so keep as member
83  std::unique_ptr<Blur_1on3<Pixel>> blur_1on3;
84 
85  const RenderSettings& settings;
86 };
87 
88 } // namespace openmsx
89 
90 #endif
openmsx::Simple3xScaler
Definition: Simple3xScaler.hh:16
openmsx::Simple3xScaler::Simple3xScaler
Simple3xScaler(const PixelOperations< Pixel > &pixelOps, const RenderSettings &settings)
Definition: Simple3xScaler.cc:36
openmsx::Scanline
Helper class to draw scalines.
Definition: Scanline.hh:43
openmsx::PixelOperations
Definition: PixelOperations.hh:142
openmsx::RenderSettings
Class containing all settings for renderers.
Definition: RenderSettings.hh:21
openmsx::PolyLineScaler
Polymorphic line scaler.
Definition: LineScalers.hh:283
openmsx::Simple3xScaler::~Simple3xScaler
~Simple3xScaler() override
openmsx::ScalerOutput
Definition: Scaler.hh:8
Scaler3.hh
openmsx::RawFrame
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:25
PixelOperations.hh
Scanline.hh
gl::scale
mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
openmsx::Scaler3
Base class for 3x scalers.
Definition: Scaler3.hh:11
openmsx::FrameSource
Interface for getting lines from a video frame.
Definition: FrameSource.hh:13
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5