MLAAScaler.hh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef MLAASCALER_HH
  2. #define MLAASCALER_HH
  3. #include "Scaler.hh"
  4. #include "PixelOperations.hh"
  5. namespace openmsx {
  6. /** Scaler that uses a variation of the morphological anti-aliasing algorithm.
  7. * The paper that describes the original MLAA algorithm can be found here:
  8. * http://visual-computing.intel-research.net
  9. * /publications/papers/2009/mlaa/mlaa.pdf
  10. * The original algorithm is a filter; it was adapted to scale the image.
  11. * The classification of edges has been expanded to work better with the
  12. * hand-drawn 2D images we apply the scaler to, as opposed to the 3D rendered
  13. * images that the original algorithm was designed for.
  14. */
  15. template <class Pixel>
  16. class MLAAScaler final : public Scaler<Pixel>
  17. {
  18. public:
  19. MLAAScaler(unsigned dstWidth, const PixelOperations<Pixel>& pixelOps);
  20. void scaleImage(FrameSource& src, const RawFrame* superImpose,
  21. unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
  22. ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) override;
  23. private:
  24. const PixelOperations<Pixel> pixelOps;
  25. const unsigned dstWidth;
  26. };
  27. } // namespace openmsx
  28. #endif