X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=deconvolution_sharpen_effect.cpp;h=0a13dd642f3d9a3cb5d00ac857f2763cf4904ee5;hp=f3998d918e310ff523600252e2f037740d31846c;hb=85f9719bf3519b1f1942738d11601584f5d38725;hpb=ad66f9714e4a36008c341355700272a52484a785 diff --git a/deconvolution_sharpen_effect.cpp b/deconvolution_sharpen_effect.cpp index f3998d9..0a13dd6 100644 --- a/deconvolution_sharpen_effect.cpp +++ b/deconvolution_sharpen_effect.cpp @@ -17,6 +17,7 @@ #include "util.h" using namespace Eigen; +using namespace std; DeconvolutionSharpenEffect::DeconvolutionSharpenEffect() : R(5), @@ -37,7 +38,7 @@ DeconvolutionSharpenEffect::DeconvolutionSharpenEffect() register_float("noise", &noise); } -std::string DeconvolutionSharpenEffect::output_fragment_shader() +string DeconvolutionSharpenEffect::output_fragment_shader() { char buf[256]; sprintf(buf, "#define R %u\n", R); @@ -170,10 +171,10 @@ MatrixXf convolve(const MatrixXf &a, const MatrixXf &b) int xa_max = xr; // Now fit to the first demand. - ya_min = std::max(ya_min, 0); - ya_max = std::min(ya_max, a.rows() - 1); - xa_min = std::max(xa_min, 0); - xa_max = std::min(xa_max, a.cols() - 1); + ya_min = max(ya_min, 0); + ya_max = min(ya_max, a.rows() - 1); + xa_min = max(xa_min, 0); + xa_max = min(xa_max, a.cols() - 1); assert(ya_max >= ya_min); assert(xa_max >= xa_min); @@ -220,10 +221,10 @@ MatrixXf central_convolve(const MatrixXf &a, const MatrixXf &b) int xa_max = xr; // Now fit to the first demand. - ya_min = std::max(ya_min, 0); - ya_max = std::min(ya_max, a.rows() - 1); - xa_min = std::max(xa_min, 0); - xa_max = std::min(xa_max, a.cols() - 1); + ya_min = max(ya_min, 0); + ya_max = min(ya_max, a.rows() - 1); + xa_min = max(xa_min, 0); + xa_max = min(xa_max, a.cols() - 1); assert(ya_max >= ya_min); assert(xa_max >= xa_min); @@ -240,16 +241,6 @@ MatrixXf central_convolve(const MatrixXf &a, const MatrixXf &b) return result; } -void print_matrix(const MatrixXf &m) -{ - for (int y = 0; y < m.rows(); ++y) { - for (int x = 0; x < m.cols(); ++x) { - printf("%7.4f ", m(x, y)); - } - printf("\n"); - } -} - } // namespace void DeconvolutionSharpenEffect::update_deconvolution_kernel() @@ -427,7 +418,7 @@ void DeconvolutionSharpenEffect::update_deconvolution_kernel() last_noise = noise; } -void DeconvolutionSharpenEffect::set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) +void DeconvolutionSharpenEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, unsigned *sampler_num) { Effect::set_gl_state(glsl_program_num, prefix, sampler_num);