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 
8 namespace openmsx {
9 
10 class RenderSettings;
11 template<typename Pixel> class PolyLineScaler;
12 
15 template <class Pixel>
16 class RGBTriplet3xScaler final : public Scaler3<Pixel>
17 {
18 public:
20  const RenderSettings& renderSettings);
21 
22 protected:
23  void scaleImage(FrameSource& src, const RawFrame* superImpose,
24  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
25  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
26 
27  void scaleBlank1to3(
28  FrameSource& src, unsigned srcStartY, unsigned srcEndY,
29  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
30  void scaleBlank2to3(
31  FrameSource& src, unsigned srcStartY, unsigned srcEndY,
32  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
33  void scale2x1to9x3(FrameSource& src,
34  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
35  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
36  void scale2x2to9x3(FrameSource& src,
37  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
38  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
39  void scale1x1to3x3(FrameSource& src,
40  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
41  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
42  void scale1x2to3x3(FrameSource& src,
43  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
44  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
45  void scale4x1to9x3(FrameSource& src,
46  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
47  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
48  void scale4x2to9x3(FrameSource& src,
49  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
50  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
51  void scale2x1to3x3(FrameSource& src,
52  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
53  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
54  void scale2x2to3x3(FrameSource& src,
55  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
56  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
57  void scale8x1to9x3(FrameSource& src,
58  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
59  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
60  void scale8x2to9x3(FrameSource& src,
61  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
62  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
63  void scale4x1to3x3(FrameSource& src,
64  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
65  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
66  void scale4x2to3x3(FrameSource& src,
67  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
68  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
69 
70 private:
71  void calcBlur(unsigned& c1, unsigned& c2);
72 
79  void rgbify(const Pixel* in, Pixel* out, unsigned inwidth, unsigned c1, unsigned c2);
80 
81  void scaleLine(const Pixel* srcLine, Pixel* dstLine,
82  PolyLineScaler<Pixel>& scale, unsigned tmpWidth,
83  unsigned c1, unsigned c2);
84  void doScale1(FrameSource& src,
85  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
86  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
88  void doScale2(FrameSource& src,
89  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
90  ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY,
92 
93  PixelOperations<Pixel> pixelOps;
94  Scanline<Pixel> scanline;
95  const RenderSettings& settings;
96 };
97 
98 } // namespace openmsx
99 
100 #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:405
openmsx::RGBTriplet3xScaler::scale4x2to3x3
void scale4x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:286
openmsx::Scanline
Helper class to draw scalines.
Definition: Scanline.hh:43
openmsx::PixelOperations
Definition: PixelOperations.hh:142
openmsx::RenderSettings
Class containing all settings for renderers.
Definition: RenderSettings.hh:21
openmsx::PolyLineScaler
Polymorphic line scaler.
Definition: LineScalers.hh:283
openmsx::RGBTriplet3xScaler::scale2x1to9x3
void scale2x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:176
openmsx::RGBTriplet3xScaler::scale1x2to3x3
void scale1x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:206
openmsx::RGBTriplet3xScaler::scale4x1to3x3
void scale4x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:276
openmsx::RGBTriplet3xScaler::scale8x2to9x3
void scale8x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:266
openmsx::ScalerOutput
Definition: Scaler.hh:8
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:93
openmsx::RGBTriplet3xScaler::scaleBlank1to3
void scaleBlank1to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:313
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:236
openmsx::RGBTriplet3xScaler::scale8x1to9x3
void scale8x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:256
openmsx::RawFrame
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:25
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:226
openmsx::RGBTriplet3xScaler::scale1x1to3x3
void scale1x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:196
openmsx::RGBTriplet3xScaler
TODO.
Definition: RGBTriplet3xScaler.hh:16
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:361
openmsx::Scaler3
Base class for 3x scalers.
Definition: Scaler3.hh:11
openmsx::FrameSource
Interface for getting lines from a video frame.
Definition: FrameSource.hh:13
openmsx::RGBTriplet3xScaler::scale4x1to9x3
void scale4x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:216
openmsx::RGBTriplet3xScaler::scale2x2to9x3
void scale2x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Definition: RGBTriplet3xScaler.cc:186
openmsx
Thanks to enen for testing this on a real cartridge:
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:246