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
13aa23f7
Commit
13aa23f7
authored
Oct 15, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12836 from dmatveev:gapi_upd151018
parents
78b51fb5
f0ddc2a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
mat.hpp
modules/gapi/include/opencv2/gapi/own/mat.hpp
+7
-5
No files found.
modules/gapi/include/opencv2/gapi/own/mat.hpp
View file @
13aa23f7
...
...
@@ -119,8 +119,9 @@ namespace cv { namespace gapi { namespace own {
*/
Mat
&
operator
=
(
const
Scalar
&
s
)
{
static
constexpr
unsigned
max_channels
=
4
;
//Scalar can't fit more than 4
GAPI_Assert
(
static_cast
<
unsigned
int
>
(
channels
())
<=
max_channels
);
constexpr
unsigned
max_channels
=
4
;
//Scalar can't fit more than 4
const
auto
channels
=
static_cast
<
unsigned
int
>
(
this
->
channels
());
GAPI_Assert
(
channels
<=
max_channels
);
using
func_p_t
=
void
(
*
)(
void
*
,
int
,
Scalar
const
&
);
using
detail
::
assign_row
;
...
...
@@ -141,11 +142,12 @@ namespace cv { namespace gapi { namespace own {
"OCV type ids used as indexes to array, thus exact numbers are important!"
);
GAPI_Assert
(
static_cast
<
unsigned
int
>
(
depth
())
<
sizeof
(
func_tbl
)
/
sizeof
(
func_tbl
[
0
]));
const
auto
depth
=
static_cast
<
unsigned
int
>
(
this
->
depth
());
GAPI_Assert
(
depth
<
sizeof
(
func_tbl
)
/
sizeof
(
func_tbl
[
0
]));
for
(
int
r
=
0
;
r
<
rows
;
++
r
)
{
auto
*
f
=
func_tbl
[
depth
()][
channels
()
-
1
];
auto
*
f
=
func_tbl
[
depth
][
channels
-
1
];
(
*
f
)(
static_cast
<
void
*>
(
ptr
(
r
)),
cols
,
s
);
}
return
*
this
;
...
...
@@ -228,7 +230,7 @@ namespace cv { namespace gapi { namespace own {
dst
.
create
(
rows
,
cols
,
type
());
for
(
int
r
=
0
;
r
<
rows
;
++
r
)
{
std
::
memcpy
(
dst
.
ptr
(
r
),
ptr
(
r
),
detail
::
default_step
(
type
(),
cols
));
std
::
copy_n
(
ptr
(
r
),
detail
::
default_step
(
type
(),
cols
),
dst
.
ptr
(
r
));
}
}
...
...
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