From fa77c0af295aee657d543816f43543f2273294a8 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 3 Nov 2026 19:51:25 -0500 Subject: [PATCH] Build an Image and initialize to background color; write to output file --- src/fart/Engine.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/fart/Engine.cpp b/src/fart/Engine.cpp index 9050d48..5ab7477 100644 --- a/src/fart/Engine.cpp +++ b/src/fart/Engine.cpp @@ -66,5 +66,19 @@ int Engine::run(string_view input_file, opt output_file) options.merge(scene->options); options.apply_defaults(); + Image image(*options.width, *options.height); + for (size_t y = 0u; y < *options.height; y++) + { + for (size_t x = 0u; x < *options.width; x++) + { + image[x, y] = *options.background; + } + } + + if (!image_writer->write(image)) + { + return 1; + } + return 0; }