Openholo  v4.2
Open Source Digital Holographic Library
ophACPAS.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef __ophACPAS_h
4 #define __ophACPAS_h
5 
6 #include "ophGen.h"
7 
8 
9 #define PI (3.14159265358979323846f)
10 #define M2_PI (PI*2.0)
11 #define RADIANS (PI/180.0) // Angle in radians
12 // DEGREE*asin(mytheta)
13 #define DEGREE2 (180./PI) // sin(RADIANS*DEGREE*asin(mytheta))
14 
15 #define NUMTBL 1024
16 #define NUMTBL2 (NUMTBL-1)
17 #define MAX_STR_LEN 4000
18 #define FFT_SEG_SIZE 64
19 #define SEG_SIZE 8
20 
22 {
23  int CghWidth; // cgh width
24  int CghHeight; // cgh height
25  int SegmentationSize;
26  int fftSegmentationSize;
27  float rWaveLength; // red laser lambda
28  float rWaveNumber; // red laser lambda
29  float ThetaX;
30  float ThetaY;
31  float DefaultDepth;
32  float xInterval;
33  float yInterval;
34  float xiInterval;
35  float etaInterval;
36  float CGHScale;
37 };
38 
39 struct GEN_DLL Segment
40 {
41  bool WorkingFlag;
42  long SegmentIndex;
43  int SegSize_x;
44  int SegSize_y;
45  int hSegSize_x; // Half size
46  int hSegSize_y; // Half size
47  double CenterX;
48  double CenterY;
49  double FrequencySlope;
50 };
51 
52 using namespace oph;
53 
54 class GEN_DLL ophACPAS : public ophGen
55 {
56 public:
57  explicit ophACPAS();
58 protected:
59  virtual ~ophACPAS();
60 
61 public:
62  bool readConfig(const char* fname);
63  int loadPointCloud(const char* pc_file);
64  int save(const char * fname, uint8_t bitsperpixel, uchar* src, uint px, uint py);
65 
66  void DataInit();
67  int ACPASCalcuation(unsigned char *cghfringe); // ÆÐÅÏ°è»ê void ACPAS(); double *m_pHologram; float m_COStbl[NUMTBL]; float m_SINtbl[NUMTBL]; private: int n_points; OphPointCloudConfig pc_config_; OphPointCloudData pc_data_; CGHEnvironmentData env; }; #endif // !__ophPAS_h
68  void ACPAS();
69 
70  double *m_pHologram;
71 
72  float m_COStbl[NUMTBL];
73  float m_SINtbl[NUMTBL];
74 private:
75  int n_points;
76  OphPointCloudConfig pc_config_;
77  OphPointCloudData pc_data_;
79 };
80 
81 
82 
83 #endif // !__ophPAS_h
unsigned char uchar
Definition: typedef.h:64
#define NUMTBL
Definition: ophACPAS.h:15
#define GEN_DLL
Definition: ophGen.h:61
Configuration for Point Cloud.
Definition: ophGen.h:555
Data for Point Cloud.
Definition: ophGen.h:582
Definition: Bitmap.h:49
unsigned int uint
Definition: typedef.h:62
Definition: ophGen.h:76