openMSX
SaI2xScaler.hh
Go to the documentation of this file.
1 #ifndef SAI2XSCALER_HH
2 #define SAI2XSCALER_HH
3 
4 #include "Scaler2.hh"
5 #include "PixelOperations.hh"
6 
7 namespace openmsx {
8 
12 template <class Pixel>
13 class SaI2xScaler final : public Scaler2<Pixel>
14 {
15 public:
16  explicit SaI2xScaler(const PixelOperations<Pixel>& pixelOps);
17  void scaleBlank1to2(
18  FrameSource& src, unsigned srcStartY, unsigned srcEndY,
19  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
20  void scale1x1to2x2(FrameSource& src,
21  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
22  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
23  void scale1x1to1x2(FrameSource& src,
24  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
25  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
26 
27 private:
28  void scaleLine1on2(
29  const Pixel* srcLine0, const Pixel* srcLine1,
30  const Pixel* srcLine2, const Pixel* srcLine3,
31  Pixel* dstUpper, Pixel* dstLower, unsigned srcWidth);
32  void scaleLine1on1(
33  const Pixel* srcLine0, const Pixel* srcLine1,
34  const Pixel* srcLine2, const Pixel* srcLine3,
35  Pixel* dstUpper, Pixel* dstLower, unsigned srcWidth);
36 
37  inline Pixel blend(Pixel p1, Pixel p2);
38 
39  PixelOperations<Pixel> pixelOps;
40 };
41 
42 } // namespace openmsx
43 
44 #endif
Base class for 2x scalers.
Definition: Scaler2.hh:11
uint32_t Pixel
Interface for getting lines from a video frame.
Definition: FrameSource.hh:14
SaI2xScaler(const PixelOperations< Pixel > &pixelOps)
Definition: SaI2xScaler.cc:18
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
2xSaI algorithm: edge-detection which produces a rounded look.
Definition: SaI2xScaler.hh:13
void scale1x1to2x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:243
void scale1x1to1x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:277
void scaleBlank1to2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:25