-
Notifications
You must be signed in to change notification settings - Fork 2
/
renderconfigform.cpp
70 lines (44 loc) · 1.21 KB
/
renderconfigform.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "renderconfigform.h"
#include "ui_renderconfigform.h"
using namespace RenderConf;
RenderConfigForm::RenderConfigForm(QWidget *parent)
: QWidget(parent)
, ui(new Ui::RenderConfigForm)
{
ui->setupUi(this);
}
RenderConfigForm::~RenderConfigForm()
{
delete ui;
}
RenderConf::RenderConfig RenderConfigForm::GetConfig()
{
RenderConfig Rend;
Rend.NumSteps = ui->spbnSteps->value();
Rend.Sampler = ui->cbSampler->currentIndex();
Rend.Vae = ui->rbFullVae->isChecked() ? VaeSel::Normal : VaeSel::Tiny;
return Rend;
}
void RenderConfigForm::SetConfig(const RenderConf::RenderConfig &InConf)
{
ui->spbnSteps->setValue(InConf.NumSteps);
ui->cbSampler->setCurrentIndex(InConf.Sampler);
ui->rbFullVae->setChecked(InConf.Vae == VaeSel::Normal);
ui->rbTinyVae->setChecked(InConf.Vae == VaeSel::Tiny);
}
ZFILE_OOVR(RenderConf::RenderConfig, RendCof)
{
right >> RendCof.NumSteps;
right >> RendCof.Sampler;
int32_t vae;
right >> vae;
RendCof.Vae = (RenderConf::VaeSel)vae;
return right;
}
ZFILE_IOVR(RenderConf::RenderConfig, RendCof)
{
right << RendCof.NumSteps;
right << RendCof.Sampler;
right << (int32_t)RendCof.Vae;
return right;
}