Build an Image and initialize to background color; write to output file
This commit is contained in:
1 parent
6f8e3714da
commit
fa77c0af29
1 file changed
+14
@@ -66,5 +66,19 @@ int Engine::run(string_view input_file, opt<string_view> output_file)
|
|||||||
options.merge(scene->options);
|
options.merge(scene->options);
|
||||||
options.apply_defaults();
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user