openMSX
RGBTriplet3xScaler.hh
Go to the documentation of this file.
1#ifndef RGBTRIPLET3XSCALER_HH
2#define RGBTRIPLET3XSCALER_HH
3
4#include "Scaler3.hh"
5#include "PixelOperations.hh"
6#include "Scanline.hh"
7#include <utility>
8
9namespace openmsx {
10
11class RenderSettings;
12template<std::unsigned_integral Pixel> class PolyLineScaler;
13
16template<std::unsigned_integral Pixel>
17class RGBTriplet3xScaler final : public Scaler3<Pixel>
18{
19public:
21 const RenderSettings& renderSettings);
22
23protected:
24 void scaleImage(FrameSource& src, const RawFrame* superImpose,
25 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
26 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
27
28 void scaleBlank1to3(
29 FrameSource& src, unsigned srcStartY, unsigned srcEndY,
30 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
31 void scaleBlank2to3(
32 FrameSource& src, unsigned srcStartY, unsigned srcEndY,
33 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
34 void scale2x1to9x3(FrameSource& src,
35 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
36 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
37 void scale2x2to9x3(FrameSource& src,
38 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
39 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
40 void scale1x1to3x3(FrameSource& src,
41 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
42 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
43 void scale1x2to3x3(FrameSource& src,
44 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
45 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
46 void scale4x1to9x3(FrameSource& src,
47 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
48 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
49 void scale4x2to9x3(FrameSource& src,
50 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
51 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
52 void scale2x1to3x3(FrameSource& src,
53 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
54 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
55 void scale2x2to3x3(FrameSource& src,
56 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
57 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
58 void scale8x1to9x3(FrameSource& src,
59 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
60 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
61 void scale8x2to9x3(FrameSource& src,
62 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
63 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
64 void scale4x1to3x3(FrameSource& src,
65 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
66 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
67 void scale4x2to3x3(FrameSource& src,
68 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
69 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
70
71private:
72 [[nodiscard]] std::pair<unsigned, unsigned> calcBlur();
73
79 void rgbify(std::span<const Pixel> in, std::span<Pixel> out, unsigned c1, unsigned c2);
80
81 void scaleLine(std::span<const Pixel> srcLine, std::span<Pixel> dstLine,
82 PolyLineScaler<Pixel>& scale, unsigned c1, unsigned c2);
83 void doScale1(FrameSource& src,
84 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
85 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
87 void doScale2(FrameSource& src,
88 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
89 ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
91
92private:
94 Scanline<Pixel> scanline;
95 const RenderSettings& settings;
96};
97
98} // namespace openmsx
99
100#endif
Interface for getting lines from a video frame.
Definition: FrameSource.hh:20
Polymorphic line scaler.
Definition: LineScalers.hh:286
void scaleBlank2to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale4x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale8x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale8x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale2x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale1x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale2x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale4x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
RGBTriplet3xScaler(const PixelOperations< Pixel > &pixelOps, const RenderSettings &renderSettings)
void scale4x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scaleImage(FrameSource &src, const RawFrame *superImpose, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Scales the image in the given area, which must consist of lines which are all equally wide.
void scale2x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale1x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale2x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale4x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scaleBlank1to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
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
constexpr mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
This file implemented 3 utility functions:
Definition: Autofire.cc:9