|
|
|
@ -1586,7 +1586,13 @@ template<typename _Tp> template<int n> inline |
|
|
|
|
Mat_<_Tp>::operator Vec<typename DataType<_Tp>::channel_type, n>() const |
|
|
|
|
{ |
|
|
|
|
CV_Assert(n % DataType<_Tp>::channels == 0); |
|
|
|
|
|
|
|
|
|
#if defined _MSC_VER |
|
|
|
|
const Mat* pMat = (const Mat*)this; // workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround)
|
|
|
|
|
return pMat->operator Vec<typename DataType<_Tp>::channel_type, n>(); |
|
|
|
|
#else |
|
|
|
|
return this->Mat::operator Vec<typename DataType<_Tp>::channel_type, n>(); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<typename _Tp> template<int m, int n> inline |
|
|
|
@ -1594,8 +1600,14 @@ Mat_<_Tp>::operator Matx<typename DataType<_Tp>::channel_type, m, n>() const |
|
|
|
|
{ |
|
|
|
|
CV_Assert(n % DataType<_Tp>::channels == 0); |
|
|
|
|
|
|
|
|
|
#if defined _MSC_VER |
|
|
|
|
const Mat* pMat = (const Mat*)this; // workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround)
|
|
|
|
|
Matx<typename DataType<_Tp>::channel_type, m, n> res = pMat->operator Matx<typename DataType<_Tp>::channel_type, m, n>(); |
|
|
|
|
return res; |
|
|
|
|
#else |
|
|
|
|
Matx<typename DataType<_Tp>::channel_type, m, n> res = this->Mat::operator Matx<typename DataType<_Tp>::channel_type, m, n>(); |
|
|
|
|
return res; |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<typename _Tp> inline |
|
|
|
|