52 #define GEN_DLL __declspec(dllexport) 54 #define GEN_DLL __declspec(dllimport) 100 virtual ~
ophGen(
void) = 0;
121 void initialize(
void);
140 bool readConfig(
const char* fname);
151 void AngularSpectrumMethod(Complex<Real>* input, Complex<Real>* output,
Real distance,
Real k,
Real lambda);
160 void conv_fft2(Complex<Real>* src1, Complex<Real>* src2, Complex<Real>* dst, ivec2 size);
180 bool save(
const char* fname, uint8_t bitsperpixel = 8,
uchar* src =
nullptr,
uint px = 0,
uint py = 0);
186 void* load(
const char* fname);
195 virtual bool loadAsOhc(
const char *fname);
208 bool save(
const char* fname, uint8_t bitsperpixel,
uint px,
uint py,
uint fnum,
uchar* args ...);
241 void encoding(
unsigned int ENCODE_FLAG);
242 void encoding(
unsigned int ENCODE_FLAG, Complex<Real>* holo,
Real* encoded);
257 virtual void encoding(
unsigned int ENCODE_FLAG,
unsigned int SSB_PASSBAND, Complex<Real>* holo =
nullptr,
Real* encoded =
nullptr);
277 void encoding(
unsigned int BIN_ENCODE_FLAG,
unsigned int ENCODE_FLAG,
Real threshold, Complex<Real>* holo =
nullptr,
Real* encoded =
nullptr);
288 void waveCarry(
Real carryingAngleX,
Real carryingAngleY,
Real distance);
290 void waveCarry(Complex<Real>* src, Complex<Real>* dst,
Real wavelength,
int carryIdxX,
int carryIdxY);
319 void transVW(
int nSize,
Real *dst,
Real *src);
334 void setResolution(ivec2 resolution);
350 template <
typename T>
351 void RealPart(Complex<T>* holo, T* encoded,
const int size);
352 template <
typename T>
353 void ImaginearyPart(Complex<T>* holo, T* encoded,
const int size);
354 template <
typename T>
355 void Phase(Complex<T>* holo, T* encoded,
const int size);
356 template <
typename T>
357 void Amplitude(Complex<T>* holo, T* encoded,
const int size);
358 template <
typename T>
359 void TwoPhase(Complex<T>* holo, T* encoded,
const int size);
360 template <
typename T>
361 void Burckhardt(Complex<T>* holo, T* encoded,
const int size);
362 template <
typename T>
363 void SimpleNI(Complex<T>* holo, T* encoded,
const int size);
372 void singleSideBand(Complex<Real>* holo,
Real* encoded,
const ivec2 holosize,
int passband);
382 void freqShift(Complex<Real>* src, Complex<Real>* dst,
const ivec2 holosize,
int shift_x,
int shift_y);
387 bool saveRefImages(
char* fnameW,
char* fnameWC,
char* fnameAS,
char* fnameSSB,
char* fnameHP,
char* fnameFreq,
char* fnameReal,
char* fnameBin,
char* fnameReconBin,
char* fnameReconErr,
char* fnameReconNo);
405 bool binaryErrorDiffusion(Complex<Real>* holo,
Real* encoded,
const ivec2 holosize,
const int type,
Real threshold);
406 bool getWeightED(
const ivec2 holosize,
const int type, ivec2* pNw);
407 bool shiftW(ivec2 holosize);
408 void binarization(Complex<Real>* src,
Real* dst,
const int size,
int ENCODE_FLAG,
Real threshold);
409 void CorrectionChromaticAberration(
uchar* src,
uchar* dst,
int width,
int height,
int ch);
427 void fresnelPropagation(
OphConfig context, Complex<Real>* in, Complex<Real>* out,
Real distance);
435 void fresnelPropagation(Complex<Real>* in, Complex<Real>* out,
Real distance,
uint channel);
444 void encodeSideBand(
bool bCPU, ivec2 sig_location);
456 void encodeSideBand_CPU(
int cropx1,
int cropx2,
int cropy1,
int cropy2, ivec2 sig_location);
469 void encodeSideBand_GPU(
int cropx1,
int cropx2,
int cropy1,
int cropy2, ivec2 sig_location);
478 void getShiftPhaseValue(Complex<Real>& shift_phase_val,
int idx, ivec2 sig_location);
487 void GetRandomPhaseValue(Complex<Real>& rand_phase_val,
bool rand_phase);
490 void GetMaxMin(
Real *src,
int len,
Real& max,
Real& min);
493 void AngularSpectrumMethod(Complex<Real> *src, Complex<Real> *dst,
Real lambda,
Real distance);
495 void RS_Diffraction(vec3 src, Complex<Real> *dst,
float lambda,
float distance,
float amplitude);
496 void RS_Diffraction(
uchar *src, Complex<Real> *dst,
Real lambda,
Real distance);
498 void Fresnel_FFT(Complex<Real> *src, Complex<Real> *dst,
Real lambda,
Real waveRatio,
Real distance);
500 bool readImage(
const char* fname,
bool bRGB);
501 void SetMode(
unsigned int mode) { m_mode = mode; }
541 : scale(0, 0, 0), distance(0), filter_shape_flag(0), focal_length_lens_in(0), focal_length_lens_out(0), focal_length_lens_eye_piece(0), tilt_angle(0, 0)
563 OphPointCloudData() :vertex(nullptr), color(nullptr), phase(nullptr) { n_points = 0; n_colors = 0; isPhaseParse = 0; }
660 OphIFTAConfig() :near_depthmap(0), far_depthmap(0), num_of_depth(0), num_of_iteration(0) {}
662 #endif // !__ophGen_h
Real focal_length_lens_eye_piece
Focal length of eyepiece lens.
Real * vertex
Geometry of point clouds.
int color_channels
The number of color.
Real fieldLength
fieldLength variable for viewing window.
Complex< Real > * normalized
Real * phase
Phase value of point clouds.
Real distance
Offset value of point cloud.
ulonglong n_points
Number of points.
Real fieldLength
fieldLength variable for viewing window.
uchar ** getNormalizedBuffer(void)
Function for getting the normalized(0~255) complex field buffer.
Real focal_length_lens_out
Focal length of output lens of Telecentric.
vec2 tilt_angle
Tilt angle for spatial filtering.
ivec2 & getEncodeSize(void)
Function for getting encode size.
Complex< Real > * src1FT
buffer to conv_fft2
int num_wrp
Number of wavefront recording plane(WRP)
Real focal_length_lens_in
Focal length of input lens of Telecentric.
void normalize(const Complex< T > *src, Complex< T > *dst, const int &size)
Normalize all elements of Complex<T>* src from 0 to 1.
void SetMode(unsigned int mode)
bool random_phase
If true, random phase is imposed on each depth layer.
vector< int > render_depth
Used when only few specific depth levels are rendered, usually for test purpose.
Real * color
Color data of point clouds.
Complex< Real > * fftTemp
vec3 scale
Scaling factor of coordinate of point cloud.
void setEncodeMethod(unsigned int ENCODE_FLAG)
vec3 scale
Scaling factor of coordinate of point cloud.
Real m_elapsedTime
Elapsed time of generate hologram.
unsigned long long ulonglong
ivec2 m_vecEncodeSize
Encoded hologram size, varied from encoding type.
Real near_depthmap
near value of depth in object
Real ** getEncodedBuffer(void)
Function for getting the encoded complex field buffer.
Real wrp_location
Location distance of WRP.
Real ** m_lpEncoded
buffer to encoded.
Real far_depthmap
far value of depth in object
Real near_depthmap
near value of depth in object
int ss
Binary Encoding - Error diffusion.
Real getElapsedTime()
Function for getting elapsed time.
Real * vertex
Vertex array.
Data for triangular mesh.
__managed__ float amplitude
Complex< Real > * weightC
SSB_PASSBAND
Passband in Single-side band encoding.
int n_colors
Number of color channel.
virtual bool loadAsOhc(const char *fname)
Function to read OHC file.
bool isPhaseParse
Selects wheter to parse the phase data.
int num_of_depth
num_of_depth = num_of_depth_quantization
vec2 filter_width
Width of spatial bandpass filter.
Configuration for Point Cloud.
uint num_of_depth_quantization
depth level of input depthmap.
Real propagation_distance
Distance of Hologram plane.
void SetRandomPhase(bool bRandomPhase)
bool change_depth_quantization
if true, change the depth quantization from the default value.
uchar ** m_lpNormalized
buffer to normalized.
Real far_depthmap
far value of depth in object
int8_t * filter_shape_flag
Shape of spatial bandpass filter ("Circle" or "Rect" for now)
uint default_depth_quantization
default value of the depth quantization - 256
int ENCODE_METHOD
Encoding method flag.
void setPrecision(uint precision)
Function for setting precision.
virtual void ophFree(void)
Pure virtual function for override in child classes.
uint * face_idx
Face indexes.
Configuration for Depth Map.