Add background RenderParams entry
This commit is contained in:
1 parent
0a979c487c
commit
c1c8c46ac7
2 files changed
+10
No files matched your search
@@ -15,6 +15,10 @@ void RenderParams::merge(const RenderParams & other)
|
||||
{
|
||||
threads = other.threads;
|
||||
}
|
||||
if (!background)
|
||||
{
|
||||
background = other.background;
|
||||
}
|
||||
}
|
||||
|
||||
void RenderParams::apply_defaults()
|
||||
@@ -33,4 +37,8 @@ void RenderParams::apply_defaults()
|
||||
size_t n = std::thread::hardware_concurrency();
|
||||
threads = n > 0u ? n : 1u;
|
||||
}
|
||||
if (!background)
|
||||
{
|
||||
background = Color{0.0, 0.0, 0.0, 1.0};
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <fart/Color.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct RenderParams
|
||||
@@ -7,6 +8,7 @@ struct RenderParams
|
||||
opt<size_t> width;
|
||||
opt<size_t> height;
|
||||
opt<size_t> threads;
|
||||
opt<Color> background;
|
||||
|
||||
/* Set each field that is not already set to the value from other. */
|
||||
void merge(const RenderParams & other);
|
||||
|
||||
Reference in new issue
Block a user