1 /* linescan.c -- linescan @ width/2 */
4 * author: frank.zirkelbach@physik.uni-augsburg.de
16 int main(int argc,char **argv) {
27 strcpy(bmp.file,argv[i]);
31 val=(double *)malloc(bmp.info.height*sizeof(double));
33 printf("malloc failed!\n");
36 memset(val,0,bmp.info.height*sizeof(double));
41 for(y=0;y<bmp.info.height;y++) {
43 val[y]+=(1.0*(bmp.map[x+d].r+bmp.map[x+d].g+bmp.map[x+d].b)/3);
44 x+=bmp.info.width; // jump to [x/2][y+1]
51 for(y=0;y<bmp.info.height;y++) {
53 printf("%f %f\n",1.0*(bmp.info.height/2-y)/(bmp.info.width*3),val[y]);
54 //printf("%f %f\n",1.0*(bmp.info.height/2-y)/(bmp.info.width),val[y]);