1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 //  By downloading, copying, installing or using the software you agree to this license.
6 //  If you do not agree to this license, do not download, install,
7 //  copy or use the software.
8 //
9 //
10 //                          License Agreement
11 //                For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
16 // Copyright (C) 2015, Itseez Inc., all rights reserved.
17 // Third party copyrights are property of their respective owners.
18 //
19 // Redistribution and use in source and binary forms, with or without modification,
20 // are permitted provided that the following conditions are met:
21 //
22 //   * Redistribution's of source code must retain the above copyright notice,
23 //     this list of conditions and the following disclaimer.
24 //
25 //   * Redistribution's in binary form must reproduce the above copyright notice,
26 //     this list of conditions and the following disclaimer in the documentation
27 //     and/or other materials provided with the distribution.
28 //
29 //   * The name of the copyright holders may not be used to endorse or promote products
30 //     derived from this software without specific prior written permission.
31 //
32 // This software is provided by the copyright holders and contributors "as is" and
33 // any express or implied warranties, including, but not limited to, the implied
34 // warranties of merchantability and fitness for a particular purpose are disclaimed.
35 // In no event shall the Intel Corporation or contributors be liable for any direct,
36 // indirect, incidental, special, exemplary, or consequential damages
37 // (including, but not limited to, procurement of substitute goods or services;
38 // loss of use, data, or profits; or business interruption) however caused
39 // and on any theory of liability, whether in contract, strict liability,
40 // or tort (including negligence or otherwise) arising in any way out of
41 // the use of this software, even if advised of the possibility of such damage.
42 //
43 //M*/
44 
45 #ifndef OPENCV_CORE_HAL_REPLACEMENT_HPP
46 #define OPENCV_CORE_HAL_REPLACEMENT_HPP
47 
48 #include "opencv2/core/hal/interface.h"
49 
50 #if defined __GNUC__
51 #  pragma GCC diagnostic push
52 #  pragma GCC diagnostic ignored "-Wunused-parameter"
53 #elif defined _MSC_VER
54 #  pragma warning( push )
55 #  pragma warning( disable: 4100 )
56 #endif
57 
58 //! @addtogroup core_hal_interface
59 //! @note Define your functions to override default implementations:
60 //! @code
61 //! #undef hal_add8u
62 //! #define hal_add8u my_add8u
63 //! @endcode
64 //! @{
65 
66 /**
67 Add: _dst[i] = src1[i] + src2[i]_ @n
68 Sub: _dst[i] = src1[i] - src2[i]_
69 @param src1_data,src1_step first source image data and step
70 @param src2_data,src2_step second source image data and step
71 @param dst_data,dst_step destination image data and step
72 @param width,height dimensions of the images
73 */
74 //! @addtogroup core_hal_interface_addsub Element-wise add and subtract
75 //! @{
hal_ni_add8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)76 inline int hal_ni_add8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_add8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height)77 inline int hal_ni_add8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_add16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height)78 inline int hal_ni_add16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_add16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height)79 inline int hal_ni_add16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_add32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height)80 inline int hal_ni_add32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_add32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height)81 inline int hal_ni_add32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_add64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height)82 inline int hal_ni_add64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
83 
hal_ni_sub8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)84 inline int hal_ni_sub8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sub8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height)85 inline int hal_ni_sub8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sub16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height)86 inline int hal_ni_sub16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sub16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height)87 inline int hal_ni_sub16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sub32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height)88 inline int hal_ni_sub32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sub32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height)89 inline int hal_ni_sub32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sub64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height)90 inline int hal_ni_sub64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
91 //! @}
92 
93 /**
94 Minimum: _dst[i] = min(src1[i], src2[i])_ @n
95 Maximum: _dst[i] = max(src1[i], src2[i])_
96 @param src1_data,src1_step first source image data and step
97 @param src2_data,src2_step second source image data and step
98 @param dst_data,dst_step destination image data and step
99 @param width,height dimensions of the images
100 */
101 //! @addtogroup core_hal_interface_minmax Element-wise minimum or maximum
102 //! @{
hal_ni_max8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)103 inline int hal_ni_max8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_max8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height)104 inline int hal_ni_max8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_max16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height)105 inline int hal_ni_max16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_max16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height)106 inline int hal_ni_max16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_max32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height)107 inline int hal_ni_max32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_max32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height)108 inline int hal_ni_max32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_max64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height)109 inline int hal_ni_max64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
110 
hal_ni_min8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)111 inline int hal_ni_min8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_min8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height)112 inline int hal_ni_min8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_min16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height)113 inline int hal_ni_min16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_min16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height)114 inline int hal_ni_min16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_min32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height)115 inline int hal_ni_min32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_min32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height)116 inline int hal_ni_min32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_min64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height)117 inline int hal_ni_min64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
118 //! @}
119 
120 /**
121 Absolute difference: _dst[i] = | src1[i] - src2[i] |_
122 @param src1_data,src1_step first source image data and step
123 @param src2_data,src2_step second source image data and step
124 @param dst_data,dst_step destination image data and step
125 @param width,height dimensions of the images
126 @param scale additional multiplier
127 */
128 //! @addtogroup core_hal_interface_absdiff Element-wise absolute difference
129 //! @{
hal_ni_absdiff8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)130 inline int hal_ni_absdiff8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_absdiff8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height)131 inline int hal_ni_absdiff8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_absdiff16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height)132 inline int hal_ni_absdiff16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_absdiff16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height)133 inline int hal_ni_absdiff16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_absdiff32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height)134 inline int hal_ni_absdiff32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_absdiff32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height)135 inline int hal_ni_absdiff32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_absdiff64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height)136 inline int hal_ni_absdiff64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
137 //! @}
138 
139 /**
140 Bitwise AND: _dst[i] = src1[i] & src2[i]_ @n
141 Bitwise OR: _dst[i] = src1[i] | src2[i]_ @n
142 Bitwise XOR: _dst[i] = src1[i] ^ src2[i]_ @n
143 Bitwise NOT: _dst[i] = !src[i]_
144 @param src1_data,src1_step first source image data and step
145 @param src2_data,src2_step second source image data and step
146 @param dst_data,dst_step destination image data and step
147 @param width,height dimensions of the images
148  */
149 //! @addtogroup core_hal_interface_logical Bitwise logical operations
150 //! @{
hal_ni_and8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)151 inline int hal_ni_and8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_or8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)152 inline int hal_ni_or8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_xor8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height)153 inline int hal_ni_xor8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_not8u(const uchar * src_data,size_t src_step,uchar * dst_data,size_t dst_step,int width,int height)154 inline int hal_ni_not8u(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
155 //! @}
156 
157 //! @cond IGNORED
158 #define cv_hal_add8u hal_ni_add8u
159 #define cv_hal_add8s hal_ni_add8s
160 #define cv_hal_add16u hal_ni_add16u
161 #define cv_hal_add16s hal_ni_add16s
162 #define cv_hal_add32s hal_ni_add32s
163 #define cv_hal_add32f hal_ni_add32f
164 #define cv_hal_add64f hal_ni_add64f
165 #define cv_hal_sub8u hal_ni_sub8u
166 #define cv_hal_sub8s hal_ni_sub8s
167 #define cv_hal_sub16u hal_ni_sub16u
168 #define cv_hal_sub16s hal_ni_sub16s
169 #define cv_hal_sub32s hal_ni_sub32s
170 #define cv_hal_sub32f hal_ni_sub32f
171 #define cv_hal_sub64f hal_ni_sub64f
172 #define cv_hal_max8u hal_ni_max8u
173 #define cv_hal_max8s hal_ni_max8s
174 #define cv_hal_max16u hal_ni_max16u
175 #define cv_hal_max16s hal_ni_max16s
176 #define cv_hal_max32s hal_ni_max32s
177 #define cv_hal_max32f hal_ni_max32f
178 #define cv_hal_max64f hal_ni_max64f
179 #define cv_hal_min8u hal_ni_min8u
180 #define cv_hal_min8s hal_ni_min8s
181 #define cv_hal_min16u hal_ni_min16u
182 #define cv_hal_min16s hal_ni_min16s
183 #define cv_hal_min32s hal_ni_min32s
184 #define cv_hal_min32f hal_ni_min32f
185 #define cv_hal_min64f hal_ni_min64f
186 #define cv_hal_absdiff8u hal_ni_absdiff8u
187 #define cv_hal_absdiff8s hal_ni_absdiff8s
188 #define cv_hal_absdiff16u hal_ni_absdiff16u
189 #define cv_hal_absdiff16s hal_ni_absdiff16s
190 #define cv_hal_absdiff32s hal_ni_absdiff32s
191 #define cv_hal_absdiff32f hal_ni_absdiff32f
192 #define cv_hal_absdiff64f hal_ni_absdiff64f
193 #define cv_hal_and8u hal_ni_and8u
194 #define cv_hal_or8u hal_ni_or8u
195 #define cv_hal_xor8u hal_ni_xor8u
196 #define cv_hal_not8u hal_ni_not8u
197 //! @endcond
198 
199 /**
200 Compare: _dst[i] = src1[i] op src2[i]_
201 @param src1_data,src1_step first source image data and step
202 @param src2_data,src2_step second source image data and step
203 @param dst_data,dst_step destination image data and step
204 @param width,height dimensions of the images
205 @param operation one of (CV_HAL_CMP_EQ, CV_HAL_CMP_GT, ...)
206 */
207 //! @addtogroup core_hal_interface_compare Element-wise compare
208 //! @{
hal_ni_cmp8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)209 inline int hal_ni_cmp8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_cmp8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)210 inline int hal_ni_cmp8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_cmp16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)211 inline int hal_ni_cmp16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_cmp16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)212 inline int hal_ni_cmp16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_cmp32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)213 inline int hal_ni_cmp32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_cmp32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)214 inline int hal_ni_cmp32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_cmp64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,int operation)215 inline int hal_ni_cmp64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, int operation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
216 //! @}
217 
218 //! @cond IGNORED
219 #define cv_hal_cmp8u hal_ni_cmp8u
220 #define cv_hal_cmp8s hal_ni_cmp8s
221 #define cv_hal_cmp16u hal_ni_cmp16u
222 #define cv_hal_cmp16s hal_ni_cmp16s
223 #define cv_hal_cmp32s hal_ni_cmp32s
224 #define cv_hal_cmp32f hal_ni_cmp32f
225 #define cv_hal_cmp64f hal_ni_cmp64f
226 //! @endcond
227 
228 /**
229 Multiply: _dst[i] = scale * src1[i] * src2[i]_
230 @param src1_data,src1_step first source image data and step
231 @param src2_data,src2_step second source image data and step
232 @param dst_data,dst_step destination image data and step
233 @param width,height dimensions of the images
234 @param scale additional multiplier
235 */
236 //! @addtogroup core_hal_interface_multiply Element-wise multiply
237 //! @{
hal_ni_mul8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,double scale)238 inline int hal_ni_mul8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_mul8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height,double scale)239 inline int hal_ni_mul8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_mul16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height,double scale)240 inline int hal_ni_mul16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_mul16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height,double scale)241 inline int hal_ni_mul16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_mul32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height,double scale)242 inline int hal_ni_mul32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_mul32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height,double scale)243 inline int hal_ni_mul32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_mul64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height,double scale)244 inline int hal_ni_mul64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
245 //! @}
246 
247 /**
248 Divide: _dst[i] = scale * src1[i] / src2[i]_
249 @param src1_data,src1_step first source image data and step
250 @param src2_data,src2_step second source image data and step
251 @param dst_data,dst_step destination image data and step
252 @param width,height dimensions of the images
253 @param scale additional multiplier
254 */
255 //! @addtogroup core_hal_interface_divide Element-wise divide
256 //! @{
hal_ni_div8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,double scale)257 inline int hal_ni_div8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_div8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height,double scale)258 inline int hal_ni_div8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_div16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height,double scale)259 inline int hal_ni_div16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_div16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height,double scale)260 inline int hal_ni_div16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_div32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height,double scale)261 inline int hal_ni_div32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_div32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height,double scale)262 inline int hal_ni_div32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_div64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height,double scale)263 inline int hal_ni_div64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
264 //! @}
265 
266 /**
267 Computes reciprocial: _dst[i] = scale / src[i]_
268 @param src_data,src_step source image data and step
269 @param dst_data,dst_step destination image data and step
270 @param width,height dimensions of the images
271 @param scale additional multiplier
272  */
273 //! @addtogroup core_hal_interface_reciprocial Element-wise reciprocial
274 //! @{
hal_ni_recip8u(const uchar * src_data,size_t src_step,uchar * dst_data,size_t dst_step,int width,int height,double scale)275 inline int hal_ni_recip8u(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_recip8s(const schar * src_data,size_t src_step,schar * dst_data,size_t dst_step,int width,int height,double scale)276 inline int hal_ni_recip8s(const schar *src_data, size_t src_step, schar *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_recip16u(const ushort * src_data,size_t src_step,ushort * dst_data,size_t dst_step,int width,int height,double scale)277 inline int hal_ni_recip16u(const ushort *src_data, size_t src_step, ushort *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_recip16s(const short * src_data,size_t src_step,short * dst_data,size_t dst_step,int width,int height,double scale)278 inline int hal_ni_recip16s(const short *src_data, size_t src_step, short *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_recip32s(const int * src_data,size_t src_step,int * dst_data,size_t dst_step,int width,int height,double scale)279 inline int hal_ni_recip32s(const int *src_data, size_t src_step, int *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_recip32f(const float * src_data,size_t src_step,float * dst_data,size_t dst_step,int width,int height,double scale)280 inline int hal_ni_recip32f(const float *src_data, size_t src_step, float *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_recip64f(const double * src_data,size_t src_step,double * dst_data,size_t dst_step,int width,int height,double scale)281 inline int hal_ni_recip64f(const double *src_data, size_t src_step, double *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
282 //! @}
283 
284 //! @cond IGNORED
285 #define cv_hal_mul8u hal_ni_mul8u
286 #define cv_hal_mul8s hal_ni_mul8s
287 #define cv_hal_mul16u hal_ni_mul16u
288 #define cv_hal_mul16s hal_ni_mul16s
289 #define cv_hal_mul32s hal_ni_mul32s
290 #define cv_hal_mul32f hal_ni_mul32f
291 #define cv_hal_mul64f hal_ni_mul64f
292 #define cv_hal_div8u hal_ni_div8u
293 #define cv_hal_div8s hal_ni_div8s
294 #define cv_hal_div16u hal_ni_div16u
295 #define cv_hal_div16s hal_ni_div16s
296 #define cv_hal_div32s hal_ni_div32s
297 #define cv_hal_div32f hal_ni_div32f
298 #define cv_hal_div64f hal_ni_div64f
299 #define cv_hal_recip8u hal_ni_recip8u
300 #define cv_hal_recip8s hal_ni_recip8s
301 #define cv_hal_recip16u hal_ni_recip16u
302 #define cv_hal_recip16s hal_ni_recip16s
303 #define cv_hal_recip32s hal_ni_recip32s
304 #define cv_hal_recip32f hal_ni_recip32f
305 #define cv_hal_recip64f hal_ni_recip64f
306 //! @endcond
307 
308 /**
309 Computes weighted sum of two arrays using formula: _dst[i] = a * src1[i] + b * src2[i] + c_
310 @param src1_data,src1_step first source image data and step
311 @param src2_data,src2_step second source image data and step
312 @param dst_data,dst_step destination image data and step
313 @param width,height dimensions of the images
314 @param scalars numbers _a_, _b_, and _c_
315  */
316 //! @addtogroup core_hal_interface_addWeighted Element-wise weighted sum
317 //! @{
hal_ni_addWeighted8u(const uchar * src1_data,size_t src1_step,const uchar * src2_data,size_t src2_step,uchar * dst_data,size_t dst_step,int width,int height,const double scalars[3])318 inline int hal_ni_addWeighted8u(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, uchar *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_addWeighted8s(const schar * src1_data,size_t src1_step,const schar * src2_data,size_t src2_step,schar * dst_data,size_t dst_step,int width,int height,const double scalars[3])319 inline int hal_ni_addWeighted8s(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, schar *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_addWeighted16u(const ushort * src1_data,size_t src1_step,const ushort * src2_data,size_t src2_step,ushort * dst_data,size_t dst_step,int width,int height,const double scalars[3])320 inline int hal_ni_addWeighted16u(const ushort *src1_data, size_t src1_step, const ushort *src2_data, size_t src2_step, ushort *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_addWeighted16s(const short * src1_data,size_t src1_step,const short * src2_data,size_t src2_step,short * dst_data,size_t dst_step,int width,int height,const double scalars[3])321 inline int hal_ni_addWeighted16s(const short *src1_data, size_t src1_step, const short *src2_data, size_t src2_step, short *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_addWeighted32s(const int * src1_data,size_t src1_step,const int * src2_data,size_t src2_step,int * dst_data,size_t dst_step,int width,int height,const double scalars[3])322 inline int hal_ni_addWeighted32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_addWeighted32f(const float * src1_data,size_t src1_step,const float * src2_data,size_t src2_step,float * dst_data,size_t dst_step,int width,int height,const double scalars[3])323 inline int hal_ni_addWeighted32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_addWeighted64f(const double * src1_data,size_t src1_step,const double * src2_data,size_t src2_step,double * dst_data,size_t dst_step,int width,int height,const double scalars[3])324 inline int hal_ni_addWeighted64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height, const double scalars[3]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
325 //! @}
326 
327 //! @cond IGNORED
328 #define cv_hal_addWeighted8u hal_ni_addWeighted8u
329 #define cv_hal_addWeighted8s hal_ni_addWeighted8s
330 #define cv_hal_addWeighted16u hal_ni_addWeighted16u
331 #define cv_hal_addWeighted16s hal_ni_addWeighted16s
332 #define cv_hal_addWeighted32s hal_ni_addWeighted32s
333 #define cv_hal_addWeighted32f hal_ni_addWeighted32f
334 #define cv_hal_addWeighted64f hal_ni_addWeighted64f
335 //! @endcond
336 
337 /**
338 @param src_data array of interleaved values (__len__ x __cn__ items) [ B, G, R, B, G, R, ...]
339 @param dst_data array of pointers to destination arrays (__cn__ items x __len__ items) [ [B, B, ...], [G, G, ...], [R, R, ...] ]
340 @param len number of elements
341 @param cn number of channels
342  */
343 //! @addtogroup core_hal_interface_split Channel split
344 //! @{
hal_ni_split8u(const uchar * src_data,uchar ** dst_data,int len,int cn)345 inline int hal_ni_split8u(const uchar *src_data, uchar **dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_split16u(const ushort * src_data,ushort ** dst_data,int len,int cn)346 inline int hal_ni_split16u(const ushort *src_data, ushort **dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_split32s(const int * src_data,int ** dst_data,int len,int cn)347 inline int hal_ni_split32s(const int *src_data, int **dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_split64s(const int64 * src_data,int64 ** dst_data,int len,int cn)348 inline int hal_ni_split64s(const int64 *src_data, int64 **dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
349 //! @}
350 
351 //! @cond IGNORED
352 #define cv_hal_split8u hal_ni_split8u
353 #define cv_hal_split16u hal_ni_split16u
354 #define cv_hal_split32s hal_ni_split32s
355 #define cv_hal_split64s hal_ni_split64s
356 //! @endcond
357 
358 /**
359 @param src_data array of pointers to source arrays (__cn__ items x __len__ items) [ [B, B, ...], [G, G, ...], [R, R, ...] ]
360 @param dst_data destination array of interleaved values (__len__ x __cn__ items) [ B, G, R, B, G, R, ...]
361 @param len number of elements
362 @param cn number of channels
363  */
364 //! @addtogroup core_hal_interface_merge Channel merge
365 //! @{
hal_ni_merge8u(const uchar ** src_data,uchar * dst_data,int len,int cn)366 inline int hal_ni_merge8u(const uchar **src_data, uchar *dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_merge16u(const ushort ** src_data,ushort * dst_data,int len,int cn)367 inline int hal_ni_merge16u(const ushort **src_data, ushort *dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_merge32s(const int ** src_data,int * dst_data,int len,int cn)368 inline int hal_ni_merge32s(const int **src_data, int *dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_merge64s(const int64 ** src_data,int64 * dst_data,int len,int cn)369 inline int hal_ni_merge64s(const int64 **src_data, int64 *dst_data, int len, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
370 //! @}
371 
372 //! @cond IGNORED
373 #define cv_hal_merge8u hal_ni_merge8u
374 #define cv_hal_merge16u hal_ni_merge16u
375 #define cv_hal_merge32s hal_ni_merge32s
376 #define cv_hal_merge64s hal_ni_merge64s
377 //! @endcond
378 
379 
380 /**
381 @param y,x source Y and X arrays
382 @param dst destination array
383 @param len length of arrays
384 @param angleInDegrees if set to true return angles in degrees, otherwise in radians
385  */
386 //! @addtogroup core_hal_interface_fastAtan Atan calculation
387 //! @{
hal_ni_fastAtan32f(const float * y,const float * x,float * dst,int len,bool angleInDegrees)388 inline int hal_ni_fastAtan32f(const float* y, const float* x, float* dst, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_fastAtan64f(const double * y,const double * x,double * dst,int len,bool angleInDegrees)389 inline int hal_ni_fastAtan64f(const double* y, const double* x, double* dst, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
390 //! @}
391 
392 //! @cond IGNORED
393 #define cv_hal_fastAtan32f hal_ni_fastAtan32f
394 #define cv_hal_fastAtan64f hal_ni_fastAtan64f
395 //! @endcond
396 
397 
398 /**
399 @param x,y source X and Y arrays
400 @param dst destination array
401 @param len length of arrays
402  */
403 //! @addtogroup core_hal_interface_magnitude Magnitude calculation
404 //! @{
hal_ni_magnitude32f(const float * x,const float * y,float * dst,int len)405 inline int hal_ni_magnitude32f(const float *x, const float *y, float *dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_magnitude64f(const double * x,const double * y,double * dst,int len)406 inline int hal_ni_magnitude64f(const double *x, const double  *y, double *dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
407 //! @}
408 
409 //! @cond IGNORED
410 #define cv_hal_magnitude32f hal_ni_magnitude32f
411 #define cv_hal_magnitude64f hal_ni_magnitude64f
412 //! @endcond
413 
414 
415 /**
416 @param src source array
417 @param dst destination array
418 @param len length of arrays
419  */
420 //! @addtogroup core_hal_interface_invSqrt Inverse square root calculation
421 //! @{
hal_ni_invSqrt32f(const float * src,float * dst,int len)422 inline int hal_ni_invSqrt32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_invSqrt64f(const double * src,double * dst,int len)423 inline int hal_ni_invSqrt64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
424 //! @}
425 
426 //! @cond IGNORED
427 #define cv_hal_invSqrt32f hal_ni_invSqrt32f
428 #define cv_hal_invSqrt64f hal_ni_invSqrt64f
429 //! @endcond
430 
431 
432 /**
433 @param src source array
434 @param dst destination array
435 @param len length of arrays
436  */
437 //! @addtogroup core_hal_interface_sqrt Square root calculation
438 //! @{
hal_ni_sqrt32f(const float * src,float * dst,int len)439 inline int hal_ni_sqrt32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_sqrt64f(const double * src,double * dst,int len)440 inline int hal_ni_sqrt64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
441 //! @}
442 
443 //! @cond IGNORED
444 #define cv_hal_sqrt32f hal_ni_sqrt32f
445 #define cv_hal_sqrt64f hal_ni_sqrt64f
446 //! @endcond
447 
448 
449 /**
450 @param src source array
451 @param dst destination array
452 @param len length of arrays
453  */
454 //! @addtogroup core_hal_interface_log Natural logarithm calculation
455 //! @{
hal_ni_log32f(const float * src,float * dst,int len)456 inline int hal_ni_log32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_log64f(const double * src,double * dst,int len)457 inline int hal_ni_log64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
458 //! @}
459 
460 //! @cond IGNORED
461 #define cv_hal_log32f hal_ni_log32f
462 #define cv_hal_log64f hal_ni_log64f
463 //! @endcond
464 
465 
466 /**
467 @param src source array
468 @param dst destination array
469 @param len length of arrays
470  */
471 //! @addtogroup core_hal_interface_exp Exponent calculation
472 //! @{
hal_ni_exp32f(const float * src,float * dst,int len)473 inline int hal_ni_exp32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_exp64f(const double * src,double * dst,int len)474 inline int hal_ni_exp64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
475 //! @}
476 
477 //! @cond IGNORED
478 #define cv_hal_exp32f hal_ni_exp32f
479 #define cv_hal_exp64f hal_ni_exp64f
480 //! @endcond
481 
482 
483 /**
484 @brief Dummy structure storing DFT/DCT context
485 
486 Users can convert this pointer to any type they want. Initialisation and destruction should be made in Init and Free function implementations correspondingly.
487 Example:
488 @code{.cpp}
489 int my_hal_dftInit2D(cvhalDFT **context, ...) {
490     *context = static_cast<cvhalDFT*>(new MyFilterData());
491     //... init
492 }
493 
494 int my_hal_dftFree2D(cvhalDFT *context) {
495     MyFilterData *c = static_cast<MyFilterData*>(context);
496     delete c;
497 }
498 @endcode
499  */
500 struct cvhalDFT {};
501 
502 /**
503 @param context double pointer to context storing all necessary data
504 @param len transformed array length
505 @param count estimated transformation count
506 @param depth array type (CV_32F or CV_64F)
507 @param flags algorithm options (combination of CV_HAL_DFT_INVERSE, CV_HAL_DFT_SCALE, ...)
508 @param needBuffer pointer to boolean variable, if valid pointer provided, then variable value should be set to true to signal that additional memory buffer is needed for operations
509  */
hal_ni_dftInit1D(cvhalDFT ** context,int len,int count,int depth,int flags,bool * needBuffer)510 inline int hal_ni_dftInit1D(cvhalDFT **context, int len, int count, int depth, int flags, bool *needBuffer) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
511 /**
512 @param context pointer to context storing all necessary data
513 @param src source data
514 @param dst destination data
515  */
hal_ni_dft1D(cvhalDFT * context,const uchar * src,uchar * dst)516 inline int hal_ni_dft1D(cvhalDFT *context, const uchar *src, uchar *dst) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
517 /**
518 @param context pointer to context storing all necessary data
519  */
hal_ni_dftFree1D(cvhalDFT * context)520 inline int hal_ni_dftFree1D(cvhalDFT *context) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
521 
522 //! @cond IGNORED
523 #define cv_hal_dftInit1D hal_ni_dftInit1D
524 #define cv_hal_dft1D hal_ni_dft1D
525 #define cv_hal_dftFree1D hal_ni_dftFree1D
526 //! @endcond
527 
528 /**
529 @param context double pointer to context storing all necessary data
530 @param width,height image dimensions
531 @param depth image type (CV_32F or CV64F)
532 @param src_channels number of channels in input image
533 @param dst_channels number of channels in output image
534 @param flags algorithm options (combination of CV_HAL_DFT_INVERSE, ...)
535 @param nonzero_rows number of nonzero rows in image, can be used for optimization
536  */
hal_ni_dftInit2D(cvhalDFT ** context,int width,int height,int depth,int src_channels,int dst_channels,int flags,int nonzero_rows)537 inline int hal_ni_dftInit2D(cvhalDFT **context, int width, int height, int depth, int src_channels, int dst_channels, int flags, int nonzero_rows) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
538 /**
539 @param context pointer to context storing all necessary data
540 @param src_data,src_step source image data and step
541 @param dst_data,dst_step destination image data and step
542  */
hal_ni_dft2D(cvhalDFT * context,const uchar * src_data,size_t src_step,uchar * dst_data,size_t dst_step)543 inline int hal_ni_dft2D(cvhalDFT *context, const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
544 /**
545 @param context pointer to context storing all necessary data
546  */
hal_ni_dftFree2D(cvhalDFT * context)547 inline int hal_ni_dftFree2D(cvhalDFT *context) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
548 
549 //! @cond IGNORED
550 #define cv_hal_dftInit2D hal_ni_dftInit2D
551 #define cv_hal_dft2D hal_ni_dft2D
552 #define cv_hal_dftFree2D hal_ni_dftFree2D
553 //! @endcond
554 
555 /**
556 @param context double pointer to context storing all necessary data
557 @param width,height image dimensions
558 @param depth image type (CV_32F or CV64F)
559 @param flags algorithm options (combination of CV_HAL_DFT_INVERSE, ...)
560  */
hal_ni_dctInit2D(cvhalDFT ** context,int width,int height,int depth,int flags)561 inline int hal_ni_dctInit2D(cvhalDFT **context, int width, int height, int depth, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
562 /**
563 @param context pointer to context storing all necessary data
564 @param src_data,src_step source image data and step
565 @param dst_data,dst_step destination image data and step
566  */
hal_ni_dct2D(cvhalDFT * context,const uchar * src_data,size_t src_step,uchar * dst_data,size_t dst_step)567 inline int hal_ni_dct2D(cvhalDFT *context, const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
568 /**
569 @param context pointer to context storing all necessary data
570  */
hal_ni_dctFree2D(cvhalDFT * context)571 inline int hal_ni_dctFree2D(cvhalDFT *context) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
572 
573 //! @cond IGNORED
574 #define cv_hal_dctInit2D hal_ni_dctInit2D
575 #define cv_hal_dct2D hal_ni_dct2D
576 #define cv_hal_dctFree2D hal_ni_dctFree2D
577 //! @endcond
578 
579 
580 /**
581 Performs \f$LU\f$ decomposition of square matrix \f$A=P*L*U\f$ (where \f$P\f$ is permutation matrix) and solves matrix equation \f$A*X=B\f$.
582 Function returns the \f$sign\f$ of permutation \f$P\f$ via parameter info.
583 @param src1 pointer to input matrix \f$A\f$ stored in row major order. After finish of work src1 contains at least \f$U\f$ part of \f$LU\f$
584 decomposition which is appropriate for determainant calculation: \f$det(A)=sign*\prod_{j=1}^{M}a_{jj}\f$.
585 @param src1_step number of bytes between two consequent rows of matrix \f$A\f$.
586 @param m size of square matrix \f$A\f$.
587 @param src2 pointer to \f$M\times N\f$ matrix \f$B\f$ which is the right-hand side of system \f$A*X=B\f$. \f$B\f$ stored in row major order.
588 If src2 is null pointer only \f$LU\f$ decomposition will be performed. After finish of work src2 contains solution \f$X\f$ of system \f$A*X=B\f$.
589 @param src2_step number of bytes between two consequent rows of matrix \f$B\f$.
590 @param n number of right-hand vectors in \f$M\times N\f$ matrix \f$B\f$.
591 @param info indicates success of decomposition. If *info is equals to zero decomposition failed, othervise *info is equals to \f$sign\f$.
592  */
593 //! @addtogroup core_hal_interface_decomp_lu LU matrix decomposition
594 //! @{
hal_ni_LU32f(float * src1,size_t src1_step,int m,float * src2,size_t src2_step,int n,int * info)595 inline int hal_ni_LU32f(float* src1, size_t src1_step, int m, float* src2, size_t src2_step, int n, int* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_LU64f(double * src1,size_t src1_step,int m,double * src2,size_t src2_step,int n,int * info)596 inline int hal_ni_LU64f(double* src1, size_t src1_step, int m, double* src2, size_t src2_step, int n, int* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
597 //! @}
598 
599 /**
600 Performs Cholesky decomposition of matrix \f$A = L*L^T\f$ and solves matrix equation \f$A*X=B\f$.
601 @param src1 pointer to input matrix \f$A\f$ stored in row major order. After finish of work src1 contains lower triangular matrix \f$L\f$.
602 @param src1_step number of bytes between two consequent rows of matrix \f$A\f$.
603 @param m size of square matrix \f$A\f$.
604 @param src2 pointer to \f$M\times N\f$ matrix \f$B\f$ which is the right-hand side of system \f$A*X=B\f$. B stored in row major order.
605 If src2 is null pointer only Cholesky decomposition will be performed. After finish of work src2 contains solution \f$X\f$ of system \f$A*X=B\f$.
606 @param src2_step number of bytes between two consequent rows of matrix \f$B\f$.
607 @param n number of right-hand vectors in \f$M\times N\f$ matrix \f$B\f$.
608 @param info indicates success of decomposition. If *info is false decomposition failed.
609  */
610 
611 //! @addtogroup core_hal_interface_decomp_cholesky Cholesky matrix decomposition
612 //! @{
hal_ni_Cholesky32f(float * src1,size_t src1_step,int m,float * src2,size_t src2_step,int n,bool * info)613 inline int hal_ni_Cholesky32f(float* src1, size_t src1_step, int m, float* src2, size_t src2_step, int n, bool* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_Cholesky64f(double * src1,size_t src1_step,int m,double * src2,size_t src2_step,int n,bool * info)614 inline int hal_ni_Cholesky64f(double* src1, size_t src1_step, int m, double* src2, size_t src2_step, int n, bool* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
615 //! @}
616 
617 /**
618 Performs singular value decomposition of \f$M\times N\f$(\f$M>N\f$) matrix \f$A = U*\Sigma*V^T\f$.
619 @param src pointer to input \f$M\times N\f$ matrix \f$A\f$ stored in column major order.
620 After finish of work src will be filled with rows of \f$U\f$ or not modified (depends of flag CV_HAL_SVD_MODIFY_A).
621 @param src_step number of bytes between two consequent columns of matrix \f$A\f$.
622 @param w pointer to array for singular values of matrix \f$A\f$ (i. e. first \f$N\f$ diagonal elements of matrix \f$\Sigma\f$).
623 @param u pointer to output \f$M\times N\f$ or \f$M\times M\f$ matrix \f$U\f$ (size depends of flags). Pointer must be valid if flag CV_HAL_SVD_MODIFY_A not used.
624 @param u_step number of bytes between two consequent rows of matrix \f$U\f$.
625 @param vt pointer to array for \f$N\times N\f$ matrix \f$V^T\f$.
626 @param vt_step number of bytes between two consequent rows of matrix \f$V^T\f$.
627 @param m number fo rows in matrix \f$A\f$.
628 @param n number of columns in matrix \f$A\f$.
629 @param flags algorithm options (combination of CV_HAL_SVD_FULL_UV, ...).
630  */
631 //! @addtogroup core_hal_interface_decomp_svd Singular value matrix decomposition
632 //! @{
hal_ni_SVD32f(float * src,size_t src_step,float * w,float * u,size_t u_step,float * vt,size_t vt_step,int m,int n,int flags)633 inline int hal_ni_SVD32f(float* src, size_t src_step, float* w, float* u, size_t u_step, float* vt, size_t vt_step, int m, int n, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_SVD64f(double * src,size_t src_step,double * w,double * u,size_t u_step,double * vt,size_t vt_step,int m,int n,int flags)634 inline int hal_ni_SVD64f(double* src, size_t src_step, double* w, double* u, size_t u_step, double* vt, size_t vt_step, int m, int n, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
635 //! @}
636 
637 /**
638 Performs QR decomposition of \f$M\times N\f$(\f$M>N\f$) matrix \f$A = Q*R\f$ and solves matrix equation \f$A*X=B\f$.
639 @param src1 pointer to input matrix \f$A\f$ stored in row major order. After finish of work src1 contains upper triangular \f$N\times N\f$ matrix \f$R\f$.
640 Lower triangle of src1 will be filled with vectors of elementary reflectors. See @cite VandLec and Lapack's DGEQRF documentation for details.
641 @param src1_step number of bytes between two consequent rows of matrix \f$A\f$.
642 @param m number fo rows in matrix \f$A\f$.
643 @param n number of columns in matrix \f$A\f$.
644 @param k number of right-hand vectors in \f$M\times K\f$ matrix \f$B\f$.
645 @param src2 pointer to \f$M\times K\f$ matrix \f$B\f$ which is the right-hand side of system \f$A*X=B\f$. \f$B\f$ stored in row major order.
646 If src2 is null pointer only QR decomposition will be performed. Otherwise system will be solved and src1 will be used as temporary buffer, so
647 after finish of work src2 contains solution \f$X\f$ of system \f$A*X=B\f$.
648 @param src2_step number of bytes between two consequent rows of matrix \f$B\f$.
649 @param dst pointer to continiuos \f$N\times 1\f$ array for scalar factors of elementary reflectors. See @cite VandLec for details.
650 @param info indicates success of decomposition. If *info is zero decomposition failed.
651 */
652 //! @addtogroup core_hal_interface_decomp_qr QR matrix decomposition
653 //! @{
hal_ni_QR32f(float * src1,size_t src1_step,int m,int n,int k,float * src2,size_t src2_step,float * dst,int * info)654 inline int hal_ni_QR32f(float* src1, size_t src1_step, int m, int n, int k, float* src2, size_t src2_step, float* dst, int* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_QR64f(double * src1,size_t src1_step,int m,int n,int k,double * src2,size_t src2_step,double * dst,int * info)655 inline int hal_ni_QR64f(double* src1, size_t src1_step, int m, int n, int k, double* src2, size_t src2_step, double* dst, int* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
656 //! @}
657 
658 
659 
660 //! @cond IGNORED
661 #define cv_hal_LU32f hal_ni_LU32f
662 #define cv_hal_LU64f hal_ni_LU64f
663 #define cv_hal_Cholesky32f hal_ni_Cholesky32f
664 #define cv_hal_Cholesky64f hal_ni_Cholesky64f
665 #define cv_hal_SVD32f hal_ni_SVD32f
666 #define cv_hal_SVD64f hal_ni_SVD64f
667 #define cv_hal_QR32f hal_ni_QR32f
668 #define cv_hal_QR64f hal_ni_QR64f
669 //! @endcond
670 
671 
672 /**
673 The function performs generalized matrix multiplication similar to the gemm functions in BLAS level 3:
674 \f$D = \alpha*AB+\beta*C\f$
675 
676 @param src1 pointer to input \f$M\times N\f$ matrix \f$A\f$ or \f$A^T\f$ stored in row major order.
677 @param src1_step number of bytes between two consequent rows of matrix \f$A\f$ or \f$A^T\f$.
678 @param src2 pointer to input \f$N\times K\f$ matrix \f$B\f$ or \f$B^T\f$ stored in row major order.
679 @param src2_step number of bytes between two consequent rows of matrix \f$B\f$ or \f$B^T\f$.
680 @param alpha \f$\alpha\f$ multiplier before \f$AB\f$
681 @param src3 pointer to input \f$M\times K\f$ matrix \f$C\f$ or \f$C^T\f$ stored in row major order.
682 @param src3_step number of bytes between two consequent rows of matrix \f$C\f$ or \f$C^T\f$.
683 @param beta \f$\beta\f$ multiplier before \f$C\f$
684 @param dst pointer to input \f$M\times K\f$ matrix \f$D\f$ stored in row major order.
685 @param dst_step number of bytes between two consequent rows of matrix \f$D\f$.
686 @param m number of rows in matrix \f$A\f$ or \f$A^T\f$, equals to number of rows in matrix \f$D\f$
687 @param n number of columns in matrix \f$A\f$ or \f$A^T\f$
688 @param k number of columns in matrix \f$B\f$ or \f$B^T\f$, equals to number of columns in matrix \f$D\f$
689 @param flags algorithm options (combination of CV_HAL_GEMM_1_T, ...).
690  */
691 
692 //! @addtogroup core_hal_interface_matrix_multiplication Matrix multiplication
693 //! @{
hal_ni_gemm32f(const float * src1,size_t src1_step,const float * src2,size_t src2_step,float alpha,const float * src3,size_t src3_step,float beta,float * dst,size_t dst_step,int m,int n,int k,int flags)694 inline int hal_ni_gemm32f(const float* src1, size_t src1_step, const float* src2, size_t src2_step,
695                           float alpha, const float* src3, size_t src3_step, float beta, float* dst, size_t dst_step,
696                           int m, int n, int k, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_gemm64f(const double * src1,size_t src1_step,const double * src2,size_t src2_step,double alpha,const double * src3,size_t src3_step,double beta,double * dst,size_t dst_step,int m,int n,int k,int flags)697 inline int hal_ni_gemm64f(const double* src1, size_t src1_step, const double* src2, size_t src2_step,
698                           double alpha, const double* src3, size_t src3_step, double beta, double* dst, size_t dst_step,
699                           int m, int n, int k, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_gemm32fc(const float * src1,size_t src1_step,const float * src2,size_t src2_step,float alpha,const float * src3,size_t src3_step,float beta,float * dst,size_t dst_step,int m,int n,int k,int flags)700 inline int hal_ni_gemm32fc(const float* src1, size_t src1_step, const float* src2, size_t src2_step,
701                           float alpha, const float* src3, size_t src3_step, float beta, float* dst, size_t dst_step,
702                           int m, int n, int k, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
hal_ni_gemm64fc(const double * src1,size_t src1_step,const double * src2,size_t src2_step,double alpha,const double * src3,size_t src3_step,double beta,double * dst,size_t dst_step,int m,int n,int k,int flags)703 inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* src2, size_t src2_step,
704                           double alpha, const double* src3, size_t src3_step, double beta, double* dst, size_t dst_step,
705                           int m, int n, int k, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
706 //! @}
707 
708 //! @cond IGNORED
709 #define cv_hal_gemm32f hal_ni_gemm32f
710 #define cv_hal_gemm64f hal_ni_gemm64f
711 #define cv_hal_gemm32fc hal_ni_gemm32fc
712 #define cv_hal_gemm64fc hal_ni_gemm64fc
713 //! @endcond
714 
715 /**
716    @brief Finds the global minimum and maximum in an array.
717    @param src_data,src_step Source image
718    @param width,height Source image dimensions
719    @param depth Depth of source image
720    @param minVal,maxVal Pointer to the returned global minimum and maximum in an array.
721    @param minIdx,maxIdx Pointer to the returned minimum and maximum location.
722    @param mask Specified array region.
723 */
hal_ni_minMaxIdx(const uchar * src_data,size_t src_step,int width,int height,int depth,double * minVal,double * maxVal,int * minIdx,int * maxIdx,uchar * mask)724 inline int hal_ni_minMaxIdx(const uchar* src_data, size_t src_step, int width, int height, int depth, double* minVal, double* maxVal,
725                             int* minIdx, int* maxIdx, uchar* mask) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
726 
727 //! @cond IGNORED
728 #define cv_hal_minMaxIdx hal_ni_minMaxIdx
729 //! @endcond
730 
731 //! @}
732 
733 
734 #if defined __GNUC__
735 #  pragma GCC diagnostic pop
736 #elif defined _MSC_VER
737 #  pragma warning( pop )
738 #endif
739 
740 #include "hal_internal.hpp"
741 #include "custom_hal.hpp"
742 
743 //! @cond IGNORED
744 #define CALL_HAL_RET(name, fun, retval, ...) \
745 { \
746     int res = __CV_EXPAND(fun(__VA_ARGS__, &retval)); \
747     if (res == CV_HAL_ERROR_OK) \
748         return retval; \
749     else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \
750         CV_Error_(cv::Error::StsInternal, \
751             ("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); \
752 }
753 
754 
755 #define CALL_HAL(name, fun, ...) \
756 { \
757     int res = __CV_EXPAND(fun(__VA_ARGS__)); \
758     if (res == CV_HAL_ERROR_OK) \
759         return; \
760     else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \
761         CV_Error_(cv::Error::StsInternal, \
762             ("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); \
763 }
764 //! @endcond
765 
766 #endif
767