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);
293 ivec2 m_vecEncodeSize;
303 uchar** m_lpNormalized;
315 Complex<Real>* src1FT;
316 Complex<Real>* src2FT;
317 Complex<Real>* dstFT;
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);
386 enum ED_WType { FLOYD_STEINBERG, SINGLE_RIGHT, SINGLE_DOWN, ITERATIVE_DESIGN };
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);
393 Complex<Real>* normalized;
394 Complex<Real>* fftTemp;
396 Complex<Real>* weightC;
397 Complex<Real>* freqW;
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; }
528 int8_t* filter_shape_flag;
532 Real focal_length_lens_in;
534 Real focal_length_lens_out;
536 Real focal_length_lens_eye_piece;
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; }
599 vector<int> render_depth;
601 bool change_depth_quantization;
603 uint default_depth_quantization;
605 uint num_of_depth_quantization;
643 Real propagation_distance;
658 int num_of_iteration;
660 OphIFTAConfig() :near_depthmap(0), far_depthmap(0), num_of_depth(0), num_of_iteration(0) {}
662 #endif // !__ophGen_h
uchar ** getNormalizedBuffer(void)
Function for getting the normalized(0~255) complex field buffer.
ivec2 & getEncodeSize(void)
Function for getting encode size.
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.
__managed__ float amplitude
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)
void setPrecision(uint precision)
Function for setting precision.
virtual void ophFree(void)
Pure virtual function for override in child classes.
Configuration for Depth Map.