--- /dev/null
+/* 3dplot.c -- 3d plot bmp image */
+
+/*
+ * author: frank.zirkelbach@physik.uni-augsburg.de
+ *
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+
+#include <stdio.h>
+#include "bmp.h"
+
+int main(int argc,char **argv) {
+
+ t_bmp bmp;
+ int x,y;
+ int help;
+ int val;
+
+ if(argc!=2) {
+ printf("usage: %s <filename>\n",argv[0]);
+ return -1;
+ }
+
+ bmp_init(&bmp,2);
+ bmp.mode=READ;
+ strcpy(bmp.file,argv[1]);
+
+ bmp_read_file(&bmp);
+
+ dprintf(2,"width = %d\n",bmp.info.width);
+
+ for(x=0;x<bmp.info.width;x++) {
+ for(y=0;y<bmp.info.height;y++) {
+ help=y*bmp.info.width+x;
+ val=(bmp.map[help].r+bmp.map[help].g+bmp.map[help].b)/3;
+ if(val!=0)
+ printf("%f %f %d\n",1.0*(x-bmp.info.width/2)/(bmp.info.width*3),
+ 1.0*(y-bmp.info.height/2)/(bmp.info.height*3),val);
+ }
+ }
+
+ bmp_shutdown(&bmp);
+
+ return 1;
+}
--- /dev/null
+/* linescan.c -- linescan @ width/2 */
+
+/*
+ * author: frank.zirkelbach@physik.uni-augsburg.de
+ *
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+
+#include <stdio.h>
+#include "bmp.h"
+
+int main(int argc,char **argv) {
+
+ t_bmp bmp;
+ int x,y;
+
+ if(argc!=2) {
+ printf("usage: %s <filename>\n",argv[0]);
+ return -1;
+ }
+
+ bmp_init(&bmp,2);
+ bmp.mode=READ;
+ strcpy(bmp.file,argv[1]);
+
+ bmp_read_file(&bmp);
+
+ dprintf(2,"width = %d\n",bmp.info.width);
+
+ x=bmp.info.width/2;
+ for(y=0;y<bmp.info.height;y++) {
+ printf("%f %d\n",1.0*(bmp.info.height/2-y)/(bmp.info.width*3),
+ (bmp.map[x].r+bmp.map[x].g+bmp.map[x].b)/3);
+ x+=bmp.info.width;
+ }
+
+ bmp_shutdown(&bmp);
+
+ return 1;
+}
dft: links $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) dft.c $(LIBS)
-all: links dft
+linescan: links $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) linescan.c $(LIBS)
+
+3dplot: links $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) 3dplot.c $(LIBS)
+
+all: links dft linescan 3dplot
clean:
rm -f $(OBJS) ivac