From d3d9b538c7ec02c9b4fac09e5829d78305fccbea Mon Sep 17 00:00:00 2001 From: Marc Rollins Date: Mon, 18 Aug 2014 11:48:38 -0700 Subject: [PATCH] Implementing division operators. --- modules/core/include/opencv2/core/types.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/core/include/opencv2/core/types.hpp b/modules/core/include/opencv2/core/types.hpp index 43b2d2e14..b8f943453 100644 --- a/modules/core/include/opencv2/core/types.hpp +++ b/modules/core/include/opencv2/core/types.hpp @@ -1326,6 +1326,21 @@ Size_<_Tp> operator * (Size_<_Tp> a, _Tp b) return a; } +template static inline +Size_<_Tp>& operator /= (Size_<_Tp>& a, _Tp b) +{ + a.width /= b; + a.height /= b; + return a; +} + +template static inline +Size_<_Tp> operator / (Size_<_Tp> a, _Tp b) +{ + a /= b; + return a; +} + template static inline Size_<_Tp> operator + (const Size_<_Tp>& a, const Size_<_Tp>& b) {