FBPostProcessor.hh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef FBPOSTPROCESSOR_HH
  2. #define FBPOSTPROCESSOR_HH
  3. #include "PostProcessor.hh"
  4. #include "RenderSettings.hh"
  5. #include "PixelOperations.hh"
  6. #include <vector>
  7. namespace openmsx {
  8. class MSXMotherBoard;
  9. class Display;
  10. template<typename Pixel> class Scaler;
  11. /** Rasterizer using SDL.
  12. */
  13. template <class Pixel>
  14. class FBPostProcessor final : public PostProcessor
  15. {
  16. public:
  17. FBPostProcessor(
  18. MSXMotherBoard& motherBoard, Display& display,
  19. OutputSurface& screen, const std::string& videoSource,
  20. unsigned maxWidth, unsigned height, bool canDoInterlace);
  21. ~FBPostProcessor() override;
  22. // Layer interface:
  23. void paint(OutputSurface& output) override;
  24. std::unique_ptr<RawFrame> rotateFrames(
  25. std::unique_ptr<RawFrame> finishedFrame, EmuTime::param time) override;
  26. private:
  27. void preCalcNoise(float factor);
  28. void drawNoise(OutputSurface& output);
  29. void drawNoiseLine(Pixel* buf, signed char* noise,
  30. size_t width);
  31. // Observer<Setting>
  32. void update(const Setting& setting) override;
  33. /** The currently active scaler.
  34. */
  35. std::unique_ptr<Scaler<Pixel>> currScaler;
  36. /** Currently active scale algorithm, used to detect scaler changes.
  37. */
  38. RenderSettings::ScaleAlgorithm scaleAlgorithm;
  39. /** Currently active scale factor, used to detect scaler changes.
  40. */
  41. unsigned scaleFactor;
  42. /** Remember the noise values to get a stable image when paused.
  43. */
  44. std::vector<unsigned> noiseShift;
  45. PixelOperations<Pixel> pixelOps;
  46. };
  47. } // namespace openmsx
  48. #endif // FBPOSTPROCESSOR_HH