From d7a8166720e4e299ef06771c58669a223090cd1d Mon Sep 17 00:00:00 2001 From: Marc Rollins Date: Mon, 18 Aug 2014 11:42:10 -0700 Subject: [PATCH] Implementing *= operator. Implementing * in terms of it. --- modules/core/include/opencv2/core/types.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/core/include/opencv2/core/types.hpp b/modules/core/include/opencv2/core/types.hpp index 0b09c6f..43b2d2e 100644 --- a/modules/core/include/opencv2/core/types.hpp +++ b/modules/core/include/opencv2/core/types.hpp @@ -1311,11 +1311,19 @@ _Tp Size_<_Tp>::area() const return width * height; } +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 * (const Size_<_Tp>& a, _Tp b) +Size_<_Tp> operator * (Size_<_Tp> a, _Tp b) { - return Size_<_Tp>(a.width * b, a.height * b); + a *= b; + return a; } template static inline -- 2.7.4