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
f7ec4a5c
Commit
f7ec4a5c
authored
Apr 13, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mat::copyTo with mask
parent
8d24a83c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
copy.cpp
modules/core/src/copy.cpp
+33
-5
No files found.
modules/core/src/copy.cpp
View file @
f7ec4a5c
...
...
@@ -81,6 +81,11 @@ copyMask_(const uchar* _src, size_t sstep, const uchar* mask, size_t mstep, ucha
template
<>
void
copyMask_
<
uchar
>
(
const
uchar
*
_src
,
size_t
sstep
,
const
uchar
*
mask
,
size_t
mstep
,
uchar
*
_dst
,
size_t
dstep
,
Size
size
)
{
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
if
(
ippiCopy_8u_C1MR
(
_src
,
(
int
)
sstep
,
_dst
,
(
int
)
dstep
,
ippiSize
(
size
),
mask
,
(
int
)
mstep
)
>=
0
)
return
;
#endif
for
(
;
size
.
height
--
;
mask
+=
mstep
,
_src
+=
sstep
,
_dst
+=
dstep
)
{
const
uchar
*
src
=
(
const
uchar
*
)
_src
;
...
...
@@ -111,6 +116,11 @@ copyMask_<uchar>(const uchar* _src, size_t sstep, const uchar* mask, size_t mste
template
<>
void
copyMask_
<
ushort
>
(
const
uchar
*
_src
,
size_t
sstep
,
const
uchar
*
mask
,
size_t
mstep
,
uchar
*
_dst
,
size_t
dstep
,
Size
size
)
{
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
if
(
ippiCopy_16u_C1MR
((
const
Ipp16u
*
)
_src
,
(
int
)
sstep
,
(
Ipp16u
*
)
_dst
,
(
int
)
dstep
,
ippiSize
(
size
),
mask
,
(
int
)
mstep
)
>=
0
)
return
;
#endif
for
(
;
size
.
height
--
;
mask
+=
mstep
,
_src
+=
sstep
,
_dst
+=
dstep
)
{
const
ushort
*
src
=
(
const
ushort
*
)
_src
;
...
...
@@ -165,15 +175,33 @@ static void copyMask##suffix(const uchar* src, size_t sstep, const uchar* mask,
copyMask_<type>(src, sstep, mask, mstep, dst, dstep, size); \
}
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
#define DEF_COPY_MASK_F(suffix, type, ippfavor, ipptype) \
static void copyMask##suffix(const uchar* src, size_t sstep, const uchar* mask, size_t mstep, \
uchar* dst, size_t dstep, Size size, void*) \
{ \
if (ippiCopy_##ippfavor((const ipptype *)src, (int)sstep, (ipptype *)dst, (int)dstep, ippiSize(size), (const Ipp8u *)mask, (int)mstep) >= 0) \
return; \
copyMask_<type>(src, sstep, mask, mstep, dst, dstep, size); \
}
#else
#define DEF_COPY_MASK_F(suffix, type, ippfavor, ipptype) \
static void copyMask##suffix(const uchar* src, size_t sstep, const uchar* mask, size_t mstep, \
uchar* dst, size_t dstep, Size size, void*) \
{ \
copyMask_<type>(src, sstep, mask, mstep, dst, dstep, size); \
}
#endif
DEF_COPY_MASK
(
8u
,
uchar
)
DEF_COPY_MASK
(
16u
,
ushort
)
DEF_COPY_MASK
(
8u
C3
,
Vec3b
)
DEF_COPY_MASK
(
32
s
,
int
)
DEF_COPY_MASK
(
16u
C3
,
Vec3s
)
DEF_COPY_MASK
_F
(
8u
C3
,
Vec3b
,
8u
_C3MR
,
Ipp8u
)
DEF_COPY_MASK
_F
(
32
s
,
int
,
32
s_C1MR
,
Ipp32s
)
DEF_COPY_MASK
_F
(
16u
C3
,
Vec3s
,
16u
_C3MR
,
Ipp16u
)
DEF_COPY_MASK
(
32
sC2
,
Vec2i
)
DEF_COPY_MASK
(
32
sC3
,
Vec3i
)
DEF_COPY_MASK
(
32
sC4
,
Vec4i
)
DEF_COPY_MASK
_F
(
32
sC3
,
Vec3i
,
32
s_C3MR
,
Ipp32s
)
DEF_COPY_MASK
_F
(
32
sC4
,
Vec4i
,
32
s_C4MR
,
Ipp32s
)
DEF_COPY_MASK
(
32
sC6
,
Vec6i
)
DEF_COPY_MASK
(
32
sC8
,
Vec8i
)
...
...
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