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
openmsx::PixelOperations
Definition: PixelOperations.hh:142
openmsx::Scaler
Abstract base class for scalers.
Definition: FBPostProcessor.hh:13
openmsx::PostProcessor::height
int height
Definition: PostProcessor.hh:143
openmsx::Setting
Definition: Setting.hh:119
openmsx::FBPostProcessor::paint
void paint(OutputSurface &output) override
Paint this layer.
Definition: FBPostProcessor.cc:258
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:93
openmsx::MSXMotherBoard
Definition: MSXMotherBoard.hh:59
PostProcessor.hh
openmsx::FBPostProcessor
Rasterizer using SDL.
Definition: FBPostProcessor.hh:18
openmsx::PostProcessor
Abstract base class for post processors.
Definition: PostProcessor.hh:29
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:31
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:19
openmsx::PostProcessor::maxWidth
int maxWidth
Definition: PostProcessor.hh:142
openmsx
Thanks to enen for testing this on a real cartridge:
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:252