FFTWWrapper.H
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 #ifndef HAHAH_H
00007 #define HAHAH_H
00008 
00009 
00010 #include <stdlib.h>
00011 #include <math.h>
00012 #include <float.h>
00013 
00014 #ifdef HAVE_FFTW3_H
00015 #include <fftw3.h>
00016 #endif
00017 
00018 class FFTWWrapper
00019 {
00020 
00021 public:
00022   FFTWWrapper(int width, int height);
00023   void init(double *image);
00024   ~FFTWWrapper();
00025   void compute(double **magspec);
00026 
00027   void compute(double *magspec);
00028 private:
00029 #ifdef HAVE_FFTW3_H
00030   inline double mag(fftw_complex c)
00031   {
00032     return (sqrt(c[0]*c[0] + c[1]*c[1]));
00033   }
00034 
00035   double *in;
00036   int imageheight;
00037   int imagewidth;
00038   fftw_complex *out;
00039   fftw_plan p;
00040 #endif // HAVE_FFTW3_H
00041 };
00042 
00043 #endif