Openholo  v5.0
Open Source Digital Holographic Library
ophNonHogelLF.cpp
Go to the documentation of this file.
1 #include "ophNonHogelLF.h"
2 #include "include.h"
3 #include "sys.h"
4 #include "tinyxml2.h"
5 
6 #ifdef _WIN64
7 #include <io.h>
8 #include <direct.h>
9 #else
10 #include <dirent.h>
11 #include <sys/stat.h>
12 #include <algorithm>
13 #endif
14 
16  : num_image(ivec2(0, 0))
17  , resolution_image(ivec2(0, 0))
18  , distanceRS2Holo(0.0)
19  , fieldLens(0.0)
20  , is_ViewingWindow(false)
21  , nImages(-1)
22  , nBufferX(0)
23  , nBufferY(0)
24  , LF(nullptr)
25  , FToverUV_LF(nullptr)
26  , WField(nullptr)
27  , Hologram(nullptr)
28  , LF_directory(nullptr)
29  , ext(nullptr)
30 {
31  LOG("*** LIGHT FIELD : BUILD DATE: %s %s ***\n\n", __DATE__, __TIME__);
32 }
33 
34 void ophNonHogelLF::setViewingWindow(bool is_ViewingWindow)
35 {
36  this->is_ViewingWindow = is_ViewingWindow;
37 }
38 
39 bool ophNonHogelLF::readConfig(const char* fname)
40 {
41  if (!ophGen::readConfig(fname))
42  return false;
43 
44  bool bRet = true;
45  auto begin = CUR_TIME;
46 
47  using namespace tinyxml2;
48  /*XML parsing*/
49  tinyxml2::XMLDocument xml_doc;
50  XMLNode *xml_node;
51 
52  if (!checkExtension(fname, ".xml"))
53  {
54  LOG("<FAILED> Wrong file ext.\n");
55  return false;
56  }
57  if (xml_doc.LoadFile(fname) != XML_SUCCESS)
58  {
59  LOG("<FAILED> Loading file.\n");
60  return false;
61  }
62 
63  xml_node = xml_doc.FirstChild();
64 
65  char szNodeName[32] = { 0, };
66  sprintf(szNodeName, "FieldLength");
67  // about viewing window
68  auto next = xml_node->FirstChildElement(szNodeName);
69  if (!next || XML_SUCCESS != next->QueryDoubleText(&fieldLens))
70  {
71  LOG("<FAILED> Not found node : \'%s\' (Double) \n", szNodeName);
72  bRet = false;
73  }
74 
75  // about image
76  sprintf(szNodeName, "Image_NumOfX");
77  next = xml_node->FirstChildElement(szNodeName);
78  if (!next || XML_SUCCESS != next->QueryIntText(&num_image[_X]))
79  {
80  LOG("<FAILED> Not found node : \'%s\' (Integer) \n", szNodeName);
81  bRet = false;
82  }
83  sprintf(szNodeName, "Image_NumOfY");
84  next = xml_node->FirstChildElement(szNodeName);
85  if (!next || XML_SUCCESS != next->QueryIntText(&num_image[_Y]))
86  {
87  LOG("<FAILED> Not found node : \'%s\' (Integer) \n", szNodeName);
88  bRet = false;
89  }
90  sprintf(szNodeName, "Image_Width");
91  next = xml_node->FirstChildElement(szNodeName);
92  if (!next || XML_SUCCESS != next->QueryIntText(&resolution_image[_X]))
93  {
94  LOG("<FAILED> Not found node : \'%s\' (Integer) \n", szNodeName);
95  bRet = false;
96  }
97  sprintf(szNodeName, "Image_Height");
98  next = xml_node->FirstChildElement(szNodeName);
99  if (!next || XML_SUCCESS != next->QueryIntText(&resolution_image[_Y]))
100  {
101  LOG("<FAILED> Not found node : \'%s\' (Integer) \n", szNodeName);
102  bRet = false;
103  }
104  sprintf(szNodeName, "Distance");
105  next = xml_node->FirstChildElement(szNodeName);
106  if (!next || XML_SUCCESS != next->QueryDoubleText(&distanceRS2Holo))
107  {
108  LOG("<FAILED> Not found node : \'%s\' (Double) \n", szNodeName);
109  bRet = false;
110  }
111 
112  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
113  initialize();
114  return bRet;
115 }
116 
117 int ophNonHogelLF::loadLF(const char* directory, const char* exten)
118 {
119  initializeLF();
120 #ifdef _WIN64
121  _finddata_t data;
122 
123  string sdir = std::string(LF_directory).append("\\").append("*.").append(exten);
124  intptr_t ff = _findfirst(sdir.c_str(), &data);
125  if (ff != -1)
126  {
127  int num = 0;
128  uchar* rgbOut;
129  ivec2 sizeOut;
130  int bytesperpixel;
131 
132  while (true)
133  {
134  string imgfullname = std::string(LF_directory).append("\\").append(data.name);
135  getImgSize(sizeOut[_X], sizeOut[_Y], bytesperpixel, imgfullname.c_str());
136 
137  rgbOut = loadAsImg(imgfullname.c_str());
138 
139  if (rgbOut == 0) {
140  LOG("<FAILED> Load image.");
141  return -1;
142  }
143 
144  convertToFormatGray8(rgbOut, *(LF + num), sizeOut[_X], sizeOut[_Y], bytesperpixel);
145  delete[] rgbOut; // solved memory leak.
146  num++;
147  int out = _findnext(ff, &data);
148  if (out == -1)
149  break;
150  }
151  _findclose(ff);
152 #else
153  string sdir;
154  DIR* dir = nullptr;
155  if (directory[0] != '/') {
156  char buf[PATH_MAX] = { 0, };
157  if (getcwd(buf, sizeof(buf)) != nullptr) {
158  sdir = sdir.append(buf).append("/").append(directory);
159  }
160  }
161  else
162  sdir = string(directory);
163  string ext = string(exten);
164 
165  if ((dir = opendir(sdir.c_str())) != nullptr) {
166 
167  int num = 0;
168  ivec2 sizeOut;
169  int bytesperpixel;
170  struct dirent* ent;
171 
172  // Add file
173  int cnt = 0;
174  vector<string> fileList;
175  while ((ent = readdir(dir)) != nullptr) {
176  string filePath;
177  filePath = filePath.append(sdir.c_str()).append("/").append(ent->d_name);
178  if (filePath != "." && filePath != "..") {
179  struct stat fileInfo;
180  if (stat(filePath.c_str(), &fileInfo) == 0 && S_ISREG(fileInfo.st_mode)) {
181  if (filePath.substr(filePath.find_last_of(".") + 1) == ext) {
182  fileList.push_back(filePath);
183  cnt++;
184  }
185  }
186  }
187  }
188  closedir(dir);
189  std::sort(fileList.begin(), fileList.end());
190 
191  uchar* rgbOut;
192  for (size_t i = 0; i < fileList.size(); i++)
193  {
194  // to do
195  getImgSize(sizeOut[_X], sizeOut[_Y], bytesperpixel, fileList[i].c_str());
196  int size = (((sizeOut[_X] * bytesperpixel) + 3) & ~3) * sizeOut[_Y];
197 
198  rgbOut = loadAsImg(fileList[i].c_str());
199 
200  if (rgbOut == 0) {
201  LOG("<FAILED> Load image.");
202  return -1;
203  }
204  convertToFormatGray8(rgbOut, LF[i], sizeOut[_X], sizeOut[_Y], bytesperpixel);
205  delete[] rgbOut; // solved memory leak.
206  }
207 
208 #endif
209  if (num_image[_X] * num_image[_Y] != num) {
210  LOG("<FAILED> Not matching image.");
211  }
212  return 1;
213  }
214  else
215  {
216  LOG("<FAILED> Load image.");
217  return -1;
218  }
219 }
220 
222 {
223  resetBuffer();
224  setBuffer();
226 }
227 
229 {
230  resetBuffer();
231 
232  LOG("1) Algorithm Method : Non-hogel based hologram generation from Light Field\n");
233  LOG("2) Generate Hologram with %s\n", m_mode & MODE_GPU ?
234  "GPU" :
235 #ifdef _OPENMP
236  "Multi Core CPU"
237 #else
238  "Single Core CPU"
239 #endif
240  );
241  LOG("3) Random Phase Use : %s\n", GetRandomPhase() ? "Y" : "N");
242  LOG("4) Number of Images : %d x %d\n", num_image[_X], num_image[_Y]);
243 
244  auto begin = CUR_TIME;
245  if (m_mode & MODE_GPU)
246  {
247  LOG("Not implement GPU version");
248  }
249  else
250  {
251  setBuffer();
254  Real distance = 0.0;
255  for (uint ch = 0; ch < context_.waveNum; ch++)
256  Fresnel_FFT(Hologram, complex_H[ch], context_.wave_length[ch], distance);
257  //fresnelPropagation(Hologram, complex_H[ch], distance, ch); //distanceRS2Holo
258  }
259 
260  LOG("Total Elapsed Time: %.5lf (sec)\n", ELAPSED_TIME(begin, CUR_TIME));
261 }
262 
263 void ophNonHogelLF::generateHologram(double thetaX, double thetaY)
264 {
265  resetBuffer();
266 
267  LOG("1) Algorithm Method : Non-hogel based hologram generation from Light Field\n");
268  LOG("2) Generate Hologram with %s\n", m_mode & MODE_GPU ?
269  "GPU" :
270 #ifdef _OPENMP
271  "Multi Core CPU"
272 #else
273  "Single Core CPU"
274 #endif
275  );
276  LOG("3) Random Phase Use : %s\n", GetRandomPhase() ? "Y" : "N");
277  LOG("4) Number of Images : %d x %d\n", num_image[_X], num_image[_Y]);
278 
279  auto begin = CUR_TIME;
280  if (m_mode & MODE_GPU)
281  {
282  LOG("Not implement GPU version");
283  }
284  else
285  {
286  setBuffer();
287  makePlaneWaveWField(thetaX, thetaY);
289  Real distance = 0.0;
290  for (uint ch = 0; ch < context_.waveNum; ch++)
291  Fresnel_FFT(Hologram, complex_H[ch], context_.wave_length[ch], distance);
292  //fresnelPropagation(Hologram, complex_H[ch], distance, ch); //distanceRS2Holo
293  }
294 
295  LOG("Total Elapsed Time: %.5lf (sec)\n", ELAPSED_TIME(begin, CUR_TIME));
296 }
297 
298 //int ophLF::saveAsOhc(const char * fname)
299 //{
300 // setPixelNumberOHC(getEncodeSize());
301 //
302 // Openholo::saveAsOhc(fname);
303 //
304 // return 0;
305 //}
306 
308 {
309  const uint nU = num_image[_X];
310  const uint nV = num_image[_Y];
311  nBufferX = (nU >> 1) + 1;
312  nBufferY = (nV >> 1) + 1;
313 }
314 
316 {
317  if (LF != nullptr) {
318  for (int i = 0; i < nImages; i++) {
319  if (LF[i]) {
320  delete[] LF[i];
321  LF[i] = nullptr;
322  }
323  }
324  delete[] LF;
325  LF = nullptr;
326  }
327 
328  LF = new uchar*[num_image[_X] * num_image[_Y]];
329  for (int i = 0; i < num_image[_X] * num_image[_Y]; i++) {
330  LF[i] = new uchar[resolution_image[_X] * resolution_image[_Y]];
331  memset(LF[i], 0, resolution_image[_X] * resolution_image[_Y]);
332  }
333  nImages = num_image[_X] * num_image[_Y];
334 }
335 
337 {
338  auto begin = CUR_TIME;
339 
340  const uint nU = num_image[_X];
341  const uint nV = num_image[_Y];
342  const uint nUV = nU * nV;
343  const uint nX = resolution_image[_X];
344  const uint nY = resolution_image[_Y];
345  const uint nXY = nX * nY;
346  const uint nXwithBuffer = nX + 2 * nBufferX;
347  const uint nYwithBuffer = nY + 2 * nBufferY;
348  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
349 
350  if (WField) {
351  delete[] WField;
352  WField = nullptr;
353  }
354  WField = new Complex<Real>[nXYwithBuffer];
355  memset(WField, 0.0, sizeof(Complex<Real>) * nXYwithBuffer);
356 
357  Complex<Real> phase(0.0, 0.0);
358  Real randVal;
359 #ifdef _OPENMP
360 #pragma omp parallel for
361 #endif
362  for (int idxnXY = 0; idxnXY < nXYwithBuffer; idxnXY++) {
363  randVal = rand((Real)0, (Real)1, idxnXY);
364  phase(0.0, 2.0 * M_PI * randVal); //randVal
365  WField[idxnXY] = exp(phase);
366  }
367  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
368 }
369 
370 void ophNonHogelLF::makePlaneWaveWField(double thetaX, double thetaY)
371 {
372  auto begin = CUR_TIME;
373  const uint nU = num_image[_X];
374  const uint nV = num_image[_Y];
375  const uint nUV = nU * nV;
376  const uint nX = resolution_image[_X];
377  const uint nY = resolution_image[_Y];
378  const uint nXY = nX * nY;
379  const long long int nXwithBuffer = nX + 2 * nBufferX;
380  const long long int nYwithBuffer = nY + 2 * nBufferY;
381  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
382  const double px = context_.pixel_pitch[_X];
383  const double py = context_.pixel_pitch[_Y];
384 
385 
386  if (WField) {
387  delete[] WField;
388  WField = nullptr;
389  }
390  WField = new Complex<Real>[nXYwithBuffer];
391  memset(WField, 0.0, sizeof(Complex<Real>) * nXYwithBuffer);
392 
393  Complex<Real> phase(0.0, 0.0);
394  double carrierFreqX = (1.0 / context_.wave_length[0])*sin(thetaX);
395  double carrierFreqY = (1.0 / context_.wave_length[0])*sin(thetaY);
396  for (int idxnX = 0; idxnX < nXwithBuffer; idxnX++) {
397  for (int idxnY = 0; idxnY < nYwithBuffer; idxnY++) {
398  phase(0.0, 2.0*M_PI* (carrierFreqX*idxnX*px + carrierFreqY*idxnY*py));
399  WField[idxnX + nXwithBuffer*idxnY] = exp(phase);
400  }
401  }
402  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
403 }
404 
406 {
407  auto begin = CUR_TIME;
408  const int nX = resolution_image[_X]; // resolution of each orthographic images = spatial resolution of LF
409  const int nY = resolution_image[_Y];
410  const long long int nXY = nX * nY;
411  const int nU = num_image[_X]; // number of orthographic images = angular resolution of LF
412  const int nV = num_image[_Y];
413  const int nUV = nU * nV;
414  const long long int nXwithBuffer = nX + 2 * nBufferX;
415  const long long int nYwithBuffer = nY + 2 * nBufferY;
416  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
417 
418 
419  // initialize
420  if (FToverUV_LF) {
421  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
422  if (FToverUV_LF[idxnUV]) {
423  delete[] FToverUV_LF[idxnUV];
424  FToverUV_LF[idxnUV] = nullptr;
425  }
426  }
427  delete[] FToverUV_LF;
428  FToverUV_LF = nullptr;
429  }
430 
431  FToverUV_LF = new Complex<Real>*[nUV];
432  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
433  FToverUV_LF[idxnUV] = new Complex<Real>[nXY];
434  memset(FToverUV_LF[idxnUV], 0.0, nXY);
435  }
436 
437  // fft over uv axis
438  Complex<Real>* LFatXY = new Complex<Real>[nUV];
439  Complex<Real>* FToverUVatXY = new Complex<Real>[nUV];
440  int progressCheckPoint = 10000;
441  int idxProgress = 0;
442  for (int idxnXY = 0; idxnXY < nXY; idxnXY++) {
443  memset(LFatXY, 0.0, sizeof(Complex<Real>) * nUV);
444  memset(FToverUVatXY, 0.0, sizeof(Complex<Real>) * nUV);
445 
446  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
447  LFatXY[idxnUV] = LF[idxnUV][idxnXY];
448  }
449 
450  fft2(num_image, LFatXY, OPH_FORWARD, OPH_ESTIMATE); // num_image ==> ivec2(nU,nV)
451  fft2(LFatXY, FToverUVatXY, nU, nV, OPH_FORWARD);
452  fftFree();
453  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
454  FToverUV_LF[idxnUV][idxnXY] = FToverUVatXY[idxnUV];
455  }
456 
457  // only for debugging
458  if (idxProgress == progressCheckPoint ) {
459  LOG("idxnXY : %1d out of nXY= %llu\n", idxnXY, nXY);
460  idxProgress = 0;
461  }
462  else {
463  idxProgress++;
464  }
465  }
466  delete[] LFatXY;
467  delete[] FToverUVatXY;
468  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
469 
470 }
471 
473 {
474  auto begin = CUR_TIME;
475 
476  const int nX = resolution_image[_X]; // resolution of each orthographic images = spatial resolution of LF
477  const int nY = resolution_image[_Y];
478  const long long int nXY = nX * nY;
479  const int nU = num_image[_X]; // number of orthographic images = angular resolution of LF
480  const int nV = num_image[_Y];
481  const int nUV = nU * nV;
482  const long long int nXwithBuffer = nX + 2 * nBufferX;
483  const long long int nYwithBuffer = nY + 2 * nBufferY;
484  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
485 
486  if (Hologram) {
487  delete[] Hologram;
488  Hologram = nullptr;
489  }
490  Hologram = new Complex<Real>[nXY];
491  memset(Hologram, 0.0, sizeof(Complex<Real>) * nXY);
492 
493  Complex<Real>* HologramWithBuffer = new Complex<Real>[nXYwithBuffer];
494  memset(HologramWithBuffer, 0.0, sizeof(Complex<Real>) * nXYwithBuffer);
495 
496  int startXH = 0;
497  int startXW = 0;
498  int startYH = 0;
499  int startYW = 0;
500 
501  int idxnU = 0;
502  int idxnV = 0;
503  int idxnX = 0;
504  int idxnY = 0;
505  for (idxnU = 0; idxnU < nU; idxnU++) {
506  startXH = (int)((((double)idxnU) - 1.) / 2.) + (int)(-(((double)nU) + 1.) / 4. - ((double)(nX))/2.0 + ((double)(nXwithBuffer)) / 2.0);
507  startXW = startXH + (int)(((double)nU) / 2.) - (idxnU - 1);
508 
509  for (idxnV = 0; idxnV < nV; idxnV++) {
510  startYH = (int)((((double)idxnV) - 1.) / 2.) + (int)(-(((double)nV) + 1.) / 4. - ((double)(nY)) / 2.0 + ((double)(nYwithBuffer)) / 2.0);
511  startYW = startYH + (int)(((double)nV) / 2.) - (idxnV - 1);
512 
513  for (idxnX = 0; idxnX < nX; idxnX++) {
514  for (idxnY = 0; idxnY < nY; idxnY++) {
515 
516  HologramWithBuffer[(startXH + idxnX) + nXwithBuffer*(startYH + idxnY)] += FToverUV_LF[idxnU + nU*idxnV][idxnX+nX*idxnY] * WField[(startXW + idxnX) + nXwithBuffer*(startYW + idxnY)];
517 
518  }
519  }
520  }
521  }
522 
523  for (idxnX = 0; idxnX < nX; idxnX++) {
524  for (idxnY = 0; idxnY < nY; idxnY++) {
525  Hologram[idxnX + nX*idxnY] = HologramWithBuffer[(nBufferX + idxnX) + nXwithBuffer*(nBufferY + idxnY)];
526  }
527  }
528  delete[] HologramWithBuffer;
529  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
530 }
531 
532 void ophNonHogelLF::writeIntensity_gray8_bmp(const char* fileName, int nx, int ny, Complex<Real>* complexvalue, int k)
533 {
534  const int n = nx * ny;
535 
536  double* intensity = (double*)malloc(sizeof(double)*n);
537  for (int i = 0; i < n; i++)
538  intensity[i] = complexvalue[i].real();
539  //intensity[i] = complexvalue[i].mag2();
540 
541  double min_val, max_val;
542  min_val = intensity[0];
543  max_val = intensity[0];
544 
545  for (int i = 0; i < n; ++i)
546  {
547  if (min_val > intensity[i])
548  min_val = intensity[i];
549  else if (max_val < intensity[i])
550  max_val = intensity[i];
551  }
552 
553  char fname[100];
554  strcpy(fname, fileName);
555  if (k != -1)
556  {
557  char num[30];
558  sprintf(num, "_%d", k);
559  strcat(fname, num);
560  }
561  strcat(fname, ".bmp");
562 
563  //LOG("minval %e, max val %e\n", min_val, max_val);
564 
565  unsigned char* cgh = (unsigned char*)malloc(sizeof(unsigned char)*n);
566 
567  for (int i = 0; i < n; ++i) {
568  double val = (intensity[i] - min_val) / (max_val - min_val);
569  //val = pow(val, 1.0 / 1.5);
570  val = val * 255.0;
571  unsigned char v = (uchar)val;
572 
573  cgh[i] = v;
574  }
575 
576  int ret = Openholo::saveAsImg(fname, 8, cgh, nx, ny);
577 
578  free(intensity);
579  free(cgh);
580 }
bytesperpixel
Definition: Openholo.cpp:431
virtual bool saveAsImg(const char *fname, uint8_t bitsperpixel, uchar *src, int width, int height)
Function for creating image files.
Definition: Openholo.cpp:135
void fftFree(void)
Resource release method.
Definition: Openholo.cpp:677
Real * wave_length
Definition: Openholo.h:106
unsigned char uchar
Definition: typedef.h:64
#define MODE_GPU
Definition: define.h:156
void writeIntensity_gray8_bmp(const char *fileName, int nx, int ny, Complex< Real > *complexvalue, int k=-1)
void convertLF2ComplexFieldUsingNonHogelMethod()
int loadLF(const char *directory, const char *exten)
Light Field images load.
float Real
Definition: typedef.h:55
void initialize(void)
Initialize variables for Hologram complex field, encoded data, normalized data.
Definition: ophGen.cpp:146
void fourierTransformOverUVLF()
#define CUR_TIME
Definition: function.h:58
bool checkExtension(const char *fname, const char *ext)
Functions for extension checking.
Definition: Openholo.cpp:86
#define OPH_ESTIMATE
Definition: define.h:76
structure for 2-dimensional integer vector and its arithmetic.
Definition: ivec.h:66
bool GetRandomPhase()
Function for getting the random phase.
Definition: ophGen.h:528
const XMLNode * FirstChild() const
Get the first child node, or null if none exists.
Definition: tinyxml2.h:761
#define _Y
Definition: define.h:96
vec2 pixel_pitch
Definition: Openholo.h:101
void setViewingWindow(bool is_ViewingWindow)
Set the value of a variable is_ViewingWindow(true or false)
#define _X
Definition: define.h:92
unsigned int m_mode
Definition: ophGen.h:350
bool getImgSize(int &w, int &h, int &bytesperpixel, const char *fname)
Function for getting the image size.
Definition: Openholo.cpp:402
void Fresnel_FFT(Complex< Real > *src, Complex< Real > *dst, Real lambda, Real distance)
Fresnel-fft method.
Definition: ophGen.cpp:516
void fft2(ivec2 n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
Functions for performing fftw 2-dimension operations inside Openholo.
Definition: Openholo.cpp:559
void makePlaneWaveWField(double thetaX, double thetaY)
void convertToFormatGray8(uchar *src, uchar *dst, int w, int h, int bytesperpixel)
Function for convert image format to gray8.
Definition: Openholo.cpp:511
bool readConfig(const char *fname)
Light Field based CGH configuration file load.
#define ELAPSED_TIME(x, y)
Definition: function.h:59
uint waveNum
Definition: Openholo.h:105
bool readConfig(const char *fname)
load to configuration file.
Definition: ophGen.cpp:221
ophNonHogelLF(void)
Constructor.
XMLError LoadFile(const char *filename)
Definition: tinyxml2.cpp:2150
virtual uchar * loadAsImg(const char *fname)
Function for loading image files.
Definition: Openholo.cpp:321
Real rand(const Real min, const Real max, oph::ulong _SEED_VALUE=0)
Get random Real value from min to max.
Definition: function.h:294
void makeRandomWField()
void resetBuffer()
reset buffer
Definition: ophGen.cpp:801
void preprocessLF()
Hologram generation.
OphConfig context_
Definition: Openholo.h:486
#define OPH_FORWARD
Definition: define.h:66
Complex< Real > ** complex_H
Definition: Openholo.h:490
void generateHologram()
const XMLElement * FirstChildElement(const char *name=0) const
Definition: tinyxml2.cpp:940
unsigned int uint
Definition: typedef.h:62
#define M_PI
Definition: define.h:52