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>
18 lines
652 B
Common Lisp
18 lines
652 B
Common Lisp
;; Echo effect - motion trails using frame buffer
|
|
;; @param num_echoes int [1, 20] default 4
|
|
;; @param decay float [0, 1] default 0.5
|
|
|
|
(define-effect echo
|
|
((num_echoes 4) (decay 0.5))
|
|
(let* ((buffer (state-get 'buffer (list)))
|
|
(new-buffer (take (cons frame buffer) (+ num_echoes 1))))
|
|
(begin
|
|
(state-set 'buffer new-buffer)
|
|
;; Blend frames with decay
|
|
(if (< (length new-buffer) 2)
|
|
frame
|
|
(let ((result (copy frame)))
|
|
;; Simple blend of first two frames for now
|
|
;; Full version would fold over all frames
|
|
(blend-images frame (nth new-buffer 1) (* decay 0.5)))))))
|