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:
31
sexp_effects/effects/mirror.sexp
Normal file
31
sexp_effects/effects/mirror.sexp
Normal file
@@ -0,0 +1,31 @@
|
||||
;; Mirror effect - mirrors half of image
|
||||
;; @param mode string default "left_right"
|
||||
|
||||
(define-effect mirror
|
||||
((mode "left_right"))
|
||||
(let* ((w (width frame))
|
||||
(h (height frame))
|
||||
(hw (floor (/ w 2)))
|
||||
(hh (floor (/ h 2))))
|
||||
(cond
|
||||
((= mode "left_right")
|
||||
(let ((left (crop frame 0 0 hw h))
|
||||
(result (copy frame)))
|
||||
(paste result (flip-h left) hw 0)))
|
||||
|
||||
((= mode "right_left")
|
||||
(let ((right (crop frame hw 0 hw h))
|
||||
(result (copy frame)))
|
||||
(paste result (flip-h right) 0 0)))
|
||||
|
||||
((= mode "top_bottom")
|
||||
(let ((top (crop frame 0 0 w hh))
|
||||
(result (copy frame)))
|
||||
(paste result (flip-v top) 0 hh)))
|
||||
|
||||
((= mode "bottom_top")
|
||||
(let ((bottom (crop frame 0 hh w hh))
|
||||
(result (copy frame)))
|
||||
(paste result (flip-v bottom) 0 0)))
|
||||
|
||||
(else frame))))
|
||||
Reference in New Issue
Block a user