added dft program + adjusted cvsignore file
authorhackbard <hackbard>
Thu, 7 Oct 2004 10:37:20 +0000 (10:37 +0000)
committerhackbard <hackbard>
Thu, 7 Oct 2004 10:37:20 +0000 (10:37 +0000)
.cvsignore
dft.c [new file with mode: 0644]
dft.h [new file with mode: 0644]
makefile [new file with mode: 0644]

index b7561ec..b4cb776 100644 (file)
@@ -8,3 +8,6 @@ nlsop-*
 parse_trim_collision
 ft
 be2le
 parse_trim_collision
 ft
 be2le
+dft
+*.bmp
+*.plot
diff --git a/dft.c b/dft.c
new file mode 100644 (file)
index 0000000..385c22d
--- /dev/null
+++ b/dft.c
@@ -0,0 +1,41 @@
+/* dft.c - discrete fourier transformation program */
+
+/*
+ * author: frank.zirkelbach@physik.uni-augsburg.de
+ *
+ */
+
+#include "dft.h"
+
+int main(int argc,char **argv) {
+
+  t_fourier fourier;
+  t_bmp src;
+  t_bmp dst;
+
+  bmp_init(&src,1);
+  bmp_init(&dst,1);
+  src.mode=READ;
+  dst.mode=WRITE;
+  strcpy(src.file,argv[1]);
+  strcpy(dst.file,argv[2]);
+
+  bmp_read_file(&src);
+
+  dst.width=src.info.width;
+  dst.height=src.info.height;
+  bmp_alloc_map(&dst);
+
+  /* simple copy for testing by now ! */
+  memcpy(dst.map,src.map,src.info.imagesize);
+
+  bmp_write_file(&dst);
+
+  bmp_shutdown(&src);
+  bmp_shutdown(&dst);
+
+  printf("done ...\n");
+
+  return 1;
+
+}
diff --git a/dft.h b/dft.h
new file mode 100644 (file)
index 0000000..fe0e66c
--- /dev/null
+++ b/dft.h
@@ -0,0 +1,14 @@
+/* dft.h -- dft header file */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <string.h>
+
+#include "fourier.h"
+#include "bmp.h"
diff --git a/makefile b/makefile
new file mode 100644 (file)
index 0000000..9a9f76e
--- /dev/null
+++ b/makefile
@@ -0,0 +1,27 @@
+# Makefile of dft
+
+INCLUDEDIR = /usr/include
+
+CFLAGS = -O3 -Wall
+LIBS = -lncurses -lm
+
+OBJS = network.o event.o input.o display.o audio.o fourier.o bmp.o
+
+dft: links $(OBJS)
+       $(CC) $(CFLAGS) -o $@ $(OBJS) dft.c $(LIBS)
+all: links dft
+
+clean:
+       rm -f $(OBJS) ivac
+
+links:
+       ln -sf ../../api/event/event.{c,h} .
+       ln -sf ../../api/input/input.{c,h} .
+       ln -sf ../../api/display/display.{c,h} .
+       ln -sf ../../api/audio/audio.{c,h} .
+       ln -sf ../../api/network/network.{c,h} .
+       ln -sf ../../api/list/list.{c,h} .
+       ln -sf ../../api/fourier/fourier.{c,h} .
+       ln -sf ../../api/bmp/bmp.{c,h} .
+
+remake: clean all