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) 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  std::vector<unsigned> noiseShift;
69 
70  PixelOperations<Pixel> pixelOps;
71 };
72 
73 } // namespace openmsx
74 
75 #endif // FBPOSTPROCESSOR_HH
openmsx::FBPostProcessor::FBPostProcessor
FBPostProcessor(const FBPostProcessor &)=delete
openmsx::PixelOperations
Definition: PixelOperations.hh:144
openmsx::PostProcessor::height
int height
Definition: PostProcessor.hh:143
openmsx::Setting
Definition: Setting.hh:120
openmsx::FBPostProcessor::paint
void paint(OutputSurface &output) override
Paint this layer.
Definition: FBPostProcessor.cc:259
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:98
ScalerOutput.hh
openmsx::MSXMotherBoard
Definition: MSXMotherBoard.hh:61
PostProcessor.hh
openmsx::FBPostProcessor
Rasterizer using SDL.
Definition: FBPostProcessor.hh:20
openmsx::PostProcessor
Abstract base class for post processors.
Definition: PostProcessor.hh:30
openmsx::FBPostProcessor::FBPostProcessor
FBPostProcessor(MSXMotherBoard &motherBoard, Display &display, OutputSurface &screen, const std::string &videoSource, unsigned maxWidth, unsigned height, bool canDoInterlace)
Definition: FBPostProcessor.cc:233
RenderSettings.hh
PixelOperations.hh
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:33
openmsx::FBPostProcessor::rotateFrames
std::unique_ptr< RawFrame > rotateFrames(std::unique_ptr< RawFrame > finishedFrame, EmuTime::param time) override
Sets up the "abcdFrame" variables for a new frame.
Definition: FBPostProcessor.cc:333
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition: OutputSurface.hh:20
openmsx::PostProcessor::maxWidth
int maxWidth
Definition: PostProcessor.hh:142
openmsx::FBPostProcessor::operator=
FBPostProcessor & operator=(const FBPostProcessor &)=delete
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::RenderSettings::ScaleAlgorithm
ScaleAlgorithm
Scaler algorithm.
Definition: RenderSettings.hh:36
openmsx::PostProcessor::screen
OutputSurface & screen
The surface which is visible to the user.
Definition: PostProcessor.hh:109
openmsx::FBPostProcessor::~FBPostProcessor
~FBPostProcessor() override
Definition: FBPostProcessor.cc:253