27 #ifndef IMG_NORMALIZER_IMPL_H
28 #define IMG_NORMALIZER_IMPL_H
30 #include <boost/shared_ptr.hpp>
36 namespace ost {
namespace img {
48 template <
typename T,
class D>
51 for(T* ptr = s.Data().GetData(); ptr<s.Data().GetEnd(); ++ptr) {
52 *ptr =
static_cast<T
>(Convert(*ptr));
57 virtual Real BackConvert(
Real v)
const = 0;
59 virtual Real Convert(
Real v)
const = 0;
98 return (val ==
Complex(0.0)? 1.0 : val/std::abs(val))*std::max<Real>(std::min<Real>(std::abs(val),maxval),minval);