Initial commit: video effects processing system
Add S-expression based video effects pipeline with modular effect definitions, constructs, and recipe files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
21
sexp_effects/effects/vignette.sexp
Normal file
21
sexp_effects/effects/vignette.sexp
Normal file
@@ -0,0 +1,21 @@
|
||||
;; Vignette effect - darkens corners
|
||||
;; @param strength float [0, 1] default 0.5
|
||||
;; @param radius float [0.5, 2] default 1
|
||||
|
||||
(define-effect vignette
|
||||
((strength 0.5) (radius 1))
|
||||
(let* ((w (width frame))
|
||||
(h (height frame))
|
||||
(cx (/ w 2))
|
||||
(cy (/ h 2))
|
||||
(max-dist (* (sqrt (+ (* cx cx) (* cy cy))) radius)))
|
||||
(map-pixels frame
|
||||
(lambda (x y c)
|
||||
(let* ((dx (- x cx))
|
||||
(dy (- y cy))
|
||||
(dist (sqrt (+ (* dx dx) (* dy dy))))
|
||||
(factor (- 1 (* (/ dist max-dist) strength)))
|
||||
(factor (clamp factor 0 1)))
|
||||
(rgb (* (red c) factor)
|
||||
(* (green c) factor)
|
||||
(* (blue c) factor)))))))
|
||||
Reference in New Issue
Block a user