All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m28s
- Add JAX text rendering with font atlas, styled text placement, and typography primitives - Add xector (element-wise/reduction) operations library and sexp effects - Add deferred effect chain fusion for JIT-compiled effect pipelines - Expand drawing primitives with font management, alignment, shadow, and outline - Add interpreter support for function-style define and require - Add GPU persistence mode and hardware decode support to streaming - Add new sexp effects: cell_pattern, halftone, mosaic, and derived definitions - Add path registry for asset resolution - Add integration, primitives, and xector tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
959 B
Common Lisp
25 lines
959 B
Common Lisp
;; Outline effect - shows only edges
|
|
(require-primitives "image")
|
|
|
|
(define-effect outline
|
|
:params (
|
|
(thickness :type int :default 2 :range [1 10])
|
|
(threshold :type int :default 100 :range [20 300])
|
|
(color :type list :default (list 0 0 0))
|
|
(fill_mode :type string :default "original")
|
|
)
|
|
(let* ((edge-img (image:edge-detect frame (/ threshold 2) threshold))
|
|
(dilated (if (> thickness 1)
|
|
(dilate edge-img thickness)
|
|
edge-img))
|
|
(base (cond
|
|
((= fill_mode "original") (copy frame))
|
|
((= fill_mode "white") (make-image (image:width frame) (image:height frame) (list 255 255 255)))
|
|
(else (make-image (image:width frame) (image:height frame) (list 0 0 0))))))
|
|
(map-pixels base
|
|
(lambda (x y c)
|
|
(let ((edge-val (luminance (pixel dilated x y))))
|
|
(if (> edge-val 128)
|
|
color
|
|
c))))))
|