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