Python/OpenCV proof of concept plus first native Swift port
Snapshot before the Python POC is removed. The POC (main.py, effects.py, panel.py, shaders.py, effects/*.glsl, flake.nix) is the reference for the native app under native/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
6591138bbf
27 changed files with 2076 additions and 0 deletions
12
native/effects/colorize.metal
Normal file
12
native/effects/colorize.metal
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Recolours the picture by brightness with a smooth colour ramp.
|
||||
// order 10
|
||||
// slider amount 0.0 1.0 0.8
|
||||
// slider palette 0.0 1.0 0.0
|
||||
// slider contrast 0.5 3.0 1.2
|
||||
float4 effect(float2 uv, Inputs in) {
|
||||
float3 c = in.image.sample(in.smp, uv).rgb;
|
||||
float luma = pow(dot(c, float3(0.299, 0.587, 0.114)), in.p.contrast);
|
||||
float3 ramp = 0.5 + 0.5 * cos(6.2832 * (luma * 0.8 + in.p.palette + float3(0.55, 0.4, 0.2)));
|
||||
float3 mapped = ramp * (0.15 + 0.85 * luma);
|
||||
return float4(mix(c, mapped, in.p.amount), 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue