Mercurial > cortex
comparison org/test-creature.org @ 120:83e638955e89
fixed bug in retina-sensor-image
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 21 Jan 2012 09:30:47 -0700 |
parents | ebfd62779ab4 |
children | 05e60a0ed043 |
comparison
equal
deleted
inserted
replaced
119:ebfd62779ab4 | 120:83e638955e89 |
---|---|
642 (if-let [eye-map (meta-data eye "eye")] | 642 (if-let [eye-map (meta-data eye "eye")] |
643 (map-vals | 643 (map-vals |
644 #(ImageToAwt/convert | 644 #(ImageToAwt/convert |
645 (.getImage (.loadTexture (asset-manager) %)) | 645 (.getImage (.loadTexture (asset-manager) %)) |
646 false false 0) | 646 false false 0) |
647 (read-string | 647 (eval (read-string eye-map))))) |
648 eye-map)))) | |
649 | 648 |
650 (defn eye-dimensions | 649 (defn eye-dimensions |
651 "returns the width and height specified in the metadata of the eye" | 650 "returns the width and height specified in the metadata of the eye" |
652 [#^Spatial eye] | 651 [#^Spatial eye] |
653 (let [dimensions | 652 (let [dimensions |
788 (fn [] | 787 (fn [] |
789 (vector | 788 (vector |
790 topology | 789 topology |
791 (vec | 790 (vec |
792 (for [[x y] whites] | 791 (for [[x y] whites] |
793 (bit-xor | 792 (bit-and |
794 mask (.getRGB @vision-image x y)))))))) | 793 mask (.getRGB @vision-image x y)))))))) |
795 retinal-map)) | 794 retinal-map)) |
796 ])) | 795 ])) |
797 | 796 |
798 (defn vision | 797 (defn vision |