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#include <span>
7
8namespace openmsx {
9
13template<std::unsigned_integral Pixel>
14class SaI2xScaler final : public Scaler2<Pixel>
15{
16public:
17 explicit SaI2xScaler(const PixelOperations<Pixel>& pixelOps);
18 void scaleBlank1to2(
19 FrameSource& src, unsigned srcStartY, unsigned srcEndY,
20 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
21 void scale1x1to2x2(FrameSource& src,
22 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
23 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
24 void scale1x1to1x2(FrameSource& src,
25 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
26 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
27
28private:
29 void scaleLine1on2(
30 std::span<const Pixel> srcLine0, std::span<const Pixel> srcLine1,
31 std::span<const Pixel> srcLine2, std::span<const Pixel> srcLine3,
32 std::span<Pixel> dstUpper, std::span<Pixel> dstLower);
33 void scaleLine1on1(
34 std::span<const Pixel> srcLine0, std::span<const Pixel> srcLine1,
35 std::span<const Pixel> srcLine2, std::span<const Pixel> srcLine3,
36 std::span<Pixel> dstUpper, std::span<Pixel> dstLower);
37
38 [[nodiscard]] inline Pixel blend(Pixel p1, Pixel p2) const;
39
40private:
42};
43
44} // namespace openmsx
45
46#endif
Interface for getting lines from a video frame.
Definition: FrameSource.hh:20
2xSaI algorithm: edge-detection which produces a rounded look.
Definition: SaI2xScaler.hh:15
SaI2xScaler(const PixelOperations< Pixel > &pixelOps)
Definition: SaI2xScaler.cc:20
void scale1x1to2x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:259
void scaleBlank1to2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:27
void scale1x1to1x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: SaI2xScaler.cc:293
Base class for 2x scalers.
Definition: Scaler2.hh:12
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint32_t Pixel