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>
14 lines
549 B
Common Lisp
14 lines
549 B
Common Lisp
;; Scanlines effect - VHS-style horizontal line shifting
|
|
;; @param amplitude float [0, 100] default 10
|
|
;; @param frequency float [1, 100] default 10
|
|
;; @param randomness float [0, 1] default 0.5
|
|
|
|
(define-effect scanlines
|
|
((amplitude 10) (frequency 10) (randomness 0.5))
|
|
(map-rows frame
|
|
(lambda (y row)
|
|
(let* ((sine-shift (* amplitude (sin (/ (* y 6.28) (max 1 frequency)))))
|
|
(rand-shift (random (- amplitude) amplitude))
|
|
(shift (floor (lerp sine-shift rand-shift randomness))))
|
|
(roll row shift 0)))))
|