Openholo  v4.1
Open Source Digital Holographic Library
ophGen Class Referenceabstract

#include <ophGen.h>

Inheritance diagram for ophGen:
Collaboration diagram for ophGen:

Public Types

enum  PRECISION { SINGLE, DOUBLE, SINGLE, DOUBLE }
 
enum  ENCODE_FLAG {
  ENCODE_PHASE, ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINARY,
  ENCODE_SIMPLENI, ENCODE_BURCKHARDT, ENCODE_TWOPHASE, ENCODE_SSB,
  ENCODE_OFFSSB, ENCODE_SIMPLEBINARY, ENCODE_EDBINARY, ENCODE_PHASE,
  ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINARY, 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  PRECISION { SINGLE, DOUBLE, SINGLE, DOUBLE }
 
enum  ENCODE_FLAG {
  ENCODE_PHASE, ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINARY,
  ENCODE_SIMPLENI, ENCODE_BURCKHARDT, ENCODE_TWOPHASE, ENCODE_SSB,
  ENCODE_OFFSSB, ENCODE_SIMPLEBINARY, ENCODE_EDBINARY, ENCODE_PHASE,
  ENCODE_AMPLITUDE, ENCODE_REAL, ENCODE_IMAGINARY, 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

 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 RS_Diffraction (Point src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 RS-diffraction method. More...
 
void Fresnel_Diffraction (Point src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 Fresnel-diffraction method. More...
 
void Fresnel_FFT (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real waveRatio, Real distance)
 Fresnel-fft method. More...
 
void AngularSpectrumMethod (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real distance)
 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...
 
void setPrecision (uint precision)
 Function for setting precision. More...
 
uint getPrecision ()
 
void setEncodeMethod (unsigned int ENCODE_FLAG)
 
void encoding (unsigned int ENCODE_FLAG)
 Encoding Functions. More...
 
void encoding (unsigned int ENCODE_FLAG, Complex< Real > *holo, Real *encoded)
 
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 nVertex, Vertex *dst, Vertex *src)
 
void transVW (int nVertex, 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 SetRandomPhase (bool bRandomPhase)
 Function for setting the random phase. More...
 
bool GetRandomPhase ()
 Function for getting the random phase. More...
 
void SetMode (unsigned int mode)
 
unsigned int GetMode ()
 
 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 RS_Diffraction (Point src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 RS-diffraction method. More...
 
void Fresnel_Diffraction (Point src, Complex< Real > *dst, Real lambda, Real distance, Real amplitude)
 Fresnel-diffraction method. More...
 
void Fresnel_FFT (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real waveRatio, Real distance)
 Fresnel-fft method. More...
 
void AngularSpectrumMethod (Complex< Real > *src, Complex< Real > *dst, Real lambda, Real distance)
 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...
 
void setPrecision (uint precision)
 Function for setting precision. More...
 
uint getPrecision ()
 
void setEncodeMethod (unsigned int ENCODE_FLAG)
 
void encoding (unsigned int ENCODE_FLAG)
 Encoding Functions. More...
 
void encoding (unsigned int ENCODE_FLAG, Complex< Real > *holo, Real *encoded)
 
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 nVertex, Vertex *dst, Vertex *src)
 
void transVW (int nVertex, Real *dst, Real *src)
 
int getStream ()
 
Real getFieldLength ()
 
ivec2getEncodeSize (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 SetRandomPhase (bool bRandomPhase)
 Function for setting the random phase. More...
 
bool GetRandomPhase ()
 Function for getting the random phase. More...
 
void SetMode (unsigned int mode)
 
unsigned int GetMode ()
 
- 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...
 
ImageConfiggetImageConfig ()
 Function for getting the image config. 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 setWaveNum (int num)
 Function for setting the wave number. More...
 
void setOffset (ivec2 offset)
 Function for setting the offset. More...
 
void setImageMerge (bool merge)
 Function for setting the image merge(true or false) More...
 
void setImageRotate (bool rotate)
 Function for setting the image rotate(true or false) More...
 
void setImageFlip (int flip)
 Function for setting the image flip. More...
 
void setMaxThreadNum (int num)
 Function for setting the max thread num. More...
 
int getMaxThreadNum ()
 Function for getting the max thread num. More...
 
bool mergeColor (int idx, int width, int height, uchar *src, uchar *dst)
 Function for generate RGB image from each grayscale image. More...
 
bool separateColor (int idx, int width, int height, uchar *src, uchar *dst)
 Function for generate each grayscale image from RGB image. More...
 
 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...
 
ImageConfiggetImageConfig ()
 Function for getting the image config. 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 setWaveNum (int num)
 Function for setting the wave number. More...
 
void setOffset (ivec2 offset)
 Function for setting the offset. More...
 
void setImageMerge (bool merge)
 Function for setting the image merge(true or false) More...
 
void setImageRotate (bool rotate)
 Function for setting the image rotate(true or false) More...
 
void setImageFlip (int flip)
 Function for setting the image flip. More...
 
void setMaxThreadNum (int num)
 Function for setting the max thread num. More...
 
int getMaxThreadNum ()
 Function for getting the max thread num. More...
 
bool mergeColor (int idx, int width, int height, uchar *src, uchar *dst)
 Function for generate RGB image from each grayscale image. More...
 
bool separateColor (int idx, int width, int height, uchar *src, uchar *dst)
 Function for generate each grayscale image from RGB image. More...
 
- 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 ~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...
 
template<typename T >
void RealPart (Complex< T > *holo, T *encoded, const int size)
 Encoding method. More...
 
template<typename T >
void ImaginaryPart (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void Phase (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void Amplitude (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void TwoPhase (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void Burckhardt (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void SimpleNI (Complex< T > *holo, T *encoded, const int size)
 
void singleSideBand (Complex< Real > *holo, Real *encoded, const ivec2 holosize, int passband)
 Encoding method. More...
 
void freqShift (Complex< Real > *holo, Complex< Real > *encoded, 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 CorrectionChromaticAberration (uchar *src, uchar *dst, int width, int height, int ch)
 
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 GetRandomPhaseValue (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 void ophFree (void)
 Pure virtual function for override in child classes. More...
 
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...
 
template<typename T >
void RealPart (Complex< T > *holo, T *encoded, const int size)
 Encoding method. More...
 
template<typename T >
void ImaginaryPart (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void Phase (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void Amplitude (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void TwoPhase (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void Burckhardt (Complex< T > *holo, T *encoded, const int size)
 
template<typename T >
void SimpleNI (Complex< T > *holo, T *encoded, const int size)
 
void singleSideBand (Complex< Real > *holo, Real *encoded, const ivec2 holosize, int passband)
 Encoding method. More...
 
void freqShift (Complex< Real > *holo, Complex< Real > *encoded, 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 CorrectionChromaticAberration (uchar *src, uchar *dst, int width, int height, int ch)
 
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 GetRandomPhaseValue (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 void ophFree (void)
 Pure virtual function for override in child classes. More...
 
- 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 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)
 Resource release method. More...
 
void fftInit2D (ivec2 size, int sign, unsigned int flag)
 initialize method for 2D FFT More...
 
void fft2 (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 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)
 Resource release method. More...
 
void fftInit2D (ivec2 size, int sign, unsigned int flag)
 initialize method for 2D FFT More...
 
void fft2 (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...
 

Protected Attributes

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
 
unsigned int m_mode
 
Complex< Real > * AS
 Binary Encoding - Error diffusion. More...
 
Complex< Real > * normalized
 
Complex< Real > * fftTemp
 
Realweight
 
Complex< Real > * weightC
 
Complex< Real > * freqW
 
RealrealEnc
 
Realbinary
 
RealmaskSSB
 
RealmaskHP
 
bool m_bRandomPhase
 
- Protected Attributes inherited from Openholo
OphConfig context_
 
ResolutionConfig resCfg
 
ImageConfig imgCfg
 
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

Author

Definition at line 76 of file ophGen.h.

Member Enumeration Documentation

◆ ED_WType [1/2]

Enumerator
FLOYD_STEINBERG 
SINGLE_RIGHT 
SINGLE_DOWN 
ITERATIVE_DESIGN 
FLOYD_STEINBERG 
SINGLE_RIGHT 
SINGLE_DOWN 
ITERATIVE_DESIGN 

Definition at line 421 of file ophGen.h.

◆ ED_WType [2/2]

Enumerator
FLOYD_STEINBERG 
SINGLE_RIGHT 
SINGLE_DOWN 
ITERATIVE_DESIGN 
FLOYD_STEINBERG 
SINGLE_RIGHT 
SINGLE_DOWN 
ITERATIVE_DESIGN 

Definition at line 421 of file ophGen.h.

◆ ENCODE_FLAG [1/2]

Enumerator
ENCODE_PHASE 
ENCODE_AMPLITUDE 
ENCODE_REAL 
ENCODE_IMAGINARY 
ENCODE_SIMPLENI 
ENCODE_BURCKHARDT 
ENCODE_TWOPHASE 
ENCODE_SSB 
ENCODE_OFFSSB 
ENCODE_SIMPLEBINARY 
ENCODE_EDBINARY 
ENCODE_PHASE 
ENCODE_AMPLITUDE 
ENCODE_REAL 
ENCODE_IMAGINARY 
ENCODE_SIMPLENI 
ENCODE_BURCKHARDT 
ENCODE_TWOPHASE 
ENCODE_SSB 
ENCODE_OFFSSB 
ENCODE_SIMPLEBINARY 
ENCODE_EDBINARY 

Definition at line 84 of file ophGen.h.

◆ ENCODE_FLAG [2/2]

Enumerator
ENCODE_PHASE 
ENCODE_AMPLITUDE 
ENCODE_REAL 
ENCODE_IMAGINARY 
ENCODE_SIMPLENI 
ENCODE_BURCKHARDT 
ENCODE_TWOPHASE 
ENCODE_SSB 
ENCODE_OFFSSB 
ENCODE_SIMPLEBINARY 
ENCODE_EDBINARY 
ENCODE_PHASE 
ENCODE_AMPLITUDE 
ENCODE_REAL 
ENCODE_IMAGINARY 
ENCODE_SIMPLENI 
ENCODE_BURCKHARDT 
ENCODE_TWOPHASE 
ENCODE_SSB 
ENCODE_OFFSSB 
ENCODE_SIMPLEBINARY 
ENCODE_EDBINARY 

Definition at line 84 of file ophGen.h.

◆ PRECISION [1/2]

Enumerator
SINGLE 
DOUBLE 
SINGLE 
DOUBLE 

Definition at line 79 of file ophGen.h.

◆ PRECISION [2/2]

Enumerator
SINGLE 
DOUBLE 
SINGLE 
DOUBLE 

Definition at line 79 of file ophGen.h.

◆ SSB_PASSBAND [1/2]

Passband in Single-side band encoding.

Enumerator
SSB_LEFT 
SSB_RIGHT 
SSB_TOP 
SSB_BOTTOM 
SSB_LEFT 
SSB_RIGHT 
SSB_TOP 
SSB_BOTTOM 

Definition at line 295 of file ophGen.h.

◆ SSB_PASSBAND [2/2]

Enumerator
SSB_LEFT 
SSB_RIGHT 
SSB_TOP 
SSB_BOTTOM 
SSB_LEFT 
SSB_RIGHT 
SSB_TOP 
SSB_BOTTOM 

Definition at line 295 of file ophGen.h.

Constructor & Destructor Documentation

◆ ophGen() [1/2]

ophGen::ophGen ( void  )
explicit

Constructor.

Definition at line 112 of file ophGen.cpp.

◆ ~ophGen() [1/2]

ophGen::~ophGen ( void  )
protectedpure virtual

Destructor.

Definition at line 140 of file ophGen.cpp.

◆ ophGen() [2/2]

ophGen::ophGen ( void  )
explicit

Constructor.

◆ ~ophGen() [2/2]

virtual ophGen::~ophGen ( void  )
protectedpure virtual

Destructor.

Member Function Documentation

◆ Amplitude() [1/2]

template<typename T >
void ophGen::Amplitude ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Definition at line 1952 of file ophGen.cpp.

◆ Amplitude() [2/2]

template<typename T >
void ophGen::Amplitude ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

◆ AngularSpectrumMethod() [1/2]

void ophGen::AngularSpectrumMethod ( Complex< Real > *  src,
Complex< Real > *  dst,
Real  lambda,
Real  distance 
)

Angular spectrum propagation method.

Parameters
[in]srcEach depth plane data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
See also
calcHoloCPU, fft2

Definition at line 606 of file ophGen.cpp.

◆ AngularSpectrumMethod() [2/2]

void ophGen::AngularSpectrumMethod ( Complex< Real > *  src,
Complex< Real > *  dst,
Real  lambda,
Real  distance 
)

Angular spectrum propagation method.

Parameters
[in]srcEach depth plane data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
See also
calcHoloCPU, fft2

◆ binarization() [1/2]

void ophGen::binarization ( Complex< Real > *  src,
Real dst,
const int  size,
int  ENCODE_FLAG,
Real  threshold 
)
protected

Definition at line 1428 of file ophGen.cpp.

◆ binarization() [2/2]

void ophGen::binarization ( Complex< Real > *  src,
Real dst,
const int  size,
int  ENCODE_FLAG,
Real  threshold 
)
protected

◆ binaryErrorDiffusion() [1/2]

bool ophGen::binaryErrorDiffusion ( Complex< Real > *  holo,
Real encoded,
const ivec2  holosize,
const int  type,
Real  threshold 
)
protected

Definition at line 1259 of file ophGen.cpp.

◆ binaryErrorDiffusion() [2/2]

bool ophGen::binaryErrorDiffusion ( Complex< Real > *  holo,
Real encoded,
const ivec2  holosize,
const int  type,
Real  threshold 
)
protected

◆ Burckhardt() [1/2]

template<typename T >
void ophGen::Burckhardt ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Definition at line 1998 of file ophGen.cpp.

◆ Burckhardt() [2/2]

template<typename T >
void ophGen::Burckhardt ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

◆ conv_fft2() [1/2]

void ophGen::conv_fft2 ( Complex< Real > *  src1,
Complex< Real > *  src2,
Complex< Real > *  dst,
ivec2  size 
)

Convolution between Complex arrays which have same size.

Parameters
[in]src1convolution matrix 1
[in]src2convolution matrix 2
[in]dstconvolution destination matrix
[in]sizematrix size

Definition at line 655 of file ophGen.cpp.

◆ conv_fft2() [2/2]

void ophGen::conv_fft2 ( Complex< Real > *  src1,
Complex< Real > *  src2,
Complex< Real > *  dst,
ivec2  size 
)

Convolution between Complex arrays which have same size.

Parameters
[in]src1convolution matrix 1
[in]src2convolution matrix 2
[in]dstconvolution destination matrix
[in]sizematrix size

◆ CorrectionChromaticAberration() [1/2]

void ophGen::CorrectionChromaticAberration ( uchar *  src,
uchar *  dst,
int  width,
int  height,
int  ch 
)
protected

Definition at line 2123 of file ophGen.cpp.

◆ CorrectionChromaticAberration() [2/2]

void ophGen::CorrectionChromaticAberration ( uchar src,
uchar dst,
int  width,
int  height,
int  ch 
)
protected

◆ encodeSideBand() [1/2]

void ophGen::encodeSideBand ( bool  bCPU,
ivec2  sig_location 
)
protected

Encode the CGH according to a signal location parameter.

Parameters
[in]bCPUSelect whether to operate with CPU or GPU
[in]sig_locationSignal location
sig_location[0]: upper or lower half, sig_location[1]:left or right half.
See also
encodeSideBand_CPU, encodeSideBand_GPU

Definition at line 1714 of file ophGen.cpp.

◆ encodeSideBand() [2/2]

void ophGen::encodeSideBand ( bool  bCPU,
ivec2  sig_location 
)
protected

Encode the CGH according to a signal location parameter.

Parameters
[in]bCPUSelect whether to operate with CPU or GPU
[in]sig_locationSignal location
sig_location[0]: upper or lower half, sig_location[1]:left or right half.
See also
encodeSideBand_CPU, encodeSideBand_GPU

◆ encodeSideBand_CPU() [1/2]

void ophGen::encodeSideBand_CPU ( int  cropx1,
int  cropx2,
int  cropy1,
int  cropy2,
ivec2  sig_location 
)
protected

Encode the CGH according to a signal location parameter on the CPU.

The CPU variable, (*complex_H) on CPU has the final result.

Parameters
[in]cropx1the start x-coordinate to crop
[in]cropx2the end x-coordinate to crop
[in]cropy1the start y-coordinate to crop
[in]cropy2the end y-coordinate to crop
[in]sig_locationSignal location
sig_location[0]: upper or lower half, sig_location[1]:left or right half.
See also
fft2

◆ encodeSideBand_CPU() [2/2]

void ophGen::encodeSideBand_CPU ( int  cropx1,
int  cropx2,
int  cropy1,
int  cropy2,
oph::ivec2  sig_location 
)
protected

Encode the CGH according to a signal location parameter on the CPU.

The CPU variable, (*complex_H) on CPU has the final result.

Parameters
[in]cropx1the start x-coordinate to crop
[in]cropx2the end x-coordinate to crop
[in]cropy1the start y-coordinate to crop
[in]cropy2the end y-coordinate to crop
[in]sig_locationSignal location
sig_location[0]: upper or lower half, sig_location[1]:left or right half.
See also
fft2

Definition at line 1756 of file ophGen.cpp.

◆ encodeSideBand_GPU() [1/2]

void ophGen::encodeSideBand_GPU ( int  cropx1,
int  cropx2,
int  cropy1,
int  cropy2,
ivec2  sig_location 
)
protected

Encode the CGH according to a signal location parameter on the GPU.

The GPU variable, (*complex_H) on GPU has the final result.

Parameters
[in]cropx1the start x-coordinate to crop
[in]cropx2the end x-coordinate to crop
[in]cropy1the start y-coordinate to crop
[in]cropy2the end y-coordinate to crop
[in]sig_locationSignal location
sig_location[0]: upper or lower half, sig_location[1]:left or right half.
See also
cudaCropFringe, cudaFFT, cudaGetFringe

◆ encodeSideBand_GPU() [2/2]

void ophGen::encodeSideBand_GPU ( int  cropx1,
int  cropx2,
int  cropy1,
int  cropy2,
oph::ivec2  sig_location 
)
protected

Encode the CGH according to a signal location parameter on the GPU.

The GPU variable, (*complex_H) on GPU has the final result.

Parameters
[in]cropx1the start x-coordinate to crop
[in]cropx2the end x-coordinate to crop
[in]cropy1the start y-coordinate to crop
[in]cropy2the end y-coordinate to crop
[in]sig_locationSignal location
sig_location[0]: upper or lower half, sig_location[1]:left or right half.
See also
cudaCropFringe, cudaFFT, cudaGetFringe

Definition at line 1798 of file ophGen.cpp.

◆ encoding() [1/10]

void ophGen::encoding ( unsigned int  ENCODE_FLAG)

Encoding Functions.

ENCODE_PHASE : Phase
ENCODE_AMPLITUDE : Amplitude
ENCODE_REAL : Real Part
ENCODE_SIMPLENI : Simple numerical interference
ENCODE_BURCKHARDT : Burckhardt encoding
ENCODE_TWOPHASE : Two Phase Encoding

Parameters
[in]ENCODE_FLAGencoding method.
[in]holobuffer to encode. 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 839 of file ophGen.cpp.

◆ encoding() [2/10]

void ophGen::encoding ( unsigned int  ENCODE_FLAG)

Encoding Functions.

ENCODE_PHASE : Phase
ENCODE_AMPLITUDE : Amplitude
ENCODE_REAL : Real Part
ENCODE_SIMPLENI : Simple numerical interference
ENCODE_BURCKHARDT : Burckhardt encoding
ENCODE_TWOPHASE : Two Phase Encoding

Parameters
[in]ENCODE_FLAGencoding method.
[in]holobuffer to encode. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ encoding() [3/10]

void ophGen::encoding ( unsigned int  ENCODE_FLAG,
Complex< Real > *  holo,
Real encoded 
)

Definition at line 876 of file ophGen.cpp.

◆ encoding() [4/10]

void ophGen::encoding ( unsigned int  ENCODE_FLAG,
Complex< Real > *  holo,
Real encoded 
)

◆ encoding() [5/10]

void ophGen::encoding ( )

◆ encoding() [6/10]

void ophGen::encoding ( )

Definition at line 985 of file ophGen.cpp.

◆ encoding() [7/10]

virtual void ophGen::encoding ( unsigned int  ENCODE_FLAG,
unsigned int  SSB_PASSBAND,
Complex< Real > *  holo = nullptr,
Real encoded = nullptr 
)
virtual

◆ encoding() [8/10]

void ophGen::encoding ( unsigned int  ENCODE_FLAG,
unsigned int  SSB_PASSBAND,
Complex< Real > *  holo = nullptr,
Real encoded = nullptr 
)
virtual

Definition at line 905 of file ophGen.cpp.

◆ encoding() [9/10]

void ophGen::encoding ( unsigned int  BIN_ENCODE_FLAG,
unsigned int  ENCODE_FLAG,
Real  threshold,
Complex< Real > *  holo = nullptr,
Real encoded = nullptr 
)

Binary Encoding Functions.

ENCODE_PHASE : Phase
ENCODE_AMPLITUDE : Amplitude
ENCODE_REAL : Real Part
ENCODE_SIMPLENI : Simple numerical interference
ENCODE_BURCKHARDT : Burckhardt encoding
ENCODE_TWOPHASE : Two Phase Encoding
ENCODE_SIMPLEBINARY : Simple binary encoding
ENCODE_EDBINARY : Error diffusion binary encoding

Parameters
[in]BIN_ENCODE_FLAGbinarization method.
[in]ENCODE_FLAGencoding method for binarization.
[in]thresholdthreshold for binarization.
[in]holobuffer to encode. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ encoding() [10/10]

void ophGen::encoding ( unsigned int  BIN_ENCODE_FLAG,
unsigned int  ENCODE_FLAG,
Real  threshold,
Complex< Real > *  holo = nullptr,
Real encoded = nullptr 
)

Binary Encoding Functions.

ENCODE_PHASE : Phase
ENCODE_AMPLITUDE : Amplitude
ENCODE_REAL : Real Part
ENCODE_SIMPLENI : Simple numerical interference
ENCODE_BURCKHARDT : Burckhardt encoding
ENCODE_TWOPHASE : Two Phase Encoding
ENCODE_SIMPLEBINARY : Simple binary encoding
ENCODE_EDBINARY : Error diffusion binary encoding

Parameters
[in]BIN_ENCODE_FLAGbinarization method.
[in]ENCODE_FLAGencoding method for binarization.
[in]thresholdthreshold for binarization.
[in]holobuffer to encode. 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 948 of file ophGen.cpp.

◆ freqShift() [1/2]

void ophGen::freqShift ( Complex< Real > *  holo,
Complex< Real > *  encoded,
const ivec2  holosize,
int  shift_x,
int  shift_y 
)
protected

Frequency shift.

Parameters
[in]holoSource data.
[out]encodedDestination data.
[in]holosize
[in]shift_xX pixel value to shift
[in]shift_yY pixel value to shift

Definition at line 1110 of file ophGen.cpp.

◆ freqShift() [2/2]

void ophGen::freqShift ( Complex< Real > *  holo,
Complex< Real > *  encoded,
const ivec2  holosize,
int  shift_x,
int  shift_y 
)
protected

Frequency shift.

Parameters
[in]holoSource data.
[out]encodedDestination data.
[in]holosize
[in]shift_xX pixel value to shift
[in]shift_yY pixel value to shift

◆ Fresnel_Diffraction() [1/2]

void ophGen::Fresnel_Diffraction ( Point  src,
Complex< Real > *  dst,
Real  lambda,
Real  distance,
Real  amplitude 
)

Fresnel-diffraction method.

Parameters
[in]srcpoint coordinate data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
[in]amplitudepoint color data.

◆ Fresnel_Diffraction() [2/2]

void ophGen::Fresnel_Diffraction ( Point  src,
Complex< Real > *  dst,
Real  lambda,
Real  distance,
Real  amplitude 
)

Fresnel-diffraction method.

Parameters
[in]srcpoint coordinate data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
[in]amplitudepoint color data.

Definition at line 446 of file ophGen.cpp.

◆ Fresnel_FFT() [1/2]

void ophGen::Fresnel_FFT ( Complex< Real > *  src,
Complex< Real > *  dst,
Real  lambda,
Real  waveRatio,
Real  distance 
)

Fresnel-fft method.

Parameters
[in]srcplane color data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
See also
fft2

◆ Fresnel_FFT() [2/2]

void ophGen::Fresnel_FFT ( Complex< Real > *  src,
Complex< Real > *  dst,
Real  lambda,
Real  waveRatio,
Real  distance 
)

Fresnel-fft method.

Parameters
[in]srcplane color data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
See also
fft2

Definition at line 515 of file ophGen.cpp.

◆ fresnelPropagation() [1/4]

void ophGen::fresnelPropagation ( OphConfig  context,
Complex< Real > *  in,
Complex< Real > *  out,
Real  distance 
)

Fresnel propagation.

Parameters
[in]contextOphContext structure
[in]inInput complex field
[out]outOutput complex field
[in]distancePropagation distance

Definition at line 1444 of file ophGen.cpp.

◆ fresnelPropagation() [2/4]

void ophGen::fresnelPropagation ( OphConfig  context,
Complex< Real > *  in,
Complex< Real > *  out,
Real  distance 
)

Fresnel propagation.

Parameters
[in]contextOphContext structure
[in]inInput complex field
[out]outOutput complex field
[in]distancePropagation distance

◆ fresnelPropagation() [3/4]

void ophGen::fresnelPropagation ( Complex< Real > *  in,
Complex< Real > *  out,
Real  distance,
uint  channel 
)

Fresnel propagation.

Parameters
[in]inInput complex field
[out]outOutput complex field
[in]distancePropagation distance
[in]channelindex of channel

Definition at line 1523 of file ophGen.cpp.

◆ fresnelPropagation() [4/4]

void ophGen::fresnelPropagation ( Complex< Real > *  in,
Complex< Real > *  out,
Real  distance,
uint  channel 
)

Fresnel propagation.

Parameters
[in]inInput complex field
[out]outOutput complex field
[in]distancePropagation distance
[in]channelindex of channel

◆ getElapsedTime() [1/2]

Real ophGen::getElapsedTime ( )
inline

Function for getting elapsed time.

Returns
Type: Real
If the function succeeds, the return value is elapsed time.

Definition at line 376 of file ophGen.h.

◆ getElapsedTime() [2/2]

Real ophGen::getElapsedTime ( )
inline

Function for getting elapsed time.

Returns
Type: Real
If the function succeeds, the return value is elapsed time.

Definition at line 376 of file ophGen.h.

◆ getEncodedBuffer() [1/2]

Real** ophGen::getEncodedBuffer ( void  )
inline

Function for getting the encoded complex field buffer.

Returns
Type: Real**
If the function succeeds, the return value is encoded complex field data's pointer.
If the function fails, the return value is nullptr.

Definition at line 117 of file ophGen.h.

◆ getEncodedBuffer() [2/2]

Real** ophGen::getEncodedBuffer ( void  )
inline

Function for getting the encoded complex field buffer.

Returns
Type: Real**
If the function succeeds, the return value is encoded complex field data's pointer.
If the function fails, the return value is nullptr.

Definition at line 117 of file ophGen.h.

◆ getEncodeSize() [1/2]

ivec2& ophGen::getEncodeSize ( void  )
inline

Function for getting encode size.

Returns
Type: ivec2&
If the function succeeds, the return value is encode size.
If the function fails, the return value is nullptr.

Definition at line 363 of file ophGen.h.

◆ getEncodeSize() [2/2]

ivec2& ophGen::getEncodeSize ( void  )
inline

Function for getting encode size.

Returns
Type: ivec2&
If the function succeeds, the return value is encode size.
If the function fails, the return value is nullptr.

Definition at line 363 of file ophGen.h.

◆ getFieldLength() [1/2]

Real ophGen::getFieldLength ( )
inline

Definition at line 356 of file ophGen.h.

◆ getFieldLength() [2/2]

Real ophGen::getFieldLength ( )
inline

Definition at line 356 of file ophGen.h.

◆ GetMaxMin() [1/2]

void ophGen::GetMaxMin ( Real src,
int  len,
Real max,
Real min 
)
protected

Definition at line 2107 of file ophGen.cpp.

◆ GetMaxMin() [2/2]

void ophGen::GetMaxMin ( Real src,
int  len,
Real max,
Real min 
)
protected

◆ GetMode() [1/2]

unsigned int ophGen::GetMode ( )
inline

Definition at line 539 of file ophGen.h.

◆ GetMode() [2/2]

unsigned int ophGen::GetMode ( )
inline

Definition at line 539 of file ophGen.h.

◆ getNormalizedBuffer() [1/2]

uchar** ophGen::getNormalizedBuffer ( void  )
inline

Function for getting the normalized(0~255) complex field buffer.

Returns
Type: uchar**
If the function succeeds, the return value is normalized complex field data's pointer.
If the function fails, the return value is nullptr.

Definition at line 124 of file ophGen.h.

◆ getNormalizedBuffer() [2/2]

uchar** ophGen::getNormalizedBuffer ( void  )
inline

Function for getting the normalized(0~255) complex field buffer.

Returns
Type: uchar**
If the function succeeds, the return value is normalized complex field data's pointer.
If the function fails, the return value is nullptr.

Definition at line 124 of file ophGen.h.

◆ getPrecision() [1/2]

uint ophGen::getPrecision ( )
inline

Definition at line 260 of file ophGen.h.

◆ getPrecision() [2/2]

uint ophGen::getPrecision ( )
inline

Definition at line 260 of file ophGen.h.

◆ GetRandomPhase() [1/2]

bool ophGen::GetRandomPhase ( )
inline

Function for getting the random phase.

Returns
Type: bool
If the succeeds to use random phase, the return value is true.
If the fails to not use random phase, the return value is false.

Definition at line 537 of file ophGen.h.

◆ GetRandomPhase() [2/2]

bool ophGen::GetRandomPhase ( )
inline

Function for getting the random phase.

Returns
Type: bool
If the succeeds to use random phase, the return value is true.
If the fails to not use random phase, the return value is false.

Definition at line 537 of file ophGen.h.

◆ GetRandomPhaseValue() [1/2]

void ophGen::GetRandomPhaseValue ( Complex< Real > &  rand_phase_val,
bool  rand_phase 
)
protected

Assign random phase value if random_phase == 1.

If random_phase == 1, calculate a random phase value using random generator
otherwise, random phase value is 1.

Parameters
[out]rand_phase_valInput & Ouput value.
[in]rand_phaserandom or not.

Definition at line 1884 of file ophGen.cpp.

◆ GetRandomPhaseValue() [2/2]

void ophGen::GetRandomPhaseValue ( Complex< Real > &  rand_phase_val,
bool  rand_phase 
)
protected

Assign random phase value if random_phase == 1.

If random_phase == 1, calculate a random phase value using random generator
otherwise, random phase value is 1.

Parameters
[out]rand_phase_valInput & Ouput value.
[in]rand_phaserandom or not.

◆ getShiftPhaseValue() [1/2]

void ophGen::getShiftPhaseValue ( oph::Complex< Real > &  shift_phase_val,
int  idx,
oph::ivec2  sig_location 
)
protected

Calculate the shift phase value.

Parameters
[in]shift_phase_valoutput variable.
[in]idxthe current pixel position.
[in]sig_locationsignal location.
See also
encodingSideBand_CPU

Definition at line 1842 of file ophGen.cpp.

◆ getShiftPhaseValue() [2/2]

void ophGen::getShiftPhaseValue ( Complex< Real > &  shift_phase_val,
int  idx,
ivec2  sig_location 
)
protected

Calculate the shift phase value.

Parameters
[in]shift_phase_valoutput variable.
[in]idxthe current pixel position.
[in]sig_locationsignal location.
See also
encodingSideBand_CPU

◆ getStream() [1/2]

int ophGen::getStream ( )
inline

Definition at line 355 of file ophGen.h.

◆ getStream() [2/2]

int ophGen::getStream ( )
inline

Definition at line 355 of file ophGen.h.

◆ getWeightED() [1/2]

bool ophGen::getWeightED ( const ivec2  holosize,
const int  type,
ivec2 *  pNw 
)
protected

Definition at line 1365 of file ophGen.cpp.

◆ getWeightED() [2/2]

bool ophGen::getWeightED ( const ivec2  holosize,
const int  type,
ivec2 pNw 
)
protected

◆ ImaginaryPart() [1/2]

template<typename T >
void ophGen::ImaginaryPart ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Definition at line 1929 of file ophGen.cpp.

◆ ImaginaryPart() [2/2]

template<typename T >
void ophGen::ImaginaryPart ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

◆ initialize() [1/2]

void ophGen::initialize ( void  )

Initialize variables for Hologram complex field, encoded data, normalized data.

◆ initialize() [2/2]

void ophGen::initialize ( void  )

Initialize variables for Hologram complex field, encoded data, normalized data.

Definition at line 145 of file ophGen.cpp.

◆ load() [1/2]

void* ophGen::load ( const char *  fname)

Function for loading image files.

Parameters
[in]fnameFile name.

◆ load() [2/2]

void * ophGen::load ( const char *  fname)

Function for loading image files.

Parameters
[in]fnameFile name.

Definition at line 794 of file ophGen.cpp.

◆ loadAsOhc() [1/2]

virtual bool ophGen::loadAsOhc ( const char *  fname)
virtual

Function to read OHC file.

Parameters
[in]fnameFile name.
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

Reimplemented from Openholo.

◆ loadAsOhc() [2/2]

bool ophGen::loadAsOhc ( const char *  fname)
virtual

Function to read OHC file.

Parameters
[in]fnameFile name.
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

Reimplemented from Openholo.

Definition at line 806 of file ophGen.cpp.

◆ loadPointCloud() [1/2]

int ophGen::loadPointCloud ( const char *  pc_file,
OphPointCloudData pc_data_ 
)

load to point cloud data.

Parameters
[in]pc_filePoint cloud data file name
[out]pc_data_Point cloud data - number of points, number of color, geometry of point cloud, color data, phase data
Returns
Type: int
If the function succeeds, the return value is Positive integer.
If the function fails, the return value is Negative interger.

Definition at line 206 of file ophGen.cpp.

◆ loadPointCloud() [2/2]

int ophGen::loadPointCloud ( const char *  pc_file,
OphPointCloudData pc_data_ 
)

load to point cloud data.

Parameters
[in]pc_filePoint cloud data file name
[out]pc_data_Point cloud data - number of points, number of color, geometry of point cloud, color data, phase data
Returns
Type: int
If the function succeeds, the return value is Positive integer.
If the function fails, the return value is Negative interger.

◆ normalize() [1/2]

void ophGen::normalize ( void  )

Normalization function to save as image file after hologram creation.

◆ normalize() [2/2]

void ophGen::normalize ( void  )

Normalization function to save as image file after hologram creation.

Definition at line 677 of file ophGen.cpp.

◆ ophFree() [1/2]

virtual void ophGen::ophFree ( void  )
protectedvirtual

Pure virtual function for override in child classes.

Reimplemented from Openholo.

Reimplemented in ophDepthMap, ophDepthMap, ophLF, and ophLF.

◆ ophFree() [2/2]

void ophGen::ophFree ( void  )
protectedvirtual

Pure virtual function for override in child classes.

Reimplemented from Openholo.

Reimplemented in ophDepthMap, ophDepthMap, ophLF, and ophLF.

Definition at line 2163 of file ophGen.cpp.

◆ Phase() [1/2]

template<typename T >
void ophGen::Phase ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Definition at line 1940 of file ophGen.cpp.

◆ Phase() [2/2]

template<typename T >
void ophGen::Phase ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

◆ readConfig() [1/2]

bool ophGen::readConfig ( const char *  fname)

load to configuration file.

Parameters
[in]fnameconfig file name
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

◆ readConfig() [2/2]

bool ophGen::readConfig ( const char *  fname)

load to configuration file.

Parameters
[in]fnameconfig file name
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

Definition at line 220 of file ophGen.cpp.

◆ RealPart() [1/2]

template<typename T >
void ophGen::RealPart ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Encoding method.

Parameters
[in]holoSource data.
[out]encodedDestination data.
[in]sizesize of encode.

Definition at line 1918 of file ophGen.cpp.

◆ RealPart() [2/2]

template<typename T >
void ophGen::RealPart ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Encoding method.

Parameters
[in]holoSource data.
[out]encodedDestination data.
[in]sizesize of encode.

◆ resetBuffer() [1/2]

void ophGen::resetBuffer ( )
protected

reset buffer

buffer memory set '0'

◆ resetBuffer() [2/2]

void ophGen::resetBuffer ( )
protected

reset buffer

buffer memory set '0'

Definition at line 824 of file ophGen.cpp.

◆ RS_Diffraction() [1/2]

void ophGen::RS_Diffraction ( Point  src,
Complex< Real > *  dst,
Real  lambda,
Real  distance,
Real  amplitude 
)

RS-diffraction method.

Parameters
[in]srcpoint coordinate data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
[in]amplitudepoint color data.

◆ RS_Diffraction() [2/2]

void ophGen::RS_Diffraction ( Point  src,
Complex< Real > *  dst,
Real  lambda,
Real  distance,
Real  amplitude 
)

RS-diffraction method.

Parameters
[in]srcpoint coordinate data.
[out]dstcomplex data.
[in]lambdawave length.
[in]distancethe distance from the object to the hologram plane.
[in]amplitudepoint color data.

Definition at line 360 of file ophGen.cpp.

◆ save() [1/4]

bool ophGen::save ( const char *  fname,
uint8_t  bitsperpixel = 8,
uchar src = nullptr,
uint  px = 0,
uint  py = 0 
)

Function for saving image files.

Parameters
[in]fnameInput file name.
[in]bitsperpixelbits per pixel.
[in]srcSource data.
[in]pximage width.
[in]pyimage height.
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

◆ save() [2/4]

bool ophGen::save ( const char *  fname,
uint8_t  bitsperpixel = 8,
uchar *  src = nullptr,
uint  px = 0,
uint  py = 0 
)

Function for saving image files.

Parameters
[in]fnameInput file name.
[in]bitsperpixelbits per pixel.
[in]srcSource data.
[in]pximage width.
[in]pyimage height.
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

Definition at line 712 of file ophGen.cpp.

◆ save() [3/4]

bool ophGen::save ( const char *  fname,
uint8_t  bitsperpixel,
uint  px,
uint  py,
uint  fnum,
uchar *  args ... 
)
protected

Called when saving multiple hologram data at a time.

Parameters
[in]fnameInput file name.
[in]bitsperpixelbits per pixel.
[in]pximage width.
[in]pyimage height.
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

◆ save() [4/4]

bool ophGen::save ( const char *  fname,
uint8_t  bitsperpixel,
uint  px,
uint  py,
uint  fnum,
uchar args ... 
)
protected

Called when saving multiple hologram data at a time.

Parameters
[in]fnameInput file name.
[in]bitsperpixelbits per pixel.
[in]pximage width.
[in]pyimage height.
Returns
Type: bool
If the function succeeds, the return value is true.
If the function fails, the return value is false.

◆ saveRefImages() [1/2]

bool ophGen::saveRefImages ( char *  fnameW,
char *  fnameWC,
char *  fnameAS,
char *  fnameSSB,
char *  fnameHP,
char *  fnameFreq,
char *  fnameReal,
char *  fnameBin,
char *  fnameReconBin,
char *  fnameReconErr,
char *  fnameReconNo 
)

Definition at line 1131 of file ophGen.cpp.

◆ saveRefImages() [2/2]

bool ophGen::saveRefImages ( char *  fnameW,
char *  fnameWC,
char *  fnameAS,
char *  fnameSSB,
char *  fnameHP,
char *  fnameFreq,
char *  fnameReal,
char *  fnameBin,
char *  fnameReconBin,
char *  fnameReconErr,
char *  fnameReconNo 
)

◆ ScaleChange() [1/2]

void ophGen::ScaleChange ( Real src,
Real dst,
int  nSize,
Real  scaleX,
Real  scaleY,
Real  scaleZ 
)
protected

◆ ScaleChange() [2/2]

void ophGen::ScaleChange ( Real src,
Real dst,
int  nSize,
Real  scaleX,
Real  scaleY,
Real  scaleZ 
)
protected

Definition at line 2091 of file ophGen.cpp.

◆ setEncodeMethod() [1/2]

void ophGen::setEncodeMethod ( unsigned int  ENCODE_FLAG)
inline

Definition at line 262 of file ophGen.h.

◆ setEncodeMethod() [2/2]

void ophGen::setEncodeMethod ( unsigned int  ENCODE_FLAG)
inline

Definition at line 262 of file ophGen.h.

◆ SetMode() [1/2]

void ophGen::SetMode ( unsigned int  mode)
inline

Definition at line 538 of file ophGen.h.

◆ SetMode() [2/2]

void ophGen::SetMode ( unsigned int  mode)
inline

Definition at line 538 of file ophGen.h.

◆ setPrecision() [1/2]

void ophGen::setPrecision ( uint  precision)
inline

Function for setting precision.

Parameters
[in]precisionlevel.

Definition at line 259 of file ophGen.h.

◆ setPrecision() [2/2]

void ophGen::setPrecision ( uint  precision)
inline

Function for setting precision.

Parameters
[in]precisionlevel.

Definition at line 259 of file ophGen.h.

◆ SetRandomPhase() [1/2]

void ophGen::SetRandomPhase ( bool  bRandomPhase)
inline

Function for setting the random phase.

Definition at line 529 of file ophGen.h.

◆ SetRandomPhase() [2/2]

void ophGen::SetRandomPhase ( bool  bRandomPhase)
inline

Function for setting the random phase.

Definition at line 529 of file ophGen.h.

◆ setResolution() [1/2]

void ophGen::setResolution ( ivec2  resolution)

Function for setting buffer size.

Parameters
[in]resolutionbuffer size.

◆ setResolution() [2/2]

void ophGen::setResolution ( ivec2  resolution)

Function for setting buffer size.

Parameters
[in]resolutionbuffer size.

Definition at line 1907 of file ophGen.cpp.

◆ Shift() [1/2]

bool ophGen::Shift ( Real  x,
Real  y 
)

◆ Shift() [2/2]

bool ophGen::Shift ( Real  x,
Real  y 
)

Definition at line 1589 of file ophGen.cpp.

◆ shiftW() [1/2]

bool ophGen::shiftW ( ivec2  holosize)
protected

Definition at line 1402 of file ophGen.cpp.

◆ shiftW() [2/2]

bool ophGen::shiftW ( ivec2  holosize)
protected

◆ SimpleNI() [1/2]

template<typename T >
void ophGen::SimpleNI ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Definition at line 2050 of file ophGen.cpp.

◆ SimpleNI() [2/2]

template<typename T >
void ophGen::SimpleNI ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

◆ singleSideBand() [1/2]

void ophGen::singleSideBand ( Complex< Real > *  holo,
Real encoded,
const ivec2  holosize,
int  passband 
)
protected

Encoding method.

Parameters
[in]holoSource data.
[out]encodedDestination data.
[in]holosizesize of encode.
[in]passbanddirection of passband.

◆ singleSideBand() [2/2]

void ophGen::singleSideBand ( Complex< Real > *  holo,
Real encoded,
const ivec2  holosize,
int  passband 
)
protected

Encoding method.

Parameters
[in]holoSource data.
[out]encodedDestination data.
[in]holosizesize of encode.
[in]passbanddirection of passband.

Definition at line 1046 of file ophGen.cpp.

◆ transVW() [1/4]

void ophGen::transVW ( int  nVertex,
Vertex dst,
Vertex src 
)

◆ transVW() [2/4]

void ophGen::transVW ( int  nVertex,
Vertex dst,
Vertex src 
)

Definition at line 2072 of file ophGen.cpp.

◆ transVW() [3/4]

void ophGen::transVW ( int  nVertex,
Real dst,
Real src 
)

Definition at line 2083 of file ophGen.cpp.

◆ transVW() [4/4]

void ophGen::transVW ( int  nVertex,
Real dst,
Real src 
)

◆ TwoPhase() [1/2]

template<typename T >
void ophGen::TwoPhase ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

Definition at line 1963 of file ophGen.cpp.

◆ TwoPhase() [2/2]

template<typename T >
void ophGen::TwoPhase ( Complex< T > *  holo,
T *  encoded,
const int  size 
)
protected

◆ waveCarry() [1/4]

void ophGen::waveCarry ( Real  carryingAngleX,
Real  carryingAngleY,
Real  distance 
)

Wave carry.

Parameters
[in]carryingAngleXWave carrying angle in horizontal direction
[in]carryingAngleYWave carrying angle in vertical direction
[in]distanceDistance between the display and the object

◆ waveCarry() [2/4]

void ophGen::waveCarry ( Real  carryingAngleX,
Real  carryingAngleY,
Real  distance 
)

Wave carry.

Parameters
[in]carryingAngleXWave carrying angle in horizontal direction
[in]carryingAngleYWave carrying angle in vertical direction
[in]distanceDistance between the display and the object

Definition at line 1644 of file ophGen.cpp.

◆ waveCarry() [3/4]

void ophGen::waveCarry ( Complex< Real > *  src,
Complex< Real > *  dst,
Real  wavelength,
int  carryIdxX,
int  carryIdxY 
)

Definition at line 1681 of file ophGen.cpp.

◆ waveCarry() [4/4]

void ophGen::waveCarry ( Complex< Real > *  src,
Complex< Real > *  dst,
Real  wavelength,
int  carryIdxX,
int  carryIdxY 
)

Member Data Documentation

◆ AS

Complex< Real > * ophGen::AS
protected

Binary Encoding - Error diffusion.

Definition at line 426 of file ophGen.h.

◆ binary

Real * ophGen::binary
protected

Definition at line 433 of file ophGen.h.

◆ ENCODE_METHOD

int ophGen::ENCODE_METHOD
protected

Encoding method flag.

Definition at line 332 of file ophGen.h.

◆ fftTemp

Complex< Real > * ophGen::fftTemp
protected

Definition at line 428 of file ophGen.h.

◆ freqW

Complex< Real > * ophGen::freqW
protected

Definition at line 431 of file ophGen.h.

◆ m_bRandomPhase

bool ophGen::m_bRandomPhase
protected

Definition at line 436 of file ophGen.h.

◆ m_dFieldLength

Real ophGen::m_dFieldLength
protected

Definition at line 348 of file ophGen.h.

◆ m_elapsedTime

Real ophGen::m_elapsedTime
protected

Elapsed time of generate hologram.

Definition at line 336 of file ophGen.h.

◆ m_lpEncoded

Real ** ophGen::m_lpEncoded
protected

buffer to encoded.

Definition at line 338 of file ophGen.h.

◆ m_lpNormalized

uchar ** ophGen::m_lpNormalized
protected

buffer to normalized.

Definition at line 340 of file ophGen.h.

◆ m_mode

unsigned int ophGen::m_mode
protected

Definition at line 350 of file ophGen.h.

◆ m_nStream

int ophGen::m_nStream
protected

Definition at line 349 of file ophGen.h.

◆ m_vecEncodeSize

ivec2 ophGen::m_vecEncodeSize
protected

Encoded hologram size, varied from encoding type.

Definition at line 330 of file ophGen.h.

◆ maskHP

Real * ophGen::maskHP
protected

Definition at line 435 of file ophGen.h.

◆ maskSSB

Real * ophGen::maskSSB
protected

Definition at line 434 of file ophGen.h.

◆ normalized

Complex< Real > * ophGen::normalized
protected

Definition at line 427 of file ophGen.h.

◆ realEnc

Real * ophGen::realEnc
protected

Definition at line 432 of file ophGen.h.

◆ SSB_PASSBAND

int ophGen::SSB_PASSBAND
protected

Passband in Single-side band encoding.

Definition at line 334 of file ophGen.h.

◆ weight

Real * ophGen::weight
protected

Definition at line 429 of file ophGen.h.

◆ weightC

Complex< Real > * ophGen::weightC
protected

Definition at line 430 of file ophGen.h.


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