- Add stream_sexp_generic.py: fully generic sexp interpreter - Add streaming primitives for video sources and audio analysis - Add config system for external sources and audio files - Add templates for reusable scans and macros - Fix video/audio stream mapping in file output - Add dynamic source cycling based on sources array length - Remove old Python effect files (migrated to sexp) - Update sexp effects to use namespaced primitives Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 lines
728 B
Common Lisp
20 lines
728 B
Common Lisp
;; Film Grain effect - adds film grain texture
|
|
(require-primitives "core")
|
|
|
|
(define-effect film_grain
|
|
:params (
|
|
(intensity :type float :default 0.2 :range [0 1])
|
|
(colored :type bool :default false)
|
|
)
|
|
(let ((grain-amount (* intensity 50)))
|
|
(map-pixels frame
|
|
(lambda (x y c)
|
|
(if colored
|
|
(rgb (clamp (+ (red c) (gaussian 0 grain-amount)) 0 255)
|
|
(clamp (+ (green c) (gaussian 0 grain-amount)) 0 255)
|
|
(clamp (+ (blue c) (gaussian 0 grain-amount)) 0 255))
|
|
(let ((n (gaussian 0 grain-amount)))
|
|
(rgb (clamp (+ (red c) n) 0 255)
|
|
(clamp (+ (green c) n) 0 255)
|
|
(clamp (+ (blue c) n) 0 255))))))))
|