Skip to content

Commit e457b80

Browse files
committed
Plumb through new settings
1 parent 0508e3b commit e457b80

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

‎blitzexport/src/render_settings.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use blitz::render_settings as brs;
44
pub struct RenderSettings {
55
tone_curve: [f32; 5],
66
exposure_basis: f32,
7+
auto_contrast: bool,
8+
saturation_boost: f32,
79
}
810

911
const TONE_CURVE_CONST: f32 = 2.0;
@@ -26,8 +28,8 @@ impl RenderSettings {
2628
brs::RenderSettings {
2729
tone_curve: tc,
2830
exposure_basis: TONE_CURVE_CONST.powf(self.exposure_basis),
29-
auto_contrast: true,
30-
saturation_boost: 0.2,
31+
auto_contrast: self.auto_contrast,
32+
saturation_boost: self.saturation_boost,
3133
}
3234
}
3335
}

‎gui/Blitz/Blitz/blitz_bindings.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ typedef struct {
3030
typedef struct {
3131
float tone_curve[5];
3232
float exposure_basis;
33+
bool auto_contrast;
34+
float saturation_boost;
3335
} RenderSettings;
3436

3537
void free_buffer(Buffer buf);

‎gui/Blitz/DetailView.swift‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ struct RenderControlsView: View {
6767
let onUpdateClicked: (RenderSettings) -> Void;
6868

6969
@State var exposure: Double = 0
70+
@State var saturation: Double = 0.1
71+
@State var autoContrast: Bool = true
7072

7173
@State var curve0: Double = 0
7274
@State var curve1: Double = 0
@@ -78,7 +80,7 @@ struct RenderControlsView: View {
7880
VStack {
7981
Button(action: {
8082
let tone_curve = (Float(self.curve0), Float(self.curve1), Float(self.curve2), Float(self.curve3), Float(self.curve4))
81-
let rs = RenderSettings(tone_curve: tone_curve, exposure_basis: Float(self.exposure))
83+
let rs = RenderSettings(tone_curve: tone_curve, exposure_basis: Float(self.exposure), auto_contrast: autoContrast, saturation_boost: Float(saturation))
8284
self.onUpdateClicked(rs)
8385

8486
}){
@@ -88,6 +90,14 @@ struct RenderControlsView: View {
8890
Text("Baseline Exposure: \(self.exposure)")
8991
SlideyBoi(value: $exposure, min:-5, max:5)
9092
}
93+
HStack {
94+
Text("Saturation:")
95+
Text("(\(saturation * 100, specifier: "%+2.0f")%)")
96+
SlideyBoi(value: $saturation, min: -1, max:1)
97+
}
98+
HStack {
99+
Toggle("Auto Contrast", isOn: $autoContrast).toggleStyle(SwitchToggleStyle())
100+
}
91101
HStack {
92102
Text("Tone Curve")
93103
Button(action: {

0 commit comments

Comments
 (0)