Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/3rdparty/openvx/hal/openvx_hal.hpp
16337 views
1
#ifndef OPENCV_OPENVX_HAL_HPP_INCLUDED
2
#define OPENCV_OPENVX_HAL_HPP_INCLUDED
3
4
#include "opencv2/core/hal/interface.h"
5
6
#include "VX/vx.h"
7
8
template <typename T>
9
int ovx_hal_add(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);
10
template <typename T>
11
int ovx_hal_sub(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);
12
13
template <typename T>
14
int ovx_hal_absdiff(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);
15
16
template <typename T>
17
int ovx_hal_and(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);
18
template <typename T>
19
int ovx_hal_or(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);
20
template <typename T>
21
int ovx_hal_xor(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);
22
int ovx_hal_not(const uchar *a, size_t astep, uchar *c, size_t cstep, int w, int h);
23
24
template <typename T>
25
int ovx_hal_mul(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h, double scale);
26
27
int ovx_hal_merge8u(const uchar **src_data, uchar *dst_data, int len, int cn);
28
int ovx_hal_resize(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, double inv_scale_x, double inv_scale_y, int interpolation);
29
int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[6], int interpolation, int borderType, const double borderValue[4]);
30
int ovx_hal_warpPerspective(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4]);
31
32
struct cvhalFilter2D;
33
int ovx_hal_filterInit(cvhalFilter2D **filter_context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,
34
int, int, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace);
35
int ovx_hal_filterFree(cvhalFilter2D *filter_context);
36
int ovx_hal_filter(cvhalFilter2D *filter_context, uchar *a, size_t astep, uchar *b, size_t bstep, int w, int h, int, int, int, int);
37
int ovx_hal_sepFilterInit(cvhalFilter2D **filter_context, int src_type, int dst_type,
38
int kernel_type, uchar *kernelx_data, int kernelx_length, uchar *kernely_data, int kernely_length,
39
int anchor_x, int anchor_y, double delta, int borderType);
40
41
#if VX_VERSION > VX_VERSION_1_0
42
int ovx_hal_morphInit(cvhalFilter2D **filter_context, int operation, int src_type, int dst_type, int , int ,
43
int kernel_type, uchar *kernel_data, size_t kernel_step, int kernel_width, int kernel_height, int anchor_x, int anchor_y,
44
int borderType, const double borderValue[4], int iterations, bool allowSubmatrix, bool allowInplace);
45
int ovx_hal_morphFree(cvhalFilter2D *filter_context);
46
int ovx_hal_morph(cvhalFilter2D *filter_context, uchar *a, size_t astep, uchar *b, size_t bstep, int w, int h, int , int , int , int , int , int , int , int );
47
#endif // 1.0 guard
48
49
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);
50
int ovx_hal_cvtGraytoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int depth, int bcn);
51
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);
52
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);
53
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);
54
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);
55
int ovx_hal_integral(int depth, int sdepth, int, const uchar * a, size_t astep, uchar * b, size_t bstep, uchar * c, size_t, uchar * d, size_t, int w, int h, int cn);
56
57
//==================================================================================================
58
// functions redefinition
59
// ...
60
61
#undef cv_hal_add8u
62
#define cv_hal_add8u ovx_hal_add<uchar>
63
#undef cv_hal_add16s
64
#define cv_hal_add16s ovx_hal_add<short>
65
#undef cv_hal_sub8u
66
#define cv_hal_sub8u ovx_hal_sub<uchar>
67
#undef cv_hal_sub16s
68
#define cv_hal_sub16s ovx_hal_sub<short>
69
70
#undef cv_hal_absdiff8u
71
#define cv_hal_absdiff8u ovx_hal_absdiff<uchar>
72
#undef cv_hal_absdiff16s
73
#define cv_hal_absdiff16s ovx_hal_absdiff<short>
74
75
#undef cv_hal_and8u
76
#define cv_hal_and8u ovx_hal_and<uchar>
77
#undef cv_hal_or8u
78
#define cv_hal_or8u ovx_hal_or<uchar>
79
#undef cv_hal_xor8u
80
#define cv_hal_xor8u ovx_hal_xor<uchar>
81
#undef cv_hal_not8u
82
#define cv_hal_not8u ovx_hal_not
83
84
#undef cv_hal_mul8u
85
#define cv_hal_mul8u ovx_hal_mul<uchar>
86
#undef cv_hal_mul16s
87
#define cv_hal_mul16s ovx_hal_mul<short>
88
89
#undef cv_hal_merge8u
90
#define cv_hal_merge8u ovx_hal_merge8u
91
92
//#undef cv_hal_resize
93
//#define cv_hal_resize ovx_hal_resize
94
95
//OpenVX warps use round to zero policy at least in sample implementation
96
//while OpenCV require round to nearest
97
//#undef cv_hal_warpAffine
98
//#define cv_hal_warpAffine ovx_hal_warpAffine
99
//#undef cv_hal_warpPerspective
100
//#define cv_hal_warpPerspective ovx_hal_warpPerspective
101
102
#undef cv_hal_filterInit
103
#define cv_hal_filterInit ovx_hal_filterInit
104
#undef cv_hal_filter
105
#define cv_hal_filter ovx_hal_filter
106
#undef cv_hal_filterFree
107
#define cv_hal_filterFree ovx_hal_filterFree
108
109
//#undef cv_hal_sepFilterInit
110
//#define cv_hal_sepFilterInit ovx_hal_sepFilterInit
111
//#undef cv_hal_sepFilter
112
//#define cv_hal_sepFilter ovx_hal_filter
113
//#undef cv_hal_sepFilterFree
114
//#define cv_hal_sepFilterFree ovx_hal_filterFree
115
116
#if VX_VERSION > VX_VERSION_1_0
117
118
#undef cv_hal_morphInit
119
#define cv_hal_morphInit ovx_hal_morphInit
120
#undef cv_hal_morph
121
#define cv_hal_morph ovx_hal_morph
122
#undef cv_hal_morphFree
123
#define cv_hal_morphFree ovx_hal_morphFree
124
125
#endif // 1.0 guard
126
127
#undef cv_hal_cvtBGRtoBGR
128
#define cv_hal_cvtBGRtoBGR ovx_hal_cvtBGRtoBGR
129
#undef cv_hal_cvtGraytoBGR
130
#define cv_hal_cvtGraytoBGR ovx_hal_cvtGraytoBGR
131
#undef cv_hal_cvtTwoPlaneYUVtoBGR
132
#define cv_hal_cvtTwoPlaneYUVtoBGR ovx_hal_cvtTwoPlaneYUVtoBGR
133
#undef cv_hal_cvtThreePlaneYUVtoBGR
134
#define cv_hal_cvtThreePlaneYUVtoBGR ovx_hal_cvtThreePlaneYUVtoBGR
135
#undef cv_hal_cvtBGRtoThreePlaneYUV
136
#define cv_hal_cvtBGRtoThreePlaneYUV ovx_hal_cvtBGRtoThreePlaneYUV
137
#undef cv_hal_cvtOnePlaneYUVtoBGR
138
#define cv_hal_cvtOnePlaneYUVtoBGR ovx_hal_cvtOnePlaneYUVtoBGR
139
#undef cv_hal_integral
140
#define cv_hal_integral ovx_hal_integral
141
142
#endif
143
144