# HG changeset patch # User Robert McIntyre # Date 1282271081 14400 # Node ID 163bf9b2fd1303647d1a42edd712111838233b39 initial import diff -r 000000000000 -r 163bf9b2fd13 lib/OpenCV.jar Binary file lib/OpenCV.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/clojure-contrib-src.jar Binary file lib/clojure-contrib-src.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/clojure-contrib.jar Binary file lib/clojure-contrib.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/clojure-sources.jar Binary file lib/clojure-sources.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/clojure.jar Binary file lib/clojure.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/commons-cli.jar Binary file lib/commons-cli.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/commons-exec-1.0.1.jar Binary file lib/commons-exec-1.0.1.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/commons-io-1.4.jar Binary file lib/commons-io-1.4.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/commons-logging-1.1.jar Binary file lib/commons-logging-1.1.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/core.jar Binary file lib/core.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/edu.mit.jwi_2.1.5_jdk.jar Binary file lib/edu.mit.jwi_2.1.5_jdk.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/ffmpeg-java.jar Binary file lib/ffmpeg-java.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/genesis_clojure.jar Binary file lib/genesis_clojure.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/icollections.jar Binary file lib/icollections.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/ij.jar Binary file lib/ij.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/jai_core.jar Binary file lib/jai_core.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/javacup_11a_beta-kab_mods-with-JLex_1_2_6.jar Binary file lib/javacup_11a_beta-kab_mods-with-JLex_1_2_6.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/javacv.jar Binary file lib/javacv.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/jgraph.jar Binary file lib/jgraph.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/jmf.jar Binary file lib/jmf.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/jna.jar Binary file lib/jna.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/junit.jar Binary file lib/junit.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/logback-classic.jar Binary file lib/logback-classic.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/logback-core.jar Binary file lib/logback-core.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/nailgun-0.7.1.jar Binary file lib/nailgun-0.7.1.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/sisc.jar Binary file lib/sisc.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/slf4j-api.jar Binary file lib/slf4j-api.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/stanford-parser-2007-08-19.jar Binary file lib/stanford-parser-2007-08-19.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/swank-clojure.jar Binary file lib/swank-clojure.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/twitter4j-core-2.1.2.jar Binary file lib/twitter4j-core-2.1.2.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/ws-commons-util-1.0.2.jar Binary file lib/ws-commons-util-1.0.2.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xmlrpc-client-3.1-sources.jar Binary file lib/xmlrpc-client-3.1-sources.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xmlrpc-client-3.1.jar Binary file lib/xmlrpc-client-3.1.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xmlrpc-common-3.1-sources.jar Binary file lib/xmlrpc-common-3.1-sources.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xmlrpc-common-3.1.jar Binary file lib/xmlrpc-common-3.1.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xmlrpc-server-3.1-sources.jar Binary file lib/xmlrpc-server-3.1-sources.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xmlrpc-server-3.1.jar Binary file lib/xmlrpc-server-3.1.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xstream-1.2.2.jar Binary file lib/xstream-1.2.2.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xuggle-xuggler-test.jar Binary file lib/xuggle-xuggler-test.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/xuggle-xuggler.jar Binary file lib/xuggle-xuggler.jar has changed diff -r 000000000000 -r 163bf9b2fd13 lib/yamlbeans-1.0.jar Binary file lib/yamlbeans-1.0.jar has changed diff -r 000000000000 -r 163bf9b2fd13 slime-port.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slime-port.txt Thu Aug 19 22:24:41 2010 -0400 @@ -0,0 +1,1 @@ +4005 diff -r 000000000000 -r 163bf9b2fd13 src/laser/rasterize.clj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/laser/rasterize.clj Thu Aug 19 22:24:41 2010 -0400 @@ -0,0 +1,65 @@ +(ns laser.rasterize) + +(import '(java.io File)) +(import '(org.apache.commons.io FileUtils)) +(import '(javax.imageio ImageIO) ) +(import '(javax.swing JFrame)) +(import '(java.awt Color BorderLayout)) +(import '(ij ImagePlus IJ)) +(import '(java.lang Math)) + +(import '(ij Macro)) + +(import '(java.io BufferedReader InputStreamReader)) +(import '(java.awt.image BufferedImage)) + +(use 'clojure.contrib.str-utils) + +(use 'clojure.contrib.combinatorics) + + +(use 'clojure.contrib.repl-utils) + +(set! *print-length* 20) + + +(def img "/home/r/graster/test.png") + +(defn frame-hash + "yields a convienent representation for the pixles in an image. + Because of the size of the structvre generated, this must only be used + in a transient way so that java can do it's garbage collection." + [#^java.lang.String image-name] + (let [image+ (ImagePlus. image-name)] + (with-meta + (let [buf (.. image+ getBufferedImage) + color (.getColorModel buf)] + (apply hash-map + (interleave + (doall (for [x (range (.getWidth image+)) y (range (.getHeight image+))] + (vector x y))) + (doall (for [x (range (.getWidth image+)) y (range (.getHeight image+))] + (let [data (.getRGB buf x y)] + (hash-map :r (bit-shift-right (bit-and 0xff0000 data) 16) + :g (bit-shift-right (bit-and 0x00ff00 data) 8) + :b (bit-and 0x0000ff data)))))))) + {:width (.getWidth image+) :height (.getHeight image+)}))) + + +(defn frame-hash->bufferedImage + [frame-hash] + (let [data (meta frame-hash) + image (BufferedImage. (:width data) (:height data) BufferedImage/TYPE_INT_BGR)] + + (doall (for [element frame-hash] + (let [coord (key element) + rgb (val element) + packed-RGB + (+ (bit-shift-left (:r rgb) 16) + (bit-shift-left (:g rgb) 8) + (:b rgb))] + (.setRGB image (first coord) (last coord) packed-RGB)))) + image)) + + + diff -r 000000000000 -r 163bf9b2fd13 swank-laser --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/swank-laser Thu Aug 19 22:24:41 2010 -0400 @@ -0,0 +1,6 @@ +":";exec java -verbose:gc -Xmn700M -Xms1g -Xmx1g -cp $HOME/lasercutter/src:$HOME/lasercutter/lib/* clojure.main $0 $*; + +(do + (require 'swank.swank) +; (use :reload-all ['mobius :only ['switch-mobius]]) + (swank.swank/start-repl 4005))