aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-05-08 19:50:45 +0200
committerAdrian Kummerlaender2016-05-08 19:50:45 +0200
commit21423a44d6e3091addc00c1b0769336e1f154d4e (patch)
treebe468b159f478e70d6d2049d988dbc29c31dcc76 /test.cc
downloadvoronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.tar
voronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.tar.gz
voronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.tar.bz2
voronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.tar.lz
voronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.tar.xz
voronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.tar.zst
voronoi-21423a44d6e3091addc00c1b0769336e1f154d4e.zip
Implement basic PPM writing function
`write_ppm` generates a PPM image using a given generation function. Output is written using `std::ofstream`. The library is intended to become a straight forward way to test out various visualizations.
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test.cc b/test.cc
new file mode 100644
index 0000000..36f637d
--- /dev/null
+++ b/test.cc
@@ -0,0 +1,12 @@
+#include <imgen.h>
+
+int main(int, char*[]) {
+ imgen::write_ppm(
+ "test.ppm",
+ 500,
+ 500,
+ [](std::size_t x, std::size_t y) -> imgen::color {
+ return imgen::color(255, x % 255, y % 255);
+ }
+ );
+}