1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-20 04:25:42 +08:00

Merge pull request #2666 from dtmoodie:fix_cudev

Replace DataType in cudev with traits::Type<T>

* DataType<T>::type is deprecated, replace with traits::Type<T>::value

* typo
This commit is contained in:
dtmoodie
2020-09-13 07:49:25 -04:00
committed by GitHub
parent e320d6aad0
commit 9ccd8eeecd

View File

@@ -54,30 +54,30 @@ template <typename T>
__host__ GpuMat_<T>::GpuMat_(Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(Allocator* allocator)
: GpuMat(allocator) : GpuMat(allocator)
{ {
flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type; flags = (flags & ~CV_MAT_TYPE_MASK) | traits::Type<T>::value;
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(int arows, int acols, Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(int arows, int acols, Allocator* allocator)
: GpuMat(arows, acols, DataType<T>::type, allocator) : GpuMat(arows, acols, traits::Type<T>::value, allocator)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(Size asize, Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(Size asize, Allocator* allocator)
: GpuMat(asize.height, asize.width, DataType<T>::type, allocator) : GpuMat(asize.height, asize.width, traits::Type<T>::value, allocator)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(int arows, int acols, Scalar val, Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(int arows, int acols, Scalar val, Allocator* allocator)
: GpuMat(arows, acols, DataType<T>::type, val, allocator) : GpuMat(arows, acols, traits::Type<T>::value, val, allocator)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(Size asize, Scalar val, Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(Size asize, Scalar val, Allocator* allocator)
: GpuMat(asize.height, asize.width, DataType<T>::type, val, allocator) : GpuMat(asize.height, asize.width, traits::Type<T>::value, val, allocator)
{ {
} }
@@ -91,15 +91,15 @@ template <typename T>
__host__ GpuMat_<T>::GpuMat_(const GpuMat& m, Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(const GpuMat& m, Allocator* allocator)
: GpuMat(allocator) : GpuMat(allocator)
{ {
flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type; flags = (flags & ~CV_MAT_TYPE_MASK) | traits::Type<T>::value;
if (DataType<T>::type == m.type()) if (traits::Type<T>::value == m.type())
{ {
GpuMat::operator =(m); GpuMat::operator =(m);
return; return;
} }
if (DataType<T>::depth == m.depth()) if (traits::Depth<T>::value == m.depth())
{ {
GpuMat::operator =(m.reshape(DataType<T>::channels, m.rows)); GpuMat::operator =(m.reshape(DataType<T>::channels, m.rows));
return; return;
@@ -111,13 +111,13 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat& m, Allocator* allocator)
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(int arows, int acols, T* adata, size_t astep) __host__ GpuMat_<T>::GpuMat_(int arows, int acols, T* adata, size_t astep)
: GpuMat(arows, acols, DataType<T>::type, adata, astep) : GpuMat(arows, acols, traits::Type<T>::value, adata, astep)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(Size asize, T* adata, size_t astep) __host__ GpuMat_<T>::GpuMat_(Size asize, T* adata, size_t astep)
: GpuMat(asize.height, asize.width, DataType<T>::type, adata, astep) : GpuMat(asize.height, asize.width, traits::Type<T>::value, adata, astep)
{ {
} }
@@ -137,7 +137,7 @@ template <typename T>
__host__ GpuMat_<T>::GpuMat_(InputArray arr, Allocator* allocator) __host__ GpuMat_<T>::GpuMat_(InputArray arr, Allocator* allocator)
: GpuMat(allocator) : GpuMat(allocator)
{ {
flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type; flags = (flags & ~CV_MAT_TYPE_MASK) | traits::Type<T>::value;
upload(arr); upload(arr);
} }
@@ -151,13 +151,13 @@ __host__ GpuMat_<T>& GpuMat_<T>::operator =(const GpuMat_& m)
template <typename T> template <typename T>
__host__ void GpuMat_<T>::create(int arows, int acols) __host__ void GpuMat_<T>::create(int arows, int acols)
{ {
GpuMat::create(arows, acols, DataType<T>::type); GpuMat::create(arows, acols, traits::Type<T>::value);
} }
template <typename T> template <typename T>
__host__ void GpuMat_<T>::create(Size asize) __host__ void GpuMat_<T>::create(Size asize)
{ {
GpuMat::create(asize, DataType<T>::type); GpuMat::create(asize, traits::Type<T>::value);
} }
template <typename T> template <typename T>
@@ -169,14 +169,14 @@ __host__ void GpuMat_<T>::swap(GpuMat_& mat)
template <typename T> template <typename T>
__host__ void GpuMat_<T>::upload(InputArray arr) __host__ void GpuMat_<T>::upload(InputArray arr)
{ {
CV_Assert( arr.type() == DataType<T>::type ); CV_Assert( arr.type() == traits::Type<T>::value );
GpuMat::upload(arr); GpuMat::upload(arr);
} }
template <typename T> template <typename T>
__host__ void GpuMat_<T>::upload(InputArray arr, Stream& stream) __host__ void GpuMat_<T>::upload(InputArray arr, Stream& stream)
{ {
CV_Assert( arr.type() == DataType<T>::type ); CV_Assert( arr.type() == traits::Type<T>::value );
GpuMat::upload(arr, stream); GpuMat::upload(arr, stream);
} }
@@ -269,15 +269,15 @@ __host__ size_t GpuMat_<T>::elemSize1() const
template <typename T> template <typename T>
__host__ int GpuMat_<T>::type() const __host__ int GpuMat_<T>::type() const
{ {
CV_DbgAssert( GpuMat::type() == DataType<T>::type ); CV_DbgAssert( GpuMat::type() == traits::Type<T>::value );
return DataType<T>::type; return traits::Type<T>::value;
} }
template <typename T> template <typename T>
__host__ int GpuMat_<T>::depth() const __host__ int GpuMat_<T>::depth() const
{ {
CV_DbgAssert( GpuMat::depth() == DataType<T>::depth ); CV_DbgAssert( GpuMat::depth() == traits::Depth<T>::value );
return DataType<T>::depth; return traits::Depth<T>::value;
} }
template <typename T> template <typename T>
@@ -341,7 +341,7 @@ namespace cv {
template<typename _Tp> template<typename _Tp>
__host__ _InputArray::_InputArray(const cudev::GpuMat_<_Tp>& m) __host__ _InputArray::_InputArray(const cudev::GpuMat_<_Tp>& m)
: flags(FIXED_TYPE + CUDA_GPU_MAT + DataType<_Tp>::type), obj((void*)&m) : flags(FIXED_TYPE + CUDA_GPU_MAT + traits::Type<_Tp>::value), obj((void*)&m)
{} {}
template<typename _Tp> template<typename _Tp>