PSFEstimationwithCPSO
|
00001 /* 00002 * PSF.hpp 00003 * 00004 * Created on: 27/05/2012 00005 * Author: Peter Frank Perroni (pfperroni@inf.ufpr.br) 00006 */ 00007 00008 #ifndef _PSF_H_ 00009 #define _PSF_H_ 00010 00011 #include "viennacl/vector.hpp" 00012 #include "viennacl/fft.hpp" 00013 #include "TimeTracker.hpp" 00014 #include "debug.hpp" 00015 #include "Profiling.hpp" 00016 00017 using namespace std; 00018 00026 class PSF { 00027 private: 00028 cl_command_queue command_queue; 00029 WORD *coefs; 00030 int n_zernikes, size_fft, img_area, coefs_offset, pupil_offset; 00031 bool has_coefs, has_pupil; 00032 00033 public: 00034 cl_mem cl_coefs, cl_pupil, cl_focus, cl_psf, cl_psfe, cl_sum; 00035 cl_mem cl_fft_psfe; 00036 cl_mem cl_external_pupil; 00037 00038 viennacl::vector<WORD> *vn_pupil, *vn_focus, *vn_fft_psfe; 00039 00040 PSF(cl_context context, cl_command_queue _command_queue, int img_size, int phase_size, int _n_zernikes); 00041 00042 ~PSF(); 00043 00044 void setCoefsPosition(cl_mem _cl_coefs, int offset); 00045 00046 void setPupilPosition(cl_mem _cl_pupil, int offset); 00047 00048 void refreshPupil(bool block); 00049 00050 void pupilToFocusFft(); 00051 00052 void psfeFft(); 00053 00054 WORD* getCoefs(); 00055 }; 00056 00057 #endif /* _PSF_H_ */