#include #include #include #include #include #include "h.h" static int rm(int x, int X){return x+x 1) a[y*X + x] = 0;}}}}; // Gaussian blur static void Gauss(){R sx = rad[0]/X, sy = rad[0]/Y; {int x=X; while(x--){int y=Y; while(y--) a[y*X + x] = ~a[y*X + x] * exp(-(sq(rm(x, X)*sx) + sq(rm(y, Y)*sy)));}}} // Convolve with uniform round disk (unfocus) static void unf(){R s2 = rad[0]*rad[0]; c * b = (c *)malloc(sizeof(c)*X*Y); {int x=X; while(x--){int y=Y; while(y--) { b[y*X + x] = ((sq(rm(x, X)) + sq(rm(y, Y))) < s2)?1:0;}}}; ext2D(b); {int j=X*Y; while(j--) a[j] = ~a[j]*b[j];} free(b);} // Auto correlation: static void ac(){int k=X*Y; while(k--) a[k] *= ~a[k];}; // Vertical translation static void up(){c ph = 1; R b = 2*pi/Y*rad[0]; c f = CMPLX(cos(b), sin(b)); int y; for(y=0; y