1
0
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:
Addison Elliott
2016-12-14 12:56:43 -06:00
parent 37cbcf024c
commit fa6692afcf
4 changed files with 77 additions and 0 deletions
+5
View File
@@ -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);