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);
218 bool save(
const char* fname, uint8_t bitsperpixel = 8,
uchar* src =
nullptr,
uint px = 0,
uint py = 0);
224 void* load(
const char* fname);
233 virtual bool loadAsOhc(
const char *fname);
246 bool save(
const char* fname, uint8_t bitsperpixel,
uint px,
uint py,
uint fnum,
uchar* args ...);
279 void encoding(
unsigned int ENCODE_FLAG);
295 virtual void encoding(
unsigned int ENCODE_FLAG,
unsigned int SSB_PASSBAND,
Complex<Real>* holo =
nullptr,
Real* encoded =
nullptr);
315 void encoding(
unsigned int BIN_ENCODE_FLAG,
unsigned int ENCODE_FLAG,
Real threshold,
Complex<Real>* holo =
nullptr,
Real* encoded =
nullptr);
326 void waveCarry(
Real carryingAngleX,
Real carryingAngleY,
Real distance);
355 void transVW(
int nVertex,
Real *dst,
Real *src);
370 void setResolution(
ivec2 resolution);
386 template <
typename T>
387 void RealPart(
Complex<T>* holo, T* encoded,
const int size);
388 template <
typename T>
389 void ImaginaryPart(
Complex<T>* holo, T* encoded,
const int size);
390 template <
typename T>
391 void Phase(
Complex<T>* holo, T* encoded,
const int size);
392 template <
typename T>
393 void Amplitude(
Complex<T>* holo, T* encoded,
const int size);
394 template <
typename T>
395 void TwoPhase(
Complex<T>* holo, T* encoded,
const int size);
396 template <
typename T>
397 void Burckhardt(
Complex<T>* holo, T* encoded,
const int size);
398 template <
typename T>
399 void SimpleNI(
Complex<T>* holo, T* encoded,
const int size);
423 bool saveRefImages(
char* fnameW,
char* fnameWC,
char* fnameAS,
char* fnameSSB,
char* fnameHP,
char* fnameFreq,
char* fnameReal,
char* fnameBin,
char* fnameReconBin,
char* fnameReconErr,
char* fnameReconNo);
440 bool getWeightED(
const ivec2 holosize,
const int type,
ivec2* pNw);
441 bool shiftW(
ivec2 holosize);
443 void CorrectionChromaticAberration(
uchar* src,
uchar* dst,
int width,
int height,
int ch);
478 void encodeSideBand(
bool bCPU,
ivec2 sig_location);
490 void encodeSideBand_CPU(
int cropx1,
int cropx2,
int cropy1,
int cropy2,
ivec2 sig_location);
503 void encodeSideBand_GPU(
int cropx1,
int cropx2,
int cropy1,
int cropy2,
ivec2 sig_location);
521 void GetRandomPhaseValue(
Complex<Real>& rand_phase_val,
bool rand_phase);
524 void GetMaxMin(
Real *src,
int len,
Real& max,
Real& min);
539 void SetMode(
unsigned int mode) { m_mode = mode; }
575 : 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)
637 OphDepthMapConfig() :fieldLength(0.0), near_depthmap(0.0), far_depthmap(0.0), num_of_depth(0), change_depth_quantization(false)
638 , default_depth_quantization(0), num_of_depth_quantization(0), random_phase(false) {}
669 : fieldLength(0.0), scale(0.0, 0.0, 0.0), num_wrp(0), wrp_location(0.0), propagation_distance(0.0)
673 : fieldLength(_fieldLength), scale(_scale), num_wrp(_num_wrp), wrp_location(_wrp_location), propagation_distance(_propagation_distance)
690 OphIFTAConfig() :near_depthmap(0), far_depthmap(0), num_of_depth(0), num_of_iteration(0) {}
692 :near_depthmap(_near_depthmap), far_depthmap(_far_depthmap), num_of_depth(_num_of_depth), num_of_iteration(_num_of_iteration) {}
696 #endif // !__ophGen_h
Real focal_length_lens_eye_piece
Focal length of eyepiece lens.
OphWRPConfig(Real _fieldLength, vec3 _scale, int _num_wrp, Real _wrp_location, Real _propagation_distance)
Real fieldLength
fieldLength variable for viewing window.
Real distance
Offset value of point cloud.
OphIFTAConfig(Real _near_depthmap, Real _far_depthmap, int _num_of_depth, int _num_of_iteration)
ulonglong n_points
Number of points.
Complex< Real > * weightC
Real fieldLength
fieldLength variable for viewing window.
uchar ** getNormalizedBuffer(void)
Function for getting the normalized(0~255) complex field buffer.
Real ** m_lpEncoded
buffer to encoded.
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.
int num_wrp
Number of wavefront recording plane(WRP)
Real focal_length_lens_in
Focal length of input lens of Telecentric.
structure for 2-dimensional integer vector and its arithmetic.
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)
bool random_phase
If true, random phase is imposed on each depth layer.
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.
structure for 2-dimensional Real type vector and its arithmetic.
Complex< Real > * fftTemp
Real far_depthmap
far value of depth in object
Real near_depthmap
near value of depth in object
Real getElapsedTime()
Function for getting elapsed time.
Data for triangular mesh.
int8_t * filter_shape_flag
Shape of spatial bandpass filter ("Circle" or "Rect" for now)
structure for 3-dimensional Real type vector and its arithmetic.
int SSB_PASSBAND
Passband in Single-side band encoding.
int n_colors
Number of color channel.
Vertex * vertices
Data of point clouds.
virtual bool loadAsOhc(const char *fname)
Function to read OHC file.
int num_of_depth
num_of_depth = num_of_depth_quantization
vec2 filter_width
Width of spatial bandpass filter.
Configuration for Point Cloud.
uchar ** m_lpNormalized
buffer to normalized.
Complex< Real > * AS
Binary Encoding - Error diffusion.
uint num_of_depth_quantization
depth level of input depthmap.
Real propagation_distance
Distance of Hologram plane.
void SetRandomPhase(bool bRandomPhase)
Function for setting the random phase.
bool change_depth_quantization
if true, change the depth quantization from the default value.
Complex< Real > * normalized
Real far_depthmap
far value of depth in object
vector< int > render_depth
Used when only few specific depth levels are rendered, usually for test purpose.
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.
Configuration for Depth Map.