Mercurial > vba-clojure
comparison clojure/com/aurellem/run/final_cut.clj @ 531:c6ad363e36f7
trying to find out map problem.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 24 Jun 2012 17:18:22 -0500 |
parents | 8d3177d19d5f |
children | a3bdff5554ad |
comparison
equal
deleted
inserted
replaced
530:8d3177d19d5f | 531:c6ad363e36f7 |
---|---|
47 (.cleanup wave-writer))) | 47 (.cleanup wave-writer))) |
48 ([initial-state moves] | 48 ([initial-state moves] |
49 (render-files! render-dir initial-state moves)) | 49 (render-files! render-dir initial-state moves)) |
50 ([moves] | 50 ([moves] |
51 (render-files! (root) moves))) | 51 (render-files! (root) moves))) |
52 | |
53 | 52 |
53 (defn file-names [#^File dir] | |
54 (mapv #(.getCanonicalPath %) (next (sort (file-seq dir))))) | |
55 | |
56 (defn composite-frames-command | |
57 [screenshot ram-map target] | |
58 ["convert" | |
59 "-size" "318x276" "xc:white" | |
60 screenshot "-geometry" "+10+10" "-composite" | |
61 ram-map "-geometry" "+180+10" "-composite" | |
62 target]) | |
63 | |
64 (defn generate-composite-frames! | |
65 ([^File rendered-dir] | |
66 (let [final-frames (File. rendered-dir "final") | |
67 _ (.mkdir final-frames) | |
68 screenshots (file-names (File. rendered-dir "frames")) | |
69 ram-maps (file-names (File. rendered-dir "ram-map")) | |
70 targets (map #(File. final-frames (format "%07d.png")) | |
71 (range (count screenshots)))] | |
72 (dorun | |
73 (map | |
74 ;; (comp ;;clojure.java.shell/sh | |
75 ;; println | |
76 ;; flatten | |
77 composite-frames-command | |
78 screenshots ram-maps targets)) | |
79 | |
80 )) | |
81 ([] (generate-composite-frames! render-dir))) | |
82 | |
83 | |
84 | |
85 |