Openholo  v1.1
Open Source Digital Holographic Library
ophPointCloud Class Reference

Openholo Point Cloud based Compter-generated holography. More...

#include <ophPointCloud.h>

Inheritance diagram for ophPointCloud:
Collaboration diagram for ophPointCloud:

Public Types

enum  PC_DIFF_FLAG { PC_DIFF_RS, PC_DIFF_FRESNEL, PC_DIFF_RS, PC_DIFF_FRESNEL }
 
enum  PC_DIFF_FLAG { PC_DIFF_RS, PC_DIFF_FRESNEL, PC_DIFF_RS, PC_DIFF_FRESNEL }
 
- Public Types inherited from ophGen
enum  ENCODE_FLAG {
  ENCODE_PHASE, ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINEARY,
  ENCODE_SIMPLENI, ENCODE_BURCKHARDT, ENCODE_TWOPHASE, ENCODE_SSB,
  ENCODE_OFFSSB, ENCODE_SIMPLEBINARY, ENCODE_EDBINARY, ENCODE_PHASE,
  ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINEARY, ENCODE_SIMPLENI,
  ENCODE_BURCKHARDT, ENCODE_TWOPHASE, ENCODE_SSB, ENCODE_OFFSSB,
  ENCODE_SIMPLEBINARY, ENCODE_EDBINARY
}
 
enum  SSB_PASSBAND {
  SSB_LEFT, SSB_RIGHT, SSB_TOP, SSB_BOTTOM,
  SSB_LEFT, SSB_RIGHT, SSB_TOP, SSB_BOTTOM
}
 Passband in Single-side band encoding. More...
 
enum  ED_WType {
  FLOYD_STEINBERG, SINGLE_RIGHT, SINGLE_DOWN, ITERATIVE_DESIGN,
  FLOYD_STEINBERG, SINGLE_RIGHT, SINGLE_DOWN, ITERATIVE_DESIGN
}
 
enum  ENCODE_FLAG {
  ENCODE_PHASE, ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINEARY,
  ENCODE_SIMPLENI, ENCODE_BURCKHARDT, ENCODE_TWOPHASE, ENCODE_SSB,
  ENCODE_OFFSSB, ENCODE_SIMPLEBINARY, ENCODE_EDBINARY, ENCODE_PHASE,
  ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINEARY, ENCODE_SIMPLENI,
  ENCODE_BURCKHARDT, ENCODE_TWOPHASE, ENCODE_SSB, ENCODE_OFFSSB,
  ENCODE_SIMPLEBINARY, ENCODE_EDBINARY
}
 
enum  SSB_PASSBAND {
  SSB_LEFT, SSB_RIGHT, SSB_TOP, SSB_BOTTOM,
  SSB_LEFT, SSB_RIGHT, SSB_TOP, SSB_BOTTOM
}
 
enum  ED_WType {
  FLOYD_STEINBERG, SINGLE_RIGHT, SINGLE_DOWN, ITERATIVE_DESIGN,
  FLOYD_STEINBERG, SINGLE_RIGHT, SINGLE_DOWN, ITERATIVE_DESIGN
}
 

Public Member Functions

 ophPointCloud (void)
 Constructor. More...
 
 ophPointCloud (const char *, const char *cfg_file)
 
void setScale (Real sx, Real sy, Real sz)
 
void setDistance (Real distance)
 
void setFilterShapeFlag (int8_t *fsf)
 
void setFilterWidth (Real wx, Real wy)
 
void setFocalLength (Real lens_in, Real lens_out, Real lens_eye_piece)
 
void setTiltAngle (Real ax, Real ay)
 
void getScale (vec3 &scale)
 
Real getDistance (void)
 
int8_t * getFilterShapeFlag (void)
 
void getFilterWidth (vec2 &filterwidth)
 
void getFocalLength (Real *lens_in, Real *lens_out, Real *lens_eye_piece)
 
void getTiltAngle (vec2 &tiltangle)
 
Real ** getVertex (void)
 
Real ** getColorPC (void)
 
Real ** getPhasePC (void)
 
void setPointCloudModel (Real *vertex, Real *color, Real *phase)
 
void getPointCloudModel (Real *vertex, Real *color, Real *phase)
 
const RealgetModelVertex (Real *vertex)
 Directly Get Basic Data. More...
 
const RealgetModelColor (Real *color)
 Directly Get Basic Data. More...
 
const RealgetModelPhase (Real *phase)
 Directly Get Basic Data. More...
 
int getNumberOfPoints ()
 Directly Get Basic Data. More...
 
void setNumberOfPoints (int nPoint)
 Directly Set Basic Data. More...
 
void setMode (bool is_CPU)
 Set the value of a variable is_CPU(true or false) More...
 
void setPrecision (bool bPrecision)
 Function for setting precision. More...
 
bool getPrecision ()
 
bool isCPU ()
 get the value of a variable is_CPU(true or false) More...
 
 ophPointCloud (void)
 Constructor. More...
 
 ophPointCloud (const char *, const char *cfg_file)
 
void setScale (Real sx, Real sy, Real sz)
 
void setDistance (Real distance)
 
void setFilterShapeFlag (int8_t *fsf)
 
void setFilterWidth (Real wx, Real wy)
 
void setFocalLength (Real lens_in, Real lens_out, Real lens_eye_piece)
 
void setTiltAngle (Real ax, Real ay)
 
void getScale (vec3 &scale)
 
Real getDistance (void)
 
int8_t * getFilterShapeFlag (void)
 
void getFilterWidth (vec2 &filterwidth)
 
void getFocalLength (Real *lens_in, Real *lens_out, Real *lens_eye_piece)
 
void getTiltAngle (vec2 &tiltangle)
 
Real ** getVertex (void)
 
Real ** getColorPC (void)
 
Real ** getPhasePC (void)
 
void setPointCloudModel (Real *vertex, Real *color, Real *phase)
 
void getPointCloudModel (Real *vertex, Real *color, Real *phase)
 
const RealgetModelVertex (Real *vertex)
 Directly Get Basic Data. More...
 
const RealgetModelColor (Real *color)
 Directly Get Basic Data. More...
 
const RealgetModelPhase (Real *phase)
 Directly Get Basic Data. More...
 
int getNumberOfPoints ()
 Directly Get Basic Data. More...
 
void setNumberOfPoints (int nPoint)
 Directly Set Basic Data. More...
 
void setMode (bool is_CPU)
 Set the value of a variable is_CPU(true or false) More...
 
void setPrecision (bool bPrecision)
 Function for setting precision. More...
 
bool getPrecision ()
 
bool isCPU ()
 get the value of a variable is_CPU(true or false) More...
 
- Public Member Functions inherited from ophGen
 ophGen (void)
 Constructor. More...
 
Real ** getEncodedBuffer (void)
 Function for getting the encoded complex field buffer. More...
 
uchar ** getNormalizedBuffer (void)
 Function for getting the normalized(0~255) complex field buffer. More...
 
void initialize (void)
 Initialize variables for Hologram complex field, encoded data, normalized data. More...
 
int loadPointCloud (const char *pc_file, OphPointCloudData *pc_data_)
 load to point cloud data. More...
 
bool readConfig (const char *fname)
 load to configuration file. More...
 
void propagationAngularSpectrum (int ch, Complex< Real > *input_u, Real propagation_dist, Real k, Real lambda)
 Angular spectrum propagation method. More...
 
void conv_fft2 (Complex< Real > *src1, Complex< Real > *src2, Complex< Real > *dst, ivec2 size)
 Convolution between Complex arrays which have same size. More...
 
void normalize (void)
 Normalization function to save as image file after hologram creation. More...
 
bool save (const char *fname, uint8_t bitsperpixel=8, uchar *src=nullptr, uint px=0, uint py=0)
 Function for saving image files. More...
 
void * load (const char *fname)
 Function for loading image files. More...
 
virtual bool loadAsOhc (const char *fname)
 Function to read OHC file. More...
 
bool mergeColor (int idx, int width, int height, uchar *src, uchar *dst)
 
bool separateColor (int idx, int width, int height, uchar *src, uchar *dst)
 
void setEncodeMethod (unsigned int ENCODE_FLAG)
 
void encoding (unsigned int ENCODE_FLAG, Complex< Real > *holo=nullptr, Real *encoded=nullptr)
 Encoding Functions. More...
 
void encoding ()
 
virtual void encoding (unsigned int ENCODE_FLAG, unsigned int SSB_PASSBAND, Complex< Real > *holo=nullptr, Real *encoded=nullptr)
 
void encoding (unsigned int BIN_ENCODE_FLAG, unsigned int ENCODE_FLAG, Real threshold, Complex< Real > *holo=nullptr, Real *encoded=nullptr)
 Binary Encoding Functions. More...
 
bool Shift (Real x, Real y)
 
void waveCarry (Real carryingAngleX, Real carryingAngleY, Real distance)
 Wave carry. More...
 
void waveCarry (Complex< Real > *src, Complex< Real > *dst, Real wavelength, int carryIdxX, int carryIdxY)
 
void transVW (int nSize, Real *dst, Real *src)
 
int getStream ()
 
Real getFieldLength ()
 
ivec2 & getEncodeSize (void)
 Function for getting encode size. More...
 
void setResolution (ivec2 resolution)
 Function for setting buffer size. More...
 
Real getElapsedTime ()
 Function for getting elapsed time. More...
 
bool saveRefImages (char *fnameW, char *fnameWC, char *fnameAS, char *fnameSSB, char *fnameHP, char *fnameFreq, char *fnameReal, char *fnameBin, char *fnameReconBin, char *fnameReconErr, char *fnameReconNo)
 
void fresnelPropagation (OphConfig context, Complex< Real > *in, Complex< Real > *out, Real distance)
 Fresnel propagation. More...
 
void fresnelPropagation (Complex< Real > *in, Complex< Real > *out, Real distance, uint channel)
 Fresnel propagation. More...
 
void AngularSpectrum (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real distance)
 
void RS_Propagation (vec3 src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 
void RS_Propagation (uchar *src, Complex< Real > *dst, Real lambda, Real distance)
 
void Fresnel_Convolution (vec3 src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 
void Fresnel_FFT (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real waveRatio, Real distance)
 
bool readImage (const char *fname, bool bRGB)
 
 ophGen (void)
 Constructor. More...
 
Real ** getEncodedBuffer (void)
 Function for getting the encoded complex field buffer. More...
 
uchar ** getNormalizedBuffer (void)
 Function for getting the normalized(0~255) complex field buffer. More...
 
void initialize (void)
 Initialize variables for Hologram complex field, encoded data, normalized data. More...
 
int loadPointCloud (const char *pc_file, OphPointCloudData *pc_data_)
 load to point cloud data. More...
 
bool readConfig (const char *fname)
 load to configuration file. More...
 
void propagationAngularSpectrum (int ch, Complex< Real > *input_u, Real propagation_dist, Real k, Real lambda)
 Angular spectrum propagation method. More...
 
void conv_fft2 (Complex< Real > *src1, Complex< Real > *src2, Complex< Real > *dst, ivec2 size)
 Convolution between Complex arrays which have same size. More...
 
void normalize (void)
 Normalization function to save as image file after hologram creation. More...
 
bool save (const char *fname, uint8_t bitsperpixel=8, uchar *src=nullptr, uint px=0, uint py=0)
 Function for saving image files. More...
 
void * load (const char *fname)
 Function for loading image files. More...
 
virtual bool loadAsOhc (const char *fname)
 Function to read OHC file. More...
 
bool mergeColor (int idx, int width, int height, uchar *src, uchar *dst)
 
bool separateColor (int idx, int width, int height, uchar *src, uchar *dst)
 
void setEncodeMethod (unsigned int ENCODE_FLAG)
 
void encoding (unsigned int ENCODE_FLAG, Complex< Real > *holo=nullptr, Real *encoded=nullptr)
 Encoding Functions. More...
 
void encoding ()
 
virtual void encoding (unsigned int ENCODE_FLAG, unsigned int SSB_PASSBAND, Complex< Real > *holo=nullptr, Real *encoded=nullptr)
 
void encoding (unsigned int BIN_ENCODE_FLAG, unsigned int ENCODE_FLAG, Real threshold, Complex< Real > *holo=nullptr, Real *encoded=nullptr)
 Binary Encoding Functions. More...
 
bool Shift (Real x, Real y)
 
void waveCarry (Real carryingAngleX, Real carryingAngleY, Real distance)
 Wave carry. More...
 
void waveCarry (Complex< Real > *src, Complex< Real > *dst, Real wavelength, int carryIdxX, int carryIdxY)
 
void transVW (int nSize, Real *dst, Real *src)
 
int getStream ()
 
Real getFieldLength ()
 
ivec2 & getEncodeSize (void)
 Function for getting encode size. More...
 
void setResolution (ivec2 resolution)
 Function for setting buffer size. More...
 
Real getElapsedTime ()
 Function for getting elapsed time. More...
 
bool saveRefImages (char *fnameW, char *fnameWC, char *fnameAS, char *fnameSSB, char *fnameHP, char *fnameFreq, char *fnameReal, char *fnameBin, char *fnameReconBin, char *fnameReconErr, char *fnameReconNo)
 
void fresnelPropagation (OphConfig context, Complex< Real > *in, Complex< Real > *out, Real distance)
 Fresnel propagation. More...
 
void fresnelPropagation (Complex< Real > *in, Complex< Real > *out, Real distance, uint channel)
 Fresnel propagation. More...
 
void AngularSpectrum (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real distance)
 
void RS_Propagation (vec3 src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 
void RS_Propagation (uchar *src, Complex< Real > *dst, Real lambda, Real distance)
 
void Fresnel_Convolution (vec3 src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 
void Fresnel_FFT (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real waveRatio, Real distance)
 
bool readImage (const char *fname, bool bRGB)
 
- Public Member Functions inherited from Openholo
 Openholo (void)
 Constructor. More...
 
virtual bool saveAsImg (const char *fname, uint8_t bitsperpixel, uchar *src, int width, int height)
 Function for creating image files. More...
 
virtual ucharloadAsImg (const char *fname)
 Function for loading image files. More...
 
virtual bool saveAsOhc (const char *fname)
 Function to write OHC file
More...
 
Complex< Real > ** getComplexField (void)
 Function for getting the complex field. More...
 
OphConfiggetContext (void)
 Function for getting the current context. More...
 
void setPixelNumber (ivec2 n)
 Function for setting the output resolution. More...
 
void setPixelNumber (int width, int height)
 
void setPixelPitch (vec2 p)
 Function for setting the output pixel pitch. More...
 
void setPixelPitch (Real pitchX, Real pitchY)
 
void setWaveLength (Real w, const uint idx=0)
 Function for setting the wave length. More...
 
void setMergeImage (bool bMerge)
 
void setWaveNum (int nNum)
 
 Openholo (void)
 Constructor. More...
 
virtual bool saveAsImg (const char *fname, uint8_t bitsperpixel, uchar *src, int width, int height)
 Function for creating image files. More...
 
virtual ucharloadAsImg (const char *fname)
 Function for loading image files. More...
 
virtual bool saveAsOhc (const char *fname)
 Function to write OHC file
More...
 
Complex< Real > ** getComplexField (void)
 Function for getting the complex field. More...
 
OphConfiggetContext (void)
 Function for getting the current context. More...
 
void setPixelNumber (ivec2 n)
 Function for setting the output resolution. More...
 
void setPixelNumber (int width, int height)
 
void setPixelPitch (vec2 p)
 Function for setting the output pixel pitch. More...
 
void setPixelPitch (Real pitchX, Real pitchY)
 
void setWaveLength (Real w, const uint idx=0)
 Function for setting the wave length. More...
 
void setMergeImage (bool bMerge)
 
void setWaveNum (int nNum)
 
- Public Member Functions inherited from Base
 Base (void)
 Constructor. More...
 
unsigned long addRef (void)
 If referenced this(Base's child, not abstract class) instance, must call this method. More...
 
unsigned long release (void)
 Call release() when reference is finished. More...
 
 Base (void)
 Constructor. More...
 
unsigned long addRef (void)
 If referenced this(Base's child, not abstract class) instance, must call this method. More...
 
unsigned long release (void)
 Call release() when reference is finished. More...
 

Protected Member Functions

virtual ~ophPointCloud (void)
 Destructor. More...
 
virtual ~ophPointCloud (void)
 Destructor. More...
 
- Protected Member Functions inherited from ophGen
virtual ~ophGen (void)=0
 Destructor. More...
 
bool save (const char *fname, uint8_t bitsperpixel, uint px, uint py, uint fnum, uchar *args ...)
 Called when saving multiple hologram data at a time. More...
 
void resetBuffer ()
 reset buffer More...
 
void RealPart (Complex< Real > *holo, Real *encoded, const int size)
 Encoding method. More...
 
void ImaginearyPart (Complex< Real > *holo, Real *encoded, const int size)
 
void Phase (Complex< Real > *holo, Real *encoded, const int size)
 
void Amplitude (Complex< Real > *holo, Real *encoded, const int size)
 
void TwoPhase (Complex< Real > *holo, Real *encoded, const int size)
 
void Burckhardt (Complex< Real > *holo, Real *encoded, const int size)
 
void SimpleNI (Complex< Real > *holo, Real *encoded, const int size)
 
void singleSideBand (Complex< Real > *holo, Real *encoded, const ivec2 holosize, int passband)
 Encoding method. More...
 
void freqShift (Complex< Real > *src, Complex< Real > *dst, const ivec2 holosize, int shift_x, int shift_y)
 Frequency shift. More...
 
bool binaryErrorDiffusion (Complex< Real > *holo, Real *encoded, const ivec2 holosize, const int type, Real threshold)
 
bool getWeightED (const ivec2 holosize, const int type, ivec2 *pNw)
 
bool shiftW (ivec2 holosize)
 
void binarization (Complex< Real > *src, Real *dst, const int size, int ENCODE_FLAG, Real threshold)
 
void encodeSideBand (bool bCPU, ivec2 sig_location)
 Encode the CGH according to a signal location parameter. More...
 
void encodeSideBand_CPU (int cropx1, int cropx2, int cropy1, int cropy2, ivec2 sig_location)
 Encode the CGH according to a signal location parameter on the CPU. More...
 
void encodeSideBand_GPU (int cropx1, int cropx2, int cropy1, int cropy2, ivec2 sig_location)
 Encode the CGH according to a signal location parameter on the GPU. More...
 
void getShiftPhaseValue (Complex< Real > &shift_phase_val, int idx, ivec2 sig_location)
 Calculate the shift phase value. More...
 
void getRandPhaseValue (Complex< Real > &rand_phase_val, bool rand_phase)
 Assign random phase value if RANDOM_PHASE == 1. More...
 
void ScaleChange (Real *src, Real *dst, int nSize, Real scaleX, Real scaleY, Real scaleZ)
 
void GetMaxMin (Real *src, int len, Real &max, Real &min)
 
virtual ~ophGen (void)=0
 Destructor. More...
 
bool save (const char *fname, uint8_t bitsperpixel, uint px, uint py, uint fnum, uchar *args ...)
 Called when saving multiple hologram data at a time. More...
 
void resetBuffer ()
 reset buffer More...
 
void RealPart (Complex< Real > *holo, Real *encoded, const int size)
 Encoding method. More...
 
void ImaginearyPart (Complex< Real > *holo, Real *encoded, const int size)
 
void Phase (Complex< Real > *holo, Real *encoded, const int size)
 
void Amplitude (Complex< Real > *holo, Real *encoded, const int size)
 
void TwoPhase (Complex< Real > *holo, Real *encoded, const int size)
 
void Burckhardt (Complex< Real > *holo, Real *encoded, const int size)
 
void SimpleNI (Complex< Real > *holo, Real *encoded, const int size)
 
void singleSideBand (Complex< Real > *holo, Real *encoded, const ivec2 holosize, int passband)
 Encoding method. More...
 
void freqShift (Complex< Real > *src, Complex< Real > *dst, const ivec2 holosize, int shift_x, int shift_y)
 Frequency shift. More...
 
bool binaryErrorDiffusion (Complex< Real > *holo, Real *encoded, const ivec2 holosize, const int type, Real threshold)
 
bool getWeightED (const ivec2 holosize, const int type, ivec2 *pNw)
 
bool shiftW (ivec2 holosize)
 
void binarization (Complex< Real > *src, Real *dst, const int size, int ENCODE_FLAG, Real threshold)
 
void encodeSideBand (bool bCPU, ivec2 sig_location)
 Encode the CGH according to a signal location parameter. More...
 
void encodeSideBand_CPU (int cropx1, int cropx2, int cropy1, int cropy2, ivec2 sig_location)
 Encode the CGH according to a signal location parameter on the CPU. More...
 
void encodeSideBand_GPU (int cropx1, int cropx2, int cropy1, int cropy2, ivec2 sig_location)
 Encode the CGH according to a signal location parameter on the GPU. More...
 
void getShiftPhaseValue (Complex< Real > &shift_phase_val, int idx, ivec2 sig_location)
 Calculate the shift phase value. More...
 
void getRandPhaseValue (Complex< Real > &rand_phase_val, bool rand_phase)
 Assign random phase value if RANDOM_PHASE == 1. More...
 
void ScaleChange (Real *src, Real *dst, int nSize, Real scaleX, Real scaleY, Real scaleZ)
 
void GetMaxMin (Real *src, int len, Real &max, Real &min)
 
- Protected Member Functions inherited from Openholo
virtual ~Openholo (void)=0
 Destructor. More...
 
bool checkExtension (const char *fname, const char *ext)
 Functions for extension checking. More...
 
bool loadAsImgUpSideDown (const char *fname, uchar *dst)
 Function for loading image files | Output image data upside down. More...
 
bool getImgSize (int &w, int &h, int &bytesperpixel, const char *fname)
 Function for getting the image size. More...
 
void imgScaleBilinear (uchar *src, uchar *dst, int w, int h, int neww, int newh, int channels=1)
 Function for change image size. More...
 
void ImageRotation (double rotate, uchar *src, uchar *dst, int w, int h, int channels)
 
void convertToFormatGray8 (uchar *src, uchar *dst, int w, int h, int bytesperpixel)
 Function for convert image format to gray8. More...
 
void fft1 (int n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
 Functions for performing fftw 1-dimension operations inside Openholo. More...
 
void fft2 (ivec2 n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
 Functions for performing fftw 2-dimension operations inside Openholo. More...
 
void fft3 (ivec3 n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
 Functions for performing fftw 3-dimension operations inside Openholo. More...
 
void fftExecute (Complex< Real > *out, bool bReverse=false)
 Execution functions to be called after fft1, fft2, and fft3. More...
 
void fftFree (void)
 
void fftwShift (Complex< Real > *src, Complex< Real > *dst, int nx, int ny, int type, bool bNormalized=false)
 Convert data from the spatial domain to the frequency domain using 2D FFT on CPU. More...
 
void fftShift (int nx, int ny, Complex< Real > *input, Complex< Real > *output)
 Swap the top-left quadrant of data with the bottom-right , and the top-right quadrant with the bottom-left. More...
 
void setPixelNumberOHC (const ivec2 pixel_number)
 getter/setter for OHC file read and write More...
 
void setPixelPitchOHC (const vec2 pixel_pitch)
 
void setWavelengthOHC (const Real wavelength, const LenUnit wavelength_unit)
 
void setWaveLengthNumOHC (const uint wavelength_num)
 
void setColorTypeOHC (const ColorType color_type)
 
void setColorArrangeOHC (const ColorArran color_arrange)
 
void setWaveLengthUnitOHC (const LenUnit length_unit)
 
void setFieldEncodingOHC (const FldStore field_store, const FldCodeType field_code_type)
 
void setPhaseEncodingOHC (const BPhaseCode phase_code, const vec2 phase_code_range)
 
void addWaveLengthNComplexFieldDataOHC (const Real wavelength, const OphComplexField &complex_field)
 Function to add ComplexField when adding wavelength data. More...
 
void addWaveLengthOHC (const Real wavelength)
 
void addComplexFieldDataOHC (const OphComplexField &complex_field)
 
void getPixelNumberOHC (ivec2 &pixel_number)
 
void getPixelPitchOHC (vec2 &pixel_pitch)
 
void getWavelengthOHC (vector< Real > &wavelength)
 
void getWaveLengthNumOHC (uint &wavelength_num)
 
void getColorTypeOHC (ColorType &color_type)
 
void getColorArrangeOHC (ColorArran &color_arrange)
 
void getWaveLengthUnitOHC (LenUnit &length_unit)
 
void getComplexFieldDataOHC (Complex< Real > **cmplx, uint wavelen_idx)
 
void getComplexFieldDataOHC (OphComplexField &cmplx, uint wavelen_idx)
 
virtual ~Openholo (void)=0
 Destructor. More...
 
bool checkExtension (const char *fname, const char *ext)
 Functions for extension checking. More...
 
bool loadAsImgUpSideDown (const char *fname, uchar *dst)
 Function for loading image files | Output image data upside down. More...
 
bool getImgSize (int &w, int &h, int &bytesperpixel, const char *fname)
 Function for getting the image size. More...
 
void imgScaleBilinear (uchar *src, uchar *dst, int w, int h, int neww, int newh, int channels=1)
 Function for change image size. More...
 
void ImageRotation (double rotate, uchar *src, uchar *dst, int w, int h, int channels)
 
void convertToFormatGray8 (uchar *src, uchar *dst, int w, int h, int bytesperpixel)
 Function for convert image format to gray8. More...
 
void fft1 (int n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
 Functions for performing fftw 1-dimension operations inside Openholo. More...
 
void fft2 (ivec2 n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
 Functions for performing fftw 2-dimension operations inside Openholo. More...
 
void fft3 (ivec3 n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
 Functions for performing fftw 3-dimension operations inside Openholo. More...
 
void fftExecute (Complex< Real > *out, bool bReverse=false)
 Execution functions to be called after fft1, fft2, and fft3. More...
 
void fftFree (void)
 
void fftwShift (Complex< Real > *src, Complex< Real > *dst, int nx, int ny, int type, bool bNormalized=false)
 Convert data from the spatial domain to the frequency domain using 2D FFT on CPU. More...
 
void fftShift (int nx, int ny, Complex< Real > *input, Complex< Real > *output)
 Swap the top-left quadrant of data with the bottom-right , and the top-right quadrant with the bottom-left. More...
 
void setPixelNumberOHC (const ivec2 pixel_number)
 getter/setter for OHC file read and write More...
 
void setPixelPitchOHC (const vec2 pixel_pitch)
 
void setWavelengthOHC (const Real wavelength, const LenUnit wavelength_unit)
 
void setWaveLengthNumOHC (const uint wavelength_num)
 
void setColorTypeOHC (const ColorType color_type)
 
void setColorArrangeOHC (const ColorArran color_arrange)
 
void setWaveLengthUnitOHC (const LenUnit length_unit)
 
void setFieldEncodingOHC (const FldStore field_store, const FldCodeType field_code_type)
 
void setPhaseEncodingOHC (const BPhaseCode phase_code, const vec2 phase_code_range)
 
void addWaveLengthNComplexFieldDataOHC (const Real wavelength, const OphComplexField &complex_field)
 Function to add ComplexField when adding wavelength data. More...
 
void addWaveLengthOHC (const Real wavelength)
 
void addComplexFieldDataOHC (const OphComplexField &complex_field)
 
void getPixelNumberOHC (ivec2 &pixel_number)
 
void getPixelPitchOHC (vec2 &pixel_pitch)
 
void getWavelengthOHC (vector< Real > &wavelength)
 
void getWaveLengthNumOHC (uint &wavelength_num)
 
void getColorTypeOHC (ColorType &color_type)
 
void getColorArrangeOHC (ColorArran &color_arrange)
 
void getWaveLengthUnitOHC (LenUnit &length_unit)
 
void getComplexFieldDataOHC (Complex< Real > **cmplx, uint wavelen_idx)
 
void getComplexFieldDataOHC (OphComplexField &cmplx, uint wavelen_idx)
 
- Protected Member Functions inherited from Base
virtual ~Base (void)
 Destructor. More...
 
virtual ~Base (void)
 Destructor. More...
 
int loadPointCloud (const char *pc_file)
 override More...
 
bool readConfig (const char *cfg_file)
 Import Specification Config File(*.config) file. More...
 
Real generateHologram (uint diff_flag=PC_DIFF_RS)
 Generate a hologram, main funtion. More...
 
void encodeHologram (vec2 band_limit=vec2(0.8, 0.5), vec2 spectrum_shift=vec2(0.0, 0.5))
 encode Single-side band More...
 
virtual void encoding (unsigned int ENCODE_FLAG)
 
virtual void encoding (unsigned int ENCODE_FLAG, unsigned int SSB_PASSBAND)
 
void setViewingWindow (bool is_ViewingWindow)
 Set the value of a variable is_ViewingWindow(true or false) More...
 
uintgetProgress ()
 Get the value of a CGH progress status. More...
 
int loadPointCloud (const char *pc_file)
 override More...
 
bool readConfig (const char *cfg_file)
 Import Specification Config File(*.config) file. More...
 
Real generateHologram (uint diff_flag=PC_DIFF_RS)
 Generate a hologram, main funtion. More...
 
void encodeHologram (vec2 band_limit=vec2(0.8, 0.5), vec2 spectrum_shift=vec2(0.0, 0.5))
 encode Single-side band More...
 
virtual void encoding (unsigned int ENCODE_FLAG)
 
virtual void encoding (unsigned int ENCODE_FLAG, unsigned int SSB_PASSBAND)
 
void setViewingWindow (bool is_ViewingWindow)
 Set the value of a variable is_ViewingWindow(true or false) More...
 
uintgetProgress ()
 Get the value of a CGH progress status. More...
 

Additional Inherited Members

- Public Attributes inherited from ophGen
uchar * imgRGB
 
uchar * imgDepth
 
int m_width
 
int m_height
 
int m_bpp
 
- Protected Attributes inherited from ophGen
ivec2 m_vecEncodeSize
 Encoded hologram size, varied from encoding type. More...
 
int ENCODE_METHOD
 Encoding method flag. More...
 
int SSB_PASSBAND
 Passband in Single-side band encoding. More...
 
Real m_elapsedTime
 Elapsed time of generate hologram. More...
 
Real ** m_lpEncoded
 buffer to encoded. More...
 
uchar ** m_lpNormalized
 buffer to normalized. More...
 
Real m_dFieldLength
 
int m_nStream
 
Complex< Real > * src1FT
 buffer to conv_fft2 More...
 
Complex< Real > * src2FT
 
Complex< Real > * dstFT
 
int ss
 Binary Encoding - Error diffusion. More...
 
Complex< Real > * AS
 
Complex< Real > * normalized
 
Complex< Real > * fftTemp
 
Realweight
 
Complex< Real > * weightC
 
Complex< Real > * freqW
 
RealrealEnc
 
Realbinary
 
RealmaskSSB
 
RealmaskHP
 
- Protected Attributes inherited from Openholo
OphConfig context_
 
Complex< Real > ** complex_H
 
ImgEncoderOhcOHC_encoder
 OHC file format Variables for read and write. More...
 
ImgDecoderOhcOHC_decoder
 
- Protected Attributes inherited from Base
unsigned long refCnt
 

Detailed Description

Openholo Point Cloud based Compter-generated holography.

Author

Definition at line 548 of file ophPointCloud.h.

Member Enumeration Documentation

◆ PC_DIFF_FLAG [1/2]

Enumerator
PC_DIFF_RS 
PC_DIFF_FRESNEL 
PC_DIFF_RS 
PC_DIFF_FRESNEL 

Definition at line 551 of file ophPointCloud.h.

◆ PC_DIFF_FLAG [2/2]

Enumerator
PC_DIFF_RS 
PC_DIFF_FRESNEL 
PC_DIFF_RS 
PC_DIFF_FRESNEL 

Definition at line 551 of file ophPointCloud.h.

Constructor & Destructor Documentation

◆ ophPointCloud() [1/4]

ophPointCloud::ophPointCloud ( void  )
explicit

Constructor.

Initialize variables.

Definition at line 52 of file ophPointCloud.cpp.

◆ ophPointCloud() [2/4]

ophPointCloud::ophPointCloud ( const char *  pc_file,
const char *  cfg_file 
)
explicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 63 of file ophPointCloud.cpp.

◆ ~ophPointCloud() [1/2]

ophPointCloud::~ophPointCloud ( void  )
protectedvirtual

Destructor.

Definition at line 76 of file ophPointCloud.cpp.

◆ ophPointCloud() [3/4]

ophPointCloud::ophPointCloud ( void  )
explicit

Constructor.

Initialize variables.

◆ ophPointCloud() [4/4]

ophPointCloud::ophPointCloud ( const char *  ,
const char *  cfg_file 
)
explicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ~ophPointCloud() [2/2]

virtual ophPointCloud::~ophPointCloud ( void  )
protectedvirtual

Destructor.

Member Function Documentation

◆ encodeHologram() [1/2]

void ophPointCloud::encodeHologram ( vec2  band_limit = vec2(0.8, 0.5),
vec2  spectrum_shift = vec2(0.0, 0.5) 
)

encode Single-side band

Parameters
Vectorband limit
Vectorspecturm shift

Definition at line 182 of file ophPointCloud.cpp.

◆ encodeHologram() [2/2]

void ophPointCloud::encodeHologram ( vec2  band_limit = vec2(0.8, 0.5),
vec2  spectrum_shift = vec2(0.0, 0.5) 
)

encode Single-side band

Parameters
Vectorband limit
Vectorspecturm shift

◆ encoding() [1/4]

virtual void ophPointCloud::encoding ( unsigned int  ENCODE_FLAG)
virtual

◆ encoding() [2/4]

void ophPointCloud::encoding ( unsigned int  ENCODE_FLAG)
virtual

Definition at line 265 of file ophPointCloud.cpp.

◆ encoding() [3/4]

void ophPointCloud::encoding ( unsigned int  ENCODE_FLAG,
unsigned int  SSB_PASSBAND 
)
virtual

Definition at line 270 of file ophPointCloud.cpp.

◆ encoding() [4/4]

virtual void ophPointCloud::encoding ( unsigned int  ENCODE_FLAG,
unsigned int  SSB_PASSBAND 
)
virtual

◆ generateHologram() [1/2]

Real ophPointCloud::generateHologram ( uint  diff_flag = PC_DIFF_RS)

Generate a hologram, main funtion.

Parameters
Selectdiffraction flag
PC_DIFF_RS: Diffraction using R-S integral
PC_DIFF_FRESNEL: Diffraction using Fresnel integral
Returns
implement time (sec)

Definition at line 145 of file ophPointCloud.cpp.

◆ generateHologram() [2/2]

Real ophPointCloud::generateHologram ( uint  diff_flag = PC_DIFF_RS)

Generate a hologram, main funtion.

Parameters
Selectdiffraction flag
PC_DIFF_RS: Diffraction using R-S integral
PC_DIFF_FRESNEL: Diffraction using Fresnel integral
Returns
implement time (sec)

◆ getColorPC() [1/2]

Real** ophPointCloud::getColorPC ( void  )
inline

Definition at line 589 of file ophPointCloud.h.

◆ getColorPC() [2/2]

Real** ophPointCloud::getColorPC ( void  )
inline

Definition at line 589 of file ophPointCloud.h.

◆ getDistance() [1/2]

Real ophPointCloud::getDistance ( void  )
inline

Definition at line 579 of file ophPointCloud.h.

◆ getDistance() [2/2]

Real ophPointCloud::getDistance ( void  )
inline

Definition at line 579 of file ophPointCloud.h.

◆ getFilterShapeFlag() [1/2]

int8_t* ophPointCloud::getFilterShapeFlag ( void  )
inline

Definition at line 580 of file ophPointCloud.h.

◆ getFilterShapeFlag() [2/2]

int8_t* ophPointCloud::getFilterShapeFlag ( void  )
inline

Definition at line 580 of file ophPointCloud.h.

◆ getFilterWidth() [1/2]

void ophPointCloud::getFilterWidth ( vec2 &  filterwidth)
inline

Definition at line 581 of file ophPointCloud.h.

◆ getFilterWidth() [2/2]

void ophPointCloud::getFilterWidth ( vec2 &  filterwidth)
inline

Definition at line 581 of file ophPointCloud.h.

◆ getFocalLength() [1/2]

void ophPointCloud::getFocalLength ( Real lens_in,
Real lens_out,
Real lens_eye_piece 
)
inline

Definition at line 582 of file ophPointCloud.h.

◆ getFocalLength() [2/2]

void ophPointCloud::getFocalLength ( Real lens_in,
Real lens_out,
Real lens_eye_piece 
)
inline

Definition at line 582 of file ophPointCloud.h.

◆ getModelColor() [1/2]

const Real* ophPointCloud::getModelColor ( Real color)
inline

Directly Get Basic Data.

Parameters
Color3D Point Cloud Color Data

Definition at line 611 of file ophPointCloud.h.

◆ getModelColor() [2/2]

const Real* ophPointCloud::getModelColor ( Real color)
inline

Directly Get Basic Data.

Parameters
Color3D Point Cloud Color Data

Definition at line 611 of file ophPointCloud.h.

◆ getModelPhase() [1/2]

const Real* ophPointCloud::getModelPhase ( Real phase)
inline

Directly Get Basic Data.

Parameters
Phase3D Point Cloud Model Phase Data of Point-Based Light Wave

Definition at line 616 of file ophPointCloud.h.

◆ getModelPhase() [2/2]

const Real* ophPointCloud::getModelPhase ( Real phase)
inline

Directly Get Basic Data.

Parameters
Phase3D Point Cloud Model Phase Data of Point-Based Light Wave

Definition at line 616 of file ophPointCloud.h.

◆ getModelVertex() [1/2]

const Real* ophPointCloud::getModelVertex ( Real vertex)
inline

Directly Get Basic Data.

Parameters
Vertex3D Point Cloud Geometry Data

Definition at line 606 of file ophPointCloud.h.

◆ getModelVertex() [2/2]

const Real* ophPointCloud::getModelVertex ( Real vertex)
inline

Directly Get Basic Data.

Parameters
Vertex3D Point Cloud Geometry Data

Definition at line 606 of file ophPointCloud.h.

◆ getNumberOfPoints() [1/2]

int ophPointCloud::getNumberOfPoints ( )
inline

Directly Get Basic Data.

Returns
int 3D Point Cloud count

Definition at line 621 of file ophPointCloud.h.

◆ getNumberOfPoints() [2/2]

int ophPointCloud::getNumberOfPoints ( )
inline

Directly Get Basic Data.

Returns
int 3D Point Cloud count

Definition at line 621 of file ophPointCloud.h.

◆ getPhasePC() [1/2]

Real** ophPointCloud::getPhasePC ( void  )
inline

Definition at line 590 of file ophPointCloud.h.

◆ getPhasePC() [2/2]

Real** ophPointCloud::getPhasePC ( void  )
inline

Definition at line 590 of file ophPointCloud.h.

◆ getPointCloudModel() [1/2]

void ophPointCloud::getPointCloudModel ( Real vertex,
Real color,
Real phase 
)
inline

Definition at line 596 of file ophPointCloud.h.

◆ getPointCloudModel() [2/2]

void ophPointCloud::getPointCloudModel ( Real vertex,
Real color,
Real phase 
)
inline

Definition at line 596 of file ophPointCloud.h.

◆ getPrecision() [1/2]

bool ophPointCloud::getPrecision ( )
inline

Definition at line 644 of file ophPointCloud.h.

◆ getPrecision() [2/2]

bool ophPointCloud::getPrecision ( )
inline

Definition at line 644 of file ophPointCloud.h.

◆ getProgress() [1/2]

uint* ophPointCloud::getProgress ( )
inline

Get the value of a CGH progress status.

Returns
pointer of percent

Definition at line 716 of file ophPointCloud.h.

◆ getProgress() [2/2]

uint* ophPointCloud::getProgress ( )
inline

Get the value of a CGH progress status.

Returns
pointer of percent

Definition at line 716 of file ophPointCloud.h.

◆ getScale() [1/2]

void ophPointCloud::getScale ( vec3 &  scale)
inline

Definition at line 578 of file ophPointCloud.h.

◆ getScale() [2/2]

void ophPointCloud::getScale ( vec3 &  scale)
inline

Definition at line 578 of file ophPointCloud.h.

◆ getTiltAngle() [1/2]

void ophPointCloud::getTiltAngle ( vec2 &  tiltangle)
inline

Definition at line 587 of file ophPointCloud.h.

◆ getTiltAngle() [2/2]

void ophPointCloud::getTiltAngle ( vec2 &  tiltangle)
inline

Definition at line 587 of file ophPointCloud.h.

◆ getVertex() [1/2]

Real** ophPointCloud::getVertex ( void  )
inline

Definition at line 588 of file ophPointCloud.h.

◆ getVertex() [2/2]

Real** ophPointCloud::getVertex ( void  )
inline

Definition at line 588 of file ophPointCloud.h.

◆ isCPU() [1/2]

bool ophPointCloud::isCPU ( )
inline

get the value of a variable is_CPU(true or false)

if is_CPU == true
CPU implementation
else
GPU implementation 
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

Definition at line 657 of file ophPointCloud.h.

◆ isCPU() [2/2]

bool ophPointCloud::isCPU ( )
inline

get the value of a variable is_CPU(true or false)

if is_CPU == true
CPU implementation
else
GPU implementation 
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

Definition at line 657 of file ophPointCloud.h.

◆ loadPointCloud() [1/2]

int ophPointCloud::loadPointCloud ( const char *  pc_file)

override

Import Point Cloud Data Base File : *.dat file. This Function is included memory location of Input Point Clouds. override

Parameters
[in]InputModelFilePointCloud(*.dat) input file path
Returns
number of Pointcloud (if it failed loading, it returned -1)

Definition at line 90 of file ophPointCloud.cpp.

◆ loadPointCloud() [2/2]

int ophPointCloud::loadPointCloud ( const char *  pc_file)

override

Import Point Cloud Data Base File : *.dat file. This Function is included memory location of Input Point Clouds. override

Parameters
[in]InputModelFilePointCloud(*.dat) input file path
Returns
number of Pointcloud (if it failed loading, it returned -1)

◆ readConfig() [1/2]

bool ophPointCloud::readConfig ( const char *  cfg_file)

Import Specification Config File(*.config) file.

Parameters
InputConfigFileSpecification Config(*.config) file path

Definition at line 97 of file ophPointCloud.cpp.

◆ readConfig() [2/2]

bool ophPointCloud::readConfig ( const char *  cfg_file)

Import Specification Config File(*.config) file.

Parameters
InputConfigFileSpecification Config(*.config) file path

◆ setDistance() [1/2]

void ophPointCloud::setDistance ( Real  distance)
inline

Definition at line 572 of file ophPointCloud.h.

◆ setDistance() [2/2]

void ophPointCloud::setDistance ( Real  distance)
inline

Definition at line 572 of file ophPointCloud.h.

◆ setFilterShapeFlag() [1/2]

void ophPointCloud::setFilterShapeFlag ( int8_t *  fsf)
inline

Definition at line 573 of file ophPointCloud.h.

◆ setFilterShapeFlag() [2/2]

void ophPointCloud::setFilterShapeFlag ( int8_t *  fsf)
inline

Definition at line 573 of file ophPointCloud.h.

◆ setFilterWidth() [1/2]

void ophPointCloud::setFilterWidth ( Real  wx,
Real  wy 
)
inline

Definition at line 574 of file ophPointCloud.h.

◆ setFilterWidth() [2/2]

void ophPointCloud::setFilterWidth ( Real  wx,
Real  wy 
)
inline

Definition at line 574 of file ophPointCloud.h.

◆ setFocalLength() [1/2]

void ophPointCloud::setFocalLength ( Real  lens_in,
Real  lens_out,
Real  lens_eye_piece 
)
inline

Definition at line 575 of file ophPointCloud.h.

◆ setFocalLength() [2/2]

void ophPointCloud::setFocalLength ( Real  lens_in,
Real  lens_out,
Real  lens_eye_piece 
)
inline

Definition at line 575 of file ophPointCloud.h.

◆ setMode() [1/2]

void ophPointCloud::setMode ( bool  is_CPU)

Set the value of a variable is_CPU(true or false)

if is_CPU == true
CPU implementation
else
GPU implementation 
Parameters
[in]is_CPUthe value for specifying whether the hologram generation method is implemented on the CPU or GPU

◆ setMode() [2/2]

void ophPointCloud::setMode ( bool  is_CPU)

Set the value of a variable is_CPU(true or false)

if is_CPU == true
CPU implementation
else
GPU implementation 
Parameters
[in]is_CPUthe value for specifying whether the hologram generation method is implemented on the CPU or GPU

Definition at line 80 of file ophPointCloud.cpp.

◆ setNumberOfPoints() [1/2]

void ophPointCloud::setNumberOfPoints ( int  nPoint)
inline

Directly Set Basic Data.

Definition at line 625 of file ophPointCloud.h.

◆ setNumberOfPoints() [2/2]

void ophPointCloud::setNumberOfPoints ( int  nPoint)
inline

Directly Set Basic Data.

Definition at line 625 of file ophPointCloud.h.

◆ setPointCloudModel() [1/2]

void ophPointCloud::setPointCloudModel ( Real vertex,
Real color,
Real phase 
)
inline

Definition at line 591 of file ophPointCloud.h.

◆ setPointCloudModel() [2/2]

void ophPointCloud::setPointCloudModel ( Real vertex,
Real color,
Real phase 
)
inline

Definition at line 591 of file ophPointCloud.h.

◆ setPrecision() [1/2]

void ophPointCloud::setPrecision ( bool  bPrecision)
inline

Function for setting precision.

Parameters
[in]precisionlevel.

Definition at line 643 of file ophPointCloud.h.

◆ setPrecision() [2/2]

void ophPointCloud::setPrecision ( bool  bPrecision)
inline

Function for setting precision.

Parameters
[in]precisionlevel.

Definition at line 643 of file ophPointCloud.h.

◆ setScale() [1/2]

void ophPointCloud::setScale ( Real  sx,
Real  sy,
Real  sz 
)
inline

Definition at line 571 of file ophPointCloud.h.

◆ setScale() [2/2]

void ophPointCloud::setScale ( Real  sx,
Real  sy,
Real  sz 
)
inline

Definition at line 571 of file ophPointCloud.h.

◆ setTiltAngle() [1/2]

void ophPointCloud::setTiltAngle ( Real  ax,
Real  ay 
)
inline

Definition at line 576 of file ophPointCloud.h.

◆ setTiltAngle() [2/2]

void ophPointCloud::setTiltAngle ( Real  ax,
Real  ay 
)
inline

Definition at line 576 of file ophPointCloud.h.

◆ setViewingWindow() [1/2]

void ophPointCloud::setViewingWindow ( bool  is_ViewingWindow)

Set the value of a variable is_ViewingWindow(true or false)

if is_ViewingWindow == true
Transform viewing window
else
Hologram 
Parameters
is_ViewingWindow: the value for specifying whether the hologram generation method is implemented on the viewing window

Definition at line 85 of file ophPointCloud.cpp.

◆ setViewingWindow() [2/2]

void ophPointCloud::setViewingWindow ( bool  is_ViewingWindow)

Set the value of a variable is_ViewingWindow(true or false)

if is_ViewingWindow == true
Transform viewing window
else
Hologram 
Parameters
is_ViewingWindow: the value for specifying whether the hologram generation method is implemented on the viewing window

The documentation for this class was generated from the following files: