/*rlmonoc3*/ #include #include #include #include #include #include #define TINY 1.0e-20 fftw_complex *out; /*extract uit een RGB beeld kanaal R, G of B*/ double * kanaal(int w,int h, ImlibImage *im, int chan) { int i,j; int index; double *out=malloc(sizeof(double)*w*h); for(i=0; irgb_data[index+chan]; } } return out; } double *regroup(int w, int h, fftw_complex *convred ,double *flimoutn) { /*herschik beeld weer zodat de vier kwadranten weer op hun plaats staan*/ int i,j; i=0; while (i < w) { j = 0; while (j < h) { int k,l; int index1, index2 ; double temp; index1 = i + w*j; if (i < w/2) {k=i + (w/2);} if (j < h/2) {l=j + (h/2);} if (i >=w/2) {k=i - (w/2);} if (j >=h/2) {l=j - (h/2);} index2 = k+w*l; flimoutn[index2] = sqrt(((convred[index1].re * convred[index1].re + convred[index1].im * convred[index1].im))); j ++; } i ++; } return flimoutn; } /*normeer PSF op 1*/ double *normpsf(double *psfch, int w, int h) { int i,j; double sum; sum = 0; for (j=0; j \n"); return 0; } /* Suck the image's original width and height out of the Image structure */ w=im->rgb_width; h=im->rgb_height; out = (fftw_complex *) malloc(w*h*sizeof(fftw_complex)); a =malloc(sizeof(double)*w*h); b =malloc(sizeof(double)*w*h); est =malloc(sizeof(double)*w*h); estblur=malloc(sizeof(double)*w*h); /*in*/ in = kanaal(w, h, im, 0); total = 0; for (j=0; j255) {est[index2]=255;} imout->rgb_data[index]=(int) est[index2]; imout->rgb_data[index+1]=(int) est[index2]; imout->rgb_data[index+2]=(int) est[index2]; } } Imlib_save_image(idout, imout, argv[3], NULL); return 1; }