1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #9818 from tz70s:issue#9570

This commit is contained in:
Alexander Alekhin
2017-10-11 15:19:17 +00:00
2 changed files with 48 additions and 0 deletions
@@ -1058,6 +1058,34 @@ const uchar* Mat::ptr(const int* idx) const
return p;
}
template<typename _Tp> inline
_Tp* Mat::ptr(const int* idx)
{
int i, d = dims;
uchar* p = data;
CV_DbgAssert( d >= 1 && p );
for( i = 0; i < d; i++ )
{
CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] );
p += idx[i] * step.p[i];
}
return (_Tp*)p;
}
template<typename _Tp> inline
const _Tp* Mat::ptr(const int* idx) const
{
int i, d = dims;
uchar* p = data;
CV_DbgAssert( d >= 1 && p );
for( i = 0; i < d; i++ )
{
CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] );
p += idx[i] * step.p[i];
}
return (const _Tp*)p;
}
template<typename _Tp> inline
_Tp& Mat::at(int i0, int i1)
{