Openholo  v4.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  fresnelPropagation(Hologram, complex_H[ch], distance, ch); //distanceRS2Holo
257  }
258 
259  LOG("Total Elapsed Time: %.5lf (sec)\n", ELAPSED_TIME(begin, CUR_TIME));
260 }
261 
262 void ophNonHogelLF::generateHologram(double thetaX, double thetaY)
263 {
264  resetBuffer();
265 
266  LOG("1) Algorithm Method : Non-hogel based hologram generation from Light Field\n");
267  LOG("2) Generate Hologram with %s\n", m_mode & MODE_GPU ?
268  "GPU" :
269 #ifdef _OPENMP
270  "Multi Core CPU"
271 #else
272  "Single Core CPU"
273 #endif
274  );
275  LOG("3) Random Phase Use : %s\n", GetRandomPhase() ? "Y" : "N");
276  LOG("4) Number of Images : %d x %d\n", num_image[_X], num_image[_Y]);
277 
278  auto begin = CUR_TIME;
279  if (m_mode & MODE_GPU)
280  {
281  LOG("Not implement GPU version");
282  }
283  else
284  {
285  setBuffer();
286  makePlaneWaveWField(thetaX, thetaY);
288  Real distance = 0.0;
289  for (uint ch = 0; ch < context_.waveNum; ch++)
290  fresnelPropagation(Hologram, complex_H[ch], distance, ch); //distanceRS2Holo
291  }
292 
293  LOG("Total Elapsed Time: %.5lf (sec)\n", ELAPSED_TIME(begin, CUR_TIME));
294 }
295 
296 //int ophLF::saveAsOhc(const char * fname)
297 //{
298 // setPixelNumberOHC(getEncodeSize());
299 //
300 // Openholo::saveAsOhc(fname);
301 //
302 // return 0;
303 //}
304 
306 {
307  const uint nU = num_image[_X];
308  const uint nV = num_image[_Y];
309  nBufferX = (nU >> 1) + 1;
310  nBufferY = (nV >> 1) + 1;
311 }
312 
314 {
315  if (LF != nullptr) {
316  for (int i = 0; i < nImages; i++) {
317  if (LF[i]) {
318  delete[] LF[i];
319  LF[i] = nullptr;
320  }
321  }
322  delete[] LF;
323  LF = nullptr;
324  }
325 
326  LF = new uchar*[num_image[_X] * num_image[_Y]];
327  for (int i = 0; i < num_image[_X] * num_image[_Y]; i++) {
328  LF[i] = new uchar[resolution_image[_X] * resolution_image[_Y]];
329  memset(LF[i], 0, resolution_image[_X] * resolution_image[_Y]);
330  }
331  nImages = num_image[_X] * num_image[_Y];
332 }
333 
335 {
336  auto begin = CUR_TIME;
337 
338  const uint nU = num_image[_X];
339  const uint nV = num_image[_Y];
340  const uint nUV = nU * nV;
341  const uint nX = resolution_image[_X];
342  const uint nY = resolution_image[_Y];
343  const uint nXY = nX * nY;
344  const uint nXwithBuffer = nX + 2 * nBufferX;
345  const uint nYwithBuffer = nY + 2 * nBufferY;
346  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
347 
348  if (WField) {
349  delete[] WField;
350  WField = nullptr;
351  }
352  WField = new Complex<Real>[nXYwithBuffer];
353  memset(WField, 0.0, sizeof(Complex<Real>) * nXYwithBuffer);
354 
355  Complex<Real> phase(0.0, 0.0);
356  Real randVal;
357 #ifdef _OPENMP
358 #pragma omp parallel for
359 #endif
360  for (int idxnXY = 0; idxnXY < nXYwithBuffer; idxnXY++) {
361  randVal = rand((Real)0, (Real)1, idxnXY);
362  phase(0.0, 2.0 * M_PI * randVal); //randVal
363  WField[idxnXY] = exp(phase);
364  }
365  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
366 }
367 
368 void ophNonHogelLF::makePlaneWaveWField(double thetaX, double thetaY)
369 {
370  auto begin = CUR_TIME;
371  const uint nU = num_image[_X];
372  const uint nV = num_image[_Y];
373  const uint nUV = nU * nV;
374  const uint nX = resolution_image[_X];
375  const uint nY = resolution_image[_Y];
376  const uint nXY = nX * nY;
377  const long long int nXwithBuffer = nX + 2 * nBufferX;
378  const long long int nYwithBuffer = nY + 2 * nBufferY;
379  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
380  const double px = context_.pixel_pitch[_X];
381  const double py = context_.pixel_pitch[_Y];
382 
383 
384  if (WField) {
385  delete[] WField;
386  WField = nullptr;
387  }
388  WField = new Complex<Real>[nXYwithBuffer];
389  memset(WField, 0.0, sizeof(Complex<Real>) * nXYwithBuffer);
390 
391  Complex<Real> phase(0.0, 0.0);
392  double carrierFreqX = (1.0 / context_.wave_length[0])*sin(thetaX);
393  double carrierFreqY = (1.0 / context_.wave_length[0])*sin(thetaY);
394  for (int idxnX = 0; idxnX < nXwithBuffer; idxnX++) {
395  for (int idxnY = 0; idxnY < nYwithBuffer; idxnY++) {
396  phase(0.0, 2.0*M_PI* (carrierFreqX*idxnX*px + carrierFreqY*idxnY*py));
397  WField[idxnX + nXwithBuffer*idxnY] = exp(phase);
398  }
399  }
400  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
401 }
402 
404 {
405  auto begin = CUR_TIME;
406  const int nX = resolution_image[_X]; // resolution of each orthographic images = spatial resolution of LF
407  const int nY = resolution_image[_Y];
408  const long long int nXY = nX * nY;
409  const int nU = num_image[_X]; // number of orthographic images = angular resolution of LF
410  const int nV = num_image[_Y];
411  const int nUV = nU * nV;
412  const long long int nXwithBuffer = nX + 2 * nBufferX;
413  const long long int nYwithBuffer = nY + 2 * nBufferY;
414  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
415 
416 
417  // initialize
418  if (FToverUV_LF) {
419  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
420  if (FToverUV_LF[idxnUV]) {
421  delete[] FToverUV_LF[idxnUV];
422  FToverUV_LF[idxnUV] = nullptr;
423  }
424  }
425  delete[] FToverUV_LF;
426  FToverUV_LF = nullptr;
427  }
428 
429  FToverUV_LF = new Complex<Real>*[nUV];
430  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
431  FToverUV_LF[idxnUV] = new Complex<Real>[nXY];
432  memset(FToverUV_LF[idxnUV], 0.0, nXY);
433  }
434 
435  // fft over uv axis
436  Complex<Real>* LFatXY = new Complex<Real>[nUV];
437  Complex<Real>* FToverUVatXY = new Complex<Real>[nUV];
438  int progressCheckPoint = 10000;
439  int idxProgress = 0;
440  for (int idxnXY = 0; idxnXY < nXY; idxnXY++) {
441  memset(LFatXY, 0.0, sizeof(Complex<Real>) * nUV);
442  memset(FToverUVatXY, 0.0, sizeof(Complex<Real>) * nUV);
443 
444  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
445  LFatXY[idxnUV] = LF[idxnUV][idxnXY];
446  }
447 
448  fft2(num_image, LFatXY, OPH_FORWARD, OPH_ESTIMATE); // num_image ==> ivec2(nU,nV)
449  fft2(LFatXY, FToverUVatXY, nU, nV, OPH_FORWARD);
450  fftFree();
451  for (int idxnUV = 0; idxnUV < nUV; idxnUV++) {
452  FToverUV_LF[idxnUV][idxnXY] = FToverUVatXY[idxnUV];
453  }
454 
455  // only for debugging
456  if (idxProgress == progressCheckPoint ) {
457  LOG("idxnXY : %1d out of nXY= %llu\n", idxnXY, nXY);
458  idxProgress = 0;
459  }
460  else {
461  idxProgress++;
462  }
463  }
464  delete[] LFatXY;
465  delete[] FToverUVatXY;
466  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
467 
468 }
469 
471 {
472  auto begin = CUR_TIME;
473 
474  const int nX = resolution_image[_X]; // resolution of each orthographic images = spatial resolution of LF
475  const int nY = resolution_image[_Y];
476  const long long int nXY = nX * nY;
477  const int nU = num_image[_X]; // number of orthographic images = angular resolution of LF
478  const int nV = num_image[_Y];
479  const int nUV = nU * nV;
480  const long long int nXwithBuffer = nX + 2 * nBufferX;
481  const long long int nYwithBuffer = nY + 2 * nBufferY;
482  const long long int nXYwithBuffer = nXwithBuffer * nYwithBuffer;
483 
484  if (Hologram) {
485  delete[] Hologram;
486  Hologram = nullptr;
487  }
488  Hologram = new Complex<Real>[nXY];
489  memset(Hologram, 0.0, sizeof(Complex<Real>) * nXY);
490 
491  Complex<Real>* HologramWithBuffer = new Complex<Real>[nXYwithBuffer];
492  memset(HologramWithBuffer, 0.0, sizeof(Complex<Real>) * nXYwithBuffer);
493 
494  int startXH = 0;
495  int startXW = 0;
496  int startYH = 0;
497  int startYW = 0;
498 
499  int idxnU = 0;
500  int idxnV = 0;
501  int idxnX = 0;
502  int idxnY = 0;
503  for (idxnU = 0; idxnU < nU; idxnU++) {
504  startXH = (int)((((double)idxnU) - 1.) / 2.) + (int)(-(((double)nU) + 1.) / 4. - ((double)(nX))/2.0 + ((double)(nXwithBuffer)) / 2.0);
505  startXW = startXH + (int)(((double)nU) / 2.) - (idxnU - 1);
506 
507  for (idxnV = 0; idxnV < nV; idxnV++) {
508  startYH = (int)((((double)idxnV) - 1.) / 2.) + (int)(-(((double)nV) + 1.) / 4. - ((double)(nY)) / 2.0 + ((double)(nYwithBuffer)) / 2.0);
509  startYW = startYH + (int)(((double)nV) / 2.) - (idxnV - 1);
510 
511  for (idxnX = 0; idxnX < nX; idxnX++) {
512  for (idxnY = 0; idxnY < nY; idxnY++) {
513 
514  HologramWithBuffer[(startXH + idxnX) + nXwithBuffer*(startYH + idxnY)] += FToverUV_LF[idxnU + nU*idxnV][idxnX+nX*idxnY] * WField[(startXW + idxnX) + nXwithBuffer*(startYW + idxnY)];
515 
516  }
517  }
518  }
519  }
520 
521  for (idxnX = 0; idxnX < nX; idxnX++) {
522  for (idxnY = 0; idxnY < nY; idxnY++) {
523  Hologram[idxnX + nX*idxnY] = HologramWithBuffer[(nBufferX + idxnX) + nXwithBuffer*(nBufferY + idxnY)];
524  }
525  }
526  delete[] HologramWithBuffer;
527  LOG("%s : %.5lf (sec)\n", __FUNCTION__, ELAPSED_TIME(begin, CUR_TIME));
528 }
529 
530 void ophNonHogelLF::writeIntensity_gray8_bmp(const char* fileName, int nx, int ny, Complex<Real>* complexvalue, int k)
531 {
532  const int n = nx * ny;
533 
534  double* intensity = (double*)malloc(sizeof(double)*n);
535  for (int i = 0; i < n; i++)
536  intensity[i] = complexvalue[i].real();
537  //intensity[i] = complexvalue[i].mag2();
538 
539  double min_val, max_val;
540  min_val = intensity[0];
541  max_val = intensity[0];
542 
543  for (int i = 0; i < n; ++i)
544  {
545  if (min_val > intensity[i])
546  min_val = intensity[i];
547  else if (max_val < intensity[i])
548  max_val = intensity[i];
549  }
550 
551  char fname[100];
552  strcpy(fname, fileName);
553  if (k != -1)
554  {
555  char num[30];
556  sprintf(num, "_%d", k);
557  strcat(fname, num);
558  }
559  strcat(fname, ".bmp");
560 
561  //LOG("minval %e, max val %e\n", min_val, max_val);
562 
563  unsigned char* cgh = (unsigned char*)malloc(sizeof(unsigned char)*n);
564 
565  for (int i = 0; i < n; ++i) {
566  double val = (intensity[i] - min_val) / (max_val - min_val);
567  //val = pow(val, 1.0 / 1.5);
568  val = val * 255.0;
569  unsigned char v = (uchar)val;
570 
571  cgh[i] = v;
572  }
573 
574  int ret = Openholo::saveAsImg(fname, 8, cgh, nx, ny);
575 
576  free(intensity);
577  free(cgh);
578 }
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:70
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:145
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:538
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:65
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:351
bool getImgSize(int &w, int &h, int &bytesperpixel, const char *fname)
Function for getting the image size.
Definition: Openholo.cpp:402
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
void fresnelPropagation(OphConfig context, Complex< Real > *in, Complex< Real > *out, Real distance)
Fresnel propagation.
Definition: ophGen.cpp:1441
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:69
bool readConfig(const char *fname)
load to configuration file.
Definition: ophGen.cpp:220
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:821
void preprocessLF()
Hologram generation.
OphConfig context_
Definition: Openholo.h:449
#define OPH_FORWARD
Definition: define.h:66
Complex< Real > ** complex_H
Definition: Openholo.h:452
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