== name == CL-GD == category == Graphics == author == Dr. Edmund Weitz (mailto(edi@agharta.de), mailto(edi@weitz.de)) == author-image == == short-description == CL-GD is a foreign function interface to href(GD,http://www.boutell.com/gd/). == long-description == CL-GD is a library for Common Lisp which provides an interface to the href(GD Graphics Library,http://www.boutell.com/gd/) for the dynamic creation of images. It is based on href(UFFI,http://uffi.b9.com/) and should thus be portable to all CL implementations supported by UFFI. == examples == (with-image* (200 200) ; create 200x200 pixel image (allocate-color 68 70 85) ; background color (let ((beige (allocate-color 222 200 81)) (brown (allocate-color 206 150 75)) (green (allocate-color 104 156 84)) (red (allocate-color 163 83 84)) (white (allocate-color 255 255 255)) (two-pi (* 2 pi))) ;; move origin to center of image (with-transformation (:x1 -100 :x2 100 :y1 -100 :y2 100 :radians t) ;; draw some 'pie slices' (draw-arc 0 0 130 130 0 (* .6 two-pi) :center-connect t :filled t :color beige) (draw-arc 0 0 130 130 (* .6 two-pi) (* .8 two-pi) :center-connect t :filled t :color brown) (draw-arc 0 0 130 130 (* .8 two-pi) (* .95 two-pi) :center-connect t :filled t :color green) (draw-arc 0 0 130 130 (* .95 two-pi) two-pi :center-connect t :filled t :color red) (with-default-color (white) (with-default-font (:small) (draw-string -8 -30 "60%") (draw-string -20 40 "20%") (draw-string 20 30 "15%")) (draw-freetype-string -90 75 "Global Revenue" ;; this assumes that 'DEFAULT_FONTPATH' ;; is set correctly :font-name "verdanab")))) (write-image-to-file "chart.png" :compression-level 6 :if-exists :supersede)) == instructions == * Install a recent version of href(GD,http://www.boutell.com/gd/). * Install href(UFFI,http://uffi.b9.com/) if you don't have it already. * Compile the file cl-gd-glue.c into a shared library for your platform. (See documentation for more info.) * Use ASDF to compile and load CL-GD itself: (asdf:oos 'asdf:load-op :cl-gd) == tutorial == Examples can be found in the documentation. == home-url == http://weitz.de/cl-gd/ == doc-url == http://weitz.de/cl-gd/ == license == CL-GD comes with a href(BSD license,http://www.opensource.org/licenses/bsd-license.php). == book == == references == Read href(the original GD documentation,http://www.boutell.com/gd/manual2.0.33.html) to understand how GD works. == source-fooball == Download the source code from href(http://weitz.de/files/cl-gd.tgz,http://weitz.de/files/cl-gd.tgz) or href(ftp://ftp.franz.com/pub/lispwire/edi/cl-gd-0.4.2.tgz,ftp://ftp.franz.com/pub/lispwire/edi/cl-gd-0.4.2.tgz). bold(NOTE: Edi's site might have a newer version.) == release-date == 2004-11-26 == release-version == 0.4.2 == status == stable == history == See source code. == acl-dependencies == Should work in all Allegro CL versions. == other-dependencies == CL-GD depends on href(UFFI,http://uffi.b9.com/) and href(GD,http://www.boutell.com/gd/). == platform == CL-GD is known to work on Linux and Windows (see the documentation for specific Win32 information) and should also work on any Unix-like platform like Mac OS X. == ad ==