OXYGENHUB
◆ main openmsx / src / Paper.hh
752 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef PAPER_HH
2
#define PAPER_HH
3
4
#include <cstdint>
5
#include <string>
6
#include <string_view>
7
#include <vector>
8
9
namespace openmsx {
10
11
/** Paper/Page rendering for printer emulation. */
12
class Paper
13
{
14
public:
15
	static constexpr std::string_view PRINT_DIR = "prints";
16
	static constexpr std::string_view PRINT_EXTENSION = ".png";
17
18
public:
19
	Paper(unsigned x, unsigned y, double dotSizeX, double dotSizeY);
20
21
	[[nodiscard]] std::string save() const;
22
	void setDotSize(double sizeX, double sizeY);
23
	void plot(double x, double y);
24
25
private:
26
	uint8_t& dot(unsigned x, unsigned y);
27
28
private:
29
	std::vector<uint8_t> buf;
30
	std::vector<int> table;
31
32
	double radiusX;
33
	double radiusY;
34
	int radius16;
35
36
	unsigned sizeX;
37
	unsigned sizeY;
38
};
39
40
} // namespace openmsx
41
42
#endif