Update of /project/imago/cvsroot/imago/src
In directory common-lisp.net:/tmp/cvs-serv4543
Modified Files:
file-png.lisp file-pnm.lisp file-tga.lisp imago.asd
package.lisp
Added Files:
file.lisp
Log Message:
Added generic image file reader
Date: Thu Jan 6 23:41:42 2005
Author: mvilleneuve
Index: imago/src/file-png.lisp
diff -u imago/src/file-png.lisp:1.4 imago/src/file-png.lisp:1.5
--- imago/src/file-png.lisp:1.4 Mon Jan 3 21:56:02 2005
+++ imago/src/file-png.lisp Thu Jan 6 23:41:42 2005
@@ -194,6 +194,9 @@
((<= pb pc) b)
(t c))))
+(register-image-reader '("png" "PNG") #'read-png)
+
+
(defun write-png (image filespec)
(with-open-file (stream filespec :direction :output :if-exists :supersede
:element-type '(unsigned-byte 8))
Index: imago/src/file-pnm.lisp
diff -u imago/src/file-pnm.lisp:1.2 imago/src/file-pnm.lisp:1.3
--- imago/src/file-pnm.lisp:1.2 Mon Jan 3 21:56:02 2005
+++ imago/src/file-pnm.lisp Thu Jan 6 23:41:42 2005
@@ -79,6 +79,9 @@
(skip-line stream)
(values width height max-value)))
+(register-image-reader '("pnm" "PNM" "ppm" "PPM" "pgm" "PGM") #'read-pnm)
+
+
(defun write-pnm (image filespec output-format)
"Writes the image data to a file in PNM format.
OUTPUT-FORMAT can be either :ASCII or :BINARY."
Index: imago/src/file-tga.lisp
diff -u imago/src/file-tga.lisp:1.2 imago/src/file-tga.lisp:1.3
--- imago/src/file-tga.lisp:1.2 Mon Jan 3 21:56:02 2005
+++ imago/src/file-tga.lisp Thu Jan 6 23:41:42 2005
@@ -89,6 +89,9 @@
do (setf (image-pixel image x y)
(funcall reader stream bpp)))))
+(register-image-reader '("tga" "TGA") #'read-tga)
+
+
(defun write-tga (image filespec &key (top-down-p nil))
(with-open-file (stream filespec :direction :output :if-exists :supersede
:element-type '(unsigned-byte 8))
Index: imago/src/imago.asd
diff -u imago/src/imago.asd:1.2 imago/src/imago.asd:1.3
--- imago/src/imago.asd:1.2 Mon Jan 3 21:56:02 2005
+++ imago/src/imago.asd Thu Jan 6 23:41:42 2005
@@ -29,6 +29,7 @@
(:file "convolve" :depends-on ("image" "color"))
(:file "compose" :depends-on ("image" "color"))
(:file "operations" :depends-on ("image" "color"))
- (:file "file-png" :depends-on ("image" "color" "crc32"))
- (:file "file-pnm" :depends-on ("image" "color"))
- (:file "file-tga" :depends-on ("image" "color"))))
+ (:file "file" :depends-on ("package"))
+ (:file "file-png" :depends-on ("image" "color" "crc32" "file"))
+ (:file "file-pnm" :depends-on ("image" "color" "file"))
+ (:file "file-tga" :depends-on ("image" "color" "file"))))
Index: imago/src/package.lisp
diff -u imago/src/package.lisp:1.5 imago/src/package.lisp:1.6
--- imago/src/package.lisp:1.5 Wed Jan 5 22:11:10 2005
+++ imago/src/package.lisp Thu Jan 6 23:41:42 2005
@@ -32,6 +32,7 @@
#:make-gray
#:gray-intensity #:gray-alpha
#:invert-gray
+
#:+white+ #:+black+
#:+red+ #:+green+ #:+blue+
#:+cyan+ #:+magenta+ #:+yellow+
@@ -50,6 +51,9 @@
#:blur #:sharpen #:edge-detect #:emboss
#:compose
+
+ #:read-image
+ #:register-image-reader
#:read-png #:write-png
#:read-pnm #:write-pnm