#include <iostream>
#include <cmath>
template <typename T>
};
template <typename T>
struct setVal
setVal(T val) : _val(val) {}
private:
T _val;
};
template <typename T>
};
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) {}
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;
};
int main() {
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;
}
A class to represent a 2-dimensional array of pixels.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()
A functor class equivalent to std::function<ValT ()>, but with a virtual operator()
virtual ValT operator()() const =0
A functor class equivalent to std::function<ValT (ValT)>, but with a virtual operator()
virtual ValT operator()(ValT lhs) const =0
A functor class equivalent to std::function<ValT (int, int, ValT)>, but with a virtual operator()
virtual ValT operator()(int x, int y, ValT lhs) const =0
A functor class equivalent to std::function<LhsT (LhsT, RhsT)>, but with a virtual operator()
virtual LhsT operator()(LhsT lhs, RhsT rhs) const =0