From eweitz at common-lisp.net Sat Apr 24 00:29:27 2004 From: eweitz at common-lisp.net (Edi Weitz) Date: Fri, 23 Apr 2004 20:29:27 -0400 Subject: [cl-gd-cvs] CVS update: cl-gd/CHANGELOG cl-gd/README cl-gd/cl-gd-glue.c cl-gd/cl-gd-test.asd cl-gd/cl-gd-test.lisp cl-gd/cl-gd.asd cl-gd/colors-aux.lisp cl-gd/colors.lisp cl-gd/drawing.lisp cl-gd/gd-uffi.lisp cl-gd/images.lisp cl-gd/init.lisp cl-gd/misc.lisp cl-gd/packages.lisp cl-gd/specials.lisp cl-gd/strings.lisp cl-gd/transform.lisp cl-gd/util.lisp Message-ID: Update of /project/cl-gd/cvsroot/cl-gd In directory common-lisp.net:/tmp/cvs-serv14058 Modified Files: CHANGELOG README cl-gd-glue.c cl-gd-test.asd cl-gd-test.lisp cl-gd.asd colors-aux.lisp colors.lisp drawing.lisp gd-uffi.lisp images.lisp init.lisp misc.lisp packages.lisp specials.lisp strings.lisp transform.lisp util.lisp Log Message: pre-0.3.1 with hyperdoc support Date: Fri Apr 23 20:29:26 2004 Author: eweitz Index: cl-gd/CHANGELOG diff -u cl-gd/CHANGELOG:1.1.1.1 cl-gd/CHANGELOG:1.2 --- cl-gd/CHANGELOG:1.1.1.1 Tue Jan 6 20:02:32 2004 +++ cl-gd/CHANGELOG Fri Apr 23 20:29:25 2004 @@ -1,3 +1,13 @@ +Version 0.3.1 +????-??-?? +Added hyperdoc support +Added :CL-GD to *FEATURES* + +Version 0.3.0 +2004-03-29 +Added GIF support (thanks to Hans H?bner) +Added Gentoo link + Version 0.2.0 2003-10-26 Added DO-PIXELS and friends (proposed by Kevin Rosenberg) Index: cl-gd/README diff -u cl-gd/README:1.1.1.1 cl-gd/README:1.2 --- cl-gd/README:1.1.1.1 Tue Jan 6 20:02:29 2004 +++ cl-gd/README Fri Apr 23 20:29:25 2004 @@ -1,4 +1,9 @@ -Complete documentation for CL-GD can be found in the 'doc' directory. +Complete documentation for CL-GD can be found in the 'doc' +directory. Make sure to read it if you want GIF support! + +CL-GD also supports Nikodemus Siivola's HYPERDOC, see + and +. 1. Installation @@ -54,5 +59,5 @@ (cl-gd-test:test #p"/usr/X11R6/lib/X11/fonts/truetype/georgiab.ttf") -where you should obviously replace the path above with the pull path +where you should obviously replace the path above with the full path to the font on your machine. Index: cl-gd/cl-gd-glue.c diff -u cl-gd/cl-gd-glue.c:1.1.1.1 cl-gd/cl-gd-glue.c:1.2 --- cl-gd/cl-gd-glue.c:1.1.1.1 Tue Jan 6 20:02:32 2004 +++ cl-gd/cl-gd-glue.c Fri Apr 23 20:29:25 2004 @@ -45,6 +45,23 @@ return NULL; } +gdImagePtr gdImageCreateFromGifFile (char *filename, int *err) { + FILE *in; + gdImagePtr im; + + if (in = fopen(filename, "rb")) { + im = gdImageCreateFromGif(in); + if (im == NULL) { + *err = 0; + return NULL; + } + fclose(in); + return im; + } + *err = errno; + return NULL; +} + gdImagePtr gdImageCreateFromPngFile (char *filename, int *err) { FILE *in; gdImagePtr im; Index: cl-gd/cl-gd-test.asd diff -u cl-gd/cl-gd-test.asd:1.1.1.1 cl-gd/cl-gd-test.asd:1.2 --- cl-gd/cl-gd-test.asd:1.1.1.1 Tue Jan 6 20:02:28 2004 +++ cl-gd/cl-gd-test.asd Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.asd,v 1.1.1.1 2004/01/07 01:02:28 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.asd,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/cl-gd-test.lisp diff -u cl-gd/cl-gd-test.lisp:1.1.1.1 cl-gd/cl-gd-test.lisp:1.2 --- cl-gd/cl-gd-test.lisp:1.1.1.1 Tue Jan 6 20:02:36 2004 +++ cl-gd/cl-gd-test.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/cl-gd.asd diff -u cl-gd/cl-gd.asd:1.1.1.1 cl-gd/cl-gd.asd:1.2 --- cl-gd/cl-gd.asd:1.1.1.1 Tue Jan 6 20:02:37 2004 +++ cl-gd/cl-gd.asd Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd.asd,v 1.1.1.1 2004/01/07 01:02:37 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd.asd,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/colors-aux.lisp diff -u cl-gd/colors-aux.lisp:1.1.1.1 cl-gd/colors-aux.lisp:1.2 --- cl-gd/colors-aux.lisp:1.1.1.1 Tue Jan 6 20:02:29 2004 +++ cl-gd/colors-aux.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors-aux.lisp,v 1.1.1.1 2004/01/07 01:02:29 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors-aux.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/colors.lisp diff -u cl-gd/colors.lisp:1.1.1.1 cl-gd/colors.lisp:1.2 --- cl-gd/colors.lisp:1.1.1.1 Tue Jan 6 20:02:30 2004 +++ cl-gd/colors.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors.lisp,v 1.1.1.1 2004/01/07 01:02:30 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/drawing.lisp diff -u cl-gd/drawing.lisp:1.1.1.1 cl-gd/drawing.lisp:1.2 --- cl-gd/drawing.lisp:1.1.1.1 Tue Jan 6 20:02:36 2004 +++ cl-gd/drawing.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/drawing.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/drawing.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/gd-uffi.lisp diff -u cl-gd/gd-uffi.lisp:1.1.1.1 cl-gd/gd-uffi.lisp:1.2 --- cl-gd/gd-uffi.lisp:1.1.1.1 Tue Jan 6 20:02:34 2004 +++ cl-gd/gd-uffi.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/gd-uffi.lisp,v 1.1.1.1 2004/01/07 01:02:34 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/gd-uffi.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. @@ -174,12 +174,19 @@ :returning gd-image-ptr :module "gd") -#-win32 +#-:win32 (def-function ("gdImageCreateFromXpm" gd-image-create-from-xpm) ((filename :cstring)) :returning gd-image-ptr :module "gd") +#+:cl-gd-gif +(def-function ("gdImageCreateFromGifFile" gd-image-create-from-gif-file) + ((filename :cstring) + (err (* :int))) + :returning gd-image-ptr + :module "gd") + (def-function ("gdImageJpegPtr" gd-image-jpeg-ptr) ((im gd-image-ptr) (size (* :int)) @@ -216,6 +223,13 @@ ((im gd-image-ptr) (size (* :int)) (level :int)) + :returning :pointer-void + :module "gd") + +#+:cl-gd-gif +(def-function ("gdImageGifPtr" gd-image-gif-ptr) + ((im gd-image-ptr) + (size (* :int))) :returning :pointer-void :module "gd") Index: cl-gd/images.lisp diff -u cl-gd/images.lisp:1.1.1.1 cl-gd/images.lisp:1.2 --- cl-gd/images.lisp:1.1.1.1 Tue Jan 6 20:02:32 2004 +++ cl-gd/images.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/images.lisp,v 1.1.1.1 2004/01/07 01:02:32 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/images.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. @@ -99,9 +99,12 @@ :gd2) ((string-equal pathname-type "xbm") :xbm) - #-win32 + #-:win32 ((string-equal pathname-type "xpm") - :xpm))))) + :xpm) + #+:cl-gd-gif + ((string-equal pathname-type "gif") + :gif))))) (unless %type (error "No type provided and it couldn't be guessed from filename")) (unless (probe-file file-name) @@ -121,9 +124,12 @@ (gd-image-create-from-gd2-file c-file-name err)) ((:xbm) (gd-image-create-from-xbm-file c-file-name err)) - #-win32 + #-:win32 ((:xpm) - (gd-image-create-from-xpm c-file-name))))) + (gd-image-create-from-xpm c-file-name)) + #+:cl-gd-gif + ((:gif) + (gd-image-create-from-gif-file c-file-name err))))) (cond ((null-pointer-p image) (cond ((or (eq %type :xpm) (zerop (deref-pointer err :int))) @@ -209,9 +215,9 @@ `(defun ,name ,signature ,docstring , at type-checks - (cond ((or #+(and allegro allegro-version>= (version>= 6 0)) + (cond ((or #+(and :allegro :allegro-version>= (version>= 6 0)) (typep stream 'excl:simple-stream) - #+lispworks4.3 + #+:lispworks4.3 (subtypep (stream-element-type stream) 'base-char) (subtypep (stream-element-type stream) '(unsigned-byte 8))) (with-foreign-object (size :int) @@ -228,8 +234,8 @@ (let ((memory ,gd-call)) (unwind-protect (with-cast-pointer (temp memory - #+(or cmu scl sbcl) :unsigned-char - #-(or cmu scl sbcl) :char) + #+(or :cmu :scl :sbcl) :unsigned-char + #-(or :cmu :scl :sbcl) :char) (dotimes (i (deref-pointer size :int)) (write-char (ensure-char-character (deref-array temp '(:array :char) i)) @@ -271,6 +277,17 @@ the user of this function has to make sure the external format yields faithful output of all 8-bit characters.") +#+:cl-gd-gif +(make-stream-fn write-gif-to-stream (stream &key (image *default-image*)) + (gd-image-gif-ptr (img image) size) + ((check-type stream stream) + (check-type image image)) + "Writes image IMAGE to stream STREAM as GIF. STREAM +must be a character stream or a binary stream of element type +\(UNSIGNED-BYTE 8). If STREAM is a character stream, the user of this +function has to make sure the external format yields faithful output +of all 8-bit characters.") + (make-stream-fn write-wbmp-to-stream (stream &key foreground (image *default-image*)) (gd-image-wbmp-ptr (img image) size foreground) ((check-type stream stream) @@ -322,7 +339,10 @@ ((:gd) #'write-gd-to-stream) ((:gd2) - #'write-gd2-to-stream)) + #'write-gd2-to-stream) + #+:cl-gd-gif + ((:gif) + #'write-gif-to-stream)) stream rest)) (defun write-image-to-file (file-name &rest rest &key type (if-exists :error) &allow-other-keys) @@ -350,6 +370,9 @@ :gd) ((string-equal pathname-type "gd2") :gd2) + #+:cl-gd-gif + ((string-equal pathname-type "gif") + :gif) (t (error "Can't determine the type of the image"))))) (sans rest :type :if-exists)))) Index: cl-gd/init.lisp diff -u cl-gd/init.lisp:1.1.1.1 cl-gd/init.lisp:1.2 --- cl-gd/init.lisp:1.1.1.1 Tue Jan 6 20:02:32 2004 +++ cl-gd/init.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/init.lisp,v 1.1.1.1 2004/01/07 01:02:32 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/init.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/misc.lisp diff -u cl-gd/misc.lisp:1.1.1.1 cl-gd/misc.lisp:1.2 --- cl-gd/misc.lisp:1.1.1.1 Tue Jan 6 20:02:36 2004 +++ cl-gd/misc.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/misc.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/misc.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/packages.lisp diff -u cl-gd/packages.lisp:1.1.1.1 cl-gd/packages.lisp:1.2 --- cl-gd/packages.lisp:1.1.1.1 Tue Jan 6 20:02:29 2004 +++ cl-gd/packages.lisp Fri Apr 23 20:29:25 2004 @@ -24,6 +24,7 @@ #:write-wbmp-to-stream #:write-gd-to-stream #:write-gd2-to-stream + #+:cl-gd-gif #:write-gif-to-stream #:write-image-to-stream #:write-image-to-file #:image-width @@ -71,4 +72,6 @@ #:do-rows #:do-pixels-in-row #:do-pixels - #:raw-pixel)) \ No newline at end of file + #:raw-pixel)) + +(pushnew :cl-gd *features*) \ No newline at end of file Index: cl-gd/specials.lisp diff -u cl-gd/specials.lisp:1.1.1.1 cl-gd/specials.lisp:1.2 --- cl-gd/specials.lisp:1.1.1.1 Tue Jan 6 20:02:32 2004 +++ cl-gd/specials.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/specials.lisp,v 1.1.1.1 2004/01/07 01:02:32 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/specials.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. @@ -139,7 +139,7 @@ "The list of drive letters (used by Wintendo) used when looking for cl-gd-glue.so.") -(defvar *gd-supporting-libraries* '("gd" "png" "z" "jpeg" "freetype" "iconv" "m") +(defvar *gd-supporting-libraries* '("c" "gd" "png" "z" "jpeg" "freetype" "iconv" "m") "The libraries which are needed by cl-gd-glues.so \(and GD itself). Only needed for Python-based Lisps like CMUCL, SBCL, or SCL.") @@ -153,4 +153,22 @@ (defconstant +most-positive-unsigned-byte-32+ (1- (expt 2 31)) "Name says it all...") - \ No newline at end of file + +;; stuff for Nikodemus Siivola's HYPERDOC +;; see +;; and + +(defvar *hyperdoc-base-uri* "http://weitz.de/cl-gd/") + +(let ((exported-symbols-alist + (loop for symbol being the external-symbols of :cl-gd + collect (cons symbol + (concatenate 'string + "#" + (string-downcase symbol)))))) + (defun hyperdoc-lookup (symbol type) + (declare (ignore type)) + (cdr (assoc symbol + exported-symbols-alist + :test #'eq)))) + \ No newline at end of file Index: cl-gd/strings.lisp diff -u cl-gd/strings.lisp:1.1.1.1 cl-gd/strings.lisp:1.2 --- cl-gd/strings.lisp:1.1.1.1 Tue Jan 6 20:02:36 2004 +++ cl-gd/strings.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/strings.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/strings.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/transform.lisp diff -u cl-gd/transform.lisp:1.1.1.1 cl-gd/transform.lisp:1.2 --- cl-gd/transform.lisp:1.1.1.1 Tue Jan 6 20:02:37 2004 +++ cl-gd/transform.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/transform.lisp,v 1.1.1.1 2004/01/07 01:02:37 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/transform.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/util.lisp diff -u cl-gd/util.lisp:1.1.1.1 cl-gd/util.lisp:1.2 --- cl-gd/util.lisp:1.1.1.1 Tue Jan 6 20:02:36 2004 +++ cl-gd/util.lisp Fri Apr 23 20:29:25 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/util.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/util.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. From eweitz at common-lisp.net Sat Apr 24 00:29:27 2004 From: eweitz at common-lisp.net (Edi Weitz) Date: Fri, 23 Apr 2004 20:29:27 -0400 Subject: [cl-gd-cvs] CVS update: cl-gd/doc/index.html Message-ID: Update of /project/cl-gd/cvsroot/cl-gd/doc In directory common-lisp.net:/tmp/cvs-serv14058/doc Modified Files: index.html Log Message: pre-0.3.1 with hyperdoc support Date: Fri Apr 23 20:29:27 2004 Author: eweitz Index: cl-gd/doc/index.html diff -u cl-gd/doc/index.html:1.1.1.1 cl-gd/doc/index.html:1.2 --- cl-gd/doc/index.html:1.1.1.1 Tue Jan 6 20:02:43 2004 +++ cl-gd/doc/index.html Fri Apr 23 20:29:27 2004 @@ -82,7 +82,8 @@ about this. GD (and thus CL-GD) can't create GIF images due to the Unisys LZW patent. And for most examples it wouldn't make much sense to use -JPEGs instead. +JPEGs instead. (Update: But see the note below about +GIF support.)
 

Contents

    @@ -106,6 +107,7 @@
  • write-jpeg-to-stream
  • write-png-to-stream
  • write-wbmp-to-stream +
  • write-gif-to-stream
  • write-gd-to-stream
  • write-gd2-to-stream
  • write-image-to-stream @@ -186,7 +188,7 @@ CL-GD together with this documentation can be downloaded from http://weitz.de/files/cl-gd.tgz. The -current version is 0.2.0. A Debian package is available thanks to Kevin Rosenberg, so if you're on Debian you should have no problems installing CL-GD. There's also a port +current version is 0.3.0. A Debian package is available thanks to Kevin Rosenberg, so if you're on Debian you should have no problems installing CL-GD. There's also a port for Gentoo Linux thanks to Matthew Kennedy. Otherwise, proceed like this:
    • Download and install a recent version of asdf. @@ -224,6 +226,19 @@ where you should obviously replace the path above with the pull path to the font on your machine.

    +Note about GIF support: The original GD library doesn't support the GIF file format due to the patent Unisys holds +on the LZW compression algorithm. However, some distributions (notably +the FreeBSD port for non-US users) do include the ability to read and write GIF +files. Hans H?bner has patched CL-GD to use this ability. If you want +GIF support first make sure that you have a corresponding version of +GD installed and then +

    +(push :cl-gd-gif *features*)
    +
    +before you compile and load CL-GD. +

    Note to Windows users: I've heard that it's possible to compile and use GD with Cygwin. I haven't tried it myself but if you succeed in using CL-GD on Windows it'd be nice if you could send some notes so I can add them to this document. Thanks. Addendum: Jeff Caldwell notes that this website has good explanations about how to install GD and its supporting libraries.

    It is recommended that you at least skim over the original GD documentation before you start using CL-GD. @@ -270,6 +285,8 @@ as type (one of the keywords :JPG, :JPEG, :PNG, :GD, :GD2, :XBM, or :XPM), or otherwise it will be guessed from the PATHNAME-TYPE of file-name. You are responsible for destroying the image after you're done with it. It is advisable to use WITH-IMAGE-FROM-FILE instead. +

    +If you have built CL-GD with GIF support type can also be :GIF.


    [Function] @@ -427,6 +444,19 @@


    [Function] +
    write-gif-to-stream stream &key image => image + +


    +Writes image image to the stream +stream as a GIF file. stream must be a character stream or a binary +stream of element type (UNSIGNED-BYTE 8). If STREAM is a character +stream, the user of this function has to make sure the external format +yields faithful output of all 8-bit characters. CL-GD knows about AllegroCL's simple streams and the bivalent streams of LispWorks 4.3 and acts accordingly, i.e. it uses WRITE-BYTE instead of WRITE-CHAR whenever possible. +

    +This function is only available if you've managed to build CL-GD with GIF support. +

    + +


    [Function]
    write-gd2-to-stream stream &key image => image


    @@ -447,6 +477,8 @@ stream of element type (UNSIGNED-BYTE 8). If STREAM is a character stream, the user of this function has to make sure the external format yields faithful output of all 8-bit characters. CL-GD knows about AllegroCL's simple streams and the bivalent streams of LispWorks 4.3 and acts accordingly, i.e. it uses WRITE-BYTE instead of WRITE-CHAR whenever possible. +

    +If you have built CL-GD with GIF support type can also be :GIF.


    [Function] @@ -1339,9 +1371,10 @@ href="http://www.boutell.com/gd/">GD and thanks to Kevin Rosenberg for UFFI without which CL-GD would not have been possible. Kevin was also extremely helpful when I needed -functionality which wasn't yet part of UFFI. +functionality which wasn't yet part of UFFI. Thanks to Hans +Hübner for the GIF patches.

    -$Header: /project/cl-gd/cvsroot/cl-gd/doc/index.html,v 1.1.1.1 2004/01/07 01:02:43 eweitz Exp $ +$Header: /project/cl-gd/cvsroot/cl-gd/doc/index.html,v 1.2 2004/04/24 00:29:27 eweitz Exp $

    BACK TO MY HOMEPAGE From eweitz at common-lisp.net Sun Apr 25 20:34:04 2004 From: eweitz at common-lisp.net (Edi Weitz) Date: Sun, 25 Apr 2004 16:34:04 -0400 Subject: [cl-gd-cvs] CVS update: cl-gd/test/orig/zappa-ellipse.png Message-ID: Update of /project/cl-gd/cvsroot/cl-gd/test/orig In directory common-lisp.net:/tmp/cvs-serv28834/test/orig Modified Files: zappa-ellipse.png Log Message: pre-0.3.2 with bugfix for LW bivalent streams Date: Sun Apr 25 16:34:04 2004 Author: eweitz Index: cl-gd/test/orig/zappa-ellipse.png From eweitz at common-lisp.net Sun Apr 25 20:34:04 2004 From: eweitz at common-lisp.net (Edi Weitz) Date: Sun, 25 Apr 2004 16:34:04 -0400 Subject: [cl-gd-cvs] CVS update: cl-gd/cl-gd-glue-gif.c cl-gd/CHANGELOG cl-gd/README cl-gd/cl-gd-glue.c cl-gd/cl-gd-test.lisp cl-gd/colors-aux.lisp cl-gd/colors.lisp cl-gd/drawing.lisp cl-gd/gd-uffi.lisp cl-gd/images.lisp cl-gd/init.lisp cl-gd/misc.lisp cl-gd/specials.lisp cl-gd/strings.lisp cl-gd/transform.lisp cl-gd/util.lisp Message-ID: Update of /project/cl-gd/cvsroot/cl-gd In directory common-lisp.net:/tmp/cvs-serv28834 Modified Files: CHANGELOG README cl-gd-glue.c cl-gd-test.lisp colors-aux.lisp colors.lisp drawing.lisp gd-uffi.lisp images.lisp init.lisp misc.lisp specials.lisp strings.lisp transform.lisp util.lisp Added Files: cl-gd-glue-gif.c Log Message: pre-0.3.2 with bugfix for LW bivalent streams Date: Sun Apr 25 16:34:02 2004 Author: eweitz Index: cl-gd/CHANGELOG diff -u cl-gd/CHANGELOG:1.2 cl-gd/CHANGELOG:1.3 --- cl-gd/CHANGELOG:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/CHANGELOG Sun Apr 25 16:34:01 2004 @@ -1,5 +1,11 @@ -Version 0.3.1 +Version 0.3.2 ????-??-?? +Replaced WRITE-BYTE with WRITE-SEQUENCE for LispWorks - see + +Version 0.3.1 +2004-04-25 +Two separate C source files (with and without GIF support) +Added note about failed tests Added hyperdoc support Added :CL-GD to *FEATURES* Index: cl-gd/README diff -u cl-gd/README:1.2 cl-gd/README:1.3 --- cl-gd/README:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/README Sun Apr 25 16:34:01 2004 @@ -61,3 +61,5 @@ where you should obviously replace the path above with the full path to the font on your machine. + +(See the note about failed tests in the documentation.) \ No newline at end of file Index: cl-gd/cl-gd-glue.c diff -u cl-gd/cl-gd-glue.c:1.2 cl-gd/cl-gd-glue.c:1.3 --- cl-gd/cl-gd-glue.c:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/cl-gd-glue.c Sun Apr 25 16:34:01 2004 @@ -45,23 +45,6 @@ return NULL; } -gdImagePtr gdImageCreateFromGifFile (char *filename, int *err) { - FILE *in; - gdImagePtr im; - - if (in = fopen(filename, "rb")) { - im = gdImageCreateFromGif(in); - if (im == NULL) { - *err = 0; - return NULL; - } - fclose(in); - return im; - } - *err = errno; - return NULL; -} - gdImagePtr gdImageCreateFromPngFile (char *filename, int *err) { FILE *in; gdImagePtr im; Index: cl-gd/cl-gd-test.lisp diff -u cl-gd/cl-gd-test.lisp:1.2 cl-gd/cl-gd-test.lisp:1.3 --- cl-gd/cl-gd-test.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/cl-gd-test.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. @@ -225,7 +225,7 @@ (and (= +max-colors+ (number-of-colors)) (null (find-color 255 0 0 :exact t)) (let ((match (find-color 255 0 0))) ; green - (and (= 64 + (and (= 85 (color-component :red match) (color-component :green match) (color-component :blue match))))))) Index: cl-gd/colors-aux.lisp diff -u cl-gd/colors-aux.lisp:1.2 cl-gd/colors-aux.lisp:1.3 --- cl-gd/colors-aux.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/colors-aux.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors-aux.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors-aux.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/colors.lisp diff -u cl-gd/colors.lisp:1.2 cl-gd/colors.lisp:1.3 --- cl-gd/colors.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/colors.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/drawing.lisp diff -u cl-gd/drawing.lisp:1.2 cl-gd/drawing.lisp:1.3 --- cl-gd/drawing.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/drawing.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/drawing.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/drawing.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/gd-uffi.lisp diff -u cl-gd/gd-uffi.lisp:1.2 cl-gd/gd-uffi.lisp:1.3 --- cl-gd/gd-uffi.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/gd-uffi.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/gd-uffi.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/gd-uffi.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/images.lisp diff -u cl-gd/images.lisp:1.2 cl-gd/images.lisp:1.3 --- cl-gd/images.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/images.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/images.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/images.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. @@ -221,10 +221,20 @@ (subtypep (stream-element-type stream) 'base-char) (subtypep (stream-element-type stream) '(unsigned-byte 8))) (with-foreign-object (size :int) - (let ((memory ,gd-call)) + (let ((memory ,gd-call) + #+:lispworks4.3 (temp-array (make-array 1 :element-type + '(unsigned-byte 8)))) (unwind-protect (with-cast-pointer (temp memory :unsigned-byte) (dotimes (i (deref-pointer size :int)) + ;; LispWorks workaround, WRITE-BYTE won't work - see + ;; + #+:lispworks4.3 + (setf (aref temp-array 0) + (deref-array temp '(:array :unsigned-byte) i)) + #+:lispworks4.3 + (write-sequence temp-array stream) + #-:lispworks4.3 (write-byte (deref-array temp '(:array :unsigned-byte) i) stream)) image) @@ -254,7 +264,7 @@ QUALITY is not specified, the default IJG JPEG quality value is used. Otherwise, for practical purposes, quality should be a value in the range 0-95. STREAM must be a character stream or a binary stream -of element type (UNSIGNED-BYTE 8). If STREAM is a character stream, +of element type \(UNSIGNED-BYTE 8). If STREAM is a character stream, the user of this function has to make sure the external format is yields faithful output of all 8-bit characters.") Index: cl-gd/init.lisp diff -u cl-gd/init.lisp:1.2 cl-gd/init.lisp:1.3 --- cl-gd/init.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/init.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/init.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/init.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/misc.lisp diff -u cl-gd/misc.lisp:1.2 cl-gd/misc.lisp:1.3 --- cl-gd/misc.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/misc.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/misc.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/misc.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/specials.lisp diff -u cl-gd/specials.lisp:1.2 cl-gd/specials.lisp:1.3 --- cl-gd/specials.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/specials.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/specials.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/specials.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/strings.lisp diff -u cl-gd/strings.lisp:1.2 cl-gd/strings.lisp:1.3 --- cl-gd/strings.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/strings.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/strings.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/strings.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/transform.lisp diff -u cl-gd/transform.lisp:1.2 cl-gd/transform.lisp:1.3 --- cl-gd/transform.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/transform.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/transform.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/transform.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. Index: cl-gd/util.lisp diff -u cl-gd/util.lisp:1.2 cl-gd/util.lisp:1.3 --- cl-gd/util.lisp:1.2 Fri Apr 23 20:29:25 2004 +++ cl-gd/util.lisp Sun Apr 25 16:34:01 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*- -;;; $Header: /project/cl-gd/cvsroot/cl-gd/util.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $ +;;; $Header: /project/cl-gd/cvsroot/cl-gd/util.lisp,v 1.3 2004/04/25 20:34:01 eweitz Exp $ ;;; Copyright (c) 2003, Dr. Edmund Weitz. All rights reserved. From eweitz at common-lisp.net Sun Apr 25 20:34:04 2004 From: eweitz at common-lisp.net (Edi Weitz) Date: Sun, 25 Apr 2004 16:34:04 -0400 Subject: [cl-gd-cvs] CVS update: cl-gd/doc/index.html Message-ID: Update of /project/cl-gd/cvsroot/cl-gd/doc In directory common-lisp.net:/tmp/cvs-serv28834/doc Modified Files: index.html Log Message: pre-0.3.2 with bugfix for LW bivalent streams Date: Sun Apr 25 16:34:04 2004 Author: eweitz Index: cl-gd/doc/index.html diff -u cl-gd/doc/index.html:1.2 cl-gd/doc/index.html:1.3 --- cl-gd/doc/index.html:1.2 Fri Apr 23 20:29:27 2004 +++ cl-gd/doc/index.html Sun Apr 25 16:34:04 2004 @@ -188,7 +188,7 @@ CL-GD together with this documentation can be downloaded from http://weitz.de/files/cl-gd.tgz. The -current version is 0.3.0. A Debian package is available thanks to Kevin Rosenberg, so if you're on Debian you should have no problems installing CL-GD. There's also a port +current version is 0.3.1. A Debian package is available thanks to Kevin Rosenberg, so if you're on Debian you should have no problems installing CL-GD. There's also a port for Gentoo Linux thanks to Matthew Kennedy. Otherwise, proceed like this:

    • Download and install a recent version of asdf. @@ -226,6 +226,11 @@ where you should obviously replace the path above with the pull path to the font on your machine.

    +Note that CL-GD might work correctly even if some of the tests fail +(as long as you don't get error messages). The exact results of the +tests seem to depend on the versions of the C libraries which are +used. +

    Note about GIF support: The original GD library doesn't support the GIF file format due to the patent Unisys holds @@ -237,7 +242,7 @@

     (push :cl-gd-gif *features*)
     
    -before you compile and load CL-GD. +before you compile and load CL-GD. Also, compile cl-gd-glue-gif.c instead of cl-gd-glue.c.

    Note to Windows users: I've heard that it's possible to compile and use GD with Cygwin. I haven't tried it myself but if you succeed in using CL-GD on Windows it'd be nice if you could send some notes so I can add them to this document. Thanks. Addendum: Jeff Caldwell notes that this website has good explanations about how to install GD and its supporting libraries.

    @@ -1374,8 +1379,8 @@ functionality which wasn't yet part of UFFI. Thanks to Hans Hübner for the GIF patches.

    -$Header: /project/cl-gd/cvsroot/cl-gd/doc/index.html,v 1.2 2004/04/24 00:29:27 eweitz Exp $ +$Header: /project/cl-gd/cvsroot/cl-gd/doc/index.html,v 1.3 2004/04/25 20:34:04 eweitz Exp $

    BACK TO MY HOMEPAGE - \ No newline at end of file +