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<typename Pixel> class Blur_1on3;
13 template<typename Pixel> class PolyLineScaler;
14 
15 template<typename 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 private:
80  PixelOperations<Pixel> pixelOps;
81  Scanline<Pixel> scanline;
82 
83  // in 16bpp calculation of LUTs can be expensive, so keep as member
84  std::unique_ptr<Blur_1on3<Pixel>> blur_1on3;
85 
86  const RenderSettings& settings;
87 };
88 
89 } // namespace openmsx
90 
91 #endif
Interface for getting lines from a video frame.
Definition: FrameSource.hh:15
Polymorphic line scaler.
Definition: LineScalers.hh:285
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:14
Class containing all settings for renderers.
Base class for 3x scalers.
Definition: Scaler3.hh:12
Helper class to draw scanlines.
Definition: Scanline.hh:44
Simple3xScaler(const PixelOperations< Pixel > &pixelOps, const RenderSettings &settings)
constexpr mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
This file implemented 3 utility functions:
Definition: Autofire.cc:5