The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
feat(color): lift, gamma and gain wheels and RGB and luma curves, in the Adjust tab and as effects
Jareerdd0f8ecd0db1
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex cebff359..a0d3fa29 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -195,6 +195,15 @@ ACEScct, in log; tables are kept in floats and uploaded as half floats.Looks an earlier build imported as format 1 are rewritten onto this whenthe window loads its packages.+Knobs are numbers in the document (`AppliedFilter::params`), and two kinds+are several: a `wheel` is its puck, `<key>.x` and `<key>.y`, and its master,+`<key>.m`, keyed together as one knob; a `curve` is up to eight points,+`<key>.<n>.x` and `<key>.<n>.y`, which the catalogue lays into the shader+with the slopes that keep it from overshooting (`grade_wheels`,+`grade_curves`). The window draws them with widgets of their own+(`concat/ui/inspector/grading.slint`) in the Adjust tab and in the effect+stack, and edits them through `concat/src/grading.rs`.+## 4. Decoding, caching and schedulingExport decodes every frame once, in order, with one decoder per clip. Everythingdiff --git a/src/crates/concat-effects/packages/concat.adjust/effect.toml b/src/crates/concat-effects/packages/concat.adjust/effect.tomlindex df0c6069..6cce6ce9 100644--- a/src/crates/concat-effects/packages/concat.adjust/effect.toml+++ b/src/crates/concat-effects/packages/concat.adjust/effect.toml@@ -16,6 +16,8 @@ description = "The manual colour panel every picture clip carries: exposure, ton# percents; the last four lift or crush their end of the curve, highlights# and shadows the broad upper and lower halves, whites and blacks the# narrow extremes. Effects: sharpen, fade and vignette add from zero.+# Wheels: lift, gamma and gain, each a hue to push towards and a master.+# Curves: luma, then red, green and blue.## 2: drawn in light. Exposure is in true stops of light, where it scaled# the display encoding, some 2.4 stops an EV; the rest reads as it did at@@ -152,6 +154,63 @@ default = 0step = 1unit = "%"+[[param]]+key = "lift"+group = "Wheels"+label = "Lift"+type = "wheel"+min = -1+max = 1+default = 0+step = 0.01+animate = true++[[param]]+key = "gamma"+group = "Wheels"+label = "Gamma"+type = "wheel"+min = -1+max = 1+default = 0+step = 0.01+animate = true++[[param]]+key = "gain"+group = "Wheels"+label = "Gain"+type = "wheel"+min = -1+max = 1+default = 0+step = 0.01+animate = true++[[param]]+key = "luma"+group = "Curves"+label = "Luma"+type = "curve"++[[param]]+key = "red"+group = "Curves"+label = "Red"+type = "curve"++[[param]]+key = "green"+group = "Curves"+label = "Green"+type = "curve"++[[param]]+key = "blue"+group = "Curves"+label = "Blue"+type = "curve"+[wgsl]entry = "effect.wgsl"diff --git a/src/crates/concat-effects/packages/concat.adjust/effect.wgsl b/src/crates/concat-effects/packages/concat.adjust/effect.wgslindex 2551ba40..53728286 100644--- a/src/crates/concat-effects/packages/concat.adjust/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.adjust/effect.wgsl@@ -12,6 +12,13 @@ struct Params {sharpen: f32,vignette: f32,fade: f32,+ lift: vec3<f32>,+ gamma: vec3<f32>,+ gain: vec3<f32>,+ luma: array<vec4<f32>, 8>,+ red: array<vec4<f32>, 8>,+ green: array<vec4<f32>, 8>,+ blue: array<vec4<f32>, 8>,}// The manual colour panel, in the order a colourist works: exposure and@@ -19,9 +26,9 @@ struct Params {// does is done in light - exposure in stops, the white balance, the// vignette - and contrast in stops about middle grey; what an eye judges// on the picture - brightness, saturation, the four tonal bands, the fade,-// sharpness - in the display encoding its sliders were drawn in, which-// here is never clipped: a highlight past white is carried on past it.-// Every knob at its default is the picture as it came.+// the wheels and curves, sharpness - in the display encoding its sliders+// were drawn in, which here is never clipped: a highlight past white is+// carried on past it. Every knob at its default is the picture as it came./// `by` added to a display-encoded colour, as far down as black and no/// further: a channel that is lit is not taken below nothing.@@ -59,9 +66,13 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {let black = (1.0 - smoothstep(0.0, 0.25, l)) * params.blacks / 100.0 * 0.1;let white = smoothstep(0.75, 1.0, l) * params.whites / 100.0 * 0.1;d = lifted(d, low + high + black + white);- let lift = params.fade / 100.0 * 0.25;+ let matte = params.fade / 100.0 * 0.25;let below = min(d, vec3<f32>(1.0));- d = below * (1.0 - lift) + vec3<f32>(lift) + (d - below);+ d = below * (1.0 - matte) + vec3<f32>(matte) + (d - below);++ // The wheels, then the curves, on the display level too.+ d = grade_wheels(d, params.lift, params.gamma, params.gain);+ d = grade_curves(d, params.luma, params.red, params.green, params.blue);// Sharpen: the picture's difference from a small blur of it, scaled.if (params.sharpen > 0.0) {diff --git a/src/crates/concat-effects/packages/concat.adjust/fixtures.toml b/src/crates/concat-effects/packages/concat.adjust/fixtures.tomlindex 12173217..5474e741 100644--- a/src/crates/concat-effects/packages/concat.adjust/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.adjust/fixtures.toml@@ -9,20 +9,22 @@ name = "default"input = [0.3, 0.2, 0.12, 1]expect = [0.3, 0.2, 0.12, 1]-# Three stops down, the black lifted away and the contrast flat: a grey.+# Three stops down, the black lifted away, the contrast flat, and the+# wheels all the way down: all but black.[[probe]]name = "minimum"at = "min"input = [6.0, 5.0, 4.0, 1]-expect = [0.130138, 0.130138, 0.130138, 1]+expect = [1.58091e-05, 1.58091e-05, 1.58091e-05, 1]# Every knob up: three true stops, brightness, contrast twice the stops,-# three times the saturation. Far past white, as light asked for it is.+# three times the saturation, the wheels all the way up. Far past white, as+# light asked for it is.[[probe]]name = "maximum"at = "max"input = [0.08, 0.07, 0.06, 1]-expect = [447.66, 0.00821351, 310.039, 1]+expect = [2362.76, 2.67506, 1636.4, 1]# A moderate grade: a stop up, a little contrast and colour, a warm light.[[probe]]@@ -43,3 +45,11 @@ name = "fade, past white"params = { fade = 50 }input = [4.0, 4.0, 4.0, 1]expect = [4.0, 4.0, 4.0, 1]++# The lift pushed towards red, the gain a little up, the luma curve through+# (0.5, 0.6).+[[probe]]+name = "wheels and a curve"+params = { "lift.y" = 0.5, "gain.m" = 0.2, "luma.0.x" = 0, "luma.0.y" = 0, "luma.1.x" = 0.5, "luma.1.y" = 0.6, "luma.2.x" = 1, "luma.2.y" = 1 }+input = [0.18, 0.18, 0.18, 1]+expect = [0.493822, 0.337644, 0.337644, 1]diff --git a/src/crates/concat-effects/packages/concat.color-wheels/effect.toml b/src/crates/concat-effects/packages/concat.color-wheels/effect.tomlnew file mode 100644index 00000000..184951de--- /dev/null+++ b/src/crates/concat-effects/packages/concat.color-wheels/effect.toml@@ -0,0 +1,51 @@+format = 2++[effect]+id = "concat.color-wheels"+name = "Color Wheels"+kind = "effect"+category = "Color"+order = 14+description = "Lift, gamma and gain: the shadows, midtones and highlights each pushed towards a hue and made brighter or darker."++[[param]]+key = "lift"+group = "Wheels"+label = "Lift"+type = "wheel"+min = -1+max = 1+default = 0+step = 0.01+animate = true++[[param]]+key = "gamma"+group = "Wheels"+label = "Gamma"+type = "wheel"+min = -1+max = 1+default = 0+step = 0.01+animate = true++[[param]]+key = "gain"+group = "Wheels"+label = "Gain"+type = "wheel"+min = -1+max = 1+default = 0+step = 0.01+animate = true++[wgsl]+entry = "effect.wgsl"+space = "display"++# At rest the picture is as shot; the card shows a teal shadow and a warm+# highlight.+[card]+params = { "lift.x" = 0.0, "lift.y" = -0.6, "gain.x" = 0.35, "gain.y" = 0.45 }diff --git a/src/crates/concat-effects/packages/concat.color-wheels/effect.wgsl b/src/crates/concat-effects/packages/concat.color-wheels/effect.wgslnew file mode 100644index 00000000..4644b7b5--- /dev/null+++ b/src/crates/concat-effects/packages/concat.color-wheels/effect.wgsl@@ -0,0 +1,11 @@+struct Params { lift: vec3<f32>, gamma: vec3<f32>, gain: vec3<f32> }++// Lift, gamma and gain on the display level (see `grade_wheels`): each+// wheel's puck a hue to push towards - red at the top - and its master a+// brighter or darker; lift moves black and leaves white, gamma bends the+// midtones, gain scales every level, past white too. What the Adjust+// panel's wheels do, alone.+fn effect(uv: vec2<f32>) -> vec4<f32> {+ let c = sample(uv);+ return vec4<f32>(grade_wheels(c.rgb, params.lift, params.gamma, params.gain), c.a);+}diff --git a/src/crates/concat-effects/packages/concat.color-wheels/fixtures.toml b/src/crates/concat-effects/packages/concat.color-wheels/fixtures.tomlnew file mode 100644index 00000000..83e2dcfb--- /dev/null+++ b/src/crates/concat-effects/packages/concat.color-wheels/fixtures.toml@@ -0,0 +1,38 @@+# Lift, gamma and gain on the display level: masters down darken, masters+# up brighten, a puck pushes its end of the picture towards its hue, and+# gamma leaves white where it is and carries a level past it on.++[[probe]]+name = "default"+input = [0.3, 0.2, 0.12, 1]+expect = [0.3, 0.2, 0.12, 1]++[[probe]]+name = "minimum, every master down"+at = "min"+input = [0.3, 0.2, 0.12, 1]+expect = [0.00257149, 0.000335419, 7.21473e-06, 1]++[[probe]]+name = "maximum, every master up"+at = "max"+input = [0.3, 0.2, 0.12, 1]+expect = [4.05487, 3.77131, 3.47967, 1]++[[probe]]+name = "the lift towards red, at the top"+params = { "lift.y" = 1 }+input = [0.02, 0.02, 0.02, 1]+expect = [0.108882, 0.00918199, 0.00918199, 1]++[[probe]]+name = "the gain towards blue"+params = { "gain.x" = -0.866025, "gain.y" = -0.5 }+input = [0.5, 0.5, 0.5, 1]+expect = [0.468661, 0.468661, 1.1487, 1]++[[probe]]+name = "gamma up, white kept and past white carried"+params = { "gamma.m" = 0.5 }+input = [4.0, 1.0, 0.18, 1]+expect = [4.0, 1.0, 0.297439, 1]diff --git a/src/crates/concat-effects/packages/concat.curves/effect.toml b/src/crates/concat-effects/packages/concat.curves/effect.tomlnew file mode 100644index 00000000..054c3312--- /dev/null+++ b/src/crates/concat-effects/packages/concat.curves/effect.toml@@ -0,0 +1,41 @@+format = 2++[effect]+id = "concat.curves"+name = "Curves"+kind = "effect"+category = "Color"+order = 15+description = "The picture's levels bent along curves you draw: luma for brightness alone, then red, green and blue."++[[param]]+key = "luma"+group = "Curves"+label = "Luma"+type = "curve"++[[param]]+key = "red"+group = "Curves"+label = "Red"+type = "curve"++[[param]]+key = "green"+group = "Curves"+label = "Green"+type = "curve"++[[param]]+key = "blue"+group = "Curves"+label = "Blue"+type = "curve"++[wgsl]+entry = "effect.wgsl"+space = "display"++# At rest the picture is as shot; the card shows a gentle S.+[card]+params = { "luma.0.x" = 0.0, "luma.0.y" = 0.0, "luma.1.x" = 0.25, "luma.1.y" = 0.18, "luma.2.x" = 0.75, "luma.2.y" = 0.84, "luma.3.x" = 1.0, "luma.3.y" = 1.0 }diff --git a/src/crates/concat-effects/packages/concat.curves/effect.wgsl b/src/crates/concat-effects/packages/concat.curves/effect.wgslnew file mode 100644index 00000000..191af81f--- /dev/null+++ b/src/crates/concat-effects/packages/concat.curves/effect.wgsl@@ -0,0 +1,15 @@+struct Params {+ luma: array<vec4<f32>, 8>,+ red: array<vec4<f32>, 8>,+ green: array<vec4<f32>, 8>,+ blue: array<vec4<f32>, 8>,+}++// Curves on the display level (see `grade_curves`): the luma curve moves a+// level's brightness and keeps its colour, then red, green and blue each+// follow their own; a level past white is carried on past the curve's+// white. What the Adjust panel's curves do, alone.+fn effect(uv: vec2<f32>) -> vec4<f32> {+ let c = sample(uv);+ return vec4<f32>(grade_curves(c.rgb, params.luma, params.red, params.green, params.blue), c.a);+}diff --git a/src/crates/concat-effects/packages/concat.curves/fixtures.toml b/src/crates/concat-effects/packages/concat.curves/fixtures.tomlnew file mode 100644index 00000000..f4471386--- /dev/null+++ b/src/crates/concat-effects/packages/concat.curves/fixtures.toml@@ -0,0 +1,39 @@+# Curves on the display level. With no points a curve is the line from+# black to white, at every bound; an S on luma darkens the shadows and+# brightens the highlights and keeps each colour's hue; a level past white+# is carried on past the curve's white.++[[probe]]+name = "default"+input = [0.3, 0.2, 0.12, 1]+expect = [0.3, 0.2, 0.12, 1]++[[probe]]+name = "minimum"+at = "min"+input = [0.3, 0.2, 0.12, 1]+expect = [0.3, 0.2, 0.12, 1]++[[probe]]+name = "maximum"+at = "max"+input = [0.3, 0.2, 0.12, 1]+expect = [0.3, 0.2, 0.12, 1]++[[probe]]+name = "an S on luma"+params = { "luma.0.x" = 0, "luma.0.y" = 0, "luma.1.x" = 0.25, "luma.1.y" = 0.18, "luma.2.x" = 0.75, "luma.2.y" = 0.84, "luma.3.x" = 1, "luma.3.y" = 1 }+input = [0.3, 0.2, 0.12, 1]+expect = [0.334194, 0.222796, 0.133677, 1]++[[probe]]+name = "an S on luma, past white"+params = { "luma.0.x" = 0, "luma.0.y" = 0, "luma.1.x" = 0.25, "luma.1.y" = 0.18, "luma.2.x" = 0.75, "luma.2.y" = 0.84, "luma.3.x" = 1, "luma.3.y" = 1 }+input = [4.0, 2.0, 1.0, 1]+expect = [4.0, 2.0, 1.0, 1]++[[probe]]+name = "red lifted at black and held down at white"+params = { "red.0.x" = 0, "red.0.y" = 0.1, "red.1.x" = 1, "red.1.y" = 0.9 }+input = [0.0, 0.5, 1.0, 1]+expect = [0.00398107, 0.5, 1.0, 1]diff --git a/src/crates/concat-effects/src/catalogue.rs b/src/crates/concat-effects/src/catalogue.rsindex 0f663a6d..0701e7e7 100644--- a/src/crates/concat-effects/src/catalogue.rs+++ b/src/crates/concat-effects/src/catalogue.rs@@ -19,7 +19,7 @@ use crate::Error;use crate::expr::{Expr, Value};use concat_core::{Lut, RevealMap, ShaderPass, TransitionPass};-use crate::manifest::{Kind, Manifest};+use crate::manifest::{Kind, Manifest, ParamType};use crate::shader::{Shader, TransitionShader};use crate::template::Template;@@ -378,7 +378,7 @@ impl Package {if let Some(key) = probe.params.keys()- .find(|key| manifest.param(key).is_none() && !(filter && key.as_str() == INTENSITY))+ .find(|key| manifest.owner(key).is_none() && !(filter && key.as_str() == INTENSITY)){return Err(invalid(format!("fixtures: probe `{}` sets `{key}`, which is not a parameter",@@ -641,20 +641,24 @@ impl Package {self.id() == id || self.manifest.effect.aliases.iter().any(|alias| alias == id)}- /// Every declared parameter at `at`.+ /// Every declared parameter at `at`: a wheel's master there too, its+ /// puck at the middle; a curve is the straight line at every one.pub fn params_at(&self, at: At) -> BTreeMap<String, f64> {- self.manifest- .params- .iter()- .map(|param| {- let value = match at {- At::Default => param.default,- At::Min => param.min,- At::Max => param.max,- };- (param.key.clone(), value)- })- .collect()+ let mut params = BTreeMap::new();+ for param in &self.manifest.params {+ let value = match at {+ At::Default => param.default,+ At::Min => param.min,+ At::Max => param.max,+ };+ params.insert(param.key.clone(), value);+ if param.kind == ParamType::Wheel {+ params.insert(format!("{}.x", param.key), 0.0);+ params.insert(format!("{}.y", param.key), 0.0);+ params.insert(format!("{}.m", param.key), value);+ }+ }+ params}/// Every declared parameter at `at`, with `set` on top.@@ -664,17 +668,26 @@ impl Package {params}- /// Every declared parameter: the value in `set`, or the default. Keys- /// the manifest does not declare are dropped.+ /// Every declared parameter: the value in `set`, or the default, and a+ /// compound knob's dotted keys as `set` has them - a wheel's puck and+ /// master, a curve's points. Keys the manifest does not own are+ /// dropped.pub fn resolve(&self, set: &BTreeMap<String, f64>) -> BTreeMap<String, f64> {- self.manifest- .params- .iter()- .map(|param| {- let value = set.get(¶m.key).copied().unwrap_or(param.default);- (param.key.clone(), value)- })- .collect()+ let mut values = BTreeMap::new();+ for param in &self.manifest.params {+ let value = set.get(¶m.key).copied().unwrap_or(param.default);+ values.insert(param.key.clone(), value);+ if param.kind.is_compound() {+ let prefix = format!("{}.", param.key);+ values.extend(+ set.range(prefix.clone()..)+ .take_while(|(key, _)| key.starts_with(&prefix))+ .filter(|(key, _)| self.manifest.owner(key).is_some())+ .map(|(key, value)| (key.clone(), *value)),+ );+ }+ }+ values}/// The FFmpeg fragment for these parameters, or `None` when the packagediff --git a/src/crates/concat-effects/src/lib.rs b/src/crates/concat-effects/src/lib.rsindex b1c0bfe6..f4ab297c 100644--- a/src/crates/concat-effects/src/lib.rs+++ b/src/crates/concat-effects/src/lib.rs@@ -242,6 +242,36 @@ mod tests {assert!(gaps.is_empty(), "\n{}", gaps.join("\n"));}+ /// A compound knob's dotted keys reach its shader: a wheel's puck and a+ /// curve's points go through `resolve` with the knobs, and keys the+ /// package does not own stay behind.+ #[test]+ fn a_compound_knob_is_resolved_whole() {+ let package = Catalogue::builtin()+ .get("concat.color-wheels")+ .expect("a built-in");+ let set: BTreeMap<String, f64> = [+ ("lift.x", 0.5),+ ("lift.m", -0.25),+ ("lift.q", 9.0),+ ("stray", 1.0),+ ]+ .into_iter()+ .map(|(key, value)| (key.to_owned(), value))+ .collect();+ let values = package.resolve(&set);+ assert_eq!(values.get("lift.x"), Some(&0.5));+ assert_eq!(values.get("lift.m"), Some(&-0.25));+ assert!(!values.contains_key("lift.q") && !values.contains_key("stray"));+ let bounds = package.params_at(At::Max);+ assert_eq!(+ bounds.get("gain.m"),+ Some(&1.0),+ "a wheel's master at its bound"+ );+ assert_eq!(bounds.get("gain.x"), Some(&0.0), "its puck in the middle");+ }+const EXPOSED: &str = "format = 2\n[effect]\nid = \"a.lift\"\nname = \"Lift\"\nkind = \"effect\"\n\[[param]]\nkey = \"stops\"\nlabel = \"Stops\"\nmin = -2\nmax = 2\n\[wgsl]\nentry = \"effect.wgsl\"\n";diff --git a/src/crates/concat-effects/src/manifest.rs b/src/crates/concat-effects/src/manifest.rsindex 056f8062..5987d7ae 100644--- a/src/crates/concat-effects/src/manifest.rs+++ b/src/crates/concat-effects/src/manifest.rs@@ -235,6 +235,28 @@ pub enum ParamType {/// A position on the picture, stored as two keys `<key>.x` and `<key>.y`/// in the 0..1 square.Point,+ /// A colour wheel: a puck on a disc of hues, stored as `<key>.x` and+ /// `<key>.y` - where it sits in the unit disc, the middle being grey -+ /// and a master, `<key>.m`, between `min` and `max` from `default`. The+ /// shader reads a `vec3<f32>`: x, y and the master. Keyed as one knob.+ Wheel,+ /// A curve through up to [`MAX_CURVE_POINTS`] points of the unit square,+ /// stored as `<key>.<n>.x` and `<key>.<n>.y`; none stored is the line+ /// from black to white. The shader reads an `array<vec4<f32>, 8>`: each+ /// point's x and y, the slope the curve leaves it at, and the count of+ /// points. It holds for the clip: it takes no keys.+ Curve,+}++/// The most points a curve may have.+pub const MAX_CURVE_POINTS: usize = 8;++impl ParamType {+ /// Whether the knob is stored as several numbers under dotted keys of+ /// its own, rather than as one number under its key.+ pub fn is_compound(self) -> bool {+ matches!(self, ParamType::Point | ParamType::Wheel | ParamType::Curve)+ }}/// The `[ffmpeg]` table: a filter chain template.@@ -506,6 +528,12 @@ impl Manifest {param.key, param.default, param.min, param.max)));}+ if param.kind == ParamType::Curve && param.animate {+ return Err(self.invalid(format!(+ "curve `{}` holds for the clip: it cannot be animated",+ param.key+ )));+ }if param.kind == ParamType::Enum {if param.values.is_empty() {return Err(self.invalid(format!("enum `{}` lists no values", param.key)));@@ -640,13 +668,11 @@ impl Manifest {return Err(self.invalid("[card] is for a package that draws the picture"));}for (key, value) in &card.params {- let point = key- .split_once('.')- .filter(|(_, axis)| *axis == "x" || *axis == "y")- .and_then(|(name, _)| self.param(name))- .filter(|param| param.kind == ParamType::Point);- let range = match (self.param(key), point) {+ let range = match (self.param(key), self.owner(key)) {(Some(param), _) => param.min..=param.max,+ // A wheel's master is its range; its puck is the unit disc's.+ (None, Some(param)) if key.ends_with(".m") => param.min..=param.max,+ (None, Some(param)) if param.kind == ParamType::Wheel => -1.0..=1.0,(None, Some(_)) => 0.0..=1.0,(None, None) if key == "intensity" && self.effect.kind == Kind::Filter => {0.0..=100.0@@ -701,6 +727,26 @@ impl Manifest {pub fn param(&self, key: &str) -> Option<&Param> {self.params.iter().find(|param| param.key == key)}++ /// The parameter a document key belongs to: a declared key's own, or a+ /// compound knob's for one of its dotted keys - a point's `<key>.x`, a+ /// wheel's `<key>.m`, a curve's `<key>.3.y`. None for anything else.+ pub fn owner(&self, key: &str) -> Option<&Param> {+ if let Some(param) = self.param(key) {+ return Some(param);+ }+ let (name, rest) = key.split_once('.')?;+ let param = self.param(name)?;+ let owned = match param.kind {+ ParamType::Point => matches!(rest, "x" | "y"),+ ParamType::Wheel => matches!(rest, "x" | "y" | "m"),+ ParamType::Curve => rest.split_once('.').is_some_and(|(n, axis)| {+ n.parse::<usize>().is_ok_and(|n| n < MAX_CURVE_POINTS) && matches!(axis, "x" | "y")+ }),+ _ => false,+ };+ owned.then_some(param)+ }}#[cfg(test)]@@ -930,6 +976,43 @@ mod tests {);}+ /// A wheel owns its puck and master and a curve its points, each under+ /// its own key; a curve takes no keys.+ #[test]+ fn a_compound_knob_owns_its_dotted_keys() {+ let manifest = Manifest::parse(+ "format = 2\n[effect]\nid = \"test.grade\"\nname = \"Grade\"\nkind = \"effect\"\n\+ [[param]]\nkey = \"lift\"\nlabel = \"Lift\"\ntype = \"wheel\"\nmin = -1\nmax = 1\n\+ [[param]]\nkey = \"luma\"\nlabel = \"Luma\"\ntype = \"curve\"\n\+ [[param]]\nkey = \"amount\"\nlabel = \"Amount\"\n\+ [wgsl]\nentry = \"effect.wgsl\"\n",+ )+ .expect("parses");+ for key in [+ "lift", "lift.x", "lift.y", "lift.m", "luma", "luma.0.x", "luma.7.y", "amount",+ ] {+ assert!(manifest.owner(key).is_some(), "{key}");+ }+ for key in [+ "lift.z", "luma.8.x", "luma.0", "luma.x", "amount.x", "other",+ ] {+ assert!(manifest.owner(key).is_none(), "{key}");+ }+ assert!(ParamType::Wheel.is_compound() && ParamType::Curve.is_compound());+ assert!(!ParamType::Float.is_compound());+ rejects(+ &format!(+ "format = 2\n{}",+ GOOD.replace(+ "[ffmpeg]\n chain = \"gblur=sigma={fixed(radius, 1)}\"",+ "[wgsl]\n entry = \"effect.wgsl\""+ )+ .replace("unit = \"px\"", "type = \"curve\"\n animate = true")+ ),+ "cannot be animated",+ );+ }+#[test]fn a_transition_manifest_parses() {let manifest = Manifest::parse(GOOD_TRANSITION).expect("parses");diff --git a/src/crates/concat-effects/src/shader.rs b/src/crates/concat-effects/src/shader.rsindex fbeddd4d..eeb1a905 100644--- a/src/crates/concat-effects/src/shader.rs+++ b/src/crates/concat-effects/src/shader.rs@@ -47,7 +47,7 @@ use std::sync::Arc;use concat_core::{Lut, RevealMap, ShaderPass, Stage, TransitionPass};use crate::expr::{Expr, Value};-use crate::manifest::{MAX_SHRINK, Manifest, Param, ParamType, Pass, Space};+use crate::manifest::{MAX_CURVE_POINTS, MAX_SHRINK, Manifest, Param, ParamType, Pass, Space};/// What an effect's shader binds: the layer at group 0, the host's frame/// block and the package's own parameters at group 1, its table at group 2@@ -805,6 +805,94 @@ fn from_display(encoded: vec3<f32>) -> vec3<f32> {return sign(encoded) * pow(abs(encoded), vec3<f32>(2.4));}+/// A wheel's puck as the colour it pushes towards: the hue at its angle -+/// red at the top, then clockwise yellow, green, cyan, blue, magenta, as the+/// wheel is drawn - as far from grey as the puck is from the middle, with no+/// brightness of its own, so a push towards it turns a colour and leaves+/// its light. `wheel` is a wheel knob: its puck in x and y.+fn wheel_hue(wheel: vec3<f32>) -> vec3<f32> {+ let reach = min(length(wheel.xy), 1.0);+ if (reach < 1e-5) {+ return vec3<f32>(0.0);+ }+ let turn = fract(atan2(wheel.x, wheel.y) / 6.28318530718 + 1.0);+ let hue = clamp(abs(fract(vec3<f32>(turn) + vec3<f32>(1.0, 2.0 / 3.0, 1.0 / 3.0)) * 6.0 - vec3<f32>(3.0)) - vec3<f32>(1.0), vec3<f32>(0.0), vec3<f32>(1.0));+ let chroma = hue - vec3<f32>(luma(hue));+ return chroma / max(max(abs(chroma.r), abs(chroma.g)), abs(chroma.b)) * reach;+}++/// Lift, gamma and gain from three wheel knobs, on a display level: lift+/// moves black towards its colour and master and leaves white where it is,+/// gamma bends the midtones by its, gain scales every level by its. Between+/// black and white each is the classic three-way grade; past white, lift+/// and gamma carry a level on by as much as it is past, and gain scales it+/// like any other. At rest - pucks in the middle, masters at 0 - the+/// picture as it came.+fn grade_wheels(level: vec3<f32>, lift: vec3<f32>, gamma: vec3<f32>, gain: vec3<f32>) -> vec3<f32> {+ if (all(lift == vec3<f32>(0.0)) && all(gamma == vec3<f32>(0.0)) && all(gain == vec3<f32>(0.0))) {+ return level;+ }+ let black = wheel_hue(lift) * 0.25 + vec3<f32>(lift.z * 0.5);+ let bend = wheel_hue(gamma) * 0.5 + vec3<f32>(gamma.z);+ let scale = wheel_hue(gain) * 0.5 + vec3<f32>(gain.z);+ let below = min(level, vec3<f32>(1.0));+ var graded = below + black * (vec3<f32>(1.0) - below);+ if (any(bend != vec3<f32>(0.0))) {+ graded = sign(graded) * pow(abs(graded), exp2(-bend));+ }+ return (graded + (level - below)) * exp2(scale);+}++/// A curve knob at `level`: the curve through its points between black and+/// white, flat before its first point and after its last, and a level past+/// either end carried on past it by as much.+fn curve_at(curve: array<vec4<f32>, 8>, level: f32) -> f32 {+ var points = curve;+ let inside = clamp(level, 0.0, 1.0);+ let count = clamp(i32(points[0].w), 2, 8);+ var i = 0;+ for (var k = 1; k < 7; k++) {+ if (k < count - 1 && inside >= points[k].x) {+ i = k;+ }+ }+ let a = points[i];+ let b = points[i + 1];+ var y: f32;+ if (inside <= points[0].x) {+ y = points[0].y;+ } else if (inside >= points[count - 1].x) {+ y = points[count - 1].y;+ } else {+ let h = max(b.x - a.x, 1e-6);+ let s = (inside - a.x) / h;+ let s2 = s * s;+ let s3 = s2 * s;+ y = (2.0 * s3 - 3.0 * s2 + 1.0) * a.y + (s3 - 2.0 * s2 + s) * h * a.z+ + (3.0 * s2 - 2.0 * s3) * b.y + (s3 - s2) * h * b.z;+ }+ return y + (level - inside);+}++/// Whether a curve knob is the line from black to white, which leaves+/// every level where it was.+fn curve_is_straight(curve: array<vec4<f32>, 8>) -> bool {+ return curve[0].w < 2.5 && all(curve[0].xy == vec2<f32>(0.0)) && all(curve[1].xy == vec2<f32>(1.0));+}++/// Curves on a display level: the luma curve first - the level's luminance+/// moved along it and its colour scaled with it, so brightness changes and+/// hue and saturation do not - then each channel along its own.+fn grade_curves(level: vec3<f32>, bright: array<vec4<f32>, 8>, red: array<vec4<f32>, 8>, green: array<vec4<f32>, 8>, blue: array<vec4<f32>, 8>) -> vec3<f32> {+ if (curve_is_straight(bright) && curve_is_straight(red) && curve_is_straight(green) && curve_is_straight(blue)) {+ return level;+ }+ let y = luma(level);+ let moved = curve_at(bright, y);+ var c = select(level + vec3<f32>(moved - y), level * (moved / y), abs(y) > 1e-4);+ return vec3<f32>(curve_at(red, c.r), curve_at(green, c.g), curve_at(blue, c.b));+}+/// A colour held to what the working space's half floats store: a knob/// pushed to its end makes the brightest light there is, never infinity,/// which every pass after it would carry on as no number at all.@@ -1716,26 +1804,38 @@ fn stitch(.find(|member| member.name.as_deref() == Some(param.key.as_str())).ok_or_else(|| format!("`Params` has no field `{}`", param.key))?;let inner = &module.types[member.ty].inner;- let wanted = match param.kind {- ParamType::Point => 2,- ParamType::Color => 4,- _ => 1,+ // What the field holds: f32s a vector wide, or for a curve that+ // many vec4s.+ let (wanted, name) = match param.kind {+ ParamType::Point => (Width::Vector(2), "a vec2<f32>"),+ ParamType::Wheel => (Width::Vector(3), "a vec3<f32>"),+ ParamType::Color => (Width::Vector(4), "a vec4<f32>"),+ ParamType::Curve => (+ Width::Points(MAX_CURVE_POINTS as u32),+ "an array<vec4<f32>, 8>",+ ),+ _ => (Width::Vector(1), "an f32"),};let width = match inner {- naga::TypeInner::Scalar(scalar) if is_f32(scalar) => 1,- naga::TypeInner::Vector { size, scalar } if is_f32(scalar) => *size as usize,- _ => 0,+ naga::TypeInner::Scalar(scalar) if is_f32(scalar) => Width::Vector(1),+ naga::TypeInner::Vector { size, scalar } if is_f32(scalar) => {+ Width::Vector(*size as u32)+ }+ naga::TypeInner::Array {+ base,+ size: naga::ArraySize::Constant(count),+ stride: 16,+ } if matches!(+ module.types[*base].inner,+ naga::TypeInner::Vector { size: naga::VectorSize::Quad, scalar } if is_f32(&scalar)+ ) =>+ {+ Width::Points(count.get())+ }+ _ => Width::Vector(0),};if width != wanted {- return Err(format!(- "`Params.{}` must be {}",- param.key,- match wanted {- 2 => "a vec2<f32>",- 4 => "a vec4<f32>",- _ => "an f32",- }- ));+ return Err(format!("`Params.{}` must be {name}", param.key));}slots.push(Slot {key: param.key.clone(),@@ -1763,8 +1863,34 @@ fn lay_params(bytes[at].copy_from_slice(&(value as f32).to_le_bytes());}};+ let default_of = |key: &str| {+ params+ .iter()+ .find(|param| param.key == key)+ .map_or(0.0, |param| param.default)+ };for slot in slots {match slot.kind {+ ParamType::Wheel => {+ let sub = |axis: &str| values.get(&format!("{}.{axis}", slot.key)).copied();+ put(slot.offset, sub("x").unwrap_or(0.0));+ put(slot.offset + 4, sub("y").unwrap_or(0.0));+ put(+ slot.offset + 8,+ sub("m").unwrap_or_else(|| default_of(&slot.key)),+ );+ }+ ParamType::Curve => {+ let points = curve_points(values, &slot.key);+ let slopes = monotone_slopes(&points);+ for (index, (&(x, y), slope)) in points.iter().zip(slopes).enumerate() {+ let at = slot.offset + index * 16;+ put(at, x);+ put(at + 4, y);+ put(at + 8, slope);+ put(at + 12, points.len() as f64);+ }+ }ParamType::Point => {put(slot.offset,@@ -1807,6 +1933,108 @@ fn lay_params(bytes}+/// How many f32s a `Params` field holds: a scalar or vector's width, or a+/// curve's points.+#[derive(Clone, Copy, PartialEq, Eq, Debug)]+enum Width {+ Vector(u32),+ Points(u32),+}++/// A curve's points as the document stores them under `key`, in the unit+/// square and in order along it, at most [`MAX_CURVE_POINTS`]; a curve with+/// fewer than two is the straight line from black to white. Two points at+/// one place along the curve are one, the later.+pub fn curve_points(values: &BTreeMap<String, f64>, key: &str) -> Vec<(f64, f64)> {+ let mut points: Vec<(f64, f64)> = (0..MAX_CURVE_POINTS)+ .filter_map(|n| {+ let x = values.get(&format!("{key}.{n}.x"))?;+ let y = values.get(&format!("{key}.{n}.y"))?;+ (x.is_finite() && y.is_finite()).then(|| (x.clamp(0.0, 1.0), y.clamp(0.0, 1.0)))+ })+ .collect();+ points.sort_by(|a, b| a.0.total_cmp(&b.0));+ points.dedup_by(|later, earlier| {+ let same = (later.0 - earlier.0).abs() < 1e-6;+ if same {+ *earlier = *later;+ }+ same+ });+ if points.len() < 2 {+ return vec![(0.0, 0.0), (1.0, 1.0)];+ }+ points+}++/// The slope a curve leaves each of its points at: Fritsch and Carlson's+/// (1980), so a curve through points that climb climbs everywhere between+/// them, and one that turns never overshoots its points.+pub fn monotone_slopes(points: &[(f64, f64)]) -> Vec<f64> {+ let n = points.len();+ if n < 2 {+ return vec![1.0; n];+ }+ let secants: Vec<f64> = points+ .windows(2)+ .map(|pair| (pair[1].1 - pair[0].1) / (pair[1].0 - pair[0].0).max(1e-9))+ .collect();+ let mut slopes = vec![0.0; n];+ slopes[0] = secants[0];+ slopes[n - 1] = secants[n - 2];+ for k in 1..n - 1 {+ slopes[k] = if secants[k - 1] * secants[k] > 0.0 {+ (secants[k - 1] + secants[k]) / 2.0+ } else {+ 0.0+ };+ }+ for k in 0..n - 1 {+ if secants[k] == 0.0 {+ slopes[k] = 0.0;+ slopes[k + 1] = 0.0;+ continue;+ }+ let a = slopes[k] / secants[k];+ let b = slopes[k + 1] / secants[k];+ let length = (a * a + b * b).sqrt();+ if length > 3.0 {+ slopes[k] = 3.0 / length * a * secants[k];+ slopes[k + 1] = 3.0 / length * b * secants[k];+ }+ }+ slopes+}++/// A curve through `points` (in order, as [`curve_points`] gives them) at+/// `level`, with the slopes [`monotone_slopes`] gives: what the shader's+/// `curve_at` works out on the GPU, for a window that draws the curve.+pub fn curve_value(points: &[(f64, f64)], slopes: &[f64], level: f64) -> f64 {+ let inside = level.clamp(0.0, 1.0);+ let (Some(first), Some(last)) = (points.first(), points.last()) else {+ return level;+ };+ let y = if inside <= first.0 {+ first.1+ } else if inside >= last.0 {+ last.1+ } else {+ let i = points+ .windows(2)+ .position(|pair| inside < pair[1].0)+ .unwrap_or(points.len() - 2);+ let ((ax, ay), (bx, by)) = (points[i], points[i + 1]);+ let h = (bx - ax).max(1e-6);+ let s = (inside - ax) / h;+ let (s2, s3) = (s * s, s * s * s);+ (2.0 * s3 - 3.0 * s2 + 1.0) * ay+ + (s3 - 2.0 * s2 + s) * h * slopes[i]+ + (3.0 * s2 - 2.0 * s3) * by+ + (s3 - s2) * h * slopes[i + 1]+ };+ y + (level - inside)+}+/// A transition package's shader, stitched, checked and laid out.#[derive(Clone, Debug)]pub struct TransitionShader {@@ -2313,6 +2541,129 @@ fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {assert!(broken.contains("shrink `radius /`"), "{broken}");}+ /// A wheel lays its puck and master into a vec3, and a curve its points+ /// in order into eight vec4s with the slopes that keep it from+ /// overshooting and the count of them; with no points a curve is the+ /// line from black to white.+ #[test]+ fn wheels_and_curves_are_laid_into_the_uniforms() {+ let manifest = Manifest::parse(+ "format = 2\n[effect]\nid = \"test.grade\"\nname = \"Grade\"\nkind = \"effect\"\n\+ [[param]]\nkey = \"lift\"\nlabel = \"Lift\"\ntype = \"wheel\"\nmin = -1\nmax = 1\ndefault = 0.25\n\+ [[param]]\nkey = \"luma\"\nlabel = \"Luma\"\ntype = \"curve\"\n\+ [wgsl]\nentry = \"effect.wgsl\"\nspace = \"display\"\n",+ )+ .expect("a manifest");+ let shader = Shader::compile(+ &manifest,+ "struct Params { lift: vec3<f32>, luma: array<vec4<f32>, 8> }\n\+ fn effect(uv: vec2<f32>) -> vec4<f32> { let c = sample(uv); let l = vec3<f32>(curve_at(params.luma, c.r)); return vec4<f32>(grade_wheels(l, params.lift, vec3<f32>(0.0), vec3<f32>(0.0)), c.a); }",+ )+ .expect("compiles");+ let floats = |bytes: Vec<u8>| -> Vec<f32> {+ bytes+ .chunks_exact(4)+ .map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]]))+ .collect()+ };+ let at_rest = floats(shader.params_bytes(&BTreeMap::new(), &manifest.params));+ assert_eq!(+ &at_rest[..3],+ &[0.0, 0.0, 0.25],+ "the puck in the middle, the master at its default"+ );+ assert_eq!(+ &at_rest[4..12],+ &[0.0, 0.0, 1.0, 2.0, 1.0, 1.0, 1.0, 2.0],+ "the straight line"+ );+ let set: BTreeMap<String, f64> = [+ ("lift.x", 0.5),+ ("lift.y", -0.5),+ ("lift.m", -1.0),+ ("luma.1.x", 1.0),+ ("luma.1.y", 1.0),+ ("luma.0.x", 0.0),+ ("luma.0.y", 0.0),+ ("luma.2.x", 0.5),+ ("luma.2.y", 0.8),+ ]+ .into_iter()+ .map(|(key, value)| (key.to_owned(), value))+ .collect();+ let laid = floats(shader.params_bytes(&set, &manifest.params));+ assert_eq!(&laid[..3], &[0.5, -0.5, -1.0]);+ let points: Vec<[f32; 4]> = laid[4..16]+ .chunks_exact(4)+ .map(|p| [p[0], p[1], p[2], p[3]])+ .collect();+ assert_eq!(+ points+ .iter()+ .map(|p| (p[0], p[1], p[3]))+ .collect::<Vec<_>>(),+ [(0.0, 0.0, 3.0), (0.5, 0.8, 3.0), (1.0, 1.0, 3.0)]+ );+ assert!(+ points.iter().all(|p| p[2] >= 0.0),+ "a climbing curve climbs everywhere: {points:?}"+ );+ }++ /// The slopes never let a curve overshoot its points: flat at a peak,+ /// and never steeper than three times a segment's own slope.+ #[test]+ fn a_curve_is_monotone_between_its_points() {+ let peak = monotone_slopes(&[(0.0, 0.0), (0.5, 1.0), (1.0, 0.0)]);+ assert_eq!(peak[1], 0.0, "flat at the top");+ let steep = monotone_slopes(&[(0.0, 0.0), (0.1, 0.9), (0.2, 0.95), (1.0, 1.0)]);+ for (k, pair) in [(0.0, 0.0), (0.1, 0.9), (0.2, 0.95), (1.0, 1.0)]+ .windows(2)+ .enumerate()+ {+ let secant = (pair[1].1 - pair[0].1) / (pair[1].0 - pair[0].0);+ assert!(+ steep[k] <= 3.0 * secant + 1e-9 && steep[k + 1] <= 3.0 * secant + 1e-9,+ "{steep:?}"+ );+ }+ let values = |pairs: &[(&str, f64)]| -> BTreeMap<String, f64> {+ pairs+ .iter()+ .map(|(key, value)| ((*key).to_owned(), *value))+ .collect()+ };+ let bend = [(0.0, 0.0), (0.5, 0.6), (1.0, 1.0)];+ let slopes = monotone_slopes(&bend);+ assert!((curve_value(&bend, &slopes, 0.25) - 0.3125).abs() < 1e-9);+ assert_eq!(curve_value(&bend, &slopes, 1.5), 1.5, "past white carried");+ assert_eq!(+ curve_value(&bend, &slopes, -0.2),+ -0.2,+ "below black carried"+ );+ assert_eq!(+ curve_points(&values(&[("c.0.x", 0.3), ("c.0.y", 0.7)]), "c"),+ [(0.0, 0.0), (1.0, 1.0)],+ "one point is no curve"+ );+ assert_eq!(+ curve_points(+ &values(&[+ ("c.0.x", 1.5),+ ("c.0.y", -1.0),+ ("c.3.x", 0.2),+ ("c.3.y", 0.4),+ ("c.5.x", 0.2),+ ("c.5.y", 0.6)+ ]),+ "c"+ ),+ [(0.2, 0.6), (1.0, 0.0)],+ "held to the square, in order, one point to a place"+ );+ }+/// The pipeline key follows the source, so a shader edited without a/// version bump does not keep a stale pipeline.#[test]diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.jsonindex 49f5ec56..266a7128 100644--- a/src/crates/concat/locales/de.json+++ b/src/crates/concat/locales/de.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Sanfte Farbtondrehung über das gesamte Spektrum im Zeitverlauf.","effects.colorCycle.name": "Farbzyklus",+ "effects.colorWheels.description": "Lift, Gamma und Verstärkung: Schatten, Mitten und Lichter jeweils zu einem Farbton hin verschoben und heller oder dunkler gemacht.",+ "effects.colorWheels.name": "Farbräder","effects.contrast.description": "Mehr oder weniger Kontrast in Blendenstufen um das mittlere Grau; Lichter über Weiß bleiben erhalten, Schwarz läuft nie zu.","effects.contrast.name": "Kontrast","effects.contrastPop.description": "Tiefere Schatten, hellere Lichter.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT-Scanlinien","effects.cube.description": "Die vorherige Einstellung dreht sich wie eine Würfelseite weg, während die nächste ins Bild dreht.","effects.cube.name": "Würfel",+ "effects.curves.description": "Die Helligkeitsstufen des Bildes entlang von Kurven gebogen, die du zeichnest: Luma für die Helligkeit allein, dann Rot, Grün und Blau.",+ "effects.curves.name": "Kurven","effects.cyberpunk.description": "Magenta in die Schatten, Cyan ins Licht, hart getrieben und neonhell.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Blöcke des Bildes reißen seitlich weg und flackern wie ein kaputter Codec.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Stanzt das Grün aus und legt das Bild über das, was darunter liegt.","effects.greenScreen.name": "Greenscreen","effects.groups.color": "Farbe",+ "effects.groups.curves": "Kurven","effects.groups.effects": "Effekte","effects.groups.lightness": "Licht",+ "effects.groups.wheels": "Räder","effects.halation.description": "Warmes rot-oranges Glühen, das um kontrastreiche Kanten ausblutet.","effects.halation.name": "Halation","effects.halftone.description": "Das Bild auf ein Raster aus schwarzen und weißen Punkten reduziert.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bits","effects.labels.blacks": "Schwarztöne","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Blau","effects.labels.blur": "Unschärfe","effects.labels.blush": "Blush","effects.labels.body": "Körper",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Frequenz","effects.labels.gain": "Verstärkung",+ "effects.labels.gamma": "Gamma","effects.labels.glow": "Glühen","effects.labels.grain": "Grain",+ "effects.labels.green": "Grün","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Hitze",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "Minimum","effects.labels.noise": "Rauschen",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Radius","effects.labels.rate": "Rate",+ "effects.labels.red": "Rot","effects.labels.rgbSplit": "RGB-Versatz","effects.labels.rotation": "Drehung","effects.labels.saturation": "Sättigung",diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.jsonindex 2b7cbf16..bc91343a 100644--- a/src/crates/concat/locales/en.json+++ b/src/crates/concat/locales/en.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Smooth temporal hue rotation across the entire spectrum.","effects.colorCycle.name": "Color Cycle",+ "effects.colorWheels.description": "Lift, gamma and gain: the shadows, midtones and highlights each pushed towards a hue and made brighter or darker.",+ "effects.colorWheels.name": "Color Wheels","effects.contrast.description": "More or less contrast in stops about middle grey, highlights past white kept and black never crushed.","effects.contrast.name": "Contrast","effects.contrastPop.description": "Deeper shadows, brighter highlights.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT Scanlines","effects.cube.description": "The outgoing shot rotates away like a cube face as the incoming one rotates into view.","effects.cube.name": "Cube",+ "effects.curves.description": "The picture's levels bent along curves you draw: luma for brightness alone, then red, green and blue.",+ "effects.curves.name": "Curves","effects.cyberpunk.description": "Magenta into the shadows, cyan into the light, pushed hard and neon-bright.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Blocks of the picture tear sideways, flickering like a broken codec.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Keys the green out, leaving the picture over whatever is beneath.","effects.greenScreen.name": "Green Screen","effects.groups.color": "Color",+ "effects.groups.curves": "Curves","effects.groups.effects": "Effects","effects.groups.lightness": "Lightness",+ "effects.groups.wheels": "Wheels","effects.halation.description": "Warm red/orange glow bleeding around high-contrast edges.","effects.halation.name": "Halation","effects.halftone.description": "The picture reduced to a grid of black and white dots.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bits","effects.labels.blacks": "Blacks","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Blue","effects.labels.blur": "Blur","effects.labels.blush": "Blush","effects.labels.body": "Body",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Frequency","effects.labels.gain": "Gain",+ "effects.labels.gamma": "Gamma","effects.labels.glow": "Glow","effects.labels.grain": "Grain",+ "effects.labels.green": "Green","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Heat",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "Minimum","effects.labels.noise": "Noise",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Radius","effects.labels.rate": "Rate",+ "effects.labels.red": "Red","effects.labels.rgbSplit": "RGB split","effects.labels.rotation": "Rotation","effects.labels.saturation": "Saturation",diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.jsonindex 0b74a6a5..c573eb54 100644--- a/src/crates/concat/locales/es.json+++ b/src/crates/concat/locales/es.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Rotación suave del matiz en el tiempo por todo el espectro.","effects.colorCycle.name": "Ciclo de color",+ "effects.colorWheels.description": "Lift, gamma y ganancia: las sombras, los medios tonos y las luces, cada uno llevado hacia un matiz y aclarado u oscurecido.",+ "effects.colorWheels.name": "Ruedas de color","effects.contrast.description": "Más o menos contraste en pasos de luz en torno al gris medio, sin perder las luces por encima del blanco ni empastar nunca el negro.","effects.contrast.name": "Contraste","effects.contrastPop.description": "Sombras más profundas, luces más brillantes.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "Líneas de CRT","effects.cube.description": "El plano saliente gira y se aleja como la cara de un cubo mientras el entrante gira hasta quedar a la vista.","effects.cube.name": "Cubo",+ "effects.curves.description": "Los niveles de la imagen doblados a lo largo de curvas que dibujas: luma solo para el brillo, luego rojo, verde y azul.",+ "effects.curves.name": "Curvas","effects.cyberpunk.description": "Magenta en las sombras, cian en las luces, llevados al límite y con brillo de neón.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Bloques de la imagen se desgarran de lado y parpadean como un códec roto.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Elimina el verde y deja la imagen sobre lo que haya debajo.","effects.greenScreen.name": "Pantalla verde","effects.groups.color": "Color",+ "effects.groups.curves": "Curvas","effects.groups.effects": "Efectos","effects.groups.lightness": "Luz",+ "effects.groups.wheels": "Ruedas","effects.halation.description": "Resplandor cálido rojo y naranja que se derrama alrededor de los bordes de alto contraste.","effects.halation.name": "Halación","effects.halftone.description": "La imagen reducida a una cuadrícula de puntos blancos y negros.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bits","effects.labels.blacks": "Negros","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Azul","effects.labels.blur": "Desenfoque","effects.labels.blush": "Blush","effects.labels.body": "Cuerpo",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Frecuencia","effects.labels.gain": "Ganancia",+ "effects.labels.gamma": "Gamma","effects.labels.glow": "Resplandor","effects.labels.grain": "Grain",+ "effects.labels.green": "Verde","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Calor",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "Mínimo","effects.labels.noise": "Ruido",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Radio","effects.labels.rate": "Velocidad",+ "effects.labels.red": "Rojo","effects.labels.rgbSplit": "Separación RGB","effects.labels.rotation": "Rotación","effects.labels.saturation": "Saturación",diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.jsonindex 38b2213d..6abb9f8f 100644--- a/src/crates/concat/locales/fa.json+++ b/src/crates/concat/locales/fa.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "آسمان صاف","effects.colorCycle.description": "چرخش نرم و زمانی Hue در سراسر طیف رنگ.","effects.colorCycle.name": "چرخش رنگ",+ "effects.colorWheels.description": "بالابری (Lift)، گاما و بهره (Gain): سایهها، میانرنگها و هایلایتها هر یک به سوی یک تهرنگ رانده و روشنتر یا تیرهتر میشوند.",+ "effects.colorWheels.name": "چرخهای رنگ","effects.contrast.description": "کنتراست بیشتر یا کمتر به اندازهٔ Stopها حول خاکستری میانی؛ هایلایتهای فراتر از سفید حفظ میشوند و سیاه هرگز له نمیشود.","effects.contrast.name": "کنتراست","effects.contrastPop.description": "سایههای عمیقتر و هایلایتهای روشنتر.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "خطوط اسکن CRT","effects.cube.description": "نمای خروجی مثل وجه یک مکعب میچرخد و دور میشود و نمای ورودی با چرخش وارد دید میشود.","effects.cube.name": "مکعب",+ "effects.curves.description": "سطوح تصویر در امتداد منحنیهایی که میکشید خم میشوند: لوما تنها برای روشنایی، سپس قرمز، سبز و آبی.",+ "effects.curves.name": "منحنیها","effects.cyberpunk.description": "سرخابی در سایهها و فیروزهای در نورها، با فشار زیاد و درخشش نئونی.","effects.cyberpunk.name": "سایبرپانک","effects.datamosh.description": "بلوکهایی از تصویر به پهلو پاره میشوند و مثل یک Codec خراب سوسو میزنند.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "سبز را Key میکند و تصویر را روی لایه زیرین باقی میگذارد.","effects.greenScreen.name": "پرده سبز","effects.groups.color": "رنگ",+ "effects.groups.curves": "منحنیها","effects.groups.effects": "افکتها","effects.groups.lightness": "روشنایی",+ "effects.groups.wheels": "چرخها","effects.halation.description": "درخشش گرم قرمز/نارنجی که اطراف لبههای پرکنتراست پخش میشود.","effects.halation.name": "هاله نور (Halation)","effects.halftone.description": "تصویر به یک شبکه از نقطههای سیاه و سفید تبدیل میشود.",@@ -376,6 +382,7 @@"effects.labels.bits": "بیت","effects.labels.blacks": "سیاهیها","effects.labels.bleed": "نشت رنگ",+ "effects.labels.blue": "آبی","effects.labels.blur": "محو","effects.labels.blush": "رژگونه","effects.labels.body": "بدنه متن",@@ -409,8 +416,10 @@"effects.labels.flash": "فلش","effects.labels.frequency": "فرکانس","effects.labels.gain": "بهره (Gain)",+ "effects.labels.gamma": "گاما","effects.labels.glow": "درخشش","effects.labels.grain": "دانهبندی",+ "effects.labels.green": "سبز","effects.labels.greens": "سبزها","effects.labels.haze": "مه","effects.labels.heat": "گرما",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "نشت نور","effects.labels.lights": "نورها","effects.labels.lines": "خطوط",+ "effects.labels.luma": "لوما","effects.labels.matte": "مات (Matte)","effects.labels.minimum": "حداقل","effects.labels.noise": "نویز",@@ -439,6 +449,7 @@"effects.labels.punch": "قدرت (Punch)","effects.labels.radius": "شعاع","effects.labels.rate": "نرخ (Rate)",+ "effects.labels.red": "قرمز","effects.labels.rgbSplit": "تفکیک RGB","effects.labels.rotation": "چرخش","effects.labels.saturation": "اشباع",diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.jsonindex ffb02b2f..6361725f 100644--- a/src/crates/concat/locales/fr.json+++ b/src/crates/concat/locales/fr.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Une rotation fluide de la teinte dans le temps, sur tout le spectre.","effects.colorCycle.name": "Cycle de couleurs",+ "effects.colorWheels.description": "Lift, gamma et gain : les ombres, les tons moyens et les hautes lumières, chacun poussé vers une teinte et rendu plus clair ou plus sombre.",+ "effects.colorWheels.name": "Roues chromatiques","effects.contrast.description": "Plus ou moins de contraste, par diaphs autour du gris moyen : hautes lumières au-delà du blanc préservées, noir jamais bouché.","effects.contrast.name": "Contraste","effects.contrastPop.description": "Des ombres plus profondes, des hautes lumières plus vives.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "Lignes de balayage CRT","effects.cube.description": "Le plan sortant pivote comme la face d'un cube tandis que le plan suivant pivote dans le champ.","effects.cube.name": "Cube",+ "effects.curves.description": "Les niveaux de l'image pliés le long de courbes que vous tracez : la luma pour la luminosité seule, puis le rouge, le vert et le bleu.",+ "effects.curves.name": "Courbes","effects.cyberpunk.description": "Du magenta dans les ombres, du cyan dans la lumière, poussés à fond et lumineux comme un néon.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Des blocs de l'image se déchirent latéralement et vacillent comme un codec cassé.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Retire le vert et pose l'image sur ce qui est en dessous.","effects.greenScreen.name": "Fond vert","effects.groups.color": "Couleur",+ "effects.groups.curves": "Courbes","effects.groups.effects": "Effets","effects.groups.lightness": "Lumière",+ "effects.groups.wheels": "Roues","effects.halation.description": "Une lueur chaude rouge-orangé qui déborde autour des contours très contrastés.","effects.halation.name": "Halation","effects.halftone.description": "L'image réduite à une grille de points noirs et blancs.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bits","effects.labels.blacks": "Noirs","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Bleu","effects.labels.blur": "Flou","effects.labels.blush": "Blush","effects.labels.body": "Corps",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Fréquence","effects.labels.gain": "Gain",+ "effects.labels.gamma": "Gamma","effects.labels.glow": "Lueur","effects.labels.grain": "Grain",+ "effects.labels.green": "Vert","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Chaleur",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "Minimum","effects.labels.noise": "Bruit",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Rayon","effects.labels.rate": "Vitesse",+ "effects.labels.red": "Rouge","effects.labels.rgbSplit": "Séparation RVB","effects.labels.rotation": "Rotation","effects.labels.saturation": "Saturation",diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.jsonindex 7c256962..133d88b8 100644--- a/src/crates/concat/locales/hr.json+++ b/src/crates/concat/locales/hr.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Nebo bez oblaka","effects.colorCycle.description": "Glatka vremenska rotacija nijanse kroz cijeli spektar.","effects.colorCycle.name": "Ciklus boja",+ "effects.colorWheels.description": "Podizanje, gama i pojačanje: sjene, srednji tonovi i svjetla, svaki pomaknut prema jednoj nijansi te posvijetljen ili potamnjen.",+ "effects.colorWheels.name": "Kotači boja","effects.contrast.description": "Više ili manje kontrasta u stupnjevima svjetla oko srednje sive; svjetla iznad bijele ostaju očuvana, a crna se nikad ne guši.","effects.contrast.name": "Kontrast","effects.contrastPop.description": "Dublje sjene, svjetlija svjetla.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT linije","effects.cube.description": "Odlazeći kadar odvrće se kao stranica kocke dok se dolazeći uvrće u vidno polje.","effects.cube.name": "Kocka",+ "effects.curves.description": "Razine slike savijene duž krivulja koje nacrtate: luma samo za svjetlinu, zatim crvena, zelena i plava.",+ "effects.curves.name": "Krivulje","effects.cyberpunk.description": "Magenta u sjene, cijan u svjetlo, gurnuto do kraja i neonski svijetlo.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Blokovi slike kidaju se u stranu, trepereći kao pokvareni kodek.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Uklanja zelenu, ostavljajući sliku preko onoga što je ispod.","effects.greenScreen.name": "Zelena pozadina","effects.groups.color": "Boja",+ "effects.groups.curves": "Krivulje","effects.groups.effects": "Efekti","effects.groups.lightness": "Svjetlina",+ "effects.groups.wheels": "Kotači","effects.halation.description": "Topli crveno-narančasti sjaj koji se razlijeva oko rubova visokog kontrasta.","effects.halation.name": "Halacija","effects.halftone.description": "Slika svedena na mrežu crnih i bijelih točaka.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bitovi","effects.labels.blacks": "Crne","effects.labels.bleed": "Curenje",+ "effects.labels.blue": "Plava","effects.labels.blur": "Zamućenje","effects.labels.blush": "Rumenilo","effects.labels.body": "Tijelo",@@ -409,8 +416,10 @@"effects.labels.flash": "Bljeskalica","effects.labels.frequency": "Frekvencija","effects.labels.gain": "Pojačanje",+ "effects.labels.gamma": "Gama","effects.labels.glow": "Sjaj","effects.labels.grain": "Zrno",+ "effects.labels.green": "Zelena","effects.labels.greens": "Zelene","effects.labels.haze": "Izmaglica","effects.labels.heat": "Vrelina",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Curenje svjetla","effects.labels.lights": "Svjetla","effects.labels.lines": "Redci",+ "effects.labels.luma": "Luma","effects.labels.matte": "Mat","effects.labels.minimum": "Minimum","effects.labels.noise": "Šum",@@ -439,6 +449,7 @@"effects.labels.punch": "Udarac","effects.labels.radius": "Polumjer","effects.labels.rate": "Brzina",+ "effects.labels.red": "Crvena","effects.labels.rgbSplit": "RGB razdvajanje","effects.labels.rotation": "Rotacija","effects.labels.saturation": "Zasićenje",diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.jsonindex 932fe3e8..7ed05048 100644--- a/src/crates/concat/locales/it.json+++ b/src/crates/concat/locales/it.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Una rotazione fluida della tonalità nel tempo, lungo tutto lo spettro.","effects.colorCycle.name": "Ciclo di colore",+ "effects.colorWheels.description": "Lift, gamma e guadagno: ombre, toni medi e luci, ciascuno spinto verso una tinta e reso più chiaro o più scuro.",+ "effects.colorWheels.name": "Ruote colore","effects.contrast.description": "Più o meno contrasto in stop attorno al grigio medio, con le luci oltre il bianco preservate e il nero mai chiuso.","effects.contrast.name": "Contrasto","effects.contrastPop.description": "Ombre più profonde, luci più brillanti.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "Scanline CRT","effects.cube.description": "L'inquadratura in uscita ruota via come la faccia di un cubo mentre quella in entrata ruota in vista.","effects.cube.name": "Cubo",+ "effects.curves.description": "I livelli dell'immagine piegati lungo curve che disegni: la luma per la sola luminosità, poi rosso, verde e blu.",+ "effects.curves.name": "Curve","effects.cyberpunk.description": "Magenta nelle ombre, ciano nella luce, spinti al massimo e brillanti come il neon.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Blocchi dell'immagine si strappano di lato, sfarfallando come un codec rotto.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Toglie il verde, lasciando l'immagine su ciò che sta sotto.","effects.greenScreen.name": "Green screen","effects.groups.color": "Colore",+ "effects.groups.curves": "Curve","effects.groups.effects": "Effetti","effects.groups.lightness": "Luce",+ "effects.groups.wheels": "Ruote","effects.halation.description": "Un bagliore caldo rosso/arancio che sbava attorno ai bordi ad alto contrasto.","effects.halation.name": "Alonatura","effects.halftone.description": "L'immagine ridotta a una griglia di punti bianchi e neri.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bit","effects.labels.blacks": "Neri","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Blu","effects.labels.blur": "Sfocatura","effects.labels.blush": "Blush","effects.labels.body": "Corpo",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Frequenza","effects.labels.gain": "Guadagno",+ "effects.labels.gamma": "Gamma","effects.labels.glow": "Bagliore","effects.labels.grain": "Grain",+ "effects.labels.green": "Verde","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Calore",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "Minimo","effects.labels.noise": "Rumore",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Raggio","effects.labels.rate": "Velocità",+ "effects.labels.red": "Rosso","effects.labels.rgbSplit": "Separazione RGB","effects.labels.rotation": "Rotazione","effects.labels.saturation": "Saturazione",diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.jsonindex 3cd06740..66ddf9d9 100644--- a/src/crates/concat/locales/ja.json+++ b/src/crates/concat/locales/ja.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "全スペクトルにわたる、時間とともに滑らかに回る色相。","effects.colorCycle.name": "カラーサイクル",+ "effects.colorWheels.description": "リフト、ガンマ、ゲイン:シャドウ、中間調、ハイライトをそれぞれ色相の方向へ寄せ、明るく、または暗くします。",+ "effects.colorWheels.name": "カラーホイール","effects.contrast.description": "中間グレーを中心に段単位でコントラストを強めたり弱めたりします。白を超えるハイライトは保たれ、黒がつぶれることはありません。","effects.contrast.name": "コントラスト","effects.contrastPop.description": "シャドウをより深く、ハイライトをより明るく。",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT 走査線","effects.cube.description": "前のショットが立方体の面のように回転して去り、次のショットが回転して現れます。","effects.cube.name": "キューブ",+ "effects.curves.description": "描いたカーブに沿って映像のレベルを曲げます。ルマは明るさだけを、続いてレッド、グリーン、ブルーを。",+ "effects.curves.name": "カーブ","effects.cyberpunk.description": "シャドウにマゼンタ、光にシアンを強く押し込んだ、ネオンのような明るさ。","effects.cyberpunk.name": "サイバーパンク","effects.datamosh.description": "画面のブロックが横にちぎれ、壊れたコーデックのようにちらつきます。",@@ -344,8 +348,10 @@"effects.greenScreen.description": "緑を抜き、下にあるものの上に画像を重ねます。","effects.greenScreen.name": "グリーンスクリーン","effects.groups.color": "カラー",+ "effects.groups.curves": "カーブ","effects.groups.effects": "エフェクト","effects.groups.lightness": "明度",+ "effects.groups.wheels": "ホイール","effects.halation.description": "コントラストの強い輪郭の周りににじむ、温かな赤とオレンジの光。","effects.halation.name": "ハレーション","effects.halftone.description": "画面を白黒のドットの格子に還元します。",@@ -376,6 +382,7 @@"effects.labels.bits": "ビット","effects.labels.blacks": "黒レベル","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "ブルー","effects.labels.blur": "ぼかし","effects.labels.blush": "Blush","effects.labels.body": "ボディ",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "周波数","effects.labels.gain": "ゲイン",+ "effects.labels.gamma": "ガンマ","effects.labels.glow": "グロー","effects.labels.grain": "Grain",+ "effects.labels.green": "グリーン","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "ヒート",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "ルマ","effects.labels.matte": "Matte","effects.labels.minimum": "最小","effects.labels.noise": "ノイズ",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "半径","effects.labels.rate": "速度",+ "effects.labels.red": "レッド","effects.labels.rgbSplit": "RGB ずれ","effects.labels.rotation": "回転","effects.labels.saturation": "彩度",diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.jsonindex 149dfa3a..a2c96063 100644--- a/src/crates/concat/locales/ko.json+++ b/src/crates/concat/locales/ko.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "전체 스펙트럼을 매끄럽게 도는 색조 회전.","effects.colorCycle.name": "색상 순환",+ "effects.colorWheels.description": "리프트, 감마, 게인: 어둠, 중간 톤, 하이라이트를 각각 한 색조 쪽으로 밀고 더 밝게 또는 어둡게 합니다.",+ "effects.colorWheels.name": "컬러 휠","effects.contrast.description": "중간 회색을 기준으로 스톱 단위로 대비를 높이거나 낮춥니다. 흰색을 넘는 하이라이트는 유지되고 검은색은 뭉개지지 않습니다.","effects.contrast.name": "대비","effects.contrastPop.description": "더 깊은 어둠, 더 밝은 하이라이트.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT 주사선","effects.cube.description": "나가는 샷이 큐브의 한 면처럼 돌아 사라지고 들어오는 샷이 돌아 나타납니다.","effects.cube.name": "큐브",+ "effects.curves.description": "그린 커브를 따라 영상의 레벨을 휩니다. 루마는 밝기만, 그다음 빨강, 초록, 파랑.",+ "effects.curves.name": "커브","effects.cyberpunk.description": "그림자에는 마젠타, 빛에는 시안을 네온처럼 밝게 강하게 밀어 넣습니다.","effects.cyberpunk.name": "사이버펑크","effects.datamosh.description": "화면의 블록이 옆으로 찢기며 깨진 코덱처럼 깜빡입니다.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "녹색을 빼고 아래에 있는 것 위에 그림을 올립니다.","effects.greenScreen.name": "그린 스크린","effects.groups.color": "색상",+ "effects.groups.curves": "커브","effects.groups.effects": "효과","effects.groups.lightness": "명도",+ "effects.groups.wheels": "휠","effects.halation.description": "고대비 윤곽 주위로 번지는 따뜻한 빨강/주황 빛.","effects.halation.name": "할레이션","effects.halftone.description": "화면을 흑백 점의 격자로 줄입니다.",@@ -376,6 +382,7 @@"effects.labels.bits": "비트","effects.labels.blacks": "검정 계열","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "파랑","effects.labels.blur": "흐림","effects.labels.blush": "Blush","effects.labels.body": "바디",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "빈도","effects.labels.gain": "게인",+ "effects.labels.gamma": "감마","effects.labels.glow": "글로우","effects.labels.grain": "Grain",+ "effects.labels.green": "초록","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "열기",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "루마","effects.labels.matte": "Matte","effects.labels.minimum": "최소","effects.labels.noise": "노이즈",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "반경","effects.labels.rate": "속도",+ "effects.labels.red": "빨강","effects.labels.rgbSplit": "RGB 분리","effects.labels.rotation": "회전","effects.labels.saturation": "채도",diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.jsonindex 39eb7fed..310cc936 100644--- a/src/crates/concat/locales/pt-BR.json+++ b/src/crates/concat/locales/pt-BR.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Rotação temporal suave do matiz por todo o espectro.","effects.colorCycle.name": "Ciclo de cores",+ "effects.colorWheels.description": "Lift, gama e ganho: as sombras, os meios-tons e os realces, cada um levado a um matiz e deixado mais claro ou mais escuro.",+ "effects.colorWheels.name": "Rodas de cor","effects.contrast.description": "Mais ou menos contraste em stops em torno do cinza médio, preservando os realces acima do branco e sem nunca esmagar o preto.","effects.contrast.name": "Contraste","effects.contrastPop.description": "Sombras mais profundas, realces mais brilhantes.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "Linhas de varredura CRT","effects.cube.description": "O plano que sai gira para longe como a face de um cubo enquanto o que entra gira até aparecer.","effects.cube.name": "Cubo",+ "effects.curves.description": "Os níveis da imagem dobrados ao longo das curvas que você desenha: luma só para o brilho, depois vermelho, verde e azul.",+ "effects.curves.name": "Curvas","effects.cyberpunk.description": "Magenta nas sombras, ciano na luz, levados ao extremo e brilhantes como neon.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Blocos da imagem se rasgam para os lados, piscando como um codec quebrado.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Remove o verde, deixando a imagem sobre o que estiver abaixo.","effects.greenScreen.name": "Tela verde","effects.groups.color": "Cor",+ "effects.groups.curves": "Curvas","effects.groups.effects": "Efeitos","effects.groups.lightness": "Luz",+ "effects.groups.wheels": "Rodas","effects.halation.description": "Brilho quente vermelho/laranja vazando ao redor das bordas de alto contraste.","effects.halation.name": "Halação","effects.halftone.description": "A imagem reduzida a uma grade de pontos pretos e brancos.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bits","effects.labels.blacks": "Pretos","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Azul","effects.labels.blur": "Desfoque","effects.labels.blush": "Blush","effects.labels.body": "Corpo",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Frequência","effects.labels.gain": "Ganho",+ "effects.labels.gamma": "Gama","effects.labels.glow": "Brilho","effects.labels.grain": "Grain",+ "effects.labels.green": "Verde","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Calor",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "Mínimo","effects.labels.noise": "Ruído",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Raio","effects.labels.rate": "Velocidade",+ "effects.labels.red": "Vermelho","effects.labels.rgbSplit": "Separação RGB","effects.labels.rotation": "Rotação","effects.labels.saturation": "Saturação",diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.jsonindex d2aeb85a..3d8016da 100644--- a/src/crates/concat/locales/ru.json+++ b/src/crates/concat/locales/ru.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Безоблачное небо","effects.colorCycle.description": "Плавное вращение оттенка во времени по всему спектру.","effects.colorCycle.name": "Цикл цвета",+ "effects.colorWheels.description": "Подъём, гамма и усиление: тени, средние тона и света, каждые сдвинутые к своему оттенку и сделанные светлее или темнее.",+ "effects.colorWheels.name": "Цветовые круги","effects.contrast.description": "Больше или меньше контраста в стопах вокруг среднего серого: света выше белого сохраняются, а чёрный никогда не заваливается.","effects.contrast.name": "Контраст","effects.contrastPop.description": "Глубже тени, ярче света.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "Строки кинескопа","effects.cube.description": "Уходящий кадр отворачивается, как грань куба, а следующий поворачивается на его место.","effects.cube.name": "Куб",+ "effects.curves.description": "Уровни изображения, изогнутые по нарисованным вами кривым: яркость (luma) отдельно, затем красный, зелёный и синий.",+ "effects.curves.name": "Кривые","effects.cyberpunk.description": "Маджента в тени, циан в свет, выкручено до неоновой яркости.","effects.cyberpunk.name": "Киберпанк","effects.datamosh.description": "Блоки картинки рвутся вбок и мерцают, как сломанный кодек.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Убирает зелёный, оставляя картинку поверх того, что ниже.","effects.greenScreen.name": "Зелёный экран","effects.groups.color": "Цвет",+ "effects.groups.curves": "Кривые","effects.groups.effects": "Эффекты","effects.groups.lightness": "Свет",+ "effects.groups.wheels": "Круги","effects.halation.description": "Тёплое красно-оранжевое свечение, растекающееся вокруг контрастных краёв.","effects.halation.name": "Ореол","effects.halftone.description": "Картинка сведена к сетке чёрных и белых точек.",@@ -376,6 +382,7 @@"effects.labels.bits": "Биты","effects.labels.blacks": "Чёрные","effects.labels.bleed": "Растекание",+ "effects.labels.blue": "Синий","effects.labels.blur": "Размытие","effects.labels.blush": "Румянец","effects.labels.body": "Тело",@@ -409,8 +416,10 @@"effects.labels.flash": "Вспышка","effects.labels.frequency": "Частота","effects.labels.gain": "Усиление",+ "effects.labels.gamma": "Гамма","effects.labels.glow": "Свечение","effects.labels.grain": "Зерно",+ "effects.labels.green": "Зелёный","effects.labels.greens": "Зелень","effects.labels.haze": "Дымка","effects.labels.heat": "Жар",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Засветка","effects.labels.lights": "Огни","effects.labels.lines": "Строки",+ "effects.labels.luma": "Яркость","effects.labels.matte": "Матовость","effects.labels.minimum": "Минимум","effects.labels.noise": "Шум",@@ -439,6 +449,7 @@"effects.labels.punch": "Удар","effects.labels.radius": "Радиус","effects.labels.rate": "Скорость",+ "effects.labels.red": "Красный","effects.labels.rgbSplit": "RGB-сдвиг","effects.labels.rotation": "Поворот","effects.labels.saturation": "Насыщенность",diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.jsonindex 71f8eb33..3b29bf0f 100644--- a/src/crates/concat/locales/tr.json+++ b/src/crates/concat/locales/tr.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "Cloudless Sky","effects.colorCycle.description": "Tüm tayf boyunca zamanla yumuşak ton döndürmesi.","effects.colorCycle.name": "Renk döngüsü",+ "effects.colorWheels.description": "Lift, gama ve kazanç: gölgeler, ara tonlar ve ışıklar, her biri bir renk tonuna doğru itilir ve daha açık ya da daha koyu yapılır.",+ "effects.colorWheels.name": "Renk tekerlekleri","effects.contrast.description": "Orta gri çevresinde, durak durak daha fazla ya da daha az kontrast; beyazın ötesindeki ışıklar korunur, siyah asla ezilmez.","effects.contrast.name": "Kontrast","effects.contrastPop.description": "Daha derin gölgeler, daha parlak ışıklar.",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT tarama çizgileri","effects.cube.description": "Giden çekim bir küp yüzü gibi dönerek uzaklaşırken gelen çekim dönerek görünür.","effects.cube.name": "Küp",+ "effects.curves.description": "Görüntünün düzeyleri çizdiğiniz eğriler boyunca bükülür: yalnızca parlaklık için luma, sonra kırmızı, yeşil ve mavi.",+ "effects.curves.name": "Eğriler","effects.cyberpunk.description": "Gölgelere macenta, ışığa camgöbeği; sert bastırılmış ve neon gibi parlak.","effects.cyberpunk.name": "Cyberpunk","effects.datamosh.description": "Görüntünün blokları yana doğru yırtılır, bozuk bir codec gibi titrer.",@@ -344,8 +348,10 @@"effects.greenScreen.description": "Yeşili çıkarır, görüntüyü altında ne varsa onun üzerine bırakır.","effects.greenScreen.name": "Yeşil perde","effects.groups.color": "Renk",+ "effects.groups.curves": "Eğriler","effects.groups.effects": "Efektler","effects.groups.lightness": "Işık",+ "effects.groups.wheels": "Tekerlekler","effects.halation.description": "Yüksek kontrastlı kenarların çevresine taşan sıcak kırmızı/turuncu parıltı.","effects.halation.name": "Halasyon","effects.halftone.description": "Görüntü siyah beyaz noktalardan bir ızgaraya indirgenmiş.",@@ -376,6 +382,7 @@"effects.labels.bits": "Bit","effects.labels.blacks": "Siyahlar","effects.labels.bleed": "Bleed",+ "effects.labels.blue": "Mavi","effects.labels.blur": "Bulanıklık","effects.labels.blush": "Blush","effects.labels.body": "Gövde",@@ -409,8 +416,10 @@"effects.labels.flash": "Flash","effects.labels.frequency": "Frekans","effects.labels.gain": "Kazanç",+ "effects.labels.gamma": "Gama","effects.labels.glow": "Parıltı","effects.labels.grain": "Grain",+ "effects.labels.green": "Yeşil","effects.labels.greens": "Greens","effects.labels.haze": "Haze","effects.labels.heat": "Isı",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "Light leak","effects.labels.lights": "Lights","effects.labels.lines": "Lines",+ "effects.labels.luma": "Luma","effects.labels.matte": "Matte","effects.labels.minimum": "En az","effects.labels.noise": "Gürültü",@@ -439,6 +449,7 @@"effects.labels.punch": "Punch","effects.labels.radius": "Yarıçap","effects.labels.rate": "Hız",+ "effects.labels.red": "Kırmızı","effects.labels.rgbSplit": "RGB ayrımı","effects.labels.rotation": "Döndürme","effects.labels.saturation": "Doygunluk",diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.jsonindex e194f396..d2aa685f 100644--- a/src/crates/concat/locales/zh-Hans.json+++ b/src/crates/concat/locales/zh-Hans.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "万里晴空","effects.colorCycle.description": "色相随时间在整个色谱上平滑轮转。","effects.colorCycle.name": "颜色循环",+ "effects.colorWheels.description": "暗部、伽马与增益:阴影、中间调和高光各自推向一个色相,并调亮或调暗。",+ "effects.colorWheels.name": "色轮","effects.contrast.description": "以中灰为中心按档增减对比度,保留白色以上的高光,黑色也绝不会死黑。","effects.contrast.name": "对比度","effects.contrastPop.description": "阴影更深,高光更亮。",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT 扫描线","effects.cube.description": "上一个镜头像立方体的一面般转走,下一个镜头随之转入视野。","effects.cube.name": "立方体",+ "effects.curves.description": "沿你绘制的曲线弯折画面的各级亮度:亮度(Luma)只改明暗,然后是红、绿、蓝。",+ "effects.curves.name": "曲线","effects.cyberpunk.description": "洋红压入阴影,青色染上亮处,推到极致,霓虹般明亮。","effects.cyberpunk.name": "赛博朋克","effects.datamosh.description": "画面块状区域横向撕裂,像损坏的编码器一样闪烁。",@@ -344,8 +348,10 @@"effects.greenScreen.description": "抠除绿色,让画面叠在下层内容之上。","effects.greenScreen.name": "绿幕","effects.groups.color": "颜色",+ "effects.groups.curves": "曲线","effects.groups.effects": "效果","effects.groups.lightness": "亮度",+ "effects.groups.wheels": "色轮","effects.halation.description": "暖红橙色辉光在高对比度边缘周围晕开。","effects.halation.name": "光晕","effects.halftone.description": "画面简化为黑白网点。",@@ -376,6 +382,7 @@"effects.labels.bits": "位数","effects.labels.blacks": "黑位","effects.labels.bleed": "渗色",+ "effects.labels.blue": "蓝","effects.labels.blur": "模糊","effects.labels.blush": "腮红","effects.labels.body": "饱满度",@@ -409,8 +416,10 @@"effects.labels.flash": "闪光","effects.labels.frequency": "频率","effects.labels.gain": "增益",+ "effects.labels.gamma": "伽马","effects.labels.glow": "发光","effects.labels.grain": "颗粒",+ "effects.labels.green": "绿","effects.labels.greens": "绿色","effects.labels.haze": "薄雾","effects.labels.heat": "热浪",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "漏光","effects.labels.lights": "灯光","effects.labels.lines": "线条",+ "effects.labels.luma": "亮度","effects.labels.matte": "哑光","effects.labels.minimum": "最小值","effects.labels.noise": "噪点",@@ -439,6 +449,7 @@"effects.labels.punch": "冲击","effects.labels.radius": "半径","effects.labels.rate": "速率",+ "effects.labels.red": "红","effects.labels.rgbSplit": "RGB 分离","effects.labels.rotation": "旋转","effects.labels.saturation": "饱和度",diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.jsonindex efa47e63..abfbaebb 100644--- a/src/crates/concat/locales/zh-TW.json+++ b/src/crates/concat/locales/zh-TW.json@@ -263,6 +263,8 @@"effects.cloudlessSky.name": "萬里晴空","effects.colorCycle.description": "色相隨時間在整個色譜上平滑輪轉。","effects.colorCycle.name": "顏色循環",+ "effects.colorWheels.description": "暗部、伽瑪與增益:陰影、中間調和亮部各自推向一個色相,並調亮或調暗。",+ "effects.colorWheels.name": "色輪","effects.contrast.description": "以中間灰為中心按格增減對比度,保留白色以上的亮部,黑色也絕不會死黑。","effects.contrast.name": "對比度","effects.contrastPop.description": "陰影更深,亮部更亮。",@@ -277,6 +279,8 @@"effects.crtScanlines.name": "CRT 掃描線","effects.cube.description": "上一個鏡頭像立方體的一面般轉走,下一個鏡頭隨之轉入視野。","effects.cube.name": "立方體",+ "effects.curves.description": "沿你繪製的曲線彎折畫面的各級亮度:亮度(Luma)只改明暗,然後是紅、綠、藍。",+ "effects.curves.name": "曲線","effects.cyberpunk.description": "洋紅壓入陰影,青色染上亮處,推到極致,霓虹般明亮。","effects.cyberpunk.name": "賽博龐克","effects.datamosh.description": "畫面區塊橫向撕裂,像損壞的編碼器一樣閃爍。",@@ -344,8 +348,10 @@"effects.greenScreen.description": "去除綠色,讓畫面疊在下層內容之上。","effects.greenScreen.name": "綠幕","effects.groups.color": "顏色",+ "effects.groups.curves": "曲線","effects.groups.effects": "效果","effects.groups.lightness": "亮度",+ "effects.groups.wheels": "色輪","effects.halation.description": "暖紅橙色輝光在高對比度邊緣周圍暈開。","effects.halation.name": "光暈","effects.halftone.description": "畫面簡化為黑白網點。",@@ -376,6 +382,7 @@"effects.labels.bits": "位元數","effects.labels.blacks": "黑位","effects.labels.bleed": "滲色",+ "effects.labels.blue": "藍","effects.labels.blur": "模糊","effects.labels.blush": "腮紅","effects.labels.body": "飽滿度",@@ -409,8 +416,10 @@"effects.labels.flash": "閃光","effects.labels.frequency": "頻率","effects.labels.gain": "增益",+ "effects.labels.gamma": "伽瑪","effects.labels.glow": "發光","effects.labels.grain": "顆粒",+ "effects.labels.green": "綠","effects.labels.greens": "綠色","effects.labels.haze": "薄霧","effects.labels.heat": "熱浪",@@ -426,6 +435,7 @@"effects.labels.lightLeak": "漏光","effects.labels.lights": "燈光","effects.labels.lines": "線條",+ "effects.labels.luma": "亮度","effects.labels.matte": "霧面","effects.labels.minimum": "最小值","effects.labels.noise": "雜訊",@@ -439,6 +449,7 @@"effects.labels.punch": "衝擊","effects.labels.radius": "半徑","effects.labels.rate": "速率",+ "effects.labels.red": "紅","effects.labels.rgbSplit": "RGB 分離","effects.labels.rotation": "旋轉","effects.labels.saturation": "飽和度",diff --git a/src/crates/concat/src/grading.rs b/src/crates/concat/src/grading.rsnew file mode 100644index 00000000..05da8fe2--- /dev/null+++ b/src/crates/concat/src/grading.rs@@ -0,0 +1,174 @@+// SPDX-License-Identifier: AGPL-3.0-or-later+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors++//! The colour wheels and curves, as the document holds them.+//!+//! A wheel is three numbers of its link's knobs - its puck, `<key>.x` and+//! `<key>.y` in the unit disc, and its master, `<key>.m` - keyed together as+//! one knob. A curve is its points, `<key>.<n>.x` and `<key>.<n>.y` in the+//! unit square, numbered from 0 with no gaps; a curve with none stored is+//! the line from black to white. What the shader makes of them is+//! concat-effects' `grade_wheels` and `grade_curves`; here is only how the+//! inspector reads and edits them.++use std::collections::BTreeMap;++use concat_effects::manifest::MAX_CURVE_POINTS;+use concat_effects::shader::{curve_points, curve_value, monotone_slopes};++/// The document keys a wheel is kept under: its puck across and up, and+/// its master.+pub fn wheel_keys(key: &str) -> [String; 3] {+ [format!("{key}.x"), format!("{key}.y"), format!("{key}.m")]+}++/// The points a curve holds, each with the number it is stored under, in+/// that order; none when the curve is the straight line.+pub fn stored_points(params: &BTreeMap<String, f64>, key: &str) -> Vec<(usize, f64, f64)> {+ (0..MAX_CURVE_POINTS)+ .filter_map(|n| {+ let x = params.get(&format!("{key}.{n}.x"))?;+ let y = params.get(&format!("{key}.{n}.y"))?;+ Some((n, *x, *y))+ })+ .collect()+}++/// The curve drawn in a unit box, y downwards: SVG path commands through+/// 65 steps of what the shader works out, the line from black to white for+/// a curve with no points.+pub fn curve_path(params: &BTreeMap<String, f64>, key: &str) -> String {+ let points = curve_points(params, key);+ let slopes = monotone_slopes(&points);+ let mut path = String::new();+ for step in 0..=64 {+ let x = f64::from(step) / 64.0;+ let y = 1.0 - curve_value(&points, &slopes, x).clamp(0.0, 1.0);+ let verb = if step == 0 { 'M' } else { 'L' };+ path.push_str(&format!("{verb} {x:.4} {y:.4} "));+ }+ path.trim_end().to_owned()+}++/// Puts point `point` of the curve at `(x, y)`, held to the unit square,+/// or a new point there when `point` is negative. A curve that is still the+/// straight line gets its two ends first, so the new point bends it rather+/// than making the whole curve; a curve with every point it may have takes+/// no more. Returns the number the point is stored under.+pub fn set_curve_point(+ params: &mut BTreeMap<String, f64>,+ key: &str,+ point: i32,+ x: f64,+ y: f64,+) -> Option<usize> {+ let (x, y) = (x.clamp(0.0, 1.0), y.clamp(0.0, 1.0));+ let index = match usize::try_from(point) {+ Ok(index) if index < MAX_CURVE_POINTS => index,+ Ok(_) => return None,+ Err(_) => {+ let mut stored = stored_points(params, key);+ if stored.len() < 2 {+ clear_curve(params, key);+ for (n, (px, py)) in [(0.0, 0.0), (1.0, 1.0)].into_iter().enumerate() {+ params.insert(format!("{key}.{n}.x"), px);+ params.insert(format!("{key}.{n}.y"), py);+ }+ stored = stored_points(params, key);+ }+ (0..MAX_CURVE_POINTS).find(|n| !stored.iter().any(|(held, ..)| held == n))?+ }+ };+ params.insert(format!("{key}.{index}.x"), x);+ params.insert(format!("{key}.{index}.y"), y);+ Some(index)+}++/// Takes point `point` off the curve and numbers the rest from 0 again, in+/// the order they were stored; a curve left with fewer than two points is+/// the straight line again.+pub fn remove_curve_point(params: &mut BTreeMap<String, f64>, key: &str, point: i32) {+ let kept: Vec<(f64, f64)> = stored_points(params, key)+ .into_iter()+ .filter(|(n, ..)| i32::try_from(*n).ok() != Some(point))+ .map(|(_, x, y)| (x, y))+ .collect();+ clear_curve(params, key);+ if kept.len() < 2 {+ return;+ }+ for (n, (x, y)) in kept.into_iter().enumerate() {+ params.insert(format!("{key}.{n}.x"), x);+ params.insert(format!("{key}.{n}.y"), y);+ }+}++/// Every point of the curve taken off: the straight line.+pub fn clear_curve(params: &mut BTreeMap<String, f64>, key: &str) {+ let prefix = format!("{key}.");+ params.retain(|held, _| {+ !(held.starts_with(&prefix)+ && held[prefix.len()..]+ .split_once('.')+ .is_some_and(|(n, _)| n.parse::<usize>().is_ok()))+ });+}++#[cfg(test)]+mod tests {+ use super::*;++ /// A first point bends a straight curve between its two ends; a moved+ /// point stays where it was stored; a removed one leaves the rest+ /// numbered from 0; and a curve left with one point is straight again.+ #[test]+ fn a_curve_is_edited_point_by_point() {+ let mut params = BTreeMap::from([("gain.m".to_owned(), 0.5)]);+ assert_eq!(set_curve_point(&mut params, "luma", -1, 0.5, 0.7), Some(2));+ assert_eq!(+ stored_points(¶ms, "luma"),+ [(0, 0.0, 0.0), (1, 1.0, 1.0), (2, 0.5, 0.7)]+ );+ assert_eq!(set_curve_point(&mut params, "luma", 1, 1.2, 0.9), Some(1));+ assert_eq!(+ stored_points(¶ms, "luma")[1],+ (1, 1.0, 0.9),+ "held to the square"+ );+ remove_curve_point(&mut params, "luma", 0);+ assert_eq!(+ stored_points(¶ms, "luma"),+ [(0, 1.0, 0.9), (1, 0.5, 0.7)],+ "numbered from 0 again"+ );+ remove_curve_point(&mut params, "luma", 1);+ assert!(stored_points(¶ms, "luma").is_empty(), "straight again");+ assert_eq!(+ params.get("gain.m"),+ Some(&0.5),+ "the other knobs untouched"+ );+ for _ in 0..MAX_CURVE_POINTS {+ set_curve_point(&mut params, "red", -1, 0.3, 0.3);+ }+ assert_eq!(stored_points(¶ms, "red").len(), MAX_CURVE_POINTS);+ assert_eq!(+ set_curve_point(&mut params, "red", -1, 0.4, 0.4),+ None,+ "full"+ );+ }++ /// A curve is drawn as the shader works it out: from black to white+ /// when straight, through its points when bent.+ #[test]+ fn a_curve_is_drawn_as_the_shader_draws_it() {+ let straight = curve_path(&BTreeMap::new(), "luma");+ assert!(straight.starts_with("M 0.0000 1.0000 "), "{straight}");+ assert!(straight.ends_with("L 1.0000 0.0000"), "{straight}");+ let mut params = BTreeMap::new();+ set_curve_point(&mut params, "luma", -1, 0.5, 0.75);+ assert!(curve_path(¶ms, "luma").contains("L 0.5000 0.2500"));+ assert_eq!(wheel_keys("lift"), ["lift.x", "lift.y", "lift.m"]);+ }+}diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rsindex 61c6b6e6..df5e7e7d 100644--- a/src/crates/concat/src/lib.rs+++ b/src/crates/concat/src/lib.rs@@ -35,6 +35,7 @@ mod chips;mod dock;mod format;mod gpu;+mod grading;mod host;mod i18n;mod platform;@@ -211,6 +212,10 @@ pub fn run() -> Result<(), slint::PlatformError> {editor.set_visual_params(ModelRc::from(models.visual_params.clone()));editor.set_audio_params(ModelRc::from(models.audio_params.clone()));editor.set_adjust_params(ModelRc::from(models.adjust_params.clone()));+ editor.set_adjust_wheels(ModelRc::from(models.adjust_wheels.clone()));+ editor.set_adjust_curves(ModelRc::from(models.adjust_curves.clone()));+ editor.set_visual_wheels(ModelRc::from(models.visual_wheels.clone()));+ editor.set_visual_curves(ModelRc::from(models.visual_curves.clone()));app.global::<Keyframes>().set_rows(ModelRc::from(models.key_rows.clone()));app.global::<KeyEditor>()@@ -994,6 +999,27 @@ pub fn run() -> Result<(), slint::PlatformError> {editor.on_adjust_set(on_lanes!(|state, key: SharedString, value: f32| {state.adjust_set(key.as_str(), value);}));+ editor.on_curve_point(on_lanes!(|state,+ entry: i32,+ key: SharedString,+ point: i32,+ x: f32,+ y: f32| {+ if entry < 0 {+ state.adjust_curve_point(key.as_str(), point, x, y);+ } else {+ state.chain_curve_point(entry, key.as_str(), point, x, y);+ }+ }));+ editor.on_curve_remove(on_lanes!(+ |state, entry: i32, key: SharedString, point: i32| {+ if entry < 0 {+ state.adjust_curve_remove(key.as_str(), point);+ } else {+ state.chain_curve_remove(entry, key.as_str(), point);+ }+ }+ ));// ── the monitor ──editor.on_seek(on_lanes!(|state, seconds: f32| {diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rsindex 022a25c4..4720f4ca 100644--- a/src/crates/concat/src/studio.rs+++ b/src/crates/concat/src/studio.rs@@ -51,6 +51,7 @@ use crate::format::{WAVE_BAR, WAVE_PITCH, colour_of, frames_timecode, hex_of, hex_rgba, hex_with_alpha,wave_columns, wave_path, when_phrase,};+use crate::grading;use crate::host::{CachedStrip, Host, MediaArt, WindowArt, cached_media_art, cached_window_art, image_at,image_of, media_art, on_ui_in_project, spawn, spawn_art, spawn_in_project, spawn_strip,@@ -571,6 +572,19 @@ pub struct Models {pub audio_params: Rc<VecModel<AppliedParamData>>,/// The colour panel's knobs.pub adjust_params: Rc<VecModel<AppliedParamData>>,+ /// The colour panel's wheels and curves, and the picture's chain's by+ /// link.+ pub adjust_wheels: Rc<VecModel<WheelData>>,+ pub adjust_curves: Rc<VecModel<CurveData>>,+ pub visual_wheels: Rc<VecModel<WheelGroupData>>,+ pub visual_curves: Rc<VecModel<CurveGroupData>>,+ /// A link's wheels and curves, and a curve's points, by the link - -1+ /// the colour panel - and the curve's key: kept like the rest, so a+ /// wheel or a point being dragged is not dropped when it is published+ /// again under the pointer.+ pub link_wheels: RefCell<HashMap<i32, Rc<VecModel<WheelData>>>>,+ pub link_curves: RefCell<HashMap<i32, Rc<VecModel<CurveData>>>>,+ pub curve_points: RefCell<HashMap<(i32, String), Rc<VecModel<CurvePointData>>>>,/// The keyframe cluster's rows and the libraries' views: synced like/// the rest, since a model handed over fresh is unequal to the last by/// identity and re-evaluates every binding on it.@@ -624,6 +638,13 @@ impl Models {visual_params: Rc::new(VecModel::default()),audio_params: Rc::new(VecModel::default()),adjust_params: Rc::new(VecModel::default()),+ adjust_wheels: Rc::new(VecModel::default()),+ adjust_curves: Rc::new(VecModel::default()),+ visual_wheels: Rc::new(VecModel::default()),+ visual_curves: Rc::new(VecModel::default()),+ link_wheels: RefCell::new(HashMap::new()),+ link_curves: RefCell::new(HashMap::new()),+ curve_points: RefCell::new(HashMap::new()),key_rows: Rc::new(VecModel::default()),key_editor_rows: Rc::new(VecModel::default()),key_marks: Rc::new(VecModel::default()),@@ -1266,6 +1287,8 @@ fn adjust_rows(chain: &[AppliedFilter], at: Option<f64>) -> Vec<AppliedParamData.manifest.params.iter()+ // The wheels and curves are drawn by widgets of their own.+ .filter(|param| !param.kind.is_compound()).map(|param| {let keyed = held.is_some_and(|entry| entry.is_keyed(¶m.key));let (here, prev, next) = match (held, at) {@@ -1367,7 +1390,12 @@ fn chain_rows(chain: &[AppliedFilter]) -> (Vec<AppliedEntryData>, Vec<AppliedParnext: false,});}- for param in &package.manifest.params {+ for param in package+ .manifest+ .params+ .iter()+ .filter(|param| !param.kind.is_compound())+ {let step = if param.step > 0.0 {param.step} else {@@ -1400,6 +1428,177 @@ fn chain_rows(chain: &[AppliedFilter]) -> (Vec<AppliedEntryData>, Vec<AppliedPar(rows, knobs)}+/// A link's wheels and curves as the inspector draws them: the values the+/// link holds, or the defaults when there is no link yet. `entry` is its+/// index in the chain, -1 for the Adjust panel; `keys` is the playhead's+/// place in the clip when the wheels can carry keys - Some(None) when it is+/// outside - and None when they cannot.+fn grading_rows(+ package: &concat_effects::Package,+ link: Option<&AppliedFilter>,+ entry: i32,+ keys: Option<Option<f64>>,+) -> (Vec<WheelData>, Vec<(CurveData, Vec<CurvePointData>)>) {+ use concat_effects::manifest::ParamType;+ let empty = std::collections::BTreeMap::new();+ let params = link.map_or(&empty, |link| &link.params);+ let mut wheels = Vec::new();+ let mut curves = Vec::new();+ for param in &package.manifest.params {+ match param.kind {+ ParamType::Wheel => {+ let [x, y, m] = grading::wheel_keys(¶m.key);+ let at = keys.flatten();+ let value = |name: &str, fallback: f64| match (link, at) {+ (Some(link), Some(at)) => link.value_at(name, at, fallback),+ _ => params.get(name).copied().unwrap_or(fallback),+ };+ let keyed = link.is_some_and(|link| link.is_keyed(&m));+ let (here, prev, next) = match (link, at) {+ (Some(link), Some(at)) if keyed => {+ let (prev, next) = link.keys_around(&m, at);+ (+ link.key_at(&m, at).is_some(),+ prev.is_some(),+ next.is_some(),+ )+ }+ _ => (false, false, false),+ };+ wheels.push(WheelData {+ entry,+ key: param.key.as_str().into(),+ label: i18n::shelf_text("labels", ¶m.label).into(),+ group: i18n::shelf_text("groups", ¶m.group).into(),+ x: value(&x, 0.0) as f32,+ y: value(&y, 0.0) as f32,+ master: value(&m, param.default) as f32,+ min: param.min as f32,+ max: param.max as f32,+ default_value: param.default as f32,+ keyable: keys.is_some(),+ keyed,+ here,+ prev,+ next,+ });+ }+ ParamType::Curve => {+ let points: Vec<CurvePointData> = grading::stored_points(params, ¶m.key)+ .into_iter()+ .map(|(index, x, y)| CurvePointData {+ index: index as i32,+ x: x as f32,+ y: y as f32,+ })+ .collect();+ curves.push((+ CurveData {+ entry,+ key: param.key.as_str().into(),+ label: i18n::shelf_text("labels", ¶m.label).into(),+ group: i18n::shelf_text("groups", ¶m.group).into(),+ points: ModelRc::default(),+ path: grading::curve_path(params, ¶m.key).into(),+ },+ points,+ ));+ }+ _ => {}+ }+ }+ (wheels, curves)+}++/// Every link's wheels and curves in a chain, for the stack.+fn chain_grading(+ chain: &[AppliedFilter],+) -> (Vec<WheelData>, Vec<(CurveData, Vec<CurvePointData>)>) {+ let catalogue = Catalogue::builtin();+ let mut wheels = Vec::new();+ let mut curves = Vec::new();+ for (index, link) in chain.iter().enumerate() {+ let Some(package) = catalogue+ .packages()+ .find(|package| package.answers_to(&link.id))+ else {+ continue;+ };+ if package.id() == ADJUST_ID {+ continue;+ }+ let (more_wheels, more_curves) = grading_rows(package, Some(link), index as i32, None);+ wheels.extend(more_wheels);+ curves.extend(more_curves);+ }+ (wheels, curves)+}++/// The document keys an Adjust knob is keyed under, with what each is worth+/// with no key: a wheel's three - named by the wheel or by any of its own -+/// else the knob's own.+fn adjust_key_names(key: &str) -> Vec<(String, f64)> {+ use concat_effects::manifest::ParamType;+ let Some(package) = Catalogue::builtin().get(ADJUST_ID) else {+ return vec![(key.to_owned(), 0.0)];+ };+ match package.manifest.owner(key) {+ Some(param) if param.kind == ParamType::Wheel => {+ let [x, y, m] = grading::wheel_keys(¶m.key);+ vec![(x, 0.0), (y, 0.0), (m, param.default)]+ }+ Some(param) => vec![(key.to_owned(), param.default)],+ None => vec![(key.to_owned(), 0.0)],+ }+}++/// The keys that move with an Adjust knob's key in the keyframes pane: for+/// a wheel's master, the puck's two; nothing for any other knob.+fn wheel_partners(param: &str) -> Vec<String> {+ let names = adjust_key_names(param);+ if names.len() == 3 && names[2].0 == param {+ names.into_iter().take(2).map(|(name, _)| name).collect()+ } else {+ Vec::new()+ }+}++/// The commands that take a wheel's puck keys at `from` to `to` with its+/// master's key - their values and eases kept - when `param` is a wheel's+/// master; nothing for any other knob.+fn partners_moved(+ link: &AppliedFilter,+ clip_id: &str,+ entry: usize,+ param: &str,+ from: f64,+ to: f64,+) -> Vec<Command> {+ wheel_partners(param)+ .into_iter()+ .filter_map(|name| {+ let key = link.keys_on(&name)[link.key_at(&name, from)?];+ Some([+ Command::ClearEffectKey {+ clip_id: clip_id.to_owned(),+ entry,+ key: name.clone(),+ at: from,+ },+ Command::SetEffectKey {+ clip_id: clip_id.to_owned(),+ entry,+ key: name,+ at: to,+ value: key.value,+ ease: key.ease,+ },+ ])+ })+ .flatten()+ .collect()+}+fn label_of(id: &str) -> String {id.split(['-', '_']).map(|word| {@@ -3039,12 +3238,44 @@ impl Studio {/// One knob of the colour panel, on the echo. The adjust package joins/// the head of the picture's chain the first time a knob moves, so an- /// untouched clip carries nothing.+ /// untouched clip carries nothing. A wheel's puck and master are knobs+ /// of their own here, `<key>.x`, `<key>.y` and `<key>.m`.pub fn adjust_set(&mut self, key: &str, value: f32) {+ let point = self.key_point().map(|(_, at)| at);+ self.edit_adjust_link(|link| match point {+ // A knob that rides is edited where the playhead is: the value+ // becomes the key there, put on if there was none. Setting the+ // constant under a ride would change nothing on screen.+ Some(at) if link.is_keyed(key) => {+ let ease = ease_before(link.keys_on(key), at);+ link.set_key(key, at, f64::from(value), ease);+ }+ _ => {+ link.params.insert(key.to_owned(), f64::from(value));+ }+ });+ }++ /// One point of one of the colour panel's curves, on the echo: moved,+ /// or put down when `point` is negative.+ pub fn adjust_curve_point(&mut self, key: &str, point: i32, x: f32, y: f32) {+ self.edit_adjust_link(|link| {+ grading::set_curve_point(&mut link.params, key, point, x.into(), y.into());+ });+ }++ /// One point of one of the colour panel's curves taken off, on the echo.+ pub fn adjust_curve_remove(&mut self, key: &str, point: i32) {+ self.edit_adjust_link(|link| grading::remove_curve_point(&mut link.params, key, point));+ }++ /// The selected clip's colour link on the echo, put at the head of the+ /// picture's chain if it is not there yet, handed to `edit`. Nothing+ /// for a clip that is not a picture.+ fn edit_adjust_link(&mut self, edit: impl FnOnce(&mut AppliedFilter)) {let Some(id) = self.sole_selection() else {return;};- let point = self.key_point().map(|(_, at)| at);self.begin_echo();let Some(clip) = self.echo_clip_mut(&id) else {return;@@ -3063,18 +3294,39 @@ impl Studio {0}};- let link = &mut clip.video_effects[entry];- match point {- // A knob that rides is edited where the playhead is: the value- // becomes the key there, put on if there was none. Setting the- // constant under a ride would change nothing on screen.- Some(at) if link.is_keyed(key) => {- let ease = ease_before(link.keys_on(key), at);- link.set_key(key, at, f64::from(value), ease);- }- _ => {- link.params.insert(key.to_owned(), f64::from(value));- }+ edit(&mut clip.video_effects[entry]);+ }++ /// One point of a curve of the picture chain's link `index`, on the+ /// echo: moved, or put down when `point` is negative.+ pub fn chain_curve_point(&mut self, index: i32, key: &str, point: i32, x: f32, y: f32) {+ self.edit_chain_link(index, |link| {+ grading::set_curve_point(&mut link.params, key, point, x.into(), y.into());+ });+ }++ /// One point of a curve of the picture chain's link `index` taken off,+ /// on the echo.+ pub fn chain_curve_remove(&mut self, index: i32, key: &str, point: i32) {+ self.edit_chain_link(index, |link| {+ grading::remove_curve_point(&mut link.params, key, point);+ });+ }++ /// The picture chain's link `index` of the selected clip, on the echo.+ fn edit_chain_link(&mut self, index: i32, edit: impl FnOnce(&mut AppliedFilter)) {+ let Some(id) = self.sole_selection() else {+ return;+ };+ self.begin_echo();+ let Some(clip) = self.echo_clip_mut(&id) else {+ return;+ };+ if let Some(link) = usize::try_from(index)+ .ok()+ .and_then(|index| clip.video_effects.get_mut(index))+ {+ edit(link);}}@@ -3096,73 +3348,98 @@ impl Studio {/// Puts a key on one Adjust knob at the playhead, or takes off the one/// there. Like `toggle_key`, the new key holds what the knob is worth- /// at that instant, so pressing the diamond never moves the picture.+ /// at that instant, so pressing the diamond never moves the picture. A+ /// wheel - named by itself or by one of its own keys - is one knob: its+ /// puck and master are keyed, and unkeyed, together.pub fn toggle_adjust_key(&mut self, key: &str) {let Some((clip, at, entry)) = self.adjust_point() else {return;};- let default = Catalogue::builtin()- .get(ADJUST_ID)- .and_then(|package| package.manifest.params.iter().find(|p| p.key == key))- .map_or(0.0, |param| param.default);+ let names = adjust_key_names(key);let clip_id = clip.id.clone();let Some(entry) = entry else {- // No colour link yet: one goes on, then the key on it, as one- // edit, so an undo takes both back.+ // No colour link yet: one goes on, then the keys on it, as one+ // edit, so an undo takes all of it back.let mut effects = clip.video_effects.clone();effects.insert(0, AppliedFilter::new(ADJUST_ID));- self.apply(Command::Batch {- commands: vec![- Command::UpdateClip {- clip_id: clip_id.clone(),- patch: ClipPatch {- video_effects: Some(effects),- ..ClipPatch::default()- },- },- Command::SetEffectKey {- clip_id,- entry: 0,- key: key.to_owned(),- at,- value: default,- ease: model::KeyEase::LINEAR,- },- ],- });+ let mut commands = vec![Command::UpdateClip {+ clip_id: clip_id.clone(),+ patch: ClipPatch {+ video_effects: Some(effects),+ ..ClipPatch::default()+ },+ }];+ commands.extend(names.iter().map(|(name, default)| Command::SetEffectKey {+ clip_id: clip_id.clone(),+ entry: 0,+ key: name.clone(),+ at,+ value: *default,+ ease: model::KeyEase::LINEAR,+ }));+ self.apply(Command::Batch { commands });return;};let link = &clip.video_effects[entry];- let command = if link.key_at(key, at).is_some() {- Command::ClearEffectKey {- clip_id,- entry,- key: key.to_owned(),- at,- }+ // The knob is keyed here when its own key - a wheel's master - is.+ let on = names+ .last()+ .is_some_and(|(name, _)| link.key_at(name, at).is_some());+ let mut commands: Vec<Command> = names+ .iter()+ .filter_map(|(name, default)| {+ if on {+ link.key_at(name, at).map(|_| Command::ClearEffectKey {+ clip_id: clip_id.clone(),+ entry,+ key: name.clone(),+ at,+ })+ } else {+ Some(Command::SetEffectKey {+ clip_id: clip_id.clone(),+ entry,+ key: name.clone(),+ at,+ value: link.value_at(name, at, *default),+ ease: ease_before(link.keys_on(name), at),+ })+ }+ })+ .collect();+ let command = if commands.len() == 1 {+ commands.remove(0)} else {- Command::SetEffectKey {- clip_id,- entry,- key: key.to_owned(),- at,- value: link.value_at(key, at, default),- ease: ease_before(link.keys_on(key), at),- }+ Command::Batch { commands }};self.apply(command);}- /// Takes every key off one Adjust knob, leaving it the value it holds.+ /// Takes every key off one Adjust knob - a wheel's puck and master+ /// together - leaving it the value it holds.pub fn clear_adjust_keys(&mut self, key: &str) {let Some((clip, _, Some(entry))) = self.adjust_point() else {return;};- self.apply(Command::ClearEffectKeys {- clip_id: clip.id,- entry,- key: key.to_owned(),- });+ let link = &clip.video_effects[entry];+ let mut commands: Vec<Command> = adjust_key_names(key)+ .into_iter()+ .filter(|(name, _)| link.is_keyed(name))+ .map(|(name, _)| Command::ClearEffectKeys {+ clip_id: clip.id.clone(),+ entry,+ key: name,+ })+ .collect();+ match commands.len() {+ 0 => {}+ 1 => {+ self.apply(commands.remove(0));+ }+ _ => {+ self.apply(Command::Batch { commands });+ }+ }}/// Moves the playhead to an Adjust knob's previous (-1) or next (+1) key.@@ -3170,7 +3447,10 @@ impl Studio {let Some((clip, at, Some(entry))) = self.adjust_point() else {return;};- let (prev, next) = clip.video_effects[entry].keys_around(key, at);+ let Some((name, _)) = adjust_key_names(key).pop() else {+ return;+ };+ let (prev, next) = clip.video_effects[entry].keys_around(&name, at);let Some(target) = (if delta < 0 { prev } else { next }) else {return;};@@ -6320,6 +6600,94 @@ impl Studio {_ => Vec::new(),},);++ // The wheels and curves: the chain's by link, the colour panel's+ // keyable at the playhead. Each curve's points go into the model+ // kept for it.+ let clip = self.sole_selection().and_then(|id| self.clip(&id));+ let (visual_wheels, visual_curves) =+ clip.map_or_else(Default::default, |clip| chain_grading(&clip.video_effects));+ let (adjust_wheels, adjust_curves) = match (clip, Catalogue::builtin().get(ADJUST_ID)) {+ (Some(clip), Some(package)) if clip.kind.is_visual() => grading_rows(+ package,+ clip.video_effects+ .iter()+ .find(|entry| entry.id == ADJUST_ID),+ -1,+ Some(self.key_point().map(|(_, at)| at)),+ ),+ _ => Default::default(),+ };+ let placed = |curves: Vec<(CurveData, Vec<CurvePointData>)>| -> Vec<CurveData> {+ let mut kept = models.curve_points.borrow_mut();+ curves+ .into_iter()+ .map(|(mut curve, points)| {+ let model = Rc::clone(+ kept.entry((curve.entry, curve.key.to_string()))+ .or_insert_with(|| Rc::new(VecModel::default())),+ );+ sync(&model, points);+ curve.points = ModelRc::from(model);+ curve+ })+ .collect()+ };+ sync(&models.adjust_wheels, adjust_wheels);+ sync(&models.adjust_curves, placed(adjust_curves));+ // The chain's, one group a link, in chain order, each group's list+ // the model kept for its link.+ let visual_curves = placed(visual_curves);+ let mut entries: Vec<i32> = visual_wheels+ .iter()+ .map(|wheel| wheel.entry)+ .chain(visual_curves.iter().map(|curve| curve.entry))+ .collect();+ entries.sort_unstable();+ entries.dedup();+ let (mut wheel_groups, mut curve_groups) = (Vec::new(), Vec::new());+ for entry in entries {+ let wheels: Vec<WheelData> = visual_wheels+ .iter()+ .filter(|wheel| wheel.entry == entry)+ .cloned()+ .collect();+ if !wheels.is_empty() {+ let model = Rc::clone(+ models+ .link_wheels+ .borrow_mut()+ .entry(entry)+ .or_insert_with(|| Rc::new(VecModel::default())),+ );+ sync(&model, wheels);+ wheel_groups.push(WheelGroupData {+ entry,+ wheels: ModelRc::from(model),+ });+ }+ let curves: Vec<CurveData> = visual_curves+ .iter()+ .filter(|curve| curve.entry == entry)+ .cloned()+ .collect();+ if !curves.is_empty() {+ let model = Rc::clone(+ models+ .link_curves+ .borrow_mut()+ .entry(entry)+ .or_insert_with(|| Rc::new(VecModel::default())),+ );+ sync(&model, curves);+ curve_groups.push(CurveGroupData {+ entry,+ curves: ModelRc::from(model),+ });+ }+ }+ sync(&models.visual_wheels, wheel_groups);+ sync(&models.visual_curves, curve_groups);}// ── the effect libraries ──@@ -6650,6 +7018,50 @@ impl Studio {ease_index,});}+ // A wheel that rides is one row, drawn from its master's keys;+ // its puck's keys sit at the same instants and move with them.+ if let Some(package) = Catalogue::builtin().get(ADJUST_ID) {+ let (wheels, _) = grading_rows(package, Some(link), -1, Some(inside));+ for wheel in wheels.into_iter().filter(|wheel| wheel.keyed) {+ let [_, _, master] = grading::wheel_keys(&wheel.key);+ let keys: Vec<(f64, f64, model::KeyEase)> = link+ .keys_on(&master)+ .iter()+ .map(|key| (key.at, key.value, key.ease))+ .collect();+ let (minimum, maximum) = (f64::from(wheel.min), f64::from(wheel.max));+ let (marks, curve, ease_index) = marks_and_curve(&keys, &|value| {+ if maximum > minimum {+ (value - minimum) / (maximum - minimum)+ } else {+ 0.5+ }+ });+ rows.push(KeyRowData {+ field: ClipField::Scale,+ param: master.as_str().into(),+ label: wheel.label.clone(),+ keys: marks,+ state: ClipKeyData {+ field: ClipField::Scale,+ keyed: true,+ here: wheel.here,+ prev: wheel.prev,+ next: wheel.next,+ },+ value: wheel.master,+ minimum: wheel.min,+ maximum: wheel.max,+ step: 0.01,+ default_value: wheel.default_value,+ fmt: format_of(""),+ unit: SharedString::default(),+ unit_scale: 1.0,+ curve: curve.into(),+ ease_index,+ });+ }+ }}rows}@@ -6708,7 +7120,7 @@ impl Studio {let (minimum, maximum) = (f64::from(row.min), f64::from(row.max));let value = minimum + fraction * (maximum - minimum);let ease = link.keys_on(param)[index].ease;- vec![+ let mut commands = vec![Command::ClearEffectKey {clip_id: clip_id.clone(),entry,@@ -6716,14 +7128,16 @@ impl Studio {at: from,},Command::SetEffectKey {- clip_id,+ clip_id: clip_id.clone(),entry,key: param.to_owned(),at: to,value,ease,},- ]+ ];+ commands.extend(partners_moved(link, &clip_id, entry, param, from, to));+ commands};self.apply(Command::Batch { commands });}@@ -6872,7 +7286,7 @@ impl Studio {};let key = &link.keys_on(param)[index];let (value, ease) = (key.value, key.ease);- vec![+ let mut commands = vec![Command::ClearEffectKey {clip_id: clip_id.clone(),entry,@@ -6880,14 +7294,16 @@ impl Studio {at: from,},Command::SetEffectKey {- clip_id,+ clip_id: clip_id.clone(),entry,key: param.to_owned(),at: to,value,ease,},- ]+ ];+ commands.extend(partners_moved(link, &clip_id, entry, param, from, to));+ commands};self.apply(Command::Batch { commands });}@@ -6924,16 +7340,27 @@ impl Studio {return;};let link = &clip.video_effects[entry];- let Some(index) = link.key_at(param, at) else {+ if link.key_at(param, at).is_none() {return;- };- Command::SetEffectKey {- clip_id,- entry,- key: param.to_owned(),- at,- value: link.keys_on(param)[index].value,- ease,+ }+ let mut commands: Vec<Command> = std::iter::once(param.to_owned())+ .chain(wheel_partners(param))+ .filter_map(|name| {+ let index = link.key_at(&name, at)?;+ Some(Command::SetEffectKey {+ clip_id: clip_id.clone(),+ entry,+ value: link.keys_on(&name)[index].value,+ key: name,+ at,+ ease,+ })+ })+ .collect();+ if commands.len() == 1 {+ commands.remove(0)+ } else {+ Command::Batch { commands }}};self.apply_within("ease", command);@@ -8428,10 +8855,66 @@ impl Studio {#[cfg(test)]mod tests {use super::{- Command, Footprint, Studio, custom_frame, custom_rate, fps_of, home_folder, key_commands,- place_in, shown, write_keyable,+ Command, Footprint, Studio, adjust_key_names, custom_frame, custom_rate, fps_of,+ grading_rows, home_folder, key_commands, place_in, shown, wheel_partners, write_keyable,};+ /// A wheel is keyed as one knob: named by itself or by any of its own+ /// keys, it keys its puck and master; its master's key takes the puck's+ /// with it in the keyframes pane; any other knob keys alone.+ #[test]+ fn a_wheel_keys_as_one_knob() {+ let names = |key: &str| -> Vec<String> {+ adjust_key_names(key)+ .into_iter()+ .map(|(name, _)| name)+ .collect()+ };+ assert_eq!(names("lift"), ["lift.x", "lift.y", "lift.m"]);+ assert_eq!(names("gain.x"), ["gain.x", "gain.y", "gain.m"]);+ assert_eq!(names("exposure"), ["exposure"]);+ assert_eq!(wheel_partners("gamma.m"), ["gamma.x", "gamma.y"]);+ assert!(wheel_partners("gamma.x").is_empty());+ assert!(wheel_partners("exposure").is_empty());+ }++ /// The Adjust panel's wheels and curves come from its manifest: three+ /// wheels at rest and four straight curves on a clip that carries+ /// nothing, and a link's own values where it holds them.+ #[test]+ fn the_adjust_panel_draws_its_wheels_and_curves() {+ use concat_project::model::AppliedFilter;+ let package = concat_effects::Catalogue::builtin()+ .get("concat.adjust")+ .expect("a built-in");+ let (wheels, curves) = grading_rows(package, None, -1, Some(None));+ assert_eq!(+ wheels.iter().map(|w| w.key.as_str()).collect::<Vec<_>>(),+ ["lift", "gamma", "gain"]+ );+ assert!(+ wheels+ .iter()+ .all(|w| w.x == 0.0 && w.y == 0.0 && w.master == 0.0 && w.keyable)+ );+ assert_eq!(+ curves+ .iter()+ .map(|(c, _)| c.key.as_str())+ .collect::<Vec<_>>(),+ ["luma", "red", "green", "blue"]+ );+ assert!(curves.iter().all(|(_, points)| points.is_empty()));+ let mut link = AppliedFilter::new("concat.adjust");+ link.params.insert("gain.x".to_owned(), 0.25);+ link.params.insert("gain.m".to_owned(), -0.5);+ crate::grading::set_curve_point(&mut link.params, "red", -1, 0.5, 0.6);+ let (wheels, curves) = grading_rows(package, Some(&link), -1, None);+ assert_eq!((wheels[2].x, wheels[2].master), (0.25, -0.5));+ assert!(!wheels[2].keyable, "a stack's wheels take no keys");+ assert_eq!(curves[1].1.len(), 3, "the ends and the point put down");+ }+/// A typed frame is even on both sides and inside the limits.#[test]fn a_typed_frame_is_even_and_bounded() {diff --git a/src/crates/concat/ui/editor.slint b/src/crates/concat/ui/editor.slintindex f81b743b..9b6df8d3 100644--- a/src/crates/concat/ui/editor.slint+++ b/src/crates/concat/ui/editor.slint@@ -5,6 +5,9 @@ import { EffectData } from "demo/effects-panel.slint";import {AppliedEntryData, AppliedParamData, CatalogueEntryData,} from "inspector/clip-inspector.slint";+import {+ CurveData, CurveGroupData, WheelData, WheelGroupData,+} from "inspector/grading.slint";import { MediaFilter, MediaItemData, TextPresetData } from "workspace/media-pane.slint";import { DockDivider, DockSide, SeatBox } from "dock.slint";import { PaneKind } from "workspace/pane-switcher.slint";@@ -147,6 +150,16 @@ export global Editor {/// The Adjust tab: the colour package's knobs for the selected clip.in-out property <[AppliedParamData]> adjust-params;callback adjust-set(key: string, value: float);+ /// The Adjust tab's wheels and curves, and the picture chain's, a+ /// group a link: see `grading.slint`. A wheel's puck and master are set+ /// as knobs, `<key>.x`, `<key>.y` and `<key>.m`; a curve's points by+ /// these two, `entry` -1 for the Adjust tab's.+ in-out property <[WheelData]> adjust-wheels;+ in-out property <[CurveData]> adjust-curves;+ in-out property <[WheelGroupData]> visual-wheels;+ in-out property <[CurveGroupData]> visual-curves;+ callback curve-point(entry: int, key: string, point: int, x: float, y: float);+ callback curve-remove(entry: int, key: string, point: int);/// Something was just applied from the library: the inspector should/// show it. The token changes with every application; the tab anddiff --git a/src/crates/concat/ui/inspector/clip-inspector.slint b/src/crates/concat/ui/inspector/clip-inspector.slintindex cee66dc7..4b30e7cf 100644--- a/src/crates/concat/ui/inspector/clip-inspector.slint+++ b/src/crates/concat/ui/inspector/clip-inspector.slint@@ -28,6 +28,14 @@ import {Switch,SwitchRow,} from "controls.slint";+import {+ ColorWheel,+ CurveData,+ CurveEditor,+ CurveGroupData,+ WheelData,+ WheelGroupData,+} from "grading.slint";import {ClipField,ClipKind,@@ -192,6 +200,9 @@ export component PresetStack inherits VerticalLayout {/// spliced from the language.in property <[AppliedEntryData]> applied;in property <[AppliedParamData]> params;+ /// The links' wheels and curves, a group a link that has any.+ in property <[WheelGroupData]> wheel-groups;+ in property <[CurveGroupData]> curve-groups;/// Which of the three libraries this is: 0 filters, 1 effects, 2 audio./// The index its view state and its callbacks are keyed by.@@ -213,6 +224,9 @@ export component PresetStack inherits VerticalLayout {callback remove(index: int);/// One knob moved. The value lands on the echo; `commit` makes it real.callback set-param(index: int, key: string, value: float);+ /// A curve's point moved, or put down when `point` is -1, or taken off.+ callback curve-point(index: int, key: string, point: int, x: float, y: float);+ callback curve-remove(index: int, key: string, point: int);callback commit();// The grid. Three columns at the inspector's width, which puts a tile at@@ -374,6 +388,51 @@ export component PresetStack inherits VerticalLayout {}}}++ // The link's wheels, three in a row, and its curves.+ for g in root.wheel-groups: Rectangle {+ visible: g.entry == index;+ height: g.entry == index ? trio.preferred-height : 0;++ trio := HorizontalLayout {+ padding-left: Theme.pad;+ padding-right: Theme.pad;+ spacing: 8px;++ for w in g.wheels: ColorWheel {+ data: w;+ enabled: item.on;+ moved(x, y) => {+ root.set-param(index, w.key + ".x", x);+ root.set-param(index, w.key + ".y", y);+ root.commit();+ }+ master-changed(v) => {+ root.set-param(index, w.key + ".m", v);+ root.commit();+ }+ }+ }+ }+ for g in root.curve-groups: Rectangle {+ visible: g.entry == index;+ height: g.entry == index ? graph.preferred-height : 0;++ graph := CurveEditor {+ padding-left: Theme.pad;+ padding-right: Theme.pad;+ curves: g.curves;+ enabled: item.on;+ point(key, point, x, y) => {+ root.curve-point(index, key, point, x, y);+ root.commit();+ }+ remove(key, point) => {+ root.curve-remove(index, key, point);+ root.commit();+ }+ }+ }}}}@@ -1639,8 +1698,13 @@ export component SpeedPanel inherits VerticalLayout {/// manifest, so a knob added there appears here without a line of UI.export component AdjustPanel inherits VerticalLayout {in property <[AppliedParamData]> params;+ in property <[WheelData]> wheels;+ in property <[CurveData]> curves;callback set(key: string, value: float);+ /// A curve's point moved, or put down when `point` is -1, or taken off.+ callback curve-point(key: string, point: int, x: float, y: float);+ callback curve-remove(key: string, point: int);callback commit();Section {@@ -1689,6 +1753,57 @@ export component AdjustPanel inherits VerticalLayout {}}}++ // The wheels, three in a row: a puck is two knobs of the panel,+ // `<key>.x` and `<key>.y`, and the master a third.+ if root.wheels.length > 0: VerticalLayout {+ spacing: Theme.gap;++ Subhead {+ title: root.wheels[0].group;+ }++ HorizontalLayout {+ padding-left: Theme.pad;+ padding-right: Theme.pad;+ spacing: 8px;++ for w in root.wheels: ColorWheel {+ data: w;+ moved(x, y) => {+ root.set(w.key + ".x", x);+ root.set(w.key + ".y", y);+ root.commit();+ }+ master-changed(v) => {+ root.set(w.key + ".m", v);+ root.commit();+ }+ }+ }+ }++ if root.curves.length > 0: VerticalLayout {+ spacing: Theme.gap;++ Subhead {+ title: root.curves[0].group;+ }++ CurveEditor {+ padding-left: Theme.pad;+ padding-right: Theme.pad;+ curves: root.curves;+ point(key, point, x, y) => {+ root.curve-point(key, point, x, y);+ root.commit();+ }+ remove(key, point) => {+ root.curve-remove(key, point);+ root.commit();+ }+ }+ }}}}diff --git a/src/crates/concat/ui/inspector/grading.slint b/src/crates/concat/ui/inspector/grading.slintnew file mode 100644index 00000000..27bf7c1a--- /dev/null+++ b/src/crates/concat/ui/inspector/grading.slint@@ -0,0 +1,388 @@+// SPDX-License-Identifier: AGPL-3.0-or-later+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors++import { I18n } from "../i18n.slint";+import { Theme } from "../theme/theme.slint";+import { Fmt } from "../util.slint";+import { NumberField } from "../primitives/number-field.slint";+import { ClipField } from "../timeline/model.slint";+import { KeyCluster } from "controls.slint";++// The colour wheels and the curves: lift, gamma and gain as three wheels in+// a row, and one graph for the curves with a tab a channel. Both draw what+// Rust publishes and hand every change straight back, so the picture moves+// with the pointer; a wheel's puck and a dragged point follow the pointer+// here until Rust has caught up.++/// One colour wheel of one link: its puck in the unit disc and its master,+/// as the document holds them, and its keys where it can carry them.+export struct WheelData {+ /// Which link, as an index into the chain; -1 for the Adjust panel.+ entry: int,+ /// The manifest's key: the puck is `<key>.x` and `<key>.y`, the master+ /// `<key>.m`.+ key: string,+ label: string,+ /// The subhead the wheels sit under in the Adjust panel.+ group: string,+ x: float,+ y: float,+ master: float,+ min: float,+ max: float,+ default-value: float,+ keyable: bool,+ keyed: bool,+ here: bool,+ prev: bool,+ next: bool,+}++/// One point of a curve, in the unit square, y upwards.+export struct CurvePointData {+ /// The number the point is stored under, which Rust is handed back.+ index: int,+ x: float,+ y: float,+}++/// One curve of one link.+export struct CurveData {+ /// Which link, as an index into the chain; -1 for the Adjust panel.+ entry: int,+ key: string,+ label: string,+ /// The subhead the curves sit under in the Adjust panel.+ group: string,+ points: [CurvePointData],+ /// The curve as the shader works it out, in a unit box, y downwards:+ /// path commands.+ path: string,+}++/// One link's wheels, for a stack that draws a chain of links.+export struct WheelGroupData {+ entry: int,+ wheels: [WheelData],+}++/// One link's curves, likewise.+export struct CurveGroupData {+ entry: int,+ curves: [CurveData],+}++/// The colour a curve is drawn in: the first - luma - in the foreground's,+/// then red, green and blue.+global CurveTint {+ public pure function of(channel: int) -> color {+ return channel == 1 ? #e5484d : channel == 2 ? #46a758 : channel == 3 ? #4c7df0 : Theme.fg;+ }+}++/// A colour wheel: a disc of hues, red at the top, with a puck pushed+/// towards the hue the grade should lean to - further out, further - and+/// the master under it, which makes the wheel's end of the picture brighter+/// or darker. Double-click the disc to put the puck back in the middle; the+/// master's field scrubs on a drag like every other.+export component ColorWheel inherits VerticalLayout {+ in property <WheelData> data;+ in property <bool> enabled: true;++ /// The puck, as it moves.+ callback moved(x: float, y: float);+ callback master-changed(value: float);++ property <float> puck-x: root.data.x;+ property <float> puck-y: root.data.y;+ property <bool> dragging;+ changed data => {+ if (!root.dragging) {+ root.puck-x = root.data.x;+ root.puck-y = root.data.y;+ }+ master.value = root.data.master;+ }++ spacing: 4px;+ alignment: start;+ horizontal-stretch: 1;++ HorizontalLayout {+ alignment: center;+ spacing: 2px;++ Text {+ text: root.data.label;+ color: Theme.fg-muted;+ font-size: Theme.fs;+ vertical-alignment: center;+ }++ if root.data.keyable: KeyCluster {+ name: root.data.key;+ state: {+ field: ClipField.scale,+ keyed: root.data.keyed,+ here: root.data.here,+ prev: root.data.prev,+ next: root.data.next,+ };+ }+ }++ disc := Rectangle {+ property <length> radius: self.width / 2;+ min-width: 56px;+ height: self.width;+ opacity: root.enabled ? 1.0 : 0.45;++ Rectangle {+ border-radius: parent.radius;+ background: @conic-gradient(#e0443e 0deg, #d9c93b 60deg, #4cc24a 120deg, #3dc3c9 180deg, #4552d9 240deg, #c946c9 300deg, #e0443e 360deg);+ }+ // Grey towards the middle, where the puck pushes towards nothing.+ Rectangle {+ border-radius: parent.radius;+ background: @radial-gradient(circle, Theme.well 0%, Theme.well.transparentize(40%) 55%, Theme.well.transparentize(100%) 100%);+ }+ Rectangle {+ border-radius: parent.radius;+ border-width: 1px;+ border-color: Theme.line;+ }+ Rectangle {+ x: parent.radius - 4px;+ y: parent.radius - 0.5px;+ width: 8px;+ height: 1px;+ background: Theme.fg-dim;+ }+ Rectangle {+ x: parent.radius - 0.5px;+ y: parent.radius - 4px;+ width: 1px;+ height: 8px;+ background: Theme.fg-dim;+ }+ Rectangle {+ x: parent.radius * (1 + root.puck-x) - 6px;+ y: parent.radius * (1 - root.puck-y) - 6px;+ width: 12px;+ height: 12px;+ border-radius: 6px;+ border-width: 2px;+ border-color: #ffffff;+ background: #00000040;+ }++ touch := TouchArea {+ enabled: root.enabled;+ mouse-cursor: crosshair;++ function place() {+ let dx = (self.mouse-x - disc.radius) / disc.radius;+ let dy = (disc.radius - self.mouse-y) / disc.radius;+ let reach = Math.sqrt(dx * dx + dy * dy);+ let inside = reach > 1 ? 1 / reach : 1;+ root.puck-x = Fmt.round-to(dx * inside, 3);+ root.puck-y = Fmt.round-to(dy * inside, 3);+ root.moved(root.puck-x, root.puck-y);+ }++ pointer-event(event) => {+ if (event.kind == PointerEventKind.down && event.button == PointerEventButton.left) {+ root.dragging = true;+ self.place();+ }+ if (event.kind == PointerEventKind.up || event.kind == PointerEventKind.cancel) {+ root.dragging = false;+ }+ }+ moved => {+ if (self.pressed) {+ self.place();+ }+ }+ double-clicked => {+ root.puck-x = 0;+ root.puck-y = 0;+ root.moved(0, 0);+ }+ }+ }++ master := NumberField {+ value: root.data.master;+ minimum: root.data.min;+ maximum: root.data.max;+ step: 0.01;+ precision: 2;+ enabled: root.enabled;+ changed(v) => { root.master-changed(v); }+ }+}++/// One point of the active curve: a dot dragged anywhere in the square,+/// which reports every step of the way; double-clicked, or dragged off the+/// graph and let go, it is taken away.+component CurvePoint inherits TouchArea {+ in property <float> px;+ in property <float> py;+ in property <length> plot-w;+ in property <length> plot-h;+ in property <color> tint;++ callback dragged(x: float, y: float);+ callback removed();++ property <float> drag-x: root.px;+ property <float> drag-y: root.py;+ property <bool> dragging;+ property <bool> off;++ x: (self.dragging ? self.drag-x : root.px) * root.plot-w - 8px;+ y: (1 - (self.dragging ? self.drag-y : root.py)) * root.plot-h - 8px;+ width: 16px;+ height: 16px;+ mouse-cursor: move;++ Rectangle {+ x: 3px;+ y: 3px;+ width: 10px;+ height: 10px;+ border-radius: 5px;+ background: root.dragging ? root.tint : Theme.panel;+ border-width: 2px;+ border-color: root.tint;+ opacity: root.off ? 0.35 : 1;+ }++ moved => {+ if (self.pressed) {+ self.dragging = true;+ let x = root.px + (self.mouse-x - self.pressed-x) / root.plot-w;+ let y = root.py - (self.mouse-y - self.pressed-y) / root.plot-h;+ // Well outside the square, the point is on its way off.+ self.off = x < -0.08 || x > 1.08 || y < -0.08 || y > 1.08;+ self.drag-x = Math.max(0, Math.min(1, x));+ self.drag-y = Math.max(0, Math.min(1, y));+ root.dragged(self.drag-x, self.drag-y);+ }+ }+ pointer-event(event) => {+ if (event.kind == PointerEventKind.up || event.kind == PointerEventKind.cancel) {+ if (self.off && event.kind == PointerEventKind.up) {+ root.removed();+ }+ self.dragging = false;+ self.off = false;+ }+ }+ double-clicked => { root.removed(); }+}++/// The curves: a tab a channel over one square graph. The chosen channel's+/// points are live - click the graph to put one down, drag it, double-click+/// it or drag it off to take it away - and the other channels are drawn+/// faintly behind it.+export component CurveEditor inherits VerticalLayout {+ /// One link's curves, in the order its manifest lists them.+ in property <[CurveData]> curves;+ in property <bool> enabled: true;+ in-out property <int> current: 0;++ /// A point moved, or put down when `index` is -1, in the unit square.+ callback point(key: string, index: int, x: float, y: float);+ callback remove(key: string, index: int);++ property <CurveData> active: root.curves[Math.min(root.current, root.curves.length - 1)];+ property <color> tint: CurveTint.of(root.current);++ spacing: 6px;+ opacity: root.enabled ? 1.0 : 0.45;++ HorizontalLayout {+ spacing: 2px;++ for curve[i] in root.curves: Rectangle {+ height: 22px;+ horizontal-stretch: 1;+ border-radius: Theme.r-xs;+ background: i == root.current ? Theme.field-active : tab.has-hover ? Theme.field-hover : Theme.field;++ Text {+ text: curve.label;+ color: i == root.current ? CurveTint.of(i) : Theme.fg-muted;+ font-size: Theme.fs-sm;+ horizontal-alignment: center;+ vertical-alignment: center;+ }+ tab := TouchArea {+ enabled: root.enabled;+ clicked => { root.current = i; }+ }+ }+ }++ graph := Rectangle {+ height: self.width;+ background: Theme.well;+ border-width: 1px;+ border-color: Theme.line;+ border-radius: Theme.r-xs;++ for step in 3: Rectangle {+ x: (step + 1) * parent.width / 4;+ width: 1px;+ height: parent.height;+ background: Theme.line;+ opacity: 0.5;+ }+ for step in 3: Rectangle {+ y: (step + 1) * parent.height / 4;+ width: parent.width;+ height: 1px;+ background: Theme.line;+ opacity: 0.5;+ }++ // Clicking the graph away from every point puts one down there.+ TouchArea {+ enabled: root.enabled;+ mouse-cursor: crosshair;+ clicked => {+ root.point(root.active.key, -1,+ Math.max(0, Math.min(1, self.mouse-x / graph.width)),+ Math.max(0, Math.min(1, 1 - self.mouse-y / graph.height)));+ }+ }++ for curve[i] in root.curves: Path {+ x: 0;+ y: 0;+ width: parent.width;+ height: parent.height;+ viewbox-width: 1;+ viewbox-height: 1;+ fit: fill;+ commands: curve.path;+ fill: Colors.transparent;+ stroke: CurveTint.of(i);+ stroke-width: i == root.current ? 2px : 1px;+ opacity: i == root.current ? 1 : 0.3;+ }++ for point in root.active.points: CurvePoint {+ px: point.x;+ py: point.y;+ plot-w: graph.width;+ plot-h: graph.height;+ tint: root.tint;+ enabled: root.enabled;+ dragged(x, y) => { root.point(root.active.key, point.index, x, y); }+ removed => { root.remove(root.active.key, point.index); }+ }+ }+}diff --git a/src/crates/concat/ui/workspace/config-pane.slint b/src/crates/concat/ui/workspace/config-pane.slintindex f19028ed..b4dc17ee 100644--- a/src/crates/concat/ui/workspace/config-pane.slint+++ b/src/crates/concat/ui/workspace/config-pane.slint@@ -11,6 +11,9 @@ import {AdjustPanel, AppliedEntryData, AppliedParamData, AudioPanel, ProcessorRows,CatalogueEntryData, FilterPanel, PresetStack, SpeedPanel, VideoPanel,} from "../inspector/clip-inspector.slint";+import {+ CurveData, CurveGroupData, WheelData, WheelGroupData,+} from "../inspector/grading.slint";import { TextPanel } from "../inspector/text-panel.slint";import {ClipField, ClipKind, ClipTextField, SelectedClipData,@@ -150,6 +153,15 @@ export component ConfigPane inherits Rectangle {/// selected clip's values or the defaults.in property <[AppliedParamData]> adjust-params;callback adjust-set(key: string, value: float);+ /// The colour panel's wheels and curves, and the picture chain's by link.+ in property <[WheelData]> adjust-wheels;+ in property <[CurveData]> adjust-curves;+ in property <[WheelGroupData]> visual-wheels;+ in property <[CurveGroupData]> visual-curves;+ /// A curve's point moved, or put down when `point` is -1, or taken off:+ /// `entry` -1 is the colour panel's, else a link of the picture's chain.+ callback curve-point(entry: int, key: string, point: int, x: float, y: float);+ callback curve-remove(entry: int, key: string, point: int);/// See Editor.inspector-jump-token: the library applied something and/// this pane should show it.@@ -546,7 +558,11 @@ export component ConfigPane inherits Rectangle {if root.showing == "Adjust": AdjustPanel {params: root.adjust-params;+ wheels: root.adjust-wheels;+ curves: root.adjust-curves;set(key, value) => { root.adjust-set(key, value); }+ curve-point(key, point, x, y) => { root.curve-point(-1, key, point, x, y); }+ curve-remove(key, point) => { root.curve-remove(-1, key, point); }commit => { root.clip-commit(); }}@@ -620,6 +636,8 @@ export component ConfigPane inherits Rectangle {catalogue: root.catalogue-effects;applied: root.applied-visual;params: root.visual-params;+ wheel-groups: root.visual-wheels;+ curve-groups: root.visual-curves;add(id) => { root.chain-add(false, id); }toggle(index) => { root.chain-toggle(false, index); }@@ -628,6 +646,12 @@ export component ConfigPane inherits Rectangle {set-param(index, key, value) => {root.chain-set-param(false, index, key, value);}+ curve-point(index, key, point, x, y) => {+ root.curve-point(index, key, point, x, y);+ }+ curve-remove(index, key, point) => {+ root.curve-remove(index, key, point);+ }commit => { root.clip-commit(); }}}diff --git a/src/crates/concat/ui/workspace/seat.slint b/src/crates/concat/ui/workspace/seat.slintindex 3475b829..655a909c 100644--- a/src/crates/concat/ui/workspace/seat.slint+++ b/src/crates/concat/ui/workspace/seat.slint@@ -221,6 +221,12 @@ export component Seat inherits Rectangle {audio-params: Editor.audio-params;adjust-params: Editor.adjust-params;adjust-set(key, value) => { Editor.adjust-set(key, value); }+ adjust-wheels: Editor.adjust-wheels;+ adjust-curves: Editor.adjust-curves;+ visual-wheels: Editor.visual-wheels;+ visual-curves: Editor.visual-curves;+ curve-point(entry, key, point, x, y) => { Editor.curve-point(entry, key, point, x, y); }+ curve-remove(entry, key, point) => { Editor.curve-remove(entry, key, point); }jump-token: Editor.inspector-jump-token;jump-tab: Editor.inspector-jump-tab;jump-section: Editor.inspector-jump-section;