#include <iostream>
#include <cmath>
template <typename T>
};
template <typename T>
struct setVal
setVal(T
val) : _val(val) {}
T operator()() const { return _val; }
private:
T _val;
};
template <typename T>
T operator()(T
val)
const {
return val + 1; }
};
template <typename T1, typename T2>
T1 operator()(T1 lhs, T2 rhs) const { return lhs / rhs; }
};
template <typename T>
Gaussian(
float a,
float xc,
float yc,
float alpha) : _a(a), _xc(xc), _yc(yc), _alpha(alpha) {}
T operator()(
int x,
int y, T
val)
const {
float const dx = x - _xc;
float const dy = y - _yc;
return val + _a * ::exp(-(dx * dx + dy * dy) / (2 * _alpha * _alpha));
}
private:
float _a, _xc, _yc, _alpha;
};
cout << img1(0, 0) <<
" " << img2(0, 0) <<
endl;
cout << img1(0, 0) <<
" " << img2(0, 0) << endl;
cout << img1(0, 0) <<
" " << img2(0, 0) << endl;
cout << img1(0, 0) <<
" " << img2(0, 0) << endl;
float const peak = 1000.0;
float const xc = 5.0;
float const yc = 3.0;
float const alpha = 1.5;
cout << img1(0, 0) <<
" " << img1(xc, yc) << endl;
}