Revision: 4139 Author: hans URL: http://bknr.net/trac/changeset/4139
checkpoint again. will i ever make this work? U trunk/projects/quickhoney/src/pixel-pdf.lisp
Modified: trunk/projects/quickhoney/src/pixel-pdf.lisp =================================================================== --- trunk/projects/quickhoney/src/pixel-pdf.lisp 2008-12-17 23:46:09 UTC (rev 4138) +++ trunk/projects/quickhoney/src/pixel-pdf.lisp 2008-12-18 00:09:18 UTC (rev 4139) @@ -39,8 +39,7 @@ (< -1 y (height *converter*))))
(defun same-color (x y) - (when (and (in-range x y) - (not (aref (seen *converter*) x y))) + (when (in-range x y) (eql (color *converter*) (aref (pixels *converter*) x y))))
(defun look (direction fn) @@ -109,36 +108,45 @@
(defun forward () (turtle:forward) - (setf (aref (seen *converter*) (x *converter*) (y *converter*)) t) + (look :forward (lambda (x y) (setf (x *converter*) x - (y *converter*) y)))) + (y *converter*) y + (aref (seen *converter*) x y) t))))
(defun set-color (color) - (setf (color *converter*) color) (format t "can't set PDF color ~A yet~%" color))
(defun fill-from (from-x from-y) ;; XXX true-color-behandlung fehlt. (format t "filling at ~A/~A~%" from-x from-y) - (setf (aref (seen *converter*) from-x from-y) t) - (set-color (aref (pixels *converter*) from-x from-y)) + (setf (aref (seen *converter*) from-x from-y) t + (looking-in-direction *converter*) :east + (x *converter*) from-x + (y *converter*) from-y + (color *converter*) (aref (pixels *converter*) from-x from-y)) + (set-color (color *converter*)) (turtle:move-to from-x from-y) (turtle:pen-down) + (turtle:forward) (do ((moved nil t)) ((and moved (eql from-x (turtle:x)) (eql from-y (turtle:y)))) (cond ((can-turn-right) + (format t " RIGHT~%") (turn :right) (forward)) ((can-go-forward) + (format t " FORWARD~%") (forward)) (t + (format t " LEFT~%") (turn :left) (turtle:forward))) - (princ turtle::*turtle*)) + (princ turtle::*turtle*) + (terpri)) (turtle:pen-up))
(defun pixels-pdf (image-pathname)