HologramDepthmap Library
hologramdepthmap.cpp
Go to the documentation of this file.
1 #include "hologramdepthmap.h"
2 #include <QtCore/QTime>
3 
5  : QMainWindow(parent)
6 {
7  ui.setupUi(this);
8 
9  QObject::connect(ui.pbGen, SIGNAL(clicked()), this, SLOT(GenHologram()));
10  QObject::connect(ui.pbRecon, SIGNAL(clicked()), this, SLOT(ReconImage()));
11 
12  ui.rbCPU->setChecked(true);
13  hologram_ = 0;
14 
15 }
16 
18 {
19 
20 }
21 
23 {
24  LOG("Generate Hologram\n");
25 
26  if (!hologram_)
28 
29  hologram_->setMode(ui.rbCPU->isChecked());
30 
31  if (!hologram_->readConfig())
32  {
33  QMessageBox::warning(this,"Warning", "Error: Wrong Format\n", QMessageBox::Ok, QMessageBox::Ok);
34  return;
35  }
36 
37  QTime t;
38  t.start();
39 
42 
43  LOG("Time : %d \n", t.elapsed());
44  LOG("Time : %f \n", t.elapsed()*0.001/60);
45 
46 }
48 {
49  if (!hologram_)
51 
52  hologram_->setMode(ui.rbCPU->isChecked());
53 
54  if (!hologram_->readConfig())
55  {
56  QMessageBox::warning(this, "Warning", "Error: Wrong Format\n", QMessageBox::Ok, QMessageBox::Ok);
57  return;
58  }
59  LOG("Reconstruct Image\n");
60 
62 
63 }
void ReconstructImage()
It is a testing function used for the reconstruction.
HologramGenerator * hologram_
void GenerateHologram()
Generate a hologram, main funtion.
void initialize()
Initialize variables for CPU and GPU implementation.
HologramDepthmap(QWidget *parent=0)
bool readConfig()
Read parameters from a config file(config_openholo.txt).
Main class for generating a hologram using depth map data.
void setMode(bool isCPU)
Set the value of a variable isCPU_(true or false)
Ui::HologramDepthmapClass ui