From: hackbard Date: Tue, 19 Oct 2004 15:21:53 +0000 (+0000) Subject: fixes (dont aks me why!) X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=2f7b88da18008693ab92c3b01224e0c6c48e38ae;p=physik%2Fnlsop.git fixes (dont aks me why!) --- diff --git a/dft.c b/dft.c index 3c64700..1d26cee 100644 --- a/dft.c +++ b/dft.c @@ -24,25 +24,23 @@ int main(int argc,char **argv) { bmp_init(&cut,1); src.mode=READ; dst.mode=WRITE; - cut.mode=WRITE; strcpy(src.file,argv[1]); strcpy(dst.file,argv[2]); - strcpy(cut.file,argv[3]); fourier_init(&fourier,1); fourier.type=DFT|FWD; fourier.dim=2; bmp_read_file(&src); - bmp_cut_bottom(&cut,&src,150); - bmp_write_file(&cut); - dst.width=src.info.width; - dst.height=src.info.height; + bmp_cut_grab_bottom(&cut,&src,src.info.width,GRAB); + + dst.width=cut.width; + dst.height=cut.height; bmp_alloc_map(&dst); - fourier.data_len[0]=src.info.width; - fourier.data_len[1]=src.info.height; + fourier.data_len[0]=cut.width; + fourier.data_len[1]=cut.height; fourier_alloc_data(&fourier); mag=(double *)malloc(fourier.data_len[0]*fourier.data_len[1]*sizeof(double)); @@ -87,9 +85,11 @@ int main(int argc,char **argv) { offt=0; for(y=0;y