#pragma once #include #include #include #include "renderer.hpp" #include "bitmap.hpp" class PgmRenderer : public Renderer { public: PgmRenderer(const std::filesystem::path& path, size_t width, size_t height); void DrawLine(const math::Vector& p0, const math::Vector& p1) override; void DrawRectangle(const math::Vector& pos, const math::Vector& size, float angle) override; void DrawCircle(const math::Vector& center, float radius) override; ~PgmRenderer() override; private: std::ofstream m_file; Bitmap m_bitmap; void RasterizeLine(int x0, int y0, int x1, int y1); void RasterizeCircle(int xm, int ym, int r); void Flush(); };