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
311a232a
Commit
311a232a
authored
Sep 08, 2016
by
Vitaly Tuzov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added color conversion HAL API functions implemented as immediate mode OpenVX calls.
parent
14fd22e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
0 deletions
+111
-0
openvx_hal.hpp
3rdparty/openvx/include/openvx_hal.hpp
+111
-0
No files found.
3rdparty/openvx/include/openvx_hal.hpp
View file @
311a232a
...
...
@@ -886,6 +886,106 @@ inline int ovx_hal_morph(cvhalFilter2D *filter_context, uchar *a, size_t astep,
return
CV_HAL_ERROR_OK
;
}
inline
int
ovx_hal_cvtBGRtoBGR
(
const
uchar
*
a
,
size_t
astep
,
uchar
*
b
,
size_t
bstep
,
int
w
,
int
h
,
int
depth
,
int
acn
,
int
bcn
,
bool
swapBlue
)
{
if
(
depth
!=
CV_8U
||
swapBlue
||
acn
==
bcn
||
(
acn
!=
3
&&
acn
!=
4
)
||
(
bcn
!=
3
&&
bcn
!=
4
))
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
try
{
vxContext
*
ctx
=
vxContext
::
getContext
();
vxImage
ia
(
*
ctx
,
acn
==
3
?
VX_DF_IMAGE_RGB
:
VX_DF_IMAGE_RGBX
,
a
,
astep
,
w
,
h
);
vxImage
ib
(
*
ctx
,
bcn
==
3
?
VX_DF_IMAGE_RGB
:
VX_DF_IMAGE_RGBX
,
b
,
bstep
,
w
,
h
);
vxErr
::
check
(
vxuColorConvert
(
ctx
->
ctx
,
ia
.
img
,
ib
.
img
));
}
catch
(
vxErr
&
e
)
{
e
.
print
();
return
CV_HAL_ERROR_UNKNOWN
;
}
return
CV_HAL_ERROR_OK
;
}
inline
int
ovx_hal_cvtTwoPlaneYUVtoBGR
(
const
uchar
*
a
,
size_t
astep
,
uchar
*
b
,
size_t
bstep
,
int
w
,
int
h
,
int
bcn
,
bool
swapBlue
,
int
uIdx
)
{
if
(
!
swapBlue
||
(
bcn
!=
3
&&
bcn
!=
4
))
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
try
{
vxContext
*
ctx
=
vxContext
::
getContext
();
vxImage
ia
(
*
ctx
,
uIdx
?
VX_DF_IMAGE_NV21
:
VX_DF_IMAGE_NV12
,
a
,
astep
,
w
,
h
);
vxImage
ib
(
*
ctx
,
bcn
==
3
?
VX_DF_IMAGE_RGB
:
VX_DF_IMAGE_RGBX
,
b
,
bstep
,
w
,
h
);
vxErr
::
check
(
vxuColorConvert
(
ctx
->
ctx
,
ia
.
img
,
ib
.
img
));
}
catch
(
vxErr
&
e
)
{
e
.
print
();
return
CV_HAL_ERROR_UNKNOWN
;
}
return
CV_HAL_ERROR_OK
;
}
inline
int
ovx_hal_cvtThreePlaneYUVtoBGR
(
const
uchar
*
a
,
size_t
astep
,
uchar
*
b
,
size_t
bstep
,
int
w
,
int
h
,
int
bcn
,
bool
swapBlue
,
int
uIdx
)
{
if
(
!
swapBlue
||
(
bcn
!=
3
&&
bcn
!=
4
)
||
uIdx
)
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
try
{
vxContext
*
ctx
=
vxContext
::
getContext
();
vxImage
ia
(
*
ctx
,
VX_DF_IMAGE_IYUV
,
a
,
astep
,
w
,
h
);
vxImage
ib
(
*
ctx
,
bcn
==
3
?
VX_DF_IMAGE_RGB
:
VX_DF_IMAGE_RGBX
,
b
,
bstep
,
w
,
h
);
vxErr
::
check
(
vxuColorConvert
(
ctx
->
ctx
,
ia
.
img
,
ib
.
img
));
}
catch
(
vxErr
&
e
)
{
e
.
print
();
return
CV_HAL_ERROR_UNKNOWN
;
}
return
CV_HAL_ERROR_OK
;
}
inline
int
ovx_hal_cvtBGRtoThreePlaneYUV
(
const
uchar
*
a
,
size_t
astep
,
uchar
*
b
,
size_t
bstep
,
int
w
,
int
h
,
int
acn
,
bool
swapBlue
,
int
uIdx
)
{
if
(
!
swapBlue
||
(
acn
!=
3
&&
acn
!=
4
)
||
uIdx
)
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
try
{
vxContext
*
ctx
=
vxContext
::
getContext
();
vxImage
ia
(
*
ctx
,
acn
==
3
?
VX_DF_IMAGE_RGB
:
VX_DF_IMAGE_RGBX
,
a
,
astep
,
w
,
h
);
vxImage
ib
(
*
ctx
,
VX_DF_IMAGE_IYUV
,
b
,
bstep
,
w
,
h
);
vxErr
::
check
(
vxuColorConvert
(
ctx
->
ctx
,
ia
.
img
,
ib
.
img
));
}
catch
(
vxErr
&
e
)
{
e
.
print
();
return
CV_HAL_ERROR_UNKNOWN
;
}
return
CV_HAL_ERROR_OK
;
}
inline
int
ovx_hal_cvtOnePlaneYUVtoBGR
(
const
uchar
*
a
,
size_t
astep
,
uchar
*
b
,
size_t
bstep
,
int
w
,
int
h
,
int
bcn
,
bool
swapBlue
,
int
uIdx
,
int
ycn
)
{
if
(
!
swapBlue
||
(
bcn
!=
3
&&
bcn
!=
4
)
||
uIdx
)
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
try
{
vxContext
*
ctx
=
vxContext
::
getContext
();
vxImage
ia
(
*
ctx
,
ycn
?
VX_DF_IMAGE_UYVY
:
VX_DF_IMAGE_YUYV
,
a
,
astep
,
w
,
h
);
vxImage
ib
(
*
ctx
,
bcn
==
3
?
VX_DF_IMAGE_RGB
:
VX_DF_IMAGE_RGBX
,
b
,
bstep
,
w
,
h
);
vxErr
::
check
(
vxuColorConvert
(
ctx
->
ctx
,
ia
.
img
,
ib
.
img
));
}
catch
(
vxErr
&
e
)
{
e
.
print
();
return
CV_HAL_ERROR_UNKNOWN
;
}
return
CV_HAL_ERROR_OK
;
}
#endif
//==================================================================================================
...
...
@@ -953,6 +1053,17 @@ inline int ovx_hal_morph(cvhalFilter2D *filter_context, uchar *a, size_t astep,
#undef cv_hal_morphFree
#define cv_hal_morphFree ovx_hal_morphFree
#undef cv_hal_cvtBGRtoBGR
#define cv_hal_cvtBGRtoBGR ovx_hal_cvtBGRtoBGR
#undef cv_hal_cvtTwoPlaneYUVtoBGR
#define cv_hal_cvtTwoPlaneYUVtoBGR ovx_hal_cvtTwoPlaneYUVtoBGR
#undef cv_hal_cvtThreePlaneYUVtoBGR
#define cv_hal_cvtThreePlaneYUVtoBGR ovx_hal_cvtThreePlaneYUVtoBGR
#undef cv_hal_cvtBGRtoThreePlaneYUV
#define cv_hal_cvtBGRtoThreePlaneYUV ovx_hal_cvtBGRtoThreePlaneYUV
#undef cv_hal_cvtOnePlaneYUVtoBGR
#define cv_hal_cvtOnePlaneYUVtoBGR ovx_hal_cvtOnePlaneYUVtoBGR
#endif
#endif
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