diff options
Diffstat (limited to 'Examples/GIFPlot/Chicken/full')
-rw-r--r-- | Examples/GIFPlot/Chicken/full/Makefile | 28 | ||||
-rw-r--r-- | Examples/GIFPlot/Chicken/full/README | 6 | ||||
-rw-r--r-- | Examples/GIFPlot/Chicken/full/cmap | bin | 768 -> 0 bytes | |||
-rw-r--r-- | Examples/GIFPlot/Chicken/full/gifplot.i | 26 | ||||
-rw-r--r-- | Examples/GIFPlot/Chicken/full/test-gifplot.scm | 66 |
5 files changed, 0 insertions, 126 deletions
diff --git a/Examples/GIFPlot/Chicken/full/Makefile b/Examples/GIFPlot/Chicken/full/Makefile deleted file mode 100644 index 2ae4fd7ea..000000000 --- a/Examples/GIFPlot/Chicken/full/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -TOP = ../../.. -SWIG = $(TOP)/../preinst-swig -INTERFACE = gifplot.i -SRCS = -CXXSRCS = -TARGET = gifplot -INCLUDE = -I. -I../../Include -SWIGOPT = -I../../Include -CFLAGS = -VARIANT = -LIBS = -L../.. -lgifplot -lm - -# comment the following two lines to build a dynamic so file -CHICKEN_MAIN = test-gifplot.scm -VARIANT = _static - -all:: $(TARGET) - -$(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ - SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ - INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' TARGET='$(TARGET)' \ - SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT) - -clean:: - $(MAKE) -f $(TOP)/Makefile chicken_clean - rm -f gifplot.scm image.gif - rm -f $(TARGET) diff --git a/Examples/GIFPlot/Chicken/full/README b/Examples/GIFPlot/Chicken/full/README deleted file mode 100644 index e5ddd7af1..000000000 --- a/Examples/GIFPlot/Chicken/full/README +++ /dev/null @@ -1,6 +0,0 @@ -This example runs the entire gifplot.h header file through SWIG without -any changes. The Scheme program 'test-gifplot.scm' does something a -little more interesting. You'll have to go look at the header file to -get a complete listing of the functions. - -`make' will build a static binary. Run ./gifplot to test it. diff --git a/Examples/GIFPlot/Chicken/full/cmap b/Examples/GIFPlot/Chicken/full/cmap Binary files differdeleted file mode 100644 index a20c331a9..000000000 --- a/Examples/GIFPlot/Chicken/full/cmap +++ /dev/null diff --git a/Examples/GIFPlot/Chicken/full/gifplot.i b/Examples/GIFPlot/Chicken/full/gifplot.i deleted file mode 100644 index f6741864a..000000000 --- a/Examples/GIFPlot/Chicken/full/gifplot.i +++ /dev/null @@ -1,26 +0,0 @@ -/* Oh what the heck, let's just grab the whole darn header file - and see what happens. */ - -%module gifplot -%{ - -/* Note: You still need this part because the %include directive - merely causes SWIG to interpret the contents of a file. It doesn't - include the right include headers for the resulting C code */ - -#include "gifplot.h" - -%} - -/* Pixel is typedef'd to unsigned char, and SWIG will translate this - type into Scheme characters. We would like to translate Pixels to - Scheme integers instead, so: */ - -SIMPLE_TYPEMAP(Pixel, C_unfix, C_fix, C_swig_is_fixnum, (int), 0); - -%{ -static Pixel int_to_Pixel (int v) { return (Pixel) v; } -%} -extern Pixel int_to_Pixel (int v); - -%include gifplot.h diff --git a/Examples/GIFPlot/Chicken/full/test-gifplot.scm b/Examples/GIFPlot/Chicken/full/test-gifplot.scm deleted file mode 100644 index c290af54d..000000000 --- a/Examples/GIFPlot/Chicken/full/test-gifplot.scm +++ /dev/null @@ -1,66 +0,0 @@ -;;; Plot a 3D function - -(declare (uses gifplot)) - -;; Here is the function to plot -(define (func x y) - (* 5 - (cos (* 2 (sqrt (+ (* x x) (* y y))))) - (exp (* -0.3 (sqrt (+ (* x x) (* y y))))))) - -;; Here are some plotting parameters -(define xmin -5.0) -(define xmax 5.0) -(define ymin -5.0) -(define ymax 5.0) -(define zmin -5.0) -(define zmax 5.0) - -;; Grid resolution -(define nxpoints 60) -(define nypoints 60) - -(define cmap (gifplot:new-ColorMap "cmap")) -(define frame (gifplot:new-FrameBuffer 500 500)) -(gifplot:FrameBuffer-clear frame (gifplot:BLACK)) - -(define p3 (gifplot:new-Plot3D frame xmin ymin zmin xmax ymax zmax)) -(gifplot:Plot3D-lookat p3 (* 2 (- zmax zmin))) -(gifplot:Plot3D-autoperspective p3 40.0) -(gifplot:Plot3D-rotu p3 60.0) -(gifplot:Plot3D-rotr p3 30.0) -(gifplot:Plot3D-rotd p3 10.0) - -(define (drawsolid) - (gifplot:Plot3D-clear p3 (gifplot:BLACK)) - (gifplot:Plot3D-start p3) - (let ((dx (/ (- xmax xmin) nxpoints)) - (dy (/ (- ymax ymin) nypoints)) - (cscale (/ 240 (- zmax zmin)))) - (let x-loop ((x xmin) (i 0)) - (cond - ((< i nxpoints) - (let y-loop ((y ymin) (j 0)) - (cond - ((< j nypoints) - (let* ((z1 (func x y)) - (z2 (func (+ x dx) y)) - (z3 (func (+ x dx) (+ y dy))) - (z4 (func x (+ y dy))) - (c1 (* cscale (- z1 zmin))) - (c2 (* cscale (- z2 zmin))) - (c3 (* cscale (- z3 zmin))) - (c4 (* cscale (- z4 zmin))) - (cc (/ (+ c1 c2 c3 c4) 4)) - (c (inexact->exact (round (max (min cc 239) 0))))) - (gifplot:Plot3D-solidquad p3 x y z1 (+ x dx) y z2 (+ x dx) (+ y dy) - z3 x (+ y dy) z4 - (gifplot:int->Pixel (+ c 16)))) - (y-loop (+ y dy) (+ j 1))))) - (x-loop (+ x dx) (+ i 1))))))) - -(display "Making a nice 3D plot...\n") -(drawsolid) - -(gifplot:FrameBuffer-writeGIF frame cmap "image.gif") -(display "Wrote image.gif\n") |