mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
Merge pull request #7858 from addisonElliott:master
This commit is contained in:
commit
c038d1be60
@ -794,6 +794,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
Mat(int ndims, const int* sizes, int type);
|
Mat(int ndims, const int* sizes, int type);
|
||||||
|
|
||||||
|
/** @overload
|
||||||
|
@param sizes Array of integers specifying an n-dimensional array shape.
|
||||||
|
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
|
||||||
|
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
|
||||||
|
*/
|
||||||
|
Mat(const std::vector<int>& sizes, int type);
|
||||||
|
|
||||||
/** @overload
|
/** @overload
|
||||||
@param ndims Array dimensionality.
|
@param ndims Array dimensionality.
|
||||||
@param sizes Array of integers specifying an n-dimensional array shape.
|
@param sizes Array of integers specifying an n-dimensional array shape.
|
||||||
@ -805,6 +812,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
Mat(int ndims, const int* sizes, int type, const Scalar& s);
|
Mat(int ndims, const int* sizes, int type, const Scalar& s);
|
||||||
|
|
||||||
|
/** @overload
|
||||||
|
@param sizes Array of integers specifying an n-dimensional array shape.
|
||||||
|
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
|
||||||
|
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
|
||||||
|
@param s An optional value to initialize each matrix element with. To set all the matrix elements to
|
||||||
|
the particular value after the construction, use the assignment operator
|
||||||
|
Mat::operator=(const Scalar& value) .
|
||||||
|
*/
|
||||||
|
Mat(const std::vector<int>& sizes, int type, const Scalar& s);
|
||||||
|
|
||||||
|
|
||||||
/** @overload
|
/** @overload
|
||||||
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
|
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
|
||||||
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
|
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
|
||||||
@ -861,6 +879,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0);
|
Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0);
|
||||||
|
|
||||||
|
/** @overload
|
||||||
|
@param sizes Array of integers specifying an n-dimensional array shape.
|
||||||
|
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
|
||||||
|
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
|
||||||
|
@param data Pointer to the user data. Matrix constructors that take data and step parameters do not
|
||||||
|
allocate matrix data. Instead, they just initialize the matrix header that points to the specified
|
||||||
|
data, which means that no data is copied. This operation is very efficient and can be used to
|
||||||
|
process external data using OpenCV functions. The external data is not automatically deallocated, so
|
||||||
|
you should take care of it.
|
||||||
|
@param steps Array of ndims-1 steps in case of a multi-dimensional array (the last step is always
|
||||||
|
set to the element size). If not specified, the matrix is assumed to be continuous.
|
||||||
|
*/
|
||||||
|
Mat(const std::vector<int>& sizes, int type, void* data, const size_t* steps=0);
|
||||||
|
|
||||||
/** @overload
|
/** @overload
|
||||||
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
|
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
|
||||||
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
|
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
|
||||||
@ -1328,6 +1360,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
void create(int ndims, const int* sizes, int type);
|
void create(int ndims, const int* sizes, int type);
|
||||||
|
|
||||||
|
/** @overload
|
||||||
|
@param sizes Array of integers specifying a new array shape.
|
||||||
|
@param type New matrix type.
|
||||||
|
*/
|
||||||
|
void create(const std::vector<int>& sizes, int type);
|
||||||
|
|
||||||
/** @brief Increments the reference counter.
|
/** @brief Increments the reference counter.
|
||||||
|
|
||||||
The method increments the reference counter associated with the matrix data. If the matrix header
|
The method increments the reference counter associated with the matrix data. If the matrix header
|
||||||
@ -2273,6 +2311,7 @@ public:
|
|||||||
void create(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
void create(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||||
void create(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
void create(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||||
void create(int ndims, const int* sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
void create(int ndims, const int* sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||||
|
void create(const std::vector<int>& sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||||
|
|
||||||
//! increases the reference counter; use with care to avoid memleaks
|
//! increases the reference counter; use with care to avoid memleaks
|
||||||
void addref();
|
void addref();
|
||||||
|
@ -386,6 +386,23 @@ Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s)
|
|||||||
*this = _s;
|
*this = _s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
Mat::Mat(const std::vector<int>& _sz, int _type)
|
||||||
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||||
|
datalimit(0), allocator(0), u(0), size(&rows)
|
||||||
|
{
|
||||||
|
create(_sz, _type);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
Mat::Mat(const std::vector<int>& _sz, int _type, const Scalar& _s)
|
||||||
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||||
|
datalimit(0), allocator(0), u(0), size(&rows)
|
||||||
|
{
|
||||||
|
create(_sz, _type);
|
||||||
|
*this = _s;
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
Mat::Mat(const Mat& m)
|
Mat::Mat(const Mat& m)
|
||||||
: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
|
: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
|
||||||
|
@ -439,6 +439,11 @@ void Mat::create(int d, const int* _sizes, int _type)
|
|||||||
finalizeHdr(*this);
|
finalizeHdr(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mat::create(const std::vector<int>& _sizes, int _type)
|
||||||
|
{
|
||||||
|
create((int)_sizes.size(), _sizes.data(), _type);
|
||||||
|
}
|
||||||
|
|
||||||
void Mat::copySize(const Mat& m)
|
void Mat::copySize(const Mat& m)
|
||||||
{
|
{
|
||||||
setSize(*this, m.dims, 0, 0);
|
setSize(*this, m.dims, 0, 0);
|
||||||
@ -541,6 +546,17 @@ Mat::Mat(int _dims, const int* _sizes, int _type, void* _data, const size_t* _st
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Mat::Mat(const std::vector<int>& _sizes, int _type, void* _data, const size_t* _steps)
|
||||||
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||||
|
datalimit(0), allocator(0), u(0), size(&rows)
|
||||||
|
{
|
||||||
|
flags |= CV_MAT_TYPE(_type);
|
||||||
|
datastart = data = (uchar*)_data;
|
||||||
|
setSize(*this, (int)_sizes.size(), _sizes.data(), _steps, true);
|
||||||
|
finalizeHdr(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Mat::Mat(const Mat& m, const Range* ranges)
|
Mat::Mat(const Mat& m, const Range* ranges)
|
||||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||||
datalimit(0), allocator(0), u(0), size(&rows)
|
datalimit(0), allocator(0), u(0), size(&rows)
|
||||||
|
@ -386,6 +386,11 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
|
|||||||
addref();
|
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)
|
void UMat::copySize(const UMat& m)
|
||||||
{
|
{
|
||||||
setSize(*this, m.dims, 0, 0);
|
setSize(*this, m.dims, 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user