openMSX
Simple2xScaler.hh
Go to the documentation of this file.
1 #ifndef SIMPLESCALER_HH
2 #define SIMPLESCALER_HH
3 
4 #include "Scaler2.hh"
5 #include "Scanline.hh"
6 #include "Multiply32.hh"
7 
8 namespace openmsx {
9 
10 class RenderSettings;
11 
17 template <class Pixel>
18 class Simple2xScaler final : public Scaler2<Pixel>
19 {
20 public:
22  const PixelOperations<Pixel>& pixelOps,
23  RenderSettings& renderSettings);
24 
25 private:
26  void scaleImage(FrameSource& src, const RawFrame* superImpose,
27  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
28  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
29  void scaleBlank1to2(
30  FrameSource& src, unsigned srcStartY, unsigned srcEndY,
31  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
32  void scale1x1to2x2(FrameSource& src,
33  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
34  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
35  void scale1x1to1x2(FrameSource& src,
36  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
37  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
38 
39  void drawScanline(const Pixel* in1, const Pixel* in2, Pixel* out,
40  int factor, unsigned dstWidth);
41  void blur1on2(const Pixel* pIn, Pixel* pOut, unsigned alpha,
42  size_t srcWidth);
43  void blur1on1(const Pixel* pIn, Pixel* pOut, unsigned alpha,
44  size_t srcWidth);
45 
46  RenderSettings& settings;
47  PixelOperations<Pixel> pixelOps;
48 
49  Multiply32<Pixel> mult1;
50  Multiply32<Pixel> mult2;
51  Multiply32<Pixel> mult3;
52 
53  Scanline<Pixel> scanline;
54 };
55 
56 } // namespace openmsx
57 
58 #endif
Scaler which assigns the color of the original pixel to all pixels in the 2x2 square.
Helper class to perform &#39;pixel x scalar&#39; calculations.
Definition: Multiply32.hh:14
Base class for 2x scalers.
Definition: Scaler2.hh:11
uint32_t Pixel
Interface for getting lines from a video frame.
Definition: FrameSource.hh:14
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:25
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
Helper class to draw scalines.
Definition: Scanline.hh:43
Simple2xScaler(const PixelOperations< Pixel > &pixelOps, RenderSettings &renderSettings)
Class containing all settings for renderers.