Openholo  v5.0
Open Source Digital Holographic Library
ophPAS.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef __ophPAS_h
4 #define __ophPAS_h
5 
6 #include "ophGen.h"
7 #define NUMTBL 1024
8 #define NUMTBL2 (NUMTBL-1)
9 
10 #define FFT_SEGMENT_SIZE 64
11 #define SEG_SIZE 8
12 
13 using namespace oph;
14 
15 class GEN_DLL ophPAS : public ophGen
16 {
17 private:
18  OphPointCloudConfig pc_config;
19  OphPointCloudData pc_data;
20 public:
21  explicit ophPAS();
22  void Init();
23  void InitGPU();
24  void PAS();
25  void CreateLookupTables();
26  void CalcSpatialFrequency(Point* pt, Real lambda, bool accurate = false);
27  void CalcCompensatedPhase(Point* pt, Real amplitude, Real phase, Real lambda, bool accurate = false);
28 
29 protected:
30  virtual ~ophPAS();
31 
32 public:
33  void setAccurate(bool accurate) { this->is_accurate = accurate; }
34  bool getAccurate() { return this->is_accurate; }
35  bool readConfig(const char* fname);
36  int loadPoint(const char* _filename);
37 
38  void generateHologram();
39 
40  void encodeHologram(const vec2 band_limit, const vec2 spectrum_shift);
41  void encoding(unsigned int ENCODE_FLAG);
42 
43 
44 private:
45  Real LUTCos[NUMTBL] = {};
46  Real LUTSin[NUMTBL] = {};
47 
48  bool is_accurate;
49  int* coefficient_cx;
50  int* coefficient_cy;
51  Real* compensation_cx;
52  Real* compensation_cy;
53  Real* xc;
54  Real* yc;
55  Complex<Real>** input;
56 };
57 
58 #endif // !__ophPAS_h
bool getAccurate()
Definition: ophPAS.h:34
float Real
Definition: typedef.h:55
Definition: struct.h:86
void setAccurate(bool accurate)
Definition: ophPAS.h:33
#define GEN_DLL
Definition: ophGen.h:61
structure for 2-dimensional Real type vector and its arithmetic.
Definition: vec.h:66
Configuration for Point Cloud.
Definition: ophGen.h:546
Data for Point Cloud.
Definition: ophGen.h:573
Definition: ophPAS.h:15
Definition: Bitmap.h:49
#define NUMTBL
Definition: ophPAS.h:7
Definition: ophGen.h:76