@@ -127,39 +127,46 @@ template<typename T> struct OpMax
127
127
T operator ()(const T a, const T b) const { return std::max (a, b); }
128
128
};
129
129
130
- inline Size getContinuousSize ( const Mat& m1 , int widthScale= 1 )
130
+ inline Size getContinuousSize_ ( int flags, int cols , int rows, int widthScale )
131
131
{
132
- return m1.isContinuous () ? Size (m1.cols *m1.rows *widthScale, 1 ) :
133
- Size (m1.cols *widthScale, m1.rows );
132
+ int64 sz = (int64)cols * rows * widthScale;
133
+ return (flags & Mat::CONTINUOUS_FLAG) != 0 &&
134
+ (int )sz == sz ? Size ((int )sz, 1 ) : Size (cols * widthScale, rows);
134
135
}
135
136
136
- inline Size getContinuousSize ( const Mat& m1, const Mat& m2, int widthScale= 1 )
137
+ inline Size getContinuousSize (const Mat& m1, int widthScale = 1 )
137
138
{
138
- return (m1.flags & m2. flags & Mat::CONTINUOUS_FLAG) != 0 ?
139
- Size (m1. cols *m1. rows *widthScale, 1 ) : Size ( m1.cols *widthScale , m1.rows );
139
+ return getContinuousSize_ (m1.flags ,
140
+ m1.cols , m1.rows , widthScale );
140
141
}
141
142
142
- inline Size getContinuousSize ( const Mat& m1, const Mat& m2,
143
- const Mat& m3, int widthScale=1 )
143
+ inline Size getContinuousSize (const Mat& m1, const Mat& m2, int widthScale = 1 )
144
144
{
145
- return (m1.flags & m2.flags & m3. flags & Mat::CONTINUOUS_FLAG) != 0 ?
146
- Size (m1. cols *m1. rows *widthScale, 1 ) : Size ( m1.cols *widthScale , m1.rows );
145
+ return getContinuousSize_ (m1.flags & m2.flags ,
146
+ m1.cols , m1.rows , widthScale );
147
147
}
148
148
149
- inline Size getContinuousSize ( const Mat& m1, const Mat& m2,
150
- const Mat& m3, const Mat& m4,
151
- int widthScale=1 )
149
+ inline Size getContinuousSize (const Mat& m1, const Mat& m2,
150
+ const Mat& m3, int widthScale = 1 )
152
151
{
153
- return (m1.flags & m2.flags & m3.flags & m4. flags & Mat::CONTINUOUS_FLAG) != 0 ?
154
- Size (m1. cols *m1. rows *widthScale, 1 ) : Size ( m1.cols *widthScale , m1.rows );
152
+ return getContinuousSize_ (m1.flags & m2.flags & m3.flags ,
153
+ m1.cols , m1.rows , widthScale );
155
154
}
156
155
157
- inline Size getContinuousSize ( const Mat& m1, const Mat& m2,
158
- const Mat& m3, const Mat& m4,
159
- const Mat& m5, int widthScale= 1 )
156
+ inline Size getContinuousSize (const Mat& m1, const Mat& m2,
157
+ const Mat& m3, const Mat& m4,
158
+ int widthScale = 1 )
160
159
{
161
- return (m1.flags & m2.flags & m3.flags & m4.flags & m5.flags & Mat::CONTINUOUS_FLAG) != 0 ?
162
- Size (m1.cols *m1.rows *widthScale, 1 ) : Size (m1.cols *widthScale, m1.rows );
160
+ return getContinuousSize_ (m1.flags & m2.flags & m3.flags & m4.flags ,
161
+ m1.cols , m1.rows , widthScale);
162
+ }
163
+
164
+ inline Size getContinuousSize (const Mat& m1, const Mat& m2,
165
+ const Mat& m3, const Mat& m4,
166
+ const Mat& m5, int widthScale = 1 )
167
+ {
168
+ return getContinuousSize_ (m1.flags & m2.flags & m3.flags & m4.flags & m5.flags ,
169
+ m1.cols , m1.rows , widthScale);
163
170
}
164
171
165
172
struct NoVec
0 commit comments