Update of /project/cello/cvsroot/cello/cl-magick In directory clnet:/tmp/cvs-serv21180
Modified Files: wand-image.lisp Log Message: Changed: Re-arranged class definition code (beautifying only).
--- /project/cello/cvsroot/cello/cl-magick/wand-image.lisp 2006/08/22 16:12:35 1.5 +++ /project/cello/cvsroot/cello/cl-magick/wand-image.lisp 2006/08/28 18:42:26 1.6 @@ -23,12 +23,11 @@ (in-package :cl-magick)
(defclass wand-image () - ((direction :initarg :direction :initform :input :accessor direction) - (file-path$ :initarg :file-path$ :accessor file-path$ :initform nil) - (mgk-wand :initarg :mgk-wand :accessor mgk-wand :initform nil) - (image-size :initarg :image-size :accessor image-size :initform nil) - (tile-p :initarg :tile-p :accessor tile-p :initform t) - )) + ((direction :initarg :direction :initform :input :accessor direction) + (file-path$ :initarg :file-path$ :initform nil :accessor file-path$) + (mgk-wand :initarg :mgk-wand :initform nil :accessor mgk-wand) + (image-size :initarg :image-size :initform nil :accessor image-size) + (tile-p :initarg :tile-p :initform t :accessor tile-p)))
(defmethod initialize-instance :after ((self wand-image) &key) (ecase (direction self) @@ -47,7 +46,7 @@ "Image file ~a not found initializing wand" (file-path$ self)) (assert (not (mgk-wand self))) ;; make sure not leaking (setf (mgk-wand self) (path-to-wand (file-path$ self))) - ;(mgk-wand-dump (mgk-wand self) (file-path$ self)) + ;;(mgk-wand-dump (mgk-wand self) (file-path$ self)) (when (and (mgk-wand self) (not (image-size self))) (setf (image-size self) (cons (magick-get-image-width (mgk-wand self)) @@ -79,9 +78,11 @@ (fgn-alloc :unsigned-long 1 :ignore))
(defun wand-image-size (wand) - (magick-get-size wand *mgk-columns* *mgk-rows*) + (magick-get-size wand + *mgk-columns* + *mgk-rows*) (cons (ff-elt *mgk-columns* :unsigned-long 0) - (ff-elt *mgk-rows* :unsigned-long 0))) + (ff-elt *mgk-rows* :unsigned-long 0)))
(defun wand-get-image-pixels (wand &optional (first-col 0) (first-row 0) @@ -99,15 +100,10 @@ (rows (- last-row first-row)) (pixels (fgn-alloc :unsigned-char (* 3 columns rows) :wand-image)))
- ;(print (list "wand-get-image-pixels got" wand (* 3 columns rows) pixels)) - (cells:trc nil "image format" wand (magick-get-image-format wand)) + ;;(print (list "wand-get-image-pixels got" wand (* 3 columns rows) pixels)) ;; frgo: debug ... + ;;(cells:trc "image format" wand (magick-get-image-format wand)) ;; frgo:debug... (magick-get-image-pixels wand first-col first-row columns rows "RGB" 0 pixels ) - #+testing (progn - (incf testn) - (print `(writeimage ,(magick-write-image wand (format nil "C:\TEST~a.JPG" testn)))) - (print `(writeimage ,(magick-write-image wand (format nil "C:\TEST~a.GIF" testn)))) - #+not (print `(writeimage ,(magick-write-image wand "C:\TEST.BMP")))) - + ;;(print `(writeimage ,(magick-write-image wand "/tmp/wand-image-test.jpg"))) #+jesfoolinaround(loop for row below 16 do (loop for col below 16 by 1 for offset = (+ (* row columns 3) (* col 3))