Skip to content

Commit 86b55b3

Browse files
committed
core: eliminate CV_ELEM_SIZE()
1 parent 0151931 commit 86b55b3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

modules/core/include/opencv2/core/mat.inl.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ _Tp& Mat::at(int i0)
11081108
CV_DbgAssert(dims <= 2);
11091109
CV_DbgAssert(data);
11101110
CV_DbgAssert((unsigned)i0 < (unsigned)(size.p[0] * size.p[1]));
1111-
CV_DbgAssert(elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value));
1111+
CV_DbgAssert(elemSize() == sizeof(_Tp));
11121112
if( isContinuous() || size.p[0] == 1 )
11131113
return ((_Tp*)data)[i0];
11141114
if( size.p[1] == 1 )
@@ -1123,7 +1123,7 @@ const _Tp& Mat::at(int i0) const
11231123
CV_DbgAssert(dims <= 2);
11241124
CV_DbgAssert(data);
11251125
CV_DbgAssert((unsigned)i0 < (unsigned)(size.p[0] * size.p[1]));
1126-
CV_DbgAssert(elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value));
1126+
CV_DbgAssert(elemSize() == sizeof(_Tp));
11271127
if( isContinuous() || size.p[0] == 1 )
11281128
return ((const _Tp*)data)[i0];
11291129
if( size.p[1] == 1 )
@@ -1135,42 +1135,42 @@ const _Tp& Mat::at(int i0) const
11351135
template<typename _Tp> inline
11361136
_Tp& Mat::at(int i0, int i1, int i2)
11371137
{
1138-
CV_DbgAssert( elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value) );
1138+
CV_DbgAssert( elemSize() == sizeof(_Tp) );
11391139
return *(_Tp*)ptr(i0, i1, i2);
11401140
}
11411141

11421142
template<typename _Tp> inline
11431143
const _Tp& Mat::at(int i0, int i1, int i2) const
11441144
{
1145-
CV_DbgAssert( elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value) );
1145+
CV_DbgAssert( elemSize() == sizeof(_Tp) );
11461146
return *(const _Tp*)ptr(i0, i1, i2);
11471147
}
11481148

11491149
template<typename _Tp> inline
11501150
_Tp& Mat::at(const int* idx)
11511151
{
1152-
CV_DbgAssert( elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value) );
1152+
CV_DbgAssert( elemSize() == sizeof(_Tp) );
11531153
return *(_Tp*)ptr(idx);
11541154
}
11551155

11561156
template<typename _Tp> inline
11571157
const _Tp& Mat::at(const int* idx) const
11581158
{
1159-
CV_DbgAssert( elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value) );
1159+
CV_DbgAssert( elemSize() == sizeof(_Tp) );
11601160
return *(const _Tp*)ptr(idx);
11611161
}
11621162

11631163
template<typename _Tp, int n> inline
11641164
_Tp& Mat::at(const Vec<int, n>& idx)
11651165
{
1166-
CV_DbgAssert( elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value) );
1166+
CV_DbgAssert( elemSize() == sizeof(_Tp) );
11671167
return *(_Tp*)ptr(idx.val);
11681168
}
11691169

11701170
template<typename _Tp, int n> inline
11711171
const _Tp& Mat::at(const Vec<int, n>& idx) const
11721172
{
1173-
CV_DbgAssert( elemSize() == CV_ELEM_SIZE(traits::Type<_Tp>::value) );
1173+
CV_DbgAssert( elemSize() == sizeof(_Tp) );
11741174
return *(const _Tp*)ptr(idx.val);
11751175
}
11761176

0 commit comments

Comments
 (0)