Files
test/sexp_effects/effects/echo.sexp
gilesb 406cc7c0c7 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>
2026-01-19 12:34:45 +00:00

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)))))))