25 lines
668 B
C++
25 lines
668 B
C++
#pragma once
|
|
|
|
#include "bitmap.hpp"
|
|
#include "drawing_context.hpp"
|
|
#include <cstddef>
|
|
#include <filesystem>
|
|
|
|
class PgmDrawingContext : public DrawingContext
|
|
{
|
|
public:
|
|
PgmDrawingContext(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;
|
|
|
|
void Flush() override;
|
|
|
|
~PgmDrawingContext() override = default;
|
|
|
|
private:
|
|
Bitmap m_bitmap;
|
|
|
|
void RasterizeLine(int x0, int y0, int x1, int y1);
|
|
}; |