]> git.sesse.net Git - movit/blobdiff - deconvolution_sharpen_effect.cpp
Split out some private utilities into effect_util.cpp, so we do not need to include...
[movit] / deconvolution_sharpen_effect.cpp
index ab28eb387d980ec8923ec150b1f3903e04e85f10..f3998d918e310ff523600252e2f037740d31846c 100644 (file)
@@ -2,15 +2,19 @@
 // Since all of our signals are symmetrical, discrete correlation and convolution
 // is the same operation, and so we won't make a difference in notation.
 
-
-#include <math.h>
-#include <assert.h>
 #include <Eigen/Dense>
 #include <Eigen/Cholesky>
+#include <GL/glew.h>
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <algorithm>
+#include <new>
 
 #include "deconvolution_sharpen_effect.h"
+#include "effect_util.h"
 #include "util.h"
-#include "opengl.h"
 
 using namespace Eigen;
 
@@ -268,8 +272,7 @@ void DeconvolutionSharpenEffect::update_deconvolution_kernel()
                        if (gaussian_radius < 1e-3) {
                                val = (x == 0 && y == 0) ? 1.0f : 0.0f;
                        } else {
-                               float z = hypot(x, y) / gaussian_radius;
-                               val = exp(-z * z);
+                               val = exp(-(x*x + y*y) / (2.0 * gaussian_radius * gaussian_radius));
                        }
                        gaussian_h(y + 2 * R, x + 2 * R) = val;
                }