diff --git a/distortiondialog.ui b/distortiondialog.ui
new file mode 100644
index 0000000..e89667a
--- /dev/null
+++ b/distortiondialog.ui
@@ -0,0 +1,32 @@
+
+
+ DistortionDialogClass
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Distortion Map
+
+
+
+
+ 300
+ 250
+ 87
+ 27
+
+
+
+ Compute
+
+
+
+
+
+
diff --git a/qtDistortionDialog.cpp b/qtDistortionDialog.cpp
new file mode 100644
index 0000000..0f6a0aa
--- /dev/null
+++ b/qtDistortionDialog.cpp
@@ -0,0 +1,12 @@
+#include "qtDistortionDialog.h"
+
+qtDistortionDialog::qtDistortionDialog(QWidget *parent, Qt::WFlags flags)
+ : QDialog(parent, flags)
+{
+ ui.setupUi(this);
+}
+
+qtDistortionDialog::~qtDistortionDialog()
+{
+ updating = false;
+}
diff --git a/qtDistortionDialog.h b/qtDistortionDialog.h
new file mode 100644
index 0000000..7d25207
--- /dev/null
+++ b/qtDistortionDialog.h
@@ -0,0 +1,84 @@
+#ifndef DISTORTIONDIALOG_H
+#define DISTORTIONDIALOG_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "ui_distortiondialog.h"
+#include "globals.h"
+
+extern QGraphicsScene* distortionScene;
+extern QGraphicsView* distortionWindow;
+extern QGraphicsPixmapItem* pixmapItem;
+
+class qtDistortionDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ qtDistortionDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
+ ~qtDistortionDialog();
+ bool updating;
+
+private:
+ Ui::DistortionDialogClass ui;
+
+public slots:
+ void on_btnComputeDistortionMap_clicked(){
+
+ int steps = 100;
+
+ //delete the pixmap if one previously existed
+ if(pixmapItem != NULL)
+ delete(pixmapItem);
+
+ //create an image
+ QImage image(steps, steps, QImage::Format_RGB888);
+
+ QColor color(255, 255, 0);
+
+
+ //compute the distortion map
+ float* distortionMap = (float*)malloc(sizeof(float) * steps * steps);
+ DistortionMap(distortionMap, steps);
+
+ //compute the extrema
+ float minDistortion = 99999;
+ float maxDistortion = distortionMap[0];
+ for(int i=1; i 0)
+ minDistortion = distortionMap[i];
+ if(distortionMap[i] > maxDistortion)
+ maxDistortion = distortionMap[i];
+ }
+ cout<addItem(pixmapItem);
+ distortionWindow->show();
+
+
+ }
+};
+
+#endif
--
libgit2 0.21.4