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(effects): the rest of the first set on format 2 - blurs, keys, texture and stylise drawn on the GPU in light
Jareer424bf083af4c
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex a0d3fa29..57fd4e56 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -181,7 +181,12 @@ the layer's pixels (`concat.gaussian-blur`, `concat.glow`). The pass carriesits stages (`concat_core::Stage`); `WgpuCompositor::run_stages` draws themin one submission into pictures claimed from the pool and handed on fromone package to the next of a layer's stack, and only the last pass mixes by-intensity.+intensity. A blur or an average reads the layer through+`sample_premultiplied`, which weighs each pixel by its alpha before pixels+are mixed, so a transparent pixel's colour never bleeds; the motion blur+(a coarse Gaussian, then straight lines between its samples) and the zoom+blur (three passes of sixteen scales, 4096 in all) are held to direct sums+in concat-render's suite.A format 2 shader works in light (`space = "linear"`, the default), in thedisplay encoding (`"display"`, the colour looks), or in log (`"log"`,@@ -202,7 +207,10 @@ are several: a `wheel` is its puck, `<key>.x` and `<key>.y`, and its master,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`.+stack, and edits them through `concat/src/grading.rs`. A `color` knob is+RGBA packed into one number, red in the top byte, unpacked into a+`vec4<f32>` for the shader and drawn in the effect stack as a swatch that+opens the picker (`ColourKnobData`); the chroma key's is its screen colour.## 4. Decoding, caching and schedulingdiff --git a/src/crates/concat-effects/packages/concat.chroma-key/effect.toml b/src/crates/concat-effects/packages/concat.chroma-key/effect.tomlnew file mode 100644index 00000000..17e3ae3c--- /dev/null+++ b/src/crates/concat-effects/packages/concat.chroma-key/effect.toml@@ -0,0 +1,54 @@+format = 2++[effect]+id = "concat.chroma-key"+name = "Chroma Key"+kind = "effect"+category = "Cutout"+order = 58+intensity = "similarity"+description = "Keys out the screen colour you pick, leaving the picture over whatever is beneath, its spill cleaned off."++# 0x00B140FF: broadcast green, the screen a studio paints.+[[param]]+key = "color"+label = "Key colour"+type = "color"+min = 0+max = 4294967295+default = 11616511++[[param]]+key = "similarity"+label = "Similarity"+min = 1+max = 60+default = 30+step = 1+unit = "%"++[[param]]+key = "softness"+label = "Softness"+min = 0+max = 50+default = 10+step = 1+unit = "%"++[[param]]+key = "spill"+label = "Spill"+min = 0+max = 100+default = 50+step = 1+unit = "%"++[wgsl]+entry = "effect.wgsl"+space = "display"++# The still before a broadcast green screen, for the key to take out.+[card]+screen = "#00b140"diff --git a/src/crates/concat-effects/packages/concat.chroma-key/effect.wgsl b/src/crates/concat-effects/packages/concat.chroma-key/effect.wgslnew file mode 100644index 00000000..d11357d7--- /dev/null+++ b/src/crates/concat-effects/packages/concat.chroma-key/effect.wgsl@@ -0,0 +1,35 @@+struct Params { color: vec4<f32>, similarity: f32, softness: f32, spill: f32 }++// A key on the display level, where the key colour was picked: a pixel+// whose chroma - BT.709's Cb and Cr - lies within `similarity` of the key+// colour's is taken out, with `softness` more to fade over; and what stays+// has the key's hue taken out of it by `spill`, as far as it leans towards+// it, so a green fringe on hair or a green cast on a face is cleaned off.++fn chroma(rgb: vec3<f32>) -> vec2<f32> {+ let cb = -0.1146 * rgb.r - 0.3854 * rgb.g + 0.5 * rgb.b;+ let cr = 0.5 * rgb.r - 0.4542 * rgb.g - 0.0458 * rgb.b;+ return vec2<f32>(cb, cr);+}++fn effect(uv: vec2<f32>) -> vec4<f32> {+ let c = sample(uv);+ let here = chroma(c.rgb);+ let key = chroma(params.color.rgb);+ let similarity = params.similarity / 100.0;+ let softness = max(params.softness / 100.0, 0.001);+ let keep = smoothstep(similarity, similarity + softness, distance(here, key) / 0.7071);+ let reach = length(key);+ var cleaned = here;+ if (reach > 1e-4) {+ let towards = key / reach;+ cleaned = here - towards * max(dot(here, towards), 0.0) * (params.spill / 100.0);+ }+ let y = luma(c.rgb);+ let rgb = vec3<f32>(+ y + 1.5748 * cleaned.y,+ y - 0.1873 * cleaned.x - 0.4681 * cleaned.y,+ y + 1.8556 * cleaned.x,+ );+ return vec4<f32>(rgb, c.a * keep);+}diff --git a/src/crates/concat-effects/packages/concat.chroma-key/fixtures.toml b/src/crates/concat-effects/packages/concat.chroma-key/fixtures.tomlnew file mode 100644index 00000000..1609dc61--- /dev/null+++ b/src/crates/concat-effects/packages/concat.chroma-key/fixtures.toml@@ -0,0 +1,72 @@+# Broadcast green, #00b140, is (0, 0.416, 0.036) in light. At its defaults the+# key takes it out, in shadow as well as lit, and keeps skin and grey; what+# it keeps has the green leaned out of it by half, so a grey with green+# spilled on it comes out greyer, and the colour of what it takes out has+# the same done to it, for the soft edge between. A colour knob's least is+# black and its most white, each a key colour of no hue, which takes out+# the greys. Pinned from a model of the shader in doubles.++[[probe]]+name = "default, a broadcast green screen"+input = [0, 0.416332, 0.0362356, 1]+expect = [0.0384438, 0.29853, 0.0997654, 0]++[[probe]]+name = "default, the screen in shadow"+input = [0, 0.18, 0.012, 1]+expect = [0.0170975, 0.128594, 0.0367308, 0]++[[probe]]+name = "default, the screen in deep shadow"+input = [0, 0.0788574, 0.00686646, 1]+expect = [0.00728244, 0.0565548, 0.0189067, 0]++[[probe]]+name = "default, skin"+input = [0.6, 0.35, 0.25, 1]+expect = [0.600086, 0.350102, 0.249991, 1]++[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.180054, 0.180054, 0.180054, 1]++[[probe]]+name = "default, a grey with green spilled on it"+input = [0.2, 0.28, 0.2, 1]+expect = [0.231019, 0.267552, 0.215542, 1]++[[probe]]+name = "default, the screen half transparent"+input = [0, 0.41626, 0.0362244, 0.5]+expect = [0.0384438, 0.29853, 0.0997654, 0]++[[probe]]+name = "minimum, a black key takes out a grey"+at = "min"+input = [0.18, 0.18, 0.18, 1]+expect = [0.180054, 0.180054, 0.180054, 0]++[[probe]]+name = "minimum, and keeps the green"+at = "min"+input = [0, 0.416332, 0.0362356, 1]+expect = [0, 0.416252, 0.0362368, 1]++[[probe]]+name = "maximum, a white key takes out skin"+at = "max"+input = [0.6, 0.35, 0.25, 1]+expect = [0.600086, 0.350102, 0.249991, 0]++[[probe]]+name = "a blue screen, keyed to its blue"+params = { color = 4701183 }+input = [0, 0.0464862, 0.475033, 1]+expect = [0.00694118, 0.0413712, 0.182929, 0]++[[probe]]+name = "no spill taken, a grey with green on it"+params = { spill = 0 }+input = [0.2, 0.28, 0.2, 1]+expect = [0.199946, 0.280029, 0.199955, 1]diff --git a/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.toml b/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.tomlindex 85c1897e..6ac04379 100644--- a/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.toml+++ b/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.toml@@ -1,12 +1,15 @@+format = 2+[effect]id = "concat.chromatic-aberration"name = "Chromatic Aberration"+version = 2kind = "effect"category = "Distort"order = 54intensity = "shift"aliases = ["chromatic-aberration"]-description = "Red and blue pulled apart, the colour fringing of a cheap lens."+description = "Red and blue pulled apart towards the edges, the colour fringing of a cheap lens."[[param]]key = "shift"@@ -18,8 +21,5 @@ default = 4step = 1unit = "px"-[ffmpeg]-chain = "rgbashift=rh=-{round(shift)}:bh={round(shift)}"-[wgsl]entry = "effect.wgsl"diff --git a/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.wgsl b/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.wgslindex a4cc476b..febede3f 100644--- a/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.chromatic-aberration/effect.wgsl@@ -1,12 +1,14 @@struct Params { shift: f32 }-// Red taken from a little to one side and blue from the other: the two ends-// of the spectrum land apart, as a lens that cannot bring them together-// leaves them.+// Lateral chromatic aberration: the red image a little larger than the+// green and the blue a little smaller, about the middle, so the fringes+// grow towards the edges - `shift` pixels at the edge of the picture's+// width - in light.fn effect(uv: vec2<f32>) -> vec4<f32> {- let d = vec2<f32>(params.shift * texel().x, 0.0);let c = sample(uv);- let r = sample(uv + d).r;- let b = sample(uv - d).b;- return vec4<f32>(r, c.g, b, c.a);+ let scale = params.shift / (0.5 * frame.size.x);+ let from_middle = uv - vec2<f32>(0.5);+ let red = sample(vec2<f32>(0.5) + from_middle / (1.0 + scale));+ let blue = sample(vec2<f32>(0.5) + from_middle / max(1.0 - scale, 0.01));+ return vec4<f32>(red.r, c.g, blue.b, c.a);}diff --git a/src/crates/concat-effects/packages/concat.chromatic-aberration/fixtures.toml b/src/crates/concat-effects/packages/concat.chromatic-aberration/fixtures.tomlindex 84d08705..0c634177 100644--- a/src/crates/concat-effects/packages/concat.chromatic-aberration/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.chromatic-aberration/fixtures.toml@@ -1,13 +1,36 @@-[[case]]-name = "default"-chain = "rgbashift=rh=-4:bh=4"+# A flat picture has no edge to fringe: what these pin is that the light past+# white and the alpha come through as they went in, whichever way red and+# blue are pulled. The fringes themselves are the card's to show.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "rgbashift=rh=-1:bh=1"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, half transparent"at = "max"-chain = "rgbashift=rh=-24:bh=24"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]diff --git a/src/crates/concat-effects/packages/concat.film-grain/effect.toml b/src/crates/concat-effects/packages/concat.film-grain/effect.tomlindex 7aeccaa6..51bf7788 100644--- a/src/crates/concat-effects/packages/concat.film-grain/effect.toml+++ b/src/crates/concat-effects/packages/concat.film-grain/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.film-grain"name = "Film Grain"+version = 2kind = "effect"category = "Stylize"order = 41@@ -17,8 +20,5 @@ max = 40default = 12step = 1-[ffmpeg]-chain = "noise=alls={round(amount)}:allf=t+u"-[wgsl]entry = "effect.wgsl"diff --git a/src/crates/concat-effects/packages/concat.film-grain/effect.wgsl b/src/crates/concat-effects/packages/concat.film-grain/effect.wgslindex 1ade46d0..b75ab81c 100644--- a/src/crates/concat-effects/packages/concat.film-grain/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.film-grain/effect.wgsl@@ -1,9 +1,11 @@struct Params { amount: f32 }-// Per-pixel noise that changes every frame, scaled by the amount.+// Grain in log, where film's is: every pixel moved up or down by the same+// share of a stop whatever its level, so a highlight grains like a shadow,+// and a level past white stays past it. New every frame, and the same on+// every GPU for the same frame (see `hash`).fn effect(uv: vec2<f32>) -> vec4<f32> {let c = sample(uv);- let n = hash(uv * frame.size, fract(frame.time * 7.31)) - 0.5;- let grain = n * params.amount / 100.0;- return vec4<f32>(clamp(c.rgb + vec3<f32>(grain), vec3<f32>(0.0), vec3<f32>(1.0)), c.a);+ let n = hash(floor(uv * frame.size), fract(frame.time * 7.31)) - 0.5;+ return vec4<f32>(from_log(to_log(c.rgb) + vec3<f32>(n * params.amount * 0.008)), c.a);}diff --git a/src/crates/concat-effects/packages/concat.film-grain/fixtures.toml b/src/crates/concat-effects/packages/concat.film-grain/fixtures.tomlindex 54c98860..aa832c24 100644--- a/src/crates/concat-effects/packages/concat.film-grain/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.film-grain/fixtures.toml@@ -1,13 +1,49 @@-[[case]]-name = "default"-chain = "noise=alls=12:allf=t+u"+# Grain moves every level by the same share of a stop, in log: a grey and a+# highlight past white alike, and in the toe by the same step of log, so a+# channel below black moves too. At the probe's middle pixel, (4, 4), at the+# start of a clip, the grain's hash is 0.43225 - a little under the middle -+# so there it darkens. Pinned from a model of the shader in doubles.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.166379, 0.166379, 0.166379, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [3.69622, 0.924055, 0.0461915, 1]++[[probe]]+name = "minimum, a grey"+at = "min"+input = [0.18, 0.18, 0.18, 1]+expect = [0.177699, 0.177699, 0.177699, 1]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "noise=alls=2:allf=t+u"+input = [4, 1, 0.05, 1]+expect = [3.94769, 0.986922, 0.0493341, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, a grey"at = "max"-chain = "noise=alls=40:allf=t+u"+input = [0.18, 0.18, 0.18, 1]+expect = [0.138376, 0.138376, 0.138376, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [3.07411, 0.768527, 0.038417, 1]++[[probe]]+name = "default, a shadow in the toe and a channel below black"+input = [0.004, 0.002, -0.01, 1]+expect = [0.00338455, 0.00138375, -0.0106192, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.462027, 0.184766, 0.0923829, 0.5]diff --git a/src/crates/concat-effects/packages/concat.fisheye/effect.toml b/src/crates/concat-effects/packages/concat.fisheye/effect.tomlindex 358df7aa..46b21c68 100644--- a/src/crates/concat-effects/packages/concat.fisheye/effect.toml+++ b/src/crates/concat-effects/packages/concat.fisheye/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.fisheye"name = "Fisheye"+version = 2kind = "effect"category = "Distort"order = 52@@ -17,11 +20,5 @@ default = 50step = 1unit = "%"-[ffmpeg]-let = [- "k = strength / 100",-]-chain = "lenscorrection=k1={fixed(-0.55 * k, 3)}:k2={fixed(-0.2 * k, 3)}:i=bilinear"-[wgsl]entry = "effect.wgsl"diff --git a/src/crates/concat-effects/packages/concat.fisheye/effect.wgsl b/src/crates/concat-effects/packages/concat.fisheye/effect.wgslindex ff89de46..59e2c026 100644--- a/src/crates/concat-effects/packages/concat.fisheye/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.fisheye/effect.wgsl@@ -1,16 +1,17 @@struct Params { strength: f32 }-// Barrel distortion about the centre, stronger towards the edge.+// The bulge of a very wide lens: the middle of the picture magnified and+// the edge drawn in, each point pulled towards the middle by a curve that+// keeps the corners where they were and never folds back on itself, so the+// whole frame stays filled. At full strength the middle is two and a half+// times its size.fn effect(uv: vec2<f32>) -> vec4<f32> {- let k = params.strength / 100.0 * 0.6;+ let s = params.strength / 100.0 * 0.6;let aspect = frame.size.x / frame.size.y;- var p = (uv - vec2<f32>(0.5)) * vec2<f32>(2.0 * aspect, 2.0);- let r2 = dot(p, p);- let denom = max(1.0 - k * (aspect * aspect + 1.0) * 0.5, 0.05);- p = p * (1.0 - k * r2) / denom;- let q = p / vec2<f32>(2.0 * aspect, 2.0) + vec2<f32>(0.5);- if (q.x < 0.0 || q.x > 1.0 || q.y < 0.0 || q.y > 1.0) {- return vec4<f32>(0.0, 0.0, 0.0, 0.0);- }- return sample(q);+ // Out from the middle, in units where a corner is 1.+ let p = (uv - vec2<f32>(0.5)) * vec2<f32>(aspect, 1.0);+ let corner = length(vec2<f32>(aspect, 1.0) * 0.5);+ let r = length(p) / corner;+ let pulled = (1.0 - s) + s * r * r;+ return sample(vec2<f32>(0.5) + p * pulled / vec2<f32>(aspect, 1.0));}diff --git a/src/crates/concat-effects/packages/concat.fisheye/fixtures.toml b/src/crates/concat-effects/packages/concat.fisheye/fixtures.tomlindex a86a30f6..2c634c73 100644--- a/src/crates/concat-effects/packages/concat.fisheye/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.fisheye/fixtures.toml@@ -1,13 +1,37 @@-[[case]]-name = "default"-chain = "lenscorrection=k1=-0.275:k2=-0.100:i=bilinear"+# A flat picture bulges to itself, every pixel drawn from somewhere inside the+# frame: what these pin is that the light past white and the alpha come+# through as they went in. concat-render's suite holds that for every pixel+# of the frame at full strength, where earlier builds drew black holes.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "lenscorrection=k1=-0.028:k2=-0.010:i=bilinear"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, half transparent"at = "max"-chain = "lenscorrection=k1=-0.550:k2=-0.200:i=bilinear"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]diff --git a/src/crates/concat-effects/packages/concat.halftone/effect.toml b/src/crates/concat-effects/packages/concat.halftone/effect.tomlindex bf5eafd4..7554bd0b 100644--- a/src/crates/concat-effects/packages/concat.halftone/effect.toml+++ b/src/crates/concat-effects/packages/concat.halftone/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.halftone"name = "Halftone"+version = 2kind = "effect"category = "Retro"order = 76@@ -13,12 +16,10 @@ label = "Dot size"type = "int"min = 4max = 40-default = 10+default = 6step = 1unit = "px"-[ffmpeg]-chain = "pixelize=w={round(size)}:h={round(size)},eq=contrast=1.5:brightness=-0.05"-[wgsl]entry = "effect.wgsl"+space = "display"diff --git a/src/crates/concat-effects/packages/concat.halftone/effect.wgsl b/src/crates/concat-effects/packages/concat.halftone/effect.wgslindex c4f33d33..665148fa 100644--- a/src/crates/concat-effects/packages/concat.halftone/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.halftone/effect.wgsl@@ -1,11 +1,19 @@struct Params { size: f32 }+// A grid of black dots on white, each as large as its cell is dark on the+// display level - the picture as a newspaper prints it - with edges a+// pixel soft so the dots stay round at any size. The paper is as bright as+// the picture where the picture is brighter than white, so a highlight+// stays one.fn effect(uv: vec2<f32>) -> vec4<f32> {let c = sample(uv);- let cell = max(params.size, 2.0) * texel();- let center = (floor(uv / cell) + vec2<f32>(0.5)) * cell;- let l = luma(sample(center).rgb);- let d = distance(uv, center) / (cell.x * 0.5 + 0.0001);- let dot = step(d, 1.0 - l);- return vec4<f32>(vec3<f32>(dot), c.a);+ let cell = max(params.size, 2.0);+ let at = uv * frame.size;+ let middle = (floor(at / cell) + vec2<f32>(0.5)) * cell;+ let seen = luma(sample(middle / frame.size).rgb);+ let level = clamp(seen, 0.0, 1.0);+ // A dot's area goes as the darkness, so its radius as the square root.+ let radius = sqrt(1.0 - level) * cell * 0.7071;+ let ink = 1.0 - smoothstep(radius - 0.75, radius + 0.75, distance(at, middle));+ return vec4<f32>(vec3<f32>((1.0 - ink) * max(seen, 1.0)), c.a);}diff --git a/src/crates/concat-effects/packages/concat.halftone/fixtures.toml b/src/crates/concat-effects/packages/concat.halftone/fixtures.tomlindex d417635f..93f44ca0 100644--- a/src/crates/concat-effects/packages/concat.halftone/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.halftone/fixtures.toml@@ -1,13 +1,78 @@-[[case]]-name = "default"-chain = "pixelize=w=10:h=10,eq=contrast=1.5:brightness=-0.05"+# The probe's middle pixel, (4.5, 4.5) in pixels, lies 2.12 pixels from the+# middle of its dot's cell at the default size and the least: inside a grey's+# dot, on a light grey's soft edge, and clear of white's, which has none. At+# the most it lies far outside every dot, on the paper. Where the picture is+# brighter than white, so is the paper.-[[case]]-name = "min"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0, 0, 0, 1]++[[probe]]+name = "default, a light grey"+input = [0.6, 0.6, 0.6, 1]+expect = [0.506252, 0.506252, 0.506252, 1]++[[probe]]+name = "default, white"+input = [1, 1, 1, 1]+expect = [1, 1, 1, 1]++[[probe]]+name = "minimum, a grey"+at = "min"+input = [0.18, 0.18, 0.18, 1]+expect = [0.293287, 0.293287, 0.293287, 1]++[[probe]]+name = "minimum, a light grey"+at = "min"+input = [0.6, 0.6, 0.6, 1]+expect = [1, 1, 1, 1]++[[probe]]+name = "minimum, white"at = "min"-chain = "pixelize=w=4:h=4,eq=contrast=1.5:brightness=-0.05"+input = [1, 1, 1, 1]+expect = [1, 1, 1, 1]++[[probe]]+name = "maximum, a grey"+at = "max"+input = [0.18, 0.18, 0.18, 1]+expect = [1, 1, 1, 1]++[[probe]]+name = "maximum, a light grey"+at = "max"+input = [0.6, 0.6, 0.6, 1]+expect = [1, 1, 1, 1]++[[probe]]+name = "maximum, white"+at = "max"+input = [1, 1, 1, 1]+expect = [1, 1, 1, 1]++[[probe]]+name = "twelve pixels, a light grey"+params = { size = 12 }+input = [0.6, 0.6, 0.6, 1]+expect = [0, 0, 0, 1]++[[probe]]+name = "default, a light grey half transparent"+input = [0.6, 0.6, 0.6, 0.5]+expect = [0.506252, 0.506252, 0.506252, 0.5]++[[probe]]+name = "default, a highlight past white"+input = [4, 4, 4, 1]+expect = [4, 4, 4, 1]-[[case]]-name = "max"+[[probe]]+name = "maximum, a highlight past white"at = "max"-chain = "pixelize=w=40:h=40,eq=contrast=1.5:brightness=-0.05"+input = [4, 4, 4, 1]+expect = [4, 4, 4, 1]diff --git a/src/crates/concat-effects/packages/concat.luma-key/effect.toml b/src/crates/concat-effects/packages/concat.luma-key/effect.tomlnew file mode 100644index 00000000..a7d21c0c--- /dev/null+++ b/src/crates/concat-effects/packages/concat.luma-key/effect.toml@@ -0,0 +1,45 @@+format = 2++[effect]+id = "concat.luma-key"+name = "Luma Key"+kind = "effect"+category = "Cutout"+order = 59+intensity = "threshold"+description = "Keys out the dark of the picture - fire, smoke or sparks shot on black - or, inverted, the light."++[[param]]+key = "threshold"+label = "Threshold"+min = 0+max = 100+default = 10+step = 1+unit = "%"++[[param]]+key = "softness"+label = "Softness"+min = 0+max = 50+default = 10+step = 1+unit = "%"++[[param]]+key = "invert"+label = "Invert"+type = "bool"+min = 0+max = 1+default = 0+step = 1++[wgsl]+entry = "effect.wgsl"+space = "display"++# The still's shadows taken out, for the card.+[card]+params = { threshold = 35 }diff --git a/src/crates/concat-effects/packages/concat.luma-key/effect.wgsl b/src/crates/concat-effects/packages/concat.luma-key/effect.wgslnew file mode 100644index 00000000..dc13bba8--- /dev/null+++ b/src/crates/concat-effects/packages/concat.luma-key/effect.wgsl@@ -0,0 +1,17 @@+struct Params { threshold: f32, softness: f32, invert: f32 }++// A key on the display level's luminance: a pixel darker than `threshold`+// is taken out, fading back in over `softness` below it, so at 0 the whole+// picture stays; inverted, a pixel lighter than it, fading over `softness`+// above it.+fn effect(uv: vec2<f32>) -> vec4<f32> {+ let c = sample(uv);+ let threshold = params.threshold / 100.0;+ let softness = max(params.softness / 100.0, 0.001);+ let level = luma(c.rgb);+ var keep = smoothstep(threshold - softness, threshold, level);+ if (params.invert > 0.5) {+ keep = 1.0 - smoothstep(threshold, threshold + softness, level);+ }+ return vec4<f32>(c.rgb, c.a * keep);+}diff --git a/src/crates/concat-effects/packages/concat.luma-key/fixtures.toml b/src/crates/concat-effects/packages/concat.luma-key/fixtures.tomlnew file mode 100644index 00000000..56b18ff3--- /dev/null+++ b/src/crates/concat-effects/packages/concat.luma-key/fixtures.toml@@ -0,0 +1,65 @@+# The key reads the display level's luma: a pixel under the threshold is+# taken out, fading back in over the softness below it, so at 0 nothing is;+# inverted, a pixel over it, fading over the softness above. A pixel half way+# down the fade keeps half its alpha, and its colour as it came.++[[probe]]+name = "default, black"+input = [0, 0, 0, 1]+expect = [0, 0, 0, 0]++[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.180054, 0.180054, 0.180054, 1]++[[probe]]+name = "default, half way down the fade"+input = [0.000754356, 0.000754356, 0.000754356, 1]+expect = [0.000754356, 0.000754356, 0.000754356, 0.500035]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.0499878, 1]++[[probe]]+name = "minimum, black stays"+at = "min"+input = [0, 0, 0, 1]+expect = [0, 0, 0, 1]++[[probe]]+name = "maximum, a grey stays under the threshold, inverted"+at = "max"+input = [0.18, 0.18, 0.18, 1]+expect = [0.180054, 0.180054, 0.180054, 1]++[[probe]]+name = "maximum, a highlight past white is taken out, inverted"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.0499878, 0.866206]++[[probe]]+name = "inverted, white"+params = { invert = 1 }+input = [1, 1, 1, 1]+expect = [1, 1, 1, 0]++[[probe]]+name = "inverted, black"+params = { invert = 1 }+input = [0, 0, 0, 1]+expect = [0, 0, 0, 1]++[[probe]]+name = "threshold 35, half way down the fade"+params = { threshold = 35 }+input = [0.055603, 0.055603, 0.055603, 1]+expect = [0.055603, 0.055603, 0.055603, 0.500032]++[[probe]]+name = "default, half transparent black"+input = [0, 0, 0, 0.5]+expect = [0, 0, 0, 0]diff --git a/src/crates/concat-effects/packages/concat.motion-blur/effect.toml b/src/crates/concat-effects/packages/concat.motion-blur/effect.tomlindex 8fd22931..a1c9e6ce 100644--- a/src/crates/concat-effects/packages/concat.motion-blur/effect.toml+++ b/src/crates/concat-effects/packages/concat.motion-blur/effect.toml@@ -1,12 +1,15 @@+format = 2+[effect]id = "concat.motion-blur"name = "Motion Blur"kind = "effect"category = "Blur"order = 22+version = 2intensity = "length"aliases = ["motion-blur"]-description = "A horizontal streak, as if the camera panned."+description = "A streak along a line, as if the camera panned."[[param]]key = "length"@@ -17,8 +20,19 @@ default = 18step = 1unit = "px"-[ffmpeg]-chain = "gblur=sigma={fixed(length, 1)}:sigmaV=0.1"+[[param]]+key = "angle"+label = "Angle"+min = -90+max = 90+default = 0+step = 1+unit = "°"[wgsl]entry = "effect.wgsl"++# A coarse Gaussian along the line, then straight lines drawn between its+# samples.+[[wgsl.pass]]+target = "coarse"diff --git a/src/crates/concat-effects/packages/concat.motion-blur/effect.wgsl b/src/crates/concat-effects/packages/concat.motion-blur/effect.wgslindex 407a11dd..318e033b 100644--- a/src/crates/concat-effects/packages/concat.motion-blur/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.motion-blur/effect.wgsl@@ -1,18 +1,62 @@-struct Params { length: f32 }+struct Params { length: f32, angle: f32 }++// A Gaussian of sigma `length` of the layer's pixels along a line `angle`+// degrees from level - anticlockwise, as a protractor reads it - in light.+// Two passes, so a long streak costs tens of taps rather than hundreds:+// `coarse` weighs twenty-four samples spread over six sigmas, and `effect`+// draws straight lines between them - a triangle across two of their+// steps, a tap every half pixel - so the streak falls away smoothly rather+// than in stairs.++const COARSE: i32 = 24;++/// Half a pixel along the line, in uv.+fn along() -> vec2<f32> {+ let a = radians(params.angle);+ return vec2<f32>(cos(a), -sin(a)) * 0.5 / frame.size;+}++/// A step of the coarse pass, in half pixels.+fn reach() -> f32 {+ return 12.0 * max(params.length, 0.5) / f32(COARSE);+}++fn coarse(uv: vec2<f32>) -> vec4<f32> {+ let step = along() * reach();+ let sigma = f32(COARSE) / 6.0;+ var sum = vec4<f32>(0.0);+ var total = 0.0;+ for (var i = 0; i < COARSE; i++) {+ let d = f32(i) - f32(COARSE - 1) * 0.5;+ let w = exp(-d * d / (2.0 * sigma * sigma));+ sum += sample_premultiplied(uv + step * d) * w;+ total += w;+ }+ return sum / total;+}++/// `coarse` at `uv`: read from its picture within the layer, and worked+/// out afresh past its outermost pixel centres, where the picture holds its+/// edge but the Gaussian reads on - so a streak by the edge of the frame is+/// the one it would be anywhere else.+fn coarse_near(uv: vec2<f32>) -> vec4<f32> {+ let p = uv * frame.size;+ if (any(p < vec2<f32>(0.5)) || any(p > frame.size - vec2<f32>(0.5))) {+ return coarse(uv);+ }+ return coarse_at(uv);+}-// A horizontal streak of `length` pixels: taps along a line, Gaussian-// weighted so the ends fade.fn effect(uv: vec2<f32>) -> vec4<f32> {- let t = texel();- let sigma = max(params.length, 0.5);- let step = max(sigma / 6.0, 1.0);+ let reach = reach();+ let taps = min(i32(ceil(reach)), 64);var sum = vec4<f32>(0.0);- var weight = 0.0;- for (var i: i32 = -12; i <= 12; i++) {- let d = f32(i) * step;- let w = exp(-(d * d) / (2.0 * sigma * sigma));- sum += sample(uv + vec2<f32>(d, 0.0) * t) * w;- weight += w;+ var total = 0.0;+ for (var i = -taps; i <= taps; i++) {+ let w = max(1.0 - abs(f32(i)) / reach, 0.0);+ sum += coarse_near(uv + along() * f32(i)) * w;+ total += w;}- return sum / weight;+ let blurred = sum / total;+ return vec4<f32>(blurred.rgb / max(blurred.a, 1e-6), blurred.a);}diff --git a/src/crates/concat-effects/packages/concat.motion-blur/fixtures.toml b/src/crates/concat-effects/packages/concat.motion-blur/fixtures.tomlindex eaf6cfae..934c9624 100644--- a/src/crates/concat-effects/packages/concat.motion-blur/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.motion-blur/fixtures.toml@@ -1,13 +1,43 @@-[[case]]-name = "default"-chain = "gblur=sigma=18.0:sigmaV=0.1"+# A flat picture streaks to itself at any length and angle, through both+# passes: what these pin is that the light past white and the alpha come out+# as they went in. How the streak spreads a picture is held to a direct+# Gaussian along its line in concat-render's suite.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "gblur=sigma=2.0:sigmaV=0.1"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, a highlight past white"at = "max"-chain = "gblur=sigma=60.0:sigmaV=0.1"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, half transparent"+at = "max"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "a diagonal streak, a highlight past white"+params = { length = 30, angle = 45 }+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]diff --git a/src/crates/concat-effects/packages/concat.pixelate/effect.toml b/src/crates/concat-effects/packages/concat.pixelate/effect.tomlindex 5e9f26da..7f0077e0 100644--- a/src/crates/concat-effects/packages/concat.pixelate/effect.toml+++ b/src/crates/concat-effects/packages/concat.pixelate/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.pixelate"name = "Pixelate"+version = 2kind = "effect"category = "Distort"order = 50@@ -18,8 +21,5 @@ default = 16step = 1unit = "px"-[ffmpeg]-chain = "pixelize=width={round(size)}:height={round(size)}"-[wgsl]entry = "effect.wgsl"diff --git a/src/crates/concat-effects/packages/concat.pixelate/effect.wgsl b/src/crates/concat-effects/packages/concat.pixelate/effect.wgslindex ba982b45..2e84ba78 100644--- a/src/crates/concat-effects/packages/concat.pixelate/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.pixelate/effect.wgsl@@ -1,8 +1,18 @@struct Params { size: f32 }-// Every pixel takes the colour at the centre of its `size`-pixel block.+// Squares `size` pixels across, each the average of the light inside it -+// sixteen bilinear taps spread over the square, each four pixels - rather+// than whichever pixel happened to be at its middle.fn effect(uv: vec2<f32>) -> vec4<f32> {let block = max(round(params.size), 1.0);- let p = floor(uv * frame.size / block) * block + vec2<f32>(block * 0.5);- return sample(p / frame.size);+ let corner = floor(uv * frame.size / block) * block;+ var sum = vec4<f32>(0.0);+ for (var y = 0; y < 4; y++) {+ for (var x = 0; x < 4; x++) {+ let at = corner + (vec2<f32>(f32(x), f32(y)) + vec2<f32>(0.5)) * block / 4.0;+ sum += sample_premultiplied(at / frame.size);+ }+ }+ let mean = sum / 16.0;+ return vec4<f32>(mean.rgb / max(mean.a, 1e-6), mean.a);}diff --git a/src/crates/concat-effects/packages/concat.pixelate/fixtures.toml b/src/crates/concat-effects/packages/concat.pixelate/fixtures.tomlindex 66381c64..beba66df 100644--- a/src/crates/concat-effects/packages/concat.pixelate/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.pixelate/fixtures.toml@@ -1,13 +1,36 @@-[[case]]-name = "default"-chain = "pixelize=width=16:height=16"+# A flat picture averages to itself in a square of any size: what these pin+# is that the light past white and the alpha come out as they went in -+# averaged in light, the alpha weighing each colour.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "pixelize=width=2:height=2"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, half transparent"at = "max"-chain = "pixelize=width=64:height=64"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]diff --git a/src/crates/concat-effects/packages/concat.posterize/effect.toml b/src/crates/concat-effects/packages/concat.posterize/effect.tomlindex 36843b74..625052e0 100644--- a/src/crates/concat-effects/packages/concat.posterize/effect.toml+++ b/src/crates/concat-effects/packages/concat.posterize/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.posterize"name = "Posterize"+version = 2kind = "effect"category = "Stylize"order = 43@@ -17,11 +20,6 @@ max = 8default = 4step = 1-[ffmpeg]-let = [- "size = round(256 / max(round(levels), 2))",-]-chain = "lutrgb=r=trunc(val/{size})*{size}:g=trunc(val/{size})*{size}:b=trunc(val/{size})*{size}"-[wgsl]entry = "effect.wgsl"+space = "display"diff --git a/src/crates/concat-effects/packages/concat.posterize/effect.wgsl b/src/crates/concat-effects/packages/concat.posterize/effect.wgslindex 2d7d6831..036c89e6 100644--- a/src/crates/concat-effects/packages/concat.posterize/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.posterize/effect.wgsl@@ -1,7 +1,10 @@struct Params { levels: f32 }+// Flat bands on the display level: each channel rounded to one of `levels`+// steps from black to white, white among them, and on at the same spacing+// past it.fn effect(uv: vec2<f32>) -> vec4<f32> {let c = sample(uv);- let n = max(round(params.levels), 2.0);- return vec4<f32>(floor(c.rgb * n) / (n - 1.0) * ((n - 1.0) / n) + vec3<f32>(0.0), c.a);+ let steps = max(round(params.levels), 2.0) - 1.0;+ return vec4<f32>(round(c.rgb * steps) / steps, c.a);}diff --git a/src/crates/concat-effects/packages/concat.posterize/fixtures.toml b/src/crates/concat-effects/packages/concat.posterize/fixtures.tomlindex d1d5455d..e4487aa2 100644--- a/src/crates/concat-effects/packages/concat.posterize/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.posterize/fixtures.toml@@ -1,13 +1,48 @@-[[case]]-name = "default"-chain = "lutrgb=r=trunc(val/64)*64:g=trunc(val/64)*64:b=trunc(val/64)*64"+# Each channel rounded on the display level to one of `levels` steps from+# black to white, and on at the same spacing past white, so a highlight keeps+# a band of its own.-[[case]]-name = "minimum"+[[probe]]+name = "default, a warm colour"+input = [0.3, 0.2, 0.12, 1]+expect = [0.377904, 0.377904, 0.0715993, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [3.40751, 1, 0.0715993, 1]++[[probe]]+name = "minimum, a warm colour"+at = "min"+input = [0.3, 0.2, 0.12, 1]+expect = [1, 1, 0, 1]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "lutrgb=r=trunc(val/128)*128:g=trunc(val/128)*128:b=trunc(val/128)*128"+input = [4, 1, 0.05, 1]+expect = [5.27803, 1, 0, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, a warm colour"at = "max"-chain = "lutrgb=r=trunc(val/32)*32:g=trunc(val/32)*32:b=trunc(val/32)*32"+input = [0.3, 0.2, 0.12, 1]+expect = [0.261041, 0.261041, 0.130875, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [3.64586, 1, 0.049458, 1]++[[probe]]+name = "five levels, a warm colour"+params = { levels = 5 }+input = [0.3, 0.2, 0.12, 1]+expect = [0.189465, 0.189465, 0.189465, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.377904, 0.377904, 0.0715993, 0.5]diff --git a/src/crates/concat-effects/packages/concat.sharpen/effect.toml b/src/crates/concat-effects/packages/concat.sharpen/effect.tomlindex 6adb8331..79b57c9d 100644--- a/src/crates/concat-effects/packages/concat.sharpen/effect.toml+++ b/src/crates/concat-effects/packages/concat.sharpen/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.sharpen"name = "Sharpen"+version = 2kind = "effect"category = "Basic"order = 13@@ -16,8 +19,6 @@ max = 3default = 1step = 0.05-[ffmpeg]-chain = "unsharp=5:5:{fixed(amount, 2)}:5:5:0"-[wgsl]entry = "effect.wgsl"+space = "display"diff --git a/src/crates/concat-effects/packages/concat.sharpen/effect.wgsl b/src/crates/concat-effects/packages/concat.sharpen/effect.wgslindex 6feff244..2c0d87e4 100644--- a/src/crates/concat-effects/packages/concat.sharpen/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.sharpen/effect.wgsl@@ -1,16 +1,20 @@struct Params { amount: f32 }-// Unsharp mask: the picture plus its difference from a small blur.+// An unsharp mask on the display level: the picture's difference from a+// small Gaussian blur of it, added back `amount` times over. An edge is+// judged by eye, so it is sharpened where the eye sees it; a level past+// white is carried, never clipped.fn effect(uv: vec2<f32>) -> vec4<f32> {let t = texel();let c = sample(uv);var blur = vec3<f32>(0.0);+ var total = 0.0;for (var y: i32 = -2; y <= 2; y++) {for (var x: i32 = -2; x <= 2; x++) {- blur += sample(uv + vec2<f32>(f32(x), f32(y)) * t).rgb;+ let w = exp(-f32(x * x + y * y) / 2.0);+ blur += sample(uv + vec2<f32>(f32(x), f32(y)) * t).rgb * w;+ total += w;}}- blur /= 25.0;- let sharp = c.rgb + (c.rgb - blur) * params.amount;- return vec4<f32>(clamp(sharp, vec3<f32>(0.0), vec3<f32>(1.0)), c.a);+ return vec4<f32>(c.rgb + (c.rgb - blur / total) * params.amount, c.a);}diff --git a/src/crates/concat-effects/packages/concat.sharpen/fixtures.toml b/src/crates/concat-effects/packages/concat.sharpen/fixtures.tomlindex 20198425..8ce51cd3 100644--- a/src/crates/concat-effects/packages/concat.sharpen/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.sharpen/fixtures.toml@@ -1,13 +1,36 @@-[[case]]-name = "default"-chain = "unsharp=5:5:1.00:5:5:0"+# A flat picture has no edge to sharpen: what these pin is that the light past+# white and the alpha come through as they went in, at every amount. The+# edges the sharpening finds are the card's to show.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "unsharp=5:5:0.20:5:5:0"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, half transparent"at = "max"-chain = "unsharp=5:5:3.00:5:5:0"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]diff --git a/src/crates/concat-effects/packages/concat.vignette/effect.toml b/src/crates/concat-effects/packages/concat.vignette/effect.tomlindex 88f67294..933ecc5e 100644--- a/src/crates/concat-effects/packages/concat.vignette/effect.toml+++ b/src/crates/concat-effects/packages/concat.vignette/effect.toml@@ -1,6 +1,9 @@+format = 2+[effect]id = "concat.vignette"name = "Vignette"+version = 2kind = "effect"category = "Stylize"order = 40@@ -17,8 +20,5 @@ default = 50step = 1unit = "%"-[ffmpeg]-chain = "vignette=angle={fixed(0.25 + (strength / 100) * 1.05, 3)}"-[wgsl]entry = "effect.wgsl"diff --git a/src/crates/concat-effects/packages/concat.vignette/effect.wgsl b/src/crates/concat-effects/packages/concat.vignette/effect.wgslindex 61e1b8a6..7d2094e7 100644--- a/src/crates/concat-effects/packages/concat.vignette/effect.wgsl+++ b/src/crates/concat-effects/packages/concat.vignette/effect.wgsl@@ -1,10 +1,13 @@struct Params { strength: f32 }-// Darkens towards the corners: a smooth fall-off from the centre.+// The light falling off towards the corners, as a lens's does: a multiply+// in light, shaped as the vignette always was on SDR (its fall taken to the+// 2.4th power, the display encoding's), so a highlight in a corner darkens+// by the same share as the rest.fn effect(uv: vec2<f32>) -> vec4<f32> {let c = sample(uv);let d = length((uv - vec2<f32>(0.5)) * vec2<f32>(2.0));let s = params.strength / 100.0;let fall = smoothstep(1.4 - s * 0.9, 1.4 + 0.2 - s * 0.3, d);- return vec4<f32>(c.rgb * (1.0 - fall * (0.4 + 0.6 * s)), c.a);+ return vec4<f32>(c.rgb * pow(1.0 - fall * (0.4 + 0.6 * s), 2.4), c.a);}diff --git a/src/crates/concat-effects/packages/concat.vignette/fixtures.toml b/src/crates/concat-effects/packages/concat.vignette/fixtures.tomlindex a0a4098c..f4308b03 100644--- a/src/crates/concat-effects/packages/concat.vignette/fixtures.toml+++ b/src/crates/concat-effects/packages/concat.vignette/fixtures.toml@@ -1,13 +1,37 @@-[[case]]-name = "default"-chain = "vignette=angle=0.775"+# The light falls off towards the corners and not at all in the middle, where+# a probe reads: what these pin is that the middle stays as it came at every+# strength, the light past white and the alpha with it. The fall itself is+# the card's to show.-[[case]]-name = "minimum"+[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"at = "min"-chain = "vignette=angle=0.355"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]-[[case]]-name = "maximum"+[[probe]]+name = "maximum, half transparent"at = "max"-chain = "vignette=angle=1.300"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]diff --git a/src/crates/concat-effects/packages/concat.zoom-blur/effect.toml b/src/crates/concat-effects/packages/concat.zoom-blur/effect.tomlnew file mode 100644index 00000000..d8cd984a--- /dev/null+++ b/src/crates/concat-effects/packages/concat.zoom-blur/effect.toml@@ -0,0 +1,49 @@+format = 2++[effect]+id = "concat.zoom-blur"+name = "Zoom Blur"+kind = "effect"+category = "Blur"+order = 23+intensity = "amount"+description = "A rush towards a point, as if the lens zoomed during the shot."++[[param]]+key = "amount"+label = "Amount"+min = 0+max = 100+default = 25+step = 1+unit = "%"+animate = true++[[param]]+key = "x"+label = "Centre X"+min = 0+max = 100+default = 50+step = 1+unit = "%"++[[param]]+key = "y"+label = "Centre Y"+min = 0+max = 100+default = 50+step = 1+unit = "%"++[wgsl]+entry = "effect.wgsl"++# Sixteen scales a pass, each pass filling in between two of the next+# one's: four thousand and ninety-six along each streak.+[[wgsl.pass]]+target = "fine"++[[wgsl.pass]]+target = "middle"diff --git a/src/crates/concat-effects/packages/concat.zoom-blur/effect.wgsl b/src/crates/concat-effects/packages/concat.zoom-blur/effect.wgslnew file mode 100644index 00000000..f207fb7f--- /dev/null+++ b/src/crates/concat-effects/packages/concat.zoom-blur/effect.wgsl@@ -0,0 +1,54 @@+struct Params { amount: f32, x: f32, y: f32 }++// Each pixel streaked along the line to the centre, over `amount` of its+// distance from it, in light: the picture drawn at every scale from its+// own down to `amount` smaller about the centre, at a steady rate of zoom,+// and averaged - nothing at the centre, the most at the edge. Three passes+// of sixteen scales, each averaging the scales between two of the next+// one's, so the four thousand and ninety-six of the whole leave no gap+// along even the longest streak of an 8K frame.++const TAPS: i32 = 16;++fn centre() -> vec2<f32> {+ return vec2<f32>(params.x, params.y) / 100.0;+}++/// The whole zoom, as a distance in log scale: nothing at 0, and never+/// quite as far as the centre.+fn span() -> f32 {+ return -log(1.0 - clamp(params.amount / 100.0, 0.0, 0.99));+}++/// `uv` drawn `by` of log scale smaller about the centre.+fn scaled(uv: vec2<f32>, by: f32) -> vec2<f32> {+ return centre() + (uv - centre()) * exp(-by);+}++fn fine(uv: vec2<f32>) -> vec4<f32> {+ let step = span() / 4096.0;+ var sum = vec4<f32>(0.0);+ for (var i = 0; i < TAPS; i++) {+ sum += sample_premultiplied(scaled(uv, step * f32(i)));+ }+ return sum / f32(TAPS);+}++fn middle(uv: vec2<f32>) -> vec4<f32> {+ let step = span() / 256.0;+ var sum = vec4<f32>(0.0);+ for (var i = 0; i < TAPS; i++) {+ sum += fine_at(scaled(uv, step * f32(i)));+ }+ return sum / f32(TAPS);+}++fn effect(uv: vec2<f32>) -> vec4<f32> {+ let step = span() / 16.0;+ var sum = vec4<f32>(0.0);+ for (var i = 0; i < TAPS; i++) {+ sum += middle_at(scaled(uv, step * f32(i)));+ }+ let blurred = sum / f32(TAPS);+ return vec4<f32>(blurred.rgb / max(blurred.a, 1e-6), blurred.a);+}diff --git a/src/crates/concat-effects/packages/concat.zoom-blur/fixtures.toml b/src/crates/concat-effects/packages/concat.zoom-blur/fixtures.tomlnew file mode 100644index 00000000..9c4c1f5d--- /dev/null+++ b/src/crates/concat-effects/packages/concat.zoom-blur/fixtures.toml@@ -0,0 +1,43 @@+# A flat picture zooms to itself about any centre, through all three passes:+# what these pin is that the light past white and the alpha come out as they+# went in. How the zoom streaks a picture is held to the scales summed+# directly in concat-render's suite.++[[probe]]+name = "default, a grey"+input = [0.18, 0.18, 0.18, 1]+expect = [0.18, 0.18, 0.18, 1]++[[probe]]+name = "default, a highlight past white"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "default, half transparent"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "minimum, a highlight past white"+at = "min"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, a highlight past white"+at = "max"+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]++[[probe]]+name = "maximum, half transparent"+at = "max"+input = [0.5, 0.2, 0.1, 0.5]+expect = [0.5, 0.2, 0.1, 0.5]++[[probe]]+name = "off to a corner, a highlight past white"+params = { amount = 60, x = 10, y = 90 }+input = [4, 1, 0.05, 1]+expect = [4, 1, 0.05, 1]diff --git a/src/crates/concat-effects/src/lib.rs b/src/crates/concat-effects/src/lib.rsindex f4ab297c..47c23e2a 100644--- a/src/crates/concat-effects/src/lib.rs+++ b/src/crates/concat-effects/src/lib.rs@@ -448,8 +448,8 @@ mod tests {fn stray_parameter_keys_are_dropped_and_missing_ones_default() {let catalogue = Catalogue::builtin();assert_eq!(- catalogue.video_chain(&[applied("sharpen", &[("amount", 2.0), ("bogus", 99.0)])]),- "unsharp=5:5:2.00:5:5:0"+ catalogue.video_chain(&[applied("hue-shift", &[("angle", 90.0), ("bogus", 99.0)])]),+ "hue=h=90");assert_eq!(catalogue.video_chain(&[applied("shake", &[("amount", 20.0)])]),diff --git a/src/crates/concat-effects/src/shader.rs b/src/crates/concat-effects/src/shader.rsindex eeb1a905..b1964284 100644--- a/src/crates/concat-effects/src/shader.rs+++ b/src/crates/concat-effects/src/shader.rs@@ -106,7 +106,13 @@ const EFFECT_SAMPLE_LINEAR: &str = r#"/// outside Rec. 709's gamut, above 1.0 in a highlight - with 1.0 the white/// of an SDR picture (203 nits).fn sample(uv: vec2<f32>) -> vec4<f32> {- return textureSample(source, source_sampler, uv);+ return into_space(textureSample(source, source_sampler, uv));+}++/// A colour of the layer as the texture holds it, in the space `sample`+/// hands it over in: here, as it is.+fn into_space(c: vec4<f32>) -> vec4<f32> {+ return c;}"#;@@ -117,7 +123,12 @@ const EFFECT_SAMPLE_DISPLAY: &str = r#"/// (see `to_display`): the picture a look drawn by eye on an SDR display/// reads, not clipped at white.fn sample(uv: vec2<f32>) -> vec4<f32> {- let c = textureSample(source, source_sampler, uv);+ return into_space(textureSample(source, source_sampler, uv));+}++/// A colour of the layer as the texture holds it, in the space `sample`+/// hands it over in: here, the display encoding.+fn into_space(c: vec4<f32>) -> vec4<f32> {return vec4<f32>(to_display(c.rgb), c.a);}"#;@@ -128,11 +139,48 @@ const EFFECT_SAMPLE_LOG: &str = r#"/// space a table made for ACEScct reads, and where every level of light,/// far past white, has a place between 0 and 1.fn sample(uv: vec2<f32>) -> vec4<f32> {- let c = textureSample(source, source_sampler, uv);+ return into_space(textureSample(source, source_sampler, uv));+}++/// A colour of the layer as the texture holds it, in the space `sample`+/// hands it over in: here, log.+fn into_space(c: vec4<f32>) -> vec4<f32> {return vec4<f32>(to_log(c.rgb), c.a);}"#;+/// What every format 2 effect can read besides `sample`, in whichever+/// space it asked for (`into_space`).+const EFFECT_SAMPLE_PREMULTIPLIED: &str = r#"+/// The layer at `uv` as `sample` reads it, but with each of the four+/// pixels it lies among premultiplied by its alpha before they are mixed,+/// and handed back premultiplied: what a blur or an average sums, so that+/// a transparent pixel's colour never bleeds into the pixels beside it.+/// Where the four are as opaque as each other - all of an opaque picture -+/// it is the one fetch. Read without derivatives, so the reading may turn+/// on what it reads.+fn sample_premultiplied(uv: vec2<f32>) -> vec4<f32> {+ let c = into_space(textureSampleLevel(source, source_sampler, uv, 0.0));+ if (abs(c.a - round(c.a)) < 1e-4) {+ return vec4<f32>(c.rgb * c.a, c.a);+ }+ let p = uv * frame.size - vec2<f32>(0.5);+ let f = fract(p);+ let first = vec2<i32>(floor(p));+ let last = vec2<i32>(frame.size) - vec2<i32>(1);+ var mixed = vec4<f32>(0.0);+ for (var y = 0; y < 2; y++) {+ for (var x = 0; x < 2; x++) {+ let at = clamp(first + vec2<i32>(x, y), vec2<i32>(0), last);+ let t = into_space(textureLoad(source, at, 0));+ let w = select(1.0 - f.x, f.x, x == 1) * select(1.0 - f.y, f.y, y == 1);+ mixed += vec4<f32>(t.rgb * t.a, t.a) * w;+ }+ }+ return mixed;+}+"#;+/// What a transition's shader binds: the outgoing picture and the incoming/// one at group 0, the frame block - its spare slot the progress - and the/// parameters at group 1, the table at group 2, and no reveal map.@@ -1184,9 +1232,21 @@ impl Contract {(Entry::Effect, Contract::Display) => &[FORMAT2_BASICS, DISPLAY_LIBRARY],_ => &[FORMAT2_BASICS, LINEAR_LIBRARY],};- [&[head, sampling, BASICS][..], library, &[VERTEX, fragment]]- .concat()- .concat()+ let reading: &[&str] = match (entry, self) {+ (Entry::Effect, Contract::Linear | Contract::Display | Contract::Log) => {+ &[EFFECT_SAMPLE_PREMULTIPLIED]+ }+ _ => &[],+ };+ [+ &[head, sampling][..],+ reading,+ &[BASICS],+ library,+ &[VERTEX, fragment],+ ]+ .concat()+ .concat()}}diff --git a/src/crates/concat-render/src/gpu/tests.rs b/src/crates/concat-render/src/gpu/tests.rsindex 37f63d99..cb2da8b8 100644--- a/src/crates/concat-render/src/gpu/tests.rs+++ b/src/crates/concat-render/src/gpu/tests.rs@@ -1186,21 +1186,12 @@ fn gaussian_at(sum.map(|value| value / total)}-/// The Gaussian blur - across and then down, at a power of two fewer-/// pixels where its radius is wide, and read back over the layer - is the-/// 2-D Gaussian summed directly, at every radius from its least to its-/// most: over a picture with a gradient, a checkerboard, dots of light six-/// times white, a hard edge past white, a half-transparent strip, and a-/// transparent band whose colour must not bleed into anything.-#[test]-fn the_gaussian_blur_is_a_direct_gaussian() {- const PEAK: f64 = 6.0;- let Some(mut gpu) = gpu() else { return };- let blur = concat_effects::Catalogue::builtin()- .get("concat.gaussian-blur")- .expect("a built-in");- let size = (192, 108);- let picture: Vec<[f32; 4]> = (0..size.1)+/// A picture `size` pixels with everything a blur can get wrong in it: a+/// gradient, a checkerboard, dots of light `peak` times white, a hard edge+/// past white, a half-transparent strip down the left, and a transparent+/// band whose colour must not bleed into anything.+fn busy(size: (u32, u32), peak: f32) -> Vec<[f32; 4]> {+ (0..size.1).flat_map(|y| (0..size.0).map(move |x| (x, y))).map(|(x, y)| {let checker = if (x / 6 + y / 6) % 2 == 0 { 0.1 } else { 0.6 };@@ -1213,7 +1204,7 @@ fn the_gaussian_blur_is_a_direct_gaussian() {rgb = [1.5, 0.05, 0.05];}if x % 40 / 2 == 10 && y % 30 / 2 == 7 {- rgb = [PEAK as f32; 3];+ rgb = [peak; 3];}match y {80..90 => [5.0, 5.0, 5.0, 0.0],@@ -1221,7 +1212,84 @@ fn the_gaussian_blur_is_a_direct_gaussian() {_ => [rgb[0], rgb[1], rgb[2], 1.0],}})- .collect();+ .collect()+}++/// `picture`, `size` pixels, at `(x, y)` in pixels - a pixel's centre at+/// its whole number - read between its pixels as `sample_premultiplied`+/// reads it: the four about it premultiplied and mixed bilinearly, the edge+/// clamped as the GPU's sampler clamps it; in doubles.+fn premultiplied_at(+ picture: &[[f32; 4]],+ (width, height): (u32, u32),+ (x, y): (f64, f64),+) -> [f64; 4] {+ let x = x.clamp(0.0, f64::from(width - 1));+ let y = y.clamp(0.0, f64::from(height - 1));+ let (left, top) = (x.floor(), y.floor());+ let (fx, fy) = (x - left, y - top);+ let mut mixed = [0.0f64; 4];+ for (down, wy) in [(0, 1.0 - fy), (1, fy)] {+ for (across, wx) in [(0, 1.0 - fx), (1, fx)] {+ let column = (left as i64 + across).min(i64::from(width) - 1);+ let row = (top as i64 + down).min(i64::from(height) - 1);+ let [r, g, b, a] = picture[(row * i64::from(width) + column) as usize].map(f64::from);+ for (into, value) in mixed.iter_mut().zip([r * a, g * a, b * a, a]) {+ *into += wx * wy * value;+ }+ }+ }+ mixed+}++/// How far `got` is from `want` at a grid of pixels - every `stride`th of+/// each row and column, and the last, where `want` has an answer -+/// premultiplied: the worst, where, and the root mean square.+fn measured(+ got: &[[f32; 4]],+ (width, height): (u32, u32),+ stride: usize,+ want: impl Fn(i64, i64) -> Option<[f64; 4]>,+) -> (f64, (i64, i64), f64) {+ let along = |length: u32| {+ (0..i64::from(length))+ .step_by(stride)+ .chain([i64::from(length) - 1])+ .collect::<Vec<_>>()+ };+ let (mut worst, mut at, mut squares, mut count) = (0.0f64, (0, 0), 0.0f64, 0);+ for &y in &along(height) {+ for &x in &along(width) {+ let Some(want) = want(x, y) else { continue };+ let [r, g, b, a] = got[(y * i64::from(width) + x) as usize].map(f64::from);+ for (got, want) in [r * a, g * a, b * a, a].into_iter().zip(want) {+ let error = (got - want).abs();+ squares += error * error;+ count += 1;+ if error > worst {+ (worst, at) = (error, (x, y));+ }+ }+ }+ }+ (worst, at, (squares / f64::from(count)).sqrt())+}++/// The Gaussian blur - across and then down, at a power of two fewer+/// pixels where its radius is wide, and read back over the layer - is the+/// 2-D Gaussian summed directly, at every radius from its least to its+/// most: over a picture with a gradient, a checkerboard, dots of light six+/// times white, a hard edge past white, a half-transparent strip, and a+/// transparent band whose colour must not bleed into anything.+#[test]+fn the_gaussian_blur_is_a_direct_gaussian() {+ const PEAK: f64 = 6.0;+ let Some(mut gpu) = gpu() else { return };+ let blur = concat_effects::Catalogue::builtin()+ .get("concat.gaussian-blur")+ .expect("a built-in");+ let size = (192, 108);+ let picture = busy(size, PEAK as f32);// Below a radius of six the last pass blurs down `across` itself, and// `down` is a sliver nothing reads.for (radius, across, down) in [@@ -1246,28 +1314,9 @@ fn the_gaussian_blur_is_a_direct_gaussian() {// Every pixel where the sum is quick, a grid of them - the edges// among them - where it is not.let stride = (radius / 4.0).max(1.0) as usize;- let along = |length: u32| {- (0..length as i64)- .step_by(stride)- .chain([i64::from(length) - 1])- .collect::<Vec<_>>()- };- let (mut worst, mut at, mut squares, mut count) = (0.0f64, (0, 0), 0.0f64, 0);- for &y in &along(size.1) {- for &x in &along(size.0) {- let want = gaussian_at(&picture, size, (x, y), radius);- let [r, g, b, a] = got[(y * i64::from(size.0) + x) as usize].map(f64::from);- for (got, want) in [r * a, g * a, b * a, a].into_iter().zip(want) {- let error = (got - want).abs();- squares += error * error;- count += 1;- if error > worst {- (worst, at) = (error, (x, y));- }- }- }- }- let rms = (squares / f64::from(count)).sqrt();+ let (worst, at, rms) = measured(&got, size, stride, |x, y| {+ Some(gaussian_at(&picture, size, (x, y), radius))+ });eprintln!("radius {radius}: worst {worst:.5} at {at:?}, rms {rms:.6}");// Half floats, the fetch between two pixels, and the sum cut at// three sigmas each leave a trace; together they come to a quarter@@ -1397,3 +1446,170 @@ fn a_table_is_read_in_its_space_and_carried_past_its_ends() {"{got:?} against {want:?}");}++/// The motion blur - a coarse Gaussian along its line, then straight lines+/// drawn between its samples - is the Gaussian of sigma `length` along the+/// line summed directly, over the busy picture: along the rows, down the+/// columns and at a slant, from its shortest streak to its longest.+#[test]+fn a_motion_blur_is_a_gaussian_along_its_line() {+ const PEAK: f64 = 6.0;+ let Some(mut gpu) = gpu() else { return };+ let blur = concat_effects::Catalogue::builtin()+ .get("concat.motion-blur")+ .expect("a built-in");+ let size = (192, 108);+ let picture = busy(size, PEAK as f32);+ for (length, angle) in [+ (2.0, 0.0),+ (5.0, 0.0),+ (18.0, 0.0),+ (60.0, 0.0),+ (18.0, 90.0),+ (12.0, 30.0),+ ] {+ let pass = blur+ .pass(+ &BTreeMap::from([("length".to_owned(), length), ("angle".to_owned(), angle)]),+ None,+ )+ .expect("a shader");+ let got = treated(&mut gpu, size, &picture, &[pass]);+ let (sin, cos) = f64::to_radians(angle).sin_cos();+ let step = (length / 16.0).min(0.25);+ let reach = (5.0 * length / step).ceil() as i64;+ let streak = |x: i64, y: i64| {+ let (mut sum, mut total) = ([0.0f64; 4], 0.0f64);+ for k in -reach..=reach {+ let t = k as f64 * step;+ let weight = (-t * t / (2.0 * length * length)).exp();+ let seen =+ premultiplied_at(&picture, size, (x as f64 + t * cos, y as f64 - t * sin));+ for (into, value) in sum.iter_mut().zip(seen) {+ *into += weight * value;+ }+ total += weight;+ }+ sum.map(|value| value / total)+ };+ let (worst, at, rms) = measured(&got, size, 3, |x, y| Some(streak(x, y)));+ eprintln!("length {length} at {angle}°: worst {worst:.5} at {at:?}, rms {rms:.6}");+ assert!(+ worst < 0.01 * PEAK,+ "length {length} at {angle}°: {worst} off at {at:?}"+ );+ assert!(+ rms < 0.0015 * PEAK,+ "length {length} at {angle}°: rms {rms}"+ );+ }+}++/// The zoom blur - three passes of sixteen scales - is the four thousand+/// and ninety-six scales of the picture about its centre summed directly,+/// about the middle and about a corner: to the half float over a ramp,+/// where the passes compose exactly, and over the busy picture as near as+/// passes that read each other between pixels come - they soften a streak+/// across its line by about half a pixel, which shows only where a streak+/// grazes a dot six times white.+#[test]+fn a_zoom_blur_is_its_scales_summed() {+ const PEAK: f64 = 6.0;+ let Some(mut gpu) = gpu() else { return };+ let zoom = concat_effects::Catalogue::builtin()+ .get("concat.zoom-blur")+ .expect("a built-in");+ let size = (192, 108);+ let ramp: Vec<[f32; 4]> = (0..size.1)+ .flat_map(|y| {+ (0..size.0).map(move |x| [x as f32 / size.0 as f32, 0.5, y as f32 / size.1 as f32, 1.0])+ })+ .collect();+ for (picture, worst_of, rms_of) in [+ (ramp, 0.002, 0.0005),+ (busy(size, PEAK as f32), 0.025 * PEAK, 0.002 * PEAK),+ ] {+ for (amount, centre) in [+ (25.0, (50.0, 50.0)),+ (100.0, (50.0, 50.0)),+ (60.0, (10.0, 90.0)),+ ] {+ let pass = zoom+ .pass(+ &BTreeMap::from([+ ("amount".to_owned(), amount),+ ("x".to_owned(), centre.0),+ ("y".to_owned(), centre.1),+ ]),+ None,+ )+ .expect("a shader");+ let got = treated(&mut gpu, size, &picture, &[pass]);+ let span = -(1.0 - f64::min(amount / 100.0, 0.99)).ln();+ let (cx, cy) = (centre.0 / 100.0, centre.1 / 100.0);+ let (width, height) = (f64::from(size.0), f64::from(size.1));+ let (worst, at, rms) = measured(&got, size, 4, |x, y| {+ let (u, v) = ((x as f64 + 0.5) / width, (y as f64 + 0.5) / height);+ let mut sum = [0.0f64; 4];+ for k in 0..4096 {+ let scale = (-span * f64::from(k) / 4096.0).exp();+ let (su, sv) = (cx + (u - cx) * scale, cy + (v - cy) * scale);+ let seen =+ premultiplied_at(&picture, size, (su * width - 0.5, sv * height - 0.5));+ for (into, value) in sum.iter_mut().zip(seen) {+ *into += value / 4096.0;+ }+ }+ Some(sum)+ });+ eprintln!("zoom {amount} about {centre:?}: worst {worst:.5} at {at:?}, rms {rms:.6}");+ assert!(worst < worst_of, "zoom {amount}: {worst} off at {at:?}");+ assert!(rms < rms_of, "zoom {amount}: rms {rms}");+ }+ }+}++/// The fisheye draws every pixel of the frame from somewhere inside it, at+/// full strength and at any shape of frame - no black holes, as earlier+/// builds drew - and pulls the picture in towards the middle without ever+/// folding it back: a ramp across the frame still climbs from left to+/// right along the middle row, the middle and the corners where they were.+#[test]+fn the_fisheye_fills_the_frame() {+ let Some(mut gpu) = gpu() else { return };+ let fisheye = concat_effects::Catalogue::builtin()+ .get("concat.fisheye")+ .expect("a built-in");+ let pass = fisheye+ .pass(&BTreeMap::from([("strength".to_owned(), 100.0)]), None)+ .expect("a shader");+ for size in [(96, 54), (54, 96), (64, 64)] {+ let flat = vec![[0.3f32, 0.5, 0.7, 1.0]; (size.0 * size.1) as usize];+ let got = treated(&mut gpu, size, &flat, std::slice::from_ref(&pass));+ for (n, pixel) in got.iter().enumerate() {+ assert!(+ near(*pixel, [0.3, 0.5, 0.7, 1.0], 0.004),+ "{size:?}: pixel {n} is {pixel:?}"+ );+ }+ let ramp: Vec<[f32; 4]> = (0..size.1)+ .flat_map(|_| (0..size.0).map(|x| [(x as f32 + 0.5) / size.0 as f32, 0.0, 0.0, 1.0]))+ .collect();+ let got = treated(&mut gpu, size, &ramp, std::slice::from_ref(&pass));+ let row = &got[(size.1 / 2 * size.0) as usize..][..size.0 as usize];+ assert!(+ row.windows(2).all(|pair| pair[1][0] >= pair[0][0]),+ "{size:?}: the middle row folds back"+ );+ let quarter = row[(size.0 / 4) as usize][0];+ assert!(+ quarter > 0.3 && quarter < 0.5,+ "{size:?}: a quarter of the way across reads {quarter}, not pulled towards the middle"+ );+ let corner = got[0][0];+ assert!(+ (corner - ramp[0][0]).abs() < 0.01,+ "{size:?}: the corner moved to {corner}"+ );+ }+}diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.jsonindex 266a7128..14285568 100644--- a/src/crates/concat/locales/de.json+++ b/src/crates/concat/locales/de.json@@ -249,8 +249,10 @@"effects.cathedral.name": "Kathedrale","effects.chipmunk.description": "Höher und quietschiger.","effects.chipmunk.name": "Streifenhörnchen",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "Stanzt die gewählte Hintergrundfarbe aus, legt das Bild über das, was darunter liegt, und entfernt die Farbüberstrahlung.",+ "effects.chromaKey.name": "Chroma-Key",+ "effects.chromaticAberration.description": "Rot und Blau zu den Rändern hin auseinandergezogen – die Farbsäume eines billigen Objektivs.",+ "effects.chromaticAberration.name": "Chromatische Aberration","effects.chromeShine.description": "Ein metallischer Verlauf rollt langsam über das Bild, von dunkel zu hell zu dunkel.","effects.chromeShine.name": "Chromglanz","effects.classicChrome.description": "Gedämpfte Lichter und tiefe, offene Schatten: der zurückhaltende Look eines klassischen Farbnegativs.",@@ -378,7 +380,7 @@"effects.labels.air": "Luft","effects.labels.amount": "Stärke","effects.labels.amplitude": "Amplitude",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "Winkel","effects.labels.bits": "Bits","effects.labels.blacks": "Schwarztöne","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "Farbton","effects.labels.ink": "Ink","effects.labels.invert": "Invertieren",+ "effects.labels.keyColour": "Key-Farbe","effects.labels.length": "Länge","effects.labels.level": "Pegel","effects.labels.levels": "Pegel",@@ -459,20 +462,21 @@"effects.labels.shadows": "Schatten","effects.labels.shape": "Form","effects.labels.sharpen": "Schärfen",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "Versatz","effects.labels.similarity": "Ähnlichkeit","effects.labels.size": "Größe","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "Weichheit","effects.labels.speed": "Tempo",+ "effects.labels.spill": "Überstrahlung","effects.labels.spread": "Streuung","effects.labels.strength": "Stärke","effects.labels.style": "Stil","effects.labels.target": "Ziel","effects.labels.tear": "Riss","effects.labels.temperature": "Temperatur",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "Schwelle","effects.labels.tiles": "Kacheln","effects.labels.tint": "Tönung","effects.labels.tone": "Klang",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Bringt den ganzen Clip auf eine Lautheit, wie Sender und Plattformen es erwarten.","effects.loudness.name": "Lautheit normalisieren",+ "effects.lumaKey.description": "Stanzt das Dunkle des Bildes aus – Feuer, Rauch oder Funken vor Schwarz gedreht – oder, invertiert, das Helle.",+ "effects.lumaKey.name": "Luma-Key","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Behält einen weich umrandeten Kreis des Bildes und lässt den Rest durch.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "Ein waagerechter Wisch, als hätte die Kamera geschwenkt.",+ "effects.motionBlur.description": "Ein Wisch entlang einer Linie, als hätte die Kamera geschwenkt.","effects.motionBlur.name": "Bewegungsunschärfe","effects.natural.description": "Eine sanfte, lebensechte Anhebung: kaum spürbare Wärme, die Haut bleibt unberührt.","effects.natural.name": "Natürlich",@@ -683,6 +689,8 @@"effects.winterCool.name": "Winterkühle","effects.wordReveal.description": "Die Wörter eines Titels erscheinen nacheinander, während der Clip läuft, in Lesereihenfolge.","effects.wordReveal.name": "Wort für Wort",+ "effects.zoomBlur.description": "Ein Sog auf einen Punkt zu, als hätte das Objektiv während der Aufnahme gezoomt.",+ "effects.zoomBlur.name": "Zoom-Unschärfe","effects.zoomBlurTransition.description": "Schneller Kamerastoß nach innen und außen mit radialer Zoomunschärfe.","effects.zoomBlurTransition.name": "Zoomunschärfe","effects.zoomTransition.description": "Ein Reißzoom aus der vorherigen Einstellung hinaus und in die nächste hinein.",diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.jsonindex bc91343a..331a6853 100644--- a/src/crates/concat/locales/en.json+++ b/src/crates/concat/locales/en.json@@ -249,7 +249,9 @@"effects.cathedral.name": "Cathedral","effects.chipmunk.description": "Higher and squeakier.","effects.chipmunk.name": "Chipmunk",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",+ "effects.chromaKey.description": "Keys out the screen colour you pick, leaving the picture over whatever is beneath, its spill cleaned off.",+ "effects.chromaKey.name": "Chroma Key",+ "effects.chromaticAberration.description": "Red and blue pulled apart towards the edges, the colour fringing of a cheap lens.","effects.chromaticAberration.name": "Chromatic Aberration","effects.chromeShine.description": "A metallic gradient rolls slowly across the picture, dark to bright to dark.","effects.chromeShine.name": "Chrome Shine",@@ -428,6 +430,7 @@"effects.labels.hue": "Hue","effects.labels.ink": "Ink","effects.labels.invert": "Invert",+ "effects.labels.keyColour": "Key colour","effects.labels.length": "Length","effects.labels.level": "Level","effects.labels.levels": "Levels",@@ -466,6 +469,7 @@"effects.labels.soften": "Soften","effects.labels.softness": "Softness","effects.labels.speed": "Speed",+ "effects.labels.spill": "Spill","effects.labels.spread": "Spread","effects.labels.strength": "Strength","effects.labels.style": "Style",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Brings the whole clip to one loudness, the way broadcast and the platforms expect.","effects.loudness.name": "Normalize Loudness",+ "effects.lumaKey.description": "Keys out the dark of the picture - fire, smoke or sparks shot on black - or, inverted, the light.",+ "effects.lumaKey.name": "Luma Key","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Keeps a soft-edged circle of the picture and lets the rest through.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "A horizontal streak, as if the camera panned.",+ "effects.motionBlur.description": "A streak along a line, as if the camera panned.","effects.motionBlur.name": "Motion Blur","effects.natural.description": "A gentle, true-to-life lift: barely-there warmth, skin left alone.","effects.natural.name": "Natural",@@ -683,6 +689,8 @@"effects.winterCool.name": "Winter Cool","effects.wordReveal.description": "A title's words appear one at a time as the clip plays, in reading order.","effects.wordReveal.name": "Word Reveal",+ "effects.zoomBlur.description": "A rush towards a point, as if the lens zoomed during the shot.",+ "effects.zoomBlur.name": "Zoom Blur","effects.zoomBlurTransition.description": "Rapid inward/outward camera rush with radial zoom blur.","effects.zoomBlurTransition.name": "Zoom Blur","effects.zoomTransition.description": "A whip zoom out of the outgoing shot and into the incoming one.",diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.jsonindex c573eb54..dc35d822 100644--- a/src/crates/concat/locales/es.json+++ b/src/crates/concat/locales/es.json@@ -249,8 +249,10 @@"effects.cathedral.name": "Catedral","effects.chipmunk.description": "Más agudo y chillón.","effects.chipmunk.name": "Ardilla",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "Elimina el color de fondo que elijas y deja la imagen sobre lo que haya debajo, sin el color que se derrama sobre ella.",+ "effects.chromaKey.name": "Clave de croma",+ "effects.chromaticAberration.description": "Rojo y azul separados hacia los bordes, las franjas de color de un objetivo barato.",+ "effects.chromaticAberration.name": "Aberración cromática","effects.chromeShine.description": "Un degradado metálico recorre despacio la imagen, de oscuro a claro y a oscuro otra vez.","effects.chromeShine.name": "Brillo cromado","effects.classicChrome.description": "Luces apagadas y sombras profundas y abiertas: el aspecto contenido de un negativo de color clásico.",@@ -378,7 +380,7 @@"effects.labels.air": "Aire","effects.labels.amount": "Cantidad","effects.labels.amplitude": "Amplitud",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "Ángulo","effects.labels.bits": "Bits","effects.labels.blacks": "Negros","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "Matiz","effects.labels.ink": "Ink","effects.labels.invert": "Invertir",+ "effects.labels.keyColour": "Color de clave","effects.labels.length": "Duración","effects.labels.level": "Nivel","effects.labels.levels": "Niveles",@@ -459,20 +462,21 @@"effects.labels.shadows": "Sombras","effects.labels.shape": "Forma","effects.labels.sharpen": "Enfocar",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "Desplazamiento","effects.labels.similarity": "Similitud","effects.labels.size": "Tamaño","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "Suavidad","effects.labels.speed": "Velocidad",+ "effects.labels.spill": "Derrame","effects.labels.spread": "Extensión","effects.labels.strength": "Intensidad","effects.labels.style": "Estilo","effects.labels.target": "Objetivo","effects.labels.tear": "Desgarro","effects.labels.temperature": "Temperatura",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "Umbral","effects.labels.tiles": "Mosaicos","effects.labels.tint": "Matiz","effects.labels.tone": "Tono",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Lleva todo el clip a una misma sonoridad, como esperan la emisión y las plataformas.","effects.loudness.name": "Normalizar sonoridad",+ "effects.lumaKey.description": "Elimina lo oscuro de la imagen —fuego, humo o chispas grabados sobre negro— o, invertido, lo claro.",+ "effects.lumaKey.name": "Clave de luma","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Conserva un círculo de borde suave de la imagen y deja pasar el resto.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "Un barrido horizontal, como si la cámara hiciera una panorámica.",+ "effects.motionBlur.description": "Un barrido a lo largo de una línea, como si la cámara hiciera una panorámica.","effects.motionBlur.name": "Desenfoque de movimiento","effects.natural.description": "Un realce suave y fiel a la realidad: una calidez apenas perceptible, la piel sin tocar.","effects.natural.name": "Natural",@@ -683,6 +689,8 @@"effects.winterCool.name": "Frío invernal","effects.wordReveal.description": "Las palabras de un título aparecen una a una mientras se reproduce el clip, en orden de lectura.","effects.wordReveal.name": "Revelado de palabras",+ "effects.zoomBlur.description": "Un impulso hacia un punto, como si el objetivo hiciera zoom durante la toma.",+ "effects.zoomBlur.name": "Desenfoque de zoom","effects.zoomBlurTransition.description": "Acercamiento y alejamiento rápidos de cámara con desenfoque de zoom radial.","effects.zoomBlurTransition.name": "Desenfoque de zoom","effects.zoomTransition.description": "Un zoom latigazo que sale del plano saliente y entra en el entrante.",diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.jsonindex 6abb9f8f..ccfa386f 100644--- a/src/crates/concat/locales/fa.json+++ b/src/crates/concat/locales/fa.json@@ -249,7 +249,9 @@"effects.cathedral.name": "کلیسا","effects.chipmunk.description": "Pitch بالاتر و صدای زیرتر.","effects.chipmunk.name": "سنجابی (Chipmunk)",- "effects.chromaticAberration.description": "قرمز و آبی از هم جدا میشوند و رنگ Fringing شبیه لنز ارزان ایجاد میشود.",+ "effects.chromaKey.description": "رنگ پردهای را که انتخاب میکنید Key میکند، تصویر را روی لایه زیرین باقی میگذارد و پخش رنگ پرده (Spill) را پاک میکند.",+ "effects.chromaKey.name": "کروما کی",+ "effects.chromaticAberration.description": "قرمز و آبی به سمت لبهها از هم جدا میشوند و رنگ Fringing شبیه لنز ارزان ایجاد میشود.","effects.chromaticAberration.name": "خطای رنگی (Chromatic Aberration)","effects.chromeShine.description": "یک گرادیان فلزی بهآرامی روی تصویر حرکت میکند؛ از تیره به روشن و دوباره به تیره.","effects.chromeShine.name": "درخشش کرومی",@@ -428,6 +430,7 @@"effects.labels.hue": "فام (Hue)","effects.labels.ink": "جوهر","effects.labels.invert": "معکوس",+ "effects.labels.keyColour": "رنگ Key","effects.labels.length": "طول","effects.labels.level": "سطح","effects.labels.levels": "سطوح",@@ -466,6 +469,7 @@"effects.labels.soften": "نرم کردن","effects.labels.softness": "نرمی","effects.labels.speed": "سرعت",+ "effects.labels.spill": "پخش رنگ","effects.labels.spread": "گستردگی","effects.labels.strength": "قدرت","effects.labels.style": "سبک",@@ -505,6 +509,8 @@"effects.lofi.name": "کیفیت پایین (Lo-fi)","effects.loudness.description": "کل کلیپ را به یک Loudness یکنواخت میرساند؛ همانطور که پخش و پلتفرمها انتظار دارند.","effects.loudness.name": "نرمالسازی بلندی صدا",+ "effects.lumaKey.description": "تاریکی تصویر را Key میکند (آتش، دود یا جرقهای که روی زمینه سیاه فیلمبرداری شده) یا، در حالت وارونه، روشنایی را.",+ "effects.lumaKey.name": "لوما کی","effects.marquee.description": "شهر شبانه: نورها و Signها زنده و Bloom میشوند، سیاهیها عمیق و سرد میمانند و چهرهها تمیز حفظ میشوند؛ مناسب فضای شهری شب.","effects.marquee.name": "انتخاب کادری (Marquee)","effects.maskCircle.description": "یک دایره با لبه نرم از تصویر را نگه میدارد و بقیه را عبور میدهد.",@@ -529,7 +535,7 @@"effects.mono.name": "مونو (Mono)","effects.moody.description": "سیاهیها با Film Toe فشرده میشوند، رنگ کاهش مییابد، Midtoneها Bronze میشوند، سایهها سرد و گوشهها تیرهتر میشوند.","effects.moody.name": "حالوهوایی",- "effects.motionBlur.description": "یک کشیدگی افقی، انگار دوربین Pan شده است.",+ "effects.motionBlur.description": "یک کشیدگی در امتداد یک خط، انگار دوربین Pan شده است.","effects.motionBlur.name": "محوشدگی حرکتی (Motion Blur)","effects.natural.description": "بهبودی ملایم و طبیعی: گرمای تقریباً نامحسوس و پوست دستنخورده.","effects.natural.name": "طبیعی",@@ -683,6 +689,8 @@"effects.winterCool.name": "سرمای زمستانی","effects.wordReveal.description": "کلمات عنوان همراه با پخش کلیپ یکییکی و به ترتیب خواندن ظاهر میشوند.","effects.wordReveal.name": "نمایش کلمه به کلمه",+ "effects.zoomBlur.description": "هجومی به سوی یک نقطه، انگار لنز هنگام فیلمبرداری زوم کرده است.",+ "effects.zoomBlur.name": "محوشدگی زوم (Zoom Blur)","effects.zoomBlurTransition.description": "هجوم سریع دوربین به داخل/بیرون همراه با Zoom Blur شعاعی.","effects.zoomBlurTransition.name": "محوشدگی بزرگنمایی (Zoom Blur)","effects.zoomTransition.description": "یک Zoom سریع از نمای خروجی به بیرون و به داخل نمای ورودی.",diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.jsonindex 6361725f..62da25db 100644--- a/src/crates/concat/locales/fr.json+++ b/src/crates/concat/locales/fr.json@@ -249,8 +249,10 @@"effects.cathedral.name": "Cathédrale","effects.chipmunk.description": "Plus aigu et plus criard.","effects.chipmunk.name": "Écureuil",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "Retire la couleur de fond choisie et pose l'image sur ce qui est en dessous, en nettoyant le débordement de couleur.",+ "effects.chromaKey.name": "Incrustation chroma",+ "effects.chromaticAberration.description": "Le rouge et le bleu écartés vers les bords, les franges colorées d'un objectif bon marché.",+ "effects.chromaticAberration.name": "Aberration chromatique","effects.chromeShine.description": "Un dégradé métallique glisse lentement sur l'image, du sombre au clair puis au sombre.","effects.chromeShine.name": "Éclat chromé","effects.classicChrome.description": "Des hautes lumières atténuées et des ombres profondes mais ouvertes : le rendu sobre d'un négatif couleur classique.",@@ -428,6 +430,7 @@"effects.labels.hue": "Teinte","effects.labels.ink": "Ink","effects.labels.invert": "Inverser",+ "effects.labels.keyColour": "Couleur de clé","effects.labels.length": "Durée","effects.labels.level": "Niveau","effects.labels.levels": "Niveaux",@@ -459,20 +462,21 @@"effects.labels.shadows": "Ombres","effects.labels.shape": "Forme","effects.labels.sharpen": "Netteté",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "Décalage","effects.labels.similarity": "Similarité","effects.labels.size": "Taille","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "Douceur","effects.labels.speed": "Vitesse",+ "effects.labels.spill": "Débordement","effects.labels.spread": "Étalement","effects.labels.strength": "Intensité","effects.labels.style": "Style","effects.labels.target": "Cible","effects.labels.tear": "Déchirure","effects.labels.temperature": "Température",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "Seuil","effects.labels.tiles": "Tuiles","effects.labels.tint": "Teinte","effects.labels.tone": "Tonalité",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Amène tout le clip à une même sonie, comme l'attendent la diffusion et les plateformes.","effects.loudness.name": "Normaliser la sonie",+ "effects.lumaKey.description": "Retire le sombre de l'image — feu, fumée ou étincelles filmés sur fond noir — ou, inversé, le clair.",+ "effects.lumaKey.name": "Incrustation luma","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Garde un cercle à bord doux de l'image et laisse passer le reste.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "Une traînée horizontale, comme un panoramique.",+ "effects.motionBlur.description": "Une traînée le long d'une ligne, comme un panoramique.","effects.motionBlur.name": "Flou de mouvement","effects.natural.description": "Un relèvement doux et fidèle : une chaleur à peine perceptible, la peau laissée telle quelle.","effects.natural.name": "Naturel",@@ -683,6 +689,8 @@"effects.winterCool.name": "Froid hivernal","effects.wordReveal.description": "Les mots d'un titre apparaissent un à un pendant la lecture du clip, dans l'ordre de lecture.","effects.wordReveal.name": "Révélation des mots",+ "effects.zoomBlur.description": "Un élan vers un point, comme si l'objectif zoomait pendant la prise.",+ "effects.zoomBlur.name": "Flou de zoom","effects.zoomBlurTransition.description": "Une ruée rapide de la caméra vers l'avant ou l'arrière, avec un flou de zoom radial.","effects.zoomBlurTransition.name": "Flou de zoom","effects.zoomTransition.description": "Un zoom fouetté hors du plan sortant et dans le plan suivant.",diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.jsonindex 133d88b8..aad94590 100644--- a/src/crates/concat/locales/hr.json+++ b/src/crates/concat/locales/hr.json@@ -249,7 +249,9 @@"effects.cathedral.name": "Katedrala","effects.chipmunk.description": "Više i piskutavije.","effects.chipmunk.name": "Vjeverica",- "effects.chromaticAberration.description": "Crvena i plava razdvojene, kolorni rub jeftinog objektiva.",+ "effects.chromaKey.description": "Uklanja boju pozadine koju odaberete, ostavljajući sliku preko onoga što je ispod, i čisti prelijevanje boje.",+ "effects.chromaKey.name": "Kroma ključ",+ "effects.chromaticAberration.description": "Crvena i plava razdvojene prema rubovima, kolorni rub jeftinog objektiva.","effects.chromaticAberration.name": "Kromatska aberacija","effects.chromeShine.description": "Metalni gradijent polako prelazi preko slike, iz tamnog u svijetlo pa u tamno.","effects.chromeShine.name": "Kromirani sjaj",@@ -428,6 +430,7 @@"effects.labels.hue": "Nijansa","effects.labels.ink": "Tinta","effects.labels.invert": "Invertiraj",+ "effects.labels.keyColour": "Boja ključa","effects.labels.length": "Dužina","effects.labels.level": "Razina","effects.labels.levels": "Razine",@@ -466,6 +469,7 @@"effects.labels.soften": "Omekšaj","effects.labels.softness": "Mekoća","effects.labels.speed": "Brzina",+ "effects.labels.spill": "Prelijevanje","effects.labels.spread": "Širenje","effects.labels.strength": "Jačina","effects.labels.style": "Stil",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Dovodi cijeli klip na jednu glasnoću, kako to očekuju emitiranje i platforme.","effects.loudness.name": "Normaliziraj glasnoću",+ "effects.lumaKey.description": "Uklanja tamno sa slike – vatru, dim ili iskre snimljene na crnom – ili, obrnuto, svijetlo.",+ "effects.lumaKey.name": "Luma ključ","effects.marquee.description": "Noćni grad: svjetla i natpisi živopisni i procvjetali, crne duboke i hladne, lica čista. Stvoreno za gradsku vrpcu.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Čuva meko obrubljeni krug slike, a ostatak propušta.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Crne zgnječene filmskim nožnim dijelom, boja isušena, bronca kroz sredinu, hladno u sjenama, kutovi se zatvaraju.","effects.moody.name": "Ćudljivo",- "effects.motionBlur.description": "Vodoravna crta, kao da je kamera panoramirala.",+ "effects.motionBlur.description": "Crta duž linije, kao da je kamera panoramirala.","effects.motionBlur.name": "Zamućenje pokreta","effects.natural.description": "Nježno, vjerno podizanje: jedva primjetna toplina, koža netaknuta.","effects.natural.name": "Prirodno",@@ -683,6 +689,8 @@"effects.winterCool.name": "Zimska hladnoća","effects.wordReveal.description": "Riječi naslova pojavljuju se jedna po jedna dok klip svira, redom čitanja.","effects.wordReveal.name": "Otkrivanje riječi",+ "effects.zoomBlur.description": "Nalet prema točki, kao da je objektiv zumirao tijekom snimanja.",+ "effects.zoomBlur.name": "Zamućenje zumiranja","effects.zoomBlurTransition.description": "Brzi nalet kamere unutra/van s radijalnim zamućenjem zuma.","effects.zoomBlurTransition.name": "Zamućenje zumom","effects.zoomTransition.description": "Brzi zum iz odlazećeg kadra u dolazeći.",diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.jsonindex 7ed05048..e3ca2a1d 100644--- a/src/crates/concat/locales/it.json+++ b/src/crates/concat/locales/it.json@@ -249,8 +249,10 @@"effects.cathedral.name": "Cattedrale","effects.chipmunk.description": "Più acuta e stridula.","effects.chipmunk.name": "Scoiattolo",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "Toglie il colore di fondo che scegli, lasciando l'immagine su ciò che sta sotto, ripulita dal colore riflesso.",+ "effects.chromaKey.name": "Chiave cromatica",+ "effects.chromaticAberration.description": "Rosso e blu separati verso i bordi, le frange di colore di un obiettivo economico.",+ "effects.chromaticAberration.name": "Aberrazione cromatica","effects.chromeShine.description": "Una sfumatura metallica scorre lentamente sull'immagine, dal buio alla luce al buio.","effects.chromeShine.name": "Riflesso cromato","effects.classicChrome.description": "Luci smorzate e ombre profonde e aperte: il look sobrio di un classico negativo a colori.",@@ -378,7 +380,7 @@"effects.labels.air": "Aria","effects.labels.amount": "Quantità","effects.labels.amplitude": "Ampiezza",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "Angolo","effects.labels.bits": "Bit","effects.labels.blacks": "Neri","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "Tonalità","effects.labels.ink": "Ink","effects.labels.invert": "Inverti",+ "effects.labels.keyColour": "Colore chiave","effects.labels.length": "Durata","effects.labels.level": "Livello","effects.labels.levels": "Livelli",@@ -459,20 +462,21 @@"effects.labels.shadows": "Ombre","effects.labels.shape": "Forma","effects.labels.sharpen": "Nitidezza",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "Spostamento","effects.labels.similarity": "Somiglianza","effects.labels.size": "Dimensione","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "Morbidezza","effects.labels.speed": "Velocità",+ "effects.labels.spill": "Riflesso","effects.labels.spread": "Diffusione","effects.labels.strength": "Intensità","effects.labels.style": "Stile","effects.labels.target": "Obiettivo","effects.labels.tear": "Strappo","effects.labels.temperature": "Temperatura",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "Soglia","effects.labels.tiles": "Tessere","effects.labels.tint": "Tinta","effects.labels.tone": "Tono",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Porta tutta la clip a un unico livello di loudness, come si aspettano broadcast e piattaforme.","effects.loudness.name": "Normalizza loudness",+ "effects.lumaKey.description": "Toglie lo scuro dell'immagine – fuoco, fumo o scintille ripresi sul nero – oppure, invertito, il chiaro.",+ "effects.lumaKey.name": "Chiave di luminanza","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Tiene un cerchio dell'immagine dal bordo morbido e lascia passare il resto.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "Una scia orizzontale, come una panoramica.",+ "effects.motionBlur.description": "Una scia lungo una linea, come una panoramica.","effects.motionBlur.name": "Sfocatura di movimento","effects.natural.description": "Un ritocco leggero e fedele: un calore appena accennato, la pelle lasciata com'è.","effects.natural.name": "Naturale",@@ -683,6 +689,8 @@"effects.winterCool.name": "Freddo invernale","effects.wordReveal.description": "Le parole di un titolo compaiono una alla volta mentre la clip scorre, in ordine di lettura.","effects.wordReveal.name": "Parole a comparsa",+ "effects.zoomBlur.description": "Uno slancio verso un punto, come se l'obiettivo zoomasse durante la ripresa.",+ "effects.zoomBlur.name": "Sfocatura zoom","effects.zoomBlurTransition.description": "Una corsa rapida della camera in avanti e indietro, con sfocatura zoom radiale.","effects.zoomBlurTransition.name": "Sfocatura zoom","effects.zoomTransition.description": "Uno zoom a frusta fuori dall'inquadratura in uscita e dentro quella in entrata.",diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.jsonindex 66ddf9d9..5d99ac54 100644--- a/src/crates/concat/locales/ja.json+++ b/src/crates/concat/locales/ja.json@@ -249,8 +249,10 @@"effects.cathedral.name": "大聖堂","effects.chipmunk.description": "より高く、キーキーと。","effects.chipmunk.name": "チップマンク",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "選んだスクリーンの色を抜き、下にあるものの上に画像を重ねます。色かぶりも取り除きます。",+ "effects.chromaKey.name": "クロマキー",+ "effects.chromaticAberration.description": "端に向かって赤と青がずれる、安いレンズの色にじみ。",+ "effects.chromaticAberration.name": "色収差","effects.chromeShine.description": "金属的なグラデーションが暗から明、また暗へと画面をゆっくり流れます。","effects.chromeShine.name": "クロームシャイン","effects.classicChrome.description": "抑えたハイライトと深く開いたシャドウ:クラシックなカラーネガの控えめなルック。",@@ -378,7 +380,7 @@"effects.labels.air": "エア","effects.labels.amount": "量","effects.labels.amplitude": "振幅",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "角度","effects.labels.bits": "ビット","effects.labels.blacks": "黒レベル","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "色相","effects.labels.ink": "Ink","effects.labels.invert": "反転",+ "effects.labels.keyColour": "キーの色","effects.labels.length": "長さ","effects.labels.level": "レベル","effects.labels.levels": "レベル",@@ -459,20 +462,21 @@"effects.labels.shadows": "シャドウ","effects.labels.shape": "形","effects.labels.sharpen": "シャープ",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "ずれ","effects.labels.similarity": "類似度","effects.labels.size": "サイズ","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "柔らかさ","effects.labels.speed": "速度",+ "effects.labels.spill": "スピル","effects.labels.spread": "広がり","effects.labels.strength": "強さ","effects.labels.style": "スタイル","effects.labels.target": "目標","effects.labels.tear": "ティア","effects.labels.temperature": "色温度",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "しきい値","effects.labels.tiles": "タイル","effects.labels.tint": "色合い","effects.labels.tone": "トーン",@@ -505,6 +509,8 @@"effects.lofi.name": "ローファイ","effects.loudness.description": "クリップ全体を、放送や配信プラットフォームが求める一定のラウドネスに揃えます。","effects.loudness.name": "ラウドネスを正規化",+ "effects.lumaKey.description": "画像の暗い部分(黒背景で撮った炎、煙、火花など)を抜きます。反転すると明るい部分を抜きます。",+ "effects.lumaKey.name": "ルマキー","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "画像の柔らかい縁の円形部分を残し、残りを透過させます。",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "カメラをパンしたような横方向の流れ。",+ "effects.motionBlur.description": "カメラをパンしたような、線に沿った流れ。","effects.motionBlur.name": "モーションブラー","effects.natural.description": "自然で穏やかな持ち上げ:ほのかな温かみで、肌はそのままに。","effects.natural.name": "自然",@@ -683,6 +689,8 @@"effects.winterCool.name": "ウィンタークール","effects.wordReveal.description": "クリップの再生に合わせて、タイトルの言葉が読む順に一つずつ現れます。","effects.wordReveal.name": "ワードリビール",+ "effects.zoomBlur.description": "撮影中にレンズをズームしたような、一点へ向かう流れ。",+ "effects.zoomBlur.name": "ズームぼかし","effects.zoomBlurTransition.description": "放射状のズームブラーを伴う、内外への素早いカメラの突進。","effects.zoomBlurTransition.name": "ズームブラー","effects.zoomTransition.description": "前のショットから勢いよくズームアウトし、次のショットへズームインします。",diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.jsonindex a2c96063..cda62d51 100644--- a/src/crates/concat/locales/ko.json+++ b/src/crates/concat/locales/ko.json@@ -249,8 +249,10 @@"effects.cathedral.name": "대성당","effects.chipmunk.description": "더 높고 새된 소리.","effects.chipmunk.name": "다람쥐",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "고른 스크린 색을 빼고 아래에 있는 것 위에 그림을 올리며, 번진 색도 지웁니다.",+ "effects.chromaKey.name": "크로마 키",+ "effects.chromaticAberration.description": "가장자리로 갈수록 빨강과 파랑이 벌어지는, 싸구려 렌즈의 색 번짐.",+ "effects.chromaticAberration.name": "색수차","effects.chromeShine.description": "금속성 그러데이션이 어둡게, 밝게, 다시 어둡게 화면을 천천히 가로지릅니다.","effects.chromeShine.name": "크롬 광택","effects.classicChrome.description": "차분한 하이라이트와 깊고 열린 그림자: 클래식 컬러 네거티브의 절제된 느낌.",@@ -378,7 +380,7 @@"effects.labels.air": "공기감","effects.labels.amount": "양","effects.labels.amplitude": "진폭",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "각도","effects.labels.bits": "비트","effects.labels.blacks": "검정 계열","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "색조","effects.labels.ink": "Ink","effects.labels.invert": "반전",+ "effects.labels.keyColour": "키 색상","effects.labels.length": "길이","effects.labels.level": "레벨","effects.labels.levels": "레벨",@@ -459,20 +462,21 @@"effects.labels.shadows": "어둠","effects.labels.shape": "모양","effects.labels.sharpen": "선명하게",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "이동","effects.labels.similarity": "유사도","effects.labels.size": "크기","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "부드러움","effects.labels.speed": "속도",+ "effects.labels.spill": "스필","effects.labels.spread": "퍼짐","effects.labels.strength": "강도","effects.labels.style": "스타일","effects.labels.target": "목표","effects.labels.tear": "찢김","effects.labels.temperature": "색온도",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "임계값","effects.labels.tiles": "타일","effects.labels.tint": "틴트","effects.labels.tone": "톤",@@ -505,6 +509,8 @@"effects.lofi.name": "로파이","effects.loudness.description": "방송과 플랫폼이 기대하는 하나의 라우드니스로 클립 전체를 맞춥니다.","effects.loudness.name": "라우드니스 정규화",+ "effects.lumaKey.description": "그림의 어두운 부분(검은 배경에서 찍은 불, 연기, 불꽃)을 빼거나, 반전하면 밝은 부분을 뺍니다.",+ "effects.lumaKey.name": "루마 키","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "부드러운 가장자리의 원 안만 남기고 나머지는 통과시킵니다.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "카메라를 패닝한 듯한 가로 잔상.",+ "effects.motionBlur.description": "카메라를 패닝한 듯 선을 따라 생기는 잔상.","effects.motionBlur.name": "모션 블러","effects.natural.description": "있는 듯 없는 듯한 온기에 피부는 건드리지 않은, 사실적이고 은은한 보정.","effects.natural.name": "자연스럽게",@@ -683,6 +689,8 @@"effects.winterCool.name": "겨울의 차가움","effects.wordReveal.description": "클립이 재생되는 동안 자막의 단어가 읽는 순서대로 하나씩 나타납니다.","effects.wordReveal.name": "단어 드러내기",+ "effects.zoomBlur.description": "촬영 중 렌즈를 줌한 듯 한 점으로 빨려 드는 흐름.",+ "effects.zoomBlur.name": "줌 블러","effects.zoomBlurTransition.description": "방사형 줌 블러가 더해진 빠른 카메라 돌진과 후퇴.","effects.zoomBlurTransition.name": "줌 블러","effects.zoomTransition.description": "나가는 샷에서 휙 줌 아웃했다가 들어오는 샷으로 줌 인합니다.",diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.jsonindex 310cc936..2b9fb4e6 100644--- a/src/crates/concat/locales/pt-BR.json+++ b/src/crates/concat/locales/pt-BR.json@@ -249,8 +249,10 @@"effects.cathedral.name": "Catedral","effects.chipmunk.description": "Mais aguda e esganiçada.","effects.chipmunk.name": "Esquilo",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "Remove a cor de fundo que você escolher, deixando a imagem sobre o que estiver abaixo, sem o vazamento de cor.",+ "effects.chromaKey.name": "Chave de croma",+ "effects.chromaticAberration.description": "Vermelho e azul afastados rumo às bordas, as franjas de cor de uma lente barata.",+ "effects.chromaticAberration.name": "Aberração cromática","effects.chromeShine.description": "Um degradê metálico percorre a imagem devagar, do escuro ao claro e de volta ao escuro.","effects.chromeShine.name": "Brilho cromado","effects.classicChrome.description": "Realces contidos e sombras profundas e abertas: o visual sóbrio de um negativo colorido clássico.",@@ -378,7 +380,7 @@"effects.labels.air": "Ar","effects.labels.amount": "Quantidade","effects.labels.amplitude": "Amplitude",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "Ângulo","effects.labels.bits": "Bits","effects.labels.blacks": "Pretos","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "Matiz","effects.labels.ink": "Ink","effects.labels.invert": "Inverter",+ "effects.labels.keyColour": "Cor da chave","effects.labels.length": "Duração","effects.labels.level": "Nível","effects.labels.levels": "Níveis",@@ -459,20 +462,21 @@"effects.labels.shadows": "Sombras","effects.labels.shape": "Forma","effects.labels.sharpen": "Nitidez",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "Deslocamento","effects.labels.similarity": "Similaridade","effects.labels.size": "Tamanho","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "Suavidade","effects.labels.speed": "Velocidade",+ "effects.labels.spill": "Vazamento","effects.labels.spread": "Espalhamento","effects.labels.strength": "Intensidade","effects.labels.style": "Estilo","effects.labels.target": "Alvo","effects.labels.tear": "Rasgo","effects.labels.temperature": "Temperatura",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "Limiar","effects.labels.tiles": "Ladrilhos","effects.labels.tint": "Matiz","effects.labels.tone": "Tom",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Leva todo o clipe a um único loudness, como a TV e as plataformas esperam.","effects.loudness.name": "Normalizar loudness",+ "effects.lumaKey.description": "Remove o escuro da imagem — fogo, fumaça ou faíscas filmados sobre preto — ou, invertido, o claro.",+ "effects.lumaKey.name": "Chave de luma","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Mantém um círculo de borda suave da imagem e deixa o resto passar.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "Um rastro horizontal, como se a câmera fizesse uma panorâmica.",+ "effects.motionBlur.description": "Um rastro ao longo de uma linha, como se a câmera fizesse uma panorâmica.","effects.motionBlur.name": "Desfoque de movimento","effects.natural.description": "Um realce suave e fiel à vida: um calor quase imperceptível, a pele deixada em paz.","effects.natural.name": "Natural",@@ -683,6 +689,8 @@"effects.winterCool.name": "Frio de inverno","effects.wordReveal.description": "As palavras de um título aparecem uma de cada vez enquanto o clipe toca, na ordem de leitura.","effects.wordReveal.name": "Revelação de palavras",+ "effects.zoomBlur.description": "Um avanço rumo a um ponto, como se a lente desse zoom durante a gravação.",+ "effects.zoomBlur.name": "Desfoque de zoom","effects.zoomBlurTransition.description": "Avanço rápido da câmera para dentro/fora com desfoque de zoom radial.","effects.zoomBlurTransition.name": "Desfoque de zoom","effects.zoomTransition.description": "Um zoom chicoteado para fora do plano que sai e para dentro do que entra.",diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.jsonindex 3d8016da..ff197263 100644--- a/src/crates/concat/locales/ru.json+++ b/src/crates/concat/locales/ru.json@@ -249,7 +249,9 @@"effects.cathedral.name": "Собор","effects.chipmunk.description": "Выше и писклявее.","effects.chipmunk.name": "Бурундук",- "effects.chromaticAberration.description": "Красный и синий разведены — цветная кайма дешёвого объектива.",+ "effects.chromaKey.description": "Убирает выбранный цвет фона, оставляя картинку поверх того, что ниже, и снимает цветную засветку.",+ "effects.chromaKey.name": "Хромакей",+ "effects.chromaticAberration.description": "Красный и синий разведены к краям — цветная кайма дешёвого объектива.","effects.chromaticAberration.name": "Хроматическая аберрация","effects.chromeShine.description": "Металлический градиент медленно катится по картинке: из тьмы в свет и снова в тьму.","effects.chromeShine.name": "Хромовый блеск",@@ -428,6 +430,7 @@"effects.labels.hue": "Оттенок","effects.labels.ink": "Чернила","effects.labels.invert": "Инверсия",+ "effects.labels.keyColour": "Цвет ключа","effects.labels.length": "Длина","effects.labels.level": "Уровень","effects.labels.levels": "Уровни",@@ -466,6 +469,7 @@"effects.labels.soften": "Смягчить","effects.labels.softness": "Мягкость","effects.labels.speed": "Скорость",+ "effects.labels.spill": "Засветка","effects.labels.spread": "Разброс","effects.labels.strength": "Сила","effects.labels.style": "Стиль",@@ -505,6 +509,8 @@"effects.lofi.name": "Лоу-фай","effects.loudness.description": "Приводит весь клип к одной громкости, как ждут телевещание и платформы.","effects.loudness.name": "Нормализовать громкость",+ "effects.lumaKey.description": "Убирает тёмное в картинке — огонь, дым или искры, снятые на чёрном, — или, при инверсии, светлое.",+ "effects.lumaKey.name": "Лума-кей","effects.marquee.description": "Ночной город: огни и вывески яркие и светящиеся, чёрные глубокие и холодные, лица чистые. Для прогулки по бульвару.","effects.marquee.name": "Огни вывесок","effects.maskCircle.description": "Оставляет круг картинки с мягким краем, остальное пропускает.",@@ -529,7 +535,7 @@"effects.mono.name": "Моно","effects.moody.description": "Чёрные придавлены плёночным носком, цвет выцвел, бронза в средних тонах, холод в тенях, углы сходятся.","effects.moody.name": "Мрачный",- "effects.motionBlur.description": "Горизонтальный смаз, будто камера панорамировала.",+ "effects.motionBlur.description": "Смаз вдоль линии, будто камера панорамировала.","effects.motionBlur.name": "Размытие в движении","effects.natural.description": "Мягкий, жизненный подъём: едва заметное тепло, кожа не тронута.","effects.natural.name": "Естественно",@@ -683,6 +689,8 @@"effects.winterCool.name": "Зимний холод","effects.wordReveal.description": "Слова титра появляются по одному по ходу клипа, в порядке чтения.","effects.wordReveal.name": "Появление слов",+ "effects.zoomBlur.description": "Рывок к точке, будто объектив зумировал во время съёмки.",+ "effects.zoomBlur.name": "Размытие зумом","effects.zoomBlurTransition.description": "Стремительный рывок камеры внутрь или наружу с радиальным зум-размытием.","effects.zoomBlurTransition.name": "Зум-размытие","effects.zoomTransition.description": "Резкий зум из уходящего кадра в следующий.",diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.jsonindex 3b29bf0f..f6f941e4 100644--- a/src/crates/concat/locales/tr.json+++ b/src/crates/concat/locales/tr.json@@ -249,8 +249,10 @@"effects.cathedral.name": "Katedral","effects.chipmunk.description": "Daha tiz ve cıyaklayan.","effects.chipmunk.name": "Sincap",- "effects.chromaticAberration.description": "Red and blue pulled apart, the colour fringing of a cheap lens.",- "effects.chromaticAberration.name": "Chromatic Aberration",+ "effects.chromaKey.description": "Seçtiğiniz perde rengini çıkarır, görüntüyü altında ne varsa onun üzerine bırakır ve renk taşmasını temizler.",+ "effects.chromaKey.name": "Kroma anahtarı",+ "effects.chromaticAberration.description": "Kenarlara doğru ayrılan kırmızı ve mavi, ucuz bir objektifin renk saçaklanması.",+ "effects.chromaticAberration.name": "Renk sapması","effects.chromeShine.description": "Metalik bir geçiş görüntü boyunca yavaşça kayar; koyudan parlağa, parlaktan koyuya.","effects.chromeShine.name": "Krom parlaması","effects.classicChrome.description": "Bastırılmış ışıklar ve derin, açık gölgeler: klasik bir renkli negatifin ölçülü görünümü.",@@ -378,7 +380,7 @@"effects.labels.air": "Hava","effects.labels.amount": "Miktar","effects.labels.amplitude": "Genlik",- "effects.labels.angle": "Angle",+ "effects.labels.angle": "Açı","effects.labels.bits": "Bit","effects.labels.blacks": "Siyahlar","effects.labels.bleed": "Bleed",@@ -428,6 +430,7 @@"effects.labels.hue": "Ton","effects.labels.ink": "Ink","effects.labels.invert": "Ters çevir",+ "effects.labels.keyColour": "Anahtar rengi","effects.labels.length": "Uzunluk","effects.labels.level": "Seviye","effects.labels.levels": "Seviyeler",@@ -459,20 +462,21 @@"effects.labels.shadows": "Gölgeler","effects.labels.shape": "Biçim","effects.labels.sharpen": "Netleştir",- "effects.labels.shift": "Shift",+ "effects.labels.shift": "Kayma","effects.labels.similarity": "Benzerlik","effects.labels.size": "Boyut","effects.labels.sky": "Sky","effects.labels.soften": "Soften","effects.labels.softness": "Yumuşaklık","effects.labels.speed": "Hız",+ "effects.labels.spill": "Taşma","effects.labels.spread": "Yayılma","effects.labels.strength": "Güç","effects.labels.style": "Stil","effects.labels.target": "Hedef","effects.labels.tear": "Yırtılma","effects.labels.temperature": "Sıcaklık",- "effects.labels.threshold": "Threshold",+ "effects.labels.threshold": "Eşik","effects.labels.tiles": "Döşemeler","effects.labels.tint": "Renk tonu","effects.labels.tone": "Ton",@@ -505,6 +509,8 @@"effects.lofi.name": "Lo-fi","effects.loudness.description": "Tüm klibi yayıncıların ve platformların beklediği tek bir ses yüksekliğine getirir.","effects.loudness.name": "Ses yüksekliğini normalleştir",+ "effects.lumaKey.description": "Görüntünün karanlığını çıkarır — siyah üzerinde çekilmiş ateş, duman ya da kıvılcımlar — ya da ters çevrildiğinde aydınlığını.",+ "effects.lumaKey.name": "Luma anahtarı","effects.marquee.description": "Night city: the lights and signs made vivid and blooming, blacks kept deep and cool, faces left clean. Made for the strip.","effects.marquee.name": "Marquee","effects.maskCircle.description": "Görüntünün yumuşak kenarlı bir dairesini tutar, gerisini geçirir.",@@ -529,7 +535,7 @@"effects.mono.name": "Mono","effects.moody.description": "Blacks crushed by a film toe, colour drained, bronze through the middle, cool in the shadows, the corners closing in.","effects.moody.name": "Moody",- "effects.motionBlur.description": "Kamera kaydırılmış gibi yatay bir iz.",+ "effects.motionBlur.description": "Kamera kaydırılmış gibi bir çizgi boyunca iz.","effects.motionBlur.name": "Hareket bulanıklığı","effects.natural.description": "Nazik, gerçeğe sadık bir canlandırma: belli belirsiz bir sıcaklık, tene dokunulmamış.","effects.natural.name": "Doğal",@@ -683,6 +689,8 @@"effects.winterCool.name": "Kış soğuğu","effects.wordReveal.description": "Bir yazının kelimeleri klip oynarken okuma sırasıyla teker teker belirir.","effects.wordReveal.name": "Kelime belirmesi",+ "effects.zoomBlur.description": "Çekim sırasında objektif yakınlaştırılmış gibi bir noktaya doğru atılış.",+ "effects.zoomBlur.name": "Yakınlaştırma bulanıklığı","effects.zoomBlurTransition.description": "Radyal yakınlaştırma bulanıklığıyla içe/dışa hızlı kamera atılışı.","effects.zoomBlurTransition.name": "Yakınlaştırma bulanıklığı","effects.zoomTransition.description": "Giden çekimden dışarı, gelen çekimin içine hızlı bir yakınlaştırma savruluşu.",diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.jsonindex d2aa685f..6369cb76 100644--- a/src/crates/concat/locales/zh-Hans.json+++ b/src/crates/concat/locales/zh-Hans.json@@ -249,7 +249,9 @@"effects.cathedral.name": "大教堂","effects.chipmunk.description": "更高、更尖细。","effects.chipmunk.name": "花栗鼠",- "effects.chromaticAberration.description": "红蓝两色错开,廉价镜头的彩色镶边。",+ "effects.chromaKey.description": "抠除你选的幕布颜色,让画面叠在下层内容之上,并清除溢色。",+ "effects.chromaKey.name": "色度键",+ "effects.chromaticAberration.description": "红蓝两色向边缘错开,廉价镜头的彩色镶边。","effects.chromaticAberration.name": "色差","effects.chromeShine.description": "金属质感的渐变缓缓滚过画面,由暗到亮再到暗。","effects.chromeShine.name": "铬光",@@ -428,6 +430,7 @@"effects.labels.hue": "色相","effects.labels.ink": "墨水","effects.labels.invert": "反转",+ "effects.labels.keyColour": "抠像颜色","effects.labels.length": "长度","effects.labels.level": "电平","effects.labels.levels": "色阶",@@ -466,6 +469,7 @@"effects.labels.soften": "柔化","effects.labels.softness": "柔和度","effects.labels.speed": "速度",+ "effects.labels.spill": "溢色","effects.labels.spread": "扩散","effects.labels.strength": "强度","effects.labels.style": "样式",@@ -505,6 +509,8 @@"effects.lofi.name": "低保真","effects.loudness.description": "将整个片段统一到同一响度,符合广播与各平台的要求。","effects.loudness.name": "响度标准化",+ "effects.lumaKey.description": "抠除画面的暗部(在黑底上拍的火焰、烟雾或火花),反转时抠除亮部。",+ "effects.lumaKey.name": "亮度键","effects.marquee.description": "夜色都市:灯光与招牌鲜艳绽放,黑色深沉而清冷,人脸保持干净。为繁华街头而生。","effects.marquee.name": "跑马灯","effects.maskCircle.description": "保留画面中一个柔边圆形区域,其余部分透出下层。",@@ -529,7 +535,7 @@"effects.mono.name": "单声道","effects.moody.description": "黑位被胶片趾部压暗,色彩褪去,中间调泛青铜色,阴影偏冷,四角向内收拢。","effects.moody.name": "情绪",- "effects.motionBlur.description": "一道水平拖影,仿佛摄像机在摇摄。",+ "effects.motionBlur.description": "沿一条线的拖影,仿佛摄像机在摇摄。","effects.motionBlur.name": "运动模糊","effects.natural.description": "温和自然的提亮:若有若无的暖意,肤色保持不变。","effects.natural.name": "自然",@@ -683,6 +689,8 @@"effects.winterCool.name": "冬日冷调","effects.wordReveal.description": "标题中的文字随片段播放按阅读顺序逐个出现。","effects.wordReveal.name": "逐词显现",+ "effects.zoomBlur.description": "冲向一点,仿佛拍摄时镜头在变焦。",+ "effects.zoomBlur.name": "缩放模糊","effects.zoomBlurTransition.description": "镜头急速推进拉出,伴随径向缩放模糊。","effects.zoomBlurTransition.name": "缩放模糊","effects.zoomTransition.description": "快速变焦拉出上一个镜头,再推入下一个镜头。",diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.jsonindex abfbaebb..2708e8b5 100644--- a/src/crates/concat/locales/zh-TW.json+++ b/src/crates/concat/locales/zh-TW.json@@ -249,7 +249,9 @@"effects.cathedral.name": "大教堂","effects.chipmunk.description": "更高、更尖細。","effects.chipmunk.name": "花栗鼠",- "effects.chromaticAberration.description": "紅藍兩色錯開,廉價鏡頭的彩色鑲邊。",+ "effects.chromaKey.description": "去除你選的布幕顏色,讓畫面疊在下層內容之上,並清除溢色。",+ "effects.chromaKey.name": "色度鍵",+ "effects.chromaticAberration.description": "紅藍兩色向邊緣錯開,廉價鏡頭的彩色鑲邊。","effects.chromaticAberration.name": "色差","effects.chromeShine.description": "金屬質感的漸層緩緩滾過畫面,由暗到亮再到暗。","effects.chromeShine.name": "鉻光",@@ -428,6 +430,7 @@"effects.labels.hue": "色相","effects.labels.ink": "墨水","effects.labels.invert": "反轉",+ "effects.labels.keyColour": "去背顏色","effects.labels.length": "長度","effects.labels.level": "電平","effects.labels.levels": "色階",@@ -466,6 +469,7 @@"effects.labels.soften": "柔化","effects.labels.softness": "柔和度","effects.labels.speed": "速度",+ "effects.labels.spill": "溢色","effects.labels.spread": "擴散","effects.labels.strength": "強度","effects.labels.style": "樣式",@@ -505,6 +509,8 @@"effects.lofi.name": "低傳真","effects.loudness.description": "將整個片段統一到同一響度,符合廣播與各平台的要求。","effects.loudness.name": "響度正規化",+ "effects.lumaKey.description": "去除畫面的暗部(在黑底上拍的火焰、煙霧或火花),反轉時去除亮部。",+ "effects.lumaKey.name": "亮度鍵","effects.marquee.description": "夜色都市:燈光與招牌鮮豔綻放,黑色深沉而清冷,人臉保持乾淨。為繁華街頭而生。","effects.marquee.name": "跑馬燈","effects.maskCircle.description": "保留畫面中一個柔邊圓形區域,其餘部分透出下層。",@@ -529,7 +535,7 @@"effects.mono.name": "單聲道","effects.moody.description": "黑位被底片趾部壓暗,色彩褪去,中間調泛青銅色,陰影偏冷,四角向內收攏。","effects.moody.name": "情緒",- "effects.motionBlur.description": "一道水平拖影,彷彿攝影機在橫搖。",+ "effects.motionBlur.description": "沿一條線的拖影,彷彿攝影機在橫搖。","effects.motionBlur.name": "動態模糊","effects.natural.description": "溫和自然的提亮:若有若無的暖意,膚色保持不變。","effects.natural.name": "自然",@@ -683,6 +689,8 @@"effects.winterCool.name": "冬日冷調","effects.wordReveal.description": "標題中的文字隨片段播放按閱讀順序逐一出現。","effects.wordReveal.name": "逐字顯現",+ "effects.zoomBlur.description": "衝向一點,彷彿拍攝時鏡頭在變焦。",+ "effects.zoomBlur.name": "縮放模糊","effects.zoomBlurTransition.description": "鏡頭急速推進拉出,伴隨徑向縮放模糊。","effects.zoomBlurTransition.name": "縮放模糊","effects.zoomTransition.description": "快速變焦拉出上一個鏡頭,再推入下一個鏡頭。",diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rsindex df5e7e7d..e44c75c2 100644--- a/src/crates/concat/src/lib.rs+++ b/src/crates/concat/src/lib.rs@@ -216,6 +216,7 @@ pub fn run() -> Result<(), slint::PlatformError> {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()));+ editor.set_visual_colours(ModelRc::from(models.visual_colours.clone()));app.global::<Keyframes>().set_rows(ModelRc::from(models.key_rows.clone()));app.global::<KeyEditor>()@@ -996,6 +997,12 @@ pub fn run() -> Result<(), slint::PlatformError> {}));+ editor.on_chain_set_colour(on_lanes!(+ |state, index: i32, key: SharedString, value: slint::Color| {+ state.chain_set_colour(index, key.as_str(), value);+ }+ ));+editor.on_adjust_set(on_lanes!(|state, key: SharedString, value: f32| {state.adjust_set(key.as_str(), value);}));diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rsindex 4720f4ca..0322599c 100644--- a/src/crates/concat/src/studio.rs+++ b/src/crates/concat/src/studio.rs@@ -31,6 +31,7 @@ use std::sync::Arc;use concat_effects::Catalogue;use concat_effects::manifest::Kind as PackageKind;+use concat_effects::manifest::ParamType;use concat_host::playback::ClipSpec;use concat_host::{AnalyseRequest, Cutouts, EnhanceRequest, ProjectInfo, RegionRequest, Session, media, projects,@@ -578,6 +579,8 @@ pub struct Models {pub adjust_curves: Rc<VecModel<CurveData>>,pub visual_wheels: Rc<VecModel<WheelGroupData>>,pub visual_curves: Rc<VecModel<CurveGroupData>>,+ /// The picture's chain's colour knobs, a row each.+ pub visual_colours: Rc<VecModel<ColourKnobData>>,/// 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@@ -641,6 +644,7 @@ impl Models {adjust_wheels: Rc::new(VecModel::default()),adjust_curves: Rc::new(VecModel::default()),visual_wheels: Rc::new(VecModel::default()),+ visual_colours: Rc::new(VecModel::default()),visual_curves: Rc::new(VecModel::default()),link_wheels: RefCell::new(HashMap::new()),link_curves: RefCell::new(HashMap::new()),@@ -1337,6 +1341,54 @@ fn adjust_rows(chain: &[AppliedFilter], at: Option<f64>) -> Vec<AppliedParamData.collect()}+/// A colour knob's value as the document holds it: RGBA packed into one+/// number, red in the top byte, as the shader unpacks it.+fn packed(colour: slint::Color) -> f64 {+ let bytes = [colour.red(), colour.green(), colour.blue(), colour.alpha()];+ f64::from(u32::from_be_bytes(bytes))+}++/// The colour a knob's packed number holds.+fn unpacked(value: f64) -> slint::Color {+ let [r, g, b, a] = (value.clamp(0.0, f64::from(u32::MAX)) as u32).to_be_bytes();+ slint::Color::from_argb_u8(a, r, g, b)+}++/// A chain's colour knobs, a row each, holding the document's colour or+/// the default.+fn chain_colours(chain: &[AppliedFilter]) -> Vec<ColourKnobData> {+ let catalogue = Catalogue::builtin();+ chain+ .iter()+ .enumerate()+ .filter_map(|(index, entry)| {+ let package = catalogue+ .packages()+ .find(|package| package.answers_to(&entry.id))?;+ Some((index, entry, package))+ })+ .flat_map(|(index, entry, package)| {+ package+ .manifest+ .params+ .iter()+ .filter(|param| param.kind == ParamType::Color)+ .map(move |param| ColourKnobData {+ entry: index as i32,+ key: param.key.as_str().into(),+ label: i18n::shelf_text("labels", ¶m.label).into(),+ value: unpacked(+ entry+ .params+ .get(¶m.key)+ .copied()+ .unwrap_or(param.default),+ ),+ })+ })+ .collect()+}+/// A chain as the inspector's stack draws it: one row per link, and one per/// knob its package declares, holding the document's value or the default./// A link no package answers to keeps its row - so it can be removed - and@@ -1390,11 +1442,13 @@ fn chain_rows(chain: &[AppliedFilter]) -> (Vec<AppliedEntryData>, Vec<AppliedParnext: false,});}+ // A colour is a swatch of its own (see `chain_colours`), and a wheel+ // or a curve is drawn apart (see `chain_grading`).for param in package.manifest.params.iter()- .filter(|param| !param.kind.is_compound())+ .filter(|param| !param.kind.is_compound() && param.kind != ParamType::Color){let step = if param.step > 0.0 {param.step@@ -1439,7 +1493,6 @@ fn grading_rows(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();@@ -1538,7 +1591,6 @@ fn chain_grading(/// 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)];};@@ -3313,6 +3365,14 @@ impl Studio {});}+ /// A colour knob of the picture chain's link `index`, on the echo:+ /// packed into the knob's number (see `packed`).+ pub fn chain_set_colour(&mut self, index: i32, key: &str, colour: slint::Color) {+ self.edit_chain_link(index, |link| {+ link.params.insert(key.to_owned(), packed(colour));+ });+ }+/// 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 {@@ -6589,6 +6649,13 @@ impl Studio {};sync(&models.applied_visual, visual);sync(&models.visual_params, visual_params);+ sync(+ &models.visual_colours,+ match self.sole_selection().and_then(|id| self.clip(&id)) {+ Some(clip) => chain_colours(&clip.video_effects),+ None => Vec::new(),+ },+ );sync(&models.applied_audio, sound);sync(&models.audio_params, sound_params);sync(@@ -8855,8 +8922,9 @@ impl Studio {#[cfg(test)]mod tests {use super::{- 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,+ Command, Footprint, Studio, adjust_key_names, chain_colours, chain_rows, custom_frame,+ custom_rate, fps_of, grading_rows, home_folder, key_commands, packed, place_in, shown,+ wheel_partners, write_keyable,};/// A wheel is keyed as one knob: named by itself or by any of its own@@ -8915,6 +8983,29 @@ mod tests {assert_eq!(curves[1].1.len(), 3, "the ends and the point put down");}+ /// A colour knob is a swatch in the stack, not a slider: broadcast+ /// green at the chroma key's default, and a colour picked is packed into+ /// the knob's number as the shader unpacks it, and read back the same.+ #[test]+ fn a_colour_knob_is_a_swatch() {+ use concat_project::model::AppliedFilter;+ let mut link = AppliedFilter::new("concat.chroma-key");+ let (_, knobs) = chain_rows(std::slice::from_ref(&link));+ assert!(knobs.iter().all(|knob| knob.key != "color"), "no slider");+ assert!(knobs.iter().any(|knob| knob.key == "similarity"));+ let colours = chain_colours(std::slice::from_ref(&link));+ assert_eq!(colours.len(), 1);+ assert_eq!(colours[0].key, "color");+ assert_eq!(+ colours[0].value,+ slint::Color::from_argb_u8(255, 0x00, 0xb1, 0x40)+ );+ let blue = slint::Color::from_argb_u8(255, 0x00, 0x47, 0xbb);+ link.params.insert("color".to_owned(), packed(blue));+ assert_eq!(link.params["color"], f64::from(0x0047_bbffu32));+ assert_eq!(chain_colours(&[link])[0].value, blue);+ }+/// 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 9b6df8d3..634c7de3 100644--- a/src/crates/concat/ui/editor.slint+++ b/src/crates/concat/ui/editor.slint@@ -3,7 +3,7 @@import { EffectData } from "demo/effects-panel.slint";import {- AppliedEntryData, AppliedParamData, CatalogueEntryData,+ AppliedEntryData, AppliedParamData, CatalogueEntryData, ColourKnobData,} from "inspector/clip-inspector.slint";import {CurveData, CurveGroupData, WheelData, WheelGroupData,@@ -158,6 +158,10 @@ export global Editor {in-out property <[CurveData]> adjust-curves;in-out property <[WheelGroupData]> visual-wheels;in-out property <[CurveGroupData]> visual-curves;+ /// The picture chain's colour knobs, and one of them picked: RGBA+ /// packed into the knob's number, see `Studio::chain_set_colour`.+ in-out property <[ColourKnobData]> visual-colours;+ callback chain-set-colour(index: int, key: string, value: color);callback curve-point(entry: int, key: string, point: int, x: float, y: float);callback curve-remove(entry: int, key: string, point: int);diff --git a/src/crates/concat/ui/inspector/clip-inspector.slint b/src/crates/concat/ui/inspector/clip-inspector.slintindex 4b30e7cf..5c84db8c 100644--- a/src/crates/concat/ui/inspector/clip-inspector.slint+++ b/src/crates/concat/ui/inspector/clip-inspector.slint@@ -16,6 +16,7 @@ import { SegmentedControl } from "../primitives/segmented-control.slint";import { Select } from "../primitives/select.slint";import {Check,+ ColourField,HelpButton,InspectorFmt,Note,@@ -153,6 +154,17 @@ export struct AppliedParamData {next: bool,}+/// One colour knob of one link - a key's screen colour - drawn as a swatch+/// that opens the picker, with the hex beside it.+export struct ColourKnobData {+ /// Which link, as an index into the applied list.+ entry: int,+ /// The manifest's key; what Rust is handed back with the new colour.+ key: string,+ label: string,+ value: color,+}+/// The favourites chip: a star that filters the shelf down to what is on it.component StarChip inherits Rectangle {in property <bool> on;@@ -203,6 +215,8 @@ export component PresetStack inherits VerticalLayout {/// The links' wheels and curves, a group a link that has any.in property <[WheelGroupData]> wheel-groups;in property <[CurveGroupData]> curve-groups;+ /// The links' colour knobs, a row each.+ in property <[ColourKnobData]> colours;/// Which of the three libraries this is: 0 filters, 1 effects, 2 audio./// The index its view state and its callbacks are keyed by.@@ -224,6 +238,8 @@ 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 colour knob picked, likewise.+ callback set-colour(index: int, key: string, value: color);/// 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);@@ -389,6 +405,23 @@ export component PresetStack inherits VerticalLayout {}}+ // The link's colours: a swatch that opens the+ // picker, and the hex, typed as well as read.+ for c in root.colours: Rectangle {+ visible: c.entry == index;+ height: c.entry == index ? swatch.preferred-height : 0;++ swatch := ColourField {+ label: c.label;+ value: c.value;+ alpha: false;+ changed(colour) => {+ root.set-colour(index, c.key, colour);+ root.commit();+ }+ }+ }+// The link's wheels, three in a row, and its curves.for g in root.wheel-groups: Rectangle {visible: g.entry == index;diff --git a/src/crates/concat/ui/workspace/config-pane.slint b/src/crates/concat/ui/workspace/config-pane.slintindex b4dc17ee..35a2c487 100644--- a/src/crates/concat/ui/workspace/config-pane.slint+++ b/src/crates/concat/ui/workspace/config-pane.slint@@ -9,7 +9,8 @@ import { PaneKind, PaneSwitcher } from "pane-switcher.slint";import { EffectData } from "../demo/effects-panel.slint";import {AdjustPanel, AppliedEntryData, AppliedParamData, AudioPanel, ProcessorRows,- CatalogueEntryData, FilterPanel, PresetStack, SpeedPanel, VideoPanel,+ CatalogueEntryData, ColourKnobData, FilterPanel, PresetStack, SpeedPanel,+ VideoPanel,} from "../inspector/clip-inspector.slint";import {CurveData, CurveGroupData, WheelData, WheelGroupData,@@ -158,6 +159,9 @@ export component ConfigPane inherits Rectangle {in property <[CurveData]> adjust-curves;in property <[WheelGroupData]> visual-wheels;in property <[CurveGroupData]> visual-curves;+ /// The picture chain's colour knobs, and one of them picked.+ in property <[ColourKnobData]> visual-colours;+ callback chain-set-colour(index: int, key: string, value: color);/// 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);@@ -638,6 +642,7 @@ export component ConfigPane inherits Rectangle {params: root.visual-params;wheel-groups: root.visual-wheels;curve-groups: root.visual-curves;+ colours: root.visual-colours;add(id) => { root.chain-add(false, id); }toggle(index) => { root.chain-toggle(false, index); }@@ -646,6 +651,9 @@ export component ConfigPane inherits Rectangle {set-param(index, key, value) => {root.chain-set-param(false, index, key, value);}+ set-colour(index, key, value) => {+ root.chain-set-colour(index, key, value);+ }curve-point(index, key, point, x, y) => {root.curve-point(index, key, point, x, y);}diff --git a/src/crates/concat/ui/workspace/seat.slint b/src/crates/concat/ui/workspace/seat.slintindex 655a909c..67c4700e 100644--- a/src/crates/concat/ui/workspace/seat.slint+++ b/src/crates/concat/ui/workspace/seat.slint@@ -225,6 +225,8 @@ export component Seat inherits Rectangle {adjust-curves: Editor.adjust-curves;visual-wheels: Editor.visual-wheels;visual-curves: Editor.visual-curves;+ visual-colours: Editor.visual-colours;+ chain-set-colour(index, key, value) => { Editor.chain-set-colour(index, key, value); }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;