return b;
}
+// Fixing a back compatibility problem -- to be reviewed by Vadim
+template<typename _Tp> inline Point MatConstIterator_<_Tp>::pos() const
+{
+ if( !m )
+ return Point();
+ if( m->isContinuous() )
+ {
+ ptrdiff_t ofs = ptr - (_Tp*)m->data;
+ int y = (int)(ofs / m->cols), x = (int)(ofs - (ptrdiff_t)y*m->cols);
+ return Point(x, y);
+ }
+ else
+ {
+ ptrdiff_t ofs = (uchar*)ptr - m->data;
+ int y = (int)(ofs / m->step), x = (int)((ofs - y*m->step)/sizeof(_Tp));
+ return Point(x, y);
+ }
+}
+
static inline bool
operator == (const MatConstIterator& a, const MatConstIterator& b)
{ return a.m == b.m && a.ptr == b.ptr; }