WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
WPFFT.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <boost/signals2.hpp>
9 #include <boost/bind.hpp>
10 #include <mutex>
11 
12 // Forward class declarations
13 class ScanProcessor;
14 
15 class WPFFT
16 {
17 public:
21  enum class FFTType
22  {
23  Forward = 0,
24  Backward,
25  ZeroPad,
26  NoZeroPad,
27  NumFFTTypes
28  };
29 
30  WPFFT();
31  WPFFT(ScanProcessor* scanProcessor);
32  virtual ~WPFFT();
33 
34  // Getters
35  static size_t GetForwardOutputHeight () { return _outputHeightFFTR2C; }
36  static size_t GetBackwardOutputHeight () { return _outputHeightFFTC2R; }
37  static size_t GetC2COutputHeight () { return _outputHeightFFTC2C; }
38  static size_t GetC2CZPOutputHeight () { return _outputHeightFFTC2CZP; }
39 
40  virtual void InitStorage (int width, int height, int depth);
41  virtual void ReleaseStorage ();
42 
43  virtual void InitPlans (int width, int height, int depth);
44  virtual void DestroyPlans ();
45 
46  virtual void OnWidthHeightChanged (int width, int height);
47 
48  virtual void Compute () { }
49  // virtual void Compute (FFTType type, void* inData = NULL) { }
50 
51 protected:
52  bool _storageInitialized;
53 
54  ScanProcessor* _scanProcessor;
55 
56  static size_t _outputHeightFFTR2C;
57  static size_t _outputHeightFFTC2R;
58  static size_t _outputHeightFFTC2C;
59  static size_t _outputHeightFFTC2CZP;
60 
61  // for averaging, need 2D-FFT - not currently used
62  static size_t _outputHeight2DFFTR2C;
63  static size_t _outputHeight2DFFTC2R;
64 
65  // The width, height, and depth of the storage elements.
66  int _storageWidth;
67  int _storageHeight;
68  int _storageDepth;
69 
71  static std::mutex _mutexSetup;
72  //static std::mutex _mutexPlan1;
73  //static std::mutex _mutexPlan2;
74  //static std::mutex _mutexPlan3;
75  //static std::mutex _mutexPlan4;
76  //static std::mutex _mutexPlan;
77 
78  // The width, height, and depth of the plan elements.
79  int _planWidth;
80  int _planHeight;
81  int _planDepth;
82 
83  static bool _plansInitialized;
84  static bool _frameworkSetup;
85  static int _numFFTObjects;
86 
87  static void OutputError (int error, char *message);
88 
89  virtual void AllocateFramework () { }
90  virtual void DestroyFramework () { }
91 
92 private:
93  boost::signals2::connection _widthHeightConnection;
94 
95  void Init();
96 };
Class that processes scans.
Definition: ScanProcessor.h:32
Definition: WPFFT.h:16
static std::mutex _mutexSetup
Mutexes for locking.
Definition: WPFFT.h:71
FFTType
Lists the different types of FFTs available.
Definition: WPFFT.h:22