vx_kernels.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. /*
  2. * Copyright (c) 2012-2017 The Khronos Group Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef _OPENVX_KERNELS_H_
  17. #define _OPENVX_KERNELS_H_
  18. /*!
  19. * \file
  20. * \brief The list of supported kernels in the OpenVX standard.
  21. */
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*!
  26. * \brief The standard list of available libraries
  27. * \ingroup group_kernel
  28. */
  29. enum vx_library_e {
  30. /*! \brief The base set of kernels as defined by Khronos. */
  31. VX_LIBRARY_KHR_BASE = 0x0,
  32. };
  33. /*!
  34. * \brief The standard list of available vision kernels.
  35. *
  36. * Each kernel listed here can be used with the <tt>\ref vxGetKernelByEnum</tt> call.
  37. * When programming the parameters, use
  38. * \arg <tt>\ref VX_INPUT</tt> for [in]
  39. * \arg <tt>\ref VX_OUTPUT</tt> for [out]
  40. * \arg <tt>\ref VX_BIDIRECTIONAL</tt> for [in,out]
  41. *
  42. * When programming the parameters, use
  43. * \arg <tt>\ref VX_TYPE_IMAGE</tt> for a <tt>\ref vx_image</tt> in the size field of <tt>\ref vxGetParameterByIndex</tt> or <tt>\ref vxSetParameterByIndex</tt> * \arg <tt>\ref VX_TYPE_ARRAY</tt> for a <tt>\ref vx_array</tt> in the size field of <tt>\ref vxGetParameterByIndex</tt> or <tt>\ref vxSetParameterByIndex</tt> * \arg or other appropriate types in \ref vx_type_e.
  44. * \ingroup group_kernel
  45. */
  46. enum vx_kernel_e {
  47. /*!
  48. * \brief The Color Space conversion kernel.
  49. * \details The conversions are based on the <tt>\ref vx_df_image_e</tt> code in the images.
  50. * \see group_vision_function_colorconvert
  51. */
  52. VX_KERNEL_COLOR_CONVERT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1,
  53. /*!
  54. * \brief The Generic Channel Extraction Kernel.
  55. * \details This kernel can remove individual color channels from an interleaved
  56. * or semi-planar, planar, sub-sampled planar image. A client could extract
  57. * a red channel from an interleaved RGB image or do a Luma extract from a
  58. * YUV format.
  59. * \see group_vision_function_channelextract
  60. */
  61. VX_KERNEL_CHANNEL_EXTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2,
  62. /*!
  63. * \brief The Generic Channel Combine Kernel.
  64. * \details This kernel combine multiple individual planes into a single
  65. * multiplanar image of the type specified in the output image.
  66. * \see group_vision_function_channelcombine
  67. */
  68. VX_KERNEL_CHANNEL_COMBINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3,
  69. /*! \brief The Sobel 3x3 Filter Kernel.
  70. * \see group_vision_function_sobel3x3
  71. */
  72. VX_KERNEL_SOBEL_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x4,
  73. /*!
  74. * \brief The Magnitude Kernel.
  75. * \details This kernel produces a magnitude plane from two input gradients.
  76. * \see group_vision_function_magnitude
  77. */
  78. VX_KERNEL_MAGNITUDE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x5,
  79. /*!
  80. * \brief The Phase Kernel.
  81. * \details This kernel produces a phase plane from two input gradients.
  82. * \see group_vision_function_phase
  83. */
  84. VX_KERNEL_PHASE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x6,
  85. /*!
  86. * \brief The Scale Image Kernel.
  87. * \details This kernel provides resizing of an input image to an output image.
  88. * The scaling factor is determined but the relative sizes of the input and
  89. * output.
  90. * \see group_vision_function_scale_image
  91. */
  92. VX_KERNEL_SCALE_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x7,
  93. /*! \brief The Table Lookup kernel
  94. * \see group_vision_function_lut
  95. */
  96. VX_KERNEL_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x8,
  97. /*! \brief The Histogram Kernel.
  98. * \see group_vision_function_histogram
  99. */
  100. VX_KERNEL_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x9,
  101. /*! \brief The Histogram Equalization Kernel.
  102. * \see group_vision_function_equalize_hist
  103. */
  104. VX_KERNEL_EQUALIZE_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xA,
  105. /*! \brief The Absolute Difference Kernel.
  106. * \see group_vision_function_absdiff
  107. */
  108. VX_KERNEL_ABSDIFF = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xB,
  109. /*! \brief The Mean and Standard Deviation Kernel.
  110. * \see group_vision_function_meanstddev
  111. */
  112. VX_KERNEL_MEAN_STDDEV = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xC,
  113. /*! \brief The Threshold Kernel.
  114. * \see group_vision_function_threshold
  115. */
  116. VX_KERNEL_THRESHOLD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xD,
  117. /*! \brief The Integral Image Kernel.
  118. * \see group_vision_function_integral_image
  119. */
  120. VX_KERNEL_INTEGRAL_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xE,
  121. /*! \brief The dilate kernel.
  122. * \see group_vision_function_dilate_image
  123. */
  124. VX_KERNEL_DILATE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xF,
  125. /*! \brief The erode kernel.
  126. * \see group_vision_function_erode_image
  127. */
  128. VX_KERNEL_ERODE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x10,
  129. /*! \brief The median image filter.
  130. * \see group_vision_function_median_image
  131. */
  132. VX_KERNEL_MEDIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x11,
  133. /*! \brief The box filter kernel.
  134. * \see group_vision_function_box_image
  135. */
  136. VX_KERNEL_BOX_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x12,
  137. /*! \brief The gaussian filter kernel.
  138. * \see group_vision_function_gaussian_image
  139. */
  140. VX_KERNEL_GAUSSIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x13,
  141. /*! \brief The custom convolution kernel.
  142. * \see group_vision_function_custom_convolution
  143. */
  144. VX_KERNEL_CUSTOM_CONVOLUTION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x14,
  145. /*! \brief The gaussian image pyramid kernel.
  146. * \see group_vision_function_gaussian_pyramid
  147. */
  148. VX_KERNEL_GAUSSIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x15,
  149. /*! \brief The accumulation kernel.
  150. * \see group_vision_function_accumulate
  151. */
  152. VX_KERNEL_ACCUMULATE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x16,
  153. /*! \brief The weigthed accumulation kernel.
  154. * \see group_vision_function_accumulate_weighted
  155. */
  156. VX_KERNEL_ACCUMULATE_WEIGHTED = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x17,
  157. /*! \brief The squared accumulation kernel.
  158. * \see group_vision_function_accumulate_square
  159. */
  160. VX_KERNEL_ACCUMULATE_SQUARE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x18,
  161. /*! \brief The min and max location kernel.
  162. * \see group_vision_function_minmaxloc
  163. */
  164. VX_KERNEL_MINMAXLOC = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x19,
  165. /*! \brief The bit-depth conversion kernel.
  166. * \see group_vision_function_convertdepth
  167. */
  168. VX_KERNEL_CONVERTDEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1A,
  169. /*! \brief The Canny Edge Detector.
  170. * \see group_vision_function_canny
  171. */
  172. VX_KERNEL_CANNY_EDGE_DETECTOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1B,
  173. /*! \brief The Bitwise And Kernel.
  174. * \see group_vision_function_and
  175. */
  176. VX_KERNEL_AND = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1C,
  177. /*! \brief The Bitwise Inclusive Or Kernel.
  178. * \see group_vision_function_or
  179. */
  180. VX_KERNEL_OR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1D,
  181. /*! \brief The Bitwise Exclusive Or Kernel.
  182. * \see group_vision_function_xor
  183. */
  184. VX_KERNEL_XOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1E,
  185. /*! \brief The Bitwise Not Kernel.
  186. * \see group_vision_function_not
  187. */
  188. VX_KERNEL_NOT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1F,
  189. /*! \brief The Pixelwise Multiplication Kernel.
  190. * \see group_vision_function_mult
  191. */
  192. VX_KERNEL_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x20,
  193. /*! \brief The Addition Kernel.
  194. * \see group_vision_function_add
  195. */
  196. VX_KERNEL_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x21,
  197. /*! \brief The Subtraction Kernel.
  198. * \see group_vision_function_sub
  199. */
  200. VX_KERNEL_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x22,
  201. /*! \brief The Warp Affine Kernel.
  202. * \see group_vision_function_warp_affine
  203. */
  204. VX_KERNEL_WARP_AFFINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x23,
  205. /*! \brief The Warp Perspective Kernel.
  206. * \see group_vision_function_warp_perspective
  207. */
  208. VX_KERNEL_WARP_PERSPECTIVE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x24,
  209. /*! \brief The Harris Corners Kernel.
  210. * \see group_vision_function_harris
  211. */
  212. VX_KERNEL_HARRIS_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x25,
  213. /*! \brief The FAST Corners Kernel.
  214. * \see group_vision_function_fast
  215. */
  216. VX_KERNEL_FAST_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x26,
  217. /*! \brief The Optical Flow Pyramid (LK) Kernel.
  218. * \see group_vision_function_opticalflowpyrlk
  219. */
  220. VX_KERNEL_OPTICAL_FLOW_PYR_LK = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x27,
  221. /*! \brief The Remap Kernel.
  222. * \see group_vision_function_remap
  223. */
  224. VX_KERNEL_REMAP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x28,
  225. /*! \brief The Half Scale Gaussian Kernel.
  226. * \see group_vision_function_scale_image
  227. */
  228. VX_KERNEL_HALFSCALE_GAUSSIAN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x29,
  229. VX_KERNEL_MAX_1_0, /*!< \internal Used for VX1.0 bounds checking in the conformance test. */
  230. /* kernel added in OpenVX 1.1 */
  231. /*! \brief The Laplacian Image Pyramid Kernel.
  232. * \see group_vision_function_laplacian_pyramid
  233. */
  234. VX_KERNEL_LAPLACIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2A,
  235. /*! \brief The Laplacian Pyramid Reconstruct Kernel.
  236. * \see group_vision_function_laplacian_pyramid
  237. */
  238. VX_KERNEL_LAPLACIAN_RECONSTRUCT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2B,
  239. /*! \brief The Non Linear Filter Kernel.
  240. * \see group_vision_function_nonlinear_filter
  241. */
  242. VX_KERNEL_NON_LINEAR_FILTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2C,
  243. VX_KERNEL_MAX_1_1, /*!< \internal Used for VX1.1 bounds checking in the conformance test. */
  244. /* kernel added in OpenVX 1.2 */
  245. /*! \brief The Match Template Kernel.
  246. * \see group_vision_match_template
  247. */
  248. VX_KERNEL_MATCH_TEMPLATE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2D,
  249. /*! \brief The LBP Kernel.
  250. * \see group_lbp
  251. */
  252. VX_KERNEL_LBP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2E,
  253. /*! \brief The hough lines probability Kernel.
  254. * \see group_vision_hough_lines_p
  255. */
  256. VX_KERNEL_HOUGH_LINES_P = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2F,
  257. /*! \brief The tensor multiply Kernel.
  258. * \see group_vision_function_tensor_multiply
  259. */
  260. VX_KERNEL_TENSOR_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x30,
  261. /*! \brief The tensor add Kernel.
  262. * \see group_vision_function_tensor_add
  263. */
  264. VX_KERNEL_TENSOR_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x31,
  265. /*! \brief The tensor subtract Kernel.
  266. * \see group_vision_function_tensor_subtract
  267. */
  268. VX_KERNEL_TENSOR_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x32,
  269. /*! \brief The tensor table look up Kernel.
  270. * \see group_vision_function_tensor_tablelookup
  271. */
  272. VX_KERNEL_TENSOR_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x33,
  273. /*! \brief The tensor transpose Kernel.
  274. * \see group_vision_function_tensor_transpose
  275. */
  276. VX_KERNEL_TENSOR_TRANSPOSE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x34,
  277. /*! \brief The tensor convert depth Kernel.
  278. * \see group_vision_function_tensor_convert_depth
  279. */
  280. VX_KERNEL_TENSOR_CONVERT_DEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x35,
  281. /*! \brief The tensor matrix multiply Kernel.
  282. * \see group_vision_function_tensor_matrix_multiply
  283. */
  284. VX_KERNEL_TENSOR_MATRIX_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x36,
  285. /*! \brief The data object copy kernel.
  286. * \see group_vision_function_copy
  287. */
  288. VX_KERNEL_COPY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x37,
  289. /*! \brief The non-max suppression kernel.
  290. * \see group_vision_function_nms
  291. */
  292. VX_KERNEL_NON_MAX_SUPPRESSION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x38,
  293. /*! \brief The scalar operation kernel.
  294. * \see group_control_flow
  295. */
  296. VX_KERNEL_SCALAR_OPERATION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x39,
  297. /*! \brief The HOG features kernel.
  298. * \see group_vision_function_hog
  299. */
  300. VX_KERNEL_HOG_FEATURES = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3A,
  301. /*! \brief The HOG Cells kernel.
  302. * \see group_vision_function_hog
  303. */
  304. VX_KERNEL_HOG_CELLS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3B,
  305. /*! \brief The bilateral filter kernel.
  306. * \see group_vision_function_bilateral_filter
  307. */
  308. VX_KERNEL_BILATERAL_FILTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3C,
  309. /*! \brief The select kernel.
  310. * \see group_control_flow
  311. */
  312. VX_KERNEL_SELECT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3D,
  313. /* insert new kernels here */
  314. VX_KERNEL_MAX_1_2, /*!< \internal Used for VX1.2 bounds checking in the conformance test. */
  315. /*! \brief The max kernel.
  316. * \see group_vision_function_max
  317. */
  318. VX_KERNEL_MAX = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3E,
  319. /*! \brief The min kernel.
  320. * \see group_vision_function_min
  321. */
  322. VX_KERNEL_MIN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3F,
  323. };
  324. #ifdef __cplusplus
  325. }
  326. #endif
  327. #endif /* _OPEN_VISION_LIBRARY_KERNELS_H_ */