-
Notifications
You must be signed in to change notification settings - Fork 14
/
pretty-pictures.lisp
30 lines (27 loc) · 1.05 KB
/
pretty-pictures.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(in-package :academy)
(defmacro %create-demo-images (&rest calls)
`(progn
,@(loop for call in calls
collect `(let ((*save-drawing-name*
,(format nil "~{~(~A~)~^-~}" (ensure-list call))))
,(ensure-list call)))))
(defun life-comic (&key (width 32) (height 32) (columns 11) (pattern "dh121") (scale 1))
(let ((*bitmap* (with-comic-strip (:action identity :columns columns :width width :height height)
(life :steps (* columns columns) :size width :pattern pattern)))
(*image-save-scale* scale))
(draw *bitmap*)))
(defun create-demo-images ()
(let ((*image-save-directory* "demo-images")
(*image-save-directory-overwrite* t)
(*image-save-inverse* t))
(%create-demo-images
;; bullseye
(bullseye :size 320)
(bullseye :size 320 :filled t)
;; moiré
(moiré :size 320 :offset 32)
;; sunbeam
(sunbeam :size 320)
(sunbeam :size 320 :step 3)
;; life
(life-comic :width 32 :height 32 :columns 11 :pattern "dh121"))))