Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
306aa0e6
Commit
306aa0e6
authored
Aug 15, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c++ move semantics for cv::Mat_
parent
1afc9eb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+10
-0
mat.inl.hpp
modules/core/include/opencv2/core/mat.inl.hpp
+50
-0
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
306aa0e6
...
...
@@ -2089,6 +2089,16 @@ public:
template
<
int
n
>
operator
Vec
<
typename
DataType
<
_Tp
>::
channel_type
,
n
>
()
const
;
//! conversion to Matx
template
<
int
m
,
int
n
>
operator
Matx
<
typename
DataType
<
_Tp
>::
channel_type
,
m
,
n
>
()
const
;
#ifdef CV_CXX_MOVE_SEMANTICS
Mat_
(
Mat_
&&
m
);
Mat_
&
operator
=
(
Mat_
&&
m
);
Mat_
(
Mat
&&
m
);
Mat_
&
operator
=
(
Mat
&&
m
);
Mat_
(
MatExpr
&&
e
);
#endif
};
typedef
Mat_
<
uchar
>
Mat1b
;
...
...
modules/core/include/opencv2/core/mat.inl.hpp
View file @
306aa0e6
...
...
@@ -1718,6 +1718,56 @@ void Mat_<_Tp>::forEach(const Functor& operation) const {
Mat
::
forEach
<
_Tp
,
Functor
>
(
operation
);
}
#ifdef CV_CXX_MOVE_SEMANTICS
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>::
Mat_
(
Mat_
&&
m
)
:
Mat
(
m
)
{
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>&
Mat_
<
_Tp
>::
operator
=
(
Mat_
&&
m
)
{
Mat
::
operator
=
(
m
);
return
*
this
;
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>::
Mat_
(
Mat
&&
m
)
:
Mat
()
{
flags
=
(
flags
&
~
CV_MAT_TYPE_MASK
)
|
DataType
<
_Tp
>::
type
;
*
this
=
m
;
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>&
Mat_
<
_Tp
>::
operator
=
(
Mat
&&
m
)
{
if
(
DataType
<
_Tp
>::
type
==
m
.
type
()
)
{
Mat
::
operator
=
(
m
);
return
*
this
;
}
if
(
DataType
<
_Tp
>::
depth
==
m
.
depth
()
)
{
return
(
*
this
=
m
.
reshape
(
DataType
<
_Tp
>::
channels
,
m
.
dims
,
0
));
}
CV_DbgAssert
(
DataType
<
_Tp
>::
channels
==
m
.
channels
());
m
.
convertTo
(
*
this
,
type
());
return
*
this
;
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>::
Mat_
(
MatExpr
&&
e
)
:
Mat
()
{
flags
=
(
flags
&
~
CV_MAT_TYPE_MASK
)
|
DataType
<
_Tp
>::
type
;
*
this
=
Mat
(
e
);
}
#endif
///////////////////////////// SparseMat /////////////////////////////
inline
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment