Mercurial > lasercutter
changeset 6:4ae2497acf7d
saving progress
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 20 Aug 2010 03:18:05 -0400 |
parents | 8cc418e04b87 |
children | 5e167f275a93 |
files | src/laser/rasterize.clj |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/src/laser/rasterize.clj Fri Aug 20 01:47:28 2010 -0400 1.2 +++ b/src/laser/rasterize.clj Fri Aug 20 03:18:05 2010 -0400 1.3 @@ -115,10 +115,12 @@ 1.4 1.5 (defn filter-keys [fun m] 1.6 (select-keys m (filter fun (keys m)))) 1.7 + 1.8 (def filter-keys (preserve-meta filter-keys)) 1.9 1.10 (defn filter-vals [fun m] 1.11 (into {} (filter (comp fun val) m))) 1.12 + 1.13 (def filter-vals (preserve-meta filter-vals)) 1.14 1.15 (defn frame-hash->bufferedImage 1.16 @@ -140,6 +142,10 @@ 1.17 1.18 (defn- makePanel [image] (proxy [Panel] [] (paint [g] (.drawImage g image 0 0 nil)))) 1.19 1.20 +(defn select-row [x window] 1.21 + (filter-keys (comp (partial = x) first) window)) 1.22 + 1.23 + 1.24 1.25 (defmethod display 1.26 BufferedImage [image]