|
|
@ -3070,50 +3070,50 @@ const Mat_<_Tp>& operator /= (const Mat_<_Tp>& a, const MatExpr& b) |
|
|
|
//////////////////////////////// UMat ////////////////////////////////
|
|
|
|
//////////////////////////////// UMat ////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat() |
|
|
|
UMat::UMat(UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{} |
|
|
|
{} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(int _rows, int _cols, int _type) |
|
|
|
UMat::UMat(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create(_rows, _cols, _type); |
|
|
|
create(_rows, _cols, _type); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(int _rows, int _cols, int _type, const Scalar& _s) |
|
|
|
UMat::UMat(int _rows, int _cols, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create(_rows, _cols, _type); |
|
|
|
create(_rows, _cols, _type); |
|
|
|
*this = _s; |
|
|
|
*this = _s; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(Size _sz, int _type) |
|
|
|
UMat::UMat(Size _sz, int _type, UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create( _sz.height, _sz.width, _type ); |
|
|
|
create( _sz.height, _sz.width, _type ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(Size _sz, int _type, const Scalar& _s) |
|
|
|
UMat::UMat(Size _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create(_sz.height, _sz.width, _type); |
|
|
|
create(_sz.height, _sz.width, _type); |
|
|
|
*this = _s; |
|
|
|
*this = _s; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(int _dims, const int* _sz, int _type) |
|
|
|
UMat::UMat(int _dims, const int* _sz, int _type, UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create(_dims, _sz, _type); |
|
|
|
create(_dims, _sz, _type); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(int _dims, const int* _sz, int _type, const Scalar& _s) |
|
|
|
UMat::UMat(int _dims, const int* _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), u(0), offset(0), size(&rows) |
|
|
|
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create(_dims, _sz, _type); |
|
|
|
create(_dims, _sz, _type); |
|
|
|
*this = _s; |
|
|
|
*this = _s; |
|
|
@ -3122,7 +3122,7 @@ UMat::UMat(int _dims, const int* _sz, int _type, const Scalar& _s) |
|
|
|
inline |
|
|
|
inline |
|
|
|
UMat::UMat(const UMat& m) |
|
|
|
UMat::UMat(const UMat& m) |
|
|
|
: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), allocator(m.allocator), |
|
|
|
: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), allocator(m.allocator), |
|
|
|
u(m.u), offset(m.offset), size(&rows) |
|
|
|
usageFlags(m.usageFlags), u(m.u), offset(m.offset), size(&rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
addref(); |
|
|
|
addref(); |
|
|
|
if( m.dims <= 2 ) |
|
|
|
if( m.dims <= 2 ) |
|
|
@ -3173,6 +3173,8 @@ UMat& UMat::operator = (const UMat& m) |
|
|
|
else |
|
|
|
else |
|
|
|
copySize(m); |
|
|
|
copySize(m); |
|
|
|
allocator = m.allocator; |
|
|
|
allocator = m.allocator; |
|
|
|
|
|
|
|
if (usageFlags == USAGE_DEFAULT) |
|
|
|
|
|
|
|
usageFlags = m.usageFlags; |
|
|
|
u = m.u; |
|
|
|
u = m.u; |
|
|
|
offset = m.offset; |
|
|
|
offset = m.offset; |
|
|
|
} |
|
|
|
} |
|
|
@ -3233,19 +3235,19 @@ void UMat::assignTo( UMat& m, int _type ) const |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
void UMat::create(int _rows, int _cols, int _type) |
|
|
|
void UMat::create(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_type &= TYPE_MASK; |
|
|
|
_type &= TYPE_MASK; |
|
|
|
if( dims <= 2 && rows == _rows && cols == _cols && type() == _type && u ) |
|
|
|
if( dims <= 2 && rows == _rows && cols == _cols && type() == _type && u ) |
|
|
|
return; |
|
|
|
return; |
|
|
|
int sz[] = {_rows, _cols}; |
|
|
|
int sz[] = {_rows, _cols}; |
|
|
|
create(2, sz, _type); |
|
|
|
create(2, sz, _type, _usageFlags); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|
void UMat::create(Size _sz, int _type) |
|
|
|
void UMat::create(Size _sz, int _type, UMatUsageFlags _usageFlags) |
|
|
|
{ |
|
|
|
{ |
|
|
|
create(_sz.height, _sz.width, _type); |
|
|
|
create(_sz.height, _sz.width, _type, _usageFlags); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline |
|
|
|
inline |
|
|
|