typedef T1 type1;
typedef T2 type2;
typedef T3 rtype;
- T3 operator ()(T1 a, T2 b) const { return saturate_cast<T3>(a + b); }
+ T3 operator ()(const T1 a, const T2 b) const { return saturate_cast<T3>(a + b); }
};
template<typename T1, typename T2=T1, typename T3=T1> struct OpSub
typedef T1 type1;
typedef T2 type2;
typedef T3 rtype;
- T3 operator ()(T1 a, T2 b) const { return saturate_cast<T3>(a - b); }
+ T3 operator ()(const T1 a, const T2 b) const { return saturate_cast<T3>(a - b); }
};
template<typename T1, typename T2=T1, typename T3=T1> struct OpRSub
typedef T1 type1;
typedef T2 type2;
typedef T3 rtype;
- T3 operator ()(T1 a, T2 b) const { return saturate_cast<T3>(b - a); }
+ T3 operator ()(const T1 a, const T2 b) const { return saturate_cast<T3>(b - a); }
};
template<typename T> struct OpMin
typedef T type1;
typedef T type2;
typedef T rtype;
- T operator ()(T a, T b) const { return std::min(a, b); }
+ T operator ()(const T a, const T b) const { return std::min(a, b); }
};
template<typename T> struct OpMax
typedef T type1;
typedef T type2;
typedef T rtype;
- T operator ()(T a, T b) const { return std::max(a, b); }
+ T operator ()(const T a, const T b) const { return std::max(a, b); }
};
inline Size getContinuousSize( const Mat& m1, int widthScale=1 )
typedef T type1;
typedef T type2;
typedef T rtype;
- T operator ()(T a, T b) const { return std::min(a, b); }
+ T operator ()(const T a, const T b) const { return std::min(a, b); }
};
template<typename T> struct MaxOp
typedef T type1;
typedef T type2;
typedef T rtype;
- T operator ()(T a, T b) const { return std::max(a, b); }
+ T operator ()(const T a, const T b) const { return std::max(a, b); }
};
#undef CV_MIN_8U
#define CV_MIN_8U(a,b) ((a) - CV_FAST_CAST_8U((a) - (b)))
#define CV_MAX_8U(a,b) ((a) + CV_FAST_CAST_8U((b) - (a)))
-template<> inline uchar MinOp<uchar>::operator ()(uchar a, uchar b) const { return CV_MIN_8U(a, b); }
-template<> inline uchar MaxOp<uchar>::operator ()(uchar a, uchar b) const { return CV_MAX_8U(a, b); }
+template<> inline uchar MinOp<uchar>::operator ()(const uchar a, const uchar b) const { return CV_MIN_8U(a, b); }
+template<> inline uchar MaxOp<uchar>::operator ()(const uchar a, const uchar b) const { return CV_MAX_8U(a, b); }
struct MorphRowNoVec
{