Changeset 2847
- Timestamp:
- 04/01/08 18:15:58 (8 months ago)
- Files:
-
- trunk/projects/bos/tmp/contract-image-test.lisp (modified) (2 diffs)
- trunk/projects/bos/web/contract-tree.lisp (added)
- trunk/projects/bos/web/image-tree.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/projects/bos/tmp/contract-image-test.lisp
r2846 r2847 20 20 21 21 (hunchentoot:define-easy-handler (ci :uri "/ci") 22 ((step :init-form 1 :parameter-type 'integer)) 23 (let ((rectangle '(6666 5467 700 500))) 22 ((step :init-form "1" :parameter-type 'string)) 23 (let ((rectangle '(6666 5467 571 426)) 24 (step (read-from-string step))) 24 25 (geometry:with-rectangle rectangle 25 26 (with-image (image width height t) … … 28 29 (do-rows (y) 29 30 (do-pixels-in-row (x) 30 (let* ((m2 (get-m2 (+ left (* step (floor x step))) (+ top (* step (floor y step))))) 31 (let* ((m2 (get-m2 (+ left (round (* step (floor x step)))) 32 (+ top (round (* step (floor y step)))))) 31 33 (contract (and m2 (m2-contract m2)))) 32 34 (when (and contract (contract-paidp contract)) 33 35 (setf (raw-pixel) (apply #'colorize-pixel (raw-pixel) (contract-color contract))))))) 34 36 (emit-image-to-browser image :png)))))) 37 38 (hunchentoot:define-easy-handler (ci2 :uri "/ci2") 39 ((size :init-form 256 :parameter-type 'integer) 40 (pixelize :init-form 1 :parameter-type 'integer)) 41 (let ((rectangle '(6666 5467 571 426)) ) 42 (geometry:with-rectangle rectangle 43 (let ((step (float (/ (max height width) size)))) 44 (with-image (image size size t) 45 (with-default-image (image) 46 (fill-image 0 0 :color (find-color 255 255 255)) 47 (do-rows (y) 48 (do-pixels-in-row (x) 49 (let* ((m2 (get-m2 (+ left (round (* step (* pixelize (floor x pixelize))))) 50 (+ top (round (* step (* pixelize (floor y pixelize))))))) 51 (contract (and m2 (m2-contract m2)))) 52 (when (and contract (contract-paidp contract)) 53 (setf (raw-pixel) (apply #'colorize-pixel (raw-pixel) (contract-color contract))))))) 54 (emit-image-to-browser image :png))))))) 35 55 36 56 trunk/projects/bos/web/image-tree.lisp
r2800 r2847 596 596 597 597 598 599 598 (defclass image-tree-kml-handler (object-handler) 600 599 ()
