53 #define GEN_DLL __declspec(dllexport) 55 #define GEN_DLL __declspec(dllimport) 59 #define GEN_DLL __attribute__((visibility("default"))) 108 virtual ~
ophGen(
void) = 0;
129 void initialize(
void);
148 bool readConfig(
const char* fname);
158 void RS_Diffraction(
Point src, Complex<Real> *dst,
Real lambda,
Real distance,
Real amplitude);
168 void Fresnel_Diffraction(
Point src, Complex<Real> *dst,
Real lambda,
Real distance,
Real amplitude);
178 void Fresnel_FFT(Complex<Real> *src, Complex<Real> *dst,
Real lambda,
Real waveRatio,
Real distance);
189 void AngularSpectrumMethod(Complex<Real>* src, Complex<Real>* dst,
Real lambda,
Real distance);
198 void conv_fft2(Complex<Real>* src1, Complex<Real>* src2, Complex<Real>* dst, ivec2 size);
217 bool save(
const char* fname, uint8_t bitsperpixel = 8,
uchar* src =
nullptr,
uint px = 0,
uint py = 0);
223 void* load(
const char* fname);
232 virtual bool loadAsOhc(
const char *fname);
245 bool save(
const char* fname, uint8_t bitsperpixel,
uint px,
uint py,
uint fnum,
uchar* args ...);
278 void encoding(
unsigned int ENCODE_FLAG);
279 void encoding(
unsigned int ENCODE_FLAG, Complex<Real>* holo,
Real* encoded);
294 virtual void encoding(
unsigned int ENCODE_FLAG,
unsigned int SSB_PASSBAND, Complex<Real>* holo =
nullptr,
Real* encoded =
nullptr);
314 void encoding(
unsigned int BIN_ENCODE_FLAG,
unsigned int ENCODE_FLAG,
Real threshold, Complex<Real>* holo =
nullptr,
Real* encoded =
nullptr);
325 void waveCarry(
Real carryingAngleX,
Real carryingAngleY,
Real distance);
327 void waveCarry(Complex<Real>* src, Complex<Real>* dst,
Real wavelength,
int carryIdxX,
int carryIdxY);
330 ivec2 m_vecEncodeSize;
340 uchar** m_lpNormalized;
354 void transVW(
int nVertex,
Real *dst,
Real *src);
369 void setResolution(ivec2 resolution);
385 template <
typename T>
386 void RealPart(Complex<T>* holo, T* encoded,
const int size);
387 template <
typename T>
388 void ImaginaryPart(Complex<T>* holo, T* encoded,
const int size);
389 template <
typename T>
390 void Phase(Complex<T>* holo, T* encoded,
const int size);
391 template <
typename T>
392 void Amplitude(Complex<T>* holo, T* encoded,
const int size);
393 template <
typename T>
394 void TwoPhase(Complex<T>* holo, T* encoded,
const int size);
395 template <
typename T>
396 void Burckhardt(Complex<T>* holo, T* encoded,
const int size);
397 template <
typename T>
398 void SimpleNI(Complex<T>* holo, T* encoded,
const int size);
407 void singleSideBand(Complex<Real>* holo,
Real* encoded,
const ivec2 holosize,
int passband);
417 void freqShift(Complex<Real>* holo, Complex<Real>* encoded,
const ivec2 holosize,
int shift_x,
int shift_y);
421 enum ED_WType { FLOYD_STEINBERG, SINGLE_RIGHT, SINGLE_DOWN, ITERATIVE_DESIGN };
422 bool saveRefImages(
char* fnameW,
char* fnameWC,
char* fnameAS,
char* fnameSSB,
char* fnameHP,
char* fnameFreq,
char* fnameReal,
char* fnameBin,
char* fnameReconBin,
char* fnameReconErr,
char* fnameReconNo);
427 Complex<Real>* normalized;
428 Complex<Real>* fftTemp;
430 Complex<Real>* weightC;
431 Complex<Real>* freqW;
438 bool binaryErrorDiffusion(Complex<Real>* holo,
Real* encoded,
const ivec2 holosize,
const int type,
Real threshold);
439 bool getWeightED(
const ivec2 holosize,
const int type, ivec2* pNw);
440 bool shiftW(ivec2 holosize);
441 void binarization(Complex<Real>* src,
Real* dst,
const int size,
int ENCODE_FLAG,
Real threshold);
442 void CorrectionChromaticAberration(
uchar* src,
uchar* dst,
int width,
int height,
int ch);
460 void fresnelPropagation(
OphConfig context, Complex<Real>* in, Complex<Real>* out,
Real distance);
468 void fresnelPropagation(Complex<Real>* in, Complex<Real>* out,
Real distance,
uint channel);
477 void encodeSideBand(
bool bCPU, ivec2 sig_location);
489 void encodeSideBand_CPU(
int cropx1,
int cropx2,
int cropy1,
int cropy2, ivec2 sig_location);
502 void encodeSideBand_GPU(
int cropx1,
int cropx2,
int cropy1,
int cropy2, ivec2 sig_location);
511 void getShiftPhaseValue(Complex<Real>& shift_phase_val,
int idx, ivec2 sig_location);
520 void GetRandomPhaseValue(Complex<Real>& rand_phase_val,
bool rand_phase);
523 void GetMaxMin(
Real *src,
int len,
Real& max,
Real& min);
538 void SetMode(
unsigned int mode) { m_mode = mode; }
561 int8_t* filter_shape_flag;
565 Real focal_length_lens_in;
567 Real focal_length_lens_out;
569 Real focal_length_lens_eye_piece;
574 : scale(0.0, 0.0, 0.0), distance(0.0), filter_shape_flag(0), focal_length_lens_in(0.0), focal_length_lens_out(0.0), focal_length_lens_eye_piece(0.0), tilt_angle(0.0, 0.0)
626 vector<int> render_depth;
628 bool change_depth_quantization;
630 uint default_depth_quantization;
632 uint num_of_depth_quantization;
636 OphDepthMapConfig() :fieldLength(0.0), near_depthmap(0.0), far_depthmap(0.0), num_of_depth(0), change_depth_quantization(false)
637 , default_depth_quantization(0), num_of_depth_quantization(0), random_phase(false) {}
665 Real propagation_distance;
668 : fieldLength(0.0), scale(0.0, 0.0, 0.0), num_wrp(0), wrp_location(0.0), propagation_distance(0.0)
672 : fieldLength(_fieldLength), scale(_scale), num_wrp(_num_wrp), wrp_location(_wrp_location), propagation_distance(_propagation_distance)
687 int num_of_iteration;
689 OphIFTAConfig() :near_depthmap(0), far_depthmap(0), num_of_depth(0), num_of_iteration(0) {}
691 :near_depthmap(_near_depthmap), far_depthmap(_far_depthmap), num_of_depth(_num_of_depth), num_of_iteration(_num_of_iteration) {}
695 #endif // !__ophGen_h
OphWRPConfig(Real _fieldLength, vec3 _scale, int _num_wrp, Real _wrp_location, Real _propagation_distance)
OphIFTAConfig(Real _near_depthmap, Real _far_depthmap, int _num_of_depth, int _num_of_iteration)
uchar ** getNormalizedBuffer(void)
Function for getting the normalized(0~255) complex field buffer.
ivec2 & getEncodeSize(void)
Function for getting encode size.
bool GetRandomPhase()
Function for getting the random phase.
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)
void setEncodeMethod(unsigned int ENCODE_FLAG)
unsigned long long ulonglong
Real ** getEncodedBuffer(void)
Function for getting the encoded complex field buffer.
Real getElapsedTime()
Function for getting elapsed time.
Data for triangular mesh.
SSB_PASSBAND
Passband in Single-side band encoding.
virtual bool loadAsOhc(const char *fname)
Function to read OHC file.
Configuration for Point Cloud.
void SetRandomPhase(bool bRandomPhase)
Function for setting the random phase.
void setPrecision(uint precision)
Function for setting precision.
virtual void ophFree(void)
Pure virtual function for override in child classes.
Configuration for Depth Map.