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 
9 namespace openmsx {
10 
11 class RenderSettings;
12 template<typename Pixel> class PolyLineScaler;
13 
16 template<typename Pixel>
17 class RGBTriplet3xScaler final : public Scaler3<Pixel>
18 {
19 public:
21  const RenderSettings& renderSettings);
22 
23 protected:
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 
71 private:
72  [[nodiscard]] std::pair<unsigned, unsigned> calcBlur();
73 
80  void rgbify(const Pixel* in, Pixel* out, unsigned inWidth, unsigned c1, unsigned c2);
81 
82  void scaleLine(const Pixel* srcLine, Pixel* dstLine,
83  PolyLineScaler<Pixel>& scale, unsigned tmpWidth,
84  unsigned c1, unsigned c2);
85  void doScale1(FrameSource& src,
86  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
87  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
89  void doScale2(FrameSource& src,
90  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
91  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
93 
94 private:
95  PixelOperations<Pixel> pixelOps;
96  Scanline<Pixel> scanline;
97  const RenderSettings& settings;
98 };
99 
100 } // namespace openmsx
101 
102 #endif
Interface for getting lines from a video frame.
Definition: FrameSource.hh:15
Polymorphic line scaler.
Definition: LineScalers.hh:285
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:14
Class containing all settings for renderers.
Base class for 3x scalers.
Definition: Scaler3.hh:12
Helper class to draw scanlines.
Definition: Scanline.hh:44
constexpr mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint32_t Pixel