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<typename 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  [[nodiscard]] inline Pixel blend(Pixel p1, Pixel p2) const;
38 
39 private:
40  PixelOperations<Pixel> pixelOps;
41 };
42 
43 } // namespace openmsx
44 
45 #endif
Interface for getting lines from a video frame.
Definition: FrameSource.hh:15
2xSaI algorithm: edge-detection which produces a rounded look.
Definition: SaI2xScaler.hh:14
SaI2xScaler(const PixelOperations< Pixel > &pixelOps)
Definition: SaI2xScaler.cc:19
void scale1x1to2x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:244
void scaleBlank1to2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:26
void scale1x1to1x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:278
Base class for 2x scalers.
Definition: Scaler2.hh:12
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint32_t Pixel