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 <vector>
8 
9 namespace openmsx {
10 
11 class MSXMotherBoard;
12 class Display;
13 template<typename Pixel> class Scaler;
14 
17 template <class Pixel>
18 class FBPostProcessor final : public PostProcessor
19 {
20 public:
22  MSXMotherBoard& motherBoard, Display& display,
23  OutputSurface& screen, const std::string& videoSource,
24  unsigned maxWidth, unsigned height, bool canDoInterlace);
25  ~FBPostProcessor() override;
26 
27  // Layer interface:
28  void paint(OutputSurface& output) override;
29 
30  std::unique_ptr<RawFrame> rotateFrames(
31  std::unique_ptr<RawFrame> finishedFrame, EmuTime::param time) override;
32 
33 private:
34  void preCalcNoise(float factor);
35  void drawNoise(OutputSurface& output);
36  void drawNoiseLine(Pixel* buf, signed char* noise,
37  size_t width);
38 
39  // Observer<Setting>
40  void update(const Setting& setting) override;
41 
44  std::unique_ptr<Scaler<Pixel>> currScaler;
45 
48  RenderSettings::ScaleAlgorithm scaleAlgorithm;
49 
52  unsigned scaleFactor;
53 
56  std::vector<unsigned> noiseShift;
57 
58  PixelOperations<Pixel> pixelOps;
59 };
60 
61 } // namespace openmsx
62 
63 #endif // FBPOSTPROCESSOR_HH
Represents the output window/screen of openMSX.
Definition: Display.hh:31
Abstract base class for scalers.
FBPostProcessor(MSXMotherBoard &motherBoard, Display &display, OutputSurface &screen, const std::string &videoSource, unsigned maxWidth, unsigned height, bool canDoInterlace)
A frame buffer where pixels can be written to.
uint32_t Pixel
void paint(OutputSurface &output) override
Paint this layer.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
OutputSurface & screen
The surface which is visible to the user.
Abstract base class for post processors.
std::unique_ptr< RawFrame > rotateFrames(std::unique_ptr< RawFrame > finishedFrame, EmuTime::param time) override
Sets up the "abcdFrame" variables for a new frame.
ScaleAlgorithm
Scaler algorithm.
Rasterizer using SDL.