Openholo  v2.1
Open Source Digital Holographic Library
ophLUT.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef __ophLUT_h
4 #define __ophLUT_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 
19 struct VoxelStruct;
20 struct CGHEnvironmentData;
21 struct Segment;
22 
23 using namespace oph;
24 
25 class GEN_DLL ophLUT : public ophGen
26 {
27 public:
28  explicit ophLUT();
29 protected:
30  virtual ~ophLUT();
31 
32 public:
33  int init(const char* _filename, CGHEnvironmentData* _CGHE); // ÃʱâÈ­
34 
35  bool loadConfig(const char* filename, CGHEnvironmentData* _CGHE);
36  bool loadPoint(const char* _filename, VoxelStruct* h_vox);
37  bool load_Num_Point(const char* _filename, long* num_point);
38 
39  void DataInit(CGHEnvironmentData* _CGHE); //µ¥ÀÌÅÍ ÃʱâÈ­
40  int LUTCalcuation(long voxnum, unsigned char *cghfringe, VoxelStruct* h_vox, CGHEnvironmentData* _CGHE); // ÆÐÅÏ°è»ê void APAS(long voxelnum, VoxelStruct* _h_vox, CGHEnvironmentData* _CGHE); int saveAsImg(const char * fname, uint8_t bitsperpixel, void* src, int pic_width, int pic_height); // À̹ÌÁö ÀúÀå //util char* trim(char *s); // ¹®ÀÚ¿­ ÁÂ¿ì °ø¹é ¸ðµÎ »èÁ¦ ÇÔ¼ö char* ltrim(char *s); // ¹®ÀÚ¿­ ÁÂÃø °ø¹é Á¦°Å ÇÔ¼ö char* rtrim(char* s); // ¹®ÀÚ¿­ ¿ìÃø °ø¹é Á¦°Å ÇÔ¼ö double *m_pHologram; Segment *m_Segment; float m_COStbl[NUMTBL]; float m_SINtbl[NUMTBL]; //long num_point = 0; // number of point cloud }; struct GEN_DLL VoxelStruct // voxel structure - data { int num; // voxel or point number float x; // x axis coordinate float y; // y axis coordinate float z; // z axis coordinate float ph; // phase float r; // amplitude in red channel //float g; // amplitude in green channel //float b; // amplitude in blue channel }; struct GEN_DLL CGHEnvironmentData { int CghWidth; // cgh width int CghHeight; // cgh height int SegmentationSize; int fftSegmentationSize; float rWaveLength; // red laser lambda float rWaveNumber; // red laser lambda float ThetaX; float ThetaY; float DefaultDepth; float xInterval; float yInterval; float xiInterval; float etaInterval; float CGHScale; }; struct GEN_DLL Segment { bool WorkingFlag; long SegmentIndex; int SegSize_x; int SegSize_y; int hSegSize_x; // Half size int hSegSize_y; // Half size double CenterX; double CenterY; double FrequencySlope; }; #endif // !__ophLUT_h
41  void APAS(long voxelnum, VoxelStruct* _h_vox, CGHEnvironmentData* _CGHE);
42 
43  int saveAsImg(const char * fname, uint8_t bitsperpixel, void* src, int pic_width, int pic_height); // À̹ÌÁö ÀúÀå
44 
45  //util
46  char* trim(char *s); // ¹®ÀÚ¿­ ÁÂ¿ì °ø¹é ¸ðµÎ »èÁ¦ ÇÔ¼ö char* ltrim(char *s); // ¹®ÀÚ¿­ ÁÂÃø °ø¹é Á¦°Å ÇÔ¼ö char* rtrim(char* s); // ¹®ÀÚ¿­ ¿ìÃø °ø¹é Á¦°Å ÇÔ¼ö double *m_pHologram; Segment *m_Segment; float m_COStbl[NUMTBL]; float m_SINtbl[NUMTBL]; //long num_point = 0; // number of point cloud }; struct GEN_DLL VoxelStruct // voxel structure - data { int num; // voxel or point number float x; // x axis coordinate float y; // y axis coordinate float z; // z axis coordinate float ph; // phase float r; // amplitude in red channel //float g; // amplitude in green channel //float b; // amplitude in blue channel }; struct GEN_DLL CGHEnvironmentData { int CghWidth; // cgh width int CghHeight; // cgh height int SegmentationSize; int fftSegmentationSize; float rWaveLength; // red laser lambda float rWaveNumber; // red laser lambda float ThetaX; float ThetaY; float DefaultDepth; float xInterval; float yInterval; float xiInterval; float etaInterval; float CGHScale; }; struct GEN_DLL Segment { bool WorkingFlag; long SegmentIndex; int SegSize_x; int SegSize_y; int hSegSize_x; // Half size int hSegSize_y; // Half size double CenterX; double CenterY; double FrequencySlope; }; #endif // !__ophLUT_h
47  char* ltrim(char *s); // ¹®ÀÚ¿­ ÁÂÃø °ø¹é Á¦°Å ÇÔ¼ö char* rtrim(char* s); // ¹®ÀÚ¿­ ¿ìÃø °ø¹é Á¦°Å ÇÔ¼ö double *m_pHologram; Segment *m_Segment; float m_COStbl[NUMTBL]; float m_SINtbl[NUMTBL]; //long num_point = 0; // number of point cloud }; struct GEN_DLL VoxelStruct // voxel structure - data { int num; // voxel or point number float x; // x axis coordinate float y; // y axis coordinate float z; // z axis coordinate float ph; // phase float r; // amplitude in red channel //float g; // amplitude in green channel //float b; // amplitude in blue channel }; struct GEN_DLL CGHEnvironmentData { int CghWidth; // cgh width int CghHeight; // cgh height int SegmentationSize; int fftSegmentationSize; float rWaveLength; // red laser lambda float rWaveNumber; // red laser lambda float ThetaX; float ThetaY; float DefaultDepth; float xInterval; float yInterval; float xiInterval; float etaInterval; float CGHScale; }; struct GEN_DLL Segment { bool WorkingFlag; long SegmentIndex; int SegSize_x; int SegSize_y; int hSegSize_x; // Half size int hSegSize_y; // Half size double CenterX; double CenterY; double FrequencySlope; }; #endif // !__ophLUT_h
48  char* rtrim(char* s); // ¹®ÀÚ¿­ ¿ìÃø °ø¹é Á¦°Å ÇÔ¼ö double *m_pHologram; Segment *m_Segment; float m_COStbl[NUMTBL]; float m_SINtbl[NUMTBL]; //long num_point = 0; // number of point cloud }; struct GEN_DLL VoxelStruct // voxel structure - data { int num; // voxel or point number float x; // x axis coordinate float y; // y axis coordinate float z; // z axis coordinate float ph; // phase float r; // amplitude in red channel //float g; // amplitude in green channel //float b; // amplitude in blue channel }; struct GEN_DLL CGHEnvironmentData { int CghWidth; // cgh width int CghHeight; // cgh height int SegmentationSize; int fftSegmentationSize; float rWaveLength; // red laser lambda float rWaveNumber; // red laser lambda float ThetaX; float ThetaY; float DefaultDepth; float xInterval; float yInterval; float xiInterval; float etaInterval; float CGHScale; }; struct GEN_DLL Segment { bool WorkingFlag; long SegmentIndex; int SegSize_x; int SegSize_y; int hSegSize_x; // Half size int hSegSize_y; // Half size double CenterX; double CenterY; double FrequencySlope; }; #endif // !__ophLUT_h
49 
50  double *m_pHologram;
51  Segment *m_Segment;
52  float m_COStbl[NUMTBL];
53  float m_SINtbl[NUMTBL];
54 
55  //long num_point = 0; // number of point cloud
56 
57 };
58 
59 struct GEN_DLL VoxelStruct // voxel structure - data
60 {
61  int num; // voxel or point number
62  float x; // x axis coordinate
63  float y; // y axis coordinate
64  float z; // z axis coordinate
65  float ph; // phase
66  float r; // amplitude in red channel
67  //float g; // amplitude in green channel
68  //float b; // amplitude in blue channel
69 };
70 
72 {
73  int CghWidth; // cgh width
74  int CghHeight; // cgh height
75  int SegmentationSize;
76  int fftSegmentationSize;
77  float rWaveLength; // red laser lambda
78  float rWaveNumber; // red laser lambda
79  float ThetaX;
80  float ThetaY;
81  float DefaultDepth;
82  float xInterval;
83  float yInterval;
84  float xiInterval;
85  float etaInterval;
86  float CGHScale;
87 };
88 
89 struct GEN_DLL Segment
90 {
91  bool WorkingFlag;
92  long SegmentIndex;
93  int SegSize_x;
94  int SegSize_y;
95  int hSegSize_x; // Half size
96  int hSegSize_y; // Half size
97  double CenterX;
98  double CenterY;
99  double FrequencySlope;
100 };
101 #endif // !__ophLUT_h
#define GEN_DLL
Definition: ophGen.h:54
Definition: ophLUT.h:25
#define NUMTBL
Definition: ophLUT.h:15
Definition: Bitmap.h:49
Definition: ophGen.h:68