blob: 35b798d9ff3dd8762e32de8d25d715dd239c7a25 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include <string>
#include <utility>
#include <fstream>
#include <functional>
namespace imgen {
using color = std::tuple<std::uint8_t, std::uint8_t, std::uint8_t>;
class ppm_pixel_stream {
public:
ppm_pixel_stream(const std::string& path,
const std::size_t width,
const std::size_t height);
ppm_pixel_stream& operator<<(const color& value);
private:
std::ofstream stream_;
};
void write_ppm(
const std::string& path,
const std::size_t sizeX,
const std::size_t sizeY,
std::function<color(std::ptrdiff_t, std::ptrdiff_t)> generator
);
}
|