mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
Added new overloaded functions for Mat and UMat that accepts std::vector<int> instead of int * for the sizes on a N-dimensional array.
This allows for an N-dimensional array to be setup in one line instead of two when using C++11 initializer lists. cv::Mat(3, {zDim, yDim, xDim}, ...) can be used instead of having to create an int pointer to hold the size array.
This commit is contained in:
@@ -386,6 +386,11 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
|
||||
addref();
|
||||
}
|
||||
|
||||
void UMat::create(const std::vector<int>& _sizes, int _type, UMatUsageFlags _usageFlags)
|
||||
{
|
||||
create((int)_sizes.size(), _sizes.data(), _type, _usageFlags);
|
||||
}
|
||||
|
||||
void UMat::copySize(const UMat& m)
|
||||
{
|
||||
setSize(*this, m.dims, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user