openMSX
Simple3xScaler.hh
Go to the documentation of this file.
1#ifndef SIMPLE3XSCALER_HH
2#define SIMPLE3XSCALER_HH
3
4#include "Scaler3.hh"
5#include "Multiply32.hh"
6#include "PixelOperations.hh"
7#include "Scanline.hh"
8
9namespace openmsx {
10
11class RenderSettings;
12template<std::unsigned_integral Pixel> class PolyLineScaler;
13
14template<std::unsigned_integral Pixel> class Blur_1on3
15{
16public:
17 explicit Blur_1on3(const PixelOperations<Pixel>& pixelOps);
18 inline void setBlur(unsigned blur_) { blur = blur_; }
19 void operator()(std::span<const Pixel> in, std::span<Pixel> out);
20private:
25 unsigned blur;
26#ifdef __SSE2__
27 void blur_SSE(const Pixel* in_, Pixel* out_, size_t srcWidth);
28#endif
29};
30
31template<std::unsigned_integral Pixel>
32class Simple3xScaler final : public Scaler3<Pixel>
33{
34public:
36 const RenderSettings& settings);
37 ~Simple3xScaler() override;
38
39private:
40 void scaleImage(FrameSource& src, const RawFrame* superImpose,
41 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
42 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
43 void scaleBlank1to3(
44 FrameSource& src, unsigned srcStartY, unsigned srcEndY,
45 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
46 void scaleBlank2to3(
47 FrameSource& src, unsigned srcStartY, unsigned srcEndY,
48 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
49 void scale2x1to9x3(FrameSource& src,
50 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
51 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
52 void scale2x2to9x3(FrameSource& src,
53 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
54 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
55 void scale1x1to3x3(FrameSource& src,
56 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
57 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
58 void scale1x2to3x3(FrameSource& src,
59 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
60 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
61 void scale4x1to9x3(FrameSource& src,
62 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
63 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
64 void scale4x2to9x3(FrameSource& src,
65 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
66 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
67 void scale2x1to3x3(FrameSource& src,
68 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
69 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
70 void scale2x2to3x3(FrameSource& src,
71 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
72 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
73 void scale8x1to9x3(FrameSource& src,
74 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
75 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
76 void scale8x2to9x3(FrameSource& src,
77 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
78 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
79 void scale4x1to3x3(FrameSource& src,
80 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
81 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
82 void scale4x2to3x3(FrameSource& src,
83 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
84 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
85
86 void doScale1(FrameSource& src,
87 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
88 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
90 void doScale2(FrameSource& src,
91 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
92 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
94
95private:
97 Scanline<Pixel> scanline;
98
99 // in 16bpp calculation of LUTs can be expensive, so keep as member
100 Blur_1on3<Pixel> blur_1on3;
101
102 const RenderSettings& settings;
103};
104
105} // namespace openmsx
106
107#endif
void operator()(std::span< const Pixel > in, std::span< Pixel > out)
void setBlur(unsigned blur_)
Blur_1on3(const PixelOperations< Pixel > &pixelOps)
Interface for getting lines from a video frame.
Definition: FrameSource.hh:20
Helper class to perform 'pixel x scalar' calculations.
Definition: Multiply32.hh:17
Polymorphic line scaler.
Definition: LineScalers.hh:286
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:15
Class containing all settings for renderers.
Base class for 3x scalers.
Definition: Scaler3.hh:12
Helper class to draw scanlines.
Definition: Scanline.hh:46
Simple3xScaler(const PixelOperations< Pixel > &pixelOps, const RenderSettings &settings)
constexpr mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint32_t Pixel