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
openmsx::RGBTriplet3xScaler::scaleImage
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.
Definition: RGBTriplet3xScaler.cc:402
openmsx::RGBTriplet3xScaler::scale4x2to3x3
void scale4x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:285
openmsx::Scanline
Helper class to draw scalines.
Definition: Scanline.hh:44
openmsx::PixelOperations
Definition: PixelOperations.hh:144
openmsx::RenderSettings
Class containing all settings for renderers.
Definition: RenderSettings.hh:22
openmsx::PolyLineScaler
Polymorphic line scaler.
Definition: LineScalers.hh:284
openmsx::RGBTriplet3xScaler::scale2x1to9x3
void scale2x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:175
openmsx::RGBTriplet3xScaler::scale1x2to3x3
void scale1x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:205
openmsx::RGBTriplet3xScaler::scale4x1to3x3
void scale4x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:275
openmsx::RGBTriplet3xScaler::scale8x2to9x3
void scale8x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:265
openmsx::ScalerOutput
Definition: ScalerOutput.hh:7
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:98
openmsx::RGBTriplet3xScaler::scaleBlank1to3
void scaleBlank1to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:312
Scaler3.hh
openmsx::RGBTriplet3xScaler::RGBTriplet3xScaler
RGBTriplet3xScaler(const PixelOperations< Pixel > &pixelOps, const RenderSettings &renderSettings)
Definition: RGBTriplet3xScaler.cc:14
openmsx::RGBTriplet3xScaler::scale2x1to3x3
void scale2x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:235
openmsx::RGBTriplet3xScaler::scale8x1to9x3
void scale8x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:255
openmsx::RawFrame
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:26
PixelOperations.hh
Scanline.hh
openmsx::RGBTriplet3xScaler::scale4x2to9x3
void scale4x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:225
openmsx::RGBTriplet3xScaler::scale1x1to3x3
void scale1x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:195
openmsx::RGBTriplet3xScaler
TODO.
Definition: RGBTriplet3xScaler.hh:18
gl::scale
mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
openmsx::RGBTriplet3xScaler::scaleBlank2to3
void scaleBlank2to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:359
openmsx::Scaler3
Base class for 3x scalers.
Definition: Scaler3.hh:12
openmsx::FrameSource
Interface for getting lines from a video frame.
Definition: FrameSource.hh:14
openmsx::RGBTriplet3xScaler::scale4x1to9x3
void scale4x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:215
openmsx::RGBTriplet3xScaler::scale2x2to9x3
void scale2x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:185
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::RGBTriplet3xScaler::scale2x2to3x3
void scale2x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:245