A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
25
Task/Image-convolution/PicoLisp/image-convolution.l
Normal file
25
Task/Image-convolution/PicoLisp/image-convolution.l
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(scl 3)
|
||||
|
||||
(de ppmConvolution (Ppm Kernel)
|
||||
(let (Len (length (car Kernel)) Radius (/ Len 2))
|
||||
(make
|
||||
(chain (head Radius Ppm))
|
||||
(for (Y Ppm T (cdr Y))
|
||||
(NIL (nth Y Len)
|
||||
(chain (tail Radius Y)) )
|
||||
(link
|
||||
(make
|
||||
(chain (head Radius (get Y (inc Radius))))
|
||||
(for (X (head Len Y) T)
|
||||
(NIL (nth X 1 Len)
|
||||
(chain (tail Radius (get X (inc Radius)))) )
|
||||
(link
|
||||
(make
|
||||
(for C 3
|
||||
(let Val 0
|
||||
(for K Len
|
||||
(for L Len
|
||||
(inc 'Val
|
||||
(* (get X K L C) (get Kernel K L)) ) ) )
|
||||
(link (min 255 (max 0 (*/ Val 1.0)))) ) ) ) )
|
||||
(map pop X) ) ) ) ) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue