projects
/
physik
/
nlsop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fb09e4f
)
switched to apropriate values
author
hackbard
<hackbard>
Tue, 15 Mar 2005 18:28:09 +0000
(18:28 +0000)
committer
hackbard
<hackbard>
Tue, 15 Mar 2005 18:28:09 +0000
(18:28 +0000)
linescan.c
patch
|
blob
|
history
diff --git
a/linescan.c
b/linescan.c
index
11a2b5f
..
889446c
100644
(file)
--- a/
linescan.c
+++ b/
linescan.c
@@
-11,10
+11,13
@@
#include <stdio.h>
#include "bmp.h"
#include <stdio.h>
#include "bmp.h"
+#define DX (3)
+
int main(int argc,char **argv) {
t_bmp bmp;
int main(int argc,char **argv) {
t_bmp bmp;
- int x,y;
+ int x,y,d;
+ double val;
if(argc!=2) {
printf("usage: %s <filename>\n",argv[0]);
if(argc!=2) {
printf("usage: %s <filename>\n",argv[0]);
@@
-27,12
+30,15
@@
int main(int argc,char **argv) {
bmp_read_file(&bmp);
bmp_read_file(&bmp);
- dprintf(2,"width = %d
\n",bmp.info.width
);
+ dprintf(2,"width = %d
... delta x = %d.\n",bmp.info.width,DX
);
x=bmp.info.width/2;
for(y=0;y<bmp.info.height;y++) {
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);
+ val=0.0;
+ for(d=-DX;d<=DX;d++)
+ val+=(1.0*(bmp.map[x+d].r+bmp.map[x+d].g+bmp.map[x+d].b)/3);
+ printf("%f %f\n",1.0*(bmp.info.height/2-y)/(bmp.info.width*3),val);
+ //printf("%f %f\n",1.0*(bmp.info.height/2-y)/(bmp.info.width),val);
x+=bmp.info.width;
}
x+=bmp.info.width;
}