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<typename 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 private:
47  RenderSettings& settings;
48  PixelOperations<Pixel> pixelOps;
49 
50  Multiply32<Pixel> mult1;
51  Multiply32<Pixel> mult2;
52  Multiply32<Pixel> mult3;
53 
54  Scanline<Pixel> scanline;
55 };
56 
57 } // namespace openmsx
58 
59 #endif
openmsx::Scanline
Helper class to draw scalines.
Definition: Scanline.hh:44
openmsx::PixelOperations
Definition: PixelOperations.hh:144
openmsx::RenderSettings
Class containing all settings for renderers.
Definition: RenderSettings.hh:22
Multiply32.hh
Scaler2.hh
openmsx::Scaler2
Base class for 2x scalers.
Definition: Scaler2.hh:12
openmsx::ScalerOutput
Definition: ScalerOutput.hh:7
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:98
openmsx::Simple2xScaler
Scaler which assigns the color of the original pixel to all pixels in the 2x2 square.
Definition: Simple2xScaler.hh:19
openmsx::RawFrame
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:26
Scanline.hh
openmsx::Multiply32
Helper class to perform 'pixel x scalar' calculations.
Definition: Multiply32.hh:14
openmsx::FrameSource
Interface for getting lines from a video frame.
Definition: FrameSource.hh:14
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Simple2xScaler::Simple2xScaler
Simple2xScaler(const PixelOperations< Pixel > &pixelOps, RenderSettings &renderSettings)
Definition: Simple2xScaler.cc:21