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
345a57b6
Commit
345a57b6
authored
Jun 09, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed matrix comma initializer for shorter notation
parent
8710c8d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
core.hpp
modules/core/include/opencv2/core/core.hpp
+7
-3
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+14
-7
No files found.
modules/core/include/opencv2/core/core.hpp
View file @
345a57b6
...
...
@@ -1069,8 +1069,9 @@ template<typename M> class CV_EXPORTS MatOp_T_;
typedef
MatExpr_
<
MatExpr_Op4_
<
Size
,
int
,
Scalar
,
int
,
Mat
,
MatOp_Set_
<
Mat
>
>
,
Mat
>
MatExpr_Initializer
;
template
<
typename
_Tp
>
class
MatIterator_
;
template
<
typename
_Tp
>
class
MatConstIterator_
;
template
<
typename
_Tp
>
class
CV_EXPORTS
MatIterator_
;
template
<
typename
_Tp
>
class
CV_EXPORTS
MatConstIterator_
;
template
<
typename
_Tp
>
class
CV_EXPORTS
MatCommaInitializer_
;
enum
{
MAGIC_MASK
=
0xFFFF0000
,
TYPE_MASK
=
0x00000FFF
,
DEPTH_MASK
=
7
};
...
...
@@ -1327,6 +1328,8 @@ public:
template
<
typename
_Tp
>
explicit
Mat
(
const
Point_
<
_Tp
>&
pt
);
//! builds matrix from a 3D point
template
<
typename
_Tp
>
explicit
Mat
(
const
Point3_
<
_Tp
>&
pt
);
//! builds matrix from comma initializer
template
<
typename
_Tp
>
explicit
Mat
(
const
MatCommaInitializer_
<
_Tp
>&
commaInitializer
);
//! helper constructor to compile matrix expressions
Mat
(
const
MatExpr_Base
&
expr
);
//! destructor - calls release()
...
...
@@ -2116,6 +2119,7 @@ public:
template
<
int
n
>
explicit
Mat_
(
const
Vec
<
_Tp
,
n
>&
vec
);
explicit
Mat_
(
const
Point_
<
_Tp
>&
pt
);
explicit
Mat_
(
const
Point3_
<
_Tp
>&
pt
);
explicit
Mat_
(
const
MatCommaInitializer_
<
_Tp
>&
commaInitializer
);
Mat_
&
operator
=
(
const
Mat
&
m
);
Mat_
&
operator
=
(
const
Mat_
&
m
);
...
...
@@ -2349,7 +2353,7 @@ public:
//! the operator that takes the next value and put it to the matrix
template
<
typename
T2
>
MatCommaInitializer_
<
_Tp
>&
operator
,
(
T2
v
);
//! the conversion operator
operator
Mat_
<
_Tp
>
()
const
;
//
operator Mat_<_Tp>() const;
//! another form of conversion operator
Mat_
<
_Tp
>
operator
*
()
const
;
void
assignTo
(
Mat
&
m
,
int
type
=-
1
)
const
;
...
...
modules/core/include/opencv2/core/mat.hpp
View file @
345a57b6
...
...
@@ -262,7 +262,14 @@ template<typename _Tp> inline Mat::Mat(const Point3_<_Tp>& pt)
((
_Tp
*
)
data
)[
1
]
=
pt
.
y
;
((
_Tp
*
)
data
)[
2
]
=
pt
.
z
;
}
template
<
typename
_Tp
>
inline
Mat
::
Mat
(
const
MatCommaInitializer_
<
_Tp
>&
commaInitializer
)
:
flags
(
MAGIC_VAL
|
DataType
<
_Tp
>::
type
|
CV_MAT_CONT_FLAG
),
rows
(
0
),
cols
(
0
),
step
(
0
),
data
(
0
),
refcount
(
0
),
datastart
(
0
),
dataend
(
0
)
{
*
this
=
*
commaInitializer
;
}
inline
Mat
::~
Mat
()
{
...
...
@@ -637,6 +644,12 @@ template<typename _Tp> inline Mat_<_Tp>::Mat_(const Point3_<_Tp>& pt)
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>::
Mat_
(
const
MatCommaInitializer_
<
_Tp
>&
commaInitializer
)
:
Mat
(
commaInitializer
)
{
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>::
Mat_
(
const
vector
<
_Tp
>&
vec
,
bool
copyData
)
:
Mat
(
vec
,
copyData
)
{}
...
...
@@ -3707,12 +3720,6 @@ MatCommaInitializer_<_Tp>::operator , (T2 v)
return
*
this
;
}
template
<
typename
_Tp
>
inline
MatCommaInitializer_
<
_Tp
>::
operator
Mat_
<
_Tp
>
()
const
{
CV_DbgAssert
(
this
->
e
.
a1
==
this
->
e
.
a1
.
m
->
end
()
);
return
*
this
->
e
.
a1
.
m
;
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>
MatCommaInitializer_
<
_Tp
>::
operator
*
()
const
{
CV_DbgAssert
(
this
->
e
.
a1
==
this
->
e
.
a1
.
m
->
end
()
);
...
...
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