46 #ifndef __ophPointCloud_h 47 #define __ophPointCloud_h 49 #define _USE_MATH_DEFINES 59 #define OPH_Bitsperpixel 8 //24 // 3byte=24 61 #define OPH_Compression 0 62 #define OPH_Xpixelpermeter 0x130B //2835 , 72 DPI 63 #define OPH_Ypixelpermeter 0x130B //2835 , 72 DPI 64 #define OPH_Pixel 0xFF 571 inline void setScale(
Real sx,
Real sy,
Real sz) { pc_config_.scale.v[0] = sx; pc_config_.scale.v[1] = sy; pc_config_.scale.v[2] = sz; }
575 inline void setFocalLength(
Real lens_in,
Real lens_out,
Real lens_eye_piece) { pc_config_.focal_length_lens_in = lens_in; pc_config_.focal_length_lens_out = lens_out; pc_config_.focal_length_lens_eye_piece = lens_eye_piece; }
576 inline void setTiltAngle(
Real ax,
Real ay) { pc_config_.tilt_angle.v[0] = ax; pc_config_.tilt_angle.v[1] = ay; }
578 inline void getScale(vec3& scale) { scale = pc_config_.scale; }
581 inline void getFilterWidth(vec2& filterwidth) { filterwidth = pc_config_.filter_width; }
583 if (lens_in !=
nullptr) *lens_in = pc_config_.focal_length_lens_in;
584 if (lens_out !=
nullptr) *lens_out = pc_config_.focal_length_lens_out;
585 if (lens_eye_piece !=
nullptr) *lens_eye_piece = pc_config_.focal_length_lens_eye_piece;
587 inline void getTiltAngle(vec2& tiltangle) { tiltangle = pc_config_.tilt_angle; }
592 pc_data_.vertex = vertex;
593 pc_data_.color = color;
594 pc_data_.phase = phase;
597 getModelVertex(vertex);
598 getModelColor(color);
599 getModelPhase(phase);
606 inline const Real*
getModelVertex(
Real *vertex) { vertex != NULL ? vertex = pc_data_.vertex : vertex;
return pc_data_.vertex; }
611 inline const Real*
getModelColor(
Real *color) { color != NULL ? color = pc_data_.color : color;
return pc_data_.color; }
616 inline const Real*
getModelPhase(
Real *phase) { phase != NULL ? phase = pc_data_.phase : phase;
return pc_data_.phase; }
652 int loadPointCloud(
const char* pc_file);
662 bool readConfig(
const char* cfg_file);
671 Real generateHologram(
uint diff_flag = PC_DIFF_RS);
677 void encodeHologram(vec2 band_limit = vec2(0.8, 0.5), vec2 spectrum_shift = vec2(0.0, 0.5));
679 virtual void encoding(
unsigned int ENCODE_FLAG);
680 virtual void encoding(
unsigned int ENCODE_FLAG,
unsigned int SSB_PASSBAND);
691 void setViewingWindow(
bool is_ViewingWindow);
710 Real genCghPointCloudCPU(
uint diff_flag);
712 void diffractEncodedRS(
uint channel, ivec2 pn, vec2 pp, vec2 ss, vec3 pc,
Real k,
Real amplitude, vec2 theta);
725 Real genCghPointCloudGPU(
uint diff_flag);
727 virtual void ophFree(
void);
729 bool is_ViewingWindow;
736 #endif // !__ophPointCloud_h void setScale(Real sx, Real sy, Real sz)
void setFilterShapeFlag(int8_t *fsf)
void getScale(vec3 &scale)
void setTiltAngle(Real ax, Real ay)
void getTiltAngle(vec2 &tiltangle)
const Real * getModelColor(Real *color)
Directly Get Basic Data.
void setDistance(Real distance)
void setFocalLength(Real lens_in, Real lens_out, Real lens_eye_piece)
void setFilterWidth(Real wx, Real wy)
const Real * getModelPhase(Real *phase)
Directly Get Basic Data.
void getPointCloudModel(Real *vertex, Real *color, Real *phase)
void getFocalLength(Real *lens_in, Real *lens_out, Real *lens_eye_piece)
Openholo Point Cloud based Compter-generated holography.
const Real * getModelVertex(Real *vertex)
Directly Get Basic Data.
__managed__ float amplitude
int8_t * getFilterShapeFlag(void)
void setPointCloudModel(Real *vertex, Real *color, Real *phase)
Configuration for Point Cloud.
int getNumberOfPoints()
Directly Get Basic Data.
void setNumberOfPoints(int nPoint)
Directly Set Basic Data.
void getFilterWidth(vec2 &filterwidth)
uint * getProgress()
Get the value of a CGH progress status.
bool isCPU()
get the value of a variable generation mode (true or false)