PathRasterizer.h 482 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2020, Srimanta Barua <srimanta.barua1@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Vector.h>
  8. #include <LibGfx/Bitmap.h>
  9. #include <LibGfx/Path.h>
  10. namespace Gfx {
  11. class PathRasterizer {
  12. public:
  13. PathRasterizer(Gfx::IntSize);
  14. void draw_path(Gfx::Path&);
  15. RefPtr<Gfx::Bitmap> accumulate();
  16. private:
  17. void draw_line(Gfx::FloatPoint, Gfx::FloatPoint);
  18. Gfx::IntSize m_size;
  19. Vector<float> m_data;
  20. };
  21. }