openMSX
FBPostProcessor.hh
Go to the documentation of this file.
1 #ifndef FBPOSTPROCESSOR_HH
2 #define FBPOSTPROCESSOR_HH
3 
4 #include "PostProcessor.hh"
5 #include "RenderSettings.hh"
6 #include "PixelOperations.hh"
7 #include "ScalerOutput.hh"
8 #include <vector>
9 
10 namespace openmsx {
11 
12 class MSXMotherBoard;
13 class Display;
14 template<typename Pixel> class Scaler;
15 
18 template<typename Pixel>
19 class FBPostProcessor final : public PostProcessor
20 {
21 public:
23  MSXMotherBoard& motherBoard, Display& display,
24  OutputSurface& screen, const std::string& videoSource,
25  unsigned maxWidth, unsigned height, bool canDoInterlace);
26  ~FBPostProcessor() override;
27  FBPostProcessor(const FBPostProcessor&) = delete;
29 
30  // Layer interface:
31  void paint(OutputSurface& output) override;
32 
33  [[nodiscard]] std::unique_ptr<RawFrame> rotateFrames(
34  std::unique_ptr<RawFrame> finishedFrame, EmuTime::param time) override;
35 
36 private:
37  void preCalcNoise(float factor);
38  void drawNoise(OutputSurface& output);
39  void drawNoiseLine(Pixel* buf, signed char* noise,
40  size_t width);
41 
42  // Observer<Setting>
43  void update(const Setting& setting) noexcept override;
44 
45 private:
48  std::unique_ptr<Scaler<Pixel>> currScaler;
49 
52  std::unique_ptr<ScalerOutput<Pixel>> stretchScaler;
53 
56  RenderSettings::ScaleAlgorithm scaleAlgorithm;
57 
60  unsigned scaleFactor;
61 
64  unsigned stretchWidth;
65 
68  OutputSurface* lastOutput = nullptr;
69 
72  std::vector<unsigned> noiseShift;
73 
74  PixelOperations<Pixel> pixelOps;
75 };
76 
77 } // namespace openmsx
78 
79 #endif // FBPOSTPROCESSOR_HH
Represents the output window/screen of openMSX.
Definition: Display.hh:33
Rasterizer using SDL.
FBPostProcessor(MSXMotherBoard &motherBoard, Display &display, OutputSurface &screen, const std::string &videoSource, unsigned maxWidth, unsigned height, bool canDoInterlace)
FBPostProcessor & operator=(const FBPostProcessor &)=delete
FBPostProcessor(const FBPostProcessor &)=delete
void paint(OutputSurface &output) override
Paint this layer.
std::unique_ptr< RawFrame > rotateFrames(std::unique_ptr< RawFrame > finishedFrame, EmuTime::param time) override
Sets up the "abcdFrame" variables for a new frame.
A frame buffer where pixels can be written to.
Abstract base class for post processors.
OutputSurface & screen
The surface which is visible to the user.
ScaleAlgorithm
Scaler algorithm.
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint32_t Pixel