aboutsummaryrefslogtreecommitdiff
path: root/src/imgen.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/imgen.h')
-rw-r--r--src/imgen.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/imgen.h b/src/imgen.h
index 5ddbaf6..35b798d 100644
--- a/src/imgen.h
+++ b/src/imgen.h
@@ -1,16 +1,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::size_t, std::size_t)> generator
+ const std::string& path,
+ const std::size_t sizeX,
+ const std::size_t sizeY,
+ std::function<color(std::ptrdiff_t, std::ptrdiff_t)> generator
);
}