openMSX
FBPostProcessor.hh
Go to the documentation of this file.
1#ifndef FBPOSTPROCESSOR_HH
2#define FBPOSTPROCESSOR_HH
3
4#include "MemBuffer.hh"
5#include "PixelOperations.hh"
6#include "PostProcessor.hh"
7#include "RenderSettings.hh"
8#include "ScalerOutput.hh"
9#include <concepts>
10#include <span>
11
12namespace openmsx {
13
14class MSXMotherBoard;
15class Display;
16template<std::unsigned_integral Pixel> class Scaler;
17
20template<std::unsigned_integral Pixel>
21class FBPostProcessor final : public PostProcessor
22{
23public:
25 MSXMotherBoard& motherBoard, Display& display,
26 OutputSurface& screen, const std::string& videoSource,
27 unsigned maxWidth, unsigned height, bool canDoInterlace);
28 ~FBPostProcessor() override;
31
32 // Layer interface:
33 void paint(OutputSurface& output) override;
34
35 [[nodiscard]] std::unique_ptr<RawFrame> rotateFrames(
36 std::unique_ptr<RawFrame> finishedFrame, EmuTime::param time) override;
37
38private:
39 void preCalcNoise(float factor);
40 void drawNoise(OutputSurface& output);
41 void drawNoiseLine(std::span<Pixel> buf, signed char* noise);
42
43 // Observer<Setting>
44 void update(const Setting& setting) noexcept override;
45
46private:
49 std::unique_ptr<Scaler<Pixel>> currScaler;
50
53 std::unique_ptr<ScalerOutput<Pixel>> stretchScaler;
54
58
61 unsigned scaleFactor = unsigned(-1);
62
65 unsigned stretchWidth = unsigned(-1);
66
69 OutputSurface* lastOutput = nullptr;
70
73 MemBuffer<uint16_t> noiseShift;
74
76};
77
78} // namespace openmsx
79
80#endif // FBPOSTPROCESSOR_HH
BaseSetting * setting
Definition: Interpreter.cc:28
Represents the output window/screen of openMSX.
Definition: Display.hh:33
Rasterizer using SDL.
FBPostProcessor & operator=(const FBPostProcessor &)=delete
FBPostProcessor(MSXMotherBoard &motherBoard, Display &display, OutputSurface &screen, const std::string &videoSource, unsigned maxWidth, unsigned height, bool canDoInterlace)
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:9