node-native-win-utils 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +144 -27
  2. package/binding.gyp +18 -5
  3. package/dist/index.d.ts +146 -4
  4. package/dist/index.js +107 -3
  5. package/include/opencv2/core/affine.hpp +678 -0
  6. package/include/opencv2/core/async.hpp +105 -0
  7. package/include/opencv2/core/base.hpp +664 -0
  8. package/include/opencv2/core/bindings_utils.hpp +325 -0
  9. package/include/opencv2/core/bufferpool.hpp +40 -0
  10. package/include/opencv2/core/check.hpp +170 -0
  11. package/include/opencv2/core/core.hpp +48 -0
  12. package/include/opencv2/core/core_c.h +3128 -0
  13. package/include/opencv2/core/cuda/block.hpp +211 -0
  14. package/include/opencv2/core/cuda/border_interpolate.hpp +722 -0
  15. package/include/opencv2/core/cuda/color.hpp +309 -0
  16. package/include/opencv2/core/cuda/common.hpp +131 -0
  17. package/include/opencv2/core/cuda/datamov_utils.hpp +113 -0
  18. package/include/opencv2/core/cuda/detail/color_detail.hpp +2018 -0
  19. package/include/opencv2/core/cuda/detail/reduce.hpp +365 -0
  20. package/include/opencv2/core/cuda/detail/reduce_key_val.hpp +502 -0
  21. package/include/opencv2/core/cuda/detail/transform_detail.hpp +392 -0
  22. package/include/opencv2/core/cuda/detail/type_traits_detail.hpp +191 -0
  23. package/include/opencv2/core/cuda/detail/vec_distance_detail.hpp +121 -0
  24. package/include/opencv2/core/cuda/dynamic_smem.hpp +88 -0
  25. package/include/opencv2/core/cuda/emulation.hpp +269 -0
  26. package/include/opencv2/core/cuda/filters.hpp +293 -0
  27. package/include/opencv2/core/cuda/funcattrib.hpp +79 -0
  28. package/include/opencv2/core/cuda/functional.hpp +805 -0
  29. package/include/opencv2/core/cuda/limits.hpp +128 -0
  30. package/include/opencv2/core/cuda/reduce.hpp +209 -0
  31. package/include/opencv2/core/cuda/saturate_cast.hpp +292 -0
  32. package/include/opencv2/core/cuda/scan.hpp +258 -0
  33. package/include/opencv2/core/cuda/simd_functions.hpp +869 -0
  34. package/include/opencv2/core/cuda/transform.hpp +75 -0
  35. package/include/opencv2/core/cuda/type_traits.hpp +90 -0
  36. package/include/opencv2/core/cuda/utility.hpp +230 -0
  37. package/include/opencv2/core/cuda/vec_distance.hpp +232 -0
  38. package/include/opencv2/core/cuda/vec_math.hpp +923 -0
  39. package/include/opencv2/core/cuda/vec_traits.hpp +288 -0
  40. package/include/opencv2/core/cuda/warp.hpp +139 -0
  41. package/include/opencv2/core/cuda/warp_reduce.hpp +76 -0
  42. package/include/opencv2/core/cuda/warp_shuffle.hpp +162 -0
  43. package/include/opencv2/core/cuda.hpp +1279 -0
  44. package/include/opencv2/core/cuda.inl.hpp +763 -0
  45. package/include/opencv2/core/cuda_stream_accessor.hpp +86 -0
  46. package/include/opencv2/core/cuda_types.hpp +144 -0
  47. package/include/opencv2/core/cv_cpu_dispatch.h +381 -0
  48. package/include/opencv2/core/cv_cpu_helper.h +550 -0
  49. package/include/opencv2/core/cvdef.h +973 -0
  50. package/include/opencv2/core/cvstd.hpp +190 -0
  51. package/include/opencv2/core/cvstd.inl.hpp +197 -0
  52. package/include/opencv2/core/cvstd_wrapper.hpp +154 -0
  53. package/include/opencv2/core/detail/async_promise.hpp +71 -0
  54. package/include/opencv2/core/detail/dispatch_helper.impl.hpp +49 -0
  55. package/include/opencv2/core/detail/exception_ptr.hpp +27 -0
  56. package/include/opencv2/core/directx.hpp +184 -0
  57. package/include/opencv2/core/dualquaternion.hpp +979 -0
  58. package/include/opencv2/core/dualquaternion.inl.hpp +487 -0
  59. package/include/opencv2/core/eigen.hpp +402 -0
  60. package/include/opencv2/core/fast_math.hpp +433 -0
  61. package/include/opencv2/core/hal/hal.hpp +256 -0
  62. package/include/opencv2/core/hal/interface.h +190 -0
  63. package/include/opencv2/core/hal/intrin.hpp +939 -0
  64. package/include/opencv2/core/hal/intrin_avx.hpp +3177 -0
  65. package/include/opencv2/core/hal/intrin_avx512.hpp +3090 -0
  66. package/include/opencv2/core/hal/intrin_cpp.hpp +3321 -0
  67. package/include/opencv2/core/hal/intrin_forward.hpp +191 -0
  68. package/include/opencv2/core/hal/intrin_lasx.hpp +3236 -0
  69. package/include/opencv2/core/hal/intrin_msa.hpp +1887 -0
  70. package/include/opencv2/core/hal/intrin_neon.hpp +2610 -0
  71. package/include/opencv2/core/hal/intrin_rvv.hpp +3320 -0
  72. package/include/opencv2/core/hal/intrin_rvv071.hpp +2545 -0
  73. package/include/opencv2/core/hal/intrin_rvv_scalable.hpp +2080 -0
  74. package/include/opencv2/core/hal/intrin_sse.hpp +3467 -0
  75. package/include/opencv2/core/hal/intrin_sse_em.hpp +180 -0
  76. package/include/opencv2/core/hal/intrin_vsx.hpp +1608 -0
  77. package/include/opencv2/core/hal/intrin_wasm.hpp +2782 -0
  78. package/include/opencv2/core/hal/msa_macros.h +1558 -0
  79. package/include/opencv2/core/hal/simd_utils.impl.hpp +186 -0
  80. package/include/opencv2/core/llapi/llapi.h +102 -0
  81. package/include/opencv2/core/mat.hpp +3775 -0
  82. package/include/opencv2/core/mat.inl.hpp +3422 -0
  83. package/include/opencv2/core/matx.hpp +1536 -0
  84. package/include/opencv2/core/neon_utils.hpp +128 -0
  85. package/include/opencv2/core/ocl.hpp +917 -0
  86. package/include/opencv2/core/ocl_genbase.hpp +69 -0
  87. package/include/opencv2/core/opencl/ocl_defs.hpp +82 -0
  88. package/include/opencv2/core/opencl/opencl_info.hpp +212 -0
  89. package/include/opencv2/core/opencl/opencl_svm.hpp +81 -0
  90. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp +602 -0
  91. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp +146 -0
  92. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp +371 -0
  93. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp +272 -0
  94. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp +62 -0
  95. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp +42 -0
  96. package/include/opencv2/core/opencl/runtime/opencl_clblas.hpp +53 -0
  97. package/include/opencv2/core/opencl/runtime/opencl_clfft.hpp +53 -0
  98. package/include/opencv2/core/opencl/runtime/opencl_core.hpp +84 -0
  99. package/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp +47 -0
  100. package/include/opencv2/core/opencl/runtime/opencl_gl.hpp +53 -0
  101. package/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp +47 -0
  102. package/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp +48 -0
  103. package/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp +42 -0
  104. package/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp +166 -0
  105. package/include/opencv2/core/opengl.hpp +733 -0
  106. package/include/opencv2/core/openvx/ovx_defs.hpp +48 -0
  107. package/include/opencv2/core/operations.hpp +610 -0
  108. package/include/opencv2/core/optim.hpp +302 -0
  109. package/include/opencv2/core/ovx.hpp +28 -0
  110. package/include/opencv2/core/parallel/backend/parallel_for.openmp.hpp +72 -0
  111. package/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp +153 -0
  112. package/include/opencv2/core/parallel/parallel_backend.hpp +90 -0
  113. package/include/opencv2/core/persistence.hpp +1350 -0
  114. package/include/opencv2/core/private/cv_cpu_include_simd_declarations.hpp +30 -0
  115. package/include/opencv2/core/private.cuda.hpp +169 -0
  116. package/include/opencv2/core/private.hpp +896 -0
  117. package/include/opencv2/core/quaternion.hpp +1696 -0
  118. package/include/opencv2/core/quaternion.inl.hpp +1063 -0
  119. package/include/opencv2/core/saturate.hpp +180 -0
  120. package/include/opencv2/core/simd_intrinsics.hpp +87 -0
  121. package/include/opencv2/core/softfloat.hpp +514 -0
  122. package/include/opencv2/core/sse_utils.hpp +652 -0
  123. package/include/opencv2/core/traits.hpp +417 -0
  124. package/include/opencv2/core/types.hpp +2457 -0
  125. package/include/opencv2/core/types_c.h +2126 -0
  126. package/include/opencv2/core/utility.hpp +1229 -0
  127. package/include/opencv2/core/utils/allocator_stats.hpp +29 -0
  128. package/include/opencv2/core/utils/allocator_stats.impl.hpp +158 -0
  129. package/include/opencv2/core/utils/buffer_area.private.hpp +136 -0
  130. package/include/opencv2/core/utils/configuration.private.hpp +22 -0
  131. package/include/opencv2/core/utils/filesystem.hpp +82 -0
  132. package/include/opencv2/core/utils/filesystem.private.hpp +66 -0
  133. package/include/opencv2/core/utils/fp_control.private.hpp +29 -0
  134. package/include/opencv2/core/utils/fp_control_utils.hpp +69 -0
  135. package/include/opencv2/core/utils/instrumentation.hpp +125 -0
  136. package/include/opencv2/core/utils/lock.private.hpp +119 -0
  137. package/include/opencv2/core/utils/logger.defines.hpp +42 -0
  138. package/include/opencv2/core/utils/logger.hpp +218 -0
  139. package/include/opencv2/core/utils/logtag.hpp +28 -0
  140. package/include/opencv2/core/utils/plugin_loader.private.hpp +165 -0
  141. package/include/opencv2/core/utils/tls.hpp +235 -0
  142. package/include/opencv2/core/utils/trace.hpp +252 -0
  143. package/include/opencv2/core/utils/trace.private.hpp +421 -0
  144. package/include/opencv2/core/va_intel.hpp +75 -0
  145. package/include/opencv2/core/version.hpp +26 -0
  146. package/include/opencv2/core/vsx_utils.hpp +1047 -0
  147. package/include/opencv2/core.hpp +3365 -0
  148. package/include/opencv2/imgcodecs/imgcodecs.hpp +48 -0
  149. package/include/opencv2/imgcodecs/imgcodecs_c.h +1 -0
  150. package/include/opencv2/imgcodecs/ios.h +59 -0
  151. package/include/opencv2/imgcodecs/legacy/constants_c.h +54 -0
  152. package/include/opencv2/imgcodecs/macosx.h +20 -0
  153. package/include/opencv2/imgcodecs.hpp +407 -0
  154. package/include/opencv2/imgproc/bindings.hpp +34 -0
  155. package/include/opencv2/imgproc/detail/gcgraph.hpp +395 -0
  156. package/include/opencv2/imgproc/hal/hal.hpp +246 -0
  157. package/include/opencv2/imgproc/hal/interface.h +46 -0
  158. package/include/opencv2/imgproc/imgproc.hpp +48 -0
  159. package/include/opencv2/imgproc/imgproc_c.h +1177 -0
  160. package/include/opencv2/imgproc/segmentation.hpp +141 -0
  161. package/include/opencv2/imgproc/types_c.h +659 -0
  162. package/include/opencv2/imgproc.hpp +5035 -0
  163. package/include/opencv2/opencv_modules.hpp +17 -0
  164. package/libs/libjpeg-turbo.lib +0 -0
  165. package/libs/libpng.lib +0 -0
  166. package/libs/opencv_core470.lib +0 -0
  167. package/libs/opencv_imgcodecs470.lib +0 -0
  168. package/libs/opencv_imgproc470.lib +0 -0
  169. package/libs/zlib.lib +0 -0
  170. package/package.json +8 -2
  171. package/prebuilds/win32-x64/node.napi.node +0 -0
  172. package/src/cpp/capturewindow.cpp +36 -46
  173. package/src/cpp/main.cpp +10 -2
  174. package/src/cpp/opencv.cpp +425 -0
@@ -0,0 +1,86 @@
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
+ // Third party copyrights are property of their respective owners.
16
+ //
17
+ // Redistribution and use in source and binary forms, with or without modification,
18
+ // are permitted provided that the following conditions are met:
19
+ //
20
+ // * Redistribution's of source code must retain the above copyright notice,
21
+ // this list of conditions and the following disclaimer.
22
+ //
23
+ // * Redistribution's in binary form must reproduce the above copyright notice,
24
+ // this list of conditions and the following disclaimer in the documentation
25
+ // and/or other materials provided with the distribution.
26
+ //
27
+ // * The name of the copyright holders may not be used to endorse or promote products
28
+ // derived from this software without specific prior written permission.
29
+ //
30
+ // This software is provided by the copyright holders and contributors "as is" and
31
+ // any express or implied warranties, including, but not limited to, the implied
32
+ // warranties of merchantability and fitness for a particular purpose are disclaimed.
33
+ // In no event shall the Intel Corporation or contributors be liable for any direct,
34
+ // indirect, incidental, special, exemplary, or consequential damages
35
+ // (including, but not limited to, procurement of substitute goods or services;
36
+ // loss of use, data, or profits; or business interruption) however caused
37
+ // and on any theory of liability, whether in contract, strict liability,
38
+ // or tort (including negligence or otherwise) arising in any way out of
39
+ // the use of this software, even if advised of the possibility of such damage.
40
+ //
41
+ //M*/
42
+
43
+ #ifndef OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP
44
+ #define OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP
45
+
46
+ #ifndef __cplusplus
47
+ # error cuda_stream_accessor.hpp header must be compiled as C++
48
+ #endif
49
+
50
+ /** @file cuda_stream_accessor.hpp
51
+ * This is only header file that depends on CUDA Runtime API. All other headers are independent.
52
+ */
53
+
54
+ #include <cuda_runtime.h>
55
+ #include "opencv2/core/cuda.hpp"
56
+
57
+ namespace cv
58
+ {
59
+ namespace cuda
60
+ {
61
+
62
+ //! @addtogroup cudacore_struct
63
+ //! @{
64
+
65
+ /** @brief Class that enables getting cudaStream_t from cuda::Stream
66
+ */
67
+ struct StreamAccessor
68
+ {
69
+ CV_EXPORTS static cudaStream_t getStream(const Stream& stream);
70
+ CV_EXPORTS static Stream wrapStream(cudaStream_t stream);
71
+ };
72
+
73
+ /** @brief Class that enables getting cudaEvent_t from cuda::Event
74
+ */
75
+ struct EventAccessor
76
+ {
77
+ CV_EXPORTS static cudaEvent_t getEvent(const Event& event);
78
+ CV_EXPORTS static Event wrapEvent(cudaEvent_t event);
79
+ };
80
+
81
+ //! @}
82
+
83
+ }
84
+ }
85
+
86
+ #endif /* OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP */
@@ -0,0 +1,144 @@
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
+ // Third party copyrights are property of their respective owners.
16
+ //
17
+ // Redistribution and use in source and binary forms, with or without modification,
18
+ // are permitted provided that the following conditions are met:
19
+ //
20
+ // * Redistribution's of source code must retain the above copyright notice,
21
+ // this list of conditions and the following disclaimer.
22
+ //
23
+ // * Redistribution's in binary form must reproduce the above copyright notice,
24
+ // this list of conditions and the following disclaimer in the documentation
25
+ // and/or other materials provided with the distribution.
26
+ //
27
+ // * The name of the copyright holders may not be used to endorse or promote products
28
+ // derived from this software without specific prior written permission.
29
+ //
30
+ // This software is provided by the copyright holders and contributors "as is" and
31
+ // any express or implied warranties, including, but not limited to, the implied
32
+ // warranties of merchantability and fitness for a particular purpose are disclaimed.
33
+ // In no event shall the Intel Corporation or contributors be liable for any direct,
34
+ // indirect, incidental, special, exemplary, or consequential damages
35
+ // (including, but not limited to, procurement of substitute goods or services;
36
+ // loss of use, data, or profits; or business interruption) however caused
37
+ // and on any theory of liability, whether in contract, strict liability,
38
+ // or tort (including negligence or otherwise) arising in any way out of
39
+ // the use of this software, even if advised of the possibility of such damage.
40
+ //
41
+ //M*/
42
+
43
+ #ifndef OPENCV_CORE_CUDA_TYPES_HPP
44
+ #define OPENCV_CORE_CUDA_TYPES_HPP
45
+
46
+ #ifndef __cplusplus
47
+ # error cuda_types.hpp header must be compiled as C++
48
+ #endif
49
+
50
+ #if defined(__OPENCV_BUILD) && defined(__clang__)
51
+ #pragma clang diagnostic ignored "-Winconsistent-missing-override"
52
+ #endif
53
+ #if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5
54
+ #pragma GCC diagnostic ignored "-Wsuggest-override"
55
+ #endif
56
+
57
+ /** @file
58
+ * @deprecated Use @ref cudev instead.
59
+ */
60
+
61
+ //! @cond IGNORED
62
+
63
+ #ifdef __CUDACC__
64
+ #define __CV_CUDA_HOST_DEVICE__ __host__ __device__ __forceinline__
65
+ #else
66
+ #define __CV_CUDA_HOST_DEVICE__
67
+ #endif
68
+
69
+ namespace cv
70
+ {
71
+ namespace cuda
72
+ {
73
+
74
+ // Simple lightweight structures that encapsulates information about an image on device.
75
+ // It is intended to pass to nvcc-compiled code. GpuMat depends on headers that nvcc can't compile
76
+
77
+ template <typename T> struct DevPtr
78
+ {
79
+ typedef T elem_type;
80
+ typedef int index_type;
81
+
82
+ enum { elem_size = sizeof(elem_type) };
83
+
84
+ T* data;
85
+
86
+ __CV_CUDA_HOST_DEVICE__ DevPtr() : data(0) {}
87
+ __CV_CUDA_HOST_DEVICE__ DevPtr(T* data_) : data(data_) {}
88
+
89
+ __CV_CUDA_HOST_DEVICE__ size_t elemSize() const { return elem_size; }
90
+ __CV_CUDA_HOST_DEVICE__ operator T*() { return data; }
91
+ __CV_CUDA_HOST_DEVICE__ operator const T*() const { return data; }
92
+ };
93
+
94
+ template <typename T> struct PtrSz : public DevPtr<T>
95
+ {
96
+ __CV_CUDA_HOST_DEVICE__ PtrSz() : size(0) {}
97
+ __CV_CUDA_HOST_DEVICE__ PtrSz(T* data_, size_t size_) : DevPtr<T>(data_), size(size_) {}
98
+
99
+ size_t size;
100
+ };
101
+
102
+ template <typename T> struct PtrStep : public DevPtr<T>
103
+ {
104
+ __CV_CUDA_HOST_DEVICE__ PtrStep() : step(0) {}
105
+ __CV_CUDA_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr<T>(data_), step(step_) {}
106
+
107
+ size_t step;
108
+
109
+ __CV_CUDA_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)(((DevPtr<T>*)this)->data) + y * step); }
110
+ __CV_CUDA_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)(((DevPtr<T>*)this)->data) + y * step); }
111
+
112
+ __CV_CUDA_HOST_DEVICE__ T& operator ()(int y, int x) { return ptr(y)[x]; }
113
+ __CV_CUDA_HOST_DEVICE__ const T& operator ()(int y, int x) const { return ptr(y)[x]; }
114
+ };
115
+
116
+ template <typename T> struct PtrStepSz : public PtrStep<T>
117
+ {
118
+ __CV_CUDA_HOST_DEVICE__ PtrStepSz() : cols(0), rows(0) {}
119
+ __CV_CUDA_HOST_DEVICE__ PtrStepSz(int rows_, int cols_, T* data_, size_t step_)
120
+ : PtrStep<T>(data_, step_), cols(cols_), rows(rows_) {}
121
+
122
+ template <typename U>
123
+ explicit PtrStepSz(const PtrStepSz<U>& d) : PtrStep<T>((T*)d.data, d.step), cols(d.cols), rows(d.rows){}
124
+
125
+ int cols;
126
+ int rows;
127
+ };
128
+
129
+ typedef PtrStepSz<unsigned char> PtrStepSzb;
130
+ typedef PtrStepSz<unsigned short> PtrStepSzus;
131
+ typedef PtrStepSz<float> PtrStepSzf;
132
+ typedef PtrStepSz<int> PtrStepSzi;
133
+
134
+ typedef PtrStep<unsigned char> PtrStepb;
135
+ typedef PtrStep<unsigned short> PtrStepus;
136
+ typedef PtrStep<float> PtrStepf;
137
+ typedef PtrStep<int> PtrStepi;
138
+
139
+ }
140
+ }
141
+
142
+ //! @endcond
143
+
144
+ #endif /* OPENCV_CORE_CUDA_TYPES_HPP */
@@ -0,0 +1,381 @@
1
+ // This file is part of OpenCV project.
2
+ // It is subject to the license terms in the LICENSE file found in the top-level directory
3
+ // of this distribution and at http://opencv.org/license.html.
4
+
5
+ #if defined __OPENCV_BUILD \
6
+
7
+ #include "cv_cpu_config.h"
8
+ #include "cv_cpu_helper.h"
9
+
10
+ #ifdef CV_CPU_DISPATCH_MODE
11
+ #define CV_CPU_OPTIMIZATION_NAMESPACE __CV_CAT(opt_, CV_CPU_DISPATCH_MODE)
12
+ #define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace __CV_CAT(opt_, CV_CPU_DISPATCH_MODE) {
13
+ #define CV_CPU_OPTIMIZATION_NAMESPACE_END }
14
+ #else
15
+ #define CV_CPU_OPTIMIZATION_NAMESPACE cpu_baseline
16
+ #define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace cpu_baseline {
17
+ #define CV_CPU_OPTIMIZATION_NAMESPACE_END }
18
+ #define CV_CPU_BASELINE_MODE 1
19
+ #endif
20
+
21
+
22
+ #define __CV_CPU_DISPATCH_CHAIN_END(fn, args, mode, ...) /* done */
23
+ #define __CV_CPU_DISPATCH(fn, args, mode, ...) __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
24
+ #define __CV_CPU_DISPATCH_EXPAND(fn, args, ...) __CV_EXPAND(__CV_CPU_DISPATCH(fn, args, __VA_ARGS__))
25
+ #define CV_CPU_DISPATCH(fn, args, ...) __CV_CPU_DISPATCH_EXPAND(fn, args, __VA_ARGS__, END) // expand macros
26
+
27
+
28
+ #if defined CV_ENABLE_INTRINSICS \
29
+ && !defined CV_DISABLE_OPTIMIZATION \
30
+ && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */ \
31
+
32
+ #ifdef CV_CPU_COMPILE_SSE2
33
+ # include <emmintrin.h>
34
+ # define CV_MMX 1
35
+ # define CV_SSE 1
36
+ # define CV_SSE2 1
37
+ #endif
38
+ #ifdef CV_CPU_COMPILE_SSE3
39
+ # include <pmmintrin.h>
40
+ # define CV_SSE3 1
41
+ #endif
42
+ #ifdef CV_CPU_COMPILE_SSSE3
43
+ # include <tmmintrin.h>
44
+ # define CV_SSSE3 1
45
+ #endif
46
+ #ifdef CV_CPU_COMPILE_SSE4_1
47
+ # include <smmintrin.h>
48
+ # define CV_SSE4_1 1
49
+ #endif
50
+ #ifdef CV_CPU_COMPILE_SSE4_2
51
+ # include <nmmintrin.h>
52
+ # define CV_SSE4_2 1
53
+ #endif
54
+ #ifdef CV_CPU_COMPILE_POPCNT
55
+ # ifdef _MSC_VER
56
+ # include <nmmintrin.h>
57
+ # if defined(_M_X64)
58
+ # define CV_POPCNT_U64 (int)_mm_popcnt_u64
59
+ # endif
60
+ # define CV_POPCNT_U32 _mm_popcnt_u32
61
+ # else
62
+ # include <popcntintrin.h>
63
+ # if defined(__x86_64__)
64
+ # define CV_POPCNT_U64 __builtin_popcountll
65
+ # endif
66
+ # define CV_POPCNT_U32 __builtin_popcount
67
+ # endif
68
+ # define CV_POPCNT 1
69
+ #endif
70
+ #ifdef CV_CPU_COMPILE_AVX
71
+ # include <immintrin.h>
72
+ # define CV_AVX 1
73
+ #endif
74
+ #ifdef CV_CPU_COMPILE_FP16
75
+ # if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64)
76
+ # include <arm_neon.h>
77
+ # else
78
+ # include <immintrin.h>
79
+ # endif
80
+ # define CV_FP16 1
81
+ #endif
82
+ #ifdef CV_CPU_COMPILE_NEON_DOTPROD
83
+ # include <arm_neon.h>
84
+ # define CV_NEON_DOT 1
85
+ #endif
86
+ #ifdef CV_CPU_COMPILE_AVX2
87
+ # include <immintrin.h>
88
+ # define CV_AVX2 1
89
+ #endif
90
+ #ifdef CV_CPU_COMPILE_AVX_512F
91
+ # include <immintrin.h>
92
+ # define CV_AVX_512F 1
93
+ #endif
94
+ #ifdef CV_CPU_COMPILE_AVX512_COMMON
95
+ # define CV_AVX512_COMMON 1
96
+ # define CV_AVX_512CD 1
97
+ #endif
98
+ #ifdef CV_CPU_COMPILE_AVX512_KNL
99
+ # define CV_AVX512_KNL 1
100
+ # define CV_AVX_512ER 1
101
+ # define CV_AVX_512PF 1
102
+ #endif
103
+ #ifdef CV_CPU_COMPILE_AVX512_KNM
104
+ # define CV_AVX512_KNM 1
105
+ # define CV_AVX_5124FMAPS 1
106
+ # define CV_AVX_5124VNNIW 1
107
+ # define CV_AVX_512VPOPCNTDQ 1
108
+ #endif
109
+ #ifdef CV_CPU_COMPILE_AVX512_SKX
110
+ # define CV_AVX512_SKX 1
111
+ # define CV_AVX_512VL 1
112
+ # define CV_AVX_512BW 1
113
+ # define CV_AVX_512DQ 1
114
+ #endif
115
+ #ifdef CV_CPU_COMPILE_AVX512_CNL
116
+ # define CV_AVX512_CNL 1
117
+ # define CV_AVX_512IFMA 1
118
+ # define CV_AVX_512VBMI 1
119
+ #endif
120
+ #ifdef CV_CPU_COMPILE_AVX512_CLX
121
+ # define CV_AVX512_CLX 1
122
+ # define CV_AVX_512VNNI 1
123
+ #endif
124
+ #ifdef CV_CPU_COMPILE_AVX512_ICL
125
+ # define CV_AVX512_ICL 1
126
+ # undef CV_AVX_512IFMA
127
+ # define CV_AVX_512IFMA 1
128
+ # undef CV_AVX_512VBMI
129
+ # define CV_AVX_512VBMI 1
130
+ # undef CV_AVX_512VNNI
131
+ # define CV_AVX_512VNNI 1
132
+ # define CV_AVX_512VBMI2 1
133
+ # define CV_AVX_512BITALG 1
134
+ # define CV_AVX_512VPOPCNTDQ 1
135
+ #endif
136
+ #ifdef CV_CPU_COMPILE_FMA3
137
+ # define CV_FMA3 1
138
+ #endif
139
+
140
+ #if defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER))
141
+ # include <Intrin.h>
142
+ # include <arm_neon.h>
143
+ # define CV_NEON 1
144
+ #elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))
145
+ # include <arm_neon.h>
146
+ # define CV_NEON 1
147
+ #endif
148
+
149
+ #if defined(__riscv) && defined(__riscv_vector) && defined(__riscv_vector_071)
150
+ # include<riscv-vector.h>
151
+ # define CV_RVV071 1
152
+ #endif
153
+
154
+ #if defined(__ARM_NEON__) || defined(__aarch64__)
155
+ # include <arm_neon.h>
156
+ #endif
157
+
158
+ #ifdef CV_CPU_COMPILE_VSX
159
+ # include <altivec.h>
160
+ # undef vector
161
+ # undef pixel
162
+ # undef bool
163
+ # define CV_VSX 1
164
+ #endif
165
+
166
+ #ifdef CV_CPU_COMPILE_VSX3
167
+ # define CV_VSX3 1
168
+ #endif
169
+
170
+ #ifdef CV_CPU_COMPILE_MSA
171
+ # include "hal/msa_macros.h"
172
+ # define CV_MSA 1
173
+ #endif
174
+
175
+ #ifdef CV_CPU_COMPILE_LASX
176
+ # include <lasxintrin.h>
177
+ # define CV_LASX 1
178
+ #endif
179
+
180
+ #ifdef __EMSCRIPTEN__
181
+ # define CV_WASM_SIMD 1
182
+ # include <wasm_simd128.h>
183
+ #endif
184
+
185
+ #if defined CV_CPU_COMPILE_RVV
186
+ # define CV_RVV 1
187
+ # include <riscv_vector.h>
188
+ #endif
189
+
190
+ #endif // CV_ENABLE_INTRINSICS && !CV_DISABLE_OPTIMIZATION && !__CUDACC__
191
+
192
+ #if defined CV_CPU_COMPILE_AVX && !defined CV_CPU_BASELINE_COMPILE_AVX
193
+ struct VZeroUpperGuard {
194
+ #ifdef __GNUC__
195
+ __attribute__((always_inline))
196
+ #endif
197
+ inline VZeroUpperGuard() { _mm256_zeroupper(); }
198
+ #ifdef __GNUC__
199
+ __attribute__((always_inline))
200
+ #endif
201
+ inline ~VZeroUpperGuard() { _mm256_zeroupper(); }
202
+ };
203
+ #define __CV_AVX_GUARD VZeroUpperGuard __vzeroupper_guard; CV_UNUSED(__vzeroupper_guard);
204
+ #endif
205
+
206
+ #ifdef __CV_AVX_GUARD
207
+ #define CV_AVX_GUARD __CV_AVX_GUARD
208
+ #else
209
+ #define CV_AVX_GUARD
210
+ #endif
211
+
212
+ #endif // __OPENCV_BUILD
213
+
214
+
215
+
216
+ #if !defined __OPENCV_BUILD /* Compatibility code */ \
217
+ && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */
218
+ #if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)
219
+ # include <emmintrin.h>
220
+ # define CV_MMX 1
221
+ # define CV_SSE 1
222
+ # define CV_SSE2 1
223
+ #elif defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER))
224
+ # include <Intrin.h>
225
+ # include <arm_neon.h>
226
+ # define CV_NEON 1
227
+ #elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))
228
+ # include <arm_neon.h>
229
+ # define CV_NEON 1
230
+ #elif defined(__VSX__) && defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
231
+ # include <altivec.h>
232
+ # undef vector
233
+ # undef pixel
234
+ # undef bool
235
+ # define CV_VSX 1
236
+ #endif
237
+
238
+ #ifdef __F16C__
239
+ # include <immintrin.h>
240
+ # define CV_FP16 1
241
+ #endif
242
+
243
+ #endif // !__OPENCV_BUILD && !__CUDACC (Compatibility code)
244
+
245
+
246
+
247
+ #ifndef CV_MMX
248
+ # define CV_MMX 0
249
+ #endif
250
+ #ifndef CV_SSE
251
+ # define CV_SSE 0
252
+ #endif
253
+ #ifndef CV_SSE2
254
+ # define CV_SSE2 0
255
+ #endif
256
+ #ifndef CV_SSE3
257
+ # define CV_SSE3 0
258
+ #endif
259
+ #ifndef CV_SSSE3
260
+ # define CV_SSSE3 0
261
+ #endif
262
+ #ifndef CV_SSE4_1
263
+ # define CV_SSE4_1 0
264
+ #endif
265
+ #ifndef CV_SSE4_2
266
+ # define CV_SSE4_2 0
267
+ #endif
268
+ #ifndef CV_POPCNT
269
+ # define CV_POPCNT 0
270
+ #endif
271
+ #ifndef CV_AVX
272
+ # define CV_AVX 0
273
+ #endif
274
+ #ifndef CV_FP16
275
+ # define CV_FP16 0
276
+ #endif
277
+ #ifndef CV_AVX2
278
+ # define CV_AVX2 0
279
+ #endif
280
+ #ifndef CV_FMA3
281
+ # define CV_FMA3 0
282
+ #endif
283
+ #ifndef CV_AVX_512F
284
+ # define CV_AVX_512F 0
285
+ #endif
286
+ #ifndef CV_AVX_512BW
287
+ # define CV_AVX_512BW 0
288
+ #endif
289
+ #ifndef CV_AVX_512CD
290
+ # define CV_AVX_512CD 0
291
+ #endif
292
+ #ifndef CV_AVX_512DQ
293
+ # define CV_AVX_512DQ 0
294
+ #endif
295
+ #ifndef CV_AVX_512ER
296
+ # define CV_AVX_512ER 0
297
+ #endif
298
+ #ifndef CV_AVX_512IFMA
299
+ # define CV_AVX_512IFMA 0
300
+ #endif
301
+ #define CV_AVX_512IFMA512 CV_AVX_512IFMA // deprecated
302
+ #ifndef CV_AVX_512PF
303
+ # define CV_AVX_512PF 0
304
+ #endif
305
+ #ifndef CV_AVX_512VBMI
306
+ # define CV_AVX_512VBMI 0
307
+ #endif
308
+ #ifndef CV_AVX_512VL
309
+ # define CV_AVX_512VL 0
310
+ #endif
311
+ #ifndef CV_AVX_5124FMAPS
312
+ # define CV_AVX_5124FMAPS 0
313
+ #endif
314
+ #ifndef CV_AVX_5124VNNIW
315
+ # define CV_AVX_5124VNNIW 0
316
+ #endif
317
+ #ifndef CV_AVX_512VPOPCNTDQ
318
+ # define CV_AVX_512VPOPCNTDQ 0
319
+ #endif
320
+ #ifndef CV_AVX_512VNNI
321
+ # define CV_AVX_512VNNI 0
322
+ #endif
323
+ #ifndef CV_AVX_512VBMI2
324
+ # define CV_AVX_512VBMI2 0
325
+ #endif
326
+ #ifndef CV_AVX_512BITALG
327
+ # define CV_AVX_512BITALG 0
328
+ #endif
329
+ #ifndef CV_AVX512_COMMON
330
+ # define CV_AVX512_COMMON 0
331
+ #endif
332
+ #ifndef CV_AVX512_KNL
333
+ # define CV_AVX512_KNL 0
334
+ #endif
335
+ #ifndef CV_AVX512_KNM
336
+ # define CV_AVX512_KNM 0
337
+ #endif
338
+ #ifndef CV_AVX512_SKX
339
+ # define CV_AVX512_SKX 0
340
+ #endif
341
+ #ifndef CV_AVX512_CNL
342
+ # define CV_AVX512_CNL 0
343
+ #endif
344
+ #ifndef CV_AVX512_CLX
345
+ # define CV_AVX512_CLX 0
346
+ #endif
347
+ #ifndef CV_AVX512_ICL
348
+ # define CV_AVX512_ICL 0
349
+ #endif
350
+
351
+ #ifndef CV_NEON
352
+ # define CV_NEON 0
353
+ #endif
354
+
355
+ #ifndef CV_RVV071
356
+ # define CV_RVV071 0
357
+ #endif
358
+
359
+ #ifndef CV_VSX
360
+ # define CV_VSX 0
361
+ #endif
362
+
363
+ #ifndef CV_VSX3
364
+ # define CV_VSX3 0
365
+ #endif
366
+
367
+ #ifndef CV_MSA
368
+ # define CV_MSA 0
369
+ #endif
370
+
371
+ #ifndef CV_WASM_SIMD
372
+ # define CV_WASM_SIMD 0
373
+ #endif
374
+
375
+ #ifndef CV_RVV
376
+ # define CV_RVV 0
377
+ #endif
378
+
379
+ #ifndef CV_LASX
380
+ # define CV_LASX 0
381
+ #endif