Openholo
v4.2
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
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
#define FFT_SEGMENT_SIZE 64
20
21
struct
VoxelStruct;
22
struct
Segment
;
23
24
using namespace
oph
;
25
26
class
GEN_DLL
ophPAS
:
public
ophGen
27
{
28
private
:
29
OphPointCloudConfig
pc_config;
30
OphPointCloudData
pc_data;
31
int
n_points;
32
public
:
33
explicit
ophPAS
();
34
protected
:
35
virtual
~
ophPAS
();
36
37
public
:
38
bool
readConfig(
const
char
* fname);
39
int
loadPoint(
const
char
* _filename);
40
41
42
//void PASCalcuation(long voxnum, unsigned char *cghfringe, VoxelStruct* h_vox, CGHEnvironmentData* _CGHE);
43
void
PASCalculation(
long
voxnum,
unsigned
char
* cghfringe,
OphPointCloudData
*data,
OphPointCloudConfig
& conf);
44
//void PAS(long voxelnum, struct VoxelStruct *voxel, double *m_pHologram, CGHEnvironmentData* _CGHE);
45
void
PAS(
long
voxelnum,
OphPointCloudData
*data,
double
*m_pHologram,
OphPointCloudConfig
& conf);
46
void
PAS_GPU(
long
voxelnum,
OphPointCloudData
*data,
double
*m_pHologram,
OphPointCloudConfig
& conf);
47
void
DataInit(
int
segsize,
int
cghwidth,
int
cghheight,
float
xiinter,
float
etainter);
48
void
init();
49
void
MemoryRelease(
void
);
50
51
void
generateHologram();
52
53
void
CalcSpatialFrequency(
float
cx,
float
cy,
float
cz,
float
amp,
int
segnumx,
int
segnumy,
int
segsize,
int
hsegsize,
float
sf_base,
float
* xc,
float
* yc,
float
* sf_cx,
float
* sf_cy,
int
* pp_cx,
int
* pp_cy,
int
* cf_cx,
int
* cf_cy,
float
xiint,
float
etaint,
OphPointCloudConfig
& conf);
54
55
void
CalcCompensatedPhase(
float
cx,
float
cy,
float
cz,
float
amp,
int
segnumx,
int
segnumy,
int
segsize,
int
hsegsize,
float
sf_base,
float
*xc,
float
*yc,
int
*cf_cx,
int
*cf_cy,
float
*COStbl,
float
*SINtbl,
float
**inRe,
float
**inIm,
OphPointCloudConfig
& conf);
56
57
void
RunFFTW(
int
segnumx,
int
segnumy,
int
segsize,
int
hsegsize,
float
**inRe,
float
**inIm, fftw_complex *in, fftw_complex *out, fftw_plan *plan,
double
*pHologram,
OphPointCloudConfig
& conf);
58
59
void
encodeHologram(
const
vec2
band_limit,
const
vec2
spectrum_shift);
60
void
encoding(
unsigned
int
ENCODE_FLAG
);
61
62
63
double
*
m_pHologram
;
64
65
float
m_COStbl[
NUMTBL
];
66
float
m_SINtbl[
NUMTBL
];
67
68
int
m_segSize
;
69
int
m_hsegSize
;
70
int
m_dsegSize
;
71
int
m_segNumx
;
72
int
m_segNumy
;
73
int
m_hsegNumx
;
74
int
m_hsegNumy
;
75
76
float
*
m_inRe_h
;
77
float
*
m_inIm_h
;
78
79
float
*
m_SFrequency_cx
;
80
float
*
m_SFrequency_cy
;
81
int
*
m_PickPoint_cx
;
82
int
*
m_PickPoint_cy
;
83
int
*
m_Coefficient_cx
;
84
int
*
m_Coefficient_cy
;
85
float
*
m_xc
;
86
float
*
m_yc
;
87
unsigned
char
*
cgh_fringe
;
88
89
float
m_sf_base
;
90
91
fftw_complex *m_in, *
m_out
;
92
fftw_plan
m_plan
;
93
94
float
**
m_inRe
;
95
float
**
m_inIm
;
96
97
float
m_cx
;
98
float
m_cy
;
99
float
m_cz
;
100
float
m_amp
;
101
};
102
103
typedef
struct
GEN_DLL
_Voxel
// voxel structure - data
104
{
105
int
num
;
// voxel or point number
106
float
x
;
// x axis coordinate
107
float
y
;
// y axis coordinate
108
float
z
;
// z axis coordinate
109
float
ph
;
// phase
110
float
r
;
// amplitude in red channel
111
float
g
;
// amplitude in green channel
112
float
b
;
// amplitude in blue channel
113
}
Voxel
;
114
115
116
struct
GEN_DLL
Segment
117
{
118
bool
WorkingFlag;
119
long
SegmentIndex;
120
int
SegSize_x;
121
int
SegSize_y;
122
int
hSegSize_x;
// Half size
123
int
hSegSize_y;
// Half size
124
double
CenterX;
125
double
CenterY;
126
double
FrequencySlope;
127
};
128
#endif // !__ophPAS_h
Voxel
struct GEN_DLL _Voxel Voxel
ophGen::ENCODE_FLAG
ENCODE_FLAG
Definition:
ophGen.h:84
NUMTBL
#define NUMTBL
Definition:
ophPAS.h:15
_Voxel::num
int num
Definition:
ophPAS.h:105
ophPAS::m_out
fftw_complex * m_out
Definition:
ophPAS.h:91
ophPAS::m_hsegNumx
int m_hsegNumx
Definition:
ophPAS.h:73
ophPAS::m_yc
float * m_yc
Definition:
ophPAS.h:86
ophGen.h
ophPAS::m_segSize
int m_segSize
Definition:
ophPAS.h:68
ophPAS::m_inRe_h
float * m_inRe_h
Definition:
ophPAS.h:76
ophPAS::m_PickPoint_cx
int * m_PickPoint_cx
Definition:
ophPAS.h:81
ophPAS::m_SFrequency_cx
float * m_SFrequency_cx
Definition:
ophPAS.h:79
ophPAS::m_Coefficient_cx
int * m_Coefficient_cx
Definition:
ophPAS.h:83
ophPAS::m_inIm
float ** m_inIm
Definition:
ophPAS.h:95
_Voxel::r
float r
Definition:
ophPAS.h:110
ophPAS::m_inIm_h
float * m_inIm_h
Definition:
ophPAS.h:77
ophPAS::m_segNumx
int m_segNumx
Definition:
ophPAS.h:71
ophPAS::m_cy
float m_cy
Definition:
ophPAS.h:98
ophPAS::m_amp
float m_amp
Definition:
ophPAS.h:100
ophPAS::m_pHologram
double * m_pHologram
Definition:
ophPAS.h:63
ophPAS::m_sf_base
float m_sf_base
Definition:
ophPAS.h:89
_Voxel::g
float g
Definition:
ophPAS.h:111
ophPAS::m_segNumy
int m_segNumy
Definition:
ophPAS.h:72
ophPAS::m_SFrequency_cy
float * m_SFrequency_cy
Definition:
ophPAS.h:80
ophPAS::m_dsegSize
int m_dsegSize
Definition:
ophPAS.h:70
Segment
Definition:
ophACPAS.h:39
_Voxel::x
float x
Definition:
ophPAS.h:106
ophPAS::m_cx
float m_cx
Definition:
ophPAS.h:97
GEN_DLL
#define GEN_DLL
Definition:
ophGen.h:61
oph::vec2
structure for 2-dimensional Real type vector and its arithmetic.
Definition:
vec.h:66
ophPAS::m_cz
float m_cz
Definition:
ophPAS.h:99
ophPAS::m_Coefficient_cy
int * m_Coefficient_cy
Definition:
ophPAS.h:84
ophPAS::m_inRe
float ** m_inRe
Definition:
ophPAS.h:94
_Voxel
Definition:
ophPAS.h:103
ophPAS::m_hsegNumy
int m_hsegNumy
Definition:
ophPAS.h:74
OphPointCloudConfig
Configuration for Point Cloud.
Definition:
ophGen.h:555
_Voxel::b
float b
Definition:
ophPAS.h:112
OphPointCloudData
Data for Point Cloud.
Definition:
ophGen.h:582
ophPAS::m_PickPoint_cy
int * m_PickPoint_cy
Definition:
ophPAS.h:82
_Voxel::y
float y
Definition:
ophPAS.h:107
ophPAS::m_plan
fftw_plan m_plan
Definition:
ophPAS.h:92
ophPAS
Definition:
ophPAS.h:26
ophPAS::m_xc
float * m_xc
Definition:
ophPAS.h:85
ophPAS::cgh_fringe
unsigned char * cgh_fringe
Definition:
ophPAS.h:87
_Voxel::ph
float ph
Definition:
ophPAS.h:109
_Voxel::z
float z
Definition:
ophPAS.h:108
oph
Definition:
Bitmap.h:49
ophPAS::m_hsegSize
int m_hsegSize
Definition:
ophPAS.h:69
ophGen
Definition:
ophGen.h:76
D:
Sources
Openholo
Openholo
build
include
ophPAS.h
Generated by
1.8.14