From ba07742cd1c1cf50e5467462311425cfdf245402 Mon Sep 17 00:00:00 2001 From: hackbard Date: Thu, 7 Oct 2004 10:37:20 +0000 Subject: [PATCH] added dft program + adjusted cvsignore file --- .cvsignore | 3 +++ dft.c | 41 +++++++++++++++++++++++++++++++++++++++++ dft.h | 14 ++++++++++++++ makefile | 27 +++++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 dft.c create mode 100644 dft.h create mode 100644 makefile diff --git a/.cvsignore b/.cvsignore index b7561ec..b4cb776 100644 --- a/.cvsignore +++ b/.cvsignore @@ -8,3 +8,6 @@ nlsop-* parse_trim_collision ft be2le +dft +*.bmp +*.plot diff --git a/dft.c b/dft.c new file mode 100644 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 index 0000000..fe0e66c --- /dev/null +++ b/dft.h @@ -0,0 +1,14 @@ +/* dft.h -- dft header file */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include + +#include "fourier.h" +#include "bmp.h" diff --git a/makefile b/makefile new file mode 100644 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 -- 2.39.2