mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge pull request #20295 from diablodale:umat_factory_usageflags
This commit is contained in:
@@ -229,14 +229,14 @@ void cv::setIdentity( InputOutputArray _m, const Scalar& s )
|
||||
|
||||
namespace cv {
|
||||
|
||||
UMat UMat::eye(int rows, int cols, int type)
|
||||
UMat UMat::eye(int rows, int cols, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat::eye(Size(cols, rows), type);
|
||||
return UMat::eye(Size(cols, rows), type, usageFlags);
|
||||
}
|
||||
|
||||
UMat UMat::eye(Size size, int type)
|
||||
UMat UMat::eye(Size size, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
UMat m(size, type);
|
||||
UMat m(size, type, usageFlags);
|
||||
setIdentity(m);
|
||||
return m;
|
||||
}
|
||||
|
||||
@@ -951,11 +951,11 @@ UMat UMat::reshape(int new_cn, int new_rows) const
|
||||
return hdr;
|
||||
}
|
||||
|
||||
UMat UMat::diag(const UMat& d)
|
||||
UMat UMat::diag(const UMat& d, UMatUsageFlags usageFlags)
|
||||
{
|
||||
CV_Assert( d.cols == 1 || d.rows == 1 );
|
||||
int len = d.rows + d.cols - 1;
|
||||
UMat m(len, len, d.type(), Scalar(0));
|
||||
UMat m(len, len, d.type(), Scalar(0), usageFlags);
|
||||
UMat md = m.diag();
|
||||
if( d.cols == 1 )
|
||||
d.copyTo(md);
|
||||
@@ -1323,34 +1323,34 @@ UMat UMat::t() const
|
||||
return m;
|
||||
}
|
||||
|
||||
UMat UMat::zeros(int rows, int cols, int type)
|
||||
UMat UMat::zeros(int rows, int cols, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat(rows, cols, type, Scalar::all(0));
|
||||
return UMat(rows, cols, type, Scalar::all(0), usageFlags);
|
||||
}
|
||||
|
||||
UMat UMat::zeros(Size size, int type)
|
||||
UMat UMat::zeros(Size size, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat(size, type, Scalar::all(0));
|
||||
return UMat(size, type, Scalar::all(0), usageFlags);
|
||||
}
|
||||
|
||||
UMat UMat::zeros(int ndims, const int* sz, int type)
|
||||
UMat UMat::zeros(int ndims, const int* sz, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat(ndims, sz, type, Scalar::all(0));
|
||||
return UMat(ndims, sz, type, Scalar::all(0), usageFlags);
|
||||
}
|
||||
|
||||
UMat UMat::ones(int rows, int cols, int type)
|
||||
UMat UMat::ones(int rows, int cols, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat::ones(Size(cols, rows), type);
|
||||
return UMat(rows, cols, type, Scalar(1), usageFlags);
|
||||
}
|
||||
|
||||
UMat UMat::ones(Size size, int type)
|
||||
UMat UMat::ones(Size size, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat(size, type, Scalar(1));
|
||||
return UMat(size, type, Scalar(1), usageFlags);
|
||||
}
|
||||
|
||||
UMat UMat::ones(int ndims, const int* sz, int type)
|
||||
UMat UMat::ones(int ndims, const int* sz, int type, UMatUsageFlags usageFlags)
|
||||
{
|
||||
return UMat(ndims, sz, type, Scalar(1));
|
||||
return UMat(ndims, sz, type, Scalar(1), usageFlags);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user