diff --git a/Makefile.am b/Makefile.am index 42570fe0..9c0d8436 100644 --- a/Makefile.am +++ b/Makefile.am @@ -248,10 +248,11 @@ AM_DEFAULT_SOURCE_EXT = .cpp AM_LDFLAGS = $(BOOST_LDFLAGS) bin_PROGRAMS = \ - tools/hash \ tools/json-clean \ tools/json-validate \ - tools/json-schema + tools/json-schema \ + tools/hash \ + tools/noise LDADD = $(top_builddir)/libutil.a $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(ZLIB_LIBS) diff --git a/image.cpp b/image.cpp index 44d06f87..d7af0b58 100644 --- a/image.cpp +++ b/image.cpp @@ -419,5 +419,8 @@ util::ppm::write (const uint8_t *restrict pixels, //----------------------------------------------------------------------------- template struct util::image::buffer; +template struct util::image::buffer; + template util::image::buffer util::image::buffer::alloc (void) const; template util::image::buffer util::image::buffer::clone (void) const; +template util::image::buffer util::image::buffer::clone (void) const; diff --git a/tools/noise.cpp b/tools/noise.cpp new file mode 100644 index 00000000..99b81e84 --- /dev/null +++ b/tools/noise.cpp @@ -0,0 +1,20 @@ +#include "image.hpp" +#include "noise.hpp" +#include "lerp.hpp" + +int +main (void) +{ + util::image::buffer img (1920, 1080); + + //static constexpr auto lerp_t = lerp::cubic; + //using basis_t = util::noise::gradient; + //using noise_t = util::noise::fbm; + + using noise_t = util::noise::fbm>; + + util::noise::fill (img, noise_t {}); + + auto grey = img.clone (); + util::pgm::write (grey, "noise.ppm"); +}